Skip to content

disassociate_delegate_from_resource

disassociate_delegate_from_resource(
    organization_id: OrganizationId,
    resource_id: EntityIdentifier,
    entity_id: EntityIdentifier,
    *,
    config_overrides: Optional[WorkMailClientConfig] = None,
) -> DisassociateDelegateFromResourceResponse

Removes a member from the resource's set of delegates.

Parameters:

  • organization_id (OrganizationId) –

    The identifier for the organization under which the resource exists.

  • resource_id (EntityIdentifier) –

    The identifier of the resource from which delegates' set members are removed.

    The identifier can accept ResourceId, Resourcename, or email. The following identity formats are available:

    • Resource ID: r-0123456789a0123456789b0123456789

    • Email address: [email protected]

    • Resource name: resource

  • entity_id (EntityIdentifier) –

    The identifier for the member (user, group) to be removed from the resource's delegates.

    The entity ID can accept UserId or GroupID, Username or Groupname, or email.

    • Entity: 12345678-1234-1234-1234-123456789012 or S-1-1-12-1234567890-123456789-123456789-1234

    • Email address: [email protected]

    • Entity: entity

Raises:

  • EntityNotFoundException –

    The identifier supplied for the user, group, or resource does not exist in your organization.

  • EntityStateException –

    You are performing an operation on a user, group, or resource that isn't in the expected state, such as trying to delete an active user.

  • InvalidParameterException –

    One or more of the input parameters don't match the service's restrictions.

  • OrganizationNotFoundException –

    An operation received a valid organization identifier that either doesn't belong or exist in the system.

  • OrganizationStateException –

    The organization must have a valid state to perform certain operations on the organization or its members.

  • UnsupportedOperationException –

    You can't perform a write operation against a read-only directory.

  • UnknownServiceError –

    The service returned an error code this client does not model.

Source code in docs_src/capo_workmail/_services/work_mail.py
def disassociate_delegate_from_resource(
    self,
    organization_id: "capo_workmail.types.organization_id.OrganizationId",
    resource_id: "capo_workmail.types.entity_identifier.EntityIdentifier",
    entity_id: "capo_workmail.types.entity_identifier.EntityIdentifier",
    *,
    config_overrides: Optional[WorkMailClientConfig] = None,
) -> "capo_workmail.types.disassociate_delegate_from_resource_response.DisassociateDelegateFromResourceResponse":
    """<p>Removes a member from the resource's set of delegates.</p>

    Args:
        organization_id: <p>The identifier for the organization under which the resource exists.</p>
        resource_id: <p>The identifier of the resource from which delegates' set members are removed. </p> <p>The identifier can accept <i>ResourceId</i>, <i>Resourcename</i>, or <i>email</i>. The following identity formats are available:</p> <ul> <li> <p>Resource ID: r-0123456789a0123456789b0123456789</p> </li> <li> <p>Email address: [email protected]</p> </li> <li> <p>Resource name: resource</p> </li> </ul>
        entity_id: <p>The identifier for the member (user, group) to be removed from the resource's delegates.</p> <p>The entity ID can accept <i>UserId or GroupID</i>, <i>Username or Groupname</i>, or <i>email</i>.</p> <ul> <li> <p>Entity: 12345678-1234-1234-1234-123456789012 or S-1-1-12-1234567890-123456789-123456789-1234</p> </li> <li> <p>Email address: [email protected]</p> </li> <li> <p>Entity: entity</p> </li> </ul>

    Raises:
        capo_workmail.errors.entity_not_found_exception.EntityNotFoundException: <p>The identifier supplied for the user, group, or resource does not exist in your organization.</p>
        capo_workmail.errors.entity_state_exception.EntityStateException: <p>You are performing an operation on a user, group, or resource that isn't in the expected state, such as trying to delete an active user.</p>
        capo_workmail.errors.invalid_parameter_exception.InvalidParameterException: <p>One or more of the input parameters don't match the service's restrictions.</p>
        capo_workmail.errors.organization_not_found_exception.OrganizationNotFoundException: <p>An operation received a valid organization identifier that either doesn't belong or exist in the system.</p>
        capo_workmail.errors.organization_state_exception.OrganizationStateException: <p>The organization must have a valid state to perform certain operations on the organization or its members.</p>
        capo_workmail.errors.unsupported_operation_exception.UnsupportedOperationException: <p>You can't perform a write operation against a read-only directory.</p>
        capo_workmail.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_workmail.types.disassociate_delegate_from_resource_request.DisassociateDelegateFromResourceRequest]",
    ) -> OperationResponse[
        "capo_workmail.types.disassociate_delegate_from_resource_response.DisassociateDelegateFromResourceResponse"
    ]:
        import capo_workmail._operations.work_mail_service.disassociate_delegate_from_resource

        output, http_response = (
            capo_workmail._operations.work_mail_service.disassociate_delegate_from_resource.disassociate_delegate_from_resource(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("DisassociateDelegateFromResource")
    )
    input_: capo_workmail.types.disassociate_delegate_from_resource_request.DisassociateDelegateFromResourceRequest = {
        "organization_id": organization_id,
        "resource_id": resource_id,
        "entity_id": entity_id,
    }

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output