Skip to content

describe_resource_permissions

describe_resource_permissions(
    resource_id: ResourceIdType,
    *,
    config_overrides: Optional[WorkDocsClientConfig] = None,
    authentication_token: Optional[AuthenticationHeaderType] = None,
    principal_id: Optional[IdType] = None,
    limit: Optional[LimitType] = None,
    marker: Optional[PageMarkerType] = None,
) -> DescribeResourcePermissionsResponse

Describes the permissions of a specified resource.

Parameters:

  • authentication_token (Optional[AuthenticationHeaderType], default: None ) –

    Amazon WorkDocs authentication token. Not required when using Amazon Web Services administrator credentials to access the API.

  • resource_id (ResourceIdType) –

    The ID of the resource.

  • principal_id (Optional[IdType], default: None ) –

    The ID of the principal to filter permissions by.

  • limit (Optional[LimitType], default: None ) –

    The maximum number of items to return with this call.

  • marker (Optional[PageMarkerType], default: None ) –

    The marker for the next set of results. (You received this marker from a previous call)

Raises:

Source code in docs_src/capo_workdocs/_services/work_docs.py
def describe_resource_permissions(
    self,
    resource_id: "capo_workdocs.types.resource_id_type.ResourceIdType",
    *,
    config_overrides: Optional[WorkDocsClientConfig] = None,
    authentication_token: Optional[
        "capo_workdocs.types.authentication_header_type.AuthenticationHeaderType"
    ] = None,
    principal_id: Optional["capo_workdocs.types.id_type.IdType"] = None,
    limit: Optional["capo_workdocs.types.limit_type.LimitType"] = None,
    marker: Optional["capo_workdocs.types.page_marker_type.PageMarkerType"] = None,
) -> "capo_workdocs.types.describe_resource_permissions_response.DescribeResourcePermissionsResponse":
    """<p>Describes the permissions of a specified resource.</p>

    Args:
        authentication_token: <p>Amazon WorkDocs authentication token. Not required when using Amazon Web Services administrator credentials to access the API.</p>
        resource_id: <p>The ID of the resource.</p>
        principal_id: <p>The ID of the principal to filter permissions by.</p>
        limit: <p>The maximum number of items to return with this call.</p>
        marker: <p>The marker for the next set of results. (You received this marker from a previous call)</p>

    Raises:
        capo_workdocs.errors.failed_dependency_exception.FailedDependencyException: <p>The Directory Service cannot reach an on-premises instance. Or a dependency under the control of the organization is failing, such as a connected Active Directory.</p>
        capo_workdocs.errors.invalid_argument_exception.InvalidArgumentException: <p>The pagination marker or limit fields are not valid.</p>
        capo_workdocs.errors.service_unavailable_exception.ServiceUnavailableException: <p>One or more of the dependencies is unavailable.</p>
        capo_workdocs.errors.unauthorized_operation_exception.UnauthorizedOperationException: <p>The operation is not permitted.</p>
        capo_workdocs.errors.unauthorized_resource_access_exception.UnauthorizedResourceAccessException: <p>The caller does not have access to perform the action on the resource.</p>
        capo_workdocs.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_workdocs.types.describe_resource_permissions_request.DescribeResourcePermissionsRequest]",
    ) -> OperationResponse[
        "capo_workdocs.types.describe_resource_permissions_response.DescribeResourcePermissionsResponse"
    ]:
        import capo_workdocs._operations.aws_gorilla_boy_service.describe_resource_permissions

        output, http_response = (
            capo_workdocs._operations.aws_gorilla_boy_service.describe_resource_permissions.describe_resource_permissions(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    def _redact_input(
        input_: "capo_workdocs.types.describe_resource_permissions_request.DescribeResourcePermissionsRequest",
    ) -> dict[str, Any]:
        import capo_workdocs.types.describe_resource_permissions_request

        return capo_workdocs.types.describe_resource_permissions_request.redact_sensitive(
            input_
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging("DescribeResourcePermissions", redact_input=_redact_input),
    )
    input_: capo_workdocs.types.describe_resource_permissions_request.DescribeResourcePermissionsRequest = {
        "resource_id": resource_id
    }
    if authentication_token is not None:
        input_["authentication_token"] = authentication_token
    if principal_id is not None:
        input_["principal_id"] = principal_id
    if limit is not None:
        input_["limit"] = limit
    if marker is not None:
        input_["marker"] = marker

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