Allows the management account or a delegated administrator of the buyer's AWS organization to reject an agreement approval that is in PENDING_APPROVAL status, as the organization administrator approver or on behalf of another approver. Once rejected, the agreement approval and its agreement request transition to REJECTED status. You must provide a reason for the rejection.
Parameters:
Raises:
Examples:
Reject an agreement approval
>>> client.reject_agreement_approval(buyer_agreement_approval_rejection_input={'agreementApprovalId': 'apr-EXAMPLE9s0t1u2v3w4x', 'note': "Rejected. This purchase isn't in the approved budget."})
Source code in docs_src/capo_marketplace_agreement/_services/marketplace_agreement.py
| def reject_agreement_approval(
self,
*,
config_overrides: Optional[MarketplaceAgreementClientConfig] = None,
buyer_agreement_approval_rejection_input: Optional[
"capo_marketplace_agreement.types.buyer_agreement_approval_rejection_input.BuyerAgreementApprovalRejectionInput"
] = None,
) -> "capo_marketplace_agreement.types.reject_agreement_approval_output.RejectAgreementApprovalOutput":
"""<p>Allows the management account or a delegated administrator of the buyer's AWS organization to reject an agreement approval that is in <code>PENDING_APPROVAL</code> status, as the organization administrator approver or on behalf of another approver. Once rejected, the agreement approval and its agreement request transition to <code>REJECTED</code> status. You must provide a reason for the rejection.</p>
Args:
buyer_agreement_approval_rejection_input: <p>The rejection decision for an agreement approval that the buyer's organization requires.</p>
Raises:
capo_marketplace_agreement.errors.access_denied_exception.AccessDeniedException: <p>User does not have sufficient access to perform this action.</p>
capo_marketplace_agreement.errors.conflict_exception.ConflictException: <p>Request was denied due to a resource conflict.</p>
capo_marketplace_agreement.errors.internal_server_exception.InternalServerException: <p>Unexpected error during processing of request.</p>
capo_marketplace_agreement.errors.resource_not_found_exception.ResourceNotFoundException: <p>Request references a resource which does not exist.</p>
capo_marketplace_agreement.errors.throttling_exception.ThrottlingException: <p>Request was denied due to request throttling.</p>
capo_marketplace_agreement.errors.validation_exception.ValidationException: <p>The input fails to satisfy the constraints specified by the service.</p>
capo_marketplace_agreement.errors.UnknownServiceError: The service returned an error code this client does not model.
Examples:
Reject an agreement approval
>>> client.reject_agreement_approval(buyer_agreement_approval_rejection_input={'agreementApprovalId': 'apr-EXAMPLE9s0t1u2v3w4x', 'note': "Rejected. This purchase isn't in the approved budget."})
"""
def _handler(
req: "OperationRequest[capo_marketplace_agreement.types.reject_agreement_approval_input.RejectAgreementApprovalInput]",
) -> OperationResponse[
"capo_marketplace_agreement.types.reject_agreement_approval_output.RejectAgreementApprovalOutput"
]:
if req.options.protocol == "awsJson1_0":
import capo_marketplace_agreement._operations.awsmp_commerce_service_v20200301.aws_json1_0.reject_agreement_approval
output, http_response = (
capo_marketplace_agreement._operations.awsmp_commerce_service_v20200301.aws_json1_0.reject_agreement_approval.reject_agreement_approval(
req.options, req.input
)
)
elif req.options.protocol == "rpcv2Cbor":
import capo_marketplace_agreement._operations.awsmp_commerce_service_v20200301.rpcv2_cbor.reject_agreement_approval
output, http_response = (
capo_marketplace_agreement._operations.awsmp_commerce_service_v20200301.rpcv2_cbor.reject_agreement_approval.reject_agreement_approval(
req.options, req.input
)
)
else:
raise ValueError(f"unknown protocol {req.options.protocol!r}")
return OperationResponse(output=output, response=http_response)
def _redact_input(
input_: "capo_marketplace_agreement.types.reject_agreement_approval_input.RejectAgreementApprovalInput",
) -> dict[str, Any]:
import capo_marketplace_agreement.types.reject_agreement_approval_input
return capo_marketplace_agreement.types.reject_agreement_approval_input.redact_sensitive(
input_
)
interceptors_, options_ = self.operation_options(
config_overrides,
OperationLogging("RejectAgreementApproval", redact_input=_redact_input),
)
input_: capo_marketplace_agreement.types.reject_agreement_approval_input.RejectAgreementApprovalInput = {}
if buyer_agreement_approval_rejection_input is not None:
input_["buyer_agreement_approval_rejection_input"] = (
buyer_agreement_approval_rejection_input
)
response = execute_pipeline(
OperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
response.response.close()
return response.output
|