Skip to content

describe_users

describe_users(
    *,
    config_overrides: Optional[WorkDocsClientConfig] = None,
    authentication_token: Optional[AuthenticationHeaderType] = None,
    organization_id: Optional[IdType] = None,
    user_ids: Optional[UserIdsType] = None,
    query: Optional[SearchQueryType] = None,
    include: Optional[UserFilterType] = None,
    order: Optional[OrderType] = None,
    sort: Optional[UserSortType] = None,
    marker: Optional[PageMarkerType] = None,
    limit: Optional[LimitType] = None,
    fields: Optional[FieldNamesType] = None,
) -> DescribeUsersResponse

Describes the specified users. You can describe all users or filter the results (for example, by status or organization).

By default, Amazon WorkDocs returns the first 24 active or pending users. If there are more results, the response includes a marker that you can use to request the next set of results.

Parameters:

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

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

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

    The ID of the organization.

  • user_ids (Optional[UserIdsType], default: None ) –

    The IDs of the users.

  • query (Optional[SearchQueryType], default: None ) –

    A query to filter users by user name. Remember the following about the Userids and Query parameters:

    • If you don't use either parameter, the API returns a paginated list of all users on the site.

    • If you use both parameters, the API ignores the Query parameter.

    • The Userid parameter only returns user names that match a corresponding user ID.

    • The Query parameter runs a "prefix" search for users by the GivenName, SurName, or UserName fields included in a CreateUser API call. For example, querying on Ma returns Márcia Oliveira, María García, and Mateo Jackson. If you use multiple characters, the API only returns data that matches all characters. For example, querying on Ma J only returns Mateo Jackson.

  • include (Optional[UserFilterType], default: None ) –

    The state of the users. Specify "ALL" to include inactive users.

  • order (Optional[OrderType], default: None ) –

    The order for the results.

  • sort (Optional[UserSortType], default: None ) –

    The sorting criteria.

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

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

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

    The maximum number of items to return.

  • fields (Optional[FieldNamesType], default: None ) –

    A comma-separated list of values. Specify "STORAGE_METADATA" to include the user storage quota and utilization information.

Raises:

Source code in docs_src/capo_workdocs/_services/work_docs.py
def describe_users(
    self,
    *,
    config_overrides: Optional[WorkDocsClientConfig] = None,
    authentication_token: Optional[
        "capo_workdocs.types.authentication_header_type.AuthenticationHeaderType"
    ] = None,
    organization_id: Optional["capo_workdocs.types.id_type.IdType"] = None,
    user_ids: Optional["capo_workdocs.types.user_ids_type.UserIdsType"] = None,
    query: Optional["capo_workdocs.types.search_query_type.SearchQueryType"] = None,
    include: Optional["capo_workdocs.types.user_filter_type.UserFilterType"] = None,
    order: Optional["capo_workdocs.types.order_type.OrderType"] = None,
    sort: Optional["capo_workdocs.types.user_sort_type.UserSortType"] = None,
    marker: Optional["capo_workdocs.types.page_marker_type.PageMarkerType"] = None,
    limit: Optional["capo_workdocs.types.limit_type.LimitType"] = None,
    fields: Optional["capo_workdocs.types.field_names_type.FieldNamesType"] = None,
) -> "capo_workdocs.types.describe_users_response.DescribeUsersResponse":
    """<p>Describes the specified users. You can describe all users or filter the results (for example, by status or organization).</p> <p>By default, Amazon WorkDocs returns the first 24 active or pending users. If there are more results, the response includes a marker that you can use to request the next set of results.</p>

    Args:
        authentication_token: <p>Amazon WorkDocs authentication token. Not required when using Amazon Web Services administrator credentials to access the API.</p>
        organization_id: <p>The ID of the organization.</p>
        user_ids: <p>The IDs of the users.</p>
        query: <p>A query to filter users by user name. Remember the following about the <code>Userids</code> and <code>Query</code> parameters:</p> <ul> <li> <p>If you don't use either parameter, the API returns a paginated list of all users on the site.</p> </li> <li> <p>If you use both parameters, the API ignores the <code>Query</code> parameter.</p> </li> <li> <p>The <code>Userid</code> parameter only returns user names that match a corresponding user ID.</p> </li> <li> <p>The <code>Query</code> parameter runs a "prefix" search for users by the <code>GivenName</code>, <code>SurName</code>, or <code>UserName</code> fields included in a <a href="https://docs.aws.amazon.com/workdocs/latest/APIReference/API_CreateUser.html">CreateUser</a> API call. For example, querying on <code>Ma</code> returns Márcia Oliveira, María García, and Mateo Jackson. If you use multiple characters, the API only returns data that matches all characters. For example, querying on <code>Ma J</code> only returns Mateo Jackson.</p> </li> </ul>
        include: <p>The state of the users. Specify "ALL" to include inactive users.</p>
        order: <p>The order for the results.</p>
        sort: <p>The sorting criteria.</p>
        marker: <p>The marker for the next set of results. (You received this marker from a previous call.)</p>
        limit: <p>The maximum number of items to return.</p>
        fields: <p>A comma-separated list of values. Specify "STORAGE_METADATA" to include the user storage quota and utilization information.</p>

    Raises:
        capo_workdocs.errors.entity_not_exists_exception.EntityNotExistsException: <p>The resource does not exist.</p>
        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.requested_entity_too_large_exception.RequestedEntityTooLargeException: <p>The response is too large to return. The request must include a filter to reduce the size of the response.</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_users_request.DescribeUsersRequest]",
    ) -> OperationResponse[
        "capo_workdocs.types.describe_users_response.DescribeUsersResponse"
    ]:
        import capo_workdocs._operations.aws_gorilla_boy_service.describe_users

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

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

        return capo_workdocs.types.describe_users_request.redact_sensitive(input_)

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

        return capo_workdocs.types.describe_users_response.redact_sensitive(output)

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging(
            "DescribeUsers",
            redact_input=_redact_input,
            redact_output=_redact_output,
        ),
    )
    input_: capo_workdocs.types.describe_users_request.DescribeUsersRequest = {}
    if authentication_token is not None:
        input_["authentication_token"] = authentication_token
    if organization_id is not None:
        input_["organization_id"] = organization_id
    if user_ids is not None:
        input_["user_ids"] = user_ids
    if query is not None:
        input_["query"] = query
    if include is not None:
        input_["include"] = include
    if order is not None:
        input_["order"] = order
    if sort is not None:
        input_["sort"] = sort
    if marker is not None:
        input_["marker"] = marker
    if limit is not None:
        input_["limit"] = limit
    if fields is not None:
        input_["fields"] = fields

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