Skip to content

list_groups

list_groups(
    identity_store_id: IdentityStoreId,
    *,
    config_overrides: Optional[identitystoreClientConfig] = None,
    max_results: Optional[MaxResults] = None,
    next_token: Optional[NextToken] = None,
    filters: Optional[Filters] = None,
) -> ListGroupsResponse

Lists all groups in the identity store. Returns a paginated list of complete Group objects. Filtering for a Group by the DisplayName attribute is deprecated. Instead, use the GetGroupId API action.

If you have access to a member account, you can use this API operation from the member account. For more information, see Limiting access to the identity store from member accounts in the IAM Identity Center User Guide.

Parameters:

  • identity_store_id (IdentityStoreId) –

    The globally unique identifier for the identity store, such as d-1234567890. In this example, d- is a fixed prefix, and 1234567890 is a randomly generated string that contains numbers and lower case letters. This value is generated at the time that a new identity store is created.

    You can specify the identity store by ID or by Amazon Resource Name (ARN). For example, identity store ID d-1234567890 or identity store ARN arn:aws:identitystore::111122223333:identitystore/d-1234567890.

  • max_results (Optional[MaxResults], default: None ) –

    The maximum number of results to be returned per request. This parameter is used in all List requests to specify how many results to return in one page.

  • next_token (Optional[NextToken], default: None ) –

    The pagination token used for the ListUsers and ListGroups API operations. This value is generated by the identity store service. It is returned in the API response if the total results are more than the size of one page. This token is also returned when it is used in the API request to retrieve the next page of results.

  • filters (Optional[Filters], default: None ) –

    A list of Filter objects, which is used in the ListUsers and ListGroups requests.

Raises:

Source code in docs_src/capo_identitystore/_services/identitystore.py
def list_groups(
    self,
    identity_store_id: "capo_identitystore.types.identity_store_id.IdentityStoreId",
    *,
    config_overrides: Optional[identitystoreClientConfig] = None,
    max_results: Optional["capo_identitystore.types.max_results.MaxResults"] = None,
    next_token: Optional["capo_identitystore.types.next_token.NextToken"] = None,
    filters: Optional["capo_identitystore.types.filters.Filters"] = None,
) -> "capo_identitystore.types.list_groups_response.ListGroupsResponse":
    """<p>Lists all groups in the identity store. Returns a paginated list of complete <code>Group</code> objects. Filtering for a <code>Group</code> by the <code>DisplayName</code> attribute is deprecated. Instead, use the <code>GetGroupId</code> API action.</p> <note> <p>If you have access to a member account, you can use this API operation from the member account. For more information, see <a href="https://docs.aws.amazon.com/singlesignon/latest/userguide/manage-your-accounts.html#limiting-access-from-member-accounts">Limiting access to the identity store from member accounts</a> in the <i> IAM Identity Center User Guide</i>.</p> </note>

    Args:
        identity_store_id: <p>The globally unique identifier for the identity store, such as <code>d-1234567890</code>. In this example, <code>d-</code> is a fixed prefix, and <code>1234567890</code> is a randomly generated string that contains numbers and lower case letters. This value is generated at the time that a new identity store is created.</p> <p>You can specify the identity store by ID or by Amazon Resource Name (ARN). For example, identity store ID <code>d-1234567890</code> or identity store ARN <code>arn:aws:identitystore::111122223333:identitystore/d-1234567890</code>.</p>
        max_results: <p>The maximum number of results to be returned per request. This parameter is used in all <code>List</code> requests to specify how many results to return in one page.</p>
        next_token: <p>The pagination token used for the <code>ListUsers</code> and <code>ListGroups</code> API operations. This value is generated by the identity store service. It is returned in the API response if the total results are more than the size of one page. This token is also returned when it is used in the API request to retrieve the next page of results.</p>
        filters: <p>A list of <code>Filter</code> objects, which is used in the <code>ListUsers</code> and <code> ListGroups</code> requests.</p>

    Raises:
        capo_identitystore.errors.access_denied_exception.AccessDeniedException: <p>You do not have sufficient access to perform this action.</p>
        capo_identitystore.errors.internal_server_exception.InternalServerException: <p>The request processing has failed because of an unknown error, exception or failure with an internal server.</p>
        capo_identitystore.errors.throttling_exception.ThrottlingException: <p>Indicates that the principal has crossed the throttling limits of the API operations.</p>
        capo_identitystore.errors.resource_not_found_exception.ResourceNotFoundException: <p>Indicates that a requested resource is not found.</p>
        capo_identitystore.errors.validation_exception.ValidationException: <p>The request failed because it contains a syntax error.</p>
        capo_identitystore.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_identitystore.types.list_groups_request.ListGroupsRequest]",
    ) -> OperationResponse[
        "capo_identitystore.types.list_groups_response.ListGroupsResponse"
    ]:
        import capo_identitystore._operations.aws_identity_store.list_groups

        output, http_response = (
            capo_identitystore._operations.aws_identity_store.list_groups.list_groups(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    def _redact_input(
        input_: "capo_identitystore.types.list_groups_request.ListGroupsRequest",
    ) -> dict[str, Any]:
        import capo_identitystore.types.list_groups_request

        return capo_identitystore.types.list_groups_request.redact_sensitive(input_)

    def _redact_output(
        output: "capo_identitystore.types.list_groups_response.ListGroupsResponse",
    ) -> dict[str, Any]:
        import capo_identitystore.types.list_groups_response

        return capo_identitystore.types.list_groups_response.redact_sensitive(
            output
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging(
            "ListGroups", redact_input=_redact_input, redact_output=_redact_output
        ),
    )
    input_: capo_identitystore.types.list_groups_request.ListGroupsRequest = {
        "identity_store_id": identity_store_id
    }
    if max_results is not None:
        input_["max_results"] = max_results
    if next_token is not None:
        input_["next_token"] = next_token
    if filters is not None:
        input_["filters"] = filters

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