Private Pricing contracts let eligible payer accounts manage private pricing agreements with Amazon Web Services. This operation associates a private pricing contract with the caller's Amazon Web Services account. The caller must be a payer (management) account listed on the contract. This operation is idempotent, so retrying a request that already succeeded is safe.
Parameters:
-
contract_arn
(ArnString)
–
The Amazon Resource Name (ARN) of the contract to associate with your account.
-
contract_document_id
(ContractDocumentId)
–
The contract ID from the contract document. It can be found in the top right corner of your contract's pages. This value confirms that you have access to the contract you are associating.
Raises:
-
AccessDeniedException
–
You don't have sufficient access to perform this action.
-
ConflictException
–
The requested operation would cause a conflict with the current state of a service resource associated with the request. Resolve the conflict before retrying this request.
-
InternalServerException
–
The request processing failed because of an unknown error, exception, or failure.
-
ResourceNotFoundException
–
The specified ARN in the request doesn't exist.
-
ThrottlingException
–
The request was denied due to request throttling.
-
ValidationException
–
The input fails to satisfy the constraints specified by an Amazon Web Services service.
-
UnknownServiceError
–
The service returned an error code this client does not model.
Examples:
Invoke AssociateContract
>>> client.associate_contract(contract_arn='arn:aws:billing::123456789012:contract/1a2b3c4d-5e6f-7a8b-9c0d-111122223333', contract_document_id='CC OTH XXXXXXXX XXXX TR')
Source code in docs_src/capo_billing/_services/billing.py
| def associate_contract(
self,
contract_arn: "capo_billing.types.arn_string.ArnString",
contract_document_id: "capo_billing.types.contract_document_id.ContractDocumentId",
*,
config_overrides: Optional[BillingClientConfig] = None,
) -> "capo_billing.types.associate_contract_response.AssociateContractResponse":
"""<p>Private Pricing contracts let eligible payer accounts manage private pricing agreements with Amazon Web Services. This operation associates a private pricing contract with the caller's Amazon Web Services account. The caller must be a payer (management) account listed on the contract. This operation is idempotent, so retrying a request that already succeeded is safe.</p>
Args:
contract_arn: <p>The Amazon Resource Name (ARN) of the contract to associate with your account.</p>
contract_document_id: <p>The contract ID from the contract document. It can be found in the top right corner of your contract's pages. This value confirms that you have access to the contract you are associating.</p>
Raises:
capo_billing.errors.access_denied_exception.AccessDeniedException: <p>You don't have sufficient access to perform this action.</p>
capo_billing.errors.conflict_exception.ConflictException: <p> The requested operation would cause a conflict with the current state of a service resource associated with the request. Resolve the conflict before retrying this request. </p>
capo_billing.errors.internal_server_exception.InternalServerException: <p>The request processing failed because of an unknown error, exception, or failure. </p>
capo_billing.errors.resource_not_found_exception.ResourceNotFoundException: <p> The specified ARN in the request doesn't exist. </p>
capo_billing.errors.throttling_exception.ThrottlingException: <p>The request was denied due to request throttling. </p>
capo_billing.errors.validation_exception.ValidationException: <p>The input fails to satisfy the constraints specified by an Amazon Web Services service. </p>
capo_billing.errors.UnknownServiceError: The service returned an error code this client does not model.
Examples:
Invoke AssociateContract
>>> client.associate_contract(contract_arn='arn:aws:billing::123456789012:contract/1a2b3c4d-5e6f-7a8b-9c0d-111122223333', contract_document_id='CC OTH XXXXXXXX XXXX TR')
"""
def _handler(
req: "OperationRequest[capo_billing.types.associate_contract_request.AssociateContractRequest]",
) -> OperationResponse[
"capo_billing.types.associate_contract_response.AssociateContractResponse"
]:
import capo_billing._operations.aws_billing.associate_contract
output, http_response = (
capo_billing._operations.aws_billing.associate_contract.associate_contract(
req.options, req.input
)
)
return OperationResponse(output=output, response=http_response)
def _redact_input(
input_: "capo_billing.types.associate_contract_request.AssociateContractRequest",
) -> dict[str, Any]:
import capo_billing.types.associate_contract_request
return capo_billing.types.associate_contract_request.redact_sensitive(
input_
)
interceptors_, options_ = self.operation_options(
config_overrides,
OperationLogging("AssociateContract", redact_input=_redact_input),
)
input_: capo_billing.types.associate_contract_request.AssociateContractRequest = {
"contract_arn": contract_arn,
"contract_document_id": contract_document_id,
}
response = execute_pipeline(
OperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
response.response.close()
return response.output
|