Associates a delegation request with the current identity.
If the partner that created the delegation request has specified the owner account during creation, only an identity from that owner account can call the AssociateDelegationRequest API for the specified delegation request. Once the AssociateDelegationRequest API call is successful, the ARN of the current calling identity will be stored as the ownerId of the request.
If the partner that created the delegation request has not specified the owner account during creation, any caller from any account can call the AssociateDelegationRequest API for the delegation request. Once this API call is successful, the ARN of the current calling identity will be stored as the ownerId and the Amazon Web Services account ID of the current calling identity will be stored as the ownerAccount of the request.
For more details, see Managing Permissions for Delegation Requests.
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.
-
InvalidInputException
–
The request was rejected because an invalid or out-of-range value was supplied for an input parameter.
-
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 associate_delegation_request(
self,
delegation_request_id: "capo_iam.types.delegation_request_id_type.delegationRequestIdType",
*,
config_overrides: Optional[IAMClientConfig] = None,
) -> None:
"""<p>Associates a delegation request with the current identity.</p> <p>If the partner that created the delegation request has specified the owner account during creation, only an identity from that owner account can call the <code>AssociateDelegationRequest</code> API for the specified delegation request. Once the <code>AssociateDelegationRequest</code> API call is successful, the ARN of the current calling identity will be stored as the <code>ownerId</code> of the request. </p> <p>If the partner that created the delegation request has not specified the owner account during creation, any caller from any account can call the <code>AssociateDelegationRequest</code> API for the delegation request. Once this API call is successful, the ARN of the current calling identity will be stored as the <code>ownerId</code> and the Amazon Web Services account ID of the current calling identity will be stored as the <code>ownerAccount</code> of the request. </p> <p> For more details, see <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies-temporary-delegation.html#temporary-delegation-managing-permissions"> Managing Permissions for Delegation Requests</a>. </p>
Args:
delegation_request_id: <p>The unique identifier of the delegation request to associate.</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.invalid_input_exception.InvalidInputException: <p>The request was rejected because an invalid or out-of-range value was supplied for an input parameter.</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.associate_delegation_request_request.AssociateDelegationRequestRequest]",
) -> OperationResponse[None]:
import capo_iam._operations.aws_identity_management_v20100508.associate_delegation_request
output, http_response = (
capo_iam._operations.aws_identity_management_v20100508.associate_delegation_request.associate_delegation_request(
req.options, req.input
)
)
return OperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("AssociateDelegationRequest")
)
input_: capo_iam.types.associate_delegation_request_request.AssociateDelegationRequestRequest = {
"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
|