Skip to content

accept_delegation_request

accept_delegation_request(
    delegation_request_id: delegationRequestIdType,
    *,
    config_overrides: Optional[IAMClientConfig] = None,
) -> None

Accepts a delegation request, granting the requested temporary access.

Once the delegation request is accepted, it is eligible to send the exchange token to the partner. The SendDelegationToken API has to be explicitly called to send the delegation token.

At the time of acceptance, IAM records the details and the state of the identity that called this API. This is the identity that gets mapped to the delegated credential.

An accepted request may be rejected before the exchange token is sent to the partner.

Parameters:

Raises:

  • ConcurrentModificationException –

    The request was rejected because multiple requests to change this object were submitted simultaneously. Wait a few minutes and submit your request again.

  • NoSuchEntityException –

    The request was rejected because it referenced a resource entity that does not exist. The error message describes the resource.

  • ServiceFailureException –

    The request processing has failed because of an unknown error, exception or failure.

  • UnknownServiceError –

    The service returned an error code this client does not model.

Source code in docs_src/capo_iam/_services/iam.py
def accept_delegation_request(
    self,
    delegation_request_id: "capo_iam.types.delegation_request_id_type.delegationRequestIdType",
    *,
    config_overrides: Optional[IAMClientConfig] = None,
) -> None:
    """<p>Accepts a delegation request, granting the requested temporary access.</p> <p>Once the delegation request is accepted, it is eligible to send the exchange token to the partner. The <a href="https://docs.aws.amazon.com/IAM/latest/APIReference/API_SendDelegationToken.html">SendDelegationToken</a> API has to be explicitly called to send the delegation token. </p> <p>At the time of acceptance, IAM records the details and the state of the identity that called this API. This is the identity that gets mapped to the delegated credential. </p> <p>An accepted request may be rejected before the exchange token is sent to the partner.</p>

    Args:
        delegation_request_id: <p>The unique identifier of the delegation request to accept.</p>

    Raises:
        capo_iam.errors.concurrent_modification_exception.ConcurrentModificationException: <p>The request was rejected because multiple requests to change this object were submitted simultaneously. Wait a few minutes and submit your request again.</p>
        capo_iam.errors.no_such_entity_exception.NoSuchEntityException: <p>The request was rejected because it referenced a resource entity that does not exist. The error message describes the resource.</p>
        capo_iam.errors.service_failure_exception.ServiceFailureException: <p>The request processing has failed because of an unknown error, exception or failure.</p>
        capo_iam.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_iam.types.accept_delegation_request_request.AcceptDelegationRequestRequest]",
    ) -> OperationResponse[None]:
        import capo_iam._operations.aws_identity_management_v20100508.accept_delegation_request

        output, http_response = (
            capo_iam._operations.aws_identity_management_v20100508.accept_delegation_request.accept_delegation_request(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("AcceptDelegationRequest")
    )
    input_: capo_iam.types.accept_delegation_request_request.AcceptDelegationRequestRequest = {
        "delegation_request_id": delegation_request_id
    }

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