Skip to content

list_subjects

list_subjects(
    *,
    config_overrides: Optional[RolesAnywhereClientConfig] = None,
    next_token: Optional[str] = None,
    page_size: Optional[int] = None,
) -> ListSubjectsResponse

Lists the subjects in the authenticated account and Amazon Web Services Region.

Required permissions: rolesanywhere:ListSubjects.

Parameters:

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

    A token that indicates where the output should continue from, if a previous request did not show all results. To get the next results, make the request again with this value.

  • page_size (Optional[int], default: None ) –

    The number of resources in the paginated list.

Raises:

Source code in docs_src/capo_rolesanywhere/_services/roles_anywhere.py
def list_subjects(
    self,
    *,
    config_overrides: Optional[RolesAnywhereClientConfig] = None,
    next_token: Optional[str] = None,
    page_size: Optional[int] = None,
) -> "capo_rolesanywhere.types.list_subjects_response.ListSubjectsResponse":
    """<p>Lists the subjects in the authenticated account and Amazon Web Services Region.</p> <p> <b>Required permissions: </b> <code>rolesanywhere:ListSubjects</code>. </p>

    Args:
        next_token: <p>A token that indicates where the output should continue from, if a previous request did not show all results. To get the next results, make the request again with this value.</p>
        page_size: <p>The number of resources in the paginated list. </p>

    Raises:
        capo_rolesanywhere.errors.access_denied_exception.AccessDeniedException: <p>You do not have sufficient access to perform this action.</p>
        capo_rolesanywhere.errors.validation_exception.ValidationException: <p>Validation exception error.</p>
        capo_rolesanywhere.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_rolesanywhere.types.list_request.ListRequest]",
    ) -> OperationResponse[
        "capo_rolesanywhere.types.list_subjects_response.ListSubjectsResponse"
    ]:
        import capo_rolesanywhere._operations.roles_anywhere.list_subjects

        output, http_response = (
            capo_rolesanywhere._operations.roles_anywhere.list_subjects.list_subjects(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ListSubjects")
    )
    input_: capo_rolesanywhere.types.list_request.ListRequest = {}
    if next_token is not None:
        input_["next_token"] = next_token
    if page_size is not None:
        input_["page_size"] = page_size

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