diff --git a/src/gradient_labs/_handoff_target_delete.py b/src/gradient_labs/_handoff_target_delete.py new file mode 100644 index 0000000..b28f5db --- /dev/null +++ b/src/gradient_labs/_handoff_target_delete.py @@ -0,0 +1,21 @@ +from dataclasses import dataclass +from dataclasses_json import dataclass_json + +from ._http_client import HttpClient + + +@dataclass_json +@dataclass(frozen=True) +class DeleteHandOffTargetParams: + # id is your identifier of choice for this hand-off target. Can be anything consisting + # of letters, numbers, or any of the following characters: `_` `-` `+` `=`. + id: str + + +def delete_hand_off_target( + *, client: HttpClient, params: DeleteHandOffTargetParams +) -> None: + _ = client.delete( + path="hand-off-targets", + body=params.to_dict(), + ) diff --git a/src/gradient_labs/client.py b/src/gradient_labs/client.py index bac394c..5302dd4 100644 --- a/src/gradient_labs/client.py +++ b/src/gradient_labs/client.py @@ -18,6 +18,7 @@ from ._handoff_target_upsert import upsert_hand_off_target, UpsertHandOffTargetParams from ._handoff_targets import list_handoff_targets, HandOffTargets +from ._handoff_target_delete import delete_hand_off_target, DeleteHandOffTargetParams from .procedure import Procedure from ._procedure_read import read_procedure @@ -227,6 +228,16 @@ def upsert_hand_off_target(self, *, params: UpsertHandOffTargetParams) -> None: params=params, ) + def delete_hand_off_target(self, *, params: DeleteHandOffTargetParams) -> None: + """delete_hand_off_target deletes a hand-off target. This will fail if the hand off target + is in use - either in a procedure, or in an intent. + + Note: requires a `Management` API key.""" + delete_hand_off_target( + client=self.http_client, + params=params, + ) + def list_handoff_targets(self) -> HandOffTargets: """list_handoff_targets returns all of your hand off targets.