Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions src/gradient_labs/_handoff_target_delete.py
Original file line number Diff line number Diff line change
@@ -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(),
)
11 changes: 11 additions & 0 deletions src/gradient_labs/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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.

Expand Down