Retrieves the approval plans that apply to an agreement request. Only the acceptor of the agreement request can call this operation. Each approval plan lists its approval levels and the approvers at each level. Pass the planReference of an approval plan to StartAgreementApprovals to start an agreement approval for it.
Parameters:
-
agreement_request_id
(AgreementRequestId)
–
The unique identifier of the agreement request to retrieve the approval plans for.
-
max_results
(Optional[MaxResults], default:
None
)
–
The maximum number of approval plans to return in a single response (1-50). Default is 10.
-
next_token
(Optional[NextToken], default:
None
)
–
A token to specify where to start pagination.
Raises:
Examples:
Get the approval plans of an agreement request
>>> client.get_agreement_request_approval_plans(agreement_request_id='ar-EXAMPLE4a539b123d4EXAMPLE78')
Source code in docs_src/capo_marketplace_agreement/_services/marketplace_agreement.py
| def get_agreement_request_approval_plans(
self,
agreement_request_id: "capo_marketplace_agreement.types.agreement_request_id.AgreementRequestId",
*,
config_overrides: Optional[MarketplaceAgreementClientConfig] = None,
max_results: Optional[
"capo_marketplace_agreement.types.max_results.MaxResults"
] = None,
next_token: Optional[
"capo_marketplace_agreement.types.next_token.NextToken"
] = None,
) -> "capo_marketplace_agreement.types.get_agreement_request_approval_plans_output.GetAgreementRequestApprovalPlansOutput":
"""<p>Retrieves the approval plans that apply to an agreement request. Only the acceptor of the agreement request can call this operation. Each approval plan lists its approval levels and the approvers at each level. Pass the <code>planReference</code> of an approval plan to <code>StartAgreementApprovals</code> to start an agreement approval for it.</p>
Args:
agreement_request_id: <p>The unique identifier of the agreement request to retrieve the approval plans for.</p>
max_results: <p>The maximum number of approval plans to return in a single response (1-50). Default is 10.</p>
next_token: <p>A token to specify where to start pagination.</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.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:
Get the approval plans of an agreement request
>>> client.get_agreement_request_approval_plans(agreement_request_id='ar-EXAMPLE4a539b123d4EXAMPLE78')
"""
def _handler(
req: "OperationRequest[capo_marketplace_agreement.types.get_agreement_request_approval_plans_input.GetAgreementRequestApprovalPlansInput]",
) -> OperationResponse[
"capo_marketplace_agreement.types.get_agreement_request_approval_plans_output.GetAgreementRequestApprovalPlansOutput"
]:
if req.options.protocol == "awsJson1_0":
import capo_marketplace_agreement._operations.awsmp_commerce_service_v20200301.aws_json1_0.get_agreement_request_approval_plans
output, http_response = (
capo_marketplace_agreement._operations.awsmp_commerce_service_v20200301.aws_json1_0.get_agreement_request_approval_plans.get_agreement_request_approval_plans(
req.options, req.input
)
)
elif req.options.protocol == "rpcv2Cbor":
import capo_marketplace_agreement._operations.awsmp_commerce_service_v20200301.rpcv2_cbor.get_agreement_request_approval_plans
output, http_response = (
capo_marketplace_agreement._operations.awsmp_commerce_service_v20200301.rpcv2_cbor.get_agreement_request_approval_plans.get_agreement_request_approval_plans(
req.options, req.input
)
)
else:
raise ValueError(f"unknown protocol {req.options.protocol!r}")
return OperationResponse(output=output, response=http_response)
def _redact_output(
output: "capo_marketplace_agreement.types.get_agreement_request_approval_plans_output.GetAgreementRequestApprovalPlansOutput",
) -> dict[str, Any]:
import capo_marketplace_agreement.types.get_agreement_request_approval_plans_output
return capo_marketplace_agreement.types.get_agreement_request_approval_plans_output.redact_sensitive(
output
)
interceptors_, options_ = self.operation_options(
config_overrides,
OperationLogging(
"GetAgreementRequestApprovalPlans", redact_output=_redact_output
),
)
input_: capo_marketplace_agreement.types.get_agreement_request_approval_plans_input.GetAgreementRequestApprovalPlansInput = {
"agreement_request_id": agreement_request_id
}
if max_results is not None:
input_["max_results"] = max_results
if next_token is not None:
input_["next_token"] = next_token
response = execute_pipeline(
OperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
response.response.close()
return response.output
|