Skip to content

get_resources

get_resources(
    *,
    config_overrides: Optional[WorkDocsClientConfig] = None,
    authentication_token: Optional[AuthenticationHeaderType] = None,
    user_id: Optional[IdType] = None,
    collection_type: Optional[ResourceCollectionType] = None,
    limit: Optional[LimitType] = None,
    marker: Optional[PageMarkerType] = None,
) -> GetResourcesResponse

Retrieves a collection of resources, including folders and documents. The only CollectionType supported is SHARED_WITH_ME.

Parameters:

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

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

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

    The user ID for the resource collection. This is a required field for accessing the API operation using IAM credentials.

  • collection_type (Optional[ResourceCollectionType], default: None ) –

    The collection type.

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

    The maximum number of resources to return.

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

    The marker for the next set of results. This marker was received from a previous call.

Raises:

Source code in docs_src/capo_workdocs/_services/work_docs.py
def get_resources(
    self,
    *,
    config_overrides: Optional[WorkDocsClientConfig] = None,
    authentication_token: Optional[
        "capo_workdocs.types.authentication_header_type.AuthenticationHeaderType"
    ] = None,
    user_id: Optional["capo_workdocs.types.id_type.IdType"] = None,
    collection_type: Optional[
        "capo_workdocs.types.resource_collection_type.ResourceCollectionType"
    ] = None,
    limit: Optional["capo_workdocs.types.limit_type.LimitType"] = None,
    marker: Optional["capo_workdocs.types.page_marker_type.PageMarkerType"] = None,
) -> "capo_workdocs.types.get_resources_response.GetResourcesResponse":
    """<p>Retrieves a collection of resources, including folders and documents. The only <code>CollectionType</code> supported is <code>SHARED_WITH_ME</code>.</p>

    Args:
        authentication_token: <p>The Amazon WorkDocs authentication token. Not required when using Amazon Web Services administrator credentials to access the API.</p>
        user_id: <p>The user ID for the resource collection. This is a required field for accessing the API operation using IAM credentials.</p>
        collection_type: <p>The collection type.</p>
        limit: <p>The maximum number of resources to return.</p>
        marker: <p>The marker for the next set of results. This marker was received 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.get_resources_request.GetResourcesRequest]",
    ) -> OperationResponse[
        "capo_workdocs.types.get_resources_response.GetResourcesResponse"
    ]:
        import capo_workdocs._operations.aws_gorilla_boy_service.get_resources

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

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

        return capo_workdocs.types.get_resources_request.redact_sensitive(input_)

    def _redact_output(
        output: "capo_workdocs.types.get_resources_response.GetResourcesResponse",
    ) -> dict[str, Any]:
        import capo_workdocs.types.get_resources_response

        return capo_workdocs.types.get_resources_response.redact_sensitive(output)

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging(
            "GetResources", redact_input=_redact_input, redact_output=_redact_output
        ),
    )
    input_: capo_workdocs.types.get_resources_request.GetResourcesRequest = {}
    if authentication_token is not None:
        input_["authentication_token"] = authentication_token
    if user_id is not None:
        input_["user_id"] = user_id
    if collection_type is not None:
        input_["collection_type"] = collection_type
    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