def get_backup_plan_from_json(
self,
backup_plan_template_json: "capo_backup.types.string.string",
*,
config_overrides: Optional[BackupClientConfig] = None,
) -> (
"capo_backup.types.get_backup_plan_from_json_output.GetBackupPlanFromJSONOutput"
):
"""<p>Returns a valid JSON document specifying a backup plan or an error.</p>
Args:
backup_plan_template_json: <p>A customer-supplied backup plan document in JSON format.</p>
Raises:
capo_backup.errors.invalid_parameter_value_exception.InvalidParameterValueException: <p>Indicates that something is wrong with a parameter's value. For example, the value is out of range.</p>
capo_backup.errors.invalid_request_exception.InvalidRequestException: <p>Indicates that something is wrong with the input to the request. For example, a parameter is of the wrong type.</p>
capo_backup.errors.limit_exceeded_exception.LimitExceededException: <p>A limit in the request has been exceeded; for example, a maximum number of items allowed in a request.</p>
capo_backup.errors.missing_parameter_value_exception.MissingParameterValueException: <p>Indicates that a required parameter is missing.</p>
capo_backup.errors.service_unavailable_exception.ServiceUnavailableException: <p>The request failed due to a temporary failure of the server.</p>
capo_backup.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
def _handler(
req: "OperationRequest[capo_backup.types.get_backup_plan_from_json_input.GetBackupPlanFromJSONInput]",
) -> OperationResponse[
"capo_backup.types.get_backup_plan_from_json_output.GetBackupPlanFromJSONOutput"
]:
import capo_backup._operations.cryo_controller_user_manager.get_backup_plan_from_json
output, http_response = (
capo_backup._operations.cryo_controller_user_manager.get_backup_plan_from_json.get_backup_plan_from_json(
req.options, req.input
)
)
return OperationResponse(output=output, response=http_response)
def _redact_output(
output: "capo_backup.types.get_backup_plan_from_json_output.GetBackupPlanFromJSONOutput",
) -> dict[str, Any]:
import capo_backup.types.get_backup_plan_from_json_output
return capo_backup.types.get_backup_plan_from_json_output.redact_sensitive(
output
)
interceptors_, options_ = self.operation_options(
config_overrides,
OperationLogging("GetBackupPlanFromJSON", redact_output=_redact_output),
)
input_: capo_backup.types.get_backup_plan_from_json_input.GetBackupPlanFromJSONInput = {
"backup_plan_template_json": backup_plan_template_json
}
response = execute_pipeline(
OperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
response.response.close()
return response.output