Skip to content

describe_resource

describe_resource(
    organization_id: OrganizationId,
    resource_id: EntityIdentifier,
    *,
    config_overrides: Optional[WorkMailClientConfig] = None,
) -> DescribeResourceResponse

Returns the data available for the resource.

Parameters:

  • organization_id (OrganizationId) –

    The identifier associated with the organization for which the resource is described.

  • resource_id (EntityIdentifier) –

    The identifier of the resource to be described.

    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

Raises:

Source code in docs_src/capo_workmail/_services/work_mail.py
def describe_resource(
    self,
    organization_id: "capo_workmail.types.organization_id.OrganizationId",
    resource_id: "capo_workmail.types.entity_identifier.EntityIdentifier",
    *,
    config_overrides: Optional[WorkMailClientConfig] = None,
) -> "capo_workmail.types.describe_resource_response.DescribeResourceResponse":
    """<p>Returns the data available for the resource.</p>

    Args:
        organization_id: <p>The identifier associated with the organization for which the resource is described.</p>
        resource_id: <p>The identifier of the resource to be described.</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>

    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.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.describe_resource_request.DescribeResourceRequest]",
    ) -> OperationResponse[
        "capo_workmail.types.describe_resource_response.DescribeResourceResponse"
    ]:
        import capo_workmail._operations.work_mail_service.describe_resource

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

    def _redact_output(
        output: "capo_workmail.types.describe_resource_response.DescribeResourceResponse",
    ) -> dict[str, Any]:
        import capo_workmail.types.describe_resource_response

        return capo_workmail.types.describe_resource_response.redact_sensitive(
            output
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging("DescribeResource", redact_output=_redact_output),
    )
    input_: capo_workmail.types.describe_resource_request.DescribeResourceRequest = {
        "organization_id": organization_id,
        "resource_id": resource_id,
    }

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