Skip to content

get_subject async

get_subject(
    subject_id: Uuid,
    *,
    config_overrides: Optional[AsyncRolesAnywhereClientConfig] = None,
) -> SubjectDetailResponse

Gets a subject, which associates a certificate identity with authentication attempts. The subject stores auditing information such as the status of the last authentication attempt, the certificate data used in the attempt, and the last time the associated identity attempted authentication.

Required permissions: rolesanywhere:GetSubject.

Parameters:

  • subject_id (Uuid) –

    The unique identifier of the subject.

Raises:

Source code in docs_src/capo_rolesanywhere/_services/async_roles_anywhere.py
async def get_subject(
    self,
    subject_id: "capo_rolesanywhere.types.uuid.Uuid",
    *,
    config_overrides: Optional[AsyncRolesAnywhereClientConfig] = None,
) -> "capo_rolesanywhere.types.subject_detail_response.SubjectDetailResponse":
    """<p>Gets a <i>subject</i>, which associates a certificate identity with authentication attempts. The subject stores auditing information such as the status of the last authentication attempt, the certificate data used in the attempt, and the last time the associated identity attempted authentication. </p> <p> <b>Required permissions: </b> <code>rolesanywhere:GetSubject</code>. </p>

    Args:
        subject_id: <p>The unique identifier of the subject. </p>

    Raises:
        capo_rolesanywhere.errors.access_denied_exception.AccessDeniedException: <p>You do not have sufficient access to perform this action.</p>
        capo_rolesanywhere.errors.resource_not_found_exception.ResourceNotFoundException: <p>The resource could not be found.</p>
        capo_rolesanywhere.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_rolesanywhere.types.scalar_subject_request.ScalarSubjectRequest]",
    ) -> AsyncOperationResponse[
        "capo_rolesanywhere.types.subject_detail_response.SubjectDetailResponse"
    ]:
        import capo_rolesanywhere._operations.roles_anywhere.get_subject

        (
            output,
            http_response,
        ) = await capo_rolesanywhere._operations.roles_anywhere.get_subject.async_get_subject(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("GetSubject")
    )
    input_: capo_rolesanywhere.types.scalar_subject_request.ScalarSubjectRequest = {
        "subject_id": subject_id
    }

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output