Skip to main content

ShareResponse

Represents the result of a share operation in the Datagrok API. This class encapsulates the status of a share request, including successful shares, already shared items, and failures.

Attributes

NameTypeDescription
datadictDictionary containing share response data from the Datagrok API. Expected keys: - 'status' (str): The status of the operation, one of: * 'success' — All items were shared successfully. * 'partial_success' — Some items were shared successfully, some failed. * 'failed' — No items were shared. - 'shared' (list): Items that were successfully shared. - 'alreadyShared' (list): Items that were already shared before the request. - 'failed' (list): Items that failed to be shared.
statusstrThe overall status of the share operation.
sharedlistItems successfully shared.
already_sharedlistItems already shared before the request.
failedlistItems that failed to be shared.

Methods

__init__()

is_success()

Returns True if all items were successfully shared.

is_partial()

Returns True if the operation had both successes and failures.

is_failed()

Returns True if the operation failed entirely

raise_for_failure()

Raises a RuntimeError if the operation failed.