Returns the specified Savings Plan.
Parameters:
-
savings_plan_id
(SavingsPlanId)
–
The ID of the Savings Plan.
-
client_token
(Optional[ClientToken], default:
None
)
–
A unique, case-sensitive identifier that you provide to ensure the idempotency of the request.
Raises:
Source code in docs_src/capo_savingsplans/_services/savingsplans.py
| def return_savings_plan(
self,
savings_plan_id: "capo_savingsplans.types.savings_plan_id.SavingsPlanId",
*,
config_overrides: Optional[savingsplansClientConfig] = None,
client_token: Optional[
"capo_savingsplans.types.client_token.ClientToken"
] = None,
) -> (
"capo_savingsplans.types.return_savings_plan_response.ReturnSavingsPlanResponse"
):
"""<p>Returns the specified Savings Plan.</p>
Args:
savings_plan_id: <p>The ID of the Savings Plan.</p>
client_token: <p>A unique, case-sensitive identifier that you provide to ensure the idempotency of the request.</p>
Raises:
capo_savingsplans.errors.internal_server_exception.InternalServerException: <p>An unexpected error occurred.</p>
capo_savingsplans.errors.resource_not_found_exception.ResourceNotFoundException: <p>The specified resource was not found.</p>
capo_savingsplans.errors.service_quota_exceeded_exception.ServiceQuotaExceededException: <p>A service quota has been exceeded.</p>
capo_savingsplans.errors.validation_exception.ValidationException: <p>One of the input parameters is not valid.</p>
capo_savingsplans.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
def _handler(
req: "OperationRequest[capo_savingsplans.types.return_savings_plan_request.ReturnSavingsPlanRequest]",
) -> OperationResponse[
"capo_savingsplans.types.return_savings_plan_response.ReturnSavingsPlanResponse"
]:
import capo_savingsplans._operations.aws_savings_plan.return_savings_plan
output, http_response = (
capo_savingsplans._operations.aws_savings_plan.return_savings_plan.return_savings_plan(
req.options, req.input
)
)
return OperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("ReturnSavingsPlan")
)
input_: capo_savingsplans.types.return_savings_plan_request.ReturnSavingsPlanRequest = {
"savings_plan_id": savings_plan_id
}
if client_token is None:
client_token = str(uuid.uuid4())
input_["client_token"] = client_token
response = execute_pipeline(
OperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
response.response.close()
return response.output
|