From fc26c59afd739cca6e89249d98c2ac188561bd68 Mon Sep 17 00:00:00 2001 From: AWS SDK Rust Bot Date: Wed, 18 Dec 2024 16:56:53 +0000 Subject: [PATCH] Update SDK models --- Cargo.toml | 3 +- aws-models/account.json | 797 +++-- aws-models/backup.json | 531 ++++ aws-models/backupsearch.json | 2820 +++++++++++++++++ aws-models/batch.json | 99 +- aws-models/cleanroomsml.json | 5 +- aws-models/cloudfront.json | 18 +- aws-models/codepipeline.json | 18 +- aws-models/ecs.json | 18 +- aws-models/m2.json | 33 + aws-models/synthetics.json | 24 +- examples/examples/batch/Cargo.toml | 2 +- examples/examples/ecs/Cargo.toml | 2 +- index.md | 1 + sdk/account/Cargo.toml | 2 +- sdk/account/README.md | 2 +- sdk/account/src/config/endpoint.rs | 508 ++- sdk/account/src/config/endpoint/internals.rs | 150 +- sdk/account/src/lib.rs | 2 +- .../operation/accept_primary_email_update.rs | 2 +- .../src/operation/delete_alternate_contact.rs | 2 +- sdk/account/src/operation/disable_region.rs | 2 +- sdk/account/src/operation/enable_region.rs | 2 +- .../src/operation/get_alternate_contact.rs | 2 +- .../src/operation/get_contact_information.rs | 2 +- .../src/operation/get_primary_email.rs | 2 +- .../src/operation/get_region_opt_status.rs | 2 +- sdk/account/src/operation/list_regions.rs | 2 +- .../src/operation/put_alternate_contact.rs | 2 +- .../src/operation/put_contact_information.rs | 2 +- .../operation/start_primary_email_update.rs | 2 +- sdk/backup/Cargo.toml | 2 +- sdk/backup/README.md | 2 +- sdk/backup/src/client.rs | 6 + .../src/client/describe_recovery_point.rs | 2 + .../get_recovery_point_index_details.rs | 24 + .../client/list_indexed_recovery_points.rs | 21 + sdk/backup/src/client/start_backup_job.rs | 1 + .../update_recovery_point_index_settings.rs | 21 + sdk/backup/src/error_meta.rs | 122 + sdk/backup/src/lens.rs | 20 + sdk/backup/src/lib.rs | 2 +- sdk/backup/src/operation.rs | 9 + .../_describe_recovery_point_output.rs | 54 + .../get_recovery_point_index_details.rs | 414 +++ ..._get_recovery_point_index_details_input.rs | 83 + ...get_recovery_point_index_details_output.rs | 257 ++ .../builders.rs | 142 + .../operation/list_indexed_recovery_points.rs | 422 +++ .../_list_indexed_recovery_points_input.rs | 236 ++ .../_list_indexed_recovery_points_output.rs | 101 + .../list_indexed_recovery_points/builders.rs | 246 ++ .../list_indexed_recovery_points/paginator.rs | 150 + .../_start_backup_job_input.rs | 74 + .../operation/start_backup_job/builders.rs | 44 + .../update_recovery_point_index_settings.rs | 434 +++ ...ate_recovery_point_index_settings_input.rs | 145 + ...te_recovery_point_index_settings_output.rs | 152 + .../builders.rs | 180 ++ sdk/backup/src/protocol_serde.rs | 16 + .../src/protocol_serde/shape_backup_rule.rs | 3 + .../protocol_serde/shape_backup_rule_input.rs | 12 + .../shape_describe_recovery_point.rs | 14 + .../shape_get_recovery_point_index_details.rs | 212 ++ .../src/protocol_serde/shape_index_action.rs | 52 + .../src/protocol_serde/shape_index_actions.rs | 32 + .../shape_indexed_recovery_point.rs | 94 + .../shape_indexed_recovery_point_list.rs | 32 + .../shape_list_indexed_recovery_points.rs | 145 + .../shape_recovery_point_by_backup_vault.rs | 14 + .../shape_recovery_point_by_resource.rs | 14 + .../shape_start_backup_job_input.rs | 29 +- ...pe_update_recovery_point_index_settings.rs | 210 ++ ...ate_recovery_point_index_settings_input.rs | 13 + sdk/backup/src/types.rs | 16 + sdk/backup/src/types/_backup_rule.rs | 42 + sdk/backup/src/types/_backup_rule_input.rs | 67 + sdk/backup/src/types/_index.rs | 108 + sdk/backup/src/types/_index_action.rs | 94 + sdk/backup/src/types/_index_status.rs | 120 + .../src/types/_indexed_recovery_point.rs | 277 ++ .../types/_recovery_point_by_backup_vault.rs | 54 + .../src/types/_recovery_point_by_resource.rs | 54 + sdk/backup/src/types/builders.rs | 4 + sdk/backupsearch/Cargo.toml | 88 + sdk/backupsearch/LICENSE | 202 ++ sdk/backupsearch/README.md | 60 + sdk/backupsearch/src/auth_plugin.rs | 35 + sdk/backupsearch/src/client.rs | 188 ++ sdk/backupsearch/src/client/customize.rs | 114 + .../src/client/customize/internal.rs | 12 + sdk/backupsearch/src/client/get_search_job.rs | 24 + .../client/get_search_result_export_job.rs | 20 + .../src/client/list_search_job_backups.rs | 17 + .../src/client/list_search_job_results.rs | 17 + .../src/client/list_search_jobs.rs | 17 + .../client/list_search_result_export_jobs.rs | 20 + .../src/client/list_tags_for_resource.rs | 13 + .../src/client/start_search_job.rs | 20 + .../client/start_search_result_export_job.rs | 20 + .../src/client/stop_search_job.rs | 12 + sdk/backupsearch/src/client/tag_resource.rs | 13 + sdk/backupsearch/src/client/untag_resource.rs | 13 + sdk/backupsearch/src/config.rs | 1338 ++++++++ sdk/backupsearch/src/config/endpoint.rs | 632 ++++ .../src/config/endpoint/internals.rs | 87 + sdk/backupsearch/src/config/http.rs | 3 + sdk/backupsearch/src/config/interceptors.rs | 11 + sdk/backupsearch/src/config/retry.rs | 7 + sdk/backupsearch/src/config/timeout.rs | 2 + sdk/backupsearch/src/endpoint_lib.rs | 19 + .../src/endpoint_lib/diagnostic.rs | 45 + .../src/endpoint_lib/partition.rs | 557 ++++ sdk/backupsearch/src/error.rs | 30 + .../src/error/sealed_unhandled.rs | 20 + sdk/backupsearch/src/error_meta.rs | 479 +++ sdk/backupsearch/src/json_errors.rs | 180 ++ sdk/backupsearch/src/lens.rs | 68 + sdk/backupsearch/src/lib.rs | 209 ++ sdk/backupsearch/src/meta.rs | 6 + sdk/backupsearch/src/operation.rs | 38 + .../src/operation/get_search_job.rs | 405 +++ .../get_search_job/_get_search_job_input.rs | 52 + .../get_search_job/_get_search_job_output.rs | 388 +++ .../src/operation/get_search_job/builders.rs | 125 + .../operation/get_search_result_export_job.rs | 416 +++ .../_get_search_result_export_job_input.rs | 60 + .../_get_search_result_export_job_output.rs | 234 ++ .../get_search_result_export_job/builders.rs | 130 + .../src/operation/list_search_job_backups.rs | 431 +++ .../_list_search_job_backups_input.rs | 102 + .../_list_search_job_backups_output.rs | 110 + .../list_search_job_backups/builders.rs | 164 + .../list_search_job_backups/paginator.rs | 149 + .../src/operation/list_search_job_results.rs | 432 +++ .../_list_search_job_results_input.rs | 102 + .../_list_search_job_results_output.rs | 110 + .../list_search_job_results/builders.rs | 162 + .../list_search_job_results/paginator.rs | 149 + .../src/operation/list_search_jobs.rs | 408 +++ .../_list_search_jobs_input.rs | 100 + .../_list_search_jobs_output.rs | 109 + .../operation/list_search_jobs/builders.rs | 162 + .../operation/list_search_jobs/paginator.rs | 148 + .../list_search_result_export_jobs.rs | 441 +++ .../_list_search_result_export_jobs_input.rs | 125 + .../_list_search_result_export_jobs_output.rs | 112 + .../builders.rs | 176 + .../paginator.rs | 152 + .../src/operation/list_tags_for_resource.rs | 405 +++ .../_list_tags_for_resource_input.rs | 53 + .../_list_tags_for_resource_output.rs | 77 + .../list_tags_for_resource/builders.rs | 125 + .../src/operation/start_search_job.rs | 407 +++ .../_start_search_job_input.rs | 183 ++ .../_start_search_job_output.rs | 110 + .../operation/start_search_job/builders.rs | 212 ++ .../start_search_result_export_job.rs | 427 +++ .../_start_search_result_export_job_input.rs | 160 + .../_start_search_result_export_job_output.rs | 102 + .../builders.rs | 194 ++ .../src/operation/stop_search_job.rs | 420 +++ .../stop_search_job/_stop_search_job_input.rs | 52 + .../_stop_search_job_output.rs | 42 + .../src/operation/stop_search_job/builders.rs | 126 + .../src/operation/tag_resource.rs | 408 +++ .../tag_resource/_tag_resource_input.rs | 88 + .../tag_resource/_tag_resource_output.rs | 42 + .../src/operation/tag_resource/builders.rs | 152 + .../src/operation/untag_resource.rs | 419 +++ .../untag_resource/_untag_resource_input.rs | 82 + .../untag_resource/_untag_resource_output.rs | 42 + .../src/operation/untag_resource/builders.rs | 144 + sdk/backupsearch/src/primitives.rs | 8 + .../src/primitives/event_stream.rs | 1 + .../src/primitives/sealed_enum_unknown.rs | 21 + sdk/backupsearch/src/protocol_serde.rs | 138 + .../shape_access_denied_exception.rs | 36 + .../shape_backup_creation_time_filter.rs | 62 + .../shape_conflict_exception.rs | 50 + .../shape_current_search_progress.rs | 54 + .../protocol_serde/shape_ebs_item_filter.rs | 101 + .../protocol_serde/shape_ebs_item_filters.rs | 32 + .../protocol_serde/shape_ebs_result_item.rs | 87 + .../shape_export_job_summaries.rs | 32 + .../shape_export_job_summary.rs | 82 + .../shape_export_specification.rs | 83 + .../protocol_serde/shape_get_search_job.rs | 216 ++ .../shape_get_search_result_export_job.rs | 216 ++ .../shape_internal_server_exception.rs | 59 + .../src/protocol_serde/shape_item_filters.rs | 70 + .../shape_list_search_job_backups.rs | 174 + .../shape_list_search_job_results.rs | 172 + .../protocol_serde/shape_list_search_jobs.rs | 149 + .../shape_list_search_result_export_jobs.rs | 194 ++ .../shape_list_tags_for_resource.rs | 163 + .../protocol_serde/shape_long_condition.rs | 65 + .../shape_long_condition_list.rs | 32 + .../shape_recovery_point_arn_list.rs | 34 + .../protocol_serde/shape_resource_arn_list.rs | 34 + .../shape_resource_not_found_exception.rs | 50 + .../shape_resource_type_list.rs | 34 + .../src/protocol_serde/shape_result_item.rs | 68 + .../src/protocol_serde/shape_results.rs | 32 + .../shape_s3_export_specification.rs | 62 + .../protocol_serde/shape_s3_item_filter.rs | 115 + .../protocol_serde/shape_s3_item_filters.rs | 32 + .../protocol_serde/shape_s3_result_item.rs | 88 + .../shape_search_job_backups_result.rs | 80 + .../shape_search_job_backups_results.rs | 32 + .../shape_search_job_summary.rs | 84 + .../src/protocol_serde/shape_search_jobs.rs | 32 + .../src/protocol_serde/shape_search_scope.rs | 106 + .../shape_search_scope_summary.rs | 47 + .../shape_service_quota_exceeded_exception.rs | 64 + .../protocol_serde/shape_start_search_job.rs | 198 ++ .../shape_start_search_job_input.rs | 40 + .../shape_start_search_result_export_job.rs | 222 ++ ...pe_start_search_result_export_job_input.rs | 34 + .../protocol_serde/shape_stop_search_job.rs | 130 + .../protocol_serde/shape_string_condition.rs | 62 + .../shape_string_condition_list.rs | 32 + .../src/protocol_serde/shape_tag_map.rs | 39 + .../src/protocol_serde/shape_tag_resource.rs | 126 + .../shape_tag_resource_input.rs | 19 + .../shape_throttling_exception.rs | 73 + .../protocol_serde/shape_time_condition.rs | 63 + .../shape_time_condition_list.rs | 32 + .../protocol_serde/shape_untag_resource.rs | 116 + .../shape_validation_exception.rs | 36 + sdk/backupsearch/src/sdk_feature_tracker.rs | 155 + sdk/backupsearch/src/serde_util.rs | 223 ++ .../src/serialization_settings.rs | 84 + sdk/backupsearch/src/types.rs | 102 + .../src/types/_backup_creation_time_filter.rs | 72 + .../src/types/_current_search_progress.rs | 94 + .../src/types/_ebs_item_filter.rs | 188 ++ .../src/types/_ebs_result_item.rs | 232 ++ .../src/types/_export_job_status.rs | 114 + .../src/types/_export_job_summary.rs | 201 ++ .../src/types/_export_specification.rs | 38 + sdk/backupsearch/src/types/_item_filters.rs | 89 + sdk/backupsearch/src/types/_long_condition.rs | 89 + .../src/types/_long_condition_operator.rs | 120 + sdk/backupsearch/src/types/_resource_type.rs | 108 + sdk/backupsearch/src/types/_result_item.rs | 52 + .../src/types/_s3_export_specification.rs | 81 + sdk/backupsearch/src/types/_s3_item_filter.rs | 228 ++ sdk/backupsearch/src/types/_s3_result_item.rs | 232 ++ .../src/types/_search_job_backups_result.rs | 182 ++ .../src/types/_search_job_state.rs | 126 + .../src/types/_search_job_summary.rs | 239 ++ sdk/backupsearch/src/types/_search_scope.rs | 191 ++ .../src/types/_search_scope_summary.rs | 78 + .../src/types/_string_condition.rs | 90 + .../src/types/_string_condition_operator.rs | 153 + sdk/backupsearch/src/types/_time_condition.rs | 89 + .../src/types/_time_condition_operator.rs | 120 + sdk/backupsearch/src/types/builders.rs | 32 + sdk/backupsearch/src/types/error.rs | 31 + .../types/error/_access_denied_exception.rs | 93 + .../src/types/error/_conflict_exception.rs | 156 + .../types/error/_internal_server_exception.rs | 121 + .../error/_resource_not_found_exception.rs | 156 + .../_service_quota_exceeded_exception.rs | 217 ++ .../src/types/error/_throttling_exception.rs | 165 + .../src/types/error/_validation_exception.rs | 93 + sdk/backupsearch/src/types/error/builders.rs | 14 + sdk/backupsearch/tests/endpoint_tests.rs | 2 + sdk/batch/Cargo.toml | 2 +- sdk/batch/README.md | 2 +- sdk/batch/src/lib.rs | 2 +- sdk/batch/src/protocol_serde.rs | 4 + .../shape_eks_annotations_map.rs | 38 + .../shape_eks_container_volume_mount.rs | 14 +- .../src/protocol_serde/shape_eks_metadata.rs | 23 + .../shape_eks_persistent_volume_claim.rs | 56 + .../src/protocol_serde/shape_eks_volume.rs | 11 + sdk/batch/src/serde_util.rs | 9 + sdk/batch/src/types.rs | 4 + .../src/types/_eks_container_volume_mount.rs | 22 + sdk/batch/src/types/_eks_metadata.rs | 159 +- .../src/types/_eks_persistent_volume_claim.rs | 73 + sdk/batch/src/types/_eks_volume.rs | 22 + sdk/batch/src/types/builders.rs | 2 + sdk/cleanroomsml/Cargo.toml | 2 +- sdk/cleanroomsml/README.md | 2 +- .../start_trained_model_inference_job.rs | 2 +- sdk/cleanroomsml/src/lib.rs | 2 +- ...start_trained_model_inference_job_input.rs | 10 +- .../builders.rs | 6 +- sdk/cleanroomsml/src/protocol_serde.rs | 6 +- ...ape_audience_generation_job_data_source.rs | 10 + .../shape_compute_configuration.rs | 40 +- .../shape_worker_compute_configuration.rs | 32 +- .../_audience_generation_job_data_source.rs | 24 + sdk/cloudfront/Cargo.toml | 2 +- sdk/cloudfront/README.md | 2 +- sdk/cloudfront/src/lib.rs | 2 +- .../protocol_serde/shape_vpc_origin_config.rs | 42 +- .../src/types/_custom_origin_config.rs | 20 +- .../src/types/_distribution_config.rs | 30 +- .../src/types/_vpc_origin_config.rs | 54 + sdk/codepipeline/Cargo.toml | 2 +- sdk/codepipeline/README.md | 2 +- .../src/client/get_action_type.rs | 2 +- sdk/codepipeline/src/lib.rs | 2 +- .../get_action_type/_get_action_type_input.rs | 10 + .../src/operation/get_action_type/builders.rs | 6 + .../src/operation/list_rule_types/builders.rs | 2 +- .../protocol_serde/shape_rule_declaration.rs | 36 +- sdk/codepipeline/src/types/_action_type_id.rs | 10 + sdk/codepipeline/src/types/_condition.rs | 2 +- .../src/types/_rule_declaration.rs | 52 +- sdk/ecs/Cargo.toml | 2 +- sdk/ecs/README.md | 2 +- .../src/client/list_service_deployments.rs | 2 +- .../src/client/register_task_definition.rs | 1 + sdk/ecs/src/lib.rs | 2 +- .../_list_service_deployments_input.rs | 10 +- .../list_service_deployments/builders.rs | 6 +- .../_register_task_definition_input.rs | 22 + .../register_task_definition/builders.rs | 14 + .../shape_register_task_definition_input.rs | 3 + .../protocol_serde/shape_task_definition.rs | 3 + .../src/types/_deployment_configuration.rs | 10 +- sdk/ecs/src/types/_log_configuration.rs | 10 +- sdk/ecs/src/types/_task_definition.rs | 22 + sdk/m2/Cargo.toml | 2 +- sdk/m2/README.md | 2 +- sdk/m2/src/client/create_environment.rs | 1 + sdk/m2/src/client/get_environment.rs | 1 + sdk/m2/src/lib.rs | 2 +- .../_create_environment_input.rs | 22 + .../operation/create_environment/builders.rs | 14 + .../_get_environment_output.rs | 22 + .../shape_create_environment_input.rs | 55 +- .../shape_environment_summary.rs | 7 + .../protocol_serde/shape_get_environment.rs | 7 + .../shape_storage_configuration.rs | 6 +- sdk/m2/src/types.rs | 4 + sdk/m2/src/types/_environment_summary.rs | 22 + sdk/m2/src/types/_network_type.rs | 108 + sdk/synthetics/Cargo.toml | 2 +- sdk/synthetics/README.md | 2 +- sdk/synthetics/src/lib.rs | 2 +- .../protocol_serde/shape_vpc_config_input.rs | 3 + .../protocol_serde/shape_vpc_config_output.rs | 4 + .../src/types/_visual_reference_input.rs | 10 +- sdk/synthetics/src/types/_vpc_config_input.rs | 22 + .../src/types/_vpc_config_output.rs | 22 + versions.toml | 482 +-- 352 files changed, 34833 insertions(+), 1235 deletions(-) create mode 100644 aws-models/backupsearch.json create mode 100644 sdk/backup/src/client/get_recovery_point_index_details.rs create mode 100644 sdk/backup/src/client/list_indexed_recovery_points.rs create mode 100644 sdk/backup/src/client/update_recovery_point_index_settings.rs create mode 100644 sdk/backup/src/operation/get_recovery_point_index_details.rs create mode 100644 sdk/backup/src/operation/get_recovery_point_index_details/_get_recovery_point_index_details_input.rs create mode 100644 sdk/backup/src/operation/get_recovery_point_index_details/_get_recovery_point_index_details_output.rs create mode 100644 sdk/backup/src/operation/get_recovery_point_index_details/builders.rs create mode 100644 sdk/backup/src/operation/list_indexed_recovery_points.rs create mode 100644 sdk/backup/src/operation/list_indexed_recovery_points/_list_indexed_recovery_points_input.rs create mode 100644 sdk/backup/src/operation/list_indexed_recovery_points/_list_indexed_recovery_points_output.rs create mode 100644 sdk/backup/src/operation/list_indexed_recovery_points/builders.rs create mode 100644 sdk/backup/src/operation/list_indexed_recovery_points/paginator.rs create mode 100644 sdk/backup/src/operation/update_recovery_point_index_settings.rs create mode 100644 sdk/backup/src/operation/update_recovery_point_index_settings/_update_recovery_point_index_settings_input.rs create mode 100644 sdk/backup/src/operation/update_recovery_point_index_settings/_update_recovery_point_index_settings_output.rs create mode 100644 sdk/backup/src/operation/update_recovery_point_index_settings/builders.rs create mode 100644 sdk/backup/src/protocol_serde/shape_get_recovery_point_index_details.rs create mode 100644 sdk/backup/src/protocol_serde/shape_index_action.rs create mode 100644 sdk/backup/src/protocol_serde/shape_index_actions.rs create mode 100644 sdk/backup/src/protocol_serde/shape_indexed_recovery_point.rs create mode 100644 sdk/backup/src/protocol_serde/shape_indexed_recovery_point_list.rs create mode 100644 sdk/backup/src/protocol_serde/shape_list_indexed_recovery_points.rs create mode 100644 sdk/backup/src/protocol_serde/shape_update_recovery_point_index_settings.rs create mode 100644 sdk/backup/src/protocol_serde/shape_update_recovery_point_index_settings_input.rs create mode 100644 sdk/backup/src/types/_index.rs create mode 100644 sdk/backup/src/types/_index_action.rs create mode 100644 sdk/backup/src/types/_index_status.rs create mode 100644 sdk/backup/src/types/_indexed_recovery_point.rs create mode 100644 sdk/backupsearch/Cargo.toml create mode 100644 sdk/backupsearch/LICENSE create mode 100644 sdk/backupsearch/README.md create mode 100644 sdk/backupsearch/src/auth_plugin.rs create mode 100644 sdk/backupsearch/src/client.rs create mode 100644 sdk/backupsearch/src/client/customize.rs create mode 100644 sdk/backupsearch/src/client/customize/internal.rs create mode 100644 sdk/backupsearch/src/client/get_search_job.rs create mode 100644 sdk/backupsearch/src/client/get_search_result_export_job.rs create mode 100644 sdk/backupsearch/src/client/list_search_job_backups.rs create mode 100644 sdk/backupsearch/src/client/list_search_job_results.rs create mode 100644 sdk/backupsearch/src/client/list_search_jobs.rs create mode 100644 sdk/backupsearch/src/client/list_search_result_export_jobs.rs create mode 100644 sdk/backupsearch/src/client/list_tags_for_resource.rs create mode 100644 sdk/backupsearch/src/client/start_search_job.rs create mode 100644 sdk/backupsearch/src/client/start_search_result_export_job.rs create mode 100644 sdk/backupsearch/src/client/stop_search_job.rs create mode 100644 sdk/backupsearch/src/client/tag_resource.rs create mode 100644 sdk/backupsearch/src/client/untag_resource.rs create mode 100644 sdk/backupsearch/src/config.rs create mode 100644 sdk/backupsearch/src/config/endpoint.rs create mode 100644 sdk/backupsearch/src/config/endpoint/internals.rs create mode 100644 sdk/backupsearch/src/config/http.rs create mode 100644 sdk/backupsearch/src/config/interceptors.rs create mode 100644 sdk/backupsearch/src/config/retry.rs create mode 100644 sdk/backupsearch/src/config/timeout.rs create mode 100644 sdk/backupsearch/src/endpoint_lib.rs create mode 100644 sdk/backupsearch/src/endpoint_lib/diagnostic.rs create mode 100644 sdk/backupsearch/src/endpoint_lib/partition.rs create mode 100644 sdk/backupsearch/src/error.rs create mode 100644 sdk/backupsearch/src/error/sealed_unhandled.rs create mode 100644 sdk/backupsearch/src/error_meta.rs create mode 100644 sdk/backupsearch/src/json_errors.rs create mode 100644 sdk/backupsearch/src/lens.rs create mode 100644 sdk/backupsearch/src/lib.rs create mode 100644 sdk/backupsearch/src/meta.rs create mode 100644 sdk/backupsearch/src/operation.rs create mode 100644 sdk/backupsearch/src/operation/get_search_job.rs create mode 100644 sdk/backupsearch/src/operation/get_search_job/_get_search_job_input.rs create mode 100644 sdk/backupsearch/src/operation/get_search_job/_get_search_job_output.rs create mode 100644 sdk/backupsearch/src/operation/get_search_job/builders.rs create mode 100644 sdk/backupsearch/src/operation/get_search_result_export_job.rs create mode 100644 sdk/backupsearch/src/operation/get_search_result_export_job/_get_search_result_export_job_input.rs create mode 100644 sdk/backupsearch/src/operation/get_search_result_export_job/_get_search_result_export_job_output.rs create mode 100644 sdk/backupsearch/src/operation/get_search_result_export_job/builders.rs create mode 100644 sdk/backupsearch/src/operation/list_search_job_backups.rs create mode 100644 sdk/backupsearch/src/operation/list_search_job_backups/_list_search_job_backups_input.rs create mode 100644 sdk/backupsearch/src/operation/list_search_job_backups/_list_search_job_backups_output.rs create mode 100644 sdk/backupsearch/src/operation/list_search_job_backups/builders.rs create mode 100644 sdk/backupsearch/src/operation/list_search_job_backups/paginator.rs create mode 100644 sdk/backupsearch/src/operation/list_search_job_results.rs create mode 100644 sdk/backupsearch/src/operation/list_search_job_results/_list_search_job_results_input.rs create mode 100644 sdk/backupsearch/src/operation/list_search_job_results/_list_search_job_results_output.rs create mode 100644 sdk/backupsearch/src/operation/list_search_job_results/builders.rs create mode 100644 sdk/backupsearch/src/operation/list_search_job_results/paginator.rs create mode 100644 sdk/backupsearch/src/operation/list_search_jobs.rs create mode 100644 sdk/backupsearch/src/operation/list_search_jobs/_list_search_jobs_input.rs create mode 100644 sdk/backupsearch/src/operation/list_search_jobs/_list_search_jobs_output.rs create mode 100644 sdk/backupsearch/src/operation/list_search_jobs/builders.rs create mode 100644 sdk/backupsearch/src/operation/list_search_jobs/paginator.rs create mode 100644 sdk/backupsearch/src/operation/list_search_result_export_jobs.rs create mode 100644 sdk/backupsearch/src/operation/list_search_result_export_jobs/_list_search_result_export_jobs_input.rs create mode 100644 sdk/backupsearch/src/operation/list_search_result_export_jobs/_list_search_result_export_jobs_output.rs create mode 100644 sdk/backupsearch/src/operation/list_search_result_export_jobs/builders.rs create mode 100644 sdk/backupsearch/src/operation/list_search_result_export_jobs/paginator.rs create mode 100644 sdk/backupsearch/src/operation/list_tags_for_resource.rs create mode 100644 sdk/backupsearch/src/operation/list_tags_for_resource/_list_tags_for_resource_input.rs create mode 100644 sdk/backupsearch/src/operation/list_tags_for_resource/_list_tags_for_resource_output.rs create mode 100644 sdk/backupsearch/src/operation/list_tags_for_resource/builders.rs create mode 100644 sdk/backupsearch/src/operation/start_search_job.rs create mode 100644 sdk/backupsearch/src/operation/start_search_job/_start_search_job_input.rs create mode 100644 sdk/backupsearch/src/operation/start_search_job/_start_search_job_output.rs create mode 100644 sdk/backupsearch/src/operation/start_search_job/builders.rs create mode 100644 sdk/backupsearch/src/operation/start_search_result_export_job.rs create mode 100644 sdk/backupsearch/src/operation/start_search_result_export_job/_start_search_result_export_job_input.rs create mode 100644 sdk/backupsearch/src/operation/start_search_result_export_job/_start_search_result_export_job_output.rs create mode 100644 sdk/backupsearch/src/operation/start_search_result_export_job/builders.rs create mode 100644 sdk/backupsearch/src/operation/stop_search_job.rs create mode 100644 sdk/backupsearch/src/operation/stop_search_job/_stop_search_job_input.rs create mode 100644 sdk/backupsearch/src/operation/stop_search_job/_stop_search_job_output.rs create mode 100644 sdk/backupsearch/src/operation/stop_search_job/builders.rs create mode 100644 sdk/backupsearch/src/operation/tag_resource.rs create mode 100644 sdk/backupsearch/src/operation/tag_resource/_tag_resource_input.rs create mode 100644 sdk/backupsearch/src/operation/tag_resource/_tag_resource_output.rs create mode 100644 sdk/backupsearch/src/operation/tag_resource/builders.rs create mode 100644 sdk/backupsearch/src/operation/untag_resource.rs create mode 100644 sdk/backupsearch/src/operation/untag_resource/_untag_resource_input.rs create mode 100644 sdk/backupsearch/src/operation/untag_resource/_untag_resource_output.rs create mode 100644 sdk/backupsearch/src/operation/untag_resource/builders.rs create mode 100644 sdk/backupsearch/src/primitives.rs create mode 100644 sdk/backupsearch/src/primitives/event_stream.rs create mode 100644 sdk/backupsearch/src/primitives/sealed_enum_unknown.rs create mode 100644 sdk/backupsearch/src/protocol_serde.rs create mode 100644 sdk/backupsearch/src/protocol_serde/shape_access_denied_exception.rs create mode 100644 sdk/backupsearch/src/protocol_serde/shape_backup_creation_time_filter.rs create mode 100644 sdk/backupsearch/src/protocol_serde/shape_conflict_exception.rs create mode 100644 sdk/backupsearch/src/protocol_serde/shape_current_search_progress.rs create mode 100644 sdk/backupsearch/src/protocol_serde/shape_ebs_item_filter.rs create mode 100644 sdk/backupsearch/src/protocol_serde/shape_ebs_item_filters.rs create mode 100644 sdk/backupsearch/src/protocol_serde/shape_ebs_result_item.rs create mode 100644 sdk/backupsearch/src/protocol_serde/shape_export_job_summaries.rs create mode 100644 sdk/backupsearch/src/protocol_serde/shape_export_job_summary.rs create mode 100644 sdk/backupsearch/src/protocol_serde/shape_export_specification.rs create mode 100644 sdk/backupsearch/src/protocol_serde/shape_get_search_job.rs create mode 100644 sdk/backupsearch/src/protocol_serde/shape_get_search_result_export_job.rs create mode 100644 sdk/backupsearch/src/protocol_serde/shape_internal_server_exception.rs create mode 100644 sdk/backupsearch/src/protocol_serde/shape_item_filters.rs create mode 100644 sdk/backupsearch/src/protocol_serde/shape_list_search_job_backups.rs create mode 100644 sdk/backupsearch/src/protocol_serde/shape_list_search_job_results.rs create mode 100644 sdk/backupsearch/src/protocol_serde/shape_list_search_jobs.rs create mode 100644 sdk/backupsearch/src/protocol_serde/shape_list_search_result_export_jobs.rs create mode 100644 sdk/backupsearch/src/protocol_serde/shape_list_tags_for_resource.rs create mode 100644 sdk/backupsearch/src/protocol_serde/shape_long_condition.rs create mode 100644 sdk/backupsearch/src/protocol_serde/shape_long_condition_list.rs create mode 100644 sdk/backupsearch/src/protocol_serde/shape_recovery_point_arn_list.rs create mode 100644 sdk/backupsearch/src/protocol_serde/shape_resource_arn_list.rs create mode 100644 sdk/backupsearch/src/protocol_serde/shape_resource_not_found_exception.rs create mode 100644 sdk/backupsearch/src/protocol_serde/shape_resource_type_list.rs create mode 100644 sdk/backupsearch/src/protocol_serde/shape_result_item.rs create mode 100644 sdk/backupsearch/src/protocol_serde/shape_results.rs create mode 100644 sdk/backupsearch/src/protocol_serde/shape_s3_export_specification.rs create mode 100644 sdk/backupsearch/src/protocol_serde/shape_s3_item_filter.rs create mode 100644 sdk/backupsearch/src/protocol_serde/shape_s3_item_filters.rs create mode 100644 sdk/backupsearch/src/protocol_serde/shape_s3_result_item.rs create mode 100644 sdk/backupsearch/src/protocol_serde/shape_search_job_backups_result.rs create mode 100644 sdk/backupsearch/src/protocol_serde/shape_search_job_backups_results.rs create mode 100644 sdk/backupsearch/src/protocol_serde/shape_search_job_summary.rs create mode 100644 sdk/backupsearch/src/protocol_serde/shape_search_jobs.rs create mode 100644 sdk/backupsearch/src/protocol_serde/shape_search_scope.rs create mode 100644 sdk/backupsearch/src/protocol_serde/shape_search_scope_summary.rs create mode 100644 sdk/backupsearch/src/protocol_serde/shape_service_quota_exceeded_exception.rs create mode 100644 sdk/backupsearch/src/protocol_serde/shape_start_search_job.rs create mode 100644 sdk/backupsearch/src/protocol_serde/shape_start_search_job_input.rs create mode 100644 sdk/backupsearch/src/protocol_serde/shape_start_search_result_export_job.rs create mode 100644 sdk/backupsearch/src/protocol_serde/shape_start_search_result_export_job_input.rs create mode 100644 sdk/backupsearch/src/protocol_serde/shape_stop_search_job.rs create mode 100644 sdk/backupsearch/src/protocol_serde/shape_string_condition.rs create mode 100644 sdk/backupsearch/src/protocol_serde/shape_string_condition_list.rs create mode 100644 sdk/backupsearch/src/protocol_serde/shape_tag_map.rs create mode 100644 sdk/backupsearch/src/protocol_serde/shape_tag_resource.rs create mode 100644 sdk/backupsearch/src/protocol_serde/shape_tag_resource_input.rs create mode 100644 sdk/backupsearch/src/protocol_serde/shape_throttling_exception.rs create mode 100644 sdk/backupsearch/src/protocol_serde/shape_time_condition.rs create mode 100644 sdk/backupsearch/src/protocol_serde/shape_time_condition_list.rs create mode 100644 sdk/backupsearch/src/protocol_serde/shape_untag_resource.rs create mode 100644 sdk/backupsearch/src/protocol_serde/shape_validation_exception.rs create mode 100644 sdk/backupsearch/src/sdk_feature_tracker.rs create mode 100644 sdk/backupsearch/src/serde_util.rs create mode 100644 sdk/backupsearch/src/serialization_settings.rs create mode 100644 sdk/backupsearch/src/types.rs create mode 100644 sdk/backupsearch/src/types/_backup_creation_time_filter.rs create mode 100644 sdk/backupsearch/src/types/_current_search_progress.rs create mode 100644 sdk/backupsearch/src/types/_ebs_item_filter.rs create mode 100644 sdk/backupsearch/src/types/_ebs_result_item.rs create mode 100644 sdk/backupsearch/src/types/_export_job_status.rs create mode 100644 sdk/backupsearch/src/types/_export_job_summary.rs create mode 100644 sdk/backupsearch/src/types/_export_specification.rs create mode 100644 sdk/backupsearch/src/types/_item_filters.rs create mode 100644 sdk/backupsearch/src/types/_long_condition.rs create mode 100644 sdk/backupsearch/src/types/_long_condition_operator.rs create mode 100644 sdk/backupsearch/src/types/_resource_type.rs create mode 100644 sdk/backupsearch/src/types/_result_item.rs create mode 100644 sdk/backupsearch/src/types/_s3_export_specification.rs create mode 100644 sdk/backupsearch/src/types/_s3_item_filter.rs create mode 100644 sdk/backupsearch/src/types/_s3_result_item.rs create mode 100644 sdk/backupsearch/src/types/_search_job_backups_result.rs create mode 100644 sdk/backupsearch/src/types/_search_job_state.rs create mode 100644 sdk/backupsearch/src/types/_search_job_summary.rs create mode 100644 sdk/backupsearch/src/types/_search_scope.rs create mode 100644 sdk/backupsearch/src/types/_search_scope_summary.rs create mode 100644 sdk/backupsearch/src/types/_string_condition.rs create mode 100644 sdk/backupsearch/src/types/_string_condition_operator.rs create mode 100644 sdk/backupsearch/src/types/_time_condition.rs create mode 100644 sdk/backupsearch/src/types/_time_condition_operator.rs create mode 100644 sdk/backupsearch/src/types/builders.rs create mode 100644 sdk/backupsearch/src/types/error.rs create mode 100644 sdk/backupsearch/src/types/error/_access_denied_exception.rs create mode 100644 sdk/backupsearch/src/types/error/_conflict_exception.rs create mode 100644 sdk/backupsearch/src/types/error/_internal_server_exception.rs create mode 100644 sdk/backupsearch/src/types/error/_resource_not_found_exception.rs create mode 100644 sdk/backupsearch/src/types/error/_service_quota_exceeded_exception.rs create mode 100644 sdk/backupsearch/src/types/error/_throttling_exception.rs create mode 100644 sdk/backupsearch/src/types/error/_validation_exception.rs create mode 100644 sdk/backupsearch/src/types/error/builders.rs create mode 100644 sdk/backupsearch/tests/endpoint_tests.rs create mode 100644 sdk/batch/src/protocol_serde/shape_eks_annotations_map.rs create mode 100644 sdk/batch/src/protocol_serde/shape_eks_persistent_volume_claim.rs create mode 100644 sdk/batch/src/types/_eks_persistent_volume_claim.rs create mode 100644 sdk/m2/src/types/_network_type.rs diff --git a/Cargo.toml b/Cargo.toml index f5e720188155..37d005bcb631 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -2,8 +2,8 @@ resolver = "2" exclude = [ "examples/lambda", - "examples/examples", "examples/cross_service", + "examples/examples", "examples/webassembly", "examples/test-utils", "tests/no-default-features", @@ -75,6 +75,7 @@ members = [ "sdk/b2bi", "sdk/backup", "sdk/backupgateway", + "sdk/backupsearch", "sdk/batch", "sdk/bcmdataexports", "sdk/bcmpricingcalculator", diff --git a/aws-models/account.json b/aws-models/account.json index 95a0177d57b3..09b328e8628a 100644 --- a/aws-models/account.json +++ b/aws-models/account.json @@ -123,6 +123,9 @@ "aws.auth#sigv4": { "name": "account" }, + "aws.endpoints#standardPartitionalEndpoints": { + "endpointPatternType": "service_region_dnsSuffix" + }, "aws.protocols#restJson1": {}, "smithy.api#cors": {}, "smithy.api#documentation": "

Operations for Amazon Web Services Account Management

", @@ -138,12 +141,6 @@ "smithy.rules#endpointRuleSet": { "version": "1.0", "parameters": { - "Region": { - "builtIn": "AWS::Region", - "required": false, - "documentation": "The AWS region used to dispatch the request.", - "type": "String" - }, "UseDualStack": { "builtIn": "AWS::UseDualStack", "required": true, @@ -163,6 +160,12 @@ "required": false, "documentation": "Override the endpoint used to send this request", "type": "String" + }, + "Region": { + "builtIn": "AWS::Region", + "required": false, + "documentation": "The AWS region used to dispatch the request.", + "type": "String" } }, "rules": [ @@ -194,263 +197,235 @@ "type": "error" }, { - "conditions": [ + "conditions": [], + "rules": [ { - "fn": "booleanEquals", - "argv": [ + "conditions": [ { - "ref": "UseDualStack" + "fn": "booleanEquals", + "argv": [ + { + "ref": "UseDualStack" + }, + true + ] + } + ], + "error": "Invalid Configuration: Dualstack and custom endpoint are not supported", + "type": "error" + }, + { + "conditions": [], + "endpoint": { + "url": { + "ref": "Endpoint" }, - true - ] + "properties": {}, + "headers": {} + }, + "type": "endpoint" } ], - "error": "Invalid Configuration: Dualstack and custom endpoint are not supported", - "type": "error" - }, - { - "conditions": [], - "endpoint": { - "url": { - "ref": "Endpoint" - }, - "properties": {}, - "headers": {} - }, - "type": "endpoint" + "type": "tree" } ], "type": "tree" }, { - "conditions": [ - { - "fn": "isSet", - "argv": [ - { - "ref": "Region" - } - ] - } - ], + "conditions": [], "rules": [ { "conditions": [ { - "fn": "aws.partition", + "fn": "isSet", "argv": [ { "ref": "Region" } - ], - "assign": "PartitionResult" + ] } ], "rules": [ { "conditions": [ { - "fn": "stringEquals", + "fn": "aws.partition", "argv": [ { - "fn": "getAttr", - "argv": [ - { - "ref": "PartitionResult" - }, - "name" - ] - }, - "aws" - ] - }, - { - "fn": "booleanEquals", - "argv": [ - { - "ref": "UseFIPS" - }, - false - ] - }, - { - "fn": "booleanEquals", - "argv": [ - { - "ref": "UseDualStack" - }, - false - ] + "ref": "Region" + } + ], + "assign": "PartitionResult" } ], - "endpoint": { - "url": "https://account.us-east-1.amazonaws.com", - "properties": { - "authSchemes": [ - { - "name": "sigv4", - "signingName": "account", - "signingRegion": "us-east-1" - } - ] - }, - "headers": {} - }, - "type": "endpoint" - }, - { - "conditions": [ + "rules": [ { - "fn": "stringEquals", - "argv": [ + "conditions": [ { - "fn": "getAttr", + "fn": "booleanEquals", "argv": [ { - "ref": "PartitionResult" + "ref": "UseFIPS" }, - "name" + true ] }, - "aws-cn" - ] - }, - { - "fn": "booleanEquals", - "argv": [ { - "ref": "UseFIPS" - }, - false - ] - }, - { - "fn": "booleanEquals", - "argv": [ + "fn": "booleanEquals", + "argv": [ + { + "ref": "UseDualStack" + }, + true + ] + } + ], + "rules": [ { - "ref": "UseDualStack" + "conditions": [ + { + "fn": "booleanEquals", + "argv": [ + true, + { + "fn": "getAttr", + "argv": [ + { + "ref": "PartitionResult" + }, + "supportsFIPS" + ] + } + ] + }, + { + "fn": "booleanEquals", + "argv": [ + true, + { + "fn": "getAttr", + "argv": [ + { + "ref": "PartitionResult" + }, + "supportsDualStack" + ] + } + ] + } + ], + "rules": [ + { + "conditions": [], + "endpoint": { + "url": "https://account-fips.{PartitionResult#implicitGlobalRegion}.{PartitionResult#dualStackDnsSuffix}", + "properties": { + "authSchemes": [ + { + "name": "sigv4", + "signingRegion": "{PartitionResult#implicitGlobalRegion}" + } + ] + }, + "headers": {} + }, + "type": "endpoint" + } + ], + "type": "tree" }, - false - ] - } - ], - "endpoint": { - "url": "https://account.cn-northwest-1.amazonaws.com.cn", - "properties": { - "authSchemes": [ { - "name": "sigv4", - "signingName": "account", - "signingRegion": "cn-northwest-1" + "conditions": [], + "error": "FIPS and DualStack are enabled, but this partition does not support one or both", + "type": "error" } - ] - }, - "headers": {} - }, - "type": "endpoint" - }, - { - "conditions": [ - { - "fn": "booleanEquals", - "argv": [ - { - "ref": "UseFIPS" - }, - true - ] + ], + "type": "tree" }, - { - "fn": "booleanEquals", - "argv": [ - { - "ref": "UseDualStack" - }, - true - ] - } - ], - "rules": [ { "conditions": [ { "fn": "booleanEquals", "argv": [ - true, { - "fn": "getAttr", - "argv": [ - { - "ref": "PartitionResult" - }, - "supportsFIPS" - ] - } + "ref": "UseFIPS" + }, + true ] }, { "fn": "booleanEquals", "argv": [ - true, { - "fn": "getAttr", + "ref": "UseDualStack" + }, + false + ] + } + ], + "rules": [ + { + "conditions": [ + { + "fn": "booleanEquals", "argv": [ { - "ref": "PartitionResult" + "fn": "getAttr", + "argv": [ + { + "ref": "PartitionResult" + }, + "supportsFIPS" + ] }, - "supportsDualStack" + true ] } - ] - } - ], - "rules": [ + ], + "rules": [ + { + "conditions": [], + "endpoint": { + "url": "https://account-fips.{PartitionResult#implicitGlobalRegion}.{PartitionResult#dnsSuffix}", + "properties": { + "authSchemes": [ + { + "name": "sigv4", + "signingRegion": "{PartitionResult#implicitGlobalRegion}" + } + ] + }, + "headers": {} + }, + "type": "endpoint" + } + ], + "type": "tree" + }, { "conditions": [], - "endpoint": { - "url": "https://account-fips.{Region}.{PartitionResult#dualStackDnsSuffix}", - "properties": {}, - "headers": {} - }, - "type": "endpoint" + "error": "FIPS is enabled but this partition does not support FIPS", + "type": "error" } ], "type": "tree" }, { - "conditions": [], - "error": "FIPS and DualStack are enabled, but this partition does not support one or both", - "type": "error" - } - ], - "type": "tree" - }, - { - "conditions": [ - { - "fn": "booleanEquals", - "argv": [ + "conditions": [ { - "ref": "UseFIPS" + "fn": "booleanEquals", + "argv": [ + { + "ref": "UseFIPS" + }, + false + ] }, - true - ] - } - ], - "rules": [ - { - "conditions": [ { "fn": "booleanEquals", "argv": [ { - "fn": "getAttr", - "argv": [ - { - "ref": "PartitionResult" - }, - "supportsFIPS" - ] + "ref": "UseDualStack" }, true ] @@ -458,127 +433,130 @@ ], "rules": [ { - "conditions": [], - "endpoint": { - "url": "https://account-fips.{Region}.{PartitionResult#dnsSuffix}", - "properties": {}, - "headers": {} - }, - "type": "endpoint" - } - ], - "type": "tree" - }, - { - "conditions": [], - "error": "FIPS is enabled but this partition does not support FIPS", - "type": "error" - } - ], - "type": "tree" - }, - { - "conditions": [ - { - "fn": "booleanEquals", - "argv": [ - { - "ref": "UseDualStack" - }, - true - ] - } - ], - "rules": [ - { - "conditions": [ - { - "fn": "booleanEquals", - "argv": [ - true, + "conditions": [ { - "fn": "getAttr", + "fn": "booleanEquals", "argv": [ + true, { - "ref": "PartitionResult" - }, - "supportsDualStack" + "fn": "getAttr", + "argv": [ + { + "ref": "PartitionResult" + }, + "supportsDualStack" + ] + } ] } - ] - } - ], - "rules": [ + ], + "rules": [ + { + "conditions": [], + "endpoint": { + "url": "https://account.{PartitionResult#implicitGlobalRegion}.{PartitionResult#dualStackDnsSuffix}", + "properties": { + "authSchemes": [ + { + "name": "sigv4", + "signingRegion": "{PartitionResult#implicitGlobalRegion}" + } + ] + }, + "headers": {} + }, + "type": "endpoint" + } + ], + "type": "tree" + }, { "conditions": [], - "endpoint": { - "url": "https://account.{Region}.{PartitionResult#dualStackDnsSuffix}", - "properties": {}, - "headers": {} - }, - "type": "endpoint" + "error": "DualStack is enabled but this partition does not support DualStack", + "type": "error" } ], "type": "tree" }, { "conditions": [], - "error": "DualStack is enabled but this partition does not support DualStack", - "type": "error" + "endpoint": { + "url": "https://account.{PartitionResult#implicitGlobalRegion}.{PartitionResult#dnsSuffix}", + "properties": { + "authSchemes": [ + { + "name": "sigv4", + "signingRegion": "{PartitionResult#implicitGlobalRegion}" + } + ] + }, + "headers": {} + }, + "type": "endpoint" } ], "type": "tree" - }, - { - "conditions": [], - "endpoint": { - "url": "https://account.{Region}.{PartitionResult#dnsSuffix}", - "properties": {}, - "headers": {} - }, - "type": "endpoint" } ], "type": "tree" + }, + { + "conditions": [], + "error": "Invalid Configuration: Missing Region", + "type": "error" } ], "type": "tree" - }, - { - "conditions": [], - "error": "Invalid Configuration: Missing Region", - "type": "error" } ] }, "smithy.rules#endpointTests": { "testCases": [ { - "documentation": "For region aws-global with FIPS disabled and DualStack disabled", + "documentation": "For custom endpoint with region not set and fips disabled", "expect": { "endpoint": { - "properties": { - "authSchemes": [ - { - "name": "sigv4", - "signingName": "account", - "signingRegion": "us-east-1" - } - ] - }, - "url": "https://account.us-east-1.amazonaws.com" + "url": "https://example.com" } }, "params": { - "Region": "aws-global", + "Endpoint": "https://example.com", + "UseFIPS": false + } + }, + { + "documentation": "For custom endpoint with fips enabled", + "expect": { + "error": "Invalid Configuration: FIPS and custom endpoint are not supported" + }, + "params": { + "Endpoint": "https://example.com", + "UseFIPS": true + } + }, + { + "documentation": "For custom endpoint with fips disabled and dualstack enabled", + "expect": { + "error": "Invalid Configuration: Dualstack and custom endpoint are not supported" + }, + "params": { + "Endpoint": "https://example.com", "UseFIPS": false, - "UseDualStack": false + "UseDualStack": true } }, { "documentation": "For region us-east-1 with FIPS enabled and DualStack enabled", "expect": { "endpoint": { + "properties": { + "authSchemes": [ + { + "name": "sigv4", + "signingRegion": "us-east-1" + } + ] + }, "url": "https://account-fips.us-east-1.api.aws" } }, @@ -592,6 +570,14 @@ "documentation": "For region us-east-1 with FIPS enabled and DualStack disabled", "expect": { "endpoint": { + "properties": { + "authSchemes": [ + { + "name": "sigv4", + "signingRegion": "us-east-1" + } + ] + }, "url": "https://account-fips.us-east-1.amazonaws.com" } }, @@ -605,6 +591,14 @@ "documentation": "For region us-east-1 with FIPS disabled and DualStack enabled", "expect": { "endpoint": { + "properties": { + "authSchemes": [ + { + "name": "sigv4", + "signingRegion": "us-east-1" + } + ] + }, "url": "https://account.us-east-1.api.aws" } }, @@ -622,7 +616,6 @@ "authSchemes": [ { "name": "sigv4", - "signingName": "account", "signingRegion": "us-east-1" } ] @@ -637,75 +630,76 @@ } }, { - "documentation": "For region aws-cn-global with FIPS disabled and DualStack disabled", + "documentation": "For region cn-northwest-1 with FIPS enabled and DualStack enabled", "expect": { "endpoint": { "properties": { "authSchemes": [ { "name": "sigv4", - "signingName": "account", "signingRegion": "cn-northwest-1" } ] }, - "url": "https://account.cn-northwest-1.amazonaws.com.cn" + "url": "https://account-fips.cn-northwest-1.api.amazonwebservices.com.cn" } }, "params": { - "Region": "aws-cn-global", - "UseFIPS": false, - "UseDualStack": false - } - }, - { - "documentation": "For region cn-north-1 with FIPS enabled and DualStack enabled", - "expect": { - "endpoint": { - "url": "https://account-fips.cn-north-1.api.amazonwebservices.com.cn" - } - }, - "params": { - "Region": "cn-north-1", + "Region": "cn-northwest-1", "UseFIPS": true, "UseDualStack": true } }, { - "documentation": "For region cn-north-1 with FIPS enabled and DualStack disabled", + "documentation": "For region cn-northwest-1 with FIPS enabled and DualStack disabled", "expect": { "endpoint": { - "url": "https://account-fips.cn-north-1.amazonaws.com.cn" + "properties": { + "authSchemes": [ + { + "name": "sigv4", + "signingRegion": "cn-northwest-1" + } + ] + }, + "url": "https://account-fips.cn-northwest-1.amazonaws.com.cn" } }, "params": { - "Region": "cn-north-1", + "Region": "cn-northwest-1", "UseFIPS": true, "UseDualStack": false } }, { - "documentation": "For region cn-north-1 with FIPS disabled and DualStack enabled", + "documentation": "For region cn-northwest-1 with FIPS disabled and DualStack enabled", "expect": { "endpoint": { - "url": "https://account.cn-north-1.api.amazonwebservices.com.cn" + "properties": { + "authSchemes": [ + { + "name": "sigv4", + "signingRegion": "cn-northwest-1" + } + ] + }, + "url": "https://account.cn-northwest-1.api.amazonwebservices.com.cn" } }, "params": { - "Region": "cn-north-1", + "Region": "cn-northwest-1", "UseFIPS": false, "UseDualStack": true } }, { - "documentation": "For region cn-north-1 with FIPS disabled and DualStack disabled", + "documentation": "For region cn-northwest-1 with FIPS disabled and DualStack disabled", "expect": { "endpoint": { "properties": { "authSchemes": [ { "name": "sigv4", - "signingName": "account", "signingRegion": "cn-northwest-1" } ] @@ -714,59 +708,91 @@ } }, "params": { - "Region": "cn-north-1", + "Region": "cn-northwest-1", "UseFIPS": false, "UseDualStack": false } }, { - "documentation": "For region us-gov-east-1 with FIPS enabled and DualStack enabled", + "documentation": "For region us-gov-west-1 with FIPS enabled and DualStack enabled", "expect": { "endpoint": { - "url": "https://account-fips.us-gov-east-1.api.aws" + "properties": { + "authSchemes": [ + { + "name": "sigv4", + "signingRegion": "us-gov-west-1" + } + ] + }, + "url": "https://account-fips.us-gov-west-1.api.aws" } }, "params": { - "Region": "us-gov-east-1", + "Region": "us-gov-west-1", "UseFIPS": true, "UseDualStack": true } }, { - "documentation": "For region us-gov-east-1 with FIPS enabled and DualStack disabled", + "documentation": "For region us-gov-west-1 with FIPS enabled and DualStack disabled", "expect": { "endpoint": { - "url": "https://account-fips.us-gov-east-1.amazonaws.com" + "properties": { + "authSchemes": [ + { + "name": "sigv4", + "signingRegion": "us-gov-west-1" + } + ] + }, + "url": "https://account-fips.us-gov-west-1.amazonaws.com" } }, "params": { - "Region": "us-gov-east-1", + "Region": "us-gov-west-1", "UseFIPS": true, "UseDualStack": false } }, { - "documentation": "For region us-gov-east-1 with FIPS disabled and DualStack enabled", + "documentation": "For region us-gov-west-1 with FIPS disabled and DualStack enabled", "expect": { "endpoint": { - "url": "https://account.us-gov-east-1.api.aws" + "properties": { + "authSchemes": [ + { + "name": "sigv4", + "signingRegion": "us-gov-west-1" + } + ] + }, + "url": "https://account.us-gov-west-1.api.aws" } }, "params": { - "Region": "us-gov-east-1", + "Region": "us-gov-west-1", "UseFIPS": false, "UseDualStack": true } }, { - "documentation": "For region us-gov-east-1 with FIPS disabled and DualStack disabled", + "documentation": "For region us-gov-west-1 with FIPS disabled and DualStack disabled", "expect": { "endpoint": { - "url": "https://account.us-gov-east-1.amazonaws.com" + "properties": { + "authSchemes": [ + { + "name": "sigv4", + "signingRegion": "us-gov-west-1" + } + ] + }, + "url": "https://account.us-gov-west-1.amazonaws.com" } }, "params": { - "Region": "us-gov-east-1", + "Region": "us-gov-west-1", "UseFIPS": false, "UseDualStack": false } @@ -786,6 +812,14 @@ "documentation": "For region us-iso-east-1 with FIPS enabled and DualStack disabled", "expect": { "endpoint": { + "properties": { + "authSchemes": [ + { + "name": "sigv4", + "signingRegion": "us-iso-east-1" + } + ] + }, "url": "https://account-fips.us-iso-east-1.c2s.ic.gov" } }, @@ -810,6 +844,14 @@ "documentation": "For region us-iso-east-1 with FIPS disabled and DualStack disabled", "expect": { "endpoint": { + "properties": { + "authSchemes": [ + { + "name": "sigv4", + "signingRegion": "us-iso-east-1" + } + ] + }, "url": "https://account.us-iso-east-1.c2s.ic.gov" } }, @@ -834,6 +876,14 @@ "documentation": "For region us-isob-east-1 with FIPS enabled and DualStack disabled", "expect": { "endpoint": { + "properties": { + "authSchemes": [ + { + "name": "sigv4", + "signingRegion": "us-isob-east-1" + } + ] + }, "url": "https://account-fips.us-isob-east-1.sc2s.sgov.gov" } }, @@ -858,6 +908,14 @@ "documentation": "For region us-isob-east-1 with FIPS disabled and DualStack disabled", "expect": { "endpoint": { + "properties": { + "authSchemes": [ + { + "name": "sigv4", + "signingRegion": "us-isob-east-1" + } + ] + }, "url": "https://account.us-isob-east-1.sc2s.sgov.gov" } }, @@ -868,54 +926,131 @@ } }, { - "documentation": "For custom endpoint with region set and fips disabled and dualstack disabled", + "documentation": "For region eu-isoe-west-1 with FIPS enabled and DualStack enabled", + "expect": { + "error": "FIPS and DualStack are enabled, but this partition does not support one or both" + }, + "params": { + "Region": "eu-isoe-west-1", + "UseFIPS": true, + "UseDualStack": true + } + }, + { + "documentation": "For region eu-isoe-west-1 with FIPS enabled and DualStack disabled", "expect": { "endpoint": { - "url": "https://example.com" + "properties": { + "authSchemes": [ + { + "name": "sigv4", + "signingRegion": "eu-isoe-west-1" + } + ] + }, + "url": "https://account-fips.eu-isoe-west-1.cloud.adc-e.uk" } }, "params": { - "Region": "us-east-1", + "Region": "eu-isoe-west-1", + "UseFIPS": true, + "UseDualStack": false + } + }, + { + "documentation": "For region eu-isoe-west-1 with FIPS disabled and DualStack enabled", + "expect": { + "error": "DualStack is enabled but this partition does not support DualStack" + }, + "params": { + "Region": "eu-isoe-west-1", "UseFIPS": false, - "UseDualStack": false, - "Endpoint": "https://example.com" + "UseDualStack": true } }, { - "documentation": "For custom endpoint with region not set and fips disabled and dualstack disabled", + "documentation": "For region eu-isoe-west-1 with FIPS disabled and DualStack disabled", "expect": { "endpoint": { - "url": "https://example.com" + "properties": { + "authSchemes": [ + { + "name": "sigv4", + "signingRegion": "eu-isoe-west-1" + } + ] + }, + "url": "https://account.eu-isoe-west-1.cloud.adc-e.uk" } }, "params": { + "Region": "eu-isoe-west-1", "UseFIPS": false, - "UseDualStack": false, - "Endpoint": "https://example.com" + "UseDualStack": false } }, { - "documentation": "For custom endpoint with fips enabled and dualstack disabled", + "documentation": "For region us-isof-south-1 with FIPS enabled and DualStack enabled", "expect": { - "error": "Invalid Configuration: FIPS and custom endpoint are not supported" + "error": "FIPS and DualStack are enabled, but this partition does not support one or both" }, "params": { - "Region": "us-east-1", + "Region": "us-isof-south-1", "UseFIPS": true, - "UseDualStack": false, - "Endpoint": "https://example.com" + "UseDualStack": true } }, { - "documentation": "For custom endpoint with fips disabled and dualstack enabled", + "documentation": "For region us-isof-south-1 with FIPS enabled and DualStack disabled", "expect": { - "error": "Invalid Configuration: Dualstack and custom endpoint are not supported" + "endpoint": { + "properties": { + "authSchemes": [ + { + "name": "sigv4", + "signingRegion": "us-isof-south-1" + } + ] + }, + "url": "https://account-fips.us-isof-south-1.csp.hci.ic.gov" + } }, "params": { - "Region": "us-east-1", + "Region": "us-isof-south-1", + "UseFIPS": true, + "UseDualStack": false + } + }, + { + "documentation": "For region us-isof-south-1 with FIPS disabled and DualStack enabled", + "expect": { + "error": "DualStack is enabled but this partition does not support DualStack" + }, + "params": { + "Region": "us-isof-south-1", + "UseFIPS": false, + "UseDualStack": true + } + }, + { + "documentation": "For region us-isof-south-1 with FIPS disabled and DualStack disabled", + "expect": { + "endpoint": { + "properties": { + "authSchemes": [ + { + "name": "sigv4", + "signingRegion": "us-isof-south-1" + } + ] + }, + "url": "https://account.us-isof-south-1.csp.hci.ic.gov" + } + }, + "params": { + "Region": "us-isof-south-1", "UseFIPS": false, - "UseDualStack": true, - "Endpoint": "https://example.com" + "UseDualStack": false } }, { diff --git a/aws-models/backup.json b/aws-models/backup.json index b99cf3683b7f..0b959d5a089d 100644 --- a/aws-models/backup.json +++ b/aws-models/backup.json @@ -743,6 +743,12 @@ "traits": { "smithy.api#documentation": "

The timezone in which the schedule expression is set. By default, \n ScheduleExpressions are in UTC. You can modify this to a specified timezone.

" } + }, + "IndexActions": { + "target": "com.amazonaws.backup#IndexActions", + "traits": { + "smithy.api#documentation": "

IndexActions is an array you use to specify how backup data should \n be indexed.

\n

eEach BackupRule can have 0 or 1 IndexAction, as each backup can have up \n to one index associated with it.

\n

Within the array is ResourceType. Only one will be accepted for each BackupRule.

" + } } }, "traits": { @@ -813,6 +819,12 @@ "traits": { "smithy.api#documentation": "

The timezone in which the schedule expression is set. By default, \n ScheduleExpressions are in UTC. You can modify this to a specified timezone.

" } + }, + "IndexActions": { + "target": "com.amazonaws.backup#IndexActions", + "traits": { + "smithy.api#documentation": "

There can up to one IndexAction in each BackupRule, as each backup \n can have 0 or 1 backup index associated with it.

\n

Within the array is ResourceTypes. Only 1 resource type will \n be accepted for each BackupRule. Valid values:

\n " + } } }, "traits": { @@ -2850,6 +2862,9 @@ { "target": "com.amazonaws.backup#GetLegalHold" }, + { + "target": "com.amazonaws.backup#GetRecoveryPointIndexDetails" + }, { "target": "com.amazonaws.backup#GetRecoveryPointRestoreMetadata" }, @@ -2898,6 +2913,9 @@ { "target": "com.amazonaws.backup#ListFrameworks" }, + { + "target": "com.amazonaws.backup#ListIndexedRecoveryPoints" + }, { "target": "com.amazonaws.backup#ListLegalHolds" }, @@ -2982,6 +3000,9 @@ { "target": "com.amazonaws.backup#UpdateGlobalSettings" }, + { + "target": "com.amazonaws.backup#UpdateRecoveryPointIndexSettings" + }, { "target": "com.amazonaws.backup#UpdateRecoveryPointLifecycle" }, @@ -5475,6 +5496,18 @@ "traits": { "smithy.api#documentation": "

The type of vault in which the described recovery point is stored.

" } + }, + "IndexStatus": { + "target": "com.amazonaws.backup#IndexStatus", + "traits": { + "smithy.api#documentation": "

This is the current status for the backup index associated with the specified recovery\n point.

\n

Statuses are: PENDING | ACTIVE | FAILED |\n DELETING\n

\n

A recovery point with an index that has the status of ACTIVE can be\n included in a search.

" + } + }, + "IndexStatusMessage": { + "target": "com.amazonaws.backup#string", + "traits": { + "smithy.api#documentation": "

A string in the form of a detailed message explaining the status of a backup index\n associated with the recovery point.

" + } } }, "traits": { @@ -6717,6 +6750,124 @@ "smithy.api#output": {} } }, + "com.amazonaws.backup#GetRecoveryPointIndexDetails": { + "type": "operation", + "input": { + "target": "com.amazonaws.backup#GetRecoveryPointIndexDetailsInput" + }, + "output": { + "target": "com.amazonaws.backup#GetRecoveryPointIndexDetailsOutput" + }, + "errors": [ + { + "target": "com.amazonaws.backup#InvalidParameterValueException" + }, + { + "target": "com.amazonaws.backup#MissingParameterValueException" + }, + { + "target": "com.amazonaws.backup#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.backup#ServiceUnavailableException" + } + ], + "traits": { + "smithy.api#documentation": "

This operation returns the metadata and details specific to \n the backup index associated with the specified recovery point.

", + "smithy.api#http": { + "method": "GET", + "uri": "/backup-vaults/{BackupVaultName}/recovery-points/{RecoveryPointArn}/index", + "code": 200 + }, + "smithy.api#idempotent": {} + } + }, + "com.amazonaws.backup#GetRecoveryPointIndexDetailsInput": { + "type": "structure", + "members": { + "BackupVaultName": { + "target": "com.amazonaws.backup#BackupVaultName", + "traits": { + "smithy.api#documentation": "

The name of a logical container where backups are stored. Backup vaults are identified\n by names that are unique to the account used to create them and the Region where they are\n created.

\n

Accepted characters include lowercase letters, numbers, and hyphens.

", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "RecoveryPointArn": { + "target": "com.amazonaws.backup#ARN", + "traits": { + "smithy.api#documentation": "

An ARN that uniquely identifies a recovery point; for example,\n arn:aws:backup:us-east-1:123456789012:recovery-point:1EB3B5E7-9EB0-435A-A80B-108B488B0D45.

", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.backup#GetRecoveryPointIndexDetailsOutput": { + "type": "structure", + "members": { + "RecoveryPointArn": { + "target": "com.amazonaws.backup#ARN", + "traits": { + "smithy.api#documentation": "

An ARN that uniquely identifies a recovery point; for example,\n arn:aws:backup:us-east-1:123456789012:recovery-point:1EB3B5E7-9EB0-435A-A80B-108B488B0D45.

" + } + }, + "BackupVaultArn": { + "target": "com.amazonaws.backup#ARN", + "traits": { + "smithy.api#documentation": "

An ARN that uniquely identifies the backup vault where the recovery \n point index is stored.

\n

For example,\n arn:aws:backup:us-east-1:123456789012:backup-vault:aBackupVault.

" + } + }, + "SourceResourceArn": { + "target": "com.amazonaws.backup#ARN", + "traits": { + "smithy.api#documentation": "

A string of the Amazon Resource Name (ARN) that uniquely identifies \n the source resource.

" + } + }, + "IndexCreationDate": { + "target": "com.amazonaws.backup#timestamp", + "traits": { + "smithy.api#documentation": "

The date and time that a backup index was created, in Unix format and Coordinated\n Universal Time (UTC). The value of CreationDate is accurate to milliseconds.\n For example, the value 1516925490.087 represents Friday, January 26, 2018 12:11:30.087\n AM.

" + } + }, + "IndexDeletionDate": { + "target": "com.amazonaws.backup#timestamp", + "traits": { + "smithy.api#documentation": "

The date and time that a backup index was deleted, in Unix format and Coordinated\n Universal Time (UTC). The value of CreationDate is accurate to milliseconds.\n For example, the value 1516925490.087 represents Friday, January 26, 2018 12:11:30.087\n AM.

" + } + }, + "IndexCompletionDate": { + "target": "com.amazonaws.backup#timestamp", + "traits": { + "smithy.api#documentation": "

The date and time that a backup index finished creation, in Unix format and Coordinated\n Universal Time (UTC). The value of CreationDate is accurate to milliseconds.\n For example, the value 1516925490.087 represents Friday, January 26, 2018 12:11:30.087\n AM.

" + } + }, + "IndexStatus": { + "target": "com.amazonaws.backup#IndexStatus", + "traits": { + "smithy.api#documentation": "

This is the current status for the backup index associated \n with the specified recovery point.

\n

Statuses are: PENDING | ACTIVE | FAILED | DELETING\n

\n

A recovery point with an index that has the status of ACTIVE \n can be included in a search.

" + } + }, + "IndexStatusMessage": { + "target": "com.amazonaws.backup#string", + "traits": { + "smithy.api#documentation": "

A detailed message explaining the status of a backup index associated \n with the recovery point.

" + } + }, + "TotalItemsIndexed": { + "target": "com.amazonaws.backup#Long", + "traits": { + "smithy.api#documentation": "

Count of items within the backup index associated with the \n recovery point.

" + } + } + }, + "traits": { + "smithy.api#output": {} + } + }, "com.amazonaws.backup#GetRecoveryPointRestoreMetadata": { "type": "operation", "input": { @@ -7133,6 +7284,140 @@ "com.amazonaws.backup#IAMRoleArn": { "type": "string" }, + "com.amazonaws.backup#Index": { + "type": "enum", + "members": { + "ENABLED": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "ENABLED" + } + }, + "DISABLED": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "DISABLED" + } + } + } + }, + "com.amazonaws.backup#IndexAction": { + "type": "structure", + "members": { + "ResourceTypes": { + "target": "com.amazonaws.backup#ResourceTypes", + "traits": { + "smithy.api#documentation": "

0 or 1 index action will be accepted for each BackupRule.

\n

Valid values:

\n " + } + } + }, + "traits": { + "smithy.api#documentation": "

This is an optional array within a BackupRule.

\n

IndexAction consists of one ResourceTypes.

" + } + }, + "com.amazonaws.backup#IndexActions": { + "type": "list", + "member": { + "target": "com.amazonaws.backup#IndexAction" + } + }, + "com.amazonaws.backup#IndexStatus": { + "type": "enum", + "members": { + "PENDING": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "PENDING" + } + }, + "ACTIVE": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "ACTIVE" + } + }, + "FAILED": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "FAILED" + } + }, + "DELETING": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "DELETING" + } + } + } + }, + "com.amazonaws.backup#IndexedRecoveryPoint": { + "type": "structure", + "members": { + "RecoveryPointArn": { + "target": "com.amazonaws.backup#ARN", + "traits": { + "smithy.api#documentation": "

An ARN that uniquely identifies a recovery point; for example,\n arn:aws:backup:us-east-1:123456789012:recovery-point:1EB3B5E7-9EB0-435A-A80B-108B488B0D45\n

" + } + }, + "SourceResourceArn": { + "target": "com.amazonaws.backup#ARN", + "traits": { + "smithy.api#documentation": "

A string of the Amazon Resource Name (ARN) that uniquely identifies \n the source resource.

" + } + }, + "IamRoleArn": { + "target": "com.amazonaws.backup#ARN", + "traits": { + "smithy.api#documentation": "

This specifies the IAM role ARN used for this operation.

\n

For example, arn:aws:iam::123456789012:role/S3Access

" + } + }, + "BackupCreationDate": { + "target": "com.amazonaws.backup#timestamp", + "traits": { + "smithy.api#documentation": "

The date and time that a backup was created, in Unix format and Coordinated\n Universal Time (UTC). The value of CreationDate is accurate to milliseconds.\n For example, the value 1516925490.087 represents Friday, January 26, 2018 12:11:30.087\n AM.

" + } + }, + "ResourceType": { + "target": "com.amazonaws.backup#ResourceType", + "traits": { + "smithy.api#documentation": "

The resource type of the indexed recovery point.

\n " + } + }, + "IndexCreationDate": { + "target": "com.amazonaws.backup#timestamp", + "traits": { + "smithy.api#documentation": "

The date and time that a backup index was created, in Unix format and Coordinated\n Universal Time (UTC). The value of CreationDate is accurate to milliseconds.\n For example, the value 1516925490.087 represents Friday, January 26, 2018 12:11:30.087\n AM.

" + } + }, + "IndexStatus": { + "target": "com.amazonaws.backup#IndexStatus", + "traits": { + "smithy.api#documentation": "

This is the current status for the backup index associated \n with the specified recovery point.

\n

Statuses are: PENDING | ACTIVE | FAILED | DELETING\n

\n

A recovery point with an index that has the status of ACTIVE \n can be included in a search.

" + } + }, + "IndexStatusMessage": { + "target": "com.amazonaws.backup#string", + "traits": { + "smithy.api#documentation": "

A string in the form of a detailed message explaining the status of a backup index associated \n with the recovery point.

" + } + }, + "BackupVaultArn": { + "target": "com.amazonaws.backup#ARN", + "traits": { + "smithy.api#documentation": "

An ARN that uniquely identifies the backup vault where the recovery \n point index is stored.

\n

For example,\n arn:aws:backup:us-east-1:123456789012:backup-vault:aBackupVault.

" + } + } + }, + "traits": { + "smithy.api#documentation": "

This is a recovery point that has an associated backup index.

\n

Only recovery points with a backup index can be \n included in a search.

" + } + }, + "com.amazonaws.backup#IndexedRecoveryPointList": { + "type": "list", + "member": { + "target": "com.amazonaws.backup#IndexedRecoveryPoint" + } + }, "com.amazonaws.backup#InvalidParameterValueException": { "type": "structure", "members": { @@ -8422,6 +8707,118 @@ "smithy.api#output": {} } }, + "com.amazonaws.backup#ListIndexedRecoveryPoints": { + "type": "operation", + "input": { + "target": "com.amazonaws.backup#ListIndexedRecoveryPointsInput" + }, + "output": { + "target": "com.amazonaws.backup#ListIndexedRecoveryPointsOutput" + }, + "errors": [ + { + "target": "com.amazonaws.backup#InvalidParameterValueException" + }, + { + "target": "com.amazonaws.backup#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.backup#ServiceUnavailableException" + } + ], + "traits": { + "smithy.api#documentation": "

This operation returns a list of recovery points that have an \n associated index, belonging to the specified account.

\n

Optional parameters you can include are: MaxResults; \n NextToken; SourceResourceArns; CreatedBefore; CreatedAfter; \n and ResourceType.

", + "smithy.api#http": { + "method": "GET", + "uri": "/indexes/recovery-point", + "code": 200 + }, + "smithy.api#idempotent": {}, + "smithy.api#paginated": { + "inputToken": "NextToken", + "outputToken": "NextToken", + "items": "IndexedRecoveryPoints", + "pageSize": "MaxResults" + } + } + }, + "com.amazonaws.backup#ListIndexedRecoveryPointsInput": { + "type": "structure", + "members": { + "NextToken": { + "target": "com.amazonaws.backup#string", + "traits": { + "smithy.api#documentation": "

The next item following a partial list of returned recovery points.

\n

For example, if a request\n is made to return MaxResults number of indexed recovery points, NextToken\n allows you to return more items in your list starting at the location pointed to by the\n next token.

", + "smithy.api#httpQuery": "nextToken" + } + }, + "MaxResults": { + "target": "com.amazonaws.backup#MaxResults", + "traits": { + "smithy.api#documentation": "

The maximum number of resource list items to be returned.

", + "smithy.api#httpQuery": "maxResults" + } + }, + "SourceResourceArn": { + "target": "com.amazonaws.backup#ARN", + "traits": { + "smithy.api#documentation": "

A string of the Amazon Resource Name (ARN) that uniquely identifies \n the source resource.

", + "smithy.api#httpQuery": "sourceResourceArn" + } + }, + "CreatedBefore": { + "target": "com.amazonaws.backup#timestamp", + "traits": { + "smithy.api#documentation": "

Returns only indexed recovery points that were created before the \n specified date.

", + "smithy.api#httpQuery": "createdBefore" + } + }, + "CreatedAfter": { + "target": "com.amazonaws.backup#timestamp", + "traits": { + "smithy.api#documentation": "

Returns only indexed recovery points that were created after the \n specified date.

", + "smithy.api#httpQuery": "createdAfter" + } + }, + "ResourceType": { + "target": "com.amazonaws.backup#ResourceType", + "traits": { + "smithy.api#documentation": "

Returns a list of indexed recovery points for the specified \n resource type(s).

\n

Accepted values include:

\n ", + "smithy.api#httpQuery": "resourceType" + } + }, + "IndexStatus": { + "target": "com.amazonaws.backup#IndexStatus", + "traits": { + "smithy.api#documentation": "

Include this parameter to filter the returned list by \n the indicated statuses.

\n

Accepted values: PENDING | ACTIVE | FAILED | DELETING\n

\n

A recovery point with an index that has the status of ACTIVE \n can be included in a search.

", + "smithy.api#httpQuery": "indexStatus" + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.backup#ListIndexedRecoveryPointsOutput": { + "type": "structure", + "members": { + "IndexedRecoveryPoints": { + "target": "com.amazonaws.backup#IndexedRecoveryPointList", + "traits": { + "smithy.api#documentation": "

This is a list of recovery points that have an \n associated index, belonging to the specified account.

" + } + }, + "NextToken": { + "target": "com.amazonaws.backup#string", + "traits": { + "smithy.api#documentation": "

The next item following a partial list of returned recovery points.

\n

For example, if a request\n is made to return MaxResults number of indexed recovery points, NextToken\n allows you to return more items in your list starting at the location pointed to by the\n next token.

" + } + } + }, + "traits": { + "smithy.api#output": {} + } + }, "com.amazonaws.backup#ListLegalHolds": { "type": "operation", "input": { @@ -10316,6 +10713,18 @@ "traits": { "smithy.api#documentation": "

The type of vault in which the described recovery point is stored.

" } + }, + "IndexStatus": { + "target": "com.amazonaws.backup#IndexStatus", + "traits": { + "smithy.api#documentation": "

This is the current status for the backup index associated \n with the specified recovery point.

\n

Statuses are: PENDING | ACTIVE | FAILED |\n DELETING\n

\n

A recovery point with an index that has the status of ACTIVE \n can be included in a search.

" + } + }, + "IndexStatusMessage": { + "target": "com.amazonaws.backup#string", + "traits": { + "smithy.api#documentation": "

A string in the form of a detailed message explaining the status of a backup index associated \n with the recovery point.

" + } } }, "traits": { @@ -10397,6 +10806,18 @@ "traits": { "smithy.api#documentation": "

The type of vault in which the described recovery point is \n stored.

" } + }, + "IndexStatus": { + "target": "com.amazonaws.backup#IndexStatus", + "traits": { + "smithy.api#documentation": "

This is the current status for the backup index associated \n with the specified recovery point.

\n

Statuses are: PENDING | ACTIVE | FAILED | DELETING\n

\n

A recovery point with an index that has the status of ACTIVE \n can be included in a search.

" + } + }, + "IndexStatusMessage": { + "target": "com.amazonaws.backup#string", + "traits": { + "smithy.api#documentation": "

A string in the form of a detailed message explaining the status of a backup index\n associated with the recovery point.

" + } } }, "traits": { @@ -11851,6 +12272,12 @@ "traits": { "smithy.api#documentation": "

The backup option for a selected resource. This option is only available for\n Windows Volume Shadow Copy Service (VSS) backup jobs.

\n

Valid values: Set to \"WindowsVSS\":\"enabled\" to enable the\n WindowsVSS backup option and create a Windows VSS backup. Set to\n \"WindowsVSS\"\"disabled\" to create a regular backup. The\n WindowsVSS option is not enabled by default.

" } + }, + "Index": { + "target": "com.amazonaws.backup#Index", + "traits": { + "smithy.api#documentation": "

Include this parameter to enable index creation if your backup \n job has a resource type that supports backup indexes.

\n

Resource types that support backup indexes include:

\n \n

Index can have 1 of 2 possible values, either ENABLED or \n DISABLED.

\n

To create a backup index for an eligible ACTIVE recovery point \n that does not yet have a backup index, set value to ENABLED.

\n

To delete a backup index, set value to DISABLED.

" + } } }, "traits": { @@ -12621,6 +13048,110 @@ "smithy.api#input": {} } }, + "com.amazonaws.backup#UpdateRecoveryPointIndexSettings": { + "type": "operation", + "input": { + "target": "com.amazonaws.backup#UpdateRecoveryPointIndexSettingsInput" + }, + "output": { + "target": "com.amazonaws.backup#UpdateRecoveryPointIndexSettingsOutput" + }, + "errors": [ + { + "target": "com.amazonaws.backup#InvalidParameterValueException" + }, + { + "target": "com.amazonaws.backup#InvalidRequestException" + }, + { + "target": "com.amazonaws.backup#MissingParameterValueException" + }, + { + "target": "com.amazonaws.backup#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.backup#ServiceUnavailableException" + } + ], + "traits": { + "smithy.api#documentation": "

This operation updates the settings of a recovery point index.

\n

Required: BackupVaultName, RecoveryPointArn, and IAMRoleArn

", + "smithy.api#http": { + "method": "POST", + "uri": "/backup-vaults/{BackupVaultName}/recovery-points/{RecoveryPointArn}/index", + "code": 200 + }, + "smithy.api#idempotent": {} + } + }, + "com.amazonaws.backup#UpdateRecoveryPointIndexSettingsInput": { + "type": "structure", + "members": { + "BackupVaultName": { + "target": "com.amazonaws.backup#BackupVaultName", + "traits": { + "smithy.api#documentation": "

The name of a logical container where backups are stored. Backup vaults are identified\n by names that are unique to the account used to create them and the Region where they are\n created.

\n

Accepted characters include lowercase letters, numbers, and hyphens.

", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "RecoveryPointArn": { + "target": "com.amazonaws.backup#ARN", + "traits": { + "smithy.api#documentation": "

An ARN that uniquely identifies a recovery point; for example,\n arn:aws:backup:us-east-1:123456789012:recovery-point:1EB3B5E7-9EB0-435A-A80B-108B488B0D45.

", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "IamRoleArn": { + "target": "com.amazonaws.backup#IAMRoleArn", + "traits": { + "smithy.api#documentation": "

This specifies the IAM role ARN used for this operation.

\n

For example, arn:aws:iam::123456789012:role/S3Access

" + } + }, + "Index": { + "target": "com.amazonaws.backup#Index", + "traits": { + "smithy.api#documentation": "

Index can have 1 of 2 possible values, either ENABLED or \n DISABLED.

\n

To create a backup index for an eligible ACTIVE recovery point \n that does not yet have a backup index, set value to ENABLED.

\n

To delete a backup index, set value to DISABLED.

", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.backup#UpdateRecoveryPointIndexSettingsOutput": { + "type": "structure", + "members": { + "BackupVaultName": { + "target": "com.amazonaws.backup#BackupVaultName", + "traits": { + "smithy.api#documentation": "

The name of a logical container where backups are stored. Backup vaults are identified\n by names that are unique to the account used to create them and the Region where they are\n created.

" + } + }, + "RecoveryPointArn": { + "target": "com.amazonaws.backup#ARN", + "traits": { + "smithy.api#documentation": "

An ARN that uniquely identifies a recovery point; for example,\n arn:aws:backup:us-east-1:123456789012:recovery-point:1EB3B5E7-9EB0-435A-A80B-108B488B0D45.

" + } + }, + "IndexStatus": { + "target": "com.amazonaws.backup#IndexStatus", + "traits": { + "smithy.api#documentation": "

This is the current status for the backup index associated \n with the specified recovery point.

\n

Statuses are: PENDING | ACTIVE | FAILED | DELETING\n

\n

A recovery point with an index that has the status of ACTIVE \n can be included in a search.

" + } + }, + "Index": { + "target": "com.amazonaws.backup#Index", + "traits": { + "smithy.api#documentation": "

Index can have 1 of 2 possible values, either ENABLED or\n DISABLED.

\n

A value of ENABLED means a backup index for an eligible ACTIVE\n recovery point has been created.

\n

A value of DISABLED means a backup index was deleted.

" + } + } + }, + "traits": { + "smithy.api#output": {} + } + }, "com.amazonaws.backup#UpdateRecoveryPointLifecycle": { "type": "operation", "input": { diff --git a/aws-models/backupsearch.json b/aws-models/backupsearch.json new file mode 100644 index 000000000000..a9bd5537b7e9 --- /dev/null +++ b/aws-models/backupsearch.json @@ -0,0 +1,2820 @@ +{ + "smithy": "2.0", + "shapes": { + "com.amazonaws.backupsearch#AccessDeniedException": { + "type": "structure", + "members": { + "message": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

User does not have sufficient access to perform this action.

", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#documentation": "

You do not have sufficient access to perform this action.

", + "smithy.api#error": "client", + "smithy.api#httpError": 403 + } + }, + "com.amazonaws.backupsearch#BackupCreationTimeFilter": { + "type": "structure", + "members": { + "CreatedAfter": { + "target": "smithy.api#Timestamp", + "traits": { + "smithy.api#documentation": "

This timestamp includes recovery points only \n created after the specified time.

" + } + }, + "CreatedBefore": { + "target": "smithy.api#Timestamp", + "traits": { + "smithy.api#documentation": "

This timestamp includes recovery points only \n created before the specified time.

" + } + } + }, + "traits": { + "smithy.api#documentation": "

This filters by recovery points within the CreatedAfter \n and CreatedBefore timestamps.

" + } + }, + "com.amazonaws.backupsearch#ConflictException": { + "type": "structure", + "members": { + "message": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

Updating or deleting a resource can cause an inconsistent state.

", + "smithy.api#required": {} + } + }, + "resourceId": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

Identifier of the resource affected.

", + "smithy.api#required": {} + } + }, + "resourceType": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

Type of the resource affected.

", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#documentation": "

This exception occurs when a conflict with a previous successful\n operation is detected. This generally occurs when the previous \n operation did not have time to propagate to the host serving the \n current request.

\n

A retry (with appropriate backoff logic) is the recommended \n response to this exception.

", + "smithy.api#error": "client", + "smithy.api#httpError": 409 + } + }, + "com.amazonaws.backupsearch#CryoBackupSearchService": { + "type": "service", + "version": "2018-05-10", + "operations": [ + { + "target": "com.amazonaws.backupsearch#ListSearchJobBackups" + }, + { + "target": "com.amazonaws.backupsearch#ListSearchJobResults" + }, + { + "target": "com.amazonaws.backupsearch#ListTagsForResource" + }, + { + "target": "com.amazonaws.backupsearch#TagResource" + }, + { + "target": "com.amazonaws.backupsearch#UntagResource" + } + ], + "resources": [ + { + "target": "com.amazonaws.backupsearch#SearchJob" + }, + { + "target": "com.amazonaws.backupsearch#SearchResultExportJob" + } + ], + "errors": [ + { + "target": "com.amazonaws.backupsearch#AccessDeniedException" + }, + { + "target": "com.amazonaws.backupsearch#InternalServerException" + }, + { + "target": "com.amazonaws.backupsearch#ThrottlingException" + }, + { + "target": "com.amazonaws.backupsearch#ValidationException" + } + ], + "traits": { + "aws.api#service": { + "sdkId": "BackupSearch", + "arnNamespace": "backup-search", + "endpointPrefix": "backup-search", + "cloudTrailEventSource": "backup.amazonaws.com" + }, + "aws.auth#sigv4": { + "name": "backup-search" + }, + "aws.endpoints#dualStackOnlyEndpoints": {}, + "aws.endpoints#standardPartitionalEndpoints": { + "endpointPatternType": "service_region_dnsSuffix" + }, + "aws.protocols#restJson1": {}, + "smithy.api#cors": { + "additionalAllowedHeaders": [ + "*", + "Authorization", + "Date", + "X-Amz-Date", + "X-Amz-Security-Token", + "X-Amz-Target", + "content-type", + "x-amz-content-sha256", + "x-amz-user-agent", + "x-amzn-platform-id", + "x-amzn-trace-id" + ], + "additionalExposedHeaders": [ + "x-amzn-errortype", + "x-amzn-requestid", + "x-amzn-errormessage", + "x-amzn-trace-id", + "x-amzn-requestid", + "x-amz-apigw-id", + "date" + ] + }, + "smithy.api#documentation": "Backup Search\n

Backup Search is the recovery point and item level search for Backup.

\n

For additional information, see:

\n ", + "smithy.api#paginated": { + "inputToken": "NextToken", + "outputToken": "NextToken", + "pageSize": "MaxResults" + }, + "smithy.api#title": "AWS Backup Search", + "smithy.rules#endpointRuleSet": { + "version": "1.0", + "parameters": { + "UseFIPS": { + "builtIn": "AWS::UseFIPS", + "required": true, + "default": false, + "documentation": "When true, send this request to the FIPS-compliant regional endpoint. If the configured endpoint does not have a FIPS compliant endpoint, dispatching the request will return an error.", + "type": "Boolean" + }, + "Endpoint": { + "builtIn": "SDK::Endpoint", + "required": false, + "documentation": "Override the endpoint used to send this request", + "type": "String" + }, + "Region": { + "builtIn": "AWS::Region", + "required": false, + "documentation": "The AWS region used to dispatch the request.", + "type": "String" + } + }, + "rules": [ + { + "conditions": [ + { + "fn": "isSet", + "argv": [ + { + "ref": "Endpoint" + } + ] + } + ], + "rules": [ + { + "conditions": [ + { + "fn": "booleanEquals", + "argv": [ + { + "ref": "UseFIPS" + }, + true + ] + } + ], + "error": "Invalid Configuration: FIPS and custom endpoint are not supported", + "type": "error" + }, + { + "conditions": [], + "endpoint": { + "url": { + "ref": "Endpoint" + }, + "properties": {}, + "headers": {} + }, + "type": "endpoint" + } + ], + "type": "tree" + }, + { + "conditions": [], + "rules": [ + { + "conditions": [ + { + "fn": "isSet", + "argv": [ + { + "ref": "Region" + } + ] + } + ], + "rules": [ + { + "conditions": [ + { + "fn": "aws.partition", + "argv": [ + { + "ref": "Region" + } + ], + "assign": "PartitionResult" + } + ], + "rules": [ + { + "conditions": [ + { + "fn": "booleanEquals", + "argv": [ + { + "ref": "UseFIPS" + }, + true + ] + } + ], + "endpoint": { + "url": "https://backup-search-fips.{PartitionResult#implicitGlobalRegion}.{PartitionResult#dualStackDnsSuffix}", + "properties": { + "authSchemes": [ + { + "name": "sigv4", + "signingRegion": "{PartitionResult#implicitGlobalRegion}" + } + ] + }, + "headers": {} + }, + "type": "endpoint" + }, + { + "conditions": [], + "endpoint": { + "url": "https://backup-search.{PartitionResult#implicitGlobalRegion}.{PartitionResult#dualStackDnsSuffix}", + "properties": { + "authSchemes": [ + { + "name": "sigv4", + "signingRegion": "{PartitionResult#implicitGlobalRegion}" + } + ] + }, + "headers": {} + }, + "type": "endpoint" + } + ], + "type": "tree" + } + ], + "type": "tree" + }, + { + "conditions": [], + "error": "Invalid Configuration: Missing Region", + "type": "error" + } + ], + "type": "tree" + } + ] + }, + "smithy.rules#endpointTests": { + "testCases": [ + { + "documentation": "For custom endpoint with region not set and fips disabled", + "expect": { + "endpoint": { + "url": "https://example.com" + } + }, + "params": { + "Endpoint": "https://example.com", + "UseFIPS": false + } + }, + { + "documentation": "For custom endpoint with fips enabled", + "expect": { + "error": "Invalid Configuration: FIPS and custom endpoint are not supported" + }, + "params": { + "Endpoint": "https://example.com", + "UseFIPS": true + } + }, + { + "documentation": "For region us-east-1 with FIPS enabled and DualStack enabled", + "expect": { + "endpoint": { + "properties": { + "authSchemes": [ + { + "name": "sigv4", + "signingRegion": "us-east-1" + } + ] + }, + "url": "https://backup-search-fips.us-east-1.api.aws" + } + }, + "params": { + "Region": "us-east-1", + "UseFIPS": true + } + }, + { + "documentation": "For region us-east-1 with FIPS disabled and DualStack enabled", + "expect": { + "endpoint": { + "properties": { + "authSchemes": [ + { + "name": "sigv4", + "signingRegion": "us-east-1" + } + ] + }, + "url": "https://backup-search.us-east-1.api.aws" + } + }, + "params": { + "Region": "us-east-1", + "UseFIPS": false + } + }, + { + "documentation": "For region cn-northwest-1 with FIPS enabled and DualStack enabled", + "expect": { + "endpoint": { + "properties": { + "authSchemes": [ + { + "name": "sigv4", + "signingRegion": "cn-northwest-1" + } + ] + }, + "url": "https://backup-search-fips.cn-northwest-1.api.amazonwebservices.com.cn" + } + }, + "params": { + "Region": "cn-northwest-1", + "UseFIPS": true + } + }, + { + "documentation": "For region cn-northwest-1 with FIPS disabled and DualStack enabled", + "expect": { + "endpoint": { + "properties": { + "authSchemes": [ + { + "name": "sigv4", + "signingRegion": "cn-northwest-1" + } + ] + }, + "url": "https://backup-search.cn-northwest-1.api.amazonwebservices.com.cn" + } + }, + "params": { + "Region": "cn-northwest-1", + "UseFIPS": false + } + }, + { + "documentation": "For region us-gov-west-1 with FIPS enabled and DualStack enabled", + "expect": { + "endpoint": { + "properties": { + "authSchemes": [ + { + "name": "sigv4", + "signingRegion": "us-gov-west-1" + } + ] + }, + "url": "https://backup-search-fips.us-gov-west-1.api.aws" + } + }, + "params": { + "Region": "us-gov-west-1", + "UseFIPS": true + } + }, + { + "documentation": "For region us-gov-west-1 with FIPS disabled and DualStack enabled", + "expect": { + "endpoint": { + "properties": { + "authSchemes": [ + { + "name": "sigv4", + "signingRegion": "us-gov-west-1" + } + ] + }, + "url": "https://backup-search.us-gov-west-1.api.aws" + } + }, + "params": { + "Region": "us-gov-west-1", + "UseFIPS": false + } + }, + { + "documentation": "For region us-iso-east-1 with FIPS enabled and DualStack enabled", + "expect": { + "endpoint": { + "properties": { + "authSchemes": [ + { + "name": "sigv4", + "signingRegion": "us-iso-east-1" + } + ] + }, + "url": "https://backup-search-fips.us-iso-east-1.c2s.ic.gov" + } + }, + "params": { + "Region": "us-iso-east-1", + "UseFIPS": true + } + }, + { + "documentation": "For region us-iso-east-1 with FIPS disabled and DualStack enabled", + "expect": { + "endpoint": { + "properties": { + "authSchemes": [ + { + "name": "sigv4", + "signingRegion": "us-iso-east-1" + } + ] + }, + "url": "https://backup-search.us-iso-east-1.c2s.ic.gov" + } + }, + "params": { + "Region": "us-iso-east-1", + "UseFIPS": false + } + }, + { + "documentation": "For region us-isob-east-1 with FIPS enabled and DualStack enabled", + "expect": { + "endpoint": { + "properties": { + "authSchemes": [ + { + "name": "sigv4", + "signingRegion": "us-isob-east-1" + } + ] + }, + "url": "https://backup-search-fips.us-isob-east-1.sc2s.sgov.gov" + } + }, + "params": { + "Region": "us-isob-east-1", + "UseFIPS": true + } + }, + { + "documentation": "For region us-isob-east-1 with FIPS disabled and DualStack enabled", + "expect": { + "endpoint": { + "properties": { + "authSchemes": [ + { + "name": "sigv4", + "signingRegion": "us-isob-east-1" + } + ] + }, + "url": "https://backup-search.us-isob-east-1.sc2s.sgov.gov" + } + }, + "params": { + "Region": "us-isob-east-1", + "UseFIPS": false + } + }, + { + "documentation": "For region eu-isoe-west-1 with FIPS enabled and DualStack enabled", + "expect": { + "endpoint": { + "properties": { + "authSchemes": [ + { + "name": "sigv4", + "signingRegion": "eu-isoe-west-1" + } + ] + }, + "url": "https://backup-search-fips.eu-isoe-west-1.cloud.adc-e.uk" + } + }, + "params": { + "Region": "eu-isoe-west-1", + "UseFIPS": true + } + }, + { + "documentation": "For region eu-isoe-west-1 with FIPS disabled and DualStack enabled", + "expect": { + "endpoint": { + "properties": { + "authSchemes": [ + { + "name": "sigv4", + "signingRegion": "eu-isoe-west-1" + } + ] + }, + "url": "https://backup-search.eu-isoe-west-1.cloud.adc-e.uk" + } + }, + "params": { + "Region": "eu-isoe-west-1", + "UseFIPS": false + } + }, + { + "documentation": "For region us-isof-south-1 with FIPS enabled and DualStack enabled", + "expect": { + "endpoint": { + "properties": { + "authSchemes": [ + { + "name": "sigv4", + "signingRegion": "us-isof-south-1" + } + ] + }, + "url": "https://backup-search-fips.us-isof-south-1.csp.hci.ic.gov" + } + }, + "params": { + "Region": "us-isof-south-1", + "UseFIPS": true + } + }, + { + "documentation": "For region us-isof-south-1 with FIPS disabled and DualStack enabled", + "expect": { + "endpoint": { + "properties": { + "authSchemes": [ + { + "name": "sigv4", + "signingRegion": "us-isof-south-1" + } + ] + }, + "url": "https://backup-search.us-isof-south-1.csp.hci.ic.gov" + } + }, + "params": { + "Region": "us-isof-south-1", + "UseFIPS": false + } + }, + { + "documentation": "Missing region", + "expect": { + "error": "Invalid Configuration: Missing Region" + } + } + ], + "version": "1.0" + } + } + }, + "com.amazonaws.backupsearch#CurrentSearchProgress": { + "type": "structure", + "members": { + "RecoveryPointsScannedCount": { + "target": "smithy.api#Integer", + "traits": { + "smithy.api#documentation": "

This number is the sum of all backups that \n have been scanned so far during a search job.

" + } + }, + "ItemsScannedCount": { + "target": "smithy.api#Long", + "traits": { + "smithy.api#documentation": "

This number is the sum of all items that \n have been scanned so far during a search job.

" + } + }, + "ItemsMatchedCount": { + "target": "smithy.api#Long", + "traits": { + "smithy.api#documentation": "

This number is the sum of all items that match \n the item filters in a search job in progress.

" + } + } + }, + "traits": { + "smithy.api#documentation": "

This contains information results retrieved from \n a search job that may not have completed.

" + } + }, + "com.amazonaws.backupsearch#EBSItemFilter": { + "type": "structure", + "members": { + "FilePaths": { + "target": "com.amazonaws.backupsearch#StringConditionList", + "traits": { + "smithy.api#documentation": "

You can include 1 to 10 values.

\n

If one file path is included, the results will \n return only items that match the file path.

\n

If more than one file path is included, the \n results will return all items that match any of the \n file paths.

" + } + }, + "Sizes": { + "target": "com.amazonaws.backupsearch#LongConditionList", + "traits": { + "smithy.api#documentation": "

You can include 1 to 10 values.

\n

If one is included, the results will \n return only items that match.

\n

If more than one is included, the \n results will return all items that match any of \n the included values.

" + } + }, + "CreationTimes": { + "target": "com.amazonaws.backupsearch#TimeConditionList", + "traits": { + "smithy.api#documentation": "

You can include 1 to 10 values.

\n

If one is included, the results will \n return only items that match.

\n

If more than one is included, the \n results will return all items that match any of \n the included values.

" + } + }, + "LastModificationTimes": { + "target": "com.amazonaws.backupsearch#TimeConditionList", + "traits": { + "smithy.api#documentation": "

You can include 1 to 10 values.

\n

If one is included, the results will \n return only items that match.

\n

If more than one is included, the \n results will return all items that match any of \n the included values.

" + } + } + }, + "traits": { + "smithy.api#documentation": "

This contains arrays of objects, which may include \n CreationTimes time condition objects, FilePaths \n string objects, LastModificationTimes time \n condition objects,

" + } + }, + "com.amazonaws.backupsearch#EBSItemFilters": { + "type": "list", + "member": { + "target": "com.amazonaws.backupsearch#EBSItemFilter" + }, + "traits": { + "smithy.api#length": { + "min": 0, + "max": 10 + } + } + }, + "com.amazonaws.backupsearch#EBSResultItem": { + "type": "structure", + "members": { + "BackupResourceArn": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

These are one or more items in the \n results that match values for the Amazon Resource \n Name (ARN) of recovery points returned in a search \n of Amazon EBS backup metadata.

" + } + }, + "SourceResourceArn": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

These are one or more items in the \n results that match values for the Amazon Resource \n Name (ARN) of source resources returned in a search \n of Amazon EBS backup metadata.

" + } + }, + "BackupVaultName": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

The name of the backup vault.

" + } + }, + "FileSystemIdentifier": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

These are one or more items in the \n results that match values for file systems returned \n in a search of Amazon EBS backup metadata.

" + } + }, + "FilePath": { + "target": "com.amazonaws.backupsearch#FilePath", + "traits": { + "smithy.api#documentation": "

These are one or more items in the \n results that match values for file paths returned \n in a search of Amazon EBS backup metadata.

" + } + }, + "FileSize": { + "target": "smithy.api#Long", + "traits": { + "smithy.api#documentation": "

These are one or more items in the \n results that match values for file sizes returned \n in a search of Amazon EBS backup metadata.

" + } + }, + "CreationTime": { + "target": "smithy.api#Timestamp", + "traits": { + "smithy.api#documentation": "

These are one or more items in the \n results that match values for creation times returned \n in a search of Amazon EBS backup metadata.

" + } + }, + "LastModifiedTime": { + "target": "smithy.api#Timestamp", + "traits": { + "smithy.api#documentation": "

These are one or more items in the \n results that match values for Last Modified Time returned \n in a search of Amazon EBS backup metadata.

" + } + } + }, + "traits": { + "smithy.api#documentation": "

These are the items returned in the results of \n a search of Amazon EBS backup metadata.

" + } + }, + "com.amazonaws.backupsearch#EncryptionKeyArn": { + "type": "string", + "traits": { + "aws.api#arnReference": { + "type": "AWS::KMS::Key" + } + } + }, + "com.amazonaws.backupsearch#ExportJobArn": { + "type": "string", + "traits": { + "aws.api#arnReference": { + "service": "com.amazonaws.backupsearch#CryoBackupSearchService" + } + } + }, + "com.amazonaws.backupsearch#ExportJobStatus": { + "type": "enum", + "members": { + "RUNNING": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "RUNNING" + } + }, + "FAILED": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "FAILED" + } + }, + "COMPLETED": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "COMPLETED" + } + } + } + }, + "com.amazonaws.backupsearch#ExportJobSummaries": { + "type": "list", + "member": { + "target": "com.amazonaws.backupsearch#ExportJobSummary" + } + }, + "com.amazonaws.backupsearch#ExportJobSummary": { + "type": "structure", + "members": { + "ExportJobIdentifier": { + "target": "com.amazonaws.backupsearch#GenericId", + "traits": { + "smithy.api#documentation": "

This is the unique string that identifies a \n specific export job.

", + "smithy.api#required": {} + } + }, + "ExportJobArn": { + "target": "com.amazonaws.backupsearch#ExportJobArn", + "traits": { + "smithy.api#documentation": "

This is the unique ARN (Amazon Resource Name) that \n belongs to the new export job.

" + } + }, + "Status": { + "target": "com.amazonaws.backupsearch#ExportJobStatus", + "traits": { + "smithy.api#documentation": "

The status of the export job is one of the \n following:

\n

\n CREATED; RUNNING; \n FAILED; or COMPLETED.

" + } + }, + "CreationTime": { + "target": "smithy.api#Timestamp", + "traits": { + "smithy.api#documentation": "

This is a timestamp of the time the export job \n was created.

" + } + }, + "CompletionTime": { + "target": "smithy.api#Timestamp", + "traits": { + "smithy.api#documentation": "

This is a timestamp of the time the export job \n compeleted.

" + } + }, + "StatusMessage": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

A status message is a string that is returned for an export\n job.

\n

A status message is included for any status other \n than COMPLETED without issues.

" + } + }, + "SearchJobArn": { + "target": "com.amazonaws.backupsearch#SearchJobArn", + "traits": { + "smithy.api#documentation": "

The unique string that identifies the Amazon Resource \n Name (ARN) of the specified search job.

" + } + } + }, + "traits": { + "smithy.api#documentation": "

This is the summary of an export job.

" + } + }, + "com.amazonaws.backupsearch#ExportSpecification": { + "type": "union", + "members": { + "s3ExportSpecification": { + "target": "com.amazonaws.backupsearch#S3ExportSpecification", + "traits": { + "smithy.api#documentation": "

This specifies the destination Amazon S3 \n bucket for the export job. And, if included, it also \n specifies the destination prefix.

" + } + } + }, + "traits": { + "smithy.api#documentation": "

This contains the export specification object.

" + } + }, + "com.amazonaws.backupsearch#FilePath": { + "type": "string", + "traits": { + "smithy.api#sensitive": {} + } + }, + "com.amazonaws.backupsearch#GenericId": { + "type": "string" + }, + "com.amazonaws.backupsearch#GetSearchJob": { + "type": "operation", + "input": { + "target": "com.amazonaws.backupsearch#GetSearchJobInput" + }, + "output": { + "target": "com.amazonaws.backupsearch#GetSearchJobOutput" + }, + "errors": [ + { + "target": "com.amazonaws.backupsearch#ResourceNotFoundException" + } + ], + "traits": { + "smithy.api#documentation": "

This operation retrieves metadata of a search job, \n including its progress.

", + "smithy.api#http": { + "code": 200, + "method": "GET", + "uri": "/search-jobs/{SearchJobIdentifier}" + }, + "smithy.api#readonly": {} + } + }, + "com.amazonaws.backupsearch#GetSearchJobInput": { + "type": "structure", + "members": { + "SearchJobIdentifier": { + "target": "com.amazonaws.backupsearch#GenericId", + "traits": { + "smithy.api#documentation": "

Required unique string that specifies the \n search job.

", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.backupsearch#GetSearchJobOutput": { + "type": "structure", + "members": { + "Name": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

Returned name of the specified search job.

" + } + }, + "SearchScopeSummary": { + "target": "com.amazonaws.backupsearch#SearchScopeSummary", + "traits": { + "smithy.api#documentation": "

Returned summary of the specified search job scope, \n including:\n

\n " + } + }, + "CurrentSearchProgress": { + "target": "com.amazonaws.backupsearch#CurrentSearchProgress", + "traits": { + "smithy.api#documentation": "

Returns numbers representing BackupsScannedCount, \n ItemsScanned, and ItemsMatched.

" + } + }, + "StatusMessage": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

A status message will be returned for either a \n earch job with a status of ERRORED or a status of \n COMPLETED jobs with issues.

\n

For example, a message may say that a search \n contained recovery points unable to be scanned because \n of a permissions issue.

" + } + }, + "EncryptionKeyArn": { + "target": "com.amazonaws.backupsearch#EncryptionKeyArn", + "traits": { + "smithy.api#documentation": "

The encryption key for the specified \n search job.

\n

Example: arn:aws:kms:us-west-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab.

" + } + }, + "CompletionTime": { + "target": "smithy.api#Timestamp", + "traits": { + "smithy.api#documentation": "

The date and time that a search job completed, in Unix format and Coordinated\n Universal Time (UTC). The value of CompletionTime is accurate to milliseconds.\n For example, the value 1516925490.087 represents Friday, January 26, 2018 12:11:30.087\n AM.

" + } + }, + "Status": { + "target": "com.amazonaws.backupsearch#SearchJobState", + "traits": { + "smithy.api#documentation": "

The current status of the specified search job.

\n

A search job may have one of the following statuses: \n RUNNING; COMPLETED; STOPPED; \n FAILED; TIMED_OUT; or EXPIRED\n .

", + "smithy.api#required": {} + } + }, + "SearchScope": { + "target": "com.amazonaws.backupsearch#SearchScope", + "traits": { + "smithy.api#documentation": "

The search scope is all backup \n properties input into a search.

", + "smithy.api#required": {} + } + }, + "ItemFilters": { + "target": "com.amazonaws.backupsearch#ItemFilters", + "traits": { + "smithy.api#documentation": "

Item Filters represent all input item \n properties specified when the search was \n created.

", + "smithy.api#required": {} + } + }, + "CreationTime": { + "target": "smithy.api#Timestamp", + "traits": { + "smithy.api#documentation": "

The date and time that a search job was created, in Unix format and Coordinated\n Universal Time (UTC). The value of CompletionTime is accurate to milliseconds.\n For example, the value 1516925490.087 represents Friday, January 26, 2018 12:11:30.087\n AM.

", + "smithy.api#required": {} + } + }, + "SearchJobIdentifier": { + "target": "com.amazonaws.backupsearch#GenericId", + "traits": { + "smithy.api#documentation": "

The unique string that identifies the specified search job.

", + "smithy.api#required": {} + } + }, + "SearchJobArn": { + "target": "com.amazonaws.backupsearch#SearchJobArn", + "traits": { + "smithy.api#documentation": "

The unique string that identifies the Amazon Resource \n Name (ARN) of the specified search job.

", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#output": {} + } + }, + "com.amazonaws.backupsearch#GetSearchResultExportJob": { + "type": "operation", + "input": { + "target": "com.amazonaws.backupsearch#GetSearchResultExportJobInput" + }, + "output": { + "target": "com.amazonaws.backupsearch#GetSearchResultExportJobOutput" + }, + "errors": [ + { + "target": "com.amazonaws.backupsearch#ResourceNotFoundException" + } + ], + "traits": { + "smithy.api#documentation": "

This operation retrieves the metadata of an export job.

\n

An export job is an operation that transmits the results \n of a search job to a specified S3 bucket in a \n .csv file.

\n

An export job allows you to retain results of a search \n beyond the search job's scheduled retention of 7 days.

", + "smithy.api#http": { + "code": 200, + "method": "GET", + "uri": "/export-search-jobs/{ExportJobIdentifier}" + }, + "smithy.api#readonly": {} + } + }, + "com.amazonaws.backupsearch#GetSearchResultExportJobInput": { + "type": "structure", + "members": { + "ExportJobIdentifier": { + "target": "com.amazonaws.backupsearch#GenericId", + "traits": { + "smithy.api#documentation": "

This is the unique string that identifies a \n specific export job.

\n

Required for this operation.

", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.backupsearch#GetSearchResultExportJobOutput": { + "type": "structure", + "members": { + "ExportJobIdentifier": { + "target": "com.amazonaws.backupsearch#GenericId", + "traits": { + "smithy.api#documentation": "

This is the unique string that identifies the \n specified export job.

", + "smithy.api#required": {} + } + }, + "ExportJobArn": { + "target": "com.amazonaws.backupsearch#ExportJobArn", + "traits": { + "smithy.api#documentation": "

The unique Amazon Resource Name (ARN) that uniquely identifies \n the export job.

" + } + }, + "Status": { + "target": "com.amazonaws.backupsearch#ExportJobStatus", + "traits": { + "smithy.api#documentation": "

This is the current status of the export job.

" + } + }, + "CreationTime": { + "target": "smithy.api#Timestamp", + "traits": { + "smithy.api#documentation": "

The date and time that an export job was created, in Unix format and Coordinated Universal\n Time (UTC). The value of CreationTime is accurate to milliseconds. For\n example, the value 1516925490.087 represents Friday, January 26, 2018 12:11:30.087\n AM.

" + } + }, + "CompletionTime": { + "target": "smithy.api#Timestamp", + "traits": { + "smithy.api#documentation": "

The date and time that an export job completed, in Unix format and Coordinated Universal\n Time (UTC). The value of CreationTime is accurate to milliseconds. For\n example, the value 1516925490.087 represents Friday, January 26, 2018 12:11:30.087\n AM.

" + } + }, + "StatusMessage": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

A status message is a string that is returned for search job \n with a status of FAILED, along with steps to remedy \n and retry the operation.

" + } + }, + "ExportSpecification": { + "target": "com.amazonaws.backupsearch#ExportSpecification", + "traits": { + "smithy.api#documentation": "

The export specification consists of the destination \n S3 bucket to which the search results were exported, along \n with the destination prefix.

" + } + }, + "SearchJobArn": { + "target": "com.amazonaws.backupsearch#SearchJobArn", + "traits": { + "smithy.api#documentation": "

The unique string that identifies the Amazon Resource \n Name (ARN) of the specified search job.

" + } + } + }, + "traits": { + "smithy.api#output": {} + } + }, + "com.amazonaws.backupsearch#IamRoleArn": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 20, + "max": 2048 + }, + "smithy.api#pattern": "^arn:(?:aws|aws-cn|aws-us-gov):iam::[a-z0-9-]+:role/(.+)$" + } + }, + "com.amazonaws.backupsearch#InternalServerException": { + "type": "structure", + "members": { + "message": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

Unexpected error during processing of request.

", + "smithy.api#required": {} + } + }, + "retryAfterSeconds": { + "target": "smithy.api#Integer", + "traits": { + "smithy.api#documentation": "

Retry the call after number of seconds.

", + "smithy.api#httpHeader": "Retry-After" + } + } + }, + "traits": { + "smithy.api#documentation": "

An internal server error occurred. Retry your request.

", + "smithy.api#error": "server", + "smithy.api#httpError": 500, + "smithy.api#retryable": {} + } + }, + "com.amazonaws.backupsearch#ItemFilters": { + "type": "structure", + "members": { + "S3ItemFilters": { + "target": "com.amazonaws.backupsearch#S3ItemFilters", + "traits": { + "smithy.api#documentation": "

This array can contain CreationTimes, ETags, \n ObjectKeys, Sizes, or VersionIds objects.

" + } + }, + "EBSItemFilters": { + "target": "com.amazonaws.backupsearch#EBSItemFilters", + "traits": { + "smithy.api#documentation": "

This array can contain CreationTimes, \n FilePaths, LastModificationTimes, or Sizes objects.

" + } + } + }, + "traits": { + "smithy.api#documentation": "

Item Filters represent all input item \n properties specified when the search was \n created.

\n

Contains either EBSItemFilters or \n S3ItemFilters

" + } + }, + "com.amazonaws.backupsearch#ListSearchJobBackups": { + "type": "operation", + "input": { + "target": "com.amazonaws.backupsearch#ListSearchJobBackupsInput" + }, + "output": { + "target": "com.amazonaws.backupsearch#ListSearchJobBackupsOutput" + }, + "errors": [ + { + "target": "com.amazonaws.backupsearch#ResourceNotFoundException" + } + ], + "traits": { + "smithy.api#documentation": "

This operation returns a list of all backups (recovery \n points) in a paginated format that were included in \n the search job.

\n

If a search does not display an expected backup in \n the results, you can call this operation to display each \n backup included in the search. Any backups that were not \n included because they have a FAILED status \n from a permissions issue will be displayed, along with a \n status message.

\n

Only recovery points with a backup index that has \n a status of ACTIVE will be included in search results. \n If the index has any other status, its status will be \n displayed along with a status message.

", + "smithy.api#http": { + "code": 200, + "method": "GET", + "uri": "/search-jobs/{SearchJobIdentifier}/backups" + }, + "smithy.api#paginated": { + "inputToken": "NextToken", + "outputToken": "NextToken", + "pageSize": "MaxResults", + "items": "Results" + }, + "smithy.api#readonly": {} + } + }, + "com.amazonaws.backupsearch#ListSearchJobBackupsInput": { + "type": "structure", + "members": { + "SearchJobIdentifier": { + "target": "com.amazonaws.backupsearch#GenericId", + "traits": { + "smithy.api#documentation": "

The unique string that specifies the search job.

", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "NextToken": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

The next item following a partial list of returned backups \n included in a search job.

\n

For example, if a request\n is made to return MaxResults number of backups, NextToken\n allows you to return more items in your list starting at the location pointed to by the\n next token.

", + "smithy.api#httpQuery": "nextToken" + } + }, + "MaxResults": { + "target": "smithy.api#Integer", + "traits": { + "smithy.api#default": 1000, + "smithy.api#documentation": "

The maximum number of resource list items to be returned.

", + "smithy.api#httpQuery": "maxResults", + "smithy.api#range": { + "min": 1, + "max": 1000 + } + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.backupsearch#ListSearchJobBackupsOutput": { + "type": "structure", + "members": { + "Results": { + "target": "com.amazonaws.backupsearch#SearchJobBackupsResults", + "traits": { + "smithy.api#documentation": "

The recovery points returned the results of a \n search job

", + "smithy.api#required": {} + } + }, + "NextToken": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

The next item following a partial list of returned backups \n included in a search job.

\n

For example, if a request\n is made to return MaxResults number of backups, NextToken\n allows you to return more items in your list starting at the location pointed to by the\n next token.

" + } + } + }, + "traits": { + "smithy.api#output": {} + } + }, + "com.amazonaws.backupsearch#ListSearchJobResults": { + "type": "operation", + "input": { + "target": "com.amazonaws.backupsearch#ListSearchJobResultsInput" + }, + "output": { + "target": "com.amazonaws.backupsearch#ListSearchJobResultsOutput" + }, + "errors": [ + { + "target": "com.amazonaws.backupsearch#ResourceNotFoundException" + } + ], + "traits": { + "aws.api#dataPlane": {}, + "smithy.api#documentation": "

This operation returns a list of a specified search job.

", + "smithy.api#http": { + "code": 200, + "method": "GET", + "uri": "/search-jobs/{SearchJobIdentifier}/search-results" + }, + "smithy.api#paginated": { + "items": "Results" + }, + "smithy.api#readonly": {} + } + }, + "com.amazonaws.backupsearch#ListSearchJobResultsInput": { + "type": "structure", + "members": { + "SearchJobIdentifier": { + "target": "com.amazonaws.backupsearch#GenericId", + "traits": { + "smithy.api#documentation": "

The unique string that specifies the search job.

", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "NextToken": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

The next item following a partial list of returned \n search job results.

\n

For example, if a request\n is made to return MaxResults number of \n search job results, NextToken\n allows you to return more items in your list starting at the location pointed to by the\n next token.

", + "smithy.api#httpQuery": "nextToken" + } + }, + "MaxResults": { + "target": "smithy.api#Integer", + "traits": { + "smithy.api#default": 1000, + "smithy.api#documentation": "

The maximum number of resource list items to be returned.

", + "smithy.api#httpQuery": "maxResults", + "smithy.api#range": { + "min": 1, + "max": 1000 + } + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.backupsearch#ListSearchJobResultsOutput": { + "type": "structure", + "members": { + "Results": { + "target": "com.amazonaws.backupsearch#Results", + "traits": { + "smithy.api#documentation": "

The results consist of either EBSResultItem or S3ResultItem.

", + "smithy.api#required": {} + } + }, + "NextToken": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

The next item following a partial list of \n search job results.

\n

For example, if a request\n is made to return MaxResults number of backups, NextToken\n allows you to return more items in your list starting at the location pointed to by the\n next token.

" + } + } + }, + "traits": { + "smithy.api#output": {} + } + }, + "com.amazonaws.backupsearch#ListSearchJobs": { + "type": "operation", + "input": { + "target": "com.amazonaws.backupsearch#ListSearchJobsInput" + }, + "output": { + "target": "com.amazonaws.backupsearch#ListSearchJobsOutput" + }, + "traits": { + "smithy.api#documentation": "

This operation returns a list of search jobs belonging \n to an account.

", + "smithy.api#http": { + "code": 200, + "method": "GET", + "uri": "/search-jobs" + }, + "smithy.api#paginated": { + "items": "SearchJobs" + }, + "smithy.api#readonly": {}, + "smithy.test#smokeTests": [ + { + "id": "ListSearchJobsSuccess", + "params": {}, + "expect": { + "success": {} + }, + "vendorParamsShape": "aws.test#AwsVendorParams", + "vendorParams": { + "region": "us-east-1" + } + } + ] + } + }, + "com.amazonaws.backupsearch#ListSearchJobsInput": { + "type": "structure", + "members": { + "ByStatus": { + "target": "com.amazonaws.backupsearch#SearchJobState", + "traits": { + "smithy.api#documentation": "

Include this parameter to filter list by search \n job status.

", + "smithy.api#httpQuery": "Status", + "smithy.api#notProperty": {} + } + }, + "NextToken": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

The next item following a partial list of returned \n search jobs.

\n

For example, if a request\n is made to return MaxResults number of backups, NextToken\n allows you to return more items in your list starting at the location pointed to by the\n next token.

", + "smithy.api#httpQuery": "NextToken", + "smithy.api#notProperty": {} + } + }, + "MaxResults": { + "target": "smithy.api#Integer", + "traits": { + "smithy.api#default": 1000, + "smithy.api#documentation": "

The maximum number of resource list items to be returned.

", + "smithy.api#httpQuery": "MaxResults", + "smithy.api#notProperty": {}, + "smithy.api#range": { + "min": 1, + "max": 1000 + } + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.backupsearch#ListSearchJobsOutput": { + "type": "structure", + "members": { + "SearchJobs": { + "target": "com.amazonaws.backupsearch#SearchJobs", + "traits": { + "smithy.api#documentation": "

The search jobs among the list, with details of \n the returned search jobs.

", + "smithy.api#notProperty": {}, + "smithy.api#required": {} + } + }, + "NextToken": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

The next item following a partial list of returned backups \n included in a search job.

\n

For example, if a request\n is made to return MaxResults number of backups, NextToken\n allows you to return more items in your list starting at the location pointed to by the\n next token.

", + "smithy.api#notProperty": {} + } + } + }, + "traits": { + "smithy.api#output": {} + } + }, + "com.amazonaws.backupsearch#ListSearchResultExportJobs": { + "type": "operation", + "input": { + "target": "com.amazonaws.backupsearch#ListSearchResultExportJobsInput" + }, + "output": { + "target": "com.amazonaws.backupsearch#ListSearchResultExportJobsOutput" + }, + "errors": [ + { + "target": "com.amazonaws.backupsearch#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.backupsearch#ServiceQuotaExceededException" + } + ], + "traits": { + "smithy.api#documentation": "

This operation exports search results of a search job \n to a specified destination S3 bucket.

", + "smithy.api#http": { + "code": 200, + "method": "GET", + "uri": "/export-search-jobs" + }, + "smithy.api#paginated": { + "items": "ExportJobs" + }, + "smithy.api#readonly": {} + } + }, + "com.amazonaws.backupsearch#ListSearchResultExportJobsInput": { + "type": "structure", + "members": { + "Status": { + "target": "com.amazonaws.backupsearch#ExportJobStatus", + "traits": { + "smithy.api#documentation": "

The search jobs to be included in the export job \n can be filtered by including this parameter.

", + "smithy.api#httpQuery": "Status", + "smithy.api#notProperty": {} + } + }, + "SearchJobIdentifier": { + "target": "com.amazonaws.backupsearch#GenericId", + "traits": { + "smithy.api#documentation": "

The unique string that specifies the search job.

", + "smithy.api#httpQuery": "SearchJobIdentifier", + "smithy.api#notProperty": {} + } + }, + "NextToken": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

The next item following a partial list of returned backups \n included in a search job.

\n

For example, if a request\n is made to return MaxResults number of backups, NextToken\n allows you to return more items in your list starting at the location pointed to by the\n next token.

", + "smithy.api#httpQuery": "NextToken", + "smithy.api#notProperty": {} + } + }, + "MaxResults": { + "target": "smithy.api#Integer", + "traits": { + "smithy.api#default": 1000, + "smithy.api#documentation": "

The maximum number of resource list items to be returned.

", + "smithy.api#httpQuery": "MaxResults", + "smithy.api#notProperty": {}, + "smithy.api#range": { + "min": 1, + "max": 1000 + } + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.backupsearch#ListSearchResultExportJobsOutput": { + "type": "structure", + "members": { + "ExportJobs": { + "target": "com.amazonaws.backupsearch#ExportJobSummaries", + "traits": { + "smithy.api#documentation": "

The operation returns the included export jobs.

", + "smithy.api#notProperty": {}, + "smithy.api#required": {} + } + }, + "NextToken": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

The next item following a partial list of returned backups \n included in a search job.

\n

For example, if a request\n is made to return MaxResults number of backups, NextToken\n allows you to return more items in your list starting at the location pointed to by the\n next token.

", + "smithy.api#notProperty": {} + } + } + }, + "traits": { + "smithy.api#output": {} + } + }, + "com.amazonaws.backupsearch#ListTagsForResource": { + "type": "operation", + "input": { + "target": "com.amazonaws.backupsearch#ListTagsForResourceRequest" + }, + "output": { + "target": "com.amazonaws.backupsearch#ListTagsForResourceResponse" + }, + "errors": [ + { + "target": "com.amazonaws.backupsearch#ResourceNotFoundException" + } + ], + "traits": { + "smithy.api#documentation": "

This operation returns the tags for a resource type.

", + "smithy.api#http": { + "uri": "/tags/{ResourceArn}", + "method": "GET" + }, + "smithy.api#readonly": {} + } + }, + "com.amazonaws.backupsearch#ListTagsForResourceRequest": { + "type": "structure", + "members": { + "ResourceArn": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

The Amazon Resource Name (ARN) that uniquely identifies \n the resource.>

", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.backupsearch#ListTagsForResourceResponse": { + "type": "structure", + "members": { + "Tags": { + "target": "com.amazonaws.backupsearch#TagMap", + "traits": { + "smithy.api#documentation": "

List of tags returned by the operation.

" + } + } + }, + "traits": { + "smithy.api#output": {} + } + }, + "com.amazonaws.backupsearch#LongCondition": { + "type": "structure", + "members": { + "Value": { + "target": "smithy.api#Long", + "traits": { + "smithy.api#documentation": "

The value of an item included in one of the search \n item filters.

", + "smithy.api#required": {} + } + }, + "Operator": { + "target": "com.amazonaws.backupsearch#LongConditionOperator", + "traits": { + "smithy.api#default": "EQUALS_TO", + "smithy.api#documentation": "

A string that defines what values will be \n returned.

\n

If this is included, avoid combinations of \n operators that will return all possible values. \n For example, including both EQUALS_TO \n and NOT_EQUALS_TO with a value of 4 \n will return all values.

" + } + } + }, + "traits": { + "smithy.api#documentation": "

The long condition contains a Value \n and can optionally contain an Operator.

" + } + }, + "com.amazonaws.backupsearch#LongConditionList": { + "type": "list", + "member": { + "target": "com.amazonaws.backupsearch#LongCondition" + }, + "traits": { + "smithy.api#length": { + "min": 1, + "max": 10 + } + } + }, + "com.amazonaws.backupsearch#LongConditionOperator": { + "type": "enum", + "members": { + "EQUALS_TO": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "EQUALS_TO" + } + }, + "NOT_EQUALS_TO": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "NOT_EQUALS_TO" + } + }, + "LESS_THAN_EQUAL_TO": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "LESS_THAN_EQUAL_TO" + } + }, + "GREATER_THAN_EQUAL_TO": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "GREATER_THAN_EQUAL_TO" + } + } + } + }, + "com.amazonaws.backupsearch#ObjectKey": { + "type": "string", + "traits": { + "smithy.api#sensitive": {} + } + }, + "com.amazonaws.backupsearch#RecoveryPoint": { + "type": "string", + "traits": { + "aws.api#arnReference": { + "type": "AWS::Backup::RecoveryPoint" + } + } + }, + "com.amazonaws.backupsearch#RecoveryPointArnList": { + "type": "list", + "member": { + "target": "com.amazonaws.backupsearch#RecoveryPoint" + }, + "traits": { + "smithy.api#length": { + "min": 0, + "max": 50 + } + } + }, + "com.amazonaws.backupsearch#ResourceArnList": { + "type": "list", + "member": { + "target": "smithy.api#String" + }, + "traits": { + "smithy.api#length": { + "min": 0, + "max": 50 + } + } + }, + "com.amazonaws.backupsearch#ResourceNotFoundException": { + "type": "structure", + "members": { + "message": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

Request references a resource which does not exist.

", + "smithy.api#required": {} + } + }, + "resourceId": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

Hypothetical identifier of the resource affected.

", + "smithy.api#required": {} + } + }, + "resourceType": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

Hypothetical type of the resource affected.

", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#documentation": "

The resource was not found for this request.

\n

Confirm the resource information, such as the ARN or type is correct \n and exists, then retry the request.

", + "smithy.api#error": "client", + "smithy.api#httpError": 404 + } + }, + "com.amazonaws.backupsearch#ResourceType": { + "type": "enum", + "members": { + "S3": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "S3" + } + }, + "EBS": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "EBS" + } + } + } + }, + "com.amazonaws.backupsearch#ResourceTypeList": { + "type": "list", + "member": { + "target": "com.amazonaws.backupsearch#ResourceType" + }, + "traits": { + "smithy.api#length": { + "min": 1, + "max": 1 + } + } + }, + "com.amazonaws.backupsearch#ResultItem": { + "type": "union", + "members": { + "S3ResultItem": { + "target": "com.amazonaws.backupsearch#S3ResultItem", + "traits": { + "smithy.api#documentation": "

These are items returned in the search results \n of an Amazon S3 search.

" + } + }, + "EBSResultItem": { + "target": "com.amazonaws.backupsearch#EBSResultItem", + "traits": { + "smithy.api#documentation": "

These are items returned in the search results \n of an Amazon EBS search.

" + } + } + }, + "traits": { + "smithy.api#documentation": "

This is an object representing the item \n returned in the results of a search for a specific \n resource type.

" + } + }, + "com.amazonaws.backupsearch#Results": { + "type": "list", + "member": { + "target": "com.amazonaws.backupsearch#ResultItem" + } + }, + "com.amazonaws.backupsearch#S3ExportSpecification": { + "type": "structure", + "members": { + "DestinationBucket": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

This specifies the destination Amazon S3 \n bucket for the export job.

", + "smithy.api#required": {} + } + }, + "DestinationPrefix": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

This specifies the prefix for the destination \n Amazon S3 bucket for the export job.

" + } + } + }, + "traits": { + "smithy.api#documentation": "

This specification contains a required string of the \n destination bucket; optionally, you can include the \n destination prefix.

" + } + }, + "com.amazonaws.backupsearch#S3ItemFilter": { + "type": "structure", + "members": { + "ObjectKeys": { + "target": "com.amazonaws.backupsearch#StringConditionList", + "traits": { + "smithy.api#documentation": "

You can include 1 to 10 values.

\n

If one value is included, the results will \n return only items that match the value.

\n

If more than one value is included, the \n results will return all items that match any of the \n values.

" + } + }, + "Sizes": { + "target": "com.amazonaws.backupsearch#LongConditionList", + "traits": { + "smithy.api#documentation": "

You can include 1 to 10 values.

\n

If one value is included, the results will \n return only items that match the value.

\n

If more than one value is included, the \n results will return all items that match any of the \n values.

" + } + }, + "CreationTimes": { + "target": "com.amazonaws.backupsearch#TimeConditionList", + "traits": { + "smithy.api#documentation": "

You can include 1 to 10 values.

\n

If one value is included, the results will \n return only items that match the value.

\n

If more than one value is included, the \n results will return all items that match any of the \n values.

" + } + }, + "VersionIds": { + "target": "com.amazonaws.backupsearch#StringConditionList", + "traits": { + "smithy.api#documentation": "

You can include 1 to 10 values.

\n

If one value is included, the results will \n return only items that match the value.

\n

If more than one value is included, the \n results will return all items that match any of the \n values.

" + } + }, + "ETags": { + "target": "com.amazonaws.backupsearch#StringConditionList", + "traits": { + "smithy.api#documentation": "

You can include 1 to 10 values.

\n

If one value is included, the results will \n return only items that match the value.

\n

If more than one value is included, the \n results will return all items that match any of the \n values.

" + } + } + }, + "traits": { + "smithy.api#documentation": "

This contains arrays of objects, which may include \n ObjectKeys, Sizes, CreationTimes, VersionIds, and/or \n Etags.

" + } + }, + "com.amazonaws.backupsearch#S3ItemFilters": { + "type": "list", + "member": { + "target": "com.amazonaws.backupsearch#S3ItemFilter" + }, + "traits": { + "smithy.api#length": { + "min": 0, + "max": 10 + } + } + }, + "com.amazonaws.backupsearch#S3ResultItem": { + "type": "structure", + "members": { + "BackupResourceArn": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

These are items in the returned results that match \n recovery point Amazon Resource Names (ARN) input during \n a search of Amazon S3 backup metadata.

" + } + }, + "SourceResourceArn": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

These are items in the returned results that match \n source Amazon Resource Names (ARN) input during \n a search of Amazon S3 backup metadata.

" + } + }, + "BackupVaultName": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

The name of the backup vault.

" + } + }, + "ObjectKey": { + "target": "com.amazonaws.backupsearch#ObjectKey", + "traits": { + "smithy.api#documentation": "

This is one or more items \n returned in the results of a search of Amazon S3 \n backup metadata that match the values input for \n object key.

" + } + }, + "ObjectSize": { + "target": "smithy.api#Long", + "traits": { + "smithy.api#documentation": "

These are items in the returned results that match \n values for object size(s) input during a search of \n Amazon S3 backup metadata.

" + } + }, + "CreationTime": { + "target": "smithy.api#Timestamp", + "traits": { + "smithy.api#documentation": "

These are one or more items in the returned results \n that match values for item creation time input during \n a search of Amazon S3 backup metadata.

" + } + }, + "ETag": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

These are one or more items in the returned results \n that match values for ETags input during \n a search of Amazon S3 backup metadata.

" + } + }, + "VersionId": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

These are one or more items in the returned results \n that match values for version IDs input during \n a search of Amazon S3 backup metadata.

" + } + } + }, + "traits": { + "smithy.api#documentation": "

These are the items returned in the results of \n a search of Amazon S3 backup metadata.

" + } + }, + "com.amazonaws.backupsearch#SearchJob": { + "type": "resource", + "identifiers": { + "SearchJobIdentifier": { + "target": "com.amazonaws.backupsearch#GenericId" + } + }, + "properties": { + "Status": { + "target": "com.amazonaws.backupsearch#SearchJobState" + }, + "Name": { + "target": "smithy.api#String" + }, + "EncryptionKeyArn": { + "target": "com.amazonaws.backupsearch#EncryptionKeyArn" + }, + "SearchScope": { + "target": "com.amazonaws.backupsearch#SearchScope" + }, + "ItemFilters": { + "target": "com.amazonaws.backupsearch#ItemFilters" + }, + "CreationTime": { + "target": "smithy.api#Timestamp" + }, + "CompletionTime": { + "target": "smithy.api#Timestamp" + }, + "SearchScopeSummary": { + "target": "com.amazonaws.backupsearch#SearchScopeSummary" + }, + "CurrentSearchProgress": { + "target": "com.amazonaws.backupsearch#CurrentSearchProgress" + }, + "StatusMessage": { + "target": "smithy.api#String" + }, + "ClientToken": { + "target": "smithy.api#String" + }, + "Tags": { + "target": "com.amazonaws.backupsearch#TagMap" + }, + "SearchJobArn": { + "target": "com.amazonaws.backupsearch#SearchJobArn" + } + }, + "create": { + "target": "com.amazonaws.backupsearch#StartSearchJob" + }, + "read": { + "target": "com.amazonaws.backupsearch#GetSearchJob" + }, + "update": { + "target": "com.amazonaws.backupsearch#StopSearchJob" + }, + "list": { + "target": "com.amazonaws.backupsearch#ListSearchJobs" + } + }, + "com.amazonaws.backupsearch#SearchJobArn": { + "type": "string", + "traits": { + "aws.api#arnReference": { + "service": "com.amazonaws.backupsearch#CryoBackupSearchService" + } + } + }, + "com.amazonaws.backupsearch#SearchJobBackupsResult": { + "type": "structure", + "members": { + "Status": { + "target": "com.amazonaws.backupsearch#SearchJobState", + "traits": { + "smithy.api#documentation": "

This is the status of the search job backup result.

" + } + }, + "StatusMessage": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

This is the status message included with the results.

" + } + }, + "ResourceType": { + "target": "com.amazonaws.backupsearch#ResourceType", + "traits": { + "smithy.api#documentation": "

This is the resource type of the search.

" + } + }, + "BackupResourceArn": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

The Amazon Resource Name (ARN) that uniquely identifies \n the backup resources.

" + } + }, + "SourceResourceArn": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

The Amazon Resource Name (ARN) that uniquely identifies \n the source resources.

" + } + }, + "IndexCreationTime": { + "target": "smithy.api#Timestamp", + "traits": { + "smithy.api#documentation": "

This is the creation time of the backup index.

" + } + }, + "BackupCreationTime": { + "target": "smithy.api#Timestamp", + "traits": { + "smithy.api#documentation": "

This is the creation time of the backup (recovery point).

" + } + } + }, + "traits": { + "smithy.api#documentation": "

This contains the information about recovery \n points returned in results of a search job.

" + } + }, + "com.amazonaws.backupsearch#SearchJobBackupsResults": { + "type": "list", + "member": { + "target": "com.amazonaws.backupsearch#SearchJobBackupsResult" + } + }, + "com.amazonaws.backupsearch#SearchJobState": { + "type": "enum", + "members": { + "RUNNING": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "RUNNING" + } + }, + "COMPLETED": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "COMPLETED" + } + }, + "STOPPING": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "STOPPING" + } + }, + "STOPPED": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "STOPPED" + } + }, + "FAILED": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "FAILED" + } + } + } + }, + "com.amazonaws.backupsearch#SearchJobSummary": { + "type": "structure", + "members": { + "SearchJobIdentifier": { + "target": "com.amazonaws.backupsearch#GenericId", + "traits": { + "smithy.api#documentation": "

The unique string that specifies the search job.

" + } + }, + "SearchJobArn": { + "target": "com.amazonaws.backupsearch#SearchJobArn", + "traits": { + "smithy.api#documentation": "

The unique string that identifies the Amazon Resource \n Name (ARN) of the specified search job.

" + } + }, + "Name": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

This is the name of the search job.

" + } + }, + "Status": { + "target": "com.amazonaws.backupsearch#SearchJobState", + "traits": { + "smithy.api#documentation": "

This is the status of the search job.

" + } + }, + "CreationTime": { + "target": "smithy.api#Timestamp", + "traits": { + "smithy.api#documentation": "

This is the creation time of the search job.

" + } + }, + "CompletionTime": { + "target": "smithy.api#Timestamp", + "traits": { + "smithy.api#documentation": "

This is the completion time of the search job.

" + } + }, + "SearchScopeSummary": { + "target": "com.amazonaws.backupsearch#SearchScopeSummary", + "traits": { + "smithy.api#documentation": "

Returned summary of the specified search job scope, \n including:\n

\n " + } + }, + "StatusMessage": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

A status message will be returned for either a \n earch job with a status of ERRORED or a status of \n COMPLETED jobs with issues.

\n

For example, a message may say that a search \n contained recovery points unable to be scanned because \n of a permissions issue.

" + } + } + }, + "traits": { + "smithy.api#documentation": "

This is information pertaining to a search job.

" + } + }, + "com.amazonaws.backupsearch#SearchJobs": { + "type": "list", + "member": { + "target": "com.amazonaws.backupsearch#SearchJobSummary" + } + }, + "com.amazonaws.backupsearch#SearchResultExportJob": { + "type": "resource", + "identifiers": { + "ExportJobIdentifier": { + "target": "com.amazonaws.backupsearch#GenericId" + } + }, + "properties": { + "ExportJobArn": { + "target": "com.amazonaws.backupsearch#ExportJobArn" + }, + "SearchJobIdentifier": { + "target": "com.amazonaws.backupsearch#GenericId" + }, + "SearchJobArn": { + "target": "com.amazonaws.backupsearch#SearchJobArn" + }, + "Status": { + "target": "com.amazonaws.backupsearch#ExportJobStatus" + }, + "StatusMessage": { + "target": "smithy.api#String" + }, + "CreationTime": { + "target": "smithy.api#Timestamp" + }, + "CompletionTime": { + "target": "smithy.api#Timestamp" + }, + "ExportSpecification": { + "target": "com.amazonaws.backupsearch#ExportSpecification" + }, + "ClientToken": { + "target": "smithy.api#String" + }, + "Tags": { + "target": "com.amazonaws.backupsearch#TagMap" + }, + "RoleArn": { + "target": "com.amazonaws.backupsearch#IamRoleArn" + } + }, + "create": { + "target": "com.amazonaws.backupsearch#StartSearchResultExportJob" + }, + "read": { + "target": "com.amazonaws.backupsearch#GetSearchResultExportJob" + }, + "list": { + "target": "com.amazonaws.backupsearch#ListSearchResultExportJobs" + } + }, + "com.amazonaws.backupsearch#SearchScope": { + "type": "structure", + "members": { + "BackupResourceTypes": { + "target": "com.amazonaws.backupsearch#ResourceTypeList", + "traits": { + "smithy.api#documentation": "

The resource types included in a search.

\n

Eligible resource types include S3 and EBS.

", + "smithy.api#required": {} + } + }, + "BackupResourceCreationTime": { + "target": "com.amazonaws.backupsearch#BackupCreationTimeFilter", + "traits": { + "smithy.api#documentation": "

This is the time a backup resource was created.

" + } + }, + "SourceResourceArns": { + "target": "com.amazonaws.backupsearch#ResourceArnList", + "traits": { + "smithy.api#documentation": "

The Amazon Resource Name (ARN) that uniquely identifies \n the source resources.

" + } + }, + "BackupResourceArns": { + "target": "com.amazonaws.backupsearch#RecoveryPointArnList", + "traits": { + "smithy.api#documentation": "

The Amazon Resource Name (ARN) that uniquely identifies \n the backup resources.

" + } + }, + "BackupResourceTags": { + "target": "com.amazonaws.backupsearch#TagMap", + "traits": { + "smithy.api#documentation": "

These are one or more tags on the backup (recovery \n point).

" + } + } + }, + "traits": { + "smithy.api#documentation": "

The search scope is all backup \n properties input into a search.

" + } + }, + "com.amazonaws.backupsearch#SearchScopeSummary": { + "type": "structure", + "members": { + "TotalRecoveryPointsToScanCount": { + "target": "smithy.api#Integer", + "traits": { + "smithy.api#documentation": "

This is the count of the total number of backups \n that will be scanned in a search.

" + } + }, + "TotalItemsToScanCount": { + "target": "smithy.api#Long", + "traits": { + "smithy.api#documentation": "

This is the count of the total number of items \n that will be scanned in a search.

" + } + } + }, + "traits": { + "smithy.api#documentation": "

The summary of the specified search job scope, \n including:\n

\n " + } + }, + "com.amazonaws.backupsearch#ServiceQuotaExceededException": { + "type": "structure", + "members": { + "message": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

This request was not successful due to a service quota exceeding limits.

", + "smithy.api#required": {} + } + }, + "resourceId": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

Identifier of the resource.

", + "smithy.api#required": {} + } + }, + "resourceType": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

Type of resource.

", + "smithy.api#required": {} + } + }, + "serviceCode": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

This is the code unique to the originating service with the quota.

", + "smithy.api#required": {} + } + }, + "quotaCode": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

This is the code specific to the quota type.

", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#documentation": "

The request denied due to exceeding the quota limits permitted.

", + "smithy.api#error": "client", + "smithy.api#httpError": 402 + } + }, + "com.amazonaws.backupsearch#StartSearchJob": { + "type": "operation", + "input": { + "target": "com.amazonaws.backupsearch#StartSearchJobInput" + }, + "output": { + "target": "com.amazonaws.backupsearch#StartSearchJobOutput" + }, + "errors": [ + { + "target": "com.amazonaws.backupsearch#ConflictException" + }, + { + "target": "com.amazonaws.backupsearch#ServiceQuotaExceededException" + } + ], + "traits": { + "smithy.api#documentation": "

This operation creates a search job which returns \n recovery points filtered by SearchScope and items \n filtered by ItemFilters.

\n

You can optionally include ClientToken, \n EncryptionKeyArn, Name, and/or Tags.

", + "smithy.api#http": { + "code": 200, + "method": "PUT", + "uri": "/search-jobs" + }, + "smithy.api#idempotent": {} + } + }, + "com.amazonaws.backupsearch#StartSearchJobInput": { + "type": "structure", + "members": { + "Tags": { + "target": "com.amazonaws.backupsearch#TagMap", + "traits": { + "smithy.api#documentation": "

List of tags returned by the operation.

" + } + }, + "Name": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

Include alphanumeric characters to create a \n name for this search job.

", + "smithy.api#length": { + "max": 500 + } + } + }, + "EncryptionKeyArn": { + "target": "com.amazonaws.backupsearch#EncryptionKeyArn", + "traits": { + "smithy.api#documentation": "

The encryption key for the specified \n search job.

" + } + }, + "ClientToken": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

Include this parameter to allow multiple identical \n calls for idempotency.

\n

A client token is valid for 8 hours after the first \n request that uses it is completed. After this time,\n any request with the same token is treated as a \n new request.

" + } + }, + "SearchScope": { + "target": "com.amazonaws.backupsearch#SearchScope", + "traits": { + "smithy.api#documentation": "

This object can contain BackupResourceTypes, \n BackupResourceArns, BackupResourceCreationTime, \n BackupResourceTags, and SourceResourceArns to \n filter the recovery points returned by the search \n job.

", + "smithy.api#required": {} + } + }, + "ItemFilters": { + "target": "com.amazonaws.backupsearch#ItemFilters", + "traits": { + "smithy.api#documentation": "

Item Filters represent all input item \n properties specified when the search was \n created.

\n

Contains either EBSItemFilters or \n S3ItemFilters

" + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.backupsearch#StartSearchJobOutput": { + "type": "structure", + "members": { + "SearchJobArn": { + "target": "com.amazonaws.backupsearch#SearchJobArn", + "traits": { + "smithy.api#documentation": "

The unique string that identifies the Amazon Resource \n Name (ARN) of the specified search job.

" + } + }, + "CreationTime": { + "target": "smithy.api#Timestamp", + "traits": { + "smithy.api#documentation": "

The date and time that a job was created, in Unix format and Coordinated\n Universal Time (UTC). The value of CompletionTime is accurate to milliseconds.\n For example, the value 1516925490.087 represents Friday, January 26, 2018 12:11:30.087\n AM.

" + } + }, + "SearchJobIdentifier": { + "target": "com.amazonaws.backupsearch#GenericId", + "traits": { + "smithy.api#documentation": "

The unique string that specifies the search job.

", + "smithy.api#notProperty": {} + } + } + }, + "traits": { + "smithy.api#output": {} + } + }, + "com.amazonaws.backupsearch#StartSearchResultExportJob": { + "type": "operation", + "input": { + "target": "com.amazonaws.backupsearch#StartSearchResultExportJobInput" + }, + "output": { + "target": "com.amazonaws.backupsearch#StartSearchResultExportJobOutput" + }, + "errors": [ + { + "target": "com.amazonaws.backupsearch#ConflictException" + }, + { + "target": "com.amazonaws.backupsearch#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.backupsearch#ServiceQuotaExceededException" + } + ], + "traits": { + "smithy.api#documentation": "

This operations starts a job to export the results \n of search job to a designated S3 bucket.

", + "smithy.api#http": { + "code": 200, + "method": "PUT", + "uri": "/export-search-jobs" + }, + "smithy.api#idempotent": {} + } + }, + "com.amazonaws.backupsearch#StartSearchResultExportJobInput": { + "type": "structure", + "members": { + "SearchJobIdentifier": { + "target": "com.amazonaws.backupsearch#GenericId", + "traits": { + "smithy.api#documentation": "

The unique string that specifies the search job.

", + "smithy.api#required": {} + } + }, + "ExportSpecification": { + "target": "com.amazonaws.backupsearch#ExportSpecification", + "traits": { + "smithy.api#documentation": "

This specification contains a required string of the \n destination bucket; optionally, you can include the \n destination prefix.

", + "smithy.api#required": {} + } + }, + "ClientToken": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

Include this parameter to allow multiple identical \n calls for idempotency.

\n

A client token is valid for 8 hours after the first \n request that uses it is completed. After this time,\n any request with the same token is treated as a \n new request.

" + } + }, + "Tags": { + "target": "com.amazonaws.backupsearch#TagMap", + "traits": { + "smithy.api#documentation": "

Optional tags to include. A tag is a key-value pair you can use to manage, \n filter, and search for your resources. Allowed characters include UTF-8 letters, \n numbers, spaces, and the following characters: + - = . _ : /.

" + } + }, + "RoleArn": { + "target": "com.amazonaws.backupsearch#IamRoleArn", + "traits": { + "smithy.api#documentation": "

This parameter specifies the role ARN used to start \n the search results export jobs.

" + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.backupsearch#StartSearchResultExportJobOutput": { + "type": "structure", + "members": { + "ExportJobArn": { + "target": "com.amazonaws.backupsearch#ExportJobArn", + "traits": { + "smithy.api#documentation": "

This is the unique ARN (Amazon Resource Name) that \n belongs to the new export job.

" + } + }, + "ExportJobIdentifier": { + "target": "com.amazonaws.backupsearch#GenericId", + "traits": { + "smithy.api#documentation": "

This is the unique identifier that \n specifies the new export job.

", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#output": {} + } + }, + "com.amazonaws.backupsearch#StopSearchJob": { + "type": "operation", + "input": { + "target": "com.amazonaws.backupsearch#StopSearchJobInput" + }, + "output": { + "target": "com.amazonaws.backupsearch#StopSearchJobOutput" + }, + "errors": [ + { + "target": "com.amazonaws.backupsearch#ConflictException" + }, + { + "target": "com.amazonaws.backupsearch#ResourceNotFoundException" + } + ], + "traits": { + "smithy.api#documentation": "

This operations ends a search job.

\n

Only a search job with a status of RUNNING \n can be stopped.

", + "smithy.api#http": { + "code": 200, + "method": "PUT", + "uri": "/search-jobs/{SearchJobIdentifier}/actions/cancel" + }, + "smithy.api#idempotent": {} + } + }, + "com.amazonaws.backupsearch#StopSearchJobInput": { + "type": "structure", + "members": { + "SearchJobIdentifier": { + "target": "com.amazonaws.backupsearch#GenericId", + "traits": { + "smithy.api#documentation": "

The unique string that specifies the search job.

", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.backupsearch#StopSearchJobOutput": { + "type": "structure", + "members": {}, + "traits": { + "smithy.api#output": {} + } + }, + "com.amazonaws.backupsearch#StringCondition": { + "type": "structure", + "members": { + "Value": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

The value of the string.

", + "smithy.api#required": {} + } + }, + "Operator": { + "target": "com.amazonaws.backupsearch#StringConditionOperator", + "traits": { + "smithy.api#default": "EQUALS_TO", + "smithy.api#documentation": "

A string that defines what values will be \n returned.

\n

If this is included, avoid combinations of \n operators that will return all possible values. \n For example, including both EQUALS_TO \n and NOT_EQUALS_TO with a value of 4 \n will return all values.

" + } + } + }, + "traits": { + "smithy.api#documentation": "

This contains the value of the string and can contain \n one or more operators.

" + } + }, + "com.amazonaws.backupsearch#StringConditionList": { + "type": "list", + "member": { + "target": "com.amazonaws.backupsearch#StringCondition" + }, + "traits": { + "smithy.api#length": { + "min": 1, + "max": 10 + } + } + }, + "com.amazonaws.backupsearch#StringConditionOperator": { + "type": "enum", + "members": { + "EQUALS_TO": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "EQUALS_TO" + } + }, + "NOT_EQUALS_TO": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "NOT_EQUALS_TO" + } + }, + "CONTAINS": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "CONTAINS" + } + }, + "DOES_NOT_CONTAIN": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "DOES_NOT_CONTAIN" + } + }, + "BEGINS_WITH": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "BEGINS_WITH" + } + }, + "ENDS_WITH": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "ENDS_WITH" + } + }, + "DOES_NOT_BEGIN_WITH": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "DOES_NOT_BEGIN_WITH" + } + }, + "DOES_NOT_END_WITH": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "DOES_NOT_END_WITH" + } + } + } + }, + "com.amazonaws.backupsearch#TagKeys": { + "type": "list", + "member": { + "target": "smithy.api#String" + } + }, + "com.amazonaws.backupsearch#TagMap": { + "type": "map", + "key": { + "target": "smithy.api#String" + }, + "value": { + "target": "smithy.api#String" + }, + "traits": { + "smithy.api#sparse": {} + } + }, + "com.amazonaws.backupsearch#TagResource": { + "type": "operation", + "input": { + "target": "com.amazonaws.backupsearch#TagResourceRequest" + }, + "output": { + "target": "com.amazonaws.backupsearch#TagResourceResponse" + }, + "errors": [ + { + "target": "com.amazonaws.backupsearch#ResourceNotFoundException" + } + ], + "traits": { + "smithy.api#documentation": "

This operation puts tags on the resource you indicate.

", + "smithy.api#http": { + "uri": "/tags/{ResourceArn}", + "method": "POST" + }, + "smithy.api#idempotent": {} + } + }, + "com.amazonaws.backupsearch#TagResourceRequest": { + "type": "structure", + "members": { + "ResourceArn": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

The Amazon Resource Name (ARN) that uniquely identifies \n the resource.

\n

This is the resource that will have the indicated tags.

", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "Tags": { + "target": "com.amazonaws.backupsearch#TagMap", + "traits": { + "smithy.api#documentation": "

Required tags to include. A tag is a key-value pair you can use to manage, \n filter, and search for your resources. Allowed characters include UTF-8 letters, \n numbers, spaces, and the following characters: + - = . _ : /.

", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.backupsearch#TagResourceResponse": { + "type": "structure", + "members": {}, + "traits": { + "smithy.api#output": {} + } + }, + "com.amazonaws.backupsearch#ThrottlingException": { + "type": "structure", + "members": { + "message": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

Request was unsuccessful due to request throttling.

", + "smithy.api#required": {} + } + }, + "serviceCode": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

This is the code unique to the originating service.

" + } + }, + "quotaCode": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

This is the code unique to the originating service with the quota.

" + } + }, + "retryAfterSeconds": { + "target": "smithy.api#Integer", + "traits": { + "smithy.api#documentation": "

Retry the call after number of seconds.

", + "smithy.api#httpHeader": "Retry-After" + } + } + }, + "traits": { + "smithy.api#documentation": "

The request was denied due to request throttling.

", + "smithy.api#error": "client", + "smithy.api#httpError": 429, + "smithy.api#retryable": { + "throttling": true + } + } + }, + "com.amazonaws.backupsearch#TimeCondition": { + "type": "structure", + "members": { + "Value": { + "target": "smithy.api#Timestamp", + "traits": { + "smithy.api#documentation": "

This is the timestamp value of the time condition.

", + "smithy.api#required": {} + } + }, + "Operator": { + "target": "com.amazonaws.backupsearch#TimeConditionOperator", + "traits": { + "smithy.api#default": "EQUALS_TO", + "smithy.api#documentation": "

A string that defines what values will be \n returned.

\n

If this is included, avoid combinations of \n operators that will return all possible values. \n For example, including both EQUALS_TO \n and NOT_EQUALS_TO with a value of 4 \n will return all values.

" + } + } + }, + "traits": { + "smithy.api#documentation": "

A time condition denotes a creation time, last modification time, \n or other time.

" + } + }, + "com.amazonaws.backupsearch#TimeConditionList": { + "type": "list", + "member": { + "target": "com.amazonaws.backupsearch#TimeCondition" + }, + "traits": { + "smithy.api#length": { + "min": 1, + "max": 10 + } + } + }, + "com.amazonaws.backupsearch#TimeConditionOperator": { + "type": "enum", + "members": { + "EQUALS_TO": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "EQUALS_TO" + } + }, + "NOT_EQUALS_TO": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "NOT_EQUALS_TO" + } + }, + "LESS_THAN_EQUAL_TO": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "LESS_THAN_EQUAL_TO" + } + }, + "GREATER_THAN_EQUAL_TO": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "GREATER_THAN_EQUAL_TO" + } + } + } + }, + "com.amazonaws.backupsearch#UntagResource": { + "type": "operation", + "input": { + "target": "com.amazonaws.backupsearch#UntagResourceRequest" + }, + "output": { + "target": "com.amazonaws.backupsearch#UntagResourceResponse" + }, + "errors": [ + { + "target": "com.amazonaws.backupsearch#ResourceNotFoundException" + } + ], + "traits": { + "smithy.api#documentation": "

This operation removes tags from the specified resource.

", + "smithy.api#http": { + "uri": "/tags/{ResourceArn}", + "method": "DELETE" + }, + "smithy.api#idempotent": {} + } + }, + "com.amazonaws.backupsearch#UntagResourceRequest": { + "type": "structure", + "members": { + "ResourceArn": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

The Amazon Resource Name (ARN) that uniquely identifies \n the resource where you want to remove tags.

", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "TagKeys": { + "target": "com.amazonaws.backupsearch#TagKeys", + "traits": { + "smithy.api#documentation": "

This required parameter contains the tag keys you \n want to remove from the source.

", + "smithy.api#httpQuery": "tagKeys", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.backupsearch#UntagResourceResponse": { + "type": "structure", + "members": {}, + "traits": { + "smithy.api#output": {} + } + }, + "com.amazonaws.backupsearch#ValidationException": { + "type": "structure", + "members": { + "message": { + "target": "smithy.api#String", + "traits": { + "smithy.api#documentation": "

The input fails to satisfy the constraints specified by an Amazon service.

", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#documentation": "

The input fails to satisfy the constraints specified by a service.

", + "smithy.api#error": "client", + "smithy.api#httpError": 400 + } + } + } +} \ No newline at end of file diff --git a/aws-models/batch.json b/aws-models/batch.json index b7de037903c3..7319b98ad97b 100644 --- a/aws-models/batch.json +++ b/aws-models/batch.json @@ -1810,27 +1810,27 @@ "allocationStrategy": { "target": "com.amazonaws.batch#CRAllocationStrategy", "traits": { - "smithy.api#documentation": "

The allocation strategy to use for the compute resource if not enough instances of the best\n fitting instance type can be allocated. This might be because of availability of the instance\n type in the Region or Amazon EC2 service limits. For more\n information, see Allocation strategies in the Batch User Guide.

\n \n

This parameter isn't applicable to jobs that are running on Fargate resources. Don't specify it.

\n
\n
\n
BEST_FIT (default)
\n
\n

Batch selects an instance type that best fits the needs of the jobs with a preference\n for the lowest-cost instance type. If additional instances of the selected instance type\n aren't available, Batch waits for the additional instances to be available. If there aren't\n enough instances available or the user is reaching Amazon EC2 service limits,\n additional jobs aren't run until the currently running jobs are completed. This allocation\n strategy keeps costs lower but can limit scaling. If you're using Spot Fleets with\n BEST_FIT, the Spot Fleet IAM Role must be specified. Compute resources that use\n a BEST_FIT allocation strategy don't support infrastructure updates and can't\n update some parameters. For more information, see Updating compute environments in\n the Batch User Guide.

\n
\n
BEST_FIT_PROGRESSIVE
\n
\n

Batch selects additional instance types that are large enough to meet the requirements\n of the jobs in the queue. Its preference is for instance types with lower cost vCPUs. If\n additional instances of the previously selected instance types aren't available, Batch\n selects new instance types.

\n
\n
SPOT_CAPACITY_OPTIMIZED
\n
\n

Batch selects one or more instance types that are large enough to meet the requirements\n of the jobs in the queue. Its preference is for instance types that are less likely to be\n interrupted. This allocation strategy is only available for Spot Instance compute\n resources.

\n
\n
SPOT_PRICE_CAPACITY_OPTIMIZED
\n
\n

The price and capacity optimized allocation strategy looks at both price and capacity to\n select the Spot Instance pools that are the least likely to be interrupted and have the lowest\n possible price. This allocation strategy is only available for Spot Instance compute\n resources.

\n
\n
\n

With BEST_FIT_PROGRESSIVE,SPOT_CAPACITY_OPTIMIZED and\n SPOT_PRICE_CAPACITY_OPTIMIZED\n (recommended) strategies using On-Demand or Spot Instances, and the\n BEST_FIT strategy using Spot Instances, Batch might need to exceed\n maxvCpus to meet your capacity requirements. In this event, Batch never exceeds\n maxvCpus by more than a single instance.

" + "smithy.api#documentation": "

The allocation strategy to use for the compute resource if not enough instances of the best\n fitting instance type can be allocated. This might be because of availability of the instance\n type in the Region or Amazon EC2 service limits. For more\n information, see Allocation strategies in the Batch User Guide.

\n \n

This parameter isn't applicable to jobs that are running on Fargate resources. Don't specify it.

\n
\n
\n
BEST_FIT (default)
\n
\n

Batch selects an instance type that best fits the needs of the jobs with a preference\n for the lowest-cost instance type. If additional instances of the selected instance type\n aren't available, Batch waits for the additional instances to be available. If there aren't\n enough instances available or the user is reaching Amazon EC2 service limits,\n additional jobs aren't run until the currently running jobs are completed. This allocation\n strategy keeps costs lower but can limit scaling. If you're using Spot Fleets with\n BEST_FIT, the Spot Fleet IAM Role must be specified. Compute resources that use\n a BEST_FIT allocation strategy don't support infrastructure updates and can't\n update some parameters. For more information, see Updating compute environments in\n the Batch User Guide.

\n
\n
BEST_FIT_PROGRESSIVE
\n
\n

Batch selects additional instance types that are large enough to meet the requirements\n of the jobs in the queue. Its preference is for instance types with lower cost vCPUs. If\n additional instances of the previously selected instance types aren't available, Batch\n selects new instance types.

\n
\n
SPOT_CAPACITY_OPTIMIZED
\n
\n

Batch selects one or more instance types that are large enough to meet the requirements\n of the jobs in the queue. Its preference is for instance types that are less likely to be\n interrupted. This allocation strategy is only available for Spot Instance compute\n resources.

\n
\n
SPOT_PRICE_CAPACITY_OPTIMIZED
\n
\n

The price and capacity optimized allocation strategy looks at both price and capacity to\n select the Spot Instance pools that are the least likely to be interrupted and have the lowest\n possible price. This allocation strategy is only available for Spot Instance compute\n resources.

\n
\n
\n

With BEST_FIT_PROGRESSIVE,SPOT_CAPACITY_OPTIMIZED and\n SPOT_PRICE_CAPACITY_OPTIMIZED (recommended) strategies using On-Demand or Spot \n Instances, and the BEST_FIT strategy using Spot Instances, Batch might need to \n exceed maxvCpus to meet your capacity requirements. In this event, Batch never \n exceeds maxvCpus by more than a single instance.

" } }, "minvCpus": { "target": "com.amazonaws.batch#Integer", "traits": { - "smithy.api#documentation": "

The minimum number of\n vCPUs that\n a\n compute\n environment should maintain (even if the compute environment is DISABLED).

\n \n

This parameter isn't applicable to jobs that are running on Fargate resources. Don't specify it.

\n
" + "smithy.api#documentation": "

The minimum number of vCPUs that a compute environment should maintain (even if the compute \n environment is DISABLED).

\n \n

This parameter isn't applicable to jobs that are running on Fargate resources. Don't specify it.

\n
" } }, "maxvCpus": { "target": "com.amazonaws.batch#Integer", "traits": { "smithy.api#clientOptional": {}, - "smithy.api#documentation": "

The maximum number of\n vCPUs that a\n compute environment can\n support.

\n \n

With BEST_FIT_PROGRESSIVE,SPOT_CAPACITY_OPTIMIZED and\n SPOT_PRICE_CAPACITY_OPTIMIZED\n (recommended) strategies using On-Demand or Spot Instances, and the\n BEST_FIT strategy using Spot Instances, Batch might need to exceed\n maxvCpus to meet your capacity requirements. In this event, Batch never exceeds\n maxvCpus by more than a single instance.

\n
", + "smithy.api#documentation": "

The maximum number of vCPUs that a compute environment can support.

\n \n

With BEST_FIT_PROGRESSIVE,SPOT_CAPACITY_OPTIMIZED and\n SPOT_PRICE_CAPACITY_OPTIMIZED (recommended) strategies using On-Demand or Spot Instances, \n and the BEST_FIT strategy using Spot Instances, Batch might need to exceed\n maxvCpus to meet your capacity requirements. In this event, Batch never exceeds\n maxvCpus by more than a single instance.

\n
", "smithy.api#required": {} } }, "desiredvCpus": { "target": "com.amazonaws.batch#Integer", "traits": { - "smithy.api#documentation": "

The desired number of\n vCPUS in the\n compute environment. Batch modifies this value between the minimum and maximum values based on\n job queue demand.

\n \n

This parameter isn't applicable to jobs that are running on Fargate resources. Don't specify it.

\n
" + "smithy.api#documentation": "

The desired number of vCPUS in the compute environment. Batch modifies this value between \n the minimum and maximum values based on job queue demand.

\n \n

This parameter isn't applicable to jobs that are running on Fargate resources. Don't specify it.

\n
" } }, "instanceTypes": { @@ -1889,7 +1889,7 @@ "bidPercentage": { "target": "com.amazonaws.batch#Integer", "traits": { - "smithy.api#documentation": "

The maximum percentage that a Spot Instance price can be when compared with the On-Demand\n price for that instance type before instances are launched. For example, if your maximum\n percentage is 20%, then the Spot price must be less than 20% of the current On-Demand price for\n that Amazon EC2 instance. You always pay the lowest (market) price and never more than your maximum\n percentage. If you leave this field empty, the default value is 100% of the On-Demand\n price. For most use cases,\n we recommend leaving this field empty.

\n \n

This parameter isn't applicable to jobs that are running on Fargate resources. Don't specify it.

\n
" + "smithy.api#documentation": "

The maximum percentage that a Spot Instance price can be when compared with the On-Demand\n price for that instance type before instances are launched. For example, if your maximum\n percentage is 20%, then the Spot price must be less than 20% of the current On-Demand price for\n that Amazon EC2 instance. You always pay the lowest (market) price and never more than your maximum\n percentage. If you leave this field empty, the default value is 100% of the On-Demand\n price. For most use cases, we recommend leaving this field empty.

\n \n

This parameter isn't applicable to jobs that are running on Fargate resources. Don't specify it.

\n
" } }, "spotIamFleetRole": { @@ -1921,19 +1921,19 @@ "minvCpus": { "target": "com.amazonaws.batch#Integer", "traits": { - "smithy.api#documentation": "

The minimum number of\n vCPUs that\n an environment should maintain (even if the compute environment is DISABLED).

\n \n

This parameter isn't applicable to jobs that are running on Fargate resources. Don't specify it.

\n
" + "smithy.api#documentation": "

The minimum number of vCPUs that an environment should maintain (even if the compute environment \n is DISABLED).

\n \n

This parameter isn't applicable to jobs that are running on Fargate resources. Don't specify it.

\n
" } }, "maxvCpus": { "target": "com.amazonaws.batch#Integer", "traits": { - "smithy.api#documentation": "

The maximum number of Amazon EC2 vCPUs that an environment can reach.

\n \n

With BEST_FIT_PROGRESSIVE,SPOT_CAPACITY_OPTIMIZED and\n SPOT_PRICE_CAPACITY_OPTIMIZED\n (recommended) strategies using On-Demand or Spot Instances, and the\n BEST_FIT strategy using Spot Instances, Batch might need to exceed\n maxvCpus to meet your capacity requirements. In this event, Batch never exceeds\n maxvCpus by more than a single instance.

\n
" + "smithy.api#documentation": "

The maximum number of Amazon EC2 vCPUs that an environment can reach.

\n \n

With BEST_FIT_PROGRESSIVE,SPOT_CAPACITY_OPTIMIZED and\n SPOT_PRICE_CAPACITY_OPTIMIZED (recommended) strategies using On-Demand or Spot \n Instances, and the BEST_FIT strategy using Spot Instances, Batch might need to \n exceed maxvCpus to meet your capacity requirements. In this event, Batch never \n exceeds maxvCpus by more than a single instance.

\n
" } }, "desiredvCpus": { "target": "com.amazonaws.batch#Integer", "traits": { - "smithy.api#documentation": "

The desired number of\n vCPUS in the\n compute environment. Batch modifies this value between the minimum and maximum values based on\n job queue demand.

\n \n

This parameter isn't applicable to jobs that are running on Fargate resources. Don't specify it.

\n
\n \n

Batch doesn't support changing the desired number of vCPUs of an existing compute\n environment. Don't specify this parameter for compute environments using Amazon EKS clusters.

\n
\n \n

When you update the desiredvCpus setting, the value must be between the\n minvCpus and maxvCpus values.

\n

Additionally, the updated desiredvCpus value must be greater than or equal to\n the current desiredvCpus value. For more information, see Troubleshooting\n Batch in the Batch User Guide.

\n
" + "smithy.api#documentation": "

The desired number of vCPUS in the compute environment. Batch modifies this value between \n the minimum and maximum values based on job queue demand.

\n \n

This parameter isn't applicable to jobs that are running on Fargate resources. Don't specify it.

\n
\n \n

Batch doesn't support changing the desired number of vCPUs of an existing compute\n environment. Don't specify this parameter for compute environments using Amazon EKS clusters.

\n
\n \n

When you update the desiredvCpus setting, the value must be between the\n minvCpus and maxvCpus values.

\n

Additionally, the updated desiredvCpus value must be greater than or equal to\n the current desiredvCpus value. For more information, see Troubleshooting\n Batch in the Batch User Guide.

\n
" } }, "subnets": { @@ -1951,7 +1951,7 @@ "allocationStrategy": { "target": "com.amazonaws.batch#CRUpdateAllocationStrategy", "traits": { - "smithy.api#documentation": "

The allocation strategy to use for the compute resource if there's not enough instances of\n the best fitting instance type that can be allocated. This might be because of availability of\n the instance type in the Region or Amazon EC2 service limits. For more\n information, see Allocation strategies in the Batch User Guide.

\n

When updating a compute environment, changing the allocation strategy requires an\n infrastructure update of the compute environment. For more information, see Updating compute\n environments in the Batch User Guide. BEST_FIT isn't\n supported when updating a compute environment.

\n \n

This parameter isn't applicable to jobs that are running on Fargate resources. Don't specify it.

\n
\n
\n
BEST_FIT_PROGRESSIVE
\n
\n

Batch selects additional instance types that are large enough to meet the requirements\n of the jobs in the queue. Its preference is for instance types with lower cost vCPUs. If\n additional instances of the previously selected instance types aren't available, Batch\n selects new instance types.

\n
\n
SPOT_CAPACITY_OPTIMIZED
\n
\n

Batch selects one or more instance types that are large enough to meet the requirements\n of the jobs in the queue. Its preference is for instance types that are less likely to be\n interrupted. This allocation strategy is only available for Spot Instance compute\n resources.

\n
\n
SPOT_PRICE_CAPACITY_OPTIMIZED
\n
\n

The price and capacity optimized allocation strategy looks at both price and capacity to\n select the Spot Instance pools that are the least likely to be interrupted and have the lowest\n possible price. This allocation strategy is only available for Spot Instance compute\n resources.

\n
\n
\n

With BEST_FIT_PROGRESSIVE,SPOT_CAPACITY_OPTIMIZED and\n SPOT_PRICE_CAPACITY_OPTIMIZED\n (recommended) strategies using On-Demand or Spot Instances, and the\n BEST_FIT strategy using Spot Instances, Batch might need to exceed\n maxvCpus to meet your capacity requirements. In this event, Batch never exceeds\n maxvCpus by more than a single instance.

" + "smithy.api#documentation": "

The allocation strategy to use for the compute resource if there's not enough instances of\n the best fitting instance type that can be allocated. This might be because of availability of\n the instance type in the Region or Amazon EC2 service limits. For more\n information, see Allocation strategies in the Batch User Guide.

\n

When updating a compute environment, changing the allocation strategy requires an\n infrastructure update of the compute environment. For more information, see Updating compute\n environments in the Batch User Guide. BEST_FIT isn't\n supported when updating a compute environment.

\n \n

This parameter isn't applicable to jobs that are running on Fargate resources. Don't specify it.

\n
\n
\n
BEST_FIT_PROGRESSIVE
\n
\n

Batch selects additional instance types that are large enough to meet the requirements\n of the jobs in the queue. Its preference is for instance types with lower cost vCPUs. If\n additional instances of the previously selected instance types aren't available, Batch\n selects new instance types.

\n
\n
SPOT_CAPACITY_OPTIMIZED
\n
\n

Batch selects one or more instance types that are large enough to meet the requirements\n of the jobs in the queue. Its preference is for instance types that are less likely to be\n interrupted. This allocation strategy is only available for Spot Instance compute\n resources.

\n
\n
SPOT_PRICE_CAPACITY_OPTIMIZED
\n
\n

The price and capacity optimized allocation strategy looks at both price and capacity to\n select the Spot Instance pools that are the least likely to be interrupted and have the lowest\n possible price. This allocation strategy is only available for Spot Instance compute\n resources.

\n
\n
\n

With BEST_FIT_PROGRESSIVE,SPOT_CAPACITY_OPTIMIZED and\n SPOT_PRICE_CAPACITY_OPTIMIZED (recommended) strategies using On-Demand or Spot Instances, \n and the BEST_FIT strategy using Spot Instances, Batch might need to exceed\n maxvCpus to meet your capacity requirements. In this event, Batch never exceeds\n maxvCpus by more than a single instance.

" } }, "instanceTypes": { @@ -1969,7 +1969,7 @@ "instanceRole": { "target": "com.amazonaws.batch#String", "traits": { - "smithy.api#documentation": "

The Amazon ECS instance profile applied to Amazon EC2 instances in a compute environment.\n Required for Amazon EC2\n instances. You can specify the short name or full Amazon Resource Name (ARN) of an instance\n profile. For example, \n ecsInstanceRole\n or\n arn:aws:iam:::instance-profile/ecsInstanceRole\n .\n For more information, see Amazon ECS instance role in the Batch User Guide.

\n

When updating a compute environment, changing this setting requires an infrastructure update\n of the compute environment. For more information, see Updating compute environments in the\n Batch User Guide.

\n \n

This parameter isn't applicable to jobs that are running on Fargate resources. Don't specify it.

\n
" + "smithy.api#documentation": "

The Amazon ECS instance profile applied to Amazon EC2 instances in a compute environment.\n Required for Amazon EC2 instances. You can specify the short name or full Amazon Resource Name (ARN) of an instance\n profile. For example, \n ecsInstanceRole\n or\n arn:aws:iam:::instance-profile/ecsInstanceRole\n .\n For more information, see Amazon ECS instance role in the Batch User Guide.

\n

When updating a compute environment, changing this setting requires an infrastructure update\n of the compute environment. For more information, see Updating compute environments in the\n Batch User Guide.

\n \n

This parameter isn't applicable to jobs that are running on Fargate resources. Don't specify it.

\n
" } }, "tags": { @@ -1987,7 +1987,7 @@ "bidPercentage": { "target": "com.amazonaws.batch#Integer", "traits": { - "smithy.api#documentation": "

The maximum percentage that a Spot Instance price can be when compared with the On-Demand\n price for that instance type before instances are launched. For example, if your maximum\n percentage is 20%, the Spot price must be less than 20% of the current On-Demand price for that\n Amazon EC2 instance. You always pay the lowest (market) price and never more than your maximum\n percentage. For most use\n cases, we recommend leaving this field empty.

\n

When updating a compute environment, changing the bid percentage requires an infrastructure\n update of the compute environment. For more information, see Updating compute environments in the\n Batch User Guide.

\n \n

This parameter isn't applicable to jobs that are running on Fargate resources. Don't specify it.

\n
" + "smithy.api#documentation": "

The maximum percentage that a Spot Instance price can be when compared with the On-Demand\n price for that instance type before instances are launched. For example, if your maximum\n percentage is 20%, the Spot price must be less than 20% of the current On-Demand price for that\n Amazon EC2 instance. You always pay the lowest (market) price and never more than your maximum\n percentage. For most use cases, we recommend leaving this field empty.

\n

When updating a compute environment, changing the bid percentage requires an infrastructure\n update of the compute environment. For more information, see Updating compute environments in the\n Batch User Guide.

\n \n

This parameter isn't applicable to jobs that are running on Fargate resources. Don't specify it.

\n
" } }, "launchTemplate": { @@ -2061,7 +2061,7 @@ "executionRoleArn": { "target": "com.amazonaws.batch#String", "traits": { - "smithy.api#documentation": "

The Amazon Resource Name (ARN) of the\n execution\n role that Batch can assume. For more information,\n see Batch execution IAM\n role in the Batch User Guide.

" + "smithy.api#documentation": "

The Amazon Resource Name (ARN) of the execution role that Batch can assume. For more information,\n see Batch execution IAM\n role in the Batch User Guide.

" } }, "volumes": { @@ -2263,7 +2263,7 @@ "image": { "target": "com.amazonaws.batch#String", "traits": { - "smithy.api#documentation": "

Required.\n The image used to start a container. This string is passed directly to the\n Docker daemon. Images in the Docker Hub registry are available by default. Other repositories are\n specified with\n \n repository-url/image:tag\n .\n It can be 255 characters long. It can contain uppercase and lowercase letters, numbers,\n hyphens (-), underscores (_), colons (:), periods (.), forward slashes (/), and number signs (#). This parameter maps to Image in the\n Create a container section of the Docker Remote API and the IMAGE\n parameter of docker run.

\n \n

Docker image architecture must match the processor architecture of the compute resources\n that they're scheduled on. For example, ARM-based Docker images can only run on ARM-based\n compute resources.

\n
\n " + "smithy.api#documentation": "

Required. The image used to start a container. This string is passed directly to the\n Docker daemon. Images in the Docker Hub registry are available by default. Other repositories are\n specified with\n \n repository-url/image:tag\n .\n It can be 255 characters long. It can contain uppercase and lowercase letters, numbers,\n hyphens (-), underscores (_), colons (:), periods (.), forward slashes (/), and number signs (#). This parameter maps to Image in the\n Create a container section of the Docker Remote API and the IMAGE\n parameter of docker run.

\n \n

Docker image architecture must match the processor architecture of the compute resources\n that they're scheduled on. For example, ARM-based Docker images can only run on ARM-based\n compute resources.

\n
\n " } }, "vcpus": { @@ -2406,7 +2406,7 @@ } }, "traits": { - "smithy.api#documentation": "

Container properties are used\n for\n Amazon ECS based job definitions. These properties to describe the container that's\n launched as part of a job.

" + "smithy.api#documentation": "

Container properties are used for Amazon ECS based job definitions. These properties to describe the \n container that's launched as part of a job.

" } }, "com.amazonaws.batch#ContainerSummary": { @@ -2446,7 +2446,7 @@ } ], "traits": { - "smithy.api#documentation": "

Creates an Batch compute environment. You can create MANAGED or\n UNMANAGED compute environments. MANAGED compute environments can\n use Amazon EC2 or Fargate resources. UNMANAGED compute environments can only use\n EC2 resources.

\n

In a managed compute environment, Batch manages the capacity and instance types of the\n compute resources within the environment. This is based on the compute resource specification\n that you define or the launch template that you\n specify when you create the compute environment. Either, you can choose to use EC2 On-Demand\n Instances and EC2 Spot Instances. Or, you can use Fargate and Fargate Spot capacity in\n your managed compute environment. You can optionally set a maximum price so that Spot\n Instances only launch when the Spot Instance price is less than a specified percentage of the\n On-Demand price.

\n \n

Multi-node parallel jobs aren't supported on Spot Instances.

\n
\n

In an unmanaged compute environment, you can manage your own EC2 compute resources and\n have flexibility with how you configure your compute resources. For example, you can use\n custom AMIs. However, you must verify that each of your AMIs meet the Amazon ECS container instance\n AMI specification. For more information, see container instance AMIs in the\n Amazon Elastic Container Service Developer Guide. After you created your unmanaged compute environment,\n you can use the DescribeComputeEnvironments operation to find the Amazon ECS\n cluster that's associated with it. Then, launch your container instances into that Amazon ECS\n cluster. For more information, see Launching an Amazon ECS container\n instance in the Amazon Elastic Container Service Developer Guide.

\n \n

To create a compute environment that uses EKS resources, the caller must have\n permissions to call eks:DescribeCluster.

\n
\n \n

Batch doesn't automatically upgrade the AMIs in a compute environment after it's\n created. For example, it also doesn't update the AMIs in your compute environment when a\n newer version of the Amazon ECS optimized AMI is available. You're responsible for the management\n of the guest operating system. This includes any updates and security patches. You're also\n responsible for any additional application software or utilities that you install on the\n compute resources. There are two ways to use a new AMI for your Batch jobs. The original\n method is to complete these steps:

\n
    \n
  1. \n

    Create a new compute environment with the new AMI.

    \n
  2. \n
  3. \n

    Add the compute environment to an existing job queue.

    \n
  4. \n
  5. \n

    Remove the earlier compute environment from your job queue.

    \n
  6. \n
  7. \n

    Delete the earlier compute environment.

    \n
  8. \n
\n

In April 2022, Batch added enhanced support for updating compute environments. For\n more information, see Updating compute environments.\n To use the enhanced updating of compute environments to update AMIs, follow these\n rules:

\n \n

If these rules are followed, any update that starts an infrastructure update causes the\n AMI ID to be re-selected. If the version setting in the launch template\n (launchTemplate) is set to $Latest or $Default, the\n latest or default version of the launch template is evaluated up at the time of the\n infrastructure update, even if the launchTemplate wasn't updated.

\n
", + "smithy.api#documentation": "

Creates an Batch compute environment. You can create MANAGED or\n UNMANAGED compute environments. MANAGED compute environments can\n use Amazon EC2 or Fargate resources. UNMANAGED compute environments can only use\n EC2 resources.

\n

In a managed compute environment, Batch manages the capacity and instance types of the\n compute resources within the environment. This is based on the compute resource specification\n that you define or the launch template that you\n specify when you create the compute environment. Either, you can choose to use EC2 On-Demand\n Instances and EC2 Spot Instances. Or, you can use Fargate and Fargate Spot capacity in\n your managed compute environment. You can optionally set a maximum price so that Spot\n Instances only launch when the Spot Instance price is less than a specified percentage of the\n On-Demand price.

\n \n

Multi-node parallel jobs aren't supported on Spot Instances.

\n
\n

In an unmanaged compute environment, you can manage your own EC2 compute resources and\n have flexibility with how you configure your compute resources. For example, you can use\n custom AMIs. However, you must verify that each of your AMIs meet the Amazon ECS container instance\n AMI specification. For more information, see container instance AMIs in the\n Amazon Elastic Container Service Developer Guide. After you created your unmanaged compute environment,\n you can use the DescribeComputeEnvironments operation to find the Amazon ECS\n cluster that's associated with it. Then, launch your container instances into that Amazon ECS\n cluster. For more information, see Launching an Amazon ECS container\n instance in the Amazon Elastic Container Service Developer Guide.

\n \n

To create a compute environment that uses EKS resources, the caller must have\n permissions to call eks:DescribeCluster.

\n
\n \n

Batch doesn't automatically upgrade the AMIs in a compute environment after it's\n created. For example, it also doesn't update the AMIs in your compute environment when a\n newer version of the Amazon ECS optimized AMI is available. You're responsible for the management\n of the guest operating system. This includes any updates and security patches. You're also\n responsible for any additional application software or utilities that you install on the\n compute resources. There are two ways to use a new AMI for your Batch jobs. The original\n method is to complete these steps:

\n
    \n
  1. \n

    Create a new compute environment with the new AMI.

    \n
  2. \n
  3. \n

    Add the compute environment to an existing job queue.

    \n
  4. \n
  5. \n

    Remove the earlier compute environment from your job queue.

    \n
  6. \n
  7. \n

    Delete the earlier compute environment.

    \n
  8. \n
\n

In April 2022, Batch added enhanced support for updating compute environments. For\n more information, see Updating compute environments.\n To use the enhanced updating of compute environments to update AMIs, follow these\n rules:

\n \n

If these rules are followed, any update that starts an infrastructure update causes the\n AMI ID to be re-selected. If the version setting in the launch template\n (launchTemplate) is set to $Latest or $Default, the\n latest or default version of the launch template is evaluated up at the time of the\n infrastructure update, even if the launchTemplate wasn't updated.

\n
", "smithy.api#examples": [ { "title": "To create a managed EC2 compute environment", @@ -3989,6 +3989,15 @@ "smithy.api#documentation": "

The properties for a task definition that describes the container and volume definitions of\n an Amazon ECS task. You can specify which Docker images to use, the required resources, and other\n configurations related to launching the task definition through an Amazon ECS service or task.

" } }, + "com.amazonaws.batch#EksAnnotationsMap": { + "type": "map", + "key": { + "target": "com.amazonaws.batch#String" + }, + "value": { + "target": "com.amazonaws.batch#String" + } + }, "com.amazonaws.batch#EksAttemptContainerDetail": { "type": "structure", "members": { @@ -4420,6 +4429,12 @@ "smithy.api#documentation": "

The path on the container where the volume is mounted.

" } }, + "subPath": { + "target": "com.amazonaws.batch#String", + "traits": { + "smithy.api#documentation": "

A sub-path inside the referenced volume instead of its root.

" + } + }, "readOnly": { "target": "com.amazonaws.batch#Boolean", "traits": { @@ -4503,10 +4518,44 @@ "traits": { "smithy.api#documentation": "

Key-value pairs used to identify, sort, and organize cube resources. Can contain up to 63\n uppercase letters, lowercase letters, numbers, hyphens (-), and underscores (_). Labels can be\n added or modified at any time. Each resource can have multiple labels, but each key must be\n unique for a given object.

" } + }, + "annotations": { + "target": "com.amazonaws.batch#EksAnnotationsMap", + "traits": { + "smithy.api#documentation": "

Key-value pairs used to attach arbitrary, non-identifying metadata to Kubernetes objects. \n Valid annotation keys have two segments: an optional prefix and a name, separated by a \n slash (/).

\n \n \n

Annotation values must be 255 characters or less.

\n
\n

Annotations can be added or modified at any time. Each resource can have multiple annotations.

" + } + }, + "namespace": { + "target": "com.amazonaws.batch#String", + "traits": { + "smithy.api#documentation": "

The namespace of the Amazon EKS cluster. In Kubernetes, namespaces provide a mechanism for isolating \n groups of resources within a single cluster. Names of resources need to be unique within a namespace, \n but not across namespaces. Batch places Batch Job pods in this namespace. If this field is provided, \n the value can't be empty or null. It must meet the following requirements:

\n \n

\n For more information, see \n Namespaces in the Kubernetes documentation. This namespace can be \n different from the kubernetesNamespace set in the compute environment's \n EksConfiguration, but must have identical role-based access control (RBAC) roles as \n the compute environment's kubernetesNamespace. For multi-node parallel jobs,\n the same value must be provided across all the node ranges.

" + } } }, "traits": { - "smithy.api#documentation": "

Describes and uniquely identifies Kubernetes resources. For example, the compute environment that\n a pod runs in or the jobID for a job running in the pod. For more information, see\n Understanding Kubernetes Objects in the Kubernetes documentation.

" + "smithy.api#documentation": "

Describes and uniquely identifies Kubernetes resources. For example, the compute environment that\n a pod runs in or the jobID for a job running in the pod. For more information, see\n \n Understanding Kubernetes Objects in the Kubernetes documentation.

" + } + }, + "com.amazonaws.batch#EksPersistentVolumeClaim": { + "type": "structure", + "members": { + "claimName": { + "target": "com.amazonaws.batch#String", + "traits": { + "smithy.api#clientOptional": {}, + "smithy.api#documentation": "

The name of the persistentVolumeClaim bounded to a persistentVolume. \n For more information, see \n Persistent Volume Claims in the Kubernetes documentation.

", + "smithy.api#required": {} + } + }, + "readOnly": { + "target": "com.amazonaws.batch#Boolean", + "traits": { + "smithy.api#documentation": "

An optional boolean value indicating if the mount is read only. Default is false. For more\n information, see \n Read Only Mounts in the Kubernetes documentation.

" + } + } + }, + "traits": { + "smithy.api#documentation": "

A persistentVolumeClaim volume is used to mount a PersistentVolume\n into a Pod. PersistentVolumeClaims are a way for users to \"claim\" durable storage without knowing \n the details of the particular cloud environment. See the information about PersistentVolumes\n in the Kubernetes documentation.

" } }, "com.amazonaws.batch#EksPodProperties": { @@ -4557,7 +4606,7 @@ "metadata": { "target": "com.amazonaws.batch#EksMetadata", "traits": { - "smithy.api#documentation": "

Metadata about the\n Kubernetes\n pod. For\n more information, see Understanding Kubernetes Objects in the Kubernetes\n documentation.

" + "smithy.api#documentation": "

Metadata about the Kubernetes pod. For more information, see Understanding Kubernetes Objects in the Kubernetes\n documentation.

" } }, "shareProcessNamespace": { @@ -4663,7 +4712,7 @@ "metadata": { "target": "com.amazonaws.batch#EksMetadata", "traits": { - "smithy.api#documentation": "

Metadata about the\n overrides for the container that's used on the Amazon EKS pod.

" + "smithy.api#documentation": "

Metadata about the overrides for the container that's used on the Amazon EKS pod.

" } } }, @@ -4772,6 +4821,12 @@ "traits": { "smithy.api#documentation": "

Specifies the configuration of a Kubernetes secret volume. For more information, see\n secret in the\n Kubernetes documentation.

" } + }, + "persistentVolumeClaim": { + "target": "com.amazonaws.batch#EksPersistentVolumeClaim", + "traits": { + "smithy.api#documentation": "

Specifies the configuration of a Kubernetes persistentVolumeClaim bounded to a \n persistentVolume. For more information, see \n Persistent Volume Claims in the Kubernetes documentation.

" + } } }, "traits": { @@ -4812,7 +4867,7 @@ "onStatusReason": { "target": "com.amazonaws.batch#String", "traits": { - "smithy.api#documentation": "

Contains a glob pattern to match against the StatusReason returned for a job.\n The pattern can contain up to 512 characters. It can contain letters, numbers, periods (.),\n colons (:), and white spaces (including spaces or tabs).\n It can\n optionally end with an asterisk (*) so that only the start of the string needs to be an exact\n match.

" + "smithy.api#documentation": "

Contains a glob pattern to match against the StatusReason returned for a job.\n The pattern can contain up to 512 characters. It can contain letters, numbers, periods (.),\n colons (:), and white spaces (including spaces or tabs). It can optionally end with an asterisk (*) \n so that only the start of the string needs to be an exact match.

" } }, "onReason": { @@ -7021,13 +7076,13 @@ "operatingSystemFamily": { "target": "com.amazonaws.batch#String", "traits": { - "smithy.api#documentation": "

The operating system for the compute environment.\n Valid values are:\n LINUX (default), WINDOWS_SERVER_2019_CORE,\n WINDOWS_SERVER_2019_FULL, WINDOWS_SERVER_2022_CORE, and\n WINDOWS_SERVER_2022_FULL.

\n \n

The following parameters can’t be set for Windows containers: linuxParameters,\n privileged, user, ulimits,\n readonlyRootFilesystem,\n and efsVolumeConfiguration.

\n
\n \n

The Batch Scheduler checks\n the compute environments\n that are attached to the job queue before registering a task definition with\n Fargate. In this\n scenario, the job queue is where the job is submitted. If the job requires a\n Windows container and the first compute environment is LINUX, the compute\n environment is skipped and the next compute environment is checked until a Windows-based compute\n environment is found.

\n
\n \n

Fargate Spot is not supported for\n ARM64 and\n Windows-based containers on Fargate. A job queue will be blocked if a\n Fargate\n ARM64 or\n Windows job is submitted to a job queue with only Fargate Spot compute environments.\n However, you can attach both FARGATE and\n FARGATE_SPOT compute environments to the same job queue.

\n
" + "smithy.api#documentation": "

The operating system for the compute environment. Valid values are:\n LINUX (default), WINDOWS_SERVER_2019_CORE,\n WINDOWS_SERVER_2019_FULL, WINDOWS_SERVER_2022_CORE, and\n WINDOWS_SERVER_2022_FULL.

\n \n

The following parameters can’t be set for Windows containers: linuxParameters,\n privileged, user, ulimits,\n readonlyRootFilesystem, and efsVolumeConfiguration.

\n
\n \n

The Batch Scheduler checks the compute environments that are attached to the job queue before \n registering a task definition with Fargate. In this scenario, the job queue is where the job is \n submitted. If the job requires a Windows container and the first compute environment is LINUX, \n the compute environment is skipped and the next compute environment is checked until a Windows-based \n compute environment is found.

\n
\n \n

Fargate Spot is not supported for ARM64 and Windows-based containers on Fargate. \n A job queue will be blocked if a Fargate ARM64 or Windows job is submitted to a job \n queue with only Fargate Spot compute environments. However, you can attach both FARGATE and\n FARGATE_SPOT compute environments to the same job queue.

\n
" } }, "cpuArchitecture": { "target": "com.amazonaws.batch#String", "traits": { - "smithy.api#documentation": "

The vCPU architecture. The default value is X86_64. Valid values are\n X86_64 and ARM64.

\n \n

This parameter must be set to\n X86_64\n for Windows containers.

\n
\n \n

Fargate Spot is not supported for ARM64 and Windows-based containers on\n Fargate. A job queue will be blocked if a Fargate ARM64 or Windows job is\n submitted to a job queue with only Fargate Spot compute environments. However, you can attach\n both FARGATE and FARGATE_SPOT compute environments to the same job\n queue.

\n
" + "smithy.api#documentation": "

The vCPU architecture. The default value is X86_64. Valid values are\n X86_64 and ARM64.

\n \n

This parameter must be set to X86_64 for Windows containers.

\n
\n \n

Fargate Spot is not supported for ARM64 and Windows-based containers on\n Fargate. A job queue will be blocked if a Fargate ARM64 or Windows job is\n submitted to a job queue with only Fargate Spot compute environments. However, you can attach\n both FARGATE and FARGATE_SPOT compute environments to the same job\n queue.

\n
" } } }, @@ -7247,7 +7302,7 @@ "schedulingPriorityOverride": { "target": "com.amazonaws.batch#Integer", "traits": { - "smithy.api#documentation": "

The scheduling priority for the job. This only affects jobs in job queues with a fair\n share policy. Jobs with a higher scheduling priority are scheduled before jobs with a lower\n scheduling priority.\n This\n overrides any scheduling priority in the job definition and works only within a single share\n identifier.

\n

The minimum supported value is 0 and the maximum supported value is 9999.

" + "smithy.api#documentation": "

The scheduling priority for the job. This only affects jobs in job queues with a fair\n share policy. Jobs with a higher scheduling priority are scheduled before jobs with a lower\n scheduling priority. This overrides any scheduling priority in the job definition and works only \n within a single share identifier.

\n

The minimum supported value is 0 and the maximum supported value is 9999.

" } }, "arrayProperties": { diff --git a/aws-models/cleanroomsml.json b/aws-models/cleanroomsml.json index 04abfdca6d40..3ed70e8c21c8 100644 --- a/aws-models/cleanroomsml.json +++ b/aws-models/cleanroomsml.json @@ -1034,6 +1034,9 @@ "traits": { "smithy.api#documentation": "

The protected SQL query parameters.

" } + }, + "sqlComputeConfiguration": { + "target": "com.amazonaws.cleanroomsml#ComputeConfiguration" } }, "traits": { @@ -9925,7 +9928,7 @@ "dataSource": { "target": "com.amazonaws.cleanroomsml#ModelInferenceDataSource", "traits": { - "smithy.api#documentation": "

Defines he data source that is used for the trained model inference job.

", + "smithy.api#documentation": "

Defines the data source that is used for the trained model inference job.

", "smithy.api#required": {} } }, diff --git a/aws-models/cloudfront.json b/aws-models/cloudfront.json index 389634425beb..e5652f64583d 100644 --- a/aws-models/cloudfront.json +++ b/aws-models/cloudfront.json @@ -5553,13 +5553,13 @@ "OriginReadTimeout": { "target": "com.amazonaws.cloudfront#integer", "traits": { - "smithy.api#documentation": "

Specifies how long, in seconds, CloudFront waits for a response from the origin. This is\n\t\t\talso known as the origin response timeout. The minimum timeout is 1\n\t\t\tsecond, the maximum is 60 seconds, and the default (if you don't specify otherwise) is\n\t\t\t30 seconds.

\n

For more information, see Origin Response Timeout in the\n\t\t\t\tAmazon CloudFront Developer Guide.

" + "smithy.api#documentation": "

Specifies how long, in seconds, CloudFront waits for a response from the origin. This is\n\t\t\talso known as the origin response timeout. The minimum timeout is 1\n\t\t\tsecond, the maximum is 60 seconds, and the default (if you don't specify otherwise) is\n\t\t\t30 seconds.

\n

For more information, see Response timeout (custom origins only) in the\n\t\t\t\tAmazon CloudFront Developer Guide.

" } }, "OriginKeepaliveTimeout": { "target": "com.amazonaws.cloudfront#integer", "traits": { - "smithy.api#documentation": "

Specifies how long, in seconds, CloudFront persists its connection to the origin. The\n\t\t\tminimum timeout is 1 second, the maximum is 60 seconds, and the default (if you don't\n\t\t\tspecify otherwise) is 5 seconds.

\n

For more information, see Origin Keep-alive Timeout in the\n\t\t\t\tAmazon CloudFront Developer Guide.

" + "smithy.api#documentation": "

Specifies how long, in seconds, CloudFront persists its connection to the origin. The\n\t\t\tminimum timeout is 1 second, the maximum is 60 seconds, and the default (if you don't\n\t\t\tspecify otherwise) is 5 seconds.

\n

For more information, see Keep-alive timeout (custom origins only) in the\n\t\t\t\tAmazon CloudFront Developer Guide.

" } } }, @@ -7079,7 +7079,7 @@ "DefaultRootObject": { "target": "com.amazonaws.cloudfront#string", "traits": { - "smithy.api#documentation": "

The object that you want CloudFront to request from your origin (for example,\n\t\t\t\tindex.html) when a viewer requests the root URL for your distribution\n\t\t\t\t(https://www.example.com) instead of an object in your distribution\n\t\t\t\t(https://www.example.com/product-description.html). Specifying a\n\t\t\tdefault root object avoids exposing the contents of your distribution.

\n

Specify only the object name, for example, index.html. Don't add a\n\t\t\t\t/ before the object name.

\n

If you don't want to specify a default root object when you create a distribution,\n\t\t\tinclude an empty DefaultRootObject element.

\n

To delete the default root object from an existing distribution, update the\n\t\t\tdistribution configuration and include an empty DefaultRootObject\n\t\t\telement.

\n

To replace the default root object, update the distribution configuration and specify\n\t\t\tthe new object.

\n

For more information about the default root object, see Creating a\n\t\t\t\tDefault Root Object in the Amazon CloudFront Developer Guide.

" + "smithy.api#documentation": "

When a viewer requests the root URL for your distribution, the default root object is the\n\t\t\tobject that you want CloudFront to request from your origin. For example, if your root URL is\n\t\t\t\thttps://www.example.com, you can specify CloudFront to return the\n\t\t\t\tindex.html file as the default root object. You can specify a default\n\t\t\troot object so that viewers see a specific file or object, instead of another object in\n\t\t\tyour distribution (for example,\n\t\t\t\thttps://www.example.com/product-description.html). A default root\n\t\t\tobject avoids exposing the contents of your distribution.

\n

You can specify the object name or a path to the object name (for example,\n\t\t\t\tindex.html or exampleFolderName/index.html). Your string\n\t\t\tcan't begin with a forward slash (/). Only specify the object name or the\n\t\t\tpath to the object.

\n

If you don't want to specify a default root object when you create a distribution,\n\t\t\tinclude an empty DefaultRootObject element.

\n

To delete the default root object from an existing distribution, update the\n\t\t\tdistribution configuration and include an empty DefaultRootObject\n\t\t\telement.

\n

To replace the default root object, update the distribution configuration and specify\n\t\t\tthe new object.

\n

For more information about the default root object, see Specify a default root object in the Amazon CloudFront Developer Guide.

" } }, "Origins": { @@ -20477,6 +20477,18 @@ "smithy.api#documentation": "

The VPC origin ID.

", "smithy.api#required": {} } + }, + "OriginReadTimeout": { + "target": "com.amazonaws.cloudfront#integer", + "traits": { + "smithy.api#documentation": "

Specifies how long, in seconds, CloudFront waits for a response from the origin. This is\n\t\t\talso known as the origin response timeout. The minimum timeout is 1\n\t\t\tsecond, the maximum is 60 seconds, and the default (if you don't specify otherwise) is\n\t\t\t30 seconds.

\n

For more information, see Response timeout (custom origins only) in the\n\t\t\tAmazon CloudFront Developer Guide.

" + } + }, + "OriginKeepaliveTimeout": { + "target": "com.amazonaws.cloudfront#integer", + "traits": { + "smithy.api#documentation": "

Specifies how long, in seconds, CloudFront persists its connection to the origin. The\n\t\t\tminimum timeout is 1 second, the maximum is 60 seconds, and the default (if you don't\n\t\t\tspecify otherwise) is 5 seconds.

\n

For more information, see Keep-alive timeout (custom origins only) in the\n\t\t\tAmazon CloudFront Developer Guide.

" + } } }, "traits": { diff --git a/aws-models/codepipeline.json b/aws-models/codepipeline.json index 2181eea8e1cd..edbae106e558 100644 --- a/aws-models/codepipeline.json +++ b/aws-models/codepipeline.json @@ -1155,7 +1155,7 @@ "category": { "target": "com.amazonaws.codepipeline#ActionCategory", "traits": { - "smithy.api#documentation": "

A category defines what kind of action can be taken in the stage, and constrains\n the provider type for the action. Valid categories are limited to one of the following\n values.

\n ", + "smithy.api#documentation": "

A category defines what kind of action can be taken in the stage, and constrains\n the provider type for the action. Valid categories are limited to one of the following\n values.

\n ", "smithy.api#required": {} } }, @@ -2955,7 +2955,7 @@ } }, "traits": { - "smithy.api#documentation": "

The condition for the stage. A condition is made up of the rules and the result for\n the condition.

" + "smithy.api#documentation": "

The condition for the stage. A condition is made up of the rules and the result for\n the condition. For more information about conditions, see Stage conditions.\n For more information about rules, see the CodePipeline rule\n reference.

" } }, "com.amazonaws.codepipeline#ConditionExecution": { @@ -4024,7 +4024,7 @@ "category": { "target": "com.amazonaws.codepipeline#ActionCategory", "traits": { - "smithy.api#documentation": "

Defines what kind of action can be taken in the stage. The following are the valid\n values:

\n ", + "smithy.api#documentation": "

Defines what kind of action can be taken in the stage. The following are the valid\n values:

\n ", "smithy.api#required": {} } }, @@ -5611,7 +5611,7 @@ } ], "traits": { - "smithy.api#documentation": "

Lists the rules for the condition.

" + "smithy.api#documentation": "

Lists the rules for the condition. For more information about conditions, see Stage\n conditions. For more information about rules, see the CodePipeline rule reference.

" } }, "com.amazonaws.codepipeline#ListRuleTypesInput": { @@ -8057,7 +8057,7 @@ "name": { "target": "com.amazonaws.codepipeline#RuleName", "traits": { - "smithy.api#documentation": "

The name of the rule that is created for the condition, such as\n CheckAllResults.

", + "smithy.api#documentation": "

The name of the rule that is created for the condition, such as\n VariableCheck.

", "smithy.api#required": {} } }, @@ -8074,6 +8074,12 @@ "smithy.api#documentation": "

The action configuration fields for the rule.

" } }, + "commands": { + "target": "com.amazonaws.codepipeline#CommandList", + "traits": { + "smithy.api#documentation": "

The shell commands to run with your commands rule in CodePipeline. All commands\n are supported except multi-line formats. While CodeBuild logs and permissions\n are used, you do not need to create any resources in CodeBuild.

\n \n

Using compute time for this action will incur separate charges in CodeBuild.

\n
" + } + }, "inputArtifacts": { "target": "com.amazonaws.codepipeline#InputArtifactList", "traits": { @@ -8100,7 +8106,7 @@ } }, "traits": { - "smithy.api#documentation": "

Represents information about the rule to be created for an associated condition. An\n example would be creating a new rule for an entry condition, such as a rule that checks\n for a test result before allowing the run to enter the deployment stage.

" + "smithy.api#documentation": "

Represents information about the rule to be created for an associated condition. An\n example would be creating a new rule for an entry condition, such as a rule that checks\n for a test result before allowing the run to enter the deployment stage. For more\n information about conditions, see Stage conditions.\n For more information about rules, see the CodePipeline rule\n reference.

" } }, "com.amazonaws.codepipeline#RuleDeclarationList": { diff --git a/aws-models/ecs.json b/aws-models/ecs.json index acd01dd3efe6..a18d106fa8dc 100644 --- a/aws-models/ecs.json +++ b/aws-models/ecs.json @@ -4383,7 +4383,7 @@ "maximumPercent": { "target": "com.amazonaws.ecs#BoxedInteger", "traits": { - "smithy.api#documentation": "

If a service is using the rolling update (ECS) deployment type, the\n\t\t\t\tmaximumPercent parameter represents an upper limit on the number of\n\t\t\tyour service's tasks that are allowed in the RUNNING or\n\t\t\t\tPENDING state during a deployment, as a percentage of the\n\t\t\t\tdesiredCount (rounded down to the nearest integer). This parameter\n\t\t\tenables you to define the deployment batch size. For example, if your service is using\n\t\t\tthe REPLICA service scheduler and has a desiredCount of four\n\t\t\ttasks and a maximumPercent value of 200%, the scheduler may start four new\n\t\t\ttasks before stopping the four older tasks (provided that the cluster resources required\n\t\t\tto do this are available). The default maximumPercent value for a service\n\t\t\tusing the REPLICA service scheduler is 200%.

\n

The Amazon ECS scheduler uses this parameter to replace unhealthy tasks by starting\n\t\t\treplacement tasks first and then stopping the unhealthy tasks, as long as cluster\n\t\t\tresources for starting replacement tasks are available. For more information about how\n\t\t\tthe scheduler replaces unhealthy tasks, see Amazon ECS\n\t\t\tservices.

\n

If a service is using either the blue/green (CODE_DEPLOY) or\n\t\t\t\tEXTERNAL deployment types, and tasks in the service use the\n\t\t\tEC2 launch type, the maximum percent\n\t\t\tvalue is set to the default value. The maximum percent\n\t\t\tvalue is used to define the upper limit on the number of the tasks in the service that\n\t\t\tremain in the RUNNING state while the container instances are in the\n\t\t\t\tDRAINING state.

\n \n

You can't specify a custom maximumPercent value for a service that\n\t\t\t\tuses either the blue/green (CODE_DEPLOY) or EXTERNAL\n\t\t\t\tdeployment types and has tasks that use the EC2 launch type.

\n
\n

If the tasks in the service use the Fargate launch type, the maximum\n\t\t\tpercent value is not used, although it is returned when describing your service.

" + "smithy.api#documentation": "

If a service is using the rolling update (ECS) deployment type, the\n\t\t\t\tmaximumPercent parameter represents an upper limit on the number of\n\t\t\tyour service's tasks that are allowed in the RUNNING or\n\t\t\t\tPENDING state during a deployment, as a percentage of the\n\t\t\t\tdesiredCount (rounded down to the nearest integer). This parameter\n\t\t\tenables you to define the deployment batch size. For example, if your service is using\n\t\t\tthe REPLICA service scheduler and has a desiredCount of four\n\t\t\ttasks and a maximumPercent value of 200%, the scheduler may start four new\n\t\t\ttasks before stopping the four older tasks (provided that the cluster resources required\n\t\t\tto do this are available). The default maximumPercent value for a service\n\t\t\tusing the REPLICA service scheduler is 200%.

\n

The Amazon ECS scheduler uses this parameter to replace unhealthy tasks by starting\n\t\t\treplacement tasks first and then stopping the unhealthy tasks, as long as cluster\n\t\t\tresources for starting replacement tasks are available. For more information about how\n\t\t\tthe scheduler replaces unhealthy tasks, see Amazon ECS\n\t\t\tservices.

\n

If a service is using either the blue/green (CODE_DEPLOY) or\n\t\t\t\tEXTERNAL deployment types, and tasks in the service use the\n\t\t\tEC2 launch type, the maximum percent\n\t\t\tvalue is set to the default value. The maximum percent\n\t\t\tvalue is used to define the upper limit on the number of the tasks in the service that\n\t\t\tremain in the RUNNING state while the container instances are in the\n\t\t\t\tDRAINING state.

\n \n

You can't specify a custom maximumPercent value for a service that\n\t\t\t\tuses either the blue/green (CODE_DEPLOY) or EXTERNAL\n\t\t\t\tdeployment types and has tasks that use the EC2 launch type.

\n
\n

If the service uses either the blue/green (CODE_DEPLOY) or EXTERNAL\n\t\t\tdeployment types, and the tasks in the service use the Fargate launch type, the maximum\n\t\t\tpercent value is not used. The value is still returned when describing your service.

" } }, "minimumHealthyPercent": { @@ -7422,7 +7422,7 @@ "cluster": { "target": "com.amazonaws.ecs#String", "traits": { - "smithy.api#documentation": "

The cluster that hosts the service. This can either be the cluster name or ARN.\n\t\t\tStarting April 15, 2023, Amazon Web Services will not onboard new customers to Amazon\n\t\t\tElastic Inference (EI), and will help current customers migrate their workloads to\n\t\t\toptions that offer better price and performanceIf you don't specify a cluster,\n\t\t\t\tdefault is used.

" + "smithy.api#documentation": "

The cluster that hosts the service. This can either be the cluster name or ARN.\n\t\t\tStarting April 15, 2023, Amazon Web Services will not onboard new customers to Amazon\n\t\t\tElastic Inference (EI), and will help current customers migrate their workloads to\n\t\t\toptions that offer better price and performance. If you don't specify a cluster,\n\t\t\t\tdefault is used.

" } }, "status": { @@ -8148,7 +8148,7 @@ "options": { "target": "com.amazonaws.ecs#LogConfigurationOptionsMap", "traits": { - "smithy.api#documentation": "

The configuration options to send to the log driver.

\n

The options you can specify depend on the log driver. Some of the options you can\n\t\t\tspecify when you use the awslogs log driver to route logs to Amazon CloudWatch\n\t\t\tinclude the following:

\n
\n
awslogs-create-group
\n
\n

Required: No

\n

Specify whether you want the log group to be created automatically. If\n\t\t\t\t\t\tthis option isn't specified, it defaults to false.

\n \n

Your IAM policy must include the logs:CreateLogGroup\n\t\t\t\t\t\t\tpermission before you attempt to use\n\t\t\t\t\t\t\tawslogs-create-group.

\n
\n
\n
awslogs-region
\n
\n

Required: Yes

\n

Specify the Amazon Web Services Region that the awslogs log driver is to\n\t\t\t\t\t\tsend your Docker logs to. You can choose to send all of your logs from\n\t\t\t\t\t\tclusters in different Regions to a single region in CloudWatch Logs. This is so that\n\t\t\t\t\t\tthey're all visible in one location. Otherwise, you can separate them by\n\t\t\t\t\t\tRegion for more granularity. Make sure that the specified log group exists\n\t\t\t\t\t\tin the Region that you specify with this option.

\n
\n
awslogs-group
\n
\n

Required: Yes

\n

Make sure to specify a log group that the awslogs log driver\n\t\t\t\t\t\tsends its log streams to.

\n
\n
awslogs-stream-prefix
\n
\n

Required: Yes, when using the Fargate launch\n\t\t\t\t\t\t\ttype.Optional for the EC2 launch type,\n\t\t\t\t\t\t\trequired for the Fargate launch type.

\n

Use the awslogs-stream-prefix option to associate a log\n\t\t\t\t\t\tstream with the specified prefix, the container name, and the ID of the\n\t\t\t\t\t\tAmazon ECS task that the container belongs to. If you specify a prefix with this\n\t\t\t\t\t\toption, then the log stream takes the format\n\t\t\t\t\t\t\tprefix-name/container-name/ecs-task-id.

\n

If you don't specify a prefix with this option, then the log stream is\n\t\t\t\t\t\tnamed after the container ID that's assigned by the Docker daemon on the\n\t\t\t\t\t\tcontainer instance. Because it's difficult to trace logs back to the\n\t\t\t\t\t\tcontainer that sent them with just the Docker container ID (which is only\n\t\t\t\t\t\tavailable on the container instance), we recommend that you specify a prefix\n\t\t\t\t\t\twith this option.

\n

For Amazon ECS services, you can use the service name as the prefix. Doing so,\n\t\t\t\t\t\tyou can trace log streams to the service that the container belongs to, the\n\t\t\t\t\t\tname of the container that sent them, and the ID of the task that the\n\t\t\t\t\t\tcontainer belongs to.

\n

You must specify a stream-prefix for your logs to have your logs appear in\n\t\t\t\t\t\tthe Log pane when using the Amazon ECS console.

\n
\n
awslogs-datetime-format
\n
\n

Required: No

\n

This option defines a multiline start pattern in Python\n\t\t\t\t\t\t\tstrftime format. A log message consists of a line that\n\t\t\t\t\t\tmatches the pattern and any following lines that don’t match the pattern.\n\t\t\t\t\t\tThe matched line is the delimiter between log messages.

\n

One example of a use case for using this format is for parsing output such\n\t\t\t\t\t\tas a stack dump, which might otherwise be logged in multiple entries. The\n\t\t\t\t\t\tcorrect pattern allows it to be captured in a single entry.

\n

For more information, see awslogs-datetime-format.

\n

You cannot configure both the awslogs-datetime-format and\n\t\t\t\t\t\t\tawslogs-multiline-pattern options.

\n \n

Multiline logging performs regular expression parsing and matching of\n\t\t\t\t\t\t\tall log messages. This might have a negative impact on logging\n\t\t\t\t\t\t\tperformance.

\n
\n
\n
awslogs-multiline-pattern
\n
\n

Required: No

\n

This option defines a multiline start pattern that uses a regular\n\t\t\t\t\t\texpression. A log message consists of a line that matches the pattern and\n\t\t\t\t\t\tany following lines that don’t match the pattern. The matched line is the\n\t\t\t\t\t\tdelimiter between log messages.

\n

For more information, see awslogs-multiline-pattern.

\n

This option is ignored if awslogs-datetime-format is also\n\t\t\t\t\t\tconfigured.

\n

You cannot configure both the awslogs-datetime-format and\n\t\t\t\t\t\t\tawslogs-multiline-pattern options.

\n \n

Multiline logging performs regular expression parsing and matching of\n\t\t\t\t\t\t\tall log messages. This might have a negative impact on logging\n\t\t\t\t\t\t\tperformance.

\n
\n
\n
mode
\n
\n

Required: No

\n

Valid values: non-blocking | blocking\n

\n

This option defines the delivery mode of log messages from the container\n\t\t\t\t\t\tto CloudWatch Logs. The delivery mode you choose affects application availability when\n\t\t\t\t\t\tthe flow of logs from container to CloudWatch is interrupted.

\n

If you use the blocking mode and the flow of logs to CloudWatch is\n\t\t\t\t\t\tinterrupted, calls from container code to write to the stdout\n\t\t\t\t\t\tand stderr streams will block. The logging thread of the\n\t\t\t\t\t\tapplication will block as a result. This may cause the application to become\n\t\t\t\t\t\tunresponsive and lead to container healthcheck failure.

\n

If you use the non-blocking mode, the container's logs are\n\t\t\t\t\t\tinstead stored in an in-memory intermediate buffer configured with the\n\t\t\t\t\t\t\tmax-buffer-size option. This prevents the application from\n\t\t\t\t\t\tbecoming unresponsive when logs cannot be sent to CloudWatch. We recommend using\n\t\t\t\t\t\tthis mode if you want to ensure service availability and are okay with some\n\t\t\t\t\t\tlog loss. For more information, see Preventing log loss with non-blocking mode in the awslogs\n\t\t\t\t\t\t\tcontainer log driver.

\n
\n
max-buffer-size
\n
\n

Required: No

\n

Default value: 1m\n

\n

When non-blocking mode is used, the\n\t\t\t\t\t\t\tmax-buffer-size log option controls the size of the buffer\n\t\t\t\t\t\tthat's used for intermediate message storage. Make sure to specify an\n\t\t\t\t\t\tadequate buffer size based on your application. When the buffer fills up,\n\t\t\t\t\t\tfurther logs cannot be stored. Logs that cannot be stored are lost.

\n
\n
\n

To route logs using the splunk log router, you need to specify a\n\t\t\t\tsplunk-token and a splunk-url.

\n

When you use the awsfirelens log router to route logs to an Amazon Web Services Service\n\t\t\tor Amazon Web Services Partner Network destination for log storage and analytics, you can set the\n\t\t\t\tlog-driver-buffer-limit option to limit the number of events that are\n\t\t\tbuffered in memory, before being sent to the log router container. It can help to\n\t\t\tresolve potential log loss issue because high throughput might result in memory running\n\t\t\tout for the buffer inside of Docker.

\n

Other options you can specify when using awsfirelens to route logs depend\n\t\t\ton the destination. When you export logs to Amazon Data Firehose, you can specify the Amazon Web Services Region\n\t\t\twith region and a name for the log stream with\n\t\t\tdelivery_stream.

\n

When you export logs to Amazon Kinesis Data Streams, you can specify an Amazon Web Services Region with\n\t\t\t\tregion and a data stream name with stream.

\n

When you export logs to Amazon OpenSearch Service, you can specify options like Name,\n\t\t\t\tHost (OpenSearch Service endpoint without protocol), Port,\n\t\t\t\tIndex, Type, Aws_auth,\n\t\t\t\tAws_region, Suppress_Type_Name, and\n\t\t\ttls.

\n

When you export logs to Amazon S3, you can specify the bucket using the bucket\n\t\t\toption. You can also specify region, total_file_size,\n\t\t\t\tupload_timeout, and use_put_object as options.

\n

This parameter requires version 1.19 of the Docker Remote API or greater on your container instance. To check the Docker Remote API version on your container instance, log in to your container instance and run the following command: sudo docker version --format '{{.Server.APIVersion}}'\n

" + "smithy.api#documentation": "

The configuration options to send to the log driver.

\n

The options you can specify depend on the log driver. Some of the options you can\n\t\t\tspecify when you use the awslogs log driver to route logs to Amazon CloudWatch\n\t\t\tinclude the following:

\n
\n
awslogs-create-group
\n
\n

Required: No

\n

Specify whether you want the log group to be created automatically. If\n\t\t\t\t\t\tthis option isn't specified, it defaults to false.

\n \n

Your IAM policy must include the logs:CreateLogGroup\n\t\t\t\t\t\t\tpermission before you attempt to use\n\t\t\t\t\t\t\tawslogs-create-group.

\n
\n
\n
awslogs-region
\n
\n

Required: Yes

\n

Specify the Amazon Web Services Region that the awslogs log driver is to\n\t\t\t\t\t\tsend your Docker logs to. You can choose to send all of your logs from\n\t\t\t\t\t\tclusters in different Regions to a single region in CloudWatch Logs. This is so that\n\t\t\t\t\t\tthey're all visible in one location. Otherwise, you can separate them by\n\t\t\t\t\t\tRegion for more granularity. Make sure that the specified log group exists\n\t\t\t\t\t\tin the Region that you specify with this option.

\n
\n
awslogs-group
\n
\n

Required: Yes

\n

Make sure to specify a log group that the awslogs log driver\n\t\t\t\t\t\tsends its log streams to.

\n
\n
awslogs-stream-prefix
\n
\n

Required: Yes, when using the Fargate launch\n\t\t\t\t\t\t\ttype.Optional for the EC2 launch type,\n\t\t\t\t\t\t\trequired for the Fargate launch type.

\n

Use the awslogs-stream-prefix option to associate a log\n\t\t\t\t\t\tstream with the specified prefix, the container name, and the ID of the\n\t\t\t\t\t\tAmazon ECS task that the container belongs to. If you specify a prefix with this\n\t\t\t\t\t\toption, then the log stream takes the format\n\t\t\t\t\t\t\tprefix-name/container-name/ecs-task-id.

\n

If you don't specify a prefix with this option, then the log stream is\n\t\t\t\t\t\tnamed after the container ID that's assigned by the Docker daemon on the\n\t\t\t\t\t\tcontainer instance. Because it's difficult to trace logs back to the\n\t\t\t\t\t\tcontainer that sent them with just the Docker container ID (which is only\n\t\t\t\t\t\tavailable on the container instance), we recommend that you specify a prefix\n\t\t\t\t\t\twith this option.

\n

For Amazon ECS services, you can use the service name as the prefix. Doing so,\n\t\t\t\t\t\tyou can trace log streams to the service that the container belongs to, the\n\t\t\t\t\t\tname of the container that sent them, and the ID of the task that the\n\t\t\t\t\t\tcontainer belongs to.

\n

You must specify a stream-prefix for your logs to have your logs appear in\n\t\t\t\t\t\tthe Log pane when using the Amazon ECS console.

\n
\n
awslogs-datetime-format
\n
\n

Required: No

\n

This option defines a multiline start pattern in Python\n\t\t\t\t\t\t\tstrftime format. A log message consists of a line that\n\t\t\t\t\t\tmatches the pattern and any following lines that don’t match the pattern.\n\t\t\t\t\t\tThe matched line is the delimiter between log messages.

\n

One example of a use case for using this format is for parsing output such\n\t\t\t\t\t\tas a stack dump, which might otherwise be logged in multiple entries. The\n\t\t\t\t\t\tcorrect pattern allows it to be captured in a single entry.

\n

For more information, see awslogs-datetime-format.

\n

You cannot configure both the awslogs-datetime-format and\n\t\t\t\t\t\t\tawslogs-multiline-pattern options.

\n \n

Multiline logging performs regular expression parsing and matching of\n\t\t\t\t\t\t\tall log messages. This might have a negative impact on logging\n\t\t\t\t\t\t\tperformance.

\n
\n
\n
awslogs-multiline-pattern
\n
\n

Required: No

\n

This option defines a multiline start pattern that uses a regular\n\t\t\t\t\t\texpression. A log message consists of a line that matches the pattern and\n\t\t\t\t\t\tany following lines that don’t match the pattern. The matched line is the\n\t\t\t\t\t\tdelimiter between log messages.

\n

For more information, see awslogs-multiline-pattern.

\n

This option is ignored if awslogs-datetime-format is also\n\t\t\t\t\t\tconfigured.

\n

You cannot configure both the awslogs-datetime-format and\n\t\t\t\t\t\t\tawslogs-multiline-pattern options.

\n \n

Multiline logging performs regular expression parsing and matching of\n\t\t\t\t\t\t\tall log messages. This might have a negative impact on logging\n\t\t\t\t\t\t\tperformance.

\n
\n
\n
mode
\n
\n

Required: No

\n

Valid values: non-blocking | blocking\n

\n

This option defines the delivery mode of log messages from the container\n\t\t\t\t\t\tto CloudWatch Logs. The delivery mode you choose affects application availability when\n\t\t\t\t\t\tthe flow of logs from container to CloudWatch is interrupted.

\n

If you use the blocking mode and the flow of logs to CloudWatch is\n\t\t\t\t\t\tinterrupted, calls from container code to write to the stdout\n\t\t\t\t\t\tand stderr streams will block. The logging thread of the\n\t\t\t\t\t\tapplication will block as a result. This may cause the application to become\n\t\t\t\t\t\tunresponsive and lead to container healthcheck failure.

\n

If you use the non-blocking mode, the container's logs are\n\t\t\t\t\t\tinstead stored in an in-memory intermediate buffer configured with the\n\t\t\t\t\t\t\tmax-buffer-size option. This prevents the application from\n\t\t\t\t\t\tbecoming unresponsive when logs cannot be sent to CloudWatch. We recommend using\n\t\t\t\t\t\tthis mode if you want to ensure service availability and are okay with some\n\t\t\t\t\t\tlog loss. For more information, see Preventing log loss with non-blocking mode in the awslogs\n\t\t\t\t\t\t\tcontainer log driver.

\n
\n
max-buffer-size
\n
\n

Required: No

\n

Default value: 1m\n

\n

When non-blocking mode is used, the\n\t\t\t\t\t\t\tmax-buffer-size log option controls the size of the buffer\n\t\t\t\t\t\tthat's used for intermediate message storage. Make sure to specify an\n\t\t\t\t\t\tadequate buffer size based on your application. When the buffer fills up,\n\t\t\t\t\t\tfurther logs cannot be stored. Logs that cannot be stored are lost.

\n
\n
\n

To route logs using the splunk log router, you need to specify a\n\t\t\t\tsplunk-token and a splunk-url.

\n

When you use the awsfirelens log router to route logs to an Amazon Web Services Service\n\t\t\tor Amazon Web Services Partner Network destination for log storage and analytics, you can set the\n\t\t\t\tlog-driver-buffer-limit option to limit the number of events that are\n\t\t\tbuffered in memory, before being sent to the log router container. It can help to\n\t\t\tresolve potential log loss issue because high throughput might result in memory running\n\t\t\tout for the buffer inside of Docker.

\n

Other options you can specify when using awsfirelens to route logs depend\n\t\t\ton the destination. When you export logs to Amazon Data Firehose, you can specify the Amazon Web Services Region\n\t\t\twith region and a name for the log stream with\n\t\t\tdelivery_stream.

\n

When you export logs to Amazon Kinesis Data Streams, you can specify an Amazon Web Services Region with\n\t\t\t\tregion and a data stream name with stream.

\n

When you export logs to Amazon OpenSearch Service, you can specify options like Name,\n\t\t\t\tHost (OpenSearch Service endpoint without protocol), Port,\n\t\t\t\tIndex, Type, Aws_auth,\n\t\t\t\tAws_region, Suppress_Type_Name, and\n\t\t\ttls. For more information, see Under the hood: FireLens for Amazon ECS Tasks.

\n

When you export logs to Amazon S3, you can specify the bucket using the bucket\n\t\t\toption. You can also specify region, total_file_size,\n\t\t\t\tupload_timeout, and use_put_object as options.

\n

This parameter requires version 1.19 of the Docker Remote API or greater on your container instance. To check the Docker Remote API version on your container instance, log in to your container instance and run the following command: sudo docker version --format '{{.Server.APIVersion}}'\n

" } }, "secretOptions": { @@ -9635,6 +9635,12 @@ "traits": { "smithy.api#documentation": "

The operating system that your tasks definitions run on. A platform family is\n\t\t\tspecified only for tasks using the Fargate launch type.

" } + }, + "enableFaultInjection": { + "target": "com.amazonaws.ecs#BoxedBoolean", + "traits": { + "smithy.api#documentation": "

Enables fault injection when you register your task definition and allows for fault injection requests \n\t\t\tto be accepted from the task's containers. The default value is false.

" + } } }, "traits": { @@ -12519,6 +12525,12 @@ "traits": { "smithy.api#documentation": "

The ephemeral storage settings to use for tasks run with the task definition.

" } + }, + "enableFaultInjection": { + "target": "com.amazonaws.ecs#BoxedBoolean", + "traits": { + "smithy.api#documentation": "

Enables fault injection and allows for fault injection requests to be accepted from the task's containers. \n\t\t\tThe default value is false.

" + } } }, "traits": { diff --git a/aws-models/m2.json b/aws-models/m2.json index 3a9fc2f4fc4a..f30882029592 100644 --- a/aws-models/m2.json +++ b/aws-models/m2.json @@ -1974,6 +1974,12 @@ "smithy.api#documentation": "

Configures the maintenance window that you want for the runtime environment. The maintenance window must have the format ddd:hh24:mi-ddd:hh24:mi and must be less than 24 hours. The following two examples are valid maintenance windows: sun:23:45-mon:00:15 or sat:01:00-sat:03:00.

\n

If you do not provide a value, a random system-generated value will be assigned.

" } }, + "networkType": { + "target": "com.amazonaws.m2#NetworkType", + "traits": { + "smithy.api#documentation": "

The network type required for the runtime environment.

" + } + }, "clientToken": { "target": "com.amazonaws.m2#ClientToken", "traits": { @@ -2853,6 +2859,12 @@ "smithy.api#documentation": "

The timestamp when the runtime environment was created.

", "smithy.api#required": {} } + }, + "networkType": { + "target": "com.amazonaws.m2#NetworkType", + "traits": { + "smithy.api#documentation": "

The network type supported by the runtime environment.

" + } } }, "traits": { @@ -3960,6 +3972,12 @@ "traits": { "smithy.api#documentation": "

The identifier of a customer managed key.

" } + }, + "networkType": { + "target": "com.amazonaws.m2#NetworkType", + "traits": { + "smithy.api#documentation": "

The network type supported by the runtime environment.

" + } } } }, @@ -5289,6 +5307,21 @@ } } }, + "com.amazonaws.m2#NetworkType": { + "type": "string", + "traits": { + "smithy.api#enum": [ + { + "value": "ipv4", + "name": "IPV4" + }, + { + "value": "dual", + "name": "DUAL" + } + ] + } + }, "com.amazonaws.m2#NextToken": { "type": "string", "traits": { diff --git a/aws-models/synthetics.json b/aws-models/synthetics.json index 571fa4c4a0ed..940783ca8500 100644 --- a/aws-models/synthetics.json +++ b/aws-models/synthetics.json @@ -314,7 +314,7 @@ "min": 1, "max": 2048 }, - "smithy.api#pattern": "^arn:(aws[a-zA-Z-]*)?:synthetics:[a-z]{2}((-gov)|(-iso(b?)))?-[a-z]+-\\d{1}:\\d{12}:canary:[0-9a-z_\\-]{1,255}$" + "smithy.api#pattern": "^arn:(aws[a-zA-Z-]*)?:synthetics:[a-z]{2,4}(-[a-z]{2,4})?-[a-z]+-\\d{1}:\\d{12}:canary:[0-9a-z_\\-]{1,255}$" } }, "com.amazonaws.synthetics#CanaryCodeInput": { @@ -1526,7 +1526,7 @@ "min": 1, "max": 2048 }, - "smithy.api#pattern": "^arn:(aws[a-zA-Z-]*)?:lambda:[a-z]{2}((-gov)|(-iso(b?)))?-[a-z]+-\\d{1}:\\d{12}:function:[a-zA-Z0-9-_]+(:(\\$LATEST|[a-zA-Z0-9-_]+))?$" + "smithy.api#pattern": "^arn:(aws[a-zA-Z-]*)?:lambda:[a-z]{2,4}(-[a-z]{2,4})?-[a-z]+-\\d{1}:\\d{12}:function:[a-zA-Z0-9-_]+(:(\\$LATEST|[a-zA-Z0-9-_]+))?$" } }, "com.amazonaws.synthetics#GetCanary": { @@ -1777,7 +1777,7 @@ "min": 1, "max": 128 }, - "smithy.api#pattern": "^arn:(aws[a-zA-Z-]*)?:synthetics:[a-z]{2}((-gov)|(-iso(b?)))?-[a-z]+-\\d{1}:\\d{12}:group:[0-9a-z]+$" + "smithy.api#pattern": "^arn:(aws[a-zA-Z-]*)?:synthetics:[a-z]{2,4}(-[a-z]{2,4})?-[a-z]+-\\d{1}:\\d{12}:group:[0-9a-z]+$" } }, "com.amazonaws.synthetics#GroupIdentifier": { @@ -1863,7 +1863,7 @@ "min": 1, "max": 2048 }, - "smithy.api#pattern": "^arn:(aws[a-zA-Z-]*)?:kms:[a-z]{2}((-gov)|(-iso(b?)))?-[a-z]+-\\d{1}:\\d{12}:key/[\\w\\-\\/]+$" + "smithy.api#pattern": "^arn:(aws[a-zA-Z-]*)?:kms:[a-z]{2,4}(-[a-z]{2,4})?-[a-z]+-\\d{1}:\\d{12}:key/[\\w\\-\\/]+$" } }, "com.amazonaws.synthetics#ListAssociatedGroups": { @@ -2291,7 +2291,7 @@ "min": 1, "max": 2048 }, - "smithy.api#pattern": "^arn:(aws[a-zA-Z-]*)?:synthetics:[a-z]{2}((-gov)|(-iso(b?)))?-[a-z]+-\\d{1}:\\d{12}:(canary|group):[0-9a-z_\\-]+$" + "smithy.api#pattern": "^arn:(aws[a-zA-Z-]*)?:synthetics:[a-z]{2,4}(-[a-z]{2,4})?-[a-z]+-\\d{1}:\\d{12}:(canary|group):[0-9a-z_\\-]+$" } }, "com.amazonaws.synthetics#ResourceList": { @@ -3987,7 +3987,7 @@ "BaseCanaryRunId": { "target": "com.amazonaws.synthetics#String", "traits": { - "smithy.api#documentation": "

Specifies which canary run to use the screenshots from as the baseline for future visual monitoring with this canary. Valid values are \n nextrun to use the screenshots from the next run after this update is made, lastrun to use the screenshots from the most recent run \n before this update was made, or the value of Id in the \n CanaryRun from any past run of this canary.

", + "smithy.api#documentation": "

Specifies which canary run to use the screenshots from as the baseline for future visual monitoring with this canary. Valid values are \n nextrun to use the screenshots from the next run after this update is made, lastrun to use the screenshots from the most recent run \n before this update was made, or the value of Id in the \n CanaryRun from a run of this a canary in the past 31 days. If you specify the Id of a canary run older than 31 days, \n the operation returns a 400 validation exception error..

", "smithy.api#required": {} } } @@ -4030,6 +4030,12 @@ "traits": { "smithy.api#documentation": "

The IDs of the security groups for this canary.

" } + }, + "Ipv6AllowedForDualStack": { + "target": "com.amazonaws.synthetics#NullableBoolean", + "traits": { + "smithy.api#documentation": "

Set this to true to allow outbound IPv6 traffic on VPC canaries that are connected to dual-stack subnets. The default is false\n

" + } } }, "traits": { @@ -4056,6 +4062,12 @@ "traits": { "smithy.api#documentation": "

The IDs of the security groups for this canary.

" } + }, + "Ipv6AllowedForDualStack": { + "target": "com.amazonaws.synthetics#NullableBoolean", + "traits": { + "smithy.api#documentation": "

Indicates whether this canary allows outbound IPv6 traffic if it is connected to dual-stack subnets.

" + } } }, "traits": { diff --git a/examples/examples/batch/Cargo.toml b/examples/examples/batch/Cargo.toml index 2e32a2edecd4..08698387db1e 100644 --- a/examples/examples/batch/Cargo.toml +++ b/examples/examples/batch/Cargo.toml @@ -8,7 +8,7 @@ publish = false [dependencies] aws-config= { version = "1.5.11", path = "../../../sdk/aws-config", features = ["behavior-version-latest"] } -aws-sdk-batch= { version = "1.59.0", path = "../../../sdk/batch" } +aws-sdk-batch= { version = "1.60.0", path = "../../../sdk/batch" } [dependencies.tokio] version = "1.20.1" diff --git a/examples/examples/ecs/Cargo.toml b/examples/examples/ecs/Cargo.toml index cb4c1e9607cb..d203469efd2a 100644 --- a/examples/examples/ecs/Cargo.toml +++ b/examples/examples/ecs/Cargo.toml @@ -8,7 +8,7 @@ publish = false [dependencies] aws-config= { version = "1.5.11", path = "../../../sdk/aws-config", features = ["behavior-version-latest"] } -aws-sdk-ecs= { version = "1.58.0", path = "../../../sdk/ecs" } +aws-sdk-ecs= { version = "1.59.0", path = "../../../sdk/ecs" } [dependencies.tokio] version = "1.20.1" diff --git a/index.md b/index.md index b20f1b8ed85c..31a88673e1c9 100644 --- a/index.md +++ b/index.md @@ -20,6 +20,7 @@ The AWS SDK for Rust contains one crate for each AWS service, as well as [aws-co | AWS B2B Data Interchange | [aws-sdk-b2bi](https://crates.io/crates/aws-sdk-b2bi) ([docs](https://docs.rs/aws-sdk-b2bi)) | | AWS Backup | [aws-sdk-backup](https://crates.io/crates/aws-sdk-backup) ([docs](https://docs.rs/aws-sdk-backup)) | | AWS Backup Gateway | [aws-sdk-backupgateway](https://crates.io/crates/aws-sdk-backupgateway) ([docs](https://docs.rs/aws-sdk-backupgateway)) | +| AWS Backup Search | [aws-sdk-backupsearch](https://crates.io/crates/aws-sdk-backupsearch) ([docs](https://docs.rs/aws-sdk-backupsearch)) | | AWS Batch | [aws-sdk-batch](https://crates.io/crates/aws-sdk-batch) ([docs](https://docs.rs/aws-sdk-batch)) | | AWS Billing | [aws-sdk-billing](https://crates.io/crates/aws-sdk-billing) ([docs](https://docs.rs/aws-sdk-billing)) | | AWS Billing and Cost Management Data Exports | [aws-sdk-bcmdataexports](https://crates.io/crates/aws-sdk-bcmdataexports) ([docs](https://docs.rs/aws-sdk-bcmdataexports)) | diff --git a/sdk/account/Cargo.toml b/sdk/account/Cargo.toml index dbdffd1a22b3..37ed48ea2869 100644 --- a/sdk/account/Cargo.toml +++ b/sdk/account/Cargo.toml @@ -1,7 +1,7 @@ # Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. [package] name = "aws-sdk-account" -version = "1.52.0" +version = "1.53.0" authors = ["AWS Rust SDK Team ", "Russell Cohen "] description = "AWS SDK for AWS Account" edition = "2021" diff --git a/sdk/account/README.md b/sdk/account/README.md index add45a7e1fc9..2f4cabc9bfb1 100644 --- a/sdk/account/README.md +++ b/sdk/account/README.md @@ -14,7 +14,7 @@ your project, add the following to your **Cargo.toml** file: ```toml [dependencies] aws-config = { version = "1.1.7", features = ["behavior-version-latest"] } -aws-sdk-account = "1.52.0" +aws-sdk-account = "1.53.0" tokio = { version = "1", features = ["full"] } ``` diff --git a/sdk/account/src/config/endpoint.rs b/sdk/account/src/config/endpoint.rs index 350cd4b0b915..c6f515a63a01 100644 --- a/sdk/account/src/config/endpoint.rs +++ b/sdk/account/src/config/endpoint.rs @@ -6,39 +6,59 @@ pub use ::aws_smithy_types::endpoint::Endpoint; #[cfg(test)] mod test { - /// For region aws-global with FIPS disabled and DualStack disabled + /// For custom endpoint with region not set and fips disabled #[test] fn test_1() { let params = crate::config::endpoint::Params::builder() - .region("aws-global".to_string()) + .endpoint("https://example.com".to_string()) .use_fips(false) - .use_dual_stack(false) .build() .expect("invalid params"); let resolver = crate::config::endpoint::DefaultResolver::new(); let endpoint = resolver.resolve_endpoint(¶ms); - let endpoint = endpoint.expect("Expected valid endpoint: https://account.us-east-1.amazonaws.com"); + let endpoint = endpoint.expect("Expected valid endpoint: https://example.com"); assert_eq!( endpoint, - ::aws_smithy_types::endpoint::Endpoint::builder() - .url("https://account.us-east-1.amazonaws.com") - .property( - "authSchemes", - vec![::aws_smithy_types::Document::from({ - let mut out = ::std::collections::HashMap::::new(); - out.insert("name".to_string(), "sigv4".to_string().into()); - out.insert("signingName".to_string(), "account".to_string().into()); - out.insert("signingRegion".to_string(), "us-east-1".to_string().into()); - out - })] - ) - .build() + ::aws_smithy_types::endpoint::Endpoint::builder().url("https://example.com").build() ); } - /// For region us-east-1 with FIPS enabled and DualStack enabled + /// For custom endpoint with fips enabled #[test] fn test_2() { + let params = crate::config::endpoint::Params::builder() + .endpoint("https://example.com".to_string()) + .use_fips(true) + .build() + .expect("invalid params"); + let resolver = crate::config::endpoint::DefaultResolver::new(); + let endpoint = resolver.resolve_endpoint(¶ms); + let error = endpoint + .expect_err("expected error: Invalid Configuration: FIPS and custom endpoint are not supported [For custom endpoint with fips enabled]"); + assert_eq!(format!("{}", error), "Invalid Configuration: FIPS and custom endpoint are not supported") + } + + /// For custom endpoint with fips disabled and dualstack enabled + #[test] + fn test_3() { + let params = crate::config::endpoint::Params::builder() + .endpoint("https://example.com".to_string()) + .use_fips(false) + .use_dual_stack(true) + .build() + .expect("invalid params"); + let resolver = crate::config::endpoint::DefaultResolver::new(); + let endpoint = resolver.resolve_endpoint(¶ms); + let error = endpoint.expect_err("expected error: Invalid Configuration: Dualstack and custom endpoint are not supported [For custom endpoint with fips disabled and dualstack enabled]"); + assert_eq!( + format!("{}", error), + "Invalid Configuration: Dualstack and custom endpoint are not supported" + ) + } + + /// For region us-east-1 with FIPS enabled and DualStack enabled + #[test] + fn test_4() { let params = crate::config::endpoint::Params::builder() .region("us-east-1".to_string()) .use_fips(true) @@ -52,13 +72,22 @@ mod test { endpoint, ::aws_smithy_types::endpoint::Endpoint::builder() .url("https://account-fips.us-east-1.api.aws") + .property( + "authSchemes", + vec![::aws_smithy_types::Document::from({ + let mut out = ::std::collections::HashMap::::new(); + out.insert("name".to_string(), "sigv4".to_string().into()); + out.insert("signingRegion".to_string(), "us-east-1".to_string().into()); + out + })] + ) .build() ); } /// For region us-east-1 with FIPS enabled and DualStack disabled #[test] - fn test_3() { + fn test_5() { let params = crate::config::endpoint::Params::builder() .region("us-east-1".to_string()) .use_fips(true) @@ -72,13 +101,22 @@ mod test { endpoint, ::aws_smithy_types::endpoint::Endpoint::builder() .url("https://account-fips.us-east-1.amazonaws.com") + .property( + "authSchemes", + vec![::aws_smithy_types::Document::from({ + let mut out = ::std::collections::HashMap::::new(); + out.insert("name".to_string(), "sigv4".to_string().into()); + out.insert("signingRegion".to_string(), "us-east-1".to_string().into()); + out + })] + ) .build() ); } /// For region us-east-1 with FIPS disabled and DualStack enabled #[test] - fn test_4() { + fn test_6() { let params = crate::config::endpoint::Params::builder() .region("us-east-1".to_string()) .use_fips(false) @@ -92,13 +130,22 @@ mod test { endpoint, ::aws_smithy_types::endpoint::Endpoint::builder() .url("https://account.us-east-1.api.aws") + .property( + "authSchemes", + vec![::aws_smithy_types::Document::from({ + let mut out = ::std::collections::HashMap::::new(); + out.insert("name".to_string(), "sigv4".to_string().into()); + out.insert("signingRegion".to_string(), "us-east-1".to_string().into()); + out + })] + ) .build() ); } /// For region us-east-1 with FIPS disabled and DualStack disabled #[test] - fn test_5() { + fn test_7() { let params = crate::config::endpoint::Params::builder() .region("us-east-1".to_string()) .use_fips(false) @@ -117,7 +164,6 @@ mod test { vec![::aws_smithy_types::Document::from({ let mut out = ::std::collections::HashMap::::new(); out.insert("name".to_string(), "sigv4".to_string().into()); - out.insert("signingName".to_string(), "account".to_string().into()); out.insert("signingRegion".to_string(), "us-east-1".to_string().into()); out })] @@ -126,28 +172,27 @@ mod test { ); } - /// For region aws-cn-global with FIPS disabled and DualStack disabled + /// For region cn-northwest-1 with FIPS enabled and DualStack enabled #[test] - fn test_6() { + fn test_8() { let params = crate::config::endpoint::Params::builder() - .region("aws-cn-global".to_string()) - .use_fips(false) - .use_dual_stack(false) + .region("cn-northwest-1".to_string()) + .use_fips(true) + .use_dual_stack(true) .build() .expect("invalid params"); let resolver = crate::config::endpoint::DefaultResolver::new(); let endpoint = resolver.resolve_endpoint(¶ms); - let endpoint = endpoint.expect("Expected valid endpoint: https://account.cn-northwest-1.amazonaws.com.cn"); + let endpoint = endpoint.expect("Expected valid endpoint: https://account-fips.cn-northwest-1.api.amazonwebservices.com.cn"); assert_eq!( endpoint, ::aws_smithy_types::endpoint::Endpoint::builder() - .url("https://account.cn-northwest-1.amazonaws.com.cn") + .url("https://account-fips.cn-northwest-1.api.amazonwebservices.com.cn") .property( "authSchemes", vec![::aws_smithy_types::Document::from({ let mut out = ::std::collections::HashMap::::new(); out.insert("name".to_string(), "sigv4".to_string().into()); - out.insert("signingName".to_string(), "account".to_string().into()); out.insert("signingRegion".to_string(), "cn-northwest-1".to_string().into()); out })] @@ -156,71 +201,69 @@ mod test { ); } - /// For region cn-north-1 with FIPS enabled and DualStack enabled - #[test] - fn test_7() { - let params = crate::config::endpoint::Params::builder() - .region("cn-north-1".to_string()) - .use_fips(true) - .use_dual_stack(true) - .build() - .expect("invalid params"); - let resolver = crate::config::endpoint::DefaultResolver::new(); - let endpoint = resolver.resolve_endpoint(¶ms); - let endpoint = endpoint.expect("Expected valid endpoint: https://account-fips.cn-north-1.api.amazonwebservices.com.cn"); - assert_eq!( - endpoint, - ::aws_smithy_types::endpoint::Endpoint::builder() - .url("https://account-fips.cn-north-1.api.amazonwebservices.com.cn") - .build() - ); - } - - /// For region cn-north-1 with FIPS enabled and DualStack disabled + /// For region cn-northwest-1 with FIPS enabled and DualStack disabled #[test] - fn test_8() { + fn test_9() { let params = crate::config::endpoint::Params::builder() - .region("cn-north-1".to_string()) + .region("cn-northwest-1".to_string()) .use_fips(true) .use_dual_stack(false) .build() .expect("invalid params"); let resolver = crate::config::endpoint::DefaultResolver::new(); let endpoint = resolver.resolve_endpoint(¶ms); - let endpoint = endpoint.expect("Expected valid endpoint: https://account-fips.cn-north-1.amazonaws.com.cn"); + let endpoint = endpoint.expect("Expected valid endpoint: https://account-fips.cn-northwest-1.amazonaws.com.cn"); assert_eq!( endpoint, ::aws_smithy_types::endpoint::Endpoint::builder() - .url("https://account-fips.cn-north-1.amazonaws.com.cn") + .url("https://account-fips.cn-northwest-1.amazonaws.com.cn") + .property( + "authSchemes", + vec![::aws_smithy_types::Document::from({ + let mut out = ::std::collections::HashMap::::new(); + out.insert("name".to_string(), "sigv4".to_string().into()); + out.insert("signingRegion".to_string(), "cn-northwest-1".to_string().into()); + out + })] + ) .build() ); } - /// For region cn-north-1 with FIPS disabled and DualStack enabled + /// For region cn-northwest-1 with FIPS disabled and DualStack enabled #[test] - fn test_9() { + fn test_10() { let params = crate::config::endpoint::Params::builder() - .region("cn-north-1".to_string()) + .region("cn-northwest-1".to_string()) .use_fips(false) .use_dual_stack(true) .build() .expect("invalid params"); let resolver = crate::config::endpoint::DefaultResolver::new(); let endpoint = resolver.resolve_endpoint(¶ms); - let endpoint = endpoint.expect("Expected valid endpoint: https://account.cn-north-1.api.amazonwebservices.com.cn"); + let endpoint = endpoint.expect("Expected valid endpoint: https://account.cn-northwest-1.api.amazonwebservices.com.cn"); assert_eq!( endpoint, ::aws_smithy_types::endpoint::Endpoint::builder() - .url("https://account.cn-north-1.api.amazonwebservices.com.cn") + .url("https://account.cn-northwest-1.api.amazonwebservices.com.cn") + .property( + "authSchemes", + vec![::aws_smithy_types::Document::from({ + let mut out = ::std::collections::HashMap::::new(); + out.insert("name".to_string(), "sigv4".to_string().into()); + out.insert("signingRegion".to_string(), "cn-northwest-1".to_string().into()); + out + })] + ) .build() ); } - /// For region cn-north-1 with FIPS disabled and DualStack disabled + /// For region cn-northwest-1 with FIPS disabled and DualStack disabled #[test] - fn test_10() { + fn test_11() { let params = crate::config::endpoint::Params::builder() - .region("cn-north-1".to_string()) + .region("cn-northwest-1".to_string()) .use_fips(false) .use_dual_stack(false) .build() @@ -237,7 +280,6 @@ mod test { vec![::aws_smithy_types::Document::from({ let mut out = ::std::collections::HashMap::::new(); out.insert("name".to_string(), "sigv4".to_string().into()); - out.insert("signingName".to_string(), "account".to_string().into()); out.insert("signingRegion".to_string(), "cn-northwest-1".to_string().into()); out })] @@ -246,89 +288,125 @@ mod test { ); } - /// For region us-gov-east-1 with FIPS enabled and DualStack enabled + /// For region us-gov-west-1 with FIPS enabled and DualStack enabled #[test] - fn test_11() { + fn test_12() { let params = crate::config::endpoint::Params::builder() - .region("us-gov-east-1".to_string()) + .region("us-gov-west-1".to_string()) .use_fips(true) .use_dual_stack(true) .build() .expect("invalid params"); let resolver = crate::config::endpoint::DefaultResolver::new(); let endpoint = resolver.resolve_endpoint(¶ms); - let endpoint = endpoint.expect("Expected valid endpoint: https://account-fips.us-gov-east-1.api.aws"); + let endpoint = endpoint.expect("Expected valid endpoint: https://account-fips.us-gov-west-1.api.aws"); assert_eq!( endpoint, ::aws_smithy_types::endpoint::Endpoint::builder() - .url("https://account-fips.us-gov-east-1.api.aws") + .url("https://account-fips.us-gov-west-1.api.aws") + .property( + "authSchemes", + vec![::aws_smithy_types::Document::from({ + let mut out = ::std::collections::HashMap::::new(); + out.insert("name".to_string(), "sigv4".to_string().into()); + out.insert("signingRegion".to_string(), "us-gov-west-1".to_string().into()); + out + })] + ) .build() ); } - /// For region us-gov-east-1 with FIPS enabled and DualStack disabled + /// For region us-gov-west-1 with FIPS enabled and DualStack disabled #[test] - fn test_12() { + fn test_13() { let params = crate::config::endpoint::Params::builder() - .region("us-gov-east-1".to_string()) + .region("us-gov-west-1".to_string()) .use_fips(true) .use_dual_stack(false) .build() .expect("invalid params"); let resolver = crate::config::endpoint::DefaultResolver::new(); let endpoint = resolver.resolve_endpoint(¶ms); - let endpoint = endpoint.expect("Expected valid endpoint: https://account-fips.us-gov-east-1.amazonaws.com"); + let endpoint = endpoint.expect("Expected valid endpoint: https://account-fips.us-gov-west-1.amazonaws.com"); assert_eq!( endpoint, ::aws_smithy_types::endpoint::Endpoint::builder() - .url("https://account-fips.us-gov-east-1.amazonaws.com") + .url("https://account-fips.us-gov-west-1.amazonaws.com") + .property( + "authSchemes", + vec![::aws_smithy_types::Document::from({ + let mut out = ::std::collections::HashMap::::new(); + out.insert("name".to_string(), "sigv4".to_string().into()); + out.insert("signingRegion".to_string(), "us-gov-west-1".to_string().into()); + out + })] + ) .build() ); } - /// For region us-gov-east-1 with FIPS disabled and DualStack enabled + /// For region us-gov-west-1 with FIPS disabled and DualStack enabled #[test] - fn test_13() { + fn test_14() { let params = crate::config::endpoint::Params::builder() - .region("us-gov-east-1".to_string()) + .region("us-gov-west-1".to_string()) .use_fips(false) .use_dual_stack(true) .build() .expect("invalid params"); let resolver = crate::config::endpoint::DefaultResolver::new(); let endpoint = resolver.resolve_endpoint(¶ms); - let endpoint = endpoint.expect("Expected valid endpoint: https://account.us-gov-east-1.api.aws"); + let endpoint = endpoint.expect("Expected valid endpoint: https://account.us-gov-west-1.api.aws"); assert_eq!( endpoint, ::aws_smithy_types::endpoint::Endpoint::builder() - .url("https://account.us-gov-east-1.api.aws") + .url("https://account.us-gov-west-1.api.aws") + .property( + "authSchemes", + vec![::aws_smithy_types::Document::from({ + let mut out = ::std::collections::HashMap::::new(); + out.insert("name".to_string(), "sigv4".to_string().into()); + out.insert("signingRegion".to_string(), "us-gov-west-1".to_string().into()); + out + })] + ) .build() ); } - /// For region us-gov-east-1 with FIPS disabled and DualStack disabled + /// For region us-gov-west-1 with FIPS disabled and DualStack disabled #[test] - fn test_14() { + fn test_15() { let params = crate::config::endpoint::Params::builder() - .region("us-gov-east-1".to_string()) + .region("us-gov-west-1".to_string()) .use_fips(false) .use_dual_stack(false) .build() .expect("invalid params"); let resolver = crate::config::endpoint::DefaultResolver::new(); let endpoint = resolver.resolve_endpoint(¶ms); - let endpoint = endpoint.expect("Expected valid endpoint: https://account.us-gov-east-1.amazonaws.com"); + let endpoint = endpoint.expect("Expected valid endpoint: https://account.us-gov-west-1.amazonaws.com"); assert_eq!( endpoint, ::aws_smithy_types::endpoint::Endpoint::builder() - .url("https://account.us-gov-east-1.amazonaws.com") + .url("https://account.us-gov-west-1.amazonaws.com") + .property( + "authSchemes", + vec![::aws_smithy_types::Document::from({ + let mut out = ::std::collections::HashMap::::new(); + out.insert("name".to_string(), "sigv4".to_string().into()); + out.insert("signingRegion".to_string(), "us-gov-west-1".to_string().into()); + out + })] + ) .build() ); } /// For region us-iso-east-1 with FIPS enabled and DualStack enabled #[test] - fn test_15() { + fn test_16() { let params = crate::config::endpoint::Params::builder() .region("us-iso-east-1".to_string()) .use_fips(true) @@ -346,7 +424,7 @@ mod test { /// For region us-iso-east-1 with FIPS enabled and DualStack disabled #[test] - fn test_16() { + fn test_17() { let params = crate::config::endpoint::Params::builder() .region("us-iso-east-1".to_string()) .use_fips(true) @@ -360,13 +438,22 @@ mod test { endpoint, ::aws_smithy_types::endpoint::Endpoint::builder() .url("https://account-fips.us-iso-east-1.c2s.ic.gov") + .property( + "authSchemes", + vec![::aws_smithy_types::Document::from({ + let mut out = ::std::collections::HashMap::::new(); + out.insert("name".to_string(), "sigv4".to_string().into()); + out.insert("signingRegion".to_string(), "us-iso-east-1".to_string().into()); + out + })] + ) .build() ); } /// For region us-iso-east-1 with FIPS disabled and DualStack enabled #[test] - fn test_17() { + fn test_18() { let params = crate::config::endpoint::Params::builder() .region("us-iso-east-1".to_string()) .use_fips(false) @@ -381,7 +468,7 @@ mod test { /// For region us-iso-east-1 with FIPS disabled and DualStack disabled #[test] - fn test_18() { + fn test_19() { let params = crate::config::endpoint::Params::builder() .region("us-iso-east-1".to_string()) .use_fips(false) @@ -395,13 +482,22 @@ mod test { endpoint, ::aws_smithy_types::endpoint::Endpoint::builder() .url("https://account.us-iso-east-1.c2s.ic.gov") + .property( + "authSchemes", + vec![::aws_smithy_types::Document::from({ + let mut out = ::std::collections::HashMap::::new(); + out.insert("name".to_string(), "sigv4".to_string().into()); + out.insert("signingRegion".to_string(), "us-iso-east-1".to_string().into()); + out + })] + ) .build() ); } /// For region us-isob-east-1 with FIPS enabled and DualStack enabled #[test] - fn test_19() { + fn test_20() { let params = crate::config::endpoint::Params::builder() .region("us-isob-east-1".to_string()) .use_fips(true) @@ -419,7 +515,7 @@ mod test { /// For region us-isob-east-1 with FIPS enabled and DualStack disabled #[test] - fn test_20() { + fn test_21() { let params = crate::config::endpoint::Params::builder() .region("us-isob-east-1".to_string()) .use_fips(true) @@ -433,13 +529,22 @@ mod test { endpoint, ::aws_smithy_types::endpoint::Endpoint::builder() .url("https://account-fips.us-isob-east-1.sc2s.sgov.gov") + .property( + "authSchemes", + vec![::aws_smithy_types::Document::from({ + let mut out = ::std::collections::HashMap::::new(); + out.insert("name".to_string(), "sigv4".to_string().into()); + out.insert("signingRegion".to_string(), "us-isob-east-1".to_string().into()); + out + })] + ) .build() ); } /// For region us-isob-east-1 with FIPS disabled and DualStack enabled #[test] - fn test_21() { + fn test_22() { let params = crate::config::endpoint::Params::builder() .region("us-isob-east-1".to_string()) .use_fips(false) @@ -454,7 +559,7 @@ mod test { /// For region us-isob-east-1 with FIPS disabled and DualStack disabled #[test] - fn test_22() { + fn test_23() { let params = crate::config::endpoint::Params::builder() .region("us-isob-east-1".to_string()) .use_fips(false) @@ -468,85 +573,204 @@ mod test { endpoint, ::aws_smithy_types::endpoint::Endpoint::builder() .url("https://account.us-isob-east-1.sc2s.sgov.gov") + .property( + "authSchemes", + vec![::aws_smithy_types::Document::from({ + let mut out = ::std::collections::HashMap::::new(); + out.insert("name".to_string(), "sigv4".to_string().into()); + out.insert("signingRegion".to_string(), "us-isob-east-1".to_string().into()); + out + })] + ) .build() ); } - /// For custom endpoint with region set and fips disabled and dualstack disabled + /// For region eu-isoe-west-1 with FIPS enabled and DualStack enabled #[test] - fn test_23() { + fn test_24() { let params = crate::config::endpoint::Params::builder() - .region("us-east-1".to_string()) - .use_fips(false) + .region("eu-isoe-west-1".to_string()) + .use_fips(true) + .use_dual_stack(true) + .build() + .expect("invalid params"); + let resolver = crate::config::endpoint::DefaultResolver::new(); + let endpoint = resolver.resolve_endpoint(¶ms); + let error = endpoint.expect_err("expected error: FIPS and DualStack are enabled, but this partition does not support one or both [For region eu-isoe-west-1 with FIPS enabled and DualStack enabled]"); + assert_eq!( + format!("{}", error), + "FIPS and DualStack are enabled, but this partition does not support one or both" + ) + } + + /// For region eu-isoe-west-1 with FIPS enabled and DualStack disabled + #[test] + fn test_25() { + let params = crate::config::endpoint::Params::builder() + .region("eu-isoe-west-1".to_string()) + .use_fips(true) .use_dual_stack(false) - .endpoint("https://example.com".to_string()) .build() .expect("invalid params"); let resolver = crate::config::endpoint::DefaultResolver::new(); let endpoint = resolver.resolve_endpoint(¶ms); - let endpoint = endpoint.expect("Expected valid endpoint: https://example.com"); + let endpoint = endpoint.expect("Expected valid endpoint: https://account-fips.eu-isoe-west-1.cloud.adc-e.uk"); assert_eq!( endpoint, - ::aws_smithy_types::endpoint::Endpoint::builder().url("https://example.com").build() + ::aws_smithy_types::endpoint::Endpoint::builder() + .url("https://account-fips.eu-isoe-west-1.cloud.adc-e.uk") + .property( + "authSchemes", + vec![::aws_smithy_types::Document::from({ + let mut out = ::std::collections::HashMap::::new(); + out.insert("name".to_string(), "sigv4".to_string().into()); + out.insert("signingRegion".to_string(), "eu-isoe-west-1".to_string().into()); + out + })] + ) + .build() ); } - /// For custom endpoint with region not set and fips disabled and dualstack disabled + /// For region eu-isoe-west-1 with FIPS disabled and DualStack enabled #[test] - fn test_24() { + fn test_26() { + let params = crate::config::endpoint::Params::builder() + .region("eu-isoe-west-1".to_string()) + .use_fips(false) + .use_dual_stack(true) + .build() + .expect("invalid params"); + let resolver = crate::config::endpoint::DefaultResolver::new(); + let endpoint = resolver.resolve_endpoint(¶ms); + let error = endpoint.expect_err("expected error: DualStack is enabled but this partition does not support DualStack [For region eu-isoe-west-1 with FIPS disabled and DualStack enabled]"); + assert_eq!(format!("{}", error), "DualStack is enabled but this partition does not support DualStack") + } + + /// For region eu-isoe-west-1 with FIPS disabled and DualStack disabled + #[test] + fn test_27() { let params = crate::config::endpoint::Params::builder() + .region("eu-isoe-west-1".to_string()) .use_fips(false) .use_dual_stack(false) - .endpoint("https://example.com".to_string()) .build() .expect("invalid params"); let resolver = crate::config::endpoint::DefaultResolver::new(); let endpoint = resolver.resolve_endpoint(¶ms); - let endpoint = endpoint.expect("Expected valid endpoint: https://example.com"); + let endpoint = endpoint.expect("Expected valid endpoint: https://account.eu-isoe-west-1.cloud.adc-e.uk"); assert_eq!( endpoint, - ::aws_smithy_types::endpoint::Endpoint::builder().url("https://example.com").build() + ::aws_smithy_types::endpoint::Endpoint::builder() + .url("https://account.eu-isoe-west-1.cloud.adc-e.uk") + .property( + "authSchemes", + vec![::aws_smithy_types::Document::from({ + let mut out = ::std::collections::HashMap::::new(); + out.insert("name".to_string(), "sigv4".to_string().into()); + out.insert("signingRegion".to_string(), "eu-isoe-west-1".to_string().into()); + out + })] + ) + .build() ); } - /// For custom endpoint with fips enabled and dualstack disabled + /// For region us-isof-south-1 with FIPS enabled and DualStack enabled #[test] - fn test_25() { + fn test_28() { let params = crate::config::endpoint::Params::builder() - .region("us-east-1".to_string()) + .region("us-isof-south-1".to_string()) + .use_fips(true) + .use_dual_stack(true) + .build() + .expect("invalid params"); + let resolver = crate::config::endpoint::DefaultResolver::new(); + let endpoint = resolver.resolve_endpoint(¶ms); + let error = endpoint.expect_err("expected error: FIPS and DualStack are enabled, but this partition does not support one or both [For region us-isof-south-1 with FIPS enabled and DualStack enabled]"); + assert_eq!( + format!("{}", error), + "FIPS and DualStack are enabled, but this partition does not support one or both" + ) + } + + /// For region us-isof-south-1 with FIPS enabled and DualStack disabled + #[test] + fn test_29() { + let params = crate::config::endpoint::Params::builder() + .region("us-isof-south-1".to_string()) .use_fips(true) .use_dual_stack(false) - .endpoint("https://example.com".to_string()) .build() .expect("invalid params"); let resolver = crate::config::endpoint::DefaultResolver::new(); let endpoint = resolver.resolve_endpoint(¶ms); - let error = endpoint.expect_err("expected error: Invalid Configuration: FIPS and custom endpoint are not supported [For custom endpoint with fips enabled and dualstack disabled]"); - assert_eq!(format!("{}", error), "Invalid Configuration: FIPS and custom endpoint are not supported") + let endpoint = endpoint.expect("Expected valid endpoint: https://account-fips.us-isof-south-1.csp.hci.ic.gov"); + assert_eq!( + endpoint, + ::aws_smithy_types::endpoint::Endpoint::builder() + .url("https://account-fips.us-isof-south-1.csp.hci.ic.gov") + .property( + "authSchemes", + vec![::aws_smithy_types::Document::from({ + let mut out = ::std::collections::HashMap::::new(); + out.insert("name".to_string(), "sigv4".to_string().into()); + out.insert("signingRegion".to_string(), "us-isof-south-1".to_string().into()); + out + })] + ) + .build() + ); } - /// For custom endpoint with fips disabled and dualstack enabled + /// For region us-isof-south-1 with FIPS disabled and DualStack enabled #[test] - fn test_26() { + fn test_30() { let params = crate::config::endpoint::Params::builder() - .region("us-east-1".to_string()) + .region("us-isof-south-1".to_string()) .use_fips(false) .use_dual_stack(true) - .endpoint("https://example.com".to_string()) .build() .expect("invalid params"); let resolver = crate::config::endpoint::DefaultResolver::new(); let endpoint = resolver.resolve_endpoint(¶ms); - let error = endpoint.expect_err("expected error: Invalid Configuration: Dualstack and custom endpoint are not supported [For custom endpoint with fips disabled and dualstack enabled]"); + let error = endpoint.expect_err("expected error: DualStack is enabled but this partition does not support DualStack [For region us-isof-south-1 with FIPS disabled and DualStack enabled]"); + assert_eq!(format!("{}", error), "DualStack is enabled but this partition does not support DualStack") + } + + /// For region us-isof-south-1 with FIPS disabled and DualStack disabled + #[test] + fn test_31() { + let params = crate::config::endpoint::Params::builder() + .region("us-isof-south-1".to_string()) + .use_fips(false) + .use_dual_stack(false) + .build() + .expect("invalid params"); + let resolver = crate::config::endpoint::DefaultResolver::new(); + let endpoint = resolver.resolve_endpoint(¶ms); + let endpoint = endpoint.expect("Expected valid endpoint: https://account.us-isof-south-1.csp.hci.ic.gov"); assert_eq!( - format!("{}", error), - "Invalid Configuration: Dualstack and custom endpoint are not supported" - ) + endpoint, + ::aws_smithy_types::endpoint::Endpoint::builder() + .url("https://account.us-isof-south-1.csp.hci.ic.gov") + .property( + "authSchemes", + vec![::aws_smithy_types::Document::from({ + let mut out = ::std::collections::HashMap::::new(); + out.insert("name".to_string(), "sigv4".to_string().into()); + out.insert("signingRegion".to_string(), "us-isof-south-1".to_string().into()); + out + })] + ) + .build() + ); } /// Missing region #[test] - fn test_27() { + fn test_32() { let params = crate::config::endpoint::Params::builder().build().expect("invalid params"); let resolver = crate::config::endpoint::DefaultResolver::new(); let endpoint = resolver.resolve_endpoint(¶ms); @@ -625,24 +849,20 @@ impl crate::config::endpoint::ResolveEndpoint for DefaultResolver { #[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)] /// Configuration parameters for resolving the correct endpoint pub struct Params { - /// The AWS region used to dispatch the request. - pub(crate) region: ::std::option::Option<::std::string::String>, /// When true, use the dual-stack endpoint. If the configured endpoint does not support dual-stack, dispatching the request MAY return an error. pub(crate) use_dual_stack: bool, /// When true, send this request to the FIPS-compliant regional endpoint. If the configured endpoint does not have a FIPS compliant endpoint, dispatching the request will return an error. pub(crate) use_fips: bool, /// Override the endpoint used to send this request pub(crate) endpoint: ::std::option::Option<::std::string::String>, + /// The AWS region used to dispatch the request. + pub(crate) region: ::std::option::Option<::std::string::String>, } impl Params { /// Create a builder for [`Params`] pub fn builder() -> crate::config::endpoint::ParamsBuilder { crate::config::endpoint::ParamsBuilder::default() } - /// The AWS region used to dispatch the request. - pub fn region(&self) -> ::std::option::Option<&str> { - self.region.as_deref() - } /// When true, use the dual-stack endpoint. If the configured endpoint does not support dual-stack, dispatching the request MAY return an error. pub fn use_dual_stack(&self) -> ::std::option::Option { Some(self.use_dual_stack) @@ -655,15 +875,19 @@ impl Params { pub fn endpoint(&self) -> ::std::option::Option<&str> { self.endpoint.as_deref() } + /// The AWS region used to dispatch the request. + pub fn region(&self) -> ::std::option::Option<&str> { + self.region.as_deref() + } } /// Builder for [`Params`] #[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)] pub struct ParamsBuilder { - region: ::std::option::Option<::std::string::String>, use_dual_stack: ::std::option::Option, use_fips: ::std::option::Option, endpoint: ::std::option::Option<::std::string::String>, + region: ::std::option::Option<::std::string::String>, } impl ParamsBuilder { /// Consume this builder, creating [`Params`]. @@ -671,7 +895,6 @@ impl ParamsBuilder { Ok( #[allow(clippy::unnecessary_lazy_evaluations)] crate::config::endpoint::Params { - region: self.region, use_dual_stack: self .use_dual_stack .or_else(|| Some(false)) @@ -681,24 +904,10 @@ impl ParamsBuilder { .or_else(|| Some(false)) .ok_or_else(|| crate::config::endpoint::InvalidParams::missing("use_fips"))?, endpoint: self.endpoint, + region: self.region, }, ) } - /// Sets the value for region - /// - /// The AWS region used to dispatch the request. - pub fn region(mut self, value: impl Into<::std::string::String>) -> Self { - self.region = Some(value.into()); - self - } - - /// Sets the value for region - /// - /// The AWS region used to dispatch the request. - pub fn set_region(mut self, param: Option<::std::string::String>) -> Self { - self.region = param; - self - } /// Sets the value for use_dual_stack /// /// When unset, this parameter has a default value of `false`. @@ -748,6 +957,21 @@ impl ParamsBuilder { self.endpoint = param; self } + /// Sets the value for region + /// + /// The AWS region used to dispatch the request. + pub fn region(mut self, value: impl Into<::std::string::String>) -> Self { + self.region = Some(value.into()); + self + } + + /// Sets the value for region + /// + /// The AWS region used to dispatch the request. + pub fn set_region(mut self, param: Option<::std::string::String>) -> Self { + self.region = param; + self + } } /// An error that occurred during endpoint resolution diff --git a/sdk/account/src/config/endpoint/internals.rs b/sdk/account/src/config/endpoint/internals.rs index 2531048cfedd..afe350311d6a 100644 --- a/sdk/account/src/config/endpoint/internals.rs +++ b/sdk/account/src/config/endpoint/internals.rs @@ -11,8 +11,6 @@ pub(super) fn resolve_endpoint( _diagnostic_collector: &mut crate::endpoint_lib::diagnostic::DiagnosticCollector, partition_resolver: &crate::endpoint_lib::partition::PartitionResolver, ) -> ::aws_smithy_http::endpoint::Result { - #[allow(unused_variables)] - let region = &_params.region; #[allow(unused_variables)] let use_dual_stack = &_params.use_dual_stack; #[allow(unused_variables)] @@ -20,6 +18,8 @@ pub(super) fn resolve_endpoint( #[allow(unused_variables)] let endpoint = &_params.endpoint; #[allow(unused_variables)] + let region = &_params.region; + #[allow(unused_variables)] if let Some(endpoint) = endpoint { if (*use_fips) == (true) { return Err(::aws_smithy_http::endpoint::ResolveEndpointError::message( @@ -37,116 +37,118 @@ pub(super) fn resolve_endpoint( if let Some(region) = region { #[allow(unused_variables)] if let Some(partition_result) = partition_resolver.resolve_partition(region, _diagnostic_collector) { - if (partition_result.name()) == ("aws") { - if (*use_fips) == (false) { - if (*use_dual_stack) == (false) { + if (*use_fips) == (true) { + if (*use_dual_stack) == (true) { + if (true) == (partition_result.supports_fips()) { + if (true) == (partition_result.supports_dual_stack()) { + return Ok(::aws_smithy_types::endpoint::Endpoint::builder() + .url({ + let mut out = String::new(); + out.push_str("https://account-fips."); + #[allow(clippy::needless_borrow)] + out.push_str(&partition_result.implicit_global_region()); + out.push('.'); + #[allow(clippy::needless_borrow)] + out.push_str(&partition_result.dual_stack_dns_suffix()); + out + }) + .property( + "authSchemes", + vec![::aws_smithy_types::Document::from({ + let mut out = ::std::collections::HashMap::::new(); + out.insert("name".to_string(), "sigv4".to_string().into()); + out.insert("signingRegion".to_string(), partition_result.implicit_global_region().to_owned().into()); + out + })], + ) + .build()); + } + } + return Err(::aws_smithy_http::endpoint::ResolveEndpointError::message( + "FIPS and DualStack are enabled, but this partition does not support one or both".to_string(), + )); + } + } + if (*use_fips) == (true) { + if (*use_dual_stack) == (false) { + if (partition_result.supports_fips()) == (true) { return Ok(::aws_smithy_types::endpoint::Endpoint::builder() - .url("https://account.us-east-1.amazonaws.com".to_string()) + .url({ + let mut out = String::new(); + out.push_str("https://account-fips."); + #[allow(clippy::needless_borrow)] + out.push_str(&partition_result.implicit_global_region()); + out.push('.'); + #[allow(clippy::needless_borrow)] + out.push_str(&partition_result.dns_suffix()); + out + }) .property( "authSchemes", vec![::aws_smithy_types::Document::from({ let mut out = ::std::collections::HashMap::::new(); out.insert("name".to_string(), "sigv4".to_string().into()); - out.insert("signingName".to_string(), "account".to_string().into()); - out.insert("signingRegion".to_string(), "us-east-1".to_string().into()); + out.insert("signingRegion".to_string(), partition_result.implicit_global_region().to_owned().into()); out })], ) .build()); } + return Err(::aws_smithy_http::endpoint::ResolveEndpointError::message( + "FIPS is enabled but this partition does not support FIPS".to_string(), + )); } } - if (partition_result.name()) == ("aws-cn") { - if (*use_fips) == (false) { - if (*use_dual_stack) == (false) { + if (*use_fips) == (false) { + if (*use_dual_stack) == (true) { + if (true) == (partition_result.supports_dual_stack()) { return Ok(::aws_smithy_types::endpoint::Endpoint::builder() - .url("https://account.cn-northwest-1.amazonaws.com.cn".to_string()) + .url({ + let mut out = String::new(); + out.push_str("https://account."); + #[allow(clippy::needless_borrow)] + out.push_str(&partition_result.implicit_global_region()); + out.push('.'); + #[allow(clippy::needless_borrow)] + out.push_str(&partition_result.dual_stack_dns_suffix()); + out + }) .property( "authSchemes", vec![::aws_smithy_types::Document::from({ let mut out = ::std::collections::HashMap::::new(); out.insert("name".to_string(), "sigv4".to_string().into()); - out.insert("signingName".to_string(), "account".to_string().into()); - out.insert("signingRegion".to_string(), "cn-northwest-1".to_string().into()); + out.insert("signingRegion".to_string(), partition_result.implicit_global_region().to_owned().into()); out })], ) .build()); } - } - } - if (*use_fips) == (true) { - if (*use_dual_stack) == (true) { - if (true) == (partition_result.supports_fips()) { - if (true) == (partition_result.supports_dual_stack()) { - return Ok(::aws_smithy_types::endpoint::Endpoint::builder() - .url({ - let mut out = String::new(); - out.push_str("https://account-fips."); - #[allow(clippy::needless_borrow)] - out.push_str(®ion); - out.push('.'); - #[allow(clippy::needless_borrow)] - out.push_str(&partition_result.dual_stack_dns_suffix()); - out - }) - .build()); - } - } return Err(::aws_smithy_http::endpoint::ResolveEndpointError::message( - "FIPS and DualStack are enabled, but this partition does not support one or both".to_string(), + "DualStack is enabled but this partition does not support DualStack".to_string(), )); } } - if (*use_fips) == (true) { - if (partition_result.supports_fips()) == (true) { - return Ok(::aws_smithy_types::endpoint::Endpoint::builder() - .url({ - let mut out = String::new(); - out.push_str("https://account-fips."); - #[allow(clippy::needless_borrow)] - out.push_str(®ion); - out.push('.'); - #[allow(clippy::needless_borrow)] - out.push_str(&partition_result.dns_suffix()); - out - }) - .build()); - } - return Err(::aws_smithy_http::endpoint::ResolveEndpointError::message( - "FIPS is enabled but this partition does not support FIPS".to_string(), - )); - } - if (*use_dual_stack) == (true) { - if (true) == (partition_result.supports_dual_stack()) { - return Ok(::aws_smithy_types::endpoint::Endpoint::builder() - .url({ - let mut out = String::new(); - out.push_str("https://account."); - #[allow(clippy::needless_borrow)] - out.push_str(®ion); - out.push('.'); - #[allow(clippy::needless_borrow)] - out.push_str(&partition_result.dual_stack_dns_suffix()); - out - }) - .build()); - } - return Err(::aws_smithy_http::endpoint::ResolveEndpointError::message( - "DualStack is enabled but this partition does not support DualStack".to_string(), - )); - } return Ok(::aws_smithy_types::endpoint::Endpoint::builder() .url({ let mut out = String::new(); out.push_str("https://account."); #[allow(clippy::needless_borrow)] - out.push_str(®ion); + out.push_str(&partition_result.implicit_global_region()); out.push('.'); #[allow(clippy::needless_borrow)] out.push_str(&partition_result.dns_suffix()); out }) + .property( + "authSchemes", + vec![::aws_smithy_types::Document::from({ + let mut out = ::std::collections::HashMap::::new(); + out.insert("name".to_string(), "sigv4".to_string().into()); + out.insert("signingRegion".to_string(), partition_result.implicit_global_region().to_owned().into()); + out + })], + ) .build()); } #[allow(unreachable_code)] diff --git a/sdk/account/src/lib.rs b/sdk/account/src/lib.rs index 278dd4f261c1..62590d271d84 100644 --- a/sdk/account/src/lib.rs +++ b/sdk/account/src/lib.rs @@ -31,7 +31,7 @@ //! ```toml //! [dependencies] //! aws-config = { version = "1.1.7", features = ["behavior-version-latest"] } -//! aws-sdk-account = "1.52.0" +//! aws-sdk-account = "1.53.0" //! tokio = { version = "1", features = ["full"] } //! ``` //! diff --git a/sdk/account/src/operation/accept_primary_email_update.rs b/sdk/account/src/operation/accept_primary_email_update.rs index 896a2402d4eb..7214f9bca05a 100644 --- a/sdk/account/src/operation/accept_primary_email_update.rs +++ b/sdk/account/src/operation/accept_primary_email_update.rs @@ -224,10 +224,10 @@ impl ::aws_smithy_runtime_api::client::interceptors::Intercept for AcceptPrimary .ok_or("failed to downcast to AcceptPrimaryEmailUpdateInput")?; let params = crate::config::endpoint::Params::builder() - .set_region(cfg.load::<::aws_types::region::Region>().map(|r| r.as_ref().to_owned())) .set_use_dual_stack(cfg.load::<::aws_types::endpoint_config::UseDualStack>().map(|ty| ty.0)) .set_use_fips(cfg.load::<::aws_types::endpoint_config::UseFips>().map(|ty| ty.0)) .set_endpoint(cfg.load::<::aws_types::endpoint_config::EndpointUrl>().map(|ty| ty.0.clone())) + .set_region(cfg.load::<::aws_types::region::Region>().map(|r| r.as_ref().to_owned())) .build() .map_err(|err| { ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err) diff --git a/sdk/account/src/operation/delete_alternate_contact.rs b/sdk/account/src/operation/delete_alternate_contact.rs index 917e90b010ae..c1d8325d21c4 100644 --- a/sdk/account/src/operation/delete_alternate_contact.rs +++ b/sdk/account/src/operation/delete_alternate_contact.rs @@ -224,10 +224,10 @@ impl ::aws_smithy_runtime_api::client::interceptors::Intercept for DeleteAlterna .ok_or("failed to downcast to DeleteAlternateContactInput")?; let params = crate::config::endpoint::Params::builder() - .set_region(cfg.load::<::aws_types::region::Region>().map(|r| r.as_ref().to_owned())) .set_use_dual_stack(cfg.load::<::aws_types::endpoint_config::UseDualStack>().map(|ty| ty.0)) .set_use_fips(cfg.load::<::aws_types::endpoint_config::UseFips>().map(|ty| ty.0)) .set_endpoint(cfg.load::<::aws_types::endpoint_config::EndpointUrl>().map(|ty| ty.0.clone())) + .set_region(cfg.load::<::aws_types::region::Region>().map(|r| r.as_ref().to_owned())) .build() .map_err(|err| { ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err) diff --git a/sdk/account/src/operation/disable_region.rs b/sdk/account/src/operation/disable_region.rs index 30a8e23386ec..5523269229d0 100644 --- a/sdk/account/src/operation/disable_region.rs +++ b/sdk/account/src/operation/disable_region.rs @@ -218,10 +218,10 @@ impl ::aws_smithy_runtime_api::client::interceptors::Intercept for DisableRegion .ok_or("failed to downcast to DisableRegionInput")?; let params = crate::config::endpoint::Params::builder() - .set_region(cfg.load::<::aws_types::region::Region>().map(|r| r.as_ref().to_owned())) .set_use_dual_stack(cfg.load::<::aws_types::endpoint_config::UseDualStack>().map(|ty| ty.0)) .set_use_fips(cfg.load::<::aws_types::endpoint_config::UseFips>().map(|ty| ty.0)) .set_endpoint(cfg.load::<::aws_types::endpoint_config::EndpointUrl>().map(|ty| ty.0.clone())) + .set_region(cfg.load::<::aws_types::region::Region>().map(|r| r.as_ref().to_owned())) .build() .map_err(|err| { ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err) diff --git a/sdk/account/src/operation/enable_region.rs b/sdk/account/src/operation/enable_region.rs index 0f2d74bf868f..ac2d3e4e0436 100644 --- a/sdk/account/src/operation/enable_region.rs +++ b/sdk/account/src/operation/enable_region.rs @@ -218,10 +218,10 @@ impl ::aws_smithy_runtime_api::client::interceptors::Intercept for EnableRegionE .ok_or("failed to downcast to EnableRegionInput")?; let params = crate::config::endpoint::Params::builder() - .set_region(cfg.load::<::aws_types::region::Region>().map(|r| r.as_ref().to_owned())) .set_use_dual_stack(cfg.load::<::aws_types::endpoint_config::UseDualStack>().map(|ty| ty.0)) .set_use_fips(cfg.load::<::aws_types::endpoint_config::UseFips>().map(|ty| ty.0)) .set_endpoint(cfg.load::<::aws_types::endpoint_config::EndpointUrl>().map(|ty| ty.0.clone())) + .set_region(cfg.load::<::aws_types::region::Region>().map(|r| r.as_ref().to_owned())) .build() .map_err(|err| { ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err) diff --git a/sdk/account/src/operation/get_alternate_contact.rs b/sdk/account/src/operation/get_alternate_contact.rs index ebd0b670c37d..3a92ca7e14d9 100644 --- a/sdk/account/src/operation/get_alternate_contact.rs +++ b/sdk/account/src/operation/get_alternate_contact.rs @@ -224,10 +224,10 @@ impl ::aws_smithy_runtime_api::client::interceptors::Intercept for GetAlternateC .ok_or("failed to downcast to GetAlternateContactInput")?; let params = crate::config::endpoint::Params::builder() - .set_region(cfg.load::<::aws_types::region::Region>().map(|r| r.as_ref().to_owned())) .set_use_dual_stack(cfg.load::<::aws_types::endpoint_config::UseDualStack>().map(|ty| ty.0)) .set_use_fips(cfg.load::<::aws_types::endpoint_config::UseFips>().map(|ty| ty.0)) .set_endpoint(cfg.load::<::aws_types::endpoint_config::EndpointUrl>().map(|ty| ty.0.clone())) + .set_region(cfg.load::<::aws_types::region::Region>().map(|r| r.as_ref().to_owned())) .build() .map_err(|err| { ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err) diff --git a/sdk/account/src/operation/get_contact_information.rs b/sdk/account/src/operation/get_contact_information.rs index 45ee1034dea1..0eae01f53235 100644 --- a/sdk/account/src/operation/get_contact_information.rs +++ b/sdk/account/src/operation/get_contact_information.rs @@ -225,10 +225,10 @@ impl ::aws_smithy_runtime_api::client::interceptors::Intercept for GetContactInf .ok_or("failed to downcast to GetContactInformationInput")?; let params = crate::config::endpoint::Params::builder() - .set_region(cfg.load::<::aws_types::region::Region>().map(|r| r.as_ref().to_owned())) .set_use_dual_stack(cfg.load::<::aws_types::endpoint_config::UseDualStack>().map(|ty| ty.0)) .set_use_fips(cfg.load::<::aws_types::endpoint_config::UseFips>().map(|ty| ty.0)) .set_endpoint(cfg.load::<::aws_types::endpoint_config::EndpointUrl>().map(|ty| ty.0.clone())) + .set_region(cfg.load::<::aws_types::region::Region>().map(|r| r.as_ref().to_owned())) .build() .map_err(|err| { ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err) diff --git a/sdk/account/src/operation/get_primary_email.rs b/sdk/account/src/operation/get_primary_email.rs index 72bf1809a8d8..146c80eb53c2 100644 --- a/sdk/account/src/operation/get_primary_email.rs +++ b/sdk/account/src/operation/get_primary_email.rs @@ -222,10 +222,10 @@ impl ::aws_smithy_runtime_api::client::interceptors::Intercept for GetPrimaryEma .ok_or("failed to downcast to GetPrimaryEmailInput")?; let params = crate::config::endpoint::Params::builder() - .set_region(cfg.load::<::aws_types::region::Region>().map(|r| r.as_ref().to_owned())) .set_use_dual_stack(cfg.load::<::aws_types::endpoint_config::UseDualStack>().map(|ty| ty.0)) .set_use_fips(cfg.load::<::aws_types::endpoint_config::UseFips>().map(|ty| ty.0)) .set_endpoint(cfg.load::<::aws_types::endpoint_config::EndpointUrl>().map(|ty| ty.0.clone())) + .set_region(cfg.load::<::aws_types::region::Region>().map(|r| r.as_ref().to_owned())) .build() .map_err(|err| { ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err) diff --git a/sdk/account/src/operation/get_region_opt_status.rs b/sdk/account/src/operation/get_region_opt_status.rs index d8b812bf2c70..ecc0e464dc36 100644 --- a/sdk/account/src/operation/get_region_opt_status.rs +++ b/sdk/account/src/operation/get_region_opt_status.rs @@ -223,10 +223,10 @@ impl ::aws_smithy_runtime_api::client::interceptors::Intercept for GetRegionOptS .ok_or("failed to downcast to GetRegionOptStatusInput")?; let params = crate::config::endpoint::Params::builder() - .set_region(cfg.load::<::aws_types::region::Region>().map(|r| r.as_ref().to_owned())) .set_use_dual_stack(cfg.load::<::aws_types::endpoint_config::UseDualStack>().map(|ty| ty.0)) .set_use_fips(cfg.load::<::aws_types::endpoint_config::UseFips>().map(|ty| ty.0)) .set_endpoint(cfg.load::<::aws_types::endpoint_config::EndpointUrl>().map(|ty| ty.0.clone())) + .set_region(cfg.load::<::aws_types::region::Region>().map(|r| r.as_ref().to_owned())) .build() .map_err(|err| { ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err) diff --git a/sdk/account/src/operation/list_regions.rs b/sdk/account/src/operation/list_regions.rs index 69df9c0bac3b..5dff02a25313 100644 --- a/sdk/account/src/operation/list_regions.rs +++ b/sdk/account/src/operation/list_regions.rs @@ -218,10 +218,10 @@ impl ::aws_smithy_runtime_api::client::interceptors::Intercept for ListRegionsEn .ok_or("failed to downcast to ListRegionsInput")?; let params = crate::config::endpoint::Params::builder() - .set_region(cfg.load::<::aws_types::region::Region>().map(|r| r.as_ref().to_owned())) .set_use_dual_stack(cfg.load::<::aws_types::endpoint_config::UseDualStack>().map(|ty| ty.0)) .set_use_fips(cfg.load::<::aws_types::endpoint_config::UseFips>().map(|ty| ty.0)) .set_endpoint(cfg.load::<::aws_types::endpoint_config::EndpointUrl>().map(|ty| ty.0.clone())) + .set_region(cfg.load::<::aws_types::region::Region>().map(|r| r.as_ref().to_owned())) .build() .map_err(|err| { ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err) diff --git a/sdk/account/src/operation/put_alternate_contact.rs b/sdk/account/src/operation/put_alternate_contact.rs index 75d8910cccb7..6adc94bd94c8 100644 --- a/sdk/account/src/operation/put_alternate_contact.rs +++ b/sdk/account/src/operation/put_alternate_contact.rs @@ -223,10 +223,10 @@ impl ::aws_smithy_runtime_api::client::interceptors::Intercept for PutAlternateC .ok_or("failed to downcast to PutAlternateContactInput")?; let params = crate::config::endpoint::Params::builder() - .set_region(cfg.load::<::aws_types::region::Region>().map(|r| r.as_ref().to_owned())) .set_use_dual_stack(cfg.load::<::aws_types::endpoint_config::UseDualStack>().map(|ty| ty.0)) .set_use_fips(cfg.load::<::aws_types::endpoint_config::UseFips>().map(|ty| ty.0)) .set_endpoint(cfg.load::<::aws_types::endpoint_config::EndpointUrl>().map(|ty| ty.0.clone())) + .set_region(cfg.load::<::aws_types::region::Region>().map(|r| r.as_ref().to_owned())) .build() .map_err(|err| { ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err) diff --git a/sdk/account/src/operation/put_contact_information.rs b/sdk/account/src/operation/put_contact_information.rs index e475d2a3bab1..b9c215520e16 100644 --- a/sdk/account/src/operation/put_contact_information.rs +++ b/sdk/account/src/operation/put_contact_information.rs @@ -224,10 +224,10 @@ impl ::aws_smithy_runtime_api::client::interceptors::Intercept for PutContactInf .ok_or("failed to downcast to PutContactInformationInput")?; let params = crate::config::endpoint::Params::builder() - .set_region(cfg.load::<::aws_types::region::Region>().map(|r| r.as_ref().to_owned())) .set_use_dual_stack(cfg.load::<::aws_types::endpoint_config::UseDualStack>().map(|ty| ty.0)) .set_use_fips(cfg.load::<::aws_types::endpoint_config::UseFips>().map(|ty| ty.0)) .set_endpoint(cfg.load::<::aws_types::endpoint_config::EndpointUrl>().map(|ty| ty.0.clone())) + .set_region(cfg.load::<::aws_types::region::Region>().map(|r| r.as_ref().to_owned())) .build() .map_err(|err| { ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err) diff --git a/sdk/account/src/operation/start_primary_email_update.rs b/sdk/account/src/operation/start_primary_email_update.rs index 25e842425e01..f96bc6767f46 100644 --- a/sdk/account/src/operation/start_primary_email_update.rs +++ b/sdk/account/src/operation/start_primary_email_update.rs @@ -224,10 +224,10 @@ impl ::aws_smithy_runtime_api::client::interceptors::Intercept for StartPrimaryE .ok_or("failed to downcast to StartPrimaryEmailUpdateInput")?; let params = crate::config::endpoint::Params::builder() - .set_region(cfg.load::<::aws_types::region::Region>().map(|r| r.as_ref().to_owned())) .set_use_dual_stack(cfg.load::<::aws_types::endpoint_config::UseDualStack>().map(|ty| ty.0)) .set_use_fips(cfg.load::<::aws_types::endpoint_config::UseFips>().map(|ty| ty.0)) .set_endpoint(cfg.load::<::aws_types::endpoint_config::EndpointUrl>().map(|ty| ty.0.clone())) + .set_region(cfg.load::<::aws_types::region::Region>().map(|r| r.as_ref().to_owned())) .build() .map_err(|err| { ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err) diff --git a/sdk/backup/Cargo.toml b/sdk/backup/Cargo.toml index 3a20439209a5..ed1841832c92 100644 --- a/sdk/backup/Cargo.toml +++ b/sdk/backup/Cargo.toml @@ -1,7 +1,7 @@ # Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. [package] name = "aws-sdk-backup" -version = "1.54.0" +version = "1.55.0" authors = ["AWS Rust SDK Team ", "Russell Cohen "] description = "AWS SDK for AWS Backup" edition = "2021" diff --git a/sdk/backup/README.md b/sdk/backup/README.md index ed6bd0ef9b1b..c0a2f59c892a 100644 --- a/sdk/backup/README.md +++ b/sdk/backup/README.md @@ -14,7 +14,7 @@ your project, add the following to your **Cargo.toml** file: ```toml [dependencies] aws-config = { version = "1.1.7", features = ["behavior-version-latest"] } -aws-sdk-backup = "1.54.0" +aws-sdk-backup = "1.55.0" tokio = { version = "1", features = ["full"] } ``` diff --git a/sdk/backup/src/client.rs b/sdk/backup/src/client.rs index d26687b2aeb7..4a652599fb3b 100644 --- a/sdk/backup/src/client.rs +++ b/sdk/backup/src/client.rs @@ -247,6 +247,8 @@ mod get_backup_vault_notifications; mod get_legal_hold; +mod get_recovery_point_index_details; + mod get_recovery_point_restore_metadata; mod get_restore_job_metadata; @@ -279,6 +281,8 @@ mod list_copy_jobs; mod list_frameworks; +mod list_indexed_recovery_points; + mod list_legal_holds; mod list_protected_resources; @@ -335,6 +339,8 @@ mod update_framework; mod update_global_settings; +mod update_recovery_point_index_settings; + mod update_recovery_point_lifecycle; mod update_region_settings; diff --git a/sdk/backup/src/client/describe_recovery_point.rs b/sdk/backup/src/client/describe_recovery_point.rs index 33270e467b37..a3a6a2fb6566 100644 --- a/sdk/backup/src/client/describe_recovery_point.rs +++ b/sdk/backup/src/client/describe_recovery_point.rs @@ -31,6 +31,8 @@ impl super::Client { /// - [`is_parent(bool)`](crate::operation::describe_recovery_point::DescribeRecoveryPointOutput::is_parent):

This returns the boolean value that a recovery point is a parent (composite) job.

/// - [`resource_name(Option)`](crate::operation::describe_recovery_point::DescribeRecoveryPointOutput::resource_name):

The name of the resource that belongs to the specified backup.

/// - [`vault_type(Option)`](crate::operation::describe_recovery_point::DescribeRecoveryPointOutput::vault_type):

The type of vault in which the described recovery point is stored.

+ /// - [`index_status(Option)`](crate::operation::describe_recovery_point::DescribeRecoveryPointOutput::index_status):

This is the current status for the backup index associated with the specified recovery point.

Statuses are: PENDING | ACTIVE | FAILED | DELETING

A recovery point with an index that has the status of ACTIVE can be included in a search.

+ /// - [`index_status_message(Option)`](crate::operation::describe_recovery_point::DescribeRecoveryPointOutput::index_status_message):

A string in the form of a detailed message explaining the status of a backup index associated with the recovery point.

/// - On failure, responds with [`SdkError`](crate::operation::describe_recovery_point::DescribeRecoveryPointError) pub fn describe_recovery_point(&self) -> crate::operation::describe_recovery_point::builders::DescribeRecoveryPointFluentBuilder { crate::operation::describe_recovery_point::builders::DescribeRecoveryPointFluentBuilder::new(self.handle.clone()) diff --git a/sdk/backup/src/client/get_recovery_point_index_details.rs b/sdk/backup/src/client/get_recovery_point_index_details.rs new file mode 100644 index 000000000000..96b0b3832975 --- /dev/null +++ b/sdk/backup/src/client/get_recovery_point_index_details.rs @@ -0,0 +1,24 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +impl super::Client { + /// Constructs a fluent builder for the [`GetRecoveryPointIndexDetails`](crate::operation::get_recovery_point_index_details::builders::GetRecoveryPointIndexDetailsFluentBuilder) operation. + /// + /// - The fluent builder is configurable: + /// - [`backup_vault_name(impl Into)`](crate::operation::get_recovery_point_index_details::builders::GetRecoveryPointIndexDetailsFluentBuilder::backup_vault_name) / [`set_backup_vault_name(Option)`](crate::operation::get_recovery_point_index_details::builders::GetRecoveryPointIndexDetailsFluentBuilder::set_backup_vault_name):
required: **true**

The name of a logical container where backups are stored. Backup vaults are identified by names that are unique to the account used to create them and the Region where they are created.

Accepted characters include lowercase letters, numbers, and hyphens.


+ /// - [`recovery_point_arn(impl Into)`](crate::operation::get_recovery_point_index_details::builders::GetRecoveryPointIndexDetailsFluentBuilder::recovery_point_arn) / [`set_recovery_point_arn(Option)`](crate::operation::get_recovery_point_index_details::builders::GetRecoveryPointIndexDetailsFluentBuilder::set_recovery_point_arn):
required: **true**

An ARN that uniquely identifies a recovery point; for example, arn:aws:backup:us-east-1:123456789012:recovery-point:1EB3B5E7-9EB0-435A-A80B-108B488B0D45.


+ /// - On success, responds with [`GetRecoveryPointIndexDetailsOutput`](crate::operation::get_recovery_point_index_details::GetRecoveryPointIndexDetailsOutput) with field(s): + /// - [`recovery_point_arn(Option)`](crate::operation::get_recovery_point_index_details::GetRecoveryPointIndexDetailsOutput::recovery_point_arn):

An ARN that uniquely identifies a recovery point; for example, arn:aws:backup:us-east-1:123456789012:recovery-point:1EB3B5E7-9EB0-435A-A80B-108B488B0D45.

+ /// - [`backup_vault_arn(Option)`](crate::operation::get_recovery_point_index_details::GetRecoveryPointIndexDetailsOutput::backup_vault_arn):

An ARN that uniquely identifies the backup vault where the recovery point index is stored.

For example, arn:aws:backup:us-east-1:123456789012:backup-vault:aBackupVault.

+ /// - [`source_resource_arn(Option)`](crate::operation::get_recovery_point_index_details::GetRecoveryPointIndexDetailsOutput::source_resource_arn):

A string of the Amazon Resource Name (ARN) that uniquely identifies the source resource.

+ /// - [`index_creation_date(Option)`](crate::operation::get_recovery_point_index_details::GetRecoveryPointIndexDetailsOutput::index_creation_date):

The date and time that a backup index was created, in Unix format and Coordinated Universal Time (UTC). The value of CreationDate is accurate to milliseconds. For example, the value 1516925490.087 represents Friday, January 26, 2018 12:11:30.087 AM.

+ /// - [`index_deletion_date(Option)`](crate::operation::get_recovery_point_index_details::GetRecoveryPointIndexDetailsOutput::index_deletion_date):

The date and time that a backup index was deleted, in Unix format and Coordinated Universal Time (UTC). The value of CreationDate is accurate to milliseconds. For example, the value 1516925490.087 represents Friday, January 26, 2018 12:11:30.087 AM.

+ /// - [`index_completion_date(Option)`](crate::operation::get_recovery_point_index_details::GetRecoveryPointIndexDetailsOutput::index_completion_date):

The date and time that a backup index finished creation, in Unix format and Coordinated Universal Time (UTC). The value of CreationDate is accurate to milliseconds. For example, the value 1516925490.087 represents Friday, January 26, 2018 12:11:30.087 AM.

+ /// - [`index_status(Option)`](crate::operation::get_recovery_point_index_details::GetRecoveryPointIndexDetailsOutput::index_status):

This is the current status for the backup index associated with the specified recovery point.

Statuses are: PENDING | ACTIVE | FAILED | DELETING

A recovery point with an index that has the status of ACTIVE can be included in a search.

+ /// - [`index_status_message(Option)`](crate::operation::get_recovery_point_index_details::GetRecoveryPointIndexDetailsOutput::index_status_message):

A detailed message explaining the status of a backup index associated with the recovery point.

+ /// - [`total_items_indexed(Option)`](crate::operation::get_recovery_point_index_details::GetRecoveryPointIndexDetailsOutput::total_items_indexed):

Count of items within the backup index associated with the recovery point.

+ /// - On failure, responds with [`SdkError`](crate::operation::get_recovery_point_index_details::GetRecoveryPointIndexDetailsError) + pub fn get_recovery_point_index_details( + &self, + ) -> crate::operation::get_recovery_point_index_details::builders::GetRecoveryPointIndexDetailsFluentBuilder { + crate::operation::get_recovery_point_index_details::builders::GetRecoveryPointIndexDetailsFluentBuilder::new(self.handle.clone()) + } +} diff --git a/sdk/backup/src/client/list_indexed_recovery_points.rs b/sdk/backup/src/client/list_indexed_recovery_points.rs new file mode 100644 index 000000000000..d7d596605d37 --- /dev/null +++ b/sdk/backup/src/client/list_indexed_recovery_points.rs @@ -0,0 +1,21 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +impl super::Client { + /// Constructs a fluent builder for the [`ListIndexedRecoveryPoints`](crate::operation::list_indexed_recovery_points::builders::ListIndexedRecoveryPointsFluentBuilder) operation. + /// This operation supports pagination; See [`into_paginator()`](crate::operation::list_indexed_recovery_points::builders::ListIndexedRecoveryPointsFluentBuilder::into_paginator). + /// + /// - The fluent builder is configurable: + /// - [`next_token(impl Into)`](crate::operation::list_indexed_recovery_points::builders::ListIndexedRecoveryPointsFluentBuilder::next_token) / [`set_next_token(Option)`](crate::operation::list_indexed_recovery_points::builders::ListIndexedRecoveryPointsFluentBuilder::set_next_token):
required: **false**

The next item following a partial list of returned recovery points.

For example, if a request is made to return MaxResults number of indexed recovery points, NextToken allows you to return more items in your list starting at the location pointed to by the next token.


+ /// - [`max_results(i32)`](crate::operation::list_indexed_recovery_points::builders::ListIndexedRecoveryPointsFluentBuilder::max_results) / [`set_max_results(Option)`](crate::operation::list_indexed_recovery_points::builders::ListIndexedRecoveryPointsFluentBuilder::set_max_results):
required: **false**

The maximum number of resource list items to be returned.


+ /// - [`source_resource_arn(impl Into)`](crate::operation::list_indexed_recovery_points::builders::ListIndexedRecoveryPointsFluentBuilder::source_resource_arn) / [`set_source_resource_arn(Option)`](crate::operation::list_indexed_recovery_points::builders::ListIndexedRecoveryPointsFluentBuilder::set_source_resource_arn):
required: **false**

A string of the Amazon Resource Name (ARN) that uniquely identifies the source resource.


+ /// - [`created_before(DateTime)`](crate::operation::list_indexed_recovery_points::builders::ListIndexedRecoveryPointsFluentBuilder::created_before) / [`set_created_before(Option)`](crate::operation::list_indexed_recovery_points::builders::ListIndexedRecoveryPointsFluentBuilder::set_created_before):
required: **false**

Returns only indexed recovery points that were created before the specified date.


+ /// - [`created_after(DateTime)`](crate::operation::list_indexed_recovery_points::builders::ListIndexedRecoveryPointsFluentBuilder::created_after) / [`set_created_after(Option)`](crate::operation::list_indexed_recovery_points::builders::ListIndexedRecoveryPointsFluentBuilder::set_created_after):
required: **false**

Returns only indexed recovery points that were created after the specified date.


+ /// - [`resource_type(impl Into)`](crate::operation::list_indexed_recovery_points::builders::ListIndexedRecoveryPointsFluentBuilder::resource_type) / [`set_resource_type(Option)`](crate::operation::list_indexed_recovery_points::builders::ListIndexedRecoveryPointsFluentBuilder::set_resource_type):
required: **false**

Returns a list of indexed recovery points for the specified resource type(s).

Accepted values include:

  • EBS for Amazon Elastic Block Store

  • S3 for Amazon Simple Storage Service (Amazon S3)


+ /// - [`index_status(IndexStatus)`](crate::operation::list_indexed_recovery_points::builders::ListIndexedRecoveryPointsFluentBuilder::index_status) / [`set_index_status(Option)`](crate::operation::list_indexed_recovery_points::builders::ListIndexedRecoveryPointsFluentBuilder::set_index_status):
required: **false**

Include this parameter to filter the returned list by the indicated statuses.

Accepted values: PENDING | ACTIVE | FAILED | DELETING

A recovery point with an index that has the status of ACTIVE can be included in a search.


+ /// - On success, responds with [`ListIndexedRecoveryPointsOutput`](crate::operation::list_indexed_recovery_points::ListIndexedRecoveryPointsOutput) with field(s): + /// - [`indexed_recovery_points(Option>)`](crate::operation::list_indexed_recovery_points::ListIndexedRecoveryPointsOutput::indexed_recovery_points):

This is a list of recovery points that have an associated index, belonging to the specified account.

+ /// - [`next_token(Option)`](crate::operation::list_indexed_recovery_points::ListIndexedRecoveryPointsOutput::next_token):

The next item following a partial list of returned recovery points.

For example, if a request is made to return MaxResults number of indexed recovery points, NextToken allows you to return more items in your list starting at the location pointed to by the next token.

+ /// - On failure, responds with [`SdkError`](crate::operation::list_indexed_recovery_points::ListIndexedRecoveryPointsError) + pub fn list_indexed_recovery_points(&self) -> crate::operation::list_indexed_recovery_points::builders::ListIndexedRecoveryPointsFluentBuilder { + crate::operation::list_indexed_recovery_points::builders::ListIndexedRecoveryPointsFluentBuilder::new(self.handle.clone()) + } +} diff --git a/sdk/backup/src/client/start_backup_job.rs b/sdk/backup/src/client/start_backup_job.rs index 6a2d389c72c2..3e9fb2f2f94c 100644 --- a/sdk/backup/src/client/start_backup_job.rs +++ b/sdk/backup/src/client/start_backup_job.rs @@ -12,6 +12,7 @@ impl super::Client { /// - [`lifecycle(Lifecycle)`](crate::operation::start_backup_job::builders::StartBackupJobFluentBuilder::lifecycle) / [`set_lifecycle(Option)`](crate::operation::start_backup_job::builders::StartBackupJobFluentBuilder::set_lifecycle):
required: **false**

The lifecycle defines when a protected resource is transitioned to cold storage and when it expires. Backup will transition and expire backups automatically according to the lifecycle that you define.

Backups transitioned to cold storage must be stored in cold storage for a minimum of 90 days. Therefore, the “retention” setting must be 90 days greater than the “transition to cold after days” setting. The “transition to cold after days” setting cannot be changed after a backup has been transitioned to cold.

Resource types that can transition to cold storage are listed in the Feature availability by resource table. Backup ignores this expression for other resource types.

This parameter has a maximum value of 100 years (36,500 days).


/// - [`recovery_point_tags(impl Into, impl Into)`](crate::operation::start_backup_job::builders::StartBackupJobFluentBuilder::recovery_point_tags) / [`set_recovery_point_tags(Option>)`](crate::operation::start_backup_job::builders::StartBackupJobFluentBuilder::set_recovery_point_tags):
required: **false**

The tags to assign to the resources.


/// - [`backup_options(impl Into, impl Into)`](crate::operation::start_backup_job::builders::StartBackupJobFluentBuilder::backup_options) / [`set_backup_options(Option>)`](crate::operation::start_backup_job::builders::StartBackupJobFluentBuilder::set_backup_options):
required: **false**

The backup option for a selected resource. This option is only available for Windows Volume Shadow Copy Service (VSS) backup jobs.

Valid values: Set to "WindowsVSS":"enabled" to enable the WindowsVSS backup option and create a Windows VSS backup. Set to "WindowsVSS""disabled" to create a regular backup. The WindowsVSS option is not enabled by default.


+ /// - [`index(Index)`](crate::operation::start_backup_job::builders::StartBackupJobFluentBuilder::index) / [`set_index(Option)`](crate::operation::start_backup_job::builders::StartBackupJobFluentBuilder::set_index):
required: **false**

Include this parameter to enable index creation if your backup job has a resource type that supports backup indexes.

Resource types that support backup indexes include:

  • EBS for Amazon Elastic Block Store

  • S3 for Amazon Simple Storage Service (Amazon S3)

Index can have 1 of 2 possible values, either ENABLED or DISABLED.

To create a backup index for an eligible ACTIVE recovery point that does not yet have a backup index, set value to ENABLED.

To delete a backup index, set value to DISABLED.


/// - On success, responds with [`StartBackupJobOutput`](crate::operation::start_backup_job::StartBackupJobOutput) with field(s): /// - [`backup_job_id(Option)`](crate::operation::start_backup_job::StartBackupJobOutput::backup_job_id):

Uniquely identifies a request to Backup to back up a resource.

/// - [`recovery_point_arn(Option)`](crate::operation::start_backup_job::StartBackupJobOutput::recovery_point_arn):

Note: This field is only returned for Amazon EFS and Advanced DynamoDB resources.

An ARN that uniquely identifies a recovery point; for example, arn:aws:backup:us-east-1:123456789012:recovery-point:1EB3B5E7-9EB0-435A-A80B-108B488B0D45.

diff --git a/sdk/backup/src/client/update_recovery_point_index_settings.rs b/sdk/backup/src/client/update_recovery_point_index_settings.rs new file mode 100644 index 000000000000..84eb26384ea0 --- /dev/null +++ b/sdk/backup/src/client/update_recovery_point_index_settings.rs @@ -0,0 +1,21 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +impl super::Client { + /// Constructs a fluent builder for the [`UpdateRecoveryPointIndexSettings`](crate::operation::update_recovery_point_index_settings::builders::UpdateRecoveryPointIndexSettingsFluentBuilder) operation. + /// + /// - The fluent builder is configurable: + /// - [`backup_vault_name(impl Into)`](crate::operation::update_recovery_point_index_settings::builders::UpdateRecoveryPointIndexSettingsFluentBuilder::backup_vault_name) / [`set_backup_vault_name(Option)`](crate::operation::update_recovery_point_index_settings::builders::UpdateRecoveryPointIndexSettingsFluentBuilder::set_backup_vault_name):
required: **true**

The name of a logical container where backups are stored. Backup vaults are identified by names that are unique to the account used to create them and the Region where they are created.

Accepted characters include lowercase letters, numbers, and hyphens.


+ /// - [`recovery_point_arn(impl Into)`](crate::operation::update_recovery_point_index_settings::builders::UpdateRecoveryPointIndexSettingsFluentBuilder::recovery_point_arn) / [`set_recovery_point_arn(Option)`](crate::operation::update_recovery_point_index_settings::builders::UpdateRecoveryPointIndexSettingsFluentBuilder::set_recovery_point_arn):
required: **true**

An ARN that uniquely identifies a recovery point; for example, arn:aws:backup:us-east-1:123456789012:recovery-point:1EB3B5E7-9EB0-435A-A80B-108B488B0D45.


+ /// - [`iam_role_arn(impl Into)`](crate::operation::update_recovery_point_index_settings::builders::UpdateRecoveryPointIndexSettingsFluentBuilder::iam_role_arn) / [`set_iam_role_arn(Option)`](crate::operation::update_recovery_point_index_settings::builders::UpdateRecoveryPointIndexSettingsFluentBuilder::set_iam_role_arn):
required: **false**

This specifies the IAM role ARN used for this operation.

For example, arn:aws:iam::123456789012:role/S3Access


+ /// - [`index(Index)`](crate::operation::update_recovery_point_index_settings::builders::UpdateRecoveryPointIndexSettingsFluentBuilder::index) / [`set_index(Option)`](crate::operation::update_recovery_point_index_settings::builders::UpdateRecoveryPointIndexSettingsFluentBuilder::set_index):
required: **true**

Index can have 1 of 2 possible values, either ENABLED or DISABLED.

To create a backup index for an eligible ACTIVE recovery point that does not yet have a backup index, set value to ENABLED.

To delete a backup index, set value to DISABLED.


+ /// - On success, responds with [`UpdateRecoveryPointIndexSettingsOutput`](crate::operation::update_recovery_point_index_settings::UpdateRecoveryPointIndexSettingsOutput) with field(s): + /// - [`backup_vault_name(Option)`](crate::operation::update_recovery_point_index_settings::UpdateRecoveryPointIndexSettingsOutput::backup_vault_name):

The name of a logical container where backups are stored. Backup vaults are identified by names that are unique to the account used to create them and the Region where they are created.

+ /// - [`recovery_point_arn(Option)`](crate::operation::update_recovery_point_index_settings::UpdateRecoveryPointIndexSettingsOutput::recovery_point_arn):

An ARN that uniquely identifies a recovery point; for example, arn:aws:backup:us-east-1:123456789012:recovery-point:1EB3B5E7-9EB0-435A-A80B-108B488B0D45.

+ /// - [`index_status(Option)`](crate::operation::update_recovery_point_index_settings::UpdateRecoveryPointIndexSettingsOutput::index_status):

This is the current status for the backup index associated with the specified recovery point.

Statuses are: PENDING | ACTIVE | FAILED | DELETING

A recovery point with an index that has the status of ACTIVE can be included in a search.

+ /// - [`index(Option)`](crate::operation::update_recovery_point_index_settings::UpdateRecoveryPointIndexSettingsOutput::index):

Index can have 1 of 2 possible values, either ENABLED or DISABLED.

A value of ENABLED means a backup index for an eligible ACTIVE recovery point has been created.

A value of DISABLED means a backup index was deleted.

+ /// - On failure, responds with [`SdkError`](crate::operation::update_recovery_point_index_settings::UpdateRecoveryPointIndexSettingsError) + pub fn update_recovery_point_index_settings( + &self, + ) -> crate::operation::update_recovery_point_index_settings::builders::UpdateRecoveryPointIndexSettingsFluentBuilder { + crate::operation::update_recovery_point_index_settings::builders::UpdateRecoveryPointIndexSettingsFluentBuilder::new(self.handle.clone()) + } +} diff --git a/sdk/backup/src/error_meta.rs b/sdk/backup/src/error_meta.rs index a09733ccdfb3..2535f0bc1590 100644 --- a/sdk/backup/src/error_meta.rs +++ b/sdk/backup/src/error_meta.rs @@ -1576,6 +1576,46 @@ impl From for Error { } } } +impl + From<::aws_smithy_runtime_api::client::result::SdkError> + for Error +where + R: Send + Sync + std::fmt::Debug + 'static, +{ + fn from( + err: ::aws_smithy_runtime_api::client::result::SdkError< + crate::operation::get_recovery_point_index_details::GetRecoveryPointIndexDetailsError, + R, + >, + ) -> Self { + match err { + ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()), + _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled { + meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(), + source: err.into(), + }), + } + } +} +impl From for Error { + fn from(err: crate::operation::get_recovery_point_index_details::GetRecoveryPointIndexDetailsError) -> Self { + match err { + crate::operation::get_recovery_point_index_details::GetRecoveryPointIndexDetailsError::InvalidParameterValueException(inner) => { + Error::InvalidParameterValueException(inner) + } + crate::operation::get_recovery_point_index_details::GetRecoveryPointIndexDetailsError::MissingParameterValueException(inner) => { + Error::MissingParameterValueException(inner) + } + crate::operation::get_recovery_point_index_details::GetRecoveryPointIndexDetailsError::ResourceNotFoundException(inner) => { + Error::ResourceNotFoundException(inner) + } + crate::operation::get_recovery_point_index_details::GetRecoveryPointIndexDetailsError::ServiceUnavailableException(inner) => { + Error::ServiceUnavailableException(inner) + } + crate::operation::get_recovery_point_index_details::GetRecoveryPointIndexDetailsError::Unhandled(inner) => Error::Unhandled(inner), + } + } +} impl From< ::aws_smithy_runtime_api::client::result::SdkError< @@ -2088,6 +2128,39 @@ impl From for Error { } } } +impl From<::aws_smithy_runtime_api::client::result::SdkError> + for Error +where + R: Send + Sync + std::fmt::Debug + 'static, +{ + fn from( + err: ::aws_smithy_runtime_api::client::result::SdkError, + ) -> Self { + match err { + ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()), + _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled { + meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(), + source: err.into(), + }), + } + } +} +impl From for Error { + fn from(err: crate::operation::list_indexed_recovery_points::ListIndexedRecoveryPointsError) -> Self { + match err { + crate::operation::list_indexed_recovery_points::ListIndexedRecoveryPointsError::InvalidParameterValueException(inner) => { + Error::InvalidParameterValueException(inner) + } + crate::operation::list_indexed_recovery_points::ListIndexedRecoveryPointsError::ResourceNotFoundException(inner) => { + Error::ResourceNotFoundException(inner) + } + crate::operation::list_indexed_recovery_points::ListIndexedRecoveryPointsError::ServiceUnavailableException(inner) => { + Error::ServiceUnavailableException(inner) + } + crate::operation::list_indexed_recovery_points::ListIndexedRecoveryPointsError::Unhandled(inner) => Error::Unhandled(inner), + } + } +} impl From<::aws_smithy_runtime_api::client::result::SdkError> for Error where R: Send + Sync + std::fmt::Debug + 'static, @@ -3028,6 +3101,55 @@ impl From f } } } +impl + From< + ::aws_smithy_runtime_api::client::result::SdkError< + crate::operation::update_recovery_point_index_settings::UpdateRecoveryPointIndexSettingsError, + R, + >, + > for Error +where + R: Send + Sync + std::fmt::Debug + 'static, +{ + fn from( + err: ::aws_smithy_runtime_api::client::result::SdkError< + crate::operation::update_recovery_point_index_settings::UpdateRecoveryPointIndexSettingsError, + R, + >, + ) -> Self { + match err { + ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()), + _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled { + meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(), + source: err.into(), + }), + } + } +} +impl From for Error { + fn from(err: crate::operation::update_recovery_point_index_settings::UpdateRecoveryPointIndexSettingsError) -> Self { + match err { + crate::operation::update_recovery_point_index_settings::UpdateRecoveryPointIndexSettingsError::InvalidParameterValueException(inner) => { + Error::InvalidParameterValueException(inner) + } + crate::operation::update_recovery_point_index_settings::UpdateRecoveryPointIndexSettingsError::InvalidRequestException(inner) => { + Error::InvalidRequestException(inner) + } + crate::operation::update_recovery_point_index_settings::UpdateRecoveryPointIndexSettingsError::MissingParameterValueException(inner) => { + Error::MissingParameterValueException(inner) + } + crate::operation::update_recovery_point_index_settings::UpdateRecoveryPointIndexSettingsError::ResourceNotFoundException(inner) => { + Error::ResourceNotFoundException(inner) + } + crate::operation::update_recovery_point_index_settings::UpdateRecoveryPointIndexSettingsError::ServiceUnavailableException(inner) => { + Error::ServiceUnavailableException(inner) + } + crate::operation::update_recovery_point_index_settings::UpdateRecoveryPointIndexSettingsError::Unhandled(inner) => { + Error::Unhandled(inner) + } + } + } +} impl From<::aws_smithy_runtime_api::client::result::SdkError> for Error diff --git a/sdk/backup/src/lens.rs b/sdk/backup/src/lens.rs index 8030026fb6b7..b5ebc834f4fb 100644 --- a/sdk/backup/src/lens.rs +++ b/sdk/backup/src/lens.rs @@ -99,6 +99,16 @@ pub(crate) fn reflens_list_frameworks_output_output_next_token( ::std::option::Option::Some(input) } +pub(crate) fn reflens_list_indexed_recovery_points_output_output_next_token( + input: &crate::operation::list_indexed_recovery_points::ListIndexedRecoveryPointsOutput, +) -> ::std::option::Option<&::std::string::String> { + let input = match &input.next_token { + ::std::option::Option::None => return ::std::option::Option::None, + ::std::option::Option::Some(t) => t, + }; + ::std::option::Option::Some(input) +} + pub(crate) fn reflens_list_legal_holds_output_output_next_token( input: &crate::operation::list_legal_holds::ListLegalHoldsOutput, ) -> ::std::option::Option<&::std::string::String> { @@ -309,6 +319,16 @@ pub(crate) fn lens_list_copy_jobs_output_output_copy_jobs( ::std::option::Option::Some(input) } +pub(crate) fn lens_list_indexed_recovery_points_output_output_indexed_recovery_points( + input: crate::operation::list_indexed_recovery_points::ListIndexedRecoveryPointsOutput, +) -> ::std::option::Option<::std::vec::Vec> { + let input = match input.indexed_recovery_points { + ::std::option::Option::None => return ::std::option::Option::None, + ::std::option::Option::Some(t) => t, + }; + ::std::option::Option::Some(input) +} + pub(crate) fn lens_list_legal_holds_output_output_legal_holds( input: crate::operation::list_legal_holds::ListLegalHoldsOutput, ) -> ::std::option::Option<::std::vec::Vec> { diff --git a/sdk/backup/src/lib.rs b/sdk/backup/src/lib.rs index 3b33854dd325..d1add329c4f8 100644 --- a/sdk/backup/src/lib.rs +++ b/sdk/backup/src/lib.rs @@ -31,7 +31,7 @@ //! ```toml //! [dependencies] //! aws-config = { version = "1.1.7", features = ["behavior-version-latest"] } -//! aws-sdk-backup = "1.54.0" +//! aws-sdk-backup = "1.55.0" //! tokio = { version = "1", features = ["full"] } //! ``` //! diff --git a/sdk/backup/src/operation.rs b/sdk/backup/src/operation.rs index 2c10d1931be3..c7ec6935af66 100644 --- a/sdk/backup/src/operation.rs +++ b/sdk/backup/src/operation.rs @@ -127,6 +127,9 @@ pub mod get_backup_vault_notifications; /// Types for the `GetLegalHold` operation. pub mod get_legal_hold; +/// Types for the `GetRecoveryPointIndexDetails` operation. +pub mod get_recovery_point_index_details; + /// Types for the `GetRecoveryPointRestoreMetadata` operation. pub mod get_recovery_point_restore_metadata; @@ -175,6 +178,9 @@ pub mod list_copy_jobs; /// Types for the `ListFrameworks` operation. pub mod list_frameworks; +/// Types for the `ListIndexedRecoveryPoints` operation. +pub mod list_indexed_recovery_points; + /// Types for the `ListLegalHolds` operation. pub mod list_legal_holds; @@ -259,6 +265,9 @@ pub mod update_framework; /// Types for the `UpdateGlobalSettings` operation. pub mod update_global_settings; +/// Types for the `UpdateRecoveryPointIndexSettings` operation. +pub mod update_recovery_point_index_settings; + /// Types for the `UpdateRecoveryPointLifecycle` operation. pub mod update_recovery_point_lifecycle; diff --git a/sdk/backup/src/operation/describe_recovery_point/_describe_recovery_point_output.rs b/sdk/backup/src/operation/describe_recovery_point/_describe_recovery_point_output.rs index 713f478563b1..c9b29bfd9167 100644 --- a/sdk/backup/src/operation/describe_recovery_point/_describe_recovery_point_output.rs +++ b/sdk/backup/src/operation/describe_recovery_point/_describe_recovery_point_output.rs @@ -58,6 +58,12 @@ pub struct DescribeRecoveryPointOutput { pub resource_name: ::std::option::Option<::std::string::String>, ///

The type of vault in which the described recovery point is stored.

pub vault_type: ::std::option::Option, + ///

This is the current status for the backup index associated with the specified recovery point.

+ ///

Statuses are: PENDING | ACTIVE | FAILED | DELETING

+ ///

A recovery point with an index that has the status of ACTIVE can be included in a search.

+ pub index_status: ::std::option::Option, + ///

A string in the form of a detailed message explaining the status of a backup index associated with the recovery point.

+ pub index_status_message: ::std::option::Option<::std::string::String>, _request_id: Option, } impl DescribeRecoveryPointOutput { @@ -164,6 +170,16 @@ impl DescribeRecoveryPointOutput { pub fn vault_type(&self) -> ::std::option::Option<&crate::types::VaultType> { self.vault_type.as_ref() } + ///

This is the current status for the backup index associated with the specified recovery point.

+ ///

Statuses are: PENDING | ACTIVE | FAILED | DELETING

+ ///

A recovery point with an index that has the status of ACTIVE can be included in a search.

+ pub fn index_status(&self) -> ::std::option::Option<&crate::types::IndexStatus> { + self.index_status.as_ref() + } + ///

A string in the form of a detailed message explaining the status of a backup index associated with the recovery point.

+ pub fn index_status_message(&self) -> ::std::option::Option<&str> { + self.index_status_message.as_deref() + } } impl ::aws_types::request_id::RequestId for DescribeRecoveryPointOutput { fn request_id(&self) -> Option<&str> { @@ -205,6 +221,8 @@ pub struct DescribeRecoveryPointOutputBuilder { pub(crate) is_parent: ::std::option::Option, pub(crate) resource_name: ::std::option::Option<::std::string::String>, pub(crate) vault_type: ::std::option::Option, + pub(crate) index_status: ::std::option::Option, + pub(crate) index_status_message: ::std::option::Option<::std::string::String>, _request_id: Option, } impl DescribeRecoveryPointOutputBuilder { @@ -565,6 +583,40 @@ impl DescribeRecoveryPointOutputBuilder { pub fn get_vault_type(&self) -> &::std::option::Option { &self.vault_type } + ///

This is the current status for the backup index associated with the specified recovery point.

+ ///

Statuses are: PENDING | ACTIVE | FAILED | DELETING

+ ///

A recovery point with an index that has the status of ACTIVE can be included in a search.

+ pub fn index_status(mut self, input: crate::types::IndexStatus) -> Self { + self.index_status = ::std::option::Option::Some(input); + self + } + ///

This is the current status for the backup index associated with the specified recovery point.

+ ///

Statuses are: PENDING | ACTIVE | FAILED | DELETING

+ ///

A recovery point with an index that has the status of ACTIVE can be included in a search.

+ pub fn set_index_status(mut self, input: ::std::option::Option) -> Self { + self.index_status = input; + self + } + ///

This is the current status for the backup index associated with the specified recovery point.

+ ///

Statuses are: PENDING | ACTIVE | FAILED | DELETING

+ ///

A recovery point with an index that has the status of ACTIVE can be included in a search.

+ pub fn get_index_status(&self) -> &::std::option::Option { + &self.index_status + } + ///

A string in the form of a detailed message explaining the status of a backup index associated with the recovery point.

+ pub fn index_status_message(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.index_status_message = ::std::option::Option::Some(input.into()); + self + } + ///

A string in the form of a detailed message explaining the status of a backup index associated with the recovery point.

+ pub fn set_index_status_message(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.index_status_message = input; + self + } + ///

A string in the form of a detailed message explaining the status of a backup index associated with the recovery point.

+ pub fn get_index_status_message(&self) -> &::std::option::Option<::std::string::String> { + &self.index_status_message + } pub(crate) fn _request_id(mut self, request_id: impl Into) -> Self { self._request_id = Some(request_id.into()); self @@ -601,6 +653,8 @@ impl DescribeRecoveryPointOutputBuilder { is_parent: self.is_parent.unwrap_or_default(), resource_name: self.resource_name, vault_type: self.vault_type, + index_status: self.index_status, + index_status_message: self.index_status_message, _request_id: self._request_id, } } diff --git a/sdk/backup/src/operation/get_recovery_point_index_details.rs b/sdk/backup/src/operation/get_recovery_point_index_details.rs new file mode 100644 index 000000000000..af70b3bd8578 --- /dev/null +++ b/sdk/backup/src/operation/get_recovery_point_index_details.rs @@ -0,0 +1,414 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +/// Orchestration and serialization glue logic for `GetRecoveryPointIndexDetails`. +#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)] +#[non_exhaustive] +pub struct GetRecoveryPointIndexDetails; +impl GetRecoveryPointIndexDetails { + /// Creates a new `GetRecoveryPointIndexDetails` + pub fn new() -> Self { + Self + } + pub(crate) async fn orchestrate( + runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, + input: crate::operation::get_recovery_point_index_details::GetRecoveryPointIndexDetailsInput, + ) -> ::std::result::Result< + crate::operation::get_recovery_point_index_details::GetRecoveryPointIndexDetailsOutput, + ::aws_smithy_runtime_api::client::result::SdkError< + crate::operation::get_recovery_point_index_details::GetRecoveryPointIndexDetailsError, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >, + > { + let map_err = |err: ::aws_smithy_runtime_api::client::result::SdkError< + ::aws_smithy_runtime_api::client::interceptors::context::Error, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >| { + err.map_service_error(|err| { + err.downcast::() + .expect("correct error type") + }) + }; + let context = Self::orchestrate_with_stop_point(runtime_plugins, input, ::aws_smithy_runtime::client::orchestrator::StopPoint::None) + .await + .map_err(map_err)?; + let output = context.finalize().map_err(map_err)?; + ::std::result::Result::Ok( + output + .downcast::() + .expect("correct output type"), + ) + } + + pub(crate) async fn orchestrate_with_stop_point( + runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, + input: crate::operation::get_recovery_point_index_details::GetRecoveryPointIndexDetailsInput, + stop_point: ::aws_smithy_runtime::client::orchestrator::StopPoint, + ) -> ::std::result::Result< + ::aws_smithy_runtime_api::client::interceptors::context::InterceptorContext, + ::aws_smithy_runtime_api::client::result::SdkError< + ::aws_smithy_runtime_api::client::interceptors::context::Error, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >, + > { + let input = ::aws_smithy_runtime_api::client::interceptors::context::Input::erase(input); + ::aws_smithy_runtime::client::orchestrator::invoke_with_stop_point( + "backup", + "GetRecoveryPointIndexDetails", + input, + runtime_plugins, + stop_point, + ) + .await + } + + pub(crate) fn operation_runtime_plugins( + client_runtime_plugins: ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, + client_config: &crate::config::Config, + config_override: ::std::option::Option, + ) -> ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins { + let mut runtime_plugins = client_runtime_plugins.with_operation_plugin(Self::new()); + runtime_plugins = runtime_plugins.with_client_plugin(crate::auth_plugin::DefaultAuthOptionsPlugin::new(vec![ + ::aws_runtime::auth::sigv4::SCHEME_ID, + ])); + if let ::std::option::Option::Some(config_override) = config_override { + for plugin in config_override.runtime_plugins.iter().cloned() { + runtime_plugins = runtime_plugins.with_operation_plugin(plugin); + } + runtime_plugins = runtime_plugins.with_operation_plugin(crate::config::ConfigOverrideRuntimePlugin::new( + config_override, + client_config.config.clone(), + &client_config.runtime_components, + )); + } + runtime_plugins + } +} +impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for GetRecoveryPointIndexDetails { + fn config(&self) -> ::std::option::Option<::aws_smithy_types::config_bag::FrozenLayer> { + let mut cfg = ::aws_smithy_types::config_bag::Layer::new("GetRecoveryPointIndexDetails"); + + cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new( + GetRecoveryPointIndexDetailsRequestSerializer, + )); + cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new( + GetRecoveryPointIndexDetailsResponseDeserializer, + )); + + cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new( + ::aws_smithy_runtime_api::client::auth::static_resolver::StaticAuthSchemeOptionResolverParams::new(), + )); + + cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::Metadata::new( + "GetRecoveryPointIndexDetails", + "backup", + )); + let mut signing_options = ::aws_runtime::auth::SigningOptions::default(); + signing_options.double_uri_encode = true; + signing_options.content_sha256_header = false; + signing_options.normalize_uri_path = true; + signing_options.payload_override = None; + + cfg.store_put(::aws_runtime::auth::SigV4OperationSigningConfig { + signing_options, + ..::std::default::Default::default() + }); + + ::std::option::Option::Some(cfg.freeze()) + } + + fn runtime_components( + &self, + _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder, + ) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> { + #[allow(unused_mut)] + let mut rcb = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("GetRecoveryPointIndexDetails") + .with_interceptor(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default()) + .with_interceptor(GetRecoveryPointIndexDetailsEndpointParamsInterceptor) + .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::< + crate::operation::get_recovery_point_index_details::GetRecoveryPointIndexDetailsError, + >::new()) + .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::< + crate::operation::get_recovery_point_index_details::GetRecoveryPointIndexDetailsError, + >::new()) + .with_retry_classifier(::aws_runtime::retries::classifiers::AwsErrorCodeClassifier::< + crate::operation::get_recovery_point_index_details::GetRecoveryPointIndexDetailsError, + >::new()); + + ::std::borrow::Cow::Owned(rcb) + } +} + +#[derive(Debug)] +struct GetRecoveryPointIndexDetailsResponseDeserializer; +impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for GetRecoveryPointIndexDetailsResponseDeserializer { + fn deserialize_nonstreaming( + &self, + response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError { + let (success, status) = (response.status().is_success(), response.status().as_u16()); + let headers = response.headers(); + let body = response.body().bytes().expect("body loaded"); + #[allow(unused_mut)] + let mut force_error = false; + ::tracing::debug!(request_id = ?::aws_types::request_id::RequestId::request_id(response)); + let parse_result = if !success && status != 200 || force_error { + crate::protocol_serde::shape_get_recovery_point_index_details::de_get_recovery_point_index_details_http_error(status, headers, body) + } else { + crate::protocol_serde::shape_get_recovery_point_index_details::de_get_recovery_point_index_details_http_response(status, headers, body) + }; + crate::protocol_serde::type_erase_result(parse_result) + } +} +#[derive(Debug)] +struct GetRecoveryPointIndexDetailsRequestSerializer; +impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for GetRecoveryPointIndexDetailsRequestSerializer { + #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)] + fn serialize_input( + &self, + input: ::aws_smithy_runtime_api::client::interceptors::context::Input, + _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag, + ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> { + let input = input + .downcast::() + .expect("correct type"); + let _header_serialization_settings = _cfg + .load::() + .cloned() + .unwrap_or_default(); + let mut request_builder = { + fn uri_base( + _input: &crate::operation::get_recovery_point_index_details::GetRecoveryPointIndexDetailsInput, + output: &mut ::std::string::String, + ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> { + use ::std::fmt::Write as _; + let input_1 = &_input.backup_vault_name; + let input_1 = input_1.as_ref().ok_or_else(|| { + ::aws_smithy_types::error::operation::BuildError::missing_field("backup_vault_name", "cannot be empty or unset") + })?; + let backup_vault_name = ::aws_smithy_http::label::fmt_string(input_1, ::aws_smithy_http::label::EncodingStrategy::Default); + if backup_vault_name.is_empty() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "backup_vault_name", + "cannot be empty or unset", + )); + } + let input_2 = &_input.recovery_point_arn; + let input_2 = input_2.as_ref().ok_or_else(|| { + ::aws_smithy_types::error::operation::BuildError::missing_field("recovery_point_arn", "cannot be empty or unset") + })?; + let recovery_point_arn = ::aws_smithy_http::label::fmt_string(input_2, ::aws_smithy_http::label::EncodingStrategy::Default); + if recovery_point_arn.is_empty() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "recovery_point_arn", + "cannot be empty or unset", + )); + } + ::std::write!( + output, + "/backup-vaults/{BackupVaultName}/recovery-points/{RecoveryPointArn}/index", + BackupVaultName = backup_vault_name, + RecoveryPointArn = recovery_point_arn + ) + .expect("formatting should succeed"); + ::std::result::Result::Ok(()) + } + #[allow(clippy::unnecessary_wraps)] + fn update_http_builder( + input: &crate::operation::get_recovery_point_index_details::GetRecoveryPointIndexDetailsInput, + builder: ::http::request::Builder, + ) -> ::std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> { + let mut uri = ::std::string::String::new(); + uri_base(input, &mut uri)?; + ::std::result::Result::Ok(builder.method("GET").uri(uri)) + } + let mut builder = update_http_builder(&input, ::http::request::Builder::new())?; + builder + }; + let body = ::aws_smithy_types::body::SdkBody::from(""); + + ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap()) + } +} +#[derive(Debug)] +struct GetRecoveryPointIndexDetailsEndpointParamsInterceptor; + +impl ::aws_smithy_runtime_api::client::interceptors::Intercept for GetRecoveryPointIndexDetailsEndpointParamsInterceptor { + fn name(&self) -> &'static str { + "GetRecoveryPointIndexDetailsEndpointParamsInterceptor" + } + + fn read_before_execution( + &self, + context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef< + '_, + ::aws_smithy_runtime_api::client::interceptors::context::Input, + ::aws_smithy_runtime_api::client::interceptors::context::Output, + ::aws_smithy_runtime_api::client::interceptors::context::Error, + >, + cfg: &mut ::aws_smithy_types::config_bag::ConfigBag, + ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> { + let _input = context + .input() + .downcast_ref::() + .ok_or("failed to downcast to GetRecoveryPointIndexDetailsInput")?; + + let params = crate::config::endpoint::Params::builder() + .set_region(cfg.load::<::aws_types::region::Region>().map(|r| r.as_ref().to_owned())) + .set_use_dual_stack(cfg.load::<::aws_types::endpoint_config::UseDualStack>().map(|ty| ty.0)) + .set_use_fips(cfg.load::<::aws_types::endpoint_config::UseFips>().map(|ty| ty.0)) + .set_endpoint(cfg.load::<::aws_types::endpoint_config::EndpointUrl>().map(|ty| ty.0.clone())) + .build() + .map_err(|err| { + ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err) + })?; + cfg.interceptor_state() + .store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params)); + ::std::result::Result::Ok(()) + } +} + +// The get_* functions below are generated from JMESPath expressions in the +// operationContextParams trait. They target the operation's input shape. + +/// Error type for the `GetRecoveryPointIndexDetailsError` operation. +#[non_exhaustive] +#[derive(::std::fmt::Debug)] +pub enum GetRecoveryPointIndexDetailsError { + ///

Indicates that something is wrong with a parameter's value. For example, the value is out of range.

+ InvalidParameterValueException(crate::types::error::InvalidParameterValueException), + ///

Indicates that a required parameter is missing.

+ MissingParameterValueException(crate::types::error::MissingParameterValueException), + ///

A resource that is required for the action doesn't exist.

+ ResourceNotFoundException(crate::types::error::ResourceNotFoundException), + ///

The request failed due to a temporary failure of the server.

+ ServiceUnavailableException(crate::types::error::ServiceUnavailableException), + /// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code). + #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \ + variable wildcard pattern and check `.code()`: + \ +    `err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }` + \ + See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-GetRecoveryPointIndexDetailsError) for what information is available for the error.")] + Unhandled(crate::error::sealed_unhandled::Unhandled), +} +impl GetRecoveryPointIndexDetailsError { + /// Creates the `GetRecoveryPointIndexDetailsError::Unhandled` variant from any error type. + pub fn unhandled( + err: impl ::std::convert::Into<::std::boxed::Box>, + ) -> Self { + Self::Unhandled(crate::error::sealed_unhandled::Unhandled { + source: err.into(), + meta: ::std::default::Default::default(), + }) + } + + /// Creates the `GetRecoveryPointIndexDetailsError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata). + pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self { + Self::Unhandled(crate::error::sealed_unhandled::Unhandled { + source: err.clone().into(), + meta: err, + }) + } + /// + /// Returns error metadata, which includes the error code, message, + /// request ID, and potentially additional information. + /// + pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata { + match self { + Self::InvalidParameterValueException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), + Self::MissingParameterValueException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), + Self::ResourceNotFoundException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), + Self::ServiceUnavailableException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), + Self::Unhandled(e) => &e.meta, + } + } + /// Returns `true` if the error kind is `GetRecoveryPointIndexDetailsError::InvalidParameterValueException`. + pub fn is_invalid_parameter_value_exception(&self) -> bool { + matches!(self, Self::InvalidParameterValueException(_)) + } + /// Returns `true` if the error kind is `GetRecoveryPointIndexDetailsError::MissingParameterValueException`. + pub fn is_missing_parameter_value_exception(&self) -> bool { + matches!(self, Self::MissingParameterValueException(_)) + } + /// Returns `true` if the error kind is `GetRecoveryPointIndexDetailsError::ResourceNotFoundException`. + pub fn is_resource_not_found_exception(&self) -> bool { + matches!(self, Self::ResourceNotFoundException(_)) + } + /// Returns `true` if the error kind is `GetRecoveryPointIndexDetailsError::ServiceUnavailableException`. + pub fn is_service_unavailable_exception(&self) -> bool { + matches!(self, Self::ServiceUnavailableException(_)) + } +} +impl ::std::error::Error for GetRecoveryPointIndexDetailsError { + fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> { + match self { + Self::InvalidParameterValueException(_inner) => ::std::option::Option::Some(_inner), + Self::MissingParameterValueException(_inner) => ::std::option::Option::Some(_inner), + Self::ResourceNotFoundException(_inner) => ::std::option::Option::Some(_inner), + Self::ServiceUnavailableException(_inner) => ::std::option::Option::Some(_inner), + Self::Unhandled(_inner) => ::std::option::Option::Some(&*_inner.source), + } + } +} +impl ::std::fmt::Display for GetRecoveryPointIndexDetailsError { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + match self { + Self::InvalidParameterValueException(_inner) => _inner.fmt(f), + Self::MissingParameterValueException(_inner) => _inner.fmt(f), + Self::ResourceNotFoundException(_inner) => _inner.fmt(f), + Self::ServiceUnavailableException(_inner) => _inner.fmt(f), + Self::Unhandled(_inner) => { + if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) { + write!(f, "unhandled error ({code})") + } else { + f.write_str("unhandled error") + } + } + } + } +} +impl ::aws_smithy_types::retry::ProvideErrorKind for GetRecoveryPointIndexDetailsError { + fn code(&self) -> ::std::option::Option<&str> { + ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) + } + fn retryable_error_kind(&self) -> ::std::option::Option<::aws_smithy_types::retry::ErrorKind> { + ::std::option::Option::None + } +} +impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for GetRecoveryPointIndexDetailsError { + fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata { + match self { + Self::InvalidParameterValueException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner), + Self::MissingParameterValueException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner), + Self::ResourceNotFoundException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner), + Self::ServiceUnavailableException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner), + Self::Unhandled(_inner) => &_inner.meta, + } + } +} +impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for GetRecoveryPointIndexDetailsError { + fn create_unhandled_error( + source: ::std::boxed::Box, + meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>, + ) -> Self { + Self::Unhandled(crate::error::sealed_unhandled::Unhandled { + source, + meta: meta.unwrap_or_default(), + }) + } +} +impl ::aws_types::request_id::RequestId for crate::operation::get_recovery_point_index_details::GetRecoveryPointIndexDetailsError { + fn request_id(&self) -> Option<&str> { + self.meta().request_id() + } +} + +pub use crate::operation::get_recovery_point_index_details::_get_recovery_point_index_details_output::GetRecoveryPointIndexDetailsOutput; + +pub use crate::operation::get_recovery_point_index_details::_get_recovery_point_index_details_input::GetRecoveryPointIndexDetailsInput; + +mod _get_recovery_point_index_details_input; + +mod _get_recovery_point_index_details_output; + +/// Builders +pub mod builders; diff --git a/sdk/backup/src/operation/get_recovery_point_index_details/_get_recovery_point_index_details_input.rs b/sdk/backup/src/operation/get_recovery_point_index_details/_get_recovery_point_index_details_input.rs new file mode 100644 index 000000000000..7123648e9216 --- /dev/null +++ b/sdk/backup/src/operation/get_recovery_point_index_details/_get_recovery_point_index_details_input.rs @@ -0,0 +1,83 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +#[allow(missing_docs)] // documentation missing in model +#[non_exhaustive] +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)] +pub struct GetRecoveryPointIndexDetailsInput { + ///

The name of a logical container where backups are stored. Backup vaults are identified by names that are unique to the account used to create them and the Region where they are created.

+ ///

Accepted characters include lowercase letters, numbers, and hyphens.

+ pub backup_vault_name: ::std::option::Option<::std::string::String>, + ///

An ARN that uniquely identifies a recovery point; for example, arn:aws:backup:us-east-1:123456789012:recovery-point:1EB3B5E7-9EB0-435A-A80B-108B488B0D45.

+ pub recovery_point_arn: ::std::option::Option<::std::string::String>, +} +impl GetRecoveryPointIndexDetailsInput { + ///

The name of a logical container where backups are stored. Backup vaults are identified by names that are unique to the account used to create them and the Region where they are created.

+ ///

Accepted characters include lowercase letters, numbers, and hyphens.

+ pub fn backup_vault_name(&self) -> ::std::option::Option<&str> { + self.backup_vault_name.as_deref() + } + ///

An ARN that uniquely identifies a recovery point; for example, arn:aws:backup:us-east-1:123456789012:recovery-point:1EB3B5E7-9EB0-435A-A80B-108B488B0D45.

+ pub fn recovery_point_arn(&self) -> ::std::option::Option<&str> { + self.recovery_point_arn.as_deref() + } +} +impl GetRecoveryPointIndexDetailsInput { + /// Creates a new builder-style object to manufacture [`GetRecoveryPointIndexDetailsInput`](crate::operation::get_recovery_point_index_details::GetRecoveryPointIndexDetailsInput). + pub fn builder() -> crate::operation::get_recovery_point_index_details::builders::GetRecoveryPointIndexDetailsInputBuilder { + crate::operation::get_recovery_point_index_details::builders::GetRecoveryPointIndexDetailsInputBuilder::default() + } +} + +/// A builder for [`GetRecoveryPointIndexDetailsInput`](crate::operation::get_recovery_point_index_details::GetRecoveryPointIndexDetailsInput). +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)] +#[non_exhaustive] +pub struct GetRecoveryPointIndexDetailsInputBuilder { + pub(crate) backup_vault_name: ::std::option::Option<::std::string::String>, + pub(crate) recovery_point_arn: ::std::option::Option<::std::string::String>, +} +impl GetRecoveryPointIndexDetailsInputBuilder { + ///

The name of a logical container where backups are stored. Backup vaults are identified by names that are unique to the account used to create them and the Region where they are created.

+ ///

Accepted characters include lowercase letters, numbers, and hyphens.

+ /// This field is required. + pub fn backup_vault_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.backup_vault_name = ::std::option::Option::Some(input.into()); + self + } + ///

The name of a logical container where backups are stored. Backup vaults are identified by names that are unique to the account used to create them and the Region where they are created.

+ ///

Accepted characters include lowercase letters, numbers, and hyphens.

+ pub fn set_backup_vault_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.backup_vault_name = input; + self + } + ///

The name of a logical container where backups are stored. Backup vaults are identified by names that are unique to the account used to create them and the Region where they are created.

+ ///

Accepted characters include lowercase letters, numbers, and hyphens.

+ pub fn get_backup_vault_name(&self) -> &::std::option::Option<::std::string::String> { + &self.backup_vault_name + } + ///

An ARN that uniquely identifies a recovery point; for example, arn:aws:backup:us-east-1:123456789012:recovery-point:1EB3B5E7-9EB0-435A-A80B-108B488B0D45.

+ /// This field is required. + pub fn recovery_point_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.recovery_point_arn = ::std::option::Option::Some(input.into()); + self + } + ///

An ARN that uniquely identifies a recovery point; for example, arn:aws:backup:us-east-1:123456789012:recovery-point:1EB3B5E7-9EB0-435A-A80B-108B488B0D45.

+ pub fn set_recovery_point_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.recovery_point_arn = input; + self + } + ///

An ARN that uniquely identifies a recovery point; for example, arn:aws:backup:us-east-1:123456789012:recovery-point:1EB3B5E7-9EB0-435A-A80B-108B488B0D45.

+ pub fn get_recovery_point_arn(&self) -> &::std::option::Option<::std::string::String> { + &self.recovery_point_arn + } + /// Consumes the builder and constructs a [`GetRecoveryPointIndexDetailsInput`](crate::operation::get_recovery_point_index_details::GetRecoveryPointIndexDetailsInput). + pub fn build( + self, + ) -> ::std::result::Result< + crate::operation::get_recovery_point_index_details::GetRecoveryPointIndexDetailsInput, + ::aws_smithy_types::error::operation::BuildError, + > { + ::std::result::Result::Ok(crate::operation::get_recovery_point_index_details::GetRecoveryPointIndexDetailsInput { + backup_vault_name: self.backup_vault_name, + recovery_point_arn: self.recovery_point_arn, + }) + } +} diff --git a/sdk/backup/src/operation/get_recovery_point_index_details/_get_recovery_point_index_details_output.rs b/sdk/backup/src/operation/get_recovery_point_index_details/_get_recovery_point_index_details_output.rs new file mode 100644 index 000000000000..ddeb2123f7d7 --- /dev/null +++ b/sdk/backup/src/operation/get_recovery_point_index_details/_get_recovery_point_index_details_output.rs @@ -0,0 +1,257 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +#[allow(missing_docs)] // documentation missing in model +#[non_exhaustive] +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)] +pub struct GetRecoveryPointIndexDetailsOutput { + ///

An ARN that uniquely identifies a recovery point; for example, arn:aws:backup:us-east-1:123456789012:recovery-point:1EB3B5E7-9EB0-435A-A80B-108B488B0D45.

+ pub recovery_point_arn: ::std::option::Option<::std::string::String>, + ///

An ARN that uniquely identifies the backup vault where the recovery point index is stored.

+ ///

For example, arn:aws:backup:us-east-1:123456789012:backup-vault:aBackupVault.

+ pub backup_vault_arn: ::std::option::Option<::std::string::String>, + ///

A string of the Amazon Resource Name (ARN) that uniquely identifies the source resource.

+ pub source_resource_arn: ::std::option::Option<::std::string::String>, + ///

The date and time that a backup index was created, in Unix format and Coordinated Universal Time (UTC). The value of CreationDate is accurate to milliseconds. For example, the value 1516925490.087 represents Friday, January 26, 2018 12:11:30.087 AM.

+ pub index_creation_date: ::std::option::Option<::aws_smithy_types::DateTime>, + ///

The date and time that a backup index was deleted, in Unix format and Coordinated Universal Time (UTC). The value of CreationDate is accurate to milliseconds. For example, the value 1516925490.087 represents Friday, January 26, 2018 12:11:30.087 AM.

+ pub index_deletion_date: ::std::option::Option<::aws_smithy_types::DateTime>, + ///

The date and time that a backup index finished creation, in Unix format and Coordinated Universal Time (UTC). The value of CreationDate is accurate to milliseconds. For example, the value 1516925490.087 represents Friday, January 26, 2018 12:11:30.087 AM.

+ pub index_completion_date: ::std::option::Option<::aws_smithy_types::DateTime>, + ///

This is the current status for the backup index associated with the specified recovery point.

+ ///

Statuses are: PENDING | ACTIVE | FAILED | DELETING

+ ///

A recovery point with an index that has the status of ACTIVE can be included in a search.

+ pub index_status: ::std::option::Option, + ///

A detailed message explaining the status of a backup index associated with the recovery point.

+ pub index_status_message: ::std::option::Option<::std::string::String>, + ///

Count of items within the backup index associated with the recovery point.

+ pub total_items_indexed: ::std::option::Option, + _request_id: Option, +} +impl GetRecoveryPointIndexDetailsOutput { + ///

An ARN that uniquely identifies a recovery point; for example, arn:aws:backup:us-east-1:123456789012:recovery-point:1EB3B5E7-9EB0-435A-A80B-108B488B0D45.

+ pub fn recovery_point_arn(&self) -> ::std::option::Option<&str> { + self.recovery_point_arn.as_deref() + } + ///

An ARN that uniquely identifies the backup vault where the recovery point index is stored.

+ ///

For example, arn:aws:backup:us-east-1:123456789012:backup-vault:aBackupVault.

+ pub fn backup_vault_arn(&self) -> ::std::option::Option<&str> { + self.backup_vault_arn.as_deref() + } + ///

A string of the Amazon Resource Name (ARN) that uniquely identifies the source resource.

+ pub fn source_resource_arn(&self) -> ::std::option::Option<&str> { + self.source_resource_arn.as_deref() + } + ///

The date and time that a backup index was created, in Unix format and Coordinated Universal Time (UTC). The value of CreationDate is accurate to milliseconds. For example, the value 1516925490.087 represents Friday, January 26, 2018 12:11:30.087 AM.

+ pub fn index_creation_date(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> { + self.index_creation_date.as_ref() + } + ///

The date and time that a backup index was deleted, in Unix format and Coordinated Universal Time (UTC). The value of CreationDate is accurate to milliseconds. For example, the value 1516925490.087 represents Friday, January 26, 2018 12:11:30.087 AM.

+ pub fn index_deletion_date(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> { + self.index_deletion_date.as_ref() + } + ///

The date and time that a backup index finished creation, in Unix format and Coordinated Universal Time (UTC). The value of CreationDate is accurate to milliseconds. For example, the value 1516925490.087 represents Friday, January 26, 2018 12:11:30.087 AM.

+ pub fn index_completion_date(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> { + self.index_completion_date.as_ref() + } + ///

This is the current status for the backup index associated with the specified recovery point.

+ ///

Statuses are: PENDING | ACTIVE | FAILED | DELETING

+ ///

A recovery point with an index that has the status of ACTIVE can be included in a search.

+ pub fn index_status(&self) -> ::std::option::Option<&crate::types::IndexStatus> { + self.index_status.as_ref() + } + ///

A detailed message explaining the status of a backup index associated with the recovery point.

+ pub fn index_status_message(&self) -> ::std::option::Option<&str> { + self.index_status_message.as_deref() + } + ///

Count of items within the backup index associated with the recovery point.

+ pub fn total_items_indexed(&self) -> ::std::option::Option { + self.total_items_indexed + } +} +impl ::aws_types::request_id::RequestId for GetRecoveryPointIndexDetailsOutput { + fn request_id(&self) -> Option<&str> { + self._request_id.as_deref() + } +} +impl GetRecoveryPointIndexDetailsOutput { + /// Creates a new builder-style object to manufacture [`GetRecoveryPointIndexDetailsOutput`](crate::operation::get_recovery_point_index_details::GetRecoveryPointIndexDetailsOutput). + pub fn builder() -> crate::operation::get_recovery_point_index_details::builders::GetRecoveryPointIndexDetailsOutputBuilder { + crate::operation::get_recovery_point_index_details::builders::GetRecoveryPointIndexDetailsOutputBuilder::default() + } +} + +/// A builder for [`GetRecoveryPointIndexDetailsOutput`](crate::operation::get_recovery_point_index_details::GetRecoveryPointIndexDetailsOutput). +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)] +#[non_exhaustive] +pub struct GetRecoveryPointIndexDetailsOutputBuilder { + pub(crate) recovery_point_arn: ::std::option::Option<::std::string::String>, + pub(crate) backup_vault_arn: ::std::option::Option<::std::string::String>, + pub(crate) source_resource_arn: ::std::option::Option<::std::string::String>, + pub(crate) index_creation_date: ::std::option::Option<::aws_smithy_types::DateTime>, + pub(crate) index_deletion_date: ::std::option::Option<::aws_smithy_types::DateTime>, + pub(crate) index_completion_date: ::std::option::Option<::aws_smithy_types::DateTime>, + pub(crate) index_status: ::std::option::Option, + pub(crate) index_status_message: ::std::option::Option<::std::string::String>, + pub(crate) total_items_indexed: ::std::option::Option, + _request_id: Option, +} +impl GetRecoveryPointIndexDetailsOutputBuilder { + ///

An ARN that uniquely identifies a recovery point; for example, arn:aws:backup:us-east-1:123456789012:recovery-point:1EB3B5E7-9EB0-435A-A80B-108B488B0D45.

+ pub fn recovery_point_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.recovery_point_arn = ::std::option::Option::Some(input.into()); + self + } + ///

An ARN that uniquely identifies a recovery point; for example, arn:aws:backup:us-east-1:123456789012:recovery-point:1EB3B5E7-9EB0-435A-A80B-108B488B0D45.

+ pub fn set_recovery_point_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.recovery_point_arn = input; + self + } + ///

An ARN that uniquely identifies a recovery point; for example, arn:aws:backup:us-east-1:123456789012:recovery-point:1EB3B5E7-9EB0-435A-A80B-108B488B0D45.

+ pub fn get_recovery_point_arn(&self) -> &::std::option::Option<::std::string::String> { + &self.recovery_point_arn + } + ///

An ARN that uniquely identifies the backup vault where the recovery point index is stored.

+ ///

For example, arn:aws:backup:us-east-1:123456789012:backup-vault:aBackupVault.

+ pub fn backup_vault_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.backup_vault_arn = ::std::option::Option::Some(input.into()); + self + } + ///

An ARN that uniquely identifies the backup vault where the recovery point index is stored.

+ ///

For example, arn:aws:backup:us-east-1:123456789012:backup-vault:aBackupVault.

+ pub fn set_backup_vault_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.backup_vault_arn = input; + self + } + ///

An ARN that uniquely identifies the backup vault where the recovery point index is stored.

+ ///

For example, arn:aws:backup:us-east-1:123456789012:backup-vault:aBackupVault.

+ pub fn get_backup_vault_arn(&self) -> &::std::option::Option<::std::string::String> { + &self.backup_vault_arn + } + ///

A string of the Amazon Resource Name (ARN) that uniquely identifies the source resource.

+ pub fn source_resource_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.source_resource_arn = ::std::option::Option::Some(input.into()); + self + } + ///

A string of the Amazon Resource Name (ARN) that uniquely identifies the source resource.

+ pub fn set_source_resource_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.source_resource_arn = input; + self + } + ///

A string of the Amazon Resource Name (ARN) that uniquely identifies the source resource.

+ pub fn get_source_resource_arn(&self) -> &::std::option::Option<::std::string::String> { + &self.source_resource_arn + } + ///

The date and time that a backup index was created, in Unix format and Coordinated Universal Time (UTC). The value of CreationDate is accurate to milliseconds. For example, the value 1516925490.087 represents Friday, January 26, 2018 12:11:30.087 AM.

+ pub fn index_creation_date(mut self, input: ::aws_smithy_types::DateTime) -> Self { + self.index_creation_date = ::std::option::Option::Some(input); + self + } + ///

The date and time that a backup index was created, in Unix format and Coordinated Universal Time (UTC). The value of CreationDate is accurate to milliseconds. For example, the value 1516925490.087 represents Friday, January 26, 2018 12:11:30.087 AM.

+ pub fn set_index_creation_date(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self { + self.index_creation_date = input; + self + } + ///

The date and time that a backup index was created, in Unix format and Coordinated Universal Time (UTC). The value of CreationDate is accurate to milliseconds. For example, the value 1516925490.087 represents Friday, January 26, 2018 12:11:30.087 AM.

+ pub fn get_index_creation_date(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> { + &self.index_creation_date + } + ///

The date and time that a backup index was deleted, in Unix format and Coordinated Universal Time (UTC). The value of CreationDate is accurate to milliseconds. For example, the value 1516925490.087 represents Friday, January 26, 2018 12:11:30.087 AM.

+ pub fn index_deletion_date(mut self, input: ::aws_smithy_types::DateTime) -> Self { + self.index_deletion_date = ::std::option::Option::Some(input); + self + } + ///

The date and time that a backup index was deleted, in Unix format and Coordinated Universal Time (UTC). The value of CreationDate is accurate to milliseconds. For example, the value 1516925490.087 represents Friday, January 26, 2018 12:11:30.087 AM.

+ pub fn set_index_deletion_date(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self { + self.index_deletion_date = input; + self + } + ///

The date and time that a backup index was deleted, in Unix format and Coordinated Universal Time (UTC). The value of CreationDate is accurate to milliseconds. For example, the value 1516925490.087 represents Friday, January 26, 2018 12:11:30.087 AM.

+ pub fn get_index_deletion_date(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> { + &self.index_deletion_date + } + ///

The date and time that a backup index finished creation, in Unix format and Coordinated Universal Time (UTC). The value of CreationDate is accurate to milliseconds. For example, the value 1516925490.087 represents Friday, January 26, 2018 12:11:30.087 AM.

+ pub fn index_completion_date(mut self, input: ::aws_smithy_types::DateTime) -> Self { + self.index_completion_date = ::std::option::Option::Some(input); + self + } + ///

The date and time that a backup index finished creation, in Unix format and Coordinated Universal Time (UTC). The value of CreationDate is accurate to milliseconds. For example, the value 1516925490.087 represents Friday, January 26, 2018 12:11:30.087 AM.

+ pub fn set_index_completion_date(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self { + self.index_completion_date = input; + self + } + ///

The date and time that a backup index finished creation, in Unix format and Coordinated Universal Time (UTC). The value of CreationDate is accurate to milliseconds. For example, the value 1516925490.087 represents Friday, January 26, 2018 12:11:30.087 AM.

+ pub fn get_index_completion_date(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> { + &self.index_completion_date + } + ///

This is the current status for the backup index associated with the specified recovery point.

+ ///

Statuses are: PENDING | ACTIVE | FAILED | DELETING

+ ///

A recovery point with an index that has the status of ACTIVE can be included in a search.

+ pub fn index_status(mut self, input: crate::types::IndexStatus) -> Self { + self.index_status = ::std::option::Option::Some(input); + self + } + ///

This is the current status for the backup index associated with the specified recovery point.

+ ///

Statuses are: PENDING | ACTIVE | FAILED | DELETING

+ ///

A recovery point with an index that has the status of ACTIVE can be included in a search.

+ pub fn set_index_status(mut self, input: ::std::option::Option) -> Self { + self.index_status = input; + self + } + ///

This is the current status for the backup index associated with the specified recovery point.

+ ///

Statuses are: PENDING | ACTIVE | FAILED | DELETING

+ ///

A recovery point with an index that has the status of ACTIVE can be included in a search.

+ pub fn get_index_status(&self) -> &::std::option::Option { + &self.index_status + } + ///

A detailed message explaining the status of a backup index associated with the recovery point.

+ pub fn index_status_message(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.index_status_message = ::std::option::Option::Some(input.into()); + self + } + ///

A detailed message explaining the status of a backup index associated with the recovery point.

+ pub fn set_index_status_message(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.index_status_message = input; + self + } + ///

A detailed message explaining the status of a backup index associated with the recovery point.

+ pub fn get_index_status_message(&self) -> &::std::option::Option<::std::string::String> { + &self.index_status_message + } + ///

Count of items within the backup index associated with the recovery point.

+ pub fn total_items_indexed(mut self, input: i64) -> Self { + self.total_items_indexed = ::std::option::Option::Some(input); + self + } + ///

Count of items within the backup index associated with the recovery point.

+ pub fn set_total_items_indexed(mut self, input: ::std::option::Option) -> Self { + self.total_items_indexed = input; + self + } + ///

Count of items within the backup index associated with the recovery point.

+ pub fn get_total_items_indexed(&self) -> &::std::option::Option { + &self.total_items_indexed + } + pub(crate) fn _request_id(mut self, request_id: impl Into) -> Self { + self._request_id = Some(request_id.into()); + self + } + + pub(crate) fn _set_request_id(&mut self, request_id: Option) -> &mut Self { + self._request_id = request_id; + self + } + /// Consumes the builder and constructs a [`GetRecoveryPointIndexDetailsOutput`](crate::operation::get_recovery_point_index_details::GetRecoveryPointIndexDetailsOutput). + pub fn build(self) -> crate::operation::get_recovery_point_index_details::GetRecoveryPointIndexDetailsOutput { + crate::operation::get_recovery_point_index_details::GetRecoveryPointIndexDetailsOutput { + recovery_point_arn: self.recovery_point_arn, + backup_vault_arn: self.backup_vault_arn, + source_resource_arn: self.source_resource_arn, + index_creation_date: self.index_creation_date, + index_deletion_date: self.index_deletion_date, + index_completion_date: self.index_completion_date, + index_status: self.index_status, + index_status_message: self.index_status_message, + total_items_indexed: self.total_items_indexed, + _request_id: self._request_id, + } + } +} diff --git a/sdk/backup/src/operation/get_recovery_point_index_details/builders.rs b/sdk/backup/src/operation/get_recovery_point_index_details/builders.rs new file mode 100644 index 000000000000..558bc592f4ae --- /dev/null +++ b/sdk/backup/src/operation/get_recovery_point_index_details/builders.rs @@ -0,0 +1,142 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +pub use crate::operation::get_recovery_point_index_details::_get_recovery_point_index_details_output::GetRecoveryPointIndexDetailsOutputBuilder; + +pub use crate::operation::get_recovery_point_index_details::_get_recovery_point_index_details_input::GetRecoveryPointIndexDetailsInputBuilder; + +impl crate::operation::get_recovery_point_index_details::builders::GetRecoveryPointIndexDetailsInputBuilder { + /// Sends a request with this input using the given client. + pub async fn send_with( + self, + client: &crate::Client, + ) -> ::std::result::Result< + crate::operation::get_recovery_point_index_details::GetRecoveryPointIndexDetailsOutput, + ::aws_smithy_runtime_api::client::result::SdkError< + crate::operation::get_recovery_point_index_details::GetRecoveryPointIndexDetailsError, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >, + > { + let mut fluent_builder = client.get_recovery_point_index_details(); + fluent_builder.inner = self; + fluent_builder.send().await + } +} +/// Fluent builder constructing a request to `GetRecoveryPointIndexDetails`. +/// +///

This operation returns the metadata and details specific to the backup index associated with the specified recovery point.

+#[derive(::std::clone::Clone, ::std::fmt::Debug)] +pub struct GetRecoveryPointIndexDetailsFluentBuilder { + handle: ::std::sync::Arc, + inner: crate::operation::get_recovery_point_index_details::builders::GetRecoveryPointIndexDetailsInputBuilder, + config_override: ::std::option::Option, +} +impl + crate::client::customize::internal::CustomizableSend< + crate::operation::get_recovery_point_index_details::GetRecoveryPointIndexDetailsOutput, + crate::operation::get_recovery_point_index_details::GetRecoveryPointIndexDetailsError, + > for GetRecoveryPointIndexDetailsFluentBuilder +{ + fn send( + self, + config_override: crate::config::Builder, + ) -> crate::client::customize::internal::BoxFuture< + crate::client::customize::internal::SendResult< + crate::operation::get_recovery_point_index_details::GetRecoveryPointIndexDetailsOutput, + crate::operation::get_recovery_point_index_details::GetRecoveryPointIndexDetailsError, + >, + > { + ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await }) + } +} +impl GetRecoveryPointIndexDetailsFluentBuilder { + /// Creates a new `GetRecoveryPointIndexDetailsFluentBuilder`. + pub(crate) fn new(handle: ::std::sync::Arc) -> Self { + Self { + handle, + inner: ::std::default::Default::default(), + config_override: ::std::option::Option::None, + } + } + /// Access the GetRecoveryPointIndexDetails as a reference. + pub fn as_input(&self) -> &crate::operation::get_recovery_point_index_details::builders::GetRecoveryPointIndexDetailsInputBuilder { + &self.inner + } + /// Sends the request and returns the response. + /// + /// If an error occurs, an `SdkError` will be returned with additional details that + /// can be matched against. + /// + /// By default, any retryable failures will be retried twice. Retry behavior + /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be + /// set when configuring the client. + pub async fn send( + self, + ) -> ::std::result::Result< + crate::operation::get_recovery_point_index_details::GetRecoveryPointIndexDetailsOutput, + ::aws_smithy_runtime_api::client::result::SdkError< + crate::operation::get_recovery_point_index_details::GetRecoveryPointIndexDetailsError, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >, + > { + let input = self + .inner + .build() + .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?; + let runtime_plugins = crate::operation::get_recovery_point_index_details::GetRecoveryPointIndexDetails::operation_runtime_plugins( + self.handle.runtime_plugins.clone(), + &self.handle.conf, + self.config_override, + ); + crate::operation::get_recovery_point_index_details::GetRecoveryPointIndexDetails::orchestrate(&runtime_plugins, input).await + } + + /// Consumes this builder, creating a customizable operation that can be modified before being sent. + pub fn customize( + self, + ) -> crate::client::customize::CustomizableOperation< + crate::operation::get_recovery_point_index_details::GetRecoveryPointIndexDetailsOutput, + crate::operation::get_recovery_point_index_details::GetRecoveryPointIndexDetailsError, + Self, + > { + crate::client::customize::CustomizableOperation::new(self) + } + pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into) -> Self { + self.set_config_override(::std::option::Option::Some(config_override.into())); + self + } + + pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option) -> &mut Self { + self.config_override = config_override; + self + } + ///

The name of a logical container where backups are stored. Backup vaults are identified by names that are unique to the account used to create them and the Region where they are created.

+ ///

Accepted characters include lowercase letters, numbers, and hyphens.

+ pub fn backup_vault_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.inner = self.inner.backup_vault_name(input.into()); + self + } + ///

The name of a logical container where backups are stored. Backup vaults are identified by names that are unique to the account used to create them and the Region where they are created.

+ ///

Accepted characters include lowercase letters, numbers, and hyphens.

+ pub fn set_backup_vault_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.inner = self.inner.set_backup_vault_name(input); + self + } + ///

The name of a logical container where backups are stored. Backup vaults are identified by names that are unique to the account used to create them and the Region where they are created.

+ ///

Accepted characters include lowercase letters, numbers, and hyphens.

+ pub fn get_backup_vault_name(&self) -> &::std::option::Option<::std::string::String> { + self.inner.get_backup_vault_name() + } + ///

An ARN that uniquely identifies a recovery point; for example, arn:aws:backup:us-east-1:123456789012:recovery-point:1EB3B5E7-9EB0-435A-A80B-108B488B0D45.

+ pub fn recovery_point_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.inner = self.inner.recovery_point_arn(input.into()); + self + } + ///

An ARN that uniquely identifies a recovery point; for example, arn:aws:backup:us-east-1:123456789012:recovery-point:1EB3B5E7-9EB0-435A-A80B-108B488B0D45.

+ pub fn set_recovery_point_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.inner = self.inner.set_recovery_point_arn(input); + self + } + ///

An ARN that uniquely identifies a recovery point; for example, arn:aws:backup:us-east-1:123456789012:recovery-point:1EB3B5E7-9EB0-435A-A80B-108B488B0D45.

+ pub fn get_recovery_point_arn(&self) -> &::std::option::Option<::std::string::String> { + self.inner.get_recovery_point_arn() + } +} diff --git a/sdk/backup/src/operation/list_indexed_recovery_points.rs b/sdk/backup/src/operation/list_indexed_recovery_points.rs new file mode 100644 index 000000000000..502c79fc4c4b --- /dev/null +++ b/sdk/backup/src/operation/list_indexed_recovery_points.rs @@ -0,0 +1,422 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +/// Orchestration and serialization glue logic for `ListIndexedRecoveryPoints`. +#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)] +#[non_exhaustive] +pub struct ListIndexedRecoveryPoints; +impl ListIndexedRecoveryPoints { + /// Creates a new `ListIndexedRecoveryPoints` + pub fn new() -> Self { + Self + } + pub(crate) async fn orchestrate( + runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, + input: crate::operation::list_indexed_recovery_points::ListIndexedRecoveryPointsInput, + ) -> ::std::result::Result< + crate::operation::list_indexed_recovery_points::ListIndexedRecoveryPointsOutput, + ::aws_smithy_runtime_api::client::result::SdkError< + crate::operation::list_indexed_recovery_points::ListIndexedRecoveryPointsError, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >, + > { + let map_err = |err: ::aws_smithy_runtime_api::client::result::SdkError< + ::aws_smithy_runtime_api::client::interceptors::context::Error, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >| { + err.map_service_error(|err| { + err.downcast::() + .expect("correct error type") + }) + }; + let context = Self::orchestrate_with_stop_point(runtime_plugins, input, ::aws_smithy_runtime::client::orchestrator::StopPoint::None) + .await + .map_err(map_err)?; + let output = context.finalize().map_err(map_err)?; + ::std::result::Result::Ok( + output + .downcast::() + .expect("correct output type"), + ) + } + + pub(crate) async fn orchestrate_with_stop_point( + runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, + input: crate::operation::list_indexed_recovery_points::ListIndexedRecoveryPointsInput, + stop_point: ::aws_smithy_runtime::client::orchestrator::StopPoint, + ) -> ::std::result::Result< + ::aws_smithy_runtime_api::client::interceptors::context::InterceptorContext, + ::aws_smithy_runtime_api::client::result::SdkError< + ::aws_smithy_runtime_api::client::interceptors::context::Error, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >, + > { + let input = ::aws_smithy_runtime_api::client::interceptors::context::Input::erase(input); + ::aws_smithy_runtime::client::orchestrator::invoke_with_stop_point("backup", "ListIndexedRecoveryPoints", input, runtime_plugins, stop_point) + .await + } + + pub(crate) fn operation_runtime_plugins( + client_runtime_plugins: ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, + client_config: &crate::config::Config, + config_override: ::std::option::Option, + ) -> ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins { + let mut runtime_plugins = client_runtime_plugins.with_operation_plugin(Self::new()); + runtime_plugins = runtime_plugins.with_client_plugin(crate::auth_plugin::DefaultAuthOptionsPlugin::new(vec![ + ::aws_runtime::auth::sigv4::SCHEME_ID, + ])); + if let ::std::option::Option::Some(config_override) = config_override { + for plugin in config_override.runtime_plugins.iter().cloned() { + runtime_plugins = runtime_plugins.with_operation_plugin(plugin); + } + runtime_plugins = runtime_plugins.with_operation_plugin(crate::config::ConfigOverrideRuntimePlugin::new( + config_override, + client_config.config.clone(), + &client_config.runtime_components, + )); + } + runtime_plugins + } +} +impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for ListIndexedRecoveryPoints { + fn config(&self) -> ::std::option::Option<::aws_smithy_types::config_bag::FrozenLayer> { + let mut cfg = ::aws_smithy_types::config_bag::Layer::new("ListIndexedRecoveryPoints"); + + cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new( + ListIndexedRecoveryPointsRequestSerializer, + )); + cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new( + ListIndexedRecoveryPointsResponseDeserializer, + )); + + cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new( + ::aws_smithy_runtime_api::client::auth::static_resolver::StaticAuthSchemeOptionResolverParams::new(), + )); + + cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::Metadata::new( + "ListIndexedRecoveryPoints", + "backup", + )); + let mut signing_options = ::aws_runtime::auth::SigningOptions::default(); + signing_options.double_uri_encode = true; + signing_options.content_sha256_header = false; + signing_options.normalize_uri_path = true; + signing_options.payload_override = None; + + cfg.store_put(::aws_runtime::auth::SigV4OperationSigningConfig { + signing_options, + ..::std::default::Default::default() + }); + + ::std::option::Option::Some(cfg.freeze()) + } + + fn runtime_components( + &self, + _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder, + ) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> { + #[allow(unused_mut)] + let mut rcb = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("ListIndexedRecoveryPoints") + .with_interceptor(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default()) + .with_interceptor(ListIndexedRecoveryPointsEndpointParamsInterceptor) + .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::< + crate::operation::list_indexed_recovery_points::ListIndexedRecoveryPointsError, + >::new()) + .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::< + crate::operation::list_indexed_recovery_points::ListIndexedRecoveryPointsError, + >::new()) + .with_retry_classifier(::aws_runtime::retries::classifiers::AwsErrorCodeClassifier::< + crate::operation::list_indexed_recovery_points::ListIndexedRecoveryPointsError, + >::new()); + + ::std::borrow::Cow::Owned(rcb) + } +} + +#[derive(Debug)] +struct ListIndexedRecoveryPointsResponseDeserializer; +impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for ListIndexedRecoveryPointsResponseDeserializer { + fn deserialize_nonstreaming( + &self, + response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError { + let (success, status) = (response.status().is_success(), response.status().as_u16()); + let headers = response.headers(); + let body = response.body().bytes().expect("body loaded"); + #[allow(unused_mut)] + let mut force_error = false; + ::tracing::debug!(request_id = ?::aws_types::request_id::RequestId::request_id(response)); + let parse_result = if !success && status != 200 || force_error { + crate::protocol_serde::shape_list_indexed_recovery_points::de_list_indexed_recovery_points_http_error(status, headers, body) + } else { + crate::protocol_serde::shape_list_indexed_recovery_points::de_list_indexed_recovery_points_http_response(status, headers, body) + }; + crate::protocol_serde::type_erase_result(parse_result) + } +} +#[derive(Debug)] +struct ListIndexedRecoveryPointsRequestSerializer; +impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for ListIndexedRecoveryPointsRequestSerializer { + #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)] + fn serialize_input( + &self, + input: ::aws_smithy_runtime_api::client::interceptors::context::Input, + _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag, + ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> { + let input = input + .downcast::() + .expect("correct type"); + let _header_serialization_settings = _cfg + .load::() + .cloned() + .unwrap_or_default(); + let mut request_builder = { + fn uri_base( + _input: &crate::operation::list_indexed_recovery_points::ListIndexedRecoveryPointsInput, + output: &mut ::std::string::String, + ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> { + use ::std::fmt::Write as _; + ::std::write!(output, "/indexes/recovery-point").expect("formatting should succeed"); + ::std::result::Result::Ok(()) + } + fn uri_query( + _input: &crate::operation::list_indexed_recovery_points::ListIndexedRecoveryPointsInput, + mut output: &mut ::std::string::String, + ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> { + let mut query = ::aws_smithy_http::query::Writer::new(output); + if let ::std::option::Option::Some(inner_1) = &_input.next_token { + { + query.push_kv("nextToken", &::aws_smithy_http::query::fmt_string(inner_1)); + } + } + if let ::std::option::Option::Some(inner_2) = &_input.max_results { + { + query.push_kv("maxResults", ::aws_smithy_types::primitive::Encoder::from(*inner_2).encode()); + } + } + if let ::std::option::Option::Some(inner_3) = &_input.source_resource_arn { + { + query.push_kv("sourceResourceArn", &::aws_smithy_http::query::fmt_string(inner_3)); + } + } + if let ::std::option::Option::Some(inner_4) = &_input.created_before { + { + query.push_kv( + "createdBefore", + &::aws_smithy_http::query::fmt_timestamp(inner_4, ::aws_smithy_types::date_time::Format::DateTime)?, + ); + } + } + if let ::std::option::Option::Some(inner_5) = &_input.created_after { + { + query.push_kv( + "createdAfter", + &::aws_smithy_http::query::fmt_timestamp(inner_5, ::aws_smithy_types::date_time::Format::DateTime)?, + ); + } + } + if let ::std::option::Option::Some(inner_6) = &_input.resource_type { + { + query.push_kv("resourceType", &::aws_smithy_http::query::fmt_string(inner_6)); + } + } + if let ::std::option::Option::Some(inner_7) = &_input.index_status { + { + query.push_kv("indexStatus", &::aws_smithy_http::query::fmt_string(inner_7)); + } + } + ::std::result::Result::Ok(()) + } + #[allow(clippy::unnecessary_wraps)] + fn update_http_builder( + input: &crate::operation::list_indexed_recovery_points::ListIndexedRecoveryPointsInput, + builder: ::http::request::Builder, + ) -> ::std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> { + let mut uri = ::std::string::String::new(); + uri_base(input, &mut uri)?; + uri_query(input, &mut uri)?; + ::std::result::Result::Ok(builder.method("GET").uri(uri)) + } + let mut builder = update_http_builder(&input, ::http::request::Builder::new())?; + builder + }; + let body = ::aws_smithy_types::body::SdkBody::from(""); + + ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap()) + } +} +#[derive(Debug)] +struct ListIndexedRecoveryPointsEndpointParamsInterceptor; + +impl ::aws_smithy_runtime_api::client::interceptors::Intercept for ListIndexedRecoveryPointsEndpointParamsInterceptor { + fn name(&self) -> &'static str { + "ListIndexedRecoveryPointsEndpointParamsInterceptor" + } + + fn read_before_execution( + &self, + context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef< + '_, + ::aws_smithy_runtime_api::client::interceptors::context::Input, + ::aws_smithy_runtime_api::client::interceptors::context::Output, + ::aws_smithy_runtime_api::client::interceptors::context::Error, + >, + cfg: &mut ::aws_smithy_types::config_bag::ConfigBag, + ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> { + let _input = context + .input() + .downcast_ref::() + .ok_or("failed to downcast to ListIndexedRecoveryPointsInput")?; + + let params = crate::config::endpoint::Params::builder() + .set_region(cfg.load::<::aws_types::region::Region>().map(|r| r.as_ref().to_owned())) + .set_use_dual_stack(cfg.load::<::aws_types::endpoint_config::UseDualStack>().map(|ty| ty.0)) + .set_use_fips(cfg.load::<::aws_types::endpoint_config::UseFips>().map(|ty| ty.0)) + .set_endpoint(cfg.load::<::aws_types::endpoint_config::EndpointUrl>().map(|ty| ty.0.clone())) + .build() + .map_err(|err| { + ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err) + })?; + cfg.interceptor_state() + .store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params)); + ::std::result::Result::Ok(()) + } +} + +// The get_* functions below are generated from JMESPath expressions in the +// operationContextParams trait. They target the operation's input shape. + +/// Error type for the `ListIndexedRecoveryPointsError` operation. +#[non_exhaustive] +#[derive(::std::fmt::Debug)] +pub enum ListIndexedRecoveryPointsError { + ///

Indicates that something is wrong with a parameter's value. For example, the value is out of range.

+ InvalidParameterValueException(crate::types::error::InvalidParameterValueException), + ///

A resource that is required for the action doesn't exist.

+ ResourceNotFoundException(crate::types::error::ResourceNotFoundException), + ///

The request failed due to a temporary failure of the server.

+ ServiceUnavailableException(crate::types::error::ServiceUnavailableException), + /// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code). + #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \ + variable wildcard pattern and check `.code()`: + \ +    `err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }` + \ + See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-ListIndexedRecoveryPointsError) for what information is available for the error.")] + Unhandled(crate::error::sealed_unhandled::Unhandled), +} +impl ListIndexedRecoveryPointsError { + /// Creates the `ListIndexedRecoveryPointsError::Unhandled` variant from any error type. + pub fn unhandled( + err: impl ::std::convert::Into<::std::boxed::Box>, + ) -> Self { + Self::Unhandled(crate::error::sealed_unhandled::Unhandled { + source: err.into(), + meta: ::std::default::Default::default(), + }) + } + + /// Creates the `ListIndexedRecoveryPointsError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata). + pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self { + Self::Unhandled(crate::error::sealed_unhandled::Unhandled { + source: err.clone().into(), + meta: err, + }) + } + /// + /// Returns error metadata, which includes the error code, message, + /// request ID, and potentially additional information. + /// + pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata { + match self { + Self::InvalidParameterValueException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), + Self::ResourceNotFoundException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), + Self::ServiceUnavailableException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), + Self::Unhandled(e) => &e.meta, + } + } + /// Returns `true` if the error kind is `ListIndexedRecoveryPointsError::InvalidParameterValueException`. + pub fn is_invalid_parameter_value_exception(&self) -> bool { + matches!(self, Self::InvalidParameterValueException(_)) + } + /// Returns `true` if the error kind is `ListIndexedRecoveryPointsError::ResourceNotFoundException`. + pub fn is_resource_not_found_exception(&self) -> bool { + matches!(self, Self::ResourceNotFoundException(_)) + } + /// Returns `true` if the error kind is `ListIndexedRecoveryPointsError::ServiceUnavailableException`. + pub fn is_service_unavailable_exception(&self) -> bool { + matches!(self, Self::ServiceUnavailableException(_)) + } +} +impl ::std::error::Error for ListIndexedRecoveryPointsError { + fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> { + match self { + Self::InvalidParameterValueException(_inner) => ::std::option::Option::Some(_inner), + Self::ResourceNotFoundException(_inner) => ::std::option::Option::Some(_inner), + Self::ServiceUnavailableException(_inner) => ::std::option::Option::Some(_inner), + Self::Unhandled(_inner) => ::std::option::Option::Some(&*_inner.source), + } + } +} +impl ::std::fmt::Display for ListIndexedRecoveryPointsError { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + match self { + Self::InvalidParameterValueException(_inner) => _inner.fmt(f), + Self::ResourceNotFoundException(_inner) => _inner.fmt(f), + Self::ServiceUnavailableException(_inner) => _inner.fmt(f), + Self::Unhandled(_inner) => { + if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) { + write!(f, "unhandled error ({code})") + } else { + f.write_str("unhandled error") + } + } + } + } +} +impl ::aws_smithy_types::retry::ProvideErrorKind for ListIndexedRecoveryPointsError { + fn code(&self) -> ::std::option::Option<&str> { + ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) + } + fn retryable_error_kind(&self) -> ::std::option::Option<::aws_smithy_types::retry::ErrorKind> { + ::std::option::Option::None + } +} +impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for ListIndexedRecoveryPointsError { + fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata { + match self { + Self::InvalidParameterValueException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner), + Self::ResourceNotFoundException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner), + Self::ServiceUnavailableException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner), + Self::Unhandled(_inner) => &_inner.meta, + } + } +} +impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for ListIndexedRecoveryPointsError { + fn create_unhandled_error( + source: ::std::boxed::Box, + meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>, + ) -> Self { + Self::Unhandled(crate::error::sealed_unhandled::Unhandled { + source, + meta: meta.unwrap_or_default(), + }) + } +} +impl ::aws_types::request_id::RequestId for crate::operation::list_indexed_recovery_points::ListIndexedRecoveryPointsError { + fn request_id(&self) -> Option<&str> { + self.meta().request_id() + } +} + +pub use crate::operation::list_indexed_recovery_points::_list_indexed_recovery_points_output::ListIndexedRecoveryPointsOutput; + +pub use crate::operation::list_indexed_recovery_points::_list_indexed_recovery_points_input::ListIndexedRecoveryPointsInput; + +mod _list_indexed_recovery_points_input; + +mod _list_indexed_recovery_points_output; + +/// Builders +pub mod builders; + +/// Paginator for this operation +pub mod paginator; diff --git a/sdk/backup/src/operation/list_indexed_recovery_points/_list_indexed_recovery_points_input.rs b/sdk/backup/src/operation/list_indexed_recovery_points/_list_indexed_recovery_points_input.rs new file mode 100644 index 000000000000..9fc7e0df55aa --- /dev/null +++ b/sdk/backup/src/operation/list_indexed_recovery_points/_list_indexed_recovery_points_input.rs @@ -0,0 +1,236 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +#[allow(missing_docs)] // documentation missing in model +#[non_exhaustive] +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)] +pub struct ListIndexedRecoveryPointsInput { + ///

The next item following a partial list of returned recovery points.

+ ///

For example, if a request is made to return MaxResults number of indexed recovery points, NextToken allows you to return more items in your list starting at the location pointed to by the next token.

+ pub next_token: ::std::option::Option<::std::string::String>, + ///

The maximum number of resource list items to be returned.

+ pub max_results: ::std::option::Option, + ///

A string of the Amazon Resource Name (ARN) that uniquely identifies the source resource.

+ pub source_resource_arn: ::std::option::Option<::std::string::String>, + ///

Returns only indexed recovery points that were created before the specified date.

+ pub created_before: ::std::option::Option<::aws_smithy_types::DateTime>, + ///

Returns only indexed recovery points that were created after the specified date.

+ pub created_after: ::std::option::Option<::aws_smithy_types::DateTime>, + ///

Returns a list of indexed recovery points for the specified resource type(s).

+ ///

Accepted values include:

+ ///
    + ///
  • + ///

    EBS for Amazon Elastic Block Store

  • + ///
  • + ///

    S3 for Amazon Simple Storage Service (Amazon S3)

  • + ///
+ pub resource_type: ::std::option::Option<::std::string::String>, + ///

Include this parameter to filter the returned list by the indicated statuses.

+ ///

Accepted values: PENDING | ACTIVE | FAILED | DELETING

+ ///

A recovery point with an index that has the status of ACTIVE can be included in a search.

+ pub index_status: ::std::option::Option, +} +impl ListIndexedRecoveryPointsInput { + ///

The next item following a partial list of returned recovery points.

+ ///

For example, if a request is made to return MaxResults number of indexed recovery points, NextToken allows you to return more items in your list starting at the location pointed to by the next token.

+ pub fn next_token(&self) -> ::std::option::Option<&str> { + self.next_token.as_deref() + } + ///

The maximum number of resource list items to be returned.

+ pub fn max_results(&self) -> ::std::option::Option { + self.max_results + } + ///

A string of the Amazon Resource Name (ARN) that uniquely identifies the source resource.

+ pub fn source_resource_arn(&self) -> ::std::option::Option<&str> { + self.source_resource_arn.as_deref() + } + ///

Returns only indexed recovery points that were created before the specified date.

+ pub fn created_before(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> { + self.created_before.as_ref() + } + ///

Returns only indexed recovery points that were created after the specified date.

+ pub fn created_after(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> { + self.created_after.as_ref() + } + ///

Returns a list of indexed recovery points for the specified resource type(s).

+ ///

Accepted values include:

+ ///
    + ///
  • + ///

    EBS for Amazon Elastic Block Store

  • + ///
  • + ///

    S3 for Amazon Simple Storage Service (Amazon S3)

  • + ///
+ pub fn resource_type(&self) -> ::std::option::Option<&str> { + self.resource_type.as_deref() + } + ///

Include this parameter to filter the returned list by the indicated statuses.

+ ///

Accepted values: PENDING | ACTIVE | FAILED | DELETING

+ ///

A recovery point with an index that has the status of ACTIVE can be included in a search.

+ pub fn index_status(&self) -> ::std::option::Option<&crate::types::IndexStatus> { + self.index_status.as_ref() + } +} +impl ListIndexedRecoveryPointsInput { + /// Creates a new builder-style object to manufacture [`ListIndexedRecoveryPointsInput`](crate::operation::list_indexed_recovery_points::ListIndexedRecoveryPointsInput). + pub fn builder() -> crate::operation::list_indexed_recovery_points::builders::ListIndexedRecoveryPointsInputBuilder { + crate::operation::list_indexed_recovery_points::builders::ListIndexedRecoveryPointsInputBuilder::default() + } +} + +/// A builder for [`ListIndexedRecoveryPointsInput`](crate::operation::list_indexed_recovery_points::ListIndexedRecoveryPointsInput). +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)] +#[non_exhaustive] +pub struct ListIndexedRecoveryPointsInputBuilder { + pub(crate) next_token: ::std::option::Option<::std::string::String>, + pub(crate) max_results: ::std::option::Option, + pub(crate) source_resource_arn: ::std::option::Option<::std::string::String>, + pub(crate) created_before: ::std::option::Option<::aws_smithy_types::DateTime>, + pub(crate) created_after: ::std::option::Option<::aws_smithy_types::DateTime>, + pub(crate) resource_type: ::std::option::Option<::std::string::String>, + pub(crate) index_status: ::std::option::Option, +} +impl ListIndexedRecoveryPointsInputBuilder { + ///

The next item following a partial list of returned recovery points.

+ ///

For example, if a request is made to return MaxResults number of indexed recovery points, NextToken allows you to return more items in your list starting at the location pointed to by the next token.

+ pub fn next_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.next_token = ::std::option::Option::Some(input.into()); + self + } + ///

The next item following a partial list of returned recovery points.

+ ///

For example, if a request is made to return MaxResults number of indexed recovery points, NextToken allows you to return more items in your list starting at the location pointed to by the next token.

+ pub fn set_next_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.next_token = input; + self + } + ///

The next item following a partial list of returned recovery points.

+ ///

For example, if a request is made to return MaxResults number of indexed recovery points, NextToken allows you to return more items in your list starting at the location pointed to by the next token.

+ pub fn get_next_token(&self) -> &::std::option::Option<::std::string::String> { + &self.next_token + } + ///

The maximum number of resource list items to be returned.

+ pub fn max_results(mut self, input: i32) -> Self { + self.max_results = ::std::option::Option::Some(input); + self + } + ///

The maximum number of resource list items to be returned.

+ pub fn set_max_results(mut self, input: ::std::option::Option) -> Self { + self.max_results = input; + self + } + ///

The maximum number of resource list items to be returned.

+ pub fn get_max_results(&self) -> &::std::option::Option { + &self.max_results + } + ///

A string of the Amazon Resource Name (ARN) that uniquely identifies the source resource.

+ pub fn source_resource_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.source_resource_arn = ::std::option::Option::Some(input.into()); + self + } + ///

A string of the Amazon Resource Name (ARN) that uniquely identifies the source resource.

+ pub fn set_source_resource_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.source_resource_arn = input; + self + } + ///

A string of the Amazon Resource Name (ARN) that uniquely identifies the source resource.

+ pub fn get_source_resource_arn(&self) -> &::std::option::Option<::std::string::String> { + &self.source_resource_arn + } + ///

Returns only indexed recovery points that were created before the specified date.

+ pub fn created_before(mut self, input: ::aws_smithy_types::DateTime) -> Self { + self.created_before = ::std::option::Option::Some(input); + self + } + ///

Returns only indexed recovery points that were created before the specified date.

+ pub fn set_created_before(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self { + self.created_before = input; + self + } + ///

Returns only indexed recovery points that were created before the specified date.

+ pub fn get_created_before(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> { + &self.created_before + } + ///

Returns only indexed recovery points that were created after the specified date.

+ pub fn created_after(mut self, input: ::aws_smithy_types::DateTime) -> Self { + self.created_after = ::std::option::Option::Some(input); + self + } + ///

Returns only indexed recovery points that were created after the specified date.

+ pub fn set_created_after(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self { + self.created_after = input; + self + } + ///

Returns only indexed recovery points that were created after the specified date.

+ pub fn get_created_after(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> { + &self.created_after + } + ///

Returns a list of indexed recovery points for the specified resource type(s).

+ ///

Accepted values include:

+ ///
    + ///
  • + ///

    EBS for Amazon Elastic Block Store

  • + ///
  • + ///

    S3 for Amazon Simple Storage Service (Amazon S3)

  • + ///
+ pub fn resource_type(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.resource_type = ::std::option::Option::Some(input.into()); + self + } + ///

Returns a list of indexed recovery points for the specified resource type(s).

+ ///

Accepted values include:

+ ///
    + ///
  • + ///

    EBS for Amazon Elastic Block Store

  • + ///
  • + ///

    S3 for Amazon Simple Storage Service (Amazon S3)

  • + ///
+ pub fn set_resource_type(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.resource_type = input; + self + } + ///

Returns a list of indexed recovery points for the specified resource type(s).

+ ///

Accepted values include:

+ ///
    + ///
  • + ///

    EBS for Amazon Elastic Block Store

  • + ///
  • + ///

    S3 for Amazon Simple Storage Service (Amazon S3)

  • + ///
+ pub fn get_resource_type(&self) -> &::std::option::Option<::std::string::String> { + &self.resource_type + } + ///

Include this parameter to filter the returned list by the indicated statuses.

+ ///

Accepted values: PENDING | ACTIVE | FAILED | DELETING

+ ///

A recovery point with an index that has the status of ACTIVE can be included in a search.

+ pub fn index_status(mut self, input: crate::types::IndexStatus) -> Self { + self.index_status = ::std::option::Option::Some(input); + self + } + ///

Include this parameter to filter the returned list by the indicated statuses.

+ ///

Accepted values: PENDING | ACTIVE | FAILED | DELETING

+ ///

A recovery point with an index that has the status of ACTIVE can be included in a search.

+ pub fn set_index_status(mut self, input: ::std::option::Option) -> Self { + self.index_status = input; + self + } + ///

Include this parameter to filter the returned list by the indicated statuses.

+ ///

Accepted values: PENDING | ACTIVE | FAILED | DELETING

+ ///

A recovery point with an index that has the status of ACTIVE can be included in a search.

+ pub fn get_index_status(&self) -> &::std::option::Option { + &self.index_status + } + /// Consumes the builder and constructs a [`ListIndexedRecoveryPointsInput`](crate::operation::list_indexed_recovery_points::ListIndexedRecoveryPointsInput). + pub fn build( + self, + ) -> ::std::result::Result< + crate::operation::list_indexed_recovery_points::ListIndexedRecoveryPointsInput, + ::aws_smithy_types::error::operation::BuildError, + > { + ::std::result::Result::Ok(crate::operation::list_indexed_recovery_points::ListIndexedRecoveryPointsInput { + next_token: self.next_token, + max_results: self.max_results, + source_resource_arn: self.source_resource_arn, + created_before: self.created_before, + created_after: self.created_after, + resource_type: self.resource_type, + index_status: self.index_status, + }) + } +} diff --git a/sdk/backup/src/operation/list_indexed_recovery_points/_list_indexed_recovery_points_output.rs b/sdk/backup/src/operation/list_indexed_recovery_points/_list_indexed_recovery_points_output.rs new file mode 100644 index 000000000000..2ecdd260f00b --- /dev/null +++ b/sdk/backup/src/operation/list_indexed_recovery_points/_list_indexed_recovery_points_output.rs @@ -0,0 +1,101 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +#[allow(missing_docs)] // documentation missing in model +#[non_exhaustive] +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)] +pub struct ListIndexedRecoveryPointsOutput { + ///

This is a list of recovery points that have an associated index, belonging to the specified account.

+ pub indexed_recovery_points: ::std::option::Option<::std::vec::Vec>, + ///

The next item following a partial list of returned recovery points.

+ ///

For example, if a request is made to return MaxResults number of indexed recovery points, NextToken allows you to return more items in your list starting at the location pointed to by the next token.

+ pub next_token: ::std::option::Option<::std::string::String>, + _request_id: Option, +} +impl ListIndexedRecoveryPointsOutput { + ///

This is a list of recovery points that have an associated index, belonging to the specified account.

+ /// + /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.indexed_recovery_points.is_none()`. + pub fn indexed_recovery_points(&self) -> &[crate::types::IndexedRecoveryPoint] { + self.indexed_recovery_points.as_deref().unwrap_or_default() + } + ///

The next item following a partial list of returned recovery points.

+ ///

For example, if a request is made to return MaxResults number of indexed recovery points, NextToken allows you to return more items in your list starting at the location pointed to by the next token.

+ pub fn next_token(&self) -> ::std::option::Option<&str> { + self.next_token.as_deref() + } +} +impl ::aws_types::request_id::RequestId for ListIndexedRecoveryPointsOutput { + fn request_id(&self) -> Option<&str> { + self._request_id.as_deref() + } +} +impl ListIndexedRecoveryPointsOutput { + /// Creates a new builder-style object to manufacture [`ListIndexedRecoveryPointsOutput`](crate::operation::list_indexed_recovery_points::ListIndexedRecoveryPointsOutput). + pub fn builder() -> crate::operation::list_indexed_recovery_points::builders::ListIndexedRecoveryPointsOutputBuilder { + crate::operation::list_indexed_recovery_points::builders::ListIndexedRecoveryPointsOutputBuilder::default() + } +} + +/// A builder for [`ListIndexedRecoveryPointsOutput`](crate::operation::list_indexed_recovery_points::ListIndexedRecoveryPointsOutput). +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)] +#[non_exhaustive] +pub struct ListIndexedRecoveryPointsOutputBuilder { + pub(crate) indexed_recovery_points: ::std::option::Option<::std::vec::Vec>, + pub(crate) next_token: ::std::option::Option<::std::string::String>, + _request_id: Option, +} +impl ListIndexedRecoveryPointsOutputBuilder { + /// Appends an item to `indexed_recovery_points`. + /// + /// To override the contents of this collection use [`set_indexed_recovery_points`](Self::set_indexed_recovery_points). + /// + ///

This is a list of recovery points that have an associated index, belonging to the specified account.

+ pub fn indexed_recovery_points(mut self, input: crate::types::IndexedRecoveryPoint) -> Self { + let mut v = self.indexed_recovery_points.unwrap_or_default(); + v.push(input); + self.indexed_recovery_points = ::std::option::Option::Some(v); + self + } + ///

This is a list of recovery points that have an associated index, belonging to the specified account.

+ pub fn set_indexed_recovery_points(mut self, input: ::std::option::Option<::std::vec::Vec>) -> Self { + self.indexed_recovery_points = input; + self + } + ///

This is a list of recovery points that have an associated index, belonging to the specified account.

+ pub fn get_indexed_recovery_points(&self) -> &::std::option::Option<::std::vec::Vec> { + &self.indexed_recovery_points + } + ///

The next item following a partial list of returned recovery points.

+ ///

For example, if a request is made to return MaxResults number of indexed recovery points, NextToken allows you to return more items in your list starting at the location pointed to by the next token.

+ pub fn next_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.next_token = ::std::option::Option::Some(input.into()); + self + } + ///

The next item following a partial list of returned recovery points.

+ ///

For example, if a request is made to return MaxResults number of indexed recovery points, NextToken allows you to return more items in your list starting at the location pointed to by the next token.

+ pub fn set_next_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.next_token = input; + self + } + ///

The next item following a partial list of returned recovery points.

+ ///

For example, if a request is made to return MaxResults number of indexed recovery points, NextToken allows you to return more items in your list starting at the location pointed to by the next token.

+ pub fn get_next_token(&self) -> &::std::option::Option<::std::string::String> { + &self.next_token + } + pub(crate) fn _request_id(mut self, request_id: impl Into) -> Self { + self._request_id = Some(request_id.into()); + self + } + + pub(crate) fn _set_request_id(&mut self, request_id: Option) -> &mut Self { + self._request_id = request_id; + self + } + /// Consumes the builder and constructs a [`ListIndexedRecoveryPointsOutput`](crate::operation::list_indexed_recovery_points::ListIndexedRecoveryPointsOutput). + pub fn build(self) -> crate::operation::list_indexed_recovery_points::ListIndexedRecoveryPointsOutput { + crate::operation::list_indexed_recovery_points::ListIndexedRecoveryPointsOutput { + indexed_recovery_points: self.indexed_recovery_points, + next_token: self.next_token, + _request_id: self._request_id, + } + } +} diff --git a/sdk/backup/src/operation/list_indexed_recovery_points/builders.rs b/sdk/backup/src/operation/list_indexed_recovery_points/builders.rs new file mode 100644 index 000000000000..c92fb6ac0a46 --- /dev/null +++ b/sdk/backup/src/operation/list_indexed_recovery_points/builders.rs @@ -0,0 +1,246 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +pub use crate::operation::list_indexed_recovery_points::_list_indexed_recovery_points_output::ListIndexedRecoveryPointsOutputBuilder; + +pub use crate::operation::list_indexed_recovery_points::_list_indexed_recovery_points_input::ListIndexedRecoveryPointsInputBuilder; + +impl crate::operation::list_indexed_recovery_points::builders::ListIndexedRecoveryPointsInputBuilder { + /// Sends a request with this input using the given client. + pub async fn send_with( + self, + client: &crate::Client, + ) -> ::std::result::Result< + crate::operation::list_indexed_recovery_points::ListIndexedRecoveryPointsOutput, + ::aws_smithy_runtime_api::client::result::SdkError< + crate::operation::list_indexed_recovery_points::ListIndexedRecoveryPointsError, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >, + > { + let mut fluent_builder = client.list_indexed_recovery_points(); + fluent_builder.inner = self; + fluent_builder.send().await + } +} +/// Fluent builder constructing a request to `ListIndexedRecoveryPoints`. +/// +///

This operation returns a list of recovery points that have an associated index, belonging to the specified account.

+///

Optional parameters you can include are: MaxResults; NextToken; SourceResourceArns; CreatedBefore; CreatedAfter; and ResourceType.

+#[derive(::std::clone::Clone, ::std::fmt::Debug)] +pub struct ListIndexedRecoveryPointsFluentBuilder { + handle: ::std::sync::Arc, + inner: crate::operation::list_indexed_recovery_points::builders::ListIndexedRecoveryPointsInputBuilder, + config_override: ::std::option::Option, +} +impl + crate::client::customize::internal::CustomizableSend< + crate::operation::list_indexed_recovery_points::ListIndexedRecoveryPointsOutput, + crate::operation::list_indexed_recovery_points::ListIndexedRecoveryPointsError, + > for ListIndexedRecoveryPointsFluentBuilder +{ + fn send( + self, + config_override: crate::config::Builder, + ) -> crate::client::customize::internal::BoxFuture< + crate::client::customize::internal::SendResult< + crate::operation::list_indexed_recovery_points::ListIndexedRecoveryPointsOutput, + crate::operation::list_indexed_recovery_points::ListIndexedRecoveryPointsError, + >, + > { + ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await }) + } +} +impl ListIndexedRecoveryPointsFluentBuilder { + /// Creates a new `ListIndexedRecoveryPointsFluentBuilder`. + pub(crate) fn new(handle: ::std::sync::Arc) -> Self { + Self { + handle, + inner: ::std::default::Default::default(), + config_override: ::std::option::Option::None, + } + } + /// Access the ListIndexedRecoveryPoints as a reference. + pub fn as_input(&self) -> &crate::operation::list_indexed_recovery_points::builders::ListIndexedRecoveryPointsInputBuilder { + &self.inner + } + /// Sends the request and returns the response. + /// + /// If an error occurs, an `SdkError` will be returned with additional details that + /// can be matched against. + /// + /// By default, any retryable failures will be retried twice. Retry behavior + /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be + /// set when configuring the client. + pub async fn send( + self, + ) -> ::std::result::Result< + crate::operation::list_indexed_recovery_points::ListIndexedRecoveryPointsOutput, + ::aws_smithy_runtime_api::client::result::SdkError< + crate::operation::list_indexed_recovery_points::ListIndexedRecoveryPointsError, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >, + > { + let input = self + .inner + .build() + .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?; + let runtime_plugins = crate::operation::list_indexed_recovery_points::ListIndexedRecoveryPoints::operation_runtime_plugins( + self.handle.runtime_plugins.clone(), + &self.handle.conf, + self.config_override, + ); + crate::operation::list_indexed_recovery_points::ListIndexedRecoveryPoints::orchestrate(&runtime_plugins, input).await + } + + /// Consumes this builder, creating a customizable operation that can be modified before being sent. + pub fn customize( + self, + ) -> crate::client::customize::CustomizableOperation< + crate::operation::list_indexed_recovery_points::ListIndexedRecoveryPointsOutput, + crate::operation::list_indexed_recovery_points::ListIndexedRecoveryPointsError, + Self, + > { + crate::client::customize::CustomizableOperation::new(self) + } + pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into) -> Self { + self.set_config_override(::std::option::Option::Some(config_override.into())); + self + } + + pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option) -> &mut Self { + self.config_override = config_override; + self + } + /// Create a paginator for this request + /// + /// Paginators are used by calling [`send().await`](crate::operation::list_indexed_recovery_points::paginator::ListIndexedRecoveryPointsPaginator::send) which returns a [`PaginationStream`](aws_smithy_async::future::pagination_stream::PaginationStream). + pub fn into_paginator(self) -> crate::operation::list_indexed_recovery_points::paginator::ListIndexedRecoveryPointsPaginator { + crate::operation::list_indexed_recovery_points::paginator::ListIndexedRecoveryPointsPaginator::new(self.handle, self.inner) + } + ///

The next item following a partial list of returned recovery points.

+ ///

For example, if a request is made to return MaxResults number of indexed recovery points, NextToken allows you to return more items in your list starting at the location pointed to by the next token.

+ pub fn next_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.inner = self.inner.next_token(input.into()); + self + } + ///

The next item following a partial list of returned recovery points.

+ ///

For example, if a request is made to return MaxResults number of indexed recovery points, NextToken allows you to return more items in your list starting at the location pointed to by the next token.

+ pub fn set_next_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.inner = self.inner.set_next_token(input); + self + } + ///

The next item following a partial list of returned recovery points.

+ ///

For example, if a request is made to return MaxResults number of indexed recovery points, NextToken allows you to return more items in your list starting at the location pointed to by the next token.

+ pub fn get_next_token(&self) -> &::std::option::Option<::std::string::String> { + self.inner.get_next_token() + } + ///

The maximum number of resource list items to be returned.

+ pub fn max_results(mut self, input: i32) -> Self { + self.inner = self.inner.max_results(input); + self + } + ///

The maximum number of resource list items to be returned.

+ pub fn set_max_results(mut self, input: ::std::option::Option) -> Self { + self.inner = self.inner.set_max_results(input); + self + } + ///

The maximum number of resource list items to be returned.

+ pub fn get_max_results(&self) -> &::std::option::Option { + self.inner.get_max_results() + } + ///

A string of the Amazon Resource Name (ARN) that uniquely identifies the source resource.

+ pub fn source_resource_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.inner = self.inner.source_resource_arn(input.into()); + self + } + ///

A string of the Amazon Resource Name (ARN) that uniquely identifies the source resource.

+ pub fn set_source_resource_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.inner = self.inner.set_source_resource_arn(input); + self + } + ///

A string of the Amazon Resource Name (ARN) that uniquely identifies the source resource.

+ pub fn get_source_resource_arn(&self) -> &::std::option::Option<::std::string::String> { + self.inner.get_source_resource_arn() + } + ///

Returns only indexed recovery points that were created before the specified date.

+ pub fn created_before(mut self, input: ::aws_smithy_types::DateTime) -> Self { + self.inner = self.inner.created_before(input); + self + } + ///

Returns only indexed recovery points that were created before the specified date.

+ pub fn set_created_before(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self { + self.inner = self.inner.set_created_before(input); + self + } + ///

Returns only indexed recovery points that were created before the specified date.

+ pub fn get_created_before(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> { + self.inner.get_created_before() + } + ///

Returns only indexed recovery points that were created after the specified date.

+ pub fn created_after(mut self, input: ::aws_smithy_types::DateTime) -> Self { + self.inner = self.inner.created_after(input); + self + } + ///

Returns only indexed recovery points that were created after the specified date.

+ pub fn set_created_after(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self { + self.inner = self.inner.set_created_after(input); + self + } + ///

Returns only indexed recovery points that were created after the specified date.

+ pub fn get_created_after(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> { + self.inner.get_created_after() + } + ///

Returns a list of indexed recovery points for the specified resource type(s).

+ ///

Accepted values include:

+ ///
    + ///
  • + ///

    EBS for Amazon Elastic Block Store

  • + ///
  • + ///

    S3 for Amazon Simple Storage Service (Amazon S3)

  • + ///
+ pub fn resource_type(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.inner = self.inner.resource_type(input.into()); + self + } + ///

Returns a list of indexed recovery points for the specified resource type(s).

+ ///

Accepted values include:

+ ///
    + ///
  • + ///

    EBS for Amazon Elastic Block Store

  • + ///
  • + ///

    S3 for Amazon Simple Storage Service (Amazon S3)

  • + ///
+ pub fn set_resource_type(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.inner = self.inner.set_resource_type(input); + self + } + ///

Returns a list of indexed recovery points for the specified resource type(s).

+ ///

Accepted values include:

+ ///
    + ///
  • + ///

    EBS for Amazon Elastic Block Store

  • + ///
  • + ///

    S3 for Amazon Simple Storage Service (Amazon S3)

  • + ///
+ pub fn get_resource_type(&self) -> &::std::option::Option<::std::string::String> { + self.inner.get_resource_type() + } + ///

Include this parameter to filter the returned list by the indicated statuses.

+ ///

Accepted values: PENDING | ACTIVE | FAILED | DELETING

+ ///

A recovery point with an index that has the status of ACTIVE can be included in a search.

+ pub fn index_status(mut self, input: crate::types::IndexStatus) -> Self { + self.inner = self.inner.index_status(input); + self + } + ///

Include this parameter to filter the returned list by the indicated statuses.

+ ///

Accepted values: PENDING | ACTIVE | FAILED | DELETING

+ ///

A recovery point with an index that has the status of ACTIVE can be included in a search.

+ pub fn set_index_status(mut self, input: ::std::option::Option) -> Self { + self.inner = self.inner.set_index_status(input); + self + } + ///

Include this parameter to filter the returned list by the indicated statuses.

+ ///

Accepted values: PENDING | ACTIVE | FAILED | DELETING

+ ///

A recovery point with an index that has the status of ACTIVE can be included in a search.

+ pub fn get_index_status(&self) -> &::std::option::Option { + self.inner.get_index_status() + } +} diff --git a/sdk/backup/src/operation/list_indexed_recovery_points/paginator.rs b/sdk/backup/src/operation/list_indexed_recovery_points/paginator.rs new file mode 100644 index 000000000000..43008cc6b28b --- /dev/null +++ b/sdk/backup/src/operation/list_indexed_recovery_points/paginator.rs @@ -0,0 +1,150 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +/// Paginator for [`ListIndexedRecoveryPoints`](crate::operation::list_indexed_recovery_points::ListIndexedRecoveryPoints) +pub struct ListIndexedRecoveryPointsPaginator { + handle: std::sync::Arc, + builder: crate::operation::list_indexed_recovery_points::builders::ListIndexedRecoveryPointsInputBuilder, + stop_on_duplicate_token: bool, +} + +impl ListIndexedRecoveryPointsPaginator { + /// Create a new paginator-wrapper + pub(crate) fn new( + handle: std::sync::Arc, + builder: crate::operation::list_indexed_recovery_points::builders::ListIndexedRecoveryPointsInputBuilder, + ) -> Self { + Self { + handle, + builder, + stop_on_duplicate_token: true, + } + } + + /// Set the page size + /// + /// _Note: this method will override any previously set value for `max_results`_ + pub fn page_size(mut self, limit: i32) -> Self { + self.builder.max_results = ::std::option::Option::Some(limit); + self + } + + /// Create a flattened paginator + /// + /// This paginator automatically flattens results using `indexed_recovery_points`. Queries to the underlying service + /// are dispatched lazily. + pub fn items(self) -> crate::operation::list_indexed_recovery_points::paginator::ListIndexedRecoveryPointsPaginatorItems { + crate::operation::list_indexed_recovery_points::paginator::ListIndexedRecoveryPointsPaginatorItems(self) + } + + /// Stop paginating when the service returns the same pagination token twice in a row. + /// + /// Defaults to true. + /// + /// For certain operations, it may be useful to continue on duplicate token. For example, + /// if an operation is for tailing a log file in real-time, then continuing may be desired. + /// This option can be set to `false` to accommodate these use cases. + pub fn stop_on_duplicate_token(mut self, stop_on_duplicate_token: bool) -> Self { + self.stop_on_duplicate_token = stop_on_duplicate_token; + self + } + + /// Create the pagination stream + /// + /// _Note:_ No requests will be dispatched until the stream is used + /// (e.g. with the [`.next().await`](aws_smithy_async::future::pagination_stream::PaginationStream::next) method). + pub fn send( + self, + ) -> ::aws_smithy_async::future::pagination_stream::PaginationStream< + ::std::result::Result< + crate::operation::list_indexed_recovery_points::ListIndexedRecoveryPointsOutput, + ::aws_smithy_runtime_api::client::result::SdkError< + crate::operation::list_indexed_recovery_points::ListIndexedRecoveryPointsError, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >, + >, + > { + // Move individual fields out of self for the borrow checker + let builder = self.builder; + let handle = self.handle; + let runtime_plugins = crate::operation::list_indexed_recovery_points::ListIndexedRecoveryPoints::operation_runtime_plugins( + handle.runtime_plugins.clone(), + &handle.conf, + ::std::option::Option::None, + ) + .with_operation_plugin(crate::sdk_feature_tracker::paginator::PaginatorFeatureTrackerRuntimePlugin::new()); + ::aws_smithy_async::future::pagination_stream::PaginationStream::new(::aws_smithy_async::future::pagination_stream::fn_stream::FnStream::new( + move |tx| { + ::std::boxed::Box::pin(async move { + // Build the input for the first time. If required fields are missing, this is where we'll produce an early error. + let mut input = match builder + .build() + .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure) + { + ::std::result::Result::Ok(input) => input, + ::std::result::Result::Err(e) => { + let _ = tx.send(::std::result::Result::Err(e)).await; + return; + } + }; + loop { + let resp = + crate::operation::list_indexed_recovery_points::ListIndexedRecoveryPoints::orchestrate(&runtime_plugins, input.clone()) + .await; + // If the input member is None or it was an error + let done = match resp { + ::std::result::Result::Ok(ref resp) => { + let new_token = crate::lens::reflens_list_indexed_recovery_points_output_output_next_token(resp); + // Pagination is exhausted when the next token is an empty string + let is_empty = new_token.map(|token| token.is_empty()).unwrap_or(true); + if !is_empty && new_token == input.next_token.as_ref() && self.stop_on_duplicate_token { + true + } else { + input.next_token = new_token.cloned(); + is_empty + } + } + ::std::result::Result::Err(_) => true, + }; + if tx.send(resp).await.is_err() { + // receiving end was dropped + return; + } + if done { + return; + } + } + }) + }, + )) + } +} + +/// Flattened paginator for `ListIndexedRecoveryPointsPaginator` +/// +/// This is created with [`.items()`](ListIndexedRecoveryPointsPaginator::items) +pub struct ListIndexedRecoveryPointsPaginatorItems(ListIndexedRecoveryPointsPaginator); + +impl ListIndexedRecoveryPointsPaginatorItems { + /// Create the pagination stream + /// + /// _Note_: No requests will be dispatched until the stream is used + /// (e.g. with the [`.next().await`](aws_smithy_async::future::pagination_stream::PaginationStream::next) method). + /// + /// To read the entirety of the paginator, use [`.collect::, _>()`](aws_smithy_async::future::pagination_stream::PaginationStream::collect). + pub fn send( + self, + ) -> ::aws_smithy_async::future::pagination_stream::PaginationStream< + ::std::result::Result< + crate::types::IndexedRecoveryPoint, + ::aws_smithy_runtime_api::client::result::SdkError< + crate::operation::list_indexed_recovery_points::ListIndexedRecoveryPointsError, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >, + >, + > { + ::aws_smithy_async::future::pagination_stream::TryFlatMap::new(self.0.send()).flat_map(|page| { + crate::lens::lens_list_indexed_recovery_points_output_output_indexed_recovery_points(page) + .unwrap_or_default() + .into_iter() + }) + } +} diff --git a/sdk/backup/src/operation/start_backup_job/_start_backup_job_input.rs b/sdk/backup/src/operation/start_backup_job/_start_backup_job_input.rs index af235cd33054..a59a545ce910 100644 --- a/sdk/backup/src/operation/start_backup_job/_start_backup_job_input.rs +++ b/sdk/backup/src/operation/start_backup_job/_start_backup_job_input.rs @@ -28,6 +28,18 @@ pub struct StartBackupJobInput { ///

The backup option for a selected resource. This option is only available for Windows Volume Shadow Copy Service (VSS) backup jobs.

///

Valid values: Set to "WindowsVSS":"enabled" to enable the WindowsVSS backup option and create a Windows VSS backup. Set to "WindowsVSS""disabled" to create a regular backup. The WindowsVSS option is not enabled by default.

pub backup_options: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>, + ///

Include this parameter to enable index creation if your backup job has a resource type that supports backup indexes.

+ ///

Resource types that support backup indexes include:

+ ///
    + ///
  • + ///

    EBS for Amazon Elastic Block Store

  • + ///
  • + ///

    S3 for Amazon Simple Storage Service (Amazon S3)

  • + ///
+ ///

Index can have 1 of 2 possible values, either ENABLED or DISABLED.

+ ///

To create a backup index for an eligible ACTIVE recovery point that does not yet have a backup index, set value to ENABLED.

+ ///

To delete a backup index, set value to DISABLED.

+ pub index: ::std::option::Option, } impl StartBackupJobInput { ///

The name of a logical container where backups are stored. Backup vaults are identified by names that are unique to the account used to create them and the Amazon Web Services Region where they are created.

@@ -73,6 +85,20 @@ impl StartBackupJobInput { pub fn backup_options(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> { self.backup_options.as_ref() } + ///

Include this parameter to enable index creation if your backup job has a resource type that supports backup indexes.

+ ///

Resource types that support backup indexes include:

+ ///
    + ///
  • + ///

    EBS for Amazon Elastic Block Store

  • + ///
  • + ///

    S3 for Amazon Simple Storage Service (Amazon S3)

  • + ///
+ ///

Index can have 1 of 2 possible values, either ENABLED or DISABLED.

+ ///

To create a backup index for an eligible ACTIVE recovery point that does not yet have a backup index, set value to ENABLED.

+ ///

To delete a backup index, set value to DISABLED.

+ pub fn index(&self) -> ::std::option::Option<&crate::types::Index> { + self.index.as_ref() + } } impl ::std::fmt::Debug for StartBackupJobInput { fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { @@ -86,6 +112,7 @@ impl ::std::fmt::Debug for StartBackupJobInput { formatter.field("lifecycle", &self.lifecycle); formatter.field("recovery_point_tags", &"*** Sensitive Data Redacted ***"); formatter.field("backup_options", &self.backup_options); + formatter.field("index", &self.index); formatter.finish() } } @@ -109,6 +136,7 @@ pub struct StartBackupJobInputBuilder { pub(crate) lifecycle: ::std::option::Option, pub(crate) recovery_point_tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>, pub(crate) backup_options: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>, + pub(crate) index: ::std::option::Option, } impl StartBackupJobInputBuilder { ///

The name of a logical container where backups are stored. Backup vaults are identified by names that are unique to the account used to create them and the Amazon Web Services Region where they are created.

@@ -287,6 +315,50 @@ impl StartBackupJobInputBuilder { pub fn get_backup_options(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> { &self.backup_options } + ///

Include this parameter to enable index creation if your backup job has a resource type that supports backup indexes.

+ ///

Resource types that support backup indexes include:

+ ///
    + ///
  • + ///

    EBS for Amazon Elastic Block Store

  • + ///
  • + ///

    S3 for Amazon Simple Storage Service (Amazon S3)

  • + ///
+ ///

Index can have 1 of 2 possible values, either ENABLED or DISABLED.

+ ///

To create a backup index for an eligible ACTIVE recovery point that does not yet have a backup index, set value to ENABLED.

+ ///

To delete a backup index, set value to DISABLED.

+ pub fn index(mut self, input: crate::types::Index) -> Self { + self.index = ::std::option::Option::Some(input); + self + } + ///

Include this parameter to enable index creation if your backup job has a resource type that supports backup indexes.

+ ///

Resource types that support backup indexes include:

+ ///
    + ///
  • + ///

    EBS for Amazon Elastic Block Store

  • + ///
  • + ///

    S3 for Amazon Simple Storage Service (Amazon S3)

  • + ///
+ ///

Index can have 1 of 2 possible values, either ENABLED or DISABLED.

+ ///

To create a backup index for an eligible ACTIVE recovery point that does not yet have a backup index, set value to ENABLED.

+ ///

To delete a backup index, set value to DISABLED.

+ pub fn set_index(mut self, input: ::std::option::Option) -> Self { + self.index = input; + self + } + ///

Include this parameter to enable index creation if your backup job has a resource type that supports backup indexes.

+ ///

Resource types that support backup indexes include:

+ ///
    + ///
  • + ///

    EBS for Amazon Elastic Block Store

  • + ///
  • + ///

    S3 for Amazon Simple Storage Service (Amazon S3)

  • + ///
+ ///

Index can have 1 of 2 possible values, either ENABLED or DISABLED.

+ ///

To create a backup index for an eligible ACTIVE recovery point that does not yet have a backup index, set value to ENABLED.

+ ///

To delete a backup index, set value to DISABLED.

+ pub fn get_index(&self) -> &::std::option::Option { + &self.index + } /// Consumes the builder and constructs a [`StartBackupJobInput`](crate::operation::start_backup_job::StartBackupJobInput). pub fn build( self, @@ -301,6 +373,7 @@ impl StartBackupJobInputBuilder { lifecycle: self.lifecycle, recovery_point_tags: self.recovery_point_tags, backup_options: self.backup_options, + index: self.index, }) } } @@ -316,6 +389,7 @@ impl ::std::fmt::Debug for StartBackupJobInputBuilder { formatter.field("lifecycle", &self.lifecycle); formatter.field("recovery_point_tags", &"*** Sensitive Data Redacted ***"); formatter.field("backup_options", &self.backup_options); + formatter.field("index", &self.index); formatter.finish() } } diff --git a/sdk/backup/src/operation/start_backup_job/builders.rs b/sdk/backup/src/operation/start_backup_job/builders.rs index a2c3f219f226..f13d94b6d2af 100644 --- a/sdk/backup/src/operation/start_backup_job/builders.rs +++ b/sdk/backup/src/operation/start_backup_job/builders.rs @@ -279,4 +279,48 @@ impl StartBackupJobFluentBuilder { pub fn get_backup_options(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> { self.inner.get_backup_options() } + ///

Include this parameter to enable index creation if your backup job has a resource type that supports backup indexes.

+ ///

Resource types that support backup indexes include:

+ ///
    + ///
  • + ///

    EBS for Amazon Elastic Block Store

  • + ///
  • + ///

    S3 for Amazon Simple Storage Service (Amazon S3)

  • + ///
+ ///

Index can have 1 of 2 possible values, either ENABLED or DISABLED.

+ ///

To create a backup index for an eligible ACTIVE recovery point that does not yet have a backup index, set value to ENABLED.

+ ///

To delete a backup index, set value to DISABLED.

+ pub fn index(mut self, input: crate::types::Index) -> Self { + self.inner = self.inner.index(input); + self + } + ///

Include this parameter to enable index creation if your backup job has a resource type that supports backup indexes.

+ ///

Resource types that support backup indexes include:

+ ///
    + ///
  • + ///

    EBS for Amazon Elastic Block Store

  • + ///
  • + ///

    S3 for Amazon Simple Storage Service (Amazon S3)

  • + ///
+ ///

Index can have 1 of 2 possible values, either ENABLED or DISABLED.

+ ///

To create a backup index for an eligible ACTIVE recovery point that does not yet have a backup index, set value to ENABLED.

+ ///

To delete a backup index, set value to DISABLED.

+ pub fn set_index(mut self, input: ::std::option::Option) -> Self { + self.inner = self.inner.set_index(input); + self + } + ///

Include this parameter to enable index creation if your backup job has a resource type that supports backup indexes.

+ ///

Resource types that support backup indexes include:

+ ///
    + ///
  • + ///

    EBS for Amazon Elastic Block Store

  • + ///
  • + ///

    S3 for Amazon Simple Storage Service (Amazon S3)

  • + ///
+ ///

Index can have 1 of 2 possible values, either ENABLED or DISABLED.

+ ///

To create a backup index for an eligible ACTIVE recovery point that does not yet have a backup index, set value to ENABLED.

+ ///

To delete a backup index, set value to DISABLED.

+ pub fn get_index(&self) -> &::std::option::Option { + self.inner.get_index() + } } diff --git a/sdk/backup/src/operation/update_recovery_point_index_settings.rs b/sdk/backup/src/operation/update_recovery_point_index_settings.rs new file mode 100644 index 000000000000..52d9837c194d --- /dev/null +++ b/sdk/backup/src/operation/update_recovery_point_index_settings.rs @@ -0,0 +1,434 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +/// Orchestration and serialization glue logic for `UpdateRecoveryPointIndexSettings`. +#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)] +#[non_exhaustive] +pub struct UpdateRecoveryPointIndexSettings; +impl UpdateRecoveryPointIndexSettings { + /// Creates a new `UpdateRecoveryPointIndexSettings` + pub fn new() -> Self { + Self + } + pub(crate) async fn orchestrate( + runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, + input: crate::operation::update_recovery_point_index_settings::UpdateRecoveryPointIndexSettingsInput, + ) -> ::std::result::Result< + crate::operation::update_recovery_point_index_settings::UpdateRecoveryPointIndexSettingsOutput, + ::aws_smithy_runtime_api::client::result::SdkError< + crate::operation::update_recovery_point_index_settings::UpdateRecoveryPointIndexSettingsError, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >, + > { + let map_err = |err: ::aws_smithy_runtime_api::client::result::SdkError< + ::aws_smithy_runtime_api::client::interceptors::context::Error, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >| { + err.map_service_error(|err| { + err.downcast::() + .expect("correct error type") + }) + }; + let context = Self::orchestrate_with_stop_point(runtime_plugins, input, ::aws_smithy_runtime::client::orchestrator::StopPoint::None) + .await + .map_err(map_err)?; + let output = context.finalize().map_err(map_err)?; + ::std::result::Result::Ok( + output + .downcast::() + .expect("correct output type"), + ) + } + + pub(crate) async fn orchestrate_with_stop_point( + runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, + input: crate::operation::update_recovery_point_index_settings::UpdateRecoveryPointIndexSettingsInput, + stop_point: ::aws_smithy_runtime::client::orchestrator::StopPoint, + ) -> ::std::result::Result< + ::aws_smithy_runtime_api::client::interceptors::context::InterceptorContext, + ::aws_smithy_runtime_api::client::result::SdkError< + ::aws_smithy_runtime_api::client::interceptors::context::Error, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >, + > { + let input = ::aws_smithy_runtime_api::client::interceptors::context::Input::erase(input); + ::aws_smithy_runtime::client::orchestrator::invoke_with_stop_point( + "backup", + "UpdateRecoveryPointIndexSettings", + input, + runtime_plugins, + stop_point, + ) + .await + } + + pub(crate) fn operation_runtime_plugins( + client_runtime_plugins: ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, + client_config: &crate::config::Config, + config_override: ::std::option::Option, + ) -> ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins { + let mut runtime_plugins = client_runtime_plugins.with_operation_plugin(Self::new()); + runtime_plugins = runtime_plugins.with_client_plugin(crate::auth_plugin::DefaultAuthOptionsPlugin::new(vec![ + ::aws_runtime::auth::sigv4::SCHEME_ID, + ])); + if let ::std::option::Option::Some(config_override) = config_override { + for plugin in config_override.runtime_plugins.iter().cloned() { + runtime_plugins = runtime_plugins.with_operation_plugin(plugin); + } + runtime_plugins = runtime_plugins.with_operation_plugin(crate::config::ConfigOverrideRuntimePlugin::new( + config_override, + client_config.config.clone(), + &client_config.runtime_components, + )); + } + runtime_plugins + } +} +impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for UpdateRecoveryPointIndexSettings { + fn config(&self) -> ::std::option::Option<::aws_smithy_types::config_bag::FrozenLayer> { + let mut cfg = ::aws_smithy_types::config_bag::Layer::new("UpdateRecoveryPointIndexSettings"); + + cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new( + UpdateRecoveryPointIndexSettingsRequestSerializer, + )); + cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new( + UpdateRecoveryPointIndexSettingsResponseDeserializer, + )); + + cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new( + ::aws_smithy_runtime_api::client::auth::static_resolver::StaticAuthSchemeOptionResolverParams::new(), + )); + + cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::Metadata::new( + "UpdateRecoveryPointIndexSettings", + "backup", + )); + let mut signing_options = ::aws_runtime::auth::SigningOptions::default(); + signing_options.double_uri_encode = true; + signing_options.content_sha256_header = false; + signing_options.normalize_uri_path = true; + signing_options.payload_override = None; + + cfg.store_put(::aws_runtime::auth::SigV4OperationSigningConfig { + signing_options, + ..::std::default::Default::default() + }); + + ::std::option::Option::Some(cfg.freeze()) + } + + fn runtime_components( + &self, + _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder, + ) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> { + #[allow(unused_mut)] + let mut rcb = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("UpdateRecoveryPointIndexSettings") + .with_interceptor(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default()) + .with_interceptor(UpdateRecoveryPointIndexSettingsEndpointParamsInterceptor) + .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::< + crate::operation::update_recovery_point_index_settings::UpdateRecoveryPointIndexSettingsError, + >::new()) + .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::< + crate::operation::update_recovery_point_index_settings::UpdateRecoveryPointIndexSettingsError, + >::new()) + .with_retry_classifier(::aws_runtime::retries::classifiers::AwsErrorCodeClassifier::< + crate::operation::update_recovery_point_index_settings::UpdateRecoveryPointIndexSettingsError, + >::new()); + + ::std::borrow::Cow::Owned(rcb) + } +} + +#[derive(Debug)] +struct UpdateRecoveryPointIndexSettingsResponseDeserializer; +impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for UpdateRecoveryPointIndexSettingsResponseDeserializer { + fn deserialize_nonstreaming( + &self, + response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError { + let (success, status) = (response.status().is_success(), response.status().as_u16()); + let headers = response.headers(); + let body = response.body().bytes().expect("body loaded"); + #[allow(unused_mut)] + let mut force_error = false; + ::tracing::debug!(request_id = ?::aws_types::request_id::RequestId::request_id(response)); + let parse_result = if !success && status != 200 || force_error { + crate::protocol_serde::shape_update_recovery_point_index_settings::de_update_recovery_point_index_settings_http_error( + status, headers, body, + ) + } else { + crate::protocol_serde::shape_update_recovery_point_index_settings::de_update_recovery_point_index_settings_http_response( + status, headers, body, + ) + }; + crate::protocol_serde::type_erase_result(parse_result) + } +} +#[derive(Debug)] +struct UpdateRecoveryPointIndexSettingsRequestSerializer; +impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for UpdateRecoveryPointIndexSettingsRequestSerializer { + #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)] + fn serialize_input( + &self, + input: ::aws_smithy_runtime_api::client::interceptors::context::Input, + _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag, + ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> { + let input = input + .downcast::() + .expect("correct type"); + let _header_serialization_settings = _cfg + .load::() + .cloned() + .unwrap_or_default(); + let mut request_builder = { + fn uri_base( + _input: &crate::operation::update_recovery_point_index_settings::UpdateRecoveryPointIndexSettingsInput, + output: &mut ::std::string::String, + ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> { + use ::std::fmt::Write as _; + let input_1 = &_input.backup_vault_name; + let input_1 = input_1.as_ref().ok_or_else(|| { + ::aws_smithy_types::error::operation::BuildError::missing_field("backup_vault_name", "cannot be empty or unset") + })?; + let backup_vault_name = ::aws_smithy_http::label::fmt_string(input_1, ::aws_smithy_http::label::EncodingStrategy::Default); + if backup_vault_name.is_empty() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "backup_vault_name", + "cannot be empty or unset", + )); + } + let input_2 = &_input.recovery_point_arn; + let input_2 = input_2.as_ref().ok_or_else(|| { + ::aws_smithy_types::error::operation::BuildError::missing_field("recovery_point_arn", "cannot be empty or unset") + })?; + let recovery_point_arn = ::aws_smithy_http::label::fmt_string(input_2, ::aws_smithy_http::label::EncodingStrategy::Default); + if recovery_point_arn.is_empty() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "recovery_point_arn", + "cannot be empty or unset", + )); + } + ::std::write!( + output, + "/backup-vaults/{BackupVaultName}/recovery-points/{RecoveryPointArn}/index", + BackupVaultName = backup_vault_name, + RecoveryPointArn = recovery_point_arn + ) + .expect("formatting should succeed"); + ::std::result::Result::Ok(()) + } + #[allow(clippy::unnecessary_wraps)] + fn update_http_builder( + input: &crate::operation::update_recovery_point_index_settings::UpdateRecoveryPointIndexSettingsInput, + builder: ::http::request::Builder, + ) -> ::std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> { + let mut uri = ::std::string::String::new(); + uri_base(input, &mut uri)?; + ::std::result::Result::Ok(builder.method("POST").uri(uri)) + } + let mut builder = update_http_builder(&input, ::http::request::Builder::new())?; + builder = _header_serialization_settings.set_default_header(builder, ::http::header::CONTENT_TYPE, "application/json"); + builder + }; + let body = ::aws_smithy_types::body::SdkBody::from( + crate::protocol_serde::shape_update_recovery_point_index_settings::ser_update_recovery_point_index_settings_input(&input)?, + ); + if let Some(content_length) = body.content_length() { + let content_length = content_length.to_string(); + request_builder = _header_serialization_settings.set_default_header(request_builder, ::http::header::CONTENT_LENGTH, &content_length); + } + ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap()) + } +} +#[derive(Debug)] +struct UpdateRecoveryPointIndexSettingsEndpointParamsInterceptor; + +impl ::aws_smithy_runtime_api::client::interceptors::Intercept for UpdateRecoveryPointIndexSettingsEndpointParamsInterceptor { + fn name(&self) -> &'static str { + "UpdateRecoveryPointIndexSettingsEndpointParamsInterceptor" + } + + fn read_before_execution( + &self, + context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef< + '_, + ::aws_smithy_runtime_api::client::interceptors::context::Input, + ::aws_smithy_runtime_api::client::interceptors::context::Output, + ::aws_smithy_runtime_api::client::interceptors::context::Error, + >, + cfg: &mut ::aws_smithy_types::config_bag::ConfigBag, + ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> { + let _input = context + .input() + .downcast_ref::() + .ok_or("failed to downcast to UpdateRecoveryPointIndexSettingsInput")?; + + let params = crate::config::endpoint::Params::builder() + .set_region(cfg.load::<::aws_types::region::Region>().map(|r| r.as_ref().to_owned())) + .set_use_dual_stack(cfg.load::<::aws_types::endpoint_config::UseDualStack>().map(|ty| ty.0)) + .set_use_fips(cfg.load::<::aws_types::endpoint_config::UseFips>().map(|ty| ty.0)) + .set_endpoint(cfg.load::<::aws_types::endpoint_config::EndpointUrl>().map(|ty| ty.0.clone())) + .build() + .map_err(|err| { + ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err) + })?; + cfg.interceptor_state() + .store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params)); + ::std::result::Result::Ok(()) + } +} + +// The get_* functions below are generated from JMESPath expressions in the +// operationContextParams trait. They target the operation's input shape. + +/// Error type for the `UpdateRecoveryPointIndexSettingsError` operation. +#[non_exhaustive] +#[derive(::std::fmt::Debug)] +pub enum UpdateRecoveryPointIndexSettingsError { + ///

Indicates that something is wrong with a parameter's value. For example, the value is out of range.

+ InvalidParameterValueException(crate::types::error::InvalidParameterValueException), + ///

Indicates that something is wrong with the input to the request. For example, a parameter is of the wrong type.

+ InvalidRequestException(crate::types::error::InvalidRequestException), + ///

Indicates that a required parameter is missing.

+ MissingParameterValueException(crate::types::error::MissingParameterValueException), + ///

A resource that is required for the action doesn't exist.

+ ResourceNotFoundException(crate::types::error::ResourceNotFoundException), + ///

The request failed due to a temporary failure of the server.

+ ServiceUnavailableException(crate::types::error::ServiceUnavailableException), + /// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code). + #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \ + variable wildcard pattern and check `.code()`: + \ +    `err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }` + \ + See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-UpdateRecoveryPointIndexSettingsError) for what information is available for the error.")] + Unhandled(crate::error::sealed_unhandled::Unhandled), +} +impl UpdateRecoveryPointIndexSettingsError { + /// Creates the `UpdateRecoveryPointIndexSettingsError::Unhandled` variant from any error type. + pub fn unhandled( + err: impl ::std::convert::Into<::std::boxed::Box>, + ) -> Self { + Self::Unhandled(crate::error::sealed_unhandled::Unhandled { + source: err.into(), + meta: ::std::default::Default::default(), + }) + } + + /// Creates the `UpdateRecoveryPointIndexSettingsError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata). + pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self { + Self::Unhandled(crate::error::sealed_unhandled::Unhandled { + source: err.clone().into(), + meta: err, + }) + } + /// + /// Returns error metadata, which includes the error code, message, + /// request ID, and potentially additional information. + /// + pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata { + match self { + Self::InvalidParameterValueException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), + Self::InvalidRequestException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), + Self::MissingParameterValueException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), + Self::ResourceNotFoundException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), + Self::ServiceUnavailableException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), + Self::Unhandled(e) => &e.meta, + } + } + /// Returns `true` if the error kind is `UpdateRecoveryPointIndexSettingsError::InvalidParameterValueException`. + pub fn is_invalid_parameter_value_exception(&self) -> bool { + matches!(self, Self::InvalidParameterValueException(_)) + } + /// Returns `true` if the error kind is `UpdateRecoveryPointIndexSettingsError::InvalidRequestException`. + pub fn is_invalid_request_exception(&self) -> bool { + matches!(self, Self::InvalidRequestException(_)) + } + /// Returns `true` if the error kind is `UpdateRecoveryPointIndexSettingsError::MissingParameterValueException`. + pub fn is_missing_parameter_value_exception(&self) -> bool { + matches!(self, Self::MissingParameterValueException(_)) + } + /// Returns `true` if the error kind is `UpdateRecoveryPointIndexSettingsError::ResourceNotFoundException`. + pub fn is_resource_not_found_exception(&self) -> bool { + matches!(self, Self::ResourceNotFoundException(_)) + } + /// Returns `true` if the error kind is `UpdateRecoveryPointIndexSettingsError::ServiceUnavailableException`. + pub fn is_service_unavailable_exception(&self) -> bool { + matches!(self, Self::ServiceUnavailableException(_)) + } +} +impl ::std::error::Error for UpdateRecoveryPointIndexSettingsError { + fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> { + match self { + Self::InvalidParameterValueException(_inner) => ::std::option::Option::Some(_inner), + Self::InvalidRequestException(_inner) => ::std::option::Option::Some(_inner), + Self::MissingParameterValueException(_inner) => ::std::option::Option::Some(_inner), + Self::ResourceNotFoundException(_inner) => ::std::option::Option::Some(_inner), + Self::ServiceUnavailableException(_inner) => ::std::option::Option::Some(_inner), + Self::Unhandled(_inner) => ::std::option::Option::Some(&*_inner.source), + } + } +} +impl ::std::fmt::Display for UpdateRecoveryPointIndexSettingsError { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + match self { + Self::InvalidParameterValueException(_inner) => _inner.fmt(f), + Self::InvalidRequestException(_inner) => _inner.fmt(f), + Self::MissingParameterValueException(_inner) => _inner.fmt(f), + Self::ResourceNotFoundException(_inner) => _inner.fmt(f), + Self::ServiceUnavailableException(_inner) => _inner.fmt(f), + Self::Unhandled(_inner) => { + if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) { + write!(f, "unhandled error ({code})") + } else { + f.write_str("unhandled error") + } + } + } + } +} +impl ::aws_smithy_types::retry::ProvideErrorKind for UpdateRecoveryPointIndexSettingsError { + fn code(&self) -> ::std::option::Option<&str> { + ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) + } + fn retryable_error_kind(&self) -> ::std::option::Option<::aws_smithy_types::retry::ErrorKind> { + ::std::option::Option::None + } +} +impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for UpdateRecoveryPointIndexSettingsError { + fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata { + match self { + Self::InvalidParameterValueException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner), + Self::InvalidRequestException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner), + Self::MissingParameterValueException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner), + Self::ResourceNotFoundException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner), + Self::ServiceUnavailableException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner), + Self::Unhandled(_inner) => &_inner.meta, + } + } +} +impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for UpdateRecoveryPointIndexSettingsError { + fn create_unhandled_error( + source: ::std::boxed::Box, + meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>, + ) -> Self { + Self::Unhandled(crate::error::sealed_unhandled::Unhandled { + source, + meta: meta.unwrap_or_default(), + }) + } +} +impl ::aws_types::request_id::RequestId for crate::operation::update_recovery_point_index_settings::UpdateRecoveryPointIndexSettingsError { + fn request_id(&self) -> Option<&str> { + self.meta().request_id() + } +} + +pub use crate::operation::update_recovery_point_index_settings::_update_recovery_point_index_settings_output::UpdateRecoveryPointIndexSettingsOutput; + +pub use crate::operation::update_recovery_point_index_settings::_update_recovery_point_index_settings_input::UpdateRecoveryPointIndexSettingsInput; + +mod _update_recovery_point_index_settings_input; + +mod _update_recovery_point_index_settings_output; + +/// Builders +pub mod builders; diff --git a/sdk/backup/src/operation/update_recovery_point_index_settings/_update_recovery_point_index_settings_input.rs b/sdk/backup/src/operation/update_recovery_point_index_settings/_update_recovery_point_index_settings_input.rs new file mode 100644 index 000000000000..a5a99af6e78e --- /dev/null +++ b/sdk/backup/src/operation/update_recovery_point_index_settings/_update_recovery_point_index_settings_input.rs @@ -0,0 +1,145 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +#[allow(missing_docs)] // documentation missing in model +#[non_exhaustive] +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)] +pub struct UpdateRecoveryPointIndexSettingsInput { + ///

The name of a logical container where backups are stored. Backup vaults are identified by names that are unique to the account used to create them and the Region where they are created.

+ ///

Accepted characters include lowercase letters, numbers, and hyphens.

+ pub backup_vault_name: ::std::option::Option<::std::string::String>, + ///

An ARN that uniquely identifies a recovery point; for example, arn:aws:backup:us-east-1:123456789012:recovery-point:1EB3B5E7-9EB0-435A-A80B-108B488B0D45.

+ pub recovery_point_arn: ::std::option::Option<::std::string::String>, + ///

This specifies the IAM role ARN used for this operation.

+ ///

For example, arn:aws:iam::123456789012:role/S3Access

+ pub iam_role_arn: ::std::option::Option<::std::string::String>, + ///

Index can have 1 of 2 possible values, either ENABLED or DISABLED.

+ ///

To create a backup index for an eligible ACTIVE recovery point that does not yet have a backup index, set value to ENABLED.

+ ///

To delete a backup index, set value to DISABLED.

+ pub index: ::std::option::Option, +} +impl UpdateRecoveryPointIndexSettingsInput { + ///

The name of a logical container where backups are stored. Backup vaults are identified by names that are unique to the account used to create them and the Region where they are created.

+ ///

Accepted characters include lowercase letters, numbers, and hyphens.

+ pub fn backup_vault_name(&self) -> ::std::option::Option<&str> { + self.backup_vault_name.as_deref() + } + ///

An ARN that uniquely identifies a recovery point; for example, arn:aws:backup:us-east-1:123456789012:recovery-point:1EB3B5E7-9EB0-435A-A80B-108B488B0D45.

+ pub fn recovery_point_arn(&self) -> ::std::option::Option<&str> { + self.recovery_point_arn.as_deref() + } + ///

This specifies the IAM role ARN used for this operation.

+ ///

For example, arn:aws:iam::123456789012:role/S3Access

+ pub fn iam_role_arn(&self) -> ::std::option::Option<&str> { + self.iam_role_arn.as_deref() + } + ///

Index can have 1 of 2 possible values, either ENABLED or DISABLED.

+ ///

To create a backup index for an eligible ACTIVE recovery point that does not yet have a backup index, set value to ENABLED.

+ ///

To delete a backup index, set value to DISABLED.

+ pub fn index(&self) -> ::std::option::Option<&crate::types::Index> { + self.index.as_ref() + } +} +impl UpdateRecoveryPointIndexSettingsInput { + /// Creates a new builder-style object to manufacture [`UpdateRecoveryPointIndexSettingsInput`](crate::operation::update_recovery_point_index_settings::UpdateRecoveryPointIndexSettingsInput). + pub fn builder() -> crate::operation::update_recovery_point_index_settings::builders::UpdateRecoveryPointIndexSettingsInputBuilder { + crate::operation::update_recovery_point_index_settings::builders::UpdateRecoveryPointIndexSettingsInputBuilder::default() + } +} + +/// A builder for [`UpdateRecoveryPointIndexSettingsInput`](crate::operation::update_recovery_point_index_settings::UpdateRecoveryPointIndexSettingsInput). +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)] +#[non_exhaustive] +pub struct UpdateRecoveryPointIndexSettingsInputBuilder { + pub(crate) backup_vault_name: ::std::option::Option<::std::string::String>, + pub(crate) recovery_point_arn: ::std::option::Option<::std::string::String>, + pub(crate) iam_role_arn: ::std::option::Option<::std::string::String>, + pub(crate) index: ::std::option::Option, +} +impl UpdateRecoveryPointIndexSettingsInputBuilder { + ///

The name of a logical container where backups are stored. Backup vaults are identified by names that are unique to the account used to create them and the Region where they are created.

+ ///

Accepted characters include lowercase letters, numbers, and hyphens.

+ /// This field is required. + pub fn backup_vault_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.backup_vault_name = ::std::option::Option::Some(input.into()); + self + } + ///

The name of a logical container where backups are stored. Backup vaults are identified by names that are unique to the account used to create them and the Region where they are created.

+ ///

Accepted characters include lowercase letters, numbers, and hyphens.

+ pub fn set_backup_vault_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.backup_vault_name = input; + self + } + ///

The name of a logical container where backups are stored. Backup vaults are identified by names that are unique to the account used to create them and the Region where they are created.

+ ///

Accepted characters include lowercase letters, numbers, and hyphens.

+ pub fn get_backup_vault_name(&self) -> &::std::option::Option<::std::string::String> { + &self.backup_vault_name + } + ///

An ARN that uniquely identifies a recovery point; for example, arn:aws:backup:us-east-1:123456789012:recovery-point:1EB3B5E7-9EB0-435A-A80B-108B488B0D45.

+ /// This field is required. + pub fn recovery_point_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.recovery_point_arn = ::std::option::Option::Some(input.into()); + self + } + ///

An ARN that uniquely identifies a recovery point; for example, arn:aws:backup:us-east-1:123456789012:recovery-point:1EB3B5E7-9EB0-435A-A80B-108B488B0D45.

+ pub fn set_recovery_point_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.recovery_point_arn = input; + self + } + ///

An ARN that uniquely identifies a recovery point; for example, arn:aws:backup:us-east-1:123456789012:recovery-point:1EB3B5E7-9EB0-435A-A80B-108B488B0D45.

+ pub fn get_recovery_point_arn(&self) -> &::std::option::Option<::std::string::String> { + &self.recovery_point_arn + } + ///

This specifies the IAM role ARN used for this operation.

+ ///

For example, arn:aws:iam::123456789012:role/S3Access

+ pub fn iam_role_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.iam_role_arn = ::std::option::Option::Some(input.into()); + self + } + ///

This specifies the IAM role ARN used for this operation.

+ ///

For example, arn:aws:iam::123456789012:role/S3Access

+ pub fn set_iam_role_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.iam_role_arn = input; + self + } + ///

This specifies the IAM role ARN used for this operation.

+ ///

For example, arn:aws:iam::123456789012:role/S3Access

+ pub fn get_iam_role_arn(&self) -> &::std::option::Option<::std::string::String> { + &self.iam_role_arn + } + ///

Index can have 1 of 2 possible values, either ENABLED or DISABLED.

+ ///

To create a backup index for an eligible ACTIVE recovery point that does not yet have a backup index, set value to ENABLED.

+ ///

To delete a backup index, set value to DISABLED.

+ /// This field is required. + pub fn index(mut self, input: crate::types::Index) -> Self { + self.index = ::std::option::Option::Some(input); + self + } + ///

Index can have 1 of 2 possible values, either ENABLED or DISABLED.

+ ///

To create a backup index for an eligible ACTIVE recovery point that does not yet have a backup index, set value to ENABLED.

+ ///

To delete a backup index, set value to DISABLED.

+ pub fn set_index(mut self, input: ::std::option::Option) -> Self { + self.index = input; + self + } + ///

Index can have 1 of 2 possible values, either ENABLED or DISABLED.

+ ///

To create a backup index for an eligible ACTIVE recovery point that does not yet have a backup index, set value to ENABLED.

+ ///

To delete a backup index, set value to DISABLED.

+ pub fn get_index(&self) -> &::std::option::Option { + &self.index + } + /// Consumes the builder and constructs a [`UpdateRecoveryPointIndexSettingsInput`](crate::operation::update_recovery_point_index_settings::UpdateRecoveryPointIndexSettingsInput). + pub fn build( + self, + ) -> ::std::result::Result< + crate::operation::update_recovery_point_index_settings::UpdateRecoveryPointIndexSettingsInput, + ::aws_smithy_types::error::operation::BuildError, + > { + ::std::result::Result::Ok( + crate::operation::update_recovery_point_index_settings::UpdateRecoveryPointIndexSettingsInput { + backup_vault_name: self.backup_vault_name, + recovery_point_arn: self.recovery_point_arn, + iam_role_arn: self.iam_role_arn, + index: self.index, + }, + ) + } +} diff --git a/sdk/backup/src/operation/update_recovery_point_index_settings/_update_recovery_point_index_settings_output.rs b/sdk/backup/src/operation/update_recovery_point_index_settings/_update_recovery_point_index_settings_output.rs new file mode 100644 index 000000000000..299f4a27ef36 --- /dev/null +++ b/sdk/backup/src/operation/update_recovery_point_index_settings/_update_recovery_point_index_settings_output.rs @@ -0,0 +1,152 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +#[allow(missing_docs)] // documentation missing in model +#[non_exhaustive] +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)] +pub struct UpdateRecoveryPointIndexSettingsOutput { + ///

The name of a logical container where backups are stored. Backup vaults are identified by names that are unique to the account used to create them and the Region where they are created.

+ pub backup_vault_name: ::std::option::Option<::std::string::String>, + ///

An ARN that uniquely identifies a recovery point; for example, arn:aws:backup:us-east-1:123456789012:recovery-point:1EB3B5E7-9EB0-435A-A80B-108B488B0D45.

+ pub recovery_point_arn: ::std::option::Option<::std::string::String>, + ///

This is the current status for the backup index associated with the specified recovery point.

+ ///

Statuses are: PENDING | ACTIVE | FAILED | DELETING

+ ///

A recovery point with an index that has the status of ACTIVE can be included in a search.

+ pub index_status: ::std::option::Option, + ///

Index can have 1 of 2 possible values, either ENABLED or DISABLED.

+ ///

A value of ENABLED means a backup index for an eligible ACTIVE recovery point has been created.

+ ///

A value of DISABLED means a backup index was deleted.

+ pub index: ::std::option::Option, + _request_id: Option, +} +impl UpdateRecoveryPointIndexSettingsOutput { + ///

The name of a logical container where backups are stored. Backup vaults are identified by names that are unique to the account used to create them and the Region where they are created.

+ pub fn backup_vault_name(&self) -> ::std::option::Option<&str> { + self.backup_vault_name.as_deref() + } + ///

An ARN that uniquely identifies a recovery point; for example, arn:aws:backup:us-east-1:123456789012:recovery-point:1EB3B5E7-9EB0-435A-A80B-108B488B0D45.

+ pub fn recovery_point_arn(&self) -> ::std::option::Option<&str> { + self.recovery_point_arn.as_deref() + } + ///

This is the current status for the backup index associated with the specified recovery point.

+ ///

Statuses are: PENDING | ACTIVE | FAILED | DELETING

+ ///

A recovery point with an index that has the status of ACTIVE can be included in a search.

+ pub fn index_status(&self) -> ::std::option::Option<&crate::types::IndexStatus> { + self.index_status.as_ref() + } + ///

Index can have 1 of 2 possible values, either ENABLED or DISABLED.

+ ///

A value of ENABLED means a backup index for an eligible ACTIVE recovery point has been created.

+ ///

A value of DISABLED means a backup index was deleted.

+ pub fn index(&self) -> ::std::option::Option<&crate::types::Index> { + self.index.as_ref() + } +} +impl ::aws_types::request_id::RequestId for UpdateRecoveryPointIndexSettingsOutput { + fn request_id(&self) -> Option<&str> { + self._request_id.as_deref() + } +} +impl UpdateRecoveryPointIndexSettingsOutput { + /// Creates a new builder-style object to manufacture [`UpdateRecoveryPointIndexSettingsOutput`](crate::operation::update_recovery_point_index_settings::UpdateRecoveryPointIndexSettingsOutput). + pub fn builder() -> crate::operation::update_recovery_point_index_settings::builders::UpdateRecoveryPointIndexSettingsOutputBuilder { + crate::operation::update_recovery_point_index_settings::builders::UpdateRecoveryPointIndexSettingsOutputBuilder::default() + } +} + +/// A builder for [`UpdateRecoveryPointIndexSettingsOutput`](crate::operation::update_recovery_point_index_settings::UpdateRecoveryPointIndexSettingsOutput). +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)] +#[non_exhaustive] +pub struct UpdateRecoveryPointIndexSettingsOutputBuilder { + pub(crate) backup_vault_name: ::std::option::Option<::std::string::String>, + pub(crate) recovery_point_arn: ::std::option::Option<::std::string::String>, + pub(crate) index_status: ::std::option::Option, + pub(crate) index: ::std::option::Option, + _request_id: Option, +} +impl UpdateRecoveryPointIndexSettingsOutputBuilder { + ///

The name of a logical container where backups are stored. Backup vaults are identified by names that are unique to the account used to create them and the Region where they are created.

+ pub fn backup_vault_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.backup_vault_name = ::std::option::Option::Some(input.into()); + self + } + ///

The name of a logical container where backups are stored. Backup vaults are identified by names that are unique to the account used to create them and the Region where they are created.

+ pub fn set_backup_vault_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.backup_vault_name = input; + self + } + ///

The name of a logical container where backups are stored. Backup vaults are identified by names that are unique to the account used to create them and the Region where they are created.

+ pub fn get_backup_vault_name(&self) -> &::std::option::Option<::std::string::String> { + &self.backup_vault_name + } + ///

An ARN that uniquely identifies a recovery point; for example, arn:aws:backup:us-east-1:123456789012:recovery-point:1EB3B5E7-9EB0-435A-A80B-108B488B0D45.

+ pub fn recovery_point_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.recovery_point_arn = ::std::option::Option::Some(input.into()); + self + } + ///

An ARN that uniquely identifies a recovery point; for example, arn:aws:backup:us-east-1:123456789012:recovery-point:1EB3B5E7-9EB0-435A-A80B-108B488B0D45.

+ pub fn set_recovery_point_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.recovery_point_arn = input; + self + } + ///

An ARN that uniquely identifies a recovery point; for example, arn:aws:backup:us-east-1:123456789012:recovery-point:1EB3B5E7-9EB0-435A-A80B-108B488B0D45.

+ pub fn get_recovery_point_arn(&self) -> &::std::option::Option<::std::string::String> { + &self.recovery_point_arn + } + ///

This is the current status for the backup index associated with the specified recovery point.

+ ///

Statuses are: PENDING | ACTIVE | FAILED | DELETING

+ ///

A recovery point with an index that has the status of ACTIVE can be included in a search.

+ pub fn index_status(mut self, input: crate::types::IndexStatus) -> Self { + self.index_status = ::std::option::Option::Some(input); + self + } + ///

This is the current status for the backup index associated with the specified recovery point.

+ ///

Statuses are: PENDING | ACTIVE | FAILED | DELETING

+ ///

A recovery point with an index that has the status of ACTIVE can be included in a search.

+ pub fn set_index_status(mut self, input: ::std::option::Option) -> Self { + self.index_status = input; + self + } + ///

This is the current status for the backup index associated with the specified recovery point.

+ ///

Statuses are: PENDING | ACTIVE | FAILED | DELETING

+ ///

A recovery point with an index that has the status of ACTIVE can be included in a search.

+ pub fn get_index_status(&self) -> &::std::option::Option { + &self.index_status + } + ///

Index can have 1 of 2 possible values, either ENABLED or DISABLED.

+ ///

A value of ENABLED means a backup index for an eligible ACTIVE recovery point has been created.

+ ///

A value of DISABLED means a backup index was deleted.

+ pub fn index(mut self, input: crate::types::Index) -> Self { + self.index = ::std::option::Option::Some(input); + self + } + ///

Index can have 1 of 2 possible values, either ENABLED or DISABLED.

+ ///

A value of ENABLED means a backup index for an eligible ACTIVE recovery point has been created.

+ ///

A value of DISABLED means a backup index was deleted.

+ pub fn set_index(mut self, input: ::std::option::Option) -> Self { + self.index = input; + self + } + ///

Index can have 1 of 2 possible values, either ENABLED or DISABLED.

+ ///

A value of ENABLED means a backup index for an eligible ACTIVE recovery point has been created.

+ ///

A value of DISABLED means a backup index was deleted.

+ pub fn get_index(&self) -> &::std::option::Option { + &self.index + } + pub(crate) fn _request_id(mut self, request_id: impl Into) -> Self { + self._request_id = Some(request_id.into()); + self + } + + pub(crate) fn _set_request_id(&mut self, request_id: Option) -> &mut Self { + self._request_id = request_id; + self + } + /// Consumes the builder and constructs a [`UpdateRecoveryPointIndexSettingsOutput`](crate::operation::update_recovery_point_index_settings::UpdateRecoveryPointIndexSettingsOutput). + pub fn build(self) -> crate::operation::update_recovery_point_index_settings::UpdateRecoveryPointIndexSettingsOutput { + crate::operation::update_recovery_point_index_settings::UpdateRecoveryPointIndexSettingsOutput { + backup_vault_name: self.backup_vault_name, + recovery_point_arn: self.recovery_point_arn, + index_status: self.index_status, + index: self.index, + _request_id: self._request_id, + } + } +} diff --git a/sdk/backup/src/operation/update_recovery_point_index_settings/builders.rs b/sdk/backup/src/operation/update_recovery_point_index_settings/builders.rs new file mode 100644 index 000000000000..fea6110b635b --- /dev/null +++ b/sdk/backup/src/operation/update_recovery_point_index_settings/builders.rs @@ -0,0 +1,180 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +pub use crate::operation::update_recovery_point_index_settings::_update_recovery_point_index_settings_output::UpdateRecoveryPointIndexSettingsOutputBuilder; + +pub use crate::operation::update_recovery_point_index_settings::_update_recovery_point_index_settings_input::UpdateRecoveryPointIndexSettingsInputBuilder; + +impl crate::operation::update_recovery_point_index_settings::builders::UpdateRecoveryPointIndexSettingsInputBuilder { + /// Sends a request with this input using the given client. + pub async fn send_with( + self, + client: &crate::Client, + ) -> ::std::result::Result< + crate::operation::update_recovery_point_index_settings::UpdateRecoveryPointIndexSettingsOutput, + ::aws_smithy_runtime_api::client::result::SdkError< + crate::operation::update_recovery_point_index_settings::UpdateRecoveryPointIndexSettingsError, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >, + > { + let mut fluent_builder = client.update_recovery_point_index_settings(); + fluent_builder.inner = self; + fluent_builder.send().await + } +} +/// Fluent builder constructing a request to `UpdateRecoveryPointIndexSettings`. +/// +///

This operation updates the settings of a recovery point index.

+///

Required: BackupVaultName, RecoveryPointArn, and IAMRoleArn

+#[derive(::std::clone::Clone, ::std::fmt::Debug)] +pub struct UpdateRecoveryPointIndexSettingsFluentBuilder { + handle: ::std::sync::Arc, + inner: crate::operation::update_recovery_point_index_settings::builders::UpdateRecoveryPointIndexSettingsInputBuilder, + config_override: ::std::option::Option, +} +impl + crate::client::customize::internal::CustomizableSend< + crate::operation::update_recovery_point_index_settings::UpdateRecoveryPointIndexSettingsOutput, + crate::operation::update_recovery_point_index_settings::UpdateRecoveryPointIndexSettingsError, + > for UpdateRecoveryPointIndexSettingsFluentBuilder +{ + fn send( + self, + config_override: crate::config::Builder, + ) -> crate::client::customize::internal::BoxFuture< + crate::client::customize::internal::SendResult< + crate::operation::update_recovery_point_index_settings::UpdateRecoveryPointIndexSettingsOutput, + crate::operation::update_recovery_point_index_settings::UpdateRecoveryPointIndexSettingsError, + >, + > { + ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await }) + } +} +impl UpdateRecoveryPointIndexSettingsFluentBuilder { + /// Creates a new `UpdateRecoveryPointIndexSettingsFluentBuilder`. + pub(crate) fn new(handle: ::std::sync::Arc) -> Self { + Self { + handle, + inner: ::std::default::Default::default(), + config_override: ::std::option::Option::None, + } + } + /// Access the UpdateRecoveryPointIndexSettings as a reference. + pub fn as_input(&self) -> &crate::operation::update_recovery_point_index_settings::builders::UpdateRecoveryPointIndexSettingsInputBuilder { + &self.inner + } + /// Sends the request and returns the response. + /// + /// If an error occurs, an `SdkError` will be returned with additional details that + /// can be matched against. + /// + /// By default, any retryable failures will be retried twice. Retry behavior + /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be + /// set when configuring the client. + pub async fn send( + self, + ) -> ::std::result::Result< + crate::operation::update_recovery_point_index_settings::UpdateRecoveryPointIndexSettingsOutput, + ::aws_smithy_runtime_api::client::result::SdkError< + crate::operation::update_recovery_point_index_settings::UpdateRecoveryPointIndexSettingsError, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >, + > { + let input = self + .inner + .build() + .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?; + let runtime_plugins = crate::operation::update_recovery_point_index_settings::UpdateRecoveryPointIndexSettings::operation_runtime_plugins( + self.handle.runtime_plugins.clone(), + &self.handle.conf, + self.config_override, + ); + crate::operation::update_recovery_point_index_settings::UpdateRecoveryPointIndexSettings::orchestrate(&runtime_plugins, input).await + } + + /// Consumes this builder, creating a customizable operation that can be modified before being sent. + pub fn customize( + self, + ) -> crate::client::customize::CustomizableOperation< + crate::operation::update_recovery_point_index_settings::UpdateRecoveryPointIndexSettingsOutput, + crate::operation::update_recovery_point_index_settings::UpdateRecoveryPointIndexSettingsError, + Self, + > { + crate::client::customize::CustomizableOperation::new(self) + } + pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into) -> Self { + self.set_config_override(::std::option::Option::Some(config_override.into())); + self + } + + pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option) -> &mut Self { + self.config_override = config_override; + self + } + ///

The name of a logical container where backups are stored. Backup vaults are identified by names that are unique to the account used to create them and the Region where they are created.

+ ///

Accepted characters include lowercase letters, numbers, and hyphens.

+ pub fn backup_vault_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.inner = self.inner.backup_vault_name(input.into()); + self + } + ///

The name of a logical container where backups are stored. Backup vaults are identified by names that are unique to the account used to create them and the Region where they are created.

+ ///

Accepted characters include lowercase letters, numbers, and hyphens.

+ pub fn set_backup_vault_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.inner = self.inner.set_backup_vault_name(input); + self + } + ///

The name of a logical container where backups are stored. Backup vaults are identified by names that are unique to the account used to create them and the Region where they are created.

+ ///

Accepted characters include lowercase letters, numbers, and hyphens.

+ pub fn get_backup_vault_name(&self) -> &::std::option::Option<::std::string::String> { + self.inner.get_backup_vault_name() + } + ///

An ARN that uniquely identifies a recovery point; for example, arn:aws:backup:us-east-1:123456789012:recovery-point:1EB3B5E7-9EB0-435A-A80B-108B488B0D45.

+ pub fn recovery_point_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.inner = self.inner.recovery_point_arn(input.into()); + self + } + ///

An ARN that uniquely identifies a recovery point; for example, arn:aws:backup:us-east-1:123456789012:recovery-point:1EB3B5E7-9EB0-435A-A80B-108B488B0D45.

+ pub fn set_recovery_point_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.inner = self.inner.set_recovery_point_arn(input); + self + } + ///

An ARN that uniquely identifies a recovery point; for example, arn:aws:backup:us-east-1:123456789012:recovery-point:1EB3B5E7-9EB0-435A-A80B-108B488B0D45.

+ pub fn get_recovery_point_arn(&self) -> &::std::option::Option<::std::string::String> { + self.inner.get_recovery_point_arn() + } + ///

This specifies the IAM role ARN used for this operation.

+ ///

For example, arn:aws:iam::123456789012:role/S3Access

+ pub fn iam_role_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.inner = self.inner.iam_role_arn(input.into()); + self + } + ///

This specifies the IAM role ARN used for this operation.

+ ///

For example, arn:aws:iam::123456789012:role/S3Access

+ pub fn set_iam_role_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.inner = self.inner.set_iam_role_arn(input); + self + } + ///

This specifies the IAM role ARN used for this operation.

+ ///

For example, arn:aws:iam::123456789012:role/S3Access

+ pub fn get_iam_role_arn(&self) -> &::std::option::Option<::std::string::String> { + self.inner.get_iam_role_arn() + } + ///

Index can have 1 of 2 possible values, either ENABLED or DISABLED.

+ ///

To create a backup index for an eligible ACTIVE recovery point that does not yet have a backup index, set value to ENABLED.

+ ///

To delete a backup index, set value to DISABLED.

+ pub fn index(mut self, input: crate::types::Index) -> Self { + self.inner = self.inner.index(input); + self + } + ///

Index can have 1 of 2 possible values, either ENABLED or DISABLED.

+ ///

To create a backup index for an eligible ACTIVE recovery point that does not yet have a backup index, set value to ENABLED.

+ ///

To delete a backup index, set value to DISABLED.

+ pub fn set_index(mut self, input: ::std::option::Option) -> Self { + self.inner = self.inner.set_index(input); + self + } + ///

Index can have 1 of 2 possible values, either ENABLED or DISABLED.

+ ///

To create a backup index for an eligible ACTIVE recovery point that does not yet have a backup index, set value to ENABLED.

+ ///

To delete a backup index, set value to DISABLED.

+ pub fn get_index(&self) -> &::std::option::Option { + self.inner.get_index() + } +} diff --git a/sdk/backup/src/protocol_serde.rs b/sdk/backup/src/protocol_serde.rs index f94c9aac8d9b..d8ff7226b41b 100644 --- a/sdk/backup/src/protocol_serde.rs +++ b/sdk/backup/src/protocol_serde.rs @@ -107,6 +107,8 @@ pub(crate) mod shape_get_backup_vault_notifications; pub(crate) mod shape_get_legal_hold; +pub(crate) mod shape_get_recovery_point_index_details; + pub(crate) mod shape_get_recovery_point_restore_metadata; pub(crate) mod shape_get_restore_job_metadata; @@ -139,6 +141,8 @@ pub(crate) mod shape_list_copy_jobs; pub(crate) mod shape_list_frameworks; +pub(crate) mod shape_list_indexed_recovery_points; + pub(crate) mod shape_list_legal_holds; pub(crate) mod shape_list_protected_resources; @@ -195,6 +199,8 @@ pub(crate) mod shape_update_framework; pub(crate) mod shape_update_global_settings; +pub(crate) mod shape_update_recovery_point_index_settings; + pub(crate) mod shape_update_recovery_point_lifecycle; pub(crate) mod shape_update_region_settings; @@ -279,6 +285,8 @@ pub(crate) mod shape_update_framework_input; pub(crate) mod shape_update_global_settings_input; +pub(crate) mod shape_update_recovery_point_index_settings_input; + pub(crate) mod shape_update_recovery_point_lifecycle_input; pub(crate) mod shape_update_region_settings_input; @@ -333,6 +341,8 @@ pub(crate) mod shape_framework_list; pub(crate) mod shape_global_settings; +pub(crate) mod shape_indexed_recovery_point_list; + pub(crate) mod shape_legal_holds_list; pub(crate) mod shape_lifecycle; @@ -429,6 +439,8 @@ pub(crate) mod shape_date_range; pub(crate) mod shape_framework; +pub(crate) mod shape_indexed_recovery_point; + pub(crate) mod shape_legal_hold; pub(crate) mod shape_list_of_tags; @@ -477,6 +489,8 @@ pub(crate) mod shape_copy_action; pub(crate) mod shape_format_list; +pub(crate) mod shape_index_action; + pub(crate) mod shape_key_value; pub(crate) mod shape_key_value_list; @@ -487,4 +501,6 @@ pub(crate) mod shape_compliance_resource_id_list; pub(crate) mod shape_copy_actions; +pub(crate) mod shape_index_actions; + pub(crate) mod shape_resource_type_list; diff --git a/sdk/backup/src/protocol_serde/shape_backup_rule.rs b/sdk/backup/src/protocol_serde/shape_backup_rule.rs index 04d1a1893cb9..263625d8ad86 100644 --- a/sdk/backup/src/protocol_serde/shape_backup_rule.rs +++ b/sdk/backup/src/protocol_serde/shape_backup_rule.rs @@ -76,6 +76,9 @@ where .transpose()?, ); } + "IndexActions" => { + builder = builder.set_index_actions(crate::protocol_serde::shape_index_actions::de_index_actions(tokens)?); + } _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?, }, other => { diff --git a/sdk/backup/src/protocol_serde/shape_backup_rule_input.rs b/sdk/backup/src/protocol_serde/shape_backup_rule_input.rs index 5275d6c815b7..21b567c18c87 100644 --- a/sdk/backup/src/protocol_serde/shape_backup_rule_input.rs +++ b/sdk/backup/src/protocol_serde/shape_backup_rule_input.rs @@ -58,5 +58,17 @@ pub fn ser_backup_rule_input( if let Some(var_15) = &input.schedule_expression_timezone { object.key("ScheduleExpressionTimezone").string(var_15.as_str()); } + if let Some(var_16) = &input.index_actions { + let mut array_17 = object.key("IndexActions").start_array(); + for item_18 in var_16 { + { + #[allow(unused_mut)] + let mut object_19 = array_17.value().start_object(); + crate::protocol_serde::shape_index_action::ser_index_action(&mut object_19, item_18)?; + object_19.finish(); + } + } + array_17.finish(); + } Ok(()) } diff --git a/sdk/backup/src/protocol_serde/shape_describe_recovery_point.rs b/sdk/backup/src/protocol_serde/shape_describe_recovery_point.rs index fdb6602b8f12..a6dca547d039 100644 --- a/sdk/backup/src/protocol_serde/shape_describe_recovery_point.rs +++ b/sdk/backup/src/protocol_serde/shape_describe_recovery_point.rs @@ -184,6 +184,20 @@ pub(crate) fn de_describe_recovery_point( .transpose()?, ); } + "IndexStatus" => { + builder = builder.set_index_status( + ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())? + .map(|s| s.to_unescaped().map(|u| crate::types::IndexStatus::from(u.as_ref()))) + .transpose()?, + ); + } + "IndexStatusMessage" => { + builder = builder.set_index_status_message( + ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())? + .map(|s| s.to_unescaped().map(|u| u.into_owned())) + .transpose()?, + ); + } "IsEncrypted" => { builder = builder.set_is_encrypted(::aws_smithy_json::deserialize::token::expect_bool_or_null(tokens.next())?); } diff --git a/sdk/backup/src/protocol_serde/shape_get_recovery_point_index_details.rs b/sdk/backup/src/protocol_serde/shape_get_recovery_point_index_details.rs new file mode 100644 index 000000000000..9f4322c14cda --- /dev/null +++ b/sdk/backup/src/protocol_serde/shape_get_recovery_point_index_details.rs @@ -0,0 +1,212 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +#[allow(clippy::unnecessary_wraps)] +pub fn de_get_recovery_point_index_details_http_error( + _response_status: u16, + _response_headers: &::aws_smithy_runtime_api::http::Headers, + _response_body: &[u8], +) -> std::result::Result< + crate::operation::get_recovery_point_index_details::GetRecoveryPointIndexDetailsOutput, + crate::operation::get_recovery_point_index_details::GetRecoveryPointIndexDetailsError, +> { + #[allow(unused_mut)] + let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(_response_status, _response_headers, _response_body) + .map_err(crate::operation::get_recovery_point_index_details::GetRecoveryPointIndexDetailsError::unhandled)?; + generic_builder = ::aws_types::request_id::apply_request_id(generic_builder, _response_headers); + let generic = generic_builder.build(); + let error_code = match generic.code() { + Some(code) => code, + None => return Err(crate::operation::get_recovery_point_index_details::GetRecoveryPointIndexDetailsError::unhandled(generic)), + }; + + let _error_message = generic.message().map(|msg| msg.to_owned()); + Err(match error_code { + "InvalidParameterValueException" => { + crate::operation::get_recovery_point_index_details::GetRecoveryPointIndexDetailsError::InvalidParameterValueException({ + #[allow(unused_mut)] + let mut tmp = { + #[allow(unused_mut)] + let mut output = crate::types::error::builders::InvalidParameterValueExceptionBuilder::default(); + output = crate::protocol_serde::shape_invalid_parameter_value_exception::de_invalid_parameter_value_exception_json_err( + _response_body, + output, + ) + .map_err(crate::operation::get_recovery_point_index_details::GetRecoveryPointIndexDetailsError::unhandled)?; + let output = output.meta(generic); + output.build() + }; + if tmp.message.is_none() { + tmp.message = _error_message; + } + tmp + }) + } + "MissingParameterValueException" => { + crate::operation::get_recovery_point_index_details::GetRecoveryPointIndexDetailsError::MissingParameterValueException({ + #[allow(unused_mut)] + let mut tmp = { + #[allow(unused_mut)] + let mut output = crate::types::error::builders::MissingParameterValueExceptionBuilder::default(); + output = crate::protocol_serde::shape_missing_parameter_value_exception::de_missing_parameter_value_exception_json_err( + _response_body, + output, + ) + .map_err(crate::operation::get_recovery_point_index_details::GetRecoveryPointIndexDetailsError::unhandled)?; + let output = output.meta(generic); + output.build() + }; + if tmp.message.is_none() { + tmp.message = _error_message; + } + tmp + }) + } + "ResourceNotFoundException" => { + crate::operation::get_recovery_point_index_details::GetRecoveryPointIndexDetailsError::ResourceNotFoundException({ + #[allow(unused_mut)] + let mut tmp = { + #[allow(unused_mut)] + let mut output = crate::types::error::builders::ResourceNotFoundExceptionBuilder::default(); + output = + crate::protocol_serde::shape_resource_not_found_exception::de_resource_not_found_exception_json_err(_response_body, output) + .map_err(crate::operation::get_recovery_point_index_details::GetRecoveryPointIndexDetailsError::unhandled)?; + let output = output.meta(generic); + output.build() + }; + if tmp.message.is_none() { + tmp.message = _error_message; + } + tmp + }) + } + "ServiceUnavailableException" => { + crate::operation::get_recovery_point_index_details::GetRecoveryPointIndexDetailsError::ServiceUnavailableException({ + #[allow(unused_mut)] + let mut tmp = { + #[allow(unused_mut)] + let mut output = crate::types::error::builders::ServiceUnavailableExceptionBuilder::default(); + output = + crate::protocol_serde::shape_service_unavailable_exception::de_service_unavailable_exception_json_err(_response_body, output) + .map_err(crate::operation::get_recovery_point_index_details::GetRecoveryPointIndexDetailsError::unhandled)?; + let output = output.meta(generic); + output.build() + }; + if tmp.message.is_none() { + tmp.message = _error_message; + } + tmp + }) + } + _ => crate::operation::get_recovery_point_index_details::GetRecoveryPointIndexDetailsError::generic(generic), + }) +} + +#[allow(clippy::unnecessary_wraps)] +pub fn de_get_recovery_point_index_details_http_response( + _response_status: u16, + _response_headers: &::aws_smithy_runtime_api::http::Headers, + _response_body: &[u8], +) -> std::result::Result< + crate::operation::get_recovery_point_index_details::GetRecoveryPointIndexDetailsOutput, + crate::operation::get_recovery_point_index_details::GetRecoveryPointIndexDetailsError, +> { + Ok({ + #[allow(unused_mut)] + let mut output = crate::operation::get_recovery_point_index_details::builders::GetRecoveryPointIndexDetailsOutputBuilder::default(); + output = crate::protocol_serde::shape_get_recovery_point_index_details::de_get_recovery_point_index_details(_response_body, output) + .map_err(crate::operation::get_recovery_point_index_details::GetRecoveryPointIndexDetailsError::unhandled)?; + output._set_request_id(::aws_types::request_id::RequestId::request_id(_response_headers).map(str::to_string)); + output.build() + }) +} + +pub(crate) fn de_get_recovery_point_index_details( + value: &[u8], + mut builder: crate::operation::get_recovery_point_index_details::builders::GetRecoveryPointIndexDetailsOutputBuilder, +) -> Result< + crate::operation::get_recovery_point_index_details::builders::GetRecoveryPointIndexDetailsOutputBuilder, + ::aws_smithy_json::deserialize::error::DeserializeError, +> { + let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(value)).peekable(); + let tokens = &mut tokens_owned; + ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; + loop { + match tokens.next().transpose()? { + Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break, + Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() { + "BackupVaultArn" => { + builder = builder.set_backup_vault_arn( + ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())? + .map(|s| s.to_unescaped().map(|u| u.into_owned())) + .transpose()?, + ); + } + "IndexCompletionDate" => { + builder = builder.set_index_completion_date(::aws_smithy_json::deserialize::token::expect_timestamp_or_null( + tokens.next(), + ::aws_smithy_types::date_time::Format::EpochSeconds, + )?); + } + "IndexCreationDate" => { + builder = builder.set_index_creation_date(::aws_smithy_json::deserialize::token::expect_timestamp_or_null( + tokens.next(), + ::aws_smithy_types::date_time::Format::EpochSeconds, + )?); + } + "IndexDeletionDate" => { + builder = builder.set_index_deletion_date(::aws_smithy_json::deserialize::token::expect_timestamp_or_null( + tokens.next(), + ::aws_smithy_types::date_time::Format::EpochSeconds, + )?); + } + "IndexStatus" => { + builder = builder.set_index_status( + ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())? + .map(|s| s.to_unescaped().map(|u| crate::types::IndexStatus::from(u.as_ref()))) + .transpose()?, + ); + } + "IndexStatusMessage" => { + builder = builder.set_index_status_message( + ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())? + .map(|s| s.to_unescaped().map(|u| u.into_owned())) + .transpose()?, + ); + } + "RecoveryPointArn" => { + builder = builder.set_recovery_point_arn( + ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())? + .map(|s| s.to_unescaped().map(|u| u.into_owned())) + .transpose()?, + ); + } + "SourceResourceArn" => { + builder = builder.set_source_resource_arn( + ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())? + .map(|s| s.to_unescaped().map(|u| u.into_owned())) + .transpose()?, + ); + } + "TotalItemsIndexed" => { + builder = builder.set_total_items_indexed( + ::aws_smithy_json::deserialize::token::expect_number_or_null(tokens.next())? + .map(i64::try_from) + .transpose()?, + ); + } + _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?, + }, + other => { + return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!( + "expected object key or end object, found: {:?}", + other + ))) + } + } + } + if tokens.next().is_some() { + return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom( + "found more JSON tokens after completing parsing", + )); + } + Ok(builder) +} diff --git a/sdk/backup/src/protocol_serde/shape_index_action.rs b/sdk/backup/src/protocol_serde/shape_index_action.rs new file mode 100644 index 000000000000..b2cb4385438b --- /dev/null +++ b/sdk/backup/src/protocol_serde/shape_index_action.rs @@ -0,0 +1,52 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +pub fn ser_index_action( + object: &mut ::aws_smithy_json::serialize::JsonObjectWriter, + input: &crate::types::IndexAction, +) -> Result<(), ::aws_smithy_types::error::operation::SerializationError> { + if let Some(var_1) = &input.resource_types { + let mut array_2 = object.key("ResourceTypes").start_array(); + for item_3 in var_1 { + { + array_2.value().string(item_3.as_str()); + } + } + array_2.finish(); + } + Ok(()) +} + +pub(crate) fn de_index_action<'a, I>( + tokens: &mut ::std::iter::Peekable, +) -> Result, ::aws_smithy_json::deserialize::error::DeserializeError> +where + I: Iterator, ::aws_smithy_json::deserialize::error::DeserializeError>>, +{ + match tokens.next().transpose()? { + Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), + Some(::aws_smithy_json::deserialize::Token::StartObject { .. }) => { + #[allow(unused_mut)] + let mut builder = crate::types::builders::IndexActionBuilder::default(); + loop { + match tokens.next().transpose()? { + Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break, + Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() { + "ResourceTypes" => { + builder = builder.set_resource_types(crate::protocol_serde::shape_resource_types::de_resource_types(tokens)?); + } + _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?, + }, + other => { + return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!( + "expected object key or end object, found: {:?}", + other + ))) + } + } + } + Ok(Some(builder.build())) + } + _ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom( + "expected start object or null", + )), + } +} diff --git a/sdk/backup/src/protocol_serde/shape_index_actions.rs b/sdk/backup/src/protocol_serde/shape_index_actions.rs new file mode 100644 index 000000000000..ac70f60c6bee --- /dev/null +++ b/sdk/backup/src/protocol_serde/shape_index_actions.rs @@ -0,0 +1,32 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +pub(crate) fn de_index_actions<'a, I>( + tokens: &mut ::std::iter::Peekable, +) -> Result>, ::aws_smithy_json::deserialize::error::DeserializeError> +where + I: Iterator, ::aws_smithy_json::deserialize::error::DeserializeError>>, +{ + match tokens.next().transpose()? { + Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), + Some(::aws_smithy_json::deserialize::Token::StartArray { .. }) => { + let mut items = Vec::new(); + loop { + match tokens.peek() { + Some(Ok(::aws_smithy_json::deserialize::Token::EndArray { .. })) => { + tokens.next().transpose().unwrap(); + break; + } + _ => { + let value = crate::protocol_serde::shape_index_action::de_index_action(tokens)?; + if let Some(value) = value { + items.push(value); + } + } + } + } + Ok(Some(items)) + } + _ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom( + "expected start array or null", + )), + } +} diff --git a/sdk/backup/src/protocol_serde/shape_indexed_recovery_point.rs b/sdk/backup/src/protocol_serde/shape_indexed_recovery_point.rs new file mode 100644 index 000000000000..0fa19318cc62 --- /dev/null +++ b/sdk/backup/src/protocol_serde/shape_indexed_recovery_point.rs @@ -0,0 +1,94 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +pub(crate) fn de_indexed_recovery_point<'a, I>( + tokens: &mut ::std::iter::Peekable, +) -> Result, ::aws_smithy_json::deserialize::error::DeserializeError> +where + I: Iterator, ::aws_smithy_json::deserialize::error::DeserializeError>>, +{ + match tokens.next().transpose()? { + Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), + Some(::aws_smithy_json::deserialize::Token::StartObject { .. }) => { + #[allow(unused_mut)] + let mut builder = crate::types::builders::IndexedRecoveryPointBuilder::default(); + loop { + match tokens.next().transpose()? { + Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break, + Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() { + "RecoveryPointArn" => { + builder = builder.set_recovery_point_arn( + ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())? + .map(|s| s.to_unescaped().map(|u| u.into_owned())) + .transpose()?, + ); + } + "SourceResourceArn" => { + builder = builder.set_source_resource_arn( + ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())? + .map(|s| s.to_unescaped().map(|u| u.into_owned())) + .transpose()?, + ); + } + "IamRoleArn" => { + builder = builder.set_iam_role_arn( + ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())? + .map(|s| s.to_unescaped().map(|u| u.into_owned())) + .transpose()?, + ); + } + "BackupCreationDate" => { + builder = builder.set_backup_creation_date(::aws_smithy_json::deserialize::token::expect_timestamp_or_null( + tokens.next(), + ::aws_smithy_types::date_time::Format::EpochSeconds, + )?); + } + "ResourceType" => { + builder = builder.set_resource_type( + ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())? + .map(|s| s.to_unescaped().map(|u| u.into_owned())) + .transpose()?, + ); + } + "IndexCreationDate" => { + builder = builder.set_index_creation_date(::aws_smithy_json::deserialize::token::expect_timestamp_or_null( + tokens.next(), + ::aws_smithy_types::date_time::Format::EpochSeconds, + )?); + } + "IndexStatus" => { + builder = builder.set_index_status( + ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())? + .map(|s| s.to_unescaped().map(|u| crate::types::IndexStatus::from(u.as_ref()))) + .transpose()?, + ); + } + "IndexStatusMessage" => { + builder = builder.set_index_status_message( + ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())? + .map(|s| s.to_unescaped().map(|u| u.into_owned())) + .transpose()?, + ); + } + "BackupVaultArn" => { + builder = builder.set_backup_vault_arn( + ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())? + .map(|s| s.to_unescaped().map(|u| u.into_owned())) + .transpose()?, + ); + } + _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?, + }, + other => { + return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!( + "expected object key or end object, found: {:?}", + other + ))) + } + } + } + Ok(Some(builder.build())) + } + _ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom( + "expected start object or null", + )), + } +} diff --git a/sdk/backup/src/protocol_serde/shape_indexed_recovery_point_list.rs b/sdk/backup/src/protocol_serde/shape_indexed_recovery_point_list.rs new file mode 100644 index 000000000000..8aea6e76fc48 --- /dev/null +++ b/sdk/backup/src/protocol_serde/shape_indexed_recovery_point_list.rs @@ -0,0 +1,32 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +pub(crate) fn de_indexed_recovery_point_list<'a, I>( + tokens: &mut ::std::iter::Peekable, +) -> Result>, ::aws_smithy_json::deserialize::error::DeserializeError> +where + I: Iterator, ::aws_smithy_json::deserialize::error::DeserializeError>>, +{ + match tokens.next().transpose()? { + Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), + Some(::aws_smithy_json::deserialize::Token::StartArray { .. }) => { + let mut items = Vec::new(); + loop { + match tokens.peek() { + Some(Ok(::aws_smithy_json::deserialize::Token::EndArray { .. })) => { + tokens.next().transpose().unwrap(); + break; + } + _ => { + let value = crate::protocol_serde::shape_indexed_recovery_point::de_indexed_recovery_point(tokens)?; + if let Some(value) = value { + items.push(value); + } + } + } + } + Ok(Some(items)) + } + _ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom( + "expected start array or null", + )), + } +} diff --git a/sdk/backup/src/protocol_serde/shape_list_indexed_recovery_points.rs b/sdk/backup/src/protocol_serde/shape_list_indexed_recovery_points.rs new file mode 100644 index 000000000000..5f454a921085 --- /dev/null +++ b/sdk/backup/src/protocol_serde/shape_list_indexed_recovery_points.rs @@ -0,0 +1,145 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +#[allow(clippy::unnecessary_wraps)] +pub fn de_list_indexed_recovery_points_http_error( + _response_status: u16, + _response_headers: &::aws_smithy_runtime_api::http::Headers, + _response_body: &[u8], +) -> std::result::Result< + crate::operation::list_indexed_recovery_points::ListIndexedRecoveryPointsOutput, + crate::operation::list_indexed_recovery_points::ListIndexedRecoveryPointsError, +> { + #[allow(unused_mut)] + let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(_response_status, _response_headers, _response_body) + .map_err(crate::operation::list_indexed_recovery_points::ListIndexedRecoveryPointsError::unhandled)?; + generic_builder = ::aws_types::request_id::apply_request_id(generic_builder, _response_headers); + let generic = generic_builder.build(); + let error_code = match generic.code() { + Some(code) => code, + None => { + return Err(crate::operation::list_indexed_recovery_points::ListIndexedRecoveryPointsError::unhandled( + generic, + )) + } + }; + + let _error_message = generic.message().map(|msg| msg.to_owned()); + Err(match error_code { + "InvalidParameterValueException" => { + crate::operation::list_indexed_recovery_points::ListIndexedRecoveryPointsError::InvalidParameterValueException({ + #[allow(unused_mut)] + let mut tmp = { + #[allow(unused_mut)] + let mut output = crate::types::error::builders::InvalidParameterValueExceptionBuilder::default(); + output = crate::protocol_serde::shape_invalid_parameter_value_exception::de_invalid_parameter_value_exception_json_err( + _response_body, + output, + ) + .map_err(crate::operation::list_indexed_recovery_points::ListIndexedRecoveryPointsError::unhandled)?; + let output = output.meta(generic); + output.build() + }; + if tmp.message.is_none() { + tmp.message = _error_message; + } + tmp + }) + } + "ResourceNotFoundException" => crate::operation::list_indexed_recovery_points::ListIndexedRecoveryPointsError::ResourceNotFoundException({ + #[allow(unused_mut)] + let mut tmp = { + #[allow(unused_mut)] + let mut output = crate::types::error::builders::ResourceNotFoundExceptionBuilder::default(); + output = crate::protocol_serde::shape_resource_not_found_exception::de_resource_not_found_exception_json_err(_response_body, output) + .map_err(crate::operation::list_indexed_recovery_points::ListIndexedRecoveryPointsError::unhandled)?; + let output = output.meta(generic); + output.build() + }; + if tmp.message.is_none() { + tmp.message = _error_message; + } + tmp + }), + "ServiceUnavailableException" => { + crate::operation::list_indexed_recovery_points::ListIndexedRecoveryPointsError::ServiceUnavailableException({ + #[allow(unused_mut)] + let mut tmp = { + #[allow(unused_mut)] + let mut output = crate::types::error::builders::ServiceUnavailableExceptionBuilder::default(); + output = + crate::protocol_serde::shape_service_unavailable_exception::de_service_unavailable_exception_json_err(_response_body, output) + .map_err(crate::operation::list_indexed_recovery_points::ListIndexedRecoveryPointsError::unhandled)?; + let output = output.meta(generic); + output.build() + }; + if tmp.message.is_none() { + tmp.message = _error_message; + } + tmp + }) + } + _ => crate::operation::list_indexed_recovery_points::ListIndexedRecoveryPointsError::generic(generic), + }) +} + +#[allow(clippy::unnecessary_wraps)] +pub fn de_list_indexed_recovery_points_http_response( + _response_status: u16, + _response_headers: &::aws_smithy_runtime_api::http::Headers, + _response_body: &[u8], +) -> std::result::Result< + crate::operation::list_indexed_recovery_points::ListIndexedRecoveryPointsOutput, + crate::operation::list_indexed_recovery_points::ListIndexedRecoveryPointsError, +> { + Ok({ + #[allow(unused_mut)] + let mut output = crate::operation::list_indexed_recovery_points::builders::ListIndexedRecoveryPointsOutputBuilder::default(); + output = crate::protocol_serde::shape_list_indexed_recovery_points::de_list_indexed_recovery_points(_response_body, output) + .map_err(crate::operation::list_indexed_recovery_points::ListIndexedRecoveryPointsError::unhandled)?; + output._set_request_id(::aws_types::request_id::RequestId::request_id(_response_headers).map(str::to_string)); + output.build() + }) +} + +pub(crate) fn de_list_indexed_recovery_points( + value: &[u8], + mut builder: crate::operation::list_indexed_recovery_points::builders::ListIndexedRecoveryPointsOutputBuilder, +) -> Result< + crate::operation::list_indexed_recovery_points::builders::ListIndexedRecoveryPointsOutputBuilder, + ::aws_smithy_json::deserialize::error::DeserializeError, +> { + let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(value)).peekable(); + let tokens = &mut tokens_owned; + ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; + loop { + match tokens.next().transpose()? { + Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break, + Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() { + "IndexedRecoveryPoints" => { + builder = builder.set_indexed_recovery_points( + crate::protocol_serde::shape_indexed_recovery_point_list::de_indexed_recovery_point_list(tokens)?, + ); + } + "NextToken" => { + builder = builder.set_next_token( + ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())? + .map(|s| s.to_unescaped().map(|u| u.into_owned())) + .transpose()?, + ); + } + _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?, + }, + other => { + return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!( + "expected object key or end object, found: {:?}", + other + ))) + } + } + } + if tokens.next().is_some() { + return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom( + "found more JSON tokens after completing parsing", + )); + } + Ok(builder) +} diff --git a/sdk/backup/src/protocol_serde/shape_recovery_point_by_backup_vault.rs b/sdk/backup/src/protocol_serde/shape_recovery_point_by_backup_vault.rs index 9d78e47f715d..fa2332b5d558 100644 --- a/sdk/backup/src/protocol_serde/shape_recovery_point_by_backup_vault.rs +++ b/sdk/backup/src/protocol_serde/shape_recovery_point_by_backup_vault.rs @@ -153,6 +153,20 @@ where .transpose()?, ); } + "IndexStatus" => { + builder = builder.set_index_status( + ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())? + .map(|s| s.to_unescaped().map(|u| crate::types::IndexStatus::from(u.as_ref()))) + .transpose()?, + ); + } + "IndexStatusMessage" => { + builder = builder.set_index_status_message( + ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())? + .map(|s| s.to_unescaped().map(|u| u.into_owned())) + .transpose()?, + ); + } _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?, }, other => { diff --git a/sdk/backup/src/protocol_serde/shape_recovery_point_by_resource.rs b/sdk/backup/src/protocol_serde/shape_recovery_point_by_resource.rs index d678b3f6db1a..bc6cd76ec175 100644 --- a/sdk/backup/src/protocol_serde/shape_recovery_point_by_resource.rs +++ b/sdk/backup/src/protocol_serde/shape_recovery_point_by_resource.rs @@ -86,6 +86,20 @@ where .transpose()?, ); } + "IndexStatus" => { + builder = builder.set_index_status( + ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())? + .map(|s| s.to_unescaped().map(|u| crate::types::IndexStatus::from(u.as_ref()))) + .transpose()?, + ); + } + "IndexStatusMessage" => { + builder = builder.set_index_status_message( + ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())? + .map(|s| s.to_unescaped().map(|u| u.into_owned())) + .transpose()?, + ); + } _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?, }, other => { diff --git a/sdk/backup/src/protocol_serde/shape_start_backup_job_input.rs b/sdk/backup/src/protocol_serde/shape_start_backup_job_input.rs index 5283f6d9da2b..7da8cd606413 100644 --- a/sdk/backup/src/protocol_serde/shape_start_backup_job_input.rs +++ b/sdk/backup/src/protocol_serde/shape_start_backup_job_input.rs @@ -28,29 +28,32 @@ pub fn ser_start_backup_job_input_input( if let Some(var_8) = &input.idempotency_token { object.key("IdempotencyToken").string(var_8.as_str()); } - if let Some(var_9) = &input.lifecycle { + if let Some(var_9) = &input.index { + object.key("Index").string(var_9.as_str()); + } + if let Some(var_10) = &input.lifecycle { #[allow(unused_mut)] - let mut object_10 = object.key("Lifecycle").start_object(); - crate::protocol_serde::shape_lifecycle::ser_lifecycle(&mut object_10, var_9)?; - object_10.finish(); + let mut object_11 = object.key("Lifecycle").start_object(); + crate::protocol_serde::shape_lifecycle::ser_lifecycle(&mut object_11, var_10)?; + object_11.finish(); } - if let Some(var_11) = &input.recovery_point_tags { + if let Some(var_12) = &input.recovery_point_tags { #[allow(unused_mut)] - let mut object_12 = object.key("RecoveryPointTags").start_object(); - for (key_13, value_14) in var_11 { + let mut object_13 = object.key("RecoveryPointTags").start_object(); + for (key_14, value_15) in var_12 { { - object_12.key(key_13.as_str()).string(value_14.as_str()); + object_13.key(key_14.as_str()).string(value_15.as_str()); } } - object_12.finish(); + object_13.finish(); } - if let Some(var_15) = &input.resource_arn { - object.key("ResourceArn").string(var_15.as_str()); + if let Some(var_16) = &input.resource_arn { + object.key("ResourceArn").string(var_16.as_str()); } - if let Some(var_16) = &input.start_window_minutes { + if let Some(var_17) = &input.start_window_minutes { object.key("StartWindowMinutes").number( #[allow(clippy::useless_conversion)] - ::aws_smithy_types::Number::NegInt((*var_16).into()), + ::aws_smithy_types::Number::NegInt((*var_17).into()), ); } Ok(()) diff --git a/sdk/backup/src/protocol_serde/shape_update_recovery_point_index_settings.rs b/sdk/backup/src/protocol_serde/shape_update_recovery_point_index_settings.rs new file mode 100644 index 000000000000..33d249e67209 --- /dev/null +++ b/sdk/backup/src/protocol_serde/shape_update_recovery_point_index_settings.rs @@ -0,0 +1,210 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +#[allow(clippy::unnecessary_wraps)] +pub fn de_update_recovery_point_index_settings_http_error( + _response_status: u16, + _response_headers: &::aws_smithy_runtime_api::http::Headers, + _response_body: &[u8], +) -> std::result::Result< + crate::operation::update_recovery_point_index_settings::UpdateRecoveryPointIndexSettingsOutput, + crate::operation::update_recovery_point_index_settings::UpdateRecoveryPointIndexSettingsError, +> { + #[allow(unused_mut)] + let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(_response_status, _response_headers, _response_body) + .map_err(crate::operation::update_recovery_point_index_settings::UpdateRecoveryPointIndexSettingsError::unhandled)?; + generic_builder = ::aws_types::request_id::apply_request_id(generic_builder, _response_headers); + let generic = generic_builder.build(); + let error_code = match generic.code() { + Some(code) => code, + None => return Err(crate::operation::update_recovery_point_index_settings::UpdateRecoveryPointIndexSettingsError::unhandled(generic)), + }; + + let _error_message = generic.message().map(|msg| msg.to_owned()); + Err(match error_code { + "InvalidParameterValueException" => { + crate::operation::update_recovery_point_index_settings::UpdateRecoveryPointIndexSettingsError::InvalidParameterValueException({ + #[allow(unused_mut)] + let mut tmp = { + #[allow(unused_mut)] + let mut output = crate::types::error::builders::InvalidParameterValueExceptionBuilder::default(); + output = crate::protocol_serde::shape_invalid_parameter_value_exception::de_invalid_parameter_value_exception_json_err( + _response_body, + output, + ) + .map_err(crate::operation::update_recovery_point_index_settings::UpdateRecoveryPointIndexSettingsError::unhandled)?; + let output = output.meta(generic); + output.build() + }; + if tmp.message.is_none() { + tmp.message = _error_message; + } + tmp + }) + } + "InvalidRequestException" => { + crate::operation::update_recovery_point_index_settings::UpdateRecoveryPointIndexSettingsError::InvalidRequestException({ + #[allow(unused_mut)] + let mut tmp = { + #[allow(unused_mut)] + let mut output = crate::types::error::builders::InvalidRequestExceptionBuilder::default(); + output = crate::protocol_serde::shape_invalid_request_exception::de_invalid_request_exception_json_err(_response_body, output) + .map_err(crate::operation::update_recovery_point_index_settings::UpdateRecoveryPointIndexSettingsError::unhandled)?; + let output = output.meta(generic); + output.build() + }; + if tmp.message.is_none() { + tmp.message = _error_message; + } + tmp + }) + } + "MissingParameterValueException" => { + crate::operation::update_recovery_point_index_settings::UpdateRecoveryPointIndexSettingsError::MissingParameterValueException({ + #[allow(unused_mut)] + let mut tmp = { + #[allow(unused_mut)] + let mut output = crate::types::error::builders::MissingParameterValueExceptionBuilder::default(); + output = crate::protocol_serde::shape_missing_parameter_value_exception::de_missing_parameter_value_exception_json_err( + _response_body, + output, + ) + .map_err(crate::operation::update_recovery_point_index_settings::UpdateRecoveryPointIndexSettingsError::unhandled)?; + let output = output.meta(generic); + output.build() + }; + if tmp.message.is_none() { + tmp.message = _error_message; + } + tmp + }) + } + "ResourceNotFoundException" => { + crate::operation::update_recovery_point_index_settings::UpdateRecoveryPointIndexSettingsError::ResourceNotFoundException({ + #[allow(unused_mut)] + let mut tmp = { + #[allow(unused_mut)] + let mut output = crate::types::error::builders::ResourceNotFoundExceptionBuilder::default(); + output = + crate::protocol_serde::shape_resource_not_found_exception::de_resource_not_found_exception_json_err(_response_body, output) + .map_err(crate::operation::update_recovery_point_index_settings::UpdateRecoveryPointIndexSettingsError::unhandled)?; + let output = output.meta(generic); + output.build() + }; + if tmp.message.is_none() { + tmp.message = _error_message; + } + tmp + }) + } + "ServiceUnavailableException" => { + crate::operation::update_recovery_point_index_settings::UpdateRecoveryPointIndexSettingsError::ServiceUnavailableException({ + #[allow(unused_mut)] + let mut tmp = { + #[allow(unused_mut)] + let mut output = crate::types::error::builders::ServiceUnavailableExceptionBuilder::default(); + output = + crate::protocol_serde::shape_service_unavailable_exception::de_service_unavailable_exception_json_err(_response_body, output) + .map_err(crate::operation::update_recovery_point_index_settings::UpdateRecoveryPointIndexSettingsError::unhandled)?; + let output = output.meta(generic); + output.build() + }; + if tmp.message.is_none() { + tmp.message = _error_message; + } + tmp + }) + } + _ => crate::operation::update_recovery_point_index_settings::UpdateRecoveryPointIndexSettingsError::generic(generic), + }) +} + +#[allow(clippy::unnecessary_wraps)] +pub fn de_update_recovery_point_index_settings_http_response( + _response_status: u16, + _response_headers: &::aws_smithy_runtime_api::http::Headers, + _response_body: &[u8], +) -> std::result::Result< + crate::operation::update_recovery_point_index_settings::UpdateRecoveryPointIndexSettingsOutput, + crate::operation::update_recovery_point_index_settings::UpdateRecoveryPointIndexSettingsError, +> { + Ok({ + #[allow(unused_mut)] + let mut output = crate::operation::update_recovery_point_index_settings::builders::UpdateRecoveryPointIndexSettingsOutputBuilder::default(); + output = crate::protocol_serde::shape_update_recovery_point_index_settings::de_update_recovery_point_index_settings(_response_body, output) + .map_err(crate::operation::update_recovery_point_index_settings::UpdateRecoveryPointIndexSettingsError::unhandled)?; + output._set_request_id(::aws_types::request_id::RequestId::request_id(_response_headers).map(str::to_string)); + output.build() + }) +} + +pub fn ser_update_recovery_point_index_settings_input( + input: &crate::operation::update_recovery_point_index_settings::UpdateRecoveryPointIndexSettingsInput, +) -> Result<::aws_smithy_types::body::SdkBody, ::aws_smithy_types::error::operation::SerializationError> { + let mut out = String::new(); + let mut object = ::aws_smithy_json::serialize::JsonObjectWriter::new(&mut out); + crate::protocol_serde::shape_update_recovery_point_index_settings_input::ser_update_recovery_point_index_settings_input_input( + &mut object, + input, + )?; + object.finish(); + Ok(::aws_smithy_types::body::SdkBody::from(out)) +} + +pub(crate) fn de_update_recovery_point_index_settings( + value: &[u8], + mut builder: crate::operation::update_recovery_point_index_settings::builders::UpdateRecoveryPointIndexSettingsOutputBuilder, +) -> Result< + crate::operation::update_recovery_point_index_settings::builders::UpdateRecoveryPointIndexSettingsOutputBuilder, + ::aws_smithy_json::deserialize::error::DeserializeError, +> { + let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(value)).peekable(); + let tokens = &mut tokens_owned; + ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; + loop { + match tokens.next().transpose()? { + Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break, + Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() { + "BackupVaultName" => { + builder = builder.set_backup_vault_name( + ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())? + .map(|s| s.to_unescaped().map(|u| u.into_owned())) + .transpose()?, + ); + } + "Index" => { + builder = builder.set_index( + ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())? + .map(|s| s.to_unescaped().map(|u| crate::types::Index::from(u.as_ref()))) + .transpose()?, + ); + } + "IndexStatus" => { + builder = builder.set_index_status( + ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())? + .map(|s| s.to_unescaped().map(|u| crate::types::IndexStatus::from(u.as_ref()))) + .transpose()?, + ); + } + "RecoveryPointArn" => { + builder = builder.set_recovery_point_arn( + ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())? + .map(|s| s.to_unescaped().map(|u| u.into_owned())) + .transpose()?, + ); + } + _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?, + }, + other => { + return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!( + "expected object key or end object, found: {:?}", + other + ))) + } + } + } + if tokens.next().is_some() { + return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom( + "found more JSON tokens after completing parsing", + )); + } + Ok(builder) +} diff --git a/sdk/backup/src/protocol_serde/shape_update_recovery_point_index_settings_input.rs b/sdk/backup/src/protocol_serde/shape_update_recovery_point_index_settings_input.rs new file mode 100644 index 000000000000..22eee9c0c19a --- /dev/null +++ b/sdk/backup/src/protocol_serde/shape_update_recovery_point_index_settings_input.rs @@ -0,0 +1,13 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +pub fn ser_update_recovery_point_index_settings_input_input( + object: &mut ::aws_smithy_json::serialize::JsonObjectWriter, + input: &crate::operation::update_recovery_point_index_settings::UpdateRecoveryPointIndexSettingsInput, +) -> Result<(), ::aws_smithy_types::error::operation::SerializationError> { + if let Some(var_1) = &input.iam_role_arn { + object.key("IamRoleArn").string(var_1.as_str()); + } + if let Some(var_2) = &input.index { + object.key("Index").string(var_2.as_str()); + } + Ok(()) +} diff --git a/sdk/backup/src/types.rs b/sdk/backup/src/types.rs index 022428a51c68..1b9f7b811e34 100644 --- a/sdk/backup/src/types.rs +++ b/sdk/backup/src/types.rs @@ -21,6 +21,10 @@ pub use crate::types::_calculated_lifecycle::CalculatedLifecycle; pub use crate::types::_lifecycle::Lifecycle; +pub use crate::types::_index::Index; + +pub use crate::types::_index_status::IndexStatus; + pub use crate::types::_framework_control::FrameworkControl; pub use crate::types::_control_scope::ControlScope; @@ -33,6 +37,8 @@ pub use crate::types::_backup_plan_input::BackupPlanInput; pub use crate::types::_backup_rule_input::BackupRuleInput; +pub use crate::types::_index_action::IndexAction; + pub use crate::types::_copy_action::CopyAction; pub use crate::types::_restore_validation_status::RestoreValidationStatus; @@ -81,6 +87,8 @@ pub use crate::types::_legal_hold::LegalHold; pub use crate::types::_legal_hold_status::LegalHoldStatus; +pub use crate::types::_indexed_recovery_point::IndexedRecoveryPoint; + pub use crate::types::_framework::Framework; pub use crate::types::_copy_job_summary::CopyJobSummary; @@ -199,6 +207,14 @@ mod _framework; mod _framework_control; +mod _index; + +mod _index_action; + +mod _index_status; + +mod _indexed_recovery_point; + mod _key_value; mod _legal_hold; diff --git a/sdk/backup/src/types/_backup_rule.rs b/sdk/backup/src/types/_backup_rule.rs index d7b94869bb01..92c9ee714add 100644 --- a/sdk/backup/src/types/_backup_rule.rs +++ b/sdk/backup/src/types/_backup_rule.rs @@ -29,6 +29,10 @@ pub struct BackupRule { pub enable_continuous_backup: ::std::option::Option, ///

The timezone in which the schedule expression is set. By default, ScheduleExpressions are in UTC. You can modify this to a specified timezone.

pub schedule_expression_timezone: ::std::option::Option<::std::string::String>, + ///

IndexActions is an array you use to specify how backup data should be indexed.

+ ///

eEach BackupRule can have 0 or 1 IndexAction, as each backup can have up to one index associated with it.

+ ///

Within the array is ResourceType. Only one will be accepted for each BackupRule.

+ pub index_actions: ::std::option::Option<::std::vec::Vec>, } impl BackupRule { ///

A display name for a backup rule. Must contain 1 to 50 alphanumeric or '-_.' characters.

@@ -82,6 +86,14 @@ impl BackupRule { pub fn schedule_expression_timezone(&self) -> ::std::option::Option<&str> { self.schedule_expression_timezone.as_deref() } + ///

IndexActions is an array you use to specify how backup data should be indexed.

+ ///

eEach BackupRule can have 0 or 1 IndexAction, as each backup can have up to one index associated with it.

+ ///

Within the array is ResourceType. Only one will be accepted for each BackupRule.

+ /// + /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.index_actions.is_none()`. + pub fn index_actions(&self) -> &[crate::types::IndexAction] { + self.index_actions.as_deref().unwrap_or_default() + } } impl ::std::fmt::Debug for BackupRule { fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { @@ -97,6 +109,7 @@ impl ::std::fmt::Debug for BackupRule { formatter.field("copy_actions", &self.copy_actions); formatter.field("enable_continuous_backup", &self.enable_continuous_backup); formatter.field("schedule_expression_timezone", &self.schedule_expression_timezone); + formatter.field("index_actions", &self.index_actions); formatter.finish() } } @@ -122,6 +135,7 @@ pub struct BackupRuleBuilder { pub(crate) copy_actions: ::std::option::Option<::std::vec::Vec>, pub(crate) enable_continuous_backup: ::std::option::Option, pub(crate) schedule_expression_timezone: ::std::option::Option<::std::string::String>, + pub(crate) index_actions: ::std::option::Option<::std::vec::Vec>, } impl BackupRuleBuilder { ///

A display name for a backup rule. Must contain 1 to 50 alphanumeric or '-_.' characters.

@@ -308,6 +322,32 @@ impl BackupRuleBuilder { pub fn get_schedule_expression_timezone(&self) -> &::std::option::Option<::std::string::String> { &self.schedule_expression_timezone } + /// Appends an item to `index_actions`. + /// + /// To override the contents of this collection use [`set_index_actions`](Self::set_index_actions). + /// + ///

IndexActions is an array you use to specify how backup data should be indexed.

+ ///

eEach BackupRule can have 0 or 1 IndexAction, as each backup can have up to one index associated with it.

+ ///

Within the array is ResourceType. Only one will be accepted for each BackupRule.

+ pub fn index_actions(mut self, input: crate::types::IndexAction) -> Self { + let mut v = self.index_actions.unwrap_or_default(); + v.push(input); + self.index_actions = ::std::option::Option::Some(v); + self + } + ///

IndexActions is an array you use to specify how backup data should be indexed.

+ ///

eEach BackupRule can have 0 or 1 IndexAction, as each backup can have up to one index associated with it.

+ ///

Within the array is ResourceType. Only one will be accepted for each BackupRule.

+ pub fn set_index_actions(mut self, input: ::std::option::Option<::std::vec::Vec>) -> Self { + self.index_actions = input; + self + } + ///

IndexActions is an array you use to specify how backup data should be indexed.

+ ///

eEach BackupRule can have 0 or 1 IndexAction, as each backup can have up to one index associated with it.

+ ///

Within the array is ResourceType. Only one will be accepted for each BackupRule.

+ pub fn get_index_actions(&self) -> &::std::option::Option<::std::vec::Vec> { + &self.index_actions + } /// Consumes the builder and constructs a [`BackupRule`](crate::types::BackupRule). /// This method will fail if any of the following fields are not set: /// - [`rule_name`](crate::types::builders::BackupRuleBuilder::rule_name) @@ -335,6 +375,7 @@ impl BackupRuleBuilder { copy_actions: self.copy_actions, enable_continuous_backup: self.enable_continuous_backup, schedule_expression_timezone: self.schedule_expression_timezone, + index_actions: self.index_actions, }) } } @@ -352,6 +393,7 @@ impl ::std::fmt::Debug for BackupRuleBuilder { formatter.field("copy_actions", &self.copy_actions); formatter.field("enable_continuous_backup", &self.enable_continuous_backup); formatter.field("schedule_expression_timezone", &self.schedule_expression_timezone); + formatter.field("index_actions", &self.index_actions); formatter.finish() } } diff --git a/sdk/backup/src/types/_backup_rule_input.rs b/sdk/backup/src/types/_backup_rule_input.rs index bbcc073c6301..f64a4f5e0b65 100644 --- a/sdk/backup/src/types/_backup_rule_input.rs +++ b/sdk/backup/src/types/_backup_rule_input.rs @@ -29,6 +29,15 @@ pub struct BackupRuleInput { pub enable_continuous_backup: ::std::option::Option, ///

The timezone in which the schedule expression is set. By default, ScheduleExpressions are in UTC. You can modify this to a specified timezone.

pub schedule_expression_timezone: ::std::option::Option<::std::string::String>, + ///

There can up to one IndexAction in each BackupRule, as each backup can have 0 or 1 backup index associated with it.

+ ///

Within the array is ResourceTypes. Only 1 resource type will be accepted for each BackupRule. Valid values:

+ ///
    + ///
  • + ///

    EBS for Amazon Elastic Block Store

  • + ///
  • + ///

    S3 for Amazon Simple Storage Service (Amazon S3)

  • + ///
+ pub index_actions: ::std::option::Option<::std::vec::Vec>, } impl BackupRuleInput { ///

A display name for a backup rule. Must contain 1 to 50 alphanumeric or '-_.' characters.

@@ -80,6 +89,19 @@ impl BackupRuleInput { pub fn schedule_expression_timezone(&self) -> ::std::option::Option<&str> { self.schedule_expression_timezone.as_deref() } + ///

There can up to one IndexAction in each BackupRule, as each backup can have 0 or 1 backup index associated with it.

+ ///

Within the array is ResourceTypes. Only 1 resource type will be accepted for each BackupRule. Valid values:

+ ///
    + ///
  • + ///

    EBS for Amazon Elastic Block Store

  • + ///
  • + ///

    S3 for Amazon Simple Storage Service (Amazon S3)

  • + ///
+ /// + /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.index_actions.is_none()`. + pub fn index_actions(&self) -> &[crate::types::IndexAction] { + self.index_actions.as_deref().unwrap_or_default() + } } impl ::std::fmt::Debug for BackupRuleInput { fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { @@ -94,6 +116,7 @@ impl ::std::fmt::Debug for BackupRuleInput { formatter.field("copy_actions", &self.copy_actions); formatter.field("enable_continuous_backup", &self.enable_continuous_backup); formatter.field("schedule_expression_timezone", &self.schedule_expression_timezone); + formatter.field("index_actions", &self.index_actions); formatter.finish() } } @@ -118,6 +141,7 @@ pub struct BackupRuleInputBuilder { pub(crate) copy_actions: ::std::option::Option<::std::vec::Vec>, pub(crate) enable_continuous_backup: ::std::option::Option, pub(crate) schedule_expression_timezone: ::std::option::Option<::std::string::String>, + pub(crate) index_actions: ::std::option::Option<::std::vec::Vec>, } impl BackupRuleInputBuilder { ///

A display name for a backup rule. Must contain 1 to 50 alphanumeric or '-_.' characters.

@@ -296,6 +320,47 @@ impl BackupRuleInputBuilder { pub fn get_schedule_expression_timezone(&self) -> &::std::option::Option<::std::string::String> { &self.schedule_expression_timezone } + /// Appends an item to `index_actions`. + /// + /// To override the contents of this collection use [`set_index_actions`](Self::set_index_actions). + /// + ///

There can up to one IndexAction in each BackupRule, as each backup can have 0 or 1 backup index associated with it.

+ ///

Within the array is ResourceTypes. Only 1 resource type will be accepted for each BackupRule. Valid values:

+ ///
    + ///
  • + ///

    EBS for Amazon Elastic Block Store

  • + ///
  • + ///

    S3 for Amazon Simple Storage Service (Amazon S3)

  • + ///
+ pub fn index_actions(mut self, input: crate::types::IndexAction) -> Self { + let mut v = self.index_actions.unwrap_or_default(); + v.push(input); + self.index_actions = ::std::option::Option::Some(v); + self + } + ///

There can up to one IndexAction in each BackupRule, as each backup can have 0 or 1 backup index associated with it.

+ ///

Within the array is ResourceTypes. Only 1 resource type will be accepted for each BackupRule. Valid values:

+ ///
    + ///
  • + ///

    EBS for Amazon Elastic Block Store

  • + ///
  • + ///

    S3 for Amazon Simple Storage Service (Amazon S3)

  • + ///
+ pub fn set_index_actions(mut self, input: ::std::option::Option<::std::vec::Vec>) -> Self { + self.index_actions = input; + self + } + ///

There can up to one IndexAction in each BackupRule, as each backup can have 0 or 1 backup index associated with it.

+ ///

Within the array is ResourceTypes. Only 1 resource type will be accepted for each BackupRule. Valid values:

+ ///
    + ///
  • + ///

    EBS for Amazon Elastic Block Store

  • + ///
  • + ///

    S3 for Amazon Simple Storage Service (Amazon S3)

  • + ///
+ pub fn get_index_actions(&self) -> &::std::option::Option<::std::vec::Vec> { + &self.index_actions + } /// Consumes the builder and constructs a [`BackupRuleInput`](crate::types::BackupRuleInput). /// This method will fail if any of the following fields are not set: /// - [`rule_name`](crate::types::builders::BackupRuleInputBuilder::rule_name) @@ -322,6 +387,7 @@ impl BackupRuleInputBuilder { copy_actions: self.copy_actions, enable_continuous_backup: self.enable_continuous_backup, schedule_expression_timezone: self.schedule_expression_timezone, + index_actions: self.index_actions, }) } } @@ -338,6 +404,7 @@ impl ::std::fmt::Debug for BackupRuleInputBuilder { formatter.field("copy_actions", &self.copy_actions); formatter.field("enable_continuous_backup", &self.enable_continuous_backup); formatter.field("schedule_expression_timezone", &self.schedule_expression_timezone); + formatter.field("index_actions", &self.index_actions); formatter.finish() } } diff --git a/sdk/backup/src/types/_index.rs b/sdk/backup/src/types/_index.rs new file mode 100644 index 000000000000..d2e5b2424236 --- /dev/null +++ b/sdk/backup/src/types/_index.rs @@ -0,0 +1,108 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. + +/// When writing a match expression against `Index`, it is important to ensure +/// your code is forward-compatible. That is, if a match arm handles a case for a +/// feature that is supported by the service but has not been represented as an enum +/// variant in a current version of SDK, your code should continue to work when you +/// upgrade SDK to a future version in which the enum does include a variant for that +/// feature. +/// +/// Here is an example of how you can make a match expression forward-compatible: +/// +/// ```text +/// # let index = unimplemented!(); +/// match index { +/// Index::Disabled => { /* ... */ }, +/// Index::Enabled => { /* ... */ }, +/// other @ _ if other.as_str() == "NewFeature" => { /* handles a case for `NewFeature` */ }, +/// _ => { /* ... */ }, +/// } +/// ``` +/// The above code demonstrates that when `index` represents +/// `NewFeature`, the execution path will lead to the second last match arm, +/// even though the enum does not contain a variant `Index::NewFeature` +/// in the current version of SDK. The reason is that the variable `other`, +/// created by the `@` operator, is bound to +/// `Index::Unknown(UnknownVariantValue("NewFeature".to_owned()))` +/// and calling `as_str` on it yields `"NewFeature"`. +/// This match expression is forward-compatible when executed with a newer +/// version of SDK where the variant `Index::NewFeature` is defined. +/// Specifically, when `index` represents `NewFeature`, +/// the execution path will hit the second last match arm as before by virtue of +/// calling `as_str` on `Index::NewFeature` also yielding `"NewFeature"`. +/// +/// Explicitly matching on the `Unknown` variant should +/// be avoided for two reasons: +/// - The inner data `UnknownVariantValue` is opaque, and no further information can be extracted. +/// - It might inadvertently shadow other intended match arms. +/// +#[allow(missing_docs)] // documentation missing in model +#[non_exhaustive] +#[derive( + ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::Ord, ::std::cmp::PartialEq, ::std::cmp::PartialOrd, ::std::fmt::Debug, ::std::hash::Hash, +)] +pub enum Index { + #[allow(missing_docs)] // documentation missing in model + Disabled, + #[allow(missing_docs)] // documentation missing in model + Enabled, + /// `Unknown` contains new variants that have been added since this code was generated. + #[deprecated(note = "Don't directly match on `Unknown`. See the docs on this enum for the correct way to handle unknown variants.")] + Unknown(crate::primitives::sealed_enum_unknown::UnknownVariantValue), +} +impl ::std::convert::From<&str> for Index { + fn from(s: &str) -> Self { + match s { + "DISABLED" => Index::Disabled, + "ENABLED" => Index::Enabled, + other => Index::Unknown(crate::primitives::sealed_enum_unknown::UnknownVariantValue(other.to_owned())), + } + } +} +impl ::std::str::FromStr for Index { + type Err = ::std::convert::Infallible; + + fn from_str(s: &str) -> ::std::result::Result::Err> { + ::std::result::Result::Ok(Index::from(s)) + } +} +impl Index { + /// Returns the `&str` value of the enum member. + pub fn as_str(&self) -> &str { + match self { + Index::Disabled => "DISABLED", + Index::Enabled => "ENABLED", + Index::Unknown(value) => value.as_str(), + } + } + /// Returns all the `&str` representations of the enum members. + pub const fn values() -> &'static [&'static str] { + &["DISABLED", "ENABLED"] + } +} +impl ::std::convert::AsRef for Index { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl Index { + /// Parses the enum value while disallowing unknown variants. + /// + /// Unknown variants will result in an error. + pub fn try_parse(value: &str) -> ::std::result::Result { + match Self::from(value) { + #[allow(deprecated)] + Self::Unknown(_) => ::std::result::Result::Err(crate::error::UnknownVariantError::new(value)), + known => Ok(known), + } + } +} +impl ::std::fmt::Display for Index { + fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + match self { + Index::Disabled => write!(f, "DISABLED"), + Index::Enabled => write!(f, "ENABLED"), + Index::Unknown(value) => write!(f, "{}", value), + } + } +} diff --git a/sdk/backup/src/types/_index_action.rs b/sdk/backup/src/types/_index_action.rs new file mode 100644 index 000000000000..6b79ffd9135c --- /dev/null +++ b/sdk/backup/src/types/_index_action.rs @@ -0,0 +1,94 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. + +///

This is an optional array within a BackupRule.

+///

IndexAction consists of one ResourceTypes.

+#[non_exhaustive] +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)] +pub struct IndexAction { + ///

0 or 1 index action will be accepted for each BackupRule.

+ ///

Valid values:

+ ///
    + ///
  • + ///

    EBS for Amazon Elastic Block Store

  • + ///
  • + ///

    S3 for Amazon Simple Storage Service (Amazon S3)

  • + ///
+ pub resource_types: ::std::option::Option<::std::vec::Vec<::std::string::String>>, +} +impl IndexAction { + ///

0 or 1 index action will be accepted for each BackupRule.

+ ///

Valid values:

+ ///
    + ///
  • + ///

    EBS for Amazon Elastic Block Store

  • + ///
  • + ///

    S3 for Amazon Simple Storage Service (Amazon S3)

  • + ///
+ /// + /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.resource_types.is_none()`. + pub fn resource_types(&self) -> &[::std::string::String] { + self.resource_types.as_deref().unwrap_or_default() + } +} +impl IndexAction { + /// Creates a new builder-style object to manufacture [`IndexAction`](crate::types::IndexAction). + pub fn builder() -> crate::types::builders::IndexActionBuilder { + crate::types::builders::IndexActionBuilder::default() + } +} + +/// A builder for [`IndexAction`](crate::types::IndexAction). +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)] +#[non_exhaustive] +pub struct IndexActionBuilder { + pub(crate) resource_types: ::std::option::Option<::std::vec::Vec<::std::string::String>>, +} +impl IndexActionBuilder { + /// Appends an item to `resource_types`. + /// + /// To override the contents of this collection use [`set_resource_types`](Self::set_resource_types). + /// + ///

0 or 1 index action will be accepted for each BackupRule.

+ ///

Valid values:

+ ///
    + ///
  • + ///

    EBS for Amazon Elastic Block Store

  • + ///
  • + ///

    S3 for Amazon Simple Storage Service (Amazon S3)

  • + ///
+ pub fn resource_types(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + let mut v = self.resource_types.unwrap_or_default(); + v.push(input.into()); + self.resource_types = ::std::option::Option::Some(v); + self + } + ///

0 or 1 index action will be accepted for each BackupRule.

+ ///

Valid values:

+ ///
    + ///
  • + ///

    EBS for Amazon Elastic Block Store

  • + ///
  • + ///

    S3 for Amazon Simple Storage Service (Amazon S3)

  • + ///
+ pub fn set_resource_types(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self { + self.resource_types = input; + self + } + ///

0 or 1 index action will be accepted for each BackupRule.

+ ///

Valid values:

+ ///
    + ///
  • + ///

    EBS for Amazon Elastic Block Store

  • + ///
  • + ///

    S3 for Amazon Simple Storage Service (Amazon S3)

  • + ///
+ pub fn get_resource_types(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> { + &self.resource_types + } + /// Consumes the builder and constructs a [`IndexAction`](crate::types::IndexAction). + pub fn build(self) -> crate::types::IndexAction { + crate::types::IndexAction { + resource_types: self.resource_types, + } + } +} diff --git a/sdk/backup/src/types/_index_status.rs b/sdk/backup/src/types/_index_status.rs new file mode 100644 index 000000000000..d545d8610a07 --- /dev/null +++ b/sdk/backup/src/types/_index_status.rs @@ -0,0 +1,120 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. + +/// When writing a match expression against `IndexStatus`, it is important to ensure +/// your code is forward-compatible. That is, if a match arm handles a case for a +/// feature that is supported by the service but has not been represented as an enum +/// variant in a current version of SDK, your code should continue to work when you +/// upgrade SDK to a future version in which the enum does include a variant for that +/// feature. +/// +/// Here is an example of how you can make a match expression forward-compatible: +/// +/// ```text +/// # let indexstatus = unimplemented!(); +/// match indexstatus { +/// IndexStatus::Active => { /* ... */ }, +/// IndexStatus::Deleting => { /* ... */ }, +/// IndexStatus::Failed => { /* ... */ }, +/// IndexStatus::Pending => { /* ... */ }, +/// other @ _ if other.as_str() == "NewFeature" => { /* handles a case for `NewFeature` */ }, +/// _ => { /* ... */ }, +/// } +/// ``` +/// The above code demonstrates that when `indexstatus` represents +/// `NewFeature`, the execution path will lead to the second last match arm, +/// even though the enum does not contain a variant `IndexStatus::NewFeature` +/// in the current version of SDK. The reason is that the variable `other`, +/// created by the `@` operator, is bound to +/// `IndexStatus::Unknown(UnknownVariantValue("NewFeature".to_owned()))` +/// and calling `as_str` on it yields `"NewFeature"`. +/// This match expression is forward-compatible when executed with a newer +/// version of SDK where the variant `IndexStatus::NewFeature` is defined. +/// Specifically, when `indexstatus` represents `NewFeature`, +/// the execution path will hit the second last match arm as before by virtue of +/// calling `as_str` on `IndexStatus::NewFeature` also yielding `"NewFeature"`. +/// +/// Explicitly matching on the `Unknown` variant should +/// be avoided for two reasons: +/// - The inner data `UnknownVariantValue` is opaque, and no further information can be extracted. +/// - It might inadvertently shadow other intended match arms. +/// +#[allow(missing_docs)] // documentation missing in model +#[non_exhaustive] +#[derive( + ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::Ord, ::std::cmp::PartialEq, ::std::cmp::PartialOrd, ::std::fmt::Debug, ::std::hash::Hash, +)] +pub enum IndexStatus { + #[allow(missing_docs)] // documentation missing in model + Active, + #[allow(missing_docs)] // documentation missing in model + Deleting, + #[allow(missing_docs)] // documentation missing in model + Failed, + #[allow(missing_docs)] // documentation missing in model + Pending, + /// `Unknown` contains new variants that have been added since this code was generated. + #[deprecated(note = "Don't directly match on `Unknown`. See the docs on this enum for the correct way to handle unknown variants.")] + Unknown(crate::primitives::sealed_enum_unknown::UnknownVariantValue), +} +impl ::std::convert::From<&str> for IndexStatus { + fn from(s: &str) -> Self { + match s { + "ACTIVE" => IndexStatus::Active, + "DELETING" => IndexStatus::Deleting, + "FAILED" => IndexStatus::Failed, + "PENDING" => IndexStatus::Pending, + other => IndexStatus::Unknown(crate::primitives::sealed_enum_unknown::UnknownVariantValue(other.to_owned())), + } + } +} +impl ::std::str::FromStr for IndexStatus { + type Err = ::std::convert::Infallible; + + fn from_str(s: &str) -> ::std::result::Result::Err> { + ::std::result::Result::Ok(IndexStatus::from(s)) + } +} +impl IndexStatus { + /// Returns the `&str` value of the enum member. + pub fn as_str(&self) -> &str { + match self { + IndexStatus::Active => "ACTIVE", + IndexStatus::Deleting => "DELETING", + IndexStatus::Failed => "FAILED", + IndexStatus::Pending => "PENDING", + IndexStatus::Unknown(value) => value.as_str(), + } + } + /// Returns all the `&str` representations of the enum members. + pub const fn values() -> &'static [&'static str] { + &["ACTIVE", "DELETING", "FAILED", "PENDING"] + } +} +impl ::std::convert::AsRef for IndexStatus { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl IndexStatus { + /// Parses the enum value while disallowing unknown variants. + /// + /// Unknown variants will result in an error. + pub fn try_parse(value: &str) -> ::std::result::Result { + match Self::from(value) { + #[allow(deprecated)] + Self::Unknown(_) => ::std::result::Result::Err(crate::error::UnknownVariantError::new(value)), + known => Ok(known), + } + } +} +impl ::std::fmt::Display for IndexStatus { + fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + match self { + IndexStatus::Active => write!(f, "ACTIVE"), + IndexStatus::Deleting => write!(f, "DELETING"), + IndexStatus::Failed => write!(f, "FAILED"), + IndexStatus::Pending => write!(f, "PENDING"), + IndexStatus::Unknown(value) => write!(f, "{}", value), + } + } +} diff --git a/sdk/backup/src/types/_indexed_recovery_point.rs b/sdk/backup/src/types/_indexed_recovery_point.rs new file mode 100644 index 000000000000..f85a5c1ac5ee --- /dev/null +++ b/sdk/backup/src/types/_indexed_recovery_point.rs @@ -0,0 +1,277 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. + +///

This is a recovery point that has an associated backup index.

+///

Only recovery points with a backup index can be included in a search.

+#[non_exhaustive] +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)] +pub struct IndexedRecoveryPoint { + ///

An ARN that uniquely identifies a recovery point; for example, arn:aws:backup:us-east-1:123456789012:recovery-point:1EB3B5E7-9EB0-435A-A80B-108B488B0D45

+ pub recovery_point_arn: ::std::option::Option<::std::string::String>, + ///

A string of the Amazon Resource Name (ARN) that uniquely identifies the source resource.

+ pub source_resource_arn: ::std::option::Option<::std::string::String>, + ///

This specifies the IAM role ARN used for this operation.

+ ///

For example, arn:aws:iam::123456789012:role/S3Access

+ pub iam_role_arn: ::std::option::Option<::std::string::String>, + ///

The date and time that a backup was created, in Unix format and Coordinated Universal Time (UTC). The value of CreationDate is accurate to milliseconds. For example, the value 1516925490.087 represents Friday, January 26, 2018 12:11:30.087 AM.

+ pub backup_creation_date: ::std::option::Option<::aws_smithy_types::DateTime>, + ///

The resource type of the indexed recovery point.

+ ///
    + ///
  • + ///

    EBS for Amazon Elastic Block Store

  • + ///
  • + ///

    S3 for Amazon Simple Storage Service (Amazon S3)

  • + ///
+ pub resource_type: ::std::option::Option<::std::string::String>, + ///

The date and time that a backup index was created, in Unix format and Coordinated Universal Time (UTC). The value of CreationDate is accurate to milliseconds. For example, the value 1516925490.087 represents Friday, January 26, 2018 12:11:30.087 AM.

+ pub index_creation_date: ::std::option::Option<::aws_smithy_types::DateTime>, + ///

This is the current status for the backup index associated with the specified recovery point.

+ ///

Statuses are: PENDING | ACTIVE | FAILED | DELETING

+ ///

A recovery point with an index that has the status of ACTIVE can be included in a search.

+ pub index_status: ::std::option::Option, + ///

A string in the form of a detailed message explaining the status of a backup index associated with the recovery point.

+ pub index_status_message: ::std::option::Option<::std::string::String>, + ///

An ARN that uniquely identifies the backup vault where the recovery point index is stored.

+ ///

For example, arn:aws:backup:us-east-1:123456789012:backup-vault:aBackupVault.

+ pub backup_vault_arn: ::std::option::Option<::std::string::String>, +} +impl IndexedRecoveryPoint { + ///

An ARN that uniquely identifies a recovery point; for example, arn:aws:backup:us-east-1:123456789012:recovery-point:1EB3B5E7-9EB0-435A-A80B-108B488B0D45

+ pub fn recovery_point_arn(&self) -> ::std::option::Option<&str> { + self.recovery_point_arn.as_deref() + } + ///

A string of the Amazon Resource Name (ARN) that uniquely identifies the source resource.

+ pub fn source_resource_arn(&self) -> ::std::option::Option<&str> { + self.source_resource_arn.as_deref() + } + ///

This specifies the IAM role ARN used for this operation.

+ ///

For example, arn:aws:iam::123456789012:role/S3Access

+ pub fn iam_role_arn(&self) -> ::std::option::Option<&str> { + self.iam_role_arn.as_deref() + } + ///

The date and time that a backup was created, in Unix format and Coordinated Universal Time (UTC). The value of CreationDate is accurate to milliseconds. For example, the value 1516925490.087 represents Friday, January 26, 2018 12:11:30.087 AM.

+ pub fn backup_creation_date(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> { + self.backup_creation_date.as_ref() + } + ///

The resource type of the indexed recovery point.

+ ///
    + ///
  • + ///

    EBS for Amazon Elastic Block Store

  • + ///
  • + ///

    S3 for Amazon Simple Storage Service (Amazon S3)

  • + ///
+ pub fn resource_type(&self) -> ::std::option::Option<&str> { + self.resource_type.as_deref() + } + ///

The date and time that a backup index was created, in Unix format and Coordinated Universal Time (UTC). The value of CreationDate is accurate to milliseconds. For example, the value 1516925490.087 represents Friday, January 26, 2018 12:11:30.087 AM.

+ pub fn index_creation_date(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> { + self.index_creation_date.as_ref() + } + ///

This is the current status for the backup index associated with the specified recovery point.

+ ///

Statuses are: PENDING | ACTIVE | FAILED | DELETING

+ ///

A recovery point with an index that has the status of ACTIVE can be included in a search.

+ pub fn index_status(&self) -> ::std::option::Option<&crate::types::IndexStatus> { + self.index_status.as_ref() + } + ///

A string in the form of a detailed message explaining the status of a backup index associated with the recovery point.

+ pub fn index_status_message(&self) -> ::std::option::Option<&str> { + self.index_status_message.as_deref() + } + ///

An ARN that uniquely identifies the backup vault where the recovery point index is stored.

+ ///

For example, arn:aws:backup:us-east-1:123456789012:backup-vault:aBackupVault.

+ pub fn backup_vault_arn(&self) -> ::std::option::Option<&str> { + self.backup_vault_arn.as_deref() + } +} +impl IndexedRecoveryPoint { + /// Creates a new builder-style object to manufacture [`IndexedRecoveryPoint`](crate::types::IndexedRecoveryPoint). + pub fn builder() -> crate::types::builders::IndexedRecoveryPointBuilder { + crate::types::builders::IndexedRecoveryPointBuilder::default() + } +} + +/// A builder for [`IndexedRecoveryPoint`](crate::types::IndexedRecoveryPoint). +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)] +#[non_exhaustive] +pub struct IndexedRecoveryPointBuilder { + pub(crate) recovery_point_arn: ::std::option::Option<::std::string::String>, + pub(crate) source_resource_arn: ::std::option::Option<::std::string::String>, + pub(crate) iam_role_arn: ::std::option::Option<::std::string::String>, + pub(crate) backup_creation_date: ::std::option::Option<::aws_smithy_types::DateTime>, + pub(crate) resource_type: ::std::option::Option<::std::string::String>, + pub(crate) index_creation_date: ::std::option::Option<::aws_smithy_types::DateTime>, + pub(crate) index_status: ::std::option::Option, + pub(crate) index_status_message: ::std::option::Option<::std::string::String>, + pub(crate) backup_vault_arn: ::std::option::Option<::std::string::String>, +} +impl IndexedRecoveryPointBuilder { + ///

An ARN that uniquely identifies a recovery point; for example, arn:aws:backup:us-east-1:123456789012:recovery-point:1EB3B5E7-9EB0-435A-A80B-108B488B0D45

+ pub fn recovery_point_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.recovery_point_arn = ::std::option::Option::Some(input.into()); + self + } + ///

An ARN that uniquely identifies a recovery point; for example, arn:aws:backup:us-east-1:123456789012:recovery-point:1EB3B5E7-9EB0-435A-A80B-108B488B0D45

+ pub fn set_recovery_point_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.recovery_point_arn = input; + self + } + ///

An ARN that uniquely identifies a recovery point; for example, arn:aws:backup:us-east-1:123456789012:recovery-point:1EB3B5E7-9EB0-435A-A80B-108B488B0D45

+ pub fn get_recovery_point_arn(&self) -> &::std::option::Option<::std::string::String> { + &self.recovery_point_arn + } + ///

A string of the Amazon Resource Name (ARN) that uniquely identifies the source resource.

+ pub fn source_resource_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.source_resource_arn = ::std::option::Option::Some(input.into()); + self + } + ///

A string of the Amazon Resource Name (ARN) that uniquely identifies the source resource.

+ pub fn set_source_resource_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.source_resource_arn = input; + self + } + ///

A string of the Amazon Resource Name (ARN) that uniquely identifies the source resource.

+ pub fn get_source_resource_arn(&self) -> &::std::option::Option<::std::string::String> { + &self.source_resource_arn + } + ///

This specifies the IAM role ARN used for this operation.

+ ///

For example, arn:aws:iam::123456789012:role/S3Access

+ pub fn iam_role_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.iam_role_arn = ::std::option::Option::Some(input.into()); + self + } + ///

This specifies the IAM role ARN used for this operation.

+ ///

For example, arn:aws:iam::123456789012:role/S3Access

+ pub fn set_iam_role_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.iam_role_arn = input; + self + } + ///

This specifies the IAM role ARN used for this operation.

+ ///

For example, arn:aws:iam::123456789012:role/S3Access

+ pub fn get_iam_role_arn(&self) -> &::std::option::Option<::std::string::String> { + &self.iam_role_arn + } + ///

The date and time that a backup was created, in Unix format and Coordinated Universal Time (UTC). The value of CreationDate is accurate to milliseconds. For example, the value 1516925490.087 represents Friday, January 26, 2018 12:11:30.087 AM.

+ pub fn backup_creation_date(mut self, input: ::aws_smithy_types::DateTime) -> Self { + self.backup_creation_date = ::std::option::Option::Some(input); + self + } + ///

The date and time that a backup was created, in Unix format and Coordinated Universal Time (UTC). The value of CreationDate is accurate to milliseconds. For example, the value 1516925490.087 represents Friday, January 26, 2018 12:11:30.087 AM.

+ pub fn set_backup_creation_date(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self { + self.backup_creation_date = input; + self + } + ///

The date and time that a backup was created, in Unix format and Coordinated Universal Time (UTC). The value of CreationDate is accurate to milliseconds. For example, the value 1516925490.087 represents Friday, January 26, 2018 12:11:30.087 AM.

+ pub fn get_backup_creation_date(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> { + &self.backup_creation_date + } + ///

The resource type of the indexed recovery point.

+ ///
    + ///
  • + ///

    EBS for Amazon Elastic Block Store

  • + ///
  • + ///

    S3 for Amazon Simple Storage Service (Amazon S3)

  • + ///
+ pub fn resource_type(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.resource_type = ::std::option::Option::Some(input.into()); + self + } + ///

The resource type of the indexed recovery point.

+ ///
    + ///
  • + ///

    EBS for Amazon Elastic Block Store

  • + ///
  • + ///

    S3 for Amazon Simple Storage Service (Amazon S3)

  • + ///
+ pub fn set_resource_type(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.resource_type = input; + self + } + ///

The resource type of the indexed recovery point.

+ ///
    + ///
  • + ///

    EBS for Amazon Elastic Block Store

  • + ///
  • + ///

    S3 for Amazon Simple Storage Service (Amazon S3)

  • + ///
+ pub fn get_resource_type(&self) -> &::std::option::Option<::std::string::String> { + &self.resource_type + } + ///

The date and time that a backup index was created, in Unix format and Coordinated Universal Time (UTC). The value of CreationDate is accurate to milliseconds. For example, the value 1516925490.087 represents Friday, January 26, 2018 12:11:30.087 AM.

+ pub fn index_creation_date(mut self, input: ::aws_smithy_types::DateTime) -> Self { + self.index_creation_date = ::std::option::Option::Some(input); + self + } + ///

The date and time that a backup index was created, in Unix format and Coordinated Universal Time (UTC). The value of CreationDate is accurate to milliseconds. For example, the value 1516925490.087 represents Friday, January 26, 2018 12:11:30.087 AM.

+ pub fn set_index_creation_date(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self { + self.index_creation_date = input; + self + } + ///

The date and time that a backup index was created, in Unix format and Coordinated Universal Time (UTC). The value of CreationDate is accurate to milliseconds. For example, the value 1516925490.087 represents Friday, January 26, 2018 12:11:30.087 AM.

+ pub fn get_index_creation_date(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> { + &self.index_creation_date + } + ///

This is the current status for the backup index associated with the specified recovery point.

+ ///

Statuses are: PENDING | ACTIVE | FAILED | DELETING

+ ///

A recovery point with an index that has the status of ACTIVE can be included in a search.

+ pub fn index_status(mut self, input: crate::types::IndexStatus) -> Self { + self.index_status = ::std::option::Option::Some(input); + self + } + ///

This is the current status for the backup index associated with the specified recovery point.

+ ///

Statuses are: PENDING | ACTIVE | FAILED | DELETING

+ ///

A recovery point with an index that has the status of ACTIVE can be included in a search.

+ pub fn set_index_status(mut self, input: ::std::option::Option) -> Self { + self.index_status = input; + self + } + ///

This is the current status for the backup index associated with the specified recovery point.

+ ///

Statuses are: PENDING | ACTIVE | FAILED | DELETING

+ ///

A recovery point with an index that has the status of ACTIVE can be included in a search.

+ pub fn get_index_status(&self) -> &::std::option::Option { + &self.index_status + } + ///

A string in the form of a detailed message explaining the status of a backup index associated with the recovery point.

+ pub fn index_status_message(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.index_status_message = ::std::option::Option::Some(input.into()); + self + } + ///

A string in the form of a detailed message explaining the status of a backup index associated with the recovery point.

+ pub fn set_index_status_message(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.index_status_message = input; + self + } + ///

A string in the form of a detailed message explaining the status of a backup index associated with the recovery point.

+ pub fn get_index_status_message(&self) -> &::std::option::Option<::std::string::String> { + &self.index_status_message + } + ///

An ARN that uniquely identifies the backup vault where the recovery point index is stored.

+ ///

For example, arn:aws:backup:us-east-1:123456789012:backup-vault:aBackupVault.

+ pub fn backup_vault_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.backup_vault_arn = ::std::option::Option::Some(input.into()); + self + } + ///

An ARN that uniquely identifies the backup vault where the recovery point index is stored.

+ ///

For example, arn:aws:backup:us-east-1:123456789012:backup-vault:aBackupVault.

+ pub fn set_backup_vault_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.backup_vault_arn = input; + self + } + ///

An ARN that uniquely identifies the backup vault where the recovery point index is stored.

+ ///

For example, arn:aws:backup:us-east-1:123456789012:backup-vault:aBackupVault.

+ pub fn get_backup_vault_arn(&self) -> &::std::option::Option<::std::string::String> { + &self.backup_vault_arn + } + /// Consumes the builder and constructs a [`IndexedRecoveryPoint`](crate::types::IndexedRecoveryPoint). + pub fn build(self) -> crate::types::IndexedRecoveryPoint { + crate::types::IndexedRecoveryPoint { + recovery_point_arn: self.recovery_point_arn, + source_resource_arn: self.source_resource_arn, + iam_role_arn: self.iam_role_arn, + backup_creation_date: self.backup_creation_date, + resource_type: self.resource_type, + index_creation_date: self.index_creation_date, + index_status: self.index_status, + index_status_message: self.index_status_message, + backup_vault_arn: self.backup_vault_arn, + } + } +} diff --git a/sdk/backup/src/types/_recovery_point_by_backup_vault.rs b/sdk/backup/src/types/_recovery_point_by_backup_vault.rs index 92db539182e3..abf4030391f2 100644 --- a/sdk/backup/src/types/_recovery_point_by_backup_vault.rs +++ b/sdk/backup/src/types/_recovery_point_by_backup_vault.rs @@ -52,6 +52,12 @@ pub struct RecoveryPointByBackupVault { pub resource_name: ::std::option::Option<::std::string::String>, ///

The type of vault in which the described recovery point is stored.

pub vault_type: ::std::option::Option, + ///

This is the current status for the backup index associated with the specified recovery point.

+ ///

Statuses are: PENDING | ACTIVE | FAILED | DELETING

+ ///

A recovery point with an index that has the status of ACTIVE can be included in a search.

+ pub index_status: ::std::option::Option, + ///

A string in the form of a detailed message explaining the status of a backup index associated with the recovery point.

+ pub index_status_message: ::std::option::Option<::std::string::String>, } impl RecoveryPointByBackupVault { ///

An Amazon Resource Name (ARN) that uniquely identifies a recovery point; for example, arn:aws:backup:us-east-1:123456789012:recovery-point:1EB3B5E7-9EB0-435A-A80B-108B488B0D45.

@@ -148,6 +154,16 @@ impl RecoveryPointByBackupVault { pub fn vault_type(&self) -> ::std::option::Option<&crate::types::VaultType> { self.vault_type.as_ref() } + ///

This is the current status for the backup index associated with the specified recovery point.

+ ///

Statuses are: PENDING | ACTIVE | FAILED | DELETING

+ ///

A recovery point with an index that has the status of ACTIVE can be included in a search.

+ pub fn index_status(&self) -> ::std::option::Option<&crate::types::IndexStatus> { + self.index_status.as_ref() + } + ///

A string in the form of a detailed message explaining the status of a backup index associated with the recovery point.

+ pub fn index_status_message(&self) -> ::std::option::Option<&str> { + self.index_status_message.as_deref() + } } impl RecoveryPointByBackupVault { /// Creates a new builder-style object to manufacture [`RecoveryPointByBackupVault`](crate::types::RecoveryPointByBackupVault). @@ -183,6 +199,8 @@ pub struct RecoveryPointByBackupVaultBuilder { pub(crate) is_parent: ::std::option::Option, pub(crate) resource_name: ::std::option::Option<::std::string::String>, pub(crate) vault_type: ::std::option::Option, + pub(crate) index_status: ::std::option::Option, + pub(crate) index_status_message: ::std::option::Option<::std::string::String>, } impl RecoveryPointByBackupVaultBuilder { ///

An Amazon Resource Name (ARN) that uniquely identifies a recovery point; for example, arn:aws:backup:us-east-1:123456789012:recovery-point:1EB3B5E7-9EB0-435A-A80B-108B488B0D45.

@@ -513,6 +531,40 @@ impl RecoveryPointByBackupVaultBuilder { pub fn get_vault_type(&self) -> &::std::option::Option { &self.vault_type } + ///

This is the current status for the backup index associated with the specified recovery point.

+ ///

Statuses are: PENDING | ACTIVE | FAILED | DELETING

+ ///

A recovery point with an index that has the status of ACTIVE can be included in a search.

+ pub fn index_status(mut self, input: crate::types::IndexStatus) -> Self { + self.index_status = ::std::option::Option::Some(input); + self + } + ///

This is the current status for the backup index associated with the specified recovery point.

+ ///

Statuses are: PENDING | ACTIVE | FAILED | DELETING

+ ///

A recovery point with an index that has the status of ACTIVE can be included in a search.

+ pub fn set_index_status(mut self, input: ::std::option::Option) -> Self { + self.index_status = input; + self + } + ///

This is the current status for the backup index associated with the specified recovery point.

+ ///

Statuses are: PENDING | ACTIVE | FAILED | DELETING

+ ///

A recovery point with an index that has the status of ACTIVE can be included in a search.

+ pub fn get_index_status(&self) -> &::std::option::Option { + &self.index_status + } + ///

A string in the form of a detailed message explaining the status of a backup index associated with the recovery point.

+ pub fn index_status_message(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.index_status_message = ::std::option::Option::Some(input.into()); + self + } + ///

A string in the form of a detailed message explaining the status of a backup index associated with the recovery point.

+ pub fn set_index_status_message(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.index_status_message = input; + self + } + ///

A string in the form of a detailed message explaining the status of a backup index associated with the recovery point.

+ pub fn get_index_status_message(&self) -> &::std::option::Option<::std::string::String> { + &self.index_status_message + } /// Consumes the builder and constructs a [`RecoveryPointByBackupVault`](crate::types::RecoveryPointByBackupVault). pub fn build(self) -> crate::types::RecoveryPointByBackupVault { crate::types::RecoveryPointByBackupVault { @@ -539,6 +591,8 @@ impl RecoveryPointByBackupVaultBuilder { is_parent: self.is_parent.unwrap_or_default(), resource_name: self.resource_name, vault_type: self.vault_type, + index_status: self.index_status, + index_status_message: self.index_status_message, } } } diff --git a/sdk/backup/src/types/_recovery_point_by_resource.rs b/sdk/backup/src/types/_recovery_point_by_resource.rs index 3d6c3657b060..ba4025f79bf2 100644 --- a/sdk/backup/src/types/_recovery_point_by_resource.rs +++ b/sdk/backup/src/types/_recovery_point_by_resource.rs @@ -26,6 +26,12 @@ pub struct RecoveryPointByResource { pub resource_name: ::std::option::Option<::std::string::String>, ///

The type of vault in which the described recovery point is stored.

pub vault_type: ::std::option::Option, + ///

This is the current status for the backup index associated with the specified recovery point.

+ ///

Statuses are: PENDING | ACTIVE | FAILED | DELETING

+ ///

A recovery point with an index that has the status of ACTIVE can be included in a search.

+ pub index_status: ::std::option::Option, + ///

A string in the form of a detailed message explaining the status of a backup index associated with the recovery point.

+ pub index_status_message: ::std::option::Option<::std::string::String>, } impl RecoveryPointByResource { ///

An Amazon Resource Name (ARN) that uniquely identifies a recovery point; for example, arn:aws:backup:us-east-1:123456789012:recovery-point:1EB3B5E7-9EB0-435A-A80B-108B488B0D45.

@@ -72,6 +78,16 @@ impl RecoveryPointByResource { pub fn vault_type(&self) -> ::std::option::Option<&crate::types::VaultType> { self.vault_type.as_ref() } + ///

This is the current status for the backup index associated with the specified recovery point.

+ ///

Statuses are: PENDING | ACTIVE | FAILED | DELETING

+ ///

A recovery point with an index that has the status of ACTIVE can be included in a search.

+ pub fn index_status(&self) -> ::std::option::Option<&crate::types::IndexStatus> { + self.index_status.as_ref() + } + ///

A string in the form of a detailed message explaining the status of a backup index associated with the recovery point.

+ pub fn index_status_message(&self) -> ::std::option::Option<&str> { + self.index_status_message.as_deref() + } } impl RecoveryPointByResource { /// Creates a new builder-style object to manufacture [`RecoveryPointByResource`](crate::types::RecoveryPointByResource). @@ -95,6 +111,8 @@ pub struct RecoveryPointByResourceBuilder { pub(crate) parent_recovery_point_arn: ::std::option::Option<::std::string::String>, pub(crate) resource_name: ::std::option::Option<::std::string::String>, pub(crate) vault_type: ::std::option::Option, + pub(crate) index_status: ::std::option::Option, + pub(crate) index_status_message: ::std::option::Option<::std::string::String>, } impl RecoveryPointByResourceBuilder { ///

An Amazon Resource Name (ARN) that uniquely identifies a recovery point; for example, arn:aws:backup:us-east-1:123456789012:recovery-point:1EB3B5E7-9EB0-435A-A80B-108B488B0D45.

@@ -251,6 +269,40 @@ impl RecoveryPointByResourceBuilder { pub fn get_vault_type(&self) -> &::std::option::Option { &self.vault_type } + ///

This is the current status for the backup index associated with the specified recovery point.

+ ///

Statuses are: PENDING | ACTIVE | FAILED | DELETING

+ ///

A recovery point with an index that has the status of ACTIVE can be included in a search.

+ pub fn index_status(mut self, input: crate::types::IndexStatus) -> Self { + self.index_status = ::std::option::Option::Some(input); + self + } + ///

This is the current status for the backup index associated with the specified recovery point.

+ ///

Statuses are: PENDING | ACTIVE | FAILED | DELETING

+ ///

A recovery point with an index that has the status of ACTIVE can be included in a search.

+ pub fn set_index_status(mut self, input: ::std::option::Option) -> Self { + self.index_status = input; + self + } + ///

This is the current status for the backup index associated with the specified recovery point.

+ ///

Statuses are: PENDING | ACTIVE | FAILED | DELETING

+ ///

A recovery point with an index that has the status of ACTIVE can be included in a search.

+ pub fn get_index_status(&self) -> &::std::option::Option { + &self.index_status + } + ///

A string in the form of a detailed message explaining the status of a backup index associated with the recovery point.

+ pub fn index_status_message(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.index_status_message = ::std::option::Option::Some(input.into()); + self + } + ///

A string in the form of a detailed message explaining the status of a backup index associated with the recovery point.

+ pub fn set_index_status_message(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.index_status_message = input; + self + } + ///

A string in the form of a detailed message explaining the status of a backup index associated with the recovery point.

+ pub fn get_index_status_message(&self) -> &::std::option::Option<::std::string::String> { + &self.index_status_message + } /// Consumes the builder and constructs a [`RecoveryPointByResource`](crate::types::RecoveryPointByResource). pub fn build(self) -> crate::types::RecoveryPointByResource { crate::types::RecoveryPointByResource { @@ -265,6 +317,8 @@ impl RecoveryPointByResourceBuilder { parent_recovery_point_arn: self.parent_recovery_point_arn, resource_name: self.resource_name, vault_type: self.vault_type, + index_status: self.index_status, + index_status_message: self.index_status_message, } } } diff --git a/sdk/backup/src/types/builders.rs b/sdk/backup/src/types/builders.rs index 7d4e798b16fe..709885d66b7a 100644 --- a/sdk/backup/src/types/builders.rs +++ b/sdk/backup/src/types/builders.rs @@ -29,6 +29,8 @@ pub use crate::types::_backup_plan_input::BackupPlanInputBuilder; pub use crate::types::_backup_rule_input::BackupRuleInputBuilder; +pub use crate::types::_index_action::IndexActionBuilder; + pub use crate::types::_copy_action::CopyActionBuilder; pub use crate::types::_restore_testing_selection_for_list::RestoreTestingSelectionForListBuilder; @@ -59,6 +61,8 @@ pub use crate::types::_protected_resource::ProtectedResourceBuilder; pub use crate::types::_legal_hold::LegalHoldBuilder; +pub use crate::types::_indexed_recovery_point::IndexedRecoveryPointBuilder; + pub use crate::types::_framework::FrameworkBuilder; pub use crate::types::_copy_job_summary::CopyJobSummaryBuilder; diff --git a/sdk/backupsearch/Cargo.toml b/sdk/backupsearch/Cargo.toml new file mode 100644 index 000000000000..2f99a84a9382 --- /dev/null +++ b/sdk/backupsearch/Cargo.toml @@ -0,0 +1,88 @@ +# Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +[package] +name = "aws-sdk-backupsearch" +version = "1.0.0" +authors = ["AWS Rust SDK Team ", "Russell Cohen "] +description = "AWS SDK for AWS Backup Search" +edition = "2021" +license = "Apache-2.0" +repository = "https://github.com/awslabs/aws-sdk-rust" +rust-version = "1.81.0" +readme = "README.md" +[package.metadata.smithy] +codegen-version = "d1734ecf3d17b376c4d20b2401b45a028309b165" +[package.metadata.docs.rs] +all-features = true +targets = ["x86_64-unknown-linux-gnu"] +[dependencies.aws-credential-types] +path = "../aws-credential-types" +version = "1.2.1" + +[dependencies.aws-runtime] +path = "../aws-runtime" +version = "1.5.1" + +[dependencies.aws-smithy-async] +path = "../aws-smithy-async" +version = "1.2.2" + +[dependencies.aws-smithy-http] +path = "../aws-smithy-http" +version = "0.60.11" + +[dependencies.aws-smithy-json] +path = "../aws-smithy-json" +version = "0.61.1" + +[dependencies.aws-smithy-runtime] +path = "../aws-smithy-runtime" +features = ["client"] +version = "1.7.5" + +[dependencies.aws-smithy-runtime-api] +path = "../aws-smithy-runtime-api" +features = ["client", "http-02x"] +version = "1.7.3" + +[dependencies.aws-smithy-types] +path = "../aws-smithy-types" +version = "1.2.10" + +[dependencies.aws-types] +path = "../aws-types" +version = "1.3.3" + +[dependencies.bytes] +version = "1.4.0" + +[dependencies.http] +version = "0.2.9" + +[dependencies.once_cell] +version = "1.16" + +[dependencies.regex-lite] +version = "0.1.5" + +[dependencies.tracing] +version = "0.1" +[dev-dependencies.aws-config] +path = "../aws-config" +version = "1.5.11" + +[dev-dependencies.aws-credential-types] +path = "../aws-credential-types" +features = ["test-util"] +version = "1.2.1" + +[dev-dependencies.tokio] +version = "1.23.1" +features = ["macros", "test-util", "rt-multi-thread"] + +[features] +behavior-version-latest = [] +rustls = ["aws-smithy-runtime/tls-rustls"] +rt-tokio = ["aws-smithy-async/rt-tokio", "aws-smithy-types/rt-tokio"] +test-util = ["aws-credential-types/test-util", "aws-smithy-runtime/test-util"] +gated-tests = [] +default = ["rustls", "rt-tokio"] diff --git a/sdk/backupsearch/LICENSE b/sdk/backupsearch/LICENSE new file mode 100644 index 000000000000..3581ac356771 --- /dev/null +++ b/sdk/backupsearch/LICENSE @@ -0,0 +1,202 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "{}" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright 2018-2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + diff --git a/sdk/backupsearch/README.md b/sdk/backupsearch/README.md new file mode 100644 index 000000000000..9227750f1121 --- /dev/null +++ b/sdk/backupsearch/README.md @@ -0,0 +1,60 @@ +# aws-sdk-backupsearch + +Backup Search is the recovery point and item level search for Backup. + +For additional information, see: + - [Backup API Reference](https://docs.aws.amazon.com/aws-backup/latest/devguide/api-reference.html) + - [Backup Developer Guide](https://docs.aws.amazon.com/aws-backup/latest/devguide/whatisbackup.html) + +## Getting Started + +> Examples are available for many services and operations, check out the +> [examples folder in GitHub](https://github.com/awslabs/aws-sdk-rust/tree/main/examples). + +The SDK provides one crate per AWS service. You must add [Tokio](https://crates.io/crates/tokio) +as a dependency within your Rust project to execute asynchronous code. To add `aws-sdk-backupsearch` to +your project, add the following to your **Cargo.toml** file: + +```toml +[dependencies] +aws-config = { version = "1.1.7", features = ["behavior-version-latest"] } +aws-sdk-backupsearch = "1.0.0" +tokio = { version = "1", features = ["full"] } +``` + +Then in code, a client can be created with the following: + +```rust,no_run +use aws_sdk_backupsearch as backupsearch; + +#[::tokio::main] +async fn main() -> Result<(), backupsearch::Error> { + let config = aws_config::load_from_env().await; + let client = aws_sdk_backupsearch::Client::new(&config); + + // ... make some calls with the client + + Ok(()) +} +``` + +See the [client documentation](https://docs.rs/aws-sdk-backupsearch/latest/aws_sdk_backupsearch/client/struct.Client.html) +for information on what calls can be made, and the inputs and outputs for each of those calls. + +## Using the SDK + +Until the SDK is released, we will be adding information about using the SDK to the +[Developer Guide](https://docs.aws.amazon.com/sdk-for-rust/latest/dg/welcome.html). Feel free to suggest +additional sections for the guide by opening an issue and describing what you are trying to do. + +## Getting Help + +* [GitHub discussions](https://github.com/awslabs/aws-sdk-rust/discussions) - For ideas, RFCs & general questions +* [GitHub issues](https://github.com/awslabs/aws-sdk-rust/issues/new/choose) - For bug reports & feature requests +* [Generated Docs (latest version)](https://awslabs.github.io/aws-sdk-rust/) +* [Usage examples](https://github.com/awslabs/aws-sdk-rust/tree/main/examples) + +## License + +This project is licensed under the Apache-2.0 License. + diff --git a/sdk/backupsearch/src/auth_plugin.rs b/sdk/backupsearch/src/auth_plugin.rs new file mode 100644 index 000000000000..6367570f4123 --- /dev/null +++ b/sdk/backupsearch/src/auth_plugin.rs @@ -0,0 +1,35 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +/* + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0 + */ + +use std::borrow::Cow; + +use aws_smithy_runtime_api::client::auth::static_resolver::StaticAuthSchemeOptionResolver; +use aws_smithy_runtime_api::client::auth::AuthSchemeId; +use aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder; +use aws_smithy_runtime_api::client::runtime_plugin::{Order, RuntimePlugin}; + +#[derive(Debug)] +pub(crate) struct DefaultAuthOptionsPlugin { + runtime_components: RuntimeComponentsBuilder, +} + +impl DefaultAuthOptionsPlugin { + pub(crate) fn new(auth_schemes: Vec) -> Self { + let runtime_components = RuntimeComponentsBuilder::new("default_auth_options") + .with_auth_scheme_option_resolver(Some(StaticAuthSchemeOptionResolver::new(auth_schemes))); + Self { runtime_components } + } +} + +impl RuntimePlugin for DefaultAuthOptionsPlugin { + fn order(&self) -> Order { + Order::Defaults + } + + fn runtime_components(&self, _current_components: &RuntimeComponentsBuilder) -> Cow<'_, RuntimeComponentsBuilder> { + Cow::Borrowed(&self.runtime_components) + } +} diff --git a/sdk/backupsearch/src/client.rs b/sdk/backupsearch/src/client.rs new file mode 100644 index 000000000000..ced0aa086d97 --- /dev/null +++ b/sdk/backupsearch/src/client.rs @@ -0,0 +1,188 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +#[derive(Debug)] +pub(crate) struct Handle { + pub(crate) conf: crate::Config, + #[allow(dead_code)] // unused when a service does not provide any operations + pub(crate) runtime_plugins: ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, +} + +/// Client for AWS Backup Search +/// +/// Client for invoking operations on AWS Backup Search. Each operation on AWS Backup Search is a method on this +/// this struct. `.send()` MUST be invoked on the generated operations to dispatch the request to the service. +/// ## Constructing a `Client` +/// +/// A [`Config`] is required to construct a client. For most use cases, the [`aws-config`] +/// crate should be used to automatically resolve this config using +/// [`aws_config::load_from_env()`], since this will resolve an [`SdkConfig`] which can be shared +/// across multiple different AWS SDK clients. This config resolution process can be customized +/// by calling [`aws_config::from_env()`] instead, which returns a [`ConfigLoader`] that uses +/// the [builder pattern] to customize the default config. +/// +/// In the simplest case, creating a client looks as follows: +/// ```rust,no_run +/// # async fn wrapper() { +/// let config = aws_config::load_from_env().await; +/// let client = aws_sdk_backupsearch::Client::new(&config); +/// # } +/// ``` +/// +/// Occasionally, SDKs may have additional service-specific values that can be set on the [`Config`] that +/// is absent from [`SdkConfig`], or slightly different settings for a specific client may be desired. +/// The [`Builder`](crate::config::Builder) struct implements `From<&SdkConfig>`, so setting these specific settings can be +/// done as follows: +/// +/// ```rust,no_run +/// # async fn wrapper() { +/// let sdk_config = ::aws_config::load_from_env().await; +/// let config = aws_sdk_backupsearch::config::Builder::from(&sdk_config) +/// # /* +/// .some_service_specific_setting("value") +/// # */ +/// .build(); +/// # } +/// ``` +/// +/// See the [`aws-config` docs] and [`Config`] for more information on customizing configuration. +/// +/// _Note:_ Client construction is expensive due to connection thread pool initialization, and should +/// be done once at application start-up. +/// +/// [`Config`]: crate::Config +/// [`ConfigLoader`]: https://docs.rs/aws-config/*/aws_config/struct.ConfigLoader.html +/// [`SdkConfig`]: https://docs.rs/aws-config/*/aws_config/struct.SdkConfig.html +/// [`aws-config` docs]: https://docs.rs/aws-config/* +/// [`aws-config`]: https://crates.io/crates/aws-config +/// [`aws_config::from_env()`]: https://docs.rs/aws-config/*/aws_config/fn.from_env.html +/// [`aws_config::load_from_env()`]: https://docs.rs/aws-config/*/aws_config/fn.load_from_env.html +/// [builder pattern]: https://rust-lang.github.io/api-guidelines/type-safety.html#builders-enable-construction-of-complex-values-c-builder +/// # Using the `Client` +/// +/// A client has a function for every operation that can be performed by the service. +/// For example, the [`ListSearchJobBackups`](crate::operation::list_search_job_backups) operation has +/// a [`Client::list_search_job_backups`], function which returns a builder for that operation. +/// The fluent builder ultimately has a `send()` function that returns an async future that +/// returns a result, as illustrated below: +/// +/// ```rust,ignore +/// let result = client.list_search_job_backups() +/// .search_job_identifier("example") +/// .send() +/// .await; +/// ``` +/// +/// The underlying HTTP requests that get made by this can be modified with the `customize_operation` +/// function on the fluent builder. See the [`customize`](crate::client::customize) module for more +/// information. +#[derive(::std::clone::Clone, ::std::fmt::Debug)] +pub struct Client { + handle: ::std::sync::Arc, +} + +impl Client { + /// Creates a new client from the service [`Config`](crate::Config). + /// + /// # Panics + /// + /// This method will panic in the following cases: + /// + /// - Retries or timeouts are enabled without a `sleep_impl` configured. + /// - Identity caching is enabled without a `sleep_impl` and `time_source` configured. + /// - No `behavior_version` is provided. + /// + /// The panic message for each of these will have instructions on how to resolve them. + #[track_caller] + pub fn from_conf(conf: crate::Config) -> Self { + let handle = Handle { + conf: conf.clone(), + runtime_plugins: crate::config::base_client_runtime_plugins(conf), + }; + if let Err(err) = Self::validate_config(&handle) { + panic!("Invalid client configuration: {err}"); + } + Self { + handle: ::std::sync::Arc::new(handle), + } + } + + /// Returns the client's configuration. + pub fn config(&self) -> &crate::Config { + &self.handle.conf + } + + fn validate_config(handle: &Handle) -> Result<(), ::aws_smithy_runtime_api::box_error::BoxError> { + let mut cfg = ::aws_smithy_types::config_bag::ConfigBag::base(); + handle + .runtime_plugins + .apply_client_configuration(&mut cfg)? + .validate_base_client_config(&cfg)?; + Ok(()) + } +} + +impl Client { + /// Creates a new client from an [SDK Config](::aws_types::sdk_config::SdkConfig). + /// + /// # Panics + /// + /// - This method will panic if the `sdk_config` is missing an async sleep implementation. If you experience this panic, set + /// the `sleep_impl` on the Config passed into this function to fix it. + /// - This method will panic if the `sdk_config` is missing an HTTP connector. If you experience this panic, set the + /// `http_connector` on the Config passed into this function to fix it. + /// - This method will panic if no `BehaviorVersion` is provided. If you experience this panic, set `behavior_version` on the Config or enable the `behavior-version-latest` Cargo feature. + #[track_caller] + pub fn new(sdk_config: &::aws_types::sdk_config::SdkConfig) -> Self { + Self::from_conf(sdk_config.into()) + } +} + +/// Operation customization and supporting types. +/// +/// The underlying HTTP requests made during an operation can be customized +/// by calling the `customize()` method on the builder returned from a client +/// operation call. For example, this can be used to add an additional HTTP header: +/// +/// ```ignore +/// # async fn wrapper() -> ::std::result::Result<(), aws_sdk_backupsearch::Error> { +/// # let client: aws_sdk_backupsearch::Client = unimplemented!(); +/// use ::http::header::{HeaderName, HeaderValue}; +/// +/// let result = client.list_search_job_backups() +/// .customize() +/// .mutate_request(|req| { +/// // Add `x-example-header` with value +/// req.headers_mut() +/// .insert( +/// HeaderName::from_static("x-example-header"), +/// HeaderValue::from_static("1"), +/// ); +/// }) +/// .send() +/// .await; +/// # } +/// ``` +pub mod customize; + +mod get_search_job; + +mod get_search_result_export_job; + +mod list_search_job_backups; + +mod list_search_job_results; + +mod list_search_jobs; + +mod list_search_result_export_jobs; + +mod list_tags_for_resource; + +mod start_search_job; + +mod start_search_result_export_job; + +mod stop_search_job; + +mod tag_resource; + +mod untag_resource; diff --git a/sdk/backupsearch/src/client/customize.rs b/sdk/backupsearch/src/client/customize.rs new file mode 100644 index 000000000000..98a6dc724116 --- /dev/null +++ b/sdk/backupsearch/src/client/customize.rs @@ -0,0 +1,114 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. + +/// `CustomizableOperation` allows for configuring a single operation invocation before it is sent. +pub struct CustomizableOperation { + customizable_send: B, + config_override: ::std::option::Option, + interceptors: Vec<::aws_smithy_runtime_api::client::interceptors::SharedInterceptor>, + runtime_plugins: Vec<::aws_smithy_runtime_api::client::runtime_plugin::SharedRuntimePlugin>, + _output: ::std::marker::PhantomData, + _error: ::std::marker::PhantomData, +} + +impl CustomizableOperation { + /// Creates a new `CustomizableOperation` from `customizable_send`. + #[allow(dead_code)] // unused when a service does not provide any operations + pub(crate) fn new(customizable_send: B) -> Self { + Self { + customizable_send, + config_override: ::std::option::Option::None, + interceptors: vec![], + runtime_plugins: vec![], + _output: ::std::marker::PhantomData, + _error: ::std::marker::PhantomData, + } + } + + pub(crate) fn execute(self, f: impl ::std::ops::FnOnce(B, crate::config::Builder) -> U) -> U { + let mut config_override = self.config_override.unwrap_or_default(); + self.interceptors.into_iter().for_each(|interceptor| { + config_override.push_interceptor(interceptor); + }); + self.runtime_plugins.into_iter().for_each(|plugin| { + config_override.push_runtime_plugin(plugin); + }); + f(self.customizable_send, config_override) + } + + /// Adds an [interceptor](::aws_smithy_runtime_api::client::interceptors::Intercept) that runs at specific stages of the request execution pipeline. + /// + /// Note that interceptors can also be added to `CustomizableOperation` by `config_override`, + /// `map_request`, and `mutate_request` (the last two are implemented via interceptors under the hood). + /// The order in which those user-specified operation interceptors are invoked should not be relied upon + /// as it is an implementation detail. + pub fn interceptor(mut self, interceptor: impl ::aws_smithy_runtime_api::client::interceptors::Intercept + 'static) -> Self { + self.interceptors + .push(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::new(interceptor)); + self + } + + /// Adds a runtime plugin. + #[allow(unused)] + pub(crate) fn runtime_plugin(mut self, runtime_plugin: impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin + 'static) -> Self { + self.runtime_plugins + .push(::aws_smithy_runtime_api::client::runtime_plugin::SharedRuntimePlugin::new(runtime_plugin)); + self + } + + /// Allows for customizing the operation's request. + pub fn map_request(mut self, f: F) -> Self + where + F: ::std::ops::Fn( + ::aws_smithy_runtime_api::client::orchestrator::HttpRequest, + ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, MapE> + + ::std::marker::Send + + ::std::marker::Sync + + 'static, + MapE: ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static, + { + self.interceptors + .push(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::new( + ::aws_smithy_runtime::client::interceptors::MapRequestInterceptor::new(f), + )); + self + } + + /// Convenience for `map_request` where infallible direct mutation of request is acceptable. + pub fn mutate_request(mut self, f: F) -> Self + where + F: ::std::ops::Fn(&mut ::aws_smithy_runtime_api::client::orchestrator::HttpRequest) + ::std::marker::Send + ::std::marker::Sync + 'static, + { + self.interceptors + .push(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::new( + ::aws_smithy_runtime::client::interceptors::MutateRequestInterceptor::new(f), + )); + self + } + + /// Overrides config for a single operation invocation. + /// + /// `config_override` is applied to the operation configuration level. + /// The fields in the builder that are `Some` override those applied to the service + /// configuration level. For instance, + /// + /// | Config A | overridden by Config B | = Config C | + /// |--------------------|------------------------|--------------------| + /// | field_1: None, | field_1: Some(v2), | field_1: Some(v2), | + /// | field_2: Some(v1), | field_2: Some(v2), | field_2: Some(v2), | + /// | field_3: Some(v1), | field_3: None, | field_3: Some(v1), | + pub fn config_override(mut self, config_override: impl ::std::convert::Into) -> Self { + self.config_override = Some(config_override.into()); + self + } + + /// Sends the request and returns the response. + pub async fn send(self) -> crate::client::customize::internal::SendResult + where + E: std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static, + B: crate::client::customize::internal::CustomizableSend, + { + self.execute(|sender, config| sender.send(config)).await + } +} + +pub(crate) mod internal; diff --git a/sdk/backupsearch/src/client/customize/internal.rs b/sdk/backupsearch/src/client/customize/internal.rs new file mode 100644 index 000000000000..a4492e4c3942 --- /dev/null +++ b/sdk/backupsearch/src/client/customize/internal.rs @@ -0,0 +1,12 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +pub type BoxFuture = ::std::pin::Pin<::std::boxed::Box + ::std::marker::Send>>; + +pub type SendResult = + ::std::result::Result>; + +pub trait CustomizableSend: ::std::marker::Send + ::std::marker::Sync { + // Takes an owned `self` as the implementation will internally call methods that take `self`. + // If it took `&self`, that would make this trait object safe, but some implementing types do not + // derive `Clone`, unable to yield `self` from `&self`. + fn send(self, config_override: crate::config::Builder) -> BoxFuture>; +} diff --git a/sdk/backupsearch/src/client/get_search_job.rs b/sdk/backupsearch/src/client/get_search_job.rs new file mode 100644 index 000000000000..e70f5eedeec3 --- /dev/null +++ b/sdk/backupsearch/src/client/get_search_job.rs @@ -0,0 +1,24 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +impl super::Client { + /// Constructs a fluent builder for the [`GetSearchJob`](crate::operation::get_search_job::builders::GetSearchJobFluentBuilder) operation. + /// + /// - The fluent builder is configurable: + /// - [`search_job_identifier(impl Into)`](crate::operation::get_search_job::builders::GetSearchJobFluentBuilder::search_job_identifier) / [`set_search_job_identifier(Option)`](crate::operation::get_search_job::builders::GetSearchJobFluentBuilder::set_search_job_identifier):
required: **true**

Required unique string that specifies the search job.


+ /// - On success, responds with [`GetSearchJobOutput`](crate::operation::get_search_job::GetSearchJobOutput) with field(s): + /// - [`name(Option)`](crate::operation::get_search_job::GetSearchJobOutput::name):

Returned name of the specified search job.

+ /// - [`search_scope_summary(Option)`](crate::operation::get_search_job::GetSearchJobOutput::search_scope_summary):

Returned summary of the specified search job scope, including:

  • TotalBackupsToScanCount, the number of recovery points returned by the search.

  • TotalItemsToScanCount, the number of items returned by the search.

+ /// - [`current_search_progress(Option)`](crate::operation::get_search_job::GetSearchJobOutput::current_search_progress):

Returns numbers representing BackupsScannedCount, ItemsScanned, and ItemsMatched.

+ /// - [`status_message(Option)`](crate::operation::get_search_job::GetSearchJobOutput::status_message):

A status message will be returned for either a earch job with a status of ERRORED or a status of COMPLETED jobs with issues.

For example, a message may say that a search contained recovery points unable to be scanned because of a permissions issue.

+ /// - [`encryption_key_arn(Option)`](crate::operation::get_search_job::GetSearchJobOutput::encryption_key_arn):

The encryption key for the specified search job.

Example: arn:aws:kms:us-west-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab.

+ /// - [`completion_time(Option)`](crate::operation::get_search_job::GetSearchJobOutput::completion_time):

The date and time that a search job completed, in Unix format and Coordinated Universal Time (UTC). The value of CompletionTime is accurate to milliseconds. For example, the value 1516925490.087 represents Friday, January 26, 2018 12:11:30.087 AM.

+ /// - [`status(SearchJobState)`](crate::operation::get_search_job::GetSearchJobOutput::status):

The current status of the specified search job.

A search job may have one of the following statuses: RUNNING; COMPLETED; STOPPED; FAILED; TIMED_OUT; or EXPIRED .

+ /// - [`search_scope(Option)`](crate::operation::get_search_job::GetSearchJobOutput::search_scope):

The search scope is all backup properties input into a search.

+ /// - [`item_filters(Option)`](crate::operation::get_search_job::GetSearchJobOutput::item_filters):

Item Filters represent all input item properties specified when the search was created.

+ /// - [`creation_time(DateTime)`](crate::operation::get_search_job::GetSearchJobOutput::creation_time):

The date and time that a search job was created, in Unix format and Coordinated Universal Time (UTC). The value of CompletionTime is accurate to milliseconds. For example, the value 1516925490.087 represents Friday, January 26, 2018 12:11:30.087 AM.

+ /// - [`search_job_identifier(String)`](crate::operation::get_search_job::GetSearchJobOutput::search_job_identifier):

The unique string that identifies the specified search job.

+ /// - [`search_job_arn(String)`](crate::operation::get_search_job::GetSearchJobOutput::search_job_arn):

The unique string that identifies the Amazon Resource Name (ARN) of the specified search job.

+ /// - On failure, responds with [`SdkError`](crate::operation::get_search_job::GetSearchJobError) + pub fn get_search_job(&self) -> crate::operation::get_search_job::builders::GetSearchJobFluentBuilder { + crate::operation::get_search_job::builders::GetSearchJobFluentBuilder::new(self.handle.clone()) + } +} diff --git a/sdk/backupsearch/src/client/get_search_result_export_job.rs b/sdk/backupsearch/src/client/get_search_result_export_job.rs new file mode 100644 index 000000000000..fa2ecc8f9a8b --- /dev/null +++ b/sdk/backupsearch/src/client/get_search_result_export_job.rs @@ -0,0 +1,20 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +impl super::Client { + /// Constructs a fluent builder for the [`GetSearchResultExportJob`](crate::operation::get_search_result_export_job::builders::GetSearchResultExportJobFluentBuilder) operation. + /// + /// - The fluent builder is configurable: + /// - [`export_job_identifier(impl Into)`](crate::operation::get_search_result_export_job::builders::GetSearchResultExportJobFluentBuilder::export_job_identifier) / [`set_export_job_identifier(Option)`](crate::operation::get_search_result_export_job::builders::GetSearchResultExportJobFluentBuilder::set_export_job_identifier):
required: **true**

This is the unique string that identifies a specific export job.

Required for this operation.


+ /// - On success, responds with [`GetSearchResultExportJobOutput`](crate::operation::get_search_result_export_job::GetSearchResultExportJobOutput) with field(s): + /// - [`export_job_identifier(String)`](crate::operation::get_search_result_export_job::GetSearchResultExportJobOutput::export_job_identifier):

This is the unique string that identifies the specified export job.

+ /// - [`export_job_arn(Option)`](crate::operation::get_search_result_export_job::GetSearchResultExportJobOutput::export_job_arn):

The unique Amazon Resource Name (ARN) that uniquely identifies the export job.

+ /// - [`status(Option)`](crate::operation::get_search_result_export_job::GetSearchResultExportJobOutput::status):

This is the current status of the export job.

+ /// - [`creation_time(Option)`](crate::operation::get_search_result_export_job::GetSearchResultExportJobOutput::creation_time):

The date and time that an export job was created, in Unix format and Coordinated Universal Time (UTC). The value of CreationTime is accurate to milliseconds. For example, the value 1516925490.087 represents Friday, January 26, 2018 12:11:30.087 AM.

+ /// - [`completion_time(Option)`](crate::operation::get_search_result_export_job::GetSearchResultExportJobOutput::completion_time):

The date and time that an export job completed, in Unix format and Coordinated Universal Time (UTC). The value of CreationTime is accurate to milliseconds. For example, the value 1516925490.087 represents Friday, January 26, 2018 12:11:30.087 AM.

+ /// - [`status_message(Option)`](crate::operation::get_search_result_export_job::GetSearchResultExportJobOutput::status_message):

A status message is a string that is returned for search job with a status of FAILED, along with steps to remedy and retry the operation.

+ /// - [`export_specification(Option)`](crate::operation::get_search_result_export_job::GetSearchResultExportJobOutput::export_specification):

The export specification consists of the destination S3 bucket to which the search results were exported, along with the destination prefix.

+ /// - [`search_job_arn(Option)`](crate::operation::get_search_result_export_job::GetSearchResultExportJobOutput::search_job_arn):

The unique string that identifies the Amazon Resource Name (ARN) of the specified search job.

+ /// - On failure, responds with [`SdkError`](crate::operation::get_search_result_export_job::GetSearchResultExportJobError) + pub fn get_search_result_export_job(&self) -> crate::operation::get_search_result_export_job::builders::GetSearchResultExportJobFluentBuilder { + crate::operation::get_search_result_export_job::builders::GetSearchResultExportJobFluentBuilder::new(self.handle.clone()) + } +} diff --git a/sdk/backupsearch/src/client/list_search_job_backups.rs b/sdk/backupsearch/src/client/list_search_job_backups.rs new file mode 100644 index 000000000000..62e4fdb480b3 --- /dev/null +++ b/sdk/backupsearch/src/client/list_search_job_backups.rs @@ -0,0 +1,17 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +impl super::Client { + /// Constructs a fluent builder for the [`ListSearchJobBackups`](crate::operation::list_search_job_backups::builders::ListSearchJobBackupsFluentBuilder) operation. + /// This operation supports pagination; See [`into_paginator()`](crate::operation::list_search_job_backups::builders::ListSearchJobBackupsFluentBuilder::into_paginator). + /// + /// - The fluent builder is configurable: + /// - [`search_job_identifier(impl Into)`](crate::operation::list_search_job_backups::builders::ListSearchJobBackupsFluentBuilder::search_job_identifier) / [`set_search_job_identifier(Option)`](crate::operation::list_search_job_backups::builders::ListSearchJobBackupsFluentBuilder::set_search_job_identifier):
required: **true**

The unique string that specifies the search job.


+ /// - [`next_token(impl Into)`](crate::operation::list_search_job_backups::builders::ListSearchJobBackupsFluentBuilder::next_token) / [`set_next_token(Option)`](crate::operation::list_search_job_backups::builders::ListSearchJobBackupsFluentBuilder::set_next_token):
required: **false**

The next item following a partial list of returned backups included in a search job.

For example, if a request is made to return MaxResults number of backups, NextToken allows you to return more items in your list starting at the location pointed to by the next token.


+ /// - [`max_results(i32)`](crate::operation::list_search_job_backups::builders::ListSearchJobBackupsFluentBuilder::max_results) / [`set_max_results(Option)`](crate::operation::list_search_job_backups::builders::ListSearchJobBackupsFluentBuilder::set_max_results):
required: **false**

The maximum number of resource list items to be returned.


+ /// - On success, responds with [`ListSearchJobBackupsOutput`](crate::operation::list_search_job_backups::ListSearchJobBackupsOutput) with field(s): + /// - [`results(Vec::)`](crate::operation::list_search_job_backups::ListSearchJobBackupsOutput::results):

The recovery points returned the results of a search job

+ /// - [`next_token(Option)`](crate::operation::list_search_job_backups::ListSearchJobBackupsOutput::next_token):

The next item following a partial list of returned backups included in a search job.

For example, if a request is made to return MaxResults number of backups, NextToken allows you to return more items in your list starting at the location pointed to by the next token.

+ /// - On failure, responds with [`SdkError`](crate::operation::list_search_job_backups::ListSearchJobBackupsError) + pub fn list_search_job_backups(&self) -> crate::operation::list_search_job_backups::builders::ListSearchJobBackupsFluentBuilder { + crate::operation::list_search_job_backups::builders::ListSearchJobBackupsFluentBuilder::new(self.handle.clone()) + } +} diff --git a/sdk/backupsearch/src/client/list_search_job_results.rs b/sdk/backupsearch/src/client/list_search_job_results.rs new file mode 100644 index 000000000000..646e7886688b --- /dev/null +++ b/sdk/backupsearch/src/client/list_search_job_results.rs @@ -0,0 +1,17 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +impl super::Client { + /// Constructs a fluent builder for the [`ListSearchJobResults`](crate::operation::list_search_job_results::builders::ListSearchJobResultsFluentBuilder) operation. + /// This operation supports pagination; See [`into_paginator()`](crate::operation::list_search_job_results::builders::ListSearchJobResultsFluentBuilder::into_paginator). + /// + /// - The fluent builder is configurable: + /// - [`search_job_identifier(impl Into)`](crate::operation::list_search_job_results::builders::ListSearchJobResultsFluentBuilder::search_job_identifier) / [`set_search_job_identifier(Option)`](crate::operation::list_search_job_results::builders::ListSearchJobResultsFluentBuilder::set_search_job_identifier):
required: **true**

The unique string that specifies the search job.


+ /// - [`next_token(impl Into)`](crate::operation::list_search_job_results::builders::ListSearchJobResultsFluentBuilder::next_token) / [`set_next_token(Option)`](crate::operation::list_search_job_results::builders::ListSearchJobResultsFluentBuilder::set_next_token):
required: **false**

The next item following a partial list of returned search job results.

For example, if a request is made to return MaxResults number of search job results, NextToken allows you to return more items in your list starting at the location pointed to by the next token.


+ /// - [`max_results(i32)`](crate::operation::list_search_job_results::builders::ListSearchJobResultsFluentBuilder::max_results) / [`set_max_results(Option)`](crate::operation::list_search_job_results::builders::ListSearchJobResultsFluentBuilder::set_max_results):
required: **false**

The maximum number of resource list items to be returned.


+ /// - On success, responds with [`ListSearchJobResultsOutput`](crate::operation::list_search_job_results::ListSearchJobResultsOutput) with field(s): + /// - [`results(Vec::)`](crate::operation::list_search_job_results::ListSearchJobResultsOutput::results):

The results consist of either EBSResultItem or S3ResultItem.

+ /// - [`next_token(Option)`](crate::operation::list_search_job_results::ListSearchJobResultsOutput::next_token):

The next item following a partial list of search job results.

For example, if a request is made to return MaxResults number of backups, NextToken allows you to return more items in your list starting at the location pointed to by the next token.

+ /// - On failure, responds with [`SdkError`](crate::operation::list_search_job_results::ListSearchJobResultsError) + pub fn list_search_job_results(&self) -> crate::operation::list_search_job_results::builders::ListSearchJobResultsFluentBuilder { + crate::operation::list_search_job_results::builders::ListSearchJobResultsFluentBuilder::new(self.handle.clone()) + } +} diff --git a/sdk/backupsearch/src/client/list_search_jobs.rs b/sdk/backupsearch/src/client/list_search_jobs.rs new file mode 100644 index 000000000000..9f85adbc9037 --- /dev/null +++ b/sdk/backupsearch/src/client/list_search_jobs.rs @@ -0,0 +1,17 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +impl super::Client { + /// Constructs a fluent builder for the [`ListSearchJobs`](crate::operation::list_search_jobs::builders::ListSearchJobsFluentBuilder) operation. + /// This operation supports pagination; See [`into_paginator()`](crate::operation::list_search_jobs::builders::ListSearchJobsFluentBuilder::into_paginator). + /// + /// - The fluent builder is configurable: + /// - [`by_status(SearchJobState)`](crate::operation::list_search_jobs::builders::ListSearchJobsFluentBuilder::by_status) / [`set_by_status(Option)`](crate::operation::list_search_jobs::builders::ListSearchJobsFluentBuilder::set_by_status):
required: **false**

Include this parameter to filter list by search job status.


+ /// - [`next_token(impl Into)`](crate::operation::list_search_jobs::builders::ListSearchJobsFluentBuilder::next_token) / [`set_next_token(Option)`](crate::operation::list_search_jobs::builders::ListSearchJobsFluentBuilder::set_next_token):
required: **false**

The next item following a partial list of returned search jobs.

For example, if a request is made to return MaxResults number of backups, NextToken allows you to return more items in your list starting at the location pointed to by the next token.


+ /// - [`max_results(i32)`](crate::operation::list_search_jobs::builders::ListSearchJobsFluentBuilder::max_results) / [`set_max_results(Option)`](crate::operation::list_search_jobs::builders::ListSearchJobsFluentBuilder::set_max_results):
required: **false**

The maximum number of resource list items to be returned.


+ /// - On success, responds with [`ListSearchJobsOutput`](crate::operation::list_search_jobs::ListSearchJobsOutput) with field(s): + /// - [`search_jobs(Vec::)`](crate::operation::list_search_jobs::ListSearchJobsOutput::search_jobs):

The search jobs among the list, with details of the returned search jobs.

+ /// - [`next_token(Option)`](crate::operation::list_search_jobs::ListSearchJobsOutput::next_token):

The next item following a partial list of returned backups included in a search job.

For example, if a request is made to return MaxResults number of backups, NextToken allows you to return more items in your list starting at the location pointed to by the next token.

+ /// - On failure, responds with [`SdkError`](crate::operation::list_search_jobs::ListSearchJobsError) + pub fn list_search_jobs(&self) -> crate::operation::list_search_jobs::builders::ListSearchJobsFluentBuilder { + crate::operation::list_search_jobs::builders::ListSearchJobsFluentBuilder::new(self.handle.clone()) + } +} diff --git a/sdk/backupsearch/src/client/list_search_result_export_jobs.rs b/sdk/backupsearch/src/client/list_search_result_export_jobs.rs new file mode 100644 index 000000000000..aa4f0b58ce23 --- /dev/null +++ b/sdk/backupsearch/src/client/list_search_result_export_jobs.rs @@ -0,0 +1,20 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +impl super::Client { + /// Constructs a fluent builder for the [`ListSearchResultExportJobs`](crate::operation::list_search_result_export_jobs::builders::ListSearchResultExportJobsFluentBuilder) operation. + /// This operation supports pagination; See [`into_paginator()`](crate::operation::list_search_result_export_jobs::builders::ListSearchResultExportJobsFluentBuilder::into_paginator). + /// + /// - The fluent builder is configurable: + /// - [`status(ExportJobStatus)`](crate::operation::list_search_result_export_jobs::builders::ListSearchResultExportJobsFluentBuilder::status) / [`set_status(Option)`](crate::operation::list_search_result_export_jobs::builders::ListSearchResultExportJobsFluentBuilder::set_status):
required: **false**

The search jobs to be included in the export job can be filtered by including this parameter.


+ /// - [`search_job_identifier(impl Into)`](crate::operation::list_search_result_export_jobs::builders::ListSearchResultExportJobsFluentBuilder::search_job_identifier) / [`set_search_job_identifier(Option)`](crate::operation::list_search_result_export_jobs::builders::ListSearchResultExportJobsFluentBuilder::set_search_job_identifier):
required: **false**

The unique string that specifies the search job.


+ /// - [`next_token(impl Into)`](crate::operation::list_search_result_export_jobs::builders::ListSearchResultExportJobsFluentBuilder::next_token) / [`set_next_token(Option)`](crate::operation::list_search_result_export_jobs::builders::ListSearchResultExportJobsFluentBuilder::set_next_token):
required: **false**

The next item following a partial list of returned backups included in a search job.

For example, if a request is made to return MaxResults number of backups, NextToken allows you to return more items in your list starting at the location pointed to by the next token.


+ /// - [`max_results(i32)`](crate::operation::list_search_result_export_jobs::builders::ListSearchResultExportJobsFluentBuilder::max_results) / [`set_max_results(Option)`](crate::operation::list_search_result_export_jobs::builders::ListSearchResultExportJobsFluentBuilder::set_max_results):
required: **false**

The maximum number of resource list items to be returned.


+ /// - On success, responds with [`ListSearchResultExportJobsOutput`](crate::operation::list_search_result_export_jobs::ListSearchResultExportJobsOutput) with field(s): + /// - [`export_jobs(Vec::)`](crate::operation::list_search_result_export_jobs::ListSearchResultExportJobsOutput::export_jobs):

The operation returns the included export jobs.

+ /// - [`next_token(Option)`](crate::operation::list_search_result_export_jobs::ListSearchResultExportJobsOutput::next_token):

The next item following a partial list of returned backups included in a search job.

For example, if a request is made to return MaxResults number of backups, NextToken allows you to return more items in your list starting at the location pointed to by the next token.

+ /// - On failure, responds with [`SdkError`](crate::operation::list_search_result_export_jobs::ListSearchResultExportJobsError) + pub fn list_search_result_export_jobs( + &self, + ) -> crate::operation::list_search_result_export_jobs::builders::ListSearchResultExportJobsFluentBuilder { + crate::operation::list_search_result_export_jobs::builders::ListSearchResultExportJobsFluentBuilder::new(self.handle.clone()) + } +} diff --git a/sdk/backupsearch/src/client/list_tags_for_resource.rs b/sdk/backupsearch/src/client/list_tags_for_resource.rs new file mode 100644 index 000000000000..8f3f7c51772d --- /dev/null +++ b/sdk/backupsearch/src/client/list_tags_for_resource.rs @@ -0,0 +1,13 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +impl super::Client { + /// Constructs a fluent builder for the [`ListTagsForResource`](crate::operation::list_tags_for_resource::builders::ListTagsForResourceFluentBuilder) operation. + /// + /// - The fluent builder is configurable: + /// - [`resource_arn(impl Into)`](crate::operation::list_tags_for_resource::builders::ListTagsForResourceFluentBuilder::resource_arn) / [`set_resource_arn(Option)`](crate::operation::list_tags_for_resource::builders::ListTagsForResourceFluentBuilder::set_resource_arn):
required: **true**

The Amazon Resource Name (ARN) that uniquely identifies the resource.>


+ /// - On success, responds with [`ListTagsForResourceOutput`](crate::operation::list_tags_for_resource::ListTagsForResourceOutput) with field(s): + /// - [`tags(Option>>)`](crate::operation::list_tags_for_resource::ListTagsForResourceOutput::tags):

List of tags returned by the operation.

+ /// - On failure, responds with [`SdkError`](crate::operation::list_tags_for_resource::ListTagsForResourceError) + pub fn list_tags_for_resource(&self) -> crate::operation::list_tags_for_resource::builders::ListTagsForResourceFluentBuilder { + crate::operation::list_tags_for_resource::builders::ListTagsForResourceFluentBuilder::new(self.handle.clone()) + } +} diff --git a/sdk/backupsearch/src/client/start_search_job.rs b/sdk/backupsearch/src/client/start_search_job.rs new file mode 100644 index 000000000000..3a80cbf72c3d --- /dev/null +++ b/sdk/backupsearch/src/client/start_search_job.rs @@ -0,0 +1,20 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +impl super::Client { + /// Constructs a fluent builder for the [`StartSearchJob`](crate::operation::start_search_job::builders::StartSearchJobFluentBuilder) operation. + /// + /// - The fluent builder is configurable: + /// - [`tags(impl Into, Option)`](crate::operation::start_search_job::builders::StartSearchJobFluentBuilder::tags) / [`set_tags(Option>>)`](crate::operation::start_search_job::builders::StartSearchJobFluentBuilder::set_tags):
required: **false**

List of tags returned by the operation.


+ /// - [`name(impl Into)`](crate::operation::start_search_job::builders::StartSearchJobFluentBuilder::name) / [`set_name(Option)`](crate::operation::start_search_job::builders::StartSearchJobFluentBuilder::set_name):
required: **false**

Include alphanumeric characters to create a name for this search job.


+ /// - [`encryption_key_arn(impl Into)`](crate::operation::start_search_job::builders::StartSearchJobFluentBuilder::encryption_key_arn) / [`set_encryption_key_arn(Option)`](crate::operation::start_search_job::builders::StartSearchJobFluentBuilder::set_encryption_key_arn):
required: **false**

The encryption key for the specified search job.


+ /// - [`client_token(impl Into)`](crate::operation::start_search_job::builders::StartSearchJobFluentBuilder::client_token) / [`set_client_token(Option)`](crate::operation::start_search_job::builders::StartSearchJobFluentBuilder::set_client_token):
required: **false**

Include this parameter to allow multiple identical calls for idempotency.

A client token is valid for 8 hours after the first request that uses it is completed. After this time, any request with the same token is treated as a new request.


+ /// - [`search_scope(SearchScope)`](crate::operation::start_search_job::builders::StartSearchJobFluentBuilder::search_scope) / [`set_search_scope(Option)`](crate::operation::start_search_job::builders::StartSearchJobFluentBuilder::set_search_scope):
required: **true**

This object can contain BackupResourceTypes, BackupResourceArns, BackupResourceCreationTime, BackupResourceTags, and SourceResourceArns to filter the recovery points returned by the search job.


+ /// - [`item_filters(ItemFilters)`](crate::operation::start_search_job::builders::StartSearchJobFluentBuilder::item_filters) / [`set_item_filters(Option)`](crate::operation::start_search_job::builders::StartSearchJobFluentBuilder::set_item_filters):
required: **false**

Item Filters represent all input item properties specified when the search was created.

Contains either EBSItemFilters or S3ItemFilters


+ /// - On success, responds with [`StartSearchJobOutput`](crate::operation::start_search_job::StartSearchJobOutput) with field(s): + /// - [`search_job_arn(Option)`](crate::operation::start_search_job::StartSearchJobOutput::search_job_arn):

The unique string that identifies the Amazon Resource Name (ARN) of the specified search job.

+ /// - [`creation_time(Option)`](crate::operation::start_search_job::StartSearchJobOutput::creation_time):

The date and time that a job was created, in Unix format and Coordinated Universal Time (UTC). The value of CompletionTime is accurate to milliseconds. For example, the value 1516925490.087 represents Friday, January 26, 2018 12:11:30.087 AM.

+ /// - [`search_job_identifier(Option)`](crate::operation::start_search_job::StartSearchJobOutput::search_job_identifier):

The unique string that specifies the search job.

+ /// - On failure, responds with [`SdkError`](crate::operation::start_search_job::StartSearchJobError) + pub fn start_search_job(&self) -> crate::operation::start_search_job::builders::StartSearchJobFluentBuilder { + crate::operation::start_search_job::builders::StartSearchJobFluentBuilder::new(self.handle.clone()) + } +} diff --git a/sdk/backupsearch/src/client/start_search_result_export_job.rs b/sdk/backupsearch/src/client/start_search_result_export_job.rs new file mode 100644 index 000000000000..1d627e5f9710 --- /dev/null +++ b/sdk/backupsearch/src/client/start_search_result_export_job.rs @@ -0,0 +1,20 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +impl super::Client { + /// Constructs a fluent builder for the [`StartSearchResultExportJob`](crate::operation::start_search_result_export_job::builders::StartSearchResultExportJobFluentBuilder) operation. + /// + /// - The fluent builder is configurable: + /// - [`search_job_identifier(impl Into)`](crate::operation::start_search_result_export_job::builders::StartSearchResultExportJobFluentBuilder::search_job_identifier) / [`set_search_job_identifier(Option)`](crate::operation::start_search_result_export_job::builders::StartSearchResultExportJobFluentBuilder::set_search_job_identifier):
required: **true**

The unique string that specifies the search job.


+ /// - [`export_specification(ExportSpecification)`](crate::operation::start_search_result_export_job::builders::StartSearchResultExportJobFluentBuilder::export_specification) / [`set_export_specification(Option)`](crate::operation::start_search_result_export_job::builders::StartSearchResultExportJobFluentBuilder::set_export_specification):
required: **true**

This specification contains a required string of the destination bucket; optionally, you can include the destination prefix.


+ /// - [`client_token(impl Into)`](crate::operation::start_search_result_export_job::builders::StartSearchResultExportJobFluentBuilder::client_token) / [`set_client_token(Option)`](crate::operation::start_search_result_export_job::builders::StartSearchResultExportJobFluentBuilder::set_client_token):
required: **false**

Include this parameter to allow multiple identical calls for idempotency.

A client token is valid for 8 hours after the first request that uses it is completed. After this time, any request with the same token is treated as a new request.


+ /// - [`tags(impl Into, Option)`](crate::operation::start_search_result_export_job::builders::StartSearchResultExportJobFluentBuilder::tags) / [`set_tags(Option>>)`](crate::operation::start_search_result_export_job::builders::StartSearchResultExportJobFluentBuilder::set_tags):
required: **false**

Optional tags to include. A tag is a key-value pair you can use to manage, filter, and search for your resources. Allowed characters include UTF-8 letters, numbers, spaces, and the following characters: + - = . _ : /.


+ /// - [`role_arn(impl Into)`](crate::operation::start_search_result_export_job::builders::StartSearchResultExportJobFluentBuilder::role_arn) / [`set_role_arn(Option)`](crate::operation::start_search_result_export_job::builders::StartSearchResultExportJobFluentBuilder::set_role_arn):
required: **false**

This parameter specifies the role ARN used to start the search results export jobs.


+ /// - On success, responds with [`StartSearchResultExportJobOutput`](crate::operation::start_search_result_export_job::StartSearchResultExportJobOutput) with field(s): + /// - [`export_job_arn(Option)`](crate::operation::start_search_result_export_job::StartSearchResultExportJobOutput::export_job_arn):

This is the unique ARN (Amazon Resource Name) that belongs to the new export job.

+ /// - [`export_job_identifier(String)`](crate::operation::start_search_result_export_job::StartSearchResultExportJobOutput::export_job_identifier):

This is the unique identifier that specifies the new export job.

+ /// - On failure, responds with [`SdkError`](crate::operation::start_search_result_export_job::StartSearchResultExportJobError) + pub fn start_search_result_export_job( + &self, + ) -> crate::operation::start_search_result_export_job::builders::StartSearchResultExportJobFluentBuilder { + crate::operation::start_search_result_export_job::builders::StartSearchResultExportJobFluentBuilder::new(self.handle.clone()) + } +} diff --git a/sdk/backupsearch/src/client/stop_search_job.rs b/sdk/backupsearch/src/client/stop_search_job.rs new file mode 100644 index 000000000000..7d2f3c8a9a96 --- /dev/null +++ b/sdk/backupsearch/src/client/stop_search_job.rs @@ -0,0 +1,12 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +impl super::Client { + /// Constructs a fluent builder for the [`StopSearchJob`](crate::operation::stop_search_job::builders::StopSearchJobFluentBuilder) operation. + /// + /// - The fluent builder is configurable: + /// - [`search_job_identifier(impl Into)`](crate::operation::stop_search_job::builders::StopSearchJobFluentBuilder::search_job_identifier) / [`set_search_job_identifier(Option)`](crate::operation::stop_search_job::builders::StopSearchJobFluentBuilder::set_search_job_identifier):
required: **true**

The unique string that specifies the search job.


+ /// - On success, responds with [`StopSearchJobOutput`](crate::operation::stop_search_job::StopSearchJobOutput) + /// - On failure, responds with [`SdkError`](crate::operation::stop_search_job::StopSearchJobError) + pub fn stop_search_job(&self) -> crate::operation::stop_search_job::builders::StopSearchJobFluentBuilder { + crate::operation::stop_search_job::builders::StopSearchJobFluentBuilder::new(self.handle.clone()) + } +} diff --git a/sdk/backupsearch/src/client/tag_resource.rs b/sdk/backupsearch/src/client/tag_resource.rs new file mode 100644 index 000000000000..2ab965b61cce --- /dev/null +++ b/sdk/backupsearch/src/client/tag_resource.rs @@ -0,0 +1,13 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +impl super::Client { + /// Constructs a fluent builder for the [`TagResource`](crate::operation::tag_resource::builders::TagResourceFluentBuilder) operation. + /// + /// - The fluent builder is configurable: + /// - [`resource_arn(impl Into)`](crate::operation::tag_resource::builders::TagResourceFluentBuilder::resource_arn) / [`set_resource_arn(Option)`](crate::operation::tag_resource::builders::TagResourceFluentBuilder::set_resource_arn):
required: **true**

The Amazon Resource Name (ARN) that uniquely identifies the resource.

This is the resource that will have the indicated tags.


+ /// - [`tags(impl Into, Option)`](crate::operation::tag_resource::builders::TagResourceFluentBuilder::tags) / [`set_tags(Option>>)`](crate::operation::tag_resource::builders::TagResourceFluentBuilder::set_tags):
required: **true**

Required tags to include. A tag is a key-value pair you can use to manage, filter, and search for your resources. Allowed characters include UTF-8 letters, numbers, spaces, and the following characters: + - = . _ : /.


+ /// - On success, responds with [`TagResourceOutput`](crate::operation::tag_resource::TagResourceOutput) + /// - On failure, responds with [`SdkError`](crate::operation::tag_resource::TagResourceError) + pub fn tag_resource(&self) -> crate::operation::tag_resource::builders::TagResourceFluentBuilder { + crate::operation::tag_resource::builders::TagResourceFluentBuilder::new(self.handle.clone()) + } +} diff --git a/sdk/backupsearch/src/client/untag_resource.rs b/sdk/backupsearch/src/client/untag_resource.rs new file mode 100644 index 000000000000..d11036459892 --- /dev/null +++ b/sdk/backupsearch/src/client/untag_resource.rs @@ -0,0 +1,13 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +impl super::Client { + /// Constructs a fluent builder for the [`UntagResource`](crate::operation::untag_resource::builders::UntagResourceFluentBuilder) operation. + /// + /// - The fluent builder is configurable: + /// - [`resource_arn(impl Into)`](crate::operation::untag_resource::builders::UntagResourceFluentBuilder::resource_arn) / [`set_resource_arn(Option)`](crate::operation::untag_resource::builders::UntagResourceFluentBuilder::set_resource_arn):
required: **true**

The Amazon Resource Name (ARN) that uniquely identifies the resource where you want to remove tags.


+ /// - [`tag_keys(impl Into)`](crate::operation::untag_resource::builders::UntagResourceFluentBuilder::tag_keys) / [`set_tag_keys(Option>)`](crate::operation::untag_resource::builders::UntagResourceFluentBuilder::set_tag_keys):
required: **true**

This required parameter contains the tag keys you want to remove from the source.


+ /// - On success, responds with [`UntagResourceOutput`](crate::operation::untag_resource::UntagResourceOutput) + /// - On failure, responds with [`SdkError`](crate::operation::untag_resource::UntagResourceError) + pub fn untag_resource(&self) -> crate::operation::untag_resource::builders::UntagResourceFluentBuilder { + crate::operation::untag_resource::builders::UntagResourceFluentBuilder::new(self.handle.clone()) + } +} diff --git a/sdk/backupsearch/src/config.rs b/sdk/backupsearch/src/config.rs new file mode 100644 index 000000000000..e2c6eafe54a4 --- /dev/null +++ b/sdk/backupsearch/src/config.rs @@ -0,0 +1,1338 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. + +/// Configuration for a aws_sdk_backupsearch service client. +/// +/// +/// Service configuration allows for customization of endpoints, region, credentials providers, +/// and retry configuration. Generally, it is constructed automatically for you from a shared +/// configuration loaded by the `aws-config` crate. For example: +/// +/// ```ignore +/// // Load a shared config from the environment +/// let shared_config = aws_config::from_env().load().await; +/// // The client constructor automatically converts the shared config into the service config +/// let client = Client::new(&shared_config); +/// ``` +/// +/// The service config can also be constructed manually using its builder. +/// +#[derive(::std::clone::Clone, ::std::fmt::Debug)] +pub struct Config { + // Both `config` and `cloneable` are the same config, but the cloneable one + // is kept around so that it is possible to convert back into a builder. This can be + // optimized in the future. + pub(crate) config: crate::config::FrozenLayer, + cloneable: ::aws_smithy_types::config_bag::CloneableLayer, + pub(crate) runtime_components: crate::config::RuntimeComponentsBuilder, + pub(crate) runtime_plugins: ::std::vec::Vec, + behavior_version: ::std::option::Option, +} +impl Config { + /// Constructs a config builder. + pub fn builder() -> Builder { + Builder::default() + } + /// Converts this config back into a builder so that it can be tweaked. + pub fn to_builder(&self) -> Builder { + Builder { + config: self.cloneable.clone(), + runtime_components: self.runtime_components.clone(), + runtime_plugins: self.runtime_plugins.clone(), + behavior_version: self.behavior_version, + } + } + /// Return a reference to the stalled stream protection configuration contained in this config, if any. + pub fn stalled_stream_protection(&self) -> ::std::option::Option<&crate::config::StalledStreamProtectionConfig> { + self.config.load::() + } + /// Return the [`SharedHttpClient`](crate::config::SharedHttpClient) to use when making requests, if any. + pub fn http_client(&self) -> Option { + self.runtime_components.http_client() + } + /// Returns the endpoint resolver. + pub fn endpoint_resolver(&self) -> ::aws_smithy_runtime_api::client::endpoint::SharedEndpointResolver { + self.runtime_components.endpoint_resolver().expect("resolver defaulted if not set") + } + /// Return a reference to the retry configuration contained in this config, if any. + pub fn retry_config(&self) -> ::std::option::Option<&::aws_smithy_types::retry::RetryConfig> { + self.config.load::<::aws_smithy_types::retry::RetryConfig>() + } + + /// Return a cloned shared async sleep implementation from this config, if any. + pub fn sleep_impl(&self) -> ::std::option::Option { + self.runtime_components.sleep_impl() + } + + /// Return a reference to the timeout configuration contained in this config, if any. + pub fn timeout_config(&self) -> ::std::option::Option<&::aws_smithy_types::timeout::TimeoutConfig> { + self.config.load::<::aws_smithy_types::timeout::TimeoutConfig>() + } + + /// Returns a reference to the retry partition contained in this config, if any. + /// + /// WARNING: This method is unstable and may be removed at any time. Do not rely on this + /// method for anything! + pub fn retry_partition(&self) -> ::std::option::Option<&::aws_smithy_runtime::client::retries::RetryPartition> { + self.config.load::<::aws_smithy_runtime::client::retries::RetryPartition>() + } + /// Returns the configured identity cache for auth. + pub fn identity_cache(&self) -> ::std::option::Option { + self.runtime_components.identity_cache() + } + /// Returns interceptors currently registered by the user. + pub fn interceptors(&self) -> impl Iterator + '_ { + self.runtime_components.interceptors() + } + /// Return time source used for this service. + pub fn time_source(&self) -> ::std::option::Option<::aws_smithy_async::time::SharedTimeSource> { + self.runtime_components.time_source() + } + /// Returns retry classifiers currently registered by the user. + pub fn retry_classifiers(&self) -> impl Iterator + '_ { + self.runtime_components.retry_classifiers() + } + /// Returns the name of the app that is using the client, if it was provided. + /// + /// This _optional_ name is used to identify the application in the user agent that + /// gets sent along with requests. + pub fn app_name(&self) -> ::std::option::Option<&::aws_types::app_name::AppName> { + self.config.load::<::aws_types::app_name::AppName>() + } + /// Returns the invocation ID generator if one was given in config. + /// + /// The invocation ID generator generates ID values for the `amz-sdk-invocation-id` header. By default, this will be a random UUID. Overriding it may be useful in tests that examine the HTTP request and need to be deterministic. + pub fn invocation_id_generator(&self) -> ::std::option::Option<::aws_runtime::invocation_id::SharedInvocationIdGenerator> { + self.config.load::<::aws_runtime::invocation_id::SharedInvocationIdGenerator>().cloned() + } + /// Creates a new [service config](crate::Config) from a [shared `config`](::aws_types::sdk_config::SdkConfig). + pub fn new(config: &::aws_types::sdk_config::SdkConfig) -> Self { + Builder::from(config).build() + } + /// The signature version 4 service signing name to use in the credential scope when signing requests. + /// + /// The signing service may be overridden by the `Endpoint`, or by specifying a custom + /// [`SigningName`](aws_types::SigningName) during operation construction + pub fn signing_name(&self) -> &'static str { + "backup-search" + } + /// Returns the AWS region, if it was provided. + pub fn region(&self) -> ::std::option::Option<&crate::config::Region> { + self.config.load::() + } + /// This function was intended to be removed, and has been broken since release-2023-11-15 as it always returns a `None`. Do not use. + #[deprecated( + note = "This function was intended to be removed, and has been broken since release-2023-11-15 as it always returns a `None`. Do not use." + )] + pub fn credentials_provider(&self) -> Option { + ::std::option::Option::None + } +} +/// Builder for creating a `Config`. +#[derive(::std::clone::Clone, ::std::fmt::Debug)] +pub struct Builder { + pub(crate) config: ::aws_smithy_types::config_bag::CloneableLayer, + pub(crate) runtime_components: crate::config::RuntimeComponentsBuilder, + pub(crate) runtime_plugins: ::std::vec::Vec, + pub(crate) behavior_version: ::std::option::Option, +} +impl ::std::default::Default for Builder { + fn default() -> Self { + Self { + config: ::std::default::Default::default(), + runtime_components: crate::config::RuntimeComponentsBuilder::new("service config"), + runtime_plugins: ::std::default::Default::default(), + behavior_version: ::std::default::Default::default(), + } + } +} +impl Builder { + /// Constructs a config builder. + pub fn new() -> Self { + Self::default() + } + /// Constructs a config builder from the given `config_bag`, setting only fields stored in the config bag, + /// but not those in runtime components. + #[allow(unused)] + pub(crate) fn from_config_bag(config_bag: &::aws_smithy_types::config_bag::ConfigBag) -> Self { + let mut builder = Self::new(); + builder.set_stalled_stream_protection(config_bag.load::().cloned()); + builder.set_retry_config(config_bag.load::<::aws_smithy_types::retry::RetryConfig>().cloned()); + builder.set_timeout_config(config_bag.load::<::aws_smithy_types::timeout::TimeoutConfig>().cloned()); + builder.set_retry_partition(config_bag.load::<::aws_smithy_runtime::client::retries::RetryPartition>().cloned()); + builder.set_app_name(config_bag.load::<::aws_types::app_name::AppName>().cloned()); + builder.set_endpoint_url(config_bag.load::<::aws_types::endpoint_config::EndpointUrl>().map(|ty| ty.0.clone())); + builder.set_use_fips(config_bag.load::<::aws_types::endpoint_config::UseFips>().map(|ty| ty.0)); + builder.set_region(config_bag.load::().cloned()); + builder + } + /// Set the [`StalledStreamProtectionConfig`](crate::config::StalledStreamProtectionConfig) + /// to configure protection for stalled streams. + pub fn stalled_stream_protection(mut self, stalled_stream_protection_config: crate::config::StalledStreamProtectionConfig) -> Self { + self.set_stalled_stream_protection(::std::option::Option::Some(stalled_stream_protection_config)); + self + } + /// Set the [`StalledStreamProtectionConfig`](crate::config::StalledStreamProtectionConfig) + /// to configure protection for stalled streams. + pub fn set_stalled_stream_protection( + &mut self, + stalled_stream_protection_config: ::std::option::Option, + ) -> &mut Self { + self.config.store_or_unset(stalled_stream_protection_config); + self + } + /// Sets the HTTP client to use when making requests. + /// + /// # Examples + /// ```no_run + /// # #[cfg(test)] + /// # mod tests { + /// # #[test] + /// # fn example() { + /// use std::time::Duration; + /// use aws_sdk_backupsearch::config::Config; + /// use aws_smithy_runtime::client::http::hyper_014::HyperClientBuilder; + /// + /// let https_connector = hyper_rustls::HttpsConnectorBuilder::new() + /// .with_webpki_roots() + /// .https_only() + /// .enable_http1() + /// .enable_http2() + /// .build(); + /// let hyper_client = HyperClientBuilder::new().build(https_connector); + /// + /// // This connector can then be given to a generated service Config + /// let config = my_service_client::Config::builder() + /// .endpoint_url("https://example.com") + /// .http_client(hyper_client) + /// .build(); + /// let client = my_service_client::Client::from_conf(config); + /// # } + /// # } + /// ``` + pub fn http_client(mut self, http_client: impl crate::config::HttpClient + 'static) -> Self { + self.set_http_client(::std::option::Option::Some(crate::config::IntoShared::into_shared(http_client))); + self + } + + /// Sets the HTTP client to use when making requests. + /// + /// # Examples + /// ```no_run + /// # #[cfg(test)] + /// # mod tests { + /// # #[test] + /// # fn example() { + /// use std::time::Duration; + /// use aws_sdk_backupsearch::config::{Builder, Config}; + /// use aws_smithy_runtime::client::http::hyper_014::HyperClientBuilder; + /// + /// fn override_http_client(builder: &mut Builder) { + /// let https_connector = hyper_rustls::HttpsConnectorBuilder::new() + /// .with_webpki_roots() + /// .https_only() + /// .enable_http1() + /// .enable_http2() + /// .build(); + /// let hyper_client = HyperClientBuilder::new().build(https_connector); + /// builder.set_http_client(Some(hyper_client)); + /// } + /// + /// let mut builder = aws_sdk_backupsearch::Config::builder(); + /// override_http_client(&mut builder); + /// let config = builder.build(); + /// # } + /// # } + /// ``` + pub fn set_http_client(&mut self, http_client: Option) -> &mut Self { + self.runtime_components.set_http_client(http_client); + self + } + /// Sets the endpoint resolver to use when making requests. + /// + + /// When unset, the client will used a generated endpoint resolver based on the endpoint resolution + /// rules for `aws_sdk_backupsearch`. + + /// + /// Note: setting an endpoint resolver will replace any endpoint URL that has been set. + /// This method accepts an endpoint resolver [specific to this service](crate::config::endpoint::ResolveEndpoint). If you want to + /// provide a shared endpoint resolver, use [`Self::set_endpoint_resolver`]. + /// + /// # Examples + /// Create a custom endpoint resolver that resolves a different endpoing per-stage, e.g. staging vs. production. + /// ```no_run + /// use aws_sdk_backupsearch::config::endpoint::{ResolveEndpoint, EndpointFuture, Params, Endpoint}; + /// #[derive(Debug)] + /// struct StageResolver { stage: String } + /// impl ResolveEndpoint for StageResolver { + /// fn resolve_endpoint(&self, params: &Params) -> EndpointFuture<'_> { + /// let stage = &self.stage; + /// EndpointFuture::ready(Ok(Endpoint::builder().url(format!("{stage}.myservice.com")).build())) + /// } + /// } + /// let resolver = StageResolver { stage: std::env::var("STAGE").unwrap() }; + /// let config = aws_sdk_backupsearch::Config::builder().endpoint_resolver(resolver).build(); + /// let client = aws_sdk_backupsearch::Client::from_conf(config); + /// ``` + pub fn endpoint_resolver(mut self, endpoint_resolver: impl crate::config::endpoint::ResolveEndpoint + 'static) -> Self { + self.set_endpoint_resolver(::std::option::Option::Some(endpoint_resolver.into_shared_resolver())); + self + } + + /// Sets the endpoint resolver to use when making requests. + /// + + /// When unset, the client will used a generated endpoint resolver based on the endpoint resolution + /// rules for `aws_sdk_backupsearch`. + pub fn set_endpoint_resolver( + &mut self, + endpoint_resolver: ::std::option::Option<::aws_smithy_runtime_api::client::endpoint::SharedEndpointResolver>, + ) -> &mut Self { + self.runtime_components.set_endpoint_resolver(endpoint_resolver); + self + } + /// Set the retry_config for the builder + /// + /// # Examples + /// ```no_run + /// use aws_sdk_backupsearch::config::Config; + /// use aws_sdk_backupsearch::config::retry::RetryConfig; + /// + /// let retry_config = RetryConfig::standard().with_max_attempts(5); + /// let config = Config::builder().retry_config(retry_config).build(); + /// ``` + pub fn retry_config(mut self, retry_config: ::aws_smithy_types::retry::RetryConfig) -> Self { + self.set_retry_config(Some(retry_config)); + self + } + + /// Set the retry_config for the builder + /// + /// # Examples + /// ```no_run + /// use aws_sdk_backupsearch::config::{Builder, Config}; + /// use aws_sdk_backupsearch::config::retry::RetryConfig; + /// + /// fn disable_retries(builder: &mut Builder) { + /// let retry_config = RetryConfig::standard().with_max_attempts(1); + /// builder.set_retry_config(Some(retry_config)); + /// } + /// + /// let mut builder = Config::builder(); + /// disable_retries(&mut builder); + /// let config = builder.build(); + /// ``` + pub fn set_retry_config(&mut self, retry_config: ::std::option::Option<::aws_smithy_types::retry::RetryConfig>) -> &mut Self { + retry_config.map(|r| self.config.store_put(r)); + self + } + /// Set the sleep_impl for the builder + /// + /// # Examples + /// + /// ```no_run + /// use aws_sdk_backupsearch::config::{AsyncSleep, Config, SharedAsyncSleep, Sleep}; + /// + /// #[derive(Debug)] + /// pub struct ForeverSleep; + /// + /// impl AsyncSleep for ForeverSleep { + /// fn sleep(&self, duration: std::time::Duration) -> Sleep { + /// Sleep::new(std::future::pending()) + /// } + /// } + /// + /// let sleep_impl = SharedAsyncSleep::new(ForeverSleep); + /// let config = Config::builder().sleep_impl(sleep_impl).build(); + /// ``` + pub fn sleep_impl(mut self, sleep_impl: impl crate::config::AsyncSleep + 'static) -> Self { + self.set_sleep_impl(Some(::aws_smithy_runtime_api::shared::IntoShared::into_shared(sleep_impl))); + self + } + + /// Set the sleep_impl for the builder + /// + /// # Examples + /// + /// ```no_run + /// use aws_sdk_backupsearch::config::{AsyncSleep, Builder, Config, SharedAsyncSleep, Sleep}; + /// + /// #[derive(Debug)] + /// pub struct ForeverSleep; + /// + /// impl AsyncSleep for ForeverSleep { + /// fn sleep(&self, duration: std::time::Duration) -> Sleep { + /// Sleep::new(std::future::pending()) + /// } + /// } + /// + /// fn set_never_ending_sleep_impl(builder: &mut Builder) { + /// let sleep_impl = SharedAsyncSleep::new(ForeverSleep); + /// builder.set_sleep_impl(Some(sleep_impl)); + /// } + /// + /// let mut builder = Config::builder(); + /// set_never_ending_sleep_impl(&mut builder); + /// let config = builder.build(); + /// ``` + pub fn set_sleep_impl(&mut self, sleep_impl: ::std::option::Option) -> &mut Self { + self.runtime_components.set_sleep_impl(sleep_impl); + self + } + /// Set the timeout_config for the builder + /// + /// # Examples + /// + /// ```no_run + /// # use std::time::Duration; + /// use aws_sdk_backupsearch::config::Config; + /// use aws_sdk_backupsearch::config::timeout::TimeoutConfig; + /// + /// let timeout_config = TimeoutConfig::builder() + /// .operation_attempt_timeout(Duration::from_secs(1)) + /// .build(); + /// let config = Config::builder().timeout_config(timeout_config).build(); + /// ``` + pub fn timeout_config(mut self, timeout_config: ::aws_smithy_types::timeout::TimeoutConfig) -> Self { + self.set_timeout_config(Some(timeout_config)); + self + } + + /// Set the timeout_config for the builder. + /// + /// Setting this to `None` has no effect if another source of configuration has set timeouts. If you + /// are attempting to disable timeouts, use [`TimeoutConfig::disabled`](::aws_smithy_types::timeout::TimeoutConfig::disabled) + /// + /// + /// # Examples + /// + /// ```no_run + /// # use std::time::Duration; + /// use aws_sdk_backupsearch::config::{Builder, Config}; + /// use aws_sdk_backupsearch::config::timeout::TimeoutConfig; + /// + /// fn set_request_timeout(builder: &mut Builder) { + /// let timeout_config = TimeoutConfig::builder() + /// .operation_attempt_timeout(Duration::from_secs(1)) + /// .build(); + /// builder.set_timeout_config(Some(timeout_config)); + /// } + /// + /// let mut builder = Config::builder(); + /// set_request_timeout(&mut builder); + /// let config = builder.build(); + /// ``` + pub fn set_timeout_config(&mut self, timeout_config: ::std::option::Option<::aws_smithy_types::timeout::TimeoutConfig>) -> &mut Self { + // passing None has no impact. + let Some(mut timeout_config) = timeout_config else { return self }; + + if let Some(base) = self.config.load::<::aws_smithy_types::timeout::TimeoutConfig>() { + timeout_config.take_defaults_from(base); + } + self.config.store_put(timeout_config); + self + } + /// Set the partition for retry-related state. When clients share a retry partition, they will + /// also share things like token buckets and client rate limiters. By default, all clients + /// for the same service will share a partition. + pub fn retry_partition(mut self, retry_partition: ::aws_smithy_runtime::client::retries::RetryPartition) -> Self { + self.set_retry_partition(Some(retry_partition)); + self + } + /// Set the partition for retry-related state. When clients share a retry partition, they will + /// also share things like token buckets and client rate limiters. By default, all clients + /// for the same service will share a partition. + pub fn set_retry_partition( + &mut self, + retry_partition: ::std::option::Option<::aws_smithy_runtime::client::retries::RetryPartition>, + ) -> &mut Self { + retry_partition.map(|r| self.config.store_put(r)); + self + } + /// Set the identity cache for auth. + /// + /// The identity cache defaults to a lazy caching implementation that will resolve + /// an identity when it is requested, and place it in the cache thereafter. Subsequent + /// requests will take the value from the cache while it is still valid. Once it expires, + /// the next request will result in refreshing the identity. + /// + /// This configuration allows you to disable or change the default caching mechanism. + /// To use a custom caching mechanism, implement the [`ResolveCachedIdentity`](crate::config::ResolveCachedIdentity) + /// trait and pass that implementation into this function. + /// + /// # Examples + /// + /// Disabling identity caching: + /// ```no_run + /// use aws_sdk_backupsearch::config::IdentityCache; + /// + /// let config = aws_sdk_backupsearch::Config::builder() + /// .identity_cache(IdentityCache::no_cache()) + /// // ... + /// .build(); + /// let client = aws_sdk_backupsearch::Client::from_conf(config); + /// ``` + /// + /// Customizing lazy caching: + /// ```no_run + /// use aws_sdk_backupsearch::config::IdentityCache; + /// use std::time::Duration; + /// + /// let config = aws_sdk_backupsearch::Config::builder() + /// .identity_cache( + /// IdentityCache::lazy() + /// // change the load timeout to 10 seconds + /// .load_timeout(Duration::from_secs(10)) + /// .build() + /// ) + /// // ... + /// .build(); + /// let client = aws_sdk_backupsearch::Client::from_conf(config); + /// ``` + + pub fn identity_cache(mut self, identity_cache: impl crate::config::ResolveCachedIdentity + 'static) -> Self { + self.set_identity_cache(identity_cache); + self + } + + /// Set the identity cache for auth. + /// + /// The identity cache defaults to a lazy caching implementation that will resolve + /// an identity when it is requested, and place it in the cache thereafter. Subsequent + /// requests will take the value from the cache while it is still valid. Once it expires, + /// the next request will result in refreshing the identity. + /// + /// This configuration allows you to disable or change the default caching mechanism. + /// To use a custom caching mechanism, implement the [`ResolveCachedIdentity`](crate::config::ResolveCachedIdentity) + /// trait and pass that implementation into this function. + /// + /// # Examples + /// + /// Disabling identity caching: + /// ```no_run + /// use aws_sdk_backupsearch::config::IdentityCache; + /// + /// let config = aws_sdk_backupsearch::Config::builder() + /// .identity_cache(IdentityCache::no_cache()) + /// // ... + /// .build(); + /// let client = aws_sdk_backupsearch::Client::from_conf(config); + /// ``` + /// + /// Customizing lazy caching: + /// ```no_run + /// use aws_sdk_backupsearch::config::IdentityCache; + /// use std::time::Duration; + /// + /// let config = aws_sdk_backupsearch::Config::builder() + /// .identity_cache( + /// IdentityCache::lazy() + /// // change the load timeout to 10 seconds + /// .load_timeout(Duration::from_secs(10)) + /// .build() + /// ) + /// // ... + /// .build(); + /// let client = aws_sdk_backupsearch::Client::from_conf(config); + /// ``` + + pub fn set_identity_cache(&mut self, identity_cache: impl crate::config::ResolveCachedIdentity + 'static) -> &mut Self { + self.runtime_components.set_identity_cache(::std::option::Option::Some(identity_cache)); + self + } + /// Add an [interceptor](crate::config::Intercept) that runs at specific stages of the request execution pipeline. + /// + /// Interceptors targeted at a certain stage are executed according to the pre-defined priority. + /// The SDK provides a default set of interceptors. An interceptor configured by this method + /// will run after those default interceptors. + /// + /// # Examples + /// ```no_run + /// # #[cfg(test)] + /// # mod tests { + /// # #[test] + /// # fn example() { + /// use aws_smithy_runtime_api::client::interceptors::context::phase::BeforeTransmit; + /// use aws_smithy_runtime_api::client::interceptors::{Interceptor, InterceptorContext}; + /// use aws_smithy_types::config_bag::ConfigBag; + /// use aws_sdk_backupsearch::config::Config; + /// + /// fn base_url() -> String { + /// // ... + /// # String::new() + /// } + /// + /// #[derive(Debug)] + /// pub struct UriModifierInterceptor; + /// impl Intercept for UriModifierInterceptor { + /// fn modify_before_signing( + /// &self, + /// context: &mut InterceptorContext, + /// _cfg: &mut ConfigBag, + /// ) -> Result<(), aws_smithy_runtime_api::client::interceptors::BoxError> { + /// let request = context.request_mut(); + /// let uri = format!("{}{}", base_url(), request.uri().path()); + /// *request.uri_mut() = uri.parse()?; + /// + /// Ok(()) + /// } + /// } + /// + /// let config = Config::builder() + /// .interceptor(UriModifierInterceptor) + /// .build(); + /// # } + /// # } + /// ``` + pub fn interceptor(mut self, interceptor: impl crate::config::Intercept + 'static) -> Self { + self.push_interceptor(crate::config::SharedInterceptor::new(interceptor)); + self + } + + /// Add a [`SharedInterceptor`](crate::config::SharedInterceptor) that runs at specific stages of the request execution pipeline. + /// + /// Interceptors targeted at a certain stage are executed according to the pre-defined priority. + /// The SDK provides a default set of interceptors. An interceptor configured by this method + /// will run after those default interceptors. + /// + /// # Examples + /// ```no_run + /// # #[cfg(test)] + /// # mod tests { + /// # #[test] + /// # fn example() { + /// use aws_smithy_runtime_api::client::interceptors::context::phase::BeforeTransmit; + /// use aws_smithy_runtime_api::client::interceptors::{Interceptor, InterceptorContext, SharedInterceptor}; + /// use aws_smithy_types::config_bag::ConfigBag; + /// use aws_sdk_backupsearch::config::{Builder, Config}; + /// + /// fn base_url() -> String { + /// // ... + /// # String::new() + /// } + /// + /// fn modify_request_uri(builder: &mut Builder) { + /// #[derive(Debug)] + /// pub struct UriModifierInterceptor; + /// impl Intercept for UriModifierInterceptor { + /// fn modify_before_signing( + /// &self, + /// context: &mut InterceptorContext, + /// _cfg: &mut ConfigBag, + /// ) -> Result<(), aws_smithy_runtime_api::client::interceptors::BoxError> { + /// let request = context.request_mut(); + /// let uri = format!("{}{}", base_url(), request.uri().path()); + /// *request.uri_mut() = uri.parse()?; + /// + /// Ok(()) + /// } + /// } + /// builder.push_interceptor(SharedInterceptor::new(UriModifierInterceptor)); + /// } + /// + /// let mut builder = Config::builder(); + /// modify_request_uri(&mut builder); + /// let config = builder.build(); + /// # } + /// # } + /// ``` + pub fn push_interceptor(&mut self, interceptor: crate::config::SharedInterceptor) -> &mut Self { + self.runtime_components.push_interceptor(interceptor); + self + } + + /// Set [`SharedInterceptor`](crate::config::SharedInterceptor)s for the builder. + pub fn set_interceptors(&mut self, interceptors: impl IntoIterator) -> &mut Self { + self.runtime_components.set_interceptors(interceptors.into_iter()); + self + } + /// Sets the time source used for this service + pub fn time_source(mut self, time_source: impl ::aws_smithy_async::time::TimeSource + 'static) -> Self { + self.set_time_source(::std::option::Option::Some(::aws_smithy_runtime_api::shared::IntoShared::into_shared( + time_source, + ))); + self + } + /// Sets the time source used for this service + pub fn set_time_source(&mut self, time_source: ::std::option::Option<::aws_smithy_async::time::SharedTimeSource>) -> &mut Self { + self.runtime_components.set_time_source(time_source); + self + } + /// Add type implementing [`ClassifyRetry`](::aws_smithy_runtime_api::client::retries::classifiers::ClassifyRetry) that will be used by the + /// [`RetryStrategy`](::aws_smithy_runtime_api::client::retries::RetryStrategy) to determine what responses should be retried. + /// + /// A retry classifier configured by this method will run according to its [priority](::aws_smithy_runtime_api::client::retries::classifiers::RetryClassifierPriority). + /// + /// # Examples + /// ```no_run + /// # #[cfg(test)] + /// # mod tests { + /// # #[test] + /// # fn example() { + /// use aws_smithy_runtime_api::client::interceptors::context::InterceptorContext; + /// use aws_smithy_runtime_api::client::orchestrator::OrchestratorError; + /// use aws_smithy_runtime_api::client::retries::classifiers::{ + /// ClassifyRetry, RetryAction, RetryClassifierPriority, + /// }; + /// use aws_smithy_types::error::metadata::ProvideErrorMetadata; + /// use aws_smithy_types::retry::ErrorKind; + /// use std::error::Error as StdError; + /// use std::marker::PhantomData; + /// use aws_sdk_backupsearch::config::Config; + /// # struct SomeOperationError {} + /// + /// const RETRYABLE_ERROR_CODES: &[&str] = [ + /// // List error codes to be retried here... + /// ]; + /// + /// // When classifying at an operation's error type, classifiers require a generic parameter. + /// // When classifying the HTTP response alone, no generic is needed. + /// #[derive(Debug, Default)] + /// pub struct ErrorCodeClassifier { + /// _inner: PhantomData, + /// } + /// + /// impl ExampleErrorCodeClassifier { + /// pub fn new() -> Self { + /// Self { + /// _inner: PhantomData, + /// } + /// } + /// } + /// + /// impl ClassifyRetry for ExampleErrorCodeClassifier + /// where + /// // Adding a trait bound for ProvideErrorMetadata allows us to inspect the error code. + /// E: StdError + ProvideErrorMetadata + Send + Sync + 'static, + /// { + /// fn classify_retry(&self, ctx: &InterceptorContext) -> RetryAction { + /// // Check for a result + /// let output_or_error = ctx.output_or_error(); + /// // Check for an error + /// let error = match output_or_error { + /// Some(Ok(_)) | None => return RetryAction::NoActionIndicated, + /// Some(Err(err)) => err, + /// }; + /// + /// // Downcast the generic error and extract the code + /// let error_code = OrchestratorError::as_operation_error(error) + /// .and_then(|err| err.downcast_ref::()) + /// .and_then(|err| err.code()); + /// + /// // If this error's code is in our list, return an action that tells the RetryStrategy to retry this request. + /// if let Some(error_code) = error_code { + /// if RETRYABLE_ERROR_CODES.contains(&error_code) { + /// return RetryAction::transient_error(); + /// } + /// } + /// + /// // Otherwise, return that no action is indicated i.e. that this classifier doesn't require a retry. + /// // Another classifier may still classify this response as retryable. + /// RetryAction::NoActionIndicated + /// } + /// + /// fn name(&self) -> &'static str { "Example Error Code Classifier" } + /// } + /// + /// let config = Config::builder() + /// .retry_classifier(ExampleErrorCodeClassifier::::new()) + /// .build(); + /// # } + /// # } + /// ``` + pub fn retry_classifier( + mut self, + retry_classifier: impl ::aws_smithy_runtime_api::client::retries::classifiers::ClassifyRetry + 'static, + ) -> Self { + self.push_retry_classifier(::aws_smithy_runtime_api::client::retries::classifiers::SharedRetryClassifier::new( + retry_classifier, + )); + self + } + + /// Add a [`SharedRetryClassifier`](::aws_smithy_runtime_api::client::retries::classifiers::SharedRetryClassifier) that will be used by the + /// [`RetryStrategy`](::aws_smithy_runtime_api::client::retries::RetryStrategy) to determine what responses should be retried. + /// + /// A retry classifier configured by this method will run according to its priority. + /// + /// # Examples + /// ```no_run + /// # #[cfg(test)] + /// # mod tests { + /// # #[test] + /// # fn example() { + /// use aws_smithy_runtime_api::client::interceptors::context::InterceptorContext; + /// use aws_smithy_runtime_api::client::orchestrator::OrchestratorError; + /// use aws_smithy_runtime_api::client::retries::classifiers::{ + /// ClassifyRetry, RetryAction, RetryClassifierPriority, + /// }; + /// use aws_smithy_types::error::metadata::ProvideErrorMetadata; + /// use aws_smithy_types::retry::ErrorKind; + /// use std::error::Error as StdError; + /// use std::marker::PhantomData; + /// use aws_sdk_backupsearch::config::{Builder, Config}; + /// # struct SomeOperationError {} + /// + /// const RETRYABLE_ERROR_CODES: &[&str] = [ + /// // List error codes to be retried here... + /// ]; + /// fn set_example_error_code_classifier(builder: &mut Builder) { + /// // When classifying at an operation's error type, classifiers require a generic parameter. + /// // When classifying the HTTP response alone, no generic is needed. + /// #[derive(Debug, Default)] + /// pub struct ExampleErrorCodeClassifier { + /// _inner: PhantomData, + /// } + /// + /// impl ExampleErrorCodeClassifier { + /// pub fn new() -> Self { + /// Self { + /// _inner: PhantomData, + /// } + /// } + /// } + /// + /// impl ClassifyRetry for ExampleErrorCodeClassifier + /// where + /// // Adding a trait bound for ProvideErrorMetadata allows us to inspect the error code. + /// E: StdError + ProvideErrorMetadata + Send + Sync + 'static, + /// { + /// fn classify_retry(&self, ctx: &InterceptorContext) -> RetryAction { + /// // Check for a result + /// let output_or_error = ctx.output_or_error(); + /// // Check for an error + /// let error = match output_or_error { + /// Some(Ok(_)) | None => return RetryAction::NoActionIndicated, + /// Some(Err(err)) => err, + /// }; + /// + /// // Downcast the generic error and extract the code + /// let error_code = OrchestratorError::as_operation_error(error) + /// .and_then(|err| err.downcast_ref::()) + /// .and_then(|err| err.code()); + /// + /// // If this error's code is in our list, return an action that tells the RetryStrategy to retry this request. + /// if let Some(error_code) = error_code { + /// if RETRYABLE_ERROR_CODES.contains(&error_code) { + /// return RetryAction::transient_error(); + /// } + /// } + /// + /// // Otherwise, return that no action is indicated i.e. that this classifier doesn't require a retry. + /// // Another classifier may still classify this response as retryable. + /// RetryAction::NoActionIndicated + /// } + /// + /// fn name(&self) -> &'static str { "Example Error Code Classifier" } + /// } + /// + /// builder.push_retry_classifier(ExampleErrorCodeClassifier::::new()) + /// } + /// + /// let mut builder = Config::builder(); + /// set_example_error_code_classifier(&mut builder); + /// let config = builder.build(); + /// # } + /// # } + /// ``` + pub fn push_retry_classifier( + &mut self, + retry_classifier: ::aws_smithy_runtime_api::client::retries::classifiers::SharedRetryClassifier, + ) -> &mut Self { + self.runtime_components.push_retry_classifier(retry_classifier); + self + } + + /// Set [`SharedRetryClassifier`](::aws_smithy_runtime_api::client::retries::classifiers::SharedRetryClassifier)s for the builder, replacing any that + /// were previously set. + pub fn set_retry_classifiers( + &mut self, + retry_classifiers: impl IntoIterator, + ) -> &mut Self { + self.runtime_components.set_retry_classifiers(retry_classifiers.into_iter()); + self + } + /// Sets the name of the app that is using the client. + /// + /// This _optional_ name is used to identify the application in the user agent that + /// gets sent along with requests. + pub fn app_name(mut self, app_name: ::aws_types::app_name::AppName) -> Self { + self.set_app_name(Some(app_name)); + self + } + /// Sets the name of the app that is using the client. + /// + /// This _optional_ name is used to identify the application in the user agent that + /// gets sent along with requests. + pub fn set_app_name(&mut self, app_name: ::std::option::Option<::aws_types::app_name::AppName>) -> &mut Self { + self.config.store_or_unset(app_name); + self + } + /// Overrides the default invocation ID generator. + /// + /// The invocation ID generator generates ID values for the `amz-sdk-invocation-id` header. By default, this will be a random UUID. Overriding it may be useful in tests that examine the HTTP request and need to be deterministic. + pub fn invocation_id_generator(mut self, gen: impl ::aws_runtime::invocation_id::InvocationIdGenerator + 'static) -> Self { + self.set_invocation_id_generator(::std::option::Option::Some( + ::aws_runtime::invocation_id::SharedInvocationIdGenerator::new(gen), + )); + self + } + /// Overrides the default invocation ID generator. + /// + /// The invocation ID generator generates ID values for the `amz-sdk-invocation-id` header. By default, this will be a random UUID. Overriding it may be useful in tests that examine the HTTP request and need to be deterministic. + pub fn set_invocation_id_generator( + &mut self, + gen: ::std::option::Option<::aws_runtime::invocation_id::SharedInvocationIdGenerator>, + ) -> &mut Self { + self.config.store_or_unset(gen); + self + } + /// Sets the endpoint URL used to communicate with this service + + /// Note: this is used in combination with other endpoint rules, e.g. an API that applies a host-label prefix + /// will be prefixed onto this URL. To fully override the endpoint resolver, use + /// [`Builder::endpoint_resolver`]. + pub fn endpoint_url(mut self, endpoint_url: impl Into<::std::string::String>) -> Self { + self.set_endpoint_url(Some(endpoint_url.into())); + self + } + /// Sets the endpoint URL used to communicate with this service + + /// Note: this is used in combination with other endpoint rules, e.g. an API that applies a host-label prefix + /// will be prefixed onto this URL. To fully override the endpoint resolver, use + /// [`Builder::endpoint_resolver`]. + pub fn set_endpoint_url(&mut self, endpoint_url: Option<::std::string::String>) -> &mut Self { + self.config.store_or_unset(endpoint_url.map(::aws_types::endpoint_config::EndpointUrl)); + self + } + /// When true, send this request to the FIPS-compliant regional endpoint. If the configured endpoint does not have a FIPS compliant endpoint, dispatching the request will return an error. + pub fn use_fips(mut self, use_fips: impl Into) -> Self { + self.set_use_fips(Some(use_fips.into())); + self + } + /// When true, send this request to the FIPS-compliant regional endpoint. If the configured endpoint does not have a FIPS compliant endpoint, dispatching the request will return an error. + pub fn set_use_fips(&mut self, use_fips: Option) -> &mut Self { + self.config.store_or_unset(use_fips.map(::aws_types::endpoint_config::UseFips)); + self + } + /// Sets the AWS region to use when making requests. + /// + /// # Examples + /// ```no_run + /// use aws_types::region::Region; + /// use aws_sdk_backupsearch::config::{Builder, Config}; + /// + /// let config = aws_sdk_backupsearch::Config::builder() + /// .region(Region::new("us-east-1")) + /// .build(); + /// ``` + pub fn region(mut self, region: impl ::std::convert::Into<::std::option::Option>) -> Self { + self.set_region(region.into()); + self + } + /// Sets the AWS region to use when making requests. + pub fn set_region(&mut self, region: ::std::option::Option) -> &mut Self { + self.config.store_or_unset(region); + self + } + /// Sets the credentials provider for this service + pub fn credentials_provider(mut self, credentials_provider: impl crate::config::ProvideCredentials + 'static) -> Self { + self.set_credentials_provider(::std::option::Option::Some(crate::config::SharedCredentialsProvider::new( + credentials_provider, + ))); + self + } + /// Sets the credentials provider for this service + pub fn set_credentials_provider(&mut self, credentials_provider: ::std::option::Option) -> &mut Self { + if let Some(credentials_provider) = credentials_provider { + self.runtime_components + .set_identity_resolver(::aws_runtime::auth::sigv4::SCHEME_ID, credentials_provider); + } + self + } + /// Sets the [`behavior major version`](crate::config::BehaviorVersion). + /// + /// Over time, new best-practice behaviors are introduced. However, these behaviors might not be backwards + /// compatible. For example, a change which introduces new default timeouts or a new retry-mode for + /// all operations might be the ideal behavior but could break existing applications. + /// + /// # Examples + /// + /// Set the behavior major version to `latest`. This is equivalent to enabling the `behavior-version-latest` cargo feature. + /// ```no_run + /// use aws_sdk_backupsearch::config::BehaviorVersion; + /// + /// let config = aws_sdk_backupsearch::Config::builder() + /// .behavior_version(BehaviorVersion::latest()) + /// // ... + /// .build(); + /// let client = aws_sdk_backupsearch::Client::from_conf(config); + /// ``` + /// + /// Customizing behavior major version: + /// ```no_run + /// use aws_sdk_backupsearch::config::BehaviorVersion; + /// + /// let config = aws_sdk_backupsearch::Config::builder() + /// .behavior_version(BehaviorVersion::v2023_11_09()) + /// // ... + /// .build(); + /// let client = aws_sdk_backupsearch::Client::from_conf(config); + /// ``` + + pub fn behavior_version(mut self, behavior_version: crate::config::BehaviorVersion) -> Self { + self.set_behavior_version(Some(behavior_version)); + self + } + + /// Sets the [`behavior major version`](crate::config::BehaviorVersion). + /// + /// Over time, new best-practice behaviors are introduced. However, these behaviors might not be backwards + /// compatible. For example, a change which introduces new default timeouts or a new retry-mode for + /// all operations might be the ideal behavior but could break existing applications. + /// + /// # Examples + /// + /// Set the behavior major version to `latest`. This is equivalent to enabling the `behavior-version-latest` cargo feature. + /// ```no_run + /// use aws_sdk_backupsearch::config::BehaviorVersion; + /// + /// let config = aws_sdk_backupsearch::Config::builder() + /// .behavior_version(BehaviorVersion::latest()) + /// // ... + /// .build(); + /// let client = aws_sdk_backupsearch::Client::from_conf(config); + /// ``` + /// + /// Customizing behavior major version: + /// ```no_run + /// use aws_sdk_backupsearch::config::BehaviorVersion; + /// + /// let config = aws_sdk_backupsearch::Config::builder() + /// .behavior_version(BehaviorVersion::v2023_11_09()) + /// // ... + /// .build(); + /// let client = aws_sdk_backupsearch::Client::from_conf(config); + /// ``` + + pub fn set_behavior_version(&mut self, behavior_version: Option) -> &mut Self { + self.behavior_version = behavior_version; + self + } + + /// Convenience method to set the latest behavior major version + /// + /// This is equivalent to enabling the `behavior-version-latest` Cargo feature + pub fn behavior_version_latest(mut self) -> Self { + self.set_behavior_version(Some(crate::config::BehaviorVersion::latest())); + self + } + /// Adds a runtime plugin to the config. + #[allow(unused)] + pub(crate) fn runtime_plugin(mut self, plugin: impl crate::config::RuntimePlugin + 'static) -> Self { + self.push_runtime_plugin(crate::config::SharedRuntimePlugin::new(plugin)); + self + } + /// Adds a runtime plugin to the config. + #[allow(unused)] + pub(crate) fn push_runtime_plugin(&mut self, plugin: crate::config::SharedRuntimePlugin) -> &mut Self { + self.runtime_plugins.push(plugin); + self + } + #[cfg(any(feature = "test-util", test))] + #[allow(unused_mut)] + /// Apply test defaults to the builder + pub fn apply_test_defaults(&mut self) -> &mut Self { + self.set_time_source(::std::option::Option::Some(::aws_smithy_async::time::SharedTimeSource::new( + ::aws_smithy_async::time::StaticTimeSource::new(::std::time::UNIX_EPOCH + ::std::time::Duration::from_secs(1234567890)), + ))); + self.config.store_put(::aws_runtime::user_agent::AwsUserAgent::for_tests()); + self.set_credentials_provider(Some(crate::config::SharedCredentialsProvider::new( + ::aws_credential_types::Credentials::for_tests(), + ))); + self.behavior_version = ::std::option::Option::Some(crate::config::BehaviorVersion::latest()); + self + } + #[cfg(any(feature = "test-util", test))] + #[allow(unused_mut)] + /// Apply test defaults to the builder + pub fn with_test_defaults(mut self) -> Self { + self.apply_test_defaults(); + self + } + /// Builds a [`Config`]. + #[allow(unused_mut)] + pub fn build(mut self) -> Config { + let mut layer = self.config; + if self.runtime_components.time_source().is_none() { + self.runtime_components + .set_time_source(::std::option::Option::Some(::std::default::Default::default())); + } + layer.store_put(crate::meta::API_METADATA.clone()); + layer.store_put(::aws_types::SigningName::from_static("backup-search")); + layer + .load::<::aws_types::region::Region>() + .cloned() + .map(|r| layer.store_put(::aws_types::region::SigningRegion::from(r))); + Config { + config: crate::config::Layer::from(layer.clone()) + .with_name("aws_sdk_backupsearch::config::Config") + .freeze(), + cloneable: layer, + runtime_components: self.runtime_components, + runtime_plugins: self.runtime_plugins, + behavior_version: self.behavior_version, + } + } +} +#[derive(::std::fmt::Debug)] +pub(crate) struct ServiceRuntimePlugin { + config: ::std::option::Option<::aws_smithy_types::config_bag::FrozenLayer>, + runtime_components: ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder, +} + +impl ServiceRuntimePlugin { + pub fn new(_service_config: crate::config::Config) -> Self { + let config = { None }; + let mut runtime_components = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("ServiceRuntimePlugin"); + runtime_components.set_endpoint_resolver(Some({ + use crate::config::endpoint::ResolveEndpoint; + crate::config::endpoint::DefaultResolver::new().into_shared_resolver() + })); + runtime_components.push_interceptor(::aws_smithy_runtime::client::http::connection_poisoning::ConnectionPoisoningInterceptor::new()); + runtime_components.push_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::HttpStatusCodeClassifier::default()); + runtime_components.push_interceptor(::aws_runtime::service_clock_skew::ServiceClockSkewInterceptor::new()); + runtime_components.push_interceptor(::aws_runtime::request_info::RequestInfoInterceptor::new()); + runtime_components.push_interceptor(::aws_runtime::user_agent::UserAgentInterceptor::new()); + runtime_components.push_interceptor(::aws_runtime::invocation_id::InvocationIdInterceptor::new()); + runtime_components.push_interceptor(::aws_runtime::recursion_detection::RecursionDetectionInterceptor::new()); + runtime_components.push_auth_scheme(::aws_smithy_runtime_api::client::auth::SharedAuthScheme::new( + ::aws_runtime::auth::sigv4::SigV4AuthScheme::new(), + )); + Self { config, runtime_components } + } +} + +impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for ServiceRuntimePlugin { + fn config(&self) -> ::std::option::Option<::aws_smithy_types::config_bag::FrozenLayer> { + self.config.clone() + } + + fn order(&self) -> ::aws_smithy_runtime_api::client::runtime_plugin::Order { + ::aws_smithy_runtime_api::client::runtime_plugin::Order::Defaults + } + + fn runtime_components( + &self, + _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder, + ) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> { + ::std::borrow::Cow::Borrowed(&self.runtime_components) + } +} + +/// Cross-operation shared-state singletons + +/// A plugin that enables configuration for a single operation invocation +/// +/// The `config` method will return a `FrozenLayer` by storing values from `config_override`. +/// In the case of default values requested, they will be obtained from `client_config`. +#[derive(Debug)] +pub(crate) struct ConfigOverrideRuntimePlugin { + pub(crate) config: ::aws_smithy_types::config_bag::FrozenLayer, + pub(crate) components: ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder, +} + +impl ConfigOverrideRuntimePlugin { + #[allow(dead_code)] // unused when a service does not provide any operations + pub(crate) fn new( + config_override: Builder, + initial_config: ::aws_smithy_types::config_bag::FrozenLayer, + initial_components: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder, + ) -> Self { + let mut layer = config_override.config; + let mut components = config_override.runtime_components; + #[allow(unused_mut)] + let mut resolver = + ::aws_smithy_runtime::client::config_override::Resolver::overrid(initial_config, initial_components, &mut layer, &mut components); + + resolver + .config_mut() + .load::<::aws_types::region::Region>() + .cloned() + .map(|r| resolver.config_mut().store_put(::aws_types::region::SigningRegion::from(r))); + + let _ = resolver; + Self { + config: ::aws_smithy_types::config_bag::Layer::from(layer) + .with_name("aws_sdk_backupsearch::config::ConfigOverrideRuntimePlugin") + .freeze(), + components, + } + } +} + +impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for ConfigOverrideRuntimePlugin { + fn config(&self) -> ::std::option::Option<::aws_smithy_types::config_bag::FrozenLayer> { + Some(self.config.clone()) + } + + fn runtime_components( + &self, + _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder, + ) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> { + ::std::borrow::Cow::Borrowed(&self.components) + } +} + +pub use ::aws_smithy_runtime::client::identity::IdentityCache; +pub use ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponents; +pub use ::aws_smithy_types::config_bag::ConfigBag; + +pub use ::aws_credential_types::Credentials; + +impl From<&::aws_types::sdk_config::SdkConfig> for Builder { + fn from(input: &::aws_types::sdk_config::SdkConfig) -> Self { + let mut builder = Builder::default(); + builder.set_credentials_provider(input.credentials_provider()); + builder = builder.region(input.region().cloned()); + builder.set_use_fips(input.use_fips()); + if input.get_origin("endpoint_url").is_client_config() { + builder.set_endpoint_url(input.endpoint_url().map(|s| s.to_string())); + } else { + builder.set_endpoint_url( + input + .service_config() + .and_then(|conf| { + conf.load_config(service_config_key("AWS_ENDPOINT_URL", "endpoint_url")) + .map(|it| it.parse().unwrap()) + }) + .or_else(|| input.endpoint_url().map(|s| s.to_string())), + ); + } + // resiliency + builder.set_retry_config(input.retry_config().cloned()); + builder.set_timeout_config(input.timeout_config().cloned()); + builder.set_sleep_impl(input.sleep_impl()); + + builder.set_http_client(input.http_client()); + builder.set_time_source(input.time_source()); + builder.set_behavior_version(input.behavior_version()); + // setting `None` here removes the default + if let Some(config) = input.stalled_stream_protection() { + builder.set_stalled_stream_protection(Some(config)); + } + + if let Some(cache) = input.identity_cache() { + builder.set_identity_cache(cache); + } + builder.set_app_name(input.app_name().cloned()); + + builder + } +} + +impl From<&::aws_types::sdk_config::SdkConfig> for Config { + fn from(sdk_config: &::aws_types::sdk_config::SdkConfig) -> Self { + Builder::from(sdk_config).build() + } +} + +pub use ::aws_types::app_name::AppName; + +#[allow(dead_code)] +fn service_config_key<'a>(env: &'a str, profile: &'a str) -> aws_types::service_config::ServiceConfigKey<'a> { + ::aws_types::service_config::ServiceConfigKey::builder() + .service_id("backupsearch") + .env(env) + .profile(profile) + .build() + .expect("all field sets explicitly, can't fail") +} + +pub use ::aws_smithy_async::rt::sleep::Sleep; + +pub(crate) fn base_client_runtime_plugins(mut config: crate::Config) -> ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins { + let mut configured_plugins = ::std::vec::Vec::new(); + ::std::mem::swap(&mut config.runtime_plugins, &mut configured_plugins); + #[cfg(feature = "behavior-version-latest")] + { + if config.behavior_version.is_none() { + config.behavior_version = Some(::aws_smithy_runtime_api::client::behavior_version::BehaviorVersion::latest()); + } + } + + let mut plugins = ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins::new() + // defaults + .with_client_plugins(::aws_smithy_runtime::client::defaults::default_plugins( + ::aws_smithy_runtime::client::defaults::DefaultPluginParams::new() + .with_retry_partition_name("backupsearch") + .with_behavior_version(config.behavior_version.expect("Invalid client configuration: A behavior major version must be set when sending a request or constructing a client. You must set it during client construction or by enabling the `behavior-version-latest` cargo feature.")) + )) + // user config + .with_client_plugin( + ::aws_smithy_runtime_api::client::runtime_plugin::StaticRuntimePlugin::new() + .with_config(config.config.clone()) + .with_runtime_components(config.runtime_components.clone()) + ) + // codegen config + .with_client_plugin(crate::config::ServiceRuntimePlugin::new(config.clone())) + .with_client_plugin(::aws_smithy_runtime::client::auth::no_auth::NoAuthRuntimePlugin::new()); + + for plugin in configured_plugins { + plugins = plugins.with_client_plugin(plugin); + } + plugins +} + +pub use ::aws_smithy_types::config_bag::FrozenLayer; + +pub use ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder; + +pub use ::aws_smithy_runtime_api::client::runtime_plugin::SharedRuntimePlugin; + +pub use ::aws_smithy_runtime_api::client::behavior_version::BehaviorVersion; + +pub use ::aws_smithy_runtime_api::client::stalled_stream_protection::StalledStreamProtectionConfig; + +pub use ::aws_smithy_runtime_api::client::http::SharedHttpClient; + +pub use ::aws_smithy_async::rt::sleep::SharedAsyncSleep; + +pub use ::aws_smithy_runtime_api::client::identity::SharedIdentityCache; + +pub use ::aws_smithy_runtime_api::client::interceptors::SharedInterceptor; + +pub use ::aws_types::region::Region; + +pub use ::aws_credential_types::provider::SharedCredentialsProvider; + +pub use ::aws_smithy_runtime_api::client::http::HttpClient; + +pub use ::aws_smithy_runtime_api::shared::IntoShared; + +pub use ::aws_smithy_async::rt::sleep::AsyncSleep; + +pub use ::aws_smithy_runtime_api::client::identity::ResolveCachedIdentity; + +pub use ::aws_smithy_runtime_api::client::interceptors::Intercept; + +pub use ::aws_credential_types::provider::ProvideCredentials; + +pub use ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin; + +pub use ::aws_smithy_types::config_bag::Layer; + +/// Types needed to configure endpoint resolution. +pub mod endpoint; + +/// HTTP request and response types. +pub mod http; + +/// Types needed to implement [`Intercept`](crate::config::Intercept). +pub mod interceptors; + +/// Retry configuration. +pub mod retry; + +/// Timeout configuration. +pub mod timeout; diff --git a/sdk/backupsearch/src/config/endpoint.rs b/sdk/backupsearch/src/config/endpoint.rs new file mode 100644 index 000000000000..9183af64c0d7 --- /dev/null +++ b/sdk/backupsearch/src/config/endpoint.rs @@ -0,0 +1,632 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +pub use ::aws_smithy_runtime_api::client::endpoint::EndpointFuture; +pub use ::aws_smithy_runtime_api::client::endpoint::SharedEndpointResolver; +pub use ::aws_smithy_types::endpoint::Endpoint; + +#[cfg(test)] +mod test { + + /// For custom endpoint with region not set and fips disabled + #[test] + fn test_1() { + let params = crate::config::endpoint::Params::builder() + .endpoint("https://example.com".to_string()) + .use_fips(false) + .build() + .expect("invalid params"); + let resolver = crate::config::endpoint::DefaultResolver::new(); + let endpoint = resolver.resolve_endpoint(¶ms); + let endpoint = endpoint.expect("Expected valid endpoint: https://example.com"); + assert_eq!( + endpoint, + ::aws_smithy_types::endpoint::Endpoint::builder().url("https://example.com").build() + ); + } + + /// For custom endpoint with fips enabled + #[test] + fn test_2() { + let params = crate::config::endpoint::Params::builder() + .endpoint("https://example.com".to_string()) + .use_fips(true) + .build() + .expect("invalid params"); + let resolver = crate::config::endpoint::DefaultResolver::new(); + let endpoint = resolver.resolve_endpoint(¶ms); + let error = endpoint + .expect_err("expected error: Invalid Configuration: FIPS and custom endpoint are not supported [For custom endpoint with fips enabled]"); + assert_eq!(format!("{}", error), "Invalid Configuration: FIPS and custom endpoint are not supported") + } + + /// For region us-east-1 with FIPS enabled and DualStack enabled + #[test] + fn test_3() { + let params = crate::config::endpoint::Params::builder() + .region("us-east-1".to_string()) + .use_fips(true) + .build() + .expect("invalid params"); + let resolver = crate::config::endpoint::DefaultResolver::new(); + let endpoint = resolver.resolve_endpoint(¶ms); + let endpoint = endpoint.expect("Expected valid endpoint: https://backup-search-fips.us-east-1.api.aws"); + assert_eq!( + endpoint, + ::aws_smithy_types::endpoint::Endpoint::builder() + .url("https://backup-search-fips.us-east-1.api.aws") + .property( + "authSchemes", + vec![::aws_smithy_types::Document::from({ + let mut out = ::std::collections::HashMap::::new(); + out.insert("name".to_string(), "sigv4".to_string().into()); + out.insert("signingRegion".to_string(), "us-east-1".to_string().into()); + out + })] + ) + .build() + ); + } + + /// For region us-east-1 with FIPS disabled and DualStack enabled + #[test] + fn test_4() { + let params = crate::config::endpoint::Params::builder() + .region("us-east-1".to_string()) + .use_fips(false) + .build() + .expect("invalid params"); + let resolver = crate::config::endpoint::DefaultResolver::new(); + let endpoint = resolver.resolve_endpoint(¶ms); + let endpoint = endpoint.expect("Expected valid endpoint: https://backup-search.us-east-1.api.aws"); + assert_eq!( + endpoint, + ::aws_smithy_types::endpoint::Endpoint::builder() + .url("https://backup-search.us-east-1.api.aws") + .property( + "authSchemes", + vec![::aws_smithy_types::Document::from({ + let mut out = ::std::collections::HashMap::::new(); + out.insert("name".to_string(), "sigv4".to_string().into()); + out.insert("signingRegion".to_string(), "us-east-1".to_string().into()); + out + })] + ) + .build() + ); + } + + /// For region cn-northwest-1 with FIPS enabled and DualStack enabled + #[test] + fn test_5() { + let params = crate::config::endpoint::Params::builder() + .region("cn-northwest-1".to_string()) + .use_fips(true) + .build() + .expect("invalid params"); + let resolver = crate::config::endpoint::DefaultResolver::new(); + let endpoint = resolver.resolve_endpoint(¶ms); + let endpoint = endpoint.expect("Expected valid endpoint: https://backup-search-fips.cn-northwest-1.api.amazonwebservices.com.cn"); + assert_eq!( + endpoint, + ::aws_smithy_types::endpoint::Endpoint::builder() + .url("https://backup-search-fips.cn-northwest-1.api.amazonwebservices.com.cn") + .property( + "authSchemes", + vec![::aws_smithy_types::Document::from({ + let mut out = ::std::collections::HashMap::::new(); + out.insert("name".to_string(), "sigv4".to_string().into()); + out.insert("signingRegion".to_string(), "cn-northwest-1".to_string().into()); + out + })] + ) + .build() + ); + } + + /// For region cn-northwest-1 with FIPS disabled and DualStack enabled + #[test] + fn test_6() { + let params = crate::config::endpoint::Params::builder() + .region("cn-northwest-1".to_string()) + .use_fips(false) + .build() + .expect("invalid params"); + let resolver = crate::config::endpoint::DefaultResolver::new(); + let endpoint = resolver.resolve_endpoint(¶ms); + let endpoint = endpoint.expect("Expected valid endpoint: https://backup-search.cn-northwest-1.api.amazonwebservices.com.cn"); + assert_eq!( + endpoint, + ::aws_smithy_types::endpoint::Endpoint::builder() + .url("https://backup-search.cn-northwest-1.api.amazonwebservices.com.cn") + .property( + "authSchemes", + vec![::aws_smithy_types::Document::from({ + let mut out = ::std::collections::HashMap::::new(); + out.insert("name".to_string(), "sigv4".to_string().into()); + out.insert("signingRegion".to_string(), "cn-northwest-1".to_string().into()); + out + })] + ) + .build() + ); + } + + /// For region us-gov-west-1 with FIPS enabled and DualStack enabled + #[test] + fn test_7() { + let params = crate::config::endpoint::Params::builder() + .region("us-gov-west-1".to_string()) + .use_fips(true) + .build() + .expect("invalid params"); + let resolver = crate::config::endpoint::DefaultResolver::new(); + let endpoint = resolver.resolve_endpoint(¶ms); + let endpoint = endpoint.expect("Expected valid endpoint: https://backup-search-fips.us-gov-west-1.api.aws"); + assert_eq!( + endpoint, + ::aws_smithy_types::endpoint::Endpoint::builder() + .url("https://backup-search-fips.us-gov-west-1.api.aws") + .property( + "authSchemes", + vec![::aws_smithy_types::Document::from({ + let mut out = ::std::collections::HashMap::::new(); + out.insert("name".to_string(), "sigv4".to_string().into()); + out.insert("signingRegion".to_string(), "us-gov-west-1".to_string().into()); + out + })] + ) + .build() + ); + } + + /// For region us-gov-west-1 with FIPS disabled and DualStack enabled + #[test] + fn test_8() { + let params = crate::config::endpoint::Params::builder() + .region("us-gov-west-1".to_string()) + .use_fips(false) + .build() + .expect("invalid params"); + let resolver = crate::config::endpoint::DefaultResolver::new(); + let endpoint = resolver.resolve_endpoint(¶ms); + let endpoint = endpoint.expect("Expected valid endpoint: https://backup-search.us-gov-west-1.api.aws"); + assert_eq!( + endpoint, + ::aws_smithy_types::endpoint::Endpoint::builder() + .url("https://backup-search.us-gov-west-1.api.aws") + .property( + "authSchemes", + vec![::aws_smithy_types::Document::from({ + let mut out = ::std::collections::HashMap::::new(); + out.insert("name".to_string(), "sigv4".to_string().into()); + out.insert("signingRegion".to_string(), "us-gov-west-1".to_string().into()); + out + })] + ) + .build() + ); + } + + /// For region us-iso-east-1 with FIPS enabled and DualStack enabled + #[test] + fn test_9() { + let params = crate::config::endpoint::Params::builder() + .region("us-iso-east-1".to_string()) + .use_fips(true) + .build() + .expect("invalid params"); + let resolver = crate::config::endpoint::DefaultResolver::new(); + let endpoint = resolver.resolve_endpoint(¶ms); + let endpoint = endpoint.expect("Expected valid endpoint: https://backup-search-fips.us-iso-east-1.c2s.ic.gov"); + assert_eq!( + endpoint, + ::aws_smithy_types::endpoint::Endpoint::builder() + .url("https://backup-search-fips.us-iso-east-1.c2s.ic.gov") + .property( + "authSchemes", + vec![::aws_smithy_types::Document::from({ + let mut out = ::std::collections::HashMap::::new(); + out.insert("name".to_string(), "sigv4".to_string().into()); + out.insert("signingRegion".to_string(), "us-iso-east-1".to_string().into()); + out + })] + ) + .build() + ); + } + + /// For region us-iso-east-1 with FIPS disabled and DualStack enabled + #[test] + fn test_10() { + let params = crate::config::endpoint::Params::builder() + .region("us-iso-east-1".to_string()) + .use_fips(false) + .build() + .expect("invalid params"); + let resolver = crate::config::endpoint::DefaultResolver::new(); + let endpoint = resolver.resolve_endpoint(¶ms); + let endpoint = endpoint.expect("Expected valid endpoint: https://backup-search.us-iso-east-1.c2s.ic.gov"); + assert_eq!( + endpoint, + ::aws_smithy_types::endpoint::Endpoint::builder() + .url("https://backup-search.us-iso-east-1.c2s.ic.gov") + .property( + "authSchemes", + vec![::aws_smithy_types::Document::from({ + let mut out = ::std::collections::HashMap::::new(); + out.insert("name".to_string(), "sigv4".to_string().into()); + out.insert("signingRegion".to_string(), "us-iso-east-1".to_string().into()); + out + })] + ) + .build() + ); + } + + /// For region us-isob-east-1 with FIPS enabled and DualStack enabled + #[test] + fn test_11() { + let params = crate::config::endpoint::Params::builder() + .region("us-isob-east-1".to_string()) + .use_fips(true) + .build() + .expect("invalid params"); + let resolver = crate::config::endpoint::DefaultResolver::new(); + let endpoint = resolver.resolve_endpoint(¶ms); + let endpoint = endpoint.expect("Expected valid endpoint: https://backup-search-fips.us-isob-east-1.sc2s.sgov.gov"); + assert_eq!( + endpoint, + ::aws_smithy_types::endpoint::Endpoint::builder() + .url("https://backup-search-fips.us-isob-east-1.sc2s.sgov.gov") + .property( + "authSchemes", + vec![::aws_smithy_types::Document::from({ + let mut out = ::std::collections::HashMap::::new(); + out.insert("name".to_string(), "sigv4".to_string().into()); + out.insert("signingRegion".to_string(), "us-isob-east-1".to_string().into()); + out + })] + ) + .build() + ); + } + + /// For region us-isob-east-1 with FIPS disabled and DualStack enabled + #[test] + fn test_12() { + let params = crate::config::endpoint::Params::builder() + .region("us-isob-east-1".to_string()) + .use_fips(false) + .build() + .expect("invalid params"); + let resolver = crate::config::endpoint::DefaultResolver::new(); + let endpoint = resolver.resolve_endpoint(¶ms); + let endpoint = endpoint.expect("Expected valid endpoint: https://backup-search.us-isob-east-1.sc2s.sgov.gov"); + assert_eq!( + endpoint, + ::aws_smithy_types::endpoint::Endpoint::builder() + .url("https://backup-search.us-isob-east-1.sc2s.sgov.gov") + .property( + "authSchemes", + vec![::aws_smithy_types::Document::from({ + let mut out = ::std::collections::HashMap::::new(); + out.insert("name".to_string(), "sigv4".to_string().into()); + out.insert("signingRegion".to_string(), "us-isob-east-1".to_string().into()); + out + })] + ) + .build() + ); + } + + /// For region eu-isoe-west-1 with FIPS enabled and DualStack enabled + #[test] + fn test_13() { + let params = crate::config::endpoint::Params::builder() + .region("eu-isoe-west-1".to_string()) + .use_fips(true) + .build() + .expect("invalid params"); + let resolver = crate::config::endpoint::DefaultResolver::new(); + let endpoint = resolver.resolve_endpoint(¶ms); + let endpoint = endpoint.expect("Expected valid endpoint: https://backup-search-fips.eu-isoe-west-1.cloud.adc-e.uk"); + assert_eq!( + endpoint, + ::aws_smithy_types::endpoint::Endpoint::builder() + .url("https://backup-search-fips.eu-isoe-west-1.cloud.adc-e.uk") + .property( + "authSchemes", + vec![::aws_smithy_types::Document::from({ + let mut out = ::std::collections::HashMap::::new(); + out.insert("name".to_string(), "sigv4".to_string().into()); + out.insert("signingRegion".to_string(), "eu-isoe-west-1".to_string().into()); + out + })] + ) + .build() + ); + } + + /// For region eu-isoe-west-1 with FIPS disabled and DualStack enabled + #[test] + fn test_14() { + let params = crate::config::endpoint::Params::builder() + .region("eu-isoe-west-1".to_string()) + .use_fips(false) + .build() + .expect("invalid params"); + let resolver = crate::config::endpoint::DefaultResolver::new(); + let endpoint = resolver.resolve_endpoint(¶ms); + let endpoint = endpoint.expect("Expected valid endpoint: https://backup-search.eu-isoe-west-1.cloud.adc-e.uk"); + assert_eq!( + endpoint, + ::aws_smithy_types::endpoint::Endpoint::builder() + .url("https://backup-search.eu-isoe-west-1.cloud.adc-e.uk") + .property( + "authSchemes", + vec![::aws_smithy_types::Document::from({ + let mut out = ::std::collections::HashMap::::new(); + out.insert("name".to_string(), "sigv4".to_string().into()); + out.insert("signingRegion".to_string(), "eu-isoe-west-1".to_string().into()); + out + })] + ) + .build() + ); + } + + /// For region us-isof-south-1 with FIPS enabled and DualStack enabled + #[test] + fn test_15() { + let params = crate::config::endpoint::Params::builder() + .region("us-isof-south-1".to_string()) + .use_fips(true) + .build() + .expect("invalid params"); + let resolver = crate::config::endpoint::DefaultResolver::new(); + let endpoint = resolver.resolve_endpoint(¶ms); + let endpoint = endpoint.expect("Expected valid endpoint: https://backup-search-fips.us-isof-south-1.csp.hci.ic.gov"); + assert_eq!( + endpoint, + ::aws_smithy_types::endpoint::Endpoint::builder() + .url("https://backup-search-fips.us-isof-south-1.csp.hci.ic.gov") + .property( + "authSchemes", + vec![::aws_smithy_types::Document::from({ + let mut out = ::std::collections::HashMap::::new(); + out.insert("name".to_string(), "sigv4".to_string().into()); + out.insert("signingRegion".to_string(), "us-isof-south-1".to_string().into()); + out + })] + ) + .build() + ); + } + + /// For region us-isof-south-1 with FIPS disabled and DualStack enabled + #[test] + fn test_16() { + let params = crate::config::endpoint::Params::builder() + .region("us-isof-south-1".to_string()) + .use_fips(false) + .build() + .expect("invalid params"); + let resolver = crate::config::endpoint::DefaultResolver::new(); + let endpoint = resolver.resolve_endpoint(¶ms); + let endpoint = endpoint.expect("Expected valid endpoint: https://backup-search.us-isof-south-1.csp.hci.ic.gov"); + assert_eq!( + endpoint, + ::aws_smithy_types::endpoint::Endpoint::builder() + .url("https://backup-search.us-isof-south-1.csp.hci.ic.gov") + .property( + "authSchemes", + vec![::aws_smithy_types::Document::from({ + let mut out = ::std::collections::HashMap::::new(); + out.insert("name".to_string(), "sigv4".to_string().into()); + out.insert("signingRegion".to_string(), "us-isof-south-1".to_string().into()); + out + })] + ) + .build() + ); + } + + /// Missing region + #[test] + fn test_17() { + let params = crate::config::endpoint::Params::builder().build().expect("invalid params"); + let resolver = crate::config::endpoint::DefaultResolver::new(); + let endpoint = resolver.resolve_endpoint(¶ms); + let error = endpoint.expect_err("expected error: Invalid Configuration: Missing Region [Missing region]"); + assert_eq!(format!("{}", error), "Invalid Configuration: Missing Region") + } +} + +/// Endpoint resolver trait specific to AWS Backup Search +pub trait ResolveEndpoint: ::std::marker::Send + ::std::marker::Sync + ::std::fmt::Debug { + /// Resolve an endpoint with the given parameters + fn resolve_endpoint<'a>(&'a self, params: &'a crate::config::endpoint::Params) -> ::aws_smithy_runtime_api::client::endpoint::EndpointFuture<'a>; + + /// Convert this service-specific resolver into a `SharedEndpointResolver` + /// + /// The resulting resolver will downcast `EndpointResolverParams` into `crate::config::endpoint::Params`. + fn into_shared_resolver(self) -> ::aws_smithy_runtime_api::client::endpoint::SharedEndpointResolver + where + Self: Sized + 'static, + { + ::aws_smithy_runtime_api::client::endpoint::SharedEndpointResolver::new(DowncastParams(self)) + } +} + +#[derive(Debug)] +struct DowncastParams(T); +impl ::aws_smithy_runtime_api::client::endpoint::ResolveEndpoint for DowncastParams +where + T: ResolveEndpoint, +{ + fn resolve_endpoint<'a>( + &'a self, + params: &'a ::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams, + ) -> ::aws_smithy_runtime_api::client::endpoint::EndpointFuture<'a> { + let ep = match params.get::() { + Some(params) => self.0.resolve_endpoint(params), + None => ::aws_smithy_runtime_api::client::endpoint::EndpointFuture::ready(Err("params of expected type was not present".into())), + }; + ep + } +} + +/// The default endpoint resolver +#[derive(Debug, Default)] +pub struct DefaultResolver { + partition_resolver: crate::endpoint_lib::partition::PartitionResolver, +} + +impl DefaultResolver { + /// Create a new endpoint resolver with default settings + pub fn new() -> Self { + Self { + partition_resolver: crate::endpoint_lib::DEFAULT_PARTITION_RESOLVER.clone(), + } + } + + fn resolve_endpoint( + &self, + params: &crate::config::endpoint::Params, + ) -> Result<::aws_smithy_types::endpoint::Endpoint, ::aws_smithy_runtime_api::box_error::BoxError> { + let mut diagnostic_collector = crate::endpoint_lib::diagnostic::DiagnosticCollector::new(); + Ok( + crate::config::endpoint::internals::resolve_endpoint(params, &mut diagnostic_collector, &self.partition_resolver) + .map_err(|err| err.with_source(diagnostic_collector.take_last_error()))?, + ) + } +} + +impl crate::config::endpoint::ResolveEndpoint for DefaultResolver { + fn resolve_endpoint(&self, params: &crate::config::endpoint::Params) -> ::aws_smithy_runtime_api::client::endpoint::EndpointFuture { + ::aws_smithy_runtime_api::client::endpoint::EndpointFuture::ready(self.resolve_endpoint(params)) + } +} + +#[non_exhaustive] +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)] +/// Configuration parameters for resolving the correct endpoint +pub struct Params { + /// When true, send this request to the FIPS-compliant regional endpoint. If the configured endpoint does not have a FIPS compliant endpoint, dispatching the request will return an error. + pub(crate) use_fips: bool, + /// Override the endpoint used to send this request + pub(crate) endpoint: ::std::option::Option<::std::string::String>, + /// The AWS region used to dispatch the request. + pub(crate) region: ::std::option::Option<::std::string::String>, +} +impl Params { + /// Create a builder for [`Params`] + pub fn builder() -> crate::config::endpoint::ParamsBuilder { + crate::config::endpoint::ParamsBuilder::default() + } + /// When true, send this request to the FIPS-compliant regional endpoint. If the configured endpoint does not have a FIPS compliant endpoint, dispatching the request will return an error. + pub fn use_fips(&self) -> ::std::option::Option { + Some(self.use_fips) + } + /// Override the endpoint used to send this request + pub fn endpoint(&self) -> ::std::option::Option<&str> { + self.endpoint.as_deref() + } + /// The AWS region used to dispatch the request. + pub fn region(&self) -> ::std::option::Option<&str> { + self.region.as_deref() + } +} + +/// Builder for [`Params`] +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)] +pub struct ParamsBuilder { + use_fips: ::std::option::Option, + endpoint: ::std::option::Option<::std::string::String>, + region: ::std::option::Option<::std::string::String>, +} +impl ParamsBuilder { + /// Consume this builder, creating [`Params`]. + pub fn build(self) -> ::std::result::Result { + Ok( + #[allow(clippy::unnecessary_lazy_evaluations)] + crate::config::endpoint::Params { + use_fips: self + .use_fips + .or_else(|| Some(false)) + .ok_or_else(|| crate::config::endpoint::InvalidParams::missing("use_fips"))?, + endpoint: self.endpoint, + region: self.region, + }, + ) + } + /// Sets the value for use_fips + /// + /// When unset, this parameter has a default value of `false`. + /// When true, send this request to the FIPS-compliant regional endpoint. If the configured endpoint does not have a FIPS compliant endpoint, dispatching the request will return an error. + pub fn use_fips(mut self, value: impl Into) -> Self { + self.use_fips = Some(value.into()); + self + } + + /// Sets the value for use_fips + /// + /// When unset, this parameter has a default value of `false`. + /// When true, send this request to the FIPS-compliant regional endpoint. If the configured endpoint does not have a FIPS compliant endpoint, dispatching the request will return an error. + pub fn set_use_fips(mut self, param: Option) -> Self { + self.use_fips = param; + self + } + /// Sets the value for endpoint + /// + /// Override the endpoint used to send this request + pub fn endpoint(mut self, value: impl Into<::std::string::String>) -> Self { + self.endpoint = Some(value.into()); + self + } + + /// Sets the value for endpoint + /// + /// Override the endpoint used to send this request + pub fn set_endpoint(mut self, param: Option<::std::string::String>) -> Self { + self.endpoint = param; + self + } + /// Sets the value for region + /// + /// The AWS region used to dispatch the request. + pub fn region(mut self, value: impl Into<::std::string::String>) -> Self { + self.region = Some(value.into()); + self + } + + /// Sets the value for region + /// + /// The AWS region used to dispatch the request. + pub fn set_region(mut self, param: Option<::std::string::String>) -> Self { + self.region = param; + self + } +} + +/// An error that occurred during endpoint resolution +#[derive(Debug)] +pub struct InvalidParams { + field: std::borrow::Cow<'static, str>, +} + +impl InvalidParams { + #[allow(dead_code)] + fn missing(field: &'static str) -> Self { + Self { field: field.into() } + } +} + +impl std::fmt::Display for InvalidParams { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "a required field was missing: `{}`", self.field) + } +} + +impl std::error::Error for InvalidParams {} + +mod internals; diff --git a/sdk/backupsearch/src/config/endpoint/internals.rs b/sdk/backupsearch/src/config/endpoint/internals.rs new file mode 100644 index 000000000000..c58316d64760 --- /dev/null +++ b/sdk/backupsearch/src/config/endpoint/internals.rs @@ -0,0 +1,87 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +#[allow( + clippy::collapsible_if, + clippy::bool_comparison, + clippy::nonminimal_bool, + clippy::comparison_to_empty, + clippy::redundant_pattern_matching +)] +pub(super) fn resolve_endpoint( + _params: &crate::config::endpoint::Params, + _diagnostic_collector: &mut crate::endpoint_lib::diagnostic::DiagnosticCollector, + partition_resolver: &crate::endpoint_lib::partition::PartitionResolver, +) -> ::aws_smithy_http::endpoint::Result { + #[allow(unused_variables)] + let use_fips = &_params.use_fips; + #[allow(unused_variables)] + let endpoint = &_params.endpoint; + #[allow(unused_variables)] + let region = &_params.region; + #[allow(unused_variables)] + if let Some(endpoint) = endpoint { + if (*use_fips) == (true) { + return Err(::aws_smithy_http::endpoint::ResolveEndpointError::message( + "Invalid Configuration: FIPS and custom endpoint are not supported".to_string(), + )); + } + return Ok(::aws_smithy_types::endpoint::Endpoint::builder().url(endpoint.to_owned()).build()); + } + #[allow(unused_variables)] + if let Some(region) = region { + #[allow(unused_variables)] + if let Some(partition_result) = partition_resolver.resolve_partition(region, _diagnostic_collector) { + if (*use_fips) == (true) { + return Ok(::aws_smithy_types::endpoint::Endpoint::builder() + .url({ + let mut out = String::new(); + out.push_str("https://backup-search-fips."); + #[allow(clippy::needless_borrow)] + out.push_str(&partition_result.implicit_global_region()); + out.push('.'); + #[allow(clippy::needless_borrow)] + out.push_str(&partition_result.dual_stack_dns_suffix()); + out + }) + .property( + "authSchemes", + vec![::aws_smithy_types::Document::from({ + let mut out = ::std::collections::HashMap::::new(); + out.insert("name".to_string(), "sigv4".to_string().into()); + out.insert("signingRegion".to_string(), partition_result.implicit_global_region().to_owned().into()); + out + })], + ) + .build()); + } + return Ok(::aws_smithy_types::endpoint::Endpoint::builder() + .url({ + let mut out = String::new(); + out.push_str("https://backup-search."); + #[allow(clippy::needless_borrow)] + out.push_str(&partition_result.implicit_global_region()); + out.push('.'); + #[allow(clippy::needless_borrow)] + out.push_str(&partition_result.dual_stack_dns_suffix()); + out + }) + .property( + "authSchemes", + vec![::aws_smithy_types::Document::from({ + let mut out = ::std::collections::HashMap::::new(); + out.insert("name".to_string(), "sigv4".to_string().into()); + out.insert("signingRegion".to_string(), partition_result.implicit_global_region().to_owned().into()); + out + })], + ) + .build()); + } + #[allow(unreachable_code)] + return Err(::aws_smithy_http::endpoint::ResolveEndpointError::message(format!( + "No rules matched these parameters. This is a bug. {:?}", + _params + ))); + } + return Err(::aws_smithy_http::endpoint::ResolveEndpointError::message( + "Invalid Configuration: Missing Region".to_string(), + )); +} diff --git a/sdk/backupsearch/src/config/http.rs b/sdk/backupsearch/src/config/http.rs new file mode 100644 index 000000000000..504946ac1b22 --- /dev/null +++ b/sdk/backupsearch/src/config/http.rs @@ -0,0 +1,3 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +pub use ::aws_smithy_runtime_api::client::orchestrator::HttpRequest; +pub use ::aws_smithy_runtime_api::client::orchestrator::HttpResponse; diff --git a/sdk/backupsearch/src/config/interceptors.rs b/sdk/backupsearch/src/config/interceptors.rs new file mode 100644 index 000000000000..cfde73a6e1a8 --- /dev/null +++ b/sdk/backupsearch/src/config/interceptors.rs @@ -0,0 +1,11 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +pub use ::aws_smithy_runtime_api::client::interceptors::context::AfterDeserializationInterceptorContextRef; +pub use ::aws_smithy_runtime_api::client::interceptors::context::BeforeDeserializationInterceptorContextMut; +pub use ::aws_smithy_runtime_api::client::interceptors::context::BeforeDeserializationInterceptorContextRef; +pub use ::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextMut; +pub use ::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef; +pub use ::aws_smithy_runtime_api::client::interceptors::context::BeforeTransmitInterceptorContextMut; +pub use ::aws_smithy_runtime_api::client::interceptors::context::BeforeTransmitInterceptorContextRef; +pub use ::aws_smithy_runtime_api::client::interceptors::context::FinalizerInterceptorContextMut; +pub use ::aws_smithy_runtime_api::client::interceptors::context::FinalizerInterceptorContextRef; +pub use ::aws_smithy_runtime_api::client::interceptors::context::InterceptorContext; diff --git a/sdk/backupsearch/src/config/retry.rs b/sdk/backupsearch/src/config/retry.rs new file mode 100644 index 000000000000..595062713158 --- /dev/null +++ b/sdk/backupsearch/src/config/retry.rs @@ -0,0 +1,7 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +pub use ::aws_smithy_runtime_api::client::retries::classifiers::ClassifyRetry; +pub use ::aws_smithy_runtime_api::client::retries::classifiers::RetryAction; +pub use ::aws_smithy_runtime_api::client::retries::ShouldAttempt; + +pub use ::aws_smithy_runtime::client::retries::RetryPartition; +pub use ::aws_smithy_types::retry::{ReconnectMode, RetryConfig, RetryConfigBuilder, RetryMode}; diff --git a/sdk/backupsearch/src/config/timeout.rs b/sdk/backupsearch/src/config/timeout.rs new file mode 100644 index 000000000000..bc2026d62a04 --- /dev/null +++ b/sdk/backupsearch/src/config/timeout.rs @@ -0,0 +1,2 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +pub use ::aws_smithy_types::timeout::{TimeoutConfig, TimeoutConfigBuilder}; diff --git a/sdk/backupsearch/src/endpoint_lib.rs b/sdk/backupsearch/src/endpoint_lib.rs new file mode 100644 index 000000000000..4dc3eeb071ae --- /dev/null +++ b/sdk/backupsearch/src/endpoint_lib.rs @@ -0,0 +1,19 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +// Loading the partition JSON is expensive since it involves many regex compilations, +// so cache the result so that it only need to be paid for the first constructed client. +pub(crate) static DEFAULT_PARTITION_RESOLVER: ::once_cell::sync::Lazy = + ::once_cell::sync::Lazy::new(|| match std::env::var("SMITHY_CLIENT_SDK_CUSTOM_PARTITION") { + Ok(partitions) => { + ::tracing::debug!("loading custom partitions located at {partitions}"); + let partition_dot_json = std::fs::read_to_string(partitions).expect("should be able to read a custom partition JSON"); + crate::endpoint_lib::partition::PartitionResolver::new_from_json(partition_dot_json.as_bytes()).expect("valid JSON") + } + _ => { + ::tracing::debug!("loading default partitions"); + crate::endpoint_lib::partition::PartitionResolver::new_from_json(b"{\"partitions\":[{\"id\":\"aws\",\"outputs\":{\"dnsSuffix\":\"amazonaws.com\",\"dualStackDnsSuffix\":\"api.aws\",\"implicitGlobalRegion\":\"us-east-1\",\"name\":\"aws\",\"supportsDualStack\":true,\"supportsFIPS\":true},\"regionRegex\":\"^(us|eu|ap|sa|ca|me|af|il|mx)\\\\-\\\\w+\\\\-\\\\d+$\",\"regions\":{\"af-south-1\":{\"description\":\"Africa (Cape Town)\"},\"ap-east-1\":{\"description\":\"Asia Pacific (Hong Kong)\"},\"ap-northeast-1\":{\"description\":\"Asia Pacific (Tokyo)\"},\"ap-northeast-2\":{\"description\":\"Asia Pacific (Seoul)\"},\"ap-northeast-3\":{\"description\":\"Asia Pacific (Osaka)\"},\"ap-south-1\":{\"description\":\"Asia Pacific (Mumbai)\"},\"ap-south-2\":{\"description\":\"Asia Pacific (Hyderabad)\"},\"ap-southeast-1\":{\"description\":\"Asia Pacific (Singapore)\"},\"ap-southeast-2\":{\"description\":\"Asia Pacific (Sydney)\"},\"ap-southeast-3\":{\"description\":\"Asia Pacific (Jakarta)\"},\"ap-southeast-4\":{\"description\":\"Asia Pacific (Melbourne)\"},\"ap-southeast-5\":{\"description\":\"Asia Pacific (Malaysia)\"},\"aws-global\":{\"description\":\"AWS Standard global region\"},\"ca-central-1\":{\"description\":\"Canada (Central)\"},\"ca-west-1\":{\"description\":\"Canada West (Calgary)\"},\"eu-central-1\":{\"description\":\"Europe (Frankfurt)\"},\"eu-central-2\":{\"description\":\"Europe (Zurich)\"},\"eu-north-1\":{\"description\":\"Europe (Stockholm)\"},\"eu-south-1\":{\"description\":\"Europe (Milan)\"},\"eu-south-2\":{\"description\":\"Europe (Spain)\"},\"eu-west-1\":{\"description\":\"Europe (Ireland)\"},\"eu-west-2\":{\"description\":\"Europe (London)\"},\"eu-west-3\":{\"description\":\"Europe (Paris)\"},\"il-central-1\":{\"description\":\"Israel (Tel Aviv)\"},\"me-central-1\":{\"description\":\"Middle East (UAE)\"},\"me-south-1\":{\"description\":\"Middle East (Bahrain)\"},\"sa-east-1\":{\"description\":\"South America (Sao Paulo)\"},\"us-east-1\":{\"description\":\"US East (N. Virginia)\"},\"us-east-2\":{\"description\":\"US East (Ohio)\"},\"us-west-1\":{\"description\":\"US West (N. California)\"},\"us-west-2\":{\"description\":\"US West (Oregon)\"}}},{\"id\":\"aws-cn\",\"outputs\":{\"dnsSuffix\":\"amazonaws.com.cn\",\"dualStackDnsSuffix\":\"api.amazonwebservices.com.cn\",\"implicitGlobalRegion\":\"cn-northwest-1\",\"name\":\"aws-cn\",\"supportsDualStack\":true,\"supportsFIPS\":true},\"regionRegex\":\"^cn\\\\-\\\\w+\\\\-\\\\d+$\",\"regions\":{\"aws-cn-global\":{\"description\":\"AWS China global region\"},\"cn-north-1\":{\"description\":\"China (Beijing)\"},\"cn-northwest-1\":{\"description\":\"China (Ningxia)\"}}},{\"id\":\"aws-us-gov\",\"outputs\":{\"dnsSuffix\":\"amazonaws.com\",\"dualStackDnsSuffix\":\"api.aws\",\"implicitGlobalRegion\":\"us-gov-west-1\",\"name\":\"aws-us-gov\",\"supportsDualStack\":true,\"supportsFIPS\":true},\"regionRegex\":\"^us\\\\-gov\\\\-\\\\w+\\\\-\\\\d+$\",\"regions\":{\"aws-us-gov-global\":{\"description\":\"AWS GovCloud (US) global region\"},\"us-gov-east-1\":{\"description\":\"AWS GovCloud (US-East)\"},\"us-gov-west-1\":{\"description\":\"AWS GovCloud (US-West)\"}}},{\"id\":\"aws-iso\",\"outputs\":{\"dnsSuffix\":\"c2s.ic.gov\",\"dualStackDnsSuffix\":\"c2s.ic.gov\",\"implicitGlobalRegion\":\"us-iso-east-1\",\"name\":\"aws-iso\",\"supportsDualStack\":false,\"supportsFIPS\":true},\"regionRegex\":\"^us\\\\-iso\\\\-\\\\w+\\\\-\\\\d+$\",\"regions\":{\"aws-iso-global\":{\"description\":\"AWS ISO (US) global region\"},\"us-iso-east-1\":{\"description\":\"US ISO East\"},\"us-iso-west-1\":{\"description\":\"US ISO WEST\"}}},{\"id\":\"aws-iso-b\",\"outputs\":{\"dnsSuffix\":\"sc2s.sgov.gov\",\"dualStackDnsSuffix\":\"sc2s.sgov.gov\",\"implicitGlobalRegion\":\"us-isob-east-1\",\"name\":\"aws-iso-b\",\"supportsDualStack\":false,\"supportsFIPS\":true},\"regionRegex\":\"^us\\\\-isob\\\\-\\\\w+\\\\-\\\\d+$\",\"regions\":{\"aws-iso-b-global\":{\"description\":\"AWS ISOB (US) global region\"},\"us-isob-east-1\":{\"description\":\"US ISOB East (Ohio)\"}}},{\"id\":\"aws-iso-e\",\"outputs\":{\"dnsSuffix\":\"cloud.adc-e.uk\",\"dualStackDnsSuffix\":\"cloud.adc-e.uk\",\"implicitGlobalRegion\":\"eu-isoe-west-1\",\"name\":\"aws-iso-e\",\"supportsDualStack\":false,\"supportsFIPS\":true},\"regionRegex\":\"^eu\\\\-isoe\\\\-\\\\w+\\\\-\\\\d+$\",\"regions\":{\"eu-isoe-west-1\":{\"description\":\"EU ISOE West\"}}},{\"id\":\"aws-iso-f\",\"outputs\":{\"dnsSuffix\":\"csp.hci.ic.gov\",\"dualStackDnsSuffix\":\"csp.hci.ic.gov\",\"implicitGlobalRegion\":\"us-isof-south-1\",\"name\":\"aws-iso-f\",\"supportsDualStack\":false,\"supportsFIPS\":true},\"regionRegex\":\"^us\\\\-isof\\\\-\\\\w+\\\\-\\\\d+$\",\"regions\":{}}],\"version\":\"1.1\"}").expect("valid JSON") + } + }); + +pub(crate) mod diagnostic; + +pub(crate) mod partition; diff --git a/sdk/backupsearch/src/endpoint_lib/diagnostic.rs b/sdk/backupsearch/src/endpoint_lib/diagnostic.rs new file mode 100644 index 000000000000..3413d0ea46d3 --- /dev/null +++ b/sdk/backupsearch/src/endpoint_lib/diagnostic.rs @@ -0,0 +1,45 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +/* + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0 + */ + +use std::error::Error; + +/// Diagnostic collector for endpoint resolution +/// +/// Endpoint functions return `Option`—to enable diagnostic information to flow, we capture the +/// last error that occurred. +#[derive(Debug, Default)] +pub(crate) struct DiagnosticCollector { + last_error: Option>, +} + +impl DiagnosticCollector { + #[allow(unused)] + /// Report an error to the collector + pub(crate) fn report_error(&mut self, err: impl Into>) { + self.last_error = Some(err.into()); + } + + #[allow(unused)] + /// Capture a result, returning Some(t) when the input was `Ok` and `None` otherwise + pub(crate) fn capture>>(&mut self, err: Result) -> Option { + match err { + Ok(res) => Some(res), + Err(e) => { + self.report_error(e); + None + } + } + } + + pub(crate) fn take_last_error(&mut self) -> Option> { + self.last_error.take() + } + + /// Create a new diagnostic collector + pub(crate) fn new() -> Self { + Self { last_error: None } + } +} diff --git a/sdk/backupsearch/src/endpoint_lib/partition.rs b/sdk/backupsearch/src/endpoint_lib/partition.rs new file mode 100644 index 000000000000..65d99bc4a5e5 --- /dev/null +++ b/sdk/backupsearch/src/endpoint_lib/partition.rs @@ -0,0 +1,557 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +/* + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0 + */ + +//! Partition function to determine a partition for a given region +//! +//! This function supports adding regions dynamically, parsing a JSON file, and builder construction. +//! +//! If, at a future point, this interface stabilizes it is a good candidate for extraction into a +//! shared crate. +use crate::endpoint_lib::diagnostic::DiagnosticCollector; +use crate::endpoint_lib::partition::deser::deserialize_partitions; +use aws_smithy_json::deserialize::error::DeserializeError; +use regex_lite::Regex; +use std::borrow::Cow; +use std::collections::HashMap; + +/// Determine the AWS partition metadata for a given region +#[derive(Clone, Debug, Default)] +pub(crate) struct PartitionResolver { + partitions: Vec, +} + +impl PartitionResolver { + pub(crate) fn from_partitions(partitions: Vec) -> Self { + Self { partitions } + } +} + +/// Partition result returned from partition resolver +pub(crate) struct Partition<'a> { + name: &'a str, + dns_suffix: &'a str, + dual_stack_dns_suffix: &'a str, + supports_fips: bool, + supports_dual_stack: bool, + implicit_global_region: &'a str, +} + +#[allow(unused)] +impl<'a> Partition<'a> { + pub(crate) fn name(&self) -> &str { + self.name + } + + pub(crate) fn dns_suffix(&self) -> &str { + self.dns_suffix + } + + pub(crate) fn supports_fips(&self) -> bool { + self.supports_fips + } + + pub(crate) fn dual_stack_dns_suffix(&self) -> &str { + self.dual_stack_dns_suffix + } + + pub(crate) fn supports_dual_stack(&self) -> bool { + self.supports_dual_stack + } + + pub(crate) fn implicit_global_region(&self) -> &str { + self.implicit_global_region + } +} + +static DEFAULT_OVERRIDE: &PartitionOutputOverride = &PartitionOutputOverride { + name: None, + dns_suffix: None, + dual_stack_dns_suffix: None, + supports_fips: None, + supports_dual_stack: None, + implicit_global_region: None, +}; + +/// Merge the base output and the override output, dealing with `Cow`s +macro_rules! merge { + ($base: expr, $output: expr, $field: ident) => { + $output.$field.as_ref().map(|s| s.as_ref()).unwrap_or($base.outputs.$field.as_ref()) + }; +} + +impl PartitionResolver { + #[allow(unused)] + pub(crate) fn empty() -> PartitionResolver { + PartitionResolver { partitions: vec![] } + } + + #[allow(unused)] + pub(crate) fn add_partition(&mut self, partition: PartitionMetadata) { + self.partitions.push(partition); + } + + pub(crate) fn new_from_json(partition_dot_json: &[u8]) -> Result { + deserialize_partitions(partition_dot_json) + } + + /// Resolve a partition for a given region + /// + /// 1. Enumerate each partition in the `partitions` array, and determine if the identifier to be + /// resolved matches an explicit region listed in the `regions` array for a given partition. + /// If identifier matches, proceed to step 4, otherwise continue to step 2. + /// 2. Enumerate each partition in the `partitions` array, use the regular expression + /// `regionRegex` to determine if the identifier matches the regular expression. If the + /// identifier matches, proceed to step 4, otherwise continue to step 3. + /// 3. If no partition is matched after exhausting step 1 and step 2, then fallback to matching + /// the identifier to the partition where `id == "aws"`, and proceed to step 4. If no `aws` + /// partition is present, return `None`. + /// 4. After matching the identifier to a partition using one of the previous steps, the partition function should return a + /// typed data structure containing the fields in `outputs` in the matched partition. **Important:** If a specific region + /// was matched, the properties associated with that region **MUST** be merged with the `outputs` field. + pub(crate) fn resolve_partition(&self, region: &str, e: &mut DiagnosticCollector) -> Option { + let mut explicit_match_partition = self.partitions.iter().flat_map(|part| part.explicit_match(region)); + let mut regex_match_partition = self.partitions.iter().flat_map(|part| part.regex_match(region)); + + let (base, region_override) = explicit_match_partition.next().or_else(|| regex_match_partition.next()).or_else(|| { + match self.partitions.iter().find(|p| p.id == "aws") { + Some(partition) => Some((partition, None)), + None => { + e.report_error("no AWS partition!"); + None + } + } + })?; + let region_override = region_override.as_ref().unwrap_or(&DEFAULT_OVERRIDE); + Some(Partition { + name: merge!(base, region_override, name), + dns_suffix: merge!(base, region_override, dns_suffix), + dual_stack_dns_suffix: merge!(base, region_override, dual_stack_dns_suffix), + supports_fips: region_override.supports_fips.unwrap_or(base.outputs.supports_fips), + supports_dual_stack: region_override.supports_dual_stack.unwrap_or(base.outputs.supports_dual_stack), + implicit_global_region: merge!(base, region_override, implicit_global_region), + }) + } +} + +type Str = Cow<'static, str>; + +#[derive(Clone, Debug)] +pub(crate) struct PartitionMetadata { + id: Str, + region_regex: Regex, + regions: HashMap, + outputs: PartitionOutput, +} + +#[derive(Default)] +pub(crate) struct PartitionMetadataBuilder { + pub(crate) id: Option, + pub(crate) region_regex: Option, + pub(crate) regions: HashMap, + pub(crate) outputs: Option, +} + +impl PartitionMetadataBuilder { + pub(crate) fn build(self) -> PartitionMetadata { + PartitionMetadata { + id: self.id.expect("id must be defined"), + region_regex: self.region_regex.expect("region regex must be defined"), + regions: self.regions, + outputs: self + .outputs + .expect("outputs must be defined") + .into_partition_output() + .expect("missing fields on outputs"), + } + } +} + +impl PartitionMetadata { + fn explicit_match(&self, region: &str) -> Option<(&PartitionMetadata, Option<&PartitionOutputOverride>)> { + self.regions.get(region).map(|output_override| (self, Some(output_override))) + } + + fn regex_match(&self, region: &str) -> Option<(&PartitionMetadata, Option<&PartitionOutputOverride>)> { + if self.region_regex.is_match(region) { + Some((self, None)) + } else { + None + } + } +} + +#[derive(Clone, Debug)] +pub(crate) struct PartitionOutput { + name: Str, + dns_suffix: Str, + dual_stack_dns_suffix: Str, + supports_fips: bool, + supports_dual_stack: bool, + implicit_global_region: Str, +} + +#[derive(Clone, Debug, Default)] +pub(crate) struct PartitionOutputOverride { + name: Option, + dns_suffix: Option, + dual_stack_dns_suffix: Option, + supports_fips: Option, + supports_dual_stack: Option, + implicit_global_region: Option, +} + +impl PartitionOutputOverride { + pub(crate) fn into_partition_output(self) -> Result> { + Ok(PartitionOutput { + name: self.name.ok_or("missing name")?, + dns_suffix: self.dns_suffix.ok_or("missing dnsSuffix")?, + dual_stack_dns_suffix: self.dual_stack_dns_suffix.ok_or("missing dual_stackDnsSuffix")?, + supports_fips: self.supports_fips.ok_or("missing supports fips")?, + supports_dual_stack: self.supports_dual_stack.ok_or("missing supportsDualstack")?, + implicit_global_region: self.implicit_global_region.ok_or("missing implicitGlobalRegion")?, + }) + } +} + +/// JSON deserializers for partition metadata +/// +/// This code was generated by smithy-rs and then hand edited for clarity +mod deser { + use crate::endpoint_lib::partition::{PartitionMetadata, PartitionMetadataBuilder, PartitionOutputOverride, PartitionResolver}; + use aws_smithy_json::deserialize::token::{expect_bool_or_null, expect_start_object, expect_string_or_null, skip_value}; + use aws_smithy_json::deserialize::{error::DeserializeError, json_token_iter, Token}; + use regex_lite::Regex; + use std::borrow::Cow; + use std::collections::HashMap; + + pub(crate) fn deserialize_partitions(value: &[u8]) -> Result { + let mut tokens_owned = json_token_iter(value).peekable(); + let tokens = &mut tokens_owned; + expect_start_object(tokens.next())?; + let mut resolver = None; + loop { + match tokens.next().transpose()? { + Some(Token::EndObject { .. }) => break, + Some(Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() { + "partitions" => { + resolver = Some(PartitionResolver::from_partitions(deser_partitions(tokens)?)); + } + _ => skip_value(tokens)?, + }, + other => return Err(DeserializeError::custom(format!("expected object key or end object, found: {:?}", other))), + } + } + if tokens.next().is_some() { + return Err(DeserializeError::custom("found more JSON tokens after completing parsing")); + } + resolver.ok_or_else(|| DeserializeError::custom("did not find partitions array")) + } + + fn deser_partitions<'a, I>(tokens: &mut std::iter::Peekable) -> Result, DeserializeError> + where + I: Iterator, DeserializeError>>, + { + match tokens.next().transpose()? { + Some(Token::StartArray { .. }) => { + let mut items = Vec::new(); + loop { + match tokens.peek() { + Some(Ok(Token::EndArray { .. })) => { + tokens.next().transpose().unwrap(); + break; + } + _ => { + items.push(deser_partition(tokens)?); + } + } + } + Ok(items) + } + _ => Err(DeserializeError::custom("expected start array")), + } + } + + pub(crate) fn deser_partition<'a, I>(tokens: &mut std::iter::Peekable) -> Result + where + I: Iterator, DeserializeError>>, + { + match tokens.next().transpose()? { + Some(Token::StartObject { .. }) => { + let mut builder = PartitionMetadataBuilder::default(); + loop { + match tokens.next().transpose()? { + Some(Token::EndObject { .. }) => break, + Some(Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() { + "id" => { + builder.id = token_to_str(tokens.next())?; + } + "regionRegex" => { + builder.region_regex = token_to_str(tokens.next())? + .map(|region_regex| Regex::new(®ion_regex)) + .transpose() + .map_err(|_e| DeserializeError::custom("invalid regex"))?; + } + "regions" => { + builder.regions = deser_explicit_regions(tokens)?; + } + "outputs" => { + builder.outputs = deser_outputs(tokens)?; + } + _ => skip_value(tokens)?, + }, + other => return Err(DeserializeError::custom(format!("expected object key or end object, found: {:?}", other))), + } + } + Ok(builder.build()) + } + _ => Err(DeserializeError::custom("expected start object")), + } + } + + #[allow(clippy::type_complexity, non_snake_case)] + pub(crate) fn deser_explicit_regions<'a, I>( + tokens: &mut std::iter::Peekable, + ) -> Result, DeserializeError> + where + I: Iterator, DeserializeError>>, + { + match tokens.next().transpose()? { + Some(Token::StartObject { .. }) => { + let mut map = HashMap::new(); + loop { + match tokens.next().transpose()? { + Some(Token::EndObject { .. }) => break, + Some(Token::ObjectKey { key, .. }) => { + let key = key.to_unescaped().map(|u| u.into_owned())?; + let value = deser_outputs(tokens)?; + if let Some(value) = value { + map.insert(key.into(), value); + } + } + other => return Err(DeserializeError::custom(format!("expected object key or end object, found: {:?}", other))), + } + } + Ok(map) + } + _ => Err(DeserializeError::custom("expected start object")), + } + } + + /// Convert a token to `Str` (a potentially static String) + fn token_to_str(token: Option>) -> Result, DeserializeError> { + Ok(expect_string_or_null(token)? + .map(|s| s.to_unescaped().map(|u| u.into_owned())) + .transpose()? + .map(Cow::Owned)) + } + + fn deser_outputs<'a, I>(tokens: &mut std::iter::Peekable) -> Result, DeserializeError> + where + I: Iterator, DeserializeError>>, + { + match tokens.next().transpose()? { + Some(Token::StartObject { .. }) => { + #[allow(unused_mut)] + let mut builder = PartitionOutputOverride::default(); + loop { + match tokens.next().transpose()? { + Some(Token::EndObject { .. }) => break, + Some(Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() { + "name" => { + builder.name = token_to_str(tokens.next())?; + } + "dnsSuffix" => { + builder.dns_suffix = token_to_str(tokens.next())?; + } + "dualStackDnsSuffix" => { + builder.dual_stack_dns_suffix = token_to_str(tokens.next())?; + } + "supportsFIPS" => { + builder.supports_fips = expect_bool_or_null(tokens.next())?; + } + "supportsDualStack" => { + builder.supports_dual_stack = expect_bool_or_null(tokens.next())?; + } + "implicitGlobalRegion" => { + builder.implicit_global_region = token_to_str(tokens.next())?; + } + _ => skip_value(tokens)?, + }, + other => return Err(DeserializeError::custom(format!("expected object key or end object, found: {:?}", other))), + } + } + Ok(Some(builder)) + } + _ => Err(DeserializeError::custom("expected start object")), + } + } +} + +#[cfg(test)] +mod test { + use crate::endpoint_lib::diagnostic::DiagnosticCollector; + use crate::endpoint_lib::partition::{Partition, PartitionMetadata, PartitionOutput, PartitionOutputOverride, PartitionResolver}; + use regex_lite::Regex; + use std::collections::HashMap; + + fn resolve<'a>(resolver: &'a PartitionResolver, region: &str) -> Partition<'a> { + resolver + .resolve_partition(region, &mut DiagnosticCollector::new()) + .expect("could not resolve partition") + } + + #[test] + fn deserialize_partitions() { + let partitions = r#"{ + "version": "1.1", + "partitions": [ + { + "id": "aws", + "regionRegex": "^(us|eu|ap|sa|ca|me|af)-\\w+-\\d+$", + "regions": { + "af-south-1": {}, + "af-east-1": {}, + "ap-northeast-1": {}, + "ap-northeast-2": {}, + "ap-northeast-3": {}, + "ap-south-1": {}, + "ap-southeast-1": {}, + "ap-southeast-2": {}, + "ap-southeast-3": {}, + "ca-central-1": {}, + "eu-central-1": {}, + "eu-north-1": {}, + "eu-south-1": {}, + "eu-west-1": {}, + "eu-west-2": {}, + "eu-west-3": {}, + "me-south-1": {}, + "sa-east-1": {}, + "us-east-1": {}, + "us-east-2": {}, + "us-west-1": {}, + "us-west-2": {}, + "aws-global": {} + }, + "outputs": { + "name": "aws", + "dnsSuffix": "amazonaws.com", + "dualStackDnsSuffix": "api.aws", + "supportsFIPS": true, + "supportsDualStack": true, + "implicitGlobalRegion": "us-east-1" + } + }, + { + "id": "aws-us-gov", + "regionRegex": "^us\\-gov\\-\\w+\\-\\d+$", + "regions": { + "us-gov-west-1": {}, + "us-gov-east-1": {}, + "aws-us-gov-global": {} + }, + "outputs": { + "name": "aws-us-gov", + "dnsSuffix": "amazonaws.com", + "dualStackDnsSuffix": "api.aws", + "supportsFIPS": true, + "supportsDualStack": true, + "implicitGlobalRegion": "us-gov-east-1" + } + }, + { + "id": "aws-cn", + "regionRegex": "^cn\\-\\w+\\-\\d+$", + "regions": { + "cn-north-1": {}, + "cn-northwest-1": {}, + "aws-cn-global": {} + }, + "outputs": { + "name": "aws-cn", + "dnsSuffix": "amazonaws.com.cn", + "dualStackDnsSuffix": "api.amazonwebservices.com.cn", + "supportsFIPS": true, + "supportsDualStack": true, + "implicitGlobalRegion": "cn-north-1" + } + }, + { + "id": "aws-iso", + "regionRegex": "^us\\-iso\\-\\w+\\-\\d+$", + "outputs": { + "name": "aws-iso", + "dnsSuffix": "c2s.ic.gov", + "supportsFIPS": true, + "supportsDualStack": false, + "dualStackDnsSuffix": "c2s.ic.gov", + "implicitGlobalRegion": "us-iso-foo-1" + }, + "regions": {} + }, + { + "id": "aws-iso-b", + "regionRegex": "^us\\-isob\\-\\w+\\-\\d+$", + "outputs": { + "name": "aws-iso-b", + "dnsSuffix": "sc2s.sgov.gov", + "supportsFIPS": true, + "supportsDualStack": false, + "dualStackDnsSuffix": "sc2s.sgov.gov", + "implicitGlobalRegion": "us-isob-foo-1" + }, + "regions": {} + } + ] +}"#; + let resolver = super::deser::deserialize_partitions(partitions.as_bytes()).expect("valid resolver"); + assert_eq!(resolve(&resolver, "cn-north-1").name, "aws-cn"); + assert_eq!(resolve(&resolver, "cn-north-1").dns_suffix, "amazonaws.com.cn"); + assert_eq!(resolver.partitions.len(), 5); + assert_eq!(resolve(&resolver, "af-south-1").implicit_global_region, "us-east-1"); + } + + #[test] + fn resolve_partitions() { + let mut resolver = PartitionResolver::empty(); + let new_suffix = PartitionOutputOverride { + dns_suffix: Some("mars.aws".into()), + ..Default::default() + }; + resolver.add_partition(PartitionMetadata { + id: "aws".into(), + region_regex: Regex::new("^(us|eu|ap|sa|ca|me|af)-\\w+-\\d+$").unwrap(), + regions: HashMap::from([("mars-east-2".into(), new_suffix)]), + outputs: PartitionOutput { + name: "aws".into(), + dns_suffix: "amazonaws.com".into(), + dual_stack_dns_suffix: "api.aws".into(), + supports_fips: true, + supports_dual_stack: true, + implicit_global_region: "us-east-1".into(), + }, + }); + resolver.add_partition(PartitionMetadata { + id: "other".into(), + region_regex: Regex::new("^(other)-\\w+-\\d+$").unwrap(), + regions: Default::default(), + outputs: PartitionOutput { + name: "other".into(), + dns_suffix: "other.amazonaws.com".into(), + dual_stack_dns_suffix: "other.aws".into(), + supports_fips: false, + supports_dual_stack: true, + implicit_global_region: "other-south-2".into(), + }, + }); + assert_eq!(resolve(&resolver, "us-east-1").name, "aws"); + assert_eq!(resolve(&resolver, "other-west-2").name, "other"); + // mars-east-1 hits aws through the default fallback + assert_eq!(resolve(&resolver, "mars-east-1").dns_suffix, "amazonaws.com"); + // mars-east-2 hits aws through the region override + assert_eq!(resolve(&resolver, "mars-east-2").dns_suffix, "mars.aws"); + } +} diff --git a/sdk/backupsearch/src/error.rs b/sdk/backupsearch/src/error.rs new file mode 100644 index 000000000000..25b0dd73f8ca --- /dev/null +++ b/sdk/backupsearch/src/error.rs @@ -0,0 +1,30 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +pub use ::aws_smithy_runtime_api::box_error::BoxError; + +/// Error type returned by the client. +pub type SdkError = ::aws_smithy_runtime_api::client::result::SdkError; +pub use ::aws_smithy_runtime_api::client::result::ConnectorError; +pub use ::aws_smithy_types::error::operation::BuildError; + +pub use ::aws_smithy_types::error::display::DisplayErrorContext; +pub use ::aws_smithy_types::error::metadata::ErrorMetadata; +pub use ::aws_smithy_types::error::metadata::ProvideErrorMetadata; + +/// The given enum value failed to parse since it is not a known value. +#[derive(Debug)] +pub struct UnknownVariantError { + value: ::std::string::String, +} +impl UnknownVariantError { + pub(crate) fn new(value: impl ::std::convert::Into<::std::string::String>) -> Self { + Self { value: value.into() } + } +} +impl ::std::fmt::Display for UnknownVariantError { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::result::Result<(), ::std::fmt::Error> { + write!(f, "unknown enum variant: '{}'", self.value) + } +} +impl ::std::error::Error for UnknownVariantError {} + +pub(crate) mod sealed_unhandled; diff --git a/sdk/backupsearch/src/error/sealed_unhandled.rs b/sdk/backupsearch/src/error/sealed_unhandled.rs new file mode 100644 index 000000000000..357c3ccc4c9a --- /dev/null +++ b/sdk/backupsearch/src/error/sealed_unhandled.rs @@ -0,0 +1,20 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +/// This struct is not intended to be used. +/// +/// This struct holds information about an unhandled error, +/// but that information should be obtained by using the +/// [`ProvideErrorMetadata`](::aws_smithy_types::error::metadata::ProvideErrorMetadata) trait +/// on the error type. +/// +/// This struct intentionally doesn't yield any useful information itself. +#[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \ +variable wildcard pattern and check `.code()`: + \ +   `err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }` + \ +See [`ProvideErrorMetadata`](::aws_smithy_types::error::metadata::ProvideErrorMetadata) for what information is available for the error.")] +#[derive(Debug)] +pub struct Unhandled { + pub(crate) source: ::aws_smithy_runtime_api::box_error::BoxError, + pub(crate) meta: ::aws_smithy_types::error::metadata::ErrorMetadata, +} diff --git a/sdk/backupsearch/src/error_meta.rs b/sdk/backupsearch/src/error_meta.rs new file mode 100644 index 000000000000..b0afc65810d1 --- /dev/null +++ b/sdk/backupsearch/src/error_meta.rs @@ -0,0 +1,479 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +/// All possible error types for this service. +#[non_exhaustive] +#[derive(::std::fmt::Debug)] +pub enum Error { + ///

You do not have sufficient access to perform this action.

+ AccessDeniedException(crate::types::error::AccessDeniedException), + ///

This exception occurs when a conflict with a previous successful operation is detected. This generally occurs when the previous operation did not have time to propagate to the host serving the current request.

+ ///

A retry (with appropriate backoff logic) is the recommended response to this exception.

+ ConflictException(crate::types::error::ConflictException), + ///

An internal server error occurred. Retry your request.

+ InternalServerException(crate::types::error::InternalServerException), + ///

The resource was not found for this request.

+ ///

Confirm the resource information, such as the ARN or type is correct and exists, then retry the request.

+ ResourceNotFoundException(crate::types::error::ResourceNotFoundException), + ///

The request denied due to exceeding the quota limits permitted.

+ ServiceQuotaExceededException(crate::types::error::ServiceQuotaExceededException), + ///

The request was denied due to request throttling.

+ ThrottlingException(crate::types::error::ThrottlingException), + ///

The input fails to satisfy the constraints specified by a service.

+ ValidationException(crate::types::error::ValidationException), + /// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code). + #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \ + variable wildcard pattern and check `.code()`: + \ +    `err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }` + \ + See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-Error) for what information is available for the error.")] + Unhandled(crate::error::sealed_unhandled::Unhandled), +} +impl ::std::fmt::Display for Error { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + match self { + Error::AccessDeniedException(inner) => inner.fmt(f), + Error::ConflictException(inner) => inner.fmt(f), + Error::InternalServerException(inner) => inner.fmt(f), + Error::ResourceNotFoundException(inner) => inner.fmt(f), + Error::ServiceQuotaExceededException(inner) => inner.fmt(f), + Error::ThrottlingException(inner) => inner.fmt(f), + Error::ValidationException(inner) => inner.fmt(f), + Error::Unhandled(_) => { + if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) { + write!(f, "unhandled error ({code})") + } else { + f.write_str("unhandled error") + } + } + } + } +} +impl From<::aws_smithy_types::error::operation::BuildError> for Error { + fn from(value: ::aws_smithy_types::error::operation::BuildError) -> Self { + Error::Unhandled(crate::error::sealed_unhandled::Unhandled { + source: value.into(), + meta: ::std::default::Default::default(), + }) + } +} +impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for Error { + fn meta(&self) -> &::aws_smithy_types::error::metadata::ErrorMetadata { + match self { + Self::AccessDeniedException(inner) => inner.meta(), + Self::ConflictException(inner) => inner.meta(), + Self::InternalServerException(inner) => inner.meta(), + Self::ResourceNotFoundException(inner) => inner.meta(), + Self::ServiceQuotaExceededException(inner) => inner.meta(), + Self::ThrottlingException(inner) => inner.meta(), + Self::ValidationException(inner) => inner.meta(), + Self::Unhandled(inner) => &inner.meta, + } + } +} +impl From<::aws_smithy_runtime_api::client::result::SdkError> for Error +where + R: Send + Sync + std::fmt::Debug + 'static, +{ + fn from(err: ::aws_smithy_runtime_api::client::result::SdkError) -> Self { + match err { + ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()), + _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled { + meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(), + source: err.into(), + }), + } + } +} +impl From for Error { + fn from(err: crate::operation::get_search_job::GetSearchJobError) -> Self { + match err { + crate::operation::get_search_job::GetSearchJobError::ResourceNotFoundException(inner) => Error::ResourceNotFoundException(inner), + crate::operation::get_search_job::GetSearchJobError::AccessDeniedException(inner) => Error::AccessDeniedException(inner), + crate::operation::get_search_job::GetSearchJobError::InternalServerException(inner) => Error::InternalServerException(inner), + crate::operation::get_search_job::GetSearchJobError::ThrottlingException(inner) => Error::ThrottlingException(inner), + crate::operation::get_search_job::GetSearchJobError::ValidationException(inner) => Error::ValidationException(inner), + crate::operation::get_search_job::GetSearchJobError::Unhandled(inner) => Error::Unhandled(inner), + } + } +} +impl From<::aws_smithy_runtime_api::client::result::SdkError> + for Error +where + R: Send + Sync + std::fmt::Debug + 'static, +{ + fn from( + err: ::aws_smithy_runtime_api::client::result::SdkError, + ) -> Self { + match err { + ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()), + _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled { + meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(), + source: err.into(), + }), + } + } +} +impl From for Error { + fn from(err: crate::operation::get_search_result_export_job::GetSearchResultExportJobError) -> Self { + match err { + crate::operation::get_search_result_export_job::GetSearchResultExportJobError::ResourceNotFoundException(inner) => { + Error::ResourceNotFoundException(inner) + } + crate::operation::get_search_result_export_job::GetSearchResultExportJobError::AccessDeniedException(inner) => { + Error::AccessDeniedException(inner) + } + crate::operation::get_search_result_export_job::GetSearchResultExportJobError::InternalServerException(inner) => { + Error::InternalServerException(inner) + } + crate::operation::get_search_result_export_job::GetSearchResultExportJobError::ThrottlingException(inner) => { + Error::ThrottlingException(inner) + } + crate::operation::get_search_result_export_job::GetSearchResultExportJobError::ValidationException(inner) => { + Error::ValidationException(inner) + } + crate::operation::get_search_result_export_job::GetSearchResultExportJobError::Unhandled(inner) => Error::Unhandled(inner), + } + } +} +impl From<::aws_smithy_runtime_api::client::result::SdkError> for Error +where + R: Send + Sync + std::fmt::Debug + 'static, +{ + fn from( + err: ::aws_smithy_runtime_api::client::result::SdkError, + ) -> Self { + match err { + ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()), + _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled { + meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(), + source: err.into(), + }), + } + } +} +impl From for Error { + fn from(err: crate::operation::list_search_job_backups::ListSearchJobBackupsError) -> Self { + match err { + crate::operation::list_search_job_backups::ListSearchJobBackupsError::ResourceNotFoundException(inner) => { + Error::ResourceNotFoundException(inner) + } + crate::operation::list_search_job_backups::ListSearchJobBackupsError::AccessDeniedException(inner) => Error::AccessDeniedException(inner), + crate::operation::list_search_job_backups::ListSearchJobBackupsError::InternalServerException(inner) => { + Error::InternalServerException(inner) + } + crate::operation::list_search_job_backups::ListSearchJobBackupsError::ThrottlingException(inner) => Error::ThrottlingException(inner), + crate::operation::list_search_job_backups::ListSearchJobBackupsError::ValidationException(inner) => Error::ValidationException(inner), + crate::operation::list_search_job_backups::ListSearchJobBackupsError::Unhandled(inner) => Error::Unhandled(inner), + } + } +} +impl From<::aws_smithy_runtime_api::client::result::SdkError> for Error +where + R: Send + Sync + std::fmt::Debug + 'static, +{ + fn from( + err: ::aws_smithy_runtime_api::client::result::SdkError, + ) -> Self { + match err { + ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()), + _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled { + meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(), + source: err.into(), + }), + } + } +} +impl From for Error { + fn from(err: crate::operation::list_search_job_results::ListSearchJobResultsError) -> Self { + match err { + crate::operation::list_search_job_results::ListSearchJobResultsError::ResourceNotFoundException(inner) => { + Error::ResourceNotFoundException(inner) + } + crate::operation::list_search_job_results::ListSearchJobResultsError::AccessDeniedException(inner) => Error::AccessDeniedException(inner), + crate::operation::list_search_job_results::ListSearchJobResultsError::InternalServerException(inner) => { + Error::InternalServerException(inner) + } + crate::operation::list_search_job_results::ListSearchJobResultsError::ThrottlingException(inner) => Error::ThrottlingException(inner), + crate::operation::list_search_job_results::ListSearchJobResultsError::ValidationException(inner) => Error::ValidationException(inner), + crate::operation::list_search_job_results::ListSearchJobResultsError::Unhandled(inner) => Error::Unhandled(inner), + } + } +} +impl From<::aws_smithy_runtime_api::client::result::SdkError> for Error +where + R: Send + Sync + std::fmt::Debug + 'static, +{ + fn from(err: ::aws_smithy_runtime_api::client::result::SdkError) -> Self { + match err { + ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()), + _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled { + meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(), + source: err.into(), + }), + } + } +} +impl From for Error { + fn from(err: crate::operation::list_search_jobs::ListSearchJobsError) -> Self { + match err { + crate::operation::list_search_jobs::ListSearchJobsError::AccessDeniedException(inner) => Error::AccessDeniedException(inner), + crate::operation::list_search_jobs::ListSearchJobsError::InternalServerException(inner) => Error::InternalServerException(inner), + crate::operation::list_search_jobs::ListSearchJobsError::ThrottlingException(inner) => Error::ThrottlingException(inner), + crate::operation::list_search_jobs::ListSearchJobsError::ValidationException(inner) => Error::ValidationException(inner), + crate::operation::list_search_jobs::ListSearchJobsError::Unhandled(inner) => Error::Unhandled(inner), + } + } +} +impl From<::aws_smithy_runtime_api::client::result::SdkError> + for Error +where + R: Send + Sync + std::fmt::Debug + 'static, +{ + fn from( + err: ::aws_smithy_runtime_api::client::result::SdkError, + ) -> Self { + match err { + ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()), + _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled { + meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(), + source: err.into(), + }), + } + } +} +impl From for Error { + fn from(err: crate::operation::list_search_result_export_jobs::ListSearchResultExportJobsError) -> Self { + match err { + crate::operation::list_search_result_export_jobs::ListSearchResultExportJobsError::ResourceNotFoundException(inner) => { + Error::ResourceNotFoundException(inner) + } + crate::operation::list_search_result_export_jobs::ListSearchResultExportJobsError::ServiceQuotaExceededException(inner) => { + Error::ServiceQuotaExceededException(inner) + } + crate::operation::list_search_result_export_jobs::ListSearchResultExportJobsError::AccessDeniedException(inner) => { + Error::AccessDeniedException(inner) + } + crate::operation::list_search_result_export_jobs::ListSearchResultExportJobsError::InternalServerException(inner) => { + Error::InternalServerException(inner) + } + crate::operation::list_search_result_export_jobs::ListSearchResultExportJobsError::ThrottlingException(inner) => { + Error::ThrottlingException(inner) + } + crate::operation::list_search_result_export_jobs::ListSearchResultExportJobsError::ValidationException(inner) => { + Error::ValidationException(inner) + } + crate::operation::list_search_result_export_jobs::ListSearchResultExportJobsError::Unhandled(inner) => Error::Unhandled(inner), + } + } +} +impl From<::aws_smithy_runtime_api::client::result::SdkError> for Error +where + R: Send + Sync + std::fmt::Debug + 'static, +{ + fn from(err: ::aws_smithy_runtime_api::client::result::SdkError) -> Self { + match err { + ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()), + _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled { + meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(), + source: err.into(), + }), + } + } +} +impl From for Error { + fn from(err: crate::operation::list_tags_for_resource::ListTagsForResourceError) -> Self { + match err { + crate::operation::list_tags_for_resource::ListTagsForResourceError::ResourceNotFoundException(inner) => { + Error::ResourceNotFoundException(inner) + } + crate::operation::list_tags_for_resource::ListTagsForResourceError::AccessDeniedException(inner) => Error::AccessDeniedException(inner), + crate::operation::list_tags_for_resource::ListTagsForResourceError::InternalServerException(inner) => { + Error::InternalServerException(inner) + } + crate::operation::list_tags_for_resource::ListTagsForResourceError::ThrottlingException(inner) => Error::ThrottlingException(inner), + crate::operation::list_tags_for_resource::ListTagsForResourceError::ValidationException(inner) => Error::ValidationException(inner), + crate::operation::list_tags_for_resource::ListTagsForResourceError::Unhandled(inner) => Error::Unhandled(inner), + } + } +} +impl From<::aws_smithy_runtime_api::client::result::SdkError> for Error +where + R: Send + Sync + std::fmt::Debug + 'static, +{ + fn from(err: ::aws_smithy_runtime_api::client::result::SdkError) -> Self { + match err { + ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()), + _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled { + meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(), + source: err.into(), + }), + } + } +} +impl From for Error { + fn from(err: crate::operation::start_search_job::StartSearchJobError) -> Self { + match err { + crate::operation::start_search_job::StartSearchJobError::ConflictException(inner) => Error::ConflictException(inner), + crate::operation::start_search_job::StartSearchJobError::ServiceQuotaExceededException(inner) => { + Error::ServiceQuotaExceededException(inner) + } + crate::operation::start_search_job::StartSearchJobError::AccessDeniedException(inner) => Error::AccessDeniedException(inner), + crate::operation::start_search_job::StartSearchJobError::InternalServerException(inner) => Error::InternalServerException(inner), + crate::operation::start_search_job::StartSearchJobError::ThrottlingException(inner) => Error::ThrottlingException(inner), + crate::operation::start_search_job::StartSearchJobError::ValidationException(inner) => Error::ValidationException(inner), + crate::operation::start_search_job::StartSearchJobError::Unhandled(inner) => Error::Unhandled(inner), + } + } +} +impl From<::aws_smithy_runtime_api::client::result::SdkError> + for Error +where + R: Send + Sync + std::fmt::Debug + 'static, +{ + fn from( + err: ::aws_smithy_runtime_api::client::result::SdkError, + ) -> Self { + match err { + ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()), + _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled { + meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(), + source: err.into(), + }), + } + } +} +impl From for Error { + fn from(err: crate::operation::start_search_result_export_job::StartSearchResultExportJobError) -> Self { + match err { + crate::operation::start_search_result_export_job::StartSearchResultExportJobError::ConflictException(inner) => { + Error::ConflictException(inner) + } + crate::operation::start_search_result_export_job::StartSearchResultExportJobError::ResourceNotFoundException(inner) => { + Error::ResourceNotFoundException(inner) + } + crate::operation::start_search_result_export_job::StartSearchResultExportJobError::ServiceQuotaExceededException(inner) => { + Error::ServiceQuotaExceededException(inner) + } + crate::operation::start_search_result_export_job::StartSearchResultExportJobError::AccessDeniedException(inner) => { + Error::AccessDeniedException(inner) + } + crate::operation::start_search_result_export_job::StartSearchResultExportJobError::InternalServerException(inner) => { + Error::InternalServerException(inner) + } + crate::operation::start_search_result_export_job::StartSearchResultExportJobError::ThrottlingException(inner) => { + Error::ThrottlingException(inner) + } + crate::operation::start_search_result_export_job::StartSearchResultExportJobError::ValidationException(inner) => { + Error::ValidationException(inner) + } + crate::operation::start_search_result_export_job::StartSearchResultExportJobError::Unhandled(inner) => Error::Unhandled(inner), + } + } +} +impl From<::aws_smithy_runtime_api::client::result::SdkError> for Error +where + R: Send + Sync + std::fmt::Debug + 'static, +{ + fn from(err: ::aws_smithy_runtime_api::client::result::SdkError) -> Self { + match err { + ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()), + _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled { + meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(), + source: err.into(), + }), + } + } +} +impl From for Error { + fn from(err: crate::operation::stop_search_job::StopSearchJobError) -> Self { + match err { + crate::operation::stop_search_job::StopSearchJobError::ConflictException(inner) => Error::ConflictException(inner), + crate::operation::stop_search_job::StopSearchJobError::ResourceNotFoundException(inner) => Error::ResourceNotFoundException(inner), + crate::operation::stop_search_job::StopSearchJobError::AccessDeniedException(inner) => Error::AccessDeniedException(inner), + crate::operation::stop_search_job::StopSearchJobError::InternalServerException(inner) => Error::InternalServerException(inner), + crate::operation::stop_search_job::StopSearchJobError::ThrottlingException(inner) => Error::ThrottlingException(inner), + crate::operation::stop_search_job::StopSearchJobError::ValidationException(inner) => Error::ValidationException(inner), + crate::operation::stop_search_job::StopSearchJobError::Unhandled(inner) => Error::Unhandled(inner), + } + } +} +impl From<::aws_smithy_runtime_api::client::result::SdkError> for Error +where + R: Send + Sync + std::fmt::Debug + 'static, +{ + fn from(err: ::aws_smithy_runtime_api::client::result::SdkError) -> Self { + match err { + ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()), + _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled { + meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(), + source: err.into(), + }), + } + } +} +impl From for Error { + fn from(err: crate::operation::tag_resource::TagResourceError) -> Self { + match err { + crate::operation::tag_resource::TagResourceError::ResourceNotFoundException(inner) => Error::ResourceNotFoundException(inner), + crate::operation::tag_resource::TagResourceError::AccessDeniedException(inner) => Error::AccessDeniedException(inner), + crate::operation::tag_resource::TagResourceError::InternalServerException(inner) => Error::InternalServerException(inner), + crate::operation::tag_resource::TagResourceError::ThrottlingException(inner) => Error::ThrottlingException(inner), + crate::operation::tag_resource::TagResourceError::ValidationException(inner) => Error::ValidationException(inner), + crate::operation::tag_resource::TagResourceError::Unhandled(inner) => Error::Unhandled(inner), + } + } +} +impl From<::aws_smithy_runtime_api::client::result::SdkError> for Error +where + R: Send + Sync + std::fmt::Debug + 'static, +{ + fn from(err: ::aws_smithy_runtime_api::client::result::SdkError) -> Self { + match err { + ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()), + _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled { + meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(), + source: err.into(), + }), + } + } +} +impl From for Error { + fn from(err: crate::operation::untag_resource::UntagResourceError) -> Self { + match err { + crate::operation::untag_resource::UntagResourceError::ResourceNotFoundException(inner) => Error::ResourceNotFoundException(inner), + crate::operation::untag_resource::UntagResourceError::AccessDeniedException(inner) => Error::AccessDeniedException(inner), + crate::operation::untag_resource::UntagResourceError::InternalServerException(inner) => Error::InternalServerException(inner), + crate::operation::untag_resource::UntagResourceError::ThrottlingException(inner) => Error::ThrottlingException(inner), + crate::operation::untag_resource::UntagResourceError::ValidationException(inner) => Error::ValidationException(inner), + crate::operation::untag_resource::UntagResourceError::Unhandled(inner) => Error::Unhandled(inner), + } + } +} +impl ::std::error::Error for Error { + fn source(&self) -> std::option::Option<&(dyn ::std::error::Error + 'static)> { + match self { + Error::AccessDeniedException(inner) => inner.source(), + Error::ConflictException(inner) => inner.source(), + Error::InternalServerException(inner) => inner.source(), + Error::ResourceNotFoundException(inner) => inner.source(), + Error::ServiceQuotaExceededException(inner) => inner.source(), + Error::ThrottlingException(inner) => inner.source(), + Error::ValidationException(inner) => inner.source(), + Error::Unhandled(inner) => ::std::option::Option::Some(&*inner.source), + } + } +} +impl ::aws_types::request_id::RequestId for Error { + fn request_id(&self) -> Option<&str> { + match self { + Self::AccessDeniedException(e) => e.request_id(), + Self::ConflictException(e) => e.request_id(), + Self::InternalServerException(e) => e.request_id(), + Self::ResourceNotFoundException(e) => e.request_id(), + Self::ServiceQuotaExceededException(e) => e.request_id(), + Self::ThrottlingException(e) => e.request_id(), + Self::ValidationException(e) => e.request_id(), + Self::Unhandled(e) => e.meta.request_id(), + } + } +} diff --git a/sdk/backupsearch/src/json_errors.rs b/sdk/backupsearch/src/json_errors.rs new file mode 100644 index 000000000000..e48663f337fc --- /dev/null +++ b/sdk/backupsearch/src/json_errors.rs @@ -0,0 +1,180 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +/* + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0 + */ + +use aws_smithy_json::deserialize::token::skip_value; +use aws_smithy_json::deserialize::{error::DeserializeError, json_token_iter, Token}; +use aws_smithy_runtime_api::http::Headers; +use aws_smithy_types::error::metadata::{Builder as ErrorMetadataBuilder, ErrorMetadata}; +use std::borrow::Cow; + +// currently only used by AwsJson +#[allow(unused)] +pub fn is_error(response: &http::Response) -> bool { + !response.status().is_success() +} + +fn sanitize_error_code(error_code: &str) -> &str { + // Trim a trailing URL from the error code, which is done by removing the longest suffix + // beginning with a `:` + let error_code = match error_code.find(':') { + Some(idx) => &error_code[..idx], + None => error_code, + }; + + // Trim a prefixing namespace from the error code, beginning with a `#` + match error_code.find('#') { + Some(idx) => &error_code[idx + 1..], + None => error_code, + } +} + +struct ErrorBody<'a> { + code: Option>, + message: Option>, +} + +fn parse_error_body(bytes: &[u8]) -> Result { + let mut tokens = json_token_iter(bytes).peekable(); + let (mut typ, mut code, mut message) = (None, None, None); + if let Some(Token::StartObject { .. }) = tokens.next().transpose()? { + loop { + match tokens.next().transpose()? { + Some(Token::EndObject { .. }) => break, + Some(Token::ObjectKey { key, .. }) => { + if let Some(Ok(Token::ValueString { value, .. })) = tokens.peek() { + match key.as_escaped_str() { + "code" => code = Some(value.to_unescaped()?), + "__type" => typ = Some(value.to_unescaped()?), + "message" | "Message" | "errorMessage" => message = Some(value.to_unescaped()?), + _ => {} + } + } + skip_value(&mut tokens)?; + } + _ => return Err(DeserializeError::custom("expected object key or end object")), + } + } + if tokens.next().is_some() { + return Err(DeserializeError::custom("found more JSON tokens after completing parsing")); + } + } + Ok(ErrorBody { code: code.or(typ), message }) +} + +pub fn parse_error_metadata(payload: &[u8], headers: &Headers) -> Result { + let ErrorBody { code, message } = parse_error_body(payload)?; + + let mut err_builder = ErrorMetadata::builder(); + if let Some(code) = headers.get("x-amzn-errortype").or(code.as_deref()).map(sanitize_error_code) { + err_builder = err_builder.code(code); + } + if let Some(message) = message { + err_builder = err_builder.message(message); + } + Ok(err_builder) +} + +#[cfg(test)] +mod test { + use crate::json_errors::{parse_error_body, parse_error_metadata, sanitize_error_code}; + use aws_smithy_runtime_api::client::orchestrator::HttpResponse; + use aws_smithy_types::{body::SdkBody, error::ErrorMetadata}; + use std::borrow::Cow; + + #[test] + fn error_metadata() { + let response = HttpResponse::try_from( + http::Response::builder() + .body(SdkBody::from(r#"{ "__type": "FooError", "message": "Go to foo" }"#)) + .unwrap(), + ) + .unwrap(); + assert_eq!( + parse_error_metadata(response.body().bytes().unwrap(), response.headers()) + .unwrap() + .build(), + ErrorMetadata::builder().code("FooError").message("Go to foo").build() + ) + } + + #[test] + fn error_type() { + assert_eq!( + Some(Cow::Borrowed("FooError")), + parse_error_body(br#"{ "__type": "FooError" }"#).unwrap().code + ); + } + + #[test] + fn code_takes_priority() { + assert_eq!( + Some(Cow::Borrowed("BarError")), + parse_error_body(br#"{ "code": "BarError", "__type": "FooError" }"#).unwrap().code + ); + } + + #[test] + fn ignore_unrecognized_fields() { + assert_eq!( + Some(Cow::Borrowed("FooError")), + parse_error_body(br#"{ "__type": "FooError", "asdf": 5, "fdsa": {}, "foo": "1" }"#) + .unwrap() + .code + ); + } + + #[test] + fn sanitize_namespace_and_url() { + assert_eq!( + sanitize_error_code("aws.protocoltests.restjson#FooError:http://internal.amazon.com/coral/com.amazon.coral.validate/"), + "FooError" + ); + } + + #[test] + fn sanitize_noop() { + assert_eq!(sanitize_error_code("FooError"), "FooError"); + } + + #[test] + fn sanitize_url() { + assert_eq!( + sanitize_error_code("FooError:http://internal.amazon.com/coral/com.amazon.coral.validate/"), + "FooError" + ); + } + + #[test] + fn sanitize_namespace() { + assert_eq!(sanitize_error_code("aws.protocoltests.restjson#FooError"), "FooError"); + } + + // services like lambda use an alternate `Message` instead of `message` + #[test] + fn alternative_error_message_names() { + let response = HttpResponse::try_from( + http::Response::builder() + .header("x-amzn-errortype", "ResourceNotFoundException") + .body(SdkBody::from( + r#"{ + "Type": "User", + "Message": "Functions from 'us-west-2' are not reachable from us-east-1" + }"#, + )) + .unwrap(), + ) + .unwrap(); + assert_eq!( + parse_error_metadata(response.body().bytes().unwrap(), response.headers()) + .unwrap() + .build(), + ErrorMetadata::builder() + .code("ResourceNotFoundException") + .message("Functions from 'us-west-2' are not reachable from us-east-1") + .build() + ); + } +} diff --git a/sdk/backupsearch/src/lens.rs b/sdk/backupsearch/src/lens.rs new file mode 100644 index 000000000000..7f8115ed98bc --- /dev/null +++ b/sdk/backupsearch/src/lens.rs @@ -0,0 +1,68 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +pub(crate) fn reflens_list_search_job_backups_output_output_next_token( + input: &crate::operation::list_search_job_backups::ListSearchJobBackupsOutput, +) -> ::std::option::Option<&::std::string::String> { + let input = match &input.next_token { + ::std::option::Option::None => return ::std::option::Option::None, + ::std::option::Option::Some(t) => t, + }; + ::std::option::Option::Some(input) +} + +pub(crate) fn reflens_list_search_job_results_output_output_next_token( + input: &crate::operation::list_search_job_results::ListSearchJobResultsOutput, +) -> ::std::option::Option<&::std::string::String> { + let input = match &input.next_token { + ::std::option::Option::None => return ::std::option::Option::None, + ::std::option::Option::Some(t) => t, + }; + ::std::option::Option::Some(input) +} + +pub(crate) fn reflens_list_search_jobs_output_output_next_token( + input: &crate::operation::list_search_jobs::ListSearchJobsOutput, +) -> ::std::option::Option<&::std::string::String> { + let input = match &input.next_token { + ::std::option::Option::None => return ::std::option::Option::None, + ::std::option::Option::Some(t) => t, + }; + ::std::option::Option::Some(input) +} + +pub(crate) fn reflens_list_search_result_export_jobs_output_output_next_token( + input: &crate::operation::list_search_result_export_jobs::ListSearchResultExportJobsOutput, +) -> ::std::option::Option<&::std::string::String> { + let input = match &input.next_token { + ::std::option::Option::None => return ::std::option::Option::None, + ::std::option::Option::Some(t) => t, + }; + ::std::option::Option::Some(input) +} + +pub(crate) fn lens_list_search_job_backups_output_output_results( + input: crate::operation::list_search_job_backups::ListSearchJobBackupsOutput, +) -> ::std::option::Option<::std::vec::Vec> { + let input = input.results; + ::std::option::Option::Some(input) +} + +pub(crate) fn lens_list_search_job_results_output_output_results( + input: crate::operation::list_search_job_results::ListSearchJobResultsOutput, +) -> ::std::option::Option<::std::vec::Vec> { + let input = input.results; + ::std::option::Option::Some(input) +} + +pub(crate) fn lens_list_search_jobs_output_output_search_jobs( + input: crate::operation::list_search_jobs::ListSearchJobsOutput, +) -> ::std::option::Option<::std::vec::Vec> { + let input = input.search_jobs; + ::std::option::Option::Some(input) +} + +pub(crate) fn lens_list_search_result_export_jobs_output_output_export_jobs( + input: crate::operation::list_search_result_export_jobs::ListSearchResultExportJobsOutput, +) -> ::std::option::Option<::std::vec::Vec> { + let input = input.export_jobs; + ::std::option::Option::Some(input) +} diff --git a/sdk/backupsearch/src/lib.rs b/sdk/backupsearch/src/lib.rs new file mode 100644 index 000000000000..1295afea1f99 --- /dev/null +++ b/sdk/backupsearch/src/lib.rs @@ -0,0 +1,209 @@ +#![allow(deprecated)] +#![allow(unknown_lints)] +#![allow(clippy::module_inception)] +#![allow(clippy::upper_case_acronyms)] +#![allow(clippy::large_enum_variant)] +#![allow(clippy::wrong_self_convention)] +#![allow(clippy::should_implement_trait)] +#![allow(clippy::disallowed_names)] +#![allow(clippy::vec_init_then_push)] +#![allow(clippy::type_complexity)] +#![allow(clippy::needless_return)] +#![allow(clippy::derive_partial_eq_without_eq)] +#![allow(clippy::result_large_err)] +#![allow(clippy::unnecessary_map_on_constructor)] +#![allow(rustdoc::bare_urls)] +#![allow(rustdoc::redundant_explicit_links)] +#![forbid(unsafe_code)] +#![warn(missing_docs)] +#![cfg_attr(docsrs, feature(doc_auto_cfg))] +//! Backup Search is the recovery point and item level search for Backup. +//! +//! For additional information, see: +//! - [Backup API Reference](https://docs.aws.amazon.com/aws-backup/latest/devguide/api-reference.html) +//! - [Backup Developer Guide](https://docs.aws.amazon.com/aws-backup/latest/devguide/whatisbackup.html) +//! +//! ## Getting Started +//! +//! > Examples are available for many services and operations, check out the +//! > [examples folder in GitHub](https://github.com/awslabs/aws-sdk-rust/tree/main/examples). +//! +//! The SDK provides one crate per AWS service. You must add [Tokio](https://crates.io/crates/tokio) +//! as a dependency within your Rust project to execute asynchronous code. To add `aws-sdk-backupsearch` to +//! your project, add the following to your **Cargo.toml** file: +//! +//! ```toml +//! [dependencies] +//! aws-config = { version = "1.1.7", features = ["behavior-version-latest"] } +//! aws-sdk-backupsearch = "1.0.0" +//! tokio = { version = "1", features = ["full"] } +//! ``` +//! +//! Then in code, a client can be created with the following: +//! +//! ```rust,no_run +//! use aws_sdk_backupsearch as backupsearch; +//! +//! #[::tokio::main] +//! async fn main() -> Result<(), backupsearch::Error> { +//! let config = aws_config::load_from_env().await; +//! let client = aws_sdk_backupsearch::Client::new(&config); +//! +//! // ... make some calls with the client +//! +//! Ok(()) +//! } +//! ``` +//! +//! See the [client documentation](https://docs.rs/aws-sdk-backupsearch/latest/aws_sdk_backupsearch/client/struct.Client.html) +//! for information on what calls can be made, and the inputs and outputs for each of those calls. +//! +//! ## Using the SDK +//! +//! Until the SDK is released, we will be adding information about using the SDK to the +//! [Developer Guide](https://docs.aws.amazon.com/sdk-for-rust/latest/dg/welcome.html). Feel free to suggest +//! additional sections for the guide by opening an issue and describing what you are trying to do. +//! +//! ## Getting Help +//! +//! * [GitHub discussions](https://github.com/awslabs/aws-sdk-rust/discussions) - For ideas, RFCs & general questions +//! * [GitHub issues](https://github.com/awslabs/aws-sdk-rust/issues/new/choose) - For bug reports & feature requests +//! * [Generated Docs (latest version)](https://awslabs.github.io/aws-sdk-rust/) +//! * [Usage examples](https://github.com/awslabs/aws-sdk-rust/tree/main/examples) +//! +//! +//! # Crate Organization +//! +//! The entry point for most customers will be [`Client`], which exposes one method for each API +//! offered by AWS Backup Search. The return value of each of these methods is a "fluent builder", +//! where the different inputs for that API are added by builder-style function call chaining, +//! followed by calling `send()` to get a [`Future`](std::future::Future) that will result in +//! either a successful output or a [`SdkError`](crate::error::SdkError). +//! +//! Some of these API inputs may be structs or enums to provide more complex structured information. +//! These structs and enums live in [`types`](crate::types). There are some simpler types for +//! representing data such as date times or binary blobs that live in [`primitives`](crate::primitives). +//! +//! All types required to configure a client via the [`Config`](crate::Config) struct live +//! in [`config`](crate::config). +//! +//! The [`operation`](crate::operation) module has a submodule for every API, and in each submodule +//! is the input, output, and error type for that API, as well as builders to construct each of those. +//! +//! There is a top-level [`Error`](crate::Error) type that encompasses all the errors that the +//! client can return. Any other error type can be converted to this `Error` type via the +//! [`From`](std::convert::From) trait. +//! +//! The other modules within this crate are not required for normal usage. + +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +pub use error_meta::Error; + +#[doc(inline)] +pub use config::Config; + +/// Client for calling AWS Backup Search. +/// ## Constructing a `Client` +/// +/// A [`Config`] is required to construct a client. For most use cases, the [`aws-config`] +/// crate should be used to automatically resolve this config using +/// [`aws_config::load_from_env()`], since this will resolve an [`SdkConfig`] which can be shared +/// across multiple different AWS SDK clients. This config resolution process can be customized +/// by calling [`aws_config::from_env()`] instead, which returns a [`ConfigLoader`] that uses +/// the [builder pattern] to customize the default config. +/// +/// In the simplest case, creating a client looks as follows: +/// ```rust,no_run +/// # async fn wrapper() { +/// let config = aws_config::load_from_env().await; +/// let client = aws_sdk_backupsearch::Client::new(&config); +/// # } +/// ``` +/// +/// Occasionally, SDKs may have additional service-specific values that can be set on the [`Config`] that +/// is absent from [`SdkConfig`], or slightly different settings for a specific client may be desired. +/// The [`Builder`](crate::config::Builder) struct implements `From<&SdkConfig>`, so setting these specific settings can be +/// done as follows: +/// +/// ```rust,no_run +/// # async fn wrapper() { +/// let sdk_config = ::aws_config::load_from_env().await; +/// let config = aws_sdk_backupsearch::config::Builder::from(&sdk_config) +/// # /* +/// .some_service_specific_setting("value") +/// # */ +/// .build(); +/// # } +/// ``` +/// +/// See the [`aws-config` docs] and [`Config`] for more information on customizing configuration. +/// +/// _Note:_ Client construction is expensive due to connection thread pool initialization, and should +/// be done once at application start-up. +/// +/// [`Config`]: crate::Config +/// [`ConfigLoader`]: https://docs.rs/aws-config/*/aws_config/struct.ConfigLoader.html +/// [`SdkConfig`]: https://docs.rs/aws-config/*/aws_config/struct.SdkConfig.html +/// [`aws-config` docs]: https://docs.rs/aws-config/* +/// [`aws-config`]: https://crates.io/crates/aws-config +/// [`aws_config::from_env()`]: https://docs.rs/aws-config/*/aws_config/fn.from_env.html +/// [`aws_config::load_from_env()`]: https://docs.rs/aws-config/*/aws_config/fn.load_from_env.html +/// [builder pattern]: https://rust-lang.github.io/api-guidelines/type-safety.html#builders-enable-construction-of-complex-values-c-builder +/// # Using the `Client` +/// +/// A client has a function for every operation that can be performed by the service. +/// For example, the [`ListSearchJobBackups`](crate::operation::list_search_job_backups) operation has +/// a [`Client::list_search_job_backups`], function which returns a builder for that operation. +/// The fluent builder ultimately has a `send()` function that returns an async future that +/// returns a result, as illustrated below: +/// +/// ```rust,ignore +/// let result = client.list_search_job_backups() +/// .search_job_identifier("example") +/// .send() +/// .await; +/// ``` +/// +/// The underlying HTTP requests that get made by this can be modified with the `customize_operation` +/// function on the fluent builder. See the [`customize`](crate::client::customize) module for more +/// information. +pub mod client; + +/// Configuration for AWS Backup Search. +pub mod config; + +/// Common errors and error handling utilities. +pub mod error; + +mod error_meta; + +/// Information about this crate. +pub mod meta; + +/// All operations that this crate can perform. +pub mod operation; + +/// Primitives such as `Blob` or `DateTime` used by other types. +pub mod primitives; + +/// Data structures used by operation inputs/outputs. +pub mod types; + +mod auth_plugin; + +pub(crate) mod protocol_serde; + +mod serialization_settings; + +mod endpoint_lib; + +mod lens; + +mod sdk_feature_tracker; + +mod serde_util; + +mod json_errors; + +#[doc(inline)] +pub use client::Client; diff --git a/sdk/backupsearch/src/meta.rs b/sdk/backupsearch/src/meta.rs new file mode 100644 index 000000000000..9cd2d111938f --- /dev/null +++ b/sdk/backupsearch/src/meta.rs @@ -0,0 +1,6 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +pub(crate) static API_METADATA: ::aws_runtime::user_agent::ApiMetadata = + ::aws_runtime::user_agent::ApiMetadata::new("backupsearch", crate::meta::PKG_VERSION); + +/// Crate version number. +pub static PKG_VERSION: &str = env!("CARGO_PKG_VERSION"); diff --git a/sdk/backupsearch/src/operation.rs b/sdk/backupsearch/src/operation.rs new file mode 100644 index 000000000000..984426017627 --- /dev/null +++ b/sdk/backupsearch/src/operation.rs @@ -0,0 +1,38 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +pub use ::aws_types::request_id::RequestId; + +/// Types for the `GetSearchJob` operation. +pub mod get_search_job; + +/// Types for the `GetSearchResultExportJob` operation. +pub mod get_search_result_export_job; + +/// Types for the `ListSearchJobBackups` operation. +pub mod list_search_job_backups; + +/// Types for the `ListSearchJobResults` operation. +pub mod list_search_job_results; + +/// Types for the `ListSearchJobs` operation. +pub mod list_search_jobs; + +/// Types for the `ListSearchResultExportJobs` operation. +pub mod list_search_result_export_jobs; + +/// Types for the `ListTagsForResource` operation. +pub mod list_tags_for_resource; + +/// Types for the `StartSearchJob` operation. +pub mod start_search_job; + +/// Types for the `StartSearchResultExportJob` operation. +pub mod start_search_result_export_job; + +/// Types for the `StopSearchJob` operation. +pub mod stop_search_job; + +/// Types for the `TagResource` operation. +pub mod tag_resource; + +/// Types for the `UntagResource` operation. +pub mod untag_resource; diff --git a/sdk/backupsearch/src/operation/get_search_job.rs b/sdk/backupsearch/src/operation/get_search_job.rs new file mode 100644 index 000000000000..c81144d8ee73 --- /dev/null +++ b/sdk/backupsearch/src/operation/get_search_job.rs @@ -0,0 +1,405 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +/// Orchestration and serialization glue logic for `GetSearchJob`. +#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)] +#[non_exhaustive] +pub struct GetSearchJob; +impl GetSearchJob { + /// Creates a new `GetSearchJob` + pub fn new() -> Self { + Self + } + pub(crate) async fn orchestrate( + runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, + input: crate::operation::get_search_job::GetSearchJobInput, + ) -> ::std::result::Result< + crate::operation::get_search_job::GetSearchJobOutput, + ::aws_smithy_runtime_api::client::result::SdkError< + crate::operation::get_search_job::GetSearchJobError, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >, + > { + let map_err = |err: ::aws_smithy_runtime_api::client::result::SdkError< + ::aws_smithy_runtime_api::client::interceptors::context::Error, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >| { + err.map_service_error(|err| { + err.downcast::() + .expect("correct error type") + }) + }; + let context = Self::orchestrate_with_stop_point(runtime_plugins, input, ::aws_smithy_runtime::client::orchestrator::StopPoint::None) + .await + .map_err(map_err)?; + let output = context.finalize().map_err(map_err)?; + ::std::result::Result::Ok( + output + .downcast::() + .expect("correct output type"), + ) + } + + pub(crate) async fn orchestrate_with_stop_point( + runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, + input: crate::operation::get_search_job::GetSearchJobInput, + stop_point: ::aws_smithy_runtime::client::orchestrator::StopPoint, + ) -> ::std::result::Result< + ::aws_smithy_runtime_api::client::interceptors::context::InterceptorContext, + ::aws_smithy_runtime_api::client::result::SdkError< + ::aws_smithy_runtime_api::client::interceptors::context::Error, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >, + > { + let input = ::aws_smithy_runtime_api::client::interceptors::context::Input::erase(input); + ::aws_smithy_runtime::client::orchestrator::invoke_with_stop_point("backupsearch", "GetSearchJob", input, runtime_plugins, stop_point).await + } + + pub(crate) fn operation_runtime_plugins( + client_runtime_plugins: ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, + client_config: &crate::config::Config, + config_override: ::std::option::Option, + ) -> ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins { + let mut runtime_plugins = client_runtime_plugins.with_operation_plugin(Self::new()); + runtime_plugins = runtime_plugins.with_client_plugin(crate::auth_plugin::DefaultAuthOptionsPlugin::new(vec![ + ::aws_runtime::auth::sigv4::SCHEME_ID, + ])); + if let ::std::option::Option::Some(config_override) = config_override { + for plugin in config_override.runtime_plugins.iter().cloned() { + runtime_plugins = runtime_plugins.with_operation_plugin(plugin); + } + runtime_plugins = runtime_plugins.with_operation_plugin(crate::config::ConfigOverrideRuntimePlugin::new( + config_override, + client_config.config.clone(), + &client_config.runtime_components, + )); + } + runtime_plugins + } +} +impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for GetSearchJob { + fn config(&self) -> ::std::option::Option<::aws_smithy_types::config_bag::FrozenLayer> { + let mut cfg = ::aws_smithy_types::config_bag::Layer::new("GetSearchJob"); + + cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new( + GetSearchJobRequestSerializer, + )); + cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new( + GetSearchJobResponseDeserializer, + )); + + cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new( + ::aws_smithy_runtime_api::client::auth::static_resolver::StaticAuthSchemeOptionResolverParams::new(), + )); + + cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::Metadata::new( + "GetSearchJob", + "backupsearch", + )); + let mut signing_options = ::aws_runtime::auth::SigningOptions::default(); + signing_options.double_uri_encode = true; + signing_options.content_sha256_header = false; + signing_options.normalize_uri_path = true; + signing_options.payload_override = None; + + cfg.store_put(::aws_runtime::auth::SigV4OperationSigningConfig { + signing_options, + ..::std::default::Default::default() + }); + + ::std::option::Option::Some(cfg.freeze()) + } + + fn runtime_components( + &self, + _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder, + ) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> { + #[allow(unused_mut)] + let mut rcb = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("GetSearchJob") + .with_interceptor(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default()) + .with_interceptor(GetSearchJobEndpointParamsInterceptor) + .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::< + crate::operation::get_search_job::GetSearchJobError, + >::new()) + .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::< + crate::operation::get_search_job::GetSearchJobError, + >::new()) + .with_retry_classifier(::aws_runtime::retries::classifiers::AwsErrorCodeClassifier::< + crate::operation::get_search_job::GetSearchJobError, + >::new()); + + ::std::borrow::Cow::Owned(rcb) + } +} + +#[derive(Debug)] +struct GetSearchJobResponseDeserializer; +impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for GetSearchJobResponseDeserializer { + fn deserialize_nonstreaming( + &self, + response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError { + let (success, status) = (response.status().is_success(), response.status().as_u16()); + let headers = response.headers(); + let body = response.body().bytes().expect("body loaded"); + #[allow(unused_mut)] + let mut force_error = false; + ::tracing::debug!(request_id = ?::aws_types::request_id::RequestId::request_id(response)); + let parse_result = if !success && status != 200 || force_error { + crate::protocol_serde::shape_get_search_job::de_get_search_job_http_error(status, headers, body) + } else { + crate::protocol_serde::shape_get_search_job::de_get_search_job_http_response(status, headers, body) + }; + crate::protocol_serde::type_erase_result(parse_result) + } +} +#[derive(Debug)] +struct GetSearchJobRequestSerializer; +impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for GetSearchJobRequestSerializer { + #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)] + fn serialize_input( + &self, + input: ::aws_smithy_runtime_api::client::interceptors::context::Input, + _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag, + ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> { + let input = input + .downcast::() + .expect("correct type"); + let _header_serialization_settings = _cfg + .load::() + .cloned() + .unwrap_or_default(); + let mut request_builder = { + fn uri_base( + _input: &crate::operation::get_search_job::GetSearchJobInput, + output: &mut ::std::string::String, + ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> { + use ::std::fmt::Write as _; + let input_1 = &_input.search_job_identifier; + let input_1 = input_1.as_ref().ok_or_else(|| { + ::aws_smithy_types::error::operation::BuildError::missing_field("search_job_identifier", "cannot be empty or unset") + })?; + let search_job_identifier = ::aws_smithy_http::label::fmt_string(input_1, ::aws_smithy_http::label::EncodingStrategy::Default); + if search_job_identifier.is_empty() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "search_job_identifier", + "cannot be empty or unset", + )); + } + ::std::write!(output, "/search-jobs/{SearchJobIdentifier}", SearchJobIdentifier = search_job_identifier) + .expect("formatting should succeed"); + ::std::result::Result::Ok(()) + } + #[allow(clippy::unnecessary_wraps)] + fn update_http_builder( + input: &crate::operation::get_search_job::GetSearchJobInput, + builder: ::http::request::Builder, + ) -> ::std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> { + let mut uri = ::std::string::String::new(); + uri_base(input, &mut uri)?; + ::std::result::Result::Ok(builder.method("GET").uri(uri)) + } + let mut builder = update_http_builder(&input, ::http::request::Builder::new())?; + builder + }; + let body = ::aws_smithy_types::body::SdkBody::from(""); + + ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap()) + } +} +#[derive(Debug)] +struct GetSearchJobEndpointParamsInterceptor; + +impl ::aws_smithy_runtime_api::client::interceptors::Intercept for GetSearchJobEndpointParamsInterceptor { + fn name(&self) -> &'static str { + "GetSearchJobEndpointParamsInterceptor" + } + + fn read_before_execution( + &self, + context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef< + '_, + ::aws_smithy_runtime_api::client::interceptors::context::Input, + ::aws_smithy_runtime_api::client::interceptors::context::Output, + ::aws_smithy_runtime_api::client::interceptors::context::Error, + >, + cfg: &mut ::aws_smithy_types::config_bag::ConfigBag, + ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> { + let _input = context + .input() + .downcast_ref::() + .ok_or("failed to downcast to GetSearchJobInput")?; + + let params = crate::config::endpoint::Params::builder() + .set_use_fips(cfg.load::<::aws_types::endpoint_config::UseFips>().map(|ty| ty.0)) + .set_endpoint(cfg.load::<::aws_types::endpoint_config::EndpointUrl>().map(|ty| ty.0.clone())) + .set_region(cfg.load::<::aws_types::region::Region>().map(|r| r.as_ref().to_owned())) + .build() + .map_err(|err| { + ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err) + })?; + cfg.interceptor_state() + .store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params)); + ::std::result::Result::Ok(()) + } +} + +// The get_* functions below are generated from JMESPath expressions in the +// operationContextParams trait. They target the operation's input shape. + +/// Error type for the `GetSearchJobError` operation. +#[non_exhaustive] +#[derive(::std::fmt::Debug)] +pub enum GetSearchJobError { + ///

The resource was not found for this request.

+ ///

Confirm the resource information, such as the ARN or type is correct and exists, then retry the request.

+ ResourceNotFoundException(crate::types::error::ResourceNotFoundException), + ///

You do not have sufficient access to perform this action.

+ AccessDeniedException(crate::types::error::AccessDeniedException), + ///

An internal server error occurred. Retry your request.

+ InternalServerException(crate::types::error::InternalServerException), + ///

The request was denied due to request throttling.

+ ThrottlingException(crate::types::error::ThrottlingException), + ///

The input fails to satisfy the constraints specified by a service.

+ ValidationException(crate::types::error::ValidationException), + /// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code). + #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \ + variable wildcard pattern and check `.code()`: + \ +    `err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }` + \ + See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-GetSearchJobError) for what information is available for the error.")] + Unhandled(crate::error::sealed_unhandled::Unhandled), +} +impl GetSearchJobError { + /// Creates the `GetSearchJobError::Unhandled` variant from any error type. + pub fn unhandled( + err: impl ::std::convert::Into<::std::boxed::Box>, + ) -> Self { + Self::Unhandled(crate::error::sealed_unhandled::Unhandled { + source: err.into(), + meta: ::std::default::Default::default(), + }) + } + + /// Creates the `GetSearchJobError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata). + pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self { + Self::Unhandled(crate::error::sealed_unhandled::Unhandled { + source: err.clone().into(), + meta: err, + }) + } + /// + /// Returns error metadata, which includes the error code, message, + /// request ID, and potentially additional information. + /// + pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata { + match self { + Self::ResourceNotFoundException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), + Self::AccessDeniedException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), + Self::InternalServerException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), + Self::ThrottlingException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), + Self::ValidationException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), + Self::Unhandled(e) => &e.meta, + } + } + /// Returns `true` if the error kind is `GetSearchJobError::ResourceNotFoundException`. + pub fn is_resource_not_found_exception(&self) -> bool { + matches!(self, Self::ResourceNotFoundException(_)) + } + /// Returns `true` if the error kind is `GetSearchJobError::AccessDeniedException`. + pub fn is_access_denied_exception(&self) -> bool { + matches!(self, Self::AccessDeniedException(_)) + } + /// Returns `true` if the error kind is `GetSearchJobError::InternalServerException`. + pub fn is_internal_server_exception(&self) -> bool { + matches!(self, Self::InternalServerException(_)) + } + /// Returns `true` if the error kind is `GetSearchJobError::ThrottlingException`. + pub fn is_throttling_exception(&self) -> bool { + matches!(self, Self::ThrottlingException(_)) + } + /// Returns `true` if the error kind is `GetSearchJobError::ValidationException`. + pub fn is_validation_exception(&self) -> bool { + matches!(self, Self::ValidationException(_)) + } +} +impl ::std::error::Error for GetSearchJobError { + fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> { + match self { + Self::ResourceNotFoundException(_inner) => ::std::option::Option::Some(_inner), + Self::AccessDeniedException(_inner) => ::std::option::Option::Some(_inner), + Self::InternalServerException(_inner) => ::std::option::Option::Some(_inner), + Self::ThrottlingException(_inner) => ::std::option::Option::Some(_inner), + Self::ValidationException(_inner) => ::std::option::Option::Some(_inner), + Self::Unhandled(_inner) => ::std::option::Option::Some(&*_inner.source), + } + } +} +impl ::std::fmt::Display for GetSearchJobError { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + match self { + Self::ResourceNotFoundException(_inner) => _inner.fmt(f), + Self::AccessDeniedException(_inner) => _inner.fmt(f), + Self::InternalServerException(_inner) => _inner.fmt(f), + Self::ThrottlingException(_inner) => _inner.fmt(f), + Self::ValidationException(_inner) => _inner.fmt(f), + Self::Unhandled(_inner) => { + if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) { + write!(f, "unhandled error ({code})") + } else { + f.write_str("unhandled error") + } + } + } + } +} +impl ::aws_smithy_types::retry::ProvideErrorKind for GetSearchJobError { + fn code(&self) -> ::std::option::Option<&str> { + ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) + } + fn retryable_error_kind(&self) -> ::std::option::Option<::aws_smithy_types::retry::ErrorKind> { + match self { + Self::InternalServerException(inner) => ::std::option::Option::Some(inner.retryable_error_kind()), + Self::ThrottlingException(inner) => ::std::option::Option::Some(inner.retryable_error_kind()), + _ => ::std::option::Option::None, + } + } +} +impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for GetSearchJobError { + fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata { + match self { + Self::ResourceNotFoundException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner), + Self::AccessDeniedException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner), + Self::InternalServerException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner), + Self::ThrottlingException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner), + Self::ValidationException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner), + Self::Unhandled(_inner) => &_inner.meta, + } + } +} +impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for GetSearchJobError { + fn create_unhandled_error( + source: ::std::boxed::Box, + meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>, + ) -> Self { + Self::Unhandled(crate::error::sealed_unhandled::Unhandled { + source, + meta: meta.unwrap_or_default(), + }) + } +} +impl ::aws_types::request_id::RequestId for crate::operation::get_search_job::GetSearchJobError { + fn request_id(&self) -> Option<&str> { + self.meta().request_id() + } +} + +pub use crate::operation::get_search_job::_get_search_job_output::GetSearchJobOutput; + +pub use crate::operation::get_search_job::_get_search_job_input::GetSearchJobInput; + +mod _get_search_job_input; + +mod _get_search_job_output; + +/// Builders +pub mod builders; diff --git a/sdk/backupsearch/src/operation/get_search_job/_get_search_job_input.rs b/sdk/backupsearch/src/operation/get_search_job/_get_search_job_input.rs new file mode 100644 index 000000000000..5bfc630416ab --- /dev/null +++ b/sdk/backupsearch/src/operation/get_search_job/_get_search_job_input.rs @@ -0,0 +1,52 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +#[allow(missing_docs)] // documentation missing in model +#[non_exhaustive] +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)] +pub struct GetSearchJobInput { + ///

Required unique string that specifies the search job.

+ pub search_job_identifier: ::std::option::Option<::std::string::String>, +} +impl GetSearchJobInput { + ///

Required unique string that specifies the search job.

+ pub fn search_job_identifier(&self) -> ::std::option::Option<&str> { + self.search_job_identifier.as_deref() + } +} +impl GetSearchJobInput { + /// Creates a new builder-style object to manufacture [`GetSearchJobInput`](crate::operation::get_search_job::GetSearchJobInput). + pub fn builder() -> crate::operation::get_search_job::builders::GetSearchJobInputBuilder { + crate::operation::get_search_job::builders::GetSearchJobInputBuilder::default() + } +} + +/// A builder for [`GetSearchJobInput`](crate::operation::get_search_job::GetSearchJobInput). +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)] +#[non_exhaustive] +pub struct GetSearchJobInputBuilder { + pub(crate) search_job_identifier: ::std::option::Option<::std::string::String>, +} +impl GetSearchJobInputBuilder { + ///

Required unique string that specifies the search job.

+ /// This field is required. + pub fn search_job_identifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.search_job_identifier = ::std::option::Option::Some(input.into()); + self + } + ///

Required unique string that specifies the search job.

+ pub fn set_search_job_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.search_job_identifier = input; + self + } + ///

Required unique string that specifies the search job.

+ pub fn get_search_job_identifier(&self) -> &::std::option::Option<::std::string::String> { + &self.search_job_identifier + } + /// Consumes the builder and constructs a [`GetSearchJobInput`](crate::operation::get_search_job::GetSearchJobInput). + pub fn build( + self, + ) -> ::std::result::Result { + ::std::result::Result::Ok(crate::operation::get_search_job::GetSearchJobInput { + search_job_identifier: self.search_job_identifier, + }) + } +} diff --git a/sdk/backupsearch/src/operation/get_search_job/_get_search_job_output.rs b/sdk/backupsearch/src/operation/get_search_job/_get_search_job_output.rs new file mode 100644 index 000000000000..66c1eff21e86 --- /dev/null +++ b/sdk/backupsearch/src/operation/get_search_job/_get_search_job_output.rs @@ -0,0 +1,388 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +#[allow(missing_docs)] // documentation missing in model +#[non_exhaustive] +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)] +pub struct GetSearchJobOutput { + ///

Returned name of the specified search job.

+ pub name: ::std::option::Option<::std::string::String>, + ///

Returned summary of the specified search job scope, including:

+ ///
    + ///
  • + ///

    TotalBackupsToScanCount, the number of recovery points returned by the search.

  • + ///
  • + ///

    TotalItemsToScanCount, the number of items returned by the search.

  • + ///
+ pub search_scope_summary: ::std::option::Option, + ///

Returns numbers representing BackupsScannedCount, ItemsScanned, and ItemsMatched.

+ pub current_search_progress: ::std::option::Option, + ///

A status message will be returned for either a earch job with a status of ERRORED or a status of COMPLETED jobs with issues.

+ ///

For example, a message may say that a search contained recovery points unable to be scanned because of a permissions issue.

+ pub status_message: ::std::option::Option<::std::string::String>, + ///

The encryption key for the specified search job.

+ ///

Example: arn:aws:kms:us-west-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab.

+ pub encryption_key_arn: ::std::option::Option<::std::string::String>, + ///

The date and time that a search job completed, in Unix format and Coordinated Universal Time (UTC). The value of CompletionTime is accurate to milliseconds. For example, the value 1516925490.087 represents Friday, January 26, 2018 12:11:30.087 AM.

+ pub completion_time: ::std::option::Option<::aws_smithy_types::DateTime>, + ///

The current status of the specified search job.

+ ///

A search job may have one of the following statuses: RUNNING; COMPLETED; STOPPED; FAILED; TIMED_OUT; or EXPIRED .

+ pub status: crate::types::SearchJobState, + ///

The search scope is all backup properties input into a search.

+ pub search_scope: ::std::option::Option, + ///

Item Filters represent all input item properties specified when the search was created.

+ pub item_filters: ::std::option::Option, + ///

The date and time that a search job was created, in Unix format and Coordinated Universal Time (UTC). The value of CompletionTime is accurate to milliseconds. For example, the value 1516925490.087 represents Friday, January 26, 2018 12:11:30.087 AM.

+ pub creation_time: ::aws_smithy_types::DateTime, + ///

The unique string that identifies the specified search job.

+ pub search_job_identifier: ::std::string::String, + ///

The unique string that identifies the Amazon Resource Name (ARN) of the specified search job.

+ pub search_job_arn: ::std::string::String, + _request_id: Option, +} +impl GetSearchJobOutput { + ///

Returned name of the specified search job.

+ pub fn name(&self) -> ::std::option::Option<&str> { + self.name.as_deref() + } + ///

Returned summary of the specified search job scope, including:

+ ///
    + ///
  • + ///

    TotalBackupsToScanCount, the number of recovery points returned by the search.

  • + ///
  • + ///

    TotalItemsToScanCount, the number of items returned by the search.

  • + ///
+ pub fn search_scope_summary(&self) -> ::std::option::Option<&crate::types::SearchScopeSummary> { + self.search_scope_summary.as_ref() + } + ///

Returns numbers representing BackupsScannedCount, ItemsScanned, and ItemsMatched.

+ pub fn current_search_progress(&self) -> ::std::option::Option<&crate::types::CurrentSearchProgress> { + self.current_search_progress.as_ref() + } + ///

A status message will be returned for either a earch job with a status of ERRORED or a status of COMPLETED jobs with issues.

+ ///

For example, a message may say that a search contained recovery points unable to be scanned because of a permissions issue.

+ pub fn status_message(&self) -> ::std::option::Option<&str> { + self.status_message.as_deref() + } + ///

The encryption key for the specified search job.

+ ///

Example: arn:aws:kms:us-west-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab.

+ pub fn encryption_key_arn(&self) -> ::std::option::Option<&str> { + self.encryption_key_arn.as_deref() + } + ///

The date and time that a search job completed, in Unix format and Coordinated Universal Time (UTC). The value of CompletionTime is accurate to milliseconds. For example, the value 1516925490.087 represents Friday, January 26, 2018 12:11:30.087 AM.

+ pub fn completion_time(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> { + self.completion_time.as_ref() + } + ///

The current status of the specified search job.

+ ///

A search job may have one of the following statuses: RUNNING; COMPLETED; STOPPED; FAILED; TIMED_OUT; or EXPIRED .

+ pub fn status(&self) -> &crate::types::SearchJobState { + &self.status + } + ///

The search scope is all backup properties input into a search.

+ pub fn search_scope(&self) -> ::std::option::Option<&crate::types::SearchScope> { + self.search_scope.as_ref() + } + ///

Item Filters represent all input item properties specified when the search was created.

+ pub fn item_filters(&self) -> ::std::option::Option<&crate::types::ItemFilters> { + self.item_filters.as_ref() + } + ///

The date and time that a search job was created, in Unix format and Coordinated Universal Time (UTC). The value of CompletionTime is accurate to milliseconds. For example, the value 1516925490.087 represents Friday, January 26, 2018 12:11:30.087 AM.

+ pub fn creation_time(&self) -> &::aws_smithy_types::DateTime { + &self.creation_time + } + ///

The unique string that identifies the specified search job.

+ pub fn search_job_identifier(&self) -> &str { + use std::ops::Deref; + self.search_job_identifier.deref() + } + ///

The unique string that identifies the Amazon Resource Name (ARN) of the specified search job.

+ pub fn search_job_arn(&self) -> &str { + use std::ops::Deref; + self.search_job_arn.deref() + } +} +impl ::aws_types::request_id::RequestId for GetSearchJobOutput { + fn request_id(&self) -> Option<&str> { + self._request_id.as_deref() + } +} +impl GetSearchJobOutput { + /// Creates a new builder-style object to manufacture [`GetSearchJobOutput`](crate::operation::get_search_job::GetSearchJobOutput). + pub fn builder() -> crate::operation::get_search_job::builders::GetSearchJobOutputBuilder { + crate::operation::get_search_job::builders::GetSearchJobOutputBuilder::default() + } +} + +/// A builder for [`GetSearchJobOutput`](crate::operation::get_search_job::GetSearchJobOutput). +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)] +#[non_exhaustive] +pub struct GetSearchJobOutputBuilder { + pub(crate) name: ::std::option::Option<::std::string::String>, + pub(crate) search_scope_summary: ::std::option::Option, + pub(crate) current_search_progress: ::std::option::Option, + pub(crate) status_message: ::std::option::Option<::std::string::String>, + pub(crate) encryption_key_arn: ::std::option::Option<::std::string::String>, + pub(crate) completion_time: ::std::option::Option<::aws_smithy_types::DateTime>, + pub(crate) status: ::std::option::Option, + pub(crate) search_scope: ::std::option::Option, + pub(crate) item_filters: ::std::option::Option, + pub(crate) creation_time: ::std::option::Option<::aws_smithy_types::DateTime>, + pub(crate) search_job_identifier: ::std::option::Option<::std::string::String>, + pub(crate) search_job_arn: ::std::option::Option<::std::string::String>, + _request_id: Option, +} +impl GetSearchJobOutputBuilder { + ///

Returned name of the specified search job.

+ pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.name = ::std::option::Option::Some(input.into()); + self + } + ///

Returned name of the specified search job.

+ pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.name = input; + self + } + ///

Returned name of the specified search job.

+ pub fn get_name(&self) -> &::std::option::Option<::std::string::String> { + &self.name + } + ///

Returned summary of the specified search job scope, including:

+ ///
    + ///
  • + ///

    TotalBackupsToScanCount, the number of recovery points returned by the search.

  • + ///
  • + ///

    TotalItemsToScanCount, the number of items returned by the search.

  • + ///
+ pub fn search_scope_summary(mut self, input: crate::types::SearchScopeSummary) -> Self { + self.search_scope_summary = ::std::option::Option::Some(input); + self + } + ///

Returned summary of the specified search job scope, including:

+ ///
    + ///
  • + ///

    TotalBackupsToScanCount, the number of recovery points returned by the search.

  • + ///
  • + ///

    TotalItemsToScanCount, the number of items returned by the search.

  • + ///
+ pub fn set_search_scope_summary(mut self, input: ::std::option::Option) -> Self { + self.search_scope_summary = input; + self + } + ///

Returned summary of the specified search job scope, including:

+ ///
    + ///
  • + ///

    TotalBackupsToScanCount, the number of recovery points returned by the search.

  • + ///
  • + ///

    TotalItemsToScanCount, the number of items returned by the search.

  • + ///
+ pub fn get_search_scope_summary(&self) -> &::std::option::Option { + &self.search_scope_summary + } + ///

Returns numbers representing BackupsScannedCount, ItemsScanned, and ItemsMatched.

+ pub fn current_search_progress(mut self, input: crate::types::CurrentSearchProgress) -> Self { + self.current_search_progress = ::std::option::Option::Some(input); + self + } + ///

Returns numbers representing BackupsScannedCount, ItemsScanned, and ItemsMatched.

+ pub fn set_current_search_progress(mut self, input: ::std::option::Option) -> Self { + self.current_search_progress = input; + self + } + ///

Returns numbers representing BackupsScannedCount, ItemsScanned, and ItemsMatched.

+ pub fn get_current_search_progress(&self) -> &::std::option::Option { + &self.current_search_progress + } + ///

A status message will be returned for either a earch job with a status of ERRORED or a status of COMPLETED jobs with issues.

+ ///

For example, a message may say that a search contained recovery points unable to be scanned because of a permissions issue.

+ pub fn status_message(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.status_message = ::std::option::Option::Some(input.into()); + self + } + ///

A status message will be returned for either a earch job with a status of ERRORED or a status of COMPLETED jobs with issues.

+ ///

For example, a message may say that a search contained recovery points unable to be scanned because of a permissions issue.

+ pub fn set_status_message(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.status_message = input; + self + } + ///

A status message will be returned for either a earch job with a status of ERRORED or a status of COMPLETED jobs with issues.

+ ///

For example, a message may say that a search contained recovery points unable to be scanned because of a permissions issue.

+ pub fn get_status_message(&self) -> &::std::option::Option<::std::string::String> { + &self.status_message + } + ///

The encryption key for the specified search job.

+ ///

Example: arn:aws:kms:us-west-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab.

+ pub fn encryption_key_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.encryption_key_arn = ::std::option::Option::Some(input.into()); + self + } + ///

The encryption key for the specified search job.

+ ///

Example: arn:aws:kms:us-west-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab.

+ pub fn set_encryption_key_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.encryption_key_arn = input; + self + } + ///

The encryption key for the specified search job.

+ ///

Example: arn:aws:kms:us-west-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab.

+ pub fn get_encryption_key_arn(&self) -> &::std::option::Option<::std::string::String> { + &self.encryption_key_arn + } + ///

The date and time that a search job completed, in Unix format and Coordinated Universal Time (UTC). The value of CompletionTime is accurate to milliseconds. For example, the value 1516925490.087 represents Friday, January 26, 2018 12:11:30.087 AM.

+ pub fn completion_time(mut self, input: ::aws_smithy_types::DateTime) -> Self { + self.completion_time = ::std::option::Option::Some(input); + self + } + ///

The date and time that a search job completed, in Unix format and Coordinated Universal Time (UTC). The value of CompletionTime is accurate to milliseconds. For example, the value 1516925490.087 represents Friday, January 26, 2018 12:11:30.087 AM.

+ pub fn set_completion_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self { + self.completion_time = input; + self + } + ///

The date and time that a search job completed, in Unix format and Coordinated Universal Time (UTC). The value of CompletionTime is accurate to milliseconds. For example, the value 1516925490.087 represents Friday, January 26, 2018 12:11:30.087 AM.

+ pub fn get_completion_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> { + &self.completion_time + } + ///

The current status of the specified search job.

+ ///

A search job may have one of the following statuses: RUNNING; COMPLETED; STOPPED; FAILED; TIMED_OUT; or EXPIRED .

+ /// This field is required. + pub fn status(mut self, input: crate::types::SearchJobState) -> Self { + self.status = ::std::option::Option::Some(input); + self + } + ///

The current status of the specified search job.

+ ///

A search job may have one of the following statuses: RUNNING; COMPLETED; STOPPED; FAILED; TIMED_OUT; or EXPIRED .

+ pub fn set_status(mut self, input: ::std::option::Option) -> Self { + self.status = input; + self + } + ///

The current status of the specified search job.

+ ///

A search job may have one of the following statuses: RUNNING; COMPLETED; STOPPED; FAILED; TIMED_OUT; or EXPIRED .

+ pub fn get_status(&self) -> &::std::option::Option { + &self.status + } + ///

The search scope is all backup properties input into a search.

+ /// This field is required. + pub fn search_scope(mut self, input: crate::types::SearchScope) -> Self { + self.search_scope = ::std::option::Option::Some(input); + self + } + ///

The search scope is all backup properties input into a search.

+ pub fn set_search_scope(mut self, input: ::std::option::Option) -> Self { + self.search_scope = input; + self + } + ///

The search scope is all backup properties input into a search.

+ pub fn get_search_scope(&self) -> &::std::option::Option { + &self.search_scope + } + ///

Item Filters represent all input item properties specified when the search was created.

+ /// This field is required. + pub fn item_filters(mut self, input: crate::types::ItemFilters) -> Self { + self.item_filters = ::std::option::Option::Some(input); + self + } + ///

Item Filters represent all input item properties specified when the search was created.

+ pub fn set_item_filters(mut self, input: ::std::option::Option) -> Self { + self.item_filters = input; + self + } + ///

Item Filters represent all input item properties specified when the search was created.

+ pub fn get_item_filters(&self) -> &::std::option::Option { + &self.item_filters + } + ///

The date and time that a search job was created, in Unix format and Coordinated Universal Time (UTC). The value of CompletionTime is accurate to milliseconds. For example, the value 1516925490.087 represents Friday, January 26, 2018 12:11:30.087 AM.

+ /// This field is required. + pub fn creation_time(mut self, input: ::aws_smithy_types::DateTime) -> Self { + self.creation_time = ::std::option::Option::Some(input); + self + } + ///

The date and time that a search job was created, in Unix format and Coordinated Universal Time (UTC). The value of CompletionTime is accurate to milliseconds. For example, the value 1516925490.087 represents Friday, January 26, 2018 12:11:30.087 AM.

+ pub fn set_creation_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self { + self.creation_time = input; + self + } + ///

The date and time that a search job was created, in Unix format and Coordinated Universal Time (UTC). The value of CompletionTime is accurate to milliseconds. For example, the value 1516925490.087 represents Friday, January 26, 2018 12:11:30.087 AM.

+ pub fn get_creation_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> { + &self.creation_time + } + ///

The unique string that identifies the specified search job.

+ /// This field is required. + pub fn search_job_identifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.search_job_identifier = ::std::option::Option::Some(input.into()); + self + } + ///

The unique string that identifies the specified search job.

+ pub fn set_search_job_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.search_job_identifier = input; + self + } + ///

The unique string that identifies the specified search job.

+ pub fn get_search_job_identifier(&self) -> &::std::option::Option<::std::string::String> { + &self.search_job_identifier + } + ///

The unique string that identifies the Amazon Resource Name (ARN) of the specified search job.

+ /// This field is required. + pub fn search_job_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.search_job_arn = ::std::option::Option::Some(input.into()); + self + } + ///

The unique string that identifies the Amazon Resource Name (ARN) of the specified search job.

+ pub fn set_search_job_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.search_job_arn = input; + self + } + ///

The unique string that identifies the Amazon Resource Name (ARN) of the specified search job.

+ pub fn get_search_job_arn(&self) -> &::std::option::Option<::std::string::String> { + &self.search_job_arn + } + pub(crate) fn _request_id(mut self, request_id: impl Into) -> Self { + self._request_id = Some(request_id.into()); + self + } + + pub(crate) fn _set_request_id(&mut self, request_id: Option) -> &mut Self { + self._request_id = request_id; + self + } + /// Consumes the builder and constructs a [`GetSearchJobOutput`](crate::operation::get_search_job::GetSearchJobOutput). + /// This method will fail if any of the following fields are not set: + /// - [`status`](crate::operation::get_search_job::builders::GetSearchJobOutputBuilder::status) + /// - [`creation_time`](crate::operation::get_search_job::builders::GetSearchJobOutputBuilder::creation_time) + /// - [`search_job_identifier`](crate::operation::get_search_job::builders::GetSearchJobOutputBuilder::search_job_identifier) + /// - [`search_job_arn`](crate::operation::get_search_job::builders::GetSearchJobOutputBuilder::search_job_arn) + pub fn build( + self, + ) -> ::std::result::Result { + ::std::result::Result::Ok(crate::operation::get_search_job::GetSearchJobOutput { + name: self.name, + search_scope_summary: self.search_scope_summary, + current_search_progress: self.current_search_progress, + status_message: self.status_message, + encryption_key_arn: self.encryption_key_arn, + completion_time: self.completion_time, + status: self.status.ok_or_else(|| { + ::aws_smithy_types::error::operation::BuildError::missing_field( + "status", + "status was not specified but it is required when building GetSearchJobOutput", + ) + })?, + search_scope: self.search_scope, + item_filters: self.item_filters, + creation_time: self.creation_time.ok_or_else(|| { + ::aws_smithy_types::error::operation::BuildError::missing_field( + "creation_time", + "creation_time was not specified but it is required when building GetSearchJobOutput", + ) + })?, + search_job_identifier: self.search_job_identifier.ok_or_else(|| { + ::aws_smithy_types::error::operation::BuildError::missing_field( + "search_job_identifier", + "search_job_identifier was not specified but it is required when building GetSearchJobOutput", + ) + })?, + search_job_arn: self.search_job_arn.ok_or_else(|| { + ::aws_smithy_types::error::operation::BuildError::missing_field( + "search_job_arn", + "search_job_arn was not specified but it is required when building GetSearchJobOutput", + ) + })?, + _request_id: self._request_id, + }) + } +} diff --git a/sdk/backupsearch/src/operation/get_search_job/builders.rs b/sdk/backupsearch/src/operation/get_search_job/builders.rs new file mode 100644 index 000000000000..dd4df2bfe695 --- /dev/null +++ b/sdk/backupsearch/src/operation/get_search_job/builders.rs @@ -0,0 +1,125 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +pub use crate::operation::get_search_job::_get_search_job_output::GetSearchJobOutputBuilder; + +pub use crate::operation::get_search_job::_get_search_job_input::GetSearchJobInputBuilder; + +impl crate::operation::get_search_job::builders::GetSearchJobInputBuilder { + /// Sends a request with this input using the given client. + pub async fn send_with( + self, + client: &crate::Client, + ) -> ::std::result::Result< + crate::operation::get_search_job::GetSearchJobOutput, + ::aws_smithy_runtime_api::client::result::SdkError< + crate::operation::get_search_job::GetSearchJobError, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >, + > { + let mut fluent_builder = client.get_search_job(); + fluent_builder.inner = self; + fluent_builder.send().await + } +} +/// Fluent builder constructing a request to `GetSearchJob`. +/// +///

This operation retrieves metadata of a search job, including its progress.

+#[derive(::std::clone::Clone, ::std::fmt::Debug)] +pub struct GetSearchJobFluentBuilder { + handle: ::std::sync::Arc, + inner: crate::operation::get_search_job::builders::GetSearchJobInputBuilder, + config_override: ::std::option::Option, +} +impl + crate::client::customize::internal::CustomizableSend< + crate::operation::get_search_job::GetSearchJobOutput, + crate::operation::get_search_job::GetSearchJobError, + > for GetSearchJobFluentBuilder +{ + fn send( + self, + config_override: crate::config::Builder, + ) -> crate::client::customize::internal::BoxFuture< + crate::client::customize::internal::SendResult< + crate::operation::get_search_job::GetSearchJobOutput, + crate::operation::get_search_job::GetSearchJobError, + >, + > { + ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await }) + } +} +impl GetSearchJobFluentBuilder { + /// Creates a new `GetSearchJobFluentBuilder`. + pub(crate) fn new(handle: ::std::sync::Arc) -> Self { + Self { + handle, + inner: ::std::default::Default::default(), + config_override: ::std::option::Option::None, + } + } + /// Access the GetSearchJob as a reference. + pub fn as_input(&self) -> &crate::operation::get_search_job::builders::GetSearchJobInputBuilder { + &self.inner + } + /// Sends the request and returns the response. + /// + /// If an error occurs, an `SdkError` will be returned with additional details that + /// can be matched against. + /// + /// By default, any retryable failures will be retried twice. Retry behavior + /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be + /// set when configuring the client. + pub async fn send( + self, + ) -> ::std::result::Result< + crate::operation::get_search_job::GetSearchJobOutput, + ::aws_smithy_runtime_api::client::result::SdkError< + crate::operation::get_search_job::GetSearchJobError, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >, + > { + let input = self + .inner + .build() + .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?; + let runtime_plugins = crate::operation::get_search_job::GetSearchJob::operation_runtime_plugins( + self.handle.runtime_plugins.clone(), + &self.handle.conf, + self.config_override, + ); + crate::operation::get_search_job::GetSearchJob::orchestrate(&runtime_plugins, input).await + } + + /// Consumes this builder, creating a customizable operation that can be modified before being sent. + pub fn customize( + self, + ) -> crate::client::customize::CustomizableOperation< + crate::operation::get_search_job::GetSearchJobOutput, + crate::operation::get_search_job::GetSearchJobError, + Self, + > { + crate::client::customize::CustomizableOperation::new(self) + } + pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into) -> Self { + self.set_config_override(::std::option::Option::Some(config_override.into())); + self + } + + pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option) -> &mut Self { + self.config_override = config_override; + self + } + ///

Required unique string that specifies the search job.

+ pub fn search_job_identifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.inner = self.inner.search_job_identifier(input.into()); + self + } + ///

Required unique string that specifies the search job.

+ pub fn set_search_job_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.inner = self.inner.set_search_job_identifier(input); + self + } + ///

Required unique string that specifies the search job.

+ pub fn get_search_job_identifier(&self) -> &::std::option::Option<::std::string::String> { + self.inner.get_search_job_identifier() + } +} diff --git a/sdk/backupsearch/src/operation/get_search_result_export_job.rs b/sdk/backupsearch/src/operation/get_search_result_export_job.rs new file mode 100644 index 000000000000..a4de45a1c743 --- /dev/null +++ b/sdk/backupsearch/src/operation/get_search_result_export_job.rs @@ -0,0 +1,416 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +/// Orchestration and serialization glue logic for `GetSearchResultExportJob`. +#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)] +#[non_exhaustive] +pub struct GetSearchResultExportJob; +impl GetSearchResultExportJob { + /// Creates a new `GetSearchResultExportJob` + pub fn new() -> Self { + Self + } + pub(crate) async fn orchestrate( + runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, + input: crate::operation::get_search_result_export_job::GetSearchResultExportJobInput, + ) -> ::std::result::Result< + crate::operation::get_search_result_export_job::GetSearchResultExportJobOutput, + ::aws_smithy_runtime_api::client::result::SdkError< + crate::operation::get_search_result_export_job::GetSearchResultExportJobError, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >, + > { + let map_err = |err: ::aws_smithy_runtime_api::client::result::SdkError< + ::aws_smithy_runtime_api::client::interceptors::context::Error, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >| { + err.map_service_error(|err| { + err.downcast::() + .expect("correct error type") + }) + }; + let context = Self::orchestrate_with_stop_point(runtime_plugins, input, ::aws_smithy_runtime::client::orchestrator::StopPoint::None) + .await + .map_err(map_err)?; + let output = context.finalize().map_err(map_err)?; + ::std::result::Result::Ok( + output + .downcast::() + .expect("correct output type"), + ) + } + + pub(crate) async fn orchestrate_with_stop_point( + runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, + input: crate::operation::get_search_result_export_job::GetSearchResultExportJobInput, + stop_point: ::aws_smithy_runtime::client::orchestrator::StopPoint, + ) -> ::std::result::Result< + ::aws_smithy_runtime_api::client::interceptors::context::InterceptorContext, + ::aws_smithy_runtime_api::client::result::SdkError< + ::aws_smithy_runtime_api::client::interceptors::context::Error, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >, + > { + let input = ::aws_smithy_runtime_api::client::interceptors::context::Input::erase(input); + ::aws_smithy_runtime::client::orchestrator::invoke_with_stop_point( + "backupsearch", + "GetSearchResultExportJob", + input, + runtime_plugins, + stop_point, + ) + .await + } + + pub(crate) fn operation_runtime_plugins( + client_runtime_plugins: ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, + client_config: &crate::config::Config, + config_override: ::std::option::Option, + ) -> ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins { + let mut runtime_plugins = client_runtime_plugins.with_operation_plugin(Self::new()); + runtime_plugins = runtime_plugins.with_client_plugin(crate::auth_plugin::DefaultAuthOptionsPlugin::new(vec![ + ::aws_runtime::auth::sigv4::SCHEME_ID, + ])); + if let ::std::option::Option::Some(config_override) = config_override { + for plugin in config_override.runtime_plugins.iter().cloned() { + runtime_plugins = runtime_plugins.with_operation_plugin(plugin); + } + runtime_plugins = runtime_plugins.with_operation_plugin(crate::config::ConfigOverrideRuntimePlugin::new( + config_override, + client_config.config.clone(), + &client_config.runtime_components, + )); + } + runtime_plugins + } +} +impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for GetSearchResultExportJob { + fn config(&self) -> ::std::option::Option<::aws_smithy_types::config_bag::FrozenLayer> { + let mut cfg = ::aws_smithy_types::config_bag::Layer::new("GetSearchResultExportJob"); + + cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new( + GetSearchResultExportJobRequestSerializer, + )); + cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new( + GetSearchResultExportJobResponseDeserializer, + )); + + cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new( + ::aws_smithy_runtime_api::client::auth::static_resolver::StaticAuthSchemeOptionResolverParams::new(), + )); + + cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::Metadata::new( + "GetSearchResultExportJob", + "backupsearch", + )); + let mut signing_options = ::aws_runtime::auth::SigningOptions::default(); + signing_options.double_uri_encode = true; + signing_options.content_sha256_header = false; + signing_options.normalize_uri_path = true; + signing_options.payload_override = None; + + cfg.store_put(::aws_runtime::auth::SigV4OperationSigningConfig { + signing_options, + ..::std::default::Default::default() + }); + + ::std::option::Option::Some(cfg.freeze()) + } + + fn runtime_components( + &self, + _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder, + ) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> { + #[allow(unused_mut)] + let mut rcb = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("GetSearchResultExportJob") + .with_interceptor(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default()) + .with_interceptor(GetSearchResultExportJobEndpointParamsInterceptor) + .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::< + crate::operation::get_search_result_export_job::GetSearchResultExportJobError, + >::new()) + .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::< + crate::operation::get_search_result_export_job::GetSearchResultExportJobError, + >::new()) + .with_retry_classifier(::aws_runtime::retries::classifiers::AwsErrorCodeClassifier::< + crate::operation::get_search_result_export_job::GetSearchResultExportJobError, + >::new()); + + ::std::borrow::Cow::Owned(rcb) + } +} + +#[derive(Debug)] +struct GetSearchResultExportJobResponseDeserializer; +impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for GetSearchResultExportJobResponseDeserializer { + fn deserialize_nonstreaming( + &self, + response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError { + let (success, status) = (response.status().is_success(), response.status().as_u16()); + let headers = response.headers(); + let body = response.body().bytes().expect("body loaded"); + #[allow(unused_mut)] + let mut force_error = false; + ::tracing::debug!(request_id = ?::aws_types::request_id::RequestId::request_id(response)); + let parse_result = if !success && status != 200 || force_error { + crate::protocol_serde::shape_get_search_result_export_job::de_get_search_result_export_job_http_error(status, headers, body) + } else { + crate::protocol_serde::shape_get_search_result_export_job::de_get_search_result_export_job_http_response(status, headers, body) + }; + crate::protocol_serde::type_erase_result(parse_result) + } +} +#[derive(Debug)] +struct GetSearchResultExportJobRequestSerializer; +impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for GetSearchResultExportJobRequestSerializer { + #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)] + fn serialize_input( + &self, + input: ::aws_smithy_runtime_api::client::interceptors::context::Input, + _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag, + ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> { + let input = input + .downcast::() + .expect("correct type"); + let _header_serialization_settings = _cfg + .load::() + .cloned() + .unwrap_or_default(); + let mut request_builder = { + fn uri_base( + _input: &crate::operation::get_search_result_export_job::GetSearchResultExportJobInput, + output: &mut ::std::string::String, + ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> { + use ::std::fmt::Write as _; + let input_1 = &_input.export_job_identifier; + let input_1 = input_1.as_ref().ok_or_else(|| { + ::aws_smithy_types::error::operation::BuildError::missing_field("export_job_identifier", "cannot be empty or unset") + })?; + let export_job_identifier = ::aws_smithy_http::label::fmt_string(input_1, ::aws_smithy_http::label::EncodingStrategy::Default); + if export_job_identifier.is_empty() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "export_job_identifier", + "cannot be empty or unset", + )); + } + ::std::write!( + output, + "/export-search-jobs/{ExportJobIdentifier}", + ExportJobIdentifier = export_job_identifier + ) + .expect("formatting should succeed"); + ::std::result::Result::Ok(()) + } + #[allow(clippy::unnecessary_wraps)] + fn update_http_builder( + input: &crate::operation::get_search_result_export_job::GetSearchResultExportJobInput, + builder: ::http::request::Builder, + ) -> ::std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> { + let mut uri = ::std::string::String::new(); + uri_base(input, &mut uri)?; + ::std::result::Result::Ok(builder.method("GET").uri(uri)) + } + let mut builder = update_http_builder(&input, ::http::request::Builder::new())?; + builder + }; + let body = ::aws_smithy_types::body::SdkBody::from(""); + + ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap()) + } +} +#[derive(Debug)] +struct GetSearchResultExportJobEndpointParamsInterceptor; + +impl ::aws_smithy_runtime_api::client::interceptors::Intercept for GetSearchResultExportJobEndpointParamsInterceptor { + fn name(&self) -> &'static str { + "GetSearchResultExportJobEndpointParamsInterceptor" + } + + fn read_before_execution( + &self, + context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef< + '_, + ::aws_smithy_runtime_api::client::interceptors::context::Input, + ::aws_smithy_runtime_api::client::interceptors::context::Output, + ::aws_smithy_runtime_api::client::interceptors::context::Error, + >, + cfg: &mut ::aws_smithy_types::config_bag::ConfigBag, + ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> { + let _input = context + .input() + .downcast_ref::() + .ok_or("failed to downcast to GetSearchResultExportJobInput")?; + + let params = crate::config::endpoint::Params::builder() + .set_use_fips(cfg.load::<::aws_types::endpoint_config::UseFips>().map(|ty| ty.0)) + .set_endpoint(cfg.load::<::aws_types::endpoint_config::EndpointUrl>().map(|ty| ty.0.clone())) + .set_region(cfg.load::<::aws_types::region::Region>().map(|r| r.as_ref().to_owned())) + .build() + .map_err(|err| { + ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err) + })?; + cfg.interceptor_state() + .store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params)); + ::std::result::Result::Ok(()) + } +} + +// The get_* functions below are generated from JMESPath expressions in the +// operationContextParams trait. They target the operation's input shape. + +/// Error type for the `GetSearchResultExportJobError` operation. +#[non_exhaustive] +#[derive(::std::fmt::Debug)] +pub enum GetSearchResultExportJobError { + ///

The resource was not found for this request.

+ ///

Confirm the resource information, such as the ARN or type is correct and exists, then retry the request.

+ ResourceNotFoundException(crate::types::error::ResourceNotFoundException), + ///

You do not have sufficient access to perform this action.

+ AccessDeniedException(crate::types::error::AccessDeniedException), + ///

An internal server error occurred. Retry your request.

+ InternalServerException(crate::types::error::InternalServerException), + ///

The request was denied due to request throttling.

+ ThrottlingException(crate::types::error::ThrottlingException), + ///

The input fails to satisfy the constraints specified by a service.

+ ValidationException(crate::types::error::ValidationException), + /// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code). + #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \ + variable wildcard pattern and check `.code()`: + \ +    `err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }` + \ + See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-GetSearchResultExportJobError) for what information is available for the error.")] + Unhandled(crate::error::sealed_unhandled::Unhandled), +} +impl GetSearchResultExportJobError { + /// Creates the `GetSearchResultExportJobError::Unhandled` variant from any error type. + pub fn unhandled( + err: impl ::std::convert::Into<::std::boxed::Box>, + ) -> Self { + Self::Unhandled(crate::error::sealed_unhandled::Unhandled { + source: err.into(), + meta: ::std::default::Default::default(), + }) + } + + /// Creates the `GetSearchResultExportJobError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata). + pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self { + Self::Unhandled(crate::error::sealed_unhandled::Unhandled { + source: err.clone().into(), + meta: err, + }) + } + /// + /// Returns error metadata, which includes the error code, message, + /// request ID, and potentially additional information. + /// + pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata { + match self { + Self::ResourceNotFoundException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), + Self::AccessDeniedException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), + Self::InternalServerException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), + Self::ThrottlingException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), + Self::ValidationException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), + Self::Unhandled(e) => &e.meta, + } + } + /// Returns `true` if the error kind is `GetSearchResultExportJobError::ResourceNotFoundException`. + pub fn is_resource_not_found_exception(&self) -> bool { + matches!(self, Self::ResourceNotFoundException(_)) + } + /// Returns `true` if the error kind is `GetSearchResultExportJobError::AccessDeniedException`. + pub fn is_access_denied_exception(&self) -> bool { + matches!(self, Self::AccessDeniedException(_)) + } + /// Returns `true` if the error kind is `GetSearchResultExportJobError::InternalServerException`. + pub fn is_internal_server_exception(&self) -> bool { + matches!(self, Self::InternalServerException(_)) + } + /// Returns `true` if the error kind is `GetSearchResultExportJobError::ThrottlingException`. + pub fn is_throttling_exception(&self) -> bool { + matches!(self, Self::ThrottlingException(_)) + } + /// Returns `true` if the error kind is `GetSearchResultExportJobError::ValidationException`. + pub fn is_validation_exception(&self) -> bool { + matches!(self, Self::ValidationException(_)) + } +} +impl ::std::error::Error for GetSearchResultExportJobError { + fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> { + match self { + Self::ResourceNotFoundException(_inner) => ::std::option::Option::Some(_inner), + Self::AccessDeniedException(_inner) => ::std::option::Option::Some(_inner), + Self::InternalServerException(_inner) => ::std::option::Option::Some(_inner), + Self::ThrottlingException(_inner) => ::std::option::Option::Some(_inner), + Self::ValidationException(_inner) => ::std::option::Option::Some(_inner), + Self::Unhandled(_inner) => ::std::option::Option::Some(&*_inner.source), + } + } +} +impl ::std::fmt::Display for GetSearchResultExportJobError { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + match self { + Self::ResourceNotFoundException(_inner) => _inner.fmt(f), + Self::AccessDeniedException(_inner) => _inner.fmt(f), + Self::InternalServerException(_inner) => _inner.fmt(f), + Self::ThrottlingException(_inner) => _inner.fmt(f), + Self::ValidationException(_inner) => _inner.fmt(f), + Self::Unhandled(_inner) => { + if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) { + write!(f, "unhandled error ({code})") + } else { + f.write_str("unhandled error") + } + } + } + } +} +impl ::aws_smithy_types::retry::ProvideErrorKind for GetSearchResultExportJobError { + fn code(&self) -> ::std::option::Option<&str> { + ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) + } + fn retryable_error_kind(&self) -> ::std::option::Option<::aws_smithy_types::retry::ErrorKind> { + match self { + Self::InternalServerException(inner) => ::std::option::Option::Some(inner.retryable_error_kind()), + Self::ThrottlingException(inner) => ::std::option::Option::Some(inner.retryable_error_kind()), + _ => ::std::option::Option::None, + } + } +} +impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for GetSearchResultExportJobError { + fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata { + match self { + Self::ResourceNotFoundException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner), + Self::AccessDeniedException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner), + Self::InternalServerException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner), + Self::ThrottlingException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner), + Self::ValidationException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner), + Self::Unhandled(_inner) => &_inner.meta, + } + } +} +impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for GetSearchResultExportJobError { + fn create_unhandled_error( + source: ::std::boxed::Box, + meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>, + ) -> Self { + Self::Unhandled(crate::error::sealed_unhandled::Unhandled { + source, + meta: meta.unwrap_or_default(), + }) + } +} +impl ::aws_types::request_id::RequestId for crate::operation::get_search_result_export_job::GetSearchResultExportJobError { + fn request_id(&self) -> Option<&str> { + self.meta().request_id() + } +} + +pub use crate::operation::get_search_result_export_job::_get_search_result_export_job_output::GetSearchResultExportJobOutput; + +pub use crate::operation::get_search_result_export_job::_get_search_result_export_job_input::GetSearchResultExportJobInput; + +mod _get_search_result_export_job_input; + +mod _get_search_result_export_job_output; + +/// Builders +pub mod builders; diff --git a/sdk/backupsearch/src/operation/get_search_result_export_job/_get_search_result_export_job_input.rs b/sdk/backupsearch/src/operation/get_search_result_export_job/_get_search_result_export_job_input.rs new file mode 100644 index 000000000000..3492c7f530bc --- /dev/null +++ b/sdk/backupsearch/src/operation/get_search_result_export_job/_get_search_result_export_job_input.rs @@ -0,0 +1,60 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +#[allow(missing_docs)] // documentation missing in model +#[non_exhaustive] +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)] +pub struct GetSearchResultExportJobInput { + ///

This is the unique string that identifies a specific export job.

+ ///

Required for this operation.

+ pub export_job_identifier: ::std::option::Option<::std::string::String>, +} +impl GetSearchResultExportJobInput { + ///

This is the unique string that identifies a specific export job.

+ ///

Required for this operation.

+ pub fn export_job_identifier(&self) -> ::std::option::Option<&str> { + self.export_job_identifier.as_deref() + } +} +impl GetSearchResultExportJobInput { + /// Creates a new builder-style object to manufacture [`GetSearchResultExportJobInput`](crate::operation::get_search_result_export_job::GetSearchResultExportJobInput). + pub fn builder() -> crate::operation::get_search_result_export_job::builders::GetSearchResultExportJobInputBuilder { + crate::operation::get_search_result_export_job::builders::GetSearchResultExportJobInputBuilder::default() + } +} + +/// A builder for [`GetSearchResultExportJobInput`](crate::operation::get_search_result_export_job::GetSearchResultExportJobInput). +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)] +#[non_exhaustive] +pub struct GetSearchResultExportJobInputBuilder { + pub(crate) export_job_identifier: ::std::option::Option<::std::string::String>, +} +impl GetSearchResultExportJobInputBuilder { + ///

This is the unique string that identifies a specific export job.

+ ///

Required for this operation.

+ /// This field is required. + pub fn export_job_identifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.export_job_identifier = ::std::option::Option::Some(input.into()); + self + } + ///

This is the unique string that identifies a specific export job.

+ ///

Required for this operation.

+ pub fn set_export_job_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.export_job_identifier = input; + self + } + ///

This is the unique string that identifies a specific export job.

+ ///

Required for this operation.

+ pub fn get_export_job_identifier(&self) -> &::std::option::Option<::std::string::String> { + &self.export_job_identifier + } + /// Consumes the builder and constructs a [`GetSearchResultExportJobInput`](crate::operation::get_search_result_export_job::GetSearchResultExportJobInput). + pub fn build( + self, + ) -> ::std::result::Result< + crate::operation::get_search_result_export_job::GetSearchResultExportJobInput, + ::aws_smithy_types::error::operation::BuildError, + > { + ::std::result::Result::Ok(crate::operation::get_search_result_export_job::GetSearchResultExportJobInput { + export_job_identifier: self.export_job_identifier, + }) + } +} diff --git a/sdk/backupsearch/src/operation/get_search_result_export_job/_get_search_result_export_job_output.rs b/sdk/backupsearch/src/operation/get_search_result_export_job/_get_search_result_export_job_output.rs new file mode 100644 index 000000000000..5c4575c144bf --- /dev/null +++ b/sdk/backupsearch/src/operation/get_search_result_export_job/_get_search_result_export_job_output.rs @@ -0,0 +1,234 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +#[allow(missing_docs)] // documentation missing in model +#[non_exhaustive] +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)] +pub struct GetSearchResultExportJobOutput { + ///

This is the unique string that identifies the specified export job.

+ pub export_job_identifier: ::std::string::String, + ///

The unique Amazon Resource Name (ARN) that uniquely identifies the export job.

+ pub export_job_arn: ::std::option::Option<::std::string::String>, + ///

This is the current status of the export job.

+ pub status: ::std::option::Option, + ///

The date and time that an export job was created, in Unix format and Coordinated Universal Time (UTC). The value of CreationTime is accurate to milliseconds. For example, the value 1516925490.087 represents Friday, January 26, 2018 12:11:30.087 AM.

+ pub creation_time: ::std::option::Option<::aws_smithy_types::DateTime>, + ///

The date and time that an export job completed, in Unix format and Coordinated Universal Time (UTC). The value of CreationTime is accurate to milliseconds. For example, the value 1516925490.087 represents Friday, January 26, 2018 12:11:30.087 AM.

+ pub completion_time: ::std::option::Option<::aws_smithy_types::DateTime>, + ///

A status message is a string that is returned for search job with a status of FAILED, along with steps to remedy and retry the operation.

+ pub status_message: ::std::option::Option<::std::string::String>, + ///

The export specification consists of the destination S3 bucket to which the search results were exported, along with the destination prefix.

+ pub export_specification: ::std::option::Option, + ///

The unique string that identifies the Amazon Resource Name (ARN) of the specified search job.

+ pub search_job_arn: ::std::option::Option<::std::string::String>, + _request_id: Option, +} +impl GetSearchResultExportJobOutput { + ///

This is the unique string that identifies the specified export job.

+ pub fn export_job_identifier(&self) -> &str { + use std::ops::Deref; + self.export_job_identifier.deref() + } + ///

The unique Amazon Resource Name (ARN) that uniquely identifies the export job.

+ pub fn export_job_arn(&self) -> ::std::option::Option<&str> { + self.export_job_arn.as_deref() + } + ///

This is the current status of the export job.

+ pub fn status(&self) -> ::std::option::Option<&crate::types::ExportJobStatus> { + self.status.as_ref() + } + ///

The date and time that an export job was created, in Unix format and Coordinated Universal Time (UTC). The value of CreationTime is accurate to milliseconds. For example, the value 1516925490.087 represents Friday, January 26, 2018 12:11:30.087 AM.

+ pub fn creation_time(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> { + self.creation_time.as_ref() + } + ///

The date and time that an export job completed, in Unix format and Coordinated Universal Time (UTC). The value of CreationTime is accurate to milliseconds. For example, the value 1516925490.087 represents Friday, January 26, 2018 12:11:30.087 AM.

+ pub fn completion_time(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> { + self.completion_time.as_ref() + } + ///

A status message is a string that is returned for search job with a status of FAILED, along with steps to remedy and retry the operation.

+ pub fn status_message(&self) -> ::std::option::Option<&str> { + self.status_message.as_deref() + } + ///

The export specification consists of the destination S3 bucket to which the search results were exported, along with the destination prefix.

+ pub fn export_specification(&self) -> ::std::option::Option<&crate::types::ExportSpecification> { + self.export_specification.as_ref() + } + ///

The unique string that identifies the Amazon Resource Name (ARN) of the specified search job.

+ pub fn search_job_arn(&self) -> ::std::option::Option<&str> { + self.search_job_arn.as_deref() + } +} +impl ::aws_types::request_id::RequestId for GetSearchResultExportJobOutput { + fn request_id(&self) -> Option<&str> { + self._request_id.as_deref() + } +} +impl GetSearchResultExportJobOutput { + /// Creates a new builder-style object to manufacture [`GetSearchResultExportJobOutput`](crate::operation::get_search_result_export_job::GetSearchResultExportJobOutput). + pub fn builder() -> crate::operation::get_search_result_export_job::builders::GetSearchResultExportJobOutputBuilder { + crate::operation::get_search_result_export_job::builders::GetSearchResultExportJobOutputBuilder::default() + } +} + +/// A builder for [`GetSearchResultExportJobOutput`](crate::operation::get_search_result_export_job::GetSearchResultExportJobOutput). +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)] +#[non_exhaustive] +pub struct GetSearchResultExportJobOutputBuilder { + pub(crate) export_job_identifier: ::std::option::Option<::std::string::String>, + pub(crate) export_job_arn: ::std::option::Option<::std::string::String>, + pub(crate) status: ::std::option::Option, + pub(crate) creation_time: ::std::option::Option<::aws_smithy_types::DateTime>, + pub(crate) completion_time: ::std::option::Option<::aws_smithy_types::DateTime>, + pub(crate) status_message: ::std::option::Option<::std::string::String>, + pub(crate) export_specification: ::std::option::Option, + pub(crate) search_job_arn: ::std::option::Option<::std::string::String>, + _request_id: Option, +} +impl GetSearchResultExportJobOutputBuilder { + ///

This is the unique string that identifies the specified export job.

+ /// This field is required. + pub fn export_job_identifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.export_job_identifier = ::std::option::Option::Some(input.into()); + self + } + ///

This is the unique string that identifies the specified export job.

+ pub fn set_export_job_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.export_job_identifier = input; + self + } + ///

This is the unique string that identifies the specified export job.

+ pub fn get_export_job_identifier(&self) -> &::std::option::Option<::std::string::String> { + &self.export_job_identifier + } + ///

The unique Amazon Resource Name (ARN) that uniquely identifies the export job.

+ pub fn export_job_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.export_job_arn = ::std::option::Option::Some(input.into()); + self + } + ///

The unique Amazon Resource Name (ARN) that uniquely identifies the export job.

+ pub fn set_export_job_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.export_job_arn = input; + self + } + ///

The unique Amazon Resource Name (ARN) that uniquely identifies the export job.

+ pub fn get_export_job_arn(&self) -> &::std::option::Option<::std::string::String> { + &self.export_job_arn + } + ///

This is the current status of the export job.

+ pub fn status(mut self, input: crate::types::ExportJobStatus) -> Self { + self.status = ::std::option::Option::Some(input); + self + } + ///

This is the current status of the export job.

+ pub fn set_status(mut self, input: ::std::option::Option) -> Self { + self.status = input; + self + } + ///

This is the current status of the export job.

+ pub fn get_status(&self) -> &::std::option::Option { + &self.status + } + ///

The date and time that an export job was created, in Unix format and Coordinated Universal Time (UTC). The value of CreationTime is accurate to milliseconds. For example, the value 1516925490.087 represents Friday, January 26, 2018 12:11:30.087 AM.

+ pub fn creation_time(mut self, input: ::aws_smithy_types::DateTime) -> Self { + self.creation_time = ::std::option::Option::Some(input); + self + } + ///

The date and time that an export job was created, in Unix format and Coordinated Universal Time (UTC). The value of CreationTime is accurate to milliseconds. For example, the value 1516925490.087 represents Friday, January 26, 2018 12:11:30.087 AM.

+ pub fn set_creation_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self { + self.creation_time = input; + self + } + ///

The date and time that an export job was created, in Unix format and Coordinated Universal Time (UTC). The value of CreationTime is accurate to milliseconds. For example, the value 1516925490.087 represents Friday, January 26, 2018 12:11:30.087 AM.

+ pub fn get_creation_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> { + &self.creation_time + } + ///

The date and time that an export job completed, in Unix format and Coordinated Universal Time (UTC). The value of CreationTime is accurate to milliseconds. For example, the value 1516925490.087 represents Friday, January 26, 2018 12:11:30.087 AM.

+ pub fn completion_time(mut self, input: ::aws_smithy_types::DateTime) -> Self { + self.completion_time = ::std::option::Option::Some(input); + self + } + ///

The date and time that an export job completed, in Unix format and Coordinated Universal Time (UTC). The value of CreationTime is accurate to milliseconds. For example, the value 1516925490.087 represents Friday, January 26, 2018 12:11:30.087 AM.

+ pub fn set_completion_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self { + self.completion_time = input; + self + } + ///

The date and time that an export job completed, in Unix format and Coordinated Universal Time (UTC). The value of CreationTime is accurate to milliseconds. For example, the value 1516925490.087 represents Friday, January 26, 2018 12:11:30.087 AM.

+ pub fn get_completion_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> { + &self.completion_time + } + ///

A status message is a string that is returned for search job with a status of FAILED, along with steps to remedy and retry the operation.

+ pub fn status_message(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.status_message = ::std::option::Option::Some(input.into()); + self + } + ///

A status message is a string that is returned for search job with a status of FAILED, along with steps to remedy and retry the operation.

+ pub fn set_status_message(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.status_message = input; + self + } + ///

A status message is a string that is returned for search job with a status of FAILED, along with steps to remedy and retry the operation.

+ pub fn get_status_message(&self) -> &::std::option::Option<::std::string::String> { + &self.status_message + } + ///

The export specification consists of the destination S3 bucket to which the search results were exported, along with the destination prefix.

+ pub fn export_specification(mut self, input: crate::types::ExportSpecification) -> Self { + self.export_specification = ::std::option::Option::Some(input); + self + } + ///

The export specification consists of the destination S3 bucket to which the search results were exported, along with the destination prefix.

+ pub fn set_export_specification(mut self, input: ::std::option::Option) -> Self { + self.export_specification = input; + self + } + ///

The export specification consists of the destination S3 bucket to which the search results were exported, along with the destination prefix.

+ pub fn get_export_specification(&self) -> &::std::option::Option { + &self.export_specification + } + ///

The unique string that identifies the Amazon Resource Name (ARN) of the specified search job.

+ pub fn search_job_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.search_job_arn = ::std::option::Option::Some(input.into()); + self + } + ///

The unique string that identifies the Amazon Resource Name (ARN) of the specified search job.

+ pub fn set_search_job_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.search_job_arn = input; + self + } + ///

The unique string that identifies the Amazon Resource Name (ARN) of the specified search job.

+ pub fn get_search_job_arn(&self) -> &::std::option::Option<::std::string::String> { + &self.search_job_arn + } + pub(crate) fn _request_id(mut self, request_id: impl Into) -> Self { + self._request_id = Some(request_id.into()); + self + } + + pub(crate) fn _set_request_id(&mut self, request_id: Option) -> &mut Self { + self._request_id = request_id; + self + } + /// Consumes the builder and constructs a [`GetSearchResultExportJobOutput`](crate::operation::get_search_result_export_job::GetSearchResultExportJobOutput). + /// This method will fail if any of the following fields are not set: + /// - [`export_job_identifier`](crate::operation::get_search_result_export_job::builders::GetSearchResultExportJobOutputBuilder::export_job_identifier) + pub fn build( + self, + ) -> ::std::result::Result< + crate::operation::get_search_result_export_job::GetSearchResultExportJobOutput, + ::aws_smithy_types::error::operation::BuildError, + > { + ::std::result::Result::Ok(crate::operation::get_search_result_export_job::GetSearchResultExportJobOutput { + export_job_identifier: self.export_job_identifier.ok_or_else(|| { + ::aws_smithy_types::error::operation::BuildError::missing_field( + "export_job_identifier", + "export_job_identifier was not specified but it is required when building GetSearchResultExportJobOutput", + ) + })?, + export_job_arn: self.export_job_arn, + status: self.status, + creation_time: self.creation_time, + completion_time: self.completion_time, + status_message: self.status_message, + export_specification: self.export_specification, + search_job_arn: self.search_job_arn, + _request_id: self._request_id, + }) + } +} diff --git a/sdk/backupsearch/src/operation/get_search_result_export_job/builders.rs b/sdk/backupsearch/src/operation/get_search_result_export_job/builders.rs new file mode 100644 index 000000000000..28c2f60c9398 --- /dev/null +++ b/sdk/backupsearch/src/operation/get_search_result_export_job/builders.rs @@ -0,0 +1,130 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +pub use crate::operation::get_search_result_export_job::_get_search_result_export_job_output::GetSearchResultExportJobOutputBuilder; + +pub use crate::operation::get_search_result_export_job::_get_search_result_export_job_input::GetSearchResultExportJobInputBuilder; + +impl crate::operation::get_search_result_export_job::builders::GetSearchResultExportJobInputBuilder { + /// Sends a request with this input using the given client. + pub async fn send_with( + self, + client: &crate::Client, + ) -> ::std::result::Result< + crate::operation::get_search_result_export_job::GetSearchResultExportJobOutput, + ::aws_smithy_runtime_api::client::result::SdkError< + crate::operation::get_search_result_export_job::GetSearchResultExportJobError, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >, + > { + let mut fluent_builder = client.get_search_result_export_job(); + fluent_builder.inner = self; + fluent_builder.send().await + } +} +/// Fluent builder constructing a request to `GetSearchResultExportJob`. +/// +///

This operation retrieves the metadata of an export job.

+///

An export job is an operation that transmits the results of a search job to a specified S3 bucket in a .csv file.

+///

An export job allows you to retain results of a search beyond the search job's scheduled retention of 7 days.

+#[derive(::std::clone::Clone, ::std::fmt::Debug)] +pub struct GetSearchResultExportJobFluentBuilder { + handle: ::std::sync::Arc, + inner: crate::operation::get_search_result_export_job::builders::GetSearchResultExportJobInputBuilder, + config_override: ::std::option::Option, +} +impl + crate::client::customize::internal::CustomizableSend< + crate::operation::get_search_result_export_job::GetSearchResultExportJobOutput, + crate::operation::get_search_result_export_job::GetSearchResultExportJobError, + > for GetSearchResultExportJobFluentBuilder +{ + fn send( + self, + config_override: crate::config::Builder, + ) -> crate::client::customize::internal::BoxFuture< + crate::client::customize::internal::SendResult< + crate::operation::get_search_result_export_job::GetSearchResultExportJobOutput, + crate::operation::get_search_result_export_job::GetSearchResultExportJobError, + >, + > { + ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await }) + } +} +impl GetSearchResultExportJobFluentBuilder { + /// Creates a new `GetSearchResultExportJobFluentBuilder`. + pub(crate) fn new(handle: ::std::sync::Arc) -> Self { + Self { + handle, + inner: ::std::default::Default::default(), + config_override: ::std::option::Option::None, + } + } + /// Access the GetSearchResultExportJob as a reference. + pub fn as_input(&self) -> &crate::operation::get_search_result_export_job::builders::GetSearchResultExportJobInputBuilder { + &self.inner + } + /// Sends the request and returns the response. + /// + /// If an error occurs, an `SdkError` will be returned with additional details that + /// can be matched against. + /// + /// By default, any retryable failures will be retried twice. Retry behavior + /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be + /// set when configuring the client. + pub async fn send( + self, + ) -> ::std::result::Result< + crate::operation::get_search_result_export_job::GetSearchResultExportJobOutput, + ::aws_smithy_runtime_api::client::result::SdkError< + crate::operation::get_search_result_export_job::GetSearchResultExportJobError, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >, + > { + let input = self + .inner + .build() + .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?; + let runtime_plugins = crate::operation::get_search_result_export_job::GetSearchResultExportJob::operation_runtime_plugins( + self.handle.runtime_plugins.clone(), + &self.handle.conf, + self.config_override, + ); + crate::operation::get_search_result_export_job::GetSearchResultExportJob::orchestrate(&runtime_plugins, input).await + } + + /// Consumes this builder, creating a customizable operation that can be modified before being sent. + pub fn customize( + self, + ) -> crate::client::customize::CustomizableOperation< + crate::operation::get_search_result_export_job::GetSearchResultExportJobOutput, + crate::operation::get_search_result_export_job::GetSearchResultExportJobError, + Self, + > { + crate::client::customize::CustomizableOperation::new(self) + } + pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into) -> Self { + self.set_config_override(::std::option::Option::Some(config_override.into())); + self + } + + pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option) -> &mut Self { + self.config_override = config_override; + self + } + ///

This is the unique string that identifies a specific export job.

+ ///

Required for this operation.

+ pub fn export_job_identifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.inner = self.inner.export_job_identifier(input.into()); + self + } + ///

This is the unique string that identifies a specific export job.

+ ///

Required for this operation.

+ pub fn set_export_job_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.inner = self.inner.set_export_job_identifier(input); + self + } + ///

This is the unique string that identifies a specific export job.

+ ///

Required for this operation.

+ pub fn get_export_job_identifier(&self) -> &::std::option::Option<::std::string::String> { + self.inner.get_export_job_identifier() + } +} diff --git a/sdk/backupsearch/src/operation/list_search_job_backups.rs b/sdk/backupsearch/src/operation/list_search_job_backups.rs new file mode 100644 index 000000000000..45c066ed0a99 --- /dev/null +++ b/sdk/backupsearch/src/operation/list_search_job_backups.rs @@ -0,0 +1,431 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +/// Orchestration and serialization glue logic for `ListSearchJobBackups`. +#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)] +#[non_exhaustive] +pub struct ListSearchJobBackups; +impl ListSearchJobBackups { + /// Creates a new `ListSearchJobBackups` + pub fn new() -> Self { + Self + } + pub(crate) async fn orchestrate( + runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, + input: crate::operation::list_search_job_backups::ListSearchJobBackupsInput, + ) -> ::std::result::Result< + crate::operation::list_search_job_backups::ListSearchJobBackupsOutput, + ::aws_smithy_runtime_api::client::result::SdkError< + crate::operation::list_search_job_backups::ListSearchJobBackupsError, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >, + > { + let map_err = |err: ::aws_smithy_runtime_api::client::result::SdkError< + ::aws_smithy_runtime_api::client::interceptors::context::Error, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >| { + err.map_service_error(|err| { + err.downcast::() + .expect("correct error type") + }) + }; + let context = Self::orchestrate_with_stop_point(runtime_plugins, input, ::aws_smithy_runtime::client::orchestrator::StopPoint::None) + .await + .map_err(map_err)?; + let output = context.finalize().map_err(map_err)?; + ::std::result::Result::Ok( + output + .downcast::() + .expect("correct output type"), + ) + } + + pub(crate) async fn orchestrate_with_stop_point( + runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, + input: crate::operation::list_search_job_backups::ListSearchJobBackupsInput, + stop_point: ::aws_smithy_runtime::client::orchestrator::StopPoint, + ) -> ::std::result::Result< + ::aws_smithy_runtime_api::client::interceptors::context::InterceptorContext, + ::aws_smithy_runtime_api::client::result::SdkError< + ::aws_smithy_runtime_api::client::interceptors::context::Error, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >, + > { + let input = ::aws_smithy_runtime_api::client::interceptors::context::Input::erase(input); + ::aws_smithy_runtime::client::orchestrator::invoke_with_stop_point("backupsearch", "ListSearchJobBackups", input, runtime_plugins, stop_point) + .await + } + + pub(crate) fn operation_runtime_plugins( + client_runtime_plugins: ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, + client_config: &crate::config::Config, + config_override: ::std::option::Option, + ) -> ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins { + let mut runtime_plugins = client_runtime_plugins.with_operation_plugin(Self::new()); + runtime_plugins = runtime_plugins.with_client_plugin(crate::auth_plugin::DefaultAuthOptionsPlugin::new(vec![ + ::aws_runtime::auth::sigv4::SCHEME_ID, + ])); + if let ::std::option::Option::Some(config_override) = config_override { + for plugin in config_override.runtime_plugins.iter().cloned() { + runtime_plugins = runtime_plugins.with_operation_plugin(plugin); + } + runtime_plugins = runtime_plugins.with_operation_plugin(crate::config::ConfigOverrideRuntimePlugin::new( + config_override, + client_config.config.clone(), + &client_config.runtime_components, + )); + } + runtime_plugins + } +} +impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for ListSearchJobBackups { + fn config(&self) -> ::std::option::Option<::aws_smithy_types::config_bag::FrozenLayer> { + let mut cfg = ::aws_smithy_types::config_bag::Layer::new("ListSearchJobBackups"); + + cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new( + ListSearchJobBackupsRequestSerializer, + )); + cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new( + ListSearchJobBackupsResponseDeserializer, + )); + + cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new( + ::aws_smithy_runtime_api::client::auth::static_resolver::StaticAuthSchemeOptionResolverParams::new(), + )); + + cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::Metadata::new( + "ListSearchJobBackups", + "backupsearch", + )); + let mut signing_options = ::aws_runtime::auth::SigningOptions::default(); + signing_options.double_uri_encode = true; + signing_options.content_sha256_header = false; + signing_options.normalize_uri_path = true; + signing_options.payload_override = None; + + cfg.store_put(::aws_runtime::auth::SigV4OperationSigningConfig { + signing_options, + ..::std::default::Default::default() + }); + + ::std::option::Option::Some(cfg.freeze()) + } + + fn runtime_components( + &self, + _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder, + ) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> { + #[allow(unused_mut)] + let mut rcb = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("ListSearchJobBackups") + .with_interceptor(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default()) + .with_interceptor(ListSearchJobBackupsEndpointParamsInterceptor) + .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::< + crate::operation::list_search_job_backups::ListSearchJobBackupsError, + >::new()) + .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::< + crate::operation::list_search_job_backups::ListSearchJobBackupsError, + >::new()) + .with_retry_classifier(::aws_runtime::retries::classifiers::AwsErrorCodeClassifier::< + crate::operation::list_search_job_backups::ListSearchJobBackupsError, + >::new()); + + ::std::borrow::Cow::Owned(rcb) + } +} + +#[derive(Debug)] +struct ListSearchJobBackupsResponseDeserializer; +impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for ListSearchJobBackupsResponseDeserializer { + fn deserialize_nonstreaming( + &self, + response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError { + let (success, status) = (response.status().is_success(), response.status().as_u16()); + let headers = response.headers(); + let body = response.body().bytes().expect("body loaded"); + #[allow(unused_mut)] + let mut force_error = false; + ::tracing::debug!(request_id = ?::aws_types::request_id::RequestId::request_id(response)); + let parse_result = if !success && status != 200 || force_error { + crate::protocol_serde::shape_list_search_job_backups::de_list_search_job_backups_http_error(status, headers, body) + } else { + crate::protocol_serde::shape_list_search_job_backups::de_list_search_job_backups_http_response(status, headers, body) + }; + crate::protocol_serde::type_erase_result(parse_result) + } +} +#[derive(Debug)] +struct ListSearchJobBackupsRequestSerializer; +impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for ListSearchJobBackupsRequestSerializer { + #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)] + fn serialize_input( + &self, + input: ::aws_smithy_runtime_api::client::interceptors::context::Input, + _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag, + ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> { + let input = input + .downcast::() + .expect("correct type"); + let _header_serialization_settings = _cfg + .load::() + .cloned() + .unwrap_or_default(); + let mut request_builder = { + fn uri_base( + _input: &crate::operation::list_search_job_backups::ListSearchJobBackupsInput, + output: &mut ::std::string::String, + ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> { + use ::std::fmt::Write as _; + let input_1 = &_input.search_job_identifier; + let input_1 = input_1.as_ref().ok_or_else(|| { + ::aws_smithy_types::error::operation::BuildError::missing_field("search_job_identifier", "cannot be empty or unset") + })?; + let search_job_identifier = ::aws_smithy_http::label::fmt_string(input_1, ::aws_smithy_http::label::EncodingStrategy::Default); + if search_job_identifier.is_empty() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "search_job_identifier", + "cannot be empty or unset", + )); + } + ::std::write!( + output, + "/search-jobs/{SearchJobIdentifier}/backups", + SearchJobIdentifier = search_job_identifier + ) + .expect("formatting should succeed"); + ::std::result::Result::Ok(()) + } + fn uri_query( + _input: &crate::operation::list_search_job_backups::ListSearchJobBackupsInput, + mut output: &mut ::std::string::String, + ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> { + let mut query = ::aws_smithy_http::query::Writer::new(output); + if let ::std::option::Option::Some(inner_2) = &_input.next_token { + { + query.push_kv("nextToken", &::aws_smithy_http::query::fmt_string(inner_2)); + } + } + if let ::std::option::Option::Some(inner_3) = &_input.max_results { + { + query.push_kv("maxResults", ::aws_smithy_types::primitive::Encoder::from(*inner_3).encode()); + } + } + ::std::result::Result::Ok(()) + } + #[allow(clippy::unnecessary_wraps)] + fn update_http_builder( + input: &crate::operation::list_search_job_backups::ListSearchJobBackupsInput, + builder: ::http::request::Builder, + ) -> ::std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> { + let mut uri = ::std::string::String::new(); + uri_base(input, &mut uri)?; + uri_query(input, &mut uri)?; + ::std::result::Result::Ok(builder.method("GET").uri(uri)) + } + let mut builder = update_http_builder(&input, ::http::request::Builder::new())?; + builder + }; + let body = ::aws_smithy_types::body::SdkBody::from(""); + + ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap()) + } +} +#[derive(Debug)] +struct ListSearchJobBackupsEndpointParamsInterceptor; + +impl ::aws_smithy_runtime_api::client::interceptors::Intercept for ListSearchJobBackupsEndpointParamsInterceptor { + fn name(&self) -> &'static str { + "ListSearchJobBackupsEndpointParamsInterceptor" + } + + fn read_before_execution( + &self, + context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef< + '_, + ::aws_smithy_runtime_api::client::interceptors::context::Input, + ::aws_smithy_runtime_api::client::interceptors::context::Output, + ::aws_smithy_runtime_api::client::interceptors::context::Error, + >, + cfg: &mut ::aws_smithy_types::config_bag::ConfigBag, + ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> { + let _input = context + .input() + .downcast_ref::() + .ok_or("failed to downcast to ListSearchJobBackupsInput")?; + + let params = crate::config::endpoint::Params::builder() + .set_use_fips(cfg.load::<::aws_types::endpoint_config::UseFips>().map(|ty| ty.0)) + .set_endpoint(cfg.load::<::aws_types::endpoint_config::EndpointUrl>().map(|ty| ty.0.clone())) + .set_region(cfg.load::<::aws_types::region::Region>().map(|r| r.as_ref().to_owned())) + .build() + .map_err(|err| { + ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err) + })?; + cfg.interceptor_state() + .store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params)); + ::std::result::Result::Ok(()) + } +} + +// The get_* functions below are generated from JMESPath expressions in the +// operationContextParams trait. They target the operation's input shape. + +/// Error type for the `ListSearchJobBackupsError` operation. +#[non_exhaustive] +#[derive(::std::fmt::Debug)] +pub enum ListSearchJobBackupsError { + ///

The resource was not found for this request.

+ ///

Confirm the resource information, such as the ARN or type is correct and exists, then retry the request.

+ ResourceNotFoundException(crate::types::error::ResourceNotFoundException), + ///

You do not have sufficient access to perform this action.

+ AccessDeniedException(crate::types::error::AccessDeniedException), + ///

An internal server error occurred. Retry your request.

+ InternalServerException(crate::types::error::InternalServerException), + ///

The request was denied due to request throttling.

+ ThrottlingException(crate::types::error::ThrottlingException), + ///

The input fails to satisfy the constraints specified by a service.

+ ValidationException(crate::types::error::ValidationException), + /// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code). + #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \ + variable wildcard pattern and check `.code()`: + \ +    `err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }` + \ + See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-ListSearchJobBackupsError) for what information is available for the error.")] + Unhandled(crate::error::sealed_unhandled::Unhandled), +} +impl ListSearchJobBackupsError { + /// Creates the `ListSearchJobBackupsError::Unhandled` variant from any error type. + pub fn unhandled( + err: impl ::std::convert::Into<::std::boxed::Box>, + ) -> Self { + Self::Unhandled(crate::error::sealed_unhandled::Unhandled { + source: err.into(), + meta: ::std::default::Default::default(), + }) + } + + /// Creates the `ListSearchJobBackupsError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata). + pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self { + Self::Unhandled(crate::error::sealed_unhandled::Unhandled { + source: err.clone().into(), + meta: err, + }) + } + /// + /// Returns error metadata, which includes the error code, message, + /// request ID, and potentially additional information. + /// + pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata { + match self { + Self::ResourceNotFoundException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), + Self::AccessDeniedException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), + Self::InternalServerException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), + Self::ThrottlingException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), + Self::ValidationException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), + Self::Unhandled(e) => &e.meta, + } + } + /// Returns `true` if the error kind is `ListSearchJobBackupsError::ResourceNotFoundException`. + pub fn is_resource_not_found_exception(&self) -> bool { + matches!(self, Self::ResourceNotFoundException(_)) + } + /// Returns `true` if the error kind is `ListSearchJobBackupsError::AccessDeniedException`. + pub fn is_access_denied_exception(&self) -> bool { + matches!(self, Self::AccessDeniedException(_)) + } + /// Returns `true` if the error kind is `ListSearchJobBackupsError::InternalServerException`. + pub fn is_internal_server_exception(&self) -> bool { + matches!(self, Self::InternalServerException(_)) + } + /// Returns `true` if the error kind is `ListSearchJobBackupsError::ThrottlingException`. + pub fn is_throttling_exception(&self) -> bool { + matches!(self, Self::ThrottlingException(_)) + } + /// Returns `true` if the error kind is `ListSearchJobBackupsError::ValidationException`. + pub fn is_validation_exception(&self) -> bool { + matches!(self, Self::ValidationException(_)) + } +} +impl ::std::error::Error for ListSearchJobBackupsError { + fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> { + match self { + Self::ResourceNotFoundException(_inner) => ::std::option::Option::Some(_inner), + Self::AccessDeniedException(_inner) => ::std::option::Option::Some(_inner), + Self::InternalServerException(_inner) => ::std::option::Option::Some(_inner), + Self::ThrottlingException(_inner) => ::std::option::Option::Some(_inner), + Self::ValidationException(_inner) => ::std::option::Option::Some(_inner), + Self::Unhandled(_inner) => ::std::option::Option::Some(&*_inner.source), + } + } +} +impl ::std::fmt::Display for ListSearchJobBackupsError { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + match self { + Self::ResourceNotFoundException(_inner) => _inner.fmt(f), + Self::AccessDeniedException(_inner) => _inner.fmt(f), + Self::InternalServerException(_inner) => _inner.fmt(f), + Self::ThrottlingException(_inner) => _inner.fmt(f), + Self::ValidationException(_inner) => _inner.fmt(f), + Self::Unhandled(_inner) => { + if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) { + write!(f, "unhandled error ({code})") + } else { + f.write_str("unhandled error") + } + } + } + } +} +impl ::aws_smithy_types::retry::ProvideErrorKind for ListSearchJobBackupsError { + fn code(&self) -> ::std::option::Option<&str> { + ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) + } + fn retryable_error_kind(&self) -> ::std::option::Option<::aws_smithy_types::retry::ErrorKind> { + match self { + Self::InternalServerException(inner) => ::std::option::Option::Some(inner.retryable_error_kind()), + Self::ThrottlingException(inner) => ::std::option::Option::Some(inner.retryable_error_kind()), + _ => ::std::option::Option::None, + } + } +} +impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for ListSearchJobBackupsError { + fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata { + match self { + Self::ResourceNotFoundException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner), + Self::AccessDeniedException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner), + Self::InternalServerException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner), + Self::ThrottlingException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner), + Self::ValidationException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner), + Self::Unhandled(_inner) => &_inner.meta, + } + } +} +impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for ListSearchJobBackupsError { + fn create_unhandled_error( + source: ::std::boxed::Box, + meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>, + ) -> Self { + Self::Unhandled(crate::error::sealed_unhandled::Unhandled { + source, + meta: meta.unwrap_or_default(), + }) + } +} +impl ::aws_types::request_id::RequestId for crate::operation::list_search_job_backups::ListSearchJobBackupsError { + fn request_id(&self) -> Option<&str> { + self.meta().request_id() + } +} + +pub use crate::operation::list_search_job_backups::_list_search_job_backups_output::ListSearchJobBackupsOutput; + +pub use crate::operation::list_search_job_backups::_list_search_job_backups_input::ListSearchJobBackupsInput; + +mod _list_search_job_backups_input; + +mod _list_search_job_backups_output; + +/// Builders +pub mod builders; + +/// Paginator for this operation +pub mod paginator; diff --git a/sdk/backupsearch/src/operation/list_search_job_backups/_list_search_job_backups_input.rs b/sdk/backupsearch/src/operation/list_search_job_backups/_list_search_job_backups_input.rs new file mode 100644 index 000000000000..d065c5aeb391 --- /dev/null +++ b/sdk/backupsearch/src/operation/list_search_job_backups/_list_search_job_backups_input.rs @@ -0,0 +1,102 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +#[allow(missing_docs)] // documentation missing in model +#[non_exhaustive] +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)] +pub struct ListSearchJobBackupsInput { + ///

The unique string that specifies the search job.

+ pub search_job_identifier: ::std::option::Option<::std::string::String>, + ///

The next item following a partial list of returned backups included in a search job.

+ ///

For example, if a request is made to return MaxResults number of backups, NextToken allows you to return more items in your list starting at the location pointed to by the next token.

+ pub next_token: ::std::option::Option<::std::string::String>, + ///

The maximum number of resource list items to be returned.

+ pub max_results: ::std::option::Option, +} +impl ListSearchJobBackupsInput { + ///

The unique string that specifies the search job.

+ pub fn search_job_identifier(&self) -> ::std::option::Option<&str> { + self.search_job_identifier.as_deref() + } + ///

The next item following a partial list of returned backups included in a search job.

+ ///

For example, if a request is made to return MaxResults number of backups, NextToken allows you to return more items in your list starting at the location pointed to by the next token.

+ pub fn next_token(&self) -> ::std::option::Option<&str> { + self.next_token.as_deref() + } + ///

The maximum number of resource list items to be returned.

+ pub fn max_results(&self) -> ::std::option::Option { + self.max_results + } +} +impl ListSearchJobBackupsInput { + /// Creates a new builder-style object to manufacture [`ListSearchJobBackupsInput`](crate::operation::list_search_job_backups::ListSearchJobBackupsInput). + pub fn builder() -> crate::operation::list_search_job_backups::builders::ListSearchJobBackupsInputBuilder { + crate::operation::list_search_job_backups::builders::ListSearchJobBackupsInputBuilder::default() + } +} + +/// A builder for [`ListSearchJobBackupsInput`](crate::operation::list_search_job_backups::ListSearchJobBackupsInput). +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)] +#[non_exhaustive] +pub struct ListSearchJobBackupsInputBuilder { + pub(crate) search_job_identifier: ::std::option::Option<::std::string::String>, + pub(crate) next_token: ::std::option::Option<::std::string::String>, + pub(crate) max_results: ::std::option::Option, +} +impl ListSearchJobBackupsInputBuilder { + ///

The unique string that specifies the search job.

+ /// This field is required. + pub fn search_job_identifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.search_job_identifier = ::std::option::Option::Some(input.into()); + self + } + ///

The unique string that specifies the search job.

+ pub fn set_search_job_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.search_job_identifier = input; + self + } + ///

The unique string that specifies the search job.

+ pub fn get_search_job_identifier(&self) -> &::std::option::Option<::std::string::String> { + &self.search_job_identifier + } + ///

The next item following a partial list of returned backups included in a search job.

+ ///

For example, if a request is made to return MaxResults number of backups, NextToken allows you to return more items in your list starting at the location pointed to by the next token.

+ pub fn next_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.next_token = ::std::option::Option::Some(input.into()); + self + } + ///

The next item following a partial list of returned backups included in a search job.

+ ///

For example, if a request is made to return MaxResults number of backups, NextToken allows you to return more items in your list starting at the location pointed to by the next token.

+ pub fn set_next_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.next_token = input; + self + } + ///

The next item following a partial list of returned backups included in a search job.

+ ///

For example, if a request is made to return MaxResults number of backups, NextToken allows you to return more items in your list starting at the location pointed to by the next token.

+ pub fn get_next_token(&self) -> &::std::option::Option<::std::string::String> { + &self.next_token + } + ///

The maximum number of resource list items to be returned.

+ pub fn max_results(mut self, input: i32) -> Self { + self.max_results = ::std::option::Option::Some(input); + self + } + ///

The maximum number of resource list items to be returned.

+ pub fn set_max_results(mut self, input: ::std::option::Option) -> Self { + self.max_results = input; + self + } + ///

The maximum number of resource list items to be returned.

+ pub fn get_max_results(&self) -> &::std::option::Option { + &self.max_results + } + /// Consumes the builder and constructs a [`ListSearchJobBackupsInput`](crate::operation::list_search_job_backups::ListSearchJobBackupsInput). + pub fn build( + self, + ) -> ::std::result::Result + { + ::std::result::Result::Ok(crate::operation::list_search_job_backups::ListSearchJobBackupsInput { + search_job_identifier: self.search_job_identifier, + next_token: self.next_token, + max_results: self.max_results, + }) + } +} diff --git a/sdk/backupsearch/src/operation/list_search_job_backups/_list_search_job_backups_output.rs b/sdk/backupsearch/src/operation/list_search_job_backups/_list_search_job_backups_output.rs new file mode 100644 index 000000000000..f90e0f1da602 --- /dev/null +++ b/sdk/backupsearch/src/operation/list_search_job_backups/_list_search_job_backups_output.rs @@ -0,0 +1,110 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +#[allow(missing_docs)] // documentation missing in model +#[non_exhaustive] +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)] +pub struct ListSearchJobBackupsOutput { + ///

The recovery points returned the results of a search job

+ pub results: ::std::vec::Vec, + ///

The next item following a partial list of returned backups included in a search job.

+ ///

For example, if a request is made to return MaxResults number of backups, NextToken allows you to return more items in your list starting at the location pointed to by the next token.

+ pub next_token: ::std::option::Option<::std::string::String>, + _request_id: Option, +} +impl ListSearchJobBackupsOutput { + ///

The recovery points returned the results of a search job

+ pub fn results(&self) -> &[crate::types::SearchJobBackupsResult] { + use std::ops::Deref; + self.results.deref() + } + ///

The next item following a partial list of returned backups included in a search job.

+ ///

For example, if a request is made to return MaxResults number of backups, NextToken allows you to return more items in your list starting at the location pointed to by the next token.

+ pub fn next_token(&self) -> ::std::option::Option<&str> { + self.next_token.as_deref() + } +} +impl ::aws_types::request_id::RequestId for ListSearchJobBackupsOutput { + fn request_id(&self) -> Option<&str> { + self._request_id.as_deref() + } +} +impl ListSearchJobBackupsOutput { + /// Creates a new builder-style object to manufacture [`ListSearchJobBackupsOutput`](crate::operation::list_search_job_backups::ListSearchJobBackupsOutput). + pub fn builder() -> crate::operation::list_search_job_backups::builders::ListSearchJobBackupsOutputBuilder { + crate::operation::list_search_job_backups::builders::ListSearchJobBackupsOutputBuilder::default() + } +} + +/// A builder for [`ListSearchJobBackupsOutput`](crate::operation::list_search_job_backups::ListSearchJobBackupsOutput). +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)] +#[non_exhaustive] +pub struct ListSearchJobBackupsOutputBuilder { + pub(crate) results: ::std::option::Option<::std::vec::Vec>, + pub(crate) next_token: ::std::option::Option<::std::string::String>, + _request_id: Option, +} +impl ListSearchJobBackupsOutputBuilder { + /// Appends an item to `results`. + /// + /// To override the contents of this collection use [`set_results`](Self::set_results). + /// + ///

The recovery points returned the results of a search job

+ pub fn results(mut self, input: crate::types::SearchJobBackupsResult) -> Self { + let mut v = self.results.unwrap_or_default(); + v.push(input); + self.results = ::std::option::Option::Some(v); + self + } + ///

The recovery points returned the results of a search job

+ pub fn set_results(mut self, input: ::std::option::Option<::std::vec::Vec>) -> Self { + self.results = input; + self + } + ///

The recovery points returned the results of a search job

+ pub fn get_results(&self) -> &::std::option::Option<::std::vec::Vec> { + &self.results + } + ///

The next item following a partial list of returned backups included in a search job.

+ ///

For example, if a request is made to return MaxResults number of backups, NextToken allows you to return more items in your list starting at the location pointed to by the next token.

+ pub fn next_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.next_token = ::std::option::Option::Some(input.into()); + self + } + ///

The next item following a partial list of returned backups included in a search job.

+ ///

For example, if a request is made to return MaxResults number of backups, NextToken allows you to return more items in your list starting at the location pointed to by the next token.

+ pub fn set_next_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.next_token = input; + self + } + ///

The next item following a partial list of returned backups included in a search job.

+ ///

For example, if a request is made to return MaxResults number of backups, NextToken allows you to return more items in your list starting at the location pointed to by the next token.

+ pub fn get_next_token(&self) -> &::std::option::Option<::std::string::String> { + &self.next_token + } + pub(crate) fn _request_id(mut self, request_id: impl Into) -> Self { + self._request_id = Some(request_id.into()); + self + } + + pub(crate) fn _set_request_id(&mut self, request_id: Option) -> &mut Self { + self._request_id = request_id; + self + } + /// Consumes the builder and constructs a [`ListSearchJobBackupsOutput`](crate::operation::list_search_job_backups::ListSearchJobBackupsOutput). + /// This method will fail if any of the following fields are not set: + /// - [`results`](crate::operation::list_search_job_backups::builders::ListSearchJobBackupsOutputBuilder::results) + pub fn build( + self, + ) -> ::std::result::Result + { + ::std::result::Result::Ok(crate::operation::list_search_job_backups::ListSearchJobBackupsOutput { + results: self.results.ok_or_else(|| { + ::aws_smithy_types::error::operation::BuildError::missing_field( + "results", + "results was not specified but it is required when building ListSearchJobBackupsOutput", + ) + })?, + next_token: self.next_token, + _request_id: self._request_id, + }) + } +} diff --git a/sdk/backupsearch/src/operation/list_search_job_backups/builders.rs b/sdk/backupsearch/src/operation/list_search_job_backups/builders.rs new file mode 100644 index 000000000000..ff9595c0a33d --- /dev/null +++ b/sdk/backupsearch/src/operation/list_search_job_backups/builders.rs @@ -0,0 +1,164 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +pub use crate::operation::list_search_job_backups::_list_search_job_backups_output::ListSearchJobBackupsOutputBuilder; + +pub use crate::operation::list_search_job_backups::_list_search_job_backups_input::ListSearchJobBackupsInputBuilder; + +impl crate::operation::list_search_job_backups::builders::ListSearchJobBackupsInputBuilder { + /// Sends a request with this input using the given client. + pub async fn send_with( + self, + client: &crate::Client, + ) -> ::std::result::Result< + crate::operation::list_search_job_backups::ListSearchJobBackupsOutput, + ::aws_smithy_runtime_api::client::result::SdkError< + crate::operation::list_search_job_backups::ListSearchJobBackupsError, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >, + > { + let mut fluent_builder = client.list_search_job_backups(); + fluent_builder.inner = self; + fluent_builder.send().await + } +} +/// Fluent builder constructing a request to `ListSearchJobBackups`. +/// +///

This operation returns a list of all backups (recovery points) in a paginated format that were included in the search job.

+///

If a search does not display an expected backup in the results, you can call this operation to display each backup included in the search. Any backups that were not included because they have a FAILED status from a permissions issue will be displayed, along with a status message.

+///

Only recovery points with a backup index that has a status of ACTIVE will be included in search results. If the index has any other status, its status will be displayed along with a status message.

+#[derive(::std::clone::Clone, ::std::fmt::Debug)] +pub struct ListSearchJobBackupsFluentBuilder { + handle: ::std::sync::Arc, + inner: crate::operation::list_search_job_backups::builders::ListSearchJobBackupsInputBuilder, + config_override: ::std::option::Option, +} +impl + crate::client::customize::internal::CustomizableSend< + crate::operation::list_search_job_backups::ListSearchJobBackupsOutput, + crate::operation::list_search_job_backups::ListSearchJobBackupsError, + > for ListSearchJobBackupsFluentBuilder +{ + fn send( + self, + config_override: crate::config::Builder, + ) -> crate::client::customize::internal::BoxFuture< + crate::client::customize::internal::SendResult< + crate::operation::list_search_job_backups::ListSearchJobBackupsOutput, + crate::operation::list_search_job_backups::ListSearchJobBackupsError, + >, + > { + ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await }) + } +} +impl ListSearchJobBackupsFluentBuilder { + /// Creates a new `ListSearchJobBackupsFluentBuilder`. + pub(crate) fn new(handle: ::std::sync::Arc) -> Self { + Self { + handle, + inner: ::std::default::Default::default(), + config_override: ::std::option::Option::None, + } + } + /// Access the ListSearchJobBackups as a reference. + pub fn as_input(&self) -> &crate::operation::list_search_job_backups::builders::ListSearchJobBackupsInputBuilder { + &self.inner + } + /// Sends the request and returns the response. + /// + /// If an error occurs, an `SdkError` will be returned with additional details that + /// can be matched against. + /// + /// By default, any retryable failures will be retried twice. Retry behavior + /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be + /// set when configuring the client. + pub async fn send( + self, + ) -> ::std::result::Result< + crate::operation::list_search_job_backups::ListSearchJobBackupsOutput, + ::aws_smithy_runtime_api::client::result::SdkError< + crate::operation::list_search_job_backups::ListSearchJobBackupsError, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >, + > { + let input = self + .inner + .build() + .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?; + let runtime_plugins = crate::operation::list_search_job_backups::ListSearchJobBackups::operation_runtime_plugins( + self.handle.runtime_plugins.clone(), + &self.handle.conf, + self.config_override, + ); + crate::operation::list_search_job_backups::ListSearchJobBackups::orchestrate(&runtime_plugins, input).await + } + + /// Consumes this builder, creating a customizable operation that can be modified before being sent. + pub fn customize( + self, + ) -> crate::client::customize::CustomizableOperation< + crate::operation::list_search_job_backups::ListSearchJobBackupsOutput, + crate::operation::list_search_job_backups::ListSearchJobBackupsError, + Self, + > { + crate::client::customize::CustomizableOperation::new(self) + } + pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into) -> Self { + self.set_config_override(::std::option::Option::Some(config_override.into())); + self + } + + pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option) -> &mut Self { + self.config_override = config_override; + self + } + /// Create a paginator for this request + /// + /// Paginators are used by calling [`send().await`](crate::operation::list_search_job_backups::paginator::ListSearchJobBackupsPaginator::send) which returns a [`PaginationStream`](aws_smithy_async::future::pagination_stream::PaginationStream). + pub fn into_paginator(self) -> crate::operation::list_search_job_backups::paginator::ListSearchJobBackupsPaginator { + crate::operation::list_search_job_backups::paginator::ListSearchJobBackupsPaginator::new(self.handle, self.inner) + } + ///

The unique string that specifies the search job.

+ pub fn search_job_identifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.inner = self.inner.search_job_identifier(input.into()); + self + } + ///

The unique string that specifies the search job.

+ pub fn set_search_job_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.inner = self.inner.set_search_job_identifier(input); + self + } + ///

The unique string that specifies the search job.

+ pub fn get_search_job_identifier(&self) -> &::std::option::Option<::std::string::String> { + self.inner.get_search_job_identifier() + } + ///

The next item following a partial list of returned backups included in a search job.

+ ///

For example, if a request is made to return MaxResults number of backups, NextToken allows you to return more items in your list starting at the location pointed to by the next token.

+ pub fn next_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.inner = self.inner.next_token(input.into()); + self + } + ///

The next item following a partial list of returned backups included in a search job.

+ ///

For example, if a request is made to return MaxResults number of backups, NextToken allows you to return more items in your list starting at the location pointed to by the next token.

+ pub fn set_next_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.inner = self.inner.set_next_token(input); + self + } + ///

The next item following a partial list of returned backups included in a search job.

+ ///

For example, if a request is made to return MaxResults number of backups, NextToken allows you to return more items in your list starting at the location pointed to by the next token.

+ pub fn get_next_token(&self) -> &::std::option::Option<::std::string::String> { + self.inner.get_next_token() + } + ///

The maximum number of resource list items to be returned.

+ pub fn max_results(mut self, input: i32) -> Self { + self.inner = self.inner.max_results(input); + self + } + ///

The maximum number of resource list items to be returned.

+ pub fn set_max_results(mut self, input: ::std::option::Option) -> Self { + self.inner = self.inner.set_max_results(input); + self + } + ///

The maximum number of resource list items to be returned.

+ pub fn get_max_results(&self) -> &::std::option::Option { + self.inner.get_max_results() + } +} diff --git a/sdk/backupsearch/src/operation/list_search_job_backups/paginator.rs b/sdk/backupsearch/src/operation/list_search_job_backups/paginator.rs new file mode 100644 index 000000000000..fcf686298974 --- /dev/null +++ b/sdk/backupsearch/src/operation/list_search_job_backups/paginator.rs @@ -0,0 +1,149 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +/// Paginator for [`ListSearchJobBackups`](crate::operation::list_search_job_backups::ListSearchJobBackups) +pub struct ListSearchJobBackupsPaginator { + handle: std::sync::Arc, + builder: crate::operation::list_search_job_backups::builders::ListSearchJobBackupsInputBuilder, + stop_on_duplicate_token: bool, +} + +impl ListSearchJobBackupsPaginator { + /// Create a new paginator-wrapper + pub(crate) fn new( + handle: std::sync::Arc, + builder: crate::operation::list_search_job_backups::builders::ListSearchJobBackupsInputBuilder, + ) -> Self { + Self { + handle, + builder, + stop_on_duplicate_token: true, + } + } + + /// Set the page size + /// + /// _Note: this method will override any previously set value for `max_results`_ + pub fn page_size(mut self, limit: i32) -> Self { + self.builder.max_results = ::std::option::Option::Some(limit); + self + } + + /// Create a flattened paginator + /// + /// This paginator automatically flattens results using `results`. Queries to the underlying service + /// are dispatched lazily. + pub fn items(self) -> crate::operation::list_search_job_backups::paginator::ListSearchJobBackupsPaginatorItems { + crate::operation::list_search_job_backups::paginator::ListSearchJobBackupsPaginatorItems(self) + } + + /// Stop paginating when the service returns the same pagination token twice in a row. + /// + /// Defaults to true. + /// + /// For certain operations, it may be useful to continue on duplicate token. For example, + /// if an operation is for tailing a log file in real-time, then continuing may be desired. + /// This option can be set to `false` to accommodate these use cases. + pub fn stop_on_duplicate_token(mut self, stop_on_duplicate_token: bool) -> Self { + self.stop_on_duplicate_token = stop_on_duplicate_token; + self + } + + /// Create the pagination stream + /// + /// _Note:_ No requests will be dispatched until the stream is used + /// (e.g. with the [`.next().await`](aws_smithy_async::future::pagination_stream::PaginationStream::next) method). + pub fn send( + self, + ) -> ::aws_smithy_async::future::pagination_stream::PaginationStream< + ::std::result::Result< + crate::operation::list_search_job_backups::ListSearchJobBackupsOutput, + ::aws_smithy_runtime_api::client::result::SdkError< + crate::operation::list_search_job_backups::ListSearchJobBackupsError, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >, + >, + > { + // Move individual fields out of self for the borrow checker + let builder = self.builder; + let handle = self.handle; + let runtime_plugins = crate::operation::list_search_job_backups::ListSearchJobBackups::operation_runtime_plugins( + handle.runtime_plugins.clone(), + &handle.conf, + ::std::option::Option::None, + ) + .with_operation_plugin(crate::sdk_feature_tracker::paginator::PaginatorFeatureTrackerRuntimePlugin::new()); + ::aws_smithy_async::future::pagination_stream::PaginationStream::new(::aws_smithy_async::future::pagination_stream::fn_stream::FnStream::new( + move |tx| { + ::std::boxed::Box::pin(async move { + // Build the input for the first time. If required fields are missing, this is where we'll produce an early error. + let mut input = match builder + .build() + .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure) + { + ::std::result::Result::Ok(input) => input, + ::std::result::Result::Err(e) => { + let _ = tx.send(::std::result::Result::Err(e)).await; + return; + } + }; + loop { + let resp = + crate::operation::list_search_job_backups::ListSearchJobBackups::orchestrate(&runtime_plugins, input.clone()).await; + // If the input member is None or it was an error + let done = match resp { + ::std::result::Result::Ok(ref resp) => { + let new_token = crate::lens::reflens_list_search_job_backups_output_output_next_token(resp); + // Pagination is exhausted when the next token is an empty string + let is_empty = new_token.map(|token| token.is_empty()).unwrap_or(true); + if !is_empty && new_token == input.next_token.as_ref() && self.stop_on_duplicate_token { + true + } else { + input.next_token = new_token.cloned(); + is_empty + } + } + ::std::result::Result::Err(_) => true, + }; + if tx.send(resp).await.is_err() { + // receiving end was dropped + return; + } + if done { + return; + } + } + }) + }, + )) + } +} + +/// Flattened paginator for `ListSearchJobBackupsPaginator` +/// +/// This is created with [`.items()`](ListSearchJobBackupsPaginator::items) +pub struct ListSearchJobBackupsPaginatorItems(ListSearchJobBackupsPaginator); + +impl ListSearchJobBackupsPaginatorItems { + /// Create the pagination stream + /// + /// _Note_: No requests will be dispatched until the stream is used + /// (e.g. with the [`.next().await`](aws_smithy_async::future::pagination_stream::PaginationStream::next) method). + /// + /// To read the entirety of the paginator, use [`.collect::, _>()`](aws_smithy_async::future::pagination_stream::PaginationStream::collect). + pub fn send( + self, + ) -> ::aws_smithy_async::future::pagination_stream::PaginationStream< + ::std::result::Result< + crate::types::SearchJobBackupsResult, + ::aws_smithy_runtime_api::client::result::SdkError< + crate::operation::list_search_job_backups::ListSearchJobBackupsError, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >, + >, + > { + ::aws_smithy_async::future::pagination_stream::TryFlatMap::new(self.0.send()).flat_map(|page| { + crate::lens::lens_list_search_job_backups_output_output_results(page) + .unwrap_or_default() + .into_iter() + }) + } +} diff --git a/sdk/backupsearch/src/operation/list_search_job_results.rs b/sdk/backupsearch/src/operation/list_search_job_results.rs new file mode 100644 index 000000000000..8f1b3037c7d3 --- /dev/null +++ b/sdk/backupsearch/src/operation/list_search_job_results.rs @@ -0,0 +1,432 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +/// Orchestration and serialization glue logic for `ListSearchJobResults`. +#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)] +#[non_exhaustive] +pub struct ListSearchJobResults; +impl ListSearchJobResults { + /// Creates a new `ListSearchJobResults` + pub fn new() -> Self { + Self + } + pub(crate) async fn orchestrate( + runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, + input: crate::operation::list_search_job_results::ListSearchJobResultsInput, + ) -> ::std::result::Result< + crate::operation::list_search_job_results::ListSearchJobResultsOutput, + ::aws_smithy_runtime_api::client::result::SdkError< + crate::operation::list_search_job_results::ListSearchJobResultsError, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >, + > { + let map_err = |err: ::aws_smithy_runtime_api::client::result::SdkError< + ::aws_smithy_runtime_api::client::interceptors::context::Error, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >| { + err.map_service_error(|err| { + err.downcast::() + .expect("correct error type") + }) + }; + let context = Self::orchestrate_with_stop_point(runtime_plugins, input, ::aws_smithy_runtime::client::orchestrator::StopPoint::None) + .await + .map_err(map_err)?; + let output = context.finalize().map_err(map_err)?; + ::std::result::Result::Ok( + output + .downcast::() + .expect("correct output type"), + ) + } + + pub(crate) async fn orchestrate_with_stop_point( + runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, + input: crate::operation::list_search_job_results::ListSearchJobResultsInput, + stop_point: ::aws_smithy_runtime::client::orchestrator::StopPoint, + ) -> ::std::result::Result< + ::aws_smithy_runtime_api::client::interceptors::context::InterceptorContext, + ::aws_smithy_runtime_api::client::result::SdkError< + ::aws_smithy_runtime_api::client::interceptors::context::Error, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >, + > { + let input = ::aws_smithy_runtime_api::client::interceptors::context::Input::erase(input); + ::aws_smithy_runtime::client::orchestrator::invoke_with_stop_point("backupsearch", "ListSearchJobResults", input, runtime_plugins, stop_point) + .await + } + + pub(crate) fn operation_runtime_plugins( + client_runtime_plugins: ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, + client_config: &crate::config::Config, + config_override: ::std::option::Option, + ) -> ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins { + let mut runtime_plugins = client_runtime_plugins.with_operation_plugin(Self::new()); + runtime_plugins = runtime_plugins.with_client_plugin(crate::auth_plugin::DefaultAuthOptionsPlugin::new(vec![ + ::aws_runtime::auth::sigv4::SCHEME_ID, + ])); + if let ::std::option::Option::Some(config_override) = config_override { + for plugin in config_override.runtime_plugins.iter().cloned() { + runtime_plugins = runtime_plugins.with_operation_plugin(plugin); + } + runtime_plugins = runtime_plugins.with_operation_plugin(crate::config::ConfigOverrideRuntimePlugin::new( + config_override, + client_config.config.clone(), + &client_config.runtime_components, + )); + } + runtime_plugins + } +} +impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for ListSearchJobResults { + fn config(&self) -> ::std::option::Option<::aws_smithy_types::config_bag::FrozenLayer> { + let mut cfg = ::aws_smithy_types::config_bag::Layer::new("ListSearchJobResults"); + + cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new( + ListSearchJobResultsRequestSerializer, + )); + cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new( + ListSearchJobResultsResponseDeserializer, + )); + + cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new( + ::aws_smithy_runtime_api::client::auth::static_resolver::StaticAuthSchemeOptionResolverParams::new(), + )); + + cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::SensitiveOutput); + cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::Metadata::new( + "ListSearchJobResults", + "backupsearch", + )); + let mut signing_options = ::aws_runtime::auth::SigningOptions::default(); + signing_options.double_uri_encode = true; + signing_options.content_sha256_header = false; + signing_options.normalize_uri_path = true; + signing_options.payload_override = None; + + cfg.store_put(::aws_runtime::auth::SigV4OperationSigningConfig { + signing_options, + ..::std::default::Default::default() + }); + + ::std::option::Option::Some(cfg.freeze()) + } + + fn runtime_components( + &self, + _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder, + ) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> { + #[allow(unused_mut)] + let mut rcb = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("ListSearchJobResults") + .with_interceptor(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default()) + .with_interceptor(ListSearchJobResultsEndpointParamsInterceptor) + .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::< + crate::operation::list_search_job_results::ListSearchJobResultsError, + >::new()) + .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::< + crate::operation::list_search_job_results::ListSearchJobResultsError, + >::new()) + .with_retry_classifier(::aws_runtime::retries::classifiers::AwsErrorCodeClassifier::< + crate::operation::list_search_job_results::ListSearchJobResultsError, + >::new()); + + ::std::borrow::Cow::Owned(rcb) + } +} + +#[derive(Debug)] +struct ListSearchJobResultsResponseDeserializer; +impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for ListSearchJobResultsResponseDeserializer { + fn deserialize_nonstreaming( + &self, + response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError { + let (success, status) = (response.status().is_success(), response.status().as_u16()); + let headers = response.headers(); + let body = response.body().bytes().expect("body loaded"); + #[allow(unused_mut)] + let mut force_error = false; + ::tracing::debug!(request_id = ?::aws_types::request_id::RequestId::request_id(response)); + let parse_result = if !success && status != 200 || force_error { + crate::protocol_serde::shape_list_search_job_results::de_list_search_job_results_http_error(status, headers, body) + } else { + crate::protocol_serde::shape_list_search_job_results::de_list_search_job_results_http_response(status, headers, body) + }; + crate::protocol_serde::type_erase_result(parse_result) + } +} +#[derive(Debug)] +struct ListSearchJobResultsRequestSerializer; +impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for ListSearchJobResultsRequestSerializer { + #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)] + fn serialize_input( + &self, + input: ::aws_smithy_runtime_api::client::interceptors::context::Input, + _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag, + ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> { + let input = input + .downcast::() + .expect("correct type"); + let _header_serialization_settings = _cfg + .load::() + .cloned() + .unwrap_or_default(); + let mut request_builder = { + fn uri_base( + _input: &crate::operation::list_search_job_results::ListSearchJobResultsInput, + output: &mut ::std::string::String, + ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> { + use ::std::fmt::Write as _; + let input_1 = &_input.search_job_identifier; + let input_1 = input_1.as_ref().ok_or_else(|| { + ::aws_smithy_types::error::operation::BuildError::missing_field("search_job_identifier", "cannot be empty or unset") + })?; + let search_job_identifier = ::aws_smithy_http::label::fmt_string(input_1, ::aws_smithy_http::label::EncodingStrategy::Default); + if search_job_identifier.is_empty() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "search_job_identifier", + "cannot be empty or unset", + )); + } + ::std::write!( + output, + "/search-jobs/{SearchJobIdentifier}/search-results", + SearchJobIdentifier = search_job_identifier + ) + .expect("formatting should succeed"); + ::std::result::Result::Ok(()) + } + fn uri_query( + _input: &crate::operation::list_search_job_results::ListSearchJobResultsInput, + mut output: &mut ::std::string::String, + ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> { + let mut query = ::aws_smithy_http::query::Writer::new(output); + if let ::std::option::Option::Some(inner_2) = &_input.next_token { + { + query.push_kv("nextToken", &::aws_smithy_http::query::fmt_string(inner_2)); + } + } + if let ::std::option::Option::Some(inner_3) = &_input.max_results { + { + query.push_kv("maxResults", ::aws_smithy_types::primitive::Encoder::from(*inner_3).encode()); + } + } + ::std::result::Result::Ok(()) + } + #[allow(clippy::unnecessary_wraps)] + fn update_http_builder( + input: &crate::operation::list_search_job_results::ListSearchJobResultsInput, + builder: ::http::request::Builder, + ) -> ::std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> { + let mut uri = ::std::string::String::new(); + uri_base(input, &mut uri)?; + uri_query(input, &mut uri)?; + ::std::result::Result::Ok(builder.method("GET").uri(uri)) + } + let mut builder = update_http_builder(&input, ::http::request::Builder::new())?; + builder + }; + let body = ::aws_smithy_types::body::SdkBody::from(""); + + ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap()) + } +} +#[derive(Debug)] +struct ListSearchJobResultsEndpointParamsInterceptor; + +impl ::aws_smithy_runtime_api::client::interceptors::Intercept for ListSearchJobResultsEndpointParamsInterceptor { + fn name(&self) -> &'static str { + "ListSearchJobResultsEndpointParamsInterceptor" + } + + fn read_before_execution( + &self, + context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef< + '_, + ::aws_smithy_runtime_api::client::interceptors::context::Input, + ::aws_smithy_runtime_api::client::interceptors::context::Output, + ::aws_smithy_runtime_api::client::interceptors::context::Error, + >, + cfg: &mut ::aws_smithy_types::config_bag::ConfigBag, + ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> { + let _input = context + .input() + .downcast_ref::() + .ok_or("failed to downcast to ListSearchJobResultsInput")?; + + let params = crate::config::endpoint::Params::builder() + .set_use_fips(cfg.load::<::aws_types::endpoint_config::UseFips>().map(|ty| ty.0)) + .set_endpoint(cfg.load::<::aws_types::endpoint_config::EndpointUrl>().map(|ty| ty.0.clone())) + .set_region(cfg.load::<::aws_types::region::Region>().map(|r| r.as_ref().to_owned())) + .build() + .map_err(|err| { + ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err) + })?; + cfg.interceptor_state() + .store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params)); + ::std::result::Result::Ok(()) + } +} + +// The get_* functions below are generated from JMESPath expressions in the +// operationContextParams trait. They target the operation's input shape. + +/// Error type for the `ListSearchJobResultsError` operation. +#[non_exhaustive] +#[derive(::std::fmt::Debug)] +pub enum ListSearchJobResultsError { + ///

The resource was not found for this request.

+ ///

Confirm the resource information, such as the ARN or type is correct and exists, then retry the request.

+ ResourceNotFoundException(crate::types::error::ResourceNotFoundException), + ///

You do not have sufficient access to perform this action.

+ AccessDeniedException(crate::types::error::AccessDeniedException), + ///

An internal server error occurred. Retry your request.

+ InternalServerException(crate::types::error::InternalServerException), + ///

The request was denied due to request throttling.

+ ThrottlingException(crate::types::error::ThrottlingException), + ///

The input fails to satisfy the constraints specified by a service.

+ ValidationException(crate::types::error::ValidationException), + /// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code). + #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \ + variable wildcard pattern and check `.code()`: + \ +    `err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }` + \ + See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-ListSearchJobResultsError) for what information is available for the error.")] + Unhandled(crate::error::sealed_unhandled::Unhandled), +} +impl ListSearchJobResultsError { + /// Creates the `ListSearchJobResultsError::Unhandled` variant from any error type. + pub fn unhandled( + err: impl ::std::convert::Into<::std::boxed::Box>, + ) -> Self { + Self::Unhandled(crate::error::sealed_unhandled::Unhandled { + source: err.into(), + meta: ::std::default::Default::default(), + }) + } + + /// Creates the `ListSearchJobResultsError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata). + pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self { + Self::Unhandled(crate::error::sealed_unhandled::Unhandled { + source: err.clone().into(), + meta: err, + }) + } + /// + /// Returns error metadata, which includes the error code, message, + /// request ID, and potentially additional information. + /// + pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata { + match self { + Self::ResourceNotFoundException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), + Self::AccessDeniedException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), + Self::InternalServerException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), + Self::ThrottlingException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), + Self::ValidationException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), + Self::Unhandled(e) => &e.meta, + } + } + /// Returns `true` if the error kind is `ListSearchJobResultsError::ResourceNotFoundException`. + pub fn is_resource_not_found_exception(&self) -> bool { + matches!(self, Self::ResourceNotFoundException(_)) + } + /// Returns `true` if the error kind is `ListSearchJobResultsError::AccessDeniedException`. + pub fn is_access_denied_exception(&self) -> bool { + matches!(self, Self::AccessDeniedException(_)) + } + /// Returns `true` if the error kind is `ListSearchJobResultsError::InternalServerException`. + pub fn is_internal_server_exception(&self) -> bool { + matches!(self, Self::InternalServerException(_)) + } + /// Returns `true` if the error kind is `ListSearchJobResultsError::ThrottlingException`. + pub fn is_throttling_exception(&self) -> bool { + matches!(self, Self::ThrottlingException(_)) + } + /// Returns `true` if the error kind is `ListSearchJobResultsError::ValidationException`. + pub fn is_validation_exception(&self) -> bool { + matches!(self, Self::ValidationException(_)) + } +} +impl ::std::error::Error for ListSearchJobResultsError { + fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> { + match self { + Self::ResourceNotFoundException(_inner) => ::std::option::Option::Some(_inner), + Self::AccessDeniedException(_inner) => ::std::option::Option::Some(_inner), + Self::InternalServerException(_inner) => ::std::option::Option::Some(_inner), + Self::ThrottlingException(_inner) => ::std::option::Option::Some(_inner), + Self::ValidationException(_inner) => ::std::option::Option::Some(_inner), + Self::Unhandled(_inner) => ::std::option::Option::Some(&*_inner.source), + } + } +} +impl ::std::fmt::Display for ListSearchJobResultsError { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + match self { + Self::ResourceNotFoundException(_inner) => _inner.fmt(f), + Self::AccessDeniedException(_inner) => _inner.fmt(f), + Self::InternalServerException(_inner) => _inner.fmt(f), + Self::ThrottlingException(_inner) => _inner.fmt(f), + Self::ValidationException(_inner) => _inner.fmt(f), + Self::Unhandled(_inner) => { + if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) { + write!(f, "unhandled error ({code})") + } else { + f.write_str("unhandled error") + } + } + } + } +} +impl ::aws_smithy_types::retry::ProvideErrorKind for ListSearchJobResultsError { + fn code(&self) -> ::std::option::Option<&str> { + ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) + } + fn retryable_error_kind(&self) -> ::std::option::Option<::aws_smithy_types::retry::ErrorKind> { + match self { + Self::InternalServerException(inner) => ::std::option::Option::Some(inner.retryable_error_kind()), + Self::ThrottlingException(inner) => ::std::option::Option::Some(inner.retryable_error_kind()), + _ => ::std::option::Option::None, + } + } +} +impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for ListSearchJobResultsError { + fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata { + match self { + Self::ResourceNotFoundException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner), + Self::AccessDeniedException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner), + Self::InternalServerException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner), + Self::ThrottlingException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner), + Self::ValidationException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner), + Self::Unhandled(_inner) => &_inner.meta, + } + } +} +impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for ListSearchJobResultsError { + fn create_unhandled_error( + source: ::std::boxed::Box, + meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>, + ) -> Self { + Self::Unhandled(crate::error::sealed_unhandled::Unhandled { + source, + meta: meta.unwrap_or_default(), + }) + } +} +impl ::aws_types::request_id::RequestId for crate::operation::list_search_job_results::ListSearchJobResultsError { + fn request_id(&self) -> Option<&str> { + self.meta().request_id() + } +} + +pub use crate::operation::list_search_job_results::_list_search_job_results_output::ListSearchJobResultsOutput; + +pub use crate::operation::list_search_job_results::_list_search_job_results_input::ListSearchJobResultsInput; + +mod _list_search_job_results_input; + +mod _list_search_job_results_output; + +/// Builders +pub mod builders; + +/// Paginator for this operation +pub mod paginator; diff --git a/sdk/backupsearch/src/operation/list_search_job_results/_list_search_job_results_input.rs b/sdk/backupsearch/src/operation/list_search_job_results/_list_search_job_results_input.rs new file mode 100644 index 000000000000..48d08ac85da1 --- /dev/null +++ b/sdk/backupsearch/src/operation/list_search_job_results/_list_search_job_results_input.rs @@ -0,0 +1,102 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +#[allow(missing_docs)] // documentation missing in model +#[non_exhaustive] +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)] +pub struct ListSearchJobResultsInput { + ///

The unique string that specifies the search job.

+ pub search_job_identifier: ::std::option::Option<::std::string::String>, + ///

The next item following a partial list of returned search job results.

+ ///

For example, if a request is made to return MaxResults number of search job results, NextToken allows you to return more items in your list starting at the location pointed to by the next token.

+ pub next_token: ::std::option::Option<::std::string::String>, + ///

The maximum number of resource list items to be returned.

+ pub max_results: ::std::option::Option, +} +impl ListSearchJobResultsInput { + ///

The unique string that specifies the search job.

+ pub fn search_job_identifier(&self) -> ::std::option::Option<&str> { + self.search_job_identifier.as_deref() + } + ///

The next item following a partial list of returned search job results.

+ ///

For example, if a request is made to return MaxResults number of search job results, NextToken allows you to return more items in your list starting at the location pointed to by the next token.

+ pub fn next_token(&self) -> ::std::option::Option<&str> { + self.next_token.as_deref() + } + ///

The maximum number of resource list items to be returned.

+ pub fn max_results(&self) -> ::std::option::Option { + self.max_results + } +} +impl ListSearchJobResultsInput { + /// Creates a new builder-style object to manufacture [`ListSearchJobResultsInput`](crate::operation::list_search_job_results::ListSearchJobResultsInput). + pub fn builder() -> crate::operation::list_search_job_results::builders::ListSearchJobResultsInputBuilder { + crate::operation::list_search_job_results::builders::ListSearchJobResultsInputBuilder::default() + } +} + +/// A builder for [`ListSearchJobResultsInput`](crate::operation::list_search_job_results::ListSearchJobResultsInput). +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)] +#[non_exhaustive] +pub struct ListSearchJobResultsInputBuilder { + pub(crate) search_job_identifier: ::std::option::Option<::std::string::String>, + pub(crate) next_token: ::std::option::Option<::std::string::String>, + pub(crate) max_results: ::std::option::Option, +} +impl ListSearchJobResultsInputBuilder { + ///

The unique string that specifies the search job.

+ /// This field is required. + pub fn search_job_identifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.search_job_identifier = ::std::option::Option::Some(input.into()); + self + } + ///

The unique string that specifies the search job.

+ pub fn set_search_job_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.search_job_identifier = input; + self + } + ///

The unique string that specifies the search job.

+ pub fn get_search_job_identifier(&self) -> &::std::option::Option<::std::string::String> { + &self.search_job_identifier + } + ///

The next item following a partial list of returned search job results.

+ ///

For example, if a request is made to return MaxResults number of search job results, NextToken allows you to return more items in your list starting at the location pointed to by the next token.

+ pub fn next_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.next_token = ::std::option::Option::Some(input.into()); + self + } + ///

The next item following a partial list of returned search job results.

+ ///

For example, if a request is made to return MaxResults number of search job results, NextToken allows you to return more items in your list starting at the location pointed to by the next token.

+ pub fn set_next_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.next_token = input; + self + } + ///

The next item following a partial list of returned search job results.

+ ///

For example, if a request is made to return MaxResults number of search job results, NextToken allows you to return more items in your list starting at the location pointed to by the next token.

+ pub fn get_next_token(&self) -> &::std::option::Option<::std::string::String> { + &self.next_token + } + ///

The maximum number of resource list items to be returned.

+ pub fn max_results(mut self, input: i32) -> Self { + self.max_results = ::std::option::Option::Some(input); + self + } + ///

The maximum number of resource list items to be returned.

+ pub fn set_max_results(mut self, input: ::std::option::Option) -> Self { + self.max_results = input; + self + } + ///

The maximum number of resource list items to be returned.

+ pub fn get_max_results(&self) -> &::std::option::Option { + &self.max_results + } + /// Consumes the builder and constructs a [`ListSearchJobResultsInput`](crate::operation::list_search_job_results::ListSearchJobResultsInput). + pub fn build( + self, + ) -> ::std::result::Result + { + ::std::result::Result::Ok(crate::operation::list_search_job_results::ListSearchJobResultsInput { + search_job_identifier: self.search_job_identifier, + next_token: self.next_token, + max_results: self.max_results, + }) + } +} diff --git a/sdk/backupsearch/src/operation/list_search_job_results/_list_search_job_results_output.rs b/sdk/backupsearch/src/operation/list_search_job_results/_list_search_job_results_output.rs new file mode 100644 index 000000000000..a187c7625812 --- /dev/null +++ b/sdk/backupsearch/src/operation/list_search_job_results/_list_search_job_results_output.rs @@ -0,0 +1,110 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +#[allow(missing_docs)] // documentation missing in model +#[non_exhaustive] +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)] +pub struct ListSearchJobResultsOutput { + ///

The results consist of either EBSResultItem or S3ResultItem.

+ pub results: ::std::vec::Vec, + ///

The next item following a partial list of search job results.

+ ///

For example, if a request is made to return MaxResults number of backups, NextToken allows you to return more items in your list starting at the location pointed to by the next token.

+ pub next_token: ::std::option::Option<::std::string::String>, + _request_id: Option, +} +impl ListSearchJobResultsOutput { + ///

The results consist of either EBSResultItem or S3ResultItem.

+ pub fn results(&self) -> &[crate::types::ResultItem] { + use std::ops::Deref; + self.results.deref() + } + ///

The next item following a partial list of search job results.

+ ///

For example, if a request is made to return MaxResults number of backups, NextToken allows you to return more items in your list starting at the location pointed to by the next token.

+ pub fn next_token(&self) -> ::std::option::Option<&str> { + self.next_token.as_deref() + } +} +impl ::aws_types::request_id::RequestId for ListSearchJobResultsOutput { + fn request_id(&self) -> Option<&str> { + self._request_id.as_deref() + } +} +impl ListSearchJobResultsOutput { + /// Creates a new builder-style object to manufacture [`ListSearchJobResultsOutput`](crate::operation::list_search_job_results::ListSearchJobResultsOutput). + pub fn builder() -> crate::operation::list_search_job_results::builders::ListSearchJobResultsOutputBuilder { + crate::operation::list_search_job_results::builders::ListSearchJobResultsOutputBuilder::default() + } +} + +/// A builder for [`ListSearchJobResultsOutput`](crate::operation::list_search_job_results::ListSearchJobResultsOutput). +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)] +#[non_exhaustive] +pub struct ListSearchJobResultsOutputBuilder { + pub(crate) results: ::std::option::Option<::std::vec::Vec>, + pub(crate) next_token: ::std::option::Option<::std::string::String>, + _request_id: Option, +} +impl ListSearchJobResultsOutputBuilder { + /// Appends an item to `results`. + /// + /// To override the contents of this collection use [`set_results`](Self::set_results). + /// + ///

The results consist of either EBSResultItem or S3ResultItem.

+ pub fn results(mut self, input: crate::types::ResultItem) -> Self { + let mut v = self.results.unwrap_or_default(); + v.push(input); + self.results = ::std::option::Option::Some(v); + self + } + ///

The results consist of either EBSResultItem or S3ResultItem.

+ pub fn set_results(mut self, input: ::std::option::Option<::std::vec::Vec>) -> Self { + self.results = input; + self + } + ///

The results consist of either EBSResultItem or S3ResultItem.

+ pub fn get_results(&self) -> &::std::option::Option<::std::vec::Vec> { + &self.results + } + ///

The next item following a partial list of search job results.

+ ///

For example, if a request is made to return MaxResults number of backups, NextToken allows you to return more items in your list starting at the location pointed to by the next token.

+ pub fn next_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.next_token = ::std::option::Option::Some(input.into()); + self + } + ///

The next item following a partial list of search job results.

+ ///

For example, if a request is made to return MaxResults number of backups, NextToken allows you to return more items in your list starting at the location pointed to by the next token.

+ pub fn set_next_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.next_token = input; + self + } + ///

The next item following a partial list of search job results.

+ ///

For example, if a request is made to return MaxResults number of backups, NextToken allows you to return more items in your list starting at the location pointed to by the next token.

+ pub fn get_next_token(&self) -> &::std::option::Option<::std::string::String> { + &self.next_token + } + pub(crate) fn _request_id(mut self, request_id: impl Into) -> Self { + self._request_id = Some(request_id.into()); + self + } + + pub(crate) fn _set_request_id(&mut self, request_id: Option) -> &mut Self { + self._request_id = request_id; + self + } + /// Consumes the builder and constructs a [`ListSearchJobResultsOutput`](crate::operation::list_search_job_results::ListSearchJobResultsOutput). + /// This method will fail if any of the following fields are not set: + /// - [`results`](crate::operation::list_search_job_results::builders::ListSearchJobResultsOutputBuilder::results) + pub fn build( + self, + ) -> ::std::result::Result + { + ::std::result::Result::Ok(crate::operation::list_search_job_results::ListSearchJobResultsOutput { + results: self.results.ok_or_else(|| { + ::aws_smithy_types::error::operation::BuildError::missing_field( + "results", + "results was not specified but it is required when building ListSearchJobResultsOutput", + ) + })?, + next_token: self.next_token, + _request_id: self._request_id, + }) + } +} diff --git a/sdk/backupsearch/src/operation/list_search_job_results/builders.rs b/sdk/backupsearch/src/operation/list_search_job_results/builders.rs new file mode 100644 index 000000000000..ce872525f17a --- /dev/null +++ b/sdk/backupsearch/src/operation/list_search_job_results/builders.rs @@ -0,0 +1,162 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +pub use crate::operation::list_search_job_results::_list_search_job_results_output::ListSearchJobResultsOutputBuilder; + +pub use crate::operation::list_search_job_results::_list_search_job_results_input::ListSearchJobResultsInputBuilder; + +impl crate::operation::list_search_job_results::builders::ListSearchJobResultsInputBuilder { + /// Sends a request with this input using the given client. + pub async fn send_with( + self, + client: &crate::Client, + ) -> ::std::result::Result< + crate::operation::list_search_job_results::ListSearchJobResultsOutput, + ::aws_smithy_runtime_api::client::result::SdkError< + crate::operation::list_search_job_results::ListSearchJobResultsError, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >, + > { + let mut fluent_builder = client.list_search_job_results(); + fluent_builder.inner = self; + fluent_builder.send().await + } +} +/// Fluent builder constructing a request to `ListSearchJobResults`. +/// +///

This operation returns a list of a specified search job.

+#[derive(::std::clone::Clone, ::std::fmt::Debug)] +pub struct ListSearchJobResultsFluentBuilder { + handle: ::std::sync::Arc, + inner: crate::operation::list_search_job_results::builders::ListSearchJobResultsInputBuilder, + config_override: ::std::option::Option, +} +impl + crate::client::customize::internal::CustomizableSend< + crate::operation::list_search_job_results::ListSearchJobResultsOutput, + crate::operation::list_search_job_results::ListSearchJobResultsError, + > for ListSearchJobResultsFluentBuilder +{ + fn send( + self, + config_override: crate::config::Builder, + ) -> crate::client::customize::internal::BoxFuture< + crate::client::customize::internal::SendResult< + crate::operation::list_search_job_results::ListSearchJobResultsOutput, + crate::operation::list_search_job_results::ListSearchJobResultsError, + >, + > { + ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await }) + } +} +impl ListSearchJobResultsFluentBuilder { + /// Creates a new `ListSearchJobResultsFluentBuilder`. + pub(crate) fn new(handle: ::std::sync::Arc) -> Self { + Self { + handle, + inner: ::std::default::Default::default(), + config_override: ::std::option::Option::None, + } + } + /// Access the ListSearchJobResults as a reference. + pub fn as_input(&self) -> &crate::operation::list_search_job_results::builders::ListSearchJobResultsInputBuilder { + &self.inner + } + /// Sends the request and returns the response. + /// + /// If an error occurs, an `SdkError` will be returned with additional details that + /// can be matched against. + /// + /// By default, any retryable failures will be retried twice. Retry behavior + /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be + /// set when configuring the client. + pub async fn send( + self, + ) -> ::std::result::Result< + crate::operation::list_search_job_results::ListSearchJobResultsOutput, + ::aws_smithy_runtime_api::client::result::SdkError< + crate::operation::list_search_job_results::ListSearchJobResultsError, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >, + > { + let input = self + .inner + .build() + .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?; + let runtime_plugins = crate::operation::list_search_job_results::ListSearchJobResults::operation_runtime_plugins( + self.handle.runtime_plugins.clone(), + &self.handle.conf, + self.config_override, + ); + crate::operation::list_search_job_results::ListSearchJobResults::orchestrate(&runtime_plugins, input).await + } + + /// Consumes this builder, creating a customizable operation that can be modified before being sent. + pub fn customize( + self, + ) -> crate::client::customize::CustomizableOperation< + crate::operation::list_search_job_results::ListSearchJobResultsOutput, + crate::operation::list_search_job_results::ListSearchJobResultsError, + Self, + > { + crate::client::customize::CustomizableOperation::new(self) + } + pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into) -> Self { + self.set_config_override(::std::option::Option::Some(config_override.into())); + self + } + + pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option) -> &mut Self { + self.config_override = config_override; + self + } + /// Create a paginator for this request + /// + /// Paginators are used by calling [`send().await`](crate::operation::list_search_job_results::paginator::ListSearchJobResultsPaginator::send) which returns a [`PaginationStream`](aws_smithy_async::future::pagination_stream::PaginationStream). + pub fn into_paginator(self) -> crate::operation::list_search_job_results::paginator::ListSearchJobResultsPaginator { + crate::operation::list_search_job_results::paginator::ListSearchJobResultsPaginator::new(self.handle, self.inner) + } + ///

The unique string that specifies the search job.

+ pub fn search_job_identifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.inner = self.inner.search_job_identifier(input.into()); + self + } + ///

The unique string that specifies the search job.

+ pub fn set_search_job_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.inner = self.inner.set_search_job_identifier(input); + self + } + ///

The unique string that specifies the search job.

+ pub fn get_search_job_identifier(&self) -> &::std::option::Option<::std::string::String> { + self.inner.get_search_job_identifier() + } + ///

The next item following a partial list of returned search job results.

+ ///

For example, if a request is made to return MaxResults number of search job results, NextToken allows you to return more items in your list starting at the location pointed to by the next token.

+ pub fn next_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.inner = self.inner.next_token(input.into()); + self + } + ///

The next item following a partial list of returned search job results.

+ ///

For example, if a request is made to return MaxResults number of search job results, NextToken allows you to return more items in your list starting at the location pointed to by the next token.

+ pub fn set_next_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.inner = self.inner.set_next_token(input); + self + } + ///

The next item following a partial list of returned search job results.

+ ///

For example, if a request is made to return MaxResults number of search job results, NextToken allows you to return more items in your list starting at the location pointed to by the next token.

+ pub fn get_next_token(&self) -> &::std::option::Option<::std::string::String> { + self.inner.get_next_token() + } + ///

The maximum number of resource list items to be returned.

+ pub fn max_results(mut self, input: i32) -> Self { + self.inner = self.inner.max_results(input); + self + } + ///

The maximum number of resource list items to be returned.

+ pub fn set_max_results(mut self, input: ::std::option::Option) -> Self { + self.inner = self.inner.set_max_results(input); + self + } + ///

The maximum number of resource list items to be returned.

+ pub fn get_max_results(&self) -> &::std::option::Option { + self.inner.get_max_results() + } +} diff --git a/sdk/backupsearch/src/operation/list_search_job_results/paginator.rs b/sdk/backupsearch/src/operation/list_search_job_results/paginator.rs new file mode 100644 index 000000000000..1119eddbb0ec --- /dev/null +++ b/sdk/backupsearch/src/operation/list_search_job_results/paginator.rs @@ -0,0 +1,149 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +/// Paginator for [`ListSearchJobResults`](crate::operation::list_search_job_results::ListSearchJobResults) +pub struct ListSearchJobResultsPaginator { + handle: std::sync::Arc, + builder: crate::operation::list_search_job_results::builders::ListSearchJobResultsInputBuilder, + stop_on_duplicate_token: bool, +} + +impl ListSearchJobResultsPaginator { + /// Create a new paginator-wrapper + pub(crate) fn new( + handle: std::sync::Arc, + builder: crate::operation::list_search_job_results::builders::ListSearchJobResultsInputBuilder, + ) -> Self { + Self { + handle, + builder, + stop_on_duplicate_token: true, + } + } + + /// Set the page size + /// + /// _Note: this method will override any previously set value for `max_results`_ + pub fn page_size(mut self, limit: i32) -> Self { + self.builder.max_results = ::std::option::Option::Some(limit); + self + } + + /// Create a flattened paginator + /// + /// This paginator automatically flattens results using `results`. Queries to the underlying service + /// are dispatched lazily. + pub fn items(self) -> crate::operation::list_search_job_results::paginator::ListSearchJobResultsPaginatorItems { + crate::operation::list_search_job_results::paginator::ListSearchJobResultsPaginatorItems(self) + } + + /// Stop paginating when the service returns the same pagination token twice in a row. + /// + /// Defaults to true. + /// + /// For certain operations, it may be useful to continue on duplicate token. For example, + /// if an operation is for tailing a log file in real-time, then continuing may be desired. + /// This option can be set to `false` to accommodate these use cases. + pub fn stop_on_duplicate_token(mut self, stop_on_duplicate_token: bool) -> Self { + self.stop_on_duplicate_token = stop_on_duplicate_token; + self + } + + /// Create the pagination stream + /// + /// _Note:_ No requests will be dispatched until the stream is used + /// (e.g. with the [`.next().await`](aws_smithy_async::future::pagination_stream::PaginationStream::next) method). + pub fn send( + self, + ) -> ::aws_smithy_async::future::pagination_stream::PaginationStream< + ::std::result::Result< + crate::operation::list_search_job_results::ListSearchJobResultsOutput, + ::aws_smithy_runtime_api::client::result::SdkError< + crate::operation::list_search_job_results::ListSearchJobResultsError, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >, + >, + > { + // Move individual fields out of self for the borrow checker + let builder = self.builder; + let handle = self.handle; + let runtime_plugins = crate::operation::list_search_job_results::ListSearchJobResults::operation_runtime_plugins( + handle.runtime_plugins.clone(), + &handle.conf, + ::std::option::Option::None, + ) + .with_operation_plugin(crate::sdk_feature_tracker::paginator::PaginatorFeatureTrackerRuntimePlugin::new()); + ::aws_smithy_async::future::pagination_stream::PaginationStream::new(::aws_smithy_async::future::pagination_stream::fn_stream::FnStream::new( + move |tx| { + ::std::boxed::Box::pin(async move { + // Build the input for the first time. If required fields are missing, this is where we'll produce an early error. + let mut input = match builder + .build() + .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure) + { + ::std::result::Result::Ok(input) => input, + ::std::result::Result::Err(e) => { + let _ = tx.send(::std::result::Result::Err(e)).await; + return; + } + }; + loop { + let resp = + crate::operation::list_search_job_results::ListSearchJobResults::orchestrate(&runtime_plugins, input.clone()).await; + // If the input member is None or it was an error + let done = match resp { + ::std::result::Result::Ok(ref resp) => { + let new_token = crate::lens::reflens_list_search_job_results_output_output_next_token(resp); + // Pagination is exhausted when the next token is an empty string + let is_empty = new_token.map(|token| token.is_empty()).unwrap_or(true); + if !is_empty && new_token == input.next_token.as_ref() && self.stop_on_duplicate_token { + true + } else { + input.next_token = new_token.cloned(); + is_empty + } + } + ::std::result::Result::Err(_) => true, + }; + if tx.send(resp).await.is_err() { + // receiving end was dropped + return; + } + if done { + return; + } + } + }) + }, + )) + } +} + +/// Flattened paginator for `ListSearchJobResultsPaginator` +/// +/// This is created with [`.items()`](ListSearchJobResultsPaginator::items) +pub struct ListSearchJobResultsPaginatorItems(ListSearchJobResultsPaginator); + +impl ListSearchJobResultsPaginatorItems { + /// Create the pagination stream + /// + /// _Note_: No requests will be dispatched until the stream is used + /// (e.g. with the [`.next().await`](aws_smithy_async::future::pagination_stream::PaginationStream::next) method). + /// + /// To read the entirety of the paginator, use [`.collect::, _>()`](aws_smithy_async::future::pagination_stream::PaginationStream::collect). + pub fn send( + self, + ) -> ::aws_smithy_async::future::pagination_stream::PaginationStream< + ::std::result::Result< + crate::types::ResultItem, + ::aws_smithy_runtime_api::client::result::SdkError< + crate::operation::list_search_job_results::ListSearchJobResultsError, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >, + >, + > { + ::aws_smithy_async::future::pagination_stream::TryFlatMap::new(self.0.send()).flat_map(|page| { + crate::lens::lens_list_search_job_results_output_output_results(page) + .unwrap_or_default() + .into_iter() + }) + } +} diff --git a/sdk/backupsearch/src/operation/list_search_jobs.rs b/sdk/backupsearch/src/operation/list_search_jobs.rs new file mode 100644 index 000000000000..19fe810b5f90 --- /dev/null +++ b/sdk/backupsearch/src/operation/list_search_jobs.rs @@ -0,0 +1,408 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +/// Orchestration and serialization glue logic for `ListSearchJobs`. +#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)] +#[non_exhaustive] +pub struct ListSearchJobs; +impl ListSearchJobs { + /// Creates a new `ListSearchJobs` + pub fn new() -> Self { + Self + } + pub(crate) async fn orchestrate( + runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, + input: crate::operation::list_search_jobs::ListSearchJobsInput, + ) -> ::std::result::Result< + crate::operation::list_search_jobs::ListSearchJobsOutput, + ::aws_smithy_runtime_api::client::result::SdkError< + crate::operation::list_search_jobs::ListSearchJobsError, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >, + > { + let map_err = |err: ::aws_smithy_runtime_api::client::result::SdkError< + ::aws_smithy_runtime_api::client::interceptors::context::Error, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >| { + err.map_service_error(|err| { + err.downcast::() + .expect("correct error type") + }) + }; + let context = Self::orchestrate_with_stop_point(runtime_plugins, input, ::aws_smithy_runtime::client::orchestrator::StopPoint::None) + .await + .map_err(map_err)?; + let output = context.finalize().map_err(map_err)?; + ::std::result::Result::Ok( + output + .downcast::() + .expect("correct output type"), + ) + } + + pub(crate) async fn orchestrate_with_stop_point( + runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, + input: crate::operation::list_search_jobs::ListSearchJobsInput, + stop_point: ::aws_smithy_runtime::client::orchestrator::StopPoint, + ) -> ::std::result::Result< + ::aws_smithy_runtime_api::client::interceptors::context::InterceptorContext, + ::aws_smithy_runtime_api::client::result::SdkError< + ::aws_smithy_runtime_api::client::interceptors::context::Error, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >, + > { + let input = ::aws_smithy_runtime_api::client::interceptors::context::Input::erase(input); + ::aws_smithy_runtime::client::orchestrator::invoke_with_stop_point("backupsearch", "ListSearchJobs", input, runtime_plugins, stop_point).await + } + + pub(crate) fn operation_runtime_plugins( + client_runtime_plugins: ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, + client_config: &crate::config::Config, + config_override: ::std::option::Option, + ) -> ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins { + let mut runtime_plugins = client_runtime_plugins.with_operation_plugin(Self::new()); + runtime_plugins = runtime_plugins.with_client_plugin(crate::auth_plugin::DefaultAuthOptionsPlugin::new(vec![ + ::aws_runtime::auth::sigv4::SCHEME_ID, + ])); + if let ::std::option::Option::Some(config_override) = config_override { + for plugin in config_override.runtime_plugins.iter().cloned() { + runtime_plugins = runtime_plugins.with_operation_plugin(plugin); + } + runtime_plugins = runtime_plugins.with_operation_plugin(crate::config::ConfigOverrideRuntimePlugin::new( + config_override, + client_config.config.clone(), + &client_config.runtime_components, + )); + } + runtime_plugins + } +} +impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for ListSearchJobs { + fn config(&self) -> ::std::option::Option<::aws_smithy_types::config_bag::FrozenLayer> { + let mut cfg = ::aws_smithy_types::config_bag::Layer::new("ListSearchJobs"); + + cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new( + ListSearchJobsRequestSerializer, + )); + cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new( + ListSearchJobsResponseDeserializer, + )); + + cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new( + ::aws_smithy_runtime_api::client::auth::static_resolver::StaticAuthSchemeOptionResolverParams::new(), + )); + + cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::Metadata::new( + "ListSearchJobs", + "backupsearch", + )); + let mut signing_options = ::aws_runtime::auth::SigningOptions::default(); + signing_options.double_uri_encode = true; + signing_options.content_sha256_header = false; + signing_options.normalize_uri_path = true; + signing_options.payload_override = None; + + cfg.store_put(::aws_runtime::auth::SigV4OperationSigningConfig { + signing_options, + ..::std::default::Default::default() + }); + + ::std::option::Option::Some(cfg.freeze()) + } + + fn runtime_components( + &self, + _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder, + ) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> { + #[allow(unused_mut)] + let mut rcb = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("ListSearchJobs") + .with_interceptor(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default()) + .with_interceptor(ListSearchJobsEndpointParamsInterceptor) + .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::< + crate::operation::list_search_jobs::ListSearchJobsError, + >::new()) + .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::< + crate::operation::list_search_jobs::ListSearchJobsError, + >::new()) + .with_retry_classifier(::aws_runtime::retries::classifiers::AwsErrorCodeClassifier::< + crate::operation::list_search_jobs::ListSearchJobsError, + >::new()); + + ::std::borrow::Cow::Owned(rcb) + } +} + +#[derive(Debug)] +struct ListSearchJobsResponseDeserializer; +impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for ListSearchJobsResponseDeserializer { + fn deserialize_nonstreaming( + &self, + response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError { + let (success, status) = (response.status().is_success(), response.status().as_u16()); + let headers = response.headers(); + let body = response.body().bytes().expect("body loaded"); + #[allow(unused_mut)] + let mut force_error = false; + ::tracing::debug!(request_id = ?::aws_types::request_id::RequestId::request_id(response)); + let parse_result = if !success && status != 200 || force_error { + crate::protocol_serde::shape_list_search_jobs::de_list_search_jobs_http_error(status, headers, body) + } else { + crate::protocol_serde::shape_list_search_jobs::de_list_search_jobs_http_response(status, headers, body) + }; + crate::protocol_serde::type_erase_result(parse_result) + } +} +#[derive(Debug)] +struct ListSearchJobsRequestSerializer; +impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for ListSearchJobsRequestSerializer { + #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)] + fn serialize_input( + &self, + input: ::aws_smithy_runtime_api::client::interceptors::context::Input, + _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag, + ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> { + let input = input + .downcast::() + .expect("correct type"); + let _header_serialization_settings = _cfg + .load::() + .cloned() + .unwrap_or_default(); + let mut request_builder = { + fn uri_base( + _input: &crate::operation::list_search_jobs::ListSearchJobsInput, + output: &mut ::std::string::String, + ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> { + use ::std::fmt::Write as _; + ::std::write!(output, "/search-jobs").expect("formatting should succeed"); + ::std::result::Result::Ok(()) + } + fn uri_query( + _input: &crate::operation::list_search_jobs::ListSearchJobsInput, + mut output: &mut ::std::string::String, + ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> { + let mut query = ::aws_smithy_http::query::Writer::new(output); + if let ::std::option::Option::Some(inner_1) = &_input.by_status { + { + query.push_kv("Status", &::aws_smithy_http::query::fmt_string(inner_1)); + } + } + if let ::std::option::Option::Some(inner_2) = &_input.next_token { + { + query.push_kv("NextToken", &::aws_smithy_http::query::fmt_string(inner_2)); + } + } + if let ::std::option::Option::Some(inner_3) = &_input.max_results { + { + query.push_kv("MaxResults", ::aws_smithy_types::primitive::Encoder::from(*inner_3).encode()); + } + } + ::std::result::Result::Ok(()) + } + #[allow(clippy::unnecessary_wraps)] + fn update_http_builder( + input: &crate::operation::list_search_jobs::ListSearchJobsInput, + builder: ::http::request::Builder, + ) -> ::std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> { + let mut uri = ::std::string::String::new(); + uri_base(input, &mut uri)?; + uri_query(input, &mut uri)?; + ::std::result::Result::Ok(builder.method("GET").uri(uri)) + } + let mut builder = update_http_builder(&input, ::http::request::Builder::new())?; + builder + }; + let body = ::aws_smithy_types::body::SdkBody::from(""); + + ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap()) + } +} +#[derive(Debug)] +struct ListSearchJobsEndpointParamsInterceptor; + +impl ::aws_smithy_runtime_api::client::interceptors::Intercept for ListSearchJobsEndpointParamsInterceptor { + fn name(&self) -> &'static str { + "ListSearchJobsEndpointParamsInterceptor" + } + + fn read_before_execution( + &self, + context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef< + '_, + ::aws_smithy_runtime_api::client::interceptors::context::Input, + ::aws_smithy_runtime_api::client::interceptors::context::Output, + ::aws_smithy_runtime_api::client::interceptors::context::Error, + >, + cfg: &mut ::aws_smithy_types::config_bag::ConfigBag, + ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> { + let _input = context + .input() + .downcast_ref::() + .ok_or("failed to downcast to ListSearchJobsInput")?; + + let params = crate::config::endpoint::Params::builder() + .set_use_fips(cfg.load::<::aws_types::endpoint_config::UseFips>().map(|ty| ty.0)) + .set_endpoint(cfg.load::<::aws_types::endpoint_config::EndpointUrl>().map(|ty| ty.0.clone())) + .set_region(cfg.load::<::aws_types::region::Region>().map(|r| r.as_ref().to_owned())) + .build() + .map_err(|err| { + ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err) + })?; + cfg.interceptor_state() + .store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params)); + ::std::result::Result::Ok(()) + } +} + +// The get_* functions below are generated from JMESPath expressions in the +// operationContextParams trait. They target the operation's input shape. + +/// Error type for the `ListSearchJobsError` operation. +#[non_exhaustive] +#[derive(::std::fmt::Debug)] +pub enum ListSearchJobsError { + ///

You do not have sufficient access to perform this action.

+ AccessDeniedException(crate::types::error::AccessDeniedException), + ///

An internal server error occurred. Retry your request.

+ InternalServerException(crate::types::error::InternalServerException), + ///

The request was denied due to request throttling.

+ ThrottlingException(crate::types::error::ThrottlingException), + ///

The input fails to satisfy the constraints specified by a service.

+ ValidationException(crate::types::error::ValidationException), + /// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code). + #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \ + variable wildcard pattern and check `.code()`: + \ +    `err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }` + \ + See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-ListSearchJobsError) for what information is available for the error.")] + Unhandled(crate::error::sealed_unhandled::Unhandled), +} +impl ListSearchJobsError { + /// Creates the `ListSearchJobsError::Unhandled` variant from any error type. + pub fn unhandled( + err: impl ::std::convert::Into<::std::boxed::Box>, + ) -> Self { + Self::Unhandled(crate::error::sealed_unhandled::Unhandled { + source: err.into(), + meta: ::std::default::Default::default(), + }) + } + + /// Creates the `ListSearchJobsError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata). + pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self { + Self::Unhandled(crate::error::sealed_unhandled::Unhandled { + source: err.clone().into(), + meta: err, + }) + } + /// + /// Returns error metadata, which includes the error code, message, + /// request ID, and potentially additional information. + /// + pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata { + match self { + Self::AccessDeniedException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), + Self::InternalServerException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), + Self::ThrottlingException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), + Self::ValidationException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), + Self::Unhandled(e) => &e.meta, + } + } + /// Returns `true` if the error kind is `ListSearchJobsError::AccessDeniedException`. + pub fn is_access_denied_exception(&self) -> bool { + matches!(self, Self::AccessDeniedException(_)) + } + /// Returns `true` if the error kind is `ListSearchJobsError::InternalServerException`. + pub fn is_internal_server_exception(&self) -> bool { + matches!(self, Self::InternalServerException(_)) + } + /// Returns `true` if the error kind is `ListSearchJobsError::ThrottlingException`. + pub fn is_throttling_exception(&self) -> bool { + matches!(self, Self::ThrottlingException(_)) + } + /// Returns `true` if the error kind is `ListSearchJobsError::ValidationException`. + pub fn is_validation_exception(&self) -> bool { + matches!(self, Self::ValidationException(_)) + } +} +impl ::std::error::Error for ListSearchJobsError { + fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> { + match self { + Self::AccessDeniedException(_inner) => ::std::option::Option::Some(_inner), + Self::InternalServerException(_inner) => ::std::option::Option::Some(_inner), + Self::ThrottlingException(_inner) => ::std::option::Option::Some(_inner), + Self::ValidationException(_inner) => ::std::option::Option::Some(_inner), + Self::Unhandled(_inner) => ::std::option::Option::Some(&*_inner.source), + } + } +} +impl ::std::fmt::Display for ListSearchJobsError { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + match self { + Self::AccessDeniedException(_inner) => _inner.fmt(f), + Self::InternalServerException(_inner) => _inner.fmt(f), + Self::ThrottlingException(_inner) => _inner.fmt(f), + Self::ValidationException(_inner) => _inner.fmt(f), + Self::Unhandled(_inner) => { + if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) { + write!(f, "unhandled error ({code})") + } else { + f.write_str("unhandled error") + } + } + } + } +} +impl ::aws_smithy_types::retry::ProvideErrorKind for ListSearchJobsError { + fn code(&self) -> ::std::option::Option<&str> { + ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) + } + fn retryable_error_kind(&self) -> ::std::option::Option<::aws_smithy_types::retry::ErrorKind> { + match self { + Self::InternalServerException(inner) => ::std::option::Option::Some(inner.retryable_error_kind()), + Self::ThrottlingException(inner) => ::std::option::Option::Some(inner.retryable_error_kind()), + _ => ::std::option::Option::None, + } + } +} +impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for ListSearchJobsError { + fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata { + match self { + Self::AccessDeniedException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner), + Self::InternalServerException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner), + Self::ThrottlingException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner), + Self::ValidationException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner), + Self::Unhandled(_inner) => &_inner.meta, + } + } +} +impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for ListSearchJobsError { + fn create_unhandled_error( + source: ::std::boxed::Box, + meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>, + ) -> Self { + Self::Unhandled(crate::error::sealed_unhandled::Unhandled { + source, + meta: meta.unwrap_or_default(), + }) + } +} +impl ::aws_types::request_id::RequestId for crate::operation::list_search_jobs::ListSearchJobsError { + fn request_id(&self) -> Option<&str> { + self.meta().request_id() + } +} + +pub use crate::operation::list_search_jobs::_list_search_jobs_output::ListSearchJobsOutput; + +pub use crate::operation::list_search_jobs::_list_search_jobs_input::ListSearchJobsInput; + +mod _list_search_jobs_input; + +mod _list_search_jobs_output; + +/// Builders +pub mod builders; + +/// Paginator for this operation +pub mod paginator; diff --git a/sdk/backupsearch/src/operation/list_search_jobs/_list_search_jobs_input.rs b/sdk/backupsearch/src/operation/list_search_jobs/_list_search_jobs_input.rs new file mode 100644 index 000000000000..5e3ca84c2c38 --- /dev/null +++ b/sdk/backupsearch/src/operation/list_search_jobs/_list_search_jobs_input.rs @@ -0,0 +1,100 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +#[allow(missing_docs)] // documentation missing in model +#[non_exhaustive] +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)] +pub struct ListSearchJobsInput { + ///

Include this parameter to filter list by search job status.

+ pub by_status: ::std::option::Option, + ///

The next item following a partial list of returned search jobs.

+ ///

For example, if a request is made to return MaxResults number of backups, NextToken allows you to return more items in your list starting at the location pointed to by the next token.

+ pub next_token: ::std::option::Option<::std::string::String>, + ///

The maximum number of resource list items to be returned.

+ pub max_results: ::std::option::Option, +} +impl ListSearchJobsInput { + ///

Include this parameter to filter list by search job status.

+ pub fn by_status(&self) -> ::std::option::Option<&crate::types::SearchJobState> { + self.by_status.as_ref() + } + ///

The next item following a partial list of returned search jobs.

+ ///

For example, if a request is made to return MaxResults number of backups, NextToken allows you to return more items in your list starting at the location pointed to by the next token.

+ pub fn next_token(&self) -> ::std::option::Option<&str> { + self.next_token.as_deref() + } + ///

The maximum number of resource list items to be returned.

+ pub fn max_results(&self) -> ::std::option::Option { + self.max_results + } +} +impl ListSearchJobsInput { + /// Creates a new builder-style object to manufacture [`ListSearchJobsInput`](crate::operation::list_search_jobs::ListSearchJobsInput). + pub fn builder() -> crate::operation::list_search_jobs::builders::ListSearchJobsInputBuilder { + crate::operation::list_search_jobs::builders::ListSearchJobsInputBuilder::default() + } +} + +/// A builder for [`ListSearchJobsInput`](crate::operation::list_search_jobs::ListSearchJobsInput). +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)] +#[non_exhaustive] +pub struct ListSearchJobsInputBuilder { + pub(crate) by_status: ::std::option::Option, + pub(crate) next_token: ::std::option::Option<::std::string::String>, + pub(crate) max_results: ::std::option::Option, +} +impl ListSearchJobsInputBuilder { + ///

Include this parameter to filter list by search job status.

+ pub fn by_status(mut self, input: crate::types::SearchJobState) -> Self { + self.by_status = ::std::option::Option::Some(input); + self + } + ///

Include this parameter to filter list by search job status.

+ pub fn set_by_status(mut self, input: ::std::option::Option) -> Self { + self.by_status = input; + self + } + ///

Include this parameter to filter list by search job status.

+ pub fn get_by_status(&self) -> &::std::option::Option { + &self.by_status + } + ///

The next item following a partial list of returned search jobs.

+ ///

For example, if a request is made to return MaxResults number of backups, NextToken allows you to return more items in your list starting at the location pointed to by the next token.

+ pub fn next_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.next_token = ::std::option::Option::Some(input.into()); + self + } + ///

The next item following a partial list of returned search jobs.

+ ///

For example, if a request is made to return MaxResults number of backups, NextToken allows you to return more items in your list starting at the location pointed to by the next token.

+ pub fn set_next_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.next_token = input; + self + } + ///

The next item following a partial list of returned search jobs.

+ ///

For example, if a request is made to return MaxResults number of backups, NextToken allows you to return more items in your list starting at the location pointed to by the next token.

+ pub fn get_next_token(&self) -> &::std::option::Option<::std::string::String> { + &self.next_token + } + ///

The maximum number of resource list items to be returned.

+ pub fn max_results(mut self, input: i32) -> Self { + self.max_results = ::std::option::Option::Some(input); + self + } + ///

The maximum number of resource list items to be returned.

+ pub fn set_max_results(mut self, input: ::std::option::Option) -> Self { + self.max_results = input; + self + } + ///

The maximum number of resource list items to be returned.

+ pub fn get_max_results(&self) -> &::std::option::Option { + &self.max_results + } + /// Consumes the builder and constructs a [`ListSearchJobsInput`](crate::operation::list_search_jobs::ListSearchJobsInput). + pub fn build( + self, + ) -> ::std::result::Result { + ::std::result::Result::Ok(crate::operation::list_search_jobs::ListSearchJobsInput { + by_status: self.by_status, + next_token: self.next_token, + max_results: self.max_results, + }) + } +} diff --git a/sdk/backupsearch/src/operation/list_search_jobs/_list_search_jobs_output.rs b/sdk/backupsearch/src/operation/list_search_jobs/_list_search_jobs_output.rs new file mode 100644 index 000000000000..c2cbd791b739 --- /dev/null +++ b/sdk/backupsearch/src/operation/list_search_jobs/_list_search_jobs_output.rs @@ -0,0 +1,109 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +#[allow(missing_docs)] // documentation missing in model +#[non_exhaustive] +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)] +pub struct ListSearchJobsOutput { + ///

The search jobs among the list, with details of the returned search jobs.

+ pub search_jobs: ::std::vec::Vec, + ///

The next item following a partial list of returned backups included in a search job.

+ ///

For example, if a request is made to return MaxResults number of backups, NextToken allows you to return more items in your list starting at the location pointed to by the next token.

+ pub next_token: ::std::option::Option<::std::string::String>, + _request_id: Option, +} +impl ListSearchJobsOutput { + ///

The search jobs among the list, with details of the returned search jobs.

+ pub fn search_jobs(&self) -> &[crate::types::SearchJobSummary] { + use std::ops::Deref; + self.search_jobs.deref() + } + ///

The next item following a partial list of returned backups included in a search job.

+ ///

For example, if a request is made to return MaxResults number of backups, NextToken allows you to return more items in your list starting at the location pointed to by the next token.

+ pub fn next_token(&self) -> ::std::option::Option<&str> { + self.next_token.as_deref() + } +} +impl ::aws_types::request_id::RequestId for ListSearchJobsOutput { + fn request_id(&self) -> Option<&str> { + self._request_id.as_deref() + } +} +impl ListSearchJobsOutput { + /// Creates a new builder-style object to manufacture [`ListSearchJobsOutput`](crate::operation::list_search_jobs::ListSearchJobsOutput). + pub fn builder() -> crate::operation::list_search_jobs::builders::ListSearchJobsOutputBuilder { + crate::operation::list_search_jobs::builders::ListSearchJobsOutputBuilder::default() + } +} + +/// A builder for [`ListSearchJobsOutput`](crate::operation::list_search_jobs::ListSearchJobsOutput). +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)] +#[non_exhaustive] +pub struct ListSearchJobsOutputBuilder { + pub(crate) search_jobs: ::std::option::Option<::std::vec::Vec>, + pub(crate) next_token: ::std::option::Option<::std::string::String>, + _request_id: Option, +} +impl ListSearchJobsOutputBuilder { + /// Appends an item to `search_jobs`. + /// + /// To override the contents of this collection use [`set_search_jobs`](Self::set_search_jobs). + /// + ///

The search jobs among the list, with details of the returned search jobs.

+ pub fn search_jobs(mut self, input: crate::types::SearchJobSummary) -> Self { + let mut v = self.search_jobs.unwrap_or_default(); + v.push(input); + self.search_jobs = ::std::option::Option::Some(v); + self + } + ///

The search jobs among the list, with details of the returned search jobs.

+ pub fn set_search_jobs(mut self, input: ::std::option::Option<::std::vec::Vec>) -> Self { + self.search_jobs = input; + self + } + ///

The search jobs among the list, with details of the returned search jobs.

+ pub fn get_search_jobs(&self) -> &::std::option::Option<::std::vec::Vec> { + &self.search_jobs + } + ///

The next item following a partial list of returned backups included in a search job.

+ ///

For example, if a request is made to return MaxResults number of backups, NextToken allows you to return more items in your list starting at the location pointed to by the next token.

+ pub fn next_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.next_token = ::std::option::Option::Some(input.into()); + self + } + ///

The next item following a partial list of returned backups included in a search job.

+ ///

For example, if a request is made to return MaxResults number of backups, NextToken allows you to return more items in your list starting at the location pointed to by the next token.

+ pub fn set_next_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.next_token = input; + self + } + ///

The next item following a partial list of returned backups included in a search job.

+ ///

For example, if a request is made to return MaxResults number of backups, NextToken allows you to return more items in your list starting at the location pointed to by the next token.

+ pub fn get_next_token(&self) -> &::std::option::Option<::std::string::String> { + &self.next_token + } + pub(crate) fn _request_id(mut self, request_id: impl Into) -> Self { + self._request_id = Some(request_id.into()); + self + } + + pub(crate) fn _set_request_id(&mut self, request_id: Option) -> &mut Self { + self._request_id = request_id; + self + } + /// Consumes the builder and constructs a [`ListSearchJobsOutput`](crate::operation::list_search_jobs::ListSearchJobsOutput). + /// This method will fail if any of the following fields are not set: + /// - [`search_jobs`](crate::operation::list_search_jobs::builders::ListSearchJobsOutputBuilder::search_jobs) + pub fn build( + self, + ) -> ::std::result::Result { + ::std::result::Result::Ok(crate::operation::list_search_jobs::ListSearchJobsOutput { + search_jobs: self.search_jobs.ok_or_else(|| { + ::aws_smithy_types::error::operation::BuildError::missing_field( + "search_jobs", + "search_jobs was not specified but it is required when building ListSearchJobsOutput", + ) + })?, + next_token: self.next_token, + _request_id: self._request_id, + }) + } +} diff --git a/sdk/backupsearch/src/operation/list_search_jobs/builders.rs b/sdk/backupsearch/src/operation/list_search_jobs/builders.rs new file mode 100644 index 000000000000..09cf8226ef18 --- /dev/null +++ b/sdk/backupsearch/src/operation/list_search_jobs/builders.rs @@ -0,0 +1,162 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +pub use crate::operation::list_search_jobs::_list_search_jobs_output::ListSearchJobsOutputBuilder; + +pub use crate::operation::list_search_jobs::_list_search_jobs_input::ListSearchJobsInputBuilder; + +impl crate::operation::list_search_jobs::builders::ListSearchJobsInputBuilder { + /// Sends a request with this input using the given client. + pub async fn send_with( + self, + client: &crate::Client, + ) -> ::std::result::Result< + crate::operation::list_search_jobs::ListSearchJobsOutput, + ::aws_smithy_runtime_api::client::result::SdkError< + crate::operation::list_search_jobs::ListSearchJobsError, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >, + > { + let mut fluent_builder = client.list_search_jobs(); + fluent_builder.inner = self; + fluent_builder.send().await + } +} +/// Fluent builder constructing a request to `ListSearchJobs`. +/// +///

This operation returns a list of search jobs belonging to an account.

+#[derive(::std::clone::Clone, ::std::fmt::Debug)] +pub struct ListSearchJobsFluentBuilder { + handle: ::std::sync::Arc, + inner: crate::operation::list_search_jobs::builders::ListSearchJobsInputBuilder, + config_override: ::std::option::Option, +} +impl + crate::client::customize::internal::CustomizableSend< + crate::operation::list_search_jobs::ListSearchJobsOutput, + crate::operation::list_search_jobs::ListSearchJobsError, + > for ListSearchJobsFluentBuilder +{ + fn send( + self, + config_override: crate::config::Builder, + ) -> crate::client::customize::internal::BoxFuture< + crate::client::customize::internal::SendResult< + crate::operation::list_search_jobs::ListSearchJobsOutput, + crate::operation::list_search_jobs::ListSearchJobsError, + >, + > { + ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await }) + } +} +impl ListSearchJobsFluentBuilder { + /// Creates a new `ListSearchJobsFluentBuilder`. + pub(crate) fn new(handle: ::std::sync::Arc) -> Self { + Self { + handle, + inner: ::std::default::Default::default(), + config_override: ::std::option::Option::None, + } + } + /// Access the ListSearchJobs as a reference. + pub fn as_input(&self) -> &crate::operation::list_search_jobs::builders::ListSearchJobsInputBuilder { + &self.inner + } + /// Sends the request and returns the response. + /// + /// If an error occurs, an `SdkError` will be returned with additional details that + /// can be matched against. + /// + /// By default, any retryable failures will be retried twice. Retry behavior + /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be + /// set when configuring the client. + pub async fn send( + self, + ) -> ::std::result::Result< + crate::operation::list_search_jobs::ListSearchJobsOutput, + ::aws_smithy_runtime_api::client::result::SdkError< + crate::operation::list_search_jobs::ListSearchJobsError, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >, + > { + let input = self + .inner + .build() + .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?; + let runtime_plugins = crate::operation::list_search_jobs::ListSearchJobs::operation_runtime_plugins( + self.handle.runtime_plugins.clone(), + &self.handle.conf, + self.config_override, + ); + crate::operation::list_search_jobs::ListSearchJobs::orchestrate(&runtime_plugins, input).await + } + + /// Consumes this builder, creating a customizable operation that can be modified before being sent. + pub fn customize( + self, + ) -> crate::client::customize::CustomizableOperation< + crate::operation::list_search_jobs::ListSearchJobsOutput, + crate::operation::list_search_jobs::ListSearchJobsError, + Self, + > { + crate::client::customize::CustomizableOperation::new(self) + } + pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into) -> Self { + self.set_config_override(::std::option::Option::Some(config_override.into())); + self + } + + pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option) -> &mut Self { + self.config_override = config_override; + self + } + /// Create a paginator for this request + /// + /// Paginators are used by calling [`send().await`](crate::operation::list_search_jobs::paginator::ListSearchJobsPaginator::send) which returns a [`PaginationStream`](aws_smithy_async::future::pagination_stream::PaginationStream). + pub fn into_paginator(self) -> crate::operation::list_search_jobs::paginator::ListSearchJobsPaginator { + crate::operation::list_search_jobs::paginator::ListSearchJobsPaginator::new(self.handle, self.inner) + } + ///

Include this parameter to filter list by search job status.

+ pub fn by_status(mut self, input: crate::types::SearchJobState) -> Self { + self.inner = self.inner.by_status(input); + self + } + ///

Include this parameter to filter list by search job status.

+ pub fn set_by_status(mut self, input: ::std::option::Option) -> Self { + self.inner = self.inner.set_by_status(input); + self + } + ///

Include this parameter to filter list by search job status.

+ pub fn get_by_status(&self) -> &::std::option::Option { + self.inner.get_by_status() + } + ///

The next item following a partial list of returned search jobs.

+ ///

For example, if a request is made to return MaxResults number of backups, NextToken allows you to return more items in your list starting at the location pointed to by the next token.

+ pub fn next_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.inner = self.inner.next_token(input.into()); + self + } + ///

The next item following a partial list of returned search jobs.

+ ///

For example, if a request is made to return MaxResults number of backups, NextToken allows you to return more items in your list starting at the location pointed to by the next token.

+ pub fn set_next_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.inner = self.inner.set_next_token(input); + self + } + ///

The next item following a partial list of returned search jobs.

+ ///

For example, if a request is made to return MaxResults number of backups, NextToken allows you to return more items in your list starting at the location pointed to by the next token.

+ pub fn get_next_token(&self) -> &::std::option::Option<::std::string::String> { + self.inner.get_next_token() + } + ///

The maximum number of resource list items to be returned.

+ pub fn max_results(mut self, input: i32) -> Self { + self.inner = self.inner.max_results(input); + self + } + ///

The maximum number of resource list items to be returned.

+ pub fn set_max_results(mut self, input: ::std::option::Option) -> Self { + self.inner = self.inner.set_max_results(input); + self + } + ///

The maximum number of resource list items to be returned.

+ pub fn get_max_results(&self) -> &::std::option::Option { + self.inner.get_max_results() + } +} diff --git a/sdk/backupsearch/src/operation/list_search_jobs/paginator.rs b/sdk/backupsearch/src/operation/list_search_jobs/paginator.rs new file mode 100644 index 000000000000..3e5f725d22d5 --- /dev/null +++ b/sdk/backupsearch/src/operation/list_search_jobs/paginator.rs @@ -0,0 +1,148 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +/// Paginator for [`ListSearchJobs`](crate::operation::list_search_jobs::ListSearchJobs) +pub struct ListSearchJobsPaginator { + handle: std::sync::Arc, + builder: crate::operation::list_search_jobs::builders::ListSearchJobsInputBuilder, + stop_on_duplicate_token: bool, +} + +impl ListSearchJobsPaginator { + /// Create a new paginator-wrapper + pub(crate) fn new( + handle: std::sync::Arc, + builder: crate::operation::list_search_jobs::builders::ListSearchJobsInputBuilder, + ) -> Self { + Self { + handle, + builder, + stop_on_duplicate_token: true, + } + } + + /// Set the page size + /// + /// _Note: this method will override any previously set value for `max_results`_ + pub fn page_size(mut self, limit: i32) -> Self { + self.builder.max_results = ::std::option::Option::Some(limit); + self + } + + /// Create a flattened paginator + /// + /// This paginator automatically flattens results using `search_jobs`. Queries to the underlying service + /// are dispatched lazily. + pub fn items(self) -> crate::operation::list_search_jobs::paginator::ListSearchJobsPaginatorItems { + crate::operation::list_search_jobs::paginator::ListSearchJobsPaginatorItems(self) + } + + /// Stop paginating when the service returns the same pagination token twice in a row. + /// + /// Defaults to true. + /// + /// For certain operations, it may be useful to continue on duplicate token. For example, + /// if an operation is for tailing a log file in real-time, then continuing may be desired. + /// This option can be set to `false` to accommodate these use cases. + pub fn stop_on_duplicate_token(mut self, stop_on_duplicate_token: bool) -> Self { + self.stop_on_duplicate_token = stop_on_duplicate_token; + self + } + + /// Create the pagination stream + /// + /// _Note:_ No requests will be dispatched until the stream is used + /// (e.g. with the [`.next().await`](aws_smithy_async::future::pagination_stream::PaginationStream::next) method). + pub fn send( + self, + ) -> ::aws_smithy_async::future::pagination_stream::PaginationStream< + ::std::result::Result< + crate::operation::list_search_jobs::ListSearchJobsOutput, + ::aws_smithy_runtime_api::client::result::SdkError< + crate::operation::list_search_jobs::ListSearchJobsError, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >, + >, + > { + // Move individual fields out of self for the borrow checker + let builder = self.builder; + let handle = self.handle; + let runtime_plugins = crate::operation::list_search_jobs::ListSearchJobs::operation_runtime_plugins( + handle.runtime_plugins.clone(), + &handle.conf, + ::std::option::Option::None, + ) + .with_operation_plugin(crate::sdk_feature_tracker::paginator::PaginatorFeatureTrackerRuntimePlugin::new()); + ::aws_smithy_async::future::pagination_stream::PaginationStream::new(::aws_smithy_async::future::pagination_stream::fn_stream::FnStream::new( + move |tx| { + ::std::boxed::Box::pin(async move { + // Build the input for the first time. If required fields are missing, this is where we'll produce an early error. + let mut input = match builder + .build() + .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure) + { + ::std::result::Result::Ok(input) => input, + ::std::result::Result::Err(e) => { + let _ = tx.send(::std::result::Result::Err(e)).await; + return; + } + }; + loop { + let resp = crate::operation::list_search_jobs::ListSearchJobs::orchestrate(&runtime_plugins, input.clone()).await; + // If the input member is None or it was an error + let done = match resp { + ::std::result::Result::Ok(ref resp) => { + let new_token = crate::lens::reflens_list_search_jobs_output_output_next_token(resp); + // Pagination is exhausted when the next token is an empty string + let is_empty = new_token.map(|token| token.is_empty()).unwrap_or(true); + if !is_empty && new_token == input.next_token.as_ref() && self.stop_on_duplicate_token { + true + } else { + input.next_token = new_token.cloned(); + is_empty + } + } + ::std::result::Result::Err(_) => true, + }; + if tx.send(resp).await.is_err() { + // receiving end was dropped + return; + } + if done { + return; + } + } + }) + }, + )) + } +} + +/// Flattened paginator for `ListSearchJobsPaginator` +/// +/// This is created with [`.items()`](ListSearchJobsPaginator::items) +pub struct ListSearchJobsPaginatorItems(ListSearchJobsPaginator); + +impl ListSearchJobsPaginatorItems { + /// Create the pagination stream + /// + /// _Note_: No requests will be dispatched until the stream is used + /// (e.g. with the [`.next().await`](aws_smithy_async::future::pagination_stream::PaginationStream::next) method). + /// + /// To read the entirety of the paginator, use [`.collect::, _>()`](aws_smithy_async::future::pagination_stream::PaginationStream::collect). + pub fn send( + self, + ) -> ::aws_smithy_async::future::pagination_stream::PaginationStream< + ::std::result::Result< + crate::types::SearchJobSummary, + ::aws_smithy_runtime_api::client::result::SdkError< + crate::operation::list_search_jobs::ListSearchJobsError, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >, + >, + > { + ::aws_smithy_async::future::pagination_stream::TryFlatMap::new(self.0.send()).flat_map(|page| { + crate::lens::lens_list_search_jobs_output_output_search_jobs(page) + .unwrap_or_default() + .into_iter() + }) + } +} diff --git a/sdk/backupsearch/src/operation/list_search_result_export_jobs.rs b/sdk/backupsearch/src/operation/list_search_result_export_jobs.rs new file mode 100644 index 000000000000..80ba561969e5 --- /dev/null +++ b/sdk/backupsearch/src/operation/list_search_result_export_jobs.rs @@ -0,0 +1,441 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +/// Orchestration and serialization glue logic for `ListSearchResultExportJobs`. +#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)] +#[non_exhaustive] +pub struct ListSearchResultExportJobs; +impl ListSearchResultExportJobs { + /// Creates a new `ListSearchResultExportJobs` + pub fn new() -> Self { + Self + } + pub(crate) async fn orchestrate( + runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, + input: crate::operation::list_search_result_export_jobs::ListSearchResultExportJobsInput, + ) -> ::std::result::Result< + crate::operation::list_search_result_export_jobs::ListSearchResultExportJobsOutput, + ::aws_smithy_runtime_api::client::result::SdkError< + crate::operation::list_search_result_export_jobs::ListSearchResultExportJobsError, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >, + > { + let map_err = |err: ::aws_smithy_runtime_api::client::result::SdkError< + ::aws_smithy_runtime_api::client::interceptors::context::Error, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >| { + err.map_service_error(|err| { + err.downcast::() + .expect("correct error type") + }) + }; + let context = Self::orchestrate_with_stop_point(runtime_plugins, input, ::aws_smithy_runtime::client::orchestrator::StopPoint::None) + .await + .map_err(map_err)?; + let output = context.finalize().map_err(map_err)?; + ::std::result::Result::Ok( + output + .downcast::() + .expect("correct output type"), + ) + } + + pub(crate) async fn orchestrate_with_stop_point( + runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, + input: crate::operation::list_search_result_export_jobs::ListSearchResultExportJobsInput, + stop_point: ::aws_smithy_runtime::client::orchestrator::StopPoint, + ) -> ::std::result::Result< + ::aws_smithy_runtime_api::client::interceptors::context::InterceptorContext, + ::aws_smithy_runtime_api::client::result::SdkError< + ::aws_smithy_runtime_api::client::interceptors::context::Error, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >, + > { + let input = ::aws_smithy_runtime_api::client::interceptors::context::Input::erase(input); + ::aws_smithy_runtime::client::orchestrator::invoke_with_stop_point( + "backupsearch", + "ListSearchResultExportJobs", + input, + runtime_plugins, + stop_point, + ) + .await + } + + pub(crate) fn operation_runtime_plugins( + client_runtime_plugins: ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, + client_config: &crate::config::Config, + config_override: ::std::option::Option, + ) -> ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins { + let mut runtime_plugins = client_runtime_plugins.with_operation_plugin(Self::new()); + runtime_plugins = runtime_plugins.with_client_plugin(crate::auth_plugin::DefaultAuthOptionsPlugin::new(vec![ + ::aws_runtime::auth::sigv4::SCHEME_ID, + ])); + if let ::std::option::Option::Some(config_override) = config_override { + for plugin in config_override.runtime_plugins.iter().cloned() { + runtime_plugins = runtime_plugins.with_operation_plugin(plugin); + } + runtime_plugins = runtime_plugins.with_operation_plugin(crate::config::ConfigOverrideRuntimePlugin::new( + config_override, + client_config.config.clone(), + &client_config.runtime_components, + )); + } + runtime_plugins + } +} +impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for ListSearchResultExportJobs { + fn config(&self) -> ::std::option::Option<::aws_smithy_types::config_bag::FrozenLayer> { + let mut cfg = ::aws_smithy_types::config_bag::Layer::new("ListSearchResultExportJobs"); + + cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new( + ListSearchResultExportJobsRequestSerializer, + )); + cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new( + ListSearchResultExportJobsResponseDeserializer, + )); + + cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new( + ::aws_smithy_runtime_api::client::auth::static_resolver::StaticAuthSchemeOptionResolverParams::new(), + )); + + cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::Metadata::new( + "ListSearchResultExportJobs", + "backupsearch", + )); + let mut signing_options = ::aws_runtime::auth::SigningOptions::default(); + signing_options.double_uri_encode = true; + signing_options.content_sha256_header = false; + signing_options.normalize_uri_path = true; + signing_options.payload_override = None; + + cfg.store_put(::aws_runtime::auth::SigV4OperationSigningConfig { + signing_options, + ..::std::default::Default::default() + }); + + ::std::option::Option::Some(cfg.freeze()) + } + + fn runtime_components( + &self, + _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder, + ) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> { + #[allow(unused_mut)] + let mut rcb = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("ListSearchResultExportJobs") + .with_interceptor(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default()) + .with_interceptor(ListSearchResultExportJobsEndpointParamsInterceptor) + .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::< + crate::operation::list_search_result_export_jobs::ListSearchResultExportJobsError, + >::new()) + .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::< + crate::operation::list_search_result_export_jobs::ListSearchResultExportJobsError, + >::new()) + .with_retry_classifier(::aws_runtime::retries::classifiers::AwsErrorCodeClassifier::< + crate::operation::list_search_result_export_jobs::ListSearchResultExportJobsError, + >::new()); + + ::std::borrow::Cow::Owned(rcb) + } +} + +#[derive(Debug)] +struct ListSearchResultExportJobsResponseDeserializer; +impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for ListSearchResultExportJobsResponseDeserializer { + fn deserialize_nonstreaming( + &self, + response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError { + let (success, status) = (response.status().is_success(), response.status().as_u16()); + let headers = response.headers(); + let body = response.body().bytes().expect("body loaded"); + #[allow(unused_mut)] + let mut force_error = false; + ::tracing::debug!(request_id = ?::aws_types::request_id::RequestId::request_id(response)); + let parse_result = if !success && status != 200 || force_error { + crate::protocol_serde::shape_list_search_result_export_jobs::de_list_search_result_export_jobs_http_error(status, headers, body) + } else { + crate::protocol_serde::shape_list_search_result_export_jobs::de_list_search_result_export_jobs_http_response(status, headers, body) + }; + crate::protocol_serde::type_erase_result(parse_result) + } +} +#[derive(Debug)] +struct ListSearchResultExportJobsRequestSerializer; +impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for ListSearchResultExportJobsRequestSerializer { + #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)] + fn serialize_input( + &self, + input: ::aws_smithy_runtime_api::client::interceptors::context::Input, + _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag, + ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> { + let input = input + .downcast::() + .expect("correct type"); + let _header_serialization_settings = _cfg + .load::() + .cloned() + .unwrap_or_default(); + let mut request_builder = { + fn uri_base( + _input: &crate::operation::list_search_result_export_jobs::ListSearchResultExportJobsInput, + output: &mut ::std::string::String, + ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> { + use ::std::fmt::Write as _; + ::std::write!(output, "/export-search-jobs").expect("formatting should succeed"); + ::std::result::Result::Ok(()) + } + fn uri_query( + _input: &crate::operation::list_search_result_export_jobs::ListSearchResultExportJobsInput, + mut output: &mut ::std::string::String, + ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> { + let mut query = ::aws_smithy_http::query::Writer::new(output); + if let ::std::option::Option::Some(inner_1) = &_input.status { + { + query.push_kv("Status", &::aws_smithy_http::query::fmt_string(inner_1)); + } + } + if let ::std::option::Option::Some(inner_2) = &_input.search_job_identifier { + { + query.push_kv("SearchJobIdentifier", &::aws_smithy_http::query::fmt_string(inner_2)); + } + } + if let ::std::option::Option::Some(inner_3) = &_input.next_token { + { + query.push_kv("NextToken", &::aws_smithy_http::query::fmt_string(inner_3)); + } + } + if let ::std::option::Option::Some(inner_4) = &_input.max_results { + { + query.push_kv("MaxResults", ::aws_smithy_types::primitive::Encoder::from(*inner_4).encode()); + } + } + ::std::result::Result::Ok(()) + } + #[allow(clippy::unnecessary_wraps)] + fn update_http_builder( + input: &crate::operation::list_search_result_export_jobs::ListSearchResultExportJobsInput, + builder: ::http::request::Builder, + ) -> ::std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> { + let mut uri = ::std::string::String::new(); + uri_base(input, &mut uri)?; + uri_query(input, &mut uri)?; + ::std::result::Result::Ok(builder.method("GET").uri(uri)) + } + let mut builder = update_http_builder(&input, ::http::request::Builder::new())?; + builder + }; + let body = ::aws_smithy_types::body::SdkBody::from(""); + + ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap()) + } +} +#[derive(Debug)] +struct ListSearchResultExportJobsEndpointParamsInterceptor; + +impl ::aws_smithy_runtime_api::client::interceptors::Intercept for ListSearchResultExportJobsEndpointParamsInterceptor { + fn name(&self) -> &'static str { + "ListSearchResultExportJobsEndpointParamsInterceptor" + } + + fn read_before_execution( + &self, + context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef< + '_, + ::aws_smithy_runtime_api::client::interceptors::context::Input, + ::aws_smithy_runtime_api::client::interceptors::context::Output, + ::aws_smithy_runtime_api::client::interceptors::context::Error, + >, + cfg: &mut ::aws_smithy_types::config_bag::ConfigBag, + ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> { + let _input = context + .input() + .downcast_ref::() + .ok_or("failed to downcast to ListSearchResultExportJobsInput")?; + + let params = crate::config::endpoint::Params::builder() + .set_use_fips(cfg.load::<::aws_types::endpoint_config::UseFips>().map(|ty| ty.0)) + .set_endpoint(cfg.load::<::aws_types::endpoint_config::EndpointUrl>().map(|ty| ty.0.clone())) + .set_region(cfg.load::<::aws_types::region::Region>().map(|r| r.as_ref().to_owned())) + .build() + .map_err(|err| { + ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err) + })?; + cfg.interceptor_state() + .store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params)); + ::std::result::Result::Ok(()) + } +} + +// The get_* functions below are generated from JMESPath expressions in the +// operationContextParams trait. They target the operation's input shape. + +/// Error type for the `ListSearchResultExportJobsError` operation. +#[non_exhaustive] +#[derive(::std::fmt::Debug)] +pub enum ListSearchResultExportJobsError { + ///

The resource was not found for this request.

+ ///

Confirm the resource information, such as the ARN or type is correct and exists, then retry the request.

+ ResourceNotFoundException(crate::types::error::ResourceNotFoundException), + ///

The request denied due to exceeding the quota limits permitted.

+ ServiceQuotaExceededException(crate::types::error::ServiceQuotaExceededException), + ///

You do not have sufficient access to perform this action.

+ AccessDeniedException(crate::types::error::AccessDeniedException), + ///

An internal server error occurred. Retry your request.

+ InternalServerException(crate::types::error::InternalServerException), + ///

The request was denied due to request throttling.

+ ThrottlingException(crate::types::error::ThrottlingException), + ///

The input fails to satisfy the constraints specified by a service.

+ ValidationException(crate::types::error::ValidationException), + /// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code). + #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \ + variable wildcard pattern and check `.code()`: + \ +    `err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }` + \ + See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-ListSearchResultExportJobsError) for what information is available for the error.")] + Unhandled(crate::error::sealed_unhandled::Unhandled), +} +impl ListSearchResultExportJobsError { + /// Creates the `ListSearchResultExportJobsError::Unhandled` variant from any error type. + pub fn unhandled( + err: impl ::std::convert::Into<::std::boxed::Box>, + ) -> Self { + Self::Unhandled(crate::error::sealed_unhandled::Unhandled { + source: err.into(), + meta: ::std::default::Default::default(), + }) + } + + /// Creates the `ListSearchResultExportJobsError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata). + pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self { + Self::Unhandled(crate::error::sealed_unhandled::Unhandled { + source: err.clone().into(), + meta: err, + }) + } + /// + /// Returns error metadata, which includes the error code, message, + /// request ID, and potentially additional information. + /// + pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata { + match self { + Self::ResourceNotFoundException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), + Self::ServiceQuotaExceededException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), + Self::AccessDeniedException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), + Self::InternalServerException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), + Self::ThrottlingException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), + Self::ValidationException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), + Self::Unhandled(e) => &e.meta, + } + } + /// Returns `true` if the error kind is `ListSearchResultExportJobsError::ResourceNotFoundException`. + pub fn is_resource_not_found_exception(&self) -> bool { + matches!(self, Self::ResourceNotFoundException(_)) + } + /// Returns `true` if the error kind is `ListSearchResultExportJobsError::ServiceQuotaExceededException`. + pub fn is_service_quota_exceeded_exception(&self) -> bool { + matches!(self, Self::ServiceQuotaExceededException(_)) + } + /// Returns `true` if the error kind is `ListSearchResultExportJobsError::AccessDeniedException`. + pub fn is_access_denied_exception(&self) -> bool { + matches!(self, Self::AccessDeniedException(_)) + } + /// Returns `true` if the error kind is `ListSearchResultExportJobsError::InternalServerException`. + pub fn is_internal_server_exception(&self) -> bool { + matches!(self, Self::InternalServerException(_)) + } + /// Returns `true` if the error kind is `ListSearchResultExportJobsError::ThrottlingException`. + pub fn is_throttling_exception(&self) -> bool { + matches!(self, Self::ThrottlingException(_)) + } + /// Returns `true` if the error kind is `ListSearchResultExportJobsError::ValidationException`. + pub fn is_validation_exception(&self) -> bool { + matches!(self, Self::ValidationException(_)) + } +} +impl ::std::error::Error for ListSearchResultExportJobsError { + fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> { + match self { + Self::ResourceNotFoundException(_inner) => ::std::option::Option::Some(_inner), + Self::ServiceQuotaExceededException(_inner) => ::std::option::Option::Some(_inner), + Self::AccessDeniedException(_inner) => ::std::option::Option::Some(_inner), + Self::InternalServerException(_inner) => ::std::option::Option::Some(_inner), + Self::ThrottlingException(_inner) => ::std::option::Option::Some(_inner), + Self::ValidationException(_inner) => ::std::option::Option::Some(_inner), + Self::Unhandled(_inner) => ::std::option::Option::Some(&*_inner.source), + } + } +} +impl ::std::fmt::Display for ListSearchResultExportJobsError { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + match self { + Self::ResourceNotFoundException(_inner) => _inner.fmt(f), + Self::ServiceQuotaExceededException(_inner) => _inner.fmt(f), + Self::AccessDeniedException(_inner) => _inner.fmt(f), + Self::InternalServerException(_inner) => _inner.fmt(f), + Self::ThrottlingException(_inner) => _inner.fmt(f), + Self::ValidationException(_inner) => _inner.fmt(f), + Self::Unhandled(_inner) => { + if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) { + write!(f, "unhandled error ({code})") + } else { + f.write_str("unhandled error") + } + } + } + } +} +impl ::aws_smithy_types::retry::ProvideErrorKind for ListSearchResultExportJobsError { + fn code(&self) -> ::std::option::Option<&str> { + ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) + } + fn retryable_error_kind(&self) -> ::std::option::Option<::aws_smithy_types::retry::ErrorKind> { + match self { + Self::InternalServerException(inner) => ::std::option::Option::Some(inner.retryable_error_kind()), + Self::ThrottlingException(inner) => ::std::option::Option::Some(inner.retryable_error_kind()), + _ => ::std::option::Option::None, + } + } +} +impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for ListSearchResultExportJobsError { + fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata { + match self { + Self::ResourceNotFoundException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner), + Self::ServiceQuotaExceededException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner), + Self::AccessDeniedException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner), + Self::InternalServerException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner), + Self::ThrottlingException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner), + Self::ValidationException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner), + Self::Unhandled(_inner) => &_inner.meta, + } + } +} +impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for ListSearchResultExportJobsError { + fn create_unhandled_error( + source: ::std::boxed::Box, + meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>, + ) -> Self { + Self::Unhandled(crate::error::sealed_unhandled::Unhandled { + source, + meta: meta.unwrap_or_default(), + }) + } +} +impl ::aws_types::request_id::RequestId for crate::operation::list_search_result_export_jobs::ListSearchResultExportJobsError { + fn request_id(&self) -> Option<&str> { + self.meta().request_id() + } +} + +pub use crate::operation::list_search_result_export_jobs::_list_search_result_export_jobs_output::ListSearchResultExportJobsOutput; + +pub use crate::operation::list_search_result_export_jobs::_list_search_result_export_jobs_input::ListSearchResultExportJobsInput; + +mod _list_search_result_export_jobs_input; + +mod _list_search_result_export_jobs_output; + +/// Builders +pub mod builders; + +/// Paginator for this operation +pub mod paginator; diff --git a/sdk/backupsearch/src/operation/list_search_result_export_jobs/_list_search_result_export_jobs_input.rs b/sdk/backupsearch/src/operation/list_search_result_export_jobs/_list_search_result_export_jobs_input.rs new file mode 100644 index 000000000000..de61945fa6ce --- /dev/null +++ b/sdk/backupsearch/src/operation/list_search_result_export_jobs/_list_search_result_export_jobs_input.rs @@ -0,0 +1,125 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +#[allow(missing_docs)] // documentation missing in model +#[non_exhaustive] +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)] +pub struct ListSearchResultExportJobsInput { + ///

The search jobs to be included in the export job can be filtered by including this parameter.

+ pub status: ::std::option::Option, + ///

The unique string that specifies the search job.

+ pub search_job_identifier: ::std::option::Option<::std::string::String>, + ///

The next item following a partial list of returned backups included in a search job.

+ ///

For example, if a request is made to return MaxResults number of backups, NextToken allows you to return more items in your list starting at the location pointed to by the next token.

+ pub next_token: ::std::option::Option<::std::string::String>, + ///

The maximum number of resource list items to be returned.

+ pub max_results: ::std::option::Option, +} +impl ListSearchResultExportJobsInput { + ///

The search jobs to be included in the export job can be filtered by including this parameter.

+ pub fn status(&self) -> ::std::option::Option<&crate::types::ExportJobStatus> { + self.status.as_ref() + } + ///

The unique string that specifies the search job.

+ pub fn search_job_identifier(&self) -> ::std::option::Option<&str> { + self.search_job_identifier.as_deref() + } + ///

The next item following a partial list of returned backups included in a search job.

+ ///

For example, if a request is made to return MaxResults number of backups, NextToken allows you to return more items in your list starting at the location pointed to by the next token.

+ pub fn next_token(&self) -> ::std::option::Option<&str> { + self.next_token.as_deref() + } + ///

The maximum number of resource list items to be returned.

+ pub fn max_results(&self) -> ::std::option::Option { + self.max_results + } +} +impl ListSearchResultExportJobsInput { + /// Creates a new builder-style object to manufacture [`ListSearchResultExportJobsInput`](crate::operation::list_search_result_export_jobs::ListSearchResultExportJobsInput). + pub fn builder() -> crate::operation::list_search_result_export_jobs::builders::ListSearchResultExportJobsInputBuilder { + crate::operation::list_search_result_export_jobs::builders::ListSearchResultExportJobsInputBuilder::default() + } +} + +/// A builder for [`ListSearchResultExportJobsInput`](crate::operation::list_search_result_export_jobs::ListSearchResultExportJobsInput). +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)] +#[non_exhaustive] +pub struct ListSearchResultExportJobsInputBuilder { + pub(crate) status: ::std::option::Option, + pub(crate) search_job_identifier: ::std::option::Option<::std::string::String>, + pub(crate) next_token: ::std::option::Option<::std::string::String>, + pub(crate) max_results: ::std::option::Option, +} +impl ListSearchResultExportJobsInputBuilder { + ///

The search jobs to be included in the export job can be filtered by including this parameter.

+ pub fn status(mut self, input: crate::types::ExportJobStatus) -> Self { + self.status = ::std::option::Option::Some(input); + self + } + ///

The search jobs to be included in the export job can be filtered by including this parameter.

+ pub fn set_status(mut self, input: ::std::option::Option) -> Self { + self.status = input; + self + } + ///

The search jobs to be included in the export job can be filtered by including this parameter.

+ pub fn get_status(&self) -> &::std::option::Option { + &self.status + } + ///

The unique string that specifies the search job.

+ pub fn search_job_identifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.search_job_identifier = ::std::option::Option::Some(input.into()); + self + } + ///

The unique string that specifies the search job.

+ pub fn set_search_job_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.search_job_identifier = input; + self + } + ///

The unique string that specifies the search job.

+ pub fn get_search_job_identifier(&self) -> &::std::option::Option<::std::string::String> { + &self.search_job_identifier + } + ///

The next item following a partial list of returned backups included in a search job.

+ ///

For example, if a request is made to return MaxResults number of backups, NextToken allows you to return more items in your list starting at the location pointed to by the next token.

+ pub fn next_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.next_token = ::std::option::Option::Some(input.into()); + self + } + ///

The next item following a partial list of returned backups included in a search job.

+ ///

For example, if a request is made to return MaxResults number of backups, NextToken allows you to return more items in your list starting at the location pointed to by the next token.

+ pub fn set_next_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.next_token = input; + self + } + ///

The next item following a partial list of returned backups included in a search job.

+ ///

For example, if a request is made to return MaxResults number of backups, NextToken allows you to return more items in your list starting at the location pointed to by the next token.

+ pub fn get_next_token(&self) -> &::std::option::Option<::std::string::String> { + &self.next_token + } + ///

The maximum number of resource list items to be returned.

+ pub fn max_results(mut self, input: i32) -> Self { + self.max_results = ::std::option::Option::Some(input); + self + } + ///

The maximum number of resource list items to be returned.

+ pub fn set_max_results(mut self, input: ::std::option::Option) -> Self { + self.max_results = input; + self + } + ///

The maximum number of resource list items to be returned.

+ pub fn get_max_results(&self) -> &::std::option::Option { + &self.max_results + } + /// Consumes the builder and constructs a [`ListSearchResultExportJobsInput`](crate::operation::list_search_result_export_jobs::ListSearchResultExportJobsInput). + pub fn build( + self, + ) -> ::std::result::Result< + crate::operation::list_search_result_export_jobs::ListSearchResultExportJobsInput, + ::aws_smithy_types::error::operation::BuildError, + > { + ::std::result::Result::Ok(crate::operation::list_search_result_export_jobs::ListSearchResultExportJobsInput { + status: self.status, + search_job_identifier: self.search_job_identifier, + next_token: self.next_token, + max_results: self.max_results, + }) + } +} diff --git a/sdk/backupsearch/src/operation/list_search_result_export_jobs/_list_search_result_export_jobs_output.rs b/sdk/backupsearch/src/operation/list_search_result_export_jobs/_list_search_result_export_jobs_output.rs new file mode 100644 index 000000000000..cd02e23465c9 --- /dev/null +++ b/sdk/backupsearch/src/operation/list_search_result_export_jobs/_list_search_result_export_jobs_output.rs @@ -0,0 +1,112 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +#[allow(missing_docs)] // documentation missing in model +#[non_exhaustive] +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)] +pub struct ListSearchResultExportJobsOutput { + ///

The operation returns the included export jobs.

+ pub export_jobs: ::std::vec::Vec, + ///

The next item following a partial list of returned backups included in a search job.

+ ///

For example, if a request is made to return MaxResults number of backups, NextToken allows you to return more items in your list starting at the location pointed to by the next token.

+ pub next_token: ::std::option::Option<::std::string::String>, + _request_id: Option, +} +impl ListSearchResultExportJobsOutput { + ///

The operation returns the included export jobs.

+ pub fn export_jobs(&self) -> &[crate::types::ExportJobSummary] { + use std::ops::Deref; + self.export_jobs.deref() + } + ///

The next item following a partial list of returned backups included in a search job.

+ ///

For example, if a request is made to return MaxResults number of backups, NextToken allows you to return more items in your list starting at the location pointed to by the next token.

+ pub fn next_token(&self) -> ::std::option::Option<&str> { + self.next_token.as_deref() + } +} +impl ::aws_types::request_id::RequestId for ListSearchResultExportJobsOutput { + fn request_id(&self) -> Option<&str> { + self._request_id.as_deref() + } +} +impl ListSearchResultExportJobsOutput { + /// Creates a new builder-style object to manufacture [`ListSearchResultExportJobsOutput`](crate::operation::list_search_result_export_jobs::ListSearchResultExportJobsOutput). + pub fn builder() -> crate::operation::list_search_result_export_jobs::builders::ListSearchResultExportJobsOutputBuilder { + crate::operation::list_search_result_export_jobs::builders::ListSearchResultExportJobsOutputBuilder::default() + } +} + +/// A builder for [`ListSearchResultExportJobsOutput`](crate::operation::list_search_result_export_jobs::ListSearchResultExportJobsOutput). +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)] +#[non_exhaustive] +pub struct ListSearchResultExportJobsOutputBuilder { + pub(crate) export_jobs: ::std::option::Option<::std::vec::Vec>, + pub(crate) next_token: ::std::option::Option<::std::string::String>, + _request_id: Option, +} +impl ListSearchResultExportJobsOutputBuilder { + /// Appends an item to `export_jobs`. + /// + /// To override the contents of this collection use [`set_export_jobs`](Self::set_export_jobs). + /// + ///

The operation returns the included export jobs.

+ pub fn export_jobs(mut self, input: crate::types::ExportJobSummary) -> Self { + let mut v = self.export_jobs.unwrap_or_default(); + v.push(input); + self.export_jobs = ::std::option::Option::Some(v); + self + } + ///

The operation returns the included export jobs.

+ pub fn set_export_jobs(mut self, input: ::std::option::Option<::std::vec::Vec>) -> Self { + self.export_jobs = input; + self + } + ///

The operation returns the included export jobs.

+ pub fn get_export_jobs(&self) -> &::std::option::Option<::std::vec::Vec> { + &self.export_jobs + } + ///

The next item following a partial list of returned backups included in a search job.

+ ///

For example, if a request is made to return MaxResults number of backups, NextToken allows you to return more items in your list starting at the location pointed to by the next token.

+ pub fn next_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.next_token = ::std::option::Option::Some(input.into()); + self + } + ///

The next item following a partial list of returned backups included in a search job.

+ ///

For example, if a request is made to return MaxResults number of backups, NextToken allows you to return more items in your list starting at the location pointed to by the next token.

+ pub fn set_next_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.next_token = input; + self + } + ///

The next item following a partial list of returned backups included in a search job.

+ ///

For example, if a request is made to return MaxResults number of backups, NextToken allows you to return more items in your list starting at the location pointed to by the next token.

+ pub fn get_next_token(&self) -> &::std::option::Option<::std::string::String> { + &self.next_token + } + pub(crate) fn _request_id(mut self, request_id: impl Into) -> Self { + self._request_id = Some(request_id.into()); + self + } + + pub(crate) fn _set_request_id(&mut self, request_id: Option) -> &mut Self { + self._request_id = request_id; + self + } + /// Consumes the builder and constructs a [`ListSearchResultExportJobsOutput`](crate::operation::list_search_result_export_jobs::ListSearchResultExportJobsOutput). + /// This method will fail if any of the following fields are not set: + /// - [`export_jobs`](crate::operation::list_search_result_export_jobs::builders::ListSearchResultExportJobsOutputBuilder::export_jobs) + pub fn build( + self, + ) -> ::std::result::Result< + crate::operation::list_search_result_export_jobs::ListSearchResultExportJobsOutput, + ::aws_smithy_types::error::operation::BuildError, + > { + ::std::result::Result::Ok(crate::operation::list_search_result_export_jobs::ListSearchResultExportJobsOutput { + export_jobs: self.export_jobs.ok_or_else(|| { + ::aws_smithy_types::error::operation::BuildError::missing_field( + "export_jobs", + "export_jobs was not specified but it is required when building ListSearchResultExportJobsOutput", + ) + })?, + next_token: self.next_token, + _request_id: self._request_id, + }) + } +} diff --git a/sdk/backupsearch/src/operation/list_search_result_export_jobs/builders.rs b/sdk/backupsearch/src/operation/list_search_result_export_jobs/builders.rs new file mode 100644 index 000000000000..0a8f02aaf7e5 --- /dev/null +++ b/sdk/backupsearch/src/operation/list_search_result_export_jobs/builders.rs @@ -0,0 +1,176 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +pub use crate::operation::list_search_result_export_jobs::_list_search_result_export_jobs_output::ListSearchResultExportJobsOutputBuilder; + +pub use crate::operation::list_search_result_export_jobs::_list_search_result_export_jobs_input::ListSearchResultExportJobsInputBuilder; + +impl crate::operation::list_search_result_export_jobs::builders::ListSearchResultExportJobsInputBuilder { + /// Sends a request with this input using the given client. + pub async fn send_with( + self, + client: &crate::Client, + ) -> ::std::result::Result< + crate::operation::list_search_result_export_jobs::ListSearchResultExportJobsOutput, + ::aws_smithy_runtime_api::client::result::SdkError< + crate::operation::list_search_result_export_jobs::ListSearchResultExportJobsError, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >, + > { + let mut fluent_builder = client.list_search_result_export_jobs(); + fluent_builder.inner = self; + fluent_builder.send().await + } +} +/// Fluent builder constructing a request to `ListSearchResultExportJobs`. +/// +///

This operation exports search results of a search job to a specified destination S3 bucket.

+#[derive(::std::clone::Clone, ::std::fmt::Debug)] +pub struct ListSearchResultExportJobsFluentBuilder { + handle: ::std::sync::Arc, + inner: crate::operation::list_search_result_export_jobs::builders::ListSearchResultExportJobsInputBuilder, + config_override: ::std::option::Option, +} +impl + crate::client::customize::internal::CustomizableSend< + crate::operation::list_search_result_export_jobs::ListSearchResultExportJobsOutput, + crate::operation::list_search_result_export_jobs::ListSearchResultExportJobsError, + > for ListSearchResultExportJobsFluentBuilder +{ + fn send( + self, + config_override: crate::config::Builder, + ) -> crate::client::customize::internal::BoxFuture< + crate::client::customize::internal::SendResult< + crate::operation::list_search_result_export_jobs::ListSearchResultExportJobsOutput, + crate::operation::list_search_result_export_jobs::ListSearchResultExportJobsError, + >, + > { + ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await }) + } +} +impl ListSearchResultExportJobsFluentBuilder { + /// Creates a new `ListSearchResultExportJobsFluentBuilder`. + pub(crate) fn new(handle: ::std::sync::Arc) -> Self { + Self { + handle, + inner: ::std::default::Default::default(), + config_override: ::std::option::Option::None, + } + } + /// Access the ListSearchResultExportJobs as a reference. + pub fn as_input(&self) -> &crate::operation::list_search_result_export_jobs::builders::ListSearchResultExportJobsInputBuilder { + &self.inner + } + /// Sends the request and returns the response. + /// + /// If an error occurs, an `SdkError` will be returned with additional details that + /// can be matched against. + /// + /// By default, any retryable failures will be retried twice. Retry behavior + /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be + /// set when configuring the client. + pub async fn send( + self, + ) -> ::std::result::Result< + crate::operation::list_search_result_export_jobs::ListSearchResultExportJobsOutput, + ::aws_smithy_runtime_api::client::result::SdkError< + crate::operation::list_search_result_export_jobs::ListSearchResultExportJobsError, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >, + > { + let input = self + .inner + .build() + .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?; + let runtime_plugins = crate::operation::list_search_result_export_jobs::ListSearchResultExportJobs::operation_runtime_plugins( + self.handle.runtime_plugins.clone(), + &self.handle.conf, + self.config_override, + ); + crate::operation::list_search_result_export_jobs::ListSearchResultExportJobs::orchestrate(&runtime_plugins, input).await + } + + /// Consumes this builder, creating a customizable operation that can be modified before being sent. + pub fn customize( + self, + ) -> crate::client::customize::CustomizableOperation< + crate::operation::list_search_result_export_jobs::ListSearchResultExportJobsOutput, + crate::operation::list_search_result_export_jobs::ListSearchResultExportJobsError, + Self, + > { + crate::client::customize::CustomizableOperation::new(self) + } + pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into) -> Self { + self.set_config_override(::std::option::Option::Some(config_override.into())); + self + } + + pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option) -> &mut Self { + self.config_override = config_override; + self + } + /// Create a paginator for this request + /// + /// Paginators are used by calling [`send().await`](crate::operation::list_search_result_export_jobs::paginator::ListSearchResultExportJobsPaginator::send) which returns a [`PaginationStream`](aws_smithy_async::future::pagination_stream::PaginationStream). + pub fn into_paginator(self) -> crate::operation::list_search_result_export_jobs::paginator::ListSearchResultExportJobsPaginator { + crate::operation::list_search_result_export_jobs::paginator::ListSearchResultExportJobsPaginator::new(self.handle, self.inner) + } + ///

The search jobs to be included in the export job can be filtered by including this parameter.

+ pub fn status(mut self, input: crate::types::ExportJobStatus) -> Self { + self.inner = self.inner.status(input); + self + } + ///

The search jobs to be included in the export job can be filtered by including this parameter.

+ pub fn set_status(mut self, input: ::std::option::Option) -> Self { + self.inner = self.inner.set_status(input); + self + } + ///

The search jobs to be included in the export job can be filtered by including this parameter.

+ pub fn get_status(&self) -> &::std::option::Option { + self.inner.get_status() + } + ///

The unique string that specifies the search job.

+ pub fn search_job_identifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.inner = self.inner.search_job_identifier(input.into()); + self + } + ///

The unique string that specifies the search job.

+ pub fn set_search_job_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.inner = self.inner.set_search_job_identifier(input); + self + } + ///

The unique string that specifies the search job.

+ pub fn get_search_job_identifier(&self) -> &::std::option::Option<::std::string::String> { + self.inner.get_search_job_identifier() + } + ///

The next item following a partial list of returned backups included in a search job.

+ ///

For example, if a request is made to return MaxResults number of backups, NextToken allows you to return more items in your list starting at the location pointed to by the next token.

+ pub fn next_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.inner = self.inner.next_token(input.into()); + self + } + ///

The next item following a partial list of returned backups included in a search job.

+ ///

For example, if a request is made to return MaxResults number of backups, NextToken allows you to return more items in your list starting at the location pointed to by the next token.

+ pub fn set_next_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.inner = self.inner.set_next_token(input); + self + } + ///

The next item following a partial list of returned backups included in a search job.

+ ///

For example, if a request is made to return MaxResults number of backups, NextToken allows you to return more items in your list starting at the location pointed to by the next token.

+ pub fn get_next_token(&self) -> &::std::option::Option<::std::string::String> { + self.inner.get_next_token() + } + ///

The maximum number of resource list items to be returned.

+ pub fn max_results(mut self, input: i32) -> Self { + self.inner = self.inner.max_results(input); + self + } + ///

The maximum number of resource list items to be returned.

+ pub fn set_max_results(mut self, input: ::std::option::Option) -> Self { + self.inner = self.inner.set_max_results(input); + self + } + ///

The maximum number of resource list items to be returned.

+ pub fn get_max_results(&self) -> &::std::option::Option { + self.inner.get_max_results() + } +} diff --git a/sdk/backupsearch/src/operation/list_search_result_export_jobs/paginator.rs b/sdk/backupsearch/src/operation/list_search_result_export_jobs/paginator.rs new file mode 100644 index 000000000000..6d50656f3ff8 --- /dev/null +++ b/sdk/backupsearch/src/operation/list_search_result_export_jobs/paginator.rs @@ -0,0 +1,152 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +/// Paginator for [`ListSearchResultExportJobs`](crate::operation::list_search_result_export_jobs::ListSearchResultExportJobs) +pub struct ListSearchResultExportJobsPaginator { + handle: std::sync::Arc, + builder: crate::operation::list_search_result_export_jobs::builders::ListSearchResultExportJobsInputBuilder, + stop_on_duplicate_token: bool, +} + +impl ListSearchResultExportJobsPaginator { + /// Create a new paginator-wrapper + pub(crate) fn new( + handle: std::sync::Arc, + builder: crate::operation::list_search_result_export_jobs::builders::ListSearchResultExportJobsInputBuilder, + ) -> Self { + Self { + handle, + builder, + stop_on_duplicate_token: true, + } + } + + /// Set the page size + /// + /// _Note: this method will override any previously set value for `max_results`_ + pub fn page_size(mut self, limit: i32) -> Self { + self.builder.max_results = ::std::option::Option::Some(limit); + self + } + + /// Create a flattened paginator + /// + /// This paginator automatically flattens results using `export_jobs`. Queries to the underlying service + /// are dispatched lazily. + pub fn items(self) -> crate::operation::list_search_result_export_jobs::paginator::ListSearchResultExportJobsPaginatorItems { + crate::operation::list_search_result_export_jobs::paginator::ListSearchResultExportJobsPaginatorItems(self) + } + + /// Stop paginating when the service returns the same pagination token twice in a row. + /// + /// Defaults to true. + /// + /// For certain operations, it may be useful to continue on duplicate token. For example, + /// if an operation is for tailing a log file in real-time, then continuing may be desired. + /// This option can be set to `false` to accommodate these use cases. + pub fn stop_on_duplicate_token(mut self, stop_on_duplicate_token: bool) -> Self { + self.stop_on_duplicate_token = stop_on_duplicate_token; + self + } + + /// Create the pagination stream + /// + /// _Note:_ No requests will be dispatched until the stream is used + /// (e.g. with the [`.next().await`](aws_smithy_async::future::pagination_stream::PaginationStream::next) method). + pub fn send( + self, + ) -> ::aws_smithy_async::future::pagination_stream::PaginationStream< + ::std::result::Result< + crate::operation::list_search_result_export_jobs::ListSearchResultExportJobsOutput, + ::aws_smithy_runtime_api::client::result::SdkError< + crate::operation::list_search_result_export_jobs::ListSearchResultExportJobsError, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >, + >, + > { + // Move individual fields out of self for the borrow checker + let builder = self.builder; + let handle = self.handle; + let runtime_plugins = crate::operation::list_search_result_export_jobs::ListSearchResultExportJobs::operation_runtime_plugins( + handle.runtime_plugins.clone(), + &handle.conf, + ::std::option::Option::None, + ) + .with_operation_plugin(crate::sdk_feature_tracker::paginator::PaginatorFeatureTrackerRuntimePlugin::new()); + ::aws_smithy_async::future::pagination_stream::PaginationStream::new(::aws_smithy_async::future::pagination_stream::fn_stream::FnStream::new( + move |tx| { + ::std::boxed::Box::pin(async move { + // Build the input for the first time. If required fields are missing, this is where we'll produce an early error. + let mut input = match builder + .build() + .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure) + { + ::std::result::Result::Ok(input) => input, + ::std::result::Result::Err(e) => { + let _ = tx.send(::std::result::Result::Err(e)).await; + return; + } + }; + loop { + let resp = crate::operation::list_search_result_export_jobs::ListSearchResultExportJobs::orchestrate( + &runtime_plugins, + input.clone(), + ) + .await; + // If the input member is None or it was an error + let done = match resp { + ::std::result::Result::Ok(ref resp) => { + let new_token = crate::lens::reflens_list_search_result_export_jobs_output_output_next_token(resp); + // Pagination is exhausted when the next token is an empty string + let is_empty = new_token.map(|token| token.is_empty()).unwrap_or(true); + if !is_empty && new_token == input.next_token.as_ref() && self.stop_on_duplicate_token { + true + } else { + input.next_token = new_token.cloned(); + is_empty + } + } + ::std::result::Result::Err(_) => true, + }; + if tx.send(resp).await.is_err() { + // receiving end was dropped + return; + } + if done { + return; + } + } + }) + }, + )) + } +} + +/// Flattened paginator for `ListSearchResultExportJobsPaginator` +/// +/// This is created with [`.items()`](ListSearchResultExportJobsPaginator::items) +pub struct ListSearchResultExportJobsPaginatorItems(ListSearchResultExportJobsPaginator); + +impl ListSearchResultExportJobsPaginatorItems { + /// Create the pagination stream + /// + /// _Note_: No requests will be dispatched until the stream is used + /// (e.g. with the [`.next().await`](aws_smithy_async::future::pagination_stream::PaginationStream::next) method). + /// + /// To read the entirety of the paginator, use [`.collect::, _>()`](aws_smithy_async::future::pagination_stream::PaginationStream::collect). + pub fn send( + self, + ) -> ::aws_smithy_async::future::pagination_stream::PaginationStream< + ::std::result::Result< + crate::types::ExportJobSummary, + ::aws_smithy_runtime_api::client::result::SdkError< + crate::operation::list_search_result_export_jobs::ListSearchResultExportJobsError, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >, + >, + > { + ::aws_smithy_async::future::pagination_stream::TryFlatMap::new(self.0.send()).flat_map(|page| { + crate::lens::lens_list_search_result_export_jobs_output_output_export_jobs(page) + .unwrap_or_default() + .into_iter() + }) + } +} diff --git a/sdk/backupsearch/src/operation/list_tags_for_resource.rs b/sdk/backupsearch/src/operation/list_tags_for_resource.rs new file mode 100644 index 000000000000..22cc37635162 --- /dev/null +++ b/sdk/backupsearch/src/operation/list_tags_for_resource.rs @@ -0,0 +1,405 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +/// Orchestration and serialization glue logic for `ListTagsForResource`. +#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)] +#[non_exhaustive] +pub struct ListTagsForResource; +impl ListTagsForResource { + /// Creates a new `ListTagsForResource` + pub fn new() -> Self { + Self + } + pub(crate) async fn orchestrate( + runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, + input: crate::operation::list_tags_for_resource::ListTagsForResourceInput, + ) -> ::std::result::Result< + crate::operation::list_tags_for_resource::ListTagsForResourceOutput, + ::aws_smithy_runtime_api::client::result::SdkError< + crate::operation::list_tags_for_resource::ListTagsForResourceError, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >, + > { + let map_err = |err: ::aws_smithy_runtime_api::client::result::SdkError< + ::aws_smithy_runtime_api::client::interceptors::context::Error, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >| { + err.map_service_error(|err| { + err.downcast::() + .expect("correct error type") + }) + }; + let context = Self::orchestrate_with_stop_point(runtime_plugins, input, ::aws_smithy_runtime::client::orchestrator::StopPoint::None) + .await + .map_err(map_err)?; + let output = context.finalize().map_err(map_err)?; + ::std::result::Result::Ok( + output + .downcast::() + .expect("correct output type"), + ) + } + + pub(crate) async fn orchestrate_with_stop_point( + runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, + input: crate::operation::list_tags_for_resource::ListTagsForResourceInput, + stop_point: ::aws_smithy_runtime::client::orchestrator::StopPoint, + ) -> ::std::result::Result< + ::aws_smithy_runtime_api::client::interceptors::context::InterceptorContext, + ::aws_smithy_runtime_api::client::result::SdkError< + ::aws_smithy_runtime_api::client::interceptors::context::Error, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >, + > { + let input = ::aws_smithy_runtime_api::client::interceptors::context::Input::erase(input); + ::aws_smithy_runtime::client::orchestrator::invoke_with_stop_point("backupsearch", "ListTagsForResource", input, runtime_plugins, stop_point) + .await + } + + pub(crate) fn operation_runtime_plugins( + client_runtime_plugins: ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, + client_config: &crate::config::Config, + config_override: ::std::option::Option, + ) -> ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins { + let mut runtime_plugins = client_runtime_plugins.with_operation_plugin(Self::new()); + runtime_plugins = runtime_plugins.with_client_plugin(crate::auth_plugin::DefaultAuthOptionsPlugin::new(vec![ + ::aws_runtime::auth::sigv4::SCHEME_ID, + ])); + if let ::std::option::Option::Some(config_override) = config_override { + for plugin in config_override.runtime_plugins.iter().cloned() { + runtime_plugins = runtime_plugins.with_operation_plugin(plugin); + } + runtime_plugins = runtime_plugins.with_operation_plugin(crate::config::ConfigOverrideRuntimePlugin::new( + config_override, + client_config.config.clone(), + &client_config.runtime_components, + )); + } + runtime_plugins + } +} +impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for ListTagsForResource { + fn config(&self) -> ::std::option::Option<::aws_smithy_types::config_bag::FrozenLayer> { + let mut cfg = ::aws_smithy_types::config_bag::Layer::new("ListTagsForResource"); + + cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new( + ListTagsForResourceRequestSerializer, + )); + cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new( + ListTagsForResourceResponseDeserializer, + )); + + cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new( + ::aws_smithy_runtime_api::client::auth::static_resolver::StaticAuthSchemeOptionResolverParams::new(), + )); + + cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::Metadata::new( + "ListTagsForResource", + "backupsearch", + )); + let mut signing_options = ::aws_runtime::auth::SigningOptions::default(); + signing_options.double_uri_encode = true; + signing_options.content_sha256_header = false; + signing_options.normalize_uri_path = true; + signing_options.payload_override = None; + + cfg.store_put(::aws_runtime::auth::SigV4OperationSigningConfig { + signing_options, + ..::std::default::Default::default() + }); + + ::std::option::Option::Some(cfg.freeze()) + } + + fn runtime_components( + &self, + _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder, + ) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> { + #[allow(unused_mut)] + let mut rcb = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("ListTagsForResource") + .with_interceptor(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default()) + .with_interceptor(ListTagsForResourceEndpointParamsInterceptor) + .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::< + crate::operation::list_tags_for_resource::ListTagsForResourceError, + >::new()) + .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::< + crate::operation::list_tags_for_resource::ListTagsForResourceError, + >::new()) + .with_retry_classifier(::aws_runtime::retries::classifiers::AwsErrorCodeClassifier::< + crate::operation::list_tags_for_resource::ListTagsForResourceError, + >::new()); + + ::std::borrow::Cow::Owned(rcb) + } +} + +#[derive(Debug)] +struct ListTagsForResourceResponseDeserializer; +impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for ListTagsForResourceResponseDeserializer { + fn deserialize_nonstreaming( + &self, + response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError { + let (success, status) = (response.status().is_success(), response.status().as_u16()); + let headers = response.headers(); + let body = response.body().bytes().expect("body loaded"); + #[allow(unused_mut)] + let mut force_error = false; + ::tracing::debug!(request_id = ?::aws_types::request_id::RequestId::request_id(response)); + let parse_result = if !success && status != 200 || force_error { + crate::protocol_serde::shape_list_tags_for_resource::de_list_tags_for_resource_http_error(status, headers, body) + } else { + crate::protocol_serde::shape_list_tags_for_resource::de_list_tags_for_resource_http_response(status, headers, body) + }; + crate::protocol_serde::type_erase_result(parse_result) + } +} +#[derive(Debug)] +struct ListTagsForResourceRequestSerializer; +impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for ListTagsForResourceRequestSerializer { + #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)] + fn serialize_input( + &self, + input: ::aws_smithy_runtime_api::client::interceptors::context::Input, + _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag, + ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> { + let input = input + .downcast::() + .expect("correct type"); + let _header_serialization_settings = _cfg + .load::() + .cloned() + .unwrap_or_default(); + let mut request_builder = { + fn uri_base( + _input: &crate::operation::list_tags_for_resource::ListTagsForResourceInput, + output: &mut ::std::string::String, + ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> { + use ::std::fmt::Write as _; + let input_1 = &_input.resource_arn; + let input_1 = input_1 + .as_ref() + .ok_or_else(|| ::aws_smithy_types::error::operation::BuildError::missing_field("resource_arn", "cannot be empty or unset"))?; + let resource_arn = ::aws_smithy_http::label::fmt_string(input_1, ::aws_smithy_http::label::EncodingStrategy::Default); + if resource_arn.is_empty() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "resource_arn", + "cannot be empty or unset", + )); + } + ::std::write!(output, "/tags/{ResourceArn}", ResourceArn = resource_arn).expect("formatting should succeed"); + ::std::result::Result::Ok(()) + } + #[allow(clippy::unnecessary_wraps)] + fn update_http_builder( + input: &crate::operation::list_tags_for_resource::ListTagsForResourceInput, + builder: ::http::request::Builder, + ) -> ::std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> { + let mut uri = ::std::string::String::new(); + uri_base(input, &mut uri)?; + ::std::result::Result::Ok(builder.method("GET").uri(uri)) + } + let mut builder = update_http_builder(&input, ::http::request::Builder::new())?; + builder + }; + let body = ::aws_smithy_types::body::SdkBody::from(""); + + ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap()) + } +} +#[derive(Debug)] +struct ListTagsForResourceEndpointParamsInterceptor; + +impl ::aws_smithy_runtime_api::client::interceptors::Intercept for ListTagsForResourceEndpointParamsInterceptor { + fn name(&self) -> &'static str { + "ListTagsForResourceEndpointParamsInterceptor" + } + + fn read_before_execution( + &self, + context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef< + '_, + ::aws_smithy_runtime_api::client::interceptors::context::Input, + ::aws_smithy_runtime_api::client::interceptors::context::Output, + ::aws_smithy_runtime_api::client::interceptors::context::Error, + >, + cfg: &mut ::aws_smithy_types::config_bag::ConfigBag, + ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> { + let _input = context + .input() + .downcast_ref::() + .ok_or("failed to downcast to ListTagsForResourceInput")?; + + let params = crate::config::endpoint::Params::builder() + .set_use_fips(cfg.load::<::aws_types::endpoint_config::UseFips>().map(|ty| ty.0)) + .set_endpoint(cfg.load::<::aws_types::endpoint_config::EndpointUrl>().map(|ty| ty.0.clone())) + .set_region(cfg.load::<::aws_types::region::Region>().map(|r| r.as_ref().to_owned())) + .build() + .map_err(|err| { + ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err) + })?; + cfg.interceptor_state() + .store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params)); + ::std::result::Result::Ok(()) + } +} + +// The get_* functions below are generated from JMESPath expressions in the +// operationContextParams trait. They target the operation's input shape. + +/// Error type for the `ListTagsForResourceError` operation. +#[non_exhaustive] +#[derive(::std::fmt::Debug)] +pub enum ListTagsForResourceError { + ///

The resource was not found for this request.

+ ///

Confirm the resource information, such as the ARN or type is correct and exists, then retry the request.

+ ResourceNotFoundException(crate::types::error::ResourceNotFoundException), + ///

You do not have sufficient access to perform this action.

+ AccessDeniedException(crate::types::error::AccessDeniedException), + ///

An internal server error occurred. Retry your request.

+ InternalServerException(crate::types::error::InternalServerException), + ///

The request was denied due to request throttling.

+ ThrottlingException(crate::types::error::ThrottlingException), + ///

The input fails to satisfy the constraints specified by a service.

+ ValidationException(crate::types::error::ValidationException), + /// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code). + #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \ + variable wildcard pattern and check `.code()`: + \ +    `err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }` + \ + See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-ListTagsForResourceError) for what information is available for the error.")] + Unhandled(crate::error::sealed_unhandled::Unhandled), +} +impl ListTagsForResourceError { + /// Creates the `ListTagsForResourceError::Unhandled` variant from any error type. + pub fn unhandled( + err: impl ::std::convert::Into<::std::boxed::Box>, + ) -> Self { + Self::Unhandled(crate::error::sealed_unhandled::Unhandled { + source: err.into(), + meta: ::std::default::Default::default(), + }) + } + + /// Creates the `ListTagsForResourceError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata). + pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self { + Self::Unhandled(crate::error::sealed_unhandled::Unhandled { + source: err.clone().into(), + meta: err, + }) + } + /// + /// Returns error metadata, which includes the error code, message, + /// request ID, and potentially additional information. + /// + pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata { + match self { + Self::ResourceNotFoundException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), + Self::AccessDeniedException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), + Self::InternalServerException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), + Self::ThrottlingException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), + Self::ValidationException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), + Self::Unhandled(e) => &e.meta, + } + } + /// Returns `true` if the error kind is `ListTagsForResourceError::ResourceNotFoundException`. + pub fn is_resource_not_found_exception(&self) -> bool { + matches!(self, Self::ResourceNotFoundException(_)) + } + /// Returns `true` if the error kind is `ListTagsForResourceError::AccessDeniedException`. + pub fn is_access_denied_exception(&self) -> bool { + matches!(self, Self::AccessDeniedException(_)) + } + /// Returns `true` if the error kind is `ListTagsForResourceError::InternalServerException`. + pub fn is_internal_server_exception(&self) -> bool { + matches!(self, Self::InternalServerException(_)) + } + /// Returns `true` if the error kind is `ListTagsForResourceError::ThrottlingException`. + pub fn is_throttling_exception(&self) -> bool { + matches!(self, Self::ThrottlingException(_)) + } + /// Returns `true` if the error kind is `ListTagsForResourceError::ValidationException`. + pub fn is_validation_exception(&self) -> bool { + matches!(self, Self::ValidationException(_)) + } +} +impl ::std::error::Error for ListTagsForResourceError { + fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> { + match self { + Self::ResourceNotFoundException(_inner) => ::std::option::Option::Some(_inner), + Self::AccessDeniedException(_inner) => ::std::option::Option::Some(_inner), + Self::InternalServerException(_inner) => ::std::option::Option::Some(_inner), + Self::ThrottlingException(_inner) => ::std::option::Option::Some(_inner), + Self::ValidationException(_inner) => ::std::option::Option::Some(_inner), + Self::Unhandled(_inner) => ::std::option::Option::Some(&*_inner.source), + } + } +} +impl ::std::fmt::Display for ListTagsForResourceError { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + match self { + Self::ResourceNotFoundException(_inner) => _inner.fmt(f), + Self::AccessDeniedException(_inner) => _inner.fmt(f), + Self::InternalServerException(_inner) => _inner.fmt(f), + Self::ThrottlingException(_inner) => _inner.fmt(f), + Self::ValidationException(_inner) => _inner.fmt(f), + Self::Unhandled(_inner) => { + if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) { + write!(f, "unhandled error ({code})") + } else { + f.write_str("unhandled error") + } + } + } + } +} +impl ::aws_smithy_types::retry::ProvideErrorKind for ListTagsForResourceError { + fn code(&self) -> ::std::option::Option<&str> { + ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) + } + fn retryable_error_kind(&self) -> ::std::option::Option<::aws_smithy_types::retry::ErrorKind> { + match self { + Self::InternalServerException(inner) => ::std::option::Option::Some(inner.retryable_error_kind()), + Self::ThrottlingException(inner) => ::std::option::Option::Some(inner.retryable_error_kind()), + _ => ::std::option::Option::None, + } + } +} +impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for ListTagsForResourceError { + fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata { + match self { + Self::ResourceNotFoundException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner), + Self::AccessDeniedException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner), + Self::InternalServerException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner), + Self::ThrottlingException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner), + Self::ValidationException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner), + Self::Unhandled(_inner) => &_inner.meta, + } + } +} +impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for ListTagsForResourceError { + fn create_unhandled_error( + source: ::std::boxed::Box, + meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>, + ) -> Self { + Self::Unhandled(crate::error::sealed_unhandled::Unhandled { + source, + meta: meta.unwrap_or_default(), + }) + } +} +impl ::aws_types::request_id::RequestId for crate::operation::list_tags_for_resource::ListTagsForResourceError { + fn request_id(&self) -> Option<&str> { + self.meta().request_id() + } +} + +pub use crate::operation::list_tags_for_resource::_list_tags_for_resource_output::ListTagsForResourceOutput; + +pub use crate::operation::list_tags_for_resource::_list_tags_for_resource_input::ListTagsForResourceInput; + +mod _list_tags_for_resource_input; + +mod _list_tags_for_resource_output; + +/// Builders +pub mod builders; diff --git a/sdk/backupsearch/src/operation/list_tags_for_resource/_list_tags_for_resource_input.rs b/sdk/backupsearch/src/operation/list_tags_for_resource/_list_tags_for_resource_input.rs new file mode 100644 index 000000000000..7271f92d2550 --- /dev/null +++ b/sdk/backupsearch/src/operation/list_tags_for_resource/_list_tags_for_resource_input.rs @@ -0,0 +1,53 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +#[allow(missing_docs)] // documentation missing in model +#[non_exhaustive] +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)] +pub struct ListTagsForResourceInput { + ///

The Amazon Resource Name (ARN) that uniquely identifies the resource.>

+ pub resource_arn: ::std::option::Option<::std::string::String>, +} +impl ListTagsForResourceInput { + ///

The Amazon Resource Name (ARN) that uniquely identifies the resource.>

+ pub fn resource_arn(&self) -> ::std::option::Option<&str> { + self.resource_arn.as_deref() + } +} +impl ListTagsForResourceInput { + /// Creates a new builder-style object to manufacture [`ListTagsForResourceInput`](crate::operation::list_tags_for_resource::ListTagsForResourceInput). + pub fn builder() -> crate::operation::list_tags_for_resource::builders::ListTagsForResourceInputBuilder { + crate::operation::list_tags_for_resource::builders::ListTagsForResourceInputBuilder::default() + } +} + +/// A builder for [`ListTagsForResourceInput`](crate::operation::list_tags_for_resource::ListTagsForResourceInput). +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)] +#[non_exhaustive] +pub struct ListTagsForResourceInputBuilder { + pub(crate) resource_arn: ::std::option::Option<::std::string::String>, +} +impl ListTagsForResourceInputBuilder { + ///

The Amazon Resource Name (ARN) that uniquely identifies the resource.>

+ /// This field is required. + pub fn resource_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.resource_arn = ::std::option::Option::Some(input.into()); + self + } + ///

The Amazon Resource Name (ARN) that uniquely identifies the resource.>

+ pub fn set_resource_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.resource_arn = input; + self + } + ///

The Amazon Resource Name (ARN) that uniquely identifies the resource.>

+ pub fn get_resource_arn(&self) -> &::std::option::Option<::std::string::String> { + &self.resource_arn + } + /// Consumes the builder and constructs a [`ListTagsForResourceInput`](crate::operation::list_tags_for_resource::ListTagsForResourceInput). + pub fn build( + self, + ) -> ::std::result::Result + { + ::std::result::Result::Ok(crate::operation::list_tags_for_resource::ListTagsForResourceInput { + resource_arn: self.resource_arn, + }) + } +} diff --git a/sdk/backupsearch/src/operation/list_tags_for_resource/_list_tags_for_resource_output.rs b/sdk/backupsearch/src/operation/list_tags_for_resource/_list_tags_for_resource_output.rs new file mode 100644 index 000000000000..467f9a0d0351 --- /dev/null +++ b/sdk/backupsearch/src/operation/list_tags_for_resource/_list_tags_for_resource_output.rs @@ -0,0 +1,77 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +#[allow(missing_docs)] // documentation missing in model +#[non_exhaustive] +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)] +pub struct ListTagsForResourceOutput { + ///

List of tags returned by the operation.

+ pub tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::option::Option<::std::string::String>>>, + _request_id: Option, +} +impl ListTagsForResourceOutput { + ///

List of tags returned by the operation.

+ pub fn tags(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::option::Option<::std::string::String>>> { + self.tags.as_ref() + } +} +impl ::aws_types::request_id::RequestId for ListTagsForResourceOutput { + fn request_id(&self) -> Option<&str> { + self._request_id.as_deref() + } +} +impl ListTagsForResourceOutput { + /// Creates a new builder-style object to manufacture [`ListTagsForResourceOutput`](crate::operation::list_tags_for_resource::ListTagsForResourceOutput). + pub fn builder() -> crate::operation::list_tags_for_resource::builders::ListTagsForResourceOutputBuilder { + crate::operation::list_tags_for_resource::builders::ListTagsForResourceOutputBuilder::default() + } +} + +/// A builder for [`ListTagsForResourceOutput`](crate::operation::list_tags_for_resource::ListTagsForResourceOutput). +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)] +#[non_exhaustive] +pub struct ListTagsForResourceOutputBuilder { + pub(crate) tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::option::Option<::std::string::String>>>, + _request_id: Option, +} +impl ListTagsForResourceOutputBuilder { + /// Adds a key-value pair to `tags`. + /// + /// To override the contents of this collection use [`set_tags`](Self::set_tags). + /// + ///

List of tags returned by the operation.

+ pub fn tags(mut self, k: impl ::std::convert::Into<::std::string::String>, v: ::std::option::Option<::std::string::String>) -> Self { + let mut hash_map = self.tags.unwrap_or_default(); + hash_map.insert(k.into(), v); + self.tags = ::std::option::Option::Some(hash_map); + self + } + ///

List of tags returned by the operation.

+ pub fn set_tags( + mut self, + input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::option::Option<::std::string::String>>>, + ) -> Self { + self.tags = input; + self + } + ///

List of tags returned by the operation.

+ pub fn get_tags( + &self, + ) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::option::Option<::std::string::String>>> { + &self.tags + } + pub(crate) fn _request_id(mut self, request_id: impl Into) -> Self { + self._request_id = Some(request_id.into()); + self + } + + pub(crate) fn _set_request_id(&mut self, request_id: Option) -> &mut Self { + self._request_id = request_id; + self + } + /// Consumes the builder and constructs a [`ListTagsForResourceOutput`](crate::operation::list_tags_for_resource::ListTagsForResourceOutput). + pub fn build(self) -> crate::operation::list_tags_for_resource::ListTagsForResourceOutput { + crate::operation::list_tags_for_resource::ListTagsForResourceOutput { + tags: self.tags, + _request_id: self._request_id, + } + } +} diff --git a/sdk/backupsearch/src/operation/list_tags_for_resource/builders.rs b/sdk/backupsearch/src/operation/list_tags_for_resource/builders.rs new file mode 100644 index 000000000000..404113962da9 --- /dev/null +++ b/sdk/backupsearch/src/operation/list_tags_for_resource/builders.rs @@ -0,0 +1,125 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +pub use crate::operation::list_tags_for_resource::_list_tags_for_resource_output::ListTagsForResourceOutputBuilder; + +pub use crate::operation::list_tags_for_resource::_list_tags_for_resource_input::ListTagsForResourceInputBuilder; + +impl crate::operation::list_tags_for_resource::builders::ListTagsForResourceInputBuilder { + /// Sends a request with this input using the given client. + pub async fn send_with( + self, + client: &crate::Client, + ) -> ::std::result::Result< + crate::operation::list_tags_for_resource::ListTagsForResourceOutput, + ::aws_smithy_runtime_api::client::result::SdkError< + crate::operation::list_tags_for_resource::ListTagsForResourceError, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >, + > { + let mut fluent_builder = client.list_tags_for_resource(); + fluent_builder.inner = self; + fluent_builder.send().await + } +} +/// Fluent builder constructing a request to `ListTagsForResource`. +/// +///

This operation returns the tags for a resource type.

+#[derive(::std::clone::Clone, ::std::fmt::Debug)] +pub struct ListTagsForResourceFluentBuilder { + handle: ::std::sync::Arc, + inner: crate::operation::list_tags_for_resource::builders::ListTagsForResourceInputBuilder, + config_override: ::std::option::Option, +} +impl + crate::client::customize::internal::CustomizableSend< + crate::operation::list_tags_for_resource::ListTagsForResourceOutput, + crate::operation::list_tags_for_resource::ListTagsForResourceError, + > for ListTagsForResourceFluentBuilder +{ + fn send( + self, + config_override: crate::config::Builder, + ) -> crate::client::customize::internal::BoxFuture< + crate::client::customize::internal::SendResult< + crate::operation::list_tags_for_resource::ListTagsForResourceOutput, + crate::operation::list_tags_for_resource::ListTagsForResourceError, + >, + > { + ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await }) + } +} +impl ListTagsForResourceFluentBuilder { + /// Creates a new `ListTagsForResourceFluentBuilder`. + pub(crate) fn new(handle: ::std::sync::Arc) -> Self { + Self { + handle, + inner: ::std::default::Default::default(), + config_override: ::std::option::Option::None, + } + } + /// Access the ListTagsForResource as a reference. + pub fn as_input(&self) -> &crate::operation::list_tags_for_resource::builders::ListTagsForResourceInputBuilder { + &self.inner + } + /// Sends the request and returns the response. + /// + /// If an error occurs, an `SdkError` will be returned with additional details that + /// can be matched against. + /// + /// By default, any retryable failures will be retried twice. Retry behavior + /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be + /// set when configuring the client. + pub async fn send( + self, + ) -> ::std::result::Result< + crate::operation::list_tags_for_resource::ListTagsForResourceOutput, + ::aws_smithy_runtime_api::client::result::SdkError< + crate::operation::list_tags_for_resource::ListTagsForResourceError, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >, + > { + let input = self + .inner + .build() + .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?; + let runtime_plugins = crate::operation::list_tags_for_resource::ListTagsForResource::operation_runtime_plugins( + self.handle.runtime_plugins.clone(), + &self.handle.conf, + self.config_override, + ); + crate::operation::list_tags_for_resource::ListTagsForResource::orchestrate(&runtime_plugins, input).await + } + + /// Consumes this builder, creating a customizable operation that can be modified before being sent. + pub fn customize( + self, + ) -> crate::client::customize::CustomizableOperation< + crate::operation::list_tags_for_resource::ListTagsForResourceOutput, + crate::operation::list_tags_for_resource::ListTagsForResourceError, + Self, + > { + crate::client::customize::CustomizableOperation::new(self) + } + pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into) -> Self { + self.set_config_override(::std::option::Option::Some(config_override.into())); + self + } + + pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option) -> &mut Self { + self.config_override = config_override; + self + } + ///

The Amazon Resource Name (ARN) that uniquely identifies the resource.>

+ pub fn resource_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.inner = self.inner.resource_arn(input.into()); + self + } + ///

The Amazon Resource Name (ARN) that uniquely identifies the resource.>

+ pub fn set_resource_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.inner = self.inner.set_resource_arn(input); + self + } + ///

The Amazon Resource Name (ARN) that uniquely identifies the resource.>

+ pub fn get_resource_arn(&self) -> &::std::option::Option<::std::string::String> { + self.inner.get_resource_arn() + } +} diff --git a/sdk/backupsearch/src/operation/start_search_job.rs b/sdk/backupsearch/src/operation/start_search_job.rs new file mode 100644 index 000000000000..1d06aeb940c4 --- /dev/null +++ b/sdk/backupsearch/src/operation/start_search_job.rs @@ -0,0 +1,407 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +/// Orchestration and serialization glue logic for `StartSearchJob`. +#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)] +#[non_exhaustive] +pub struct StartSearchJob; +impl StartSearchJob { + /// Creates a new `StartSearchJob` + pub fn new() -> Self { + Self + } + pub(crate) async fn orchestrate( + runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, + input: crate::operation::start_search_job::StartSearchJobInput, + ) -> ::std::result::Result< + crate::operation::start_search_job::StartSearchJobOutput, + ::aws_smithy_runtime_api::client::result::SdkError< + crate::operation::start_search_job::StartSearchJobError, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >, + > { + let map_err = |err: ::aws_smithy_runtime_api::client::result::SdkError< + ::aws_smithy_runtime_api::client::interceptors::context::Error, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >| { + err.map_service_error(|err| { + err.downcast::() + .expect("correct error type") + }) + }; + let context = Self::orchestrate_with_stop_point(runtime_plugins, input, ::aws_smithy_runtime::client::orchestrator::StopPoint::None) + .await + .map_err(map_err)?; + let output = context.finalize().map_err(map_err)?; + ::std::result::Result::Ok( + output + .downcast::() + .expect("correct output type"), + ) + } + + pub(crate) async fn orchestrate_with_stop_point( + runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, + input: crate::operation::start_search_job::StartSearchJobInput, + stop_point: ::aws_smithy_runtime::client::orchestrator::StopPoint, + ) -> ::std::result::Result< + ::aws_smithy_runtime_api::client::interceptors::context::InterceptorContext, + ::aws_smithy_runtime_api::client::result::SdkError< + ::aws_smithy_runtime_api::client::interceptors::context::Error, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >, + > { + let input = ::aws_smithy_runtime_api::client::interceptors::context::Input::erase(input); + ::aws_smithy_runtime::client::orchestrator::invoke_with_stop_point("backupsearch", "StartSearchJob", input, runtime_plugins, stop_point).await + } + + pub(crate) fn operation_runtime_plugins( + client_runtime_plugins: ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, + client_config: &crate::config::Config, + config_override: ::std::option::Option, + ) -> ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins { + let mut runtime_plugins = client_runtime_plugins.with_operation_plugin(Self::new()); + runtime_plugins = runtime_plugins.with_client_plugin(crate::auth_plugin::DefaultAuthOptionsPlugin::new(vec![ + ::aws_runtime::auth::sigv4::SCHEME_ID, + ])); + if let ::std::option::Option::Some(config_override) = config_override { + for plugin in config_override.runtime_plugins.iter().cloned() { + runtime_plugins = runtime_plugins.with_operation_plugin(plugin); + } + runtime_plugins = runtime_plugins.with_operation_plugin(crate::config::ConfigOverrideRuntimePlugin::new( + config_override, + client_config.config.clone(), + &client_config.runtime_components, + )); + } + runtime_plugins + } +} +impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for StartSearchJob { + fn config(&self) -> ::std::option::Option<::aws_smithy_types::config_bag::FrozenLayer> { + let mut cfg = ::aws_smithy_types::config_bag::Layer::new("StartSearchJob"); + + cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new( + StartSearchJobRequestSerializer, + )); + cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new( + StartSearchJobResponseDeserializer, + )); + + cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new( + ::aws_smithy_runtime_api::client::auth::static_resolver::StaticAuthSchemeOptionResolverParams::new(), + )); + + cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::Metadata::new( + "StartSearchJob", + "backupsearch", + )); + let mut signing_options = ::aws_runtime::auth::SigningOptions::default(); + signing_options.double_uri_encode = true; + signing_options.content_sha256_header = false; + signing_options.normalize_uri_path = true; + signing_options.payload_override = None; + + cfg.store_put(::aws_runtime::auth::SigV4OperationSigningConfig { + signing_options, + ..::std::default::Default::default() + }); + + ::std::option::Option::Some(cfg.freeze()) + } + + fn runtime_components( + &self, + _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder, + ) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> { + #[allow(unused_mut)] + let mut rcb = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("StartSearchJob") + .with_interceptor(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default()) + .with_interceptor(StartSearchJobEndpointParamsInterceptor) + .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::< + crate::operation::start_search_job::StartSearchJobError, + >::new()) + .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::< + crate::operation::start_search_job::StartSearchJobError, + >::new()) + .with_retry_classifier(::aws_runtime::retries::classifiers::AwsErrorCodeClassifier::< + crate::operation::start_search_job::StartSearchJobError, + >::new()); + + ::std::borrow::Cow::Owned(rcb) + } +} + +#[derive(Debug)] +struct StartSearchJobResponseDeserializer; +impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for StartSearchJobResponseDeserializer { + fn deserialize_nonstreaming( + &self, + response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError { + let (success, status) = (response.status().is_success(), response.status().as_u16()); + let headers = response.headers(); + let body = response.body().bytes().expect("body loaded"); + #[allow(unused_mut)] + let mut force_error = false; + ::tracing::debug!(request_id = ?::aws_types::request_id::RequestId::request_id(response)); + let parse_result = if !success && status != 200 || force_error { + crate::protocol_serde::shape_start_search_job::de_start_search_job_http_error(status, headers, body) + } else { + crate::protocol_serde::shape_start_search_job::de_start_search_job_http_response(status, headers, body) + }; + crate::protocol_serde::type_erase_result(parse_result) + } +} +#[derive(Debug)] +struct StartSearchJobRequestSerializer; +impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for StartSearchJobRequestSerializer { + #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)] + fn serialize_input( + &self, + input: ::aws_smithy_runtime_api::client::interceptors::context::Input, + _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag, + ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> { + let input = input + .downcast::() + .expect("correct type"); + let _header_serialization_settings = _cfg + .load::() + .cloned() + .unwrap_or_default(); + let mut request_builder = { + fn uri_base( + _input: &crate::operation::start_search_job::StartSearchJobInput, + output: &mut ::std::string::String, + ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> { + use ::std::fmt::Write as _; + ::std::write!(output, "/search-jobs").expect("formatting should succeed"); + ::std::result::Result::Ok(()) + } + #[allow(clippy::unnecessary_wraps)] + fn update_http_builder( + input: &crate::operation::start_search_job::StartSearchJobInput, + builder: ::http::request::Builder, + ) -> ::std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> { + let mut uri = ::std::string::String::new(); + uri_base(input, &mut uri)?; + ::std::result::Result::Ok(builder.method("PUT").uri(uri)) + } + let mut builder = update_http_builder(&input, ::http::request::Builder::new())?; + builder = _header_serialization_settings.set_default_header(builder, ::http::header::CONTENT_TYPE, "application/json"); + builder + }; + let body = ::aws_smithy_types::body::SdkBody::from(crate::protocol_serde::shape_start_search_job::ser_start_search_job_input(&input)?); + if let Some(content_length) = body.content_length() { + let content_length = content_length.to_string(); + request_builder = _header_serialization_settings.set_default_header(request_builder, ::http::header::CONTENT_LENGTH, &content_length); + } + ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap()) + } +} +#[derive(Debug)] +struct StartSearchJobEndpointParamsInterceptor; + +impl ::aws_smithy_runtime_api::client::interceptors::Intercept for StartSearchJobEndpointParamsInterceptor { + fn name(&self) -> &'static str { + "StartSearchJobEndpointParamsInterceptor" + } + + fn read_before_execution( + &self, + context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef< + '_, + ::aws_smithy_runtime_api::client::interceptors::context::Input, + ::aws_smithy_runtime_api::client::interceptors::context::Output, + ::aws_smithy_runtime_api::client::interceptors::context::Error, + >, + cfg: &mut ::aws_smithy_types::config_bag::ConfigBag, + ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> { + let _input = context + .input() + .downcast_ref::() + .ok_or("failed to downcast to StartSearchJobInput")?; + + let params = crate::config::endpoint::Params::builder() + .set_use_fips(cfg.load::<::aws_types::endpoint_config::UseFips>().map(|ty| ty.0)) + .set_endpoint(cfg.load::<::aws_types::endpoint_config::EndpointUrl>().map(|ty| ty.0.clone())) + .set_region(cfg.load::<::aws_types::region::Region>().map(|r| r.as_ref().to_owned())) + .build() + .map_err(|err| { + ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err) + })?; + cfg.interceptor_state() + .store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params)); + ::std::result::Result::Ok(()) + } +} + +// The get_* functions below are generated from JMESPath expressions in the +// operationContextParams trait. They target the operation's input shape. + +/// Error type for the `StartSearchJobError` operation. +#[non_exhaustive] +#[derive(::std::fmt::Debug)] +pub enum StartSearchJobError { + ///

This exception occurs when a conflict with a previous successful operation is detected. This generally occurs when the previous operation did not have time to propagate to the host serving the current request.

+ ///

A retry (with appropriate backoff logic) is the recommended response to this exception.

+ ConflictException(crate::types::error::ConflictException), + ///

The request denied due to exceeding the quota limits permitted.

+ ServiceQuotaExceededException(crate::types::error::ServiceQuotaExceededException), + ///

You do not have sufficient access to perform this action.

+ AccessDeniedException(crate::types::error::AccessDeniedException), + ///

An internal server error occurred. Retry your request.

+ InternalServerException(crate::types::error::InternalServerException), + ///

The request was denied due to request throttling.

+ ThrottlingException(crate::types::error::ThrottlingException), + ///

The input fails to satisfy the constraints specified by a service.

+ ValidationException(crate::types::error::ValidationException), + /// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code). + #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \ + variable wildcard pattern and check `.code()`: + \ +    `err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }` + \ + See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-StartSearchJobError) for what information is available for the error.")] + Unhandled(crate::error::sealed_unhandled::Unhandled), +} +impl StartSearchJobError { + /// Creates the `StartSearchJobError::Unhandled` variant from any error type. + pub fn unhandled( + err: impl ::std::convert::Into<::std::boxed::Box>, + ) -> Self { + Self::Unhandled(crate::error::sealed_unhandled::Unhandled { + source: err.into(), + meta: ::std::default::Default::default(), + }) + } + + /// Creates the `StartSearchJobError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata). + pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self { + Self::Unhandled(crate::error::sealed_unhandled::Unhandled { + source: err.clone().into(), + meta: err, + }) + } + /// + /// Returns error metadata, which includes the error code, message, + /// request ID, and potentially additional information. + /// + pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata { + match self { + Self::ConflictException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), + Self::ServiceQuotaExceededException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), + Self::AccessDeniedException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), + Self::InternalServerException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), + Self::ThrottlingException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), + Self::ValidationException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), + Self::Unhandled(e) => &e.meta, + } + } + /// Returns `true` if the error kind is `StartSearchJobError::ConflictException`. + pub fn is_conflict_exception(&self) -> bool { + matches!(self, Self::ConflictException(_)) + } + /// Returns `true` if the error kind is `StartSearchJobError::ServiceQuotaExceededException`. + pub fn is_service_quota_exceeded_exception(&self) -> bool { + matches!(self, Self::ServiceQuotaExceededException(_)) + } + /// Returns `true` if the error kind is `StartSearchJobError::AccessDeniedException`. + pub fn is_access_denied_exception(&self) -> bool { + matches!(self, Self::AccessDeniedException(_)) + } + /// Returns `true` if the error kind is `StartSearchJobError::InternalServerException`. + pub fn is_internal_server_exception(&self) -> bool { + matches!(self, Self::InternalServerException(_)) + } + /// Returns `true` if the error kind is `StartSearchJobError::ThrottlingException`. + pub fn is_throttling_exception(&self) -> bool { + matches!(self, Self::ThrottlingException(_)) + } + /// Returns `true` if the error kind is `StartSearchJobError::ValidationException`. + pub fn is_validation_exception(&self) -> bool { + matches!(self, Self::ValidationException(_)) + } +} +impl ::std::error::Error for StartSearchJobError { + fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> { + match self { + Self::ConflictException(_inner) => ::std::option::Option::Some(_inner), + Self::ServiceQuotaExceededException(_inner) => ::std::option::Option::Some(_inner), + Self::AccessDeniedException(_inner) => ::std::option::Option::Some(_inner), + Self::InternalServerException(_inner) => ::std::option::Option::Some(_inner), + Self::ThrottlingException(_inner) => ::std::option::Option::Some(_inner), + Self::ValidationException(_inner) => ::std::option::Option::Some(_inner), + Self::Unhandled(_inner) => ::std::option::Option::Some(&*_inner.source), + } + } +} +impl ::std::fmt::Display for StartSearchJobError { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + match self { + Self::ConflictException(_inner) => _inner.fmt(f), + Self::ServiceQuotaExceededException(_inner) => _inner.fmt(f), + Self::AccessDeniedException(_inner) => _inner.fmt(f), + Self::InternalServerException(_inner) => _inner.fmt(f), + Self::ThrottlingException(_inner) => _inner.fmt(f), + Self::ValidationException(_inner) => _inner.fmt(f), + Self::Unhandled(_inner) => { + if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) { + write!(f, "unhandled error ({code})") + } else { + f.write_str("unhandled error") + } + } + } + } +} +impl ::aws_smithy_types::retry::ProvideErrorKind for StartSearchJobError { + fn code(&self) -> ::std::option::Option<&str> { + ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) + } + fn retryable_error_kind(&self) -> ::std::option::Option<::aws_smithy_types::retry::ErrorKind> { + match self { + Self::InternalServerException(inner) => ::std::option::Option::Some(inner.retryable_error_kind()), + Self::ThrottlingException(inner) => ::std::option::Option::Some(inner.retryable_error_kind()), + _ => ::std::option::Option::None, + } + } +} +impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for StartSearchJobError { + fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata { + match self { + Self::ConflictException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner), + Self::ServiceQuotaExceededException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner), + Self::AccessDeniedException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner), + Self::InternalServerException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner), + Self::ThrottlingException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner), + Self::ValidationException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner), + Self::Unhandled(_inner) => &_inner.meta, + } + } +} +impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for StartSearchJobError { + fn create_unhandled_error( + source: ::std::boxed::Box, + meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>, + ) -> Self { + Self::Unhandled(crate::error::sealed_unhandled::Unhandled { + source, + meta: meta.unwrap_or_default(), + }) + } +} +impl ::aws_types::request_id::RequestId for crate::operation::start_search_job::StartSearchJobError { + fn request_id(&self) -> Option<&str> { + self.meta().request_id() + } +} + +pub use crate::operation::start_search_job::_start_search_job_output::StartSearchJobOutput; + +pub use crate::operation::start_search_job::_start_search_job_input::StartSearchJobInput; + +mod _start_search_job_input; + +mod _start_search_job_output; + +/// Builders +pub mod builders; diff --git a/sdk/backupsearch/src/operation/start_search_job/_start_search_job_input.rs b/sdk/backupsearch/src/operation/start_search_job/_start_search_job_input.rs new file mode 100644 index 000000000000..56a3d03daabf --- /dev/null +++ b/sdk/backupsearch/src/operation/start_search_job/_start_search_job_input.rs @@ -0,0 +1,183 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +#[allow(missing_docs)] // documentation missing in model +#[non_exhaustive] +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)] +pub struct StartSearchJobInput { + ///

List of tags returned by the operation.

+ pub tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::option::Option<::std::string::String>>>, + ///

Include alphanumeric characters to create a name for this search job.

+ pub name: ::std::option::Option<::std::string::String>, + ///

The encryption key for the specified search job.

+ pub encryption_key_arn: ::std::option::Option<::std::string::String>, + ///

Include this parameter to allow multiple identical calls for idempotency.

+ ///

A client token is valid for 8 hours after the first request that uses it is completed. After this time, any request with the same token is treated as a new request.

+ pub client_token: ::std::option::Option<::std::string::String>, + ///

This object can contain BackupResourceTypes, BackupResourceArns, BackupResourceCreationTime, BackupResourceTags, and SourceResourceArns to filter the recovery points returned by the search job.

+ pub search_scope: ::std::option::Option, + ///

Item Filters represent all input item properties specified when the search was created.

+ ///

Contains either EBSItemFilters or S3ItemFilters

+ pub item_filters: ::std::option::Option, +} +impl StartSearchJobInput { + ///

List of tags returned by the operation.

+ pub fn tags(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::option::Option<::std::string::String>>> { + self.tags.as_ref() + } + ///

Include alphanumeric characters to create a name for this search job.

+ pub fn name(&self) -> ::std::option::Option<&str> { + self.name.as_deref() + } + ///

The encryption key for the specified search job.

+ pub fn encryption_key_arn(&self) -> ::std::option::Option<&str> { + self.encryption_key_arn.as_deref() + } + ///

Include this parameter to allow multiple identical calls for idempotency.

+ ///

A client token is valid for 8 hours after the first request that uses it is completed. After this time, any request with the same token is treated as a new request.

+ pub fn client_token(&self) -> ::std::option::Option<&str> { + self.client_token.as_deref() + } + ///

This object can contain BackupResourceTypes, BackupResourceArns, BackupResourceCreationTime, BackupResourceTags, and SourceResourceArns to filter the recovery points returned by the search job.

+ pub fn search_scope(&self) -> ::std::option::Option<&crate::types::SearchScope> { + self.search_scope.as_ref() + } + ///

Item Filters represent all input item properties specified when the search was created.

+ ///

Contains either EBSItemFilters or S3ItemFilters

+ pub fn item_filters(&self) -> ::std::option::Option<&crate::types::ItemFilters> { + self.item_filters.as_ref() + } +} +impl StartSearchJobInput { + /// Creates a new builder-style object to manufacture [`StartSearchJobInput`](crate::operation::start_search_job::StartSearchJobInput). + pub fn builder() -> crate::operation::start_search_job::builders::StartSearchJobInputBuilder { + crate::operation::start_search_job::builders::StartSearchJobInputBuilder::default() + } +} + +/// A builder for [`StartSearchJobInput`](crate::operation::start_search_job::StartSearchJobInput). +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)] +#[non_exhaustive] +pub struct StartSearchJobInputBuilder { + pub(crate) tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::option::Option<::std::string::String>>>, + pub(crate) name: ::std::option::Option<::std::string::String>, + pub(crate) encryption_key_arn: ::std::option::Option<::std::string::String>, + pub(crate) client_token: ::std::option::Option<::std::string::String>, + pub(crate) search_scope: ::std::option::Option, + pub(crate) item_filters: ::std::option::Option, +} +impl StartSearchJobInputBuilder { + /// Adds a key-value pair to `tags`. + /// + /// To override the contents of this collection use [`set_tags`](Self::set_tags). + /// + ///

List of tags returned by the operation.

+ pub fn tags(mut self, k: impl ::std::convert::Into<::std::string::String>, v: ::std::option::Option<::std::string::String>) -> Self { + let mut hash_map = self.tags.unwrap_or_default(); + hash_map.insert(k.into(), v); + self.tags = ::std::option::Option::Some(hash_map); + self + } + ///

List of tags returned by the operation.

+ pub fn set_tags( + mut self, + input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::option::Option<::std::string::String>>>, + ) -> Self { + self.tags = input; + self + } + ///

List of tags returned by the operation.

+ pub fn get_tags( + &self, + ) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::option::Option<::std::string::String>>> { + &self.tags + } + ///

Include alphanumeric characters to create a name for this search job.

+ pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.name = ::std::option::Option::Some(input.into()); + self + } + ///

Include alphanumeric characters to create a name for this search job.

+ pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.name = input; + self + } + ///

Include alphanumeric characters to create a name for this search job.

+ pub fn get_name(&self) -> &::std::option::Option<::std::string::String> { + &self.name + } + ///

The encryption key for the specified search job.

+ pub fn encryption_key_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.encryption_key_arn = ::std::option::Option::Some(input.into()); + self + } + ///

The encryption key for the specified search job.

+ pub fn set_encryption_key_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.encryption_key_arn = input; + self + } + ///

The encryption key for the specified search job.

+ pub fn get_encryption_key_arn(&self) -> &::std::option::Option<::std::string::String> { + &self.encryption_key_arn + } + ///

Include this parameter to allow multiple identical calls for idempotency.

+ ///

A client token is valid for 8 hours after the first request that uses it is completed. After this time, any request with the same token is treated as a new request.

+ pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.client_token = ::std::option::Option::Some(input.into()); + self + } + ///

Include this parameter to allow multiple identical calls for idempotency.

+ ///

A client token is valid for 8 hours after the first request that uses it is completed. After this time, any request with the same token is treated as a new request.

+ pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.client_token = input; + self + } + ///

Include this parameter to allow multiple identical calls for idempotency.

+ ///

A client token is valid for 8 hours after the first request that uses it is completed. After this time, any request with the same token is treated as a new request.

+ pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> { + &self.client_token + } + ///

This object can contain BackupResourceTypes, BackupResourceArns, BackupResourceCreationTime, BackupResourceTags, and SourceResourceArns to filter the recovery points returned by the search job.

+ /// This field is required. + pub fn search_scope(mut self, input: crate::types::SearchScope) -> Self { + self.search_scope = ::std::option::Option::Some(input); + self + } + ///

This object can contain BackupResourceTypes, BackupResourceArns, BackupResourceCreationTime, BackupResourceTags, and SourceResourceArns to filter the recovery points returned by the search job.

+ pub fn set_search_scope(mut self, input: ::std::option::Option) -> Self { + self.search_scope = input; + self + } + ///

This object can contain BackupResourceTypes, BackupResourceArns, BackupResourceCreationTime, BackupResourceTags, and SourceResourceArns to filter the recovery points returned by the search job.

+ pub fn get_search_scope(&self) -> &::std::option::Option { + &self.search_scope + } + ///

Item Filters represent all input item properties specified when the search was created.

+ ///

Contains either EBSItemFilters or S3ItemFilters

+ pub fn item_filters(mut self, input: crate::types::ItemFilters) -> Self { + self.item_filters = ::std::option::Option::Some(input); + self + } + ///

Item Filters represent all input item properties specified when the search was created.

+ ///

Contains either EBSItemFilters or S3ItemFilters

+ pub fn set_item_filters(mut self, input: ::std::option::Option) -> Self { + self.item_filters = input; + self + } + ///

Item Filters represent all input item properties specified when the search was created.

+ ///

Contains either EBSItemFilters or S3ItemFilters

+ pub fn get_item_filters(&self) -> &::std::option::Option { + &self.item_filters + } + /// Consumes the builder and constructs a [`StartSearchJobInput`](crate::operation::start_search_job::StartSearchJobInput). + pub fn build( + self, + ) -> ::std::result::Result { + ::std::result::Result::Ok(crate::operation::start_search_job::StartSearchJobInput { + tags: self.tags, + name: self.name, + encryption_key_arn: self.encryption_key_arn, + client_token: self.client_token, + search_scope: self.search_scope, + item_filters: self.item_filters, + }) + } +} diff --git a/sdk/backupsearch/src/operation/start_search_job/_start_search_job_output.rs b/sdk/backupsearch/src/operation/start_search_job/_start_search_job_output.rs new file mode 100644 index 000000000000..70d23910fc74 --- /dev/null +++ b/sdk/backupsearch/src/operation/start_search_job/_start_search_job_output.rs @@ -0,0 +1,110 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +#[allow(missing_docs)] // documentation missing in model +#[non_exhaustive] +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)] +pub struct StartSearchJobOutput { + ///

The unique string that identifies the Amazon Resource Name (ARN) of the specified search job.

+ pub search_job_arn: ::std::option::Option<::std::string::String>, + ///

The date and time that a job was created, in Unix format and Coordinated Universal Time (UTC). The value of CompletionTime is accurate to milliseconds. For example, the value 1516925490.087 represents Friday, January 26, 2018 12:11:30.087 AM.

+ pub creation_time: ::std::option::Option<::aws_smithy_types::DateTime>, + ///

The unique string that specifies the search job.

+ pub search_job_identifier: ::std::option::Option<::std::string::String>, + _request_id: Option, +} +impl StartSearchJobOutput { + ///

The unique string that identifies the Amazon Resource Name (ARN) of the specified search job.

+ pub fn search_job_arn(&self) -> ::std::option::Option<&str> { + self.search_job_arn.as_deref() + } + ///

The date and time that a job was created, in Unix format and Coordinated Universal Time (UTC). The value of CompletionTime is accurate to milliseconds. For example, the value 1516925490.087 represents Friday, January 26, 2018 12:11:30.087 AM.

+ pub fn creation_time(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> { + self.creation_time.as_ref() + } + ///

The unique string that specifies the search job.

+ pub fn search_job_identifier(&self) -> ::std::option::Option<&str> { + self.search_job_identifier.as_deref() + } +} +impl ::aws_types::request_id::RequestId for StartSearchJobOutput { + fn request_id(&self) -> Option<&str> { + self._request_id.as_deref() + } +} +impl StartSearchJobOutput { + /// Creates a new builder-style object to manufacture [`StartSearchJobOutput`](crate::operation::start_search_job::StartSearchJobOutput). + pub fn builder() -> crate::operation::start_search_job::builders::StartSearchJobOutputBuilder { + crate::operation::start_search_job::builders::StartSearchJobOutputBuilder::default() + } +} + +/// A builder for [`StartSearchJobOutput`](crate::operation::start_search_job::StartSearchJobOutput). +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)] +#[non_exhaustive] +pub struct StartSearchJobOutputBuilder { + pub(crate) search_job_arn: ::std::option::Option<::std::string::String>, + pub(crate) creation_time: ::std::option::Option<::aws_smithy_types::DateTime>, + pub(crate) search_job_identifier: ::std::option::Option<::std::string::String>, + _request_id: Option, +} +impl StartSearchJobOutputBuilder { + ///

The unique string that identifies the Amazon Resource Name (ARN) of the specified search job.

+ pub fn search_job_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.search_job_arn = ::std::option::Option::Some(input.into()); + self + } + ///

The unique string that identifies the Amazon Resource Name (ARN) of the specified search job.

+ pub fn set_search_job_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.search_job_arn = input; + self + } + ///

The unique string that identifies the Amazon Resource Name (ARN) of the specified search job.

+ pub fn get_search_job_arn(&self) -> &::std::option::Option<::std::string::String> { + &self.search_job_arn + } + ///

The date and time that a job was created, in Unix format and Coordinated Universal Time (UTC). The value of CompletionTime is accurate to milliseconds. For example, the value 1516925490.087 represents Friday, January 26, 2018 12:11:30.087 AM.

+ pub fn creation_time(mut self, input: ::aws_smithy_types::DateTime) -> Self { + self.creation_time = ::std::option::Option::Some(input); + self + } + ///

The date and time that a job was created, in Unix format and Coordinated Universal Time (UTC). The value of CompletionTime is accurate to milliseconds. For example, the value 1516925490.087 represents Friday, January 26, 2018 12:11:30.087 AM.

+ pub fn set_creation_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self { + self.creation_time = input; + self + } + ///

The date and time that a job was created, in Unix format and Coordinated Universal Time (UTC). The value of CompletionTime is accurate to milliseconds. For example, the value 1516925490.087 represents Friday, January 26, 2018 12:11:30.087 AM.

+ pub fn get_creation_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> { + &self.creation_time + } + ///

The unique string that specifies the search job.

+ pub fn search_job_identifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.search_job_identifier = ::std::option::Option::Some(input.into()); + self + } + ///

The unique string that specifies the search job.

+ pub fn set_search_job_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.search_job_identifier = input; + self + } + ///

The unique string that specifies the search job.

+ pub fn get_search_job_identifier(&self) -> &::std::option::Option<::std::string::String> { + &self.search_job_identifier + } + pub(crate) fn _request_id(mut self, request_id: impl Into) -> Self { + self._request_id = Some(request_id.into()); + self + } + + pub(crate) fn _set_request_id(&mut self, request_id: Option) -> &mut Self { + self._request_id = request_id; + self + } + /// Consumes the builder and constructs a [`StartSearchJobOutput`](crate::operation::start_search_job::StartSearchJobOutput). + pub fn build(self) -> crate::operation::start_search_job::StartSearchJobOutput { + crate::operation::start_search_job::StartSearchJobOutput { + search_job_arn: self.search_job_arn, + creation_time: self.creation_time, + search_job_identifier: self.search_job_identifier, + _request_id: self._request_id, + } + } +} diff --git a/sdk/backupsearch/src/operation/start_search_job/builders.rs b/sdk/backupsearch/src/operation/start_search_job/builders.rs new file mode 100644 index 000000000000..d74f8f1cb027 --- /dev/null +++ b/sdk/backupsearch/src/operation/start_search_job/builders.rs @@ -0,0 +1,212 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +pub use crate::operation::start_search_job::_start_search_job_output::StartSearchJobOutputBuilder; + +pub use crate::operation::start_search_job::_start_search_job_input::StartSearchJobInputBuilder; + +impl crate::operation::start_search_job::builders::StartSearchJobInputBuilder { + /// Sends a request with this input using the given client. + pub async fn send_with( + self, + client: &crate::Client, + ) -> ::std::result::Result< + crate::operation::start_search_job::StartSearchJobOutput, + ::aws_smithy_runtime_api::client::result::SdkError< + crate::operation::start_search_job::StartSearchJobError, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >, + > { + let mut fluent_builder = client.start_search_job(); + fluent_builder.inner = self; + fluent_builder.send().await + } +} +/// Fluent builder constructing a request to `StartSearchJob`. +/// +///

This operation creates a search job which returns recovery points filtered by SearchScope and items filtered by ItemFilters.

+///

You can optionally include ClientToken, EncryptionKeyArn, Name, and/or Tags.

+#[derive(::std::clone::Clone, ::std::fmt::Debug)] +pub struct StartSearchJobFluentBuilder { + handle: ::std::sync::Arc, + inner: crate::operation::start_search_job::builders::StartSearchJobInputBuilder, + config_override: ::std::option::Option, +} +impl + crate::client::customize::internal::CustomizableSend< + crate::operation::start_search_job::StartSearchJobOutput, + crate::operation::start_search_job::StartSearchJobError, + > for StartSearchJobFluentBuilder +{ + fn send( + self, + config_override: crate::config::Builder, + ) -> crate::client::customize::internal::BoxFuture< + crate::client::customize::internal::SendResult< + crate::operation::start_search_job::StartSearchJobOutput, + crate::operation::start_search_job::StartSearchJobError, + >, + > { + ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await }) + } +} +impl StartSearchJobFluentBuilder { + /// Creates a new `StartSearchJobFluentBuilder`. + pub(crate) fn new(handle: ::std::sync::Arc) -> Self { + Self { + handle, + inner: ::std::default::Default::default(), + config_override: ::std::option::Option::None, + } + } + /// Access the StartSearchJob as a reference. + pub fn as_input(&self) -> &crate::operation::start_search_job::builders::StartSearchJobInputBuilder { + &self.inner + } + /// Sends the request and returns the response. + /// + /// If an error occurs, an `SdkError` will be returned with additional details that + /// can be matched against. + /// + /// By default, any retryable failures will be retried twice. Retry behavior + /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be + /// set when configuring the client. + pub async fn send( + self, + ) -> ::std::result::Result< + crate::operation::start_search_job::StartSearchJobOutput, + ::aws_smithy_runtime_api::client::result::SdkError< + crate::operation::start_search_job::StartSearchJobError, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >, + > { + let input = self + .inner + .build() + .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?; + let runtime_plugins = crate::operation::start_search_job::StartSearchJob::operation_runtime_plugins( + self.handle.runtime_plugins.clone(), + &self.handle.conf, + self.config_override, + ); + crate::operation::start_search_job::StartSearchJob::orchestrate(&runtime_plugins, input).await + } + + /// Consumes this builder, creating a customizable operation that can be modified before being sent. + pub fn customize( + self, + ) -> crate::client::customize::CustomizableOperation< + crate::operation::start_search_job::StartSearchJobOutput, + crate::operation::start_search_job::StartSearchJobError, + Self, + > { + crate::client::customize::CustomizableOperation::new(self) + } + pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into) -> Self { + self.set_config_override(::std::option::Option::Some(config_override.into())); + self + } + + pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option) -> &mut Self { + self.config_override = config_override; + self + } + /// + /// Adds a key-value pair to `Tags`. + /// + /// To override the contents of this collection use [`set_tags`](Self::set_tags). + /// + ///

List of tags returned by the operation.

+ pub fn tags(mut self, k: impl ::std::convert::Into<::std::string::String>, v: ::std::option::Option<::std::string::String>) -> Self { + self.inner = self.inner.tags(k.into(), v); + self + } + ///

List of tags returned by the operation.

+ pub fn set_tags( + mut self, + input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::option::Option<::std::string::String>>>, + ) -> Self { + self.inner = self.inner.set_tags(input); + self + } + ///

List of tags returned by the operation.

+ pub fn get_tags( + &self, + ) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::option::Option<::std::string::String>>> { + self.inner.get_tags() + } + ///

Include alphanumeric characters to create a name for this search job.

+ pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.inner = self.inner.name(input.into()); + self + } + ///

Include alphanumeric characters to create a name for this search job.

+ pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.inner = self.inner.set_name(input); + self + } + ///

Include alphanumeric characters to create a name for this search job.

+ pub fn get_name(&self) -> &::std::option::Option<::std::string::String> { + self.inner.get_name() + } + ///

The encryption key for the specified search job.

+ pub fn encryption_key_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.inner = self.inner.encryption_key_arn(input.into()); + self + } + ///

The encryption key for the specified search job.

+ pub fn set_encryption_key_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.inner = self.inner.set_encryption_key_arn(input); + self + } + ///

The encryption key for the specified search job.

+ pub fn get_encryption_key_arn(&self) -> &::std::option::Option<::std::string::String> { + self.inner.get_encryption_key_arn() + } + ///

Include this parameter to allow multiple identical calls for idempotency.

+ ///

A client token is valid for 8 hours after the first request that uses it is completed. After this time, any request with the same token is treated as a new request.

+ pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.inner = self.inner.client_token(input.into()); + self + } + ///

Include this parameter to allow multiple identical calls for idempotency.

+ ///

A client token is valid for 8 hours after the first request that uses it is completed. After this time, any request with the same token is treated as a new request.

+ pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.inner = self.inner.set_client_token(input); + self + } + ///

Include this parameter to allow multiple identical calls for idempotency.

+ ///

A client token is valid for 8 hours after the first request that uses it is completed. After this time, any request with the same token is treated as a new request.

+ pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> { + self.inner.get_client_token() + } + ///

This object can contain BackupResourceTypes, BackupResourceArns, BackupResourceCreationTime, BackupResourceTags, and SourceResourceArns to filter the recovery points returned by the search job.

+ pub fn search_scope(mut self, input: crate::types::SearchScope) -> Self { + self.inner = self.inner.search_scope(input); + self + } + ///

This object can contain BackupResourceTypes, BackupResourceArns, BackupResourceCreationTime, BackupResourceTags, and SourceResourceArns to filter the recovery points returned by the search job.

+ pub fn set_search_scope(mut self, input: ::std::option::Option) -> Self { + self.inner = self.inner.set_search_scope(input); + self + } + ///

This object can contain BackupResourceTypes, BackupResourceArns, BackupResourceCreationTime, BackupResourceTags, and SourceResourceArns to filter the recovery points returned by the search job.

+ pub fn get_search_scope(&self) -> &::std::option::Option { + self.inner.get_search_scope() + } + ///

Item Filters represent all input item properties specified when the search was created.

+ ///

Contains either EBSItemFilters or S3ItemFilters

+ pub fn item_filters(mut self, input: crate::types::ItemFilters) -> Self { + self.inner = self.inner.item_filters(input); + self + } + ///

Item Filters represent all input item properties specified when the search was created.

+ ///

Contains either EBSItemFilters or S3ItemFilters

+ pub fn set_item_filters(mut self, input: ::std::option::Option) -> Self { + self.inner = self.inner.set_item_filters(input); + self + } + ///

Item Filters represent all input item properties specified when the search was created.

+ ///

Contains either EBSItemFilters or S3ItemFilters

+ pub fn get_item_filters(&self) -> &::std::option::Option { + self.inner.get_item_filters() + } +} diff --git a/sdk/backupsearch/src/operation/start_search_result_export_job.rs b/sdk/backupsearch/src/operation/start_search_result_export_job.rs new file mode 100644 index 000000000000..9b1adf1dd03e --- /dev/null +++ b/sdk/backupsearch/src/operation/start_search_result_export_job.rs @@ -0,0 +1,427 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +/// Orchestration and serialization glue logic for `StartSearchResultExportJob`. +#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)] +#[non_exhaustive] +pub struct StartSearchResultExportJob; +impl StartSearchResultExportJob { + /// Creates a new `StartSearchResultExportJob` + pub fn new() -> Self { + Self + } + pub(crate) async fn orchestrate( + runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, + input: crate::operation::start_search_result_export_job::StartSearchResultExportJobInput, + ) -> ::std::result::Result< + crate::operation::start_search_result_export_job::StartSearchResultExportJobOutput, + ::aws_smithy_runtime_api::client::result::SdkError< + crate::operation::start_search_result_export_job::StartSearchResultExportJobError, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >, + > { + let map_err = |err: ::aws_smithy_runtime_api::client::result::SdkError< + ::aws_smithy_runtime_api::client::interceptors::context::Error, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >| { + err.map_service_error(|err| { + err.downcast::() + .expect("correct error type") + }) + }; + let context = Self::orchestrate_with_stop_point(runtime_plugins, input, ::aws_smithy_runtime::client::orchestrator::StopPoint::None) + .await + .map_err(map_err)?; + let output = context.finalize().map_err(map_err)?; + ::std::result::Result::Ok( + output + .downcast::() + .expect("correct output type"), + ) + } + + pub(crate) async fn orchestrate_with_stop_point( + runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, + input: crate::operation::start_search_result_export_job::StartSearchResultExportJobInput, + stop_point: ::aws_smithy_runtime::client::orchestrator::StopPoint, + ) -> ::std::result::Result< + ::aws_smithy_runtime_api::client::interceptors::context::InterceptorContext, + ::aws_smithy_runtime_api::client::result::SdkError< + ::aws_smithy_runtime_api::client::interceptors::context::Error, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >, + > { + let input = ::aws_smithy_runtime_api::client::interceptors::context::Input::erase(input); + ::aws_smithy_runtime::client::orchestrator::invoke_with_stop_point( + "backupsearch", + "StartSearchResultExportJob", + input, + runtime_plugins, + stop_point, + ) + .await + } + + pub(crate) fn operation_runtime_plugins( + client_runtime_plugins: ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, + client_config: &crate::config::Config, + config_override: ::std::option::Option, + ) -> ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins { + let mut runtime_plugins = client_runtime_plugins.with_operation_plugin(Self::new()); + runtime_plugins = runtime_plugins.with_client_plugin(crate::auth_plugin::DefaultAuthOptionsPlugin::new(vec![ + ::aws_runtime::auth::sigv4::SCHEME_ID, + ])); + if let ::std::option::Option::Some(config_override) = config_override { + for plugin in config_override.runtime_plugins.iter().cloned() { + runtime_plugins = runtime_plugins.with_operation_plugin(plugin); + } + runtime_plugins = runtime_plugins.with_operation_plugin(crate::config::ConfigOverrideRuntimePlugin::new( + config_override, + client_config.config.clone(), + &client_config.runtime_components, + )); + } + runtime_plugins + } +} +impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for StartSearchResultExportJob { + fn config(&self) -> ::std::option::Option<::aws_smithy_types::config_bag::FrozenLayer> { + let mut cfg = ::aws_smithy_types::config_bag::Layer::new("StartSearchResultExportJob"); + + cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new( + StartSearchResultExportJobRequestSerializer, + )); + cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new( + StartSearchResultExportJobResponseDeserializer, + )); + + cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new( + ::aws_smithy_runtime_api::client::auth::static_resolver::StaticAuthSchemeOptionResolverParams::new(), + )); + + cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::Metadata::new( + "StartSearchResultExportJob", + "backupsearch", + )); + let mut signing_options = ::aws_runtime::auth::SigningOptions::default(); + signing_options.double_uri_encode = true; + signing_options.content_sha256_header = false; + signing_options.normalize_uri_path = true; + signing_options.payload_override = None; + + cfg.store_put(::aws_runtime::auth::SigV4OperationSigningConfig { + signing_options, + ..::std::default::Default::default() + }); + + ::std::option::Option::Some(cfg.freeze()) + } + + fn runtime_components( + &self, + _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder, + ) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> { + #[allow(unused_mut)] + let mut rcb = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("StartSearchResultExportJob") + .with_interceptor(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default()) + .with_interceptor(StartSearchResultExportJobEndpointParamsInterceptor) + .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::< + crate::operation::start_search_result_export_job::StartSearchResultExportJobError, + >::new()) + .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::< + crate::operation::start_search_result_export_job::StartSearchResultExportJobError, + >::new()) + .with_retry_classifier(::aws_runtime::retries::classifiers::AwsErrorCodeClassifier::< + crate::operation::start_search_result_export_job::StartSearchResultExportJobError, + >::new()); + + ::std::borrow::Cow::Owned(rcb) + } +} + +#[derive(Debug)] +struct StartSearchResultExportJobResponseDeserializer; +impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for StartSearchResultExportJobResponseDeserializer { + fn deserialize_nonstreaming( + &self, + response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError { + let (success, status) = (response.status().is_success(), response.status().as_u16()); + let headers = response.headers(); + let body = response.body().bytes().expect("body loaded"); + #[allow(unused_mut)] + let mut force_error = false; + ::tracing::debug!(request_id = ?::aws_types::request_id::RequestId::request_id(response)); + let parse_result = if !success && status != 200 || force_error { + crate::protocol_serde::shape_start_search_result_export_job::de_start_search_result_export_job_http_error(status, headers, body) + } else { + crate::protocol_serde::shape_start_search_result_export_job::de_start_search_result_export_job_http_response(status, headers, body) + }; + crate::protocol_serde::type_erase_result(parse_result) + } +} +#[derive(Debug)] +struct StartSearchResultExportJobRequestSerializer; +impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for StartSearchResultExportJobRequestSerializer { + #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)] + fn serialize_input( + &self, + input: ::aws_smithy_runtime_api::client::interceptors::context::Input, + _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag, + ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> { + let input = input + .downcast::() + .expect("correct type"); + let _header_serialization_settings = _cfg + .load::() + .cloned() + .unwrap_or_default(); + let mut request_builder = { + fn uri_base( + _input: &crate::operation::start_search_result_export_job::StartSearchResultExportJobInput, + output: &mut ::std::string::String, + ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> { + use ::std::fmt::Write as _; + ::std::write!(output, "/export-search-jobs").expect("formatting should succeed"); + ::std::result::Result::Ok(()) + } + #[allow(clippy::unnecessary_wraps)] + fn update_http_builder( + input: &crate::operation::start_search_result_export_job::StartSearchResultExportJobInput, + builder: ::http::request::Builder, + ) -> ::std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> { + let mut uri = ::std::string::String::new(); + uri_base(input, &mut uri)?; + ::std::result::Result::Ok(builder.method("PUT").uri(uri)) + } + let mut builder = update_http_builder(&input, ::http::request::Builder::new())?; + builder = _header_serialization_settings.set_default_header(builder, ::http::header::CONTENT_TYPE, "application/json"); + builder + }; + let body = ::aws_smithy_types::body::SdkBody::from( + crate::protocol_serde::shape_start_search_result_export_job::ser_start_search_result_export_job_input(&input)?, + ); + if let Some(content_length) = body.content_length() { + let content_length = content_length.to_string(); + request_builder = _header_serialization_settings.set_default_header(request_builder, ::http::header::CONTENT_LENGTH, &content_length); + } + ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap()) + } +} +#[derive(Debug)] +struct StartSearchResultExportJobEndpointParamsInterceptor; + +impl ::aws_smithy_runtime_api::client::interceptors::Intercept for StartSearchResultExportJobEndpointParamsInterceptor { + fn name(&self) -> &'static str { + "StartSearchResultExportJobEndpointParamsInterceptor" + } + + fn read_before_execution( + &self, + context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef< + '_, + ::aws_smithy_runtime_api::client::interceptors::context::Input, + ::aws_smithy_runtime_api::client::interceptors::context::Output, + ::aws_smithy_runtime_api::client::interceptors::context::Error, + >, + cfg: &mut ::aws_smithy_types::config_bag::ConfigBag, + ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> { + let _input = context + .input() + .downcast_ref::() + .ok_or("failed to downcast to StartSearchResultExportJobInput")?; + + let params = crate::config::endpoint::Params::builder() + .set_use_fips(cfg.load::<::aws_types::endpoint_config::UseFips>().map(|ty| ty.0)) + .set_endpoint(cfg.load::<::aws_types::endpoint_config::EndpointUrl>().map(|ty| ty.0.clone())) + .set_region(cfg.load::<::aws_types::region::Region>().map(|r| r.as_ref().to_owned())) + .build() + .map_err(|err| { + ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err) + })?; + cfg.interceptor_state() + .store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params)); + ::std::result::Result::Ok(()) + } +} + +// The get_* functions below are generated from JMESPath expressions in the +// operationContextParams trait. They target the operation's input shape. + +/// Error type for the `StartSearchResultExportJobError` operation. +#[non_exhaustive] +#[derive(::std::fmt::Debug)] +pub enum StartSearchResultExportJobError { + ///

This exception occurs when a conflict with a previous successful operation is detected. This generally occurs when the previous operation did not have time to propagate to the host serving the current request.

+ ///

A retry (with appropriate backoff logic) is the recommended response to this exception.

+ ConflictException(crate::types::error::ConflictException), + ///

The resource was not found for this request.

+ ///

Confirm the resource information, such as the ARN or type is correct and exists, then retry the request.

+ ResourceNotFoundException(crate::types::error::ResourceNotFoundException), + ///

The request denied due to exceeding the quota limits permitted.

+ ServiceQuotaExceededException(crate::types::error::ServiceQuotaExceededException), + ///

You do not have sufficient access to perform this action.

+ AccessDeniedException(crate::types::error::AccessDeniedException), + ///

An internal server error occurred. Retry your request.

+ InternalServerException(crate::types::error::InternalServerException), + ///

The request was denied due to request throttling.

+ ThrottlingException(crate::types::error::ThrottlingException), + ///

The input fails to satisfy the constraints specified by a service.

+ ValidationException(crate::types::error::ValidationException), + /// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code). + #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \ + variable wildcard pattern and check `.code()`: + \ +    `err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }` + \ + See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-StartSearchResultExportJobError) for what information is available for the error.")] + Unhandled(crate::error::sealed_unhandled::Unhandled), +} +impl StartSearchResultExportJobError { + /// Creates the `StartSearchResultExportJobError::Unhandled` variant from any error type. + pub fn unhandled( + err: impl ::std::convert::Into<::std::boxed::Box>, + ) -> Self { + Self::Unhandled(crate::error::sealed_unhandled::Unhandled { + source: err.into(), + meta: ::std::default::Default::default(), + }) + } + + /// Creates the `StartSearchResultExportJobError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata). + pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self { + Self::Unhandled(crate::error::sealed_unhandled::Unhandled { + source: err.clone().into(), + meta: err, + }) + } + /// + /// Returns error metadata, which includes the error code, message, + /// request ID, and potentially additional information. + /// + pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata { + match self { + Self::ConflictException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), + Self::ResourceNotFoundException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), + Self::ServiceQuotaExceededException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), + Self::AccessDeniedException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), + Self::InternalServerException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), + Self::ThrottlingException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), + Self::ValidationException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), + Self::Unhandled(e) => &e.meta, + } + } + /// Returns `true` if the error kind is `StartSearchResultExportJobError::ConflictException`. + pub fn is_conflict_exception(&self) -> bool { + matches!(self, Self::ConflictException(_)) + } + /// Returns `true` if the error kind is `StartSearchResultExportJobError::ResourceNotFoundException`. + pub fn is_resource_not_found_exception(&self) -> bool { + matches!(self, Self::ResourceNotFoundException(_)) + } + /// Returns `true` if the error kind is `StartSearchResultExportJobError::ServiceQuotaExceededException`. + pub fn is_service_quota_exceeded_exception(&self) -> bool { + matches!(self, Self::ServiceQuotaExceededException(_)) + } + /// Returns `true` if the error kind is `StartSearchResultExportJobError::AccessDeniedException`. + pub fn is_access_denied_exception(&self) -> bool { + matches!(self, Self::AccessDeniedException(_)) + } + /// Returns `true` if the error kind is `StartSearchResultExportJobError::InternalServerException`. + pub fn is_internal_server_exception(&self) -> bool { + matches!(self, Self::InternalServerException(_)) + } + /// Returns `true` if the error kind is `StartSearchResultExportJobError::ThrottlingException`. + pub fn is_throttling_exception(&self) -> bool { + matches!(self, Self::ThrottlingException(_)) + } + /// Returns `true` if the error kind is `StartSearchResultExportJobError::ValidationException`. + pub fn is_validation_exception(&self) -> bool { + matches!(self, Self::ValidationException(_)) + } +} +impl ::std::error::Error for StartSearchResultExportJobError { + fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> { + match self { + Self::ConflictException(_inner) => ::std::option::Option::Some(_inner), + Self::ResourceNotFoundException(_inner) => ::std::option::Option::Some(_inner), + Self::ServiceQuotaExceededException(_inner) => ::std::option::Option::Some(_inner), + Self::AccessDeniedException(_inner) => ::std::option::Option::Some(_inner), + Self::InternalServerException(_inner) => ::std::option::Option::Some(_inner), + Self::ThrottlingException(_inner) => ::std::option::Option::Some(_inner), + Self::ValidationException(_inner) => ::std::option::Option::Some(_inner), + Self::Unhandled(_inner) => ::std::option::Option::Some(&*_inner.source), + } + } +} +impl ::std::fmt::Display for StartSearchResultExportJobError { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + match self { + Self::ConflictException(_inner) => _inner.fmt(f), + Self::ResourceNotFoundException(_inner) => _inner.fmt(f), + Self::ServiceQuotaExceededException(_inner) => _inner.fmt(f), + Self::AccessDeniedException(_inner) => _inner.fmt(f), + Self::InternalServerException(_inner) => _inner.fmt(f), + Self::ThrottlingException(_inner) => _inner.fmt(f), + Self::ValidationException(_inner) => _inner.fmt(f), + Self::Unhandled(_inner) => { + if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) { + write!(f, "unhandled error ({code})") + } else { + f.write_str("unhandled error") + } + } + } + } +} +impl ::aws_smithy_types::retry::ProvideErrorKind for StartSearchResultExportJobError { + fn code(&self) -> ::std::option::Option<&str> { + ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) + } + fn retryable_error_kind(&self) -> ::std::option::Option<::aws_smithy_types::retry::ErrorKind> { + match self { + Self::InternalServerException(inner) => ::std::option::Option::Some(inner.retryable_error_kind()), + Self::ThrottlingException(inner) => ::std::option::Option::Some(inner.retryable_error_kind()), + _ => ::std::option::Option::None, + } + } +} +impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for StartSearchResultExportJobError { + fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata { + match self { + Self::ConflictException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner), + Self::ResourceNotFoundException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner), + Self::ServiceQuotaExceededException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner), + Self::AccessDeniedException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner), + Self::InternalServerException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner), + Self::ThrottlingException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner), + Self::ValidationException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner), + Self::Unhandled(_inner) => &_inner.meta, + } + } +} +impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for StartSearchResultExportJobError { + fn create_unhandled_error( + source: ::std::boxed::Box, + meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>, + ) -> Self { + Self::Unhandled(crate::error::sealed_unhandled::Unhandled { + source, + meta: meta.unwrap_or_default(), + }) + } +} +impl ::aws_types::request_id::RequestId for crate::operation::start_search_result_export_job::StartSearchResultExportJobError { + fn request_id(&self) -> Option<&str> { + self.meta().request_id() + } +} + +pub use crate::operation::start_search_result_export_job::_start_search_result_export_job_output::StartSearchResultExportJobOutput; + +pub use crate::operation::start_search_result_export_job::_start_search_result_export_job_input::StartSearchResultExportJobInput; + +mod _start_search_result_export_job_input; + +mod _start_search_result_export_job_output; + +/// Builders +pub mod builders; diff --git a/sdk/backupsearch/src/operation/start_search_result_export_job/_start_search_result_export_job_input.rs b/sdk/backupsearch/src/operation/start_search_result_export_job/_start_search_result_export_job_input.rs new file mode 100644 index 000000000000..4a049ec2f521 --- /dev/null +++ b/sdk/backupsearch/src/operation/start_search_result_export_job/_start_search_result_export_job_input.rs @@ -0,0 +1,160 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +#[allow(missing_docs)] // documentation missing in model +#[non_exhaustive] +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)] +pub struct StartSearchResultExportJobInput { + ///

The unique string that specifies the search job.

+ pub search_job_identifier: ::std::option::Option<::std::string::String>, + ///

This specification contains a required string of the destination bucket; optionally, you can include the destination prefix.

+ pub export_specification: ::std::option::Option, + ///

Include this parameter to allow multiple identical calls for idempotency.

+ ///

A client token is valid for 8 hours after the first request that uses it is completed. After this time, any request with the same token is treated as a new request.

+ pub client_token: ::std::option::Option<::std::string::String>, + ///

Optional tags to include. A tag is a key-value pair you can use to manage, filter, and search for your resources. Allowed characters include UTF-8 letters, numbers, spaces, and the following characters: + - = . _ : /.

+ pub tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::option::Option<::std::string::String>>>, + ///

This parameter specifies the role ARN used to start the search results export jobs.

+ pub role_arn: ::std::option::Option<::std::string::String>, +} +impl StartSearchResultExportJobInput { + ///

The unique string that specifies the search job.

+ pub fn search_job_identifier(&self) -> ::std::option::Option<&str> { + self.search_job_identifier.as_deref() + } + ///

This specification contains a required string of the destination bucket; optionally, you can include the destination prefix.

+ pub fn export_specification(&self) -> ::std::option::Option<&crate::types::ExportSpecification> { + self.export_specification.as_ref() + } + ///

Include this parameter to allow multiple identical calls for idempotency.

+ ///

A client token is valid for 8 hours after the first request that uses it is completed. After this time, any request with the same token is treated as a new request.

+ pub fn client_token(&self) -> ::std::option::Option<&str> { + self.client_token.as_deref() + } + ///

Optional tags to include. A tag is a key-value pair you can use to manage, filter, and search for your resources. Allowed characters include UTF-8 letters, numbers, spaces, and the following characters: + - = . _ : /.

+ pub fn tags(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::option::Option<::std::string::String>>> { + self.tags.as_ref() + } + ///

This parameter specifies the role ARN used to start the search results export jobs.

+ pub fn role_arn(&self) -> ::std::option::Option<&str> { + self.role_arn.as_deref() + } +} +impl StartSearchResultExportJobInput { + /// Creates a new builder-style object to manufacture [`StartSearchResultExportJobInput`](crate::operation::start_search_result_export_job::StartSearchResultExportJobInput). + pub fn builder() -> crate::operation::start_search_result_export_job::builders::StartSearchResultExportJobInputBuilder { + crate::operation::start_search_result_export_job::builders::StartSearchResultExportJobInputBuilder::default() + } +} + +/// A builder for [`StartSearchResultExportJobInput`](crate::operation::start_search_result_export_job::StartSearchResultExportJobInput). +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)] +#[non_exhaustive] +pub struct StartSearchResultExportJobInputBuilder { + pub(crate) search_job_identifier: ::std::option::Option<::std::string::String>, + pub(crate) export_specification: ::std::option::Option, + pub(crate) client_token: ::std::option::Option<::std::string::String>, + pub(crate) tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::option::Option<::std::string::String>>>, + pub(crate) role_arn: ::std::option::Option<::std::string::String>, +} +impl StartSearchResultExportJobInputBuilder { + ///

The unique string that specifies the search job.

+ /// This field is required. + pub fn search_job_identifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.search_job_identifier = ::std::option::Option::Some(input.into()); + self + } + ///

The unique string that specifies the search job.

+ pub fn set_search_job_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.search_job_identifier = input; + self + } + ///

The unique string that specifies the search job.

+ pub fn get_search_job_identifier(&self) -> &::std::option::Option<::std::string::String> { + &self.search_job_identifier + } + ///

This specification contains a required string of the destination bucket; optionally, you can include the destination prefix.

+ /// This field is required. + pub fn export_specification(mut self, input: crate::types::ExportSpecification) -> Self { + self.export_specification = ::std::option::Option::Some(input); + self + } + ///

This specification contains a required string of the destination bucket; optionally, you can include the destination prefix.

+ pub fn set_export_specification(mut self, input: ::std::option::Option) -> Self { + self.export_specification = input; + self + } + ///

This specification contains a required string of the destination bucket; optionally, you can include the destination prefix.

+ pub fn get_export_specification(&self) -> &::std::option::Option { + &self.export_specification + } + ///

Include this parameter to allow multiple identical calls for idempotency.

+ ///

A client token is valid for 8 hours after the first request that uses it is completed. After this time, any request with the same token is treated as a new request.

+ pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.client_token = ::std::option::Option::Some(input.into()); + self + } + ///

Include this parameter to allow multiple identical calls for idempotency.

+ ///

A client token is valid for 8 hours after the first request that uses it is completed. After this time, any request with the same token is treated as a new request.

+ pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.client_token = input; + self + } + ///

Include this parameter to allow multiple identical calls for idempotency.

+ ///

A client token is valid for 8 hours after the first request that uses it is completed. After this time, any request with the same token is treated as a new request.

+ pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> { + &self.client_token + } + /// Adds a key-value pair to `tags`. + /// + /// To override the contents of this collection use [`set_tags`](Self::set_tags). + /// + ///

Optional tags to include. A tag is a key-value pair you can use to manage, filter, and search for your resources. Allowed characters include UTF-8 letters, numbers, spaces, and the following characters: + - = . _ : /.

+ pub fn tags(mut self, k: impl ::std::convert::Into<::std::string::String>, v: ::std::option::Option<::std::string::String>) -> Self { + let mut hash_map = self.tags.unwrap_or_default(); + hash_map.insert(k.into(), v); + self.tags = ::std::option::Option::Some(hash_map); + self + } + ///

Optional tags to include. A tag is a key-value pair you can use to manage, filter, and search for your resources. Allowed characters include UTF-8 letters, numbers, spaces, and the following characters: + - = . _ : /.

+ pub fn set_tags( + mut self, + input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::option::Option<::std::string::String>>>, + ) -> Self { + self.tags = input; + self + } + ///

Optional tags to include. A tag is a key-value pair you can use to manage, filter, and search for your resources. Allowed characters include UTF-8 letters, numbers, spaces, and the following characters: + - = . _ : /.

+ pub fn get_tags( + &self, + ) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::option::Option<::std::string::String>>> { + &self.tags + } + ///

This parameter specifies the role ARN used to start the search results export jobs.

+ pub fn role_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.role_arn = ::std::option::Option::Some(input.into()); + self + } + ///

This parameter specifies the role ARN used to start the search results export jobs.

+ pub fn set_role_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.role_arn = input; + self + } + ///

This parameter specifies the role ARN used to start the search results export jobs.

+ pub fn get_role_arn(&self) -> &::std::option::Option<::std::string::String> { + &self.role_arn + } + /// Consumes the builder and constructs a [`StartSearchResultExportJobInput`](crate::operation::start_search_result_export_job::StartSearchResultExportJobInput). + pub fn build( + self, + ) -> ::std::result::Result< + crate::operation::start_search_result_export_job::StartSearchResultExportJobInput, + ::aws_smithy_types::error::operation::BuildError, + > { + ::std::result::Result::Ok(crate::operation::start_search_result_export_job::StartSearchResultExportJobInput { + search_job_identifier: self.search_job_identifier, + export_specification: self.export_specification, + client_token: self.client_token, + tags: self.tags, + role_arn: self.role_arn, + }) + } +} diff --git a/sdk/backupsearch/src/operation/start_search_result_export_job/_start_search_result_export_job_output.rs b/sdk/backupsearch/src/operation/start_search_result_export_job/_start_search_result_export_job_output.rs new file mode 100644 index 000000000000..b5b876870b91 --- /dev/null +++ b/sdk/backupsearch/src/operation/start_search_result_export_job/_start_search_result_export_job_output.rs @@ -0,0 +1,102 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +#[allow(missing_docs)] // documentation missing in model +#[non_exhaustive] +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)] +pub struct StartSearchResultExportJobOutput { + ///

This is the unique ARN (Amazon Resource Name) that belongs to the new export job.

+ pub export_job_arn: ::std::option::Option<::std::string::String>, + ///

This is the unique identifier that specifies the new export job.

+ pub export_job_identifier: ::std::string::String, + _request_id: Option, +} +impl StartSearchResultExportJobOutput { + ///

This is the unique ARN (Amazon Resource Name) that belongs to the new export job.

+ pub fn export_job_arn(&self) -> ::std::option::Option<&str> { + self.export_job_arn.as_deref() + } + ///

This is the unique identifier that specifies the new export job.

+ pub fn export_job_identifier(&self) -> &str { + use std::ops::Deref; + self.export_job_identifier.deref() + } +} +impl ::aws_types::request_id::RequestId for StartSearchResultExportJobOutput { + fn request_id(&self) -> Option<&str> { + self._request_id.as_deref() + } +} +impl StartSearchResultExportJobOutput { + /// Creates a new builder-style object to manufacture [`StartSearchResultExportJobOutput`](crate::operation::start_search_result_export_job::StartSearchResultExportJobOutput). + pub fn builder() -> crate::operation::start_search_result_export_job::builders::StartSearchResultExportJobOutputBuilder { + crate::operation::start_search_result_export_job::builders::StartSearchResultExportJobOutputBuilder::default() + } +} + +/// A builder for [`StartSearchResultExportJobOutput`](crate::operation::start_search_result_export_job::StartSearchResultExportJobOutput). +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)] +#[non_exhaustive] +pub struct StartSearchResultExportJobOutputBuilder { + pub(crate) export_job_arn: ::std::option::Option<::std::string::String>, + pub(crate) export_job_identifier: ::std::option::Option<::std::string::String>, + _request_id: Option, +} +impl StartSearchResultExportJobOutputBuilder { + ///

This is the unique ARN (Amazon Resource Name) that belongs to the new export job.

+ pub fn export_job_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.export_job_arn = ::std::option::Option::Some(input.into()); + self + } + ///

This is the unique ARN (Amazon Resource Name) that belongs to the new export job.

+ pub fn set_export_job_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.export_job_arn = input; + self + } + ///

This is the unique ARN (Amazon Resource Name) that belongs to the new export job.

+ pub fn get_export_job_arn(&self) -> &::std::option::Option<::std::string::String> { + &self.export_job_arn + } + ///

This is the unique identifier that specifies the new export job.

+ /// This field is required. + pub fn export_job_identifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.export_job_identifier = ::std::option::Option::Some(input.into()); + self + } + ///

This is the unique identifier that specifies the new export job.

+ pub fn set_export_job_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.export_job_identifier = input; + self + } + ///

This is the unique identifier that specifies the new export job.

+ pub fn get_export_job_identifier(&self) -> &::std::option::Option<::std::string::String> { + &self.export_job_identifier + } + pub(crate) fn _request_id(mut self, request_id: impl Into) -> Self { + self._request_id = Some(request_id.into()); + self + } + + pub(crate) fn _set_request_id(&mut self, request_id: Option) -> &mut Self { + self._request_id = request_id; + self + } + /// Consumes the builder and constructs a [`StartSearchResultExportJobOutput`](crate::operation::start_search_result_export_job::StartSearchResultExportJobOutput). + /// This method will fail if any of the following fields are not set: + /// - [`export_job_identifier`](crate::operation::start_search_result_export_job::builders::StartSearchResultExportJobOutputBuilder::export_job_identifier) + pub fn build( + self, + ) -> ::std::result::Result< + crate::operation::start_search_result_export_job::StartSearchResultExportJobOutput, + ::aws_smithy_types::error::operation::BuildError, + > { + ::std::result::Result::Ok(crate::operation::start_search_result_export_job::StartSearchResultExportJobOutput { + export_job_arn: self.export_job_arn, + export_job_identifier: self.export_job_identifier.ok_or_else(|| { + ::aws_smithy_types::error::operation::BuildError::missing_field( + "export_job_identifier", + "export_job_identifier was not specified but it is required when building StartSearchResultExportJobOutput", + ) + })?, + _request_id: self._request_id, + }) + } +} diff --git a/sdk/backupsearch/src/operation/start_search_result_export_job/builders.rs b/sdk/backupsearch/src/operation/start_search_result_export_job/builders.rs new file mode 100644 index 000000000000..7eed286b353c --- /dev/null +++ b/sdk/backupsearch/src/operation/start_search_result_export_job/builders.rs @@ -0,0 +1,194 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +pub use crate::operation::start_search_result_export_job::_start_search_result_export_job_output::StartSearchResultExportJobOutputBuilder; + +pub use crate::operation::start_search_result_export_job::_start_search_result_export_job_input::StartSearchResultExportJobInputBuilder; + +impl crate::operation::start_search_result_export_job::builders::StartSearchResultExportJobInputBuilder { + /// Sends a request with this input using the given client. + pub async fn send_with( + self, + client: &crate::Client, + ) -> ::std::result::Result< + crate::operation::start_search_result_export_job::StartSearchResultExportJobOutput, + ::aws_smithy_runtime_api::client::result::SdkError< + crate::operation::start_search_result_export_job::StartSearchResultExportJobError, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >, + > { + let mut fluent_builder = client.start_search_result_export_job(); + fluent_builder.inner = self; + fluent_builder.send().await + } +} +/// Fluent builder constructing a request to `StartSearchResultExportJob`. +/// +///

This operations starts a job to export the results of search job to a designated S3 bucket.

+#[derive(::std::clone::Clone, ::std::fmt::Debug)] +pub struct StartSearchResultExportJobFluentBuilder { + handle: ::std::sync::Arc, + inner: crate::operation::start_search_result_export_job::builders::StartSearchResultExportJobInputBuilder, + config_override: ::std::option::Option, +} +impl + crate::client::customize::internal::CustomizableSend< + crate::operation::start_search_result_export_job::StartSearchResultExportJobOutput, + crate::operation::start_search_result_export_job::StartSearchResultExportJobError, + > for StartSearchResultExportJobFluentBuilder +{ + fn send( + self, + config_override: crate::config::Builder, + ) -> crate::client::customize::internal::BoxFuture< + crate::client::customize::internal::SendResult< + crate::operation::start_search_result_export_job::StartSearchResultExportJobOutput, + crate::operation::start_search_result_export_job::StartSearchResultExportJobError, + >, + > { + ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await }) + } +} +impl StartSearchResultExportJobFluentBuilder { + /// Creates a new `StartSearchResultExportJobFluentBuilder`. + pub(crate) fn new(handle: ::std::sync::Arc) -> Self { + Self { + handle, + inner: ::std::default::Default::default(), + config_override: ::std::option::Option::None, + } + } + /// Access the StartSearchResultExportJob as a reference. + pub fn as_input(&self) -> &crate::operation::start_search_result_export_job::builders::StartSearchResultExportJobInputBuilder { + &self.inner + } + /// Sends the request and returns the response. + /// + /// If an error occurs, an `SdkError` will be returned with additional details that + /// can be matched against. + /// + /// By default, any retryable failures will be retried twice. Retry behavior + /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be + /// set when configuring the client. + pub async fn send( + self, + ) -> ::std::result::Result< + crate::operation::start_search_result_export_job::StartSearchResultExportJobOutput, + ::aws_smithy_runtime_api::client::result::SdkError< + crate::operation::start_search_result_export_job::StartSearchResultExportJobError, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >, + > { + let input = self + .inner + .build() + .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?; + let runtime_plugins = crate::operation::start_search_result_export_job::StartSearchResultExportJob::operation_runtime_plugins( + self.handle.runtime_plugins.clone(), + &self.handle.conf, + self.config_override, + ); + crate::operation::start_search_result_export_job::StartSearchResultExportJob::orchestrate(&runtime_plugins, input).await + } + + /// Consumes this builder, creating a customizable operation that can be modified before being sent. + pub fn customize( + self, + ) -> crate::client::customize::CustomizableOperation< + crate::operation::start_search_result_export_job::StartSearchResultExportJobOutput, + crate::operation::start_search_result_export_job::StartSearchResultExportJobError, + Self, + > { + crate::client::customize::CustomizableOperation::new(self) + } + pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into) -> Self { + self.set_config_override(::std::option::Option::Some(config_override.into())); + self + } + + pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option) -> &mut Self { + self.config_override = config_override; + self + } + ///

The unique string that specifies the search job.

+ pub fn search_job_identifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.inner = self.inner.search_job_identifier(input.into()); + self + } + ///

The unique string that specifies the search job.

+ pub fn set_search_job_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.inner = self.inner.set_search_job_identifier(input); + self + } + ///

The unique string that specifies the search job.

+ pub fn get_search_job_identifier(&self) -> &::std::option::Option<::std::string::String> { + self.inner.get_search_job_identifier() + } + ///

This specification contains a required string of the destination bucket; optionally, you can include the destination prefix.

+ pub fn export_specification(mut self, input: crate::types::ExportSpecification) -> Self { + self.inner = self.inner.export_specification(input); + self + } + ///

This specification contains a required string of the destination bucket; optionally, you can include the destination prefix.

+ pub fn set_export_specification(mut self, input: ::std::option::Option) -> Self { + self.inner = self.inner.set_export_specification(input); + self + } + ///

This specification contains a required string of the destination bucket; optionally, you can include the destination prefix.

+ pub fn get_export_specification(&self) -> &::std::option::Option { + self.inner.get_export_specification() + } + ///

Include this parameter to allow multiple identical calls for idempotency.

+ ///

A client token is valid for 8 hours after the first request that uses it is completed. After this time, any request with the same token is treated as a new request.

+ pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.inner = self.inner.client_token(input.into()); + self + } + ///

Include this parameter to allow multiple identical calls for idempotency.

+ ///

A client token is valid for 8 hours after the first request that uses it is completed. After this time, any request with the same token is treated as a new request.

+ pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.inner = self.inner.set_client_token(input); + self + } + ///

Include this parameter to allow multiple identical calls for idempotency.

+ ///

A client token is valid for 8 hours after the first request that uses it is completed. After this time, any request with the same token is treated as a new request.

+ pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> { + self.inner.get_client_token() + } + /// + /// Adds a key-value pair to `Tags`. + /// + /// To override the contents of this collection use [`set_tags`](Self::set_tags). + /// + ///

Optional tags to include. A tag is a key-value pair you can use to manage, filter, and search for your resources. Allowed characters include UTF-8 letters, numbers, spaces, and the following characters: + - = . _ : /.

+ pub fn tags(mut self, k: impl ::std::convert::Into<::std::string::String>, v: ::std::option::Option<::std::string::String>) -> Self { + self.inner = self.inner.tags(k.into(), v); + self + } + ///

Optional tags to include. A tag is a key-value pair you can use to manage, filter, and search for your resources. Allowed characters include UTF-8 letters, numbers, spaces, and the following characters: + - = . _ : /.

+ pub fn set_tags( + mut self, + input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::option::Option<::std::string::String>>>, + ) -> Self { + self.inner = self.inner.set_tags(input); + self + } + ///

Optional tags to include. A tag is a key-value pair you can use to manage, filter, and search for your resources. Allowed characters include UTF-8 letters, numbers, spaces, and the following characters: + - = . _ : /.

+ pub fn get_tags( + &self, + ) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::option::Option<::std::string::String>>> { + self.inner.get_tags() + } + ///

This parameter specifies the role ARN used to start the search results export jobs.

+ pub fn role_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.inner = self.inner.role_arn(input.into()); + self + } + ///

This parameter specifies the role ARN used to start the search results export jobs.

+ pub fn set_role_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.inner = self.inner.set_role_arn(input); + self + } + ///

This parameter specifies the role ARN used to start the search results export jobs.

+ pub fn get_role_arn(&self) -> &::std::option::Option<::std::string::String> { + self.inner.get_role_arn() + } +} diff --git a/sdk/backupsearch/src/operation/stop_search_job.rs b/sdk/backupsearch/src/operation/stop_search_job.rs new file mode 100644 index 000000000000..53192ca21f45 --- /dev/null +++ b/sdk/backupsearch/src/operation/stop_search_job.rs @@ -0,0 +1,420 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +/// Orchestration and serialization glue logic for `StopSearchJob`. +#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)] +#[non_exhaustive] +pub struct StopSearchJob; +impl StopSearchJob { + /// Creates a new `StopSearchJob` + pub fn new() -> Self { + Self + } + pub(crate) async fn orchestrate( + runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, + input: crate::operation::stop_search_job::StopSearchJobInput, + ) -> ::std::result::Result< + crate::operation::stop_search_job::StopSearchJobOutput, + ::aws_smithy_runtime_api::client::result::SdkError< + crate::operation::stop_search_job::StopSearchJobError, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >, + > { + let map_err = |err: ::aws_smithy_runtime_api::client::result::SdkError< + ::aws_smithy_runtime_api::client::interceptors::context::Error, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >| { + err.map_service_error(|err| { + err.downcast::() + .expect("correct error type") + }) + }; + let context = Self::orchestrate_with_stop_point(runtime_plugins, input, ::aws_smithy_runtime::client::orchestrator::StopPoint::None) + .await + .map_err(map_err)?; + let output = context.finalize().map_err(map_err)?; + ::std::result::Result::Ok( + output + .downcast::() + .expect("correct output type"), + ) + } + + pub(crate) async fn orchestrate_with_stop_point( + runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, + input: crate::operation::stop_search_job::StopSearchJobInput, + stop_point: ::aws_smithy_runtime::client::orchestrator::StopPoint, + ) -> ::std::result::Result< + ::aws_smithy_runtime_api::client::interceptors::context::InterceptorContext, + ::aws_smithy_runtime_api::client::result::SdkError< + ::aws_smithy_runtime_api::client::interceptors::context::Error, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >, + > { + let input = ::aws_smithy_runtime_api::client::interceptors::context::Input::erase(input); + ::aws_smithy_runtime::client::orchestrator::invoke_with_stop_point("backupsearch", "StopSearchJob", input, runtime_plugins, stop_point).await + } + + pub(crate) fn operation_runtime_plugins( + client_runtime_plugins: ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, + client_config: &crate::config::Config, + config_override: ::std::option::Option, + ) -> ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins { + let mut runtime_plugins = client_runtime_plugins.with_operation_plugin(Self::new()); + runtime_plugins = runtime_plugins.with_client_plugin(crate::auth_plugin::DefaultAuthOptionsPlugin::new(vec![ + ::aws_runtime::auth::sigv4::SCHEME_ID, + ])); + if let ::std::option::Option::Some(config_override) = config_override { + for plugin in config_override.runtime_plugins.iter().cloned() { + runtime_plugins = runtime_plugins.with_operation_plugin(plugin); + } + runtime_plugins = runtime_plugins.with_operation_plugin(crate::config::ConfigOverrideRuntimePlugin::new( + config_override, + client_config.config.clone(), + &client_config.runtime_components, + )); + } + runtime_plugins + } +} +impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for StopSearchJob { + fn config(&self) -> ::std::option::Option<::aws_smithy_types::config_bag::FrozenLayer> { + let mut cfg = ::aws_smithy_types::config_bag::Layer::new("StopSearchJob"); + + cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new( + StopSearchJobRequestSerializer, + )); + cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new( + StopSearchJobResponseDeserializer, + )); + + cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new( + ::aws_smithy_runtime_api::client::auth::static_resolver::StaticAuthSchemeOptionResolverParams::new(), + )); + + cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::Metadata::new( + "StopSearchJob", + "backupsearch", + )); + let mut signing_options = ::aws_runtime::auth::SigningOptions::default(); + signing_options.double_uri_encode = true; + signing_options.content_sha256_header = false; + signing_options.normalize_uri_path = true; + signing_options.payload_override = None; + + cfg.store_put(::aws_runtime::auth::SigV4OperationSigningConfig { + signing_options, + ..::std::default::Default::default() + }); + + ::std::option::Option::Some(cfg.freeze()) + } + + fn runtime_components( + &self, + _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder, + ) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> { + #[allow(unused_mut)] + let mut rcb = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("StopSearchJob") + .with_interceptor(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default()) + .with_interceptor(StopSearchJobEndpointParamsInterceptor) + .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::< + crate::operation::stop_search_job::StopSearchJobError, + >::new()) + .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::< + crate::operation::stop_search_job::StopSearchJobError, + >::new()) + .with_retry_classifier(::aws_runtime::retries::classifiers::AwsErrorCodeClassifier::< + crate::operation::stop_search_job::StopSearchJobError, + >::new()); + + ::std::borrow::Cow::Owned(rcb) + } +} + +#[derive(Debug)] +struct StopSearchJobResponseDeserializer; +impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for StopSearchJobResponseDeserializer { + fn deserialize_nonstreaming( + &self, + response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError { + let (success, status) = (response.status().is_success(), response.status().as_u16()); + let headers = response.headers(); + let body = response.body().bytes().expect("body loaded"); + #[allow(unused_mut)] + let mut force_error = false; + ::tracing::debug!(request_id = ?::aws_types::request_id::RequestId::request_id(response)); + let parse_result = if !success && status != 200 || force_error { + crate::protocol_serde::shape_stop_search_job::de_stop_search_job_http_error(status, headers, body) + } else { + crate::protocol_serde::shape_stop_search_job::de_stop_search_job_http_response(status, headers, body) + }; + crate::protocol_serde::type_erase_result(parse_result) + } +} +#[derive(Debug)] +struct StopSearchJobRequestSerializer; +impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for StopSearchJobRequestSerializer { + #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)] + fn serialize_input( + &self, + input: ::aws_smithy_runtime_api::client::interceptors::context::Input, + _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag, + ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> { + let input = input + .downcast::() + .expect("correct type"); + let _header_serialization_settings = _cfg + .load::() + .cloned() + .unwrap_or_default(); + let mut request_builder = { + fn uri_base( + _input: &crate::operation::stop_search_job::StopSearchJobInput, + output: &mut ::std::string::String, + ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> { + use ::std::fmt::Write as _; + let input_1 = &_input.search_job_identifier; + let input_1 = input_1.as_ref().ok_or_else(|| { + ::aws_smithy_types::error::operation::BuildError::missing_field("search_job_identifier", "cannot be empty or unset") + })?; + let search_job_identifier = ::aws_smithy_http::label::fmt_string(input_1, ::aws_smithy_http::label::EncodingStrategy::Default); + if search_job_identifier.is_empty() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "search_job_identifier", + "cannot be empty or unset", + )); + } + ::std::write!( + output, + "/search-jobs/{SearchJobIdentifier}/actions/cancel", + SearchJobIdentifier = search_job_identifier + ) + .expect("formatting should succeed"); + ::std::result::Result::Ok(()) + } + #[allow(clippy::unnecessary_wraps)] + fn update_http_builder( + input: &crate::operation::stop_search_job::StopSearchJobInput, + builder: ::http::request::Builder, + ) -> ::std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> { + let mut uri = ::std::string::String::new(); + uri_base(input, &mut uri)?; + ::std::result::Result::Ok(builder.method("PUT").uri(uri)) + } + let mut builder = update_http_builder(&input, ::http::request::Builder::new())?; + builder + }; + let body = ::aws_smithy_types::body::SdkBody::from(""); + + ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap()) + } +} +#[derive(Debug)] +struct StopSearchJobEndpointParamsInterceptor; + +impl ::aws_smithy_runtime_api::client::interceptors::Intercept for StopSearchJobEndpointParamsInterceptor { + fn name(&self) -> &'static str { + "StopSearchJobEndpointParamsInterceptor" + } + + fn read_before_execution( + &self, + context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef< + '_, + ::aws_smithy_runtime_api::client::interceptors::context::Input, + ::aws_smithy_runtime_api::client::interceptors::context::Output, + ::aws_smithy_runtime_api::client::interceptors::context::Error, + >, + cfg: &mut ::aws_smithy_types::config_bag::ConfigBag, + ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> { + let _input = context + .input() + .downcast_ref::() + .ok_or("failed to downcast to StopSearchJobInput")?; + + let params = crate::config::endpoint::Params::builder() + .set_use_fips(cfg.load::<::aws_types::endpoint_config::UseFips>().map(|ty| ty.0)) + .set_endpoint(cfg.load::<::aws_types::endpoint_config::EndpointUrl>().map(|ty| ty.0.clone())) + .set_region(cfg.load::<::aws_types::region::Region>().map(|r| r.as_ref().to_owned())) + .build() + .map_err(|err| { + ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err) + })?; + cfg.interceptor_state() + .store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params)); + ::std::result::Result::Ok(()) + } +} + +// The get_* functions below are generated from JMESPath expressions in the +// operationContextParams trait. They target the operation's input shape. + +/// Error type for the `StopSearchJobError` operation. +#[non_exhaustive] +#[derive(::std::fmt::Debug)] +pub enum StopSearchJobError { + ///

This exception occurs when a conflict with a previous successful operation is detected. This generally occurs when the previous operation did not have time to propagate to the host serving the current request.

+ ///

A retry (with appropriate backoff logic) is the recommended response to this exception.

+ ConflictException(crate::types::error::ConflictException), + ///

The resource was not found for this request.

+ ///

Confirm the resource information, such as the ARN or type is correct and exists, then retry the request.

+ ResourceNotFoundException(crate::types::error::ResourceNotFoundException), + ///

You do not have sufficient access to perform this action.

+ AccessDeniedException(crate::types::error::AccessDeniedException), + ///

An internal server error occurred. Retry your request.

+ InternalServerException(crate::types::error::InternalServerException), + ///

The request was denied due to request throttling.

+ ThrottlingException(crate::types::error::ThrottlingException), + ///

The input fails to satisfy the constraints specified by a service.

+ ValidationException(crate::types::error::ValidationException), + /// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code). + #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \ + variable wildcard pattern and check `.code()`: + \ +    `err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }` + \ + See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-StopSearchJobError) for what information is available for the error.")] + Unhandled(crate::error::sealed_unhandled::Unhandled), +} +impl StopSearchJobError { + /// Creates the `StopSearchJobError::Unhandled` variant from any error type. + pub fn unhandled( + err: impl ::std::convert::Into<::std::boxed::Box>, + ) -> Self { + Self::Unhandled(crate::error::sealed_unhandled::Unhandled { + source: err.into(), + meta: ::std::default::Default::default(), + }) + } + + /// Creates the `StopSearchJobError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata). + pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self { + Self::Unhandled(crate::error::sealed_unhandled::Unhandled { + source: err.clone().into(), + meta: err, + }) + } + /// + /// Returns error metadata, which includes the error code, message, + /// request ID, and potentially additional information. + /// + pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata { + match self { + Self::ConflictException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), + Self::ResourceNotFoundException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), + Self::AccessDeniedException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), + Self::InternalServerException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), + Self::ThrottlingException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), + Self::ValidationException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), + Self::Unhandled(e) => &e.meta, + } + } + /// Returns `true` if the error kind is `StopSearchJobError::ConflictException`. + pub fn is_conflict_exception(&self) -> bool { + matches!(self, Self::ConflictException(_)) + } + /// Returns `true` if the error kind is `StopSearchJobError::ResourceNotFoundException`. + pub fn is_resource_not_found_exception(&self) -> bool { + matches!(self, Self::ResourceNotFoundException(_)) + } + /// Returns `true` if the error kind is `StopSearchJobError::AccessDeniedException`. + pub fn is_access_denied_exception(&self) -> bool { + matches!(self, Self::AccessDeniedException(_)) + } + /// Returns `true` if the error kind is `StopSearchJobError::InternalServerException`. + pub fn is_internal_server_exception(&self) -> bool { + matches!(self, Self::InternalServerException(_)) + } + /// Returns `true` if the error kind is `StopSearchJobError::ThrottlingException`. + pub fn is_throttling_exception(&self) -> bool { + matches!(self, Self::ThrottlingException(_)) + } + /// Returns `true` if the error kind is `StopSearchJobError::ValidationException`. + pub fn is_validation_exception(&self) -> bool { + matches!(self, Self::ValidationException(_)) + } +} +impl ::std::error::Error for StopSearchJobError { + fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> { + match self { + Self::ConflictException(_inner) => ::std::option::Option::Some(_inner), + Self::ResourceNotFoundException(_inner) => ::std::option::Option::Some(_inner), + Self::AccessDeniedException(_inner) => ::std::option::Option::Some(_inner), + Self::InternalServerException(_inner) => ::std::option::Option::Some(_inner), + Self::ThrottlingException(_inner) => ::std::option::Option::Some(_inner), + Self::ValidationException(_inner) => ::std::option::Option::Some(_inner), + Self::Unhandled(_inner) => ::std::option::Option::Some(&*_inner.source), + } + } +} +impl ::std::fmt::Display for StopSearchJobError { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + match self { + Self::ConflictException(_inner) => _inner.fmt(f), + Self::ResourceNotFoundException(_inner) => _inner.fmt(f), + Self::AccessDeniedException(_inner) => _inner.fmt(f), + Self::InternalServerException(_inner) => _inner.fmt(f), + Self::ThrottlingException(_inner) => _inner.fmt(f), + Self::ValidationException(_inner) => _inner.fmt(f), + Self::Unhandled(_inner) => { + if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) { + write!(f, "unhandled error ({code})") + } else { + f.write_str("unhandled error") + } + } + } + } +} +impl ::aws_smithy_types::retry::ProvideErrorKind for StopSearchJobError { + fn code(&self) -> ::std::option::Option<&str> { + ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) + } + fn retryable_error_kind(&self) -> ::std::option::Option<::aws_smithy_types::retry::ErrorKind> { + match self { + Self::InternalServerException(inner) => ::std::option::Option::Some(inner.retryable_error_kind()), + Self::ThrottlingException(inner) => ::std::option::Option::Some(inner.retryable_error_kind()), + _ => ::std::option::Option::None, + } + } +} +impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for StopSearchJobError { + fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata { + match self { + Self::ConflictException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner), + Self::ResourceNotFoundException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner), + Self::AccessDeniedException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner), + Self::InternalServerException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner), + Self::ThrottlingException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner), + Self::ValidationException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner), + Self::Unhandled(_inner) => &_inner.meta, + } + } +} +impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for StopSearchJobError { + fn create_unhandled_error( + source: ::std::boxed::Box, + meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>, + ) -> Self { + Self::Unhandled(crate::error::sealed_unhandled::Unhandled { + source, + meta: meta.unwrap_or_default(), + }) + } +} +impl ::aws_types::request_id::RequestId for crate::operation::stop_search_job::StopSearchJobError { + fn request_id(&self) -> Option<&str> { + self.meta().request_id() + } +} + +pub use crate::operation::stop_search_job::_stop_search_job_output::StopSearchJobOutput; + +pub use crate::operation::stop_search_job::_stop_search_job_input::StopSearchJobInput; + +mod _stop_search_job_input; + +mod _stop_search_job_output; + +/// Builders +pub mod builders; diff --git a/sdk/backupsearch/src/operation/stop_search_job/_stop_search_job_input.rs b/sdk/backupsearch/src/operation/stop_search_job/_stop_search_job_input.rs new file mode 100644 index 000000000000..3fdb6866d120 --- /dev/null +++ b/sdk/backupsearch/src/operation/stop_search_job/_stop_search_job_input.rs @@ -0,0 +1,52 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +#[allow(missing_docs)] // documentation missing in model +#[non_exhaustive] +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)] +pub struct StopSearchJobInput { + ///

The unique string that specifies the search job.

+ pub search_job_identifier: ::std::option::Option<::std::string::String>, +} +impl StopSearchJobInput { + ///

The unique string that specifies the search job.

+ pub fn search_job_identifier(&self) -> ::std::option::Option<&str> { + self.search_job_identifier.as_deref() + } +} +impl StopSearchJobInput { + /// Creates a new builder-style object to manufacture [`StopSearchJobInput`](crate::operation::stop_search_job::StopSearchJobInput). + pub fn builder() -> crate::operation::stop_search_job::builders::StopSearchJobInputBuilder { + crate::operation::stop_search_job::builders::StopSearchJobInputBuilder::default() + } +} + +/// A builder for [`StopSearchJobInput`](crate::operation::stop_search_job::StopSearchJobInput). +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)] +#[non_exhaustive] +pub struct StopSearchJobInputBuilder { + pub(crate) search_job_identifier: ::std::option::Option<::std::string::String>, +} +impl StopSearchJobInputBuilder { + ///

The unique string that specifies the search job.

+ /// This field is required. + pub fn search_job_identifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.search_job_identifier = ::std::option::Option::Some(input.into()); + self + } + ///

The unique string that specifies the search job.

+ pub fn set_search_job_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.search_job_identifier = input; + self + } + ///

The unique string that specifies the search job.

+ pub fn get_search_job_identifier(&self) -> &::std::option::Option<::std::string::String> { + &self.search_job_identifier + } + /// Consumes the builder and constructs a [`StopSearchJobInput`](crate::operation::stop_search_job::StopSearchJobInput). + pub fn build( + self, + ) -> ::std::result::Result { + ::std::result::Result::Ok(crate::operation::stop_search_job::StopSearchJobInput { + search_job_identifier: self.search_job_identifier, + }) + } +} diff --git a/sdk/backupsearch/src/operation/stop_search_job/_stop_search_job_output.rs b/sdk/backupsearch/src/operation/stop_search_job/_stop_search_job_output.rs new file mode 100644 index 000000000000..d0a61a6d8fa4 --- /dev/null +++ b/sdk/backupsearch/src/operation/stop_search_job/_stop_search_job_output.rs @@ -0,0 +1,42 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +#[allow(missing_docs)] // documentation missing in model +#[non_exhaustive] +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)] +pub struct StopSearchJobOutput { + _request_id: Option, +} +impl ::aws_types::request_id::RequestId for StopSearchJobOutput { + fn request_id(&self) -> Option<&str> { + self._request_id.as_deref() + } +} +impl StopSearchJobOutput { + /// Creates a new builder-style object to manufacture [`StopSearchJobOutput`](crate::operation::stop_search_job::StopSearchJobOutput). + pub fn builder() -> crate::operation::stop_search_job::builders::StopSearchJobOutputBuilder { + crate::operation::stop_search_job::builders::StopSearchJobOutputBuilder::default() + } +} + +/// A builder for [`StopSearchJobOutput`](crate::operation::stop_search_job::StopSearchJobOutput). +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)] +#[non_exhaustive] +pub struct StopSearchJobOutputBuilder { + _request_id: Option, +} +impl StopSearchJobOutputBuilder { + pub(crate) fn _request_id(mut self, request_id: impl Into) -> Self { + self._request_id = Some(request_id.into()); + self + } + + pub(crate) fn _set_request_id(&mut self, request_id: Option) -> &mut Self { + self._request_id = request_id; + self + } + /// Consumes the builder and constructs a [`StopSearchJobOutput`](crate::operation::stop_search_job::StopSearchJobOutput). + pub fn build(self) -> crate::operation::stop_search_job::StopSearchJobOutput { + crate::operation::stop_search_job::StopSearchJobOutput { + _request_id: self._request_id, + } + } +} diff --git a/sdk/backupsearch/src/operation/stop_search_job/builders.rs b/sdk/backupsearch/src/operation/stop_search_job/builders.rs new file mode 100644 index 000000000000..92b4670785b4 --- /dev/null +++ b/sdk/backupsearch/src/operation/stop_search_job/builders.rs @@ -0,0 +1,126 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +pub use crate::operation::stop_search_job::_stop_search_job_output::StopSearchJobOutputBuilder; + +pub use crate::operation::stop_search_job::_stop_search_job_input::StopSearchJobInputBuilder; + +impl crate::operation::stop_search_job::builders::StopSearchJobInputBuilder { + /// Sends a request with this input using the given client. + pub async fn send_with( + self, + client: &crate::Client, + ) -> ::std::result::Result< + crate::operation::stop_search_job::StopSearchJobOutput, + ::aws_smithy_runtime_api::client::result::SdkError< + crate::operation::stop_search_job::StopSearchJobError, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >, + > { + let mut fluent_builder = client.stop_search_job(); + fluent_builder.inner = self; + fluent_builder.send().await + } +} +/// Fluent builder constructing a request to `StopSearchJob`. +/// +///

This operations ends a search job.

+///

Only a search job with a status of RUNNING can be stopped.

+#[derive(::std::clone::Clone, ::std::fmt::Debug)] +pub struct StopSearchJobFluentBuilder { + handle: ::std::sync::Arc, + inner: crate::operation::stop_search_job::builders::StopSearchJobInputBuilder, + config_override: ::std::option::Option, +} +impl + crate::client::customize::internal::CustomizableSend< + crate::operation::stop_search_job::StopSearchJobOutput, + crate::operation::stop_search_job::StopSearchJobError, + > for StopSearchJobFluentBuilder +{ + fn send( + self, + config_override: crate::config::Builder, + ) -> crate::client::customize::internal::BoxFuture< + crate::client::customize::internal::SendResult< + crate::operation::stop_search_job::StopSearchJobOutput, + crate::operation::stop_search_job::StopSearchJobError, + >, + > { + ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await }) + } +} +impl StopSearchJobFluentBuilder { + /// Creates a new `StopSearchJobFluentBuilder`. + pub(crate) fn new(handle: ::std::sync::Arc) -> Self { + Self { + handle, + inner: ::std::default::Default::default(), + config_override: ::std::option::Option::None, + } + } + /// Access the StopSearchJob as a reference. + pub fn as_input(&self) -> &crate::operation::stop_search_job::builders::StopSearchJobInputBuilder { + &self.inner + } + /// Sends the request and returns the response. + /// + /// If an error occurs, an `SdkError` will be returned with additional details that + /// can be matched against. + /// + /// By default, any retryable failures will be retried twice. Retry behavior + /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be + /// set when configuring the client. + pub async fn send( + self, + ) -> ::std::result::Result< + crate::operation::stop_search_job::StopSearchJobOutput, + ::aws_smithy_runtime_api::client::result::SdkError< + crate::operation::stop_search_job::StopSearchJobError, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >, + > { + let input = self + .inner + .build() + .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?; + let runtime_plugins = crate::operation::stop_search_job::StopSearchJob::operation_runtime_plugins( + self.handle.runtime_plugins.clone(), + &self.handle.conf, + self.config_override, + ); + crate::operation::stop_search_job::StopSearchJob::orchestrate(&runtime_plugins, input).await + } + + /// Consumes this builder, creating a customizable operation that can be modified before being sent. + pub fn customize( + self, + ) -> crate::client::customize::CustomizableOperation< + crate::operation::stop_search_job::StopSearchJobOutput, + crate::operation::stop_search_job::StopSearchJobError, + Self, + > { + crate::client::customize::CustomizableOperation::new(self) + } + pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into) -> Self { + self.set_config_override(::std::option::Option::Some(config_override.into())); + self + } + + pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option) -> &mut Self { + self.config_override = config_override; + self + } + ///

The unique string that specifies the search job.

+ pub fn search_job_identifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.inner = self.inner.search_job_identifier(input.into()); + self + } + ///

The unique string that specifies the search job.

+ pub fn set_search_job_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.inner = self.inner.set_search_job_identifier(input); + self + } + ///

The unique string that specifies the search job.

+ pub fn get_search_job_identifier(&self) -> &::std::option::Option<::std::string::String> { + self.inner.get_search_job_identifier() + } +} diff --git a/sdk/backupsearch/src/operation/tag_resource.rs b/sdk/backupsearch/src/operation/tag_resource.rs new file mode 100644 index 000000000000..3b570dd26e6b --- /dev/null +++ b/sdk/backupsearch/src/operation/tag_resource.rs @@ -0,0 +1,408 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +/// Orchestration and serialization glue logic for `TagResource`. +#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)] +#[non_exhaustive] +pub struct TagResource; +impl TagResource { + /// Creates a new `TagResource` + pub fn new() -> Self { + Self + } + pub(crate) async fn orchestrate( + runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, + input: crate::operation::tag_resource::TagResourceInput, + ) -> ::std::result::Result< + crate::operation::tag_resource::TagResourceOutput, + ::aws_smithy_runtime_api::client::result::SdkError< + crate::operation::tag_resource::TagResourceError, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >, + > { + let map_err = |err: ::aws_smithy_runtime_api::client::result::SdkError< + ::aws_smithy_runtime_api::client::interceptors::context::Error, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >| { + err.map_service_error(|err| { + err.downcast::() + .expect("correct error type") + }) + }; + let context = Self::orchestrate_with_stop_point(runtime_plugins, input, ::aws_smithy_runtime::client::orchestrator::StopPoint::None) + .await + .map_err(map_err)?; + let output = context.finalize().map_err(map_err)?; + ::std::result::Result::Ok( + output + .downcast::() + .expect("correct output type"), + ) + } + + pub(crate) async fn orchestrate_with_stop_point( + runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, + input: crate::operation::tag_resource::TagResourceInput, + stop_point: ::aws_smithy_runtime::client::orchestrator::StopPoint, + ) -> ::std::result::Result< + ::aws_smithy_runtime_api::client::interceptors::context::InterceptorContext, + ::aws_smithy_runtime_api::client::result::SdkError< + ::aws_smithy_runtime_api::client::interceptors::context::Error, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >, + > { + let input = ::aws_smithy_runtime_api::client::interceptors::context::Input::erase(input); + ::aws_smithy_runtime::client::orchestrator::invoke_with_stop_point("backupsearch", "TagResource", input, runtime_plugins, stop_point).await + } + + pub(crate) fn operation_runtime_plugins( + client_runtime_plugins: ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, + client_config: &crate::config::Config, + config_override: ::std::option::Option, + ) -> ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins { + let mut runtime_plugins = client_runtime_plugins.with_operation_plugin(Self::new()); + runtime_plugins = runtime_plugins.with_client_plugin(crate::auth_plugin::DefaultAuthOptionsPlugin::new(vec![ + ::aws_runtime::auth::sigv4::SCHEME_ID, + ])); + if let ::std::option::Option::Some(config_override) = config_override { + for plugin in config_override.runtime_plugins.iter().cloned() { + runtime_plugins = runtime_plugins.with_operation_plugin(plugin); + } + runtime_plugins = runtime_plugins.with_operation_plugin(crate::config::ConfigOverrideRuntimePlugin::new( + config_override, + client_config.config.clone(), + &client_config.runtime_components, + )); + } + runtime_plugins + } +} +impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for TagResource { + fn config(&self) -> ::std::option::Option<::aws_smithy_types::config_bag::FrozenLayer> { + let mut cfg = ::aws_smithy_types::config_bag::Layer::new("TagResource"); + + cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new( + TagResourceRequestSerializer, + )); + cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new( + TagResourceResponseDeserializer, + )); + + cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new( + ::aws_smithy_runtime_api::client::auth::static_resolver::StaticAuthSchemeOptionResolverParams::new(), + )); + + cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::Metadata::new( + "TagResource", + "backupsearch", + )); + let mut signing_options = ::aws_runtime::auth::SigningOptions::default(); + signing_options.double_uri_encode = true; + signing_options.content_sha256_header = false; + signing_options.normalize_uri_path = true; + signing_options.payload_override = None; + + cfg.store_put(::aws_runtime::auth::SigV4OperationSigningConfig { + signing_options, + ..::std::default::Default::default() + }); + + ::std::option::Option::Some(cfg.freeze()) + } + + fn runtime_components( + &self, + _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder, + ) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> { + #[allow(unused_mut)] + let mut rcb = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("TagResource") + .with_interceptor(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default()) + .with_interceptor(TagResourceEndpointParamsInterceptor) + .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::< + crate::operation::tag_resource::TagResourceError, + >::new()) + .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::< + crate::operation::tag_resource::TagResourceError, + >::new()) + .with_retry_classifier(::aws_runtime::retries::classifiers::AwsErrorCodeClassifier::< + crate::operation::tag_resource::TagResourceError, + >::new()); + + ::std::borrow::Cow::Owned(rcb) + } +} + +#[derive(Debug)] +struct TagResourceResponseDeserializer; +impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for TagResourceResponseDeserializer { + fn deserialize_nonstreaming( + &self, + response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError { + let (success, status) = (response.status().is_success(), response.status().as_u16()); + let headers = response.headers(); + let body = response.body().bytes().expect("body loaded"); + #[allow(unused_mut)] + let mut force_error = false; + ::tracing::debug!(request_id = ?::aws_types::request_id::RequestId::request_id(response)); + let parse_result = if !success && status != 200 || force_error { + crate::protocol_serde::shape_tag_resource::de_tag_resource_http_error(status, headers, body) + } else { + crate::protocol_serde::shape_tag_resource::de_tag_resource_http_response(status, headers, body) + }; + crate::protocol_serde::type_erase_result(parse_result) + } +} +#[derive(Debug)] +struct TagResourceRequestSerializer; +impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for TagResourceRequestSerializer { + #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)] + fn serialize_input( + &self, + input: ::aws_smithy_runtime_api::client::interceptors::context::Input, + _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag, + ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> { + let input = input + .downcast::() + .expect("correct type"); + let _header_serialization_settings = _cfg + .load::() + .cloned() + .unwrap_or_default(); + let mut request_builder = { + fn uri_base( + _input: &crate::operation::tag_resource::TagResourceInput, + output: &mut ::std::string::String, + ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> { + use ::std::fmt::Write as _; + let input_1 = &_input.resource_arn; + let input_1 = input_1 + .as_ref() + .ok_or_else(|| ::aws_smithy_types::error::operation::BuildError::missing_field("resource_arn", "cannot be empty or unset"))?; + let resource_arn = ::aws_smithy_http::label::fmt_string(input_1, ::aws_smithy_http::label::EncodingStrategy::Default); + if resource_arn.is_empty() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "resource_arn", + "cannot be empty or unset", + )); + } + ::std::write!(output, "/tags/{ResourceArn}", ResourceArn = resource_arn).expect("formatting should succeed"); + ::std::result::Result::Ok(()) + } + #[allow(clippy::unnecessary_wraps)] + fn update_http_builder( + input: &crate::operation::tag_resource::TagResourceInput, + builder: ::http::request::Builder, + ) -> ::std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> { + let mut uri = ::std::string::String::new(); + uri_base(input, &mut uri)?; + ::std::result::Result::Ok(builder.method("POST").uri(uri)) + } + let mut builder = update_http_builder(&input, ::http::request::Builder::new())?; + builder = _header_serialization_settings.set_default_header(builder, ::http::header::CONTENT_TYPE, "application/json"); + builder + }; + let body = ::aws_smithy_types::body::SdkBody::from(crate::protocol_serde::shape_tag_resource::ser_tag_resource_input(&input)?); + if let Some(content_length) = body.content_length() { + let content_length = content_length.to_string(); + request_builder = _header_serialization_settings.set_default_header(request_builder, ::http::header::CONTENT_LENGTH, &content_length); + } + ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap()) + } +} +#[derive(Debug)] +struct TagResourceEndpointParamsInterceptor; + +impl ::aws_smithy_runtime_api::client::interceptors::Intercept for TagResourceEndpointParamsInterceptor { + fn name(&self) -> &'static str { + "TagResourceEndpointParamsInterceptor" + } + + fn read_before_execution( + &self, + context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef< + '_, + ::aws_smithy_runtime_api::client::interceptors::context::Input, + ::aws_smithy_runtime_api::client::interceptors::context::Output, + ::aws_smithy_runtime_api::client::interceptors::context::Error, + >, + cfg: &mut ::aws_smithy_types::config_bag::ConfigBag, + ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> { + let _input = context + .input() + .downcast_ref::() + .ok_or("failed to downcast to TagResourceInput")?; + + let params = crate::config::endpoint::Params::builder() + .set_use_fips(cfg.load::<::aws_types::endpoint_config::UseFips>().map(|ty| ty.0)) + .set_endpoint(cfg.load::<::aws_types::endpoint_config::EndpointUrl>().map(|ty| ty.0.clone())) + .set_region(cfg.load::<::aws_types::region::Region>().map(|r| r.as_ref().to_owned())) + .build() + .map_err(|err| { + ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err) + })?; + cfg.interceptor_state() + .store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params)); + ::std::result::Result::Ok(()) + } +} + +// The get_* functions below are generated from JMESPath expressions in the +// operationContextParams trait. They target the operation's input shape. + +/// Error type for the `TagResourceError` operation. +#[non_exhaustive] +#[derive(::std::fmt::Debug)] +pub enum TagResourceError { + ///

The resource was not found for this request.

+ ///

Confirm the resource information, such as the ARN or type is correct and exists, then retry the request.

+ ResourceNotFoundException(crate::types::error::ResourceNotFoundException), + ///

You do not have sufficient access to perform this action.

+ AccessDeniedException(crate::types::error::AccessDeniedException), + ///

An internal server error occurred. Retry your request.

+ InternalServerException(crate::types::error::InternalServerException), + ///

The request was denied due to request throttling.

+ ThrottlingException(crate::types::error::ThrottlingException), + ///

The input fails to satisfy the constraints specified by a service.

+ ValidationException(crate::types::error::ValidationException), + /// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code). + #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \ + variable wildcard pattern and check `.code()`: + \ +    `err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }` + \ + See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-TagResourceError) for what information is available for the error.")] + Unhandled(crate::error::sealed_unhandled::Unhandled), +} +impl TagResourceError { + /// Creates the `TagResourceError::Unhandled` variant from any error type. + pub fn unhandled( + err: impl ::std::convert::Into<::std::boxed::Box>, + ) -> Self { + Self::Unhandled(crate::error::sealed_unhandled::Unhandled { + source: err.into(), + meta: ::std::default::Default::default(), + }) + } + + /// Creates the `TagResourceError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata). + pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self { + Self::Unhandled(crate::error::sealed_unhandled::Unhandled { + source: err.clone().into(), + meta: err, + }) + } + /// + /// Returns error metadata, which includes the error code, message, + /// request ID, and potentially additional information. + /// + pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata { + match self { + Self::ResourceNotFoundException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), + Self::AccessDeniedException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), + Self::InternalServerException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), + Self::ThrottlingException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), + Self::ValidationException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), + Self::Unhandled(e) => &e.meta, + } + } + /// Returns `true` if the error kind is `TagResourceError::ResourceNotFoundException`. + pub fn is_resource_not_found_exception(&self) -> bool { + matches!(self, Self::ResourceNotFoundException(_)) + } + /// Returns `true` if the error kind is `TagResourceError::AccessDeniedException`. + pub fn is_access_denied_exception(&self) -> bool { + matches!(self, Self::AccessDeniedException(_)) + } + /// Returns `true` if the error kind is `TagResourceError::InternalServerException`. + pub fn is_internal_server_exception(&self) -> bool { + matches!(self, Self::InternalServerException(_)) + } + /// Returns `true` if the error kind is `TagResourceError::ThrottlingException`. + pub fn is_throttling_exception(&self) -> bool { + matches!(self, Self::ThrottlingException(_)) + } + /// Returns `true` if the error kind is `TagResourceError::ValidationException`. + pub fn is_validation_exception(&self) -> bool { + matches!(self, Self::ValidationException(_)) + } +} +impl ::std::error::Error for TagResourceError { + fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> { + match self { + Self::ResourceNotFoundException(_inner) => ::std::option::Option::Some(_inner), + Self::AccessDeniedException(_inner) => ::std::option::Option::Some(_inner), + Self::InternalServerException(_inner) => ::std::option::Option::Some(_inner), + Self::ThrottlingException(_inner) => ::std::option::Option::Some(_inner), + Self::ValidationException(_inner) => ::std::option::Option::Some(_inner), + Self::Unhandled(_inner) => ::std::option::Option::Some(&*_inner.source), + } + } +} +impl ::std::fmt::Display for TagResourceError { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + match self { + Self::ResourceNotFoundException(_inner) => _inner.fmt(f), + Self::AccessDeniedException(_inner) => _inner.fmt(f), + Self::InternalServerException(_inner) => _inner.fmt(f), + Self::ThrottlingException(_inner) => _inner.fmt(f), + Self::ValidationException(_inner) => _inner.fmt(f), + Self::Unhandled(_inner) => { + if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) { + write!(f, "unhandled error ({code})") + } else { + f.write_str("unhandled error") + } + } + } + } +} +impl ::aws_smithy_types::retry::ProvideErrorKind for TagResourceError { + fn code(&self) -> ::std::option::Option<&str> { + ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) + } + fn retryable_error_kind(&self) -> ::std::option::Option<::aws_smithy_types::retry::ErrorKind> { + match self { + Self::InternalServerException(inner) => ::std::option::Option::Some(inner.retryable_error_kind()), + Self::ThrottlingException(inner) => ::std::option::Option::Some(inner.retryable_error_kind()), + _ => ::std::option::Option::None, + } + } +} +impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for TagResourceError { + fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata { + match self { + Self::ResourceNotFoundException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner), + Self::AccessDeniedException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner), + Self::InternalServerException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner), + Self::ThrottlingException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner), + Self::ValidationException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner), + Self::Unhandled(_inner) => &_inner.meta, + } + } +} +impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for TagResourceError { + fn create_unhandled_error( + source: ::std::boxed::Box, + meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>, + ) -> Self { + Self::Unhandled(crate::error::sealed_unhandled::Unhandled { + source, + meta: meta.unwrap_or_default(), + }) + } +} +impl ::aws_types::request_id::RequestId for crate::operation::tag_resource::TagResourceError { + fn request_id(&self) -> Option<&str> { + self.meta().request_id() + } +} + +pub use crate::operation::tag_resource::_tag_resource_output::TagResourceOutput; + +pub use crate::operation::tag_resource::_tag_resource_input::TagResourceInput; + +mod _tag_resource_input; + +mod _tag_resource_output; + +/// Builders +pub mod builders; diff --git a/sdk/backupsearch/src/operation/tag_resource/_tag_resource_input.rs b/sdk/backupsearch/src/operation/tag_resource/_tag_resource_input.rs new file mode 100644 index 000000000000..d06114e0c737 --- /dev/null +++ b/sdk/backupsearch/src/operation/tag_resource/_tag_resource_input.rs @@ -0,0 +1,88 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +#[allow(missing_docs)] // documentation missing in model +#[non_exhaustive] +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)] +pub struct TagResourceInput { + ///

The Amazon Resource Name (ARN) that uniquely identifies the resource.

+ ///

This is the resource that will have the indicated tags.

+ pub resource_arn: ::std::option::Option<::std::string::String>, + ///

Required tags to include. A tag is a key-value pair you can use to manage, filter, and search for your resources. Allowed characters include UTF-8 letters, numbers, spaces, and the following characters: + - = . _ : /.

+ pub tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::option::Option<::std::string::String>>>, +} +impl TagResourceInput { + ///

The Amazon Resource Name (ARN) that uniquely identifies the resource.

+ ///

This is the resource that will have the indicated tags.

+ pub fn resource_arn(&self) -> ::std::option::Option<&str> { + self.resource_arn.as_deref() + } + ///

Required tags to include. A tag is a key-value pair you can use to manage, filter, and search for your resources. Allowed characters include UTF-8 letters, numbers, spaces, and the following characters: + - = . _ : /.

+ pub fn tags(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::option::Option<::std::string::String>>> { + self.tags.as_ref() + } +} +impl TagResourceInput { + /// Creates a new builder-style object to manufacture [`TagResourceInput`](crate::operation::tag_resource::TagResourceInput). + pub fn builder() -> crate::operation::tag_resource::builders::TagResourceInputBuilder { + crate::operation::tag_resource::builders::TagResourceInputBuilder::default() + } +} + +/// A builder for [`TagResourceInput`](crate::operation::tag_resource::TagResourceInput). +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)] +#[non_exhaustive] +pub struct TagResourceInputBuilder { + pub(crate) resource_arn: ::std::option::Option<::std::string::String>, + pub(crate) tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::option::Option<::std::string::String>>>, +} +impl TagResourceInputBuilder { + ///

The Amazon Resource Name (ARN) that uniquely identifies the resource.

+ ///

This is the resource that will have the indicated tags.

+ /// This field is required. + pub fn resource_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.resource_arn = ::std::option::Option::Some(input.into()); + self + } + ///

The Amazon Resource Name (ARN) that uniquely identifies the resource.

+ ///

This is the resource that will have the indicated tags.

+ pub fn set_resource_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.resource_arn = input; + self + } + ///

The Amazon Resource Name (ARN) that uniquely identifies the resource.

+ ///

This is the resource that will have the indicated tags.

+ pub fn get_resource_arn(&self) -> &::std::option::Option<::std::string::String> { + &self.resource_arn + } + /// Adds a key-value pair to `tags`. + /// + /// To override the contents of this collection use [`set_tags`](Self::set_tags). + /// + ///

Required tags to include. A tag is a key-value pair you can use to manage, filter, and search for your resources. Allowed characters include UTF-8 letters, numbers, spaces, and the following characters: + - = . _ : /.

+ pub fn tags(mut self, k: impl ::std::convert::Into<::std::string::String>, v: ::std::option::Option<::std::string::String>) -> Self { + let mut hash_map = self.tags.unwrap_or_default(); + hash_map.insert(k.into(), v); + self.tags = ::std::option::Option::Some(hash_map); + self + } + ///

Required tags to include. A tag is a key-value pair you can use to manage, filter, and search for your resources. Allowed characters include UTF-8 letters, numbers, spaces, and the following characters: + - = . _ : /.

+ pub fn set_tags( + mut self, + input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::option::Option<::std::string::String>>>, + ) -> Self { + self.tags = input; + self + } + ///

Required tags to include. A tag is a key-value pair you can use to manage, filter, and search for your resources. Allowed characters include UTF-8 letters, numbers, spaces, and the following characters: + - = . _ : /.

+ pub fn get_tags( + &self, + ) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::option::Option<::std::string::String>>> { + &self.tags + } + /// Consumes the builder and constructs a [`TagResourceInput`](crate::operation::tag_resource::TagResourceInput). + pub fn build(self) -> ::std::result::Result { + ::std::result::Result::Ok(crate::operation::tag_resource::TagResourceInput { + resource_arn: self.resource_arn, + tags: self.tags, + }) + } +} diff --git a/sdk/backupsearch/src/operation/tag_resource/_tag_resource_output.rs b/sdk/backupsearch/src/operation/tag_resource/_tag_resource_output.rs new file mode 100644 index 000000000000..deb8ac09be79 --- /dev/null +++ b/sdk/backupsearch/src/operation/tag_resource/_tag_resource_output.rs @@ -0,0 +1,42 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +#[allow(missing_docs)] // documentation missing in model +#[non_exhaustive] +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)] +pub struct TagResourceOutput { + _request_id: Option, +} +impl ::aws_types::request_id::RequestId for TagResourceOutput { + fn request_id(&self) -> Option<&str> { + self._request_id.as_deref() + } +} +impl TagResourceOutput { + /// Creates a new builder-style object to manufacture [`TagResourceOutput`](crate::operation::tag_resource::TagResourceOutput). + pub fn builder() -> crate::operation::tag_resource::builders::TagResourceOutputBuilder { + crate::operation::tag_resource::builders::TagResourceOutputBuilder::default() + } +} + +/// A builder for [`TagResourceOutput`](crate::operation::tag_resource::TagResourceOutput). +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)] +#[non_exhaustive] +pub struct TagResourceOutputBuilder { + _request_id: Option, +} +impl TagResourceOutputBuilder { + pub(crate) fn _request_id(mut self, request_id: impl Into) -> Self { + self._request_id = Some(request_id.into()); + self + } + + pub(crate) fn _set_request_id(&mut self, request_id: Option) -> &mut Self { + self._request_id = request_id; + self + } + /// Consumes the builder and constructs a [`TagResourceOutput`](crate::operation::tag_resource::TagResourceOutput). + pub fn build(self) -> crate::operation::tag_resource::TagResourceOutput { + crate::operation::tag_resource::TagResourceOutput { + _request_id: self._request_id, + } + } +} diff --git a/sdk/backupsearch/src/operation/tag_resource/builders.rs b/sdk/backupsearch/src/operation/tag_resource/builders.rs new file mode 100644 index 000000000000..a745d8f34dd4 --- /dev/null +++ b/sdk/backupsearch/src/operation/tag_resource/builders.rs @@ -0,0 +1,152 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +pub use crate::operation::tag_resource::_tag_resource_output::TagResourceOutputBuilder; + +pub use crate::operation::tag_resource::_tag_resource_input::TagResourceInputBuilder; + +impl crate::operation::tag_resource::builders::TagResourceInputBuilder { + /// Sends a request with this input using the given client. + pub async fn send_with( + self, + client: &crate::Client, + ) -> ::std::result::Result< + crate::operation::tag_resource::TagResourceOutput, + ::aws_smithy_runtime_api::client::result::SdkError< + crate::operation::tag_resource::TagResourceError, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >, + > { + let mut fluent_builder = client.tag_resource(); + fluent_builder.inner = self; + fluent_builder.send().await + } +} +/// Fluent builder constructing a request to `TagResource`. +/// +///

This operation puts tags on the resource you indicate.

+#[derive(::std::clone::Clone, ::std::fmt::Debug)] +pub struct TagResourceFluentBuilder { + handle: ::std::sync::Arc, + inner: crate::operation::tag_resource::builders::TagResourceInputBuilder, + config_override: ::std::option::Option, +} +impl + crate::client::customize::internal::CustomizableSend< + crate::operation::tag_resource::TagResourceOutput, + crate::operation::tag_resource::TagResourceError, + > for TagResourceFluentBuilder +{ + fn send( + self, + config_override: crate::config::Builder, + ) -> crate::client::customize::internal::BoxFuture< + crate::client::customize::internal::SendResult< + crate::operation::tag_resource::TagResourceOutput, + crate::operation::tag_resource::TagResourceError, + >, + > { + ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await }) + } +} +impl TagResourceFluentBuilder { + /// Creates a new `TagResourceFluentBuilder`. + pub(crate) fn new(handle: ::std::sync::Arc) -> Self { + Self { + handle, + inner: ::std::default::Default::default(), + config_override: ::std::option::Option::None, + } + } + /// Access the TagResource as a reference. + pub fn as_input(&self) -> &crate::operation::tag_resource::builders::TagResourceInputBuilder { + &self.inner + } + /// Sends the request and returns the response. + /// + /// If an error occurs, an `SdkError` will be returned with additional details that + /// can be matched against. + /// + /// By default, any retryable failures will be retried twice. Retry behavior + /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be + /// set when configuring the client. + pub async fn send( + self, + ) -> ::std::result::Result< + crate::operation::tag_resource::TagResourceOutput, + ::aws_smithy_runtime_api::client::result::SdkError< + crate::operation::tag_resource::TagResourceError, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >, + > { + let input = self + .inner + .build() + .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?; + let runtime_plugins = crate::operation::tag_resource::TagResource::operation_runtime_plugins( + self.handle.runtime_plugins.clone(), + &self.handle.conf, + self.config_override, + ); + crate::operation::tag_resource::TagResource::orchestrate(&runtime_plugins, input).await + } + + /// Consumes this builder, creating a customizable operation that can be modified before being sent. + pub fn customize( + self, + ) -> crate::client::customize::CustomizableOperation< + crate::operation::tag_resource::TagResourceOutput, + crate::operation::tag_resource::TagResourceError, + Self, + > { + crate::client::customize::CustomizableOperation::new(self) + } + pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into) -> Self { + self.set_config_override(::std::option::Option::Some(config_override.into())); + self + } + + pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option) -> &mut Self { + self.config_override = config_override; + self + } + ///

The Amazon Resource Name (ARN) that uniquely identifies the resource.

+ ///

This is the resource that will have the indicated tags.

+ pub fn resource_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.inner = self.inner.resource_arn(input.into()); + self + } + ///

The Amazon Resource Name (ARN) that uniquely identifies the resource.

+ ///

This is the resource that will have the indicated tags.

+ pub fn set_resource_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.inner = self.inner.set_resource_arn(input); + self + } + ///

The Amazon Resource Name (ARN) that uniquely identifies the resource.

+ ///

This is the resource that will have the indicated tags.

+ pub fn get_resource_arn(&self) -> &::std::option::Option<::std::string::String> { + self.inner.get_resource_arn() + } + /// + /// Adds a key-value pair to `Tags`. + /// + /// To override the contents of this collection use [`set_tags`](Self::set_tags). + /// + ///

Required tags to include. A tag is a key-value pair you can use to manage, filter, and search for your resources. Allowed characters include UTF-8 letters, numbers, spaces, and the following characters: + - = . _ : /.

+ pub fn tags(mut self, k: impl ::std::convert::Into<::std::string::String>, v: ::std::option::Option<::std::string::String>) -> Self { + self.inner = self.inner.tags(k.into(), v); + self + } + ///

Required tags to include. A tag is a key-value pair you can use to manage, filter, and search for your resources. Allowed characters include UTF-8 letters, numbers, spaces, and the following characters: + - = . _ : /.

+ pub fn set_tags( + mut self, + input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::option::Option<::std::string::String>>>, + ) -> Self { + self.inner = self.inner.set_tags(input); + self + } + ///

Required tags to include. A tag is a key-value pair you can use to manage, filter, and search for your resources. Allowed characters include UTF-8 letters, numbers, spaces, and the following characters: + - = . _ : /.

+ pub fn get_tags( + &self, + ) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::option::Option<::std::string::String>>> { + self.inner.get_tags() + } +} diff --git a/sdk/backupsearch/src/operation/untag_resource.rs b/sdk/backupsearch/src/operation/untag_resource.rs new file mode 100644 index 000000000000..104da1356733 --- /dev/null +++ b/sdk/backupsearch/src/operation/untag_resource.rs @@ -0,0 +1,419 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +/// Orchestration and serialization glue logic for `UntagResource`. +#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)] +#[non_exhaustive] +pub struct UntagResource; +impl UntagResource { + /// Creates a new `UntagResource` + pub fn new() -> Self { + Self + } + pub(crate) async fn orchestrate( + runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, + input: crate::operation::untag_resource::UntagResourceInput, + ) -> ::std::result::Result< + crate::operation::untag_resource::UntagResourceOutput, + ::aws_smithy_runtime_api::client::result::SdkError< + crate::operation::untag_resource::UntagResourceError, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >, + > { + let map_err = |err: ::aws_smithy_runtime_api::client::result::SdkError< + ::aws_smithy_runtime_api::client::interceptors::context::Error, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >| { + err.map_service_error(|err| { + err.downcast::() + .expect("correct error type") + }) + }; + let context = Self::orchestrate_with_stop_point(runtime_plugins, input, ::aws_smithy_runtime::client::orchestrator::StopPoint::None) + .await + .map_err(map_err)?; + let output = context.finalize().map_err(map_err)?; + ::std::result::Result::Ok( + output + .downcast::() + .expect("correct output type"), + ) + } + + pub(crate) async fn orchestrate_with_stop_point( + runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, + input: crate::operation::untag_resource::UntagResourceInput, + stop_point: ::aws_smithy_runtime::client::orchestrator::StopPoint, + ) -> ::std::result::Result< + ::aws_smithy_runtime_api::client::interceptors::context::InterceptorContext, + ::aws_smithy_runtime_api::client::result::SdkError< + ::aws_smithy_runtime_api::client::interceptors::context::Error, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >, + > { + let input = ::aws_smithy_runtime_api::client::interceptors::context::Input::erase(input); + ::aws_smithy_runtime::client::orchestrator::invoke_with_stop_point("backupsearch", "UntagResource", input, runtime_plugins, stop_point).await + } + + pub(crate) fn operation_runtime_plugins( + client_runtime_plugins: ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, + client_config: &crate::config::Config, + config_override: ::std::option::Option, + ) -> ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins { + let mut runtime_plugins = client_runtime_plugins.with_operation_plugin(Self::new()); + runtime_plugins = runtime_plugins.with_client_plugin(crate::auth_plugin::DefaultAuthOptionsPlugin::new(vec![ + ::aws_runtime::auth::sigv4::SCHEME_ID, + ])); + if let ::std::option::Option::Some(config_override) = config_override { + for plugin in config_override.runtime_plugins.iter().cloned() { + runtime_plugins = runtime_plugins.with_operation_plugin(plugin); + } + runtime_plugins = runtime_plugins.with_operation_plugin(crate::config::ConfigOverrideRuntimePlugin::new( + config_override, + client_config.config.clone(), + &client_config.runtime_components, + )); + } + runtime_plugins + } +} +impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for UntagResource { + fn config(&self) -> ::std::option::Option<::aws_smithy_types::config_bag::FrozenLayer> { + let mut cfg = ::aws_smithy_types::config_bag::Layer::new("UntagResource"); + + cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new( + UntagResourceRequestSerializer, + )); + cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new( + UntagResourceResponseDeserializer, + )); + + cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new( + ::aws_smithy_runtime_api::client::auth::static_resolver::StaticAuthSchemeOptionResolverParams::new(), + )); + + cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::Metadata::new( + "UntagResource", + "backupsearch", + )); + let mut signing_options = ::aws_runtime::auth::SigningOptions::default(); + signing_options.double_uri_encode = true; + signing_options.content_sha256_header = false; + signing_options.normalize_uri_path = true; + signing_options.payload_override = None; + + cfg.store_put(::aws_runtime::auth::SigV4OperationSigningConfig { + signing_options, + ..::std::default::Default::default() + }); + + ::std::option::Option::Some(cfg.freeze()) + } + + fn runtime_components( + &self, + _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder, + ) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> { + #[allow(unused_mut)] + let mut rcb = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("UntagResource") + .with_interceptor(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default()) + .with_interceptor(UntagResourceEndpointParamsInterceptor) + .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::< + crate::operation::untag_resource::UntagResourceError, + >::new()) + .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::< + crate::operation::untag_resource::UntagResourceError, + >::new()) + .with_retry_classifier(::aws_runtime::retries::classifiers::AwsErrorCodeClassifier::< + crate::operation::untag_resource::UntagResourceError, + >::new()); + + ::std::borrow::Cow::Owned(rcb) + } +} + +#[derive(Debug)] +struct UntagResourceResponseDeserializer; +impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for UntagResourceResponseDeserializer { + fn deserialize_nonstreaming( + &self, + response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError { + let (success, status) = (response.status().is_success(), response.status().as_u16()); + let headers = response.headers(); + let body = response.body().bytes().expect("body loaded"); + #[allow(unused_mut)] + let mut force_error = false; + ::tracing::debug!(request_id = ?::aws_types::request_id::RequestId::request_id(response)); + let parse_result = if !success && status != 200 || force_error { + crate::protocol_serde::shape_untag_resource::de_untag_resource_http_error(status, headers, body) + } else { + crate::protocol_serde::shape_untag_resource::de_untag_resource_http_response(status, headers, body) + }; + crate::protocol_serde::type_erase_result(parse_result) + } +} +#[derive(Debug)] +struct UntagResourceRequestSerializer; +impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for UntagResourceRequestSerializer { + #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)] + fn serialize_input( + &self, + input: ::aws_smithy_runtime_api::client::interceptors::context::Input, + _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag, + ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> { + let input = input + .downcast::() + .expect("correct type"); + let _header_serialization_settings = _cfg + .load::() + .cloned() + .unwrap_or_default(); + let mut request_builder = { + fn uri_base( + _input: &crate::operation::untag_resource::UntagResourceInput, + output: &mut ::std::string::String, + ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> { + use ::std::fmt::Write as _; + let input_1 = &_input.resource_arn; + let input_1 = input_1 + .as_ref() + .ok_or_else(|| ::aws_smithy_types::error::operation::BuildError::missing_field("resource_arn", "cannot be empty or unset"))?; + let resource_arn = ::aws_smithy_http::label::fmt_string(input_1, ::aws_smithy_http::label::EncodingStrategy::Default); + if resource_arn.is_empty() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "resource_arn", + "cannot be empty or unset", + )); + } + ::std::write!(output, "/tags/{ResourceArn}", ResourceArn = resource_arn).expect("formatting should succeed"); + ::std::result::Result::Ok(()) + } + fn uri_query( + _input: &crate::operation::untag_resource::UntagResourceInput, + mut output: &mut ::std::string::String, + ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> { + let mut query = ::aws_smithy_http::query::Writer::new(output); + let inner_2 = &_input.tag_keys; + let inner_2 = inner_2 + .as_ref() + .ok_or_else(|| ::aws_smithy_types::error::operation::BuildError::missing_field("tag_keys", "cannot be empty or unset"))?; + for inner_3 in inner_2 { + query.push_kv("tagKeys", &::aws_smithy_http::query::fmt_string(inner_3)); + } + ::std::result::Result::Ok(()) + } + #[allow(clippy::unnecessary_wraps)] + fn update_http_builder( + input: &crate::operation::untag_resource::UntagResourceInput, + builder: ::http::request::Builder, + ) -> ::std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> { + let mut uri = ::std::string::String::new(); + uri_base(input, &mut uri)?; + uri_query(input, &mut uri)?; + ::std::result::Result::Ok(builder.method("DELETE").uri(uri)) + } + let mut builder = update_http_builder(&input, ::http::request::Builder::new())?; + builder + }; + let body = ::aws_smithy_types::body::SdkBody::from(""); + + ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap()) + } +} +#[derive(Debug)] +struct UntagResourceEndpointParamsInterceptor; + +impl ::aws_smithy_runtime_api::client::interceptors::Intercept for UntagResourceEndpointParamsInterceptor { + fn name(&self) -> &'static str { + "UntagResourceEndpointParamsInterceptor" + } + + fn read_before_execution( + &self, + context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef< + '_, + ::aws_smithy_runtime_api::client::interceptors::context::Input, + ::aws_smithy_runtime_api::client::interceptors::context::Output, + ::aws_smithy_runtime_api::client::interceptors::context::Error, + >, + cfg: &mut ::aws_smithy_types::config_bag::ConfigBag, + ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> { + let _input = context + .input() + .downcast_ref::() + .ok_or("failed to downcast to UntagResourceInput")?; + + let params = crate::config::endpoint::Params::builder() + .set_use_fips(cfg.load::<::aws_types::endpoint_config::UseFips>().map(|ty| ty.0)) + .set_endpoint(cfg.load::<::aws_types::endpoint_config::EndpointUrl>().map(|ty| ty.0.clone())) + .set_region(cfg.load::<::aws_types::region::Region>().map(|r| r.as_ref().to_owned())) + .build() + .map_err(|err| { + ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err) + })?; + cfg.interceptor_state() + .store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params)); + ::std::result::Result::Ok(()) + } +} + +// The get_* functions below are generated from JMESPath expressions in the +// operationContextParams trait. They target the operation's input shape. + +/// Error type for the `UntagResourceError` operation. +#[non_exhaustive] +#[derive(::std::fmt::Debug)] +pub enum UntagResourceError { + ///

The resource was not found for this request.

+ ///

Confirm the resource information, such as the ARN or type is correct and exists, then retry the request.

+ ResourceNotFoundException(crate::types::error::ResourceNotFoundException), + ///

You do not have sufficient access to perform this action.

+ AccessDeniedException(crate::types::error::AccessDeniedException), + ///

An internal server error occurred. Retry your request.

+ InternalServerException(crate::types::error::InternalServerException), + ///

The request was denied due to request throttling.

+ ThrottlingException(crate::types::error::ThrottlingException), + ///

The input fails to satisfy the constraints specified by a service.

+ ValidationException(crate::types::error::ValidationException), + /// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code). + #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \ + variable wildcard pattern and check `.code()`: + \ +    `err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }` + \ + See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-UntagResourceError) for what information is available for the error.")] + Unhandled(crate::error::sealed_unhandled::Unhandled), +} +impl UntagResourceError { + /// Creates the `UntagResourceError::Unhandled` variant from any error type. + pub fn unhandled( + err: impl ::std::convert::Into<::std::boxed::Box>, + ) -> Self { + Self::Unhandled(crate::error::sealed_unhandled::Unhandled { + source: err.into(), + meta: ::std::default::Default::default(), + }) + } + + /// Creates the `UntagResourceError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata). + pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self { + Self::Unhandled(crate::error::sealed_unhandled::Unhandled { + source: err.clone().into(), + meta: err, + }) + } + /// + /// Returns error metadata, which includes the error code, message, + /// request ID, and potentially additional information. + /// + pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata { + match self { + Self::ResourceNotFoundException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), + Self::AccessDeniedException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), + Self::InternalServerException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), + Self::ThrottlingException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), + Self::ValidationException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), + Self::Unhandled(e) => &e.meta, + } + } + /// Returns `true` if the error kind is `UntagResourceError::ResourceNotFoundException`. + pub fn is_resource_not_found_exception(&self) -> bool { + matches!(self, Self::ResourceNotFoundException(_)) + } + /// Returns `true` if the error kind is `UntagResourceError::AccessDeniedException`. + pub fn is_access_denied_exception(&self) -> bool { + matches!(self, Self::AccessDeniedException(_)) + } + /// Returns `true` if the error kind is `UntagResourceError::InternalServerException`. + pub fn is_internal_server_exception(&self) -> bool { + matches!(self, Self::InternalServerException(_)) + } + /// Returns `true` if the error kind is `UntagResourceError::ThrottlingException`. + pub fn is_throttling_exception(&self) -> bool { + matches!(self, Self::ThrottlingException(_)) + } + /// Returns `true` if the error kind is `UntagResourceError::ValidationException`. + pub fn is_validation_exception(&self) -> bool { + matches!(self, Self::ValidationException(_)) + } +} +impl ::std::error::Error for UntagResourceError { + fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> { + match self { + Self::ResourceNotFoundException(_inner) => ::std::option::Option::Some(_inner), + Self::AccessDeniedException(_inner) => ::std::option::Option::Some(_inner), + Self::InternalServerException(_inner) => ::std::option::Option::Some(_inner), + Self::ThrottlingException(_inner) => ::std::option::Option::Some(_inner), + Self::ValidationException(_inner) => ::std::option::Option::Some(_inner), + Self::Unhandled(_inner) => ::std::option::Option::Some(&*_inner.source), + } + } +} +impl ::std::fmt::Display for UntagResourceError { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + match self { + Self::ResourceNotFoundException(_inner) => _inner.fmt(f), + Self::AccessDeniedException(_inner) => _inner.fmt(f), + Self::InternalServerException(_inner) => _inner.fmt(f), + Self::ThrottlingException(_inner) => _inner.fmt(f), + Self::ValidationException(_inner) => _inner.fmt(f), + Self::Unhandled(_inner) => { + if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) { + write!(f, "unhandled error ({code})") + } else { + f.write_str("unhandled error") + } + } + } + } +} +impl ::aws_smithy_types::retry::ProvideErrorKind for UntagResourceError { + fn code(&self) -> ::std::option::Option<&str> { + ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) + } + fn retryable_error_kind(&self) -> ::std::option::Option<::aws_smithy_types::retry::ErrorKind> { + match self { + Self::InternalServerException(inner) => ::std::option::Option::Some(inner.retryable_error_kind()), + Self::ThrottlingException(inner) => ::std::option::Option::Some(inner.retryable_error_kind()), + _ => ::std::option::Option::None, + } + } +} +impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for UntagResourceError { + fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata { + match self { + Self::ResourceNotFoundException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner), + Self::AccessDeniedException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner), + Self::InternalServerException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner), + Self::ThrottlingException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner), + Self::ValidationException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner), + Self::Unhandled(_inner) => &_inner.meta, + } + } +} +impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for UntagResourceError { + fn create_unhandled_error( + source: ::std::boxed::Box, + meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>, + ) -> Self { + Self::Unhandled(crate::error::sealed_unhandled::Unhandled { + source, + meta: meta.unwrap_or_default(), + }) + } +} +impl ::aws_types::request_id::RequestId for crate::operation::untag_resource::UntagResourceError { + fn request_id(&self) -> Option<&str> { + self.meta().request_id() + } +} + +pub use crate::operation::untag_resource::_untag_resource_output::UntagResourceOutput; + +pub use crate::operation::untag_resource::_untag_resource_input::UntagResourceInput; + +mod _untag_resource_input; + +mod _untag_resource_output; + +/// Builders +pub mod builders; diff --git a/sdk/backupsearch/src/operation/untag_resource/_untag_resource_input.rs b/sdk/backupsearch/src/operation/untag_resource/_untag_resource_input.rs new file mode 100644 index 000000000000..841e759e49bd --- /dev/null +++ b/sdk/backupsearch/src/operation/untag_resource/_untag_resource_input.rs @@ -0,0 +1,82 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +#[allow(missing_docs)] // documentation missing in model +#[non_exhaustive] +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)] +pub struct UntagResourceInput { + ///

The Amazon Resource Name (ARN) that uniquely identifies the resource where you want to remove tags.

+ pub resource_arn: ::std::option::Option<::std::string::String>, + ///

This required parameter contains the tag keys you want to remove from the source.

+ pub tag_keys: ::std::option::Option<::std::vec::Vec<::std::string::String>>, +} +impl UntagResourceInput { + ///

The Amazon Resource Name (ARN) that uniquely identifies the resource where you want to remove tags.

+ pub fn resource_arn(&self) -> ::std::option::Option<&str> { + self.resource_arn.as_deref() + } + ///

This required parameter contains the tag keys you want to remove from the source.

+ /// + /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.tag_keys.is_none()`. + pub fn tag_keys(&self) -> &[::std::string::String] { + self.tag_keys.as_deref().unwrap_or_default() + } +} +impl UntagResourceInput { + /// Creates a new builder-style object to manufacture [`UntagResourceInput`](crate::operation::untag_resource::UntagResourceInput). + pub fn builder() -> crate::operation::untag_resource::builders::UntagResourceInputBuilder { + crate::operation::untag_resource::builders::UntagResourceInputBuilder::default() + } +} + +/// A builder for [`UntagResourceInput`](crate::operation::untag_resource::UntagResourceInput). +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)] +#[non_exhaustive] +pub struct UntagResourceInputBuilder { + pub(crate) resource_arn: ::std::option::Option<::std::string::String>, + pub(crate) tag_keys: ::std::option::Option<::std::vec::Vec<::std::string::String>>, +} +impl UntagResourceInputBuilder { + ///

The Amazon Resource Name (ARN) that uniquely identifies the resource where you want to remove tags.

+ /// This field is required. + pub fn resource_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.resource_arn = ::std::option::Option::Some(input.into()); + self + } + ///

The Amazon Resource Name (ARN) that uniquely identifies the resource where you want to remove tags.

+ pub fn set_resource_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.resource_arn = input; + self + } + ///

The Amazon Resource Name (ARN) that uniquely identifies the resource where you want to remove tags.

+ pub fn get_resource_arn(&self) -> &::std::option::Option<::std::string::String> { + &self.resource_arn + } + /// Appends an item to `tag_keys`. + /// + /// To override the contents of this collection use [`set_tag_keys`](Self::set_tag_keys). + /// + ///

This required parameter contains the tag keys you want to remove from the source.

+ pub fn tag_keys(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + let mut v = self.tag_keys.unwrap_or_default(); + v.push(input.into()); + self.tag_keys = ::std::option::Option::Some(v); + self + } + ///

This required parameter contains the tag keys you want to remove from the source.

+ pub fn set_tag_keys(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self { + self.tag_keys = input; + self + } + ///

This required parameter contains the tag keys you want to remove from the source.

+ pub fn get_tag_keys(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> { + &self.tag_keys + } + /// Consumes the builder and constructs a [`UntagResourceInput`](crate::operation::untag_resource::UntagResourceInput). + pub fn build( + self, + ) -> ::std::result::Result { + ::std::result::Result::Ok(crate::operation::untag_resource::UntagResourceInput { + resource_arn: self.resource_arn, + tag_keys: self.tag_keys, + }) + } +} diff --git a/sdk/backupsearch/src/operation/untag_resource/_untag_resource_output.rs b/sdk/backupsearch/src/operation/untag_resource/_untag_resource_output.rs new file mode 100644 index 000000000000..286734ed0167 --- /dev/null +++ b/sdk/backupsearch/src/operation/untag_resource/_untag_resource_output.rs @@ -0,0 +1,42 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +#[allow(missing_docs)] // documentation missing in model +#[non_exhaustive] +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)] +pub struct UntagResourceOutput { + _request_id: Option, +} +impl ::aws_types::request_id::RequestId for UntagResourceOutput { + fn request_id(&self) -> Option<&str> { + self._request_id.as_deref() + } +} +impl UntagResourceOutput { + /// Creates a new builder-style object to manufacture [`UntagResourceOutput`](crate::operation::untag_resource::UntagResourceOutput). + pub fn builder() -> crate::operation::untag_resource::builders::UntagResourceOutputBuilder { + crate::operation::untag_resource::builders::UntagResourceOutputBuilder::default() + } +} + +/// A builder for [`UntagResourceOutput`](crate::operation::untag_resource::UntagResourceOutput). +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)] +#[non_exhaustive] +pub struct UntagResourceOutputBuilder { + _request_id: Option, +} +impl UntagResourceOutputBuilder { + pub(crate) fn _request_id(mut self, request_id: impl Into) -> Self { + self._request_id = Some(request_id.into()); + self + } + + pub(crate) fn _set_request_id(&mut self, request_id: Option) -> &mut Self { + self._request_id = request_id; + self + } + /// Consumes the builder and constructs a [`UntagResourceOutput`](crate::operation::untag_resource::UntagResourceOutput). + pub fn build(self) -> crate::operation::untag_resource::UntagResourceOutput { + crate::operation::untag_resource::UntagResourceOutput { + _request_id: self._request_id, + } + } +} diff --git a/sdk/backupsearch/src/operation/untag_resource/builders.rs b/sdk/backupsearch/src/operation/untag_resource/builders.rs new file mode 100644 index 000000000000..caf107b05cca --- /dev/null +++ b/sdk/backupsearch/src/operation/untag_resource/builders.rs @@ -0,0 +1,144 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +pub use crate::operation::untag_resource::_untag_resource_output::UntagResourceOutputBuilder; + +pub use crate::operation::untag_resource::_untag_resource_input::UntagResourceInputBuilder; + +impl crate::operation::untag_resource::builders::UntagResourceInputBuilder { + /// Sends a request with this input using the given client. + pub async fn send_with( + self, + client: &crate::Client, + ) -> ::std::result::Result< + crate::operation::untag_resource::UntagResourceOutput, + ::aws_smithy_runtime_api::client::result::SdkError< + crate::operation::untag_resource::UntagResourceError, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >, + > { + let mut fluent_builder = client.untag_resource(); + fluent_builder.inner = self; + fluent_builder.send().await + } +} +/// Fluent builder constructing a request to `UntagResource`. +/// +///

This operation removes tags from the specified resource.

+#[derive(::std::clone::Clone, ::std::fmt::Debug)] +pub struct UntagResourceFluentBuilder { + handle: ::std::sync::Arc, + inner: crate::operation::untag_resource::builders::UntagResourceInputBuilder, + config_override: ::std::option::Option, +} +impl + crate::client::customize::internal::CustomizableSend< + crate::operation::untag_resource::UntagResourceOutput, + crate::operation::untag_resource::UntagResourceError, + > for UntagResourceFluentBuilder +{ + fn send( + self, + config_override: crate::config::Builder, + ) -> crate::client::customize::internal::BoxFuture< + crate::client::customize::internal::SendResult< + crate::operation::untag_resource::UntagResourceOutput, + crate::operation::untag_resource::UntagResourceError, + >, + > { + ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await }) + } +} +impl UntagResourceFluentBuilder { + /// Creates a new `UntagResourceFluentBuilder`. + pub(crate) fn new(handle: ::std::sync::Arc) -> Self { + Self { + handle, + inner: ::std::default::Default::default(), + config_override: ::std::option::Option::None, + } + } + /// Access the UntagResource as a reference. + pub fn as_input(&self) -> &crate::operation::untag_resource::builders::UntagResourceInputBuilder { + &self.inner + } + /// Sends the request and returns the response. + /// + /// If an error occurs, an `SdkError` will be returned with additional details that + /// can be matched against. + /// + /// By default, any retryable failures will be retried twice. Retry behavior + /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be + /// set when configuring the client. + pub async fn send( + self, + ) -> ::std::result::Result< + crate::operation::untag_resource::UntagResourceOutput, + ::aws_smithy_runtime_api::client::result::SdkError< + crate::operation::untag_resource::UntagResourceError, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >, + > { + let input = self + .inner + .build() + .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?; + let runtime_plugins = crate::operation::untag_resource::UntagResource::operation_runtime_plugins( + self.handle.runtime_plugins.clone(), + &self.handle.conf, + self.config_override, + ); + crate::operation::untag_resource::UntagResource::orchestrate(&runtime_plugins, input).await + } + + /// Consumes this builder, creating a customizable operation that can be modified before being sent. + pub fn customize( + self, + ) -> crate::client::customize::CustomizableOperation< + crate::operation::untag_resource::UntagResourceOutput, + crate::operation::untag_resource::UntagResourceError, + Self, + > { + crate::client::customize::CustomizableOperation::new(self) + } + pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into) -> Self { + self.set_config_override(::std::option::Option::Some(config_override.into())); + self + } + + pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option) -> &mut Self { + self.config_override = config_override; + self + } + ///

The Amazon Resource Name (ARN) that uniquely identifies the resource where you want to remove tags.

+ pub fn resource_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.inner = self.inner.resource_arn(input.into()); + self + } + ///

The Amazon Resource Name (ARN) that uniquely identifies the resource where you want to remove tags.

+ pub fn set_resource_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.inner = self.inner.set_resource_arn(input); + self + } + ///

The Amazon Resource Name (ARN) that uniquely identifies the resource where you want to remove tags.

+ pub fn get_resource_arn(&self) -> &::std::option::Option<::std::string::String> { + self.inner.get_resource_arn() + } + /// + /// Appends an item to `TagKeys`. + /// + /// To override the contents of this collection use [`set_tag_keys`](Self::set_tag_keys). + /// + ///

This required parameter contains the tag keys you want to remove from the source.

+ pub fn tag_keys(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.inner = self.inner.tag_keys(input.into()); + self + } + ///

This required parameter contains the tag keys you want to remove from the source.

+ pub fn set_tag_keys(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self { + self.inner = self.inner.set_tag_keys(input); + self + } + ///

This required parameter contains the tag keys you want to remove from the source.

+ pub fn get_tag_keys(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> { + self.inner.get_tag_keys() + } +} diff --git a/sdk/backupsearch/src/primitives.rs b/sdk/backupsearch/src/primitives.rs new file mode 100644 index 000000000000..367d49da1d6d --- /dev/null +++ b/sdk/backupsearch/src/primitives.rs @@ -0,0 +1,8 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +pub use ::aws_smithy_types::date_time::Format as DateTimeFormat; +pub use ::aws_smithy_types::DateTime; + +/// Event stream related primitives such as `Message` or `Header`. +pub mod event_stream; + +pub(crate) mod sealed_enum_unknown; diff --git a/sdk/backupsearch/src/primitives/event_stream.rs b/sdk/backupsearch/src/primitives/event_stream.rs new file mode 100644 index 000000000000..ddd9e04a924d --- /dev/null +++ b/sdk/backupsearch/src/primitives/event_stream.rs @@ -0,0 +1 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. diff --git a/sdk/backupsearch/src/primitives/sealed_enum_unknown.rs b/sdk/backupsearch/src/primitives/sealed_enum_unknown.rs new file mode 100644 index 000000000000..746e172e83bf --- /dev/null +++ b/sdk/backupsearch/src/primitives/sealed_enum_unknown.rs @@ -0,0 +1,21 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. + +/// Opaque struct used as inner data for the `Unknown` variant defined in enums in +/// the crate. +/// +/// This is not intended to be used directly. +#[non_exhaustive] +#[derive( + ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::Ord, ::std::cmp::PartialEq, ::std::cmp::PartialOrd, ::std::fmt::Debug, ::std::hash::Hash, +)] +pub struct UnknownVariantValue(pub(crate) ::std::string::String); +impl UnknownVariantValue { + pub(crate) fn as_str(&self) -> &str { + &self.0 + } +} +impl ::std::fmt::Display for UnknownVariantValue { + fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + write!(f, "{}", self.0) + } +} diff --git a/sdk/backupsearch/src/protocol_serde.rs b/sdk/backupsearch/src/protocol_serde.rs new file mode 100644 index 000000000000..a78acd82400e --- /dev/null +++ b/sdk/backupsearch/src/protocol_serde.rs @@ -0,0 +1,138 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +pub(crate) fn type_erase_result( + result: ::std::result::Result, +) -> ::std::result::Result< + ::aws_smithy_runtime_api::client::interceptors::context::Output, + ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError<::aws_smithy_runtime_api::client::interceptors::context::Error>, +> +where + O: ::std::fmt::Debug + ::std::marker::Send + ::std::marker::Sync + 'static, + E: ::std::error::Error + std::fmt::Debug + ::std::marker::Send + ::std::marker::Sync + 'static, +{ + result + .map(|output| ::aws_smithy_runtime_api::client::interceptors::context::Output::erase(output)) + .map_err(|error| ::aws_smithy_runtime_api::client::interceptors::context::Error::erase(error)) + .map_err(::std::convert::Into::into) +} + +pub fn parse_http_error_metadata( + _response_status: u16, + response_headers: &::aws_smithy_runtime_api::http::Headers, + response_body: &[u8], +) -> Result<::aws_smithy_types::error::metadata::Builder, ::aws_smithy_json::deserialize::error::DeserializeError> { + crate::json_errors::parse_error_metadata(response_body, response_headers) +} + +pub(crate) mod shape_get_search_job; + +pub(crate) mod shape_get_search_result_export_job; + +pub(crate) mod shape_list_search_job_backups; + +pub(crate) mod shape_list_search_job_results; + +pub(crate) mod shape_list_search_jobs; + +pub(crate) mod shape_list_search_result_export_jobs; + +pub(crate) mod shape_list_tags_for_resource; + +pub(crate) mod shape_start_search_job; + +pub(crate) mod shape_start_search_result_export_job; + +pub(crate) mod shape_stop_search_job; + +pub(crate) mod shape_tag_resource; + +pub(crate) mod shape_untag_resource; + +pub(crate) fn or_empty_doc(data: &[u8]) -> &[u8] { + if data.is_empty() { + b"{}" + } else { + data + } +} + +pub(crate) mod shape_access_denied_exception; + +pub(crate) mod shape_conflict_exception; + +pub(crate) mod shape_internal_server_exception; + +pub(crate) mod shape_resource_not_found_exception; + +pub(crate) mod shape_service_quota_exceeded_exception; + +pub(crate) mod shape_start_search_job_input; + +pub(crate) mod shape_start_search_result_export_job_input; + +pub(crate) mod shape_tag_resource_input; + +pub(crate) mod shape_throttling_exception; + +pub(crate) mod shape_validation_exception; + +pub(crate) mod shape_current_search_progress; + +pub(crate) mod shape_export_job_summaries; + +pub(crate) mod shape_export_specification; + +pub(crate) mod shape_item_filters; + +pub(crate) mod shape_results; + +pub(crate) mod shape_search_job_backups_results; + +pub(crate) mod shape_search_jobs; + +pub(crate) mod shape_search_scope; + +pub(crate) mod shape_search_scope_summary; + +pub(crate) mod shape_tag_map; + +pub(crate) mod shape_backup_creation_time_filter; + +pub(crate) mod shape_ebs_item_filter; + +pub(crate) mod shape_ebs_item_filters; + +pub(crate) mod shape_export_job_summary; + +pub(crate) mod shape_recovery_point_arn_list; + +pub(crate) mod shape_resource_arn_list; + +pub(crate) mod shape_resource_type_list; + +pub(crate) mod shape_result_item; + +pub(crate) mod shape_s3_export_specification; + +pub(crate) mod shape_s3_item_filter; + +pub(crate) mod shape_s3_item_filters; + +pub(crate) mod shape_search_job_backups_result; + +pub(crate) mod shape_search_job_summary; + +pub(crate) mod shape_ebs_result_item; + +pub(crate) mod shape_long_condition; + +pub(crate) mod shape_s3_result_item; + +pub(crate) mod shape_string_condition; + +pub(crate) mod shape_time_condition; + +pub(crate) mod shape_long_condition_list; + +pub(crate) mod shape_string_condition_list; + +pub(crate) mod shape_time_condition_list; diff --git a/sdk/backupsearch/src/protocol_serde/shape_access_denied_exception.rs b/sdk/backupsearch/src/protocol_serde/shape_access_denied_exception.rs new file mode 100644 index 000000000000..d8fa6ac83705 --- /dev/null +++ b/sdk/backupsearch/src/protocol_serde/shape_access_denied_exception.rs @@ -0,0 +1,36 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +pub(crate) fn de_access_denied_exception_json_err( + value: &[u8], + mut builder: crate::types::error::builders::AccessDeniedExceptionBuilder, +) -> Result { + let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(value)).peekable(); + let tokens = &mut tokens_owned; + ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; + loop { + match tokens.next().transpose()? { + Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break, + Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() { + "message" => { + builder = builder.set_message( + ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())? + .map(|s| s.to_unescaped().map(|u| u.into_owned())) + .transpose()?, + ); + } + _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?, + }, + other => { + return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!( + "expected object key or end object, found: {:?}", + other + ))) + } + } + } + if tokens.next().is_some() { + return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom( + "found more JSON tokens after completing parsing", + )); + } + Ok(builder) +} diff --git a/sdk/backupsearch/src/protocol_serde/shape_backup_creation_time_filter.rs b/sdk/backupsearch/src/protocol_serde/shape_backup_creation_time_filter.rs new file mode 100644 index 000000000000..dda21cac88fc --- /dev/null +++ b/sdk/backupsearch/src/protocol_serde/shape_backup_creation_time_filter.rs @@ -0,0 +1,62 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +pub(crate) fn de_backup_creation_time_filter<'a, I>( + tokens: &mut ::std::iter::Peekable, +) -> Result, ::aws_smithy_json::deserialize::error::DeserializeError> +where + I: Iterator, ::aws_smithy_json::deserialize::error::DeserializeError>>, +{ + match tokens.next().transpose()? { + Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), + Some(::aws_smithy_json::deserialize::Token::StartObject { .. }) => { + #[allow(unused_mut)] + let mut builder = crate::types::builders::BackupCreationTimeFilterBuilder::default(); + loop { + match tokens.next().transpose()? { + Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break, + Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() { + "CreatedAfter" => { + builder = builder.set_created_after(::aws_smithy_json::deserialize::token::expect_timestamp_or_null( + tokens.next(), + ::aws_smithy_types::date_time::Format::EpochSeconds, + )?); + } + "CreatedBefore" => { + builder = builder.set_created_before(::aws_smithy_json::deserialize::token::expect_timestamp_or_null( + tokens.next(), + ::aws_smithy_types::date_time::Format::EpochSeconds, + )?); + } + _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?, + }, + other => { + return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!( + "expected object key or end object, found: {:?}", + other + ))) + } + } + } + Ok(Some(builder.build())) + } + _ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom( + "expected start object or null", + )), + } +} + +pub fn ser_backup_creation_time_filter( + object: &mut ::aws_smithy_json::serialize::JsonObjectWriter, + input: &crate::types::BackupCreationTimeFilter, +) -> Result<(), ::aws_smithy_types::error::operation::SerializationError> { + if let Some(var_1) = &input.created_after { + object + .key("CreatedAfter") + .date_time(var_1, ::aws_smithy_types::date_time::Format::EpochSeconds)?; + } + if let Some(var_2) = &input.created_before { + object + .key("CreatedBefore") + .date_time(var_2, ::aws_smithy_types::date_time::Format::EpochSeconds)?; + } + Ok(()) +} diff --git a/sdk/backupsearch/src/protocol_serde/shape_conflict_exception.rs b/sdk/backupsearch/src/protocol_serde/shape_conflict_exception.rs new file mode 100644 index 000000000000..aa8b5a37ca07 --- /dev/null +++ b/sdk/backupsearch/src/protocol_serde/shape_conflict_exception.rs @@ -0,0 +1,50 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +pub(crate) fn de_conflict_exception_json_err( + value: &[u8], + mut builder: crate::types::error::builders::ConflictExceptionBuilder, +) -> Result { + let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(value)).peekable(); + let tokens = &mut tokens_owned; + ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; + loop { + match tokens.next().transpose()? { + Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break, + Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() { + "message" => { + builder = builder.set_message( + ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())? + .map(|s| s.to_unescaped().map(|u| u.into_owned())) + .transpose()?, + ); + } + "resourceId" => { + builder = builder.set_resource_id( + ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())? + .map(|s| s.to_unescaped().map(|u| u.into_owned())) + .transpose()?, + ); + } + "resourceType" => { + builder = builder.set_resource_type( + ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())? + .map(|s| s.to_unescaped().map(|u| u.into_owned())) + .transpose()?, + ); + } + _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?, + }, + other => { + return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!( + "expected object key or end object, found: {:?}", + other + ))) + } + } + } + if tokens.next().is_some() { + return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom( + "found more JSON tokens after completing parsing", + )); + } + Ok(builder) +} diff --git a/sdk/backupsearch/src/protocol_serde/shape_current_search_progress.rs b/sdk/backupsearch/src/protocol_serde/shape_current_search_progress.rs new file mode 100644 index 000000000000..92989c6f9cce --- /dev/null +++ b/sdk/backupsearch/src/protocol_serde/shape_current_search_progress.rs @@ -0,0 +1,54 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +pub(crate) fn de_current_search_progress<'a, I>( + tokens: &mut ::std::iter::Peekable, +) -> Result, ::aws_smithy_json::deserialize::error::DeserializeError> +where + I: Iterator, ::aws_smithy_json::deserialize::error::DeserializeError>>, +{ + match tokens.next().transpose()? { + Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), + Some(::aws_smithy_json::deserialize::Token::StartObject { .. }) => { + #[allow(unused_mut)] + let mut builder = crate::types::builders::CurrentSearchProgressBuilder::default(); + loop { + match tokens.next().transpose()? { + Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break, + Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() { + "RecoveryPointsScannedCount" => { + builder = builder.set_recovery_points_scanned_count( + ::aws_smithy_json::deserialize::token::expect_number_or_null(tokens.next())? + .map(i32::try_from) + .transpose()?, + ); + } + "ItemsScannedCount" => { + builder = builder.set_items_scanned_count( + ::aws_smithy_json::deserialize::token::expect_number_or_null(tokens.next())? + .map(i64::try_from) + .transpose()?, + ); + } + "ItemsMatchedCount" => { + builder = builder.set_items_matched_count( + ::aws_smithy_json::deserialize::token::expect_number_or_null(tokens.next())? + .map(i64::try_from) + .transpose()?, + ); + } + _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?, + }, + other => { + return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!( + "expected object key or end object, found: {:?}", + other + ))) + } + } + } + Ok(Some(builder.build())) + } + _ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom( + "expected start object or null", + )), + } +} diff --git a/sdk/backupsearch/src/protocol_serde/shape_ebs_item_filter.rs b/sdk/backupsearch/src/protocol_serde/shape_ebs_item_filter.rs new file mode 100644 index 000000000000..463c152cb05a --- /dev/null +++ b/sdk/backupsearch/src/protocol_serde/shape_ebs_item_filter.rs @@ -0,0 +1,101 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +pub fn ser_ebs_item_filter( + object: &mut ::aws_smithy_json::serialize::JsonObjectWriter, + input: &crate::types::EbsItemFilter, +) -> Result<(), ::aws_smithy_types::error::operation::SerializationError> { + if let Some(var_1) = &input.file_paths { + let mut array_2 = object.key("FilePaths").start_array(); + for item_3 in var_1 { + { + #[allow(unused_mut)] + let mut object_4 = array_2.value().start_object(); + crate::protocol_serde::shape_string_condition::ser_string_condition(&mut object_4, item_3)?; + object_4.finish(); + } + } + array_2.finish(); + } + if let Some(var_5) = &input.sizes { + let mut array_6 = object.key("Sizes").start_array(); + for item_7 in var_5 { + { + #[allow(unused_mut)] + let mut object_8 = array_6.value().start_object(); + crate::protocol_serde::shape_long_condition::ser_long_condition(&mut object_8, item_7)?; + object_8.finish(); + } + } + array_6.finish(); + } + if let Some(var_9) = &input.creation_times { + let mut array_10 = object.key("CreationTimes").start_array(); + for item_11 in var_9 { + { + #[allow(unused_mut)] + let mut object_12 = array_10.value().start_object(); + crate::protocol_serde::shape_time_condition::ser_time_condition(&mut object_12, item_11)?; + object_12.finish(); + } + } + array_10.finish(); + } + if let Some(var_13) = &input.last_modification_times { + let mut array_14 = object.key("LastModificationTimes").start_array(); + for item_15 in var_13 { + { + #[allow(unused_mut)] + let mut object_16 = array_14.value().start_object(); + crate::protocol_serde::shape_time_condition::ser_time_condition(&mut object_16, item_15)?; + object_16.finish(); + } + } + array_14.finish(); + } + Ok(()) +} + +pub(crate) fn de_ebs_item_filter<'a, I>( + tokens: &mut ::std::iter::Peekable, +) -> Result, ::aws_smithy_json::deserialize::error::DeserializeError> +where + I: Iterator, ::aws_smithy_json::deserialize::error::DeserializeError>>, +{ + match tokens.next().transpose()? { + Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), + Some(::aws_smithy_json::deserialize::Token::StartObject { .. }) => { + #[allow(unused_mut)] + let mut builder = crate::types::builders::EbsItemFilterBuilder::default(); + loop { + match tokens.next().transpose()? { + Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break, + Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() { + "FilePaths" => { + builder = builder.set_file_paths(crate::protocol_serde::shape_string_condition_list::de_string_condition_list(tokens)?); + } + "Sizes" => { + builder = builder.set_sizes(crate::protocol_serde::shape_long_condition_list::de_long_condition_list(tokens)?); + } + "CreationTimes" => { + builder = builder.set_creation_times(crate::protocol_serde::shape_time_condition_list::de_time_condition_list(tokens)?); + } + "LastModificationTimes" => { + builder = builder + .set_last_modification_times(crate::protocol_serde::shape_time_condition_list::de_time_condition_list(tokens)?); + } + _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?, + }, + other => { + return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!( + "expected object key or end object, found: {:?}", + other + ))) + } + } + } + Ok(Some(builder.build())) + } + _ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom( + "expected start object or null", + )), + } +} diff --git a/sdk/backupsearch/src/protocol_serde/shape_ebs_item_filters.rs b/sdk/backupsearch/src/protocol_serde/shape_ebs_item_filters.rs new file mode 100644 index 000000000000..011b6e71fc78 --- /dev/null +++ b/sdk/backupsearch/src/protocol_serde/shape_ebs_item_filters.rs @@ -0,0 +1,32 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +pub(crate) fn de_ebs_item_filters<'a, I>( + tokens: &mut ::std::iter::Peekable, +) -> Result>, ::aws_smithy_json::deserialize::error::DeserializeError> +where + I: Iterator, ::aws_smithy_json::deserialize::error::DeserializeError>>, +{ + match tokens.next().transpose()? { + Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), + Some(::aws_smithy_json::deserialize::Token::StartArray { .. }) => { + let mut items = Vec::new(); + loop { + match tokens.peek() { + Some(Ok(::aws_smithy_json::deserialize::Token::EndArray { .. })) => { + tokens.next().transpose().unwrap(); + break; + } + _ => { + let value = crate::protocol_serde::shape_ebs_item_filter::de_ebs_item_filter(tokens)?; + if let Some(value) = value { + items.push(value); + } + } + } + } + Ok(Some(items)) + } + _ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom( + "expected start array or null", + )), + } +} diff --git a/sdk/backupsearch/src/protocol_serde/shape_ebs_result_item.rs b/sdk/backupsearch/src/protocol_serde/shape_ebs_result_item.rs new file mode 100644 index 000000000000..f05b23c3788c --- /dev/null +++ b/sdk/backupsearch/src/protocol_serde/shape_ebs_result_item.rs @@ -0,0 +1,87 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +pub(crate) fn de_ebs_result_item<'a, I>( + tokens: &mut ::std::iter::Peekable, +) -> Result, ::aws_smithy_json::deserialize::error::DeserializeError> +where + I: Iterator, ::aws_smithy_json::deserialize::error::DeserializeError>>, +{ + match tokens.next().transpose()? { + Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), + Some(::aws_smithy_json::deserialize::Token::StartObject { .. }) => { + #[allow(unused_mut)] + let mut builder = crate::types::builders::EbsResultItemBuilder::default(); + loop { + match tokens.next().transpose()? { + Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break, + Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() { + "BackupResourceArn" => { + builder = builder.set_backup_resource_arn( + ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())? + .map(|s| s.to_unescaped().map(|u| u.into_owned())) + .transpose()?, + ); + } + "SourceResourceArn" => { + builder = builder.set_source_resource_arn( + ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())? + .map(|s| s.to_unescaped().map(|u| u.into_owned())) + .transpose()?, + ); + } + "BackupVaultName" => { + builder = builder.set_backup_vault_name( + ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())? + .map(|s| s.to_unescaped().map(|u| u.into_owned())) + .transpose()?, + ); + } + "FileSystemIdentifier" => { + builder = builder.set_file_system_identifier( + ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())? + .map(|s| s.to_unescaped().map(|u| u.into_owned())) + .transpose()?, + ); + } + "FilePath" => { + builder = builder.set_file_path( + ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())? + .map(|s| s.to_unescaped().map(|u| u.into_owned())) + .transpose()?, + ); + } + "FileSize" => { + builder = builder.set_file_size( + ::aws_smithy_json::deserialize::token::expect_number_or_null(tokens.next())? + .map(i64::try_from) + .transpose()?, + ); + } + "CreationTime" => { + builder = builder.set_creation_time(::aws_smithy_json::deserialize::token::expect_timestamp_or_null( + tokens.next(), + ::aws_smithy_types::date_time::Format::EpochSeconds, + )?); + } + "LastModifiedTime" => { + builder = builder.set_last_modified_time(::aws_smithy_json::deserialize::token::expect_timestamp_or_null( + tokens.next(), + ::aws_smithy_types::date_time::Format::EpochSeconds, + )?); + } + _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?, + }, + other => { + return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!( + "expected object key or end object, found: {:?}", + other + ))) + } + } + } + Ok(Some(builder.build())) + } + _ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom( + "expected start object or null", + )), + } +} diff --git a/sdk/backupsearch/src/protocol_serde/shape_export_job_summaries.rs b/sdk/backupsearch/src/protocol_serde/shape_export_job_summaries.rs new file mode 100644 index 000000000000..0c466e2ec917 --- /dev/null +++ b/sdk/backupsearch/src/protocol_serde/shape_export_job_summaries.rs @@ -0,0 +1,32 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +pub(crate) fn de_export_job_summaries<'a, I>( + tokens: &mut ::std::iter::Peekable, +) -> Result>, ::aws_smithy_json::deserialize::error::DeserializeError> +where + I: Iterator, ::aws_smithy_json::deserialize::error::DeserializeError>>, +{ + match tokens.next().transpose()? { + Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), + Some(::aws_smithy_json::deserialize::Token::StartArray { .. }) => { + let mut items = Vec::new(); + loop { + match tokens.peek() { + Some(Ok(::aws_smithy_json::deserialize::Token::EndArray { .. })) => { + tokens.next().transpose().unwrap(); + break; + } + _ => { + let value = crate::protocol_serde::shape_export_job_summary::de_export_job_summary(tokens)?; + if let Some(value) = value { + items.push(value); + } + } + } + } + Ok(Some(items)) + } + _ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom( + "expected start array or null", + )), + } +} diff --git a/sdk/backupsearch/src/protocol_serde/shape_export_job_summary.rs b/sdk/backupsearch/src/protocol_serde/shape_export_job_summary.rs new file mode 100644 index 000000000000..ceb32125dfb8 --- /dev/null +++ b/sdk/backupsearch/src/protocol_serde/shape_export_job_summary.rs @@ -0,0 +1,82 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +pub(crate) fn de_export_job_summary<'a, I>( + tokens: &mut ::std::iter::Peekable, +) -> Result, ::aws_smithy_json::deserialize::error::DeserializeError> +where + I: Iterator, ::aws_smithy_json::deserialize::error::DeserializeError>>, +{ + match tokens.next().transpose()? { + Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), + Some(::aws_smithy_json::deserialize::Token::StartObject { .. }) => { + #[allow(unused_mut)] + let mut builder = crate::types::builders::ExportJobSummaryBuilder::default(); + loop { + match tokens.next().transpose()? { + Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break, + Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() { + "ExportJobIdentifier" => { + builder = builder.set_export_job_identifier( + ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())? + .map(|s| s.to_unescaped().map(|u| u.into_owned())) + .transpose()?, + ); + } + "ExportJobArn" => { + builder = builder.set_export_job_arn( + ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())? + .map(|s| s.to_unescaped().map(|u| u.into_owned())) + .transpose()?, + ); + } + "Status" => { + builder = builder.set_status( + ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())? + .map(|s| s.to_unescaped().map(|u| crate::types::ExportJobStatus::from(u.as_ref()))) + .transpose()?, + ); + } + "CreationTime" => { + builder = builder.set_creation_time(::aws_smithy_json::deserialize::token::expect_timestamp_or_null( + tokens.next(), + ::aws_smithy_types::date_time::Format::EpochSeconds, + )?); + } + "CompletionTime" => { + builder = builder.set_completion_time(::aws_smithy_json::deserialize::token::expect_timestamp_or_null( + tokens.next(), + ::aws_smithy_types::date_time::Format::EpochSeconds, + )?); + } + "StatusMessage" => { + builder = builder.set_status_message( + ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())? + .map(|s| s.to_unescaped().map(|u| u.into_owned())) + .transpose()?, + ); + } + "SearchJobArn" => { + builder = builder.set_search_job_arn( + ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())? + .map(|s| s.to_unescaped().map(|u| u.into_owned())) + .transpose()?, + ); + } + _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?, + }, + other => { + return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!( + "expected object key or end object, found: {:?}", + other + ))) + } + } + } + Ok(Some(crate::serde_util::export_job_summary_correct_errors(builder).build().map_err( + |err| ::aws_smithy_json::deserialize::error::DeserializeError::custom_source("Response was invalid", err), + )?)) + } + _ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom( + "expected start object or null", + )), + } +} diff --git a/sdk/backupsearch/src/protocol_serde/shape_export_specification.rs b/sdk/backupsearch/src/protocol_serde/shape_export_specification.rs new file mode 100644 index 000000000000..45e623a0221a --- /dev/null +++ b/sdk/backupsearch/src/protocol_serde/shape_export_specification.rs @@ -0,0 +1,83 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +pub(crate) fn de_export_specification<'a, I>( + tokens: &mut ::std::iter::Peekable, +) -> Result, ::aws_smithy_json::deserialize::error::DeserializeError> +where + I: Iterator, ::aws_smithy_json::deserialize::error::DeserializeError>>, +{ + let mut variant = None; + match tokens.next().transpose()? { + Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => return Ok(None), + Some(::aws_smithy_json::deserialize::Token::StartObject { .. }) => loop { + match tokens.next().transpose()? { + Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break, + Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { + if let ::std::option::Option::Some(::std::result::Result::Ok(::aws_smithy_json::deserialize::Token::ValueNull { .. })) = + tokens.peek() + { + let _ = tokens.next().expect("peek returned a token")?; + continue; + } + let key = key.to_unescaped()?; + if key == "__type" { + ::aws_smithy_json::deserialize::token::skip_value(tokens)?; + continue; + } + if variant.is_some() { + return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom( + "encountered mixed variants in union", + )); + } + variant = match key.as_ref() { + "s3ExportSpecification" => Some(crate::types::ExportSpecification::S3ExportSpecification( + crate::protocol_serde::shape_s3_export_specification::de_s3_export_specification(tokens)?.ok_or_else(|| { + ::aws_smithy_json::deserialize::error::DeserializeError::custom("value for 's3ExportSpecification' cannot be null") + })?, + )), + _ => { + ::aws_smithy_json::deserialize::token::skip_value(tokens)?; + Some(crate::types::ExportSpecification::Unknown) + } + }; + } + other => { + return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!( + "expected object key or end object, found: {:?}", + other + ))) + } + } + }, + _ => { + return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom( + "expected start object or null", + )) + } + } + if variant.is_none() { + return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom( + "Union did not contain a valid variant.", + )); + } + Ok(variant) +} + +pub fn ser_export_specification( + object_3: &mut ::aws_smithy_json::serialize::JsonObjectWriter, + input: &crate::types::ExportSpecification, +) -> Result<(), ::aws_smithy_types::error::operation::SerializationError> { + match input { + crate::types::ExportSpecification::S3ExportSpecification(inner) => { + #[allow(unused_mut)] + let mut object_1 = object_3.key("s3ExportSpecification").start_object(); + crate::protocol_serde::shape_s3_export_specification::ser_s3_export_specification(&mut object_1, inner)?; + object_1.finish(); + } + crate::types::ExportSpecification::Unknown => { + return Err(::aws_smithy_types::error::operation::SerializationError::unknown_variant( + "ExportSpecification", + )) + } + } + Ok(()) +} diff --git a/sdk/backupsearch/src/protocol_serde/shape_get_search_job.rs b/sdk/backupsearch/src/protocol_serde/shape_get_search_job.rs new file mode 100644 index 000000000000..d9c201eacb62 --- /dev/null +++ b/sdk/backupsearch/src/protocol_serde/shape_get_search_job.rs @@ -0,0 +1,216 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +#[allow(clippy::unnecessary_wraps)] +pub fn de_get_search_job_http_error( + _response_status: u16, + _response_headers: &::aws_smithy_runtime_api::http::Headers, + _response_body: &[u8], +) -> std::result::Result { + #[allow(unused_mut)] + let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(_response_status, _response_headers, _response_body) + .map_err(crate::operation::get_search_job::GetSearchJobError::unhandled)?; + generic_builder = ::aws_types::request_id::apply_request_id(generic_builder, _response_headers); + let generic = generic_builder.build(); + let error_code = match generic.code() { + Some(code) => code, + None => return Err(crate::operation::get_search_job::GetSearchJobError::unhandled(generic)), + }; + + let _error_message = generic.message().map(|msg| msg.to_owned()); + Err(match error_code { + "ResourceNotFoundException" => crate::operation::get_search_job::GetSearchJobError::ResourceNotFoundException({ + #[allow(unused_mut)] + let mut tmp = { + #[allow(unused_mut)] + let mut output = crate::types::error::builders::ResourceNotFoundExceptionBuilder::default(); + output = crate::protocol_serde::shape_resource_not_found_exception::de_resource_not_found_exception_json_err(_response_body, output) + .map_err(crate::operation::get_search_job::GetSearchJobError::unhandled)?; + let output = output.meta(generic); + crate::serde_util::resource_not_found_exception_correct_errors(output) + .build() + .map_err(crate::operation::get_search_job::GetSearchJobError::unhandled)? + }; + tmp + }), + "AccessDeniedException" => crate::operation::get_search_job::GetSearchJobError::AccessDeniedException({ + #[allow(unused_mut)] + let mut tmp = { + #[allow(unused_mut)] + let mut output = crate::types::error::builders::AccessDeniedExceptionBuilder::default(); + output = crate::protocol_serde::shape_access_denied_exception::de_access_denied_exception_json_err(_response_body, output) + .map_err(crate::operation::get_search_job::GetSearchJobError::unhandled)?; + let output = output.meta(generic); + crate::serde_util::access_denied_exception_correct_errors(output) + .build() + .map_err(crate::operation::get_search_job::GetSearchJobError::unhandled)? + }; + tmp + }), + "InternalServerException" => crate::operation::get_search_job::GetSearchJobError::InternalServerException({ + #[allow(unused_mut)] + let mut tmp = { + #[allow(unused_mut)] + let mut output = crate::types::error::builders::InternalServerExceptionBuilder::default(); + output = crate::protocol_serde::shape_internal_server_exception::de_internal_server_exception_json_err(_response_body, output) + .map_err(crate::operation::get_search_job::GetSearchJobError::unhandled)?; + output = output.set_retry_after_seconds( + crate::protocol_serde::shape_internal_server_exception::de_retry_after_seconds_header(_response_headers).map_err(|_| { + crate::operation::get_search_job::GetSearchJobError::unhandled("Failed to parse retryAfterSeconds from header `Retry-After") + })?, + ); + let output = output.meta(generic); + crate::serde_util::internal_server_exception_correct_errors(output) + .build() + .map_err(crate::operation::get_search_job::GetSearchJobError::unhandled)? + }; + tmp + }), + "ThrottlingException" => crate::operation::get_search_job::GetSearchJobError::ThrottlingException({ + #[allow(unused_mut)] + let mut tmp = { + #[allow(unused_mut)] + let mut output = crate::types::error::builders::ThrottlingExceptionBuilder::default(); + output = crate::protocol_serde::shape_throttling_exception::de_throttling_exception_json_err(_response_body, output) + .map_err(crate::operation::get_search_job::GetSearchJobError::unhandled)?; + output = output.set_retry_after_seconds( + crate::protocol_serde::shape_throttling_exception::de_retry_after_seconds_header(_response_headers).map_err(|_| { + crate::operation::get_search_job::GetSearchJobError::unhandled("Failed to parse retryAfterSeconds from header `Retry-After") + })?, + ); + let output = output.meta(generic); + crate::serde_util::throttling_exception_correct_errors(output) + .build() + .map_err(crate::operation::get_search_job::GetSearchJobError::unhandled)? + }; + tmp + }), + "ValidationException" => crate::operation::get_search_job::GetSearchJobError::ValidationException({ + #[allow(unused_mut)] + let mut tmp = { + #[allow(unused_mut)] + let mut output = crate::types::error::builders::ValidationExceptionBuilder::default(); + output = crate::protocol_serde::shape_validation_exception::de_validation_exception_json_err(_response_body, output) + .map_err(crate::operation::get_search_job::GetSearchJobError::unhandled)?; + let output = output.meta(generic); + crate::serde_util::validation_exception_correct_errors(output) + .build() + .map_err(crate::operation::get_search_job::GetSearchJobError::unhandled)? + }; + tmp + }), + _ => crate::operation::get_search_job::GetSearchJobError::generic(generic), + }) +} + +#[allow(clippy::unnecessary_wraps)] +pub fn de_get_search_job_http_response( + _response_status: u16, + _response_headers: &::aws_smithy_runtime_api::http::Headers, + _response_body: &[u8], +) -> std::result::Result { + Ok({ + #[allow(unused_mut)] + let mut output = crate::operation::get_search_job::builders::GetSearchJobOutputBuilder::default(); + output = crate::protocol_serde::shape_get_search_job::de_get_search_job(_response_body, output) + .map_err(crate::operation::get_search_job::GetSearchJobError::unhandled)?; + output._set_request_id(::aws_types::request_id::RequestId::request_id(_response_headers).map(str::to_string)); + crate::serde_util::get_search_job_output_output_correct_errors(output) + .build() + .map_err(crate::operation::get_search_job::GetSearchJobError::unhandled)? + }) +} + +pub(crate) fn de_get_search_job( + value: &[u8], + mut builder: crate::operation::get_search_job::builders::GetSearchJobOutputBuilder, +) -> Result { + let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(value)).peekable(); + let tokens = &mut tokens_owned; + ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; + loop { + match tokens.next().transpose()? { + Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break, + Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() { + "CompletionTime" => { + builder = builder.set_completion_time(::aws_smithy_json::deserialize::token::expect_timestamp_or_null( + tokens.next(), + ::aws_smithy_types::date_time::Format::EpochSeconds, + )?); + } + "CreationTime" => { + builder = builder.set_creation_time(::aws_smithy_json::deserialize::token::expect_timestamp_or_null( + tokens.next(), + ::aws_smithy_types::date_time::Format::EpochSeconds, + )?); + } + "CurrentSearchProgress" => { + builder = builder + .set_current_search_progress(crate::protocol_serde::shape_current_search_progress::de_current_search_progress(tokens)?); + } + "EncryptionKeyArn" => { + builder = builder.set_encryption_key_arn( + ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())? + .map(|s| s.to_unescaped().map(|u| u.into_owned())) + .transpose()?, + ); + } + "ItemFilters" => { + builder = builder.set_item_filters(crate::protocol_serde::shape_item_filters::de_item_filters(tokens)?); + } + "Name" => { + builder = builder.set_name( + ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())? + .map(|s| s.to_unescaped().map(|u| u.into_owned())) + .transpose()?, + ); + } + "SearchJobArn" => { + builder = builder.set_search_job_arn( + ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())? + .map(|s| s.to_unescaped().map(|u| u.into_owned())) + .transpose()?, + ); + } + "SearchJobIdentifier" => { + builder = builder.set_search_job_identifier( + ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())? + .map(|s| s.to_unescaped().map(|u| u.into_owned())) + .transpose()?, + ); + } + "SearchScope" => { + builder = builder.set_search_scope(crate::protocol_serde::shape_search_scope::de_search_scope(tokens)?); + } + "SearchScopeSummary" => { + builder = builder.set_search_scope_summary(crate::protocol_serde::shape_search_scope_summary::de_search_scope_summary(tokens)?); + } + "Status" => { + builder = builder.set_status( + ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())? + .map(|s| s.to_unescaped().map(|u| crate::types::SearchJobState::from(u.as_ref()))) + .transpose()?, + ); + } + "StatusMessage" => { + builder = builder.set_status_message( + ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())? + .map(|s| s.to_unescaped().map(|u| u.into_owned())) + .transpose()?, + ); + } + _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?, + }, + other => { + return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!( + "expected object key or end object, found: {:?}", + other + ))) + } + } + } + if tokens.next().is_some() { + return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom( + "found more JSON tokens after completing parsing", + )); + } + Ok(builder) +} diff --git a/sdk/backupsearch/src/protocol_serde/shape_get_search_result_export_job.rs b/sdk/backupsearch/src/protocol_serde/shape_get_search_result_export_job.rs new file mode 100644 index 000000000000..df66ca0928b4 --- /dev/null +++ b/sdk/backupsearch/src/protocol_serde/shape_get_search_result_export_job.rs @@ -0,0 +1,216 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +#[allow(clippy::unnecessary_wraps)] +pub fn de_get_search_result_export_job_http_error( + _response_status: u16, + _response_headers: &::aws_smithy_runtime_api::http::Headers, + _response_body: &[u8], +) -> std::result::Result< + crate::operation::get_search_result_export_job::GetSearchResultExportJobOutput, + crate::operation::get_search_result_export_job::GetSearchResultExportJobError, +> { + #[allow(unused_mut)] + let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(_response_status, _response_headers, _response_body) + .map_err(crate::operation::get_search_result_export_job::GetSearchResultExportJobError::unhandled)?; + generic_builder = ::aws_types::request_id::apply_request_id(generic_builder, _response_headers); + let generic = generic_builder.build(); + let error_code = match generic.code() { + Some(code) => code, + None => { + return Err(crate::operation::get_search_result_export_job::GetSearchResultExportJobError::unhandled( + generic, + )) + } + }; + + let _error_message = generic.message().map(|msg| msg.to_owned()); + Err(match error_code { + "ResourceNotFoundException" => crate::operation::get_search_result_export_job::GetSearchResultExportJobError::ResourceNotFoundException({ + #[allow(unused_mut)] + let mut tmp = { + #[allow(unused_mut)] + let mut output = crate::types::error::builders::ResourceNotFoundExceptionBuilder::default(); + output = crate::protocol_serde::shape_resource_not_found_exception::de_resource_not_found_exception_json_err(_response_body, output) + .map_err(crate::operation::get_search_result_export_job::GetSearchResultExportJobError::unhandled)?; + let output = output.meta(generic); + crate::serde_util::resource_not_found_exception_correct_errors(output) + .build() + .map_err(crate::operation::get_search_result_export_job::GetSearchResultExportJobError::unhandled)? + }; + tmp + }), + "AccessDeniedException" => crate::operation::get_search_result_export_job::GetSearchResultExportJobError::AccessDeniedException({ + #[allow(unused_mut)] + let mut tmp = { + #[allow(unused_mut)] + let mut output = crate::types::error::builders::AccessDeniedExceptionBuilder::default(); + output = crate::protocol_serde::shape_access_denied_exception::de_access_denied_exception_json_err(_response_body, output) + .map_err(crate::operation::get_search_result_export_job::GetSearchResultExportJobError::unhandled)?; + let output = output.meta(generic); + crate::serde_util::access_denied_exception_correct_errors(output) + .build() + .map_err(crate::operation::get_search_result_export_job::GetSearchResultExportJobError::unhandled)? + }; + tmp + }), + "InternalServerException" => crate::operation::get_search_result_export_job::GetSearchResultExportJobError::InternalServerException({ + #[allow(unused_mut)] + let mut tmp = { + #[allow(unused_mut)] + let mut output = crate::types::error::builders::InternalServerExceptionBuilder::default(); + output = crate::protocol_serde::shape_internal_server_exception::de_internal_server_exception_json_err(_response_body, output) + .map_err(crate::operation::get_search_result_export_job::GetSearchResultExportJobError::unhandled)?; + output = output.set_retry_after_seconds( + crate::protocol_serde::shape_internal_server_exception::de_retry_after_seconds_header(_response_headers).map_err(|_| { + crate::operation::get_search_result_export_job::GetSearchResultExportJobError::unhandled( + "Failed to parse retryAfterSeconds from header `Retry-After", + ) + })?, + ); + let output = output.meta(generic); + crate::serde_util::internal_server_exception_correct_errors(output) + .build() + .map_err(crate::operation::get_search_result_export_job::GetSearchResultExportJobError::unhandled)? + }; + tmp + }), + "ThrottlingException" => crate::operation::get_search_result_export_job::GetSearchResultExportJobError::ThrottlingException({ + #[allow(unused_mut)] + let mut tmp = { + #[allow(unused_mut)] + let mut output = crate::types::error::builders::ThrottlingExceptionBuilder::default(); + output = crate::protocol_serde::shape_throttling_exception::de_throttling_exception_json_err(_response_body, output) + .map_err(crate::operation::get_search_result_export_job::GetSearchResultExportJobError::unhandled)?; + output = output.set_retry_after_seconds( + crate::protocol_serde::shape_throttling_exception::de_retry_after_seconds_header(_response_headers).map_err(|_| { + crate::operation::get_search_result_export_job::GetSearchResultExportJobError::unhandled( + "Failed to parse retryAfterSeconds from header `Retry-After", + ) + })?, + ); + let output = output.meta(generic); + crate::serde_util::throttling_exception_correct_errors(output) + .build() + .map_err(crate::operation::get_search_result_export_job::GetSearchResultExportJobError::unhandled)? + }; + tmp + }), + "ValidationException" => crate::operation::get_search_result_export_job::GetSearchResultExportJobError::ValidationException({ + #[allow(unused_mut)] + let mut tmp = { + #[allow(unused_mut)] + let mut output = crate::types::error::builders::ValidationExceptionBuilder::default(); + output = crate::protocol_serde::shape_validation_exception::de_validation_exception_json_err(_response_body, output) + .map_err(crate::operation::get_search_result_export_job::GetSearchResultExportJobError::unhandled)?; + let output = output.meta(generic); + crate::serde_util::validation_exception_correct_errors(output) + .build() + .map_err(crate::operation::get_search_result_export_job::GetSearchResultExportJobError::unhandled)? + }; + tmp + }), + _ => crate::operation::get_search_result_export_job::GetSearchResultExportJobError::generic(generic), + }) +} + +#[allow(clippy::unnecessary_wraps)] +pub fn de_get_search_result_export_job_http_response( + _response_status: u16, + _response_headers: &::aws_smithy_runtime_api::http::Headers, + _response_body: &[u8], +) -> std::result::Result< + crate::operation::get_search_result_export_job::GetSearchResultExportJobOutput, + crate::operation::get_search_result_export_job::GetSearchResultExportJobError, +> { + Ok({ + #[allow(unused_mut)] + let mut output = crate::operation::get_search_result_export_job::builders::GetSearchResultExportJobOutputBuilder::default(); + output = crate::protocol_serde::shape_get_search_result_export_job::de_get_search_result_export_job(_response_body, output) + .map_err(crate::operation::get_search_result_export_job::GetSearchResultExportJobError::unhandled)?; + output._set_request_id(::aws_types::request_id::RequestId::request_id(_response_headers).map(str::to_string)); + crate::serde_util::get_search_result_export_job_output_output_correct_errors(output) + .build() + .map_err(crate::operation::get_search_result_export_job::GetSearchResultExportJobError::unhandled)? + }) +} + +pub(crate) fn de_get_search_result_export_job( + value: &[u8], + mut builder: crate::operation::get_search_result_export_job::builders::GetSearchResultExportJobOutputBuilder, +) -> Result< + crate::operation::get_search_result_export_job::builders::GetSearchResultExportJobOutputBuilder, + ::aws_smithy_json::deserialize::error::DeserializeError, +> { + let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(value)).peekable(); + let tokens = &mut tokens_owned; + ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; + loop { + match tokens.next().transpose()? { + Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break, + Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() { + "CompletionTime" => { + builder = builder.set_completion_time(::aws_smithy_json::deserialize::token::expect_timestamp_or_null( + tokens.next(), + ::aws_smithy_types::date_time::Format::EpochSeconds, + )?); + } + "CreationTime" => { + builder = builder.set_creation_time(::aws_smithy_json::deserialize::token::expect_timestamp_or_null( + tokens.next(), + ::aws_smithy_types::date_time::Format::EpochSeconds, + )?); + } + "ExportJobArn" => { + builder = builder.set_export_job_arn( + ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())? + .map(|s| s.to_unescaped().map(|u| u.into_owned())) + .transpose()?, + ); + } + "ExportJobIdentifier" => { + builder = builder.set_export_job_identifier( + ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())? + .map(|s| s.to_unescaped().map(|u| u.into_owned())) + .transpose()?, + ); + } + "ExportSpecification" => { + builder = builder.set_export_specification(crate::protocol_serde::shape_export_specification::de_export_specification(tokens)?); + } + "SearchJobArn" => { + builder = builder.set_search_job_arn( + ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())? + .map(|s| s.to_unescaped().map(|u| u.into_owned())) + .transpose()?, + ); + } + "Status" => { + builder = builder.set_status( + ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())? + .map(|s| s.to_unescaped().map(|u| crate::types::ExportJobStatus::from(u.as_ref()))) + .transpose()?, + ); + } + "StatusMessage" => { + builder = builder.set_status_message( + ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())? + .map(|s| s.to_unescaped().map(|u| u.into_owned())) + .transpose()?, + ); + } + _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?, + }, + other => { + return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!( + "expected object key or end object, found: {:?}", + other + ))) + } + } + } + if tokens.next().is_some() { + return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom( + "found more JSON tokens after completing parsing", + )); + } + Ok(builder) +} diff --git a/sdk/backupsearch/src/protocol_serde/shape_internal_server_exception.rs b/sdk/backupsearch/src/protocol_serde/shape_internal_server_exception.rs new file mode 100644 index 000000000000..e9703902f22c --- /dev/null +++ b/sdk/backupsearch/src/protocol_serde/shape_internal_server_exception.rs @@ -0,0 +1,59 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +pub(crate) fn de_internal_server_exception_json_err( + value: &[u8], + mut builder: crate::types::error::builders::InternalServerExceptionBuilder, +) -> Result { + let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(value)).peekable(); + let tokens = &mut tokens_owned; + ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; + loop { + match tokens.next().transpose()? { + Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break, + Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() { + "message" => { + builder = builder.set_message( + ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())? + .map(|s| s.to_unescaped().map(|u| u.into_owned())) + .transpose()?, + ); + } + "retryAfterSeconds" => { + builder = builder.set_retry_after_seconds( + ::aws_smithy_json::deserialize::token::expect_number_or_null(tokens.next())? + .map(i32::try_from) + .transpose()?, + ); + } + _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?, + }, + other => { + return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!( + "expected object key or end object, found: {:?}", + other + ))) + } + } + } + if tokens.next().is_some() { + return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom( + "found more JSON tokens after completing parsing", + )); + } + Ok(builder) +} + +pub(crate) fn de_retry_after_seconds_header( + header_map: &::aws_smithy_runtime_api::http::Headers, +) -> ::std::result::Result<::std::option::Option, ::aws_smithy_http::header::ParseError> { + let headers = header_map.get_all("Retry-After"); + let var_1 = ::aws_smithy_http::header::read_many_primitive::(headers)?; + if var_1.len() > 1 { + Err(::aws_smithy_http::header::ParseError::new(format!( + "expected one item but found {}", + var_1.len() + ))) + } else { + let mut var_1 = var_1; + Ok(var_1.pop()) + } +} diff --git a/sdk/backupsearch/src/protocol_serde/shape_item_filters.rs b/sdk/backupsearch/src/protocol_serde/shape_item_filters.rs new file mode 100644 index 000000000000..3549a4275c21 --- /dev/null +++ b/sdk/backupsearch/src/protocol_serde/shape_item_filters.rs @@ -0,0 +1,70 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +pub(crate) fn de_item_filters<'a, I>( + tokens: &mut ::std::iter::Peekable, +) -> Result, ::aws_smithy_json::deserialize::error::DeserializeError> +where + I: Iterator, ::aws_smithy_json::deserialize::error::DeserializeError>>, +{ + match tokens.next().transpose()? { + Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), + Some(::aws_smithy_json::deserialize::Token::StartObject { .. }) => { + #[allow(unused_mut)] + let mut builder = crate::types::builders::ItemFiltersBuilder::default(); + loop { + match tokens.next().transpose()? { + Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break, + Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() { + "S3ItemFilters" => { + builder = builder.set_s3_item_filters(crate::protocol_serde::shape_s3_item_filters::de_s3_item_filters(tokens)?); + } + "EBSItemFilters" => { + builder = builder.set_ebs_item_filters(crate::protocol_serde::shape_ebs_item_filters::de_ebs_item_filters(tokens)?); + } + _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?, + }, + other => { + return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!( + "expected object key or end object, found: {:?}", + other + ))) + } + } + } + Ok(Some(builder.build())) + } + _ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom( + "expected start object or null", + )), + } +} + +pub fn ser_item_filters( + object: &mut ::aws_smithy_json::serialize::JsonObjectWriter, + input: &crate::types::ItemFilters, +) -> Result<(), ::aws_smithy_types::error::operation::SerializationError> { + if let Some(var_1) = &input.s3_item_filters { + let mut array_2 = object.key("S3ItemFilters").start_array(); + for item_3 in var_1 { + { + #[allow(unused_mut)] + let mut object_4 = array_2.value().start_object(); + crate::protocol_serde::shape_s3_item_filter::ser_s3_item_filter(&mut object_4, item_3)?; + object_4.finish(); + } + } + array_2.finish(); + } + if let Some(var_5) = &input.ebs_item_filters { + let mut array_6 = object.key("EBSItemFilters").start_array(); + for item_7 in var_5 { + { + #[allow(unused_mut)] + let mut object_8 = array_6.value().start_object(); + crate::protocol_serde::shape_ebs_item_filter::ser_ebs_item_filter(&mut object_8, item_7)?; + object_8.finish(); + } + } + array_6.finish(); + } + Ok(()) +} diff --git a/sdk/backupsearch/src/protocol_serde/shape_list_search_job_backups.rs b/sdk/backupsearch/src/protocol_serde/shape_list_search_job_backups.rs new file mode 100644 index 000000000000..c6b7e65dad64 --- /dev/null +++ b/sdk/backupsearch/src/protocol_serde/shape_list_search_job_backups.rs @@ -0,0 +1,174 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +#[allow(clippy::unnecessary_wraps)] +pub fn de_list_search_job_backups_http_error( + _response_status: u16, + _response_headers: &::aws_smithy_runtime_api::http::Headers, + _response_body: &[u8], +) -> std::result::Result< + crate::operation::list_search_job_backups::ListSearchJobBackupsOutput, + crate::operation::list_search_job_backups::ListSearchJobBackupsError, +> { + #[allow(unused_mut)] + let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(_response_status, _response_headers, _response_body) + .map_err(crate::operation::list_search_job_backups::ListSearchJobBackupsError::unhandled)?; + generic_builder = ::aws_types::request_id::apply_request_id(generic_builder, _response_headers); + let generic = generic_builder.build(); + let error_code = match generic.code() { + Some(code) => code, + None => return Err(crate::operation::list_search_job_backups::ListSearchJobBackupsError::unhandled(generic)), + }; + + let _error_message = generic.message().map(|msg| msg.to_owned()); + Err(match error_code { + "ResourceNotFoundException" => crate::operation::list_search_job_backups::ListSearchJobBackupsError::ResourceNotFoundException({ + #[allow(unused_mut)] + let mut tmp = { + #[allow(unused_mut)] + let mut output = crate::types::error::builders::ResourceNotFoundExceptionBuilder::default(); + output = crate::protocol_serde::shape_resource_not_found_exception::de_resource_not_found_exception_json_err(_response_body, output) + .map_err(crate::operation::list_search_job_backups::ListSearchJobBackupsError::unhandled)?; + let output = output.meta(generic); + crate::serde_util::resource_not_found_exception_correct_errors(output) + .build() + .map_err(crate::operation::list_search_job_backups::ListSearchJobBackupsError::unhandled)? + }; + tmp + }), + "AccessDeniedException" => crate::operation::list_search_job_backups::ListSearchJobBackupsError::AccessDeniedException({ + #[allow(unused_mut)] + let mut tmp = { + #[allow(unused_mut)] + let mut output = crate::types::error::builders::AccessDeniedExceptionBuilder::default(); + output = crate::protocol_serde::shape_access_denied_exception::de_access_denied_exception_json_err(_response_body, output) + .map_err(crate::operation::list_search_job_backups::ListSearchJobBackupsError::unhandled)?; + let output = output.meta(generic); + crate::serde_util::access_denied_exception_correct_errors(output) + .build() + .map_err(crate::operation::list_search_job_backups::ListSearchJobBackupsError::unhandled)? + }; + tmp + }), + "InternalServerException" => crate::operation::list_search_job_backups::ListSearchJobBackupsError::InternalServerException({ + #[allow(unused_mut)] + let mut tmp = { + #[allow(unused_mut)] + let mut output = crate::types::error::builders::InternalServerExceptionBuilder::default(); + output = crate::protocol_serde::shape_internal_server_exception::de_internal_server_exception_json_err(_response_body, output) + .map_err(crate::operation::list_search_job_backups::ListSearchJobBackupsError::unhandled)?; + output = output.set_retry_after_seconds( + crate::protocol_serde::shape_internal_server_exception::de_retry_after_seconds_header(_response_headers).map_err(|_| { + crate::operation::list_search_job_backups::ListSearchJobBackupsError::unhandled( + "Failed to parse retryAfterSeconds from header `Retry-After", + ) + })?, + ); + let output = output.meta(generic); + crate::serde_util::internal_server_exception_correct_errors(output) + .build() + .map_err(crate::operation::list_search_job_backups::ListSearchJobBackupsError::unhandled)? + }; + tmp + }), + "ThrottlingException" => crate::operation::list_search_job_backups::ListSearchJobBackupsError::ThrottlingException({ + #[allow(unused_mut)] + let mut tmp = { + #[allow(unused_mut)] + let mut output = crate::types::error::builders::ThrottlingExceptionBuilder::default(); + output = crate::protocol_serde::shape_throttling_exception::de_throttling_exception_json_err(_response_body, output) + .map_err(crate::operation::list_search_job_backups::ListSearchJobBackupsError::unhandled)?; + output = output.set_retry_after_seconds( + crate::protocol_serde::shape_throttling_exception::de_retry_after_seconds_header(_response_headers).map_err(|_| { + crate::operation::list_search_job_backups::ListSearchJobBackupsError::unhandled( + "Failed to parse retryAfterSeconds from header `Retry-After", + ) + })?, + ); + let output = output.meta(generic); + crate::serde_util::throttling_exception_correct_errors(output) + .build() + .map_err(crate::operation::list_search_job_backups::ListSearchJobBackupsError::unhandled)? + }; + tmp + }), + "ValidationException" => crate::operation::list_search_job_backups::ListSearchJobBackupsError::ValidationException({ + #[allow(unused_mut)] + let mut tmp = { + #[allow(unused_mut)] + let mut output = crate::types::error::builders::ValidationExceptionBuilder::default(); + output = crate::protocol_serde::shape_validation_exception::de_validation_exception_json_err(_response_body, output) + .map_err(crate::operation::list_search_job_backups::ListSearchJobBackupsError::unhandled)?; + let output = output.meta(generic); + crate::serde_util::validation_exception_correct_errors(output) + .build() + .map_err(crate::operation::list_search_job_backups::ListSearchJobBackupsError::unhandled)? + }; + tmp + }), + _ => crate::operation::list_search_job_backups::ListSearchJobBackupsError::generic(generic), + }) +} + +#[allow(clippy::unnecessary_wraps)] +pub fn de_list_search_job_backups_http_response( + _response_status: u16, + _response_headers: &::aws_smithy_runtime_api::http::Headers, + _response_body: &[u8], +) -> std::result::Result< + crate::operation::list_search_job_backups::ListSearchJobBackupsOutput, + crate::operation::list_search_job_backups::ListSearchJobBackupsError, +> { + Ok({ + #[allow(unused_mut)] + let mut output = crate::operation::list_search_job_backups::builders::ListSearchJobBackupsOutputBuilder::default(); + output = crate::protocol_serde::shape_list_search_job_backups::de_list_search_job_backups(_response_body, output) + .map_err(crate::operation::list_search_job_backups::ListSearchJobBackupsError::unhandled)?; + output._set_request_id(::aws_types::request_id::RequestId::request_id(_response_headers).map(str::to_string)); + crate::serde_util::list_search_job_backups_output_output_correct_errors(output) + .build() + .map_err(crate::operation::list_search_job_backups::ListSearchJobBackupsError::unhandled)? + }) +} + +pub(crate) fn de_list_search_job_backups( + value: &[u8], + mut builder: crate::operation::list_search_job_backups::builders::ListSearchJobBackupsOutputBuilder, +) -> Result< + crate::operation::list_search_job_backups::builders::ListSearchJobBackupsOutputBuilder, + ::aws_smithy_json::deserialize::error::DeserializeError, +> { + let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(value)).peekable(); + let tokens = &mut tokens_owned; + ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; + loop { + match tokens.next().transpose()? { + Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break, + Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() { + "NextToken" => { + builder = builder.set_next_token( + ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())? + .map(|s| s.to_unescaped().map(|u| u.into_owned())) + .transpose()?, + ); + } + "Results" => { + builder = builder.set_results(crate::protocol_serde::shape_search_job_backups_results::de_search_job_backups_results( + tokens, + )?); + } + _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?, + }, + other => { + return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!( + "expected object key or end object, found: {:?}", + other + ))) + } + } + } + if tokens.next().is_some() { + return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom( + "found more JSON tokens after completing parsing", + )); + } + Ok(builder) +} diff --git a/sdk/backupsearch/src/protocol_serde/shape_list_search_job_results.rs b/sdk/backupsearch/src/protocol_serde/shape_list_search_job_results.rs new file mode 100644 index 000000000000..235d10c419e1 --- /dev/null +++ b/sdk/backupsearch/src/protocol_serde/shape_list_search_job_results.rs @@ -0,0 +1,172 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +#[allow(clippy::unnecessary_wraps)] +pub fn de_list_search_job_results_http_error( + _response_status: u16, + _response_headers: &::aws_smithy_runtime_api::http::Headers, + _response_body: &[u8], +) -> std::result::Result< + crate::operation::list_search_job_results::ListSearchJobResultsOutput, + crate::operation::list_search_job_results::ListSearchJobResultsError, +> { + #[allow(unused_mut)] + let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(_response_status, _response_headers, _response_body) + .map_err(crate::operation::list_search_job_results::ListSearchJobResultsError::unhandled)?; + generic_builder = ::aws_types::request_id::apply_request_id(generic_builder, _response_headers); + let generic = generic_builder.build(); + let error_code = match generic.code() { + Some(code) => code, + None => return Err(crate::operation::list_search_job_results::ListSearchJobResultsError::unhandled(generic)), + }; + + let _error_message = generic.message().map(|msg| msg.to_owned()); + Err(match error_code { + "ResourceNotFoundException" => crate::operation::list_search_job_results::ListSearchJobResultsError::ResourceNotFoundException({ + #[allow(unused_mut)] + let mut tmp = { + #[allow(unused_mut)] + let mut output = crate::types::error::builders::ResourceNotFoundExceptionBuilder::default(); + output = crate::protocol_serde::shape_resource_not_found_exception::de_resource_not_found_exception_json_err(_response_body, output) + .map_err(crate::operation::list_search_job_results::ListSearchJobResultsError::unhandled)?; + let output = output.meta(generic); + crate::serde_util::resource_not_found_exception_correct_errors(output) + .build() + .map_err(crate::operation::list_search_job_results::ListSearchJobResultsError::unhandled)? + }; + tmp + }), + "AccessDeniedException" => crate::operation::list_search_job_results::ListSearchJobResultsError::AccessDeniedException({ + #[allow(unused_mut)] + let mut tmp = { + #[allow(unused_mut)] + let mut output = crate::types::error::builders::AccessDeniedExceptionBuilder::default(); + output = crate::protocol_serde::shape_access_denied_exception::de_access_denied_exception_json_err(_response_body, output) + .map_err(crate::operation::list_search_job_results::ListSearchJobResultsError::unhandled)?; + let output = output.meta(generic); + crate::serde_util::access_denied_exception_correct_errors(output) + .build() + .map_err(crate::operation::list_search_job_results::ListSearchJobResultsError::unhandled)? + }; + tmp + }), + "InternalServerException" => crate::operation::list_search_job_results::ListSearchJobResultsError::InternalServerException({ + #[allow(unused_mut)] + let mut tmp = { + #[allow(unused_mut)] + let mut output = crate::types::error::builders::InternalServerExceptionBuilder::default(); + output = crate::protocol_serde::shape_internal_server_exception::de_internal_server_exception_json_err(_response_body, output) + .map_err(crate::operation::list_search_job_results::ListSearchJobResultsError::unhandled)?; + output = output.set_retry_after_seconds( + crate::protocol_serde::shape_internal_server_exception::de_retry_after_seconds_header(_response_headers).map_err(|_| { + crate::operation::list_search_job_results::ListSearchJobResultsError::unhandled( + "Failed to parse retryAfterSeconds from header `Retry-After", + ) + })?, + ); + let output = output.meta(generic); + crate::serde_util::internal_server_exception_correct_errors(output) + .build() + .map_err(crate::operation::list_search_job_results::ListSearchJobResultsError::unhandled)? + }; + tmp + }), + "ThrottlingException" => crate::operation::list_search_job_results::ListSearchJobResultsError::ThrottlingException({ + #[allow(unused_mut)] + let mut tmp = { + #[allow(unused_mut)] + let mut output = crate::types::error::builders::ThrottlingExceptionBuilder::default(); + output = crate::protocol_serde::shape_throttling_exception::de_throttling_exception_json_err(_response_body, output) + .map_err(crate::operation::list_search_job_results::ListSearchJobResultsError::unhandled)?; + output = output.set_retry_after_seconds( + crate::protocol_serde::shape_throttling_exception::de_retry_after_seconds_header(_response_headers).map_err(|_| { + crate::operation::list_search_job_results::ListSearchJobResultsError::unhandled( + "Failed to parse retryAfterSeconds from header `Retry-After", + ) + })?, + ); + let output = output.meta(generic); + crate::serde_util::throttling_exception_correct_errors(output) + .build() + .map_err(crate::operation::list_search_job_results::ListSearchJobResultsError::unhandled)? + }; + tmp + }), + "ValidationException" => crate::operation::list_search_job_results::ListSearchJobResultsError::ValidationException({ + #[allow(unused_mut)] + let mut tmp = { + #[allow(unused_mut)] + let mut output = crate::types::error::builders::ValidationExceptionBuilder::default(); + output = crate::protocol_serde::shape_validation_exception::de_validation_exception_json_err(_response_body, output) + .map_err(crate::operation::list_search_job_results::ListSearchJobResultsError::unhandled)?; + let output = output.meta(generic); + crate::serde_util::validation_exception_correct_errors(output) + .build() + .map_err(crate::operation::list_search_job_results::ListSearchJobResultsError::unhandled)? + }; + tmp + }), + _ => crate::operation::list_search_job_results::ListSearchJobResultsError::generic(generic), + }) +} + +#[allow(clippy::unnecessary_wraps)] +pub fn de_list_search_job_results_http_response( + _response_status: u16, + _response_headers: &::aws_smithy_runtime_api::http::Headers, + _response_body: &[u8], +) -> std::result::Result< + crate::operation::list_search_job_results::ListSearchJobResultsOutput, + crate::operation::list_search_job_results::ListSearchJobResultsError, +> { + Ok({ + #[allow(unused_mut)] + let mut output = crate::operation::list_search_job_results::builders::ListSearchJobResultsOutputBuilder::default(); + output = crate::protocol_serde::shape_list_search_job_results::de_list_search_job_results(_response_body, output) + .map_err(crate::operation::list_search_job_results::ListSearchJobResultsError::unhandled)?; + output._set_request_id(::aws_types::request_id::RequestId::request_id(_response_headers).map(str::to_string)); + crate::serde_util::list_search_job_results_output_output_correct_errors(output) + .build() + .map_err(crate::operation::list_search_job_results::ListSearchJobResultsError::unhandled)? + }) +} + +pub(crate) fn de_list_search_job_results( + value: &[u8], + mut builder: crate::operation::list_search_job_results::builders::ListSearchJobResultsOutputBuilder, +) -> Result< + crate::operation::list_search_job_results::builders::ListSearchJobResultsOutputBuilder, + ::aws_smithy_json::deserialize::error::DeserializeError, +> { + let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(value)).peekable(); + let tokens = &mut tokens_owned; + ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; + loop { + match tokens.next().transpose()? { + Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break, + Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() { + "NextToken" => { + builder = builder.set_next_token( + ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())? + .map(|s| s.to_unescaped().map(|u| u.into_owned())) + .transpose()?, + ); + } + "Results" => { + builder = builder.set_results(crate::protocol_serde::shape_results::de_results(tokens)?); + } + _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?, + }, + other => { + return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!( + "expected object key or end object, found: {:?}", + other + ))) + } + } + } + if tokens.next().is_some() { + return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom( + "found more JSON tokens after completing parsing", + )); + } + Ok(builder) +} diff --git a/sdk/backupsearch/src/protocol_serde/shape_list_search_jobs.rs b/sdk/backupsearch/src/protocol_serde/shape_list_search_jobs.rs new file mode 100644 index 000000000000..5697861e0481 --- /dev/null +++ b/sdk/backupsearch/src/protocol_serde/shape_list_search_jobs.rs @@ -0,0 +1,149 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +#[allow(clippy::unnecessary_wraps)] +pub fn de_list_search_jobs_http_error( + _response_status: u16, + _response_headers: &::aws_smithy_runtime_api::http::Headers, + _response_body: &[u8], +) -> std::result::Result { + #[allow(unused_mut)] + let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(_response_status, _response_headers, _response_body) + .map_err(crate::operation::list_search_jobs::ListSearchJobsError::unhandled)?; + generic_builder = ::aws_types::request_id::apply_request_id(generic_builder, _response_headers); + let generic = generic_builder.build(); + let error_code = match generic.code() { + Some(code) => code, + None => return Err(crate::operation::list_search_jobs::ListSearchJobsError::unhandled(generic)), + }; + + let _error_message = generic.message().map(|msg| msg.to_owned()); + Err(match error_code { + "AccessDeniedException" => crate::operation::list_search_jobs::ListSearchJobsError::AccessDeniedException({ + #[allow(unused_mut)] + let mut tmp = { + #[allow(unused_mut)] + let mut output = crate::types::error::builders::AccessDeniedExceptionBuilder::default(); + output = crate::protocol_serde::shape_access_denied_exception::de_access_denied_exception_json_err(_response_body, output) + .map_err(crate::operation::list_search_jobs::ListSearchJobsError::unhandled)?; + let output = output.meta(generic); + crate::serde_util::access_denied_exception_correct_errors(output) + .build() + .map_err(crate::operation::list_search_jobs::ListSearchJobsError::unhandled)? + }; + tmp + }), + "InternalServerException" => crate::operation::list_search_jobs::ListSearchJobsError::InternalServerException({ + #[allow(unused_mut)] + let mut tmp = { + #[allow(unused_mut)] + let mut output = crate::types::error::builders::InternalServerExceptionBuilder::default(); + output = crate::protocol_serde::shape_internal_server_exception::de_internal_server_exception_json_err(_response_body, output) + .map_err(crate::operation::list_search_jobs::ListSearchJobsError::unhandled)?; + output = output.set_retry_after_seconds( + crate::protocol_serde::shape_internal_server_exception::de_retry_after_seconds_header(_response_headers).map_err(|_| { + crate::operation::list_search_jobs::ListSearchJobsError::unhandled( + "Failed to parse retryAfterSeconds from header `Retry-After", + ) + })?, + ); + let output = output.meta(generic); + crate::serde_util::internal_server_exception_correct_errors(output) + .build() + .map_err(crate::operation::list_search_jobs::ListSearchJobsError::unhandled)? + }; + tmp + }), + "ThrottlingException" => crate::operation::list_search_jobs::ListSearchJobsError::ThrottlingException({ + #[allow(unused_mut)] + let mut tmp = { + #[allow(unused_mut)] + let mut output = crate::types::error::builders::ThrottlingExceptionBuilder::default(); + output = crate::protocol_serde::shape_throttling_exception::de_throttling_exception_json_err(_response_body, output) + .map_err(crate::operation::list_search_jobs::ListSearchJobsError::unhandled)?; + output = output.set_retry_after_seconds( + crate::protocol_serde::shape_throttling_exception::de_retry_after_seconds_header(_response_headers).map_err(|_| { + crate::operation::list_search_jobs::ListSearchJobsError::unhandled( + "Failed to parse retryAfterSeconds from header `Retry-After", + ) + })?, + ); + let output = output.meta(generic); + crate::serde_util::throttling_exception_correct_errors(output) + .build() + .map_err(crate::operation::list_search_jobs::ListSearchJobsError::unhandled)? + }; + tmp + }), + "ValidationException" => crate::operation::list_search_jobs::ListSearchJobsError::ValidationException({ + #[allow(unused_mut)] + let mut tmp = { + #[allow(unused_mut)] + let mut output = crate::types::error::builders::ValidationExceptionBuilder::default(); + output = crate::protocol_serde::shape_validation_exception::de_validation_exception_json_err(_response_body, output) + .map_err(crate::operation::list_search_jobs::ListSearchJobsError::unhandled)?; + let output = output.meta(generic); + crate::serde_util::validation_exception_correct_errors(output) + .build() + .map_err(crate::operation::list_search_jobs::ListSearchJobsError::unhandled)? + }; + tmp + }), + _ => crate::operation::list_search_jobs::ListSearchJobsError::generic(generic), + }) +} + +#[allow(clippy::unnecessary_wraps)] +pub fn de_list_search_jobs_http_response( + _response_status: u16, + _response_headers: &::aws_smithy_runtime_api::http::Headers, + _response_body: &[u8], +) -> std::result::Result { + Ok({ + #[allow(unused_mut)] + let mut output = crate::operation::list_search_jobs::builders::ListSearchJobsOutputBuilder::default(); + output = crate::protocol_serde::shape_list_search_jobs::de_list_search_jobs(_response_body, output) + .map_err(crate::operation::list_search_jobs::ListSearchJobsError::unhandled)?; + output._set_request_id(::aws_types::request_id::RequestId::request_id(_response_headers).map(str::to_string)); + crate::serde_util::list_search_jobs_output_output_correct_errors(output) + .build() + .map_err(crate::operation::list_search_jobs::ListSearchJobsError::unhandled)? + }) +} + +pub(crate) fn de_list_search_jobs( + value: &[u8], + mut builder: crate::operation::list_search_jobs::builders::ListSearchJobsOutputBuilder, +) -> Result { + let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(value)).peekable(); + let tokens = &mut tokens_owned; + ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; + loop { + match tokens.next().transpose()? { + Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break, + Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() { + "NextToken" => { + builder = builder.set_next_token( + ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())? + .map(|s| s.to_unescaped().map(|u| u.into_owned())) + .transpose()?, + ); + } + "SearchJobs" => { + builder = builder.set_search_jobs(crate::protocol_serde::shape_search_jobs::de_search_jobs(tokens)?); + } + _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?, + }, + other => { + return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!( + "expected object key or end object, found: {:?}", + other + ))) + } + } + } + if tokens.next().is_some() { + return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom( + "found more JSON tokens after completing parsing", + )); + } + Ok(builder) +} diff --git a/sdk/backupsearch/src/protocol_serde/shape_list_search_result_export_jobs.rs b/sdk/backupsearch/src/protocol_serde/shape_list_search_result_export_jobs.rs new file mode 100644 index 000000000000..d9f2fddf847a --- /dev/null +++ b/sdk/backupsearch/src/protocol_serde/shape_list_search_result_export_jobs.rs @@ -0,0 +1,194 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +#[allow(clippy::unnecessary_wraps)] +pub fn de_list_search_result_export_jobs_http_error( + _response_status: u16, + _response_headers: &::aws_smithy_runtime_api::http::Headers, + _response_body: &[u8], +) -> std::result::Result< + crate::operation::list_search_result_export_jobs::ListSearchResultExportJobsOutput, + crate::operation::list_search_result_export_jobs::ListSearchResultExportJobsError, +> { + #[allow(unused_mut)] + let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(_response_status, _response_headers, _response_body) + .map_err(crate::operation::list_search_result_export_jobs::ListSearchResultExportJobsError::unhandled)?; + generic_builder = ::aws_types::request_id::apply_request_id(generic_builder, _response_headers); + let generic = generic_builder.build(); + let error_code = match generic.code() { + Some(code) => code, + None => return Err(crate::operation::list_search_result_export_jobs::ListSearchResultExportJobsError::unhandled(generic)), + }; + + let _error_message = generic.message().map(|msg| msg.to_owned()); + Err(match error_code { + "ResourceNotFoundException" => { + crate::operation::list_search_result_export_jobs::ListSearchResultExportJobsError::ResourceNotFoundException({ + #[allow(unused_mut)] + let mut tmp = { + #[allow(unused_mut)] + let mut output = crate::types::error::builders::ResourceNotFoundExceptionBuilder::default(); + output = + crate::protocol_serde::shape_resource_not_found_exception::de_resource_not_found_exception_json_err(_response_body, output) + .map_err(crate::operation::list_search_result_export_jobs::ListSearchResultExportJobsError::unhandled)?; + let output = output.meta(generic); + crate::serde_util::resource_not_found_exception_correct_errors(output) + .build() + .map_err(crate::operation::list_search_result_export_jobs::ListSearchResultExportJobsError::unhandled)? + }; + tmp + }) + } + "ServiceQuotaExceededException" => { + crate::operation::list_search_result_export_jobs::ListSearchResultExportJobsError::ServiceQuotaExceededException({ + #[allow(unused_mut)] + let mut tmp = { + #[allow(unused_mut)] + let mut output = crate::types::error::builders::ServiceQuotaExceededExceptionBuilder::default(); + output = crate::protocol_serde::shape_service_quota_exceeded_exception::de_service_quota_exceeded_exception_json_err( + _response_body, + output, + ) + .map_err(crate::operation::list_search_result_export_jobs::ListSearchResultExportJobsError::unhandled)?; + let output = output.meta(generic); + crate::serde_util::service_quota_exceeded_exception_correct_errors(output) + .build() + .map_err(crate::operation::list_search_result_export_jobs::ListSearchResultExportJobsError::unhandled)? + }; + tmp + }) + } + "AccessDeniedException" => crate::operation::list_search_result_export_jobs::ListSearchResultExportJobsError::AccessDeniedException({ + #[allow(unused_mut)] + let mut tmp = { + #[allow(unused_mut)] + let mut output = crate::types::error::builders::AccessDeniedExceptionBuilder::default(); + output = crate::protocol_serde::shape_access_denied_exception::de_access_denied_exception_json_err(_response_body, output) + .map_err(crate::operation::list_search_result_export_jobs::ListSearchResultExportJobsError::unhandled)?; + let output = output.meta(generic); + crate::serde_util::access_denied_exception_correct_errors(output) + .build() + .map_err(crate::operation::list_search_result_export_jobs::ListSearchResultExportJobsError::unhandled)? + }; + tmp + }), + "InternalServerException" => crate::operation::list_search_result_export_jobs::ListSearchResultExportJobsError::InternalServerException({ + #[allow(unused_mut)] + let mut tmp = { + #[allow(unused_mut)] + let mut output = crate::types::error::builders::InternalServerExceptionBuilder::default(); + output = crate::protocol_serde::shape_internal_server_exception::de_internal_server_exception_json_err(_response_body, output) + .map_err(crate::operation::list_search_result_export_jobs::ListSearchResultExportJobsError::unhandled)?; + output = output.set_retry_after_seconds( + crate::protocol_serde::shape_internal_server_exception::de_retry_after_seconds_header(_response_headers).map_err(|_| { + crate::operation::list_search_result_export_jobs::ListSearchResultExportJobsError::unhandled( + "Failed to parse retryAfterSeconds from header `Retry-After", + ) + })?, + ); + let output = output.meta(generic); + crate::serde_util::internal_server_exception_correct_errors(output) + .build() + .map_err(crate::operation::list_search_result_export_jobs::ListSearchResultExportJobsError::unhandled)? + }; + tmp + }), + "ThrottlingException" => crate::operation::list_search_result_export_jobs::ListSearchResultExportJobsError::ThrottlingException({ + #[allow(unused_mut)] + let mut tmp = { + #[allow(unused_mut)] + let mut output = crate::types::error::builders::ThrottlingExceptionBuilder::default(); + output = crate::protocol_serde::shape_throttling_exception::de_throttling_exception_json_err(_response_body, output) + .map_err(crate::operation::list_search_result_export_jobs::ListSearchResultExportJobsError::unhandled)?; + output = output.set_retry_after_seconds( + crate::protocol_serde::shape_throttling_exception::de_retry_after_seconds_header(_response_headers).map_err(|_| { + crate::operation::list_search_result_export_jobs::ListSearchResultExportJobsError::unhandled( + "Failed to parse retryAfterSeconds from header `Retry-After", + ) + })?, + ); + let output = output.meta(generic); + crate::serde_util::throttling_exception_correct_errors(output) + .build() + .map_err(crate::operation::list_search_result_export_jobs::ListSearchResultExportJobsError::unhandled)? + }; + tmp + }), + "ValidationException" => crate::operation::list_search_result_export_jobs::ListSearchResultExportJobsError::ValidationException({ + #[allow(unused_mut)] + let mut tmp = { + #[allow(unused_mut)] + let mut output = crate::types::error::builders::ValidationExceptionBuilder::default(); + output = crate::protocol_serde::shape_validation_exception::de_validation_exception_json_err(_response_body, output) + .map_err(crate::operation::list_search_result_export_jobs::ListSearchResultExportJobsError::unhandled)?; + let output = output.meta(generic); + crate::serde_util::validation_exception_correct_errors(output) + .build() + .map_err(crate::operation::list_search_result_export_jobs::ListSearchResultExportJobsError::unhandled)? + }; + tmp + }), + _ => crate::operation::list_search_result_export_jobs::ListSearchResultExportJobsError::generic(generic), + }) +} + +#[allow(clippy::unnecessary_wraps)] +pub fn de_list_search_result_export_jobs_http_response( + _response_status: u16, + _response_headers: &::aws_smithy_runtime_api::http::Headers, + _response_body: &[u8], +) -> std::result::Result< + crate::operation::list_search_result_export_jobs::ListSearchResultExportJobsOutput, + crate::operation::list_search_result_export_jobs::ListSearchResultExportJobsError, +> { + Ok({ + #[allow(unused_mut)] + let mut output = crate::operation::list_search_result_export_jobs::builders::ListSearchResultExportJobsOutputBuilder::default(); + output = crate::protocol_serde::shape_list_search_result_export_jobs::de_list_search_result_export_jobs(_response_body, output) + .map_err(crate::operation::list_search_result_export_jobs::ListSearchResultExportJobsError::unhandled)?; + output._set_request_id(::aws_types::request_id::RequestId::request_id(_response_headers).map(str::to_string)); + crate::serde_util::list_search_result_export_jobs_output_output_correct_errors(output) + .build() + .map_err(crate::operation::list_search_result_export_jobs::ListSearchResultExportJobsError::unhandled)? + }) +} + +pub(crate) fn de_list_search_result_export_jobs( + value: &[u8], + mut builder: crate::operation::list_search_result_export_jobs::builders::ListSearchResultExportJobsOutputBuilder, +) -> Result< + crate::operation::list_search_result_export_jobs::builders::ListSearchResultExportJobsOutputBuilder, + ::aws_smithy_json::deserialize::error::DeserializeError, +> { + let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(value)).peekable(); + let tokens = &mut tokens_owned; + ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; + loop { + match tokens.next().transpose()? { + Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break, + Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() { + "ExportJobs" => { + builder = builder.set_export_jobs(crate::protocol_serde::shape_export_job_summaries::de_export_job_summaries(tokens)?); + } + "NextToken" => { + builder = builder.set_next_token( + ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())? + .map(|s| s.to_unescaped().map(|u| u.into_owned())) + .transpose()?, + ); + } + _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?, + }, + other => { + return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!( + "expected object key or end object, found: {:?}", + other + ))) + } + } + } + if tokens.next().is_some() { + return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom( + "found more JSON tokens after completing parsing", + )); + } + Ok(builder) +} diff --git a/sdk/backupsearch/src/protocol_serde/shape_list_tags_for_resource.rs b/sdk/backupsearch/src/protocol_serde/shape_list_tags_for_resource.rs new file mode 100644 index 000000000000..9855ed56a06d --- /dev/null +++ b/sdk/backupsearch/src/protocol_serde/shape_list_tags_for_resource.rs @@ -0,0 +1,163 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +#[allow(clippy::unnecessary_wraps)] +pub fn de_list_tags_for_resource_http_error( + _response_status: u16, + _response_headers: &::aws_smithy_runtime_api::http::Headers, + _response_body: &[u8], +) -> std::result::Result< + crate::operation::list_tags_for_resource::ListTagsForResourceOutput, + crate::operation::list_tags_for_resource::ListTagsForResourceError, +> { + #[allow(unused_mut)] + let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(_response_status, _response_headers, _response_body) + .map_err(crate::operation::list_tags_for_resource::ListTagsForResourceError::unhandled)?; + generic_builder = ::aws_types::request_id::apply_request_id(generic_builder, _response_headers); + let generic = generic_builder.build(); + let error_code = match generic.code() { + Some(code) => code, + None => return Err(crate::operation::list_tags_for_resource::ListTagsForResourceError::unhandled(generic)), + }; + + let _error_message = generic.message().map(|msg| msg.to_owned()); + Err(match error_code { + "ResourceNotFoundException" => crate::operation::list_tags_for_resource::ListTagsForResourceError::ResourceNotFoundException({ + #[allow(unused_mut)] + let mut tmp = { + #[allow(unused_mut)] + let mut output = crate::types::error::builders::ResourceNotFoundExceptionBuilder::default(); + output = crate::protocol_serde::shape_resource_not_found_exception::de_resource_not_found_exception_json_err(_response_body, output) + .map_err(crate::operation::list_tags_for_resource::ListTagsForResourceError::unhandled)?; + let output = output.meta(generic); + crate::serde_util::resource_not_found_exception_correct_errors(output) + .build() + .map_err(crate::operation::list_tags_for_resource::ListTagsForResourceError::unhandled)? + }; + tmp + }), + "AccessDeniedException" => crate::operation::list_tags_for_resource::ListTagsForResourceError::AccessDeniedException({ + #[allow(unused_mut)] + let mut tmp = { + #[allow(unused_mut)] + let mut output = crate::types::error::builders::AccessDeniedExceptionBuilder::default(); + output = crate::protocol_serde::shape_access_denied_exception::de_access_denied_exception_json_err(_response_body, output) + .map_err(crate::operation::list_tags_for_resource::ListTagsForResourceError::unhandled)?; + let output = output.meta(generic); + crate::serde_util::access_denied_exception_correct_errors(output) + .build() + .map_err(crate::operation::list_tags_for_resource::ListTagsForResourceError::unhandled)? + }; + tmp + }), + "InternalServerException" => crate::operation::list_tags_for_resource::ListTagsForResourceError::InternalServerException({ + #[allow(unused_mut)] + let mut tmp = { + #[allow(unused_mut)] + let mut output = crate::types::error::builders::InternalServerExceptionBuilder::default(); + output = crate::protocol_serde::shape_internal_server_exception::de_internal_server_exception_json_err(_response_body, output) + .map_err(crate::operation::list_tags_for_resource::ListTagsForResourceError::unhandled)?; + output = output.set_retry_after_seconds( + crate::protocol_serde::shape_internal_server_exception::de_retry_after_seconds_header(_response_headers).map_err(|_| { + crate::operation::list_tags_for_resource::ListTagsForResourceError::unhandled( + "Failed to parse retryAfterSeconds from header `Retry-After", + ) + })?, + ); + let output = output.meta(generic); + crate::serde_util::internal_server_exception_correct_errors(output) + .build() + .map_err(crate::operation::list_tags_for_resource::ListTagsForResourceError::unhandled)? + }; + tmp + }), + "ThrottlingException" => crate::operation::list_tags_for_resource::ListTagsForResourceError::ThrottlingException({ + #[allow(unused_mut)] + let mut tmp = { + #[allow(unused_mut)] + let mut output = crate::types::error::builders::ThrottlingExceptionBuilder::default(); + output = crate::protocol_serde::shape_throttling_exception::de_throttling_exception_json_err(_response_body, output) + .map_err(crate::operation::list_tags_for_resource::ListTagsForResourceError::unhandled)?; + output = output.set_retry_after_seconds( + crate::protocol_serde::shape_throttling_exception::de_retry_after_seconds_header(_response_headers).map_err(|_| { + crate::operation::list_tags_for_resource::ListTagsForResourceError::unhandled( + "Failed to parse retryAfterSeconds from header `Retry-After", + ) + })?, + ); + let output = output.meta(generic); + crate::serde_util::throttling_exception_correct_errors(output) + .build() + .map_err(crate::operation::list_tags_for_resource::ListTagsForResourceError::unhandled)? + }; + tmp + }), + "ValidationException" => crate::operation::list_tags_for_resource::ListTagsForResourceError::ValidationException({ + #[allow(unused_mut)] + let mut tmp = { + #[allow(unused_mut)] + let mut output = crate::types::error::builders::ValidationExceptionBuilder::default(); + output = crate::protocol_serde::shape_validation_exception::de_validation_exception_json_err(_response_body, output) + .map_err(crate::operation::list_tags_for_resource::ListTagsForResourceError::unhandled)?; + let output = output.meta(generic); + crate::serde_util::validation_exception_correct_errors(output) + .build() + .map_err(crate::operation::list_tags_for_resource::ListTagsForResourceError::unhandled)? + }; + tmp + }), + _ => crate::operation::list_tags_for_resource::ListTagsForResourceError::generic(generic), + }) +} + +#[allow(clippy::unnecessary_wraps)] +pub fn de_list_tags_for_resource_http_response( + _response_status: u16, + _response_headers: &::aws_smithy_runtime_api::http::Headers, + _response_body: &[u8], +) -> std::result::Result< + crate::operation::list_tags_for_resource::ListTagsForResourceOutput, + crate::operation::list_tags_for_resource::ListTagsForResourceError, +> { + Ok({ + #[allow(unused_mut)] + let mut output = crate::operation::list_tags_for_resource::builders::ListTagsForResourceOutputBuilder::default(); + output = crate::protocol_serde::shape_list_tags_for_resource::de_list_tags_for_resource(_response_body, output) + .map_err(crate::operation::list_tags_for_resource::ListTagsForResourceError::unhandled)?; + output._set_request_id(::aws_types::request_id::RequestId::request_id(_response_headers).map(str::to_string)); + output.build() + }) +} + +pub(crate) fn de_list_tags_for_resource( + value: &[u8], + mut builder: crate::operation::list_tags_for_resource::builders::ListTagsForResourceOutputBuilder, +) -> Result< + crate::operation::list_tags_for_resource::builders::ListTagsForResourceOutputBuilder, + ::aws_smithy_json::deserialize::error::DeserializeError, +> { + let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(value)).peekable(); + let tokens = &mut tokens_owned; + ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; + loop { + match tokens.next().transpose()? { + Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break, + Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() { + "Tags" => { + builder = builder.set_tags(crate::protocol_serde::shape_tag_map::de_tag_map(tokens)?); + } + _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?, + }, + other => { + return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!( + "expected object key or end object, found: {:?}", + other + ))) + } + } + } + if tokens.next().is_some() { + return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom( + "found more JSON tokens after completing parsing", + )); + } + Ok(builder) +} diff --git a/sdk/backupsearch/src/protocol_serde/shape_long_condition.rs b/sdk/backupsearch/src/protocol_serde/shape_long_condition.rs new file mode 100644 index 000000000000..25d866939e87 --- /dev/null +++ b/sdk/backupsearch/src/protocol_serde/shape_long_condition.rs @@ -0,0 +1,65 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +pub fn ser_long_condition( + object: &mut ::aws_smithy_json::serialize::JsonObjectWriter, + input: &crate::types::LongCondition, +) -> Result<(), ::aws_smithy_types::error::operation::SerializationError> { + { + object.key("Value").number( + #[allow(clippy::useless_conversion)] + ::aws_smithy_types::Number::NegInt((input.value).into()), + ); + } + { + object.key("Operator").string(input.operator.as_str()); + } + Ok(()) +} + +pub(crate) fn de_long_condition<'a, I>( + tokens: &mut ::std::iter::Peekable, +) -> Result, ::aws_smithy_json::deserialize::error::DeserializeError> +where + I: Iterator, ::aws_smithy_json::deserialize::error::DeserializeError>>, +{ + match tokens.next().transpose()? { + Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), + Some(::aws_smithy_json::deserialize::Token::StartObject { .. }) => { + #[allow(unused_mut)] + let mut builder = crate::types::builders::LongConditionBuilder::default(); + loop { + match tokens.next().transpose()? { + Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break, + Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() { + "Value" => { + builder = builder.set_value( + ::aws_smithy_json::deserialize::token::expect_number_or_null(tokens.next())? + .map(i64::try_from) + .transpose()?, + ); + } + "Operator" => { + builder = builder.set_operator( + ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())? + .map(|s| s.to_unescaped().map(|u| crate::types::LongConditionOperator::from(u.as_ref()))) + .transpose()?, + ); + } + _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?, + }, + other => { + return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!( + "expected object key or end object, found: {:?}", + other + ))) + } + } + } + Ok(Some(crate::serde_util::long_condition_correct_errors(builder).build().map_err( + |err| ::aws_smithy_json::deserialize::error::DeserializeError::custom_source("Response was invalid", err), + )?)) + } + _ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom( + "expected start object or null", + )), + } +} diff --git a/sdk/backupsearch/src/protocol_serde/shape_long_condition_list.rs b/sdk/backupsearch/src/protocol_serde/shape_long_condition_list.rs new file mode 100644 index 000000000000..b5fdb840f78c --- /dev/null +++ b/sdk/backupsearch/src/protocol_serde/shape_long_condition_list.rs @@ -0,0 +1,32 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +pub(crate) fn de_long_condition_list<'a, I>( + tokens: &mut ::std::iter::Peekable, +) -> Result>, ::aws_smithy_json::deserialize::error::DeserializeError> +where + I: Iterator, ::aws_smithy_json::deserialize::error::DeserializeError>>, +{ + match tokens.next().transpose()? { + Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), + Some(::aws_smithy_json::deserialize::Token::StartArray { .. }) => { + let mut items = Vec::new(); + loop { + match tokens.peek() { + Some(Ok(::aws_smithy_json::deserialize::Token::EndArray { .. })) => { + tokens.next().transpose().unwrap(); + break; + } + _ => { + let value = crate::protocol_serde::shape_long_condition::de_long_condition(tokens)?; + if let Some(value) = value { + items.push(value); + } + } + } + } + Ok(Some(items)) + } + _ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom( + "expected start array or null", + )), + } +} diff --git a/sdk/backupsearch/src/protocol_serde/shape_recovery_point_arn_list.rs b/sdk/backupsearch/src/protocol_serde/shape_recovery_point_arn_list.rs new file mode 100644 index 000000000000..32e3a710dc3b --- /dev/null +++ b/sdk/backupsearch/src/protocol_serde/shape_recovery_point_arn_list.rs @@ -0,0 +1,34 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +pub(crate) fn de_recovery_point_arn_list<'a, I>( + tokens: &mut ::std::iter::Peekable, +) -> Result>, ::aws_smithy_json::deserialize::error::DeserializeError> +where + I: Iterator, ::aws_smithy_json::deserialize::error::DeserializeError>>, +{ + match tokens.next().transpose()? { + Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), + Some(::aws_smithy_json::deserialize::Token::StartArray { .. }) => { + let mut items = Vec::new(); + loop { + match tokens.peek() { + Some(Ok(::aws_smithy_json::deserialize::Token::EndArray { .. })) => { + tokens.next().transpose().unwrap(); + break; + } + _ => { + let value = ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())? + .map(|s| s.to_unescaped().map(|u| u.into_owned())) + .transpose()?; + if let Some(value) = value { + items.push(value); + } + } + } + } + Ok(Some(items)) + } + _ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom( + "expected start array or null", + )), + } +} diff --git a/sdk/backupsearch/src/protocol_serde/shape_resource_arn_list.rs b/sdk/backupsearch/src/protocol_serde/shape_resource_arn_list.rs new file mode 100644 index 000000000000..ebaa905a428b --- /dev/null +++ b/sdk/backupsearch/src/protocol_serde/shape_resource_arn_list.rs @@ -0,0 +1,34 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +pub(crate) fn de_resource_arn_list<'a, I>( + tokens: &mut ::std::iter::Peekable, +) -> Result>, ::aws_smithy_json::deserialize::error::DeserializeError> +where + I: Iterator, ::aws_smithy_json::deserialize::error::DeserializeError>>, +{ + match tokens.next().transpose()? { + Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), + Some(::aws_smithy_json::deserialize::Token::StartArray { .. }) => { + let mut items = Vec::new(); + loop { + match tokens.peek() { + Some(Ok(::aws_smithy_json::deserialize::Token::EndArray { .. })) => { + tokens.next().transpose().unwrap(); + break; + } + _ => { + let value = ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())? + .map(|s| s.to_unescaped().map(|u| u.into_owned())) + .transpose()?; + if let Some(value) = value { + items.push(value); + } + } + } + } + Ok(Some(items)) + } + _ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom( + "expected start array or null", + )), + } +} diff --git a/sdk/backupsearch/src/protocol_serde/shape_resource_not_found_exception.rs b/sdk/backupsearch/src/protocol_serde/shape_resource_not_found_exception.rs new file mode 100644 index 000000000000..1a91c7a96169 --- /dev/null +++ b/sdk/backupsearch/src/protocol_serde/shape_resource_not_found_exception.rs @@ -0,0 +1,50 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +pub(crate) fn de_resource_not_found_exception_json_err( + value: &[u8], + mut builder: crate::types::error::builders::ResourceNotFoundExceptionBuilder, +) -> Result { + let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(value)).peekable(); + let tokens = &mut tokens_owned; + ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; + loop { + match tokens.next().transpose()? { + Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break, + Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() { + "message" => { + builder = builder.set_message( + ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())? + .map(|s| s.to_unescaped().map(|u| u.into_owned())) + .transpose()?, + ); + } + "resourceId" => { + builder = builder.set_resource_id( + ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())? + .map(|s| s.to_unescaped().map(|u| u.into_owned())) + .transpose()?, + ); + } + "resourceType" => { + builder = builder.set_resource_type( + ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())? + .map(|s| s.to_unescaped().map(|u| u.into_owned())) + .transpose()?, + ); + } + _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?, + }, + other => { + return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!( + "expected object key or end object, found: {:?}", + other + ))) + } + } + } + if tokens.next().is_some() { + return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom( + "found more JSON tokens after completing parsing", + )); + } + Ok(builder) +} diff --git a/sdk/backupsearch/src/protocol_serde/shape_resource_type_list.rs b/sdk/backupsearch/src/protocol_serde/shape_resource_type_list.rs new file mode 100644 index 000000000000..2d7a1e19cbff --- /dev/null +++ b/sdk/backupsearch/src/protocol_serde/shape_resource_type_list.rs @@ -0,0 +1,34 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +pub(crate) fn de_resource_type_list<'a, I>( + tokens: &mut ::std::iter::Peekable, +) -> Result>, ::aws_smithy_json::deserialize::error::DeserializeError> +where + I: Iterator, ::aws_smithy_json::deserialize::error::DeserializeError>>, +{ + match tokens.next().transpose()? { + Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), + Some(::aws_smithy_json::deserialize::Token::StartArray { .. }) => { + let mut items = Vec::new(); + loop { + match tokens.peek() { + Some(Ok(::aws_smithy_json::deserialize::Token::EndArray { .. })) => { + tokens.next().transpose().unwrap(); + break; + } + _ => { + let value = ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())? + .map(|s| s.to_unescaped().map(|u| crate::types::ResourceType::from(u.as_ref()))) + .transpose()?; + if let Some(value) = value { + items.push(value); + } + } + } + } + Ok(Some(items)) + } + _ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom( + "expected start array or null", + )), + } +} diff --git a/sdk/backupsearch/src/protocol_serde/shape_result_item.rs b/sdk/backupsearch/src/protocol_serde/shape_result_item.rs new file mode 100644 index 000000000000..e7d1572bb4d0 --- /dev/null +++ b/sdk/backupsearch/src/protocol_serde/shape_result_item.rs @@ -0,0 +1,68 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +pub(crate) fn de_result_item<'a, I>( + tokens: &mut ::std::iter::Peekable, +) -> Result, ::aws_smithy_json::deserialize::error::DeserializeError> +where + I: Iterator, ::aws_smithy_json::deserialize::error::DeserializeError>>, +{ + let mut variant = None; + match tokens.next().transpose()? { + Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => return Ok(None), + Some(::aws_smithy_json::deserialize::Token::StartObject { .. }) => loop { + match tokens.next().transpose()? { + Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break, + Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { + if let ::std::option::Option::Some(::std::result::Result::Ok(::aws_smithy_json::deserialize::Token::ValueNull { .. })) = + tokens.peek() + { + let _ = tokens.next().expect("peek returned a token")?; + continue; + } + let key = key.to_unescaped()?; + if key == "__type" { + ::aws_smithy_json::deserialize::token::skip_value(tokens)?; + continue; + } + if variant.is_some() { + return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom( + "encountered mixed variants in union", + )); + } + variant = match key.as_ref() { + "S3ResultItem" => Some(crate::types::ResultItem::S3ResultItem( + crate::protocol_serde::shape_s3_result_item::de_s3_result_item(tokens)?.ok_or_else(|| { + ::aws_smithy_json::deserialize::error::DeserializeError::custom("value for 'S3ResultItem' cannot be null") + })?, + )), + "EBSResultItem" => Some(crate::types::ResultItem::EbsResultItem( + crate::protocol_serde::shape_ebs_result_item::de_ebs_result_item(tokens)?.ok_or_else(|| { + ::aws_smithy_json::deserialize::error::DeserializeError::custom("value for 'EBSResultItem' cannot be null") + })?, + )), + _ => { + ::aws_smithy_json::deserialize::token::skip_value(tokens)?; + Some(crate::types::ResultItem::Unknown) + } + }; + } + other => { + return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!( + "expected object key or end object, found: {:?}", + other + ))) + } + } + }, + _ => { + return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom( + "expected start object or null", + )) + } + } + if variant.is_none() { + return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom( + "Union did not contain a valid variant.", + )); + } + Ok(variant) +} diff --git a/sdk/backupsearch/src/protocol_serde/shape_results.rs b/sdk/backupsearch/src/protocol_serde/shape_results.rs new file mode 100644 index 000000000000..f69ec60752c8 --- /dev/null +++ b/sdk/backupsearch/src/protocol_serde/shape_results.rs @@ -0,0 +1,32 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +pub(crate) fn de_results<'a, I>( + tokens: &mut ::std::iter::Peekable, +) -> Result>, ::aws_smithy_json::deserialize::error::DeserializeError> +where + I: Iterator, ::aws_smithy_json::deserialize::error::DeserializeError>>, +{ + match tokens.next().transpose()? { + Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), + Some(::aws_smithy_json::deserialize::Token::StartArray { .. }) => { + let mut items = Vec::new(); + loop { + match tokens.peek() { + Some(Ok(::aws_smithy_json::deserialize::Token::EndArray { .. })) => { + tokens.next().transpose().unwrap(); + break; + } + _ => { + let value = crate::protocol_serde::shape_result_item::de_result_item(tokens)?; + if let Some(value) = value { + items.push(value); + } + } + } + } + Ok(Some(items)) + } + _ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom( + "expected start array or null", + )), + } +} diff --git a/sdk/backupsearch/src/protocol_serde/shape_s3_export_specification.rs b/sdk/backupsearch/src/protocol_serde/shape_s3_export_specification.rs new file mode 100644 index 000000000000..586e870f573c --- /dev/null +++ b/sdk/backupsearch/src/protocol_serde/shape_s3_export_specification.rs @@ -0,0 +1,62 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +pub(crate) fn de_s3_export_specification<'a, I>( + tokens: &mut ::std::iter::Peekable, +) -> Result, ::aws_smithy_json::deserialize::error::DeserializeError> +where + I: Iterator, ::aws_smithy_json::deserialize::error::DeserializeError>>, +{ + match tokens.next().transpose()? { + Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), + Some(::aws_smithy_json::deserialize::Token::StartObject { .. }) => { + #[allow(unused_mut)] + let mut builder = crate::types::builders::S3ExportSpecificationBuilder::default(); + loop { + match tokens.next().transpose()? { + Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break, + Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() { + "DestinationBucket" => { + builder = builder.set_destination_bucket( + ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())? + .map(|s| s.to_unescaped().map(|u| u.into_owned())) + .transpose()?, + ); + } + "DestinationPrefix" => { + builder = builder.set_destination_prefix( + ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())? + .map(|s| s.to_unescaped().map(|u| u.into_owned())) + .transpose()?, + ); + } + _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?, + }, + other => { + return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!( + "expected object key or end object, found: {:?}", + other + ))) + } + } + } + Ok(Some(crate::serde_util::s3_export_specification_correct_errors(builder).build().map_err( + |err| ::aws_smithy_json::deserialize::error::DeserializeError::custom_source("Response was invalid", err), + )?)) + } + _ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom( + "expected start object or null", + )), + } +} + +pub fn ser_s3_export_specification( + object: &mut ::aws_smithy_json::serialize::JsonObjectWriter, + input: &crate::types::S3ExportSpecification, +) -> Result<(), ::aws_smithy_types::error::operation::SerializationError> { + { + object.key("DestinationBucket").string(input.destination_bucket.as_str()); + } + if let Some(var_1) = &input.destination_prefix { + object.key("DestinationPrefix").string(var_1.as_str()); + } + Ok(()) +} diff --git a/sdk/backupsearch/src/protocol_serde/shape_s3_item_filter.rs b/sdk/backupsearch/src/protocol_serde/shape_s3_item_filter.rs new file mode 100644 index 000000000000..f9c831b04620 --- /dev/null +++ b/sdk/backupsearch/src/protocol_serde/shape_s3_item_filter.rs @@ -0,0 +1,115 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +pub fn ser_s3_item_filter( + object: &mut ::aws_smithy_json::serialize::JsonObjectWriter, + input: &crate::types::S3ItemFilter, +) -> Result<(), ::aws_smithy_types::error::operation::SerializationError> { + if let Some(var_1) = &input.object_keys { + let mut array_2 = object.key("ObjectKeys").start_array(); + for item_3 in var_1 { + { + #[allow(unused_mut)] + let mut object_4 = array_2.value().start_object(); + crate::protocol_serde::shape_string_condition::ser_string_condition(&mut object_4, item_3)?; + object_4.finish(); + } + } + array_2.finish(); + } + if let Some(var_5) = &input.sizes { + let mut array_6 = object.key("Sizes").start_array(); + for item_7 in var_5 { + { + #[allow(unused_mut)] + let mut object_8 = array_6.value().start_object(); + crate::protocol_serde::shape_long_condition::ser_long_condition(&mut object_8, item_7)?; + object_8.finish(); + } + } + array_6.finish(); + } + if let Some(var_9) = &input.creation_times { + let mut array_10 = object.key("CreationTimes").start_array(); + for item_11 in var_9 { + { + #[allow(unused_mut)] + let mut object_12 = array_10.value().start_object(); + crate::protocol_serde::shape_time_condition::ser_time_condition(&mut object_12, item_11)?; + object_12.finish(); + } + } + array_10.finish(); + } + if let Some(var_13) = &input.version_ids { + let mut array_14 = object.key("VersionIds").start_array(); + for item_15 in var_13 { + { + #[allow(unused_mut)] + let mut object_16 = array_14.value().start_object(); + crate::protocol_serde::shape_string_condition::ser_string_condition(&mut object_16, item_15)?; + object_16.finish(); + } + } + array_14.finish(); + } + if let Some(var_17) = &input.e_tags { + let mut array_18 = object.key("ETags").start_array(); + for item_19 in var_17 { + { + #[allow(unused_mut)] + let mut object_20 = array_18.value().start_object(); + crate::protocol_serde::shape_string_condition::ser_string_condition(&mut object_20, item_19)?; + object_20.finish(); + } + } + array_18.finish(); + } + Ok(()) +} + +pub(crate) fn de_s3_item_filter<'a, I>( + tokens: &mut ::std::iter::Peekable, +) -> Result, ::aws_smithy_json::deserialize::error::DeserializeError> +where + I: Iterator, ::aws_smithy_json::deserialize::error::DeserializeError>>, +{ + match tokens.next().transpose()? { + Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), + Some(::aws_smithy_json::deserialize::Token::StartObject { .. }) => { + #[allow(unused_mut)] + let mut builder = crate::types::builders::S3ItemFilterBuilder::default(); + loop { + match tokens.next().transpose()? { + Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break, + Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() { + "ObjectKeys" => { + builder = builder.set_object_keys(crate::protocol_serde::shape_string_condition_list::de_string_condition_list(tokens)?); + } + "Sizes" => { + builder = builder.set_sizes(crate::protocol_serde::shape_long_condition_list::de_long_condition_list(tokens)?); + } + "CreationTimes" => { + builder = builder.set_creation_times(crate::protocol_serde::shape_time_condition_list::de_time_condition_list(tokens)?); + } + "VersionIds" => { + builder = builder.set_version_ids(crate::protocol_serde::shape_string_condition_list::de_string_condition_list(tokens)?); + } + "ETags" => { + builder = builder.set_e_tags(crate::protocol_serde::shape_string_condition_list::de_string_condition_list(tokens)?); + } + _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?, + }, + other => { + return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!( + "expected object key or end object, found: {:?}", + other + ))) + } + } + } + Ok(Some(builder.build())) + } + _ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom( + "expected start object or null", + )), + } +} diff --git a/sdk/backupsearch/src/protocol_serde/shape_s3_item_filters.rs b/sdk/backupsearch/src/protocol_serde/shape_s3_item_filters.rs new file mode 100644 index 000000000000..187fef2cfb36 --- /dev/null +++ b/sdk/backupsearch/src/protocol_serde/shape_s3_item_filters.rs @@ -0,0 +1,32 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +pub(crate) fn de_s3_item_filters<'a, I>( + tokens: &mut ::std::iter::Peekable, +) -> Result>, ::aws_smithy_json::deserialize::error::DeserializeError> +where + I: Iterator, ::aws_smithy_json::deserialize::error::DeserializeError>>, +{ + match tokens.next().transpose()? { + Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), + Some(::aws_smithy_json::deserialize::Token::StartArray { .. }) => { + let mut items = Vec::new(); + loop { + match tokens.peek() { + Some(Ok(::aws_smithy_json::deserialize::Token::EndArray { .. })) => { + tokens.next().transpose().unwrap(); + break; + } + _ => { + let value = crate::protocol_serde::shape_s3_item_filter::de_s3_item_filter(tokens)?; + if let Some(value) = value { + items.push(value); + } + } + } + } + Ok(Some(items)) + } + _ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom( + "expected start array or null", + )), + } +} diff --git a/sdk/backupsearch/src/protocol_serde/shape_s3_result_item.rs b/sdk/backupsearch/src/protocol_serde/shape_s3_result_item.rs new file mode 100644 index 000000000000..dbacb34f1021 --- /dev/null +++ b/sdk/backupsearch/src/protocol_serde/shape_s3_result_item.rs @@ -0,0 +1,88 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +pub(crate) fn de_s3_result_item<'a, I>( + tokens: &mut ::std::iter::Peekable, +) -> Result, ::aws_smithy_json::deserialize::error::DeserializeError> +where + I: Iterator, ::aws_smithy_json::deserialize::error::DeserializeError>>, +{ + match tokens.next().transpose()? { + Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), + Some(::aws_smithy_json::deserialize::Token::StartObject { .. }) => { + #[allow(unused_mut)] + let mut builder = crate::types::builders::S3ResultItemBuilder::default(); + loop { + match tokens.next().transpose()? { + Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break, + Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() { + "BackupResourceArn" => { + builder = builder.set_backup_resource_arn( + ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())? + .map(|s| s.to_unescaped().map(|u| u.into_owned())) + .transpose()?, + ); + } + "SourceResourceArn" => { + builder = builder.set_source_resource_arn( + ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())? + .map(|s| s.to_unescaped().map(|u| u.into_owned())) + .transpose()?, + ); + } + "BackupVaultName" => { + builder = builder.set_backup_vault_name( + ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())? + .map(|s| s.to_unescaped().map(|u| u.into_owned())) + .transpose()?, + ); + } + "ObjectKey" => { + builder = builder.set_object_key( + ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())? + .map(|s| s.to_unescaped().map(|u| u.into_owned())) + .transpose()?, + ); + } + "ObjectSize" => { + builder = builder.set_object_size( + ::aws_smithy_json::deserialize::token::expect_number_or_null(tokens.next())? + .map(i64::try_from) + .transpose()?, + ); + } + "CreationTime" => { + builder = builder.set_creation_time(::aws_smithy_json::deserialize::token::expect_timestamp_or_null( + tokens.next(), + ::aws_smithy_types::date_time::Format::EpochSeconds, + )?); + } + "ETag" => { + builder = builder.set_e_tag( + ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())? + .map(|s| s.to_unescaped().map(|u| u.into_owned())) + .transpose()?, + ); + } + "VersionId" => { + builder = builder.set_version_id( + ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())? + .map(|s| s.to_unescaped().map(|u| u.into_owned())) + .transpose()?, + ); + } + _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?, + }, + other => { + return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!( + "expected object key or end object, found: {:?}", + other + ))) + } + } + } + Ok(Some(builder.build())) + } + _ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom( + "expected start object or null", + )), + } +} diff --git a/sdk/backupsearch/src/protocol_serde/shape_search_job_backups_result.rs b/sdk/backupsearch/src/protocol_serde/shape_search_job_backups_result.rs new file mode 100644 index 000000000000..27b29dc31534 --- /dev/null +++ b/sdk/backupsearch/src/protocol_serde/shape_search_job_backups_result.rs @@ -0,0 +1,80 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +pub(crate) fn de_search_job_backups_result<'a, I>( + tokens: &mut ::std::iter::Peekable, +) -> Result, ::aws_smithy_json::deserialize::error::DeserializeError> +where + I: Iterator, ::aws_smithy_json::deserialize::error::DeserializeError>>, +{ + match tokens.next().transpose()? { + Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), + Some(::aws_smithy_json::deserialize::Token::StartObject { .. }) => { + #[allow(unused_mut)] + let mut builder = crate::types::builders::SearchJobBackupsResultBuilder::default(); + loop { + match tokens.next().transpose()? { + Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break, + Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() { + "Status" => { + builder = builder.set_status( + ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())? + .map(|s| s.to_unescaped().map(|u| crate::types::SearchJobState::from(u.as_ref()))) + .transpose()?, + ); + } + "StatusMessage" => { + builder = builder.set_status_message( + ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())? + .map(|s| s.to_unescaped().map(|u| u.into_owned())) + .transpose()?, + ); + } + "ResourceType" => { + builder = builder.set_resource_type( + ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())? + .map(|s| s.to_unescaped().map(|u| crate::types::ResourceType::from(u.as_ref()))) + .transpose()?, + ); + } + "BackupResourceArn" => { + builder = builder.set_backup_resource_arn( + ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())? + .map(|s| s.to_unescaped().map(|u| u.into_owned())) + .transpose()?, + ); + } + "SourceResourceArn" => { + builder = builder.set_source_resource_arn( + ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())? + .map(|s| s.to_unescaped().map(|u| u.into_owned())) + .transpose()?, + ); + } + "IndexCreationTime" => { + builder = builder.set_index_creation_time(::aws_smithy_json::deserialize::token::expect_timestamp_or_null( + tokens.next(), + ::aws_smithy_types::date_time::Format::EpochSeconds, + )?); + } + "BackupCreationTime" => { + builder = builder.set_backup_creation_time(::aws_smithy_json::deserialize::token::expect_timestamp_or_null( + tokens.next(), + ::aws_smithy_types::date_time::Format::EpochSeconds, + )?); + } + _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?, + }, + other => { + return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!( + "expected object key or end object, found: {:?}", + other + ))) + } + } + } + Ok(Some(builder.build())) + } + _ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom( + "expected start object or null", + )), + } +} diff --git a/sdk/backupsearch/src/protocol_serde/shape_search_job_backups_results.rs b/sdk/backupsearch/src/protocol_serde/shape_search_job_backups_results.rs new file mode 100644 index 000000000000..f8b7ac7b9a6c --- /dev/null +++ b/sdk/backupsearch/src/protocol_serde/shape_search_job_backups_results.rs @@ -0,0 +1,32 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +pub(crate) fn de_search_job_backups_results<'a, I>( + tokens: &mut ::std::iter::Peekable, +) -> Result>, ::aws_smithy_json::deserialize::error::DeserializeError> +where + I: Iterator, ::aws_smithy_json::deserialize::error::DeserializeError>>, +{ + match tokens.next().transpose()? { + Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), + Some(::aws_smithy_json::deserialize::Token::StartArray { .. }) => { + let mut items = Vec::new(); + loop { + match tokens.peek() { + Some(Ok(::aws_smithy_json::deserialize::Token::EndArray { .. })) => { + tokens.next().transpose().unwrap(); + break; + } + _ => { + let value = crate::protocol_serde::shape_search_job_backups_result::de_search_job_backups_result(tokens)?; + if let Some(value) = value { + items.push(value); + } + } + } + } + Ok(Some(items)) + } + _ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom( + "expected start array or null", + )), + } +} diff --git a/sdk/backupsearch/src/protocol_serde/shape_search_job_summary.rs b/sdk/backupsearch/src/protocol_serde/shape_search_job_summary.rs new file mode 100644 index 000000000000..1abd4ac58212 --- /dev/null +++ b/sdk/backupsearch/src/protocol_serde/shape_search_job_summary.rs @@ -0,0 +1,84 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +pub(crate) fn de_search_job_summary<'a, I>( + tokens: &mut ::std::iter::Peekable, +) -> Result, ::aws_smithy_json::deserialize::error::DeserializeError> +where + I: Iterator, ::aws_smithy_json::deserialize::error::DeserializeError>>, +{ + match tokens.next().transpose()? { + Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), + Some(::aws_smithy_json::deserialize::Token::StartObject { .. }) => { + #[allow(unused_mut)] + let mut builder = crate::types::builders::SearchJobSummaryBuilder::default(); + loop { + match tokens.next().transpose()? { + Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break, + Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() { + "SearchJobIdentifier" => { + builder = builder.set_search_job_identifier( + ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())? + .map(|s| s.to_unescaped().map(|u| u.into_owned())) + .transpose()?, + ); + } + "SearchJobArn" => { + builder = builder.set_search_job_arn( + ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())? + .map(|s| s.to_unescaped().map(|u| u.into_owned())) + .transpose()?, + ); + } + "Name" => { + builder = builder.set_name( + ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())? + .map(|s| s.to_unescaped().map(|u| u.into_owned())) + .transpose()?, + ); + } + "Status" => { + builder = builder.set_status( + ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())? + .map(|s| s.to_unescaped().map(|u| crate::types::SearchJobState::from(u.as_ref()))) + .transpose()?, + ); + } + "CreationTime" => { + builder = builder.set_creation_time(::aws_smithy_json::deserialize::token::expect_timestamp_or_null( + tokens.next(), + ::aws_smithy_types::date_time::Format::EpochSeconds, + )?); + } + "CompletionTime" => { + builder = builder.set_completion_time(::aws_smithy_json::deserialize::token::expect_timestamp_or_null( + tokens.next(), + ::aws_smithy_types::date_time::Format::EpochSeconds, + )?); + } + "SearchScopeSummary" => { + builder = + builder.set_search_scope_summary(crate::protocol_serde::shape_search_scope_summary::de_search_scope_summary(tokens)?); + } + "StatusMessage" => { + builder = builder.set_status_message( + ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())? + .map(|s| s.to_unescaped().map(|u| u.into_owned())) + .transpose()?, + ); + } + _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?, + }, + other => { + return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!( + "expected object key or end object, found: {:?}", + other + ))) + } + } + } + Ok(Some(builder.build())) + } + _ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom( + "expected start object or null", + )), + } +} diff --git a/sdk/backupsearch/src/protocol_serde/shape_search_jobs.rs b/sdk/backupsearch/src/protocol_serde/shape_search_jobs.rs new file mode 100644 index 000000000000..8f2576a8df4f --- /dev/null +++ b/sdk/backupsearch/src/protocol_serde/shape_search_jobs.rs @@ -0,0 +1,32 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +pub(crate) fn de_search_jobs<'a, I>( + tokens: &mut ::std::iter::Peekable, +) -> Result>, ::aws_smithy_json::deserialize::error::DeserializeError> +where + I: Iterator, ::aws_smithy_json::deserialize::error::DeserializeError>>, +{ + match tokens.next().transpose()? { + Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), + Some(::aws_smithy_json::deserialize::Token::StartArray { .. }) => { + let mut items = Vec::new(); + loop { + match tokens.peek() { + Some(Ok(::aws_smithy_json::deserialize::Token::EndArray { .. })) => { + tokens.next().transpose().unwrap(); + break; + } + _ => { + let value = crate::protocol_serde::shape_search_job_summary::de_search_job_summary(tokens)?; + if let Some(value) = value { + items.push(value); + } + } + } + } + Ok(Some(items)) + } + _ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom( + "expected start array or null", + )), + } +} diff --git a/sdk/backupsearch/src/protocol_serde/shape_search_scope.rs b/sdk/backupsearch/src/protocol_serde/shape_search_scope.rs new file mode 100644 index 000000000000..d86547564f95 --- /dev/null +++ b/sdk/backupsearch/src/protocol_serde/shape_search_scope.rs @@ -0,0 +1,106 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +pub(crate) fn de_search_scope<'a, I>( + tokens: &mut ::std::iter::Peekable, +) -> Result, ::aws_smithy_json::deserialize::error::DeserializeError> +where + I: Iterator, ::aws_smithy_json::deserialize::error::DeserializeError>>, +{ + match tokens.next().transpose()? { + Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), + Some(::aws_smithy_json::deserialize::Token::StartObject { .. }) => { + #[allow(unused_mut)] + let mut builder = crate::types::builders::SearchScopeBuilder::default(); + loop { + match tokens.next().transpose()? { + Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break, + Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() { + "BackupResourceTypes" => { + builder = + builder.set_backup_resource_types(crate::protocol_serde::shape_resource_type_list::de_resource_type_list(tokens)?); + } + "BackupResourceCreationTime" => { + builder = builder.set_backup_resource_creation_time( + crate::protocol_serde::shape_backup_creation_time_filter::de_backup_creation_time_filter(tokens)?, + ); + } + "SourceResourceArns" => { + builder = builder.set_source_resource_arns(crate::protocol_serde::shape_resource_arn_list::de_resource_arn_list(tokens)?); + } + "BackupResourceArns" => { + builder = builder + .set_backup_resource_arns(crate::protocol_serde::shape_recovery_point_arn_list::de_recovery_point_arn_list(tokens)?); + } + "BackupResourceTags" => { + builder = builder.set_backup_resource_tags(crate::protocol_serde::shape_tag_map::de_tag_map(tokens)?); + } + _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?, + }, + other => { + return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!( + "expected object key or end object, found: {:?}", + other + ))) + } + } + } + Ok(Some(crate::serde_util::search_scope_correct_errors(builder).build().map_err(|err| { + ::aws_smithy_json::deserialize::error::DeserializeError::custom_source("Response was invalid", err) + })?)) + } + _ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom( + "expected start object or null", + )), + } +} + +pub fn ser_search_scope( + object: &mut ::aws_smithy_json::serialize::JsonObjectWriter, + input: &crate::types::SearchScope, +) -> Result<(), ::aws_smithy_types::error::operation::SerializationError> { + { + let mut array_1 = object.key("BackupResourceTypes").start_array(); + for item_2 in &input.backup_resource_types { + { + array_1.value().string(item_2.as_str()); + } + } + array_1.finish(); + } + if let Some(var_3) = &input.backup_resource_creation_time { + #[allow(unused_mut)] + let mut object_4 = object.key("BackupResourceCreationTime").start_object(); + crate::protocol_serde::shape_backup_creation_time_filter::ser_backup_creation_time_filter(&mut object_4, var_3)?; + object_4.finish(); + } + if let Some(var_5) = &input.source_resource_arns { + let mut array_6 = object.key("SourceResourceArns").start_array(); + for item_7 in var_5 { + { + array_6.value().string(item_7.as_str()); + } + } + array_6.finish(); + } + if let Some(var_8) = &input.backup_resource_arns { + let mut array_9 = object.key("BackupResourceArns").start_array(); + for item_10 in var_8 { + { + array_9.value().string(item_10.as_str()); + } + } + array_9.finish(); + } + if let Some(var_11) = &input.backup_resource_tags { + #[allow(unused_mut)] + let mut object_12 = object.key("BackupResourceTags").start_object(); + for (key_13, value_14) in var_11 { + if let Some(var_15) = value_14 { + object_12.key(key_13.as_str()).string(var_15.as_str()); + } else { + object_12.key(key_13.as_str()).null(); + } + } + object_12.finish(); + } + Ok(()) +} diff --git a/sdk/backupsearch/src/protocol_serde/shape_search_scope_summary.rs b/sdk/backupsearch/src/protocol_serde/shape_search_scope_summary.rs new file mode 100644 index 000000000000..bcdd3bc2a8b7 --- /dev/null +++ b/sdk/backupsearch/src/protocol_serde/shape_search_scope_summary.rs @@ -0,0 +1,47 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +pub(crate) fn de_search_scope_summary<'a, I>( + tokens: &mut ::std::iter::Peekable, +) -> Result, ::aws_smithy_json::deserialize::error::DeserializeError> +where + I: Iterator, ::aws_smithy_json::deserialize::error::DeserializeError>>, +{ + match tokens.next().transpose()? { + Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), + Some(::aws_smithy_json::deserialize::Token::StartObject { .. }) => { + #[allow(unused_mut)] + let mut builder = crate::types::builders::SearchScopeSummaryBuilder::default(); + loop { + match tokens.next().transpose()? { + Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break, + Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() { + "TotalRecoveryPointsToScanCount" => { + builder = builder.set_total_recovery_points_to_scan_count( + ::aws_smithy_json::deserialize::token::expect_number_or_null(tokens.next())? + .map(i32::try_from) + .transpose()?, + ); + } + "TotalItemsToScanCount" => { + builder = builder.set_total_items_to_scan_count( + ::aws_smithy_json::deserialize::token::expect_number_or_null(tokens.next())? + .map(i64::try_from) + .transpose()?, + ); + } + _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?, + }, + other => { + return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!( + "expected object key or end object, found: {:?}", + other + ))) + } + } + } + Ok(Some(builder.build())) + } + _ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom( + "expected start object or null", + )), + } +} diff --git a/sdk/backupsearch/src/protocol_serde/shape_service_quota_exceeded_exception.rs b/sdk/backupsearch/src/protocol_serde/shape_service_quota_exceeded_exception.rs new file mode 100644 index 000000000000..41dea667ac84 --- /dev/null +++ b/sdk/backupsearch/src/protocol_serde/shape_service_quota_exceeded_exception.rs @@ -0,0 +1,64 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +pub(crate) fn de_service_quota_exceeded_exception_json_err( + value: &[u8], + mut builder: crate::types::error::builders::ServiceQuotaExceededExceptionBuilder, +) -> Result { + let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(value)).peekable(); + let tokens = &mut tokens_owned; + ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; + loop { + match tokens.next().transpose()? { + Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break, + Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() { + "message" => { + builder = builder.set_message( + ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())? + .map(|s| s.to_unescaped().map(|u| u.into_owned())) + .transpose()?, + ); + } + "resourceId" => { + builder = builder.set_resource_id( + ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())? + .map(|s| s.to_unescaped().map(|u| u.into_owned())) + .transpose()?, + ); + } + "resourceType" => { + builder = builder.set_resource_type( + ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())? + .map(|s| s.to_unescaped().map(|u| u.into_owned())) + .transpose()?, + ); + } + "serviceCode" => { + builder = builder.set_service_code( + ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())? + .map(|s| s.to_unescaped().map(|u| u.into_owned())) + .transpose()?, + ); + } + "quotaCode" => { + builder = builder.set_quota_code( + ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())? + .map(|s| s.to_unescaped().map(|u| u.into_owned())) + .transpose()?, + ); + } + _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?, + }, + other => { + return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!( + "expected object key or end object, found: {:?}", + other + ))) + } + } + } + if tokens.next().is_some() { + return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom( + "found more JSON tokens after completing parsing", + )); + } + Ok(builder) +} diff --git a/sdk/backupsearch/src/protocol_serde/shape_start_search_job.rs b/sdk/backupsearch/src/protocol_serde/shape_start_search_job.rs new file mode 100644 index 000000000000..c1b98c222550 --- /dev/null +++ b/sdk/backupsearch/src/protocol_serde/shape_start_search_job.rs @@ -0,0 +1,198 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +#[allow(clippy::unnecessary_wraps)] +pub fn de_start_search_job_http_error( + _response_status: u16, + _response_headers: &::aws_smithy_runtime_api::http::Headers, + _response_body: &[u8], +) -> std::result::Result { + #[allow(unused_mut)] + let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(_response_status, _response_headers, _response_body) + .map_err(crate::operation::start_search_job::StartSearchJobError::unhandled)?; + generic_builder = ::aws_types::request_id::apply_request_id(generic_builder, _response_headers); + let generic = generic_builder.build(); + let error_code = match generic.code() { + Some(code) => code, + None => return Err(crate::operation::start_search_job::StartSearchJobError::unhandled(generic)), + }; + + let _error_message = generic.message().map(|msg| msg.to_owned()); + Err(match error_code { + "ConflictException" => crate::operation::start_search_job::StartSearchJobError::ConflictException({ + #[allow(unused_mut)] + let mut tmp = { + #[allow(unused_mut)] + let mut output = crate::types::error::builders::ConflictExceptionBuilder::default(); + output = crate::protocol_serde::shape_conflict_exception::de_conflict_exception_json_err(_response_body, output) + .map_err(crate::operation::start_search_job::StartSearchJobError::unhandled)?; + let output = output.meta(generic); + crate::serde_util::conflict_exception_correct_errors(output) + .build() + .map_err(crate::operation::start_search_job::StartSearchJobError::unhandled)? + }; + tmp + }), + "ServiceQuotaExceededException" => crate::operation::start_search_job::StartSearchJobError::ServiceQuotaExceededException({ + #[allow(unused_mut)] + let mut tmp = { + #[allow(unused_mut)] + let mut output = crate::types::error::builders::ServiceQuotaExceededExceptionBuilder::default(); + output = crate::protocol_serde::shape_service_quota_exceeded_exception::de_service_quota_exceeded_exception_json_err( + _response_body, + output, + ) + .map_err(crate::operation::start_search_job::StartSearchJobError::unhandled)?; + let output = output.meta(generic); + crate::serde_util::service_quota_exceeded_exception_correct_errors(output) + .build() + .map_err(crate::operation::start_search_job::StartSearchJobError::unhandled)? + }; + tmp + }), + "AccessDeniedException" => crate::operation::start_search_job::StartSearchJobError::AccessDeniedException({ + #[allow(unused_mut)] + let mut tmp = { + #[allow(unused_mut)] + let mut output = crate::types::error::builders::AccessDeniedExceptionBuilder::default(); + output = crate::protocol_serde::shape_access_denied_exception::de_access_denied_exception_json_err(_response_body, output) + .map_err(crate::operation::start_search_job::StartSearchJobError::unhandled)?; + let output = output.meta(generic); + crate::serde_util::access_denied_exception_correct_errors(output) + .build() + .map_err(crate::operation::start_search_job::StartSearchJobError::unhandled)? + }; + tmp + }), + "InternalServerException" => crate::operation::start_search_job::StartSearchJobError::InternalServerException({ + #[allow(unused_mut)] + let mut tmp = { + #[allow(unused_mut)] + let mut output = crate::types::error::builders::InternalServerExceptionBuilder::default(); + output = crate::protocol_serde::shape_internal_server_exception::de_internal_server_exception_json_err(_response_body, output) + .map_err(crate::operation::start_search_job::StartSearchJobError::unhandled)?; + output = output.set_retry_after_seconds( + crate::protocol_serde::shape_internal_server_exception::de_retry_after_seconds_header(_response_headers).map_err(|_| { + crate::operation::start_search_job::StartSearchJobError::unhandled( + "Failed to parse retryAfterSeconds from header `Retry-After", + ) + })?, + ); + let output = output.meta(generic); + crate::serde_util::internal_server_exception_correct_errors(output) + .build() + .map_err(crate::operation::start_search_job::StartSearchJobError::unhandled)? + }; + tmp + }), + "ThrottlingException" => crate::operation::start_search_job::StartSearchJobError::ThrottlingException({ + #[allow(unused_mut)] + let mut tmp = { + #[allow(unused_mut)] + let mut output = crate::types::error::builders::ThrottlingExceptionBuilder::default(); + output = crate::protocol_serde::shape_throttling_exception::de_throttling_exception_json_err(_response_body, output) + .map_err(crate::operation::start_search_job::StartSearchJobError::unhandled)?; + output = output.set_retry_after_seconds( + crate::protocol_serde::shape_throttling_exception::de_retry_after_seconds_header(_response_headers).map_err(|_| { + crate::operation::start_search_job::StartSearchJobError::unhandled( + "Failed to parse retryAfterSeconds from header `Retry-After", + ) + })?, + ); + let output = output.meta(generic); + crate::serde_util::throttling_exception_correct_errors(output) + .build() + .map_err(crate::operation::start_search_job::StartSearchJobError::unhandled)? + }; + tmp + }), + "ValidationException" => crate::operation::start_search_job::StartSearchJobError::ValidationException({ + #[allow(unused_mut)] + let mut tmp = { + #[allow(unused_mut)] + let mut output = crate::types::error::builders::ValidationExceptionBuilder::default(); + output = crate::protocol_serde::shape_validation_exception::de_validation_exception_json_err(_response_body, output) + .map_err(crate::operation::start_search_job::StartSearchJobError::unhandled)?; + let output = output.meta(generic); + crate::serde_util::validation_exception_correct_errors(output) + .build() + .map_err(crate::operation::start_search_job::StartSearchJobError::unhandled)? + }; + tmp + }), + _ => crate::operation::start_search_job::StartSearchJobError::generic(generic), + }) +} + +#[allow(clippy::unnecessary_wraps)] +pub fn de_start_search_job_http_response( + _response_status: u16, + _response_headers: &::aws_smithy_runtime_api::http::Headers, + _response_body: &[u8], +) -> std::result::Result { + Ok({ + #[allow(unused_mut)] + let mut output = crate::operation::start_search_job::builders::StartSearchJobOutputBuilder::default(); + output = crate::protocol_serde::shape_start_search_job::de_start_search_job(_response_body, output) + .map_err(crate::operation::start_search_job::StartSearchJobError::unhandled)?; + output._set_request_id(::aws_types::request_id::RequestId::request_id(_response_headers).map(str::to_string)); + output.build() + }) +} + +pub fn ser_start_search_job_input( + input: &crate::operation::start_search_job::StartSearchJobInput, +) -> Result<::aws_smithy_types::body::SdkBody, ::aws_smithy_types::error::operation::SerializationError> { + let mut out = String::new(); + let mut object = ::aws_smithy_json::serialize::JsonObjectWriter::new(&mut out); + crate::protocol_serde::shape_start_search_job_input::ser_start_search_job_input_input(&mut object, input)?; + object.finish(); + Ok(::aws_smithy_types::body::SdkBody::from(out)) +} + +pub(crate) fn de_start_search_job( + value: &[u8], + mut builder: crate::operation::start_search_job::builders::StartSearchJobOutputBuilder, +) -> Result { + let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(value)).peekable(); + let tokens = &mut tokens_owned; + ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; + loop { + match tokens.next().transpose()? { + Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break, + Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() { + "CreationTime" => { + builder = builder.set_creation_time(::aws_smithy_json::deserialize::token::expect_timestamp_or_null( + tokens.next(), + ::aws_smithy_types::date_time::Format::EpochSeconds, + )?); + } + "SearchJobArn" => { + builder = builder.set_search_job_arn( + ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())? + .map(|s| s.to_unescaped().map(|u| u.into_owned())) + .transpose()?, + ); + } + "SearchJobIdentifier" => { + builder = builder.set_search_job_identifier( + ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())? + .map(|s| s.to_unescaped().map(|u| u.into_owned())) + .transpose()?, + ); + } + _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?, + }, + other => { + return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!( + "expected object key or end object, found: {:?}", + other + ))) + } + } + } + if tokens.next().is_some() { + return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom( + "found more JSON tokens after completing parsing", + )); + } + Ok(builder) +} diff --git a/sdk/backupsearch/src/protocol_serde/shape_start_search_job_input.rs b/sdk/backupsearch/src/protocol_serde/shape_start_search_job_input.rs new file mode 100644 index 000000000000..57e71823b82e --- /dev/null +++ b/sdk/backupsearch/src/protocol_serde/shape_start_search_job_input.rs @@ -0,0 +1,40 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +pub fn ser_start_search_job_input_input( + object: &mut ::aws_smithy_json::serialize::JsonObjectWriter, + input: &crate::operation::start_search_job::StartSearchJobInput, +) -> Result<(), ::aws_smithy_types::error::operation::SerializationError> { + if let Some(var_1) = &input.client_token { + object.key("ClientToken").string(var_1.as_str()); + } + if let Some(var_2) = &input.encryption_key_arn { + object.key("EncryptionKeyArn").string(var_2.as_str()); + } + if let Some(var_3) = &input.item_filters { + #[allow(unused_mut)] + let mut object_4 = object.key("ItemFilters").start_object(); + crate::protocol_serde::shape_item_filters::ser_item_filters(&mut object_4, var_3)?; + object_4.finish(); + } + if let Some(var_5) = &input.name { + object.key("Name").string(var_5.as_str()); + } + if let Some(var_6) = &input.search_scope { + #[allow(unused_mut)] + let mut object_7 = object.key("SearchScope").start_object(); + crate::protocol_serde::shape_search_scope::ser_search_scope(&mut object_7, var_6)?; + object_7.finish(); + } + if let Some(var_8) = &input.tags { + #[allow(unused_mut)] + let mut object_9 = object.key("Tags").start_object(); + for (key_10, value_11) in var_8 { + if let Some(var_12) = value_11 { + object_9.key(key_10.as_str()).string(var_12.as_str()); + } else { + object_9.key(key_10.as_str()).null(); + } + } + object_9.finish(); + } + Ok(()) +} diff --git a/sdk/backupsearch/src/protocol_serde/shape_start_search_result_export_job.rs b/sdk/backupsearch/src/protocol_serde/shape_start_search_result_export_job.rs new file mode 100644 index 000000000000..94fd0c5e2e07 --- /dev/null +++ b/sdk/backupsearch/src/protocol_serde/shape_start_search_result_export_job.rs @@ -0,0 +1,222 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +#[allow(clippy::unnecessary_wraps)] +pub fn de_start_search_result_export_job_http_error( + _response_status: u16, + _response_headers: &::aws_smithy_runtime_api::http::Headers, + _response_body: &[u8], +) -> std::result::Result< + crate::operation::start_search_result_export_job::StartSearchResultExportJobOutput, + crate::operation::start_search_result_export_job::StartSearchResultExportJobError, +> { + #[allow(unused_mut)] + let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(_response_status, _response_headers, _response_body) + .map_err(crate::operation::start_search_result_export_job::StartSearchResultExportJobError::unhandled)?; + generic_builder = ::aws_types::request_id::apply_request_id(generic_builder, _response_headers); + let generic = generic_builder.build(); + let error_code = match generic.code() { + Some(code) => code, + None => return Err(crate::operation::start_search_result_export_job::StartSearchResultExportJobError::unhandled(generic)), + }; + + let _error_message = generic.message().map(|msg| msg.to_owned()); + Err(match error_code { + "ConflictException" => crate::operation::start_search_result_export_job::StartSearchResultExportJobError::ConflictException({ + #[allow(unused_mut)] + let mut tmp = { + #[allow(unused_mut)] + let mut output = crate::types::error::builders::ConflictExceptionBuilder::default(); + output = crate::protocol_serde::shape_conflict_exception::de_conflict_exception_json_err(_response_body, output) + .map_err(crate::operation::start_search_result_export_job::StartSearchResultExportJobError::unhandled)?; + let output = output.meta(generic); + crate::serde_util::conflict_exception_correct_errors(output) + .build() + .map_err(crate::operation::start_search_result_export_job::StartSearchResultExportJobError::unhandled)? + }; + tmp + }), + "ResourceNotFoundException" => { + crate::operation::start_search_result_export_job::StartSearchResultExportJobError::ResourceNotFoundException({ + #[allow(unused_mut)] + let mut tmp = { + #[allow(unused_mut)] + let mut output = crate::types::error::builders::ResourceNotFoundExceptionBuilder::default(); + output = + crate::protocol_serde::shape_resource_not_found_exception::de_resource_not_found_exception_json_err(_response_body, output) + .map_err(crate::operation::start_search_result_export_job::StartSearchResultExportJobError::unhandled)?; + let output = output.meta(generic); + crate::serde_util::resource_not_found_exception_correct_errors(output) + .build() + .map_err(crate::operation::start_search_result_export_job::StartSearchResultExportJobError::unhandled)? + }; + tmp + }) + } + "ServiceQuotaExceededException" => { + crate::operation::start_search_result_export_job::StartSearchResultExportJobError::ServiceQuotaExceededException({ + #[allow(unused_mut)] + let mut tmp = { + #[allow(unused_mut)] + let mut output = crate::types::error::builders::ServiceQuotaExceededExceptionBuilder::default(); + output = crate::protocol_serde::shape_service_quota_exceeded_exception::de_service_quota_exceeded_exception_json_err( + _response_body, + output, + ) + .map_err(crate::operation::start_search_result_export_job::StartSearchResultExportJobError::unhandled)?; + let output = output.meta(generic); + crate::serde_util::service_quota_exceeded_exception_correct_errors(output) + .build() + .map_err(crate::operation::start_search_result_export_job::StartSearchResultExportJobError::unhandled)? + }; + tmp + }) + } + "AccessDeniedException" => crate::operation::start_search_result_export_job::StartSearchResultExportJobError::AccessDeniedException({ + #[allow(unused_mut)] + let mut tmp = { + #[allow(unused_mut)] + let mut output = crate::types::error::builders::AccessDeniedExceptionBuilder::default(); + output = crate::protocol_serde::shape_access_denied_exception::de_access_denied_exception_json_err(_response_body, output) + .map_err(crate::operation::start_search_result_export_job::StartSearchResultExportJobError::unhandled)?; + let output = output.meta(generic); + crate::serde_util::access_denied_exception_correct_errors(output) + .build() + .map_err(crate::operation::start_search_result_export_job::StartSearchResultExportJobError::unhandled)? + }; + tmp + }), + "InternalServerException" => crate::operation::start_search_result_export_job::StartSearchResultExportJobError::InternalServerException({ + #[allow(unused_mut)] + let mut tmp = { + #[allow(unused_mut)] + let mut output = crate::types::error::builders::InternalServerExceptionBuilder::default(); + output = crate::protocol_serde::shape_internal_server_exception::de_internal_server_exception_json_err(_response_body, output) + .map_err(crate::operation::start_search_result_export_job::StartSearchResultExportJobError::unhandled)?; + output = output.set_retry_after_seconds( + crate::protocol_serde::shape_internal_server_exception::de_retry_after_seconds_header(_response_headers).map_err(|_| { + crate::operation::start_search_result_export_job::StartSearchResultExportJobError::unhandled( + "Failed to parse retryAfterSeconds from header `Retry-After", + ) + })?, + ); + let output = output.meta(generic); + crate::serde_util::internal_server_exception_correct_errors(output) + .build() + .map_err(crate::operation::start_search_result_export_job::StartSearchResultExportJobError::unhandled)? + }; + tmp + }), + "ThrottlingException" => crate::operation::start_search_result_export_job::StartSearchResultExportJobError::ThrottlingException({ + #[allow(unused_mut)] + let mut tmp = { + #[allow(unused_mut)] + let mut output = crate::types::error::builders::ThrottlingExceptionBuilder::default(); + output = crate::protocol_serde::shape_throttling_exception::de_throttling_exception_json_err(_response_body, output) + .map_err(crate::operation::start_search_result_export_job::StartSearchResultExportJobError::unhandled)?; + output = output.set_retry_after_seconds( + crate::protocol_serde::shape_throttling_exception::de_retry_after_seconds_header(_response_headers).map_err(|_| { + crate::operation::start_search_result_export_job::StartSearchResultExportJobError::unhandled( + "Failed to parse retryAfterSeconds from header `Retry-After", + ) + })?, + ); + let output = output.meta(generic); + crate::serde_util::throttling_exception_correct_errors(output) + .build() + .map_err(crate::operation::start_search_result_export_job::StartSearchResultExportJobError::unhandled)? + }; + tmp + }), + "ValidationException" => crate::operation::start_search_result_export_job::StartSearchResultExportJobError::ValidationException({ + #[allow(unused_mut)] + let mut tmp = { + #[allow(unused_mut)] + let mut output = crate::types::error::builders::ValidationExceptionBuilder::default(); + output = crate::protocol_serde::shape_validation_exception::de_validation_exception_json_err(_response_body, output) + .map_err(crate::operation::start_search_result_export_job::StartSearchResultExportJobError::unhandled)?; + let output = output.meta(generic); + crate::serde_util::validation_exception_correct_errors(output) + .build() + .map_err(crate::operation::start_search_result_export_job::StartSearchResultExportJobError::unhandled)? + }; + tmp + }), + _ => crate::operation::start_search_result_export_job::StartSearchResultExportJobError::generic(generic), + }) +} + +#[allow(clippy::unnecessary_wraps)] +pub fn de_start_search_result_export_job_http_response( + _response_status: u16, + _response_headers: &::aws_smithy_runtime_api::http::Headers, + _response_body: &[u8], +) -> std::result::Result< + crate::operation::start_search_result_export_job::StartSearchResultExportJobOutput, + crate::operation::start_search_result_export_job::StartSearchResultExportJobError, +> { + Ok({ + #[allow(unused_mut)] + let mut output = crate::operation::start_search_result_export_job::builders::StartSearchResultExportJobOutputBuilder::default(); + output = crate::protocol_serde::shape_start_search_result_export_job::de_start_search_result_export_job(_response_body, output) + .map_err(crate::operation::start_search_result_export_job::StartSearchResultExportJobError::unhandled)?; + output._set_request_id(::aws_types::request_id::RequestId::request_id(_response_headers).map(str::to_string)); + crate::serde_util::start_search_result_export_job_output_output_correct_errors(output) + .build() + .map_err(crate::operation::start_search_result_export_job::StartSearchResultExportJobError::unhandled)? + }) +} + +pub fn ser_start_search_result_export_job_input( + input: &crate::operation::start_search_result_export_job::StartSearchResultExportJobInput, +) -> Result<::aws_smithy_types::body::SdkBody, ::aws_smithy_types::error::operation::SerializationError> { + let mut out = String::new(); + let mut object = ::aws_smithy_json::serialize::JsonObjectWriter::new(&mut out); + crate::protocol_serde::shape_start_search_result_export_job_input::ser_start_search_result_export_job_input_input(&mut object, input)?; + object.finish(); + Ok(::aws_smithy_types::body::SdkBody::from(out)) +} + +pub(crate) fn de_start_search_result_export_job( + value: &[u8], + mut builder: crate::operation::start_search_result_export_job::builders::StartSearchResultExportJobOutputBuilder, +) -> Result< + crate::operation::start_search_result_export_job::builders::StartSearchResultExportJobOutputBuilder, + ::aws_smithy_json::deserialize::error::DeserializeError, +> { + let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(value)).peekable(); + let tokens = &mut tokens_owned; + ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; + loop { + match tokens.next().transpose()? { + Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break, + Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() { + "ExportJobArn" => { + builder = builder.set_export_job_arn( + ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())? + .map(|s| s.to_unescaped().map(|u| u.into_owned())) + .transpose()?, + ); + } + "ExportJobIdentifier" => { + builder = builder.set_export_job_identifier( + ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())? + .map(|s| s.to_unescaped().map(|u| u.into_owned())) + .transpose()?, + ); + } + _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?, + }, + other => { + return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!( + "expected object key or end object, found: {:?}", + other + ))) + } + } + } + if tokens.next().is_some() { + return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom( + "found more JSON tokens after completing parsing", + )); + } + Ok(builder) +} diff --git a/sdk/backupsearch/src/protocol_serde/shape_start_search_result_export_job_input.rs b/sdk/backupsearch/src/protocol_serde/shape_start_search_result_export_job_input.rs new file mode 100644 index 000000000000..ff56a14b6873 --- /dev/null +++ b/sdk/backupsearch/src/protocol_serde/shape_start_search_result_export_job_input.rs @@ -0,0 +1,34 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +pub fn ser_start_search_result_export_job_input_input( + object: &mut ::aws_smithy_json::serialize::JsonObjectWriter, + input: &crate::operation::start_search_result_export_job::StartSearchResultExportJobInput, +) -> Result<(), ::aws_smithy_types::error::operation::SerializationError> { + if let Some(var_1) = &input.client_token { + object.key("ClientToken").string(var_1.as_str()); + } + if let Some(var_2) = &input.export_specification { + #[allow(unused_mut)] + let mut object_3 = object.key("ExportSpecification").start_object(); + crate::protocol_serde::shape_export_specification::ser_export_specification(&mut object_3, var_2)?; + object_3.finish(); + } + if let Some(var_4) = &input.role_arn { + object.key("RoleArn").string(var_4.as_str()); + } + if let Some(var_5) = &input.search_job_identifier { + object.key("SearchJobIdentifier").string(var_5.as_str()); + } + if let Some(var_6) = &input.tags { + #[allow(unused_mut)] + let mut object_7 = object.key("Tags").start_object(); + for (key_8, value_9) in var_6 { + if let Some(var_10) = value_9 { + object_7.key(key_8.as_str()).string(var_10.as_str()); + } else { + object_7.key(key_8.as_str()).null(); + } + } + object_7.finish(); + } + Ok(()) +} diff --git a/sdk/backupsearch/src/protocol_serde/shape_stop_search_job.rs b/sdk/backupsearch/src/protocol_serde/shape_stop_search_job.rs new file mode 100644 index 000000000000..afaad0c2b0ab --- /dev/null +++ b/sdk/backupsearch/src/protocol_serde/shape_stop_search_job.rs @@ -0,0 +1,130 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +#[allow(clippy::unnecessary_wraps)] +pub fn de_stop_search_job_http_error( + _response_status: u16, + _response_headers: &::aws_smithy_runtime_api::http::Headers, + _response_body: &[u8], +) -> std::result::Result { + #[allow(unused_mut)] + let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(_response_status, _response_headers, _response_body) + .map_err(crate::operation::stop_search_job::StopSearchJobError::unhandled)?; + generic_builder = ::aws_types::request_id::apply_request_id(generic_builder, _response_headers); + let generic = generic_builder.build(); + let error_code = match generic.code() { + Some(code) => code, + None => return Err(crate::operation::stop_search_job::StopSearchJobError::unhandled(generic)), + }; + + let _error_message = generic.message().map(|msg| msg.to_owned()); + Err(match error_code { + "ConflictException" => crate::operation::stop_search_job::StopSearchJobError::ConflictException({ + #[allow(unused_mut)] + let mut tmp = { + #[allow(unused_mut)] + let mut output = crate::types::error::builders::ConflictExceptionBuilder::default(); + output = crate::protocol_serde::shape_conflict_exception::de_conflict_exception_json_err(_response_body, output) + .map_err(crate::operation::stop_search_job::StopSearchJobError::unhandled)?; + let output = output.meta(generic); + crate::serde_util::conflict_exception_correct_errors(output) + .build() + .map_err(crate::operation::stop_search_job::StopSearchJobError::unhandled)? + }; + tmp + }), + "ResourceNotFoundException" => crate::operation::stop_search_job::StopSearchJobError::ResourceNotFoundException({ + #[allow(unused_mut)] + let mut tmp = { + #[allow(unused_mut)] + let mut output = crate::types::error::builders::ResourceNotFoundExceptionBuilder::default(); + output = crate::protocol_serde::shape_resource_not_found_exception::de_resource_not_found_exception_json_err(_response_body, output) + .map_err(crate::operation::stop_search_job::StopSearchJobError::unhandled)?; + let output = output.meta(generic); + crate::serde_util::resource_not_found_exception_correct_errors(output) + .build() + .map_err(crate::operation::stop_search_job::StopSearchJobError::unhandled)? + }; + tmp + }), + "AccessDeniedException" => crate::operation::stop_search_job::StopSearchJobError::AccessDeniedException({ + #[allow(unused_mut)] + let mut tmp = { + #[allow(unused_mut)] + let mut output = crate::types::error::builders::AccessDeniedExceptionBuilder::default(); + output = crate::protocol_serde::shape_access_denied_exception::de_access_denied_exception_json_err(_response_body, output) + .map_err(crate::operation::stop_search_job::StopSearchJobError::unhandled)?; + let output = output.meta(generic); + crate::serde_util::access_denied_exception_correct_errors(output) + .build() + .map_err(crate::operation::stop_search_job::StopSearchJobError::unhandled)? + }; + tmp + }), + "InternalServerException" => crate::operation::stop_search_job::StopSearchJobError::InternalServerException({ + #[allow(unused_mut)] + let mut tmp = { + #[allow(unused_mut)] + let mut output = crate::types::error::builders::InternalServerExceptionBuilder::default(); + output = crate::protocol_serde::shape_internal_server_exception::de_internal_server_exception_json_err(_response_body, output) + .map_err(crate::operation::stop_search_job::StopSearchJobError::unhandled)?; + output = output.set_retry_after_seconds( + crate::protocol_serde::shape_internal_server_exception::de_retry_after_seconds_header(_response_headers).map_err(|_| { + crate::operation::stop_search_job::StopSearchJobError::unhandled("Failed to parse retryAfterSeconds from header `Retry-After") + })?, + ); + let output = output.meta(generic); + crate::serde_util::internal_server_exception_correct_errors(output) + .build() + .map_err(crate::operation::stop_search_job::StopSearchJobError::unhandled)? + }; + tmp + }), + "ThrottlingException" => crate::operation::stop_search_job::StopSearchJobError::ThrottlingException({ + #[allow(unused_mut)] + let mut tmp = { + #[allow(unused_mut)] + let mut output = crate::types::error::builders::ThrottlingExceptionBuilder::default(); + output = crate::protocol_serde::shape_throttling_exception::de_throttling_exception_json_err(_response_body, output) + .map_err(crate::operation::stop_search_job::StopSearchJobError::unhandled)?; + output = output.set_retry_after_seconds( + crate::protocol_serde::shape_throttling_exception::de_retry_after_seconds_header(_response_headers).map_err(|_| { + crate::operation::stop_search_job::StopSearchJobError::unhandled("Failed to parse retryAfterSeconds from header `Retry-After") + })?, + ); + let output = output.meta(generic); + crate::serde_util::throttling_exception_correct_errors(output) + .build() + .map_err(crate::operation::stop_search_job::StopSearchJobError::unhandled)? + }; + tmp + }), + "ValidationException" => crate::operation::stop_search_job::StopSearchJobError::ValidationException({ + #[allow(unused_mut)] + let mut tmp = { + #[allow(unused_mut)] + let mut output = crate::types::error::builders::ValidationExceptionBuilder::default(); + output = crate::protocol_serde::shape_validation_exception::de_validation_exception_json_err(_response_body, output) + .map_err(crate::operation::stop_search_job::StopSearchJobError::unhandled)?; + let output = output.meta(generic); + crate::serde_util::validation_exception_correct_errors(output) + .build() + .map_err(crate::operation::stop_search_job::StopSearchJobError::unhandled)? + }; + tmp + }), + _ => crate::operation::stop_search_job::StopSearchJobError::generic(generic), + }) +} + +#[allow(clippy::unnecessary_wraps)] +pub fn de_stop_search_job_http_response( + _response_status: u16, + _response_headers: &::aws_smithy_runtime_api::http::Headers, + _response_body: &[u8], +) -> std::result::Result { + Ok({ + #[allow(unused_mut)] + let mut output = crate::operation::stop_search_job::builders::StopSearchJobOutputBuilder::default(); + output._set_request_id(::aws_types::request_id::RequestId::request_id(_response_headers).map(str::to_string)); + output.build() + }) +} diff --git a/sdk/backupsearch/src/protocol_serde/shape_string_condition.rs b/sdk/backupsearch/src/protocol_serde/shape_string_condition.rs new file mode 100644 index 000000000000..eacbeef4258f --- /dev/null +++ b/sdk/backupsearch/src/protocol_serde/shape_string_condition.rs @@ -0,0 +1,62 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +pub fn ser_string_condition( + object: &mut ::aws_smithy_json::serialize::JsonObjectWriter, + input: &crate::types::StringCondition, +) -> Result<(), ::aws_smithy_types::error::operation::SerializationError> { + { + object.key("Value").string(input.value.as_str()); + } + { + object.key("Operator").string(input.operator.as_str()); + } + Ok(()) +} + +pub(crate) fn de_string_condition<'a, I>( + tokens: &mut ::std::iter::Peekable, +) -> Result, ::aws_smithy_json::deserialize::error::DeserializeError> +where + I: Iterator, ::aws_smithy_json::deserialize::error::DeserializeError>>, +{ + match tokens.next().transpose()? { + Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), + Some(::aws_smithy_json::deserialize::Token::StartObject { .. }) => { + #[allow(unused_mut)] + let mut builder = crate::types::builders::StringConditionBuilder::default(); + loop { + match tokens.next().transpose()? { + Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break, + Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() { + "Value" => { + builder = builder.set_value( + ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())? + .map(|s| s.to_unescaped().map(|u| u.into_owned())) + .transpose()?, + ); + } + "Operator" => { + builder = builder.set_operator( + ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())? + .map(|s| s.to_unescaped().map(|u| crate::types::StringConditionOperator::from(u.as_ref()))) + .transpose()?, + ); + } + _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?, + }, + other => { + return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!( + "expected object key or end object, found: {:?}", + other + ))) + } + } + } + Ok(Some(crate::serde_util::string_condition_correct_errors(builder).build().map_err( + |err| ::aws_smithy_json::deserialize::error::DeserializeError::custom_source("Response was invalid", err), + )?)) + } + _ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom( + "expected start object or null", + )), + } +} diff --git a/sdk/backupsearch/src/protocol_serde/shape_string_condition_list.rs b/sdk/backupsearch/src/protocol_serde/shape_string_condition_list.rs new file mode 100644 index 000000000000..7379afc2ff50 --- /dev/null +++ b/sdk/backupsearch/src/protocol_serde/shape_string_condition_list.rs @@ -0,0 +1,32 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +pub(crate) fn de_string_condition_list<'a, I>( + tokens: &mut ::std::iter::Peekable, +) -> Result>, ::aws_smithy_json::deserialize::error::DeserializeError> +where + I: Iterator, ::aws_smithy_json::deserialize::error::DeserializeError>>, +{ + match tokens.next().transpose()? { + Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), + Some(::aws_smithy_json::deserialize::Token::StartArray { .. }) => { + let mut items = Vec::new(); + loop { + match tokens.peek() { + Some(Ok(::aws_smithy_json::deserialize::Token::EndArray { .. })) => { + tokens.next().transpose().unwrap(); + break; + } + _ => { + let value = crate::protocol_serde::shape_string_condition::de_string_condition(tokens)?; + if let Some(value) = value { + items.push(value); + } + } + } + } + Ok(Some(items)) + } + _ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom( + "expected start array or null", + )), + } +} diff --git a/sdk/backupsearch/src/protocol_serde/shape_tag_map.rs b/sdk/backupsearch/src/protocol_serde/shape_tag_map.rs new file mode 100644 index 000000000000..6ca9e62478e5 --- /dev/null +++ b/sdk/backupsearch/src/protocol_serde/shape_tag_map.rs @@ -0,0 +1,39 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +pub(crate) fn de_tag_map<'a, I>( + tokens: &mut ::std::iter::Peekable, +) -> Result< + Option<::std::collections::HashMap<::std::string::String, ::std::option::Option<::std::string::String>>>, + ::aws_smithy_json::deserialize::error::DeserializeError, +> +where + I: Iterator, ::aws_smithy_json::deserialize::error::DeserializeError>>, +{ + match tokens.next().transpose()? { + Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), + Some(::aws_smithy_json::deserialize::Token::StartObject { .. }) => { + let mut map = ::std::collections::HashMap::new(); + loop { + match tokens.next().transpose()? { + Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break, + Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { + let key = key.to_unescaped().map(|u| u.into_owned())?; + let value = ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())? + .map(|s| s.to_unescaped().map(|u| u.into_owned())) + .transpose()?; + map.insert(key, value); + } + other => { + return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!( + "expected object key or end object, found: {:?}", + other + ))) + } + } + } + Ok(Some(map)) + } + _ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom( + "expected start object or null", + )), + } +} diff --git a/sdk/backupsearch/src/protocol_serde/shape_tag_resource.rs b/sdk/backupsearch/src/protocol_serde/shape_tag_resource.rs new file mode 100644 index 000000000000..f196d5e409a0 --- /dev/null +++ b/sdk/backupsearch/src/protocol_serde/shape_tag_resource.rs @@ -0,0 +1,126 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +#[allow(clippy::unnecessary_wraps)] +pub fn de_tag_resource_http_error( + _response_status: u16, + _response_headers: &::aws_smithy_runtime_api::http::Headers, + _response_body: &[u8], +) -> std::result::Result { + #[allow(unused_mut)] + let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(_response_status, _response_headers, _response_body) + .map_err(crate::operation::tag_resource::TagResourceError::unhandled)?; + generic_builder = ::aws_types::request_id::apply_request_id(generic_builder, _response_headers); + let generic = generic_builder.build(); + let error_code = match generic.code() { + Some(code) => code, + None => return Err(crate::operation::tag_resource::TagResourceError::unhandled(generic)), + }; + + let _error_message = generic.message().map(|msg| msg.to_owned()); + Err(match error_code { + "ResourceNotFoundException" => crate::operation::tag_resource::TagResourceError::ResourceNotFoundException({ + #[allow(unused_mut)] + let mut tmp = { + #[allow(unused_mut)] + let mut output = crate::types::error::builders::ResourceNotFoundExceptionBuilder::default(); + output = crate::protocol_serde::shape_resource_not_found_exception::de_resource_not_found_exception_json_err(_response_body, output) + .map_err(crate::operation::tag_resource::TagResourceError::unhandled)?; + let output = output.meta(generic); + crate::serde_util::resource_not_found_exception_correct_errors(output) + .build() + .map_err(crate::operation::tag_resource::TagResourceError::unhandled)? + }; + tmp + }), + "AccessDeniedException" => crate::operation::tag_resource::TagResourceError::AccessDeniedException({ + #[allow(unused_mut)] + let mut tmp = { + #[allow(unused_mut)] + let mut output = crate::types::error::builders::AccessDeniedExceptionBuilder::default(); + output = crate::protocol_serde::shape_access_denied_exception::de_access_denied_exception_json_err(_response_body, output) + .map_err(crate::operation::tag_resource::TagResourceError::unhandled)?; + let output = output.meta(generic); + crate::serde_util::access_denied_exception_correct_errors(output) + .build() + .map_err(crate::operation::tag_resource::TagResourceError::unhandled)? + }; + tmp + }), + "InternalServerException" => crate::operation::tag_resource::TagResourceError::InternalServerException({ + #[allow(unused_mut)] + let mut tmp = { + #[allow(unused_mut)] + let mut output = crate::types::error::builders::InternalServerExceptionBuilder::default(); + output = crate::protocol_serde::shape_internal_server_exception::de_internal_server_exception_json_err(_response_body, output) + .map_err(crate::operation::tag_resource::TagResourceError::unhandled)?; + output = output.set_retry_after_seconds( + crate::protocol_serde::shape_internal_server_exception::de_retry_after_seconds_header(_response_headers).map_err(|_| { + crate::operation::tag_resource::TagResourceError::unhandled("Failed to parse retryAfterSeconds from header `Retry-After") + })?, + ); + let output = output.meta(generic); + crate::serde_util::internal_server_exception_correct_errors(output) + .build() + .map_err(crate::operation::tag_resource::TagResourceError::unhandled)? + }; + tmp + }), + "ThrottlingException" => crate::operation::tag_resource::TagResourceError::ThrottlingException({ + #[allow(unused_mut)] + let mut tmp = { + #[allow(unused_mut)] + let mut output = crate::types::error::builders::ThrottlingExceptionBuilder::default(); + output = crate::protocol_serde::shape_throttling_exception::de_throttling_exception_json_err(_response_body, output) + .map_err(crate::operation::tag_resource::TagResourceError::unhandled)?; + output = output.set_retry_after_seconds( + crate::protocol_serde::shape_throttling_exception::de_retry_after_seconds_header(_response_headers).map_err(|_| { + crate::operation::tag_resource::TagResourceError::unhandled("Failed to parse retryAfterSeconds from header `Retry-After") + })?, + ); + let output = output.meta(generic); + crate::serde_util::throttling_exception_correct_errors(output) + .build() + .map_err(crate::operation::tag_resource::TagResourceError::unhandled)? + }; + tmp + }), + "ValidationException" => crate::operation::tag_resource::TagResourceError::ValidationException({ + #[allow(unused_mut)] + let mut tmp = { + #[allow(unused_mut)] + let mut output = crate::types::error::builders::ValidationExceptionBuilder::default(); + output = crate::protocol_serde::shape_validation_exception::de_validation_exception_json_err(_response_body, output) + .map_err(crate::operation::tag_resource::TagResourceError::unhandled)?; + let output = output.meta(generic); + crate::serde_util::validation_exception_correct_errors(output) + .build() + .map_err(crate::operation::tag_resource::TagResourceError::unhandled)? + }; + tmp + }), + _ => crate::operation::tag_resource::TagResourceError::generic(generic), + }) +} + +#[allow(clippy::unnecessary_wraps)] +pub fn de_tag_resource_http_response( + _response_status: u16, + _response_headers: &::aws_smithy_runtime_api::http::Headers, + _response_body: &[u8], +) -> std::result::Result { + Ok({ + #[allow(unused_mut)] + let mut output = crate::operation::tag_resource::builders::TagResourceOutputBuilder::default(); + output._set_request_id(::aws_types::request_id::RequestId::request_id(_response_headers).map(str::to_string)); + output.build() + }) +} + +pub fn ser_tag_resource_input( + input: &crate::operation::tag_resource::TagResourceInput, +) -> Result<::aws_smithy_types::body::SdkBody, ::aws_smithy_types::error::operation::SerializationError> { + let mut out = String::new(); + let mut object = ::aws_smithy_json::serialize::JsonObjectWriter::new(&mut out); + crate::protocol_serde::shape_tag_resource_input::ser_tag_resource_input_input(&mut object, input)?; + object.finish(); + Ok(::aws_smithy_types::body::SdkBody::from(out)) +} diff --git a/sdk/backupsearch/src/protocol_serde/shape_tag_resource_input.rs b/sdk/backupsearch/src/protocol_serde/shape_tag_resource_input.rs new file mode 100644 index 000000000000..eea1c9c31666 --- /dev/null +++ b/sdk/backupsearch/src/protocol_serde/shape_tag_resource_input.rs @@ -0,0 +1,19 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +pub fn ser_tag_resource_input_input( + object: &mut ::aws_smithy_json::serialize::JsonObjectWriter, + input: &crate::operation::tag_resource::TagResourceInput, +) -> Result<(), ::aws_smithy_types::error::operation::SerializationError> { + if let Some(var_1) = &input.tags { + #[allow(unused_mut)] + let mut object_2 = object.key("Tags").start_object(); + for (key_3, value_4) in var_1 { + if let Some(var_5) = value_4 { + object_2.key(key_3.as_str()).string(var_5.as_str()); + } else { + object_2.key(key_3.as_str()).null(); + } + } + object_2.finish(); + } + Ok(()) +} diff --git a/sdk/backupsearch/src/protocol_serde/shape_throttling_exception.rs b/sdk/backupsearch/src/protocol_serde/shape_throttling_exception.rs new file mode 100644 index 000000000000..21232ac8ccb8 --- /dev/null +++ b/sdk/backupsearch/src/protocol_serde/shape_throttling_exception.rs @@ -0,0 +1,73 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +pub(crate) fn de_throttling_exception_json_err( + value: &[u8], + mut builder: crate::types::error::builders::ThrottlingExceptionBuilder, +) -> Result { + let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(value)).peekable(); + let tokens = &mut tokens_owned; + ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; + loop { + match tokens.next().transpose()? { + Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break, + Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() { + "message" => { + builder = builder.set_message( + ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())? + .map(|s| s.to_unescaped().map(|u| u.into_owned())) + .transpose()?, + ); + } + "serviceCode" => { + builder = builder.set_service_code( + ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())? + .map(|s| s.to_unescaped().map(|u| u.into_owned())) + .transpose()?, + ); + } + "quotaCode" => { + builder = builder.set_quota_code( + ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())? + .map(|s| s.to_unescaped().map(|u| u.into_owned())) + .transpose()?, + ); + } + "retryAfterSeconds" => { + builder = builder.set_retry_after_seconds( + ::aws_smithy_json::deserialize::token::expect_number_or_null(tokens.next())? + .map(i32::try_from) + .transpose()?, + ); + } + _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?, + }, + other => { + return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!( + "expected object key or end object, found: {:?}", + other + ))) + } + } + } + if tokens.next().is_some() { + return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom( + "found more JSON tokens after completing parsing", + )); + } + Ok(builder) +} + +pub(crate) fn de_retry_after_seconds_header( + header_map: &::aws_smithy_runtime_api::http::Headers, +) -> ::std::result::Result<::std::option::Option, ::aws_smithy_http::header::ParseError> { + let headers = header_map.get_all("Retry-After"); + let var_1 = ::aws_smithy_http::header::read_many_primitive::(headers)?; + if var_1.len() > 1 { + Err(::aws_smithy_http::header::ParseError::new(format!( + "expected one item but found {}", + var_1.len() + ))) + } else { + let mut var_1 = var_1; + Ok(var_1.pop()) + } +} diff --git a/sdk/backupsearch/src/protocol_serde/shape_time_condition.rs b/sdk/backupsearch/src/protocol_serde/shape_time_condition.rs new file mode 100644 index 000000000000..29e9edc5baa2 --- /dev/null +++ b/sdk/backupsearch/src/protocol_serde/shape_time_condition.rs @@ -0,0 +1,63 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +pub fn ser_time_condition( + object: &mut ::aws_smithy_json::serialize::JsonObjectWriter, + input: &crate::types::TimeCondition, +) -> Result<(), ::aws_smithy_types::error::operation::SerializationError> { + { + object + .key("Value") + .date_time(&input.value, ::aws_smithy_types::date_time::Format::EpochSeconds)?; + } + { + object.key("Operator").string(input.operator.as_str()); + } + Ok(()) +} + +pub(crate) fn de_time_condition<'a, I>( + tokens: &mut ::std::iter::Peekable, +) -> Result, ::aws_smithy_json::deserialize::error::DeserializeError> +where + I: Iterator, ::aws_smithy_json::deserialize::error::DeserializeError>>, +{ + match tokens.next().transpose()? { + Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), + Some(::aws_smithy_json::deserialize::Token::StartObject { .. }) => { + #[allow(unused_mut)] + let mut builder = crate::types::builders::TimeConditionBuilder::default(); + loop { + match tokens.next().transpose()? { + Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break, + Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() { + "Value" => { + builder = builder.set_value(::aws_smithy_json::deserialize::token::expect_timestamp_or_null( + tokens.next(), + ::aws_smithy_types::date_time::Format::EpochSeconds, + )?); + } + "Operator" => { + builder = builder.set_operator( + ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())? + .map(|s| s.to_unescaped().map(|u| crate::types::TimeConditionOperator::from(u.as_ref()))) + .transpose()?, + ); + } + _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?, + }, + other => { + return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!( + "expected object key or end object, found: {:?}", + other + ))) + } + } + } + Ok(Some(crate::serde_util::time_condition_correct_errors(builder).build().map_err( + |err| ::aws_smithy_json::deserialize::error::DeserializeError::custom_source("Response was invalid", err), + )?)) + } + _ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom( + "expected start object or null", + )), + } +} diff --git a/sdk/backupsearch/src/protocol_serde/shape_time_condition_list.rs b/sdk/backupsearch/src/protocol_serde/shape_time_condition_list.rs new file mode 100644 index 000000000000..7257a502ef18 --- /dev/null +++ b/sdk/backupsearch/src/protocol_serde/shape_time_condition_list.rs @@ -0,0 +1,32 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +pub(crate) fn de_time_condition_list<'a, I>( + tokens: &mut ::std::iter::Peekable, +) -> Result>, ::aws_smithy_json::deserialize::error::DeserializeError> +where + I: Iterator, ::aws_smithy_json::deserialize::error::DeserializeError>>, +{ + match tokens.next().transpose()? { + Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), + Some(::aws_smithy_json::deserialize::Token::StartArray { .. }) => { + let mut items = Vec::new(); + loop { + match tokens.peek() { + Some(Ok(::aws_smithy_json::deserialize::Token::EndArray { .. })) => { + tokens.next().transpose().unwrap(); + break; + } + _ => { + let value = crate::protocol_serde::shape_time_condition::de_time_condition(tokens)?; + if let Some(value) = value { + items.push(value); + } + } + } + } + Ok(Some(items)) + } + _ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom( + "expected start array or null", + )), + } +} diff --git a/sdk/backupsearch/src/protocol_serde/shape_untag_resource.rs b/sdk/backupsearch/src/protocol_serde/shape_untag_resource.rs new file mode 100644 index 000000000000..ace40f9b3221 --- /dev/null +++ b/sdk/backupsearch/src/protocol_serde/shape_untag_resource.rs @@ -0,0 +1,116 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +#[allow(clippy::unnecessary_wraps)] +pub fn de_untag_resource_http_error( + _response_status: u16, + _response_headers: &::aws_smithy_runtime_api::http::Headers, + _response_body: &[u8], +) -> std::result::Result { + #[allow(unused_mut)] + let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(_response_status, _response_headers, _response_body) + .map_err(crate::operation::untag_resource::UntagResourceError::unhandled)?; + generic_builder = ::aws_types::request_id::apply_request_id(generic_builder, _response_headers); + let generic = generic_builder.build(); + let error_code = match generic.code() { + Some(code) => code, + None => return Err(crate::operation::untag_resource::UntagResourceError::unhandled(generic)), + }; + + let _error_message = generic.message().map(|msg| msg.to_owned()); + Err(match error_code { + "ResourceNotFoundException" => crate::operation::untag_resource::UntagResourceError::ResourceNotFoundException({ + #[allow(unused_mut)] + let mut tmp = { + #[allow(unused_mut)] + let mut output = crate::types::error::builders::ResourceNotFoundExceptionBuilder::default(); + output = crate::protocol_serde::shape_resource_not_found_exception::de_resource_not_found_exception_json_err(_response_body, output) + .map_err(crate::operation::untag_resource::UntagResourceError::unhandled)?; + let output = output.meta(generic); + crate::serde_util::resource_not_found_exception_correct_errors(output) + .build() + .map_err(crate::operation::untag_resource::UntagResourceError::unhandled)? + }; + tmp + }), + "AccessDeniedException" => crate::operation::untag_resource::UntagResourceError::AccessDeniedException({ + #[allow(unused_mut)] + let mut tmp = { + #[allow(unused_mut)] + let mut output = crate::types::error::builders::AccessDeniedExceptionBuilder::default(); + output = crate::protocol_serde::shape_access_denied_exception::de_access_denied_exception_json_err(_response_body, output) + .map_err(crate::operation::untag_resource::UntagResourceError::unhandled)?; + let output = output.meta(generic); + crate::serde_util::access_denied_exception_correct_errors(output) + .build() + .map_err(crate::operation::untag_resource::UntagResourceError::unhandled)? + }; + tmp + }), + "InternalServerException" => crate::operation::untag_resource::UntagResourceError::InternalServerException({ + #[allow(unused_mut)] + let mut tmp = { + #[allow(unused_mut)] + let mut output = crate::types::error::builders::InternalServerExceptionBuilder::default(); + output = crate::protocol_serde::shape_internal_server_exception::de_internal_server_exception_json_err(_response_body, output) + .map_err(crate::operation::untag_resource::UntagResourceError::unhandled)?; + output = output.set_retry_after_seconds( + crate::protocol_serde::shape_internal_server_exception::de_retry_after_seconds_header(_response_headers).map_err(|_| { + crate::operation::untag_resource::UntagResourceError::unhandled("Failed to parse retryAfterSeconds from header `Retry-After") + })?, + ); + let output = output.meta(generic); + crate::serde_util::internal_server_exception_correct_errors(output) + .build() + .map_err(crate::operation::untag_resource::UntagResourceError::unhandled)? + }; + tmp + }), + "ThrottlingException" => crate::operation::untag_resource::UntagResourceError::ThrottlingException({ + #[allow(unused_mut)] + let mut tmp = { + #[allow(unused_mut)] + let mut output = crate::types::error::builders::ThrottlingExceptionBuilder::default(); + output = crate::protocol_serde::shape_throttling_exception::de_throttling_exception_json_err(_response_body, output) + .map_err(crate::operation::untag_resource::UntagResourceError::unhandled)?; + output = output.set_retry_after_seconds( + crate::protocol_serde::shape_throttling_exception::de_retry_after_seconds_header(_response_headers).map_err(|_| { + crate::operation::untag_resource::UntagResourceError::unhandled("Failed to parse retryAfterSeconds from header `Retry-After") + })?, + ); + let output = output.meta(generic); + crate::serde_util::throttling_exception_correct_errors(output) + .build() + .map_err(crate::operation::untag_resource::UntagResourceError::unhandled)? + }; + tmp + }), + "ValidationException" => crate::operation::untag_resource::UntagResourceError::ValidationException({ + #[allow(unused_mut)] + let mut tmp = { + #[allow(unused_mut)] + let mut output = crate::types::error::builders::ValidationExceptionBuilder::default(); + output = crate::protocol_serde::shape_validation_exception::de_validation_exception_json_err(_response_body, output) + .map_err(crate::operation::untag_resource::UntagResourceError::unhandled)?; + let output = output.meta(generic); + crate::serde_util::validation_exception_correct_errors(output) + .build() + .map_err(crate::operation::untag_resource::UntagResourceError::unhandled)? + }; + tmp + }), + _ => crate::operation::untag_resource::UntagResourceError::generic(generic), + }) +} + +#[allow(clippy::unnecessary_wraps)] +pub fn de_untag_resource_http_response( + _response_status: u16, + _response_headers: &::aws_smithy_runtime_api::http::Headers, + _response_body: &[u8], +) -> std::result::Result { + Ok({ + #[allow(unused_mut)] + let mut output = crate::operation::untag_resource::builders::UntagResourceOutputBuilder::default(); + output._set_request_id(::aws_types::request_id::RequestId::request_id(_response_headers).map(str::to_string)); + output.build() + }) +} diff --git a/sdk/backupsearch/src/protocol_serde/shape_validation_exception.rs b/sdk/backupsearch/src/protocol_serde/shape_validation_exception.rs new file mode 100644 index 000000000000..a0173754eba6 --- /dev/null +++ b/sdk/backupsearch/src/protocol_serde/shape_validation_exception.rs @@ -0,0 +1,36 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +pub(crate) fn de_validation_exception_json_err( + value: &[u8], + mut builder: crate::types::error::builders::ValidationExceptionBuilder, +) -> Result { + let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(value)).peekable(); + let tokens = &mut tokens_owned; + ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; + loop { + match tokens.next().transpose()? { + Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break, + Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() { + "message" => { + builder = builder.set_message( + ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())? + .map(|s| s.to_unescaped().map(|u| u.into_owned())) + .transpose()?, + ); + } + _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?, + }, + other => { + return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!( + "expected object key or end object, found: {:?}", + other + ))) + } + } + } + if tokens.next().is_some() { + return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom( + "found more JSON tokens after completing parsing", + )); + } + Ok(builder) +} diff --git a/sdk/backupsearch/src/sdk_feature_tracker.rs b/sdk/backupsearch/src/sdk_feature_tracker.rs new file mode 100644 index 000000000000..f052ed5e88a5 --- /dev/null +++ b/sdk/backupsearch/src/sdk_feature_tracker.rs @@ -0,0 +1,155 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +/* + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0 + */ + +#[allow(dead_code)] +pub(crate) mod rpc_v2_cbor { + use aws_smithy_runtime::client::sdk_feature::SmithySdkFeature; + use aws_smithy_runtime_api::box_error::BoxError; + use aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextMut; + use aws_smithy_runtime_api::client::interceptors::Intercept; + use aws_smithy_runtime_api::client::runtime_components::RuntimeComponents; + use aws_smithy_types::config_bag::ConfigBag; + + #[derive(Debug)] + pub(crate) struct RpcV2CborFeatureTrackerInterceptor; + + impl RpcV2CborFeatureTrackerInterceptor { + pub(crate) fn new() -> Self { + Self + } + } + + impl Intercept for RpcV2CborFeatureTrackerInterceptor { + fn name(&self) -> &'static str { + "RpcV2CborFeatureTrackerInterceptor" + } + + fn modify_before_serialization( + &self, + _context: &mut BeforeSerializationInterceptorContextMut<'_>, + _runtime_components: &RuntimeComponents, + cfg: &mut ConfigBag, + ) -> Result<(), BoxError> { + cfg.interceptor_state() + .store_append::(SmithySdkFeature::ProtocolRpcV2Cbor); + Ok(()) + } + } +} + +#[allow(dead_code)] +pub(crate) mod paginator { + use aws_smithy_runtime::client::sdk_feature::SmithySdkFeature; + use aws_smithy_runtime_api::box_error::BoxError; + use aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextMut; + use aws_smithy_runtime_api::client::interceptors::{Intercept, SharedInterceptor}; + use aws_smithy_runtime_api::client::runtime_components::{RuntimeComponents, RuntimeComponentsBuilder}; + use aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin; + use aws_smithy_types::config_bag::ConfigBag; + use std::borrow::Cow; + + #[derive(Debug)] + struct PaginatorFeatureTrackerInterceptor; + + impl PaginatorFeatureTrackerInterceptor { + pub(crate) fn new() -> Self { + Self + } + } + + impl Intercept for PaginatorFeatureTrackerInterceptor { + fn name(&self) -> &'static str { + "PaginatorFeatureTrackerInterceptor" + } + + fn modify_before_serialization( + &self, + _context: &mut BeforeSerializationInterceptorContextMut<'_>, + _runtime_components: &RuntimeComponents, + cfg: &mut ConfigBag, + ) -> Result<(), BoxError> { + cfg.interceptor_state().store_append::(SmithySdkFeature::Paginator); + Ok(()) + } + } + + #[derive(Debug)] + pub(crate) struct PaginatorFeatureTrackerRuntimePlugin { + runtime_components: RuntimeComponentsBuilder, + } + + impl PaginatorFeatureTrackerRuntimePlugin { + pub(crate) fn new() -> Self { + Self { + runtime_components: RuntimeComponentsBuilder::new("PaginatorFeatureTrackerRuntimePlugin") + .with_interceptor(SharedInterceptor::new(PaginatorFeatureTrackerInterceptor::new())), + } + } + } + + impl RuntimePlugin for PaginatorFeatureTrackerRuntimePlugin { + fn runtime_components(&self, _: &RuntimeComponentsBuilder) -> Cow<'_, RuntimeComponentsBuilder> { + Cow::Borrowed(&self.runtime_components) + } + } +} + +#[allow(dead_code)] +pub(crate) mod waiter { + use aws_smithy_runtime::client::sdk_feature::SmithySdkFeature; + use aws_smithy_runtime_api::box_error::BoxError; + use aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextMut; + use aws_smithy_runtime_api::client::interceptors::{Intercept, SharedInterceptor}; + use aws_smithy_runtime_api::client::runtime_components::{RuntimeComponents, RuntimeComponentsBuilder}; + use aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin; + use aws_smithy_types::config_bag::ConfigBag; + use std::borrow::Cow; + + #[derive(Debug)] + struct WaiterFeatureTrackerInterceptor; + + impl WaiterFeatureTrackerInterceptor { + pub(crate) fn new() -> Self { + Self + } + } + + impl Intercept for WaiterFeatureTrackerInterceptor { + fn name(&self) -> &'static str { + "WaiterFeatureTrackerInterceptor" + } + + fn modify_before_serialization( + &self, + _context: &mut BeforeSerializationInterceptorContextMut<'_>, + _runtime_components: &RuntimeComponents, + cfg: &mut ConfigBag, + ) -> Result<(), BoxError> { + cfg.interceptor_state().store_append::(SmithySdkFeature::Waiter); + Ok(()) + } + } + + #[derive(Debug)] + pub(crate) struct WaiterFeatureTrackerRuntimePlugin { + runtime_components: RuntimeComponentsBuilder, + } + + impl WaiterFeatureTrackerRuntimePlugin { + pub(crate) fn new() -> Self { + Self { + runtime_components: RuntimeComponentsBuilder::new("WaiterFeatureTrackerRuntimePlugin") + .with_interceptor(SharedInterceptor::new(WaiterFeatureTrackerInterceptor::new())), + } + } + } + + impl RuntimePlugin for WaiterFeatureTrackerRuntimePlugin { + fn runtime_components(&self, _: &RuntimeComponentsBuilder) -> Cow<'_, RuntimeComponentsBuilder> { + Cow::Borrowed(&self.runtime_components) + } + } +} diff --git a/sdk/backupsearch/src/serde_util.rs b/sdk/backupsearch/src/serde_util.rs new file mode 100644 index 000000000000..6f101abc2d29 --- /dev/null +++ b/sdk/backupsearch/src/serde_util.rs @@ -0,0 +1,223 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +pub(crate) fn resource_not_found_exception_correct_errors( + mut builder: crate::types::error::builders::ResourceNotFoundExceptionBuilder, +) -> crate::types::error::builders::ResourceNotFoundExceptionBuilder { + if builder.message.is_none() { + builder.message = Some(Default::default()) + } + if builder.resource_id.is_none() { + builder.resource_id = Some(Default::default()) + } + if builder.resource_type.is_none() { + builder.resource_type = Some(Default::default()) + } + builder +} + +pub(crate) fn access_denied_exception_correct_errors( + mut builder: crate::types::error::builders::AccessDeniedExceptionBuilder, +) -> crate::types::error::builders::AccessDeniedExceptionBuilder { + if builder.message.is_none() { + builder.message = Some(Default::default()) + } + builder +} + +pub(crate) fn internal_server_exception_correct_errors( + mut builder: crate::types::error::builders::InternalServerExceptionBuilder, +) -> crate::types::error::builders::InternalServerExceptionBuilder { + if builder.message.is_none() { + builder.message = Some(Default::default()) + } + builder +} + +pub(crate) fn throttling_exception_correct_errors( + mut builder: crate::types::error::builders::ThrottlingExceptionBuilder, +) -> crate::types::error::builders::ThrottlingExceptionBuilder { + if builder.message.is_none() { + builder.message = Some(Default::default()) + } + builder +} + +pub(crate) fn validation_exception_correct_errors( + mut builder: crate::types::error::builders::ValidationExceptionBuilder, +) -> crate::types::error::builders::ValidationExceptionBuilder { + if builder.message.is_none() { + builder.message = Some(Default::default()) + } + builder +} + +pub(crate) fn get_search_job_output_output_correct_errors( + mut builder: crate::operation::get_search_job::builders::GetSearchJobOutputBuilder, +) -> crate::operation::get_search_job::builders::GetSearchJobOutputBuilder { + if builder.status.is_none() { + builder.status = "no value was set".parse::().ok() + } + if builder.search_scope.is_none() { + builder.search_scope = { + let builder = crate::types::builders::SearchScopeBuilder::default(); + crate::serde_util::search_scope_correct_errors(builder).build().ok() + } + } + if builder.item_filters.is_none() { + builder.item_filters = { + let builder = crate::types::builders::ItemFiltersBuilder::default(); + Some(builder.build()) + } + } + if builder.creation_time.is_none() { + builder.creation_time = Some(::aws_smithy_types::DateTime::from_fractional_secs(0, 0_f64)) + } + if builder.search_job_identifier.is_none() { + builder.search_job_identifier = Some(Default::default()) + } + if builder.search_job_arn.is_none() { + builder.search_job_arn = Some(Default::default()) + } + builder +} + +pub(crate) fn get_search_result_export_job_output_output_correct_errors( + mut builder: crate::operation::get_search_result_export_job::builders::GetSearchResultExportJobOutputBuilder, +) -> crate::operation::get_search_result_export_job::builders::GetSearchResultExportJobOutputBuilder { + if builder.export_job_identifier.is_none() { + builder.export_job_identifier = Some(Default::default()) + } + builder +} + +pub(crate) fn list_search_job_backups_output_output_correct_errors( + mut builder: crate::operation::list_search_job_backups::builders::ListSearchJobBackupsOutputBuilder, +) -> crate::operation::list_search_job_backups::builders::ListSearchJobBackupsOutputBuilder { + if builder.results.is_none() { + builder.results = Some(Default::default()) + } + builder +} + +pub(crate) fn list_search_job_results_output_output_correct_errors( + mut builder: crate::operation::list_search_job_results::builders::ListSearchJobResultsOutputBuilder, +) -> crate::operation::list_search_job_results::builders::ListSearchJobResultsOutputBuilder { + if builder.results.is_none() { + builder.results = Some(Default::default()) + } + builder +} + +pub(crate) fn list_search_jobs_output_output_correct_errors( + mut builder: crate::operation::list_search_jobs::builders::ListSearchJobsOutputBuilder, +) -> crate::operation::list_search_jobs::builders::ListSearchJobsOutputBuilder { + if builder.search_jobs.is_none() { + builder.search_jobs = Some(Default::default()) + } + builder +} + +pub(crate) fn service_quota_exceeded_exception_correct_errors( + mut builder: crate::types::error::builders::ServiceQuotaExceededExceptionBuilder, +) -> crate::types::error::builders::ServiceQuotaExceededExceptionBuilder { + if builder.message.is_none() { + builder.message = Some(Default::default()) + } + if builder.resource_id.is_none() { + builder.resource_id = Some(Default::default()) + } + if builder.resource_type.is_none() { + builder.resource_type = Some(Default::default()) + } + if builder.service_code.is_none() { + builder.service_code = Some(Default::default()) + } + if builder.quota_code.is_none() { + builder.quota_code = Some(Default::default()) + } + builder +} + +pub(crate) fn list_search_result_export_jobs_output_output_correct_errors( + mut builder: crate::operation::list_search_result_export_jobs::builders::ListSearchResultExportJobsOutputBuilder, +) -> crate::operation::list_search_result_export_jobs::builders::ListSearchResultExportJobsOutputBuilder { + if builder.export_jobs.is_none() { + builder.export_jobs = Some(Default::default()) + } + builder +} + +pub(crate) fn conflict_exception_correct_errors( + mut builder: crate::types::error::builders::ConflictExceptionBuilder, +) -> crate::types::error::builders::ConflictExceptionBuilder { + if builder.message.is_none() { + builder.message = Some(Default::default()) + } + if builder.resource_id.is_none() { + builder.resource_id = Some(Default::default()) + } + if builder.resource_type.is_none() { + builder.resource_type = Some(Default::default()) + } + builder +} + +pub(crate) fn start_search_result_export_job_output_output_correct_errors( + mut builder: crate::operation::start_search_result_export_job::builders::StartSearchResultExportJobOutputBuilder, +) -> crate::operation::start_search_result_export_job::builders::StartSearchResultExportJobOutputBuilder { + if builder.export_job_identifier.is_none() { + builder.export_job_identifier = Some(Default::default()) + } + builder +} + +pub(crate) fn search_scope_correct_errors(mut builder: crate::types::builders::SearchScopeBuilder) -> crate::types::builders::SearchScopeBuilder { + if builder.backup_resource_types.is_none() { + builder.backup_resource_types = Some(Default::default()) + } + builder +} + +pub(crate) fn export_job_summary_correct_errors( + mut builder: crate::types::builders::ExportJobSummaryBuilder, +) -> crate::types::builders::ExportJobSummaryBuilder { + if builder.export_job_identifier.is_none() { + builder.export_job_identifier = Some(Default::default()) + } + builder +} + +pub(crate) fn s3_export_specification_correct_errors( + mut builder: crate::types::builders::S3ExportSpecificationBuilder, +) -> crate::types::builders::S3ExportSpecificationBuilder { + if builder.destination_bucket.is_none() { + builder.destination_bucket = Some(Default::default()) + } + builder +} + +pub(crate) fn long_condition_correct_errors( + mut builder: crate::types::builders::LongConditionBuilder, +) -> crate::types::builders::LongConditionBuilder { + if builder.value.is_none() { + builder.value = Some(Default::default()) + } + builder +} + +pub(crate) fn string_condition_correct_errors( + mut builder: crate::types::builders::StringConditionBuilder, +) -> crate::types::builders::StringConditionBuilder { + if builder.value.is_none() { + builder.value = Some(Default::default()) + } + builder +} + +pub(crate) fn time_condition_correct_errors( + mut builder: crate::types::builders::TimeConditionBuilder, +) -> crate::types::builders::TimeConditionBuilder { + if builder.value.is_none() { + builder.value = Some(::aws_smithy_types::DateTime::from_fractional_secs(0, 0_f64)) + } + builder +} diff --git a/sdk/backupsearch/src/serialization_settings.rs b/sdk/backupsearch/src/serialization_settings.rs new file mode 100644 index 000000000000..b543b8ad0b70 --- /dev/null +++ b/sdk/backupsearch/src/serialization_settings.rs @@ -0,0 +1,84 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +/* + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0 + */ + +#![allow(dead_code)] + +use aws_smithy_http::header::set_request_header_if_absent; +use aws_smithy_types::config_bag::{Storable, StoreReplace}; +use http::header::{HeaderName, CONTENT_LENGTH, CONTENT_TYPE}; + +/// Configuration for how default protocol headers are serialized +#[derive(Clone, Debug, Default)] +pub(crate) struct HeaderSerializationSettings { + omit_default_content_length: bool, + omit_default_content_type: bool, +} + +impl HeaderSerializationSettings { + /// Creates new [`HeaderSerializationSettings`] + pub(crate) fn new() -> Self { + Default::default() + } + + /// Omit the default `Content-Length` header during serialization + pub(crate) fn omit_default_content_length(self) -> Self { + Self { + omit_default_content_length: true, + ..self + } + } + + /// Omit the default `Content-Type` header during serialization + pub(crate) fn omit_default_content_type(self) -> Self { + Self { + omit_default_content_type: true, + ..self + } + } + + /// Returns true if the given default header name should be serialized + fn include_header(&self, header: &HeaderName) -> bool { + (!self.omit_default_content_length || header != CONTENT_LENGTH) && (!self.omit_default_content_type || header != CONTENT_TYPE) + } + + /// Sets a default header on the given request builder if it should be serialized + pub(crate) fn set_default_header(&self, mut request: http::request::Builder, header_name: HeaderName, value: &str) -> http::request::Builder { + if self.include_header(&header_name) { + request = set_request_header_if_absent(request, header_name, value); + } + request + } +} + +impl Storable for HeaderSerializationSettings { + type Storer = StoreReplace; +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn test_include_header() { + let settings = HeaderSerializationSettings::default(); + assert!(settings.include_header(&CONTENT_LENGTH)); + assert!(settings.include_header(&CONTENT_TYPE)); + + let settings = HeaderSerializationSettings::default().omit_default_content_length(); + assert!(!settings.include_header(&CONTENT_LENGTH)); + assert!(settings.include_header(&CONTENT_TYPE)); + + let settings = HeaderSerializationSettings::default().omit_default_content_type(); + assert!(settings.include_header(&CONTENT_LENGTH)); + assert!(!settings.include_header(&CONTENT_TYPE)); + + let settings = HeaderSerializationSettings::default() + .omit_default_content_type() + .omit_default_content_length(); + assert!(!settings.include_header(&CONTENT_LENGTH)); + assert!(!settings.include_header(&CONTENT_TYPE)); + } +} diff --git a/sdk/backupsearch/src/types.rs b/sdk/backupsearch/src/types.rs new file mode 100644 index 000000000000..6bd48ce52524 --- /dev/null +++ b/sdk/backupsearch/src/types.rs @@ -0,0 +1,102 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +pub use crate::types::_export_specification::ExportSpecification; + +pub use crate::types::_s3_export_specification::S3ExportSpecification; + +pub use crate::types::_export_job_status::ExportJobStatus; + +pub use crate::types::_export_job_summary::ExportJobSummary; + +pub use crate::types::_item_filters::ItemFilters; + +pub use crate::types::_ebs_item_filter::EbsItemFilter; + +pub use crate::types::_time_condition::TimeCondition; + +pub use crate::types::_time_condition_operator::TimeConditionOperator; + +pub use crate::types::_long_condition::LongCondition; + +pub use crate::types::_long_condition_operator::LongConditionOperator; + +pub use crate::types::_string_condition::StringCondition; + +pub use crate::types::_string_condition_operator::StringConditionOperator; + +pub use crate::types::_s3_item_filter::S3ItemFilter; + +pub use crate::types::_search_scope::SearchScope; + +pub use crate::types::_backup_creation_time_filter::BackupCreationTimeFilter; + +pub use crate::types::_resource_type::ResourceType; + +pub use crate::types::_search_job_state::SearchJobState; + +pub use crate::types::_current_search_progress::CurrentSearchProgress; + +pub use crate::types::_search_scope_summary::SearchScopeSummary; + +pub use crate::types::_search_job_summary::SearchJobSummary; + +pub use crate::types::_result_item::ResultItem; + +pub use crate::types::_ebs_result_item::EbsResultItem; + +pub use crate::types::_s3_result_item::S3ResultItem; + +pub use crate::types::_search_job_backups_result::SearchJobBackupsResult; + +mod _backup_creation_time_filter; + +mod _current_search_progress; + +mod _ebs_item_filter; + +mod _ebs_result_item; + +mod _export_job_status; + +mod _export_job_summary; + +mod _export_specification; + +mod _item_filters; + +mod _long_condition; + +mod _long_condition_operator; + +mod _resource_type; + +mod _result_item; + +mod _s3_export_specification; + +mod _s3_item_filter; + +mod _s3_result_item; + +mod _search_job_backups_result; + +mod _search_job_state; + +mod _search_job_summary; + +mod _search_scope; + +mod _search_scope_summary; + +mod _string_condition; + +mod _string_condition_operator; + +mod _time_condition; + +mod _time_condition_operator; + +/// Builders +pub mod builders; + +/// Error types that AWS Backup Search can respond with. +pub mod error; diff --git a/sdk/backupsearch/src/types/_backup_creation_time_filter.rs b/sdk/backupsearch/src/types/_backup_creation_time_filter.rs new file mode 100644 index 000000000000..31c954b38d8a --- /dev/null +++ b/sdk/backupsearch/src/types/_backup_creation_time_filter.rs @@ -0,0 +1,72 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. + +///

This filters by recovery points within the CreatedAfter and CreatedBefore timestamps.

+#[non_exhaustive] +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)] +pub struct BackupCreationTimeFilter { + ///

This timestamp includes recovery points only created after the specified time.

+ pub created_after: ::std::option::Option<::aws_smithy_types::DateTime>, + ///

This timestamp includes recovery points only created before the specified time.

+ pub created_before: ::std::option::Option<::aws_smithy_types::DateTime>, +} +impl BackupCreationTimeFilter { + ///

This timestamp includes recovery points only created after the specified time.

+ pub fn created_after(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> { + self.created_after.as_ref() + } + ///

This timestamp includes recovery points only created before the specified time.

+ pub fn created_before(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> { + self.created_before.as_ref() + } +} +impl BackupCreationTimeFilter { + /// Creates a new builder-style object to manufacture [`BackupCreationTimeFilter`](crate::types::BackupCreationTimeFilter). + pub fn builder() -> crate::types::builders::BackupCreationTimeFilterBuilder { + crate::types::builders::BackupCreationTimeFilterBuilder::default() + } +} + +/// A builder for [`BackupCreationTimeFilter`](crate::types::BackupCreationTimeFilter). +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)] +#[non_exhaustive] +pub struct BackupCreationTimeFilterBuilder { + pub(crate) created_after: ::std::option::Option<::aws_smithy_types::DateTime>, + pub(crate) created_before: ::std::option::Option<::aws_smithy_types::DateTime>, +} +impl BackupCreationTimeFilterBuilder { + ///

This timestamp includes recovery points only created after the specified time.

+ pub fn created_after(mut self, input: ::aws_smithy_types::DateTime) -> Self { + self.created_after = ::std::option::Option::Some(input); + self + } + ///

This timestamp includes recovery points only created after the specified time.

+ pub fn set_created_after(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self { + self.created_after = input; + self + } + ///

This timestamp includes recovery points only created after the specified time.

+ pub fn get_created_after(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> { + &self.created_after + } + ///

This timestamp includes recovery points only created before the specified time.

+ pub fn created_before(mut self, input: ::aws_smithy_types::DateTime) -> Self { + self.created_before = ::std::option::Option::Some(input); + self + } + ///

This timestamp includes recovery points only created before the specified time.

+ pub fn set_created_before(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self { + self.created_before = input; + self + } + ///

This timestamp includes recovery points only created before the specified time.

+ pub fn get_created_before(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> { + &self.created_before + } + /// Consumes the builder and constructs a [`BackupCreationTimeFilter`](crate::types::BackupCreationTimeFilter). + pub fn build(self) -> crate::types::BackupCreationTimeFilter { + crate::types::BackupCreationTimeFilter { + created_after: self.created_after, + created_before: self.created_before, + } + } +} diff --git a/sdk/backupsearch/src/types/_current_search_progress.rs b/sdk/backupsearch/src/types/_current_search_progress.rs new file mode 100644 index 000000000000..53d157f9ee59 --- /dev/null +++ b/sdk/backupsearch/src/types/_current_search_progress.rs @@ -0,0 +1,94 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. + +///

This contains information results retrieved from a search job that may not have completed.

+#[non_exhaustive] +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)] +pub struct CurrentSearchProgress { + ///

This number is the sum of all backups that have been scanned so far during a search job.

+ pub recovery_points_scanned_count: ::std::option::Option, + ///

This number is the sum of all items that have been scanned so far during a search job.

+ pub items_scanned_count: ::std::option::Option, + ///

This number is the sum of all items that match the item filters in a search job in progress.

+ pub items_matched_count: ::std::option::Option, +} +impl CurrentSearchProgress { + ///

This number is the sum of all backups that have been scanned so far during a search job.

+ pub fn recovery_points_scanned_count(&self) -> ::std::option::Option { + self.recovery_points_scanned_count + } + ///

This number is the sum of all items that have been scanned so far during a search job.

+ pub fn items_scanned_count(&self) -> ::std::option::Option { + self.items_scanned_count + } + ///

This number is the sum of all items that match the item filters in a search job in progress.

+ pub fn items_matched_count(&self) -> ::std::option::Option { + self.items_matched_count + } +} +impl CurrentSearchProgress { + /// Creates a new builder-style object to manufacture [`CurrentSearchProgress`](crate::types::CurrentSearchProgress). + pub fn builder() -> crate::types::builders::CurrentSearchProgressBuilder { + crate::types::builders::CurrentSearchProgressBuilder::default() + } +} + +/// A builder for [`CurrentSearchProgress`](crate::types::CurrentSearchProgress). +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)] +#[non_exhaustive] +pub struct CurrentSearchProgressBuilder { + pub(crate) recovery_points_scanned_count: ::std::option::Option, + pub(crate) items_scanned_count: ::std::option::Option, + pub(crate) items_matched_count: ::std::option::Option, +} +impl CurrentSearchProgressBuilder { + ///

This number is the sum of all backups that have been scanned so far during a search job.

+ pub fn recovery_points_scanned_count(mut self, input: i32) -> Self { + self.recovery_points_scanned_count = ::std::option::Option::Some(input); + self + } + ///

This number is the sum of all backups that have been scanned so far during a search job.

+ pub fn set_recovery_points_scanned_count(mut self, input: ::std::option::Option) -> Self { + self.recovery_points_scanned_count = input; + self + } + ///

This number is the sum of all backups that have been scanned so far during a search job.

+ pub fn get_recovery_points_scanned_count(&self) -> &::std::option::Option { + &self.recovery_points_scanned_count + } + ///

This number is the sum of all items that have been scanned so far during a search job.

+ pub fn items_scanned_count(mut self, input: i64) -> Self { + self.items_scanned_count = ::std::option::Option::Some(input); + self + } + ///

This number is the sum of all items that have been scanned so far during a search job.

+ pub fn set_items_scanned_count(mut self, input: ::std::option::Option) -> Self { + self.items_scanned_count = input; + self + } + ///

This number is the sum of all items that have been scanned so far during a search job.

+ pub fn get_items_scanned_count(&self) -> &::std::option::Option { + &self.items_scanned_count + } + ///

This number is the sum of all items that match the item filters in a search job in progress.

+ pub fn items_matched_count(mut self, input: i64) -> Self { + self.items_matched_count = ::std::option::Option::Some(input); + self + } + ///

This number is the sum of all items that match the item filters in a search job in progress.

+ pub fn set_items_matched_count(mut self, input: ::std::option::Option) -> Self { + self.items_matched_count = input; + self + } + ///

This number is the sum of all items that match the item filters in a search job in progress.

+ pub fn get_items_matched_count(&self) -> &::std::option::Option { + &self.items_matched_count + } + /// Consumes the builder and constructs a [`CurrentSearchProgress`](crate::types::CurrentSearchProgress). + pub fn build(self) -> crate::types::CurrentSearchProgress { + crate::types::CurrentSearchProgress { + recovery_points_scanned_count: self.recovery_points_scanned_count, + items_scanned_count: self.items_scanned_count, + items_matched_count: self.items_matched_count, + } + } +} diff --git a/sdk/backupsearch/src/types/_ebs_item_filter.rs b/sdk/backupsearch/src/types/_ebs_item_filter.rs new file mode 100644 index 000000000000..417926db4ba5 --- /dev/null +++ b/sdk/backupsearch/src/types/_ebs_item_filter.rs @@ -0,0 +1,188 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. + +///

This contains arrays of objects, which may include CreationTimes time condition objects, FilePaths string objects, LastModificationTimes time condition objects,

+#[non_exhaustive] +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)] +pub struct EbsItemFilter { + ///

You can include 1 to 10 values.

+ ///

If one file path is included, the results will return only items that match the file path.

+ ///

If more than one file path is included, the results will return all items that match any of the file paths.

+ pub file_paths: ::std::option::Option<::std::vec::Vec>, + ///

You can include 1 to 10 values.

+ ///

If one is included, the results will return only items that match.

+ ///

If more than one is included, the results will return all items that match any of the included values.

+ pub sizes: ::std::option::Option<::std::vec::Vec>, + ///

You can include 1 to 10 values.

+ ///

If one is included, the results will return only items that match.

+ ///

If more than one is included, the results will return all items that match any of the included values.

+ pub creation_times: ::std::option::Option<::std::vec::Vec>, + ///

You can include 1 to 10 values.

+ ///

If one is included, the results will return only items that match.

+ ///

If more than one is included, the results will return all items that match any of the included values.

+ pub last_modification_times: ::std::option::Option<::std::vec::Vec>, +} +impl EbsItemFilter { + ///

You can include 1 to 10 values.

+ ///

If one file path is included, the results will return only items that match the file path.

+ ///

If more than one file path is included, the results will return all items that match any of the file paths.

+ /// + /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.file_paths.is_none()`. + pub fn file_paths(&self) -> &[crate::types::StringCondition] { + self.file_paths.as_deref().unwrap_or_default() + } + ///

You can include 1 to 10 values.

+ ///

If one is included, the results will return only items that match.

+ ///

If more than one is included, the results will return all items that match any of the included values.

+ /// + /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.sizes.is_none()`. + pub fn sizes(&self) -> &[crate::types::LongCondition] { + self.sizes.as_deref().unwrap_or_default() + } + ///

You can include 1 to 10 values.

+ ///

If one is included, the results will return only items that match.

+ ///

If more than one is included, the results will return all items that match any of the included values.

+ /// + /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.creation_times.is_none()`. + pub fn creation_times(&self) -> &[crate::types::TimeCondition] { + self.creation_times.as_deref().unwrap_or_default() + } + ///

You can include 1 to 10 values.

+ ///

If one is included, the results will return only items that match.

+ ///

If more than one is included, the results will return all items that match any of the included values.

+ /// + /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.last_modification_times.is_none()`. + pub fn last_modification_times(&self) -> &[crate::types::TimeCondition] { + self.last_modification_times.as_deref().unwrap_or_default() + } +} +impl EbsItemFilter { + /// Creates a new builder-style object to manufacture [`EbsItemFilter`](crate::types::EbsItemFilter). + pub fn builder() -> crate::types::builders::EbsItemFilterBuilder { + crate::types::builders::EbsItemFilterBuilder::default() + } +} + +/// A builder for [`EbsItemFilter`](crate::types::EbsItemFilter). +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)] +#[non_exhaustive] +pub struct EbsItemFilterBuilder { + pub(crate) file_paths: ::std::option::Option<::std::vec::Vec>, + pub(crate) sizes: ::std::option::Option<::std::vec::Vec>, + pub(crate) creation_times: ::std::option::Option<::std::vec::Vec>, + pub(crate) last_modification_times: ::std::option::Option<::std::vec::Vec>, +} +impl EbsItemFilterBuilder { + /// Appends an item to `file_paths`. + /// + /// To override the contents of this collection use [`set_file_paths`](Self::set_file_paths). + /// + ///

You can include 1 to 10 values.

+ ///

If one file path is included, the results will return only items that match the file path.

+ ///

If more than one file path is included, the results will return all items that match any of the file paths.

+ pub fn file_paths(mut self, input: crate::types::StringCondition) -> Self { + let mut v = self.file_paths.unwrap_or_default(); + v.push(input); + self.file_paths = ::std::option::Option::Some(v); + self + } + ///

You can include 1 to 10 values.

+ ///

If one file path is included, the results will return only items that match the file path.

+ ///

If more than one file path is included, the results will return all items that match any of the file paths.

+ pub fn set_file_paths(mut self, input: ::std::option::Option<::std::vec::Vec>) -> Self { + self.file_paths = input; + self + } + ///

You can include 1 to 10 values.

+ ///

If one file path is included, the results will return only items that match the file path.

+ ///

If more than one file path is included, the results will return all items that match any of the file paths.

+ pub fn get_file_paths(&self) -> &::std::option::Option<::std::vec::Vec> { + &self.file_paths + } + /// Appends an item to `sizes`. + /// + /// To override the contents of this collection use [`set_sizes`](Self::set_sizes). + /// + ///

You can include 1 to 10 values.

+ ///

If one is included, the results will return only items that match.

+ ///

If more than one is included, the results will return all items that match any of the included values.

+ pub fn sizes(mut self, input: crate::types::LongCondition) -> Self { + let mut v = self.sizes.unwrap_or_default(); + v.push(input); + self.sizes = ::std::option::Option::Some(v); + self + } + ///

You can include 1 to 10 values.

+ ///

If one is included, the results will return only items that match.

+ ///

If more than one is included, the results will return all items that match any of the included values.

+ pub fn set_sizes(mut self, input: ::std::option::Option<::std::vec::Vec>) -> Self { + self.sizes = input; + self + } + ///

You can include 1 to 10 values.

+ ///

If one is included, the results will return only items that match.

+ ///

If more than one is included, the results will return all items that match any of the included values.

+ pub fn get_sizes(&self) -> &::std::option::Option<::std::vec::Vec> { + &self.sizes + } + /// Appends an item to `creation_times`. + /// + /// To override the contents of this collection use [`set_creation_times`](Self::set_creation_times). + /// + ///

You can include 1 to 10 values.

+ ///

If one is included, the results will return only items that match.

+ ///

If more than one is included, the results will return all items that match any of the included values.

+ pub fn creation_times(mut self, input: crate::types::TimeCondition) -> Self { + let mut v = self.creation_times.unwrap_or_default(); + v.push(input); + self.creation_times = ::std::option::Option::Some(v); + self + } + ///

You can include 1 to 10 values.

+ ///

If one is included, the results will return only items that match.

+ ///

If more than one is included, the results will return all items that match any of the included values.

+ pub fn set_creation_times(mut self, input: ::std::option::Option<::std::vec::Vec>) -> Self { + self.creation_times = input; + self + } + ///

You can include 1 to 10 values.

+ ///

If one is included, the results will return only items that match.

+ ///

If more than one is included, the results will return all items that match any of the included values.

+ pub fn get_creation_times(&self) -> &::std::option::Option<::std::vec::Vec> { + &self.creation_times + } + /// Appends an item to `last_modification_times`. + /// + /// To override the contents of this collection use [`set_last_modification_times`](Self::set_last_modification_times). + /// + ///

You can include 1 to 10 values.

+ ///

If one is included, the results will return only items that match.

+ ///

If more than one is included, the results will return all items that match any of the included values.

+ pub fn last_modification_times(mut self, input: crate::types::TimeCondition) -> Self { + let mut v = self.last_modification_times.unwrap_or_default(); + v.push(input); + self.last_modification_times = ::std::option::Option::Some(v); + self + } + ///

You can include 1 to 10 values.

+ ///

If one is included, the results will return only items that match.

+ ///

If more than one is included, the results will return all items that match any of the included values.

+ pub fn set_last_modification_times(mut self, input: ::std::option::Option<::std::vec::Vec>) -> Self { + self.last_modification_times = input; + self + } + ///

You can include 1 to 10 values.

+ ///

If one is included, the results will return only items that match.

+ ///

If more than one is included, the results will return all items that match any of the included values.

+ pub fn get_last_modification_times(&self) -> &::std::option::Option<::std::vec::Vec> { + &self.last_modification_times + } + /// Consumes the builder and constructs a [`EbsItemFilter`](crate::types::EbsItemFilter). + pub fn build(self) -> crate::types::EbsItemFilter { + crate::types::EbsItemFilter { + file_paths: self.file_paths, + sizes: self.sizes, + creation_times: self.creation_times, + last_modification_times: self.last_modification_times, + } + } +} diff --git a/sdk/backupsearch/src/types/_ebs_result_item.rs b/sdk/backupsearch/src/types/_ebs_result_item.rs new file mode 100644 index 000000000000..96127547e5a0 --- /dev/null +++ b/sdk/backupsearch/src/types/_ebs_result_item.rs @@ -0,0 +1,232 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. + +///

These are the items returned in the results of a search of Amazon EBS backup metadata.

+#[non_exhaustive] +#[derive(::std::clone::Clone, ::std::cmp::PartialEq)] +pub struct EbsResultItem { + ///

These are one or more items in the results that match values for the Amazon Resource Name (ARN) of recovery points returned in a search of Amazon EBS backup metadata.

+ pub backup_resource_arn: ::std::option::Option<::std::string::String>, + ///

These are one or more items in the results that match values for the Amazon Resource Name (ARN) of source resources returned in a search of Amazon EBS backup metadata.

+ pub source_resource_arn: ::std::option::Option<::std::string::String>, + ///

The name of the backup vault.

+ pub backup_vault_name: ::std::option::Option<::std::string::String>, + ///

These are one or more items in the results that match values for file systems returned in a search of Amazon EBS backup metadata.

+ pub file_system_identifier: ::std::option::Option<::std::string::String>, + ///

These are one or more items in the results that match values for file paths returned in a search of Amazon EBS backup metadata.

+ pub file_path: ::std::option::Option<::std::string::String>, + ///

These are one or more items in the results that match values for file sizes returned in a search of Amazon EBS backup metadata.

+ pub file_size: ::std::option::Option, + ///

These are one or more items in the results that match values for creation times returned in a search of Amazon EBS backup metadata.

+ pub creation_time: ::std::option::Option<::aws_smithy_types::DateTime>, + ///

These are one or more items in the results that match values for Last Modified Time returned in a search of Amazon EBS backup metadata.

+ pub last_modified_time: ::std::option::Option<::aws_smithy_types::DateTime>, +} +impl EbsResultItem { + ///

These are one or more items in the results that match values for the Amazon Resource Name (ARN) of recovery points returned in a search of Amazon EBS backup metadata.

+ pub fn backup_resource_arn(&self) -> ::std::option::Option<&str> { + self.backup_resource_arn.as_deref() + } + ///

These are one or more items in the results that match values for the Amazon Resource Name (ARN) of source resources returned in a search of Amazon EBS backup metadata.

+ pub fn source_resource_arn(&self) -> ::std::option::Option<&str> { + self.source_resource_arn.as_deref() + } + ///

The name of the backup vault.

+ pub fn backup_vault_name(&self) -> ::std::option::Option<&str> { + self.backup_vault_name.as_deref() + } + ///

These are one or more items in the results that match values for file systems returned in a search of Amazon EBS backup metadata.

+ pub fn file_system_identifier(&self) -> ::std::option::Option<&str> { + self.file_system_identifier.as_deref() + } + ///

These are one or more items in the results that match values for file paths returned in a search of Amazon EBS backup metadata.

+ pub fn file_path(&self) -> ::std::option::Option<&str> { + self.file_path.as_deref() + } + ///

These are one or more items in the results that match values for file sizes returned in a search of Amazon EBS backup metadata.

+ pub fn file_size(&self) -> ::std::option::Option { + self.file_size + } + ///

These are one or more items in the results that match values for creation times returned in a search of Amazon EBS backup metadata.

+ pub fn creation_time(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> { + self.creation_time.as_ref() + } + ///

These are one or more items in the results that match values for Last Modified Time returned in a search of Amazon EBS backup metadata.

+ pub fn last_modified_time(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> { + self.last_modified_time.as_ref() + } +} +impl ::std::fmt::Debug for EbsResultItem { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + let mut formatter = f.debug_struct("EbsResultItem"); + formatter.field("backup_resource_arn", &self.backup_resource_arn); + formatter.field("source_resource_arn", &self.source_resource_arn); + formatter.field("backup_vault_name", &self.backup_vault_name); + formatter.field("file_system_identifier", &self.file_system_identifier); + formatter.field("file_path", &"*** Sensitive Data Redacted ***"); + formatter.field("file_size", &self.file_size); + formatter.field("creation_time", &self.creation_time); + formatter.field("last_modified_time", &self.last_modified_time); + formatter.finish() + } +} +impl EbsResultItem { + /// Creates a new builder-style object to manufacture [`EbsResultItem`](crate::types::EbsResultItem). + pub fn builder() -> crate::types::builders::EbsResultItemBuilder { + crate::types::builders::EbsResultItemBuilder::default() + } +} + +/// A builder for [`EbsResultItem`](crate::types::EbsResultItem). +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)] +#[non_exhaustive] +pub struct EbsResultItemBuilder { + pub(crate) backup_resource_arn: ::std::option::Option<::std::string::String>, + pub(crate) source_resource_arn: ::std::option::Option<::std::string::String>, + pub(crate) backup_vault_name: ::std::option::Option<::std::string::String>, + pub(crate) file_system_identifier: ::std::option::Option<::std::string::String>, + pub(crate) file_path: ::std::option::Option<::std::string::String>, + pub(crate) file_size: ::std::option::Option, + pub(crate) creation_time: ::std::option::Option<::aws_smithy_types::DateTime>, + pub(crate) last_modified_time: ::std::option::Option<::aws_smithy_types::DateTime>, +} +impl EbsResultItemBuilder { + ///

These are one or more items in the results that match values for the Amazon Resource Name (ARN) of recovery points returned in a search of Amazon EBS backup metadata.

+ pub fn backup_resource_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.backup_resource_arn = ::std::option::Option::Some(input.into()); + self + } + ///

These are one or more items in the results that match values for the Amazon Resource Name (ARN) of recovery points returned in a search of Amazon EBS backup metadata.

+ pub fn set_backup_resource_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.backup_resource_arn = input; + self + } + ///

These are one or more items in the results that match values for the Amazon Resource Name (ARN) of recovery points returned in a search of Amazon EBS backup metadata.

+ pub fn get_backup_resource_arn(&self) -> &::std::option::Option<::std::string::String> { + &self.backup_resource_arn + } + ///

These are one or more items in the results that match values for the Amazon Resource Name (ARN) of source resources returned in a search of Amazon EBS backup metadata.

+ pub fn source_resource_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.source_resource_arn = ::std::option::Option::Some(input.into()); + self + } + ///

These are one or more items in the results that match values for the Amazon Resource Name (ARN) of source resources returned in a search of Amazon EBS backup metadata.

+ pub fn set_source_resource_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.source_resource_arn = input; + self + } + ///

These are one or more items in the results that match values for the Amazon Resource Name (ARN) of source resources returned in a search of Amazon EBS backup metadata.

+ pub fn get_source_resource_arn(&self) -> &::std::option::Option<::std::string::String> { + &self.source_resource_arn + } + ///

The name of the backup vault.

+ pub fn backup_vault_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.backup_vault_name = ::std::option::Option::Some(input.into()); + self + } + ///

The name of the backup vault.

+ pub fn set_backup_vault_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.backup_vault_name = input; + self + } + ///

The name of the backup vault.

+ pub fn get_backup_vault_name(&self) -> &::std::option::Option<::std::string::String> { + &self.backup_vault_name + } + ///

These are one or more items in the results that match values for file systems returned in a search of Amazon EBS backup metadata.

+ pub fn file_system_identifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.file_system_identifier = ::std::option::Option::Some(input.into()); + self + } + ///

These are one or more items in the results that match values for file systems returned in a search of Amazon EBS backup metadata.

+ pub fn set_file_system_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.file_system_identifier = input; + self + } + ///

These are one or more items in the results that match values for file systems returned in a search of Amazon EBS backup metadata.

+ pub fn get_file_system_identifier(&self) -> &::std::option::Option<::std::string::String> { + &self.file_system_identifier + } + ///

These are one or more items in the results that match values for file paths returned in a search of Amazon EBS backup metadata.

+ pub fn file_path(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.file_path = ::std::option::Option::Some(input.into()); + self + } + ///

These are one or more items in the results that match values for file paths returned in a search of Amazon EBS backup metadata.

+ pub fn set_file_path(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.file_path = input; + self + } + ///

These are one or more items in the results that match values for file paths returned in a search of Amazon EBS backup metadata.

+ pub fn get_file_path(&self) -> &::std::option::Option<::std::string::String> { + &self.file_path + } + ///

These are one or more items in the results that match values for file sizes returned in a search of Amazon EBS backup metadata.

+ pub fn file_size(mut self, input: i64) -> Self { + self.file_size = ::std::option::Option::Some(input); + self + } + ///

These are one or more items in the results that match values for file sizes returned in a search of Amazon EBS backup metadata.

+ pub fn set_file_size(mut self, input: ::std::option::Option) -> Self { + self.file_size = input; + self + } + ///

These are one or more items in the results that match values for file sizes returned in a search of Amazon EBS backup metadata.

+ pub fn get_file_size(&self) -> &::std::option::Option { + &self.file_size + } + ///

These are one or more items in the results that match values for creation times returned in a search of Amazon EBS backup metadata.

+ pub fn creation_time(mut self, input: ::aws_smithy_types::DateTime) -> Self { + self.creation_time = ::std::option::Option::Some(input); + self + } + ///

These are one or more items in the results that match values for creation times returned in a search of Amazon EBS backup metadata.

+ pub fn set_creation_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self { + self.creation_time = input; + self + } + ///

These are one or more items in the results that match values for creation times returned in a search of Amazon EBS backup metadata.

+ pub fn get_creation_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> { + &self.creation_time + } + ///

These are one or more items in the results that match values for Last Modified Time returned in a search of Amazon EBS backup metadata.

+ pub fn last_modified_time(mut self, input: ::aws_smithy_types::DateTime) -> Self { + self.last_modified_time = ::std::option::Option::Some(input); + self + } + ///

These are one or more items in the results that match values for Last Modified Time returned in a search of Amazon EBS backup metadata.

+ pub fn set_last_modified_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self { + self.last_modified_time = input; + self + } + ///

These are one or more items in the results that match values for Last Modified Time returned in a search of Amazon EBS backup metadata.

+ pub fn get_last_modified_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> { + &self.last_modified_time + } + /// Consumes the builder and constructs a [`EbsResultItem`](crate::types::EbsResultItem). + pub fn build(self) -> crate::types::EbsResultItem { + crate::types::EbsResultItem { + backup_resource_arn: self.backup_resource_arn, + source_resource_arn: self.source_resource_arn, + backup_vault_name: self.backup_vault_name, + file_system_identifier: self.file_system_identifier, + file_path: self.file_path, + file_size: self.file_size, + creation_time: self.creation_time, + last_modified_time: self.last_modified_time, + } + } +} +impl ::std::fmt::Debug for EbsResultItemBuilder { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + let mut formatter = f.debug_struct("EbsResultItemBuilder"); + formatter.field("backup_resource_arn", &self.backup_resource_arn); + formatter.field("source_resource_arn", &self.source_resource_arn); + formatter.field("backup_vault_name", &self.backup_vault_name); + formatter.field("file_system_identifier", &self.file_system_identifier); + formatter.field("file_path", &"*** Sensitive Data Redacted ***"); + formatter.field("file_size", &self.file_size); + formatter.field("creation_time", &self.creation_time); + formatter.field("last_modified_time", &self.last_modified_time); + formatter.finish() + } +} diff --git a/sdk/backupsearch/src/types/_export_job_status.rs b/sdk/backupsearch/src/types/_export_job_status.rs new file mode 100644 index 000000000000..e2b1fa86b62f --- /dev/null +++ b/sdk/backupsearch/src/types/_export_job_status.rs @@ -0,0 +1,114 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. + +/// When writing a match expression against `ExportJobStatus`, it is important to ensure +/// your code is forward-compatible. That is, if a match arm handles a case for a +/// feature that is supported by the service but has not been represented as an enum +/// variant in a current version of SDK, your code should continue to work when you +/// upgrade SDK to a future version in which the enum does include a variant for that +/// feature. +/// +/// Here is an example of how you can make a match expression forward-compatible: +/// +/// ```text +/// # let exportjobstatus = unimplemented!(); +/// match exportjobstatus { +/// ExportJobStatus::Completed => { /* ... */ }, +/// ExportJobStatus::Failed => { /* ... */ }, +/// ExportJobStatus::Running => { /* ... */ }, +/// other @ _ if other.as_str() == "NewFeature" => { /* handles a case for `NewFeature` */ }, +/// _ => { /* ... */ }, +/// } +/// ``` +/// The above code demonstrates that when `exportjobstatus` represents +/// `NewFeature`, the execution path will lead to the second last match arm, +/// even though the enum does not contain a variant `ExportJobStatus::NewFeature` +/// in the current version of SDK. The reason is that the variable `other`, +/// created by the `@` operator, is bound to +/// `ExportJobStatus::Unknown(UnknownVariantValue("NewFeature".to_owned()))` +/// and calling `as_str` on it yields `"NewFeature"`. +/// This match expression is forward-compatible when executed with a newer +/// version of SDK where the variant `ExportJobStatus::NewFeature` is defined. +/// Specifically, when `exportjobstatus` represents `NewFeature`, +/// the execution path will hit the second last match arm as before by virtue of +/// calling `as_str` on `ExportJobStatus::NewFeature` also yielding `"NewFeature"`. +/// +/// Explicitly matching on the `Unknown` variant should +/// be avoided for two reasons: +/// - The inner data `UnknownVariantValue` is opaque, and no further information can be extracted. +/// - It might inadvertently shadow other intended match arms. +/// +#[allow(missing_docs)] // documentation missing in model +#[non_exhaustive] +#[derive( + ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::Ord, ::std::cmp::PartialEq, ::std::cmp::PartialOrd, ::std::fmt::Debug, ::std::hash::Hash, +)] +pub enum ExportJobStatus { + #[allow(missing_docs)] // documentation missing in model + Completed, + #[allow(missing_docs)] // documentation missing in model + Failed, + #[allow(missing_docs)] // documentation missing in model + Running, + /// `Unknown` contains new variants that have been added since this code was generated. + #[deprecated(note = "Don't directly match on `Unknown`. See the docs on this enum for the correct way to handle unknown variants.")] + Unknown(crate::primitives::sealed_enum_unknown::UnknownVariantValue), +} +impl ::std::convert::From<&str> for ExportJobStatus { + fn from(s: &str) -> Self { + match s { + "COMPLETED" => ExportJobStatus::Completed, + "FAILED" => ExportJobStatus::Failed, + "RUNNING" => ExportJobStatus::Running, + other => ExportJobStatus::Unknown(crate::primitives::sealed_enum_unknown::UnknownVariantValue(other.to_owned())), + } + } +} +impl ::std::str::FromStr for ExportJobStatus { + type Err = ::std::convert::Infallible; + + fn from_str(s: &str) -> ::std::result::Result::Err> { + ::std::result::Result::Ok(ExportJobStatus::from(s)) + } +} +impl ExportJobStatus { + /// Returns the `&str` value of the enum member. + pub fn as_str(&self) -> &str { + match self { + ExportJobStatus::Completed => "COMPLETED", + ExportJobStatus::Failed => "FAILED", + ExportJobStatus::Running => "RUNNING", + ExportJobStatus::Unknown(value) => value.as_str(), + } + } + /// Returns all the `&str` representations of the enum members. + pub const fn values() -> &'static [&'static str] { + &["COMPLETED", "FAILED", "RUNNING"] + } +} +impl ::std::convert::AsRef for ExportJobStatus { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl ExportJobStatus { + /// Parses the enum value while disallowing unknown variants. + /// + /// Unknown variants will result in an error. + pub fn try_parse(value: &str) -> ::std::result::Result { + match Self::from(value) { + #[allow(deprecated)] + Self::Unknown(_) => ::std::result::Result::Err(crate::error::UnknownVariantError::new(value)), + known => Ok(known), + } + } +} +impl ::std::fmt::Display for ExportJobStatus { + fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + match self { + ExportJobStatus::Completed => write!(f, "COMPLETED"), + ExportJobStatus::Failed => write!(f, "FAILED"), + ExportJobStatus::Running => write!(f, "RUNNING"), + ExportJobStatus::Unknown(value) => write!(f, "{}", value), + } + } +} diff --git a/sdk/backupsearch/src/types/_export_job_summary.rs b/sdk/backupsearch/src/types/_export_job_summary.rs new file mode 100644 index 000000000000..6524ce4e988e --- /dev/null +++ b/sdk/backupsearch/src/types/_export_job_summary.rs @@ -0,0 +1,201 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. + +///

This is the summary of an export job.

+#[non_exhaustive] +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)] +pub struct ExportJobSummary { + ///

This is the unique string that identifies a specific export job.

+ pub export_job_identifier: ::std::string::String, + ///

This is the unique ARN (Amazon Resource Name) that belongs to the new export job.

+ pub export_job_arn: ::std::option::Option<::std::string::String>, + ///

The status of the export job is one of the following:

+ ///

CREATED; RUNNING; FAILED; or COMPLETED.

+ pub status: ::std::option::Option, + ///

This is a timestamp of the time the export job was created.

+ pub creation_time: ::std::option::Option<::aws_smithy_types::DateTime>, + ///

This is a timestamp of the time the export job compeleted.

+ pub completion_time: ::std::option::Option<::aws_smithy_types::DateTime>, + ///

A status message is a string that is returned for an export job.

+ ///

A status message is included for any status other than COMPLETED without issues.

+ pub status_message: ::std::option::Option<::std::string::String>, + ///

The unique string that identifies the Amazon Resource Name (ARN) of the specified search job.

+ pub search_job_arn: ::std::option::Option<::std::string::String>, +} +impl ExportJobSummary { + ///

This is the unique string that identifies a specific export job.

+ pub fn export_job_identifier(&self) -> &str { + use std::ops::Deref; + self.export_job_identifier.deref() + } + ///

This is the unique ARN (Amazon Resource Name) that belongs to the new export job.

+ pub fn export_job_arn(&self) -> ::std::option::Option<&str> { + self.export_job_arn.as_deref() + } + ///

The status of the export job is one of the following:

+ ///

CREATED; RUNNING; FAILED; or COMPLETED.

+ pub fn status(&self) -> ::std::option::Option<&crate::types::ExportJobStatus> { + self.status.as_ref() + } + ///

This is a timestamp of the time the export job was created.

+ pub fn creation_time(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> { + self.creation_time.as_ref() + } + ///

This is a timestamp of the time the export job compeleted.

+ pub fn completion_time(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> { + self.completion_time.as_ref() + } + ///

A status message is a string that is returned for an export job.

+ ///

A status message is included for any status other than COMPLETED without issues.

+ pub fn status_message(&self) -> ::std::option::Option<&str> { + self.status_message.as_deref() + } + ///

The unique string that identifies the Amazon Resource Name (ARN) of the specified search job.

+ pub fn search_job_arn(&self) -> ::std::option::Option<&str> { + self.search_job_arn.as_deref() + } +} +impl ExportJobSummary { + /// Creates a new builder-style object to manufacture [`ExportJobSummary`](crate::types::ExportJobSummary). + pub fn builder() -> crate::types::builders::ExportJobSummaryBuilder { + crate::types::builders::ExportJobSummaryBuilder::default() + } +} + +/// A builder for [`ExportJobSummary`](crate::types::ExportJobSummary). +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)] +#[non_exhaustive] +pub struct ExportJobSummaryBuilder { + pub(crate) export_job_identifier: ::std::option::Option<::std::string::String>, + pub(crate) export_job_arn: ::std::option::Option<::std::string::String>, + pub(crate) status: ::std::option::Option, + pub(crate) creation_time: ::std::option::Option<::aws_smithy_types::DateTime>, + pub(crate) completion_time: ::std::option::Option<::aws_smithy_types::DateTime>, + pub(crate) status_message: ::std::option::Option<::std::string::String>, + pub(crate) search_job_arn: ::std::option::Option<::std::string::String>, +} +impl ExportJobSummaryBuilder { + ///

This is the unique string that identifies a specific export job.

+ /// This field is required. + pub fn export_job_identifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.export_job_identifier = ::std::option::Option::Some(input.into()); + self + } + ///

This is the unique string that identifies a specific export job.

+ pub fn set_export_job_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.export_job_identifier = input; + self + } + ///

This is the unique string that identifies a specific export job.

+ pub fn get_export_job_identifier(&self) -> &::std::option::Option<::std::string::String> { + &self.export_job_identifier + } + ///

This is the unique ARN (Amazon Resource Name) that belongs to the new export job.

+ pub fn export_job_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.export_job_arn = ::std::option::Option::Some(input.into()); + self + } + ///

This is the unique ARN (Amazon Resource Name) that belongs to the new export job.

+ pub fn set_export_job_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.export_job_arn = input; + self + } + ///

This is the unique ARN (Amazon Resource Name) that belongs to the new export job.

+ pub fn get_export_job_arn(&self) -> &::std::option::Option<::std::string::String> { + &self.export_job_arn + } + ///

The status of the export job is one of the following:

+ ///

CREATED; RUNNING; FAILED; or COMPLETED.

+ pub fn status(mut self, input: crate::types::ExportJobStatus) -> Self { + self.status = ::std::option::Option::Some(input); + self + } + ///

The status of the export job is one of the following:

+ ///

CREATED; RUNNING; FAILED; or COMPLETED.

+ pub fn set_status(mut self, input: ::std::option::Option) -> Self { + self.status = input; + self + } + ///

The status of the export job is one of the following:

+ ///

CREATED; RUNNING; FAILED; or COMPLETED.

+ pub fn get_status(&self) -> &::std::option::Option { + &self.status + } + ///

This is a timestamp of the time the export job was created.

+ pub fn creation_time(mut self, input: ::aws_smithy_types::DateTime) -> Self { + self.creation_time = ::std::option::Option::Some(input); + self + } + ///

This is a timestamp of the time the export job was created.

+ pub fn set_creation_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self { + self.creation_time = input; + self + } + ///

This is a timestamp of the time the export job was created.

+ pub fn get_creation_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> { + &self.creation_time + } + ///

This is a timestamp of the time the export job compeleted.

+ pub fn completion_time(mut self, input: ::aws_smithy_types::DateTime) -> Self { + self.completion_time = ::std::option::Option::Some(input); + self + } + ///

This is a timestamp of the time the export job compeleted.

+ pub fn set_completion_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self { + self.completion_time = input; + self + } + ///

This is a timestamp of the time the export job compeleted.

+ pub fn get_completion_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> { + &self.completion_time + } + ///

A status message is a string that is returned for an export job.

+ ///

A status message is included for any status other than COMPLETED without issues.

+ pub fn status_message(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.status_message = ::std::option::Option::Some(input.into()); + self + } + ///

A status message is a string that is returned for an export job.

+ ///

A status message is included for any status other than COMPLETED without issues.

+ pub fn set_status_message(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.status_message = input; + self + } + ///

A status message is a string that is returned for an export job.

+ ///

A status message is included for any status other than COMPLETED without issues.

+ pub fn get_status_message(&self) -> &::std::option::Option<::std::string::String> { + &self.status_message + } + ///

The unique string that identifies the Amazon Resource Name (ARN) of the specified search job.

+ pub fn search_job_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.search_job_arn = ::std::option::Option::Some(input.into()); + self + } + ///

The unique string that identifies the Amazon Resource Name (ARN) of the specified search job.

+ pub fn set_search_job_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.search_job_arn = input; + self + } + ///

The unique string that identifies the Amazon Resource Name (ARN) of the specified search job.

+ pub fn get_search_job_arn(&self) -> &::std::option::Option<::std::string::String> { + &self.search_job_arn + } + /// Consumes the builder and constructs a [`ExportJobSummary`](crate::types::ExportJobSummary). + /// This method will fail if any of the following fields are not set: + /// - [`export_job_identifier`](crate::types::builders::ExportJobSummaryBuilder::export_job_identifier) + pub fn build(self) -> ::std::result::Result { + ::std::result::Result::Ok(crate::types::ExportJobSummary { + export_job_identifier: self.export_job_identifier.ok_or_else(|| { + ::aws_smithy_types::error::operation::BuildError::missing_field( + "export_job_identifier", + "export_job_identifier was not specified but it is required when building ExportJobSummary", + ) + })?, + export_job_arn: self.export_job_arn, + status: self.status, + creation_time: self.creation_time, + completion_time: self.completion_time, + status_message: self.status_message, + search_job_arn: self.search_job_arn, + }) + } +} diff --git a/sdk/backupsearch/src/types/_export_specification.rs b/sdk/backupsearch/src/types/_export_specification.rs new file mode 100644 index 000000000000..d447884ac65a --- /dev/null +++ b/sdk/backupsearch/src/types/_export_specification.rs @@ -0,0 +1,38 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. + +///

This contains the export specification object.

+#[non_exhaustive] +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)] +pub enum ExportSpecification { + ///

This specifies the destination Amazon S3 bucket for the export job. And, if included, it also specifies the destination prefix.

+ S3ExportSpecification(crate::types::S3ExportSpecification), + /// The `Unknown` variant represents cases where new union variant was received. Consider upgrading the SDK to the latest available version. + /// An unknown enum variant + /// + /// _Note: If you encounter this error, consider upgrading your SDK to the latest version._ + /// The `Unknown` variant represents cases where the server sent a value that wasn't recognized + /// by the client. This can happen when the server adds new functionality, but the client has not been updated. + /// To investigate this, consider turning on debug logging to print the raw HTTP response. + #[non_exhaustive] + Unknown, +} +impl ExportSpecification { + #[allow(irrefutable_let_patterns)] + /// Tries to convert the enum instance into [`S3ExportSpecification`](crate::types::ExportSpecification::S3ExportSpecification), extracting the inner [`S3ExportSpecification`](crate::types::S3ExportSpecification). + /// Returns `Err(&Self)` if it can't be converted. + pub fn as_s3_export_specification(&self) -> ::std::result::Result<&crate::types::S3ExportSpecification, &Self> { + if let ExportSpecification::S3ExportSpecification(val) = &self { + ::std::result::Result::Ok(val) + } else { + ::std::result::Result::Err(self) + } + } + /// Returns true if this is a [`S3ExportSpecification`](crate::types::ExportSpecification::S3ExportSpecification). + pub fn is_s3_export_specification(&self) -> bool { + self.as_s3_export_specification().is_ok() + } + /// Returns true if the enum instance is the `Unknown` variant. + pub fn is_unknown(&self) -> bool { + matches!(self, Self::Unknown) + } +} diff --git a/sdk/backupsearch/src/types/_item_filters.rs b/sdk/backupsearch/src/types/_item_filters.rs new file mode 100644 index 000000000000..3a0bcdaf4403 --- /dev/null +++ b/sdk/backupsearch/src/types/_item_filters.rs @@ -0,0 +1,89 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. + +///

Item Filters represent all input item properties specified when the search was created.

+///

Contains either EBSItemFilters or S3ItemFilters

+#[non_exhaustive] +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)] +pub struct ItemFilters { + ///

This array can contain CreationTimes, ETags, ObjectKeys, Sizes, or VersionIds objects.

+ pub s3_item_filters: ::std::option::Option<::std::vec::Vec>, + ///

This array can contain CreationTimes, FilePaths, LastModificationTimes, or Sizes objects.

+ pub ebs_item_filters: ::std::option::Option<::std::vec::Vec>, +} +impl ItemFilters { + ///

This array can contain CreationTimes, ETags, ObjectKeys, Sizes, or VersionIds objects.

+ /// + /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.s3_item_filters.is_none()`. + pub fn s3_item_filters(&self) -> &[crate::types::S3ItemFilter] { + self.s3_item_filters.as_deref().unwrap_or_default() + } + ///

This array can contain CreationTimes, FilePaths, LastModificationTimes, or Sizes objects.

+ /// + /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.ebs_item_filters.is_none()`. + pub fn ebs_item_filters(&self) -> &[crate::types::EbsItemFilter] { + self.ebs_item_filters.as_deref().unwrap_or_default() + } +} +impl ItemFilters { + /// Creates a new builder-style object to manufacture [`ItemFilters`](crate::types::ItemFilters). + pub fn builder() -> crate::types::builders::ItemFiltersBuilder { + crate::types::builders::ItemFiltersBuilder::default() + } +} + +/// A builder for [`ItemFilters`](crate::types::ItemFilters). +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)] +#[non_exhaustive] +pub struct ItemFiltersBuilder { + pub(crate) s3_item_filters: ::std::option::Option<::std::vec::Vec>, + pub(crate) ebs_item_filters: ::std::option::Option<::std::vec::Vec>, +} +impl ItemFiltersBuilder { + /// Appends an item to `s3_item_filters`. + /// + /// To override the contents of this collection use [`set_s3_item_filters`](Self::set_s3_item_filters). + /// + ///

This array can contain CreationTimes, ETags, ObjectKeys, Sizes, or VersionIds objects.

+ pub fn s3_item_filters(mut self, input: crate::types::S3ItemFilter) -> Self { + let mut v = self.s3_item_filters.unwrap_or_default(); + v.push(input); + self.s3_item_filters = ::std::option::Option::Some(v); + self + } + ///

This array can contain CreationTimes, ETags, ObjectKeys, Sizes, or VersionIds objects.

+ pub fn set_s3_item_filters(mut self, input: ::std::option::Option<::std::vec::Vec>) -> Self { + self.s3_item_filters = input; + self + } + ///

This array can contain CreationTimes, ETags, ObjectKeys, Sizes, or VersionIds objects.

+ pub fn get_s3_item_filters(&self) -> &::std::option::Option<::std::vec::Vec> { + &self.s3_item_filters + } + /// Appends an item to `ebs_item_filters`. + /// + /// To override the contents of this collection use [`set_ebs_item_filters`](Self::set_ebs_item_filters). + /// + ///

This array can contain CreationTimes, FilePaths, LastModificationTimes, or Sizes objects.

+ pub fn ebs_item_filters(mut self, input: crate::types::EbsItemFilter) -> Self { + let mut v = self.ebs_item_filters.unwrap_or_default(); + v.push(input); + self.ebs_item_filters = ::std::option::Option::Some(v); + self + } + ///

This array can contain CreationTimes, FilePaths, LastModificationTimes, or Sizes objects.

+ pub fn set_ebs_item_filters(mut self, input: ::std::option::Option<::std::vec::Vec>) -> Self { + self.ebs_item_filters = input; + self + } + ///

This array can contain CreationTimes, FilePaths, LastModificationTimes, or Sizes objects.

+ pub fn get_ebs_item_filters(&self) -> &::std::option::Option<::std::vec::Vec> { + &self.ebs_item_filters + } + /// Consumes the builder and constructs a [`ItemFilters`](crate::types::ItemFilters). + pub fn build(self) -> crate::types::ItemFilters { + crate::types::ItemFilters { + s3_item_filters: self.s3_item_filters, + ebs_item_filters: self.ebs_item_filters, + } + } +} diff --git a/sdk/backupsearch/src/types/_long_condition.rs b/sdk/backupsearch/src/types/_long_condition.rs new file mode 100644 index 000000000000..e7313dc212fd --- /dev/null +++ b/sdk/backupsearch/src/types/_long_condition.rs @@ -0,0 +1,89 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. + +///

The long condition contains a Value and can optionally contain an Operator.

+#[non_exhaustive] +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)] +pub struct LongCondition { + ///

The value of an item included in one of the search item filters.

+ pub value: i64, + ///

A string that defines what values will be returned.

+ ///

If this is included, avoid combinations of operators that will return all possible values. For example, including both EQUALS_TO and NOT_EQUALS_TO with a value of 4 will return all values.

+ pub operator: crate::types::LongConditionOperator, +} +impl LongCondition { + ///

The value of an item included in one of the search item filters.

+ pub fn value(&self) -> i64 { + self.value + } + ///

A string that defines what values will be returned.

+ ///

If this is included, avoid combinations of operators that will return all possible values. For example, including both EQUALS_TO and NOT_EQUALS_TO with a value of 4 will return all values.

+ pub fn operator(&self) -> &crate::types::LongConditionOperator { + &self.operator + } +} +impl LongCondition { + /// Creates a new builder-style object to manufacture [`LongCondition`](crate::types::LongCondition). + pub fn builder() -> crate::types::builders::LongConditionBuilder { + crate::types::builders::LongConditionBuilder::default() + } +} + +/// A builder for [`LongCondition`](crate::types::LongCondition). +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)] +#[non_exhaustive] +pub struct LongConditionBuilder { + pub(crate) value: ::std::option::Option, + pub(crate) operator: ::std::option::Option, +} +impl LongConditionBuilder { + ///

The value of an item included in one of the search item filters.

+ /// This field is required. + pub fn value(mut self, input: i64) -> Self { + self.value = ::std::option::Option::Some(input); + self + } + ///

The value of an item included in one of the search item filters.

+ pub fn set_value(mut self, input: ::std::option::Option) -> Self { + self.value = input; + self + } + ///

The value of an item included in one of the search item filters.

+ pub fn get_value(&self) -> &::std::option::Option { + &self.value + } + ///

A string that defines what values will be returned.

+ ///

If this is included, avoid combinations of operators that will return all possible values. For example, including both EQUALS_TO and NOT_EQUALS_TO with a value of 4 will return all values.

+ pub fn operator(mut self, input: crate::types::LongConditionOperator) -> Self { + self.operator = ::std::option::Option::Some(input); + self + } + ///

A string that defines what values will be returned.

+ ///

If this is included, avoid combinations of operators that will return all possible values. For example, including both EQUALS_TO and NOT_EQUALS_TO with a value of 4 will return all values.

+ pub fn set_operator(mut self, input: ::std::option::Option) -> Self { + self.operator = input; + self + } + ///

A string that defines what values will be returned.

+ ///

If this is included, avoid combinations of operators that will return all possible values. For example, including both EQUALS_TO and NOT_EQUALS_TO with a value of 4 will return all values.

+ pub fn get_operator(&self) -> &::std::option::Option { + &self.operator + } + /// Consumes the builder and constructs a [`LongCondition`](crate::types::LongCondition). + /// This method will fail if any of the following fields are not set: + /// - [`value`](crate::types::builders::LongConditionBuilder::value) + pub fn build(self) -> ::std::result::Result { + ::std::result::Result::Ok(crate::types::LongCondition { + value: self.value.ok_or_else(|| { + ::aws_smithy_types::error::operation::BuildError::missing_field( + "value", + "value was not specified but it is required when building LongCondition", + ) + })?, + operator: self.operator.unwrap_or( + "EQUALS_TO" + .parse::() + .expect("static value validated to member"), + ), + }) + } +} diff --git a/sdk/backupsearch/src/types/_long_condition_operator.rs b/sdk/backupsearch/src/types/_long_condition_operator.rs new file mode 100644 index 000000000000..84a30d3a3f86 --- /dev/null +++ b/sdk/backupsearch/src/types/_long_condition_operator.rs @@ -0,0 +1,120 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. + +/// When writing a match expression against `LongConditionOperator`, it is important to ensure +/// your code is forward-compatible. That is, if a match arm handles a case for a +/// feature that is supported by the service but has not been represented as an enum +/// variant in a current version of SDK, your code should continue to work when you +/// upgrade SDK to a future version in which the enum does include a variant for that +/// feature. +/// +/// Here is an example of how you can make a match expression forward-compatible: +/// +/// ```text +/// # let longconditionoperator = unimplemented!(); +/// match longconditionoperator { +/// LongConditionOperator::EqualsTo => { /* ... */ }, +/// LongConditionOperator::GreaterThanEqualTo => { /* ... */ }, +/// LongConditionOperator::LessThanEqualTo => { /* ... */ }, +/// LongConditionOperator::NotEqualsTo => { /* ... */ }, +/// other @ _ if other.as_str() == "NewFeature" => { /* handles a case for `NewFeature` */ }, +/// _ => { /* ... */ }, +/// } +/// ``` +/// The above code demonstrates that when `longconditionoperator` represents +/// `NewFeature`, the execution path will lead to the second last match arm, +/// even though the enum does not contain a variant `LongConditionOperator::NewFeature` +/// in the current version of SDK. The reason is that the variable `other`, +/// created by the `@` operator, is bound to +/// `LongConditionOperator::Unknown(UnknownVariantValue("NewFeature".to_owned()))` +/// and calling `as_str` on it yields `"NewFeature"`. +/// This match expression is forward-compatible when executed with a newer +/// version of SDK where the variant `LongConditionOperator::NewFeature` is defined. +/// Specifically, when `longconditionoperator` represents `NewFeature`, +/// the execution path will hit the second last match arm as before by virtue of +/// calling `as_str` on `LongConditionOperator::NewFeature` also yielding `"NewFeature"`. +/// +/// Explicitly matching on the `Unknown` variant should +/// be avoided for two reasons: +/// - The inner data `UnknownVariantValue` is opaque, and no further information can be extracted. +/// - It might inadvertently shadow other intended match arms. +/// +#[allow(missing_docs)] // documentation missing in model +#[non_exhaustive] +#[derive( + ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::Ord, ::std::cmp::PartialEq, ::std::cmp::PartialOrd, ::std::fmt::Debug, ::std::hash::Hash, +)] +pub enum LongConditionOperator { + #[allow(missing_docs)] // documentation missing in model + EqualsTo, + #[allow(missing_docs)] // documentation missing in model + GreaterThanEqualTo, + #[allow(missing_docs)] // documentation missing in model + LessThanEqualTo, + #[allow(missing_docs)] // documentation missing in model + NotEqualsTo, + /// `Unknown` contains new variants that have been added since this code was generated. + #[deprecated(note = "Don't directly match on `Unknown`. See the docs on this enum for the correct way to handle unknown variants.")] + Unknown(crate::primitives::sealed_enum_unknown::UnknownVariantValue), +} +impl ::std::convert::From<&str> for LongConditionOperator { + fn from(s: &str) -> Self { + match s { + "EQUALS_TO" => LongConditionOperator::EqualsTo, + "GREATER_THAN_EQUAL_TO" => LongConditionOperator::GreaterThanEqualTo, + "LESS_THAN_EQUAL_TO" => LongConditionOperator::LessThanEqualTo, + "NOT_EQUALS_TO" => LongConditionOperator::NotEqualsTo, + other => LongConditionOperator::Unknown(crate::primitives::sealed_enum_unknown::UnknownVariantValue(other.to_owned())), + } + } +} +impl ::std::str::FromStr for LongConditionOperator { + type Err = ::std::convert::Infallible; + + fn from_str(s: &str) -> ::std::result::Result::Err> { + ::std::result::Result::Ok(LongConditionOperator::from(s)) + } +} +impl LongConditionOperator { + /// Returns the `&str` value of the enum member. + pub fn as_str(&self) -> &str { + match self { + LongConditionOperator::EqualsTo => "EQUALS_TO", + LongConditionOperator::GreaterThanEqualTo => "GREATER_THAN_EQUAL_TO", + LongConditionOperator::LessThanEqualTo => "LESS_THAN_EQUAL_TO", + LongConditionOperator::NotEqualsTo => "NOT_EQUALS_TO", + LongConditionOperator::Unknown(value) => value.as_str(), + } + } + /// Returns all the `&str` representations of the enum members. + pub const fn values() -> &'static [&'static str] { + &["EQUALS_TO", "GREATER_THAN_EQUAL_TO", "LESS_THAN_EQUAL_TO", "NOT_EQUALS_TO"] + } +} +impl ::std::convert::AsRef for LongConditionOperator { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl LongConditionOperator { + /// Parses the enum value while disallowing unknown variants. + /// + /// Unknown variants will result in an error. + pub fn try_parse(value: &str) -> ::std::result::Result { + match Self::from(value) { + #[allow(deprecated)] + Self::Unknown(_) => ::std::result::Result::Err(crate::error::UnknownVariantError::new(value)), + known => Ok(known), + } + } +} +impl ::std::fmt::Display for LongConditionOperator { + fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + match self { + LongConditionOperator::EqualsTo => write!(f, "EQUALS_TO"), + LongConditionOperator::GreaterThanEqualTo => write!(f, "GREATER_THAN_EQUAL_TO"), + LongConditionOperator::LessThanEqualTo => write!(f, "LESS_THAN_EQUAL_TO"), + LongConditionOperator::NotEqualsTo => write!(f, "NOT_EQUALS_TO"), + LongConditionOperator::Unknown(value) => write!(f, "{}", value), + } + } +} diff --git a/sdk/backupsearch/src/types/_resource_type.rs b/sdk/backupsearch/src/types/_resource_type.rs new file mode 100644 index 000000000000..c5d13bc93c3d --- /dev/null +++ b/sdk/backupsearch/src/types/_resource_type.rs @@ -0,0 +1,108 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. + +/// When writing a match expression against `ResourceType`, it is important to ensure +/// your code is forward-compatible. That is, if a match arm handles a case for a +/// feature that is supported by the service but has not been represented as an enum +/// variant in a current version of SDK, your code should continue to work when you +/// upgrade SDK to a future version in which the enum does include a variant for that +/// feature. +/// +/// Here is an example of how you can make a match expression forward-compatible: +/// +/// ```text +/// # let resourcetype = unimplemented!(); +/// match resourcetype { +/// ResourceType::Ebs => { /* ... */ }, +/// ResourceType::S3 => { /* ... */ }, +/// other @ _ if other.as_str() == "NewFeature" => { /* handles a case for `NewFeature` */ }, +/// _ => { /* ... */ }, +/// } +/// ``` +/// The above code demonstrates that when `resourcetype` represents +/// `NewFeature`, the execution path will lead to the second last match arm, +/// even though the enum does not contain a variant `ResourceType::NewFeature` +/// in the current version of SDK. The reason is that the variable `other`, +/// created by the `@` operator, is bound to +/// `ResourceType::Unknown(UnknownVariantValue("NewFeature".to_owned()))` +/// and calling `as_str` on it yields `"NewFeature"`. +/// This match expression is forward-compatible when executed with a newer +/// version of SDK where the variant `ResourceType::NewFeature` is defined. +/// Specifically, when `resourcetype` represents `NewFeature`, +/// the execution path will hit the second last match arm as before by virtue of +/// calling `as_str` on `ResourceType::NewFeature` also yielding `"NewFeature"`. +/// +/// Explicitly matching on the `Unknown` variant should +/// be avoided for two reasons: +/// - The inner data `UnknownVariantValue` is opaque, and no further information can be extracted. +/// - It might inadvertently shadow other intended match arms. +/// +#[allow(missing_docs)] // documentation missing in model +#[non_exhaustive] +#[derive( + ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::Ord, ::std::cmp::PartialEq, ::std::cmp::PartialOrd, ::std::fmt::Debug, ::std::hash::Hash, +)] +pub enum ResourceType { + #[allow(missing_docs)] // documentation missing in model + Ebs, + #[allow(missing_docs)] // documentation missing in model + S3, + /// `Unknown` contains new variants that have been added since this code was generated. + #[deprecated(note = "Don't directly match on `Unknown`. See the docs on this enum for the correct way to handle unknown variants.")] + Unknown(crate::primitives::sealed_enum_unknown::UnknownVariantValue), +} +impl ::std::convert::From<&str> for ResourceType { + fn from(s: &str) -> Self { + match s { + "EBS" => ResourceType::Ebs, + "S3" => ResourceType::S3, + other => ResourceType::Unknown(crate::primitives::sealed_enum_unknown::UnknownVariantValue(other.to_owned())), + } + } +} +impl ::std::str::FromStr for ResourceType { + type Err = ::std::convert::Infallible; + + fn from_str(s: &str) -> ::std::result::Result::Err> { + ::std::result::Result::Ok(ResourceType::from(s)) + } +} +impl ResourceType { + /// Returns the `&str` value of the enum member. + pub fn as_str(&self) -> &str { + match self { + ResourceType::Ebs => "EBS", + ResourceType::S3 => "S3", + ResourceType::Unknown(value) => value.as_str(), + } + } + /// Returns all the `&str` representations of the enum members. + pub const fn values() -> &'static [&'static str] { + &["EBS", "S3"] + } +} +impl ::std::convert::AsRef for ResourceType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl ResourceType { + /// Parses the enum value while disallowing unknown variants. + /// + /// Unknown variants will result in an error. + pub fn try_parse(value: &str) -> ::std::result::Result { + match Self::from(value) { + #[allow(deprecated)] + Self::Unknown(_) => ::std::result::Result::Err(crate::error::UnknownVariantError::new(value)), + known => Ok(known), + } + } +} +impl ::std::fmt::Display for ResourceType { + fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + match self { + ResourceType::Ebs => write!(f, "EBS"), + ResourceType::S3 => write!(f, "S3"), + ResourceType::Unknown(value) => write!(f, "{}", value), + } + } +} diff --git a/sdk/backupsearch/src/types/_result_item.rs b/sdk/backupsearch/src/types/_result_item.rs new file mode 100644 index 000000000000..4879a80e4802 --- /dev/null +++ b/sdk/backupsearch/src/types/_result_item.rs @@ -0,0 +1,52 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. + +///

This is an object representing the item returned in the results of a search for a specific resource type.

+#[non_exhaustive] +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)] +pub enum ResultItem { + ///

These are items returned in the search results of an Amazon EBS search.

+ EbsResultItem(crate::types::EbsResultItem), + ///

These are items returned in the search results of an Amazon S3 search.

+ S3ResultItem(crate::types::S3ResultItem), + /// The `Unknown` variant represents cases where new union variant was received. Consider upgrading the SDK to the latest available version. + /// An unknown enum variant + /// + /// _Note: If you encounter this error, consider upgrading your SDK to the latest version._ + /// The `Unknown` variant represents cases where the server sent a value that wasn't recognized + /// by the client. This can happen when the server adds new functionality, but the client has not been updated. + /// To investigate this, consider turning on debug logging to print the raw HTTP response. + #[non_exhaustive] + Unknown, +} +impl ResultItem { + /// Tries to convert the enum instance into [`EbsResultItem`](crate::types::ResultItem::EbsResultItem), extracting the inner [`EbsResultItem`](crate::types::EbsResultItem). + /// Returns `Err(&Self)` if it can't be converted. + pub fn as_ebs_result_item(&self) -> ::std::result::Result<&crate::types::EbsResultItem, &Self> { + if let ResultItem::EbsResultItem(val) = &self { + ::std::result::Result::Ok(val) + } else { + ::std::result::Result::Err(self) + } + } + /// Returns true if this is a [`EbsResultItem`](crate::types::ResultItem::EbsResultItem). + pub fn is_ebs_result_item(&self) -> bool { + self.as_ebs_result_item().is_ok() + } + /// Tries to convert the enum instance into [`S3ResultItem`](crate::types::ResultItem::S3ResultItem), extracting the inner [`S3ResultItem`](crate::types::S3ResultItem). + /// Returns `Err(&Self)` if it can't be converted. + pub fn as_s3_result_item(&self) -> ::std::result::Result<&crate::types::S3ResultItem, &Self> { + if let ResultItem::S3ResultItem(val) = &self { + ::std::result::Result::Ok(val) + } else { + ::std::result::Result::Err(self) + } + } + /// Returns true if this is a [`S3ResultItem`](crate::types::ResultItem::S3ResultItem). + pub fn is_s3_result_item(&self) -> bool { + self.as_s3_result_item().is_ok() + } + /// Returns true if the enum instance is the `Unknown` variant. + pub fn is_unknown(&self) -> bool { + matches!(self, Self::Unknown) + } +} diff --git a/sdk/backupsearch/src/types/_s3_export_specification.rs b/sdk/backupsearch/src/types/_s3_export_specification.rs new file mode 100644 index 000000000000..cd5a29bf2722 --- /dev/null +++ b/sdk/backupsearch/src/types/_s3_export_specification.rs @@ -0,0 +1,81 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. + +///

This specification contains a required string of the destination bucket; optionally, you can include the destination prefix.

+#[non_exhaustive] +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)] +pub struct S3ExportSpecification { + ///

This specifies the destination Amazon S3 bucket for the export job.

+ pub destination_bucket: ::std::string::String, + ///

This specifies the prefix for the destination Amazon S3 bucket for the export job.

+ pub destination_prefix: ::std::option::Option<::std::string::String>, +} +impl S3ExportSpecification { + ///

This specifies the destination Amazon S3 bucket for the export job.

+ pub fn destination_bucket(&self) -> &str { + use std::ops::Deref; + self.destination_bucket.deref() + } + ///

This specifies the prefix for the destination Amazon S3 bucket for the export job.

+ pub fn destination_prefix(&self) -> ::std::option::Option<&str> { + self.destination_prefix.as_deref() + } +} +impl S3ExportSpecification { + /// Creates a new builder-style object to manufacture [`S3ExportSpecification`](crate::types::S3ExportSpecification). + pub fn builder() -> crate::types::builders::S3ExportSpecificationBuilder { + crate::types::builders::S3ExportSpecificationBuilder::default() + } +} + +/// A builder for [`S3ExportSpecification`](crate::types::S3ExportSpecification). +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)] +#[non_exhaustive] +pub struct S3ExportSpecificationBuilder { + pub(crate) destination_bucket: ::std::option::Option<::std::string::String>, + pub(crate) destination_prefix: ::std::option::Option<::std::string::String>, +} +impl S3ExportSpecificationBuilder { + ///

This specifies the destination Amazon S3 bucket for the export job.

+ /// This field is required. + pub fn destination_bucket(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.destination_bucket = ::std::option::Option::Some(input.into()); + self + } + ///

This specifies the destination Amazon S3 bucket for the export job.

+ pub fn set_destination_bucket(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.destination_bucket = input; + self + } + ///

This specifies the destination Amazon S3 bucket for the export job.

+ pub fn get_destination_bucket(&self) -> &::std::option::Option<::std::string::String> { + &self.destination_bucket + } + ///

This specifies the prefix for the destination Amazon S3 bucket for the export job.

+ pub fn destination_prefix(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.destination_prefix = ::std::option::Option::Some(input.into()); + self + } + ///

This specifies the prefix for the destination Amazon S3 bucket for the export job.

+ pub fn set_destination_prefix(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.destination_prefix = input; + self + } + ///

This specifies the prefix for the destination Amazon S3 bucket for the export job.

+ pub fn get_destination_prefix(&self) -> &::std::option::Option<::std::string::String> { + &self.destination_prefix + } + /// Consumes the builder and constructs a [`S3ExportSpecification`](crate::types::S3ExportSpecification). + /// This method will fail if any of the following fields are not set: + /// - [`destination_bucket`](crate::types::builders::S3ExportSpecificationBuilder::destination_bucket) + pub fn build(self) -> ::std::result::Result { + ::std::result::Result::Ok(crate::types::S3ExportSpecification { + destination_bucket: self.destination_bucket.ok_or_else(|| { + ::aws_smithy_types::error::operation::BuildError::missing_field( + "destination_bucket", + "destination_bucket was not specified but it is required when building S3ExportSpecification", + ) + })?, + destination_prefix: self.destination_prefix, + }) + } +} diff --git a/sdk/backupsearch/src/types/_s3_item_filter.rs b/sdk/backupsearch/src/types/_s3_item_filter.rs new file mode 100644 index 000000000000..d2398a1dde01 --- /dev/null +++ b/sdk/backupsearch/src/types/_s3_item_filter.rs @@ -0,0 +1,228 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. + +///

This contains arrays of objects, which may include ObjectKeys, Sizes, CreationTimes, VersionIds, and/or Etags.

+#[non_exhaustive] +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)] +pub struct S3ItemFilter { + ///

You can include 1 to 10 values.

+ ///

If one value is included, the results will return only items that match the value.

+ ///

If more than one value is included, the results will return all items that match any of the values.

+ pub object_keys: ::std::option::Option<::std::vec::Vec>, + ///

You can include 1 to 10 values.

+ ///

If one value is included, the results will return only items that match the value.

+ ///

If more than one value is included, the results will return all items that match any of the values.

+ pub sizes: ::std::option::Option<::std::vec::Vec>, + ///

You can include 1 to 10 values.

+ ///

If one value is included, the results will return only items that match the value.

+ ///

If more than one value is included, the results will return all items that match any of the values.

+ pub creation_times: ::std::option::Option<::std::vec::Vec>, + ///

You can include 1 to 10 values.

+ ///

If one value is included, the results will return only items that match the value.

+ ///

If more than one value is included, the results will return all items that match any of the values.

+ pub version_ids: ::std::option::Option<::std::vec::Vec>, + ///

You can include 1 to 10 values.

+ ///

If one value is included, the results will return only items that match the value.

+ ///

If more than one value is included, the results will return all items that match any of the values.

+ pub e_tags: ::std::option::Option<::std::vec::Vec>, +} +impl S3ItemFilter { + ///

You can include 1 to 10 values.

+ ///

If one value is included, the results will return only items that match the value.

+ ///

If more than one value is included, the results will return all items that match any of the values.

+ /// + /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.object_keys.is_none()`. + pub fn object_keys(&self) -> &[crate::types::StringCondition] { + self.object_keys.as_deref().unwrap_or_default() + } + ///

You can include 1 to 10 values.

+ ///

If one value is included, the results will return only items that match the value.

+ ///

If more than one value is included, the results will return all items that match any of the values.

+ /// + /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.sizes.is_none()`. + pub fn sizes(&self) -> &[crate::types::LongCondition] { + self.sizes.as_deref().unwrap_or_default() + } + ///

You can include 1 to 10 values.

+ ///

If one value is included, the results will return only items that match the value.

+ ///

If more than one value is included, the results will return all items that match any of the values.

+ /// + /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.creation_times.is_none()`. + pub fn creation_times(&self) -> &[crate::types::TimeCondition] { + self.creation_times.as_deref().unwrap_or_default() + } + ///

You can include 1 to 10 values.

+ ///

If one value is included, the results will return only items that match the value.

+ ///

If more than one value is included, the results will return all items that match any of the values.

+ /// + /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.version_ids.is_none()`. + pub fn version_ids(&self) -> &[crate::types::StringCondition] { + self.version_ids.as_deref().unwrap_or_default() + } + ///

You can include 1 to 10 values.

+ ///

If one value is included, the results will return only items that match the value.

+ ///

If more than one value is included, the results will return all items that match any of the values.

+ /// + /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.e_tags.is_none()`. + pub fn e_tags(&self) -> &[crate::types::StringCondition] { + self.e_tags.as_deref().unwrap_or_default() + } +} +impl S3ItemFilter { + /// Creates a new builder-style object to manufacture [`S3ItemFilter`](crate::types::S3ItemFilter). + pub fn builder() -> crate::types::builders::S3ItemFilterBuilder { + crate::types::builders::S3ItemFilterBuilder::default() + } +} + +/// A builder for [`S3ItemFilter`](crate::types::S3ItemFilter). +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)] +#[non_exhaustive] +pub struct S3ItemFilterBuilder { + pub(crate) object_keys: ::std::option::Option<::std::vec::Vec>, + pub(crate) sizes: ::std::option::Option<::std::vec::Vec>, + pub(crate) creation_times: ::std::option::Option<::std::vec::Vec>, + pub(crate) version_ids: ::std::option::Option<::std::vec::Vec>, + pub(crate) e_tags: ::std::option::Option<::std::vec::Vec>, +} +impl S3ItemFilterBuilder { + /// Appends an item to `object_keys`. + /// + /// To override the contents of this collection use [`set_object_keys`](Self::set_object_keys). + /// + ///

You can include 1 to 10 values.

+ ///

If one value is included, the results will return only items that match the value.

+ ///

If more than one value is included, the results will return all items that match any of the values.

+ pub fn object_keys(mut self, input: crate::types::StringCondition) -> Self { + let mut v = self.object_keys.unwrap_or_default(); + v.push(input); + self.object_keys = ::std::option::Option::Some(v); + self + } + ///

You can include 1 to 10 values.

+ ///

If one value is included, the results will return only items that match the value.

+ ///

If more than one value is included, the results will return all items that match any of the values.

+ pub fn set_object_keys(mut self, input: ::std::option::Option<::std::vec::Vec>) -> Self { + self.object_keys = input; + self + } + ///

You can include 1 to 10 values.

+ ///

If one value is included, the results will return only items that match the value.

+ ///

If more than one value is included, the results will return all items that match any of the values.

+ pub fn get_object_keys(&self) -> &::std::option::Option<::std::vec::Vec> { + &self.object_keys + } + /// Appends an item to `sizes`. + /// + /// To override the contents of this collection use [`set_sizes`](Self::set_sizes). + /// + ///

You can include 1 to 10 values.

+ ///

If one value is included, the results will return only items that match the value.

+ ///

If more than one value is included, the results will return all items that match any of the values.

+ pub fn sizes(mut self, input: crate::types::LongCondition) -> Self { + let mut v = self.sizes.unwrap_or_default(); + v.push(input); + self.sizes = ::std::option::Option::Some(v); + self + } + ///

You can include 1 to 10 values.

+ ///

If one value is included, the results will return only items that match the value.

+ ///

If more than one value is included, the results will return all items that match any of the values.

+ pub fn set_sizes(mut self, input: ::std::option::Option<::std::vec::Vec>) -> Self { + self.sizes = input; + self + } + ///

You can include 1 to 10 values.

+ ///

If one value is included, the results will return only items that match the value.

+ ///

If more than one value is included, the results will return all items that match any of the values.

+ pub fn get_sizes(&self) -> &::std::option::Option<::std::vec::Vec> { + &self.sizes + } + /// Appends an item to `creation_times`. + /// + /// To override the contents of this collection use [`set_creation_times`](Self::set_creation_times). + /// + ///

You can include 1 to 10 values.

+ ///

If one value is included, the results will return only items that match the value.

+ ///

If more than one value is included, the results will return all items that match any of the values.

+ pub fn creation_times(mut self, input: crate::types::TimeCondition) -> Self { + let mut v = self.creation_times.unwrap_or_default(); + v.push(input); + self.creation_times = ::std::option::Option::Some(v); + self + } + ///

You can include 1 to 10 values.

+ ///

If one value is included, the results will return only items that match the value.

+ ///

If more than one value is included, the results will return all items that match any of the values.

+ pub fn set_creation_times(mut self, input: ::std::option::Option<::std::vec::Vec>) -> Self { + self.creation_times = input; + self + } + ///

You can include 1 to 10 values.

+ ///

If one value is included, the results will return only items that match the value.

+ ///

If more than one value is included, the results will return all items that match any of the values.

+ pub fn get_creation_times(&self) -> &::std::option::Option<::std::vec::Vec> { + &self.creation_times + } + /// Appends an item to `version_ids`. + /// + /// To override the contents of this collection use [`set_version_ids`](Self::set_version_ids). + /// + ///

You can include 1 to 10 values.

+ ///

If one value is included, the results will return only items that match the value.

+ ///

If more than one value is included, the results will return all items that match any of the values.

+ pub fn version_ids(mut self, input: crate::types::StringCondition) -> Self { + let mut v = self.version_ids.unwrap_or_default(); + v.push(input); + self.version_ids = ::std::option::Option::Some(v); + self + } + ///

You can include 1 to 10 values.

+ ///

If one value is included, the results will return only items that match the value.

+ ///

If more than one value is included, the results will return all items that match any of the values.

+ pub fn set_version_ids(mut self, input: ::std::option::Option<::std::vec::Vec>) -> Self { + self.version_ids = input; + self + } + ///

You can include 1 to 10 values.

+ ///

If one value is included, the results will return only items that match the value.

+ ///

If more than one value is included, the results will return all items that match any of the values.

+ pub fn get_version_ids(&self) -> &::std::option::Option<::std::vec::Vec> { + &self.version_ids + } + /// Appends an item to `e_tags`. + /// + /// To override the contents of this collection use [`set_e_tags`](Self::set_e_tags). + /// + ///

You can include 1 to 10 values.

+ ///

If one value is included, the results will return only items that match the value.

+ ///

If more than one value is included, the results will return all items that match any of the values.

+ pub fn e_tags(mut self, input: crate::types::StringCondition) -> Self { + let mut v = self.e_tags.unwrap_or_default(); + v.push(input); + self.e_tags = ::std::option::Option::Some(v); + self + } + ///

You can include 1 to 10 values.

+ ///

If one value is included, the results will return only items that match the value.

+ ///

If more than one value is included, the results will return all items that match any of the values.

+ pub fn set_e_tags(mut self, input: ::std::option::Option<::std::vec::Vec>) -> Self { + self.e_tags = input; + self + } + ///

You can include 1 to 10 values.

+ ///

If one value is included, the results will return only items that match the value.

+ ///

If more than one value is included, the results will return all items that match any of the values.

+ pub fn get_e_tags(&self) -> &::std::option::Option<::std::vec::Vec> { + &self.e_tags + } + /// Consumes the builder and constructs a [`S3ItemFilter`](crate::types::S3ItemFilter). + pub fn build(self) -> crate::types::S3ItemFilter { + crate::types::S3ItemFilter { + object_keys: self.object_keys, + sizes: self.sizes, + creation_times: self.creation_times, + version_ids: self.version_ids, + e_tags: self.e_tags, + } + } +} diff --git a/sdk/backupsearch/src/types/_s3_result_item.rs b/sdk/backupsearch/src/types/_s3_result_item.rs new file mode 100644 index 000000000000..9be776dbff01 --- /dev/null +++ b/sdk/backupsearch/src/types/_s3_result_item.rs @@ -0,0 +1,232 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. + +///

These are the items returned in the results of a search of Amazon S3 backup metadata.

+#[non_exhaustive] +#[derive(::std::clone::Clone, ::std::cmp::PartialEq)] +pub struct S3ResultItem { + ///

These are items in the returned results that match recovery point Amazon Resource Names (ARN) input during a search of Amazon S3 backup metadata.

+ pub backup_resource_arn: ::std::option::Option<::std::string::String>, + ///

These are items in the returned results that match source Amazon Resource Names (ARN) input during a search of Amazon S3 backup metadata.

+ pub source_resource_arn: ::std::option::Option<::std::string::String>, + ///

The name of the backup vault.

+ pub backup_vault_name: ::std::option::Option<::std::string::String>, + ///

This is one or more items returned in the results of a search of Amazon S3 backup metadata that match the values input for object key.

+ pub object_key: ::std::option::Option<::std::string::String>, + ///

These are items in the returned results that match values for object size(s) input during a search of Amazon S3 backup metadata.

+ pub object_size: ::std::option::Option, + ///

These are one or more items in the returned results that match values for item creation time input during a search of Amazon S3 backup metadata.

+ pub creation_time: ::std::option::Option<::aws_smithy_types::DateTime>, + ///

These are one or more items in the returned results that match values for ETags input during a search of Amazon S3 backup metadata.

+ pub e_tag: ::std::option::Option<::std::string::String>, + ///

These are one or more items in the returned results that match values for version IDs input during a search of Amazon S3 backup metadata.

+ pub version_id: ::std::option::Option<::std::string::String>, +} +impl S3ResultItem { + ///

These are items in the returned results that match recovery point Amazon Resource Names (ARN) input during a search of Amazon S3 backup metadata.

+ pub fn backup_resource_arn(&self) -> ::std::option::Option<&str> { + self.backup_resource_arn.as_deref() + } + ///

These are items in the returned results that match source Amazon Resource Names (ARN) input during a search of Amazon S3 backup metadata.

+ pub fn source_resource_arn(&self) -> ::std::option::Option<&str> { + self.source_resource_arn.as_deref() + } + ///

The name of the backup vault.

+ pub fn backup_vault_name(&self) -> ::std::option::Option<&str> { + self.backup_vault_name.as_deref() + } + ///

This is one or more items returned in the results of a search of Amazon S3 backup metadata that match the values input for object key.

+ pub fn object_key(&self) -> ::std::option::Option<&str> { + self.object_key.as_deref() + } + ///

These are items in the returned results that match values for object size(s) input during a search of Amazon S3 backup metadata.

+ pub fn object_size(&self) -> ::std::option::Option { + self.object_size + } + ///

These are one or more items in the returned results that match values for item creation time input during a search of Amazon S3 backup metadata.

+ pub fn creation_time(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> { + self.creation_time.as_ref() + } + ///

These are one or more items in the returned results that match values for ETags input during a search of Amazon S3 backup metadata.

+ pub fn e_tag(&self) -> ::std::option::Option<&str> { + self.e_tag.as_deref() + } + ///

These are one or more items in the returned results that match values for version IDs input during a search of Amazon S3 backup metadata.

+ pub fn version_id(&self) -> ::std::option::Option<&str> { + self.version_id.as_deref() + } +} +impl ::std::fmt::Debug for S3ResultItem { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + let mut formatter = f.debug_struct("S3ResultItem"); + formatter.field("backup_resource_arn", &self.backup_resource_arn); + formatter.field("source_resource_arn", &self.source_resource_arn); + formatter.field("backup_vault_name", &self.backup_vault_name); + formatter.field("object_key", &"*** Sensitive Data Redacted ***"); + formatter.field("object_size", &self.object_size); + formatter.field("creation_time", &self.creation_time); + formatter.field("e_tag", &self.e_tag); + formatter.field("version_id", &self.version_id); + formatter.finish() + } +} +impl S3ResultItem { + /// Creates a new builder-style object to manufacture [`S3ResultItem`](crate::types::S3ResultItem). + pub fn builder() -> crate::types::builders::S3ResultItemBuilder { + crate::types::builders::S3ResultItemBuilder::default() + } +} + +/// A builder for [`S3ResultItem`](crate::types::S3ResultItem). +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)] +#[non_exhaustive] +pub struct S3ResultItemBuilder { + pub(crate) backup_resource_arn: ::std::option::Option<::std::string::String>, + pub(crate) source_resource_arn: ::std::option::Option<::std::string::String>, + pub(crate) backup_vault_name: ::std::option::Option<::std::string::String>, + pub(crate) object_key: ::std::option::Option<::std::string::String>, + pub(crate) object_size: ::std::option::Option, + pub(crate) creation_time: ::std::option::Option<::aws_smithy_types::DateTime>, + pub(crate) e_tag: ::std::option::Option<::std::string::String>, + pub(crate) version_id: ::std::option::Option<::std::string::String>, +} +impl S3ResultItemBuilder { + ///

These are items in the returned results that match recovery point Amazon Resource Names (ARN) input during a search of Amazon S3 backup metadata.

+ pub fn backup_resource_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.backup_resource_arn = ::std::option::Option::Some(input.into()); + self + } + ///

These are items in the returned results that match recovery point Amazon Resource Names (ARN) input during a search of Amazon S3 backup metadata.

+ pub fn set_backup_resource_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.backup_resource_arn = input; + self + } + ///

These are items in the returned results that match recovery point Amazon Resource Names (ARN) input during a search of Amazon S3 backup metadata.

+ pub fn get_backup_resource_arn(&self) -> &::std::option::Option<::std::string::String> { + &self.backup_resource_arn + } + ///

These are items in the returned results that match source Amazon Resource Names (ARN) input during a search of Amazon S3 backup metadata.

+ pub fn source_resource_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.source_resource_arn = ::std::option::Option::Some(input.into()); + self + } + ///

These are items in the returned results that match source Amazon Resource Names (ARN) input during a search of Amazon S3 backup metadata.

+ pub fn set_source_resource_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.source_resource_arn = input; + self + } + ///

These are items in the returned results that match source Amazon Resource Names (ARN) input during a search of Amazon S3 backup metadata.

+ pub fn get_source_resource_arn(&self) -> &::std::option::Option<::std::string::String> { + &self.source_resource_arn + } + ///

The name of the backup vault.

+ pub fn backup_vault_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.backup_vault_name = ::std::option::Option::Some(input.into()); + self + } + ///

The name of the backup vault.

+ pub fn set_backup_vault_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.backup_vault_name = input; + self + } + ///

The name of the backup vault.

+ pub fn get_backup_vault_name(&self) -> &::std::option::Option<::std::string::String> { + &self.backup_vault_name + } + ///

This is one or more items returned in the results of a search of Amazon S3 backup metadata that match the values input for object key.

+ pub fn object_key(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.object_key = ::std::option::Option::Some(input.into()); + self + } + ///

This is one or more items returned in the results of a search of Amazon S3 backup metadata that match the values input for object key.

+ pub fn set_object_key(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.object_key = input; + self + } + ///

This is one or more items returned in the results of a search of Amazon S3 backup metadata that match the values input for object key.

+ pub fn get_object_key(&self) -> &::std::option::Option<::std::string::String> { + &self.object_key + } + ///

These are items in the returned results that match values for object size(s) input during a search of Amazon S3 backup metadata.

+ pub fn object_size(mut self, input: i64) -> Self { + self.object_size = ::std::option::Option::Some(input); + self + } + ///

These are items in the returned results that match values for object size(s) input during a search of Amazon S3 backup metadata.

+ pub fn set_object_size(mut self, input: ::std::option::Option) -> Self { + self.object_size = input; + self + } + ///

These are items in the returned results that match values for object size(s) input during a search of Amazon S3 backup metadata.

+ pub fn get_object_size(&self) -> &::std::option::Option { + &self.object_size + } + ///

These are one or more items in the returned results that match values for item creation time input during a search of Amazon S3 backup metadata.

+ pub fn creation_time(mut self, input: ::aws_smithy_types::DateTime) -> Self { + self.creation_time = ::std::option::Option::Some(input); + self + } + ///

These are one or more items in the returned results that match values for item creation time input during a search of Amazon S3 backup metadata.

+ pub fn set_creation_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self { + self.creation_time = input; + self + } + ///

These are one or more items in the returned results that match values for item creation time input during a search of Amazon S3 backup metadata.

+ pub fn get_creation_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> { + &self.creation_time + } + ///

These are one or more items in the returned results that match values for ETags input during a search of Amazon S3 backup metadata.

+ pub fn e_tag(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.e_tag = ::std::option::Option::Some(input.into()); + self + } + ///

These are one or more items in the returned results that match values for ETags input during a search of Amazon S3 backup metadata.

+ pub fn set_e_tag(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.e_tag = input; + self + } + ///

These are one or more items in the returned results that match values for ETags input during a search of Amazon S3 backup metadata.

+ pub fn get_e_tag(&self) -> &::std::option::Option<::std::string::String> { + &self.e_tag + } + ///

These are one or more items in the returned results that match values for version IDs input during a search of Amazon S3 backup metadata.

+ pub fn version_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.version_id = ::std::option::Option::Some(input.into()); + self + } + ///

These are one or more items in the returned results that match values for version IDs input during a search of Amazon S3 backup metadata.

+ pub fn set_version_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.version_id = input; + self + } + ///

These are one or more items in the returned results that match values for version IDs input during a search of Amazon S3 backup metadata.

+ pub fn get_version_id(&self) -> &::std::option::Option<::std::string::String> { + &self.version_id + } + /// Consumes the builder and constructs a [`S3ResultItem`](crate::types::S3ResultItem). + pub fn build(self) -> crate::types::S3ResultItem { + crate::types::S3ResultItem { + backup_resource_arn: self.backup_resource_arn, + source_resource_arn: self.source_resource_arn, + backup_vault_name: self.backup_vault_name, + object_key: self.object_key, + object_size: self.object_size, + creation_time: self.creation_time, + e_tag: self.e_tag, + version_id: self.version_id, + } + } +} +impl ::std::fmt::Debug for S3ResultItemBuilder { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + let mut formatter = f.debug_struct("S3ResultItemBuilder"); + formatter.field("backup_resource_arn", &self.backup_resource_arn); + formatter.field("source_resource_arn", &self.source_resource_arn); + formatter.field("backup_vault_name", &self.backup_vault_name); + formatter.field("object_key", &"*** Sensitive Data Redacted ***"); + formatter.field("object_size", &self.object_size); + formatter.field("creation_time", &self.creation_time); + formatter.field("e_tag", &self.e_tag); + formatter.field("version_id", &self.version_id); + formatter.finish() + } +} diff --git a/sdk/backupsearch/src/types/_search_job_backups_result.rs b/sdk/backupsearch/src/types/_search_job_backups_result.rs new file mode 100644 index 000000000000..78adab458d98 --- /dev/null +++ b/sdk/backupsearch/src/types/_search_job_backups_result.rs @@ -0,0 +1,182 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. + +///

This contains the information about recovery points returned in results of a search job.

+#[non_exhaustive] +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)] +pub struct SearchJobBackupsResult { + ///

This is the status of the search job backup result.

+ pub status: ::std::option::Option, + ///

This is the status message included with the results.

+ pub status_message: ::std::option::Option<::std::string::String>, + ///

This is the resource type of the search.

+ pub resource_type: ::std::option::Option, + ///

The Amazon Resource Name (ARN) that uniquely identifies the backup resources.

+ pub backup_resource_arn: ::std::option::Option<::std::string::String>, + ///

The Amazon Resource Name (ARN) that uniquely identifies the source resources.

+ pub source_resource_arn: ::std::option::Option<::std::string::String>, + ///

This is the creation time of the backup index.

+ pub index_creation_time: ::std::option::Option<::aws_smithy_types::DateTime>, + ///

This is the creation time of the backup (recovery point).

+ pub backup_creation_time: ::std::option::Option<::aws_smithy_types::DateTime>, +} +impl SearchJobBackupsResult { + ///

This is the status of the search job backup result.

+ pub fn status(&self) -> ::std::option::Option<&crate::types::SearchJobState> { + self.status.as_ref() + } + ///

This is the status message included with the results.

+ pub fn status_message(&self) -> ::std::option::Option<&str> { + self.status_message.as_deref() + } + ///

This is the resource type of the search.

+ pub fn resource_type(&self) -> ::std::option::Option<&crate::types::ResourceType> { + self.resource_type.as_ref() + } + ///

The Amazon Resource Name (ARN) that uniquely identifies the backup resources.

+ pub fn backup_resource_arn(&self) -> ::std::option::Option<&str> { + self.backup_resource_arn.as_deref() + } + ///

The Amazon Resource Name (ARN) that uniquely identifies the source resources.

+ pub fn source_resource_arn(&self) -> ::std::option::Option<&str> { + self.source_resource_arn.as_deref() + } + ///

This is the creation time of the backup index.

+ pub fn index_creation_time(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> { + self.index_creation_time.as_ref() + } + ///

This is the creation time of the backup (recovery point).

+ pub fn backup_creation_time(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> { + self.backup_creation_time.as_ref() + } +} +impl SearchJobBackupsResult { + /// Creates a new builder-style object to manufacture [`SearchJobBackupsResult`](crate::types::SearchJobBackupsResult). + pub fn builder() -> crate::types::builders::SearchJobBackupsResultBuilder { + crate::types::builders::SearchJobBackupsResultBuilder::default() + } +} + +/// A builder for [`SearchJobBackupsResult`](crate::types::SearchJobBackupsResult). +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)] +#[non_exhaustive] +pub struct SearchJobBackupsResultBuilder { + pub(crate) status: ::std::option::Option, + pub(crate) status_message: ::std::option::Option<::std::string::String>, + pub(crate) resource_type: ::std::option::Option, + pub(crate) backup_resource_arn: ::std::option::Option<::std::string::String>, + pub(crate) source_resource_arn: ::std::option::Option<::std::string::String>, + pub(crate) index_creation_time: ::std::option::Option<::aws_smithy_types::DateTime>, + pub(crate) backup_creation_time: ::std::option::Option<::aws_smithy_types::DateTime>, +} +impl SearchJobBackupsResultBuilder { + ///

This is the status of the search job backup result.

+ pub fn status(mut self, input: crate::types::SearchJobState) -> Self { + self.status = ::std::option::Option::Some(input); + self + } + ///

This is the status of the search job backup result.

+ pub fn set_status(mut self, input: ::std::option::Option) -> Self { + self.status = input; + self + } + ///

This is the status of the search job backup result.

+ pub fn get_status(&self) -> &::std::option::Option { + &self.status + } + ///

This is the status message included with the results.

+ pub fn status_message(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.status_message = ::std::option::Option::Some(input.into()); + self + } + ///

This is the status message included with the results.

+ pub fn set_status_message(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.status_message = input; + self + } + ///

This is the status message included with the results.

+ pub fn get_status_message(&self) -> &::std::option::Option<::std::string::String> { + &self.status_message + } + ///

This is the resource type of the search.

+ pub fn resource_type(mut self, input: crate::types::ResourceType) -> Self { + self.resource_type = ::std::option::Option::Some(input); + self + } + ///

This is the resource type of the search.

+ pub fn set_resource_type(mut self, input: ::std::option::Option) -> Self { + self.resource_type = input; + self + } + ///

This is the resource type of the search.

+ pub fn get_resource_type(&self) -> &::std::option::Option { + &self.resource_type + } + ///

The Amazon Resource Name (ARN) that uniquely identifies the backup resources.

+ pub fn backup_resource_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.backup_resource_arn = ::std::option::Option::Some(input.into()); + self + } + ///

The Amazon Resource Name (ARN) that uniquely identifies the backup resources.

+ pub fn set_backup_resource_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.backup_resource_arn = input; + self + } + ///

The Amazon Resource Name (ARN) that uniquely identifies the backup resources.

+ pub fn get_backup_resource_arn(&self) -> &::std::option::Option<::std::string::String> { + &self.backup_resource_arn + } + ///

The Amazon Resource Name (ARN) that uniquely identifies the source resources.

+ pub fn source_resource_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.source_resource_arn = ::std::option::Option::Some(input.into()); + self + } + ///

The Amazon Resource Name (ARN) that uniquely identifies the source resources.

+ pub fn set_source_resource_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.source_resource_arn = input; + self + } + ///

The Amazon Resource Name (ARN) that uniquely identifies the source resources.

+ pub fn get_source_resource_arn(&self) -> &::std::option::Option<::std::string::String> { + &self.source_resource_arn + } + ///

This is the creation time of the backup index.

+ pub fn index_creation_time(mut self, input: ::aws_smithy_types::DateTime) -> Self { + self.index_creation_time = ::std::option::Option::Some(input); + self + } + ///

This is the creation time of the backup index.

+ pub fn set_index_creation_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self { + self.index_creation_time = input; + self + } + ///

This is the creation time of the backup index.

+ pub fn get_index_creation_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> { + &self.index_creation_time + } + ///

This is the creation time of the backup (recovery point).

+ pub fn backup_creation_time(mut self, input: ::aws_smithy_types::DateTime) -> Self { + self.backup_creation_time = ::std::option::Option::Some(input); + self + } + ///

This is the creation time of the backup (recovery point).

+ pub fn set_backup_creation_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self { + self.backup_creation_time = input; + self + } + ///

This is the creation time of the backup (recovery point).

+ pub fn get_backup_creation_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> { + &self.backup_creation_time + } + /// Consumes the builder and constructs a [`SearchJobBackupsResult`](crate::types::SearchJobBackupsResult). + pub fn build(self) -> crate::types::SearchJobBackupsResult { + crate::types::SearchJobBackupsResult { + status: self.status, + status_message: self.status_message, + resource_type: self.resource_type, + backup_resource_arn: self.backup_resource_arn, + source_resource_arn: self.source_resource_arn, + index_creation_time: self.index_creation_time, + backup_creation_time: self.backup_creation_time, + } + } +} diff --git a/sdk/backupsearch/src/types/_search_job_state.rs b/sdk/backupsearch/src/types/_search_job_state.rs new file mode 100644 index 000000000000..f8ec8bc78dd9 --- /dev/null +++ b/sdk/backupsearch/src/types/_search_job_state.rs @@ -0,0 +1,126 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. + +/// When writing a match expression against `SearchJobState`, it is important to ensure +/// your code is forward-compatible. That is, if a match arm handles a case for a +/// feature that is supported by the service but has not been represented as an enum +/// variant in a current version of SDK, your code should continue to work when you +/// upgrade SDK to a future version in which the enum does include a variant for that +/// feature. +/// +/// Here is an example of how you can make a match expression forward-compatible: +/// +/// ```text +/// # let searchjobstate = unimplemented!(); +/// match searchjobstate { +/// SearchJobState::Completed => { /* ... */ }, +/// SearchJobState::Failed => { /* ... */ }, +/// SearchJobState::Running => { /* ... */ }, +/// SearchJobState::Stopped => { /* ... */ }, +/// SearchJobState::Stopping => { /* ... */ }, +/// other @ _ if other.as_str() == "NewFeature" => { /* handles a case for `NewFeature` */ }, +/// _ => { /* ... */ }, +/// } +/// ``` +/// The above code demonstrates that when `searchjobstate` represents +/// `NewFeature`, the execution path will lead to the second last match arm, +/// even though the enum does not contain a variant `SearchJobState::NewFeature` +/// in the current version of SDK. The reason is that the variable `other`, +/// created by the `@` operator, is bound to +/// `SearchJobState::Unknown(UnknownVariantValue("NewFeature".to_owned()))` +/// and calling `as_str` on it yields `"NewFeature"`. +/// This match expression is forward-compatible when executed with a newer +/// version of SDK where the variant `SearchJobState::NewFeature` is defined. +/// Specifically, when `searchjobstate` represents `NewFeature`, +/// the execution path will hit the second last match arm as before by virtue of +/// calling `as_str` on `SearchJobState::NewFeature` also yielding `"NewFeature"`. +/// +/// Explicitly matching on the `Unknown` variant should +/// be avoided for two reasons: +/// - The inner data `UnknownVariantValue` is opaque, and no further information can be extracted. +/// - It might inadvertently shadow other intended match arms. +/// +#[allow(missing_docs)] // documentation missing in model +#[non_exhaustive] +#[derive( + ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::Ord, ::std::cmp::PartialEq, ::std::cmp::PartialOrd, ::std::fmt::Debug, ::std::hash::Hash, +)] +pub enum SearchJobState { + #[allow(missing_docs)] // documentation missing in model + Completed, + #[allow(missing_docs)] // documentation missing in model + Failed, + #[allow(missing_docs)] // documentation missing in model + Running, + #[allow(missing_docs)] // documentation missing in model + Stopped, + #[allow(missing_docs)] // documentation missing in model + Stopping, + /// `Unknown` contains new variants that have been added since this code was generated. + #[deprecated(note = "Don't directly match on `Unknown`. See the docs on this enum for the correct way to handle unknown variants.")] + Unknown(crate::primitives::sealed_enum_unknown::UnknownVariantValue), +} +impl ::std::convert::From<&str> for SearchJobState { + fn from(s: &str) -> Self { + match s { + "COMPLETED" => SearchJobState::Completed, + "FAILED" => SearchJobState::Failed, + "RUNNING" => SearchJobState::Running, + "STOPPED" => SearchJobState::Stopped, + "STOPPING" => SearchJobState::Stopping, + other => SearchJobState::Unknown(crate::primitives::sealed_enum_unknown::UnknownVariantValue(other.to_owned())), + } + } +} +impl ::std::str::FromStr for SearchJobState { + type Err = ::std::convert::Infallible; + + fn from_str(s: &str) -> ::std::result::Result::Err> { + ::std::result::Result::Ok(SearchJobState::from(s)) + } +} +impl SearchJobState { + /// Returns the `&str` value of the enum member. + pub fn as_str(&self) -> &str { + match self { + SearchJobState::Completed => "COMPLETED", + SearchJobState::Failed => "FAILED", + SearchJobState::Running => "RUNNING", + SearchJobState::Stopped => "STOPPED", + SearchJobState::Stopping => "STOPPING", + SearchJobState::Unknown(value) => value.as_str(), + } + } + /// Returns all the `&str` representations of the enum members. + pub const fn values() -> &'static [&'static str] { + &["COMPLETED", "FAILED", "RUNNING", "STOPPED", "STOPPING"] + } +} +impl ::std::convert::AsRef for SearchJobState { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl SearchJobState { + /// Parses the enum value while disallowing unknown variants. + /// + /// Unknown variants will result in an error. + pub fn try_parse(value: &str) -> ::std::result::Result { + match Self::from(value) { + #[allow(deprecated)] + Self::Unknown(_) => ::std::result::Result::Err(crate::error::UnknownVariantError::new(value)), + known => Ok(known), + } + } +} +impl ::std::fmt::Display for SearchJobState { + fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + match self { + SearchJobState::Completed => write!(f, "COMPLETED"), + SearchJobState::Failed => write!(f, "FAILED"), + SearchJobState::Running => write!(f, "RUNNING"), + SearchJobState::Stopped => write!(f, "STOPPED"), + SearchJobState::Stopping => write!(f, "STOPPING"), + SearchJobState::Unknown(value) => write!(f, "{}", value), + } + } +} diff --git a/sdk/backupsearch/src/types/_search_job_summary.rs b/sdk/backupsearch/src/types/_search_job_summary.rs new file mode 100644 index 000000000000..480ad3ea6fbb --- /dev/null +++ b/sdk/backupsearch/src/types/_search_job_summary.rs @@ -0,0 +1,239 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. + +///

This is information pertaining to a search job.

+#[non_exhaustive] +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)] +pub struct SearchJobSummary { + ///

The unique string that specifies the search job.

+ pub search_job_identifier: ::std::option::Option<::std::string::String>, + ///

The unique string that identifies the Amazon Resource Name (ARN) of the specified search job.

+ pub search_job_arn: ::std::option::Option<::std::string::String>, + ///

This is the name of the search job.

+ pub name: ::std::option::Option<::std::string::String>, + ///

This is the status of the search job.

+ pub status: ::std::option::Option, + ///

This is the creation time of the search job.

+ pub creation_time: ::std::option::Option<::aws_smithy_types::DateTime>, + ///

This is the completion time of the search job.

+ pub completion_time: ::std::option::Option<::aws_smithy_types::DateTime>, + ///

Returned summary of the specified search job scope, including:

+ ///
    + ///
  • + ///

    TotalBackupsToScanCount, the number of recovery points returned by the search.

  • + ///
  • + ///

    TotalItemsToScanCount, the number of items returned by the search.

  • + ///
+ pub search_scope_summary: ::std::option::Option, + ///

A status message will be returned for either a earch job with a status of ERRORED or a status of COMPLETED jobs with issues.

+ ///

For example, a message may say that a search contained recovery points unable to be scanned because of a permissions issue.

+ pub status_message: ::std::option::Option<::std::string::String>, +} +impl SearchJobSummary { + ///

The unique string that specifies the search job.

+ pub fn search_job_identifier(&self) -> ::std::option::Option<&str> { + self.search_job_identifier.as_deref() + } + ///

The unique string that identifies the Amazon Resource Name (ARN) of the specified search job.

+ pub fn search_job_arn(&self) -> ::std::option::Option<&str> { + self.search_job_arn.as_deref() + } + ///

This is the name of the search job.

+ pub fn name(&self) -> ::std::option::Option<&str> { + self.name.as_deref() + } + ///

This is the status of the search job.

+ pub fn status(&self) -> ::std::option::Option<&crate::types::SearchJobState> { + self.status.as_ref() + } + ///

This is the creation time of the search job.

+ pub fn creation_time(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> { + self.creation_time.as_ref() + } + ///

This is the completion time of the search job.

+ pub fn completion_time(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> { + self.completion_time.as_ref() + } + ///

Returned summary of the specified search job scope, including:

+ ///
    + ///
  • + ///

    TotalBackupsToScanCount, the number of recovery points returned by the search.

  • + ///
  • + ///

    TotalItemsToScanCount, the number of items returned by the search.

  • + ///
+ pub fn search_scope_summary(&self) -> ::std::option::Option<&crate::types::SearchScopeSummary> { + self.search_scope_summary.as_ref() + } + ///

A status message will be returned for either a earch job with a status of ERRORED or a status of COMPLETED jobs with issues.

+ ///

For example, a message may say that a search contained recovery points unable to be scanned because of a permissions issue.

+ pub fn status_message(&self) -> ::std::option::Option<&str> { + self.status_message.as_deref() + } +} +impl SearchJobSummary { + /// Creates a new builder-style object to manufacture [`SearchJobSummary`](crate::types::SearchJobSummary). + pub fn builder() -> crate::types::builders::SearchJobSummaryBuilder { + crate::types::builders::SearchJobSummaryBuilder::default() + } +} + +/// A builder for [`SearchJobSummary`](crate::types::SearchJobSummary). +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)] +#[non_exhaustive] +pub struct SearchJobSummaryBuilder { + pub(crate) search_job_identifier: ::std::option::Option<::std::string::String>, + pub(crate) search_job_arn: ::std::option::Option<::std::string::String>, + pub(crate) name: ::std::option::Option<::std::string::String>, + pub(crate) status: ::std::option::Option, + pub(crate) creation_time: ::std::option::Option<::aws_smithy_types::DateTime>, + pub(crate) completion_time: ::std::option::Option<::aws_smithy_types::DateTime>, + pub(crate) search_scope_summary: ::std::option::Option, + pub(crate) status_message: ::std::option::Option<::std::string::String>, +} +impl SearchJobSummaryBuilder { + ///

The unique string that specifies the search job.

+ pub fn search_job_identifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.search_job_identifier = ::std::option::Option::Some(input.into()); + self + } + ///

The unique string that specifies the search job.

+ pub fn set_search_job_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.search_job_identifier = input; + self + } + ///

The unique string that specifies the search job.

+ pub fn get_search_job_identifier(&self) -> &::std::option::Option<::std::string::String> { + &self.search_job_identifier + } + ///

The unique string that identifies the Amazon Resource Name (ARN) of the specified search job.

+ pub fn search_job_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.search_job_arn = ::std::option::Option::Some(input.into()); + self + } + ///

The unique string that identifies the Amazon Resource Name (ARN) of the specified search job.

+ pub fn set_search_job_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.search_job_arn = input; + self + } + ///

The unique string that identifies the Amazon Resource Name (ARN) of the specified search job.

+ pub fn get_search_job_arn(&self) -> &::std::option::Option<::std::string::String> { + &self.search_job_arn + } + ///

This is the name of the search job.

+ pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.name = ::std::option::Option::Some(input.into()); + self + } + ///

This is the name of the search job.

+ pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.name = input; + self + } + ///

This is the name of the search job.

+ pub fn get_name(&self) -> &::std::option::Option<::std::string::String> { + &self.name + } + ///

This is the status of the search job.

+ pub fn status(mut self, input: crate::types::SearchJobState) -> Self { + self.status = ::std::option::Option::Some(input); + self + } + ///

This is the status of the search job.

+ pub fn set_status(mut self, input: ::std::option::Option) -> Self { + self.status = input; + self + } + ///

This is the status of the search job.

+ pub fn get_status(&self) -> &::std::option::Option { + &self.status + } + ///

This is the creation time of the search job.

+ pub fn creation_time(mut self, input: ::aws_smithy_types::DateTime) -> Self { + self.creation_time = ::std::option::Option::Some(input); + self + } + ///

This is the creation time of the search job.

+ pub fn set_creation_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self { + self.creation_time = input; + self + } + ///

This is the creation time of the search job.

+ pub fn get_creation_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> { + &self.creation_time + } + ///

This is the completion time of the search job.

+ pub fn completion_time(mut self, input: ::aws_smithy_types::DateTime) -> Self { + self.completion_time = ::std::option::Option::Some(input); + self + } + ///

This is the completion time of the search job.

+ pub fn set_completion_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self { + self.completion_time = input; + self + } + ///

This is the completion time of the search job.

+ pub fn get_completion_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> { + &self.completion_time + } + ///

Returned summary of the specified search job scope, including:

+ ///
    + ///
  • + ///

    TotalBackupsToScanCount, the number of recovery points returned by the search.

  • + ///
  • + ///

    TotalItemsToScanCount, the number of items returned by the search.

  • + ///
+ pub fn search_scope_summary(mut self, input: crate::types::SearchScopeSummary) -> Self { + self.search_scope_summary = ::std::option::Option::Some(input); + self + } + ///

Returned summary of the specified search job scope, including:

+ ///
    + ///
  • + ///

    TotalBackupsToScanCount, the number of recovery points returned by the search.

  • + ///
  • + ///

    TotalItemsToScanCount, the number of items returned by the search.

  • + ///
+ pub fn set_search_scope_summary(mut self, input: ::std::option::Option) -> Self { + self.search_scope_summary = input; + self + } + ///

Returned summary of the specified search job scope, including:

+ ///
    + ///
  • + ///

    TotalBackupsToScanCount, the number of recovery points returned by the search.

  • + ///
  • + ///

    TotalItemsToScanCount, the number of items returned by the search.

  • + ///
+ pub fn get_search_scope_summary(&self) -> &::std::option::Option { + &self.search_scope_summary + } + ///

A status message will be returned for either a earch job with a status of ERRORED or a status of COMPLETED jobs with issues.

+ ///

For example, a message may say that a search contained recovery points unable to be scanned because of a permissions issue.

+ pub fn status_message(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.status_message = ::std::option::Option::Some(input.into()); + self + } + ///

A status message will be returned for either a earch job with a status of ERRORED or a status of COMPLETED jobs with issues.

+ ///

For example, a message may say that a search contained recovery points unable to be scanned because of a permissions issue.

+ pub fn set_status_message(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.status_message = input; + self + } + ///

A status message will be returned for either a earch job with a status of ERRORED or a status of COMPLETED jobs with issues.

+ ///

For example, a message may say that a search contained recovery points unable to be scanned because of a permissions issue.

+ pub fn get_status_message(&self) -> &::std::option::Option<::std::string::String> { + &self.status_message + } + /// Consumes the builder and constructs a [`SearchJobSummary`](crate::types::SearchJobSummary). + pub fn build(self) -> crate::types::SearchJobSummary { + crate::types::SearchJobSummary { + search_job_identifier: self.search_job_identifier, + search_job_arn: self.search_job_arn, + name: self.name, + status: self.status, + creation_time: self.creation_time, + completion_time: self.completion_time, + search_scope_summary: self.search_scope_summary, + status_message: self.status_message, + } + } +} diff --git a/sdk/backupsearch/src/types/_search_scope.rs b/sdk/backupsearch/src/types/_search_scope.rs new file mode 100644 index 000000000000..0b10711fe241 --- /dev/null +++ b/sdk/backupsearch/src/types/_search_scope.rs @@ -0,0 +1,191 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. + +///

The search scope is all backup properties input into a search.

+#[non_exhaustive] +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)] +pub struct SearchScope { + ///

The resource types included in a search.

+ ///

Eligible resource types include S3 and EBS.

+ pub backup_resource_types: ::std::vec::Vec, + ///

This is the time a backup resource was created.

+ pub backup_resource_creation_time: ::std::option::Option, + ///

The Amazon Resource Name (ARN) that uniquely identifies the source resources.

+ pub source_resource_arns: ::std::option::Option<::std::vec::Vec<::std::string::String>>, + ///

The Amazon Resource Name (ARN) that uniquely identifies the backup resources.

+ pub backup_resource_arns: ::std::option::Option<::std::vec::Vec<::std::string::String>>, + ///

These are one or more tags on the backup (recovery point).

+ pub backup_resource_tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::option::Option<::std::string::String>>>, +} +impl SearchScope { + ///

The resource types included in a search.

+ ///

Eligible resource types include S3 and EBS.

+ pub fn backup_resource_types(&self) -> &[crate::types::ResourceType] { + use std::ops::Deref; + self.backup_resource_types.deref() + } + ///

This is the time a backup resource was created.

+ pub fn backup_resource_creation_time(&self) -> ::std::option::Option<&crate::types::BackupCreationTimeFilter> { + self.backup_resource_creation_time.as_ref() + } + ///

The Amazon Resource Name (ARN) that uniquely identifies the source resources.

+ /// + /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.source_resource_arns.is_none()`. + pub fn source_resource_arns(&self) -> &[::std::string::String] { + self.source_resource_arns.as_deref().unwrap_or_default() + } + ///

The Amazon Resource Name (ARN) that uniquely identifies the backup resources.

+ /// + /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.backup_resource_arns.is_none()`. + pub fn backup_resource_arns(&self) -> &[::std::string::String] { + self.backup_resource_arns.as_deref().unwrap_or_default() + } + ///

These are one or more tags on the backup (recovery point).

+ pub fn backup_resource_tags( + &self, + ) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::option::Option<::std::string::String>>> { + self.backup_resource_tags.as_ref() + } +} +impl SearchScope { + /// Creates a new builder-style object to manufacture [`SearchScope`](crate::types::SearchScope). + pub fn builder() -> crate::types::builders::SearchScopeBuilder { + crate::types::builders::SearchScopeBuilder::default() + } +} + +/// A builder for [`SearchScope`](crate::types::SearchScope). +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)] +#[non_exhaustive] +pub struct SearchScopeBuilder { + pub(crate) backup_resource_types: ::std::option::Option<::std::vec::Vec>, + pub(crate) backup_resource_creation_time: ::std::option::Option, + pub(crate) source_resource_arns: ::std::option::Option<::std::vec::Vec<::std::string::String>>, + pub(crate) backup_resource_arns: ::std::option::Option<::std::vec::Vec<::std::string::String>>, + pub(crate) backup_resource_tags: + ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::option::Option<::std::string::String>>>, +} +impl SearchScopeBuilder { + /// Appends an item to `backup_resource_types`. + /// + /// To override the contents of this collection use [`set_backup_resource_types`](Self::set_backup_resource_types). + /// + ///

The resource types included in a search.

+ ///

Eligible resource types include S3 and EBS.

+ pub fn backup_resource_types(mut self, input: crate::types::ResourceType) -> Self { + let mut v = self.backup_resource_types.unwrap_or_default(); + v.push(input); + self.backup_resource_types = ::std::option::Option::Some(v); + self + } + ///

The resource types included in a search.

+ ///

Eligible resource types include S3 and EBS.

+ pub fn set_backup_resource_types(mut self, input: ::std::option::Option<::std::vec::Vec>) -> Self { + self.backup_resource_types = input; + self + } + ///

The resource types included in a search.

+ ///

Eligible resource types include S3 and EBS.

+ pub fn get_backup_resource_types(&self) -> &::std::option::Option<::std::vec::Vec> { + &self.backup_resource_types + } + ///

This is the time a backup resource was created.

+ pub fn backup_resource_creation_time(mut self, input: crate::types::BackupCreationTimeFilter) -> Self { + self.backup_resource_creation_time = ::std::option::Option::Some(input); + self + } + ///

This is the time a backup resource was created.

+ pub fn set_backup_resource_creation_time(mut self, input: ::std::option::Option) -> Self { + self.backup_resource_creation_time = input; + self + } + ///

This is the time a backup resource was created.

+ pub fn get_backup_resource_creation_time(&self) -> &::std::option::Option { + &self.backup_resource_creation_time + } + /// Appends an item to `source_resource_arns`. + /// + /// To override the contents of this collection use [`set_source_resource_arns`](Self::set_source_resource_arns). + /// + ///

The Amazon Resource Name (ARN) that uniquely identifies the source resources.

+ pub fn source_resource_arns(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + let mut v = self.source_resource_arns.unwrap_or_default(); + v.push(input.into()); + self.source_resource_arns = ::std::option::Option::Some(v); + self + } + ///

The Amazon Resource Name (ARN) that uniquely identifies the source resources.

+ pub fn set_source_resource_arns(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self { + self.source_resource_arns = input; + self + } + ///

The Amazon Resource Name (ARN) that uniquely identifies the source resources.

+ pub fn get_source_resource_arns(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> { + &self.source_resource_arns + } + /// Appends an item to `backup_resource_arns`. + /// + /// To override the contents of this collection use [`set_backup_resource_arns`](Self::set_backup_resource_arns). + /// + ///

The Amazon Resource Name (ARN) that uniquely identifies the backup resources.

+ pub fn backup_resource_arns(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + let mut v = self.backup_resource_arns.unwrap_or_default(); + v.push(input.into()); + self.backup_resource_arns = ::std::option::Option::Some(v); + self + } + ///

The Amazon Resource Name (ARN) that uniquely identifies the backup resources.

+ pub fn set_backup_resource_arns(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self { + self.backup_resource_arns = input; + self + } + ///

The Amazon Resource Name (ARN) that uniquely identifies the backup resources.

+ pub fn get_backup_resource_arns(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> { + &self.backup_resource_arns + } + /// Adds a key-value pair to `backup_resource_tags`. + /// + /// To override the contents of this collection use [`set_backup_resource_tags`](Self::set_backup_resource_tags). + /// + ///

These are one or more tags on the backup (recovery point).

+ pub fn backup_resource_tags( + mut self, + k: impl ::std::convert::Into<::std::string::String>, + v: ::std::option::Option<::std::string::String>, + ) -> Self { + let mut hash_map = self.backup_resource_tags.unwrap_or_default(); + hash_map.insert(k.into(), v); + self.backup_resource_tags = ::std::option::Option::Some(hash_map); + self + } + ///

These are one or more tags on the backup (recovery point).

+ pub fn set_backup_resource_tags( + mut self, + input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::option::Option<::std::string::String>>>, + ) -> Self { + self.backup_resource_tags = input; + self + } + ///

These are one or more tags on the backup (recovery point).

+ pub fn get_backup_resource_tags( + &self, + ) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::option::Option<::std::string::String>>> { + &self.backup_resource_tags + } + /// Consumes the builder and constructs a [`SearchScope`](crate::types::SearchScope). + /// This method will fail if any of the following fields are not set: + /// - [`backup_resource_types`](crate::types::builders::SearchScopeBuilder::backup_resource_types) + pub fn build(self) -> ::std::result::Result { + ::std::result::Result::Ok(crate::types::SearchScope { + backup_resource_types: self.backup_resource_types.ok_or_else(|| { + ::aws_smithy_types::error::operation::BuildError::missing_field( + "backup_resource_types", + "backup_resource_types was not specified but it is required when building SearchScope", + ) + })?, + backup_resource_creation_time: self.backup_resource_creation_time, + source_resource_arns: self.source_resource_arns, + backup_resource_arns: self.backup_resource_arns, + backup_resource_tags: self.backup_resource_tags, + }) + } +} diff --git a/sdk/backupsearch/src/types/_search_scope_summary.rs b/sdk/backupsearch/src/types/_search_scope_summary.rs new file mode 100644 index 000000000000..6b1a4d493af1 --- /dev/null +++ b/sdk/backupsearch/src/types/_search_scope_summary.rs @@ -0,0 +1,78 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. + +///

The summary of the specified search job scope, including:

+///
    +///
  • +///

    TotalBackupsToScanCount, the number of recovery points returned by the search.

  • +///
  • +///

    TotalItemsToScanCount, the number of items returned by the search.

  • +///
+#[non_exhaustive] +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)] +pub struct SearchScopeSummary { + ///

This is the count of the total number of backups that will be scanned in a search.

+ pub total_recovery_points_to_scan_count: ::std::option::Option, + ///

This is the count of the total number of items that will be scanned in a search.

+ pub total_items_to_scan_count: ::std::option::Option, +} +impl SearchScopeSummary { + ///

This is the count of the total number of backups that will be scanned in a search.

+ pub fn total_recovery_points_to_scan_count(&self) -> ::std::option::Option { + self.total_recovery_points_to_scan_count + } + ///

This is the count of the total number of items that will be scanned in a search.

+ pub fn total_items_to_scan_count(&self) -> ::std::option::Option { + self.total_items_to_scan_count + } +} +impl SearchScopeSummary { + /// Creates a new builder-style object to manufacture [`SearchScopeSummary`](crate::types::SearchScopeSummary). + pub fn builder() -> crate::types::builders::SearchScopeSummaryBuilder { + crate::types::builders::SearchScopeSummaryBuilder::default() + } +} + +/// A builder for [`SearchScopeSummary`](crate::types::SearchScopeSummary). +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)] +#[non_exhaustive] +pub struct SearchScopeSummaryBuilder { + pub(crate) total_recovery_points_to_scan_count: ::std::option::Option, + pub(crate) total_items_to_scan_count: ::std::option::Option, +} +impl SearchScopeSummaryBuilder { + ///

This is the count of the total number of backups that will be scanned in a search.

+ pub fn total_recovery_points_to_scan_count(mut self, input: i32) -> Self { + self.total_recovery_points_to_scan_count = ::std::option::Option::Some(input); + self + } + ///

This is the count of the total number of backups that will be scanned in a search.

+ pub fn set_total_recovery_points_to_scan_count(mut self, input: ::std::option::Option) -> Self { + self.total_recovery_points_to_scan_count = input; + self + } + ///

This is the count of the total number of backups that will be scanned in a search.

+ pub fn get_total_recovery_points_to_scan_count(&self) -> &::std::option::Option { + &self.total_recovery_points_to_scan_count + } + ///

This is the count of the total number of items that will be scanned in a search.

+ pub fn total_items_to_scan_count(mut self, input: i64) -> Self { + self.total_items_to_scan_count = ::std::option::Option::Some(input); + self + } + ///

This is the count of the total number of items that will be scanned in a search.

+ pub fn set_total_items_to_scan_count(mut self, input: ::std::option::Option) -> Self { + self.total_items_to_scan_count = input; + self + } + ///

This is the count of the total number of items that will be scanned in a search.

+ pub fn get_total_items_to_scan_count(&self) -> &::std::option::Option { + &self.total_items_to_scan_count + } + /// Consumes the builder and constructs a [`SearchScopeSummary`](crate::types::SearchScopeSummary). + pub fn build(self) -> crate::types::SearchScopeSummary { + crate::types::SearchScopeSummary { + total_recovery_points_to_scan_count: self.total_recovery_points_to_scan_count, + total_items_to_scan_count: self.total_items_to_scan_count, + } + } +} diff --git a/sdk/backupsearch/src/types/_string_condition.rs b/sdk/backupsearch/src/types/_string_condition.rs new file mode 100644 index 000000000000..23394741c2b1 --- /dev/null +++ b/sdk/backupsearch/src/types/_string_condition.rs @@ -0,0 +1,90 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. + +///

This contains the value of the string and can contain one or more operators.

+#[non_exhaustive] +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)] +pub struct StringCondition { + ///

The value of the string.

+ pub value: ::std::string::String, + ///

A string that defines what values will be returned.

+ ///

If this is included, avoid combinations of operators that will return all possible values. For example, including both EQUALS_TO and NOT_EQUALS_TO with a value of 4 will return all values.

+ pub operator: crate::types::StringConditionOperator, +} +impl StringCondition { + ///

The value of the string.

+ pub fn value(&self) -> &str { + use std::ops::Deref; + self.value.deref() + } + ///

A string that defines what values will be returned.

+ ///

If this is included, avoid combinations of operators that will return all possible values. For example, including both EQUALS_TO and NOT_EQUALS_TO with a value of 4 will return all values.

+ pub fn operator(&self) -> &crate::types::StringConditionOperator { + &self.operator + } +} +impl StringCondition { + /// Creates a new builder-style object to manufacture [`StringCondition`](crate::types::StringCondition). + pub fn builder() -> crate::types::builders::StringConditionBuilder { + crate::types::builders::StringConditionBuilder::default() + } +} + +/// A builder for [`StringCondition`](crate::types::StringCondition). +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)] +#[non_exhaustive] +pub struct StringConditionBuilder { + pub(crate) value: ::std::option::Option<::std::string::String>, + pub(crate) operator: ::std::option::Option, +} +impl StringConditionBuilder { + ///

The value of the string.

+ /// This field is required. + pub fn value(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.value = ::std::option::Option::Some(input.into()); + self + } + ///

The value of the string.

+ pub fn set_value(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.value = input; + self + } + ///

The value of the string.

+ pub fn get_value(&self) -> &::std::option::Option<::std::string::String> { + &self.value + } + ///

A string that defines what values will be returned.

+ ///

If this is included, avoid combinations of operators that will return all possible values. For example, including both EQUALS_TO and NOT_EQUALS_TO with a value of 4 will return all values.

+ pub fn operator(mut self, input: crate::types::StringConditionOperator) -> Self { + self.operator = ::std::option::Option::Some(input); + self + } + ///

A string that defines what values will be returned.

+ ///

If this is included, avoid combinations of operators that will return all possible values. For example, including both EQUALS_TO and NOT_EQUALS_TO with a value of 4 will return all values.

+ pub fn set_operator(mut self, input: ::std::option::Option) -> Self { + self.operator = input; + self + } + ///

A string that defines what values will be returned.

+ ///

If this is included, avoid combinations of operators that will return all possible values. For example, including both EQUALS_TO and NOT_EQUALS_TO with a value of 4 will return all values.

+ pub fn get_operator(&self) -> &::std::option::Option { + &self.operator + } + /// Consumes the builder and constructs a [`StringCondition`](crate::types::StringCondition). + /// This method will fail if any of the following fields are not set: + /// - [`value`](crate::types::builders::StringConditionBuilder::value) + pub fn build(self) -> ::std::result::Result { + ::std::result::Result::Ok(crate::types::StringCondition { + value: self.value.ok_or_else(|| { + ::aws_smithy_types::error::operation::BuildError::missing_field( + "value", + "value was not specified but it is required when building StringCondition", + ) + })?, + operator: self.operator.unwrap_or( + "EQUALS_TO" + .parse::() + .expect("static value validated to member"), + ), + }) + } +} diff --git a/sdk/backupsearch/src/types/_string_condition_operator.rs b/sdk/backupsearch/src/types/_string_condition_operator.rs new file mode 100644 index 000000000000..13ece415bf11 --- /dev/null +++ b/sdk/backupsearch/src/types/_string_condition_operator.rs @@ -0,0 +1,153 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. + +/// When writing a match expression against `StringConditionOperator`, it is important to ensure +/// your code is forward-compatible. That is, if a match arm handles a case for a +/// feature that is supported by the service but has not been represented as an enum +/// variant in a current version of SDK, your code should continue to work when you +/// upgrade SDK to a future version in which the enum does include a variant for that +/// feature. +/// +/// Here is an example of how you can make a match expression forward-compatible: +/// +/// ```text +/// # let stringconditionoperator = unimplemented!(); +/// match stringconditionoperator { +/// StringConditionOperator::BeginsWith => { /* ... */ }, +/// StringConditionOperator::Contains => { /* ... */ }, +/// StringConditionOperator::DoesNotBeginWith => { /* ... */ }, +/// StringConditionOperator::DoesNotContain => { /* ... */ }, +/// StringConditionOperator::DoesNotEndWith => { /* ... */ }, +/// StringConditionOperator::EndsWith => { /* ... */ }, +/// StringConditionOperator::EqualsTo => { /* ... */ }, +/// StringConditionOperator::NotEqualsTo => { /* ... */ }, +/// other @ _ if other.as_str() == "NewFeature" => { /* handles a case for `NewFeature` */ }, +/// _ => { /* ... */ }, +/// } +/// ``` +/// The above code demonstrates that when `stringconditionoperator` represents +/// `NewFeature`, the execution path will lead to the second last match arm, +/// even though the enum does not contain a variant `StringConditionOperator::NewFeature` +/// in the current version of SDK. The reason is that the variable `other`, +/// created by the `@` operator, is bound to +/// `StringConditionOperator::Unknown(UnknownVariantValue("NewFeature".to_owned()))` +/// and calling `as_str` on it yields `"NewFeature"`. +/// This match expression is forward-compatible when executed with a newer +/// version of SDK where the variant `StringConditionOperator::NewFeature` is defined. +/// Specifically, when `stringconditionoperator` represents `NewFeature`, +/// the execution path will hit the second last match arm as before by virtue of +/// calling `as_str` on `StringConditionOperator::NewFeature` also yielding `"NewFeature"`. +/// +/// Explicitly matching on the `Unknown` variant should +/// be avoided for two reasons: +/// - The inner data `UnknownVariantValue` is opaque, and no further information can be extracted. +/// - It might inadvertently shadow other intended match arms. +/// +#[allow(missing_docs)] // documentation missing in model +#[non_exhaustive] +#[derive( + ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::Ord, ::std::cmp::PartialEq, ::std::cmp::PartialOrd, ::std::fmt::Debug, ::std::hash::Hash, +)] +pub enum StringConditionOperator { + #[allow(missing_docs)] // documentation missing in model + BeginsWith, + #[allow(missing_docs)] // documentation missing in model + Contains, + #[allow(missing_docs)] // documentation missing in model + DoesNotBeginWith, + #[allow(missing_docs)] // documentation missing in model + DoesNotContain, + #[allow(missing_docs)] // documentation missing in model + DoesNotEndWith, + #[allow(missing_docs)] // documentation missing in model + EndsWith, + #[allow(missing_docs)] // documentation missing in model + EqualsTo, + #[allow(missing_docs)] // documentation missing in model + NotEqualsTo, + /// `Unknown` contains new variants that have been added since this code was generated. + #[deprecated(note = "Don't directly match on `Unknown`. See the docs on this enum for the correct way to handle unknown variants.")] + Unknown(crate::primitives::sealed_enum_unknown::UnknownVariantValue), +} +impl ::std::convert::From<&str> for StringConditionOperator { + fn from(s: &str) -> Self { + match s { + "BEGINS_WITH" => StringConditionOperator::BeginsWith, + "CONTAINS" => StringConditionOperator::Contains, + "DOES_NOT_BEGIN_WITH" => StringConditionOperator::DoesNotBeginWith, + "DOES_NOT_CONTAIN" => StringConditionOperator::DoesNotContain, + "DOES_NOT_END_WITH" => StringConditionOperator::DoesNotEndWith, + "ENDS_WITH" => StringConditionOperator::EndsWith, + "EQUALS_TO" => StringConditionOperator::EqualsTo, + "NOT_EQUALS_TO" => StringConditionOperator::NotEqualsTo, + other => StringConditionOperator::Unknown(crate::primitives::sealed_enum_unknown::UnknownVariantValue(other.to_owned())), + } + } +} +impl ::std::str::FromStr for StringConditionOperator { + type Err = ::std::convert::Infallible; + + fn from_str(s: &str) -> ::std::result::Result::Err> { + ::std::result::Result::Ok(StringConditionOperator::from(s)) + } +} +impl StringConditionOperator { + /// Returns the `&str` value of the enum member. + pub fn as_str(&self) -> &str { + match self { + StringConditionOperator::BeginsWith => "BEGINS_WITH", + StringConditionOperator::Contains => "CONTAINS", + StringConditionOperator::DoesNotBeginWith => "DOES_NOT_BEGIN_WITH", + StringConditionOperator::DoesNotContain => "DOES_NOT_CONTAIN", + StringConditionOperator::DoesNotEndWith => "DOES_NOT_END_WITH", + StringConditionOperator::EndsWith => "ENDS_WITH", + StringConditionOperator::EqualsTo => "EQUALS_TO", + StringConditionOperator::NotEqualsTo => "NOT_EQUALS_TO", + StringConditionOperator::Unknown(value) => value.as_str(), + } + } + /// Returns all the `&str` representations of the enum members. + pub const fn values() -> &'static [&'static str] { + &[ + "BEGINS_WITH", + "CONTAINS", + "DOES_NOT_BEGIN_WITH", + "DOES_NOT_CONTAIN", + "DOES_NOT_END_WITH", + "ENDS_WITH", + "EQUALS_TO", + "NOT_EQUALS_TO", + ] + } +} +impl ::std::convert::AsRef for StringConditionOperator { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl StringConditionOperator { + /// Parses the enum value while disallowing unknown variants. + /// + /// Unknown variants will result in an error. + pub fn try_parse(value: &str) -> ::std::result::Result { + match Self::from(value) { + #[allow(deprecated)] + Self::Unknown(_) => ::std::result::Result::Err(crate::error::UnknownVariantError::new(value)), + known => Ok(known), + } + } +} +impl ::std::fmt::Display for StringConditionOperator { + fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + match self { + StringConditionOperator::BeginsWith => write!(f, "BEGINS_WITH"), + StringConditionOperator::Contains => write!(f, "CONTAINS"), + StringConditionOperator::DoesNotBeginWith => write!(f, "DOES_NOT_BEGIN_WITH"), + StringConditionOperator::DoesNotContain => write!(f, "DOES_NOT_CONTAIN"), + StringConditionOperator::DoesNotEndWith => write!(f, "DOES_NOT_END_WITH"), + StringConditionOperator::EndsWith => write!(f, "ENDS_WITH"), + StringConditionOperator::EqualsTo => write!(f, "EQUALS_TO"), + StringConditionOperator::NotEqualsTo => write!(f, "NOT_EQUALS_TO"), + StringConditionOperator::Unknown(value) => write!(f, "{}", value), + } + } +} diff --git a/sdk/backupsearch/src/types/_time_condition.rs b/sdk/backupsearch/src/types/_time_condition.rs new file mode 100644 index 000000000000..88c4ef24073d --- /dev/null +++ b/sdk/backupsearch/src/types/_time_condition.rs @@ -0,0 +1,89 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. + +///

A time condition denotes a creation time, last modification time, or other time.

+#[non_exhaustive] +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)] +pub struct TimeCondition { + ///

This is the timestamp value of the time condition.

+ pub value: ::aws_smithy_types::DateTime, + ///

A string that defines what values will be returned.

+ ///

If this is included, avoid combinations of operators that will return all possible values. For example, including both EQUALS_TO and NOT_EQUALS_TO with a value of 4 will return all values.

+ pub operator: crate::types::TimeConditionOperator, +} +impl TimeCondition { + ///

This is the timestamp value of the time condition.

+ pub fn value(&self) -> &::aws_smithy_types::DateTime { + &self.value + } + ///

A string that defines what values will be returned.

+ ///

If this is included, avoid combinations of operators that will return all possible values. For example, including both EQUALS_TO and NOT_EQUALS_TO with a value of 4 will return all values.

+ pub fn operator(&self) -> &crate::types::TimeConditionOperator { + &self.operator + } +} +impl TimeCondition { + /// Creates a new builder-style object to manufacture [`TimeCondition`](crate::types::TimeCondition). + pub fn builder() -> crate::types::builders::TimeConditionBuilder { + crate::types::builders::TimeConditionBuilder::default() + } +} + +/// A builder for [`TimeCondition`](crate::types::TimeCondition). +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)] +#[non_exhaustive] +pub struct TimeConditionBuilder { + pub(crate) value: ::std::option::Option<::aws_smithy_types::DateTime>, + pub(crate) operator: ::std::option::Option, +} +impl TimeConditionBuilder { + ///

This is the timestamp value of the time condition.

+ /// This field is required. + pub fn value(mut self, input: ::aws_smithy_types::DateTime) -> Self { + self.value = ::std::option::Option::Some(input); + self + } + ///

This is the timestamp value of the time condition.

+ pub fn set_value(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self { + self.value = input; + self + } + ///

This is the timestamp value of the time condition.

+ pub fn get_value(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> { + &self.value + } + ///

A string that defines what values will be returned.

+ ///

If this is included, avoid combinations of operators that will return all possible values. For example, including both EQUALS_TO and NOT_EQUALS_TO with a value of 4 will return all values.

+ pub fn operator(mut self, input: crate::types::TimeConditionOperator) -> Self { + self.operator = ::std::option::Option::Some(input); + self + } + ///

A string that defines what values will be returned.

+ ///

If this is included, avoid combinations of operators that will return all possible values. For example, including both EQUALS_TO and NOT_EQUALS_TO with a value of 4 will return all values.

+ pub fn set_operator(mut self, input: ::std::option::Option) -> Self { + self.operator = input; + self + } + ///

A string that defines what values will be returned.

+ ///

If this is included, avoid combinations of operators that will return all possible values. For example, including both EQUALS_TO and NOT_EQUALS_TO with a value of 4 will return all values.

+ pub fn get_operator(&self) -> &::std::option::Option { + &self.operator + } + /// Consumes the builder and constructs a [`TimeCondition`](crate::types::TimeCondition). + /// This method will fail if any of the following fields are not set: + /// - [`value`](crate::types::builders::TimeConditionBuilder::value) + pub fn build(self) -> ::std::result::Result { + ::std::result::Result::Ok(crate::types::TimeCondition { + value: self.value.ok_or_else(|| { + ::aws_smithy_types::error::operation::BuildError::missing_field( + "value", + "value was not specified but it is required when building TimeCondition", + ) + })?, + operator: self.operator.unwrap_or( + "EQUALS_TO" + .parse::() + .expect("static value validated to member"), + ), + }) + } +} diff --git a/sdk/backupsearch/src/types/_time_condition_operator.rs b/sdk/backupsearch/src/types/_time_condition_operator.rs new file mode 100644 index 000000000000..151060bba83b --- /dev/null +++ b/sdk/backupsearch/src/types/_time_condition_operator.rs @@ -0,0 +1,120 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. + +/// When writing a match expression against `TimeConditionOperator`, it is important to ensure +/// your code is forward-compatible. That is, if a match arm handles a case for a +/// feature that is supported by the service but has not been represented as an enum +/// variant in a current version of SDK, your code should continue to work when you +/// upgrade SDK to a future version in which the enum does include a variant for that +/// feature. +/// +/// Here is an example of how you can make a match expression forward-compatible: +/// +/// ```text +/// # let timeconditionoperator = unimplemented!(); +/// match timeconditionoperator { +/// TimeConditionOperator::EqualsTo => { /* ... */ }, +/// TimeConditionOperator::GreaterThanEqualTo => { /* ... */ }, +/// TimeConditionOperator::LessThanEqualTo => { /* ... */ }, +/// TimeConditionOperator::NotEqualsTo => { /* ... */ }, +/// other @ _ if other.as_str() == "NewFeature" => { /* handles a case for `NewFeature` */ }, +/// _ => { /* ... */ }, +/// } +/// ``` +/// The above code demonstrates that when `timeconditionoperator` represents +/// `NewFeature`, the execution path will lead to the second last match arm, +/// even though the enum does not contain a variant `TimeConditionOperator::NewFeature` +/// in the current version of SDK. The reason is that the variable `other`, +/// created by the `@` operator, is bound to +/// `TimeConditionOperator::Unknown(UnknownVariantValue("NewFeature".to_owned()))` +/// and calling `as_str` on it yields `"NewFeature"`. +/// This match expression is forward-compatible when executed with a newer +/// version of SDK where the variant `TimeConditionOperator::NewFeature` is defined. +/// Specifically, when `timeconditionoperator` represents `NewFeature`, +/// the execution path will hit the second last match arm as before by virtue of +/// calling `as_str` on `TimeConditionOperator::NewFeature` also yielding `"NewFeature"`. +/// +/// Explicitly matching on the `Unknown` variant should +/// be avoided for two reasons: +/// - The inner data `UnknownVariantValue` is opaque, and no further information can be extracted. +/// - It might inadvertently shadow other intended match arms. +/// +#[allow(missing_docs)] // documentation missing in model +#[non_exhaustive] +#[derive( + ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::Ord, ::std::cmp::PartialEq, ::std::cmp::PartialOrd, ::std::fmt::Debug, ::std::hash::Hash, +)] +pub enum TimeConditionOperator { + #[allow(missing_docs)] // documentation missing in model + EqualsTo, + #[allow(missing_docs)] // documentation missing in model + GreaterThanEqualTo, + #[allow(missing_docs)] // documentation missing in model + LessThanEqualTo, + #[allow(missing_docs)] // documentation missing in model + NotEqualsTo, + /// `Unknown` contains new variants that have been added since this code was generated. + #[deprecated(note = "Don't directly match on `Unknown`. See the docs on this enum for the correct way to handle unknown variants.")] + Unknown(crate::primitives::sealed_enum_unknown::UnknownVariantValue), +} +impl ::std::convert::From<&str> for TimeConditionOperator { + fn from(s: &str) -> Self { + match s { + "EQUALS_TO" => TimeConditionOperator::EqualsTo, + "GREATER_THAN_EQUAL_TO" => TimeConditionOperator::GreaterThanEqualTo, + "LESS_THAN_EQUAL_TO" => TimeConditionOperator::LessThanEqualTo, + "NOT_EQUALS_TO" => TimeConditionOperator::NotEqualsTo, + other => TimeConditionOperator::Unknown(crate::primitives::sealed_enum_unknown::UnknownVariantValue(other.to_owned())), + } + } +} +impl ::std::str::FromStr for TimeConditionOperator { + type Err = ::std::convert::Infallible; + + fn from_str(s: &str) -> ::std::result::Result::Err> { + ::std::result::Result::Ok(TimeConditionOperator::from(s)) + } +} +impl TimeConditionOperator { + /// Returns the `&str` value of the enum member. + pub fn as_str(&self) -> &str { + match self { + TimeConditionOperator::EqualsTo => "EQUALS_TO", + TimeConditionOperator::GreaterThanEqualTo => "GREATER_THAN_EQUAL_TO", + TimeConditionOperator::LessThanEqualTo => "LESS_THAN_EQUAL_TO", + TimeConditionOperator::NotEqualsTo => "NOT_EQUALS_TO", + TimeConditionOperator::Unknown(value) => value.as_str(), + } + } + /// Returns all the `&str` representations of the enum members. + pub const fn values() -> &'static [&'static str] { + &["EQUALS_TO", "GREATER_THAN_EQUAL_TO", "LESS_THAN_EQUAL_TO", "NOT_EQUALS_TO"] + } +} +impl ::std::convert::AsRef for TimeConditionOperator { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl TimeConditionOperator { + /// Parses the enum value while disallowing unknown variants. + /// + /// Unknown variants will result in an error. + pub fn try_parse(value: &str) -> ::std::result::Result { + match Self::from(value) { + #[allow(deprecated)] + Self::Unknown(_) => ::std::result::Result::Err(crate::error::UnknownVariantError::new(value)), + known => Ok(known), + } + } +} +impl ::std::fmt::Display for TimeConditionOperator { + fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + match self { + TimeConditionOperator::EqualsTo => write!(f, "EQUALS_TO"), + TimeConditionOperator::GreaterThanEqualTo => write!(f, "GREATER_THAN_EQUAL_TO"), + TimeConditionOperator::LessThanEqualTo => write!(f, "LESS_THAN_EQUAL_TO"), + TimeConditionOperator::NotEqualsTo => write!(f, "NOT_EQUALS_TO"), + TimeConditionOperator::Unknown(value) => write!(f, "{}", value), + } + } +} diff --git a/sdk/backupsearch/src/types/builders.rs b/sdk/backupsearch/src/types/builders.rs new file mode 100644 index 000000000000..d9fe757f11fd --- /dev/null +++ b/sdk/backupsearch/src/types/builders.rs @@ -0,0 +1,32 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +pub use crate::types::_s3_export_specification::S3ExportSpecificationBuilder; + +pub use crate::types::_export_job_summary::ExportJobSummaryBuilder; + +pub use crate::types::_item_filters::ItemFiltersBuilder; + +pub use crate::types::_ebs_item_filter::EbsItemFilterBuilder; + +pub use crate::types::_time_condition::TimeConditionBuilder; + +pub use crate::types::_long_condition::LongConditionBuilder; + +pub use crate::types::_string_condition::StringConditionBuilder; + +pub use crate::types::_s3_item_filter::S3ItemFilterBuilder; + +pub use crate::types::_search_scope::SearchScopeBuilder; + +pub use crate::types::_backup_creation_time_filter::BackupCreationTimeFilterBuilder; + +pub use crate::types::_current_search_progress::CurrentSearchProgressBuilder; + +pub use crate::types::_search_scope_summary::SearchScopeSummaryBuilder; + +pub use crate::types::_search_job_summary::SearchJobSummaryBuilder; + +pub use crate::types::_ebs_result_item::EbsResultItemBuilder; + +pub use crate::types::_s3_result_item::S3ResultItemBuilder; + +pub use crate::types::_search_job_backups_result::SearchJobBackupsResultBuilder; diff --git a/sdk/backupsearch/src/types/error.rs b/sdk/backupsearch/src/types/error.rs new file mode 100644 index 000000000000..b93c66e0f24d --- /dev/null +++ b/sdk/backupsearch/src/types/error.rs @@ -0,0 +1,31 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +pub use crate::types::error::_validation_exception::ValidationException; + +pub use crate::types::error::_throttling_exception::ThrottlingException; + +pub use crate::types::error::_internal_server_exception::InternalServerException; + +pub use crate::types::error::_access_denied_exception::AccessDeniedException; + +pub use crate::types::error::_resource_not_found_exception::ResourceNotFoundException; + +pub use crate::types::error::_service_quota_exceeded_exception::ServiceQuotaExceededException; + +pub use crate::types::error::_conflict_exception::ConflictException; + +mod _access_denied_exception; + +mod _conflict_exception; + +mod _internal_server_exception; + +mod _resource_not_found_exception; + +mod _service_quota_exceeded_exception; + +mod _throttling_exception; + +mod _validation_exception; + +/// Builders +pub mod builders; diff --git a/sdk/backupsearch/src/types/error/_access_denied_exception.rs b/sdk/backupsearch/src/types/error/_access_denied_exception.rs new file mode 100644 index 000000000000..4a6ac63537ba --- /dev/null +++ b/sdk/backupsearch/src/types/error/_access_denied_exception.rs @@ -0,0 +1,93 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. + +///

You do not have sufficient access to perform this action.

+#[non_exhaustive] +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)] +pub struct AccessDeniedException { + ///

User does not have sufficient access to perform this action.

+ pub message: ::std::string::String, + pub(crate) meta: ::aws_smithy_types::error::ErrorMetadata, +} +impl AccessDeniedException { + /// Returns the error message. + pub fn message(&self) -> &str { + &self.message + } +} +impl ::std::fmt::Display for AccessDeniedException { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + ::std::write!(f, "AccessDeniedException")?; + { + ::std::write!(f, ": {}", &self.message)?; + } + Ok(()) + } +} +impl ::std::error::Error for AccessDeniedException {} +impl ::aws_types::request_id::RequestId for crate::types::error::AccessDeniedException { + fn request_id(&self) -> Option<&str> { + use ::aws_smithy_types::error::metadata::ProvideErrorMetadata; + self.meta().request_id() + } +} +impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for AccessDeniedException { + fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata { + &self.meta + } +} +impl AccessDeniedException { + /// Creates a new builder-style object to manufacture [`AccessDeniedException`](crate::types::error::AccessDeniedException). + pub fn builder() -> crate::types::error::builders::AccessDeniedExceptionBuilder { + crate::types::error::builders::AccessDeniedExceptionBuilder::default() + } +} + +/// A builder for [`AccessDeniedException`](crate::types::error::AccessDeniedException). +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)] +#[non_exhaustive] +pub struct AccessDeniedExceptionBuilder { + pub(crate) message: ::std::option::Option<::std::string::String>, + meta: std::option::Option<::aws_smithy_types::error::ErrorMetadata>, +} +impl AccessDeniedExceptionBuilder { + ///

User does not have sufficient access to perform this action.

+ /// This field is required. + pub fn message(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.message = ::std::option::Option::Some(input.into()); + self + } + ///

User does not have sufficient access to perform this action.

+ pub fn set_message(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.message = input; + self + } + ///

User does not have sufficient access to perform this action.

+ pub fn get_message(&self) -> &::std::option::Option<::std::string::String> { + &self.message + } + /// Sets error metadata + pub fn meta(mut self, meta: ::aws_smithy_types::error::ErrorMetadata) -> Self { + self.meta = Some(meta); + self + } + + /// Sets error metadata + pub fn set_meta(&mut self, meta: std::option::Option<::aws_smithy_types::error::ErrorMetadata>) -> &mut Self { + self.meta = meta; + self + } + /// Consumes the builder and constructs a [`AccessDeniedException`](crate::types::error::AccessDeniedException). + /// This method will fail if any of the following fields are not set: + /// - [`message`](crate::types::error::builders::AccessDeniedExceptionBuilder::message) + pub fn build(self) -> ::std::result::Result { + ::std::result::Result::Ok(crate::types::error::AccessDeniedException { + message: self.message.ok_or_else(|| { + ::aws_smithy_types::error::operation::BuildError::missing_field( + "message", + "message was not specified but it is required when building AccessDeniedException", + ) + })?, + meta: self.meta.unwrap_or_default(), + }) + } +} diff --git a/sdk/backupsearch/src/types/error/_conflict_exception.rs b/sdk/backupsearch/src/types/error/_conflict_exception.rs new file mode 100644 index 000000000000..cefc7670cdbf --- /dev/null +++ b/sdk/backupsearch/src/types/error/_conflict_exception.rs @@ -0,0 +1,156 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. + +///

This exception occurs when a conflict with a previous successful operation is detected. This generally occurs when the previous operation did not have time to propagate to the host serving the current request.

+///

A retry (with appropriate backoff logic) is the recommended response to this exception.

+#[non_exhaustive] +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)] +pub struct ConflictException { + ///

Updating or deleting a resource can cause an inconsistent state.

+ pub message: ::std::string::String, + ///

Identifier of the resource affected.

+ pub resource_id: ::std::string::String, + ///

Type of the resource affected.

+ pub resource_type: ::std::string::String, + pub(crate) meta: ::aws_smithy_types::error::ErrorMetadata, +} +impl ConflictException { + ///

Identifier of the resource affected.

+ pub fn resource_id(&self) -> &str { + use std::ops::Deref; + self.resource_id.deref() + } + ///

Type of the resource affected.

+ pub fn resource_type(&self) -> &str { + use std::ops::Deref; + self.resource_type.deref() + } +} +impl ConflictException { + /// Returns the error message. + pub fn message(&self) -> &str { + &self.message + } +} +impl ::std::fmt::Display for ConflictException { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + ::std::write!(f, "ConflictException")?; + { + ::std::write!(f, ": {}", &self.message)?; + } + Ok(()) + } +} +impl ::std::error::Error for ConflictException {} +impl ::aws_types::request_id::RequestId for crate::types::error::ConflictException { + fn request_id(&self) -> Option<&str> { + use ::aws_smithy_types::error::metadata::ProvideErrorMetadata; + self.meta().request_id() + } +} +impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for ConflictException { + fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata { + &self.meta + } +} +impl ConflictException { + /// Creates a new builder-style object to manufacture [`ConflictException`](crate::types::error::ConflictException). + pub fn builder() -> crate::types::error::builders::ConflictExceptionBuilder { + crate::types::error::builders::ConflictExceptionBuilder::default() + } +} + +/// A builder for [`ConflictException`](crate::types::error::ConflictException). +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)] +#[non_exhaustive] +pub struct ConflictExceptionBuilder { + pub(crate) message: ::std::option::Option<::std::string::String>, + pub(crate) resource_id: ::std::option::Option<::std::string::String>, + pub(crate) resource_type: ::std::option::Option<::std::string::String>, + meta: std::option::Option<::aws_smithy_types::error::ErrorMetadata>, +} +impl ConflictExceptionBuilder { + ///

Updating or deleting a resource can cause an inconsistent state.

+ /// This field is required. + pub fn message(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.message = ::std::option::Option::Some(input.into()); + self + } + ///

Updating or deleting a resource can cause an inconsistent state.

+ pub fn set_message(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.message = input; + self + } + ///

Updating or deleting a resource can cause an inconsistent state.

+ pub fn get_message(&self) -> &::std::option::Option<::std::string::String> { + &self.message + } + ///

Identifier of the resource affected.

+ /// This field is required. + pub fn resource_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.resource_id = ::std::option::Option::Some(input.into()); + self + } + ///

Identifier of the resource affected.

+ pub fn set_resource_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.resource_id = input; + self + } + ///

Identifier of the resource affected.

+ pub fn get_resource_id(&self) -> &::std::option::Option<::std::string::String> { + &self.resource_id + } + ///

Type of the resource affected.

+ /// This field is required. + pub fn resource_type(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.resource_type = ::std::option::Option::Some(input.into()); + self + } + ///

Type of the resource affected.

+ pub fn set_resource_type(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.resource_type = input; + self + } + ///

Type of the resource affected.

+ pub fn get_resource_type(&self) -> &::std::option::Option<::std::string::String> { + &self.resource_type + } + /// Sets error metadata + pub fn meta(mut self, meta: ::aws_smithy_types::error::ErrorMetadata) -> Self { + self.meta = Some(meta); + self + } + + /// Sets error metadata + pub fn set_meta(&mut self, meta: std::option::Option<::aws_smithy_types::error::ErrorMetadata>) -> &mut Self { + self.meta = meta; + self + } + /// Consumes the builder and constructs a [`ConflictException`](crate::types::error::ConflictException). + /// This method will fail if any of the following fields are not set: + /// - [`message`](crate::types::error::builders::ConflictExceptionBuilder::message) + /// - [`resource_id`](crate::types::error::builders::ConflictExceptionBuilder::resource_id) + /// - [`resource_type`](crate::types::error::builders::ConflictExceptionBuilder::resource_type) + pub fn build(self) -> ::std::result::Result { + ::std::result::Result::Ok(crate::types::error::ConflictException { + message: self.message.ok_or_else(|| { + ::aws_smithy_types::error::operation::BuildError::missing_field( + "message", + "message was not specified but it is required when building ConflictException", + ) + })?, + resource_id: self.resource_id.ok_or_else(|| { + ::aws_smithy_types::error::operation::BuildError::missing_field( + "resource_id", + "resource_id was not specified but it is required when building ConflictException", + ) + })?, + resource_type: self.resource_type.ok_or_else(|| { + ::aws_smithy_types::error::operation::BuildError::missing_field( + "resource_type", + "resource_type was not specified but it is required when building ConflictException", + ) + })?, + meta: self.meta.unwrap_or_default(), + }) + } +} diff --git a/sdk/backupsearch/src/types/error/_internal_server_exception.rs b/sdk/backupsearch/src/types/error/_internal_server_exception.rs new file mode 100644 index 000000000000..080065684ff3 --- /dev/null +++ b/sdk/backupsearch/src/types/error/_internal_server_exception.rs @@ -0,0 +1,121 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. + +///

An internal server error occurred. Retry your request.

+#[non_exhaustive] +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)] +pub struct InternalServerException { + ///

Unexpected error during processing of request.

+ pub message: ::std::string::String, + ///

Retry the call after number of seconds.

+ pub retry_after_seconds: ::std::option::Option, + pub(crate) meta: ::aws_smithy_types::error::ErrorMetadata, +} +impl InternalServerException { + ///

Retry the call after number of seconds.

+ pub fn retry_after_seconds(&self) -> ::std::option::Option { + self.retry_after_seconds + } +} +impl InternalServerException { + /// Returns `Some(ErrorKind)` if the error is retryable. Otherwise, returns `None`. + pub fn retryable_error_kind(&self) -> ::aws_smithy_types::retry::ErrorKind { + ::aws_smithy_types::retry::ErrorKind::ServerError + } + /// Returns the error message. + pub fn message(&self) -> &str { + &self.message + } +} +impl ::std::fmt::Display for InternalServerException { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + ::std::write!(f, "InternalServerException")?; + { + ::std::write!(f, ": {}", &self.message)?; + } + Ok(()) + } +} +impl ::std::error::Error for InternalServerException {} +impl ::aws_types::request_id::RequestId for crate::types::error::InternalServerException { + fn request_id(&self) -> Option<&str> { + use ::aws_smithy_types::error::metadata::ProvideErrorMetadata; + self.meta().request_id() + } +} +impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for InternalServerException { + fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata { + &self.meta + } +} +impl InternalServerException { + /// Creates a new builder-style object to manufacture [`InternalServerException`](crate::types::error::InternalServerException). + pub fn builder() -> crate::types::error::builders::InternalServerExceptionBuilder { + crate::types::error::builders::InternalServerExceptionBuilder::default() + } +} + +/// A builder for [`InternalServerException`](crate::types::error::InternalServerException). +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)] +#[non_exhaustive] +pub struct InternalServerExceptionBuilder { + pub(crate) message: ::std::option::Option<::std::string::String>, + pub(crate) retry_after_seconds: ::std::option::Option, + meta: std::option::Option<::aws_smithy_types::error::ErrorMetadata>, +} +impl InternalServerExceptionBuilder { + ///

Unexpected error during processing of request.

+ /// This field is required. + pub fn message(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.message = ::std::option::Option::Some(input.into()); + self + } + ///

Unexpected error during processing of request.

+ pub fn set_message(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.message = input; + self + } + ///

Unexpected error during processing of request.

+ pub fn get_message(&self) -> &::std::option::Option<::std::string::String> { + &self.message + } + ///

Retry the call after number of seconds.

+ pub fn retry_after_seconds(mut self, input: i32) -> Self { + self.retry_after_seconds = ::std::option::Option::Some(input); + self + } + ///

Retry the call after number of seconds.

+ pub fn set_retry_after_seconds(mut self, input: ::std::option::Option) -> Self { + self.retry_after_seconds = input; + self + } + ///

Retry the call after number of seconds.

+ pub fn get_retry_after_seconds(&self) -> &::std::option::Option { + &self.retry_after_seconds + } + /// Sets error metadata + pub fn meta(mut self, meta: ::aws_smithy_types::error::ErrorMetadata) -> Self { + self.meta = Some(meta); + self + } + + /// Sets error metadata + pub fn set_meta(&mut self, meta: std::option::Option<::aws_smithy_types::error::ErrorMetadata>) -> &mut Self { + self.meta = meta; + self + } + /// Consumes the builder and constructs a [`InternalServerException`](crate::types::error::InternalServerException). + /// This method will fail if any of the following fields are not set: + /// - [`message`](crate::types::error::builders::InternalServerExceptionBuilder::message) + pub fn build(self) -> ::std::result::Result { + ::std::result::Result::Ok(crate::types::error::InternalServerException { + message: self.message.ok_or_else(|| { + ::aws_smithy_types::error::operation::BuildError::missing_field( + "message", + "message was not specified but it is required when building InternalServerException", + ) + })?, + retry_after_seconds: self.retry_after_seconds, + meta: self.meta.unwrap_or_default(), + }) + } +} diff --git a/sdk/backupsearch/src/types/error/_resource_not_found_exception.rs b/sdk/backupsearch/src/types/error/_resource_not_found_exception.rs new file mode 100644 index 000000000000..38f6ebdb85a4 --- /dev/null +++ b/sdk/backupsearch/src/types/error/_resource_not_found_exception.rs @@ -0,0 +1,156 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. + +///

The resource was not found for this request.

+///

Confirm the resource information, such as the ARN or type is correct and exists, then retry the request.

+#[non_exhaustive] +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)] +pub struct ResourceNotFoundException { + ///

Request references a resource which does not exist.

+ pub message: ::std::string::String, + ///

Hypothetical identifier of the resource affected.

+ pub resource_id: ::std::string::String, + ///

Hypothetical type of the resource affected.

+ pub resource_type: ::std::string::String, + pub(crate) meta: ::aws_smithy_types::error::ErrorMetadata, +} +impl ResourceNotFoundException { + ///

Hypothetical identifier of the resource affected.

+ pub fn resource_id(&self) -> &str { + use std::ops::Deref; + self.resource_id.deref() + } + ///

Hypothetical type of the resource affected.

+ pub fn resource_type(&self) -> &str { + use std::ops::Deref; + self.resource_type.deref() + } +} +impl ResourceNotFoundException { + /// Returns the error message. + pub fn message(&self) -> &str { + &self.message + } +} +impl ::std::fmt::Display for ResourceNotFoundException { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + ::std::write!(f, "ResourceNotFoundException")?; + { + ::std::write!(f, ": {}", &self.message)?; + } + Ok(()) + } +} +impl ::std::error::Error for ResourceNotFoundException {} +impl ::aws_types::request_id::RequestId for crate::types::error::ResourceNotFoundException { + fn request_id(&self) -> Option<&str> { + use ::aws_smithy_types::error::metadata::ProvideErrorMetadata; + self.meta().request_id() + } +} +impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for ResourceNotFoundException { + fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata { + &self.meta + } +} +impl ResourceNotFoundException { + /// Creates a new builder-style object to manufacture [`ResourceNotFoundException`](crate::types::error::ResourceNotFoundException). + pub fn builder() -> crate::types::error::builders::ResourceNotFoundExceptionBuilder { + crate::types::error::builders::ResourceNotFoundExceptionBuilder::default() + } +} + +/// A builder for [`ResourceNotFoundException`](crate::types::error::ResourceNotFoundException). +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)] +#[non_exhaustive] +pub struct ResourceNotFoundExceptionBuilder { + pub(crate) message: ::std::option::Option<::std::string::String>, + pub(crate) resource_id: ::std::option::Option<::std::string::String>, + pub(crate) resource_type: ::std::option::Option<::std::string::String>, + meta: std::option::Option<::aws_smithy_types::error::ErrorMetadata>, +} +impl ResourceNotFoundExceptionBuilder { + ///

Request references a resource which does not exist.

+ /// This field is required. + pub fn message(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.message = ::std::option::Option::Some(input.into()); + self + } + ///

Request references a resource which does not exist.

+ pub fn set_message(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.message = input; + self + } + ///

Request references a resource which does not exist.

+ pub fn get_message(&self) -> &::std::option::Option<::std::string::String> { + &self.message + } + ///

Hypothetical identifier of the resource affected.

+ /// This field is required. + pub fn resource_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.resource_id = ::std::option::Option::Some(input.into()); + self + } + ///

Hypothetical identifier of the resource affected.

+ pub fn set_resource_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.resource_id = input; + self + } + ///

Hypothetical identifier of the resource affected.

+ pub fn get_resource_id(&self) -> &::std::option::Option<::std::string::String> { + &self.resource_id + } + ///

Hypothetical type of the resource affected.

+ /// This field is required. + pub fn resource_type(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.resource_type = ::std::option::Option::Some(input.into()); + self + } + ///

Hypothetical type of the resource affected.

+ pub fn set_resource_type(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.resource_type = input; + self + } + ///

Hypothetical type of the resource affected.

+ pub fn get_resource_type(&self) -> &::std::option::Option<::std::string::String> { + &self.resource_type + } + /// Sets error metadata + pub fn meta(mut self, meta: ::aws_smithy_types::error::ErrorMetadata) -> Self { + self.meta = Some(meta); + self + } + + /// Sets error metadata + pub fn set_meta(&mut self, meta: std::option::Option<::aws_smithy_types::error::ErrorMetadata>) -> &mut Self { + self.meta = meta; + self + } + /// Consumes the builder and constructs a [`ResourceNotFoundException`](crate::types::error::ResourceNotFoundException). + /// This method will fail if any of the following fields are not set: + /// - [`message`](crate::types::error::builders::ResourceNotFoundExceptionBuilder::message) + /// - [`resource_id`](crate::types::error::builders::ResourceNotFoundExceptionBuilder::resource_id) + /// - [`resource_type`](crate::types::error::builders::ResourceNotFoundExceptionBuilder::resource_type) + pub fn build(self) -> ::std::result::Result { + ::std::result::Result::Ok(crate::types::error::ResourceNotFoundException { + message: self.message.ok_or_else(|| { + ::aws_smithy_types::error::operation::BuildError::missing_field( + "message", + "message was not specified but it is required when building ResourceNotFoundException", + ) + })?, + resource_id: self.resource_id.ok_or_else(|| { + ::aws_smithy_types::error::operation::BuildError::missing_field( + "resource_id", + "resource_id was not specified but it is required when building ResourceNotFoundException", + ) + })?, + resource_type: self.resource_type.ok_or_else(|| { + ::aws_smithy_types::error::operation::BuildError::missing_field( + "resource_type", + "resource_type was not specified but it is required when building ResourceNotFoundException", + ) + })?, + meta: self.meta.unwrap_or_default(), + }) + } +} diff --git a/sdk/backupsearch/src/types/error/_service_quota_exceeded_exception.rs b/sdk/backupsearch/src/types/error/_service_quota_exceeded_exception.rs new file mode 100644 index 000000000000..c526e8b88837 --- /dev/null +++ b/sdk/backupsearch/src/types/error/_service_quota_exceeded_exception.rs @@ -0,0 +1,217 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. + +///

The request denied due to exceeding the quota limits permitted.

+#[non_exhaustive] +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)] +pub struct ServiceQuotaExceededException { + ///

This request was not successful due to a service quota exceeding limits.

+ pub message: ::std::string::String, + ///

Identifier of the resource.

+ pub resource_id: ::std::string::String, + ///

Type of resource.

+ pub resource_type: ::std::string::String, + ///

This is the code unique to the originating service with the quota.

+ pub service_code: ::std::string::String, + ///

This is the code specific to the quota type.

+ pub quota_code: ::std::string::String, + pub(crate) meta: ::aws_smithy_types::error::ErrorMetadata, +} +impl ServiceQuotaExceededException { + ///

Identifier of the resource.

+ pub fn resource_id(&self) -> &str { + use std::ops::Deref; + self.resource_id.deref() + } + ///

Type of resource.

+ pub fn resource_type(&self) -> &str { + use std::ops::Deref; + self.resource_type.deref() + } + ///

This is the code unique to the originating service with the quota.

+ pub fn service_code(&self) -> &str { + use std::ops::Deref; + self.service_code.deref() + } + ///

This is the code specific to the quota type.

+ pub fn quota_code(&self) -> &str { + use std::ops::Deref; + self.quota_code.deref() + } +} +impl ServiceQuotaExceededException { + /// Returns the error message. + pub fn message(&self) -> &str { + &self.message + } +} +impl ::std::fmt::Display for ServiceQuotaExceededException { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + ::std::write!(f, "ServiceQuotaExceededException")?; + { + ::std::write!(f, ": {}", &self.message)?; + } + Ok(()) + } +} +impl ::std::error::Error for ServiceQuotaExceededException {} +impl ::aws_types::request_id::RequestId for crate::types::error::ServiceQuotaExceededException { + fn request_id(&self) -> Option<&str> { + use ::aws_smithy_types::error::metadata::ProvideErrorMetadata; + self.meta().request_id() + } +} +impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for ServiceQuotaExceededException { + fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata { + &self.meta + } +} +impl ServiceQuotaExceededException { + /// Creates a new builder-style object to manufacture [`ServiceQuotaExceededException`](crate::types::error::ServiceQuotaExceededException). + pub fn builder() -> crate::types::error::builders::ServiceQuotaExceededExceptionBuilder { + crate::types::error::builders::ServiceQuotaExceededExceptionBuilder::default() + } +} + +/// A builder for [`ServiceQuotaExceededException`](crate::types::error::ServiceQuotaExceededException). +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)] +#[non_exhaustive] +pub struct ServiceQuotaExceededExceptionBuilder { + pub(crate) message: ::std::option::Option<::std::string::String>, + pub(crate) resource_id: ::std::option::Option<::std::string::String>, + pub(crate) resource_type: ::std::option::Option<::std::string::String>, + pub(crate) service_code: ::std::option::Option<::std::string::String>, + pub(crate) quota_code: ::std::option::Option<::std::string::String>, + meta: std::option::Option<::aws_smithy_types::error::ErrorMetadata>, +} +impl ServiceQuotaExceededExceptionBuilder { + ///

This request was not successful due to a service quota exceeding limits.

+ /// This field is required. + pub fn message(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.message = ::std::option::Option::Some(input.into()); + self + } + ///

This request was not successful due to a service quota exceeding limits.

+ pub fn set_message(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.message = input; + self + } + ///

This request was not successful due to a service quota exceeding limits.

+ pub fn get_message(&self) -> &::std::option::Option<::std::string::String> { + &self.message + } + ///

Identifier of the resource.

+ /// This field is required. + pub fn resource_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.resource_id = ::std::option::Option::Some(input.into()); + self + } + ///

Identifier of the resource.

+ pub fn set_resource_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.resource_id = input; + self + } + ///

Identifier of the resource.

+ pub fn get_resource_id(&self) -> &::std::option::Option<::std::string::String> { + &self.resource_id + } + ///

Type of resource.

+ /// This field is required. + pub fn resource_type(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.resource_type = ::std::option::Option::Some(input.into()); + self + } + ///

Type of resource.

+ pub fn set_resource_type(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.resource_type = input; + self + } + ///

Type of resource.

+ pub fn get_resource_type(&self) -> &::std::option::Option<::std::string::String> { + &self.resource_type + } + ///

This is the code unique to the originating service with the quota.

+ /// This field is required. + pub fn service_code(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.service_code = ::std::option::Option::Some(input.into()); + self + } + ///

This is the code unique to the originating service with the quota.

+ pub fn set_service_code(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.service_code = input; + self + } + ///

This is the code unique to the originating service with the quota.

+ pub fn get_service_code(&self) -> &::std::option::Option<::std::string::String> { + &self.service_code + } + ///

This is the code specific to the quota type.

+ /// This field is required. + pub fn quota_code(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.quota_code = ::std::option::Option::Some(input.into()); + self + } + ///

This is the code specific to the quota type.

+ pub fn set_quota_code(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.quota_code = input; + self + } + ///

This is the code specific to the quota type.

+ pub fn get_quota_code(&self) -> &::std::option::Option<::std::string::String> { + &self.quota_code + } + /// Sets error metadata + pub fn meta(mut self, meta: ::aws_smithy_types::error::ErrorMetadata) -> Self { + self.meta = Some(meta); + self + } + + /// Sets error metadata + pub fn set_meta(&mut self, meta: std::option::Option<::aws_smithy_types::error::ErrorMetadata>) -> &mut Self { + self.meta = meta; + self + } + /// Consumes the builder and constructs a [`ServiceQuotaExceededException`](crate::types::error::ServiceQuotaExceededException). + /// This method will fail if any of the following fields are not set: + /// - [`message`](crate::types::error::builders::ServiceQuotaExceededExceptionBuilder::message) + /// - [`resource_id`](crate::types::error::builders::ServiceQuotaExceededExceptionBuilder::resource_id) + /// - [`resource_type`](crate::types::error::builders::ServiceQuotaExceededExceptionBuilder::resource_type) + /// - [`service_code`](crate::types::error::builders::ServiceQuotaExceededExceptionBuilder::service_code) + /// - [`quota_code`](crate::types::error::builders::ServiceQuotaExceededExceptionBuilder::quota_code) + pub fn build( + self, + ) -> ::std::result::Result { + ::std::result::Result::Ok(crate::types::error::ServiceQuotaExceededException { + message: self.message.ok_or_else(|| { + ::aws_smithy_types::error::operation::BuildError::missing_field( + "message", + "message was not specified but it is required when building ServiceQuotaExceededException", + ) + })?, + resource_id: self.resource_id.ok_or_else(|| { + ::aws_smithy_types::error::operation::BuildError::missing_field( + "resource_id", + "resource_id was not specified but it is required when building ServiceQuotaExceededException", + ) + })?, + resource_type: self.resource_type.ok_or_else(|| { + ::aws_smithy_types::error::operation::BuildError::missing_field( + "resource_type", + "resource_type was not specified but it is required when building ServiceQuotaExceededException", + ) + })?, + service_code: self.service_code.ok_or_else(|| { + ::aws_smithy_types::error::operation::BuildError::missing_field( + "service_code", + "service_code was not specified but it is required when building ServiceQuotaExceededException", + ) + })?, + quota_code: self.quota_code.ok_or_else(|| { + ::aws_smithy_types::error::operation::BuildError::missing_field( + "quota_code", + "quota_code was not specified but it is required when building ServiceQuotaExceededException", + ) + })?, + meta: self.meta.unwrap_or_default(), + }) + } +} diff --git a/sdk/backupsearch/src/types/error/_throttling_exception.rs b/sdk/backupsearch/src/types/error/_throttling_exception.rs new file mode 100644 index 000000000000..1795c0df071b --- /dev/null +++ b/sdk/backupsearch/src/types/error/_throttling_exception.rs @@ -0,0 +1,165 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. + +///

The request was denied due to request throttling.

+#[non_exhaustive] +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)] +pub struct ThrottlingException { + ///

Request was unsuccessful due to request throttling.

+ pub message: ::std::string::String, + ///

This is the code unique to the originating service.

+ pub service_code: ::std::option::Option<::std::string::String>, + ///

This is the code unique to the originating service with the quota.

+ pub quota_code: ::std::option::Option<::std::string::String>, + ///

Retry the call after number of seconds.

+ pub retry_after_seconds: ::std::option::Option, + pub(crate) meta: ::aws_smithy_types::error::ErrorMetadata, +} +impl ThrottlingException { + ///

This is the code unique to the originating service.

+ pub fn service_code(&self) -> ::std::option::Option<&str> { + self.service_code.as_deref() + } + ///

This is the code unique to the originating service with the quota.

+ pub fn quota_code(&self) -> ::std::option::Option<&str> { + self.quota_code.as_deref() + } + ///

Retry the call after number of seconds.

+ pub fn retry_after_seconds(&self) -> ::std::option::Option { + self.retry_after_seconds + } +} +impl ThrottlingException { + /// Returns `Some(ErrorKind)` if the error is retryable. Otherwise, returns `None`. + pub fn retryable_error_kind(&self) -> ::aws_smithy_types::retry::ErrorKind { + ::aws_smithy_types::retry::ErrorKind::ThrottlingError + } + /// Returns the error message. + pub fn message(&self) -> &str { + &self.message + } +} +impl ::std::fmt::Display for ThrottlingException { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + ::std::write!(f, "ThrottlingException")?; + { + ::std::write!(f, ": {}", &self.message)?; + } + Ok(()) + } +} +impl ::std::error::Error for ThrottlingException {} +impl ::aws_types::request_id::RequestId for crate::types::error::ThrottlingException { + fn request_id(&self) -> Option<&str> { + use ::aws_smithy_types::error::metadata::ProvideErrorMetadata; + self.meta().request_id() + } +} +impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for ThrottlingException { + fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata { + &self.meta + } +} +impl ThrottlingException { + /// Creates a new builder-style object to manufacture [`ThrottlingException`](crate::types::error::ThrottlingException). + pub fn builder() -> crate::types::error::builders::ThrottlingExceptionBuilder { + crate::types::error::builders::ThrottlingExceptionBuilder::default() + } +} + +/// A builder for [`ThrottlingException`](crate::types::error::ThrottlingException). +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)] +#[non_exhaustive] +pub struct ThrottlingExceptionBuilder { + pub(crate) message: ::std::option::Option<::std::string::String>, + pub(crate) service_code: ::std::option::Option<::std::string::String>, + pub(crate) quota_code: ::std::option::Option<::std::string::String>, + pub(crate) retry_after_seconds: ::std::option::Option, + meta: std::option::Option<::aws_smithy_types::error::ErrorMetadata>, +} +impl ThrottlingExceptionBuilder { + ///

Request was unsuccessful due to request throttling.

+ /// This field is required. + pub fn message(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.message = ::std::option::Option::Some(input.into()); + self + } + ///

Request was unsuccessful due to request throttling.

+ pub fn set_message(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.message = input; + self + } + ///

Request was unsuccessful due to request throttling.

+ pub fn get_message(&self) -> &::std::option::Option<::std::string::String> { + &self.message + } + ///

This is the code unique to the originating service.

+ pub fn service_code(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.service_code = ::std::option::Option::Some(input.into()); + self + } + ///

This is the code unique to the originating service.

+ pub fn set_service_code(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.service_code = input; + self + } + ///

This is the code unique to the originating service.

+ pub fn get_service_code(&self) -> &::std::option::Option<::std::string::String> { + &self.service_code + } + ///

This is the code unique to the originating service with the quota.

+ pub fn quota_code(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.quota_code = ::std::option::Option::Some(input.into()); + self + } + ///

This is the code unique to the originating service with the quota.

+ pub fn set_quota_code(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.quota_code = input; + self + } + ///

This is the code unique to the originating service with the quota.

+ pub fn get_quota_code(&self) -> &::std::option::Option<::std::string::String> { + &self.quota_code + } + ///

Retry the call after number of seconds.

+ pub fn retry_after_seconds(mut self, input: i32) -> Self { + self.retry_after_seconds = ::std::option::Option::Some(input); + self + } + ///

Retry the call after number of seconds.

+ pub fn set_retry_after_seconds(mut self, input: ::std::option::Option) -> Self { + self.retry_after_seconds = input; + self + } + ///

Retry the call after number of seconds.

+ pub fn get_retry_after_seconds(&self) -> &::std::option::Option { + &self.retry_after_seconds + } + /// Sets error metadata + pub fn meta(mut self, meta: ::aws_smithy_types::error::ErrorMetadata) -> Self { + self.meta = Some(meta); + self + } + + /// Sets error metadata + pub fn set_meta(&mut self, meta: std::option::Option<::aws_smithy_types::error::ErrorMetadata>) -> &mut Self { + self.meta = meta; + self + } + /// Consumes the builder and constructs a [`ThrottlingException`](crate::types::error::ThrottlingException). + /// This method will fail if any of the following fields are not set: + /// - [`message`](crate::types::error::builders::ThrottlingExceptionBuilder::message) + pub fn build(self) -> ::std::result::Result { + ::std::result::Result::Ok(crate::types::error::ThrottlingException { + message: self.message.ok_or_else(|| { + ::aws_smithy_types::error::operation::BuildError::missing_field( + "message", + "message was not specified but it is required when building ThrottlingException", + ) + })?, + service_code: self.service_code, + quota_code: self.quota_code, + retry_after_seconds: self.retry_after_seconds, + meta: self.meta.unwrap_or_default(), + }) + } +} diff --git a/sdk/backupsearch/src/types/error/_validation_exception.rs b/sdk/backupsearch/src/types/error/_validation_exception.rs new file mode 100644 index 000000000000..9e47980d4991 --- /dev/null +++ b/sdk/backupsearch/src/types/error/_validation_exception.rs @@ -0,0 +1,93 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. + +///

The input fails to satisfy the constraints specified by a service.

+#[non_exhaustive] +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)] +pub struct ValidationException { + ///

The input fails to satisfy the constraints specified by an Amazon service.

+ pub message: ::std::string::String, + pub(crate) meta: ::aws_smithy_types::error::ErrorMetadata, +} +impl ValidationException { + /// Returns the error message. + pub fn message(&self) -> &str { + &self.message + } +} +impl ::std::fmt::Display for ValidationException { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + ::std::write!(f, "ValidationException")?; + { + ::std::write!(f, ": {}", &self.message)?; + } + Ok(()) + } +} +impl ::std::error::Error for ValidationException {} +impl ::aws_types::request_id::RequestId for crate::types::error::ValidationException { + fn request_id(&self) -> Option<&str> { + use ::aws_smithy_types::error::metadata::ProvideErrorMetadata; + self.meta().request_id() + } +} +impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for ValidationException { + fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata { + &self.meta + } +} +impl ValidationException { + /// Creates a new builder-style object to manufacture [`ValidationException`](crate::types::error::ValidationException). + pub fn builder() -> crate::types::error::builders::ValidationExceptionBuilder { + crate::types::error::builders::ValidationExceptionBuilder::default() + } +} + +/// A builder for [`ValidationException`](crate::types::error::ValidationException). +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)] +#[non_exhaustive] +pub struct ValidationExceptionBuilder { + pub(crate) message: ::std::option::Option<::std::string::String>, + meta: std::option::Option<::aws_smithy_types::error::ErrorMetadata>, +} +impl ValidationExceptionBuilder { + ///

The input fails to satisfy the constraints specified by an Amazon service.

+ /// This field is required. + pub fn message(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.message = ::std::option::Option::Some(input.into()); + self + } + ///

The input fails to satisfy the constraints specified by an Amazon service.

+ pub fn set_message(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.message = input; + self + } + ///

The input fails to satisfy the constraints specified by an Amazon service.

+ pub fn get_message(&self) -> &::std::option::Option<::std::string::String> { + &self.message + } + /// Sets error metadata + pub fn meta(mut self, meta: ::aws_smithy_types::error::ErrorMetadata) -> Self { + self.meta = Some(meta); + self + } + + /// Sets error metadata + pub fn set_meta(&mut self, meta: std::option::Option<::aws_smithy_types::error::ErrorMetadata>) -> &mut Self { + self.meta = meta; + self + } + /// Consumes the builder and constructs a [`ValidationException`](crate::types::error::ValidationException). + /// This method will fail if any of the following fields are not set: + /// - [`message`](crate::types::error::builders::ValidationExceptionBuilder::message) + pub fn build(self) -> ::std::result::Result { + ::std::result::Result::Ok(crate::types::error::ValidationException { + message: self.message.ok_or_else(|| { + ::aws_smithy_types::error::operation::BuildError::missing_field( + "message", + "message was not specified but it is required when building ValidationException", + ) + })?, + meta: self.meta.unwrap_or_default(), + }) + } +} diff --git a/sdk/backupsearch/src/types/error/builders.rs b/sdk/backupsearch/src/types/error/builders.rs new file mode 100644 index 000000000000..ff1d688bb41e --- /dev/null +++ b/sdk/backupsearch/src/types/error/builders.rs @@ -0,0 +1,14 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +pub use crate::types::error::_validation_exception::ValidationExceptionBuilder; + +pub use crate::types::error::_throttling_exception::ThrottlingExceptionBuilder; + +pub use crate::types::error::_internal_server_exception::InternalServerExceptionBuilder; + +pub use crate::types::error::_access_denied_exception::AccessDeniedExceptionBuilder; + +pub use crate::types::error::_resource_not_found_exception::ResourceNotFoundExceptionBuilder; + +pub use crate::types::error::_service_quota_exceeded_exception::ServiceQuotaExceededExceptionBuilder; + +pub use crate::types::error::_conflict_exception::ConflictExceptionBuilder; diff --git a/sdk/backupsearch/tests/endpoint_tests.rs b/sdk/backupsearch/tests/endpoint_tests.rs new file mode 100644 index 000000000000..e0cddc84a781 --- /dev/null +++ b/sdk/backupsearch/tests/endpoint_tests.rs @@ -0,0 +1,2 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +#![cfg(feature = "test-util")] diff --git a/sdk/batch/Cargo.toml b/sdk/batch/Cargo.toml index c90134148ca5..2774686f33ca 100644 --- a/sdk/batch/Cargo.toml +++ b/sdk/batch/Cargo.toml @@ -1,7 +1,7 @@ # Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. [package] name = "aws-sdk-batch" -version = "1.59.0" +version = "1.60.0" authors = ["AWS Rust SDK Team ", "Russell Cohen "] description = "AWS SDK for AWS Batch" edition = "2021" diff --git a/sdk/batch/README.md b/sdk/batch/README.md index 9fa3286c23d8..8adf0581e6ad 100644 --- a/sdk/batch/README.md +++ b/sdk/batch/README.md @@ -16,7 +16,7 @@ your project, add the following to your **Cargo.toml** file: ```toml [dependencies] aws-config = { version = "1.1.7", features = ["behavior-version-latest"] } -aws-sdk-batch = "1.59.0" +aws-sdk-batch = "1.60.0" tokio = { version = "1", features = ["full"] } ``` diff --git a/sdk/batch/src/lib.rs b/sdk/batch/src/lib.rs index 417f26a72aad..1acb5bf01d92 100644 --- a/sdk/batch/src/lib.rs +++ b/sdk/batch/src/lib.rs @@ -33,7 +33,7 @@ //! ```toml //! [dependencies] //! aws-config = { version = "1.1.7", features = ["behavior-version-latest"] } -//! aws-sdk-batch = "1.59.0" +//! aws-sdk-batch = "1.60.0" //! tokio = { version = "1", features = ["full"] } //! ``` //! diff --git a/sdk/batch/src/protocol_serde.rs b/sdk/batch/src/protocol_serde.rs index cd8f4de12a54..6f2a2929e09d 100644 --- a/sdk/batch/src/protocol_serde.rs +++ b/sdk/batch/src/protocol_serde.rs @@ -329,6 +329,8 @@ pub(crate) mod shape_eks_empty_dir; pub(crate) mod shape_eks_host_path; +pub(crate) mod shape_eks_persistent_volume_claim; + pub(crate) mod shape_eks_pod_properties_detail; pub(crate) mod shape_eks_secret; @@ -391,6 +393,8 @@ pub(crate) mod shape_tmpfs_list; pub(crate) mod shape_attempt_ecs_task_details; +pub(crate) mod shape_eks_annotations_map; + pub(crate) mod shape_eks_attempt_container_detail; pub(crate) mod shape_eks_container_detail; diff --git a/sdk/batch/src/protocol_serde/shape_eks_annotations_map.rs b/sdk/batch/src/protocol_serde/shape_eks_annotations_map.rs new file mode 100644 index 000000000000..fc531617e3a7 --- /dev/null +++ b/sdk/batch/src/protocol_serde/shape_eks_annotations_map.rs @@ -0,0 +1,38 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +pub(crate) fn de_eks_annotations_map<'a, I>( + tokens: &mut ::std::iter::Peekable, +) -> Result>, ::aws_smithy_json::deserialize::error::DeserializeError> +where + I: Iterator, ::aws_smithy_json::deserialize::error::DeserializeError>>, +{ + match tokens.next().transpose()? { + Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), + Some(::aws_smithy_json::deserialize::Token::StartObject { .. }) => { + let mut map = ::std::collections::HashMap::new(); + loop { + match tokens.next().transpose()? { + Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break, + Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { + let key = key.to_unescaped().map(|u| u.into_owned())?; + let value = ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())? + .map(|s| s.to_unescaped().map(|u| u.into_owned())) + .transpose()?; + if let Some(value) = value { + map.insert(key, value); + } + } + other => { + return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!( + "expected object key or end object, found: {:?}", + other + ))) + } + } + } + Ok(Some(map)) + } + _ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom( + "expected start object or null", + )), + } +} diff --git a/sdk/batch/src/protocol_serde/shape_eks_container_volume_mount.rs b/sdk/batch/src/protocol_serde/shape_eks_container_volume_mount.rs index bbc17540c7b0..9c267c7c1911 100644 --- a/sdk/batch/src/protocol_serde/shape_eks_container_volume_mount.rs +++ b/sdk/batch/src/protocol_serde/shape_eks_container_volume_mount.rs @@ -9,8 +9,11 @@ pub fn ser_eks_container_volume_mount( if let Some(var_2) = &input.mount_path { object.key("mountPath").string(var_2.as_str()); } - if let Some(var_3) = &input.read_only { - object.key("readOnly").boolean(*var_3); + if let Some(var_3) = &input.sub_path { + object.key("subPath").string(var_3.as_str()); + } + if let Some(var_4) = &input.read_only { + object.key("readOnly").boolean(*var_4); } Ok(()) } @@ -44,6 +47,13 @@ where .transpose()?, ); } + "subPath" => { + builder = builder.set_sub_path( + ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())? + .map(|s| s.to_unescaped().map(|u| u.into_owned())) + .transpose()?, + ); + } "readOnly" => { builder = builder.set_read_only(::aws_smithy_json::deserialize::token::expect_bool_or_null(tokens.next())?); } diff --git a/sdk/batch/src/protocol_serde/shape_eks_metadata.rs b/sdk/batch/src/protocol_serde/shape_eks_metadata.rs index d89ef56857e8..f8a65d109976 100644 --- a/sdk/batch/src/protocol_serde/shape_eks_metadata.rs +++ b/sdk/batch/src/protocol_serde/shape_eks_metadata.rs @@ -13,6 +13,19 @@ pub fn ser_eks_metadata( } object_2.finish(); } + if let Some(var_5) = &input.annotations { + #[allow(unused_mut)] + let mut object_6 = object.key("annotations").start_object(); + for (key_7, value_8) in var_5 { + { + object_6.key(key_7.as_str()).string(value_8.as_str()); + } + } + object_6.finish(); + } + if let Some(var_9) = &input.namespace { + object.key("namespace").string(var_9.as_str()); + } Ok(()) } @@ -34,6 +47,16 @@ where "labels" => { builder = builder.set_labels(crate::protocol_serde::shape_eks_labels_map::de_eks_labels_map(tokens)?); } + "annotations" => { + builder = builder.set_annotations(crate::protocol_serde::shape_eks_annotations_map::de_eks_annotations_map(tokens)?); + } + "namespace" => { + builder = builder.set_namespace( + ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())? + .map(|s| s.to_unescaped().map(|u| u.into_owned())) + .transpose()?, + ); + } _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?, }, other => { diff --git a/sdk/batch/src/protocol_serde/shape_eks_persistent_volume_claim.rs b/sdk/batch/src/protocol_serde/shape_eks_persistent_volume_claim.rs new file mode 100644 index 000000000000..d92e42a3e995 --- /dev/null +++ b/sdk/batch/src/protocol_serde/shape_eks_persistent_volume_claim.rs @@ -0,0 +1,56 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +pub fn ser_eks_persistent_volume_claim( + object: &mut ::aws_smithy_json::serialize::JsonObjectWriter, + input: &crate::types::EksPersistentVolumeClaim, +) -> Result<(), ::aws_smithy_types::error::operation::SerializationError> { + if let Some(var_1) = &input.claim_name { + object.key("claimName").string(var_1.as_str()); + } + if let Some(var_2) = &input.read_only { + object.key("readOnly").boolean(*var_2); + } + Ok(()) +} + +pub(crate) fn de_eks_persistent_volume_claim<'a, I>( + tokens: &mut ::std::iter::Peekable, +) -> Result, ::aws_smithy_json::deserialize::error::DeserializeError> +where + I: Iterator, ::aws_smithy_json::deserialize::error::DeserializeError>>, +{ + match tokens.next().transpose()? { + Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), + Some(::aws_smithy_json::deserialize::Token::StartObject { .. }) => { + #[allow(unused_mut)] + let mut builder = crate::types::builders::EksPersistentVolumeClaimBuilder::default(); + loop { + match tokens.next().transpose()? { + Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break, + Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() { + "claimName" => { + builder = builder.set_claim_name( + ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())? + .map(|s| s.to_unescaped().map(|u| u.into_owned())) + .transpose()?, + ); + } + "readOnly" => { + builder = builder.set_read_only(::aws_smithy_json::deserialize::token::expect_bool_or_null(tokens.next())?); + } + _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?, + }, + other => { + return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!( + "expected object key or end object, found: {:?}", + other + ))) + } + } + } + Ok(Some(crate::serde_util::eks_persistent_volume_claim_correct_errors(builder).build())) + } + _ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom( + "expected start object or null", + )), + } +} diff --git a/sdk/batch/src/protocol_serde/shape_eks_volume.rs b/sdk/batch/src/protocol_serde/shape_eks_volume.rs index 78c722cd8812..7b4afe0a9ebe 100644 --- a/sdk/batch/src/protocol_serde/shape_eks_volume.rs +++ b/sdk/batch/src/protocol_serde/shape_eks_volume.rs @@ -24,6 +24,12 @@ pub fn ser_eks_volume( crate::protocol_serde::shape_eks_secret::ser_eks_secret(&mut object_7, var_6)?; object_7.finish(); } + if let Some(var_8) = &input.persistent_volume_claim { + #[allow(unused_mut)] + let mut object_9 = object.key("persistentVolumeClaim").start_object(); + crate::protocol_serde::shape_eks_persistent_volume_claim::ser_eks_persistent_volume_claim(&mut object_9, var_8)?; + object_9.finish(); + } Ok(()) } @@ -58,6 +64,11 @@ where "secret" => { builder = builder.set_secret(crate::protocol_serde::shape_eks_secret::de_eks_secret(tokens)?); } + "persistentVolumeClaim" => { + builder = builder.set_persistent_volume_claim( + crate::protocol_serde::shape_eks_persistent_volume_claim::de_eks_persistent_volume_claim(tokens)?, + ); + } _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?, }, other => { diff --git a/sdk/batch/src/serde_util.rs b/sdk/batch/src/serde_util.rs index 76f433d30e7c..20e416487c0e 100644 --- a/sdk/batch/src/serde_util.rs +++ b/sdk/batch/src/serde_util.rs @@ -400,6 +400,15 @@ pub(crate) fn tmpfs_correct_errors(mut builder: crate::types::builders::TmpfsBui builder } +pub(crate) fn eks_persistent_volume_claim_correct_errors( + mut builder: crate::types::builders::EksPersistentVolumeClaimBuilder, +) -> crate::types::builders::EksPersistentVolumeClaimBuilder { + if builder.claim_name.is_none() { + builder.claim_name = Some(Default::default()) + } + builder +} + pub(crate) fn eks_secret_correct_errors(mut builder: crate::types::builders::EksSecretBuilder) -> crate::types::builders::EksSecretBuilder { if builder.secret_name.is_none() { builder.secret_name = Some(Default::default()) diff --git a/sdk/batch/src/types.rs b/sdk/batch/src/types.rs index 7c01617c1a06..97f8420d4ccb 100644 --- a/sdk/batch/src/types.rs +++ b/sdk/batch/src/types.rs @@ -127,6 +127,8 @@ pub use crate::types::_eks_pod_properties::EksPodProperties; pub use crate::types::_eks_volume::EksVolume; +pub use crate::types::_eks_persistent_volume_claim::EksPersistentVolumeClaim; + pub use crate::types::_eks_secret::EksSecret; pub use crate::types::_eks_empty_dir::EksEmptyDir; @@ -323,6 +325,8 @@ mod _eks_host_path; mod _eks_metadata; +mod _eks_persistent_volume_claim; + mod _eks_pod_properties; mod _eks_pod_properties_detail; diff --git a/sdk/batch/src/types/_eks_container_volume_mount.rs b/sdk/batch/src/types/_eks_container_volume_mount.rs index 617f77bc24cb..fbbbad8c0dfa 100644 --- a/sdk/batch/src/types/_eks_container_volume_mount.rs +++ b/sdk/batch/src/types/_eks_container_volume_mount.rs @@ -8,6 +8,8 @@ pub struct EksContainerVolumeMount { pub name: ::std::option::Option<::std::string::String>, ///

The path on the container where the volume is mounted.

pub mount_path: ::std::option::Option<::std::string::String>, + ///

A sub-path inside the referenced volume instead of its root.

+ pub sub_path: ::std::option::Option<::std::string::String>, ///

If this value is true, the container has read-only access to the volume. Otherwise, the container can write to the volume. The default value is false.

pub read_only: ::std::option::Option, } @@ -20,6 +22,10 @@ impl EksContainerVolumeMount { pub fn mount_path(&self) -> ::std::option::Option<&str> { self.mount_path.as_deref() } + ///

A sub-path inside the referenced volume instead of its root.

+ pub fn sub_path(&self) -> ::std::option::Option<&str> { + self.sub_path.as_deref() + } ///

If this value is true, the container has read-only access to the volume. Otherwise, the container can write to the volume. The default value is false.

pub fn read_only(&self) -> ::std::option::Option { self.read_only @@ -38,6 +44,7 @@ impl EksContainerVolumeMount { pub struct EksContainerVolumeMountBuilder { pub(crate) name: ::std::option::Option<::std::string::String>, pub(crate) mount_path: ::std::option::Option<::std::string::String>, + pub(crate) sub_path: ::std::option::Option<::std::string::String>, pub(crate) read_only: ::std::option::Option, } impl EksContainerVolumeMountBuilder { @@ -69,6 +76,20 @@ impl EksContainerVolumeMountBuilder { pub fn get_mount_path(&self) -> &::std::option::Option<::std::string::String> { &self.mount_path } + ///

A sub-path inside the referenced volume instead of its root.

+ pub fn sub_path(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.sub_path = ::std::option::Option::Some(input.into()); + self + } + ///

A sub-path inside the referenced volume instead of its root.

+ pub fn set_sub_path(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.sub_path = input; + self + } + ///

A sub-path inside the referenced volume instead of its root.

+ pub fn get_sub_path(&self) -> &::std::option::Option<::std::string::String> { + &self.sub_path + } ///

If this value is true, the container has read-only access to the volume. Otherwise, the container can write to the volume. The default value is false.

pub fn read_only(mut self, input: bool) -> Self { self.read_only = ::std::option::Option::Some(input); @@ -88,6 +109,7 @@ impl EksContainerVolumeMountBuilder { crate::types::EksContainerVolumeMount { name: self.name, mount_path: self.mount_path, + sub_path: self.sub_path, read_only: self.read_only, } } diff --git a/sdk/batch/src/types/_eks_metadata.rs b/sdk/batch/src/types/_eks_metadata.rs index 08df37041382..54127edb6fd6 100644 --- a/sdk/batch/src/types/_eks_metadata.rs +++ b/sdk/batch/src/types/_eks_metadata.rs @@ -1,17 +1,69 @@ // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -///

Describes and uniquely identifies Kubernetes resources. For example, the compute environment that a pod runs in or the jobID for a job running in the pod. For more information, see Understanding Kubernetes Objects in the Kubernetes documentation.

+///

Describes and uniquely identifies Kubernetes resources. For example, the compute environment that a pod runs in or the jobID for a job running in the pod. For more information, see Understanding Kubernetes Objects in the Kubernetes documentation.

#[non_exhaustive] #[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)] pub struct EksMetadata { ///

Key-value pairs used to identify, sort, and organize cube resources. Can contain up to 63 uppercase letters, lowercase letters, numbers, hyphens (-), and underscores (_). Labels can be added or modified at any time. Each resource can have multiple labels, but each key must be unique for a given object.

pub labels: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>, + ///

Key-value pairs used to attach arbitrary, non-identifying metadata to Kubernetes objects. Valid annotation keys have two segments: an optional prefix and a name, separated by a slash (/).

+ ///
    + ///
  • + ///

    The prefix is optional and must be 253 characters or less. If specified, the prefix must be a DNS subdomain− a series of DNS labels separated by dots (.), and it must end with a slash (/).

  • + ///
  • + ///

    The name segment is required and must be 63 characters or less. It can include alphanumeric characters (\[a-z0-9A-Z\]), dashes (-), underscores (_), and dots (.), but must begin and end with an alphanumeric character.

  • + ///
+ ///

Annotation values must be 255 characters or less.

+ ///
+ ///

Annotations can be added or modified at any time. Each resource can have multiple annotations.

+ pub annotations: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>, + ///

The namespace of the Amazon EKS cluster. In Kubernetes, namespaces provide a mechanism for isolating groups of resources within a single cluster. Names of resources need to be unique within a namespace, but not across namespaces. Batch places Batch Job pods in this namespace. If this field is provided, the value can't be empty or null. It must meet the following requirements:

+ ///
    + ///
  • + ///

    1-63 characters long

  • + ///
  • + ///

    Can't be set to default

  • + ///
  • + ///

    Can't start with kube

  • + ///
  • + ///

    Must match the following regular expression: ^\[a-z0-9\](\[-a-z0-9\]*\[a-z0-9\])?$

  • + ///
+ ///

For more information, see Namespaces in the Kubernetes documentation. This namespace can be different from the kubernetesNamespace set in the compute environment's EksConfiguration, but must have identical role-based access control (RBAC) roles as the compute environment's kubernetesNamespace. For multi-node parallel jobs, the same value must be provided across all the node ranges.

+ pub namespace: ::std::option::Option<::std::string::String>, } impl EksMetadata { ///

Key-value pairs used to identify, sort, and organize cube resources. Can contain up to 63 uppercase letters, lowercase letters, numbers, hyphens (-), and underscores (_). Labels can be added or modified at any time. Each resource can have multiple labels, but each key must be unique for a given object.

pub fn labels(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> { self.labels.as_ref() } + ///

Key-value pairs used to attach arbitrary, non-identifying metadata to Kubernetes objects. Valid annotation keys have two segments: an optional prefix and a name, separated by a slash (/).

+ ///
    + ///
  • + ///

    The prefix is optional and must be 253 characters or less. If specified, the prefix must be a DNS subdomain− a series of DNS labels separated by dots (.), and it must end with a slash (/).

  • + ///
  • + ///

    The name segment is required and must be 63 characters or less. It can include alphanumeric characters (\[a-z0-9A-Z\]), dashes (-), underscores (_), and dots (.), but must begin and end with an alphanumeric character.

  • + ///
+ ///

Annotation values must be 255 characters or less.

+ ///
+ ///

Annotations can be added or modified at any time. Each resource can have multiple annotations.

+ pub fn annotations(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> { + self.annotations.as_ref() + } + ///

The namespace of the Amazon EKS cluster. In Kubernetes, namespaces provide a mechanism for isolating groups of resources within a single cluster. Names of resources need to be unique within a namespace, but not across namespaces. Batch places Batch Job pods in this namespace. If this field is provided, the value can't be empty or null. It must meet the following requirements:

+ ///
    + ///
  • + ///

    1-63 characters long

  • + ///
  • + ///

    Can't be set to default

  • + ///
  • + ///

    Can't start with kube

  • + ///
  • + ///

    Must match the following regular expression: ^\[a-z0-9\](\[-a-z0-9\]*\[a-z0-9\])?$

  • + ///
+ ///

For more information, see Namespaces in the Kubernetes documentation. This namespace can be different from the kubernetesNamespace set in the compute environment's EksConfiguration, but must have identical role-based access control (RBAC) roles as the compute environment's kubernetesNamespace. For multi-node parallel jobs, the same value must be provided across all the node ranges.

+ pub fn namespace(&self) -> ::std::option::Option<&str> { + self.namespace.as_deref() + } } impl EksMetadata { /// Creates a new builder-style object to manufacture [`EksMetadata`](crate::types::EksMetadata). @@ -25,6 +77,8 @@ impl EksMetadata { #[non_exhaustive] pub struct EksMetadataBuilder { pub(crate) labels: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>, + pub(crate) annotations: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>, + pub(crate) namespace: ::std::option::Option<::std::string::String>, } impl EksMetadataBuilder { /// Adds a key-value pair to `labels`. @@ -47,8 +101,109 @@ impl EksMetadataBuilder { pub fn get_labels(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> { &self.labels } + /// Adds a key-value pair to `annotations`. + /// + /// To override the contents of this collection use [`set_annotations`](Self::set_annotations). + /// + ///

Key-value pairs used to attach arbitrary, non-identifying metadata to Kubernetes objects. Valid annotation keys have two segments: an optional prefix and a name, separated by a slash (/).

+ ///
    + ///
  • + ///

    The prefix is optional and must be 253 characters or less. If specified, the prefix must be a DNS subdomain− a series of DNS labels separated by dots (.), and it must end with a slash (/).

  • + ///
  • + ///

    The name segment is required and must be 63 characters or less. It can include alphanumeric characters (\[a-z0-9A-Z\]), dashes (-), underscores (_), and dots (.), but must begin and end with an alphanumeric character.

  • + ///
+ ///

Annotation values must be 255 characters or less.

+ ///
+ ///

Annotations can be added or modified at any time. Each resource can have multiple annotations.

+ pub fn annotations(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self { + let mut hash_map = self.annotations.unwrap_or_default(); + hash_map.insert(k.into(), v.into()); + self.annotations = ::std::option::Option::Some(hash_map); + self + } + ///

Key-value pairs used to attach arbitrary, non-identifying metadata to Kubernetes objects. Valid annotation keys have two segments: an optional prefix and a name, separated by a slash (/).

+ ///
    + ///
  • + ///

    The prefix is optional and must be 253 characters or less. If specified, the prefix must be a DNS subdomain− a series of DNS labels separated by dots (.), and it must end with a slash (/).

  • + ///
  • + ///

    The name segment is required and must be 63 characters or less. It can include alphanumeric characters (\[a-z0-9A-Z\]), dashes (-), underscores (_), and dots (.), but must begin and end with an alphanumeric character.

  • + ///
+ ///

Annotation values must be 255 characters or less.

+ ///
+ ///

Annotations can be added or modified at any time. Each resource can have multiple annotations.

+ pub fn set_annotations( + mut self, + input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>, + ) -> Self { + self.annotations = input; + self + } + ///

Key-value pairs used to attach arbitrary, non-identifying metadata to Kubernetes objects. Valid annotation keys have two segments: an optional prefix and a name, separated by a slash (/).

+ ///
    + ///
  • + ///

    The prefix is optional and must be 253 characters or less. If specified, the prefix must be a DNS subdomain− a series of DNS labels separated by dots (.), and it must end with a slash (/).

  • + ///
  • + ///

    The name segment is required and must be 63 characters or less. It can include alphanumeric characters (\[a-z0-9A-Z\]), dashes (-), underscores (_), and dots (.), but must begin and end with an alphanumeric character.

  • + ///
+ ///

Annotation values must be 255 characters or less.

+ ///
+ ///

Annotations can be added or modified at any time. Each resource can have multiple annotations.

+ pub fn get_annotations(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> { + &self.annotations + } + ///

The namespace of the Amazon EKS cluster. In Kubernetes, namespaces provide a mechanism for isolating groups of resources within a single cluster. Names of resources need to be unique within a namespace, but not across namespaces. Batch places Batch Job pods in this namespace. If this field is provided, the value can't be empty or null. It must meet the following requirements:

+ ///
    + ///
  • + ///

    1-63 characters long

  • + ///
  • + ///

    Can't be set to default

  • + ///
  • + ///

    Can't start with kube

  • + ///
  • + ///

    Must match the following regular expression: ^\[a-z0-9\](\[-a-z0-9\]*\[a-z0-9\])?$

  • + ///
+ ///

For more information, see Namespaces in the Kubernetes documentation. This namespace can be different from the kubernetesNamespace set in the compute environment's EksConfiguration, but must have identical role-based access control (RBAC) roles as the compute environment's kubernetesNamespace. For multi-node parallel jobs, the same value must be provided across all the node ranges.

+ pub fn namespace(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.namespace = ::std::option::Option::Some(input.into()); + self + } + ///

The namespace of the Amazon EKS cluster. In Kubernetes, namespaces provide a mechanism for isolating groups of resources within a single cluster. Names of resources need to be unique within a namespace, but not across namespaces. Batch places Batch Job pods in this namespace. If this field is provided, the value can't be empty or null. It must meet the following requirements:

+ ///
    + ///
  • + ///

    1-63 characters long

  • + ///
  • + ///

    Can't be set to default

  • + ///
  • + ///

    Can't start with kube

  • + ///
  • + ///

    Must match the following regular expression: ^\[a-z0-9\](\[-a-z0-9\]*\[a-z0-9\])?$

  • + ///
+ ///

For more information, see Namespaces in the Kubernetes documentation. This namespace can be different from the kubernetesNamespace set in the compute environment's EksConfiguration, but must have identical role-based access control (RBAC) roles as the compute environment's kubernetesNamespace. For multi-node parallel jobs, the same value must be provided across all the node ranges.

+ pub fn set_namespace(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.namespace = input; + self + } + ///

The namespace of the Amazon EKS cluster. In Kubernetes, namespaces provide a mechanism for isolating groups of resources within a single cluster. Names of resources need to be unique within a namespace, but not across namespaces. Batch places Batch Job pods in this namespace. If this field is provided, the value can't be empty or null. It must meet the following requirements:

+ ///
    + ///
  • + ///

    1-63 characters long

  • + ///
  • + ///

    Can't be set to default

  • + ///
  • + ///

    Can't start with kube

  • + ///
  • + ///

    Must match the following regular expression: ^\[a-z0-9\](\[-a-z0-9\]*\[a-z0-9\])?$

  • + ///
+ ///

For more information, see Namespaces in the Kubernetes documentation. This namespace can be different from the kubernetesNamespace set in the compute environment's EksConfiguration, but must have identical role-based access control (RBAC) roles as the compute environment's kubernetesNamespace. For multi-node parallel jobs, the same value must be provided across all the node ranges.

+ pub fn get_namespace(&self) -> &::std::option::Option<::std::string::String> { + &self.namespace + } /// Consumes the builder and constructs a [`EksMetadata`](crate::types::EksMetadata). pub fn build(self) -> crate::types::EksMetadata { - crate::types::EksMetadata { labels: self.labels } + crate::types::EksMetadata { + labels: self.labels, + annotations: self.annotations, + namespace: self.namespace, + } } } diff --git a/sdk/batch/src/types/_eks_persistent_volume_claim.rs b/sdk/batch/src/types/_eks_persistent_volume_claim.rs new file mode 100644 index 000000000000..8e0d298f648a --- /dev/null +++ b/sdk/batch/src/types/_eks_persistent_volume_claim.rs @@ -0,0 +1,73 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. + +///

A persistentVolumeClaim volume is used to mount a PersistentVolume into a Pod. PersistentVolumeClaims are a way for users to "claim" durable storage without knowing the details of the particular cloud environment. See the information about PersistentVolumes in the Kubernetes documentation.

+#[non_exhaustive] +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)] +pub struct EksPersistentVolumeClaim { + ///

The name of the persistentVolumeClaim bounded to a persistentVolume. For more information, see Persistent Volume Claims in the Kubernetes documentation.

+ pub claim_name: ::std::option::Option<::std::string::String>, + ///

An optional boolean value indicating if the mount is read only. Default is false. For more information, see Read Only Mounts in the Kubernetes documentation.

+ pub read_only: ::std::option::Option, +} +impl EksPersistentVolumeClaim { + ///

The name of the persistentVolumeClaim bounded to a persistentVolume. For more information, see Persistent Volume Claims in the Kubernetes documentation.

+ pub fn claim_name(&self) -> ::std::option::Option<&str> { + self.claim_name.as_deref() + } + ///

An optional boolean value indicating if the mount is read only. Default is false. For more information, see Read Only Mounts in the Kubernetes documentation.

+ pub fn read_only(&self) -> ::std::option::Option { + self.read_only + } +} +impl EksPersistentVolumeClaim { + /// Creates a new builder-style object to manufacture [`EksPersistentVolumeClaim`](crate::types::EksPersistentVolumeClaim). + pub fn builder() -> crate::types::builders::EksPersistentVolumeClaimBuilder { + crate::types::builders::EksPersistentVolumeClaimBuilder::default() + } +} + +/// A builder for [`EksPersistentVolumeClaim`](crate::types::EksPersistentVolumeClaim). +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)] +#[non_exhaustive] +pub struct EksPersistentVolumeClaimBuilder { + pub(crate) claim_name: ::std::option::Option<::std::string::String>, + pub(crate) read_only: ::std::option::Option, +} +impl EksPersistentVolumeClaimBuilder { + ///

The name of the persistentVolumeClaim bounded to a persistentVolume. For more information, see Persistent Volume Claims in the Kubernetes documentation.

+ /// This field is required. + pub fn claim_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.claim_name = ::std::option::Option::Some(input.into()); + self + } + ///

The name of the persistentVolumeClaim bounded to a persistentVolume. For more information, see Persistent Volume Claims in the Kubernetes documentation.

+ pub fn set_claim_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.claim_name = input; + self + } + ///

The name of the persistentVolumeClaim bounded to a persistentVolume. For more information, see Persistent Volume Claims in the Kubernetes documentation.

+ pub fn get_claim_name(&self) -> &::std::option::Option<::std::string::String> { + &self.claim_name + } + ///

An optional boolean value indicating if the mount is read only. Default is false. For more information, see Read Only Mounts in the Kubernetes documentation.

+ pub fn read_only(mut self, input: bool) -> Self { + self.read_only = ::std::option::Option::Some(input); + self + } + ///

An optional boolean value indicating if the mount is read only. Default is false. For more information, see Read Only Mounts in the Kubernetes documentation.

+ pub fn set_read_only(mut self, input: ::std::option::Option) -> Self { + self.read_only = input; + self + } + ///

An optional boolean value indicating if the mount is read only. Default is false. For more information, see Read Only Mounts in the Kubernetes documentation.

+ pub fn get_read_only(&self) -> &::std::option::Option { + &self.read_only + } + /// Consumes the builder and constructs a [`EksPersistentVolumeClaim`](crate::types::EksPersistentVolumeClaim). + pub fn build(self) -> crate::types::EksPersistentVolumeClaim { + crate::types::EksPersistentVolumeClaim { + claim_name: self.claim_name, + read_only: self.read_only, + } + } +} diff --git a/sdk/batch/src/types/_eks_volume.rs b/sdk/batch/src/types/_eks_volume.rs index 640e4e8db4c0..4b7ac60c70b2 100644 --- a/sdk/batch/src/types/_eks_volume.rs +++ b/sdk/batch/src/types/_eks_volume.rs @@ -12,6 +12,8 @@ pub struct EksVolume { pub empty_dir: ::std::option::Option, ///

Specifies the configuration of a Kubernetes secret volume. For more information, see secret in the Kubernetes documentation.

pub secret: ::std::option::Option, + ///

Specifies the configuration of a Kubernetes persistentVolumeClaim bounded to a persistentVolume. For more information, see Persistent Volume Claims in the Kubernetes documentation.

+ pub persistent_volume_claim: ::std::option::Option, } impl EksVolume { ///

The name of the volume. The name must be allowed as a DNS subdomain name. For more information, see DNS subdomain names in the Kubernetes documentation.

@@ -30,6 +32,10 @@ impl EksVolume { pub fn secret(&self) -> ::std::option::Option<&crate::types::EksSecret> { self.secret.as_ref() } + ///

Specifies the configuration of a Kubernetes persistentVolumeClaim bounded to a persistentVolume. For more information, see Persistent Volume Claims in the Kubernetes documentation.

+ pub fn persistent_volume_claim(&self) -> ::std::option::Option<&crate::types::EksPersistentVolumeClaim> { + self.persistent_volume_claim.as_ref() + } } impl EksVolume { /// Creates a new builder-style object to manufacture [`EksVolume`](crate::types::EksVolume). @@ -46,6 +52,7 @@ pub struct EksVolumeBuilder { pub(crate) host_path: ::std::option::Option, pub(crate) empty_dir: ::std::option::Option, pub(crate) secret: ::std::option::Option, + pub(crate) persistent_volume_claim: ::std::option::Option, } impl EksVolumeBuilder { ///

The name of the volume. The name must be allowed as a DNS subdomain name. For more information, see DNS subdomain names in the Kubernetes documentation.

@@ -105,6 +112,20 @@ impl EksVolumeBuilder { pub fn get_secret(&self) -> &::std::option::Option { &self.secret } + ///

Specifies the configuration of a Kubernetes persistentVolumeClaim bounded to a persistentVolume. For more information, see Persistent Volume Claims in the Kubernetes documentation.

+ pub fn persistent_volume_claim(mut self, input: crate::types::EksPersistentVolumeClaim) -> Self { + self.persistent_volume_claim = ::std::option::Option::Some(input); + self + } + ///

Specifies the configuration of a Kubernetes persistentVolumeClaim bounded to a persistentVolume. For more information, see Persistent Volume Claims in the Kubernetes documentation.

+ pub fn set_persistent_volume_claim(mut self, input: ::std::option::Option) -> Self { + self.persistent_volume_claim = input; + self + } + ///

Specifies the configuration of a Kubernetes persistentVolumeClaim bounded to a persistentVolume. For more information, see Persistent Volume Claims in the Kubernetes documentation.

+ pub fn get_persistent_volume_claim(&self) -> &::std::option::Option { + &self.persistent_volume_claim + } /// Consumes the builder and constructs a [`EksVolume`](crate::types::EksVolume). pub fn build(self) -> crate::types::EksVolume { crate::types::EksVolume { @@ -112,6 +133,7 @@ impl EksVolumeBuilder { host_path: self.host_path, empty_dir: self.empty_dir, secret: self.secret, + persistent_volume_claim: self.persistent_volume_claim, } } } diff --git a/sdk/batch/src/types/builders.rs b/sdk/batch/src/types/builders.rs index 1189df486037..f973c684d0ba 100644 --- a/sdk/batch/src/types/builders.rs +++ b/sdk/batch/src/types/builders.rs @@ -99,6 +99,8 @@ pub use crate::types::_eks_pod_properties::EksPodPropertiesBuilder; pub use crate::types::_eks_volume::EksVolumeBuilder; +pub use crate::types::_eks_persistent_volume_claim::EksPersistentVolumeClaimBuilder; + pub use crate::types::_eks_secret::EksSecretBuilder; pub use crate::types::_eks_empty_dir::EksEmptyDirBuilder; diff --git a/sdk/cleanroomsml/Cargo.toml b/sdk/cleanroomsml/Cargo.toml index a2261a7fe195..ef308738d393 100644 --- a/sdk/cleanroomsml/Cargo.toml +++ b/sdk/cleanroomsml/Cargo.toml @@ -1,7 +1,7 @@ # Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. [package] name = "aws-sdk-cleanroomsml" -version = "1.51.0" +version = "1.52.0" authors = ["AWS Rust SDK Team ", "Russell Cohen "] description = "AWS SDK for AWS Clean Rooms ML" edition = "2021" diff --git a/sdk/cleanroomsml/README.md b/sdk/cleanroomsml/README.md index d6f4a56b2729..b7e10b9371b4 100644 --- a/sdk/cleanroomsml/README.md +++ b/sdk/cleanroomsml/README.md @@ -20,7 +20,7 @@ your project, add the following to your **Cargo.toml** file: ```toml [dependencies] aws-config = { version = "1.1.7", features = ["behavior-version-latest"] } -aws-sdk-cleanroomsml = "1.51.0" +aws-sdk-cleanroomsml = "1.52.0" tokio = { version = "1", features = ["full"] } ``` diff --git a/sdk/cleanroomsml/src/client/start_trained_model_inference_job.rs b/sdk/cleanroomsml/src/client/start_trained_model_inference_job.rs index 38438c1afcd6..57e86b5e9d70 100644 --- a/sdk/cleanroomsml/src/client/start_trained_model_inference_job.rs +++ b/sdk/cleanroomsml/src/client/start_trained_model_inference_job.rs @@ -9,7 +9,7 @@ impl super::Client { /// - [`configured_model_algorithm_association_arn(impl Into)`](crate::operation::start_trained_model_inference_job::builders::StartTrainedModelInferenceJobFluentBuilder::configured_model_algorithm_association_arn) / [`set_configured_model_algorithm_association_arn(Option)`](crate::operation::start_trained_model_inference_job::builders::StartTrainedModelInferenceJobFluentBuilder::set_configured_model_algorithm_association_arn):
required: **false**

The Amazon Resource Name (ARN) of the configured model algorithm association that is used for this trained model inference job.


/// - [`resource_config(InferenceResourceConfig)`](crate::operation::start_trained_model_inference_job::builders::StartTrainedModelInferenceJobFluentBuilder::resource_config) / [`set_resource_config(Option)`](crate::operation::start_trained_model_inference_job::builders::StartTrainedModelInferenceJobFluentBuilder::set_resource_config):
required: **true**

Defines the resource configuration for the trained model inference job.


/// - [`output_configuration(InferenceOutputConfiguration)`](crate::operation::start_trained_model_inference_job::builders::StartTrainedModelInferenceJobFluentBuilder::output_configuration) / [`set_output_configuration(Option)`](crate::operation::start_trained_model_inference_job::builders::StartTrainedModelInferenceJobFluentBuilder::set_output_configuration):
required: **true**

Defines the output configuration information for the trained model inference job.


- /// - [`data_source(ModelInferenceDataSource)`](crate::operation::start_trained_model_inference_job::builders::StartTrainedModelInferenceJobFluentBuilder::data_source) / [`set_data_source(Option)`](crate::operation::start_trained_model_inference_job::builders::StartTrainedModelInferenceJobFluentBuilder::set_data_source):
required: **true**

Defines he data source that is used for the trained model inference job.


+ /// - [`data_source(ModelInferenceDataSource)`](crate::operation::start_trained_model_inference_job::builders::StartTrainedModelInferenceJobFluentBuilder::data_source) / [`set_data_source(Option)`](crate::operation::start_trained_model_inference_job::builders::StartTrainedModelInferenceJobFluentBuilder::set_data_source):
required: **true**

Defines the data source that is used for the trained model inference job.


/// - [`description(impl Into)`](crate::operation::start_trained_model_inference_job::builders::StartTrainedModelInferenceJobFluentBuilder::description) / [`set_description(Option)`](crate::operation::start_trained_model_inference_job::builders::StartTrainedModelInferenceJobFluentBuilder::set_description):
required: **false**

The description of the trained model inference job.


/// - [`container_execution_parameters(InferenceContainerExecutionParameters)`](crate::operation::start_trained_model_inference_job::builders::StartTrainedModelInferenceJobFluentBuilder::container_execution_parameters) / [`set_container_execution_parameters(Option)`](crate::operation::start_trained_model_inference_job::builders::StartTrainedModelInferenceJobFluentBuilder::set_container_execution_parameters):
required: **false**

The execution parameters for the container.


/// - [`environment(impl Into, impl Into)`](crate::operation::start_trained_model_inference_job::builders::StartTrainedModelInferenceJobFluentBuilder::environment) / [`set_environment(Option>)`](crate::operation::start_trained_model_inference_job::builders::StartTrainedModelInferenceJobFluentBuilder::set_environment):
required: **false**

The environment variables to set in the Docker container.


diff --git a/sdk/cleanroomsml/src/lib.rs b/sdk/cleanroomsml/src/lib.rs index 342386759fae..f56025d9b53b 100644 --- a/sdk/cleanroomsml/src/lib.rs +++ b/sdk/cleanroomsml/src/lib.rs @@ -37,7 +37,7 @@ //! ```toml //! [dependencies] //! aws-config = { version = "1.1.7", features = ["behavior-version-latest"] } -//! aws-sdk-cleanroomsml = "1.51.0" +//! aws-sdk-cleanroomsml = "1.52.0" //! tokio = { version = "1", features = ["full"] } //! ``` //! diff --git a/sdk/cleanroomsml/src/operation/start_trained_model_inference_job/_start_trained_model_inference_job_input.rs b/sdk/cleanroomsml/src/operation/start_trained_model_inference_job/_start_trained_model_inference_job_input.rs index 601c59684789..13e5a8a36bac 100644 --- a/sdk/cleanroomsml/src/operation/start_trained_model_inference_job/_start_trained_model_inference_job_input.rs +++ b/sdk/cleanroomsml/src/operation/start_trained_model_inference_job/_start_trained_model_inference_job_input.rs @@ -15,7 +15,7 @@ pub struct StartTrainedModelInferenceJobInput { pub resource_config: ::std::option::Option, ///

Defines the output configuration information for the trained model inference job.

pub output_configuration: ::std::option::Option, - ///

Defines he data source that is used for the trained model inference job.

+ ///

Defines the data source that is used for the trained model inference job.

pub data_source: ::std::option::Option, ///

The description of the trained model inference job.

pub description: ::std::option::Option<::std::string::String>, @@ -70,7 +70,7 @@ impl StartTrainedModelInferenceJobInput { pub fn output_configuration(&self) -> ::std::option::Option<&crate::types::InferenceOutputConfiguration> { self.output_configuration.as_ref() } - ///

Defines he data source that is used for the trained model inference job.

+ ///

Defines the data source that is used for the trained model inference job.

pub fn data_source(&self) -> ::std::option::Option<&crate::types::ModelInferenceDataSource> { self.data_source.as_ref() } @@ -226,18 +226,18 @@ impl StartTrainedModelInferenceJobInputBuilder { pub fn get_output_configuration(&self) -> &::std::option::Option { &self.output_configuration } - ///

Defines he data source that is used for the trained model inference job.

+ ///

Defines the data source that is used for the trained model inference job.

/// This field is required. pub fn data_source(mut self, input: crate::types::ModelInferenceDataSource) -> Self { self.data_source = ::std::option::Option::Some(input); self } - ///

Defines he data source that is used for the trained model inference job.

+ ///

Defines the data source that is used for the trained model inference job.

pub fn set_data_source(mut self, input: ::std::option::Option) -> Self { self.data_source = input; self } - ///

Defines he data source that is used for the trained model inference job.

+ ///

Defines the data source that is used for the trained model inference job.

pub fn get_data_source(&self) -> &::std::option::Option { &self.data_source } diff --git a/sdk/cleanroomsml/src/operation/start_trained_model_inference_job/builders.rs b/sdk/cleanroomsml/src/operation/start_trained_model_inference_job/builders.rs index 52296c3b42ce..72ba867ed8f5 100644 --- a/sdk/cleanroomsml/src/operation/start_trained_model_inference_job/builders.rs +++ b/sdk/cleanroomsml/src/operation/start_trained_model_inference_job/builders.rs @@ -192,17 +192,17 @@ impl StartTrainedModelInferenceJobFluentBuilder { pub fn get_output_configuration(&self) -> &::std::option::Option { self.inner.get_output_configuration() } - ///

Defines he data source that is used for the trained model inference job.

+ ///

Defines the data source that is used for the trained model inference job.

pub fn data_source(mut self, input: crate::types::ModelInferenceDataSource) -> Self { self.inner = self.inner.data_source(input); self } - ///

Defines he data source that is used for the trained model inference job.

+ ///

Defines the data source that is used for the trained model inference job.

pub fn set_data_source(mut self, input: ::std::option::Option) -> Self { self.inner = self.inner.set_data_source(input); self } - ///

Defines he data source that is used for the trained model inference job.

+ ///

Defines the data source that is used for the trained model inference job.

pub fn get_data_source(&self) -> &::std::option::Option { self.inner.get_data_source() } diff --git a/sdk/cleanroomsml/src/protocol_serde.rs b/sdk/cleanroomsml/src/protocol_serde.rs index 76b31fd18565..de39ee1041d1 100644 --- a/sdk/cleanroomsml/src/protocol_serde.rs +++ b/sdk/cleanroomsml/src/protocol_serde.rs @@ -293,6 +293,8 @@ pub(crate) mod shape_collaboration_trained_model_inference_job_summary; pub(crate) mod shape_collaboration_trained_model_summary; +pub(crate) mod shape_compute_configuration; + pub(crate) mod shape_configured_audience_model_summary; pub(crate) mod shape_configured_model_algorithm_association_summary; @@ -351,7 +353,7 @@ pub(crate) mod shape_trained_model_inference_jobs_configuration_policy; pub(crate) mod shape_trained_models_configuration_policy; -pub(crate) mod shape_compute_configuration; +pub(crate) mod shape_worker_compute_configuration; pub(crate) mod shape_dataset_schema_list; @@ -371,8 +373,6 @@ pub(crate) mod shape_trained_model_exports_max_size; pub(crate) mod shape_trained_model_inference_max_output_size; -pub(crate) mod shape_worker_compute_configuration; - pub(crate) mod shape_account_id_list; pub(crate) mod shape_column_type_list; diff --git a/sdk/cleanroomsml/src/protocol_serde/shape_audience_generation_job_data_source.rs b/sdk/cleanroomsml/src/protocol_serde/shape_audience_generation_job_data_source.rs index 101c0229ae06..90311d64b625 100644 --- a/sdk/cleanroomsml/src/protocol_serde/shape_audience_generation_job_data_source.rs +++ b/sdk/cleanroomsml/src/protocol_serde/shape_audience_generation_job_data_source.rs @@ -29,6 +29,10 @@ where crate::protocol_serde::shape_protected_query_sql_parameters::de_protected_query_sql_parameters(tokens)?, ); } + "sqlComputeConfiguration" => { + builder = builder + .set_sql_compute_configuration(crate::protocol_serde::shape_compute_configuration::de_compute_configuration(tokens)?); + } _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?, }, other => { @@ -70,5 +74,11 @@ pub fn ser_audience_generation_job_data_source( crate::protocol_serde::shape_protected_query_sql_parameters::ser_protected_query_sql_parameters(&mut object_4, var_3)?; object_4.finish(); } + if let Some(var_5) = &input.sql_compute_configuration { + #[allow(unused_mut)] + let mut object_6 = object.key("sqlComputeConfiguration").start_object(); + crate::protocol_serde::shape_compute_configuration::ser_compute_configuration(&mut object_6, var_5)?; + object_6.finish(); + } Ok(()) } diff --git a/sdk/cleanroomsml/src/protocol_serde/shape_compute_configuration.rs b/sdk/cleanroomsml/src/protocol_serde/shape_compute_configuration.rs index 0764810829ef..1ade14e972bd 100644 --- a/sdk/cleanroomsml/src/protocol_serde/shape_compute_configuration.rs +++ b/sdk/cleanroomsml/src/protocol_serde/shape_compute_configuration.rs @@ -1,24 +1,4 @@ // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -pub fn ser_compute_configuration( - object_4: &mut ::aws_smithy_json::serialize::JsonObjectWriter, - input: &crate::types::ComputeConfiguration, -) -> Result<(), ::aws_smithy_types::error::operation::SerializationError> { - match input { - crate::types::ComputeConfiguration::Worker(inner) => { - #[allow(unused_mut)] - let mut object_1 = object_4.key("worker").start_object(); - crate::protocol_serde::shape_worker_compute_configuration::ser_worker_compute_configuration(&mut object_1, inner)?; - object_1.finish(); - } - crate::types::ComputeConfiguration::Unknown => { - return Err(::aws_smithy_types::error::operation::SerializationError::unknown_variant( - "ComputeConfiguration", - )) - } - } - Ok(()) -} - pub(crate) fn de_compute_configuration<'a, I>( tokens: &mut ::std::iter::Peekable, ) -> Result, ::aws_smithy_json::deserialize::error::DeserializeError> @@ -81,3 +61,23 @@ where } Ok(variant) } + +pub fn ser_compute_configuration( + object_6: &mut ::aws_smithy_json::serialize::JsonObjectWriter, + input: &crate::types::ComputeConfiguration, +) -> Result<(), ::aws_smithy_types::error::operation::SerializationError> { + match input { + crate::types::ComputeConfiguration::Worker(inner) => { + #[allow(unused_mut)] + let mut object_1 = object_6.key("worker").start_object(); + crate::protocol_serde::shape_worker_compute_configuration::ser_worker_compute_configuration(&mut object_1, inner)?; + object_1.finish(); + } + crate::types::ComputeConfiguration::Unknown => { + return Err(::aws_smithy_types::error::operation::SerializationError::unknown_variant( + "ComputeConfiguration", + )) + } + } + Ok(()) +} diff --git a/sdk/cleanroomsml/src/protocol_serde/shape_worker_compute_configuration.rs b/sdk/cleanroomsml/src/protocol_serde/shape_worker_compute_configuration.rs index 2d5f460b5c53..09cfcd4cf68c 100644 --- a/sdk/cleanroomsml/src/protocol_serde/shape_worker_compute_configuration.rs +++ b/sdk/cleanroomsml/src/protocol_serde/shape_worker_compute_configuration.rs @@ -1,20 +1,4 @@ // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -pub fn ser_worker_compute_configuration( - object: &mut ::aws_smithy_json::serialize::JsonObjectWriter, - input: &crate::types::WorkerComputeConfiguration, -) -> Result<(), ::aws_smithy_types::error::operation::SerializationError> { - { - object.key("type").string(input.r#type.as_str()); - } - if input.number != 16 { - object.key("number").number( - #[allow(clippy::useless_conversion)] - ::aws_smithy_types::Number::NegInt((input.number).into()), - ); - } - Ok(()) -} - pub(crate) fn de_worker_compute_configuration<'a, I>( tokens: &mut ::std::iter::Peekable, ) -> Result, ::aws_smithy_json::deserialize::error::DeserializeError> @@ -61,3 +45,19 @@ where )), } } + +pub fn ser_worker_compute_configuration( + object: &mut ::aws_smithy_json::serialize::JsonObjectWriter, + input: &crate::types::WorkerComputeConfiguration, +) -> Result<(), ::aws_smithy_types::error::operation::SerializationError> { + { + object.key("type").string(input.r#type.as_str()); + } + if input.number != 16 { + object.key("number").number( + #[allow(clippy::useless_conversion)] + ::aws_smithy_types::Number::NegInt((input.number).into()), + ); + } + Ok(()) +} diff --git a/sdk/cleanroomsml/src/types/_audience_generation_job_data_source.rs b/sdk/cleanroomsml/src/types/_audience_generation_job_data_source.rs index df0a774ead63..caf4ac0e3729 100644 --- a/sdk/cleanroomsml/src/types/_audience_generation_job_data_source.rs +++ b/sdk/cleanroomsml/src/types/_audience_generation_job_data_source.rs @@ -13,6 +13,8 @@ pub struct AudienceGenerationJobDataSource { pub role_arn: ::std::string::String, ///

The protected SQL query parameters.

pub sql_parameters: ::std::option::Option, + ///

Provides configuration information for the instances that will perform the compute work.

+ pub sql_compute_configuration: ::std::option::Option, } impl AudienceGenerationJobDataSource { ///

Defines the Amazon S3 bucket where the seed audience for the generating audience is stored. A valid data source is a JSON line file in the following format:

@@ -31,6 +33,10 @@ impl AudienceGenerationJobDataSource { pub fn sql_parameters(&self) -> ::std::option::Option<&crate::types::ProtectedQuerySqlParameters> { self.sql_parameters.as_ref() } + ///

Provides configuration information for the instances that will perform the compute work.

+ pub fn sql_compute_configuration(&self) -> ::std::option::Option<&crate::types::ComputeConfiguration> { + self.sql_compute_configuration.as_ref() + } } impl ::std::fmt::Debug for AudienceGenerationJobDataSource { fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { @@ -38,6 +44,7 @@ impl ::std::fmt::Debug for AudienceGenerationJobDataSource { formatter.field("data_source", &self.data_source); formatter.field("role_arn", &self.role_arn); formatter.field("sql_parameters", &"*** Sensitive Data Redacted ***"); + formatter.field("sql_compute_configuration", &self.sql_compute_configuration); formatter.finish() } } @@ -55,6 +62,7 @@ pub struct AudienceGenerationJobDataSourceBuilder { pub(crate) data_source: ::std::option::Option, pub(crate) role_arn: ::std::option::Option<::std::string::String>, pub(crate) sql_parameters: ::std::option::Option, + pub(crate) sql_compute_configuration: ::std::option::Option, } impl AudienceGenerationJobDataSourceBuilder { ///

Defines the Amazon S3 bucket where the seed audience for the generating audience is stored. A valid data source is a JSON line file in the following format:

@@ -109,6 +117,20 @@ impl AudienceGenerationJobDataSourceBuilder { pub fn get_sql_parameters(&self) -> &::std::option::Option { &self.sql_parameters } + ///

Provides configuration information for the instances that will perform the compute work.

+ pub fn sql_compute_configuration(mut self, input: crate::types::ComputeConfiguration) -> Self { + self.sql_compute_configuration = ::std::option::Option::Some(input); + self + } + ///

Provides configuration information for the instances that will perform the compute work.

+ pub fn set_sql_compute_configuration(mut self, input: ::std::option::Option) -> Self { + self.sql_compute_configuration = input; + self + } + ///

Provides configuration information for the instances that will perform the compute work.

+ pub fn get_sql_compute_configuration(&self) -> &::std::option::Option { + &self.sql_compute_configuration + } /// Consumes the builder and constructs a [`AudienceGenerationJobDataSource`](crate::types::AudienceGenerationJobDataSource). /// This method will fail if any of the following fields are not set: /// - [`role_arn`](crate::types::builders::AudienceGenerationJobDataSourceBuilder::role_arn) @@ -122,6 +144,7 @@ impl AudienceGenerationJobDataSourceBuilder { ) })?, sql_parameters: self.sql_parameters, + sql_compute_configuration: self.sql_compute_configuration, }) } } @@ -131,6 +154,7 @@ impl ::std::fmt::Debug for AudienceGenerationJobDataSourceBuilder { formatter.field("data_source", &self.data_source); formatter.field("role_arn", &self.role_arn); formatter.field("sql_parameters", &"*** Sensitive Data Redacted ***"); + formatter.field("sql_compute_configuration", &self.sql_compute_configuration); formatter.finish() } } diff --git a/sdk/cloudfront/Cargo.toml b/sdk/cloudfront/Cargo.toml index 056bfdff603f..56847522a527 100644 --- a/sdk/cloudfront/Cargo.toml +++ b/sdk/cloudfront/Cargo.toml @@ -1,7 +1,7 @@ # Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. [package] name = "aws-sdk-cloudfront" -version = "1.56.0" +version = "1.57.0" authors = ["AWS Rust SDK Team ", "Russell Cohen "] description = "AWS SDK for Amazon CloudFront" edition = "2021" diff --git a/sdk/cloudfront/README.md b/sdk/cloudfront/README.md index 992276786ce6..70e793ca821a 100644 --- a/sdk/cloudfront/README.md +++ b/sdk/cloudfront/README.md @@ -14,7 +14,7 @@ your project, add the following to your **Cargo.toml** file: ```toml [dependencies] aws-config = { version = "1.1.7", features = ["behavior-version-latest"] } -aws-sdk-cloudfront = "1.56.0" +aws-sdk-cloudfront = "1.57.0" tokio = { version = "1", features = ["full"] } ``` diff --git a/sdk/cloudfront/src/lib.rs b/sdk/cloudfront/src/lib.rs index f5d48c30a152..24c4aca223e3 100644 --- a/sdk/cloudfront/src/lib.rs +++ b/sdk/cloudfront/src/lib.rs @@ -31,7 +31,7 @@ //! ```toml //! [dependencies] //! aws-config = { version = "1.1.7", features = ["behavior-version-latest"] } -//! aws-sdk-cloudfront = "1.56.0" +//! aws-sdk-cloudfront = "1.57.0" //! tokio = { version = "1", features = ["full"] } //! ``` //! diff --git a/sdk/cloudfront/src/protocol_serde/shape_vpc_origin_config.rs b/sdk/cloudfront/src/protocol_serde/shape_vpc_origin_config.rs index ff7667f8f111..57ea088458ee 100644 --- a/sdk/cloudfront/src/protocol_serde/shape_vpc_origin_config.rs +++ b/sdk/cloudfront/src/protocol_serde/shape_vpc_origin_config.rs @@ -9,6 +9,14 @@ pub fn ser_vpc_origin_config( let mut inner_writer = scope.start_el("VpcOriginId").finish(); inner_writer.data(input.vpc_origin_id.as_str()); } + if let Some(var_1) = &input.origin_read_timeout { + let mut inner_writer = scope.start_el("OriginReadTimeout").finish(); + inner_writer.data(::aws_smithy_types::primitive::Encoder::from(*var_1).encode()); + } + if let Some(var_2) = &input.origin_keepalive_timeout { + let mut inner_writer = scope.start_el("OriginKeepaliveTimeout").finish(); + inner_writer.data(::aws_smithy_types::primitive::Encoder::from(*var_2).encode()); + } scope.finish(); Ok(()) } @@ -22,7 +30,7 @@ pub fn de_vpc_origin_config( while let Some(mut tag) = decoder.next_tag() { match tag.start_el() { s if s.matches("VpcOriginId") /* VpcOriginId com.amazonaws.cloudfront#VpcOriginConfig$VpcOriginId */ => { - let var_1 = + let var_3 = Some( Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok( ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref() @@ -31,7 +39,37 @@ pub fn de_vpc_origin_config( ? ) ; - builder = builder.set_vpc_origin_id(var_1); + builder = builder.set_vpc_origin_id(var_3); + } + , + s if s.matches("OriginReadTimeout") /* OriginReadTimeout com.amazonaws.cloudfront#VpcOriginConfig$OriginReadTimeout */ => { + let var_4 = + Some( + { + ::parse_smithy_primitive( + ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref() + ) + .map_err(|_|::aws_smithy_xml::decode::XmlDecodeError::custom("expected (integer: `com.amazonaws.cloudfront#integer`)")) + } + ? + ) + ; + builder = builder.set_origin_read_timeout(var_4); + } + , + s if s.matches("OriginKeepaliveTimeout") /* OriginKeepaliveTimeout com.amazonaws.cloudfront#VpcOriginConfig$OriginKeepaliveTimeout */ => { + let var_5 = + Some( + { + ::parse_smithy_primitive( + ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref() + ) + .map_err(|_|::aws_smithy_xml::decode::XmlDecodeError::custom("expected (integer: `com.amazonaws.cloudfront#integer`)")) + } + ? + ) + ; + builder = builder.set_origin_keepalive_timeout(var_5); } , _ => {} diff --git a/sdk/cloudfront/src/types/_custom_origin_config.rs b/sdk/cloudfront/src/types/_custom_origin_config.rs index 54e42df86a78..9ad99818bab3 100644 --- a/sdk/cloudfront/src/types/_custom_origin_config.rs +++ b/sdk/cloudfront/src/types/_custom_origin_config.rs @@ -22,10 +22,10 @@ pub struct CustomOriginConfig { ///

For more information, see Minimum Origin SSL Protocol in the Amazon CloudFront Developer Guide.

pub origin_ssl_protocols: ::std::option::Option, ///

Specifies how long, in seconds, CloudFront waits for a response from the origin. This is also known as the origin response timeout. The minimum timeout is 1 second, the maximum is 60 seconds, and the default (if you don't specify otherwise) is 30 seconds.

- ///

For more information, see Origin Response Timeout in the Amazon CloudFront Developer Guide.

+ ///

For more information, see Response timeout (custom origins only) in the Amazon CloudFront Developer Guide.

pub origin_read_timeout: ::std::option::Option, ///

Specifies how long, in seconds, CloudFront persists its connection to the origin. The minimum timeout is 1 second, the maximum is 60 seconds, and the default (if you don't specify otherwise) is 5 seconds.

- ///

For more information, see Origin Keep-alive Timeout in the Amazon CloudFront Developer Guide.

+ ///

For more information, see Keep-alive timeout (custom origins only) in the Amazon CloudFront Developer Guide.

pub origin_keepalive_timeout: ::std::option::Option, } impl CustomOriginConfig { @@ -55,12 +55,12 @@ impl CustomOriginConfig { self.origin_ssl_protocols.as_ref() } ///

Specifies how long, in seconds, CloudFront waits for a response from the origin. This is also known as the origin response timeout. The minimum timeout is 1 second, the maximum is 60 seconds, and the default (if you don't specify otherwise) is 30 seconds.

- ///

For more information, see Origin Response Timeout in the Amazon CloudFront Developer Guide.

+ ///

For more information, see Response timeout (custom origins only) in the Amazon CloudFront Developer Guide.

pub fn origin_read_timeout(&self) -> ::std::option::Option { self.origin_read_timeout } ///

Specifies how long, in seconds, CloudFront persists its connection to the origin. The minimum timeout is 1 second, the maximum is 60 seconds, and the default (if you don't specify otherwise) is 5 seconds.

- ///

For more information, see Origin Keep-alive Timeout in the Amazon CloudFront Developer Guide.

+ ///

For more information, see Keep-alive timeout (custom origins only) in the Amazon CloudFront Developer Guide.

pub fn origin_keepalive_timeout(&self) -> ::std::option::Option { self.origin_keepalive_timeout } @@ -171,36 +171,36 @@ impl CustomOriginConfigBuilder { &self.origin_ssl_protocols } ///

Specifies how long, in seconds, CloudFront waits for a response from the origin. This is also known as the origin response timeout. The minimum timeout is 1 second, the maximum is 60 seconds, and the default (if you don't specify otherwise) is 30 seconds.

- ///

For more information, see Origin Response Timeout in the Amazon CloudFront Developer Guide.

+ ///

For more information, see Response timeout (custom origins only) in the Amazon CloudFront Developer Guide.

pub fn origin_read_timeout(mut self, input: i32) -> Self { self.origin_read_timeout = ::std::option::Option::Some(input); self } ///

Specifies how long, in seconds, CloudFront waits for a response from the origin. This is also known as the origin response timeout. The minimum timeout is 1 second, the maximum is 60 seconds, and the default (if you don't specify otherwise) is 30 seconds.

- ///

For more information, see Origin Response Timeout in the Amazon CloudFront Developer Guide.

+ ///

For more information, see Response timeout (custom origins only) in the Amazon CloudFront Developer Guide.

pub fn set_origin_read_timeout(mut self, input: ::std::option::Option) -> Self { self.origin_read_timeout = input; self } ///

Specifies how long, in seconds, CloudFront waits for a response from the origin. This is also known as the origin response timeout. The minimum timeout is 1 second, the maximum is 60 seconds, and the default (if you don't specify otherwise) is 30 seconds.

- ///

For more information, see Origin Response Timeout in the Amazon CloudFront Developer Guide.

+ ///

For more information, see Response timeout (custom origins only) in the Amazon CloudFront Developer Guide.

pub fn get_origin_read_timeout(&self) -> &::std::option::Option { &self.origin_read_timeout } ///

Specifies how long, in seconds, CloudFront persists its connection to the origin. The minimum timeout is 1 second, the maximum is 60 seconds, and the default (if you don't specify otherwise) is 5 seconds.

- ///

For more information, see Origin Keep-alive Timeout in the Amazon CloudFront Developer Guide.

+ ///

For more information, see Keep-alive timeout (custom origins only) in the Amazon CloudFront Developer Guide.

pub fn origin_keepalive_timeout(mut self, input: i32) -> Self { self.origin_keepalive_timeout = ::std::option::Option::Some(input); self } ///

Specifies how long, in seconds, CloudFront persists its connection to the origin. The minimum timeout is 1 second, the maximum is 60 seconds, and the default (if you don't specify otherwise) is 5 seconds.

- ///

For more information, see Origin Keep-alive Timeout in the Amazon CloudFront Developer Guide.

+ ///

For more information, see Keep-alive timeout (custom origins only) in the Amazon CloudFront Developer Guide.

pub fn set_origin_keepalive_timeout(mut self, input: ::std::option::Option) -> Self { self.origin_keepalive_timeout = input; self } ///

Specifies how long, in seconds, CloudFront persists its connection to the origin. The minimum timeout is 1 second, the maximum is 60 seconds, and the default (if you don't specify otherwise) is 5 seconds.

- ///

For more information, see Origin Keep-alive Timeout in the Amazon CloudFront Developer Guide.

+ ///

For more information, see Keep-alive timeout (custom origins only) in the Amazon CloudFront Developer Guide.

pub fn get_origin_keepalive_timeout(&self) -> &::std::option::Option { &self.origin_keepalive_timeout } diff --git a/sdk/cloudfront/src/types/_distribution_config.rs b/sdk/cloudfront/src/types/_distribution_config.rs index 1c497aad9e30..94f82af9b498 100644 --- a/sdk/cloudfront/src/types/_distribution_config.rs +++ b/sdk/cloudfront/src/types/_distribution_config.rs @@ -10,12 +10,12 @@ pub struct DistributionConfig { pub caller_reference: ::std::string::String, ///

A complex type that contains information about CNAMEs (alternate domain names), if any, for this distribution.

pub aliases: ::std::option::Option, - ///

The object that you want CloudFront to request from your origin (for example, index.html) when a viewer requests the root URL for your distribution (https://www.example.com) instead of an object in your distribution (https://www.example.com/product-description.html). Specifying a default root object avoids exposing the contents of your distribution.

- ///

Specify only the object name, for example, index.html. Don't add a / before the object name.

+ ///

When a viewer requests the root URL for your distribution, the default root object is the object that you want CloudFront to request from your origin. For example, if your root URL is https://www.example.com, you can specify CloudFront to return the index.html file as the default root object. You can specify a default root object so that viewers see a specific file or object, instead of another object in your distribution (for example, https://www.example.com/product-description.html). A default root object avoids exposing the contents of your distribution.

+ ///

You can specify the object name or a path to the object name (for example, index.html or exampleFolderName/index.html). Your string can't begin with a forward slash (/). Only specify the object name or the path to the object.

///

If you don't want to specify a default root object when you create a distribution, include an empty DefaultRootObject element.

///

To delete the default root object from an existing distribution, update the distribution configuration and include an empty DefaultRootObject element.

///

To replace the default root object, update the distribution configuration and specify the new object.

- ///

For more information about the default root object, see Creating a Default Root Object in the Amazon CloudFront Developer Guide.

+ ///

For more information about the default root object, see Specify a default root object in the Amazon CloudFront Developer Guide.

pub default_root_object: ::std::option::Option<::std::string::String>, ///

A complex type that contains information about origins for this distribution.

pub origins: ::std::option::Option, @@ -87,12 +87,12 @@ impl DistributionConfig { pub fn aliases(&self) -> ::std::option::Option<&crate::types::Aliases> { self.aliases.as_ref() } - ///

The object that you want CloudFront to request from your origin (for example, index.html) when a viewer requests the root URL for your distribution (https://www.example.com) instead of an object in your distribution (https://www.example.com/product-description.html). Specifying a default root object avoids exposing the contents of your distribution.

- ///

Specify only the object name, for example, index.html. Don't add a / before the object name.

+ ///

When a viewer requests the root URL for your distribution, the default root object is the object that you want CloudFront to request from your origin. For example, if your root URL is https://www.example.com, you can specify CloudFront to return the index.html file as the default root object. You can specify a default root object so that viewers see a specific file or object, instead of another object in your distribution (for example, https://www.example.com/product-description.html). A default root object avoids exposing the contents of your distribution.

+ ///

You can specify the object name or a path to the object name (for example, index.html or exampleFolderName/index.html). Your string can't begin with a forward slash (/). Only specify the object name or the path to the object.

///

If you don't want to specify a default root object when you create a distribution, include an empty DefaultRootObject element.

///

To delete the default root object from an existing distribution, update the distribution configuration and include an empty DefaultRootObject element.

///

To replace the default root object, update the distribution configuration and specify the new object.

- ///

For more information about the default root object, see Creating a Default Root Object in the Amazon CloudFront Developer Guide.

+ ///

For more information about the default root object, see Specify a default root object in the Amazon CloudFront Developer Guide.

pub fn default_root_object(&self) -> ::std::option::Option<&str> { self.default_root_object.as_deref() } @@ -283,32 +283,32 @@ impl DistributionConfigBuilder { pub fn get_aliases(&self) -> &::std::option::Option { &self.aliases } - ///

The object that you want CloudFront to request from your origin (for example, index.html) when a viewer requests the root URL for your distribution (https://www.example.com) instead of an object in your distribution (https://www.example.com/product-description.html). Specifying a default root object avoids exposing the contents of your distribution.

- ///

Specify only the object name, for example, index.html. Don't add a / before the object name.

+ ///

When a viewer requests the root URL for your distribution, the default root object is the object that you want CloudFront to request from your origin. For example, if your root URL is https://www.example.com, you can specify CloudFront to return the index.html file as the default root object. You can specify a default root object so that viewers see a specific file or object, instead of another object in your distribution (for example, https://www.example.com/product-description.html). A default root object avoids exposing the contents of your distribution.

+ ///

You can specify the object name or a path to the object name (for example, index.html or exampleFolderName/index.html). Your string can't begin with a forward slash (/). Only specify the object name or the path to the object.

///

If you don't want to specify a default root object when you create a distribution, include an empty DefaultRootObject element.

///

To delete the default root object from an existing distribution, update the distribution configuration and include an empty DefaultRootObject element.

///

To replace the default root object, update the distribution configuration and specify the new object.

- ///

For more information about the default root object, see Creating a Default Root Object in the Amazon CloudFront Developer Guide.

+ ///

For more information about the default root object, see Specify a default root object in the Amazon CloudFront Developer Guide.

pub fn default_root_object(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { self.default_root_object = ::std::option::Option::Some(input.into()); self } - ///

The object that you want CloudFront to request from your origin (for example, index.html) when a viewer requests the root URL for your distribution (https://www.example.com) instead of an object in your distribution (https://www.example.com/product-description.html). Specifying a default root object avoids exposing the contents of your distribution.

- ///

Specify only the object name, for example, index.html. Don't add a / before the object name.

+ ///

When a viewer requests the root URL for your distribution, the default root object is the object that you want CloudFront to request from your origin. For example, if your root URL is https://www.example.com, you can specify CloudFront to return the index.html file as the default root object. You can specify a default root object so that viewers see a specific file or object, instead of another object in your distribution (for example, https://www.example.com/product-description.html). A default root object avoids exposing the contents of your distribution.

+ ///

You can specify the object name or a path to the object name (for example, index.html or exampleFolderName/index.html). Your string can't begin with a forward slash (/). Only specify the object name or the path to the object.

///

If you don't want to specify a default root object when you create a distribution, include an empty DefaultRootObject element.

///

To delete the default root object from an existing distribution, update the distribution configuration and include an empty DefaultRootObject element.

///

To replace the default root object, update the distribution configuration and specify the new object.

- ///

For more information about the default root object, see Creating a Default Root Object in the Amazon CloudFront Developer Guide.

+ ///

For more information about the default root object, see Specify a default root object in the Amazon CloudFront Developer Guide.

pub fn set_default_root_object(mut self, input: ::std::option::Option<::std::string::String>) -> Self { self.default_root_object = input; self } - ///

The object that you want CloudFront to request from your origin (for example, index.html) when a viewer requests the root URL for your distribution (https://www.example.com) instead of an object in your distribution (https://www.example.com/product-description.html). Specifying a default root object avoids exposing the contents of your distribution.

- ///

Specify only the object name, for example, index.html. Don't add a / before the object name.

+ ///

When a viewer requests the root URL for your distribution, the default root object is the object that you want CloudFront to request from your origin. For example, if your root URL is https://www.example.com, you can specify CloudFront to return the index.html file as the default root object. You can specify a default root object so that viewers see a specific file or object, instead of another object in your distribution (for example, https://www.example.com/product-description.html). A default root object avoids exposing the contents of your distribution.

+ ///

You can specify the object name or a path to the object name (for example, index.html or exampleFolderName/index.html). Your string can't begin with a forward slash (/). Only specify the object name or the path to the object.

///

If you don't want to specify a default root object when you create a distribution, include an empty DefaultRootObject element.

///

To delete the default root object from an existing distribution, update the distribution configuration and include an empty DefaultRootObject element.

///

To replace the default root object, update the distribution configuration and specify the new object.

- ///

For more information about the default root object, see Creating a Default Root Object in the Amazon CloudFront Developer Guide.

+ ///

For more information about the default root object, see Specify a default root object in the Amazon CloudFront Developer Guide.

pub fn get_default_root_object(&self) -> &::std::option::Option<::std::string::String> { &self.default_root_object } diff --git a/sdk/cloudfront/src/types/_vpc_origin_config.rs b/sdk/cloudfront/src/types/_vpc_origin_config.rs index be774a62ccb8..ab0447df38bc 100644 --- a/sdk/cloudfront/src/types/_vpc_origin_config.rs +++ b/sdk/cloudfront/src/types/_vpc_origin_config.rs @@ -6,6 +6,12 @@ pub struct VpcOriginConfig { ///

The VPC origin ID.

pub vpc_origin_id: ::std::string::String, + ///

Specifies how long, in seconds, CloudFront waits for a response from the origin. This is also known as the origin response timeout. The minimum timeout is 1 second, the maximum is 60 seconds, and the default (if you don't specify otherwise) is 30 seconds.

+ ///

For more information, see Response timeout (custom origins only) in the Amazon CloudFront Developer Guide.

+ pub origin_read_timeout: ::std::option::Option, + ///

Specifies how long, in seconds, CloudFront persists its connection to the origin. The minimum timeout is 1 second, the maximum is 60 seconds, and the default (if you don't specify otherwise) is 5 seconds.

+ ///

For more information, see Keep-alive timeout (custom origins only) in the Amazon CloudFront Developer Guide.

+ pub origin_keepalive_timeout: ::std::option::Option, } impl VpcOriginConfig { ///

The VPC origin ID.

@@ -13,6 +19,16 @@ impl VpcOriginConfig { use std::ops::Deref; self.vpc_origin_id.deref() } + ///

Specifies how long, in seconds, CloudFront waits for a response from the origin. This is also known as the origin response timeout. The minimum timeout is 1 second, the maximum is 60 seconds, and the default (if you don't specify otherwise) is 30 seconds.

+ ///

For more information, see Response timeout (custom origins only) in the Amazon CloudFront Developer Guide.

+ pub fn origin_read_timeout(&self) -> ::std::option::Option { + self.origin_read_timeout + } + ///

Specifies how long, in seconds, CloudFront persists its connection to the origin. The minimum timeout is 1 second, the maximum is 60 seconds, and the default (if you don't specify otherwise) is 5 seconds.

+ ///

For more information, see Keep-alive timeout (custom origins only) in the Amazon CloudFront Developer Guide.

+ pub fn origin_keepalive_timeout(&self) -> ::std::option::Option { + self.origin_keepalive_timeout + } } impl VpcOriginConfig { /// Creates a new builder-style object to manufacture [`VpcOriginConfig`](crate::types::VpcOriginConfig). @@ -26,6 +42,8 @@ impl VpcOriginConfig { #[non_exhaustive] pub struct VpcOriginConfigBuilder { pub(crate) vpc_origin_id: ::std::option::Option<::std::string::String>, + pub(crate) origin_read_timeout: ::std::option::Option, + pub(crate) origin_keepalive_timeout: ::std::option::Option, } impl VpcOriginConfigBuilder { ///

The VPC origin ID.

@@ -43,6 +61,40 @@ impl VpcOriginConfigBuilder { pub fn get_vpc_origin_id(&self) -> &::std::option::Option<::std::string::String> { &self.vpc_origin_id } + ///

Specifies how long, in seconds, CloudFront waits for a response from the origin. This is also known as the origin response timeout. The minimum timeout is 1 second, the maximum is 60 seconds, and the default (if you don't specify otherwise) is 30 seconds.

+ ///

For more information, see Response timeout (custom origins only) in the Amazon CloudFront Developer Guide.

+ pub fn origin_read_timeout(mut self, input: i32) -> Self { + self.origin_read_timeout = ::std::option::Option::Some(input); + self + } + ///

Specifies how long, in seconds, CloudFront waits for a response from the origin. This is also known as the origin response timeout. The minimum timeout is 1 second, the maximum is 60 seconds, and the default (if you don't specify otherwise) is 30 seconds.

+ ///

For more information, see Response timeout (custom origins only) in the Amazon CloudFront Developer Guide.

+ pub fn set_origin_read_timeout(mut self, input: ::std::option::Option) -> Self { + self.origin_read_timeout = input; + self + } + ///

Specifies how long, in seconds, CloudFront waits for a response from the origin. This is also known as the origin response timeout. The minimum timeout is 1 second, the maximum is 60 seconds, and the default (if you don't specify otherwise) is 30 seconds.

+ ///

For more information, see Response timeout (custom origins only) in the Amazon CloudFront Developer Guide.

+ pub fn get_origin_read_timeout(&self) -> &::std::option::Option { + &self.origin_read_timeout + } + ///

Specifies how long, in seconds, CloudFront persists its connection to the origin. The minimum timeout is 1 second, the maximum is 60 seconds, and the default (if you don't specify otherwise) is 5 seconds.

+ ///

For more information, see Keep-alive timeout (custom origins only) in the Amazon CloudFront Developer Guide.

+ pub fn origin_keepalive_timeout(mut self, input: i32) -> Self { + self.origin_keepalive_timeout = ::std::option::Option::Some(input); + self + } + ///

Specifies how long, in seconds, CloudFront persists its connection to the origin. The minimum timeout is 1 second, the maximum is 60 seconds, and the default (if you don't specify otherwise) is 5 seconds.

+ ///

For more information, see Keep-alive timeout (custom origins only) in the Amazon CloudFront Developer Guide.

+ pub fn set_origin_keepalive_timeout(mut self, input: ::std::option::Option) -> Self { + self.origin_keepalive_timeout = input; + self + } + ///

Specifies how long, in seconds, CloudFront persists its connection to the origin. The minimum timeout is 1 second, the maximum is 60 seconds, and the default (if you don't specify otherwise) is 5 seconds.

+ ///

For more information, see Keep-alive timeout (custom origins only) in the Amazon CloudFront Developer Guide.

+ pub fn get_origin_keepalive_timeout(&self) -> &::std::option::Option { + &self.origin_keepalive_timeout + } /// Consumes the builder and constructs a [`VpcOriginConfig`](crate::types::VpcOriginConfig). /// This method will fail if any of the following fields are not set: /// - [`vpc_origin_id`](crate::types::builders::VpcOriginConfigBuilder::vpc_origin_id) @@ -54,6 +106,8 @@ impl VpcOriginConfigBuilder { "vpc_origin_id was not specified but it is required when building VpcOriginConfig", ) })?, + origin_read_timeout: self.origin_read_timeout, + origin_keepalive_timeout: self.origin_keepalive_timeout, }) } } diff --git a/sdk/codepipeline/Cargo.toml b/sdk/codepipeline/Cargo.toml index b01a33401ce2..d95eb53d04cb 100644 --- a/sdk/codepipeline/Cargo.toml +++ b/sdk/codepipeline/Cargo.toml @@ -1,7 +1,7 @@ # Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. [package] name = "aws-sdk-codepipeline" -version = "1.59.0" +version = "1.60.0" authors = ["AWS Rust SDK Team ", "Russell Cohen "] description = "AWS SDK for AWS CodePipeline" edition = "2021" diff --git a/sdk/codepipeline/README.md b/sdk/codepipeline/README.md index 92d9c602ce57..2fbfa902d74d 100644 --- a/sdk/codepipeline/README.md +++ b/sdk/codepipeline/README.md @@ -72,7 +72,7 @@ your project, add the following to your **Cargo.toml** file: ```toml [dependencies] aws-config = { version = "1.1.7", features = ["behavior-version-latest"] } -aws-sdk-codepipeline = "1.59.0" +aws-sdk-codepipeline = "1.60.0" tokio = { version = "1", features = ["full"] } ``` diff --git a/sdk/codepipeline/src/client/get_action_type.rs b/sdk/codepipeline/src/client/get_action_type.rs index b519b58c0a97..ab44fde7f3e7 100644 --- a/sdk/codepipeline/src/client/get_action_type.rs +++ b/sdk/codepipeline/src/client/get_action_type.rs @@ -3,7 +3,7 @@ impl super::Client { /// Constructs a fluent builder for the [`GetActionType`](crate::operation::get_action_type::builders::GetActionTypeFluentBuilder) operation. /// /// - The fluent builder is configurable: - /// - [`category(ActionCategory)`](crate::operation::get_action_type::builders::GetActionTypeFluentBuilder::category) / [`set_category(Option)`](crate::operation::get_action_type::builders::GetActionTypeFluentBuilder::set_category):
required: **true**

Defines what kind of action can be taken in the stage. The following are the valid values:

  • Source

  • Build

  • Test

  • Deploy

  • Approval

  • Invoke


+ /// - [`category(ActionCategory)`](crate::operation::get_action_type::builders::GetActionTypeFluentBuilder::category) / [`set_category(Option)`](crate::operation::get_action_type::builders::GetActionTypeFluentBuilder::set_category):
required: **true**

Defines what kind of action can be taken in the stage. The following are the valid values:

  • Source

  • Build

  • Test

  • Deploy

  • Approval

  • Invoke

  • Compute


/// - [`owner(impl Into)`](crate::operation::get_action_type::builders::GetActionTypeFluentBuilder::owner) / [`set_owner(Option)`](crate::operation::get_action_type::builders::GetActionTypeFluentBuilder::set_owner):
required: **true**

The creator of an action type that was created with any supported integration model. There are two valid values: AWS and ThirdParty.


/// - [`provider(impl Into)`](crate::operation::get_action_type::builders::GetActionTypeFluentBuilder::provider) / [`set_provider(Option)`](crate::operation::get_action_type::builders::GetActionTypeFluentBuilder::set_provider):
required: **true**

The provider of the action type being called. The provider name is specified when the action type is created.


/// - [`version(impl Into)`](crate::operation::get_action_type::builders::GetActionTypeFluentBuilder::version) / [`set_version(Option)`](crate::operation::get_action_type::builders::GetActionTypeFluentBuilder::set_version):
required: **true**

A string that describes the action type version.


diff --git a/sdk/codepipeline/src/lib.rs b/sdk/codepipeline/src/lib.rs index d7370cb9a9f7..a08705ef73c0 100644 --- a/sdk/codepipeline/src/lib.rs +++ b/sdk/codepipeline/src/lib.rs @@ -89,7 +89,7 @@ //! ```toml //! [dependencies] //! aws-config = { version = "1.1.7", features = ["behavior-version-latest"] } -//! aws-sdk-codepipeline = "1.59.0" +//! aws-sdk-codepipeline = "1.60.0" //! tokio = { version = "1", features = ["full"] } //! ``` //! diff --git a/sdk/codepipeline/src/operation/get_action_type/_get_action_type_input.rs b/sdk/codepipeline/src/operation/get_action_type/_get_action_type_input.rs index 028d17191d37..70b40a7125fc 100644 --- a/sdk/codepipeline/src/operation/get_action_type/_get_action_type_input.rs +++ b/sdk/codepipeline/src/operation/get_action_type/_get_action_type_input.rs @@ -17,6 +17,8 @@ pub struct GetActionTypeInput { ///

Approval

///
  • ///

    Invoke

  • + ///
  • + ///

    Compute

  • /// pub category: ::std::option::Option, ///

    The creator of an action type that was created with any supported integration model. There are two valid values: AWS and ThirdParty.

    @@ -41,6 +43,8 @@ impl GetActionTypeInput { ///

    Approval

    ///
  • ///

    Invoke

  • + ///
  • + ///

    Compute

  • /// pub fn category(&self) -> ::std::option::Option<&crate::types::ActionCategory> { self.category.as_ref() @@ -89,6 +93,8 @@ impl GetActionTypeInputBuilder { ///

    Approval

    ///
  • ///

    Invoke

  • + ///
  • + ///

    Compute

  • /// /// This field is required. pub fn category(mut self, input: crate::types::ActionCategory) -> Self { @@ -109,6 +115,8 @@ impl GetActionTypeInputBuilder { ///

    Approval

    ///
  • ///

    Invoke

  • + ///
  • + ///

    Compute

  • /// pub fn set_category(mut self, input: ::std::option::Option) -> Self { self.category = input; @@ -128,6 +136,8 @@ impl GetActionTypeInputBuilder { ///

    Approval

    ///
  • ///

    Invoke

  • + ///
  • + ///

    Compute

  • /// pub fn get_category(&self) -> &::std::option::Option { &self.category diff --git a/sdk/codepipeline/src/operation/get_action_type/builders.rs b/sdk/codepipeline/src/operation/get_action_type/builders.rs index 2375b8706781..82fc7aeae90c 100644 --- a/sdk/codepipeline/src/operation/get_action_type/builders.rs +++ b/sdk/codepipeline/src/operation/get_action_type/builders.rs @@ -122,6 +122,8 @@ impl GetActionTypeFluentBuilder { ///

    Approval

    ///
  • ///

    Invoke

  • + ///
  • + ///

    Compute

  • /// pub fn category(mut self, input: crate::types::ActionCategory) -> Self { self.inner = self.inner.category(input); @@ -141,6 +143,8 @@ impl GetActionTypeFluentBuilder { ///

    Approval

    ///
  • ///

    Invoke

  • + ///
  • + ///

    Compute

  • /// pub fn set_category(mut self, input: ::std::option::Option) -> Self { self.inner = self.inner.set_category(input); @@ -160,6 +164,8 @@ impl GetActionTypeFluentBuilder { ///

    Approval

    ///
  • ///

    Invoke

  • + ///
  • + ///

    Compute

  • /// pub fn get_category(&self) -> &::std::option::Option { self.inner.get_category() diff --git a/sdk/codepipeline/src/operation/list_rule_types/builders.rs b/sdk/codepipeline/src/operation/list_rule_types/builders.rs index 7b5591364413..e19d73cf109e 100644 --- a/sdk/codepipeline/src/operation/list_rule_types/builders.rs +++ b/sdk/codepipeline/src/operation/list_rule_types/builders.rs @@ -22,7 +22,7 @@ impl crate::operation::list_rule_types::builders::ListRuleTypesInputBuilder { } /// Fluent builder constructing a request to `ListRuleTypes`. /// -///

    Lists the rules for the condition.

    +///

    Lists the rules for the condition. For more information about conditions, see Stage conditions. For more information about rules, see the CodePipeline rule reference.

    #[derive(::std::clone::Clone, ::std::fmt::Debug)] pub struct ListRuleTypesFluentBuilder { handle: ::std::sync::Arc, diff --git a/sdk/codepipeline/src/protocol_serde/shape_rule_declaration.rs b/sdk/codepipeline/src/protocol_serde/shape_rule_declaration.rs index eb4b30084009..b760cd36efc0 100644 --- a/sdk/codepipeline/src/protocol_serde/shape_rule_declaration.rs +++ b/sdk/codepipeline/src/protocol_serde/shape_rule_declaration.rs @@ -22,28 +22,37 @@ pub fn ser_rule_declaration( } object_4.finish(); } - if let Some(var_7) = &input.input_artifacts { - let mut array_8 = object.key("inputArtifacts").start_array(); + if let Some(var_7) = &input.commands { + let mut array_8 = object.key("commands").start_array(); for item_9 in var_7 { { - #[allow(unused_mut)] - let mut object_10 = array_8.value().start_object(); - crate::protocol_serde::shape_input_artifact::ser_input_artifact(&mut object_10, item_9)?; - object_10.finish(); + array_8.value().string(item_9.as_str()); } } array_8.finish(); } - if let Some(var_11) = &input.role_arn { - object.key("roleArn").string(var_11.as_str()); + if let Some(var_10) = &input.input_artifacts { + let mut array_11 = object.key("inputArtifacts").start_array(); + for item_12 in var_10 { + { + #[allow(unused_mut)] + let mut object_13 = array_11.value().start_object(); + crate::protocol_serde::shape_input_artifact::ser_input_artifact(&mut object_13, item_12)?; + object_13.finish(); + } + } + array_11.finish(); + } + if let Some(var_14) = &input.role_arn { + object.key("roleArn").string(var_14.as_str()); } - if let Some(var_12) = &input.region { - object.key("region").string(var_12.as_str()); + if let Some(var_15) = &input.region { + object.key("region").string(var_15.as_str()); } - if let Some(var_13) = &input.timeout_in_minutes { + if let Some(var_16) = &input.timeout_in_minutes { object.key("timeoutInMinutes").number( #[allow(clippy::useless_conversion)] - ::aws_smithy_types::Number::NegInt((*var_13).into()), + ::aws_smithy_types::Number::NegInt((*var_16).into()), ); } Ok(()) @@ -78,6 +87,9 @@ where builder = builder.set_configuration(crate::protocol_serde::shape_rule_configuration_map::de_rule_configuration_map(tokens)?); } + "commands" => { + builder = builder.set_commands(crate::protocol_serde::shape_command_list::de_command_list(tokens)?); + } "inputArtifacts" => { builder = builder.set_input_artifacts(crate::protocol_serde::shape_input_artifact_list::de_input_artifact_list(tokens)?); } diff --git a/sdk/codepipeline/src/types/_action_type_id.rs b/sdk/codepipeline/src/types/_action_type_id.rs index 74a2a438369c..01e02e4c486c 100644 --- a/sdk/codepipeline/src/types/_action_type_id.rs +++ b/sdk/codepipeline/src/types/_action_type_id.rs @@ -18,6 +18,8 @@ pub struct ActionTypeId { ///

    Invoke

    ///
  • ///

    Approval

  • + ///
  • + ///

    Compute

  • /// pub category: crate::types::ActionCategory, ///

    The creator of the action being called. There are three valid values for the Owner field in the action category section within your pipeline structure: AWS, ThirdParty, and Custom. For more information, see Valid Action Types and Providers in CodePipeline.

    @@ -42,6 +44,8 @@ impl ActionTypeId { ///

    Invoke

    ///
  • ///

    Approval

  • + ///
  • + ///

    Compute

  • /// pub fn category(&self) -> &crate::types::ActionCategory { &self.category @@ -92,6 +96,8 @@ impl ActionTypeIdBuilder { ///

    Invoke

    ///
  • ///

    Approval

  • + ///
  • + ///

    Compute

  • /// /// This field is required. pub fn category(mut self, input: crate::types::ActionCategory) -> Self { @@ -112,6 +118,8 @@ impl ActionTypeIdBuilder { ///

    Invoke

    ///
  • ///

    Approval

  • + ///
  • + ///

    Compute

  • /// pub fn set_category(mut self, input: ::std::option::Option) -> Self { self.category = input; @@ -131,6 +139,8 @@ impl ActionTypeIdBuilder { ///

    Invoke

    ///
  • ///

    Approval

  • + ///
  • + ///

    Compute

  • /// pub fn get_category(&self) -> &::std::option::Option { &self.category diff --git a/sdk/codepipeline/src/types/_condition.rs b/sdk/codepipeline/src/types/_condition.rs index da56ac6a8aba..1743938d8cec 100644 --- a/sdk/codepipeline/src/types/_condition.rs +++ b/sdk/codepipeline/src/types/_condition.rs @@ -1,6 +1,6 @@ // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -///

    The condition for the stage. A condition is made up of the rules and the result for the condition.

    +///

    The condition for the stage. A condition is made up of the rules and the result for the condition. For more information about conditions, see Stage conditions. For more information about rules, see the CodePipeline rule reference.

    #[non_exhaustive] #[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)] pub struct Condition { diff --git a/sdk/codepipeline/src/types/_rule_declaration.rs b/sdk/codepipeline/src/types/_rule_declaration.rs index 5311c235c0e8..a55f5fde9c42 100644 --- a/sdk/codepipeline/src/types/_rule_declaration.rs +++ b/sdk/codepipeline/src/types/_rule_declaration.rs @@ -1,15 +1,19 @@ // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -///

    Represents information about the rule to be created for an associated condition. An example would be creating a new rule for an entry condition, such as a rule that checks for a test result before allowing the run to enter the deployment stage.

    +///

    Represents information about the rule to be created for an associated condition. An example would be creating a new rule for an entry condition, such as a rule that checks for a test result before allowing the run to enter the deployment stage. For more information about conditions, see Stage conditions. For more information about rules, see the CodePipeline rule reference.

    #[non_exhaustive] #[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)] pub struct RuleDeclaration { - ///

    The name of the rule that is created for the condition, such as CheckAllResults.

    + ///

    The name of the rule that is created for the condition, such as VariableCheck.

    pub name: ::std::string::String, ///

    The ID for the rule type, which is made up of the combined values for category, owner, provider, and version.

    pub rule_type_id: ::std::option::Option, ///

    The action configuration fields for the rule.

    pub configuration: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>, + ///

    The shell commands to run with your commands rule in CodePipeline. All commands are supported except multi-line formats. While CodeBuild logs and permissions are used, you do not need to create any resources in CodeBuild.

    + ///

    Using compute time for this action will incur separate charges in CodeBuild.

    + ///
    + pub commands: ::std::option::Option<::std::vec::Vec<::std::string::String>>, ///

    The input artifacts fields for the rule, such as specifying an input file for the rule.

    pub input_artifacts: ::std::option::Option<::std::vec::Vec>, ///

    The pipeline role ARN associated with the rule.

    @@ -20,7 +24,7 @@ pub struct RuleDeclaration { pub timeout_in_minutes: ::std::option::Option, } impl RuleDeclaration { - ///

    The name of the rule that is created for the condition, such as CheckAllResults.

    + ///

    The name of the rule that is created for the condition, such as VariableCheck.

    pub fn name(&self) -> &str { use std::ops::Deref; self.name.deref() @@ -33,6 +37,14 @@ impl RuleDeclaration { pub fn configuration(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> { self.configuration.as_ref() } + ///

    The shell commands to run with your commands rule in CodePipeline. All commands are supported except multi-line formats. While CodeBuild logs and permissions are used, you do not need to create any resources in CodeBuild.

    + ///

    Using compute time for this action will incur separate charges in CodeBuild.

    + ///
    + /// + /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.commands.is_none()`. + pub fn commands(&self) -> &[::std::string::String] { + self.commands.as_deref().unwrap_or_default() + } ///

    The input artifacts fields for the rule, such as specifying an input file for the rule.

    /// /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.input_artifacts.is_none()`. @@ -66,24 +78,25 @@ pub struct RuleDeclarationBuilder { pub(crate) name: ::std::option::Option<::std::string::String>, pub(crate) rule_type_id: ::std::option::Option, pub(crate) configuration: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>, + pub(crate) commands: ::std::option::Option<::std::vec::Vec<::std::string::String>>, pub(crate) input_artifacts: ::std::option::Option<::std::vec::Vec>, pub(crate) role_arn: ::std::option::Option<::std::string::String>, pub(crate) region: ::std::option::Option<::std::string::String>, pub(crate) timeout_in_minutes: ::std::option::Option, } impl RuleDeclarationBuilder { - ///

    The name of the rule that is created for the condition, such as CheckAllResults.

    + ///

    The name of the rule that is created for the condition, such as VariableCheck.

    /// This field is required. pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { self.name = ::std::option::Option::Some(input.into()); self } - ///

    The name of the rule that is created for the condition, such as CheckAllResults.

    + ///

    The name of the rule that is created for the condition, such as VariableCheck.

    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self { self.name = input; self } - ///

    The name of the rule that is created for the condition, such as CheckAllResults.

    + ///

    The name of the rule that is created for the condition, such as VariableCheck.

    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> { &self.name } @@ -125,6 +138,32 @@ impl RuleDeclarationBuilder { pub fn get_configuration(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> { &self.configuration } + /// Appends an item to `commands`. + /// + /// To override the contents of this collection use [`set_commands`](Self::set_commands). + /// + ///

    The shell commands to run with your commands rule in CodePipeline. All commands are supported except multi-line formats. While CodeBuild logs and permissions are used, you do not need to create any resources in CodeBuild.

    + ///

    Using compute time for this action will incur separate charges in CodeBuild.

    + ///
    + pub fn commands(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + let mut v = self.commands.unwrap_or_default(); + v.push(input.into()); + self.commands = ::std::option::Option::Some(v); + self + } + ///

    The shell commands to run with your commands rule in CodePipeline. All commands are supported except multi-line formats. While CodeBuild logs and permissions are used, you do not need to create any resources in CodeBuild.

    + ///

    Using compute time for this action will incur separate charges in CodeBuild.

    + ///
    + pub fn set_commands(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self { + self.commands = input; + self + } + ///

    The shell commands to run with your commands rule in CodePipeline. All commands are supported except multi-line formats. While CodeBuild logs and permissions are used, you do not need to create any resources in CodeBuild.

    + ///

    Using compute time for this action will incur separate charges in CodeBuild.

    + ///
    + pub fn get_commands(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> { + &self.commands + } /// Appends an item to `input_artifacts`. /// /// To override the contents of this collection use [`set_input_artifacts`](Self::set_input_artifacts). @@ -200,6 +239,7 @@ impl RuleDeclarationBuilder { })?, rule_type_id: self.rule_type_id, configuration: self.configuration, + commands: self.commands, input_artifacts: self.input_artifacts, role_arn: self.role_arn, region: self.region, diff --git a/sdk/ecs/Cargo.toml b/sdk/ecs/Cargo.toml index 8a039371c25b..0337efa78cdf 100644 --- a/sdk/ecs/Cargo.toml +++ b/sdk/ecs/Cargo.toml @@ -1,7 +1,7 @@ # Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. [package] name = "aws-sdk-ecs" -version = "1.58.0" +version = "1.59.0" authors = ["AWS Rust SDK Team ", "Russell Cohen "] description = "AWS SDK for Amazon EC2 Container Service" edition = "2021" diff --git a/sdk/ecs/README.md b/sdk/ecs/README.md index 67ef655225df..77aa48a192e5 100644 --- a/sdk/ecs/README.md +++ b/sdk/ecs/README.md @@ -18,7 +18,7 @@ your project, add the following to your **Cargo.toml** file: ```toml [dependencies] aws-config = { version = "1.1.7", features = ["behavior-version-latest"] } -aws-sdk-ecs = "1.58.0" +aws-sdk-ecs = "1.59.0" tokio = { version = "1", features = ["full"] } ``` diff --git a/sdk/ecs/src/client/list_service_deployments.rs b/sdk/ecs/src/client/list_service_deployments.rs index 456f9a31aa77..f7b9ec312f0e 100644 --- a/sdk/ecs/src/client/list_service_deployments.rs +++ b/sdk/ecs/src/client/list_service_deployments.rs @@ -4,7 +4,7 @@ impl super::Client { /// /// - The fluent builder is configurable: /// - [`service(impl Into)`](crate::operation::list_service_deployments::builders::ListServiceDeploymentsFluentBuilder::service) / [`set_service(Option)`](crate::operation::list_service_deployments::builders::ListServiceDeploymentsFluentBuilder::set_service):
    required: **true**

    The ARN or name of the service


    - /// - [`cluster(impl Into)`](crate::operation::list_service_deployments::builders::ListServiceDeploymentsFluentBuilder::cluster) / [`set_cluster(Option)`](crate::operation::list_service_deployments::builders::ListServiceDeploymentsFluentBuilder::set_cluster):
    required: **false**

    The cluster that hosts the service. This can either be the cluster name or ARN. Starting April 15, 2023, Amazon Web Services will not onboard new customers to Amazon Elastic Inference (EI), and will help current customers migrate their workloads to options that offer better price and performanceIf you don't specify a cluster, default is used.


    + /// - [`cluster(impl Into)`](crate::operation::list_service_deployments::builders::ListServiceDeploymentsFluentBuilder::cluster) / [`set_cluster(Option)`](crate::operation::list_service_deployments::builders::ListServiceDeploymentsFluentBuilder::set_cluster):
    required: **false**

    The cluster that hosts the service. This can either be the cluster name or ARN. Starting April 15, 2023, Amazon Web Services will not onboard new customers to Amazon Elastic Inference (EI), and will help current customers migrate their workloads to options that offer better price and performance. If you don't specify a cluster, default is used.


    /// - [`status(ServiceDeploymentStatus)`](crate::operation::list_service_deployments::builders::ListServiceDeploymentsFluentBuilder::status) / [`set_status(Option>)`](crate::operation::list_service_deployments::builders::ListServiceDeploymentsFluentBuilder::set_status):
    required: **false**

    An optional filter you can use to narrow the results. If you do not specify a status, then all status values are included in the result.


    /// - [`created_at(CreatedAt)`](crate::operation::list_service_deployments::builders::ListServiceDeploymentsFluentBuilder::created_at) / [`set_created_at(Option)`](crate::operation::list_service_deployments::builders::ListServiceDeploymentsFluentBuilder::set_created_at):
    required: **false**

    An optional filter you can use to narrow the results by the service creation date. If you do not specify a value, the result includes all services created before the current time. The format is yyyy-MM-dd HH:mm:ss.SSSSSS.


    /// - [`next_token(impl Into)`](crate::operation::list_service_deployments::builders::ListServiceDeploymentsFluentBuilder::next_token) / [`set_next_token(Option)`](crate::operation::list_service_deployments::builders::ListServiceDeploymentsFluentBuilder::set_next_token):
    required: **false**

    The nextToken value returned from a ListServiceDeployments request indicating that more results are available to fulfill the request and further calls are needed. If you provided maxResults, it's possible the number of results is fewer than maxResults.


    diff --git a/sdk/ecs/src/client/register_task_definition.rs b/sdk/ecs/src/client/register_task_definition.rs index b0d306329d43..d53cb138570b 100644 --- a/sdk/ecs/src/client/register_task_definition.rs +++ b/sdk/ecs/src/client/register_task_definition.rs @@ -20,6 +20,7 @@ impl super::Client { /// - [`inference_accelerators(InferenceAccelerator)`](crate::operation::register_task_definition::builders::RegisterTaskDefinitionFluentBuilder::inference_accelerators) / [`set_inference_accelerators(Option>)`](crate::operation::register_task_definition::builders::RegisterTaskDefinitionFluentBuilder::set_inference_accelerators):
    required: **false**

    The Elastic Inference accelerators to use for the containers in the task.


    /// - [`ephemeral_storage(EphemeralStorage)`](crate::operation::register_task_definition::builders::RegisterTaskDefinitionFluentBuilder::ephemeral_storage) / [`set_ephemeral_storage(Option)`](crate::operation::register_task_definition::builders::RegisterTaskDefinitionFluentBuilder::set_ephemeral_storage):
    required: **false**

    The amount of ephemeral storage to allocate for the task. This parameter is used to expand the total amount of ephemeral storage available, beyond the default amount, for tasks hosted on Fargate. For more information, see Using data volumes in tasks in the Amazon ECS Developer Guide.

    For tasks using the Fargate launch type, the task requires the following platforms:

    • Linux platform version 1.4.0 or later.

    • Windows platform version 1.0.0 or later.


    /// - [`runtime_platform(RuntimePlatform)`](crate::operation::register_task_definition::builders::RegisterTaskDefinitionFluentBuilder::runtime_platform) / [`set_runtime_platform(Option)`](crate::operation::register_task_definition::builders::RegisterTaskDefinitionFluentBuilder::set_runtime_platform):
    required: **false**

    The operating system that your tasks definitions run on. A platform family is specified only for tasks using the Fargate launch type.


    + /// - [`enable_fault_injection(bool)`](crate::operation::register_task_definition::builders::RegisterTaskDefinitionFluentBuilder::enable_fault_injection) / [`set_enable_fault_injection(Option)`](crate::operation::register_task_definition::builders::RegisterTaskDefinitionFluentBuilder::set_enable_fault_injection):
    required: **false**

    Enables fault injection when you register your task definition and allows for fault injection requests to be accepted from the task's containers. The default value is false.


    /// - On success, responds with [`RegisterTaskDefinitionOutput`](crate::operation::register_task_definition::RegisterTaskDefinitionOutput) with field(s): /// - [`task_definition(Option)`](crate::operation::register_task_definition::RegisterTaskDefinitionOutput::task_definition):

    The full description of the registered task definition.

    /// - [`tags(Option>)`](crate::operation::register_task_definition::RegisterTaskDefinitionOutput::tags):

    The list of tags associated with the task definition.

    diff --git a/sdk/ecs/src/lib.rs b/sdk/ecs/src/lib.rs index 2aaa973e8774..941ecd8d8e2b 100644 --- a/sdk/ecs/src/lib.rs +++ b/sdk/ecs/src/lib.rs @@ -35,7 +35,7 @@ //! ```toml //! [dependencies] //! aws-config = { version = "1.1.7", features = ["behavior-version-latest"] } -//! aws-sdk-ecs = "1.58.0" +//! aws-sdk-ecs = "1.59.0" //! tokio = { version = "1", features = ["full"] } //! ``` //! diff --git a/sdk/ecs/src/operation/list_service_deployments/_list_service_deployments_input.rs b/sdk/ecs/src/operation/list_service_deployments/_list_service_deployments_input.rs index 85d752baaca3..0c635600476d 100644 --- a/sdk/ecs/src/operation/list_service_deployments/_list_service_deployments_input.rs +++ b/sdk/ecs/src/operation/list_service_deployments/_list_service_deployments_input.rs @@ -5,7 +5,7 @@ pub struct ListServiceDeploymentsInput { ///

    The ARN or name of the service

    pub service: ::std::option::Option<::std::string::String>, - ///

    The cluster that hosts the service. This can either be the cluster name or ARN. Starting April 15, 2023, Amazon Web Services will not onboard new customers to Amazon Elastic Inference (EI), and will help current customers migrate their workloads to options that offer better price and performanceIf you don't specify a cluster, default is used.

    + ///

    The cluster that hosts the service. This can either be the cluster name or ARN. Starting April 15, 2023, Amazon Web Services will not onboard new customers to Amazon Elastic Inference (EI), and will help current customers migrate their workloads to options that offer better price and performance. If you don't specify a cluster, default is used.

    pub cluster: ::std::option::Option<::std::string::String>, ///

    An optional filter you can use to narrow the results. If you do not specify a status, then all status values are included in the result.

    pub status: ::std::option::Option<::std::vec::Vec>, @@ -21,7 +21,7 @@ impl ListServiceDeploymentsInput { pub fn service(&self) -> ::std::option::Option<&str> { self.service.as_deref() } - ///

    The cluster that hosts the service. This can either be the cluster name or ARN. Starting April 15, 2023, Amazon Web Services will not onboard new customers to Amazon Elastic Inference (EI), and will help current customers migrate their workloads to options that offer better price and performanceIf you don't specify a cluster, default is used.

    + ///

    The cluster that hosts the service. This can either be the cluster name or ARN. Starting April 15, 2023, Amazon Web Services will not onboard new customers to Amazon Elastic Inference (EI), and will help current customers migrate their workloads to options that offer better price and performance. If you don't specify a cluster, default is used.

    pub fn cluster(&self) -> ::std::option::Option<&str> { self.cluster.as_deref() } @@ -78,17 +78,17 @@ impl ListServiceDeploymentsInputBuilder { pub fn get_service(&self) -> &::std::option::Option<::std::string::String> { &self.service } - ///

    The cluster that hosts the service. This can either be the cluster name or ARN. Starting April 15, 2023, Amazon Web Services will not onboard new customers to Amazon Elastic Inference (EI), and will help current customers migrate their workloads to options that offer better price and performanceIf you don't specify a cluster, default is used.

    + ///

    The cluster that hosts the service. This can either be the cluster name or ARN. Starting April 15, 2023, Amazon Web Services will not onboard new customers to Amazon Elastic Inference (EI), and will help current customers migrate their workloads to options that offer better price and performance. If you don't specify a cluster, default is used.

    pub fn cluster(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { self.cluster = ::std::option::Option::Some(input.into()); self } - ///

    The cluster that hosts the service. This can either be the cluster name or ARN. Starting April 15, 2023, Amazon Web Services will not onboard new customers to Amazon Elastic Inference (EI), and will help current customers migrate their workloads to options that offer better price and performanceIf you don't specify a cluster, default is used.

    + ///

    The cluster that hosts the service. This can either be the cluster name or ARN. Starting April 15, 2023, Amazon Web Services will not onboard new customers to Amazon Elastic Inference (EI), and will help current customers migrate their workloads to options that offer better price and performance. If you don't specify a cluster, default is used.

    pub fn set_cluster(mut self, input: ::std::option::Option<::std::string::String>) -> Self { self.cluster = input; self } - ///

    The cluster that hosts the service. This can either be the cluster name or ARN. Starting April 15, 2023, Amazon Web Services will not onboard new customers to Amazon Elastic Inference (EI), and will help current customers migrate their workloads to options that offer better price and performanceIf you don't specify a cluster, default is used.

    + ///

    The cluster that hosts the service. This can either be the cluster name or ARN. Starting April 15, 2023, Amazon Web Services will not onboard new customers to Amazon Elastic Inference (EI), and will help current customers migrate their workloads to options that offer better price and performance. If you don't specify a cluster, default is used.

    pub fn get_cluster(&self) -> &::std::option::Option<::std::string::String> { &self.cluster } diff --git a/sdk/ecs/src/operation/list_service_deployments/builders.rs b/sdk/ecs/src/operation/list_service_deployments/builders.rs index 2c3cb321de7e..818509ddf8c5 100644 --- a/sdk/ecs/src/operation/list_service_deployments/builders.rs +++ b/sdk/ecs/src/operation/list_service_deployments/builders.rs @@ -124,17 +124,17 @@ impl ListServiceDeploymentsFluentBuilder { pub fn get_service(&self) -> &::std::option::Option<::std::string::String> { self.inner.get_service() } - ///

    The cluster that hosts the service. This can either be the cluster name or ARN. Starting April 15, 2023, Amazon Web Services will not onboard new customers to Amazon Elastic Inference (EI), and will help current customers migrate their workloads to options that offer better price and performanceIf you don't specify a cluster, default is used.

    + ///

    The cluster that hosts the service. This can either be the cluster name or ARN. Starting April 15, 2023, Amazon Web Services will not onboard new customers to Amazon Elastic Inference (EI), and will help current customers migrate their workloads to options that offer better price and performance. If you don't specify a cluster, default is used.

    pub fn cluster(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { self.inner = self.inner.cluster(input.into()); self } - ///

    The cluster that hosts the service. This can either be the cluster name or ARN. Starting April 15, 2023, Amazon Web Services will not onboard new customers to Amazon Elastic Inference (EI), and will help current customers migrate their workloads to options that offer better price and performanceIf you don't specify a cluster, default is used.

    + ///

    The cluster that hosts the service. This can either be the cluster name or ARN. Starting April 15, 2023, Amazon Web Services will not onboard new customers to Amazon Elastic Inference (EI), and will help current customers migrate their workloads to options that offer better price and performance. If you don't specify a cluster, default is used.

    pub fn set_cluster(mut self, input: ::std::option::Option<::std::string::String>) -> Self { self.inner = self.inner.set_cluster(input); self } - ///

    The cluster that hosts the service. This can either be the cluster name or ARN. Starting April 15, 2023, Amazon Web Services will not onboard new customers to Amazon Elastic Inference (EI), and will help current customers migrate their workloads to options that offer better price and performanceIf you don't specify a cluster, default is used.

    + ///

    The cluster that hosts the service. This can either be the cluster name or ARN. Starting April 15, 2023, Amazon Web Services will not onboard new customers to Amazon Elastic Inference (EI), and will help current customers migrate their workloads to options that offer better price and performance. If you don't specify a cluster, default is used.

    pub fn get_cluster(&self) -> &::std::option::Option<::std::string::String> { self.inner.get_cluster() } diff --git a/sdk/ecs/src/operation/register_task_definition/_register_task_definition_input.rs b/sdk/ecs/src/operation/register_task_definition/_register_task_definition_input.rs index 0110fe44f56d..35bfad500feb 100644 --- a/sdk/ecs/src/operation/register_task_definition/_register_task_definition_input.rs +++ b/sdk/ecs/src/operation/register_task_definition/_register_task_definition_input.rs @@ -133,6 +133,8 @@ pub struct RegisterTaskDefinitionInput { pub ephemeral_storage: ::std::option::Option, ///

    The operating system that your tasks definitions run on. A platform family is specified only for tasks using the Fargate launch type.

    pub runtime_platform: ::std::option::Option, + ///

    Enables fault injection when you register your task definition and allows for fault injection requests to be accepted from the task's containers. The default value is false.

    + pub enable_fault_injection: ::std::option::Option, } impl RegisterTaskDefinitionInput { ///

    You must specify a family for a task definition. You can use it track multiple versions of the same task definition. The family is used as a name for your task definition. Up to 255 letters (uppercase and lowercase), numbers, underscores, and hyphens are allowed.

    @@ -311,6 +313,10 @@ impl RegisterTaskDefinitionInput { pub fn runtime_platform(&self) -> ::std::option::Option<&crate::types::RuntimePlatform> { self.runtime_platform.as_ref() } + ///

    Enables fault injection when you register your task definition and allows for fault injection requests to be accepted from the task's containers. The default value is false.

    + pub fn enable_fault_injection(&self) -> ::std::option::Option { + self.enable_fault_injection + } } impl RegisterTaskDefinitionInput { /// Creates a new builder-style object to manufacture [`RegisterTaskDefinitionInput`](crate::operation::register_task_definition::RegisterTaskDefinitionInput). @@ -340,6 +346,7 @@ pub struct RegisterTaskDefinitionInputBuilder { pub(crate) inference_accelerators: ::std::option::Option<::std::vec::Vec>, pub(crate) ephemeral_storage: ::std::option::Option, pub(crate) runtime_platform: ::std::option::Option, + pub(crate) enable_fault_injection: ::std::option::Option, } impl RegisterTaskDefinitionInputBuilder { ///

    You must specify a family for a task definition. You can use it track multiple versions of the same task definition. The family is used as a name for your task definition. Up to 255 letters (uppercase and lowercase), numbers, underscores, and hyphens are allowed.

    @@ -908,6 +915,20 @@ impl RegisterTaskDefinitionInputBuilder { pub fn get_runtime_platform(&self) -> &::std::option::Option { &self.runtime_platform } + ///

    Enables fault injection when you register your task definition and allows for fault injection requests to be accepted from the task's containers. The default value is false.

    + pub fn enable_fault_injection(mut self, input: bool) -> Self { + self.enable_fault_injection = ::std::option::Option::Some(input); + self + } + ///

    Enables fault injection when you register your task definition and allows for fault injection requests to be accepted from the task's containers. The default value is false.

    + pub fn set_enable_fault_injection(mut self, input: ::std::option::Option) -> Self { + self.enable_fault_injection = input; + self + } + ///

    Enables fault injection when you register your task definition and allows for fault injection requests to be accepted from the task's containers. The default value is false.

    + pub fn get_enable_fault_injection(&self) -> &::std::option::Option { + &self.enable_fault_injection + } /// Consumes the builder and constructs a [`RegisterTaskDefinitionInput`](crate::operation::register_task_definition::RegisterTaskDefinitionInput). pub fn build( self, @@ -933,6 +954,7 @@ impl RegisterTaskDefinitionInputBuilder { inference_accelerators: self.inference_accelerators, ephemeral_storage: self.ephemeral_storage, runtime_platform: self.runtime_platform, + enable_fault_injection: self.enable_fault_injection, }) } } diff --git a/sdk/ecs/src/operation/register_task_definition/builders.rs b/sdk/ecs/src/operation/register_task_definition/builders.rs index 84a0ede8dc70..931197a815ec 100644 --- a/sdk/ecs/src/operation/register_task_definition/builders.rs +++ b/sdk/ecs/src/operation/register_task_definition/builders.rs @@ -669,4 +669,18 @@ impl RegisterTaskDefinitionFluentBuilder { pub fn get_runtime_platform(&self) -> &::std::option::Option { self.inner.get_runtime_platform() } + ///

    Enables fault injection when you register your task definition and allows for fault injection requests to be accepted from the task's containers. The default value is false.

    + pub fn enable_fault_injection(mut self, input: bool) -> Self { + self.inner = self.inner.enable_fault_injection(input); + self + } + ///

    Enables fault injection when you register your task definition and allows for fault injection requests to be accepted from the task's containers. The default value is false.

    + pub fn set_enable_fault_injection(mut self, input: ::std::option::Option) -> Self { + self.inner = self.inner.set_enable_fault_injection(input); + self + } + ///

    Enables fault injection when you register your task definition and allows for fault injection requests to be accepted from the task's containers. The default value is false.

    + pub fn get_enable_fault_injection(&self) -> &::std::option::Option { + self.inner.get_enable_fault_injection() + } } diff --git a/sdk/ecs/src/protocol_serde/shape_register_task_definition_input.rs b/sdk/ecs/src/protocol_serde/shape_register_task_definition_input.rs index be146289e398..8671f2913676 100644 --- a/sdk/ecs/src/protocol_serde/shape_register_task_definition_input.rs +++ b/sdk/ecs/src/protocol_serde/shape_register_task_definition_input.rs @@ -114,5 +114,8 @@ pub fn ser_register_task_definition_input_input( crate::protocol_serde::shape_runtime_platform::ser_runtime_platform(&mut object_37, var_36)?; object_37.finish(); } + if let Some(var_38) = &input.enable_fault_injection { + object.key("enableFaultInjection").boolean(*var_38); + } Ok(()) } diff --git a/sdk/ecs/src/protocol_serde/shape_task_definition.rs b/sdk/ecs/src/protocol_serde/shape_task_definition.rs index 7aeb793b5b04..e0eda4683174 100644 --- a/sdk/ecs/src/protocol_serde/shape_task_definition.rs +++ b/sdk/ecs/src/protocol_serde/shape_task_definition.rs @@ -147,6 +147,9 @@ where "ephemeralStorage" => { builder = builder.set_ephemeral_storage(crate::protocol_serde::shape_ephemeral_storage::de_ephemeral_storage(tokens)?); } + "enableFaultInjection" => { + builder = builder.set_enable_fault_injection(::aws_smithy_json::deserialize::token::expect_bool_or_null(tokens.next())?); + } _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?, }, other => { diff --git a/sdk/ecs/src/types/_deployment_configuration.rs b/sdk/ecs/src/types/_deployment_configuration.rs index f36eda6f2027..51d14cead74c 100644 --- a/sdk/ecs/src/types/_deployment_configuration.rs +++ b/sdk/ecs/src/types/_deployment_configuration.rs @@ -14,7 +14,7 @@ pub struct DeploymentConfiguration { ///

    If a service is using either the blue/green (CODE_DEPLOY) or EXTERNAL deployment types, and tasks in the service use the EC2 launch type, the maximum percent value is set to the default value. The maximum percent value is used to define the upper limit on the number of the tasks in the service that remain in the RUNNING state while the container instances are in the DRAINING state.

    ///

    You can't specify a custom maximumPercent value for a service that uses either the blue/green (CODE_DEPLOY) or EXTERNAL deployment types and has tasks that use the EC2 launch type.

    ///
    - ///

    If the tasks in the service use the Fargate launch type, the maximum percent value is not used, although it is returned when describing your service.

    + ///

    If the service uses either the blue/green (CODE_DEPLOY) or EXTERNAL deployment types, and the tasks in the service use the Fargate launch type, the maximum percent value is not used. The value is still returned when describing your service.

    pub maximum_percent: ::std::option::Option, ///

    If a service is using the rolling update (ECS) deployment type, the minimumHealthyPercent represents a lower limit on the number of your service's tasks that must remain in the RUNNING state during a deployment, as a percentage of the desiredCount (rounded up to the nearest integer). This parameter enables you to deploy without using additional cluster capacity. For example, if your service has a desiredCount of four tasks and a minimumHealthyPercent of 50%, the service scheduler may stop two existing tasks to free up cluster capacity before starting two new tasks.

    ///

    If any tasks are unhealthy and if maximumPercent doesn't allow the Amazon ECS scheduler to start replacement tasks, the scheduler stops the unhealthy tasks one-by-one — using the minimumHealthyPercent as a constraint — to clear up capacity to launch replacement tasks. For more information about how the scheduler replaces unhealthy tasks, see Amazon ECS services .

    @@ -57,7 +57,7 @@ impl DeploymentConfiguration { ///

    If a service is using either the blue/green (CODE_DEPLOY) or EXTERNAL deployment types, and tasks in the service use the EC2 launch type, the maximum percent value is set to the default value. The maximum percent value is used to define the upper limit on the number of the tasks in the service that remain in the RUNNING state while the container instances are in the DRAINING state.

    ///

    You can't specify a custom maximumPercent value for a service that uses either the blue/green (CODE_DEPLOY) or EXTERNAL deployment types and has tasks that use the EC2 launch type.

    ///
    - ///

    If the tasks in the service use the Fargate launch type, the maximum percent value is not used, although it is returned when describing your service.

    + ///

    If the service uses either the blue/green (CODE_DEPLOY) or EXTERNAL deployment types, and the tasks in the service use the Fargate launch type, the maximum percent value is not used. The value is still returned when describing your service.

    pub fn maximum_percent(&self) -> ::std::option::Option { self.maximum_percent } @@ -138,7 +138,7 @@ impl DeploymentConfigurationBuilder { ///

    If a service is using either the blue/green (CODE_DEPLOY) or EXTERNAL deployment types, and tasks in the service use the EC2 launch type, the maximum percent value is set to the default value. The maximum percent value is used to define the upper limit on the number of the tasks in the service that remain in the RUNNING state while the container instances are in the DRAINING state.

    ///

    You can't specify a custom maximumPercent value for a service that uses either the blue/green (CODE_DEPLOY) or EXTERNAL deployment types and has tasks that use the EC2 launch type.

    ///
    - ///

    If the tasks in the service use the Fargate launch type, the maximum percent value is not used, although it is returned when describing your service.

    + ///

    If the service uses either the blue/green (CODE_DEPLOY) or EXTERNAL deployment types, and the tasks in the service use the Fargate launch type, the maximum percent value is not used. The value is still returned when describing your service.

    pub fn maximum_percent(mut self, input: i32) -> Self { self.maximum_percent = ::std::option::Option::Some(input); self @@ -148,7 +148,7 @@ impl DeploymentConfigurationBuilder { ///

    If a service is using either the blue/green (CODE_DEPLOY) or EXTERNAL deployment types, and tasks in the service use the EC2 launch type, the maximum percent value is set to the default value. The maximum percent value is used to define the upper limit on the number of the tasks in the service that remain in the RUNNING state while the container instances are in the DRAINING state.

    ///

    You can't specify a custom maximumPercent value for a service that uses either the blue/green (CODE_DEPLOY) or EXTERNAL deployment types and has tasks that use the EC2 launch type.

    ///
    - ///

    If the tasks in the service use the Fargate launch type, the maximum percent value is not used, although it is returned when describing your service.

    + ///

    If the service uses either the blue/green (CODE_DEPLOY) or EXTERNAL deployment types, and the tasks in the service use the Fargate launch type, the maximum percent value is not used. The value is still returned when describing your service.

    pub fn set_maximum_percent(mut self, input: ::std::option::Option) -> Self { self.maximum_percent = input; self @@ -158,7 +158,7 @@ impl DeploymentConfigurationBuilder { ///

    If a service is using either the blue/green (CODE_DEPLOY) or EXTERNAL deployment types, and tasks in the service use the EC2 launch type, the maximum percent value is set to the default value. The maximum percent value is used to define the upper limit on the number of the tasks in the service that remain in the RUNNING state while the container instances are in the DRAINING state.

    ///

    You can't specify a custom maximumPercent value for a service that uses either the blue/green (CODE_DEPLOY) or EXTERNAL deployment types and has tasks that use the EC2 launch type.

    ///
    - ///

    If the tasks in the service use the Fargate launch type, the maximum percent value is not used, although it is returned when describing your service.

    + ///

    If the service uses either the blue/green (CODE_DEPLOY) or EXTERNAL deployment types, and the tasks in the service use the Fargate launch type, the maximum percent value is not used. The value is still returned when describing your service.

    pub fn get_maximum_percent(&self) -> &::std::option::Option { &self.maximum_percent } diff --git a/sdk/ecs/src/types/_log_configuration.rs b/sdk/ecs/src/types/_log_configuration.rs index 8e8c85c34d37..d012ea321b83 100644 --- a/sdk/ecs/src/types/_log_configuration.rs +++ b/sdk/ecs/src/types/_log_configuration.rs @@ -109,7 +109,7 @@ pub struct LogConfiguration { ///

    When you use the awsfirelens log router to route logs to an Amazon Web Services Service or Amazon Web Services Partner Network destination for log storage and analytics, you can set the log-driver-buffer-limit option to limit the number of events that are buffered in memory, before being sent to the log router container. It can help to resolve potential log loss issue because high throughput might result in memory running out for the buffer inside of Docker.

    ///

    Other options you can specify when using awsfirelens to route logs depend on the destination. When you export logs to Amazon Data Firehose, you can specify the Amazon Web Services Region with region and a name for the log stream with delivery_stream.

    ///

    When you export logs to Amazon Kinesis Data Streams, you can specify an Amazon Web Services Region with region and a data stream name with stream.

    - ///

    When you export logs to Amazon OpenSearch Service, you can specify options like Name, Host (OpenSearch Service endpoint without protocol), Port, Index, Type, Aws_auth, Aws_region, Suppress_Type_Name, and tls.

    + ///

    When you export logs to Amazon OpenSearch Service, you can specify options like Name, Host (OpenSearch Service endpoint without protocol), Port, Index, Type, Aws_auth, Aws_region, Suppress_Type_Name, and tls. For more information, see Under the hood: FireLens for Amazon ECS Tasks.

    ///

    When you export logs to Amazon S3, you can specify the bucket using the bucket option. You can also specify region, total_file_size, upload_timeout, and use_put_object as options.

    ///

    This parameter requires version 1.19 of the Docker Remote API or greater on your container instance. To check the Docker Remote API version on your container instance, log in to your container instance and run the following command: sudo docker version --format '{{.Server.APIVersion}}'

    pub options: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>, @@ -210,7 +210,7 @@ impl LogConfiguration { ///

    When you use the awsfirelens log router to route logs to an Amazon Web Services Service or Amazon Web Services Partner Network destination for log storage and analytics, you can set the log-driver-buffer-limit option to limit the number of events that are buffered in memory, before being sent to the log router container. It can help to resolve potential log loss issue because high throughput might result in memory running out for the buffer inside of Docker.

    ///

    Other options you can specify when using awsfirelens to route logs depend on the destination. When you export logs to Amazon Data Firehose, you can specify the Amazon Web Services Region with region and a name for the log stream with delivery_stream.

    ///

    When you export logs to Amazon Kinesis Data Streams, you can specify an Amazon Web Services Region with region and a data stream name with stream.

    - ///

    When you export logs to Amazon OpenSearch Service, you can specify options like Name, Host (OpenSearch Service endpoint without protocol), Port, Index, Type, Aws_auth, Aws_region, Suppress_Type_Name, and tls.

    + ///

    When you export logs to Amazon OpenSearch Service, you can specify options like Name, Host (OpenSearch Service endpoint without protocol), Port, Index, Type, Aws_auth, Aws_region, Suppress_Type_Name, and tls. For more information, see Under the hood: FireLens for Amazon ECS Tasks.

    ///

    When you export logs to Amazon S3, you can specify the bucket using the bucket option. You can also specify region, total_file_size, upload_timeout, and use_put_object as options.

    ///

    This parameter requires version 1.19 of the Docker Remote API or greater on your container instance. To check the Docker Remote API version on your container instance, log in to your container instance and run the following command: sudo docker version --format '{{.Server.APIVersion}}'

    pub fn options(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> { @@ -359,7 +359,7 @@ impl LogConfigurationBuilder { ///

    When you use the awsfirelens log router to route logs to an Amazon Web Services Service or Amazon Web Services Partner Network destination for log storage and analytics, you can set the log-driver-buffer-limit option to limit the number of events that are buffered in memory, before being sent to the log router container. It can help to resolve potential log loss issue because high throughput might result in memory running out for the buffer inside of Docker.

    ///

    Other options you can specify when using awsfirelens to route logs depend on the destination. When you export logs to Amazon Data Firehose, you can specify the Amazon Web Services Region with region and a name for the log stream with delivery_stream.

    ///

    When you export logs to Amazon Kinesis Data Streams, you can specify an Amazon Web Services Region with region and a data stream name with stream.

    - ///

    When you export logs to Amazon OpenSearch Service, you can specify options like Name, Host (OpenSearch Service endpoint without protocol), Port, Index, Type, Aws_auth, Aws_region, Suppress_Type_Name, and tls.

    + ///

    When you export logs to Amazon OpenSearch Service, you can specify options like Name, Host (OpenSearch Service endpoint without protocol), Port, Index, Type, Aws_auth, Aws_region, Suppress_Type_Name, and tls. For more information, see Under the hood: FireLens for Amazon ECS Tasks.

    ///

    When you export logs to Amazon S3, you can specify the bucket using the bucket option. You can also specify region, total_file_size, upload_timeout, and use_put_object as options.

    ///

    This parameter requires version 1.19 of the Docker Remote API or greater on your container instance. To check the Docker Remote API version on your container instance, log in to your container instance and run the following command: sudo docker version --format '{{.Server.APIVersion}}'

    pub fn options(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self { @@ -451,7 +451,7 @@ impl LogConfigurationBuilder { ///

    When you use the awsfirelens log router to route logs to an Amazon Web Services Service or Amazon Web Services Partner Network destination for log storage and analytics, you can set the log-driver-buffer-limit option to limit the number of events that are buffered in memory, before being sent to the log router container. It can help to resolve potential log loss issue because high throughput might result in memory running out for the buffer inside of Docker.

    ///

    Other options you can specify when using awsfirelens to route logs depend on the destination. When you export logs to Amazon Data Firehose, you can specify the Amazon Web Services Region with region and a name for the log stream with delivery_stream.

    ///

    When you export logs to Amazon Kinesis Data Streams, you can specify an Amazon Web Services Region with region and a data stream name with stream.

    - ///

    When you export logs to Amazon OpenSearch Service, you can specify options like Name, Host (OpenSearch Service endpoint without protocol), Port, Index, Type, Aws_auth, Aws_region, Suppress_Type_Name, and tls.

    + ///

    When you export logs to Amazon OpenSearch Service, you can specify options like Name, Host (OpenSearch Service endpoint without protocol), Port, Index, Type, Aws_auth, Aws_region, Suppress_Type_Name, and tls. For more information, see Under the hood: FireLens for Amazon ECS Tasks.

    ///

    When you export logs to Amazon S3, you can specify the bucket using the bucket option. You can also specify region, total_file_size, upload_timeout, and use_put_object as options.

    ///

    This parameter requires version 1.19 of the Docker Remote API or greater on your container instance. To check the Docker Remote API version on your container instance, log in to your container instance and run the following command: sudo docker version --format '{{.Server.APIVersion}}'

    pub fn set_options(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self { @@ -541,7 +541,7 @@ impl LogConfigurationBuilder { ///

    When you use the awsfirelens log router to route logs to an Amazon Web Services Service or Amazon Web Services Partner Network destination for log storage and analytics, you can set the log-driver-buffer-limit option to limit the number of events that are buffered in memory, before being sent to the log router container. It can help to resolve potential log loss issue because high throughput might result in memory running out for the buffer inside of Docker.

    ///

    Other options you can specify when using awsfirelens to route logs depend on the destination. When you export logs to Amazon Data Firehose, you can specify the Amazon Web Services Region with region and a name for the log stream with delivery_stream.

    ///

    When you export logs to Amazon Kinesis Data Streams, you can specify an Amazon Web Services Region with region and a data stream name with stream.

    - ///

    When you export logs to Amazon OpenSearch Service, you can specify options like Name, Host (OpenSearch Service endpoint without protocol), Port, Index, Type, Aws_auth, Aws_region, Suppress_Type_Name, and tls.

    + ///

    When you export logs to Amazon OpenSearch Service, you can specify options like Name, Host (OpenSearch Service endpoint without protocol), Port, Index, Type, Aws_auth, Aws_region, Suppress_Type_Name, and tls. For more information, see Under the hood: FireLens for Amazon ECS Tasks.

    ///

    When you export logs to Amazon S3, you can specify the bucket using the bucket option. You can also specify region, total_file_size, upload_timeout, and use_put_object as options.

    ///

    This parameter requires version 1.19 of the Docker Remote API or greater on your container instance. To check the Docker Remote API version on your container instance, log in to your container instance and run the following command: sudo docker version --format '{{.Server.APIVersion}}'

    pub fn get_options(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> { diff --git a/sdk/ecs/src/types/_task_definition.rs b/sdk/ecs/src/types/_task_definition.rs index 7bcc989140c2..8f5fc6c8a789 100644 --- a/sdk/ecs/src/types/_task_definition.rs +++ b/sdk/ecs/src/types/_task_definition.rs @@ -125,6 +125,8 @@ pub struct TaskDefinition { pub registered_by: ::std::option::Option<::std::string::String>, ///

    The ephemeral storage settings to use for tasks run with the task definition.

    pub ephemeral_storage: ::std::option::Option, + ///

    Enables fault injection and allows for fault injection requests to be accepted from the task's containers. The default value is false.

    + pub enable_fault_injection: ::std::option::Option, } impl TaskDefinition { ///

    The full Amazon Resource Name (ARN) of the task definition.

    @@ -310,6 +312,10 @@ impl TaskDefinition { pub fn ephemeral_storage(&self) -> ::std::option::Option<&crate::types::EphemeralStorage> { self.ephemeral_storage.as_ref() } + ///

    Enables fault injection and allows for fault injection requests to be accepted from the task's containers. The default value is false.

    + pub fn enable_fault_injection(&self) -> ::std::option::Option { + self.enable_fault_injection + } } impl TaskDefinition { /// Creates a new builder-style object to manufacture [`TaskDefinition`](crate::types::TaskDefinition). @@ -346,6 +352,7 @@ pub struct TaskDefinitionBuilder { pub(crate) deregistered_at: ::std::option::Option<::aws_smithy_types::DateTime>, pub(crate) registered_by: ::std::option::Option<::std::string::String>, pub(crate) ephemeral_storage: ::std::option::Option, + pub(crate) enable_fault_injection: ::std::option::Option, } impl TaskDefinitionBuilder { ///

    The full Amazon Resource Name (ARN) of the task definition.

    @@ -948,6 +955,20 @@ impl TaskDefinitionBuilder { pub fn get_ephemeral_storage(&self) -> &::std::option::Option { &self.ephemeral_storage } + ///

    Enables fault injection and allows for fault injection requests to be accepted from the task's containers. The default value is false.

    + pub fn enable_fault_injection(mut self, input: bool) -> Self { + self.enable_fault_injection = ::std::option::Option::Some(input); + self + } + ///

    Enables fault injection and allows for fault injection requests to be accepted from the task's containers. The default value is false.

    + pub fn set_enable_fault_injection(mut self, input: ::std::option::Option) -> Self { + self.enable_fault_injection = input; + self + } + ///

    Enables fault injection and allows for fault injection requests to be accepted from the task's containers. The default value is false.

    + pub fn get_enable_fault_injection(&self) -> &::std::option::Option { + &self.enable_fault_injection + } /// Consumes the builder and constructs a [`TaskDefinition`](crate::types::TaskDefinition). pub fn build(self) -> crate::types::TaskDefinition { crate::types::TaskDefinition { @@ -975,6 +996,7 @@ impl TaskDefinitionBuilder { deregistered_at: self.deregistered_at, registered_by: self.registered_by, ephemeral_storage: self.ephemeral_storage, + enable_fault_injection: self.enable_fault_injection, } } } diff --git a/sdk/m2/Cargo.toml b/sdk/m2/Cargo.toml index dbb61069d0b7..4a98912a7a8a 100644 --- a/sdk/m2/Cargo.toml +++ b/sdk/m2/Cargo.toml @@ -1,7 +1,7 @@ # Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. [package] name = "aws-sdk-m2" -version = "1.53.0" +version = "1.54.0" authors = ["AWS Rust SDK Team ", "Russell Cohen "] description = "AWS SDK for AWSMainframeModernization" edition = "2021" diff --git a/sdk/m2/README.md b/sdk/m2/README.md index 3ac27d3a21f0..2afbadacca28 100644 --- a/sdk/m2/README.md +++ b/sdk/m2/README.md @@ -14,7 +14,7 @@ your project, add the following to your **Cargo.toml** file: ```toml [dependencies] aws-config = { version = "1.1.7", features = ["behavior-version-latest"] } -aws-sdk-m2 = "1.53.0" +aws-sdk-m2 = "1.54.0" tokio = { version = "1", features = ["full"] } ``` diff --git a/sdk/m2/src/client/create_environment.rs b/sdk/m2/src/client/create_environment.rs index 876717956217..c623402bf103 100644 --- a/sdk/m2/src/client/create_environment.rs +++ b/sdk/m2/src/client/create_environment.rs @@ -15,6 +15,7 @@ impl super::Client { /// - [`high_availability_config(HighAvailabilityConfig)`](crate::operation::create_environment::builders::CreateEnvironmentFluentBuilder::high_availability_config) / [`set_high_availability_config(Option)`](crate::operation::create_environment::builders::CreateEnvironmentFluentBuilder::set_high_availability_config):
    required: **false**

    The details of a high availability configuration for this runtime environment.


    /// - [`tags(impl Into, impl Into)`](crate::operation::create_environment::builders::CreateEnvironmentFluentBuilder::tags) / [`set_tags(Option>)`](crate::operation::create_environment::builders::CreateEnvironmentFluentBuilder::set_tags):
    required: **false**

    The tags for the runtime environment.


    /// - [`preferred_maintenance_window(impl Into)`](crate::operation::create_environment::builders::CreateEnvironmentFluentBuilder::preferred_maintenance_window) / [`set_preferred_maintenance_window(Option)`](crate::operation::create_environment::builders::CreateEnvironmentFluentBuilder::set_preferred_maintenance_window):
    required: **false**

    Configures the maintenance window that you want for the runtime environment. The maintenance window must have the format ddd:hh24:mi-ddd:hh24:mi and must be less than 24 hours. The following two examples are valid maintenance windows: sun:23:45-mon:00:15 or sat:01:00-sat:03:00.

    If you do not provide a value, a random system-generated value will be assigned.


    + /// - [`network_type(NetworkType)`](crate::operation::create_environment::builders::CreateEnvironmentFluentBuilder::network_type) / [`set_network_type(Option)`](crate::operation::create_environment::builders::CreateEnvironmentFluentBuilder::set_network_type):
    required: **false**

    The network type required for the runtime environment.


    /// - [`client_token(impl Into)`](crate::operation::create_environment::builders::CreateEnvironmentFluentBuilder::client_token) / [`set_client_token(Option)`](crate::operation::create_environment::builders::CreateEnvironmentFluentBuilder::set_client_token):
    required: **false**

    Unique, case-sensitive identifier you provide to ensure the idempotency of the request to create an environment. The service generates the clientToken when the API call is triggered. The token expires after one hour, so if you retry the API within this timeframe with the same clientToken, you will get the same response. The service also handles deleting the clientToken after it expires.


    /// - [`kms_key_id(impl Into)`](crate::operation::create_environment::builders::CreateEnvironmentFluentBuilder::kms_key_id) / [`set_kms_key_id(Option)`](crate::operation::create_environment::builders::CreateEnvironmentFluentBuilder::set_kms_key_id):
    required: **false**

    The identifier of a customer managed key.


    /// - On success, responds with [`CreateEnvironmentOutput`](crate::operation::create_environment::CreateEnvironmentOutput) with field(s): diff --git a/sdk/m2/src/client/get_environment.rs b/sdk/m2/src/client/get_environment.rs index 768c29dc3787..9ffa32cd3f90 100644 --- a/sdk/m2/src/client/get_environment.rs +++ b/sdk/m2/src/client/get_environment.rs @@ -27,6 +27,7 @@ impl super::Client { /// - [`preferred_maintenance_window(Option)`](crate::operation::get_environment::GetEnvironmentOutput::preferred_maintenance_window):

    The maintenance window for the runtime environment. If you don't provide a value for the maintenance window, the service assigns a random value.

    /// - [`pending_maintenance(Option)`](crate::operation::get_environment::GetEnvironmentOutput::pending_maintenance):

    Indicates the pending maintenance scheduled on this environment.

    /// - [`kms_key_id(Option)`](crate::operation::get_environment::GetEnvironmentOutput::kms_key_id):

    The identifier of a customer managed key.

    + /// - [`network_type(Option)`](crate::operation::get_environment::GetEnvironmentOutput::network_type):

    The network type supported by the runtime environment.

    /// - On failure, responds with [`SdkError`](crate::operation::get_environment::GetEnvironmentError) pub fn get_environment(&self) -> crate::operation::get_environment::builders::GetEnvironmentFluentBuilder { crate::operation::get_environment::builders::GetEnvironmentFluentBuilder::new(self.handle.clone()) diff --git a/sdk/m2/src/lib.rs b/sdk/m2/src/lib.rs index 223ae354d5e7..fd94b9f737d7 100644 --- a/sdk/m2/src/lib.rs +++ b/sdk/m2/src/lib.rs @@ -31,7 +31,7 @@ //! ```toml //! [dependencies] //! aws-config = { version = "1.1.7", features = ["behavior-version-latest"] } -//! aws-sdk-m2 = "1.53.0" +//! aws-sdk-m2 = "1.54.0" //! tokio = { version = "1", features = ["full"] } //! ``` //! diff --git a/sdk/m2/src/operation/create_environment/_create_environment_input.rs b/sdk/m2/src/operation/create_environment/_create_environment_input.rs index e87a9907ab1b..9fabe01e0c49 100644 --- a/sdk/m2/src/operation/create_environment/_create_environment_input.rs +++ b/sdk/m2/src/operation/create_environment/_create_environment_input.rs @@ -28,6 +28,8 @@ pub struct CreateEnvironmentInput { ///

    Configures the maintenance window that you want for the runtime environment. The maintenance window must have the format ddd:hh24:mi-ddd:hh24:mi and must be less than 24 hours. The following two examples are valid maintenance windows: sun:23:45-mon:00:15 or sat:01:00-sat:03:00.

    ///

    If you do not provide a value, a random system-generated value will be assigned.

    pub preferred_maintenance_window: ::std::option::Option<::std::string::String>, + ///

    The network type required for the runtime environment.

    + pub network_type: ::std::option::Option, ///

    Unique, case-sensitive identifier you provide to ensure the idempotency of the request to create an environment. The service generates the clientToken when the API call is triggered. The token expires after one hour, so if you retry the API within this timeframe with the same clientToken, you will get the same response. The service also handles deleting the clientToken after it expires.

    pub client_token: ::std::option::Option<::std::string::String>, ///

    The identifier of a customer managed key.

    @@ -89,6 +91,10 @@ impl CreateEnvironmentInput { pub fn preferred_maintenance_window(&self) -> ::std::option::Option<&str> { self.preferred_maintenance_window.as_deref() } + ///

    The network type required for the runtime environment.

    + pub fn network_type(&self) -> ::std::option::Option<&crate::types::NetworkType> { + self.network_type.as_ref() + } ///

    Unique, case-sensitive identifier you provide to ensure the idempotency of the request to create an environment. The service generates the clientToken when the API call is triggered. The token expires after one hour, so if you retry the API within this timeframe with the same clientToken, you will get the same response. The service also handles deleting the clientToken after it expires.

    pub fn client_token(&self) -> ::std::option::Option<&str> { self.client_token.as_deref() @@ -121,6 +127,7 @@ pub struct CreateEnvironmentInputBuilder { pub(crate) high_availability_config: ::std::option::Option, pub(crate) tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>, pub(crate) preferred_maintenance_window: ::std::option::Option<::std::string::String>, + pub(crate) network_type: ::std::option::Option, pub(crate) client_token: ::std::option::Option<::std::string::String>, pub(crate) kms_key_id: ::std::option::Option<::std::string::String>, } @@ -323,6 +330,20 @@ impl CreateEnvironmentInputBuilder { pub fn get_preferred_maintenance_window(&self) -> &::std::option::Option<::std::string::String> { &self.preferred_maintenance_window } + ///

    The network type required for the runtime environment.

    + pub fn network_type(mut self, input: crate::types::NetworkType) -> Self { + self.network_type = ::std::option::Option::Some(input); + self + } + ///

    The network type required for the runtime environment.

    + pub fn set_network_type(mut self, input: ::std::option::Option) -> Self { + self.network_type = input; + self + } + ///

    The network type required for the runtime environment.

    + pub fn get_network_type(&self) -> &::std::option::Option { + &self.network_type + } ///

    Unique, case-sensitive identifier you provide to ensure the idempotency of the request to create an environment. The service generates the clientToken when the API call is triggered. The token expires after one hour, so if you retry the API within this timeframe with the same clientToken, you will get the same response. The service also handles deleting the clientToken after it expires.

    pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { self.client_token = ::std::option::Option::Some(input.into()); @@ -368,6 +389,7 @@ impl CreateEnvironmentInputBuilder { high_availability_config: self.high_availability_config, tags: self.tags, preferred_maintenance_window: self.preferred_maintenance_window, + network_type: self.network_type, client_token: self.client_token, kms_key_id: self.kms_key_id, }) diff --git a/sdk/m2/src/operation/create_environment/builders.rs b/sdk/m2/src/operation/create_environment/builders.rs index 87c8021780a1..dcdbfc2a6a05 100644 --- a/sdk/m2/src/operation/create_environment/builders.rs +++ b/sdk/m2/src/operation/create_environment/builders.rs @@ -299,6 +299,20 @@ impl CreateEnvironmentFluentBuilder { pub fn get_preferred_maintenance_window(&self) -> &::std::option::Option<::std::string::String> { self.inner.get_preferred_maintenance_window() } + ///

    The network type required for the runtime environment.

    + pub fn network_type(mut self, input: crate::types::NetworkType) -> Self { + self.inner = self.inner.network_type(input); + self + } + ///

    The network type required for the runtime environment.

    + pub fn set_network_type(mut self, input: ::std::option::Option) -> Self { + self.inner = self.inner.set_network_type(input); + self + } + ///

    The network type required for the runtime environment.

    + pub fn get_network_type(&self) -> &::std::option::Option { + self.inner.get_network_type() + } ///

    Unique, case-sensitive identifier you provide to ensure the idempotency of the request to create an environment. The service generates the clientToken when the API call is triggered. The token expires after one hour, so if you retry the API within this timeframe with the same clientToken, you will get the same response. The service also handles deleting the clientToken after it expires.

    pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { self.inner = self.inner.client_token(input.into()); diff --git a/sdk/m2/src/operation/get_environment/_get_environment_output.rs b/sdk/m2/src/operation/get_environment/_get_environment_output.rs index cf499bfda8e0..ec1414c02924 100644 --- a/sdk/m2/src/operation/get_environment/_get_environment_output.rs +++ b/sdk/m2/src/operation/get_environment/_get_environment_output.rs @@ -47,6 +47,8 @@ pub struct GetEnvironmentOutput { pub pending_maintenance: ::std::option::Option, ///

    The identifier of a customer managed key.

    pub kms_key_id: ::std::option::Option<::std::string::String>, + ///

    The network type supported by the runtime environment.

    + pub network_type: ::std::option::Option, _request_id: Option, } impl GetEnvironmentOutput { @@ -148,6 +150,10 @@ impl GetEnvironmentOutput { pub fn kms_key_id(&self) -> ::std::option::Option<&str> { self.kms_key_id.as_deref() } + ///

    The network type supported by the runtime environment.

    + pub fn network_type(&self) -> ::std::option::Option<&crate::types::NetworkType> { + self.network_type.as_ref() + } } impl ::aws_types::request_id::RequestId for GetEnvironmentOutput { fn request_id(&self) -> Option<&str> { @@ -187,6 +193,7 @@ pub struct GetEnvironmentOutputBuilder { pub(crate) preferred_maintenance_window: ::std::option::Option<::std::string::String>, pub(crate) pending_maintenance: ::std::option::Option, pub(crate) kms_key_id: ::std::option::Option<::std::string::String>, + pub(crate) network_type: ::std::option::Option, _request_id: Option, } impl GetEnvironmentOutputBuilder { @@ -531,6 +538,20 @@ impl GetEnvironmentOutputBuilder { pub fn get_kms_key_id(&self) -> &::std::option::Option<::std::string::String> { &self.kms_key_id } + ///

    The network type supported by the runtime environment.

    + pub fn network_type(mut self, input: crate::types::NetworkType) -> Self { + self.network_type = ::std::option::Option::Some(input); + self + } + ///

    The network type supported by the runtime environment.

    + pub fn set_network_type(mut self, input: ::std::option::Option) -> Self { + self.network_type = input; + self + } + ///

    The network type supported by the runtime environment.

    + pub fn get_network_type(&self) -> &::std::option::Option { + &self.network_type + } pub(crate) fn _request_id(mut self, request_id: impl Into) -> Self { self._request_id = Some(request_id.into()); self @@ -634,6 +655,7 @@ impl GetEnvironmentOutputBuilder { preferred_maintenance_window: self.preferred_maintenance_window, pending_maintenance: self.pending_maintenance, kms_key_id: self.kms_key_id, + network_type: self.network_type, _request_id: self._request_id, }) } diff --git a/sdk/m2/src/protocol_serde/shape_create_environment_input.rs b/sdk/m2/src/protocol_serde/shape_create_environment_input.rs index 69fe54d038a1..96e34779d6f9 100644 --- a/sdk/m2/src/protocol_serde/shape_create_environment_input.rs +++ b/sdk/m2/src/protocol_serde/shape_create_environment_input.rs @@ -30,51 +30,54 @@ pub fn ser_create_environment_input_input( if let Some(var_9) = &input.name { object.key("name").string(var_9.as_str()); } - if let Some(var_10) = &input.preferred_maintenance_window { - object.key("preferredMaintenanceWindow").string(var_10.as_str()); + if let Some(var_10) = &input.network_type { + object.key("networkType").string(var_10.as_str()); } - if let Some(var_11) = &input.publicly_accessible { - object.key("publiclyAccessible").boolean(*var_11); + if let Some(var_11) = &input.preferred_maintenance_window { + object.key("preferredMaintenanceWindow").string(var_11.as_str()); } - if let Some(var_12) = &input.security_group_ids { - let mut array_13 = object.key("securityGroupIds").start_array(); - for item_14 in var_12 { + if let Some(var_12) = &input.publicly_accessible { + object.key("publiclyAccessible").boolean(*var_12); + } + if let Some(var_13) = &input.security_group_ids { + let mut array_14 = object.key("securityGroupIds").start_array(); + for item_15 in var_13 { { - array_13.value().string(item_14.as_str()); + array_14.value().string(item_15.as_str()); } } - array_13.finish(); + array_14.finish(); } - if let Some(var_15) = &input.storage_configurations { - let mut array_16 = object.key("storageConfigurations").start_array(); - for item_17 in var_15 { + if let Some(var_16) = &input.storage_configurations { + let mut array_17 = object.key("storageConfigurations").start_array(); + for item_18 in var_16 { { #[allow(unused_mut)] - let mut object_18 = array_16.value().start_object(); - crate::protocol_serde::shape_storage_configuration::ser_storage_configuration(&mut object_18, item_17)?; - object_18.finish(); + let mut object_19 = array_17.value().start_object(); + crate::protocol_serde::shape_storage_configuration::ser_storage_configuration(&mut object_19, item_18)?; + object_19.finish(); } } - array_16.finish(); + array_17.finish(); } - if let Some(var_19) = &input.subnet_ids { - let mut array_20 = object.key("subnetIds").start_array(); - for item_21 in var_19 { + if let Some(var_20) = &input.subnet_ids { + let mut array_21 = object.key("subnetIds").start_array(); + for item_22 in var_20 { { - array_20.value().string(item_21.as_str()); + array_21.value().string(item_22.as_str()); } } - array_20.finish(); + array_21.finish(); } - if let Some(var_22) = &input.tags { + if let Some(var_23) = &input.tags { #[allow(unused_mut)] - let mut object_23 = object.key("tags").start_object(); - for (key_24, value_25) in var_22 { + let mut object_24 = object.key("tags").start_object(); + for (key_25, value_26) in var_23 { { - object_23.key(key_24.as_str()).string(value_25.as_str()); + object_24.key(key_25.as_str()).string(value_26.as_str()); } } - object_23.finish(); + object_24.finish(); } Ok(()) } diff --git a/sdk/m2/src/protocol_serde/shape_environment_summary.rs b/sdk/m2/src/protocol_serde/shape_environment_summary.rs index 6387359bbf1b..59c23e78f680 100644 --- a/sdk/m2/src/protocol_serde/shape_environment_summary.rs +++ b/sdk/m2/src/protocol_serde/shape_environment_summary.rs @@ -69,6 +69,13 @@ where ::aws_smithy_types::date_time::Format::EpochSeconds, )?); } + "networkType" => { + builder = builder.set_network_type( + ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())? + .map(|s| s.to_unescaped().map(|u| crate::types::NetworkType::from(u.as_ref()))) + .transpose()?, + ); + } _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?, }, other => { diff --git a/sdk/m2/src/protocol_serde/shape_get_environment.rs b/sdk/m2/src/protocol_serde/shape_get_environment.rs index e8e3d8455d86..c9b061b18d7f 100644 --- a/sdk/m2/src/protocol_serde/shape_get_environment.rs +++ b/sdk/m2/src/protocol_serde/shape_get_environment.rs @@ -215,6 +215,13 @@ pub(crate) fn de_get_environment( .transpose()?, ); } + "networkType" => { + builder = builder.set_network_type( + ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())? + .map(|s| s.to_unescaped().map(|u| crate::types::NetworkType::from(u.as_ref()))) + .transpose()?, + ); + } "pendingMaintenance" => { builder = builder.set_pending_maintenance(crate::protocol_serde::shape_pending_maintenance::de_pending_maintenance(tokens)?); } diff --git a/sdk/m2/src/protocol_serde/shape_storage_configuration.rs b/sdk/m2/src/protocol_serde/shape_storage_configuration.rs index c94ef8fc277a..48057a7e76ce 100644 --- a/sdk/m2/src/protocol_serde/shape_storage_configuration.rs +++ b/sdk/m2/src/protocol_serde/shape_storage_configuration.rs @@ -1,18 +1,18 @@ // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. pub fn ser_storage_configuration( - object_18: &mut ::aws_smithy_json::serialize::JsonObjectWriter, + object_19: &mut ::aws_smithy_json::serialize::JsonObjectWriter, input: &crate::types::StorageConfiguration, ) -> Result<(), ::aws_smithy_types::error::operation::SerializationError> { match input { crate::types::StorageConfiguration::Efs(inner) => { #[allow(unused_mut)] - let mut object_1 = object_18.key("efs").start_object(); + let mut object_1 = object_19.key("efs").start_object(); crate::protocol_serde::shape_efs_storage_configuration::ser_efs_storage_configuration(&mut object_1, inner)?; object_1.finish(); } crate::types::StorageConfiguration::Fsx(inner) => { #[allow(unused_mut)] - let mut object_2 = object_18.key("fsx").start_object(); + let mut object_2 = object_19.key("fsx").start_object(); crate::protocol_serde::shape_fsx_storage_configuration::ser_fsx_storage_configuration(&mut object_2, inner)?; object_2.finish(); } diff --git a/sdk/m2/src/types.rs b/sdk/m2/src/types.rs index d257dbc0ffc2..8f13f3d0c73f 100644 --- a/sdk/m2/src/types.rs +++ b/sdk/m2/src/types.rs @@ -3,6 +3,8 @@ pub use crate::types::_validation_exception_field::ValidationExceptionField; pub use crate::types::_validation_exception_reason::ValidationExceptionReason; +pub use crate::types::_network_type::NetworkType; + pub use crate::types::_pending_maintenance::PendingMaintenance; pub use crate::types::_maintenance_schedule::MaintenanceSchedule; @@ -195,6 +197,8 @@ mod _log_group_summary; mod _maintenance_schedule; +mod _network_type; + mod _pending_maintenance; mod _po_attributes; diff --git a/sdk/m2/src/types/_environment_summary.rs b/sdk/m2/src/types/_environment_summary.rs index 89dfc7e4d256..59e230d9d1cc 100644 --- a/sdk/m2/src/types/_environment_summary.rs +++ b/sdk/m2/src/types/_environment_summary.rs @@ -20,6 +20,8 @@ pub struct EnvironmentSummary { pub engine_version: ::std::string::String, ///

    The timestamp when the runtime environment was created.

    pub creation_time: ::aws_smithy_types::DateTime, + ///

    The network type supported by the runtime environment.

    + pub network_type: ::std::option::Option, } impl EnvironmentSummary { ///

    The name of the runtime environment.

    @@ -59,6 +61,10 @@ impl EnvironmentSummary { pub fn creation_time(&self) -> &::aws_smithy_types::DateTime { &self.creation_time } + ///

    The network type supported by the runtime environment.

    + pub fn network_type(&self) -> ::std::option::Option<&crate::types::NetworkType> { + self.network_type.as_ref() + } } impl EnvironmentSummary { /// Creates a new builder-style object to manufacture [`EnvironmentSummary`](crate::types::EnvironmentSummary). @@ -79,6 +85,7 @@ pub struct EnvironmentSummaryBuilder { pub(crate) engine_type: ::std::option::Option, pub(crate) engine_version: ::std::option::Option<::std::string::String>, pub(crate) creation_time: ::std::option::Option<::aws_smithy_types::DateTime>, + pub(crate) network_type: ::std::option::Option, } impl EnvironmentSummaryBuilder { ///

    The name of the runtime environment.

    @@ -201,6 +208,20 @@ impl EnvironmentSummaryBuilder { pub fn get_creation_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> { &self.creation_time } + ///

    The network type supported by the runtime environment.

    + pub fn network_type(mut self, input: crate::types::NetworkType) -> Self { + self.network_type = ::std::option::Option::Some(input); + self + } + ///

    The network type supported by the runtime environment.

    + pub fn set_network_type(mut self, input: ::std::option::Option) -> Self { + self.network_type = input; + self + } + ///

    The network type supported by the runtime environment.

    + pub fn get_network_type(&self) -> &::std::option::Option { + &self.network_type + } /// Consumes the builder and constructs a [`EnvironmentSummary`](crate::types::EnvironmentSummary). /// This method will fail if any of the following fields are not set: /// - [`name`](crate::types::builders::EnvironmentSummaryBuilder::name) @@ -261,6 +282,7 @@ impl EnvironmentSummaryBuilder { "creation_time was not specified but it is required when building EnvironmentSummary", ) })?, + network_type: self.network_type, }) } } diff --git a/sdk/m2/src/types/_network_type.rs b/sdk/m2/src/types/_network_type.rs new file mode 100644 index 000000000000..47ce14b0b79f --- /dev/null +++ b/sdk/m2/src/types/_network_type.rs @@ -0,0 +1,108 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. + +/// When writing a match expression against `NetworkType`, it is important to ensure +/// your code is forward-compatible. That is, if a match arm handles a case for a +/// feature that is supported by the service but has not been represented as an enum +/// variant in a current version of SDK, your code should continue to work when you +/// upgrade SDK to a future version in which the enum does include a variant for that +/// feature. +/// +/// Here is an example of how you can make a match expression forward-compatible: +/// +/// ```text +/// # let networktype = unimplemented!(); +/// match networktype { +/// NetworkType::Dual => { /* ... */ }, +/// NetworkType::Ipv4 => { /* ... */ }, +/// other @ _ if other.as_str() == "NewFeature" => { /* handles a case for `NewFeature` */ }, +/// _ => { /* ... */ }, +/// } +/// ``` +/// The above code demonstrates that when `networktype` represents +/// `NewFeature`, the execution path will lead to the second last match arm, +/// even though the enum does not contain a variant `NetworkType::NewFeature` +/// in the current version of SDK. The reason is that the variable `other`, +/// created by the `@` operator, is bound to +/// `NetworkType::Unknown(UnknownVariantValue("NewFeature".to_owned()))` +/// and calling `as_str` on it yields `"NewFeature"`. +/// This match expression is forward-compatible when executed with a newer +/// version of SDK where the variant `NetworkType::NewFeature` is defined. +/// Specifically, when `networktype` represents `NewFeature`, +/// the execution path will hit the second last match arm as before by virtue of +/// calling `as_str` on `NetworkType::NewFeature` also yielding `"NewFeature"`. +/// +/// Explicitly matching on the `Unknown` variant should +/// be avoided for two reasons: +/// - The inner data `UnknownVariantValue` is opaque, and no further information can be extracted. +/// - It might inadvertently shadow other intended match arms. +/// +#[allow(missing_docs)] // documentation missing in model +#[non_exhaustive] +#[derive( + ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::Ord, ::std::cmp::PartialEq, ::std::cmp::PartialOrd, ::std::fmt::Debug, ::std::hash::Hash, +)] +pub enum NetworkType { + #[allow(missing_docs)] // documentation missing in model + Dual, + #[allow(missing_docs)] // documentation missing in model + Ipv4, + /// `Unknown` contains new variants that have been added since this code was generated. + #[deprecated(note = "Don't directly match on `Unknown`. See the docs on this enum for the correct way to handle unknown variants.")] + Unknown(crate::primitives::sealed_enum_unknown::UnknownVariantValue), +} +impl ::std::convert::From<&str> for NetworkType { + fn from(s: &str) -> Self { + match s { + "dual" => NetworkType::Dual, + "ipv4" => NetworkType::Ipv4, + other => NetworkType::Unknown(crate::primitives::sealed_enum_unknown::UnknownVariantValue(other.to_owned())), + } + } +} +impl ::std::str::FromStr for NetworkType { + type Err = ::std::convert::Infallible; + + fn from_str(s: &str) -> ::std::result::Result::Err> { + ::std::result::Result::Ok(NetworkType::from(s)) + } +} +impl NetworkType { + /// Returns the `&str` value of the enum member. + pub fn as_str(&self) -> &str { + match self { + NetworkType::Dual => "dual", + NetworkType::Ipv4 => "ipv4", + NetworkType::Unknown(value) => value.as_str(), + } + } + /// Returns all the `&str` representations of the enum members. + pub const fn values() -> &'static [&'static str] { + &["dual", "ipv4"] + } +} +impl ::std::convert::AsRef for NetworkType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl NetworkType { + /// Parses the enum value while disallowing unknown variants. + /// + /// Unknown variants will result in an error. + pub fn try_parse(value: &str) -> ::std::result::Result { + match Self::from(value) { + #[allow(deprecated)] + Self::Unknown(_) => ::std::result::Result::Err(crate::error::UnknownVariantError::new(value)), + known => Ok(known), + } + } +} +impl ::std::fmt::Display for NetworkType { + fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + match self { + NetworkType::Dual => write!(f, "dual"), + NetworkType::Ipv4 => write!(f, "ipv4"), + NetworkType::Unknown(value) => write!(f, "{}", value), + } + } +} diff --git a/sdk/synthetics/Cargo.toml b/sdk/synthetics/Cargo.toml index b9df6cd75ee7..565883cec2b0 100644 --- a/sdk/synthetics/Cargo.toml +++ b/sdk/synthetics/Cargo.toml @@ -1,7 +1,7 @@ # Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. [package] name = "aws-sdk-synthetics" -version = "1.53.0" +version = "1.54.0" authors = ["AWS Rust SDK Team ", "Russell Cohen "] description = "AWS SDK for Synthetics" edition = "2021" diff --git a/sdk/synthetics/README.md b/sdk/synthetics/README.md index b3b70655e170..21771288f7d6 100644 --- a/sdk/synthetics/README.md +++ b/sdk/synthetics/README.md @@ -16,7 +16,7 @@ your project, add the following to your **Cargo.toml** file: ```toml [dependencies] aws-config = { version = "1.1.7", features = ["behavior-version-latest"] } -aws-sdk-synthetics = "1.53.0" +aws-sdk-synthetics = "1.54.0" tokio = { version = "1", features = ["full"] } ``` diff --git a/sdk/synthetics/src/lib.rs b/sdk/synthetics/src/lib.rs index dd064bad864e..dcc478c44319 100644 --- a/sdk/synthetics/src/lib.rs +++ b/sdk/synthetics/src/lib.rs @@ -33,7 +33,7 @@ //! ```toml //! [dependencies] //! aws-config = { version = "1.1.7", features = ["behavior-version-latest"] } -//! aws-sdk-synthetics = "1.53.0" +//! aws-sdk-synthetics = "1.54.0" //! tokio = { version = "1", features = ["full"] } //! ``` //! diff --git a/sdk/synthetics/src/protocol_serde/shape_vpc_config_input.rs b/sdk/synthetics/src/protocol_serde/shape_vpc_config_input.rs index 9f347fd2a573..3c8aaeec16ec 100644 --- a/sdk/synthetics/src/protocol_serde/shape_vpc_config_input.rs +++ b/sdk/synthetics/src/protocol_serde/shape_vpc_config_input.rs @@ -21,5 +21,8 @@ pub fn ser_vpc_config_input( } array_5.finish(); } + if let Some(var_7) = &input.ipv6_allowed_for_dual_stack { + object.key("Ipv6AllowedForDualStack").boolean(*var_7); + } Ok(()) } diff --git a/sdk/synthetics/src/protocol_serde/shape_vpc_config_output.rs b/sdk/synthetics/src/protocol_serde/shape_vpc_config_output.rs index 2e04880a65bb..1b3f2a635d4b 100644 --- a/sdk/synthetics/src/protocol_serde/shape_vpc_config_output.rs +++ b/sdk/synthetics/src/protocol_serde/shape_vpc_config_output.rs @@ -27,6 +27,10 @@ where "SecurityGroupIds" => { builder = builder.set_security_group_ids(crate::protocol_serde::shape_security_group_ids::de_security_group_ids(tokens)?); } + "Ipv6AllowedForDualStack" => { + builder = + builder.set_ipv6_allowed_for_dual_stack(::aws_smithy_json::deserialize::token::expect_bool_or_null(tokens.next())?); + } _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?, }, other => { diff --git a/sdk/synthetics/src/types/_visual_reference_input.rs b/sdk/synthetics/src/types/_visual_reference_input.rs index bc1a4029f33f..a6d37230e341 100644 --- a/sdk/synthetics/src/types/_visual_reference_input.rs +++ b/sdk/synthetics/src/types/_visual_reference_input.rs @@ -7,7 +7,7 @@ pub struct VisualReferenceInput { ///

    An array of screenshots that will be used as the baseline for visual monitoring in future runs of this canary. If there is a screenshot that you don't want to be used for visual monitoring, remove it from this array.

    pub base_screenshots: ::std::option::Option<::std::vec::Vec>, - ///

    Specifies which canary run to use the screenshots from as the baseline for future visual monitoring with this canary. Valid values are nextrun to use the screenshots from the next run after this update is made, lastrun to use the screenshots from the most recent run before this update was made, or the value of Id in the CanaryRun from any past run of this canary.

    + ///

    Specifies which canary run to use the screenshots from as the baseline for future visual monitoring with this canary. Valid values are nextrun to use the screenshots from the next run after this update is made, lastrun to use the screenshots from the most recent run before this update was made, or the value of Id in the CanaryRun from a run of this a canary in the past 31 days. If you specify the Id of a canary run older than 31 days, the operation returns a 400 validation exception error..

    pub base_canary_run_id: ::std::string::String, } impl VisualReferenceInput { @@ -17,7 +17,7 @@ impl VisualReferenceInput { pub fn base_screenshots(&self) -> &[crate::types::BaseScreenshot] { self.base_screenshots.as_deref().unwrap_or_default() } - ///

    Specifies which canary run to use the screenshots from as the baseline for future visual monitoring with this canary. Valid values are nextrun to use the screenshots from the next run after this update is made, lastrun to use the screenshots from the most recent run before this update was made, or the value of Id in the CanaryRun from any past run of this canary.

    + ///

    Specifies which canary run to use the screenshots from as the baseline for future visual monitoring with this canary. Valid values are nextrun to use the screenshots from the next run after this update is made, lastrun to use the screenshots from the most recent run before this update was made, or the value of Id in the CanaryRun from a run of this a canary in the past 31 days. If you specify the Id of a canary run older than 31 days, the operation returns a 400 validation exception error..

    pub fn base_canary_run_id(&self) -> &str { use std::ops::Deref; self.base_canary_run_id.deref() @@ -58,18 +58,18 @@ impl VisualReferenceInputBuilder { pub fn get_base_screenshots(&self) -> &::std::option::Option<::std::vec::Vec> { &self.base_screenshots } - ///

    Specifies which canary run to use the screenshots from as the baseline for future visual monitoring with this canary. Valid values are nextrun to use the screenshots from the next run after this update is made, lastrun to use the screenshots from the most recent run before this update was made, or the value of Id in the CanaryRun from any past run of this canary.

    + ///

    Specifies which canary run to use the screenshots from as the baseline for future visual monitoring with this canary. Valid values are nextrun to use the screenshots from the next run after this update is made, lastrun to use the screenshots from the most recent run before this update was made, or the value of Id in the CanaryRun from a run of this a canary in the past 31 days. If you specify the Id of a canary run older than 31 days, the operation returns a 400 validation exception error..

    /// This field is required. pub fn base_canary_run_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { self.base_canary_run_id = ::std::option::Option::Some(input.into()); self } - ///

    Specifies which canary run to use the screenshots from as the baseline for future visual monitoring with this canary. Valid values are nextrun to use the screenshots from the next run after this update is made, lastrun to use the screenshots from the most recent run before this update was made, or the value of Id in the CanaryRun from any past run of this canary.

    + ///

    Specifies which canary run to use the screenshots from as the baseline for future visual monitoring with this canary. Valid values are nextrun to use the screenshots from the next run after this update is made, lastrun to use the screenshots from the most recent run before this update was made, or the value of Id in the CanaryRun from a run of this a canary in the past 31 days. If you specify the Id of a canary run older than 31 days, the operation returns a 400 validation exception error..

    pub fn set_base_canary_run_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self { self.base_canary_run_id = input; self } - ///

    Specifies which canary run to use the screenshots from as the baseline for future visual monitoring with this canary. Valid values are nextrun to use the screenshots from the next run after this update is made, lastrun to use the screenshots from the most recent run before this update was made, or the value of Id in the CanaryRun from any past run of this canary.

    + ///

    Specifies which canary run to use the screenshots from as the baseline for future visual monitoring with this canary. Valid values are nextrun to use the screenshots from the next run after this update is made, lastrun to use the screenshots from the most recent run before this update was made, or the value of Id in the CanaryRun from a run of this a canary in the past 31 days. If you specify the Id of a canary run older than 31 days, the operation returns a 400 validation exception error..

    pub fn get_base_canary_run_id(&self) -> &::std::option::Option<::std::string::String> { &self.base_canary_run_id } diff --git a/sdk/synthetics/src/types/_vpc_config_input.rs b/sdk/synthetics/src/types/_vpc_config_input.rs index ec5f38c14188..fa2689a6934c 100644 --- a/sdk/synthetics/src/types/_vpc_config_input.rs +++ b/sdk/synthetics/src/types/_vpc_config_input.rs @@ -8,6 +8,8 @@ pub struct VpcConfigInput { pub subnet_ids: ::std::option::Option<::std::vec::Vec<::std::string::String>>, ///

    The IDs of the security groups for this canary.

    pub security_group_ids: ::std::option::Option<::std::vec::Vec<::std::string::String>>, + ///

    Set this to true to allow outbound IPv6 traffic on VPC canaries that are connected to dual-stack subnets. The default is false

    + pub ipv6_allowed_for_dual_stack: ::std::option::Option, } impl VpcConfigInput { ///

    The IDs of the subnets where this canary is to run.

    @@ -22,6 +24,10 @@ impl VpcConfigInput { pub fn security_group_ids(&self) -> &[::std::string::String] { self.security_group_ids.as_deref().unwrap_or_default() } + ///

    Set this to true to allow outbound IPv6 traffic on VPC canaries that are connected to dual-stack subnets. The default is false

    + pub fn ipv6_allowed_for_dual_stack(&self) -> ::std::option::Option { + self.ipv6_allowed_for_dual_stack + } } impl VpcConfigInput { /// Creates a new builder-style object to manufacture [`VpcConfigInput`](crate::types::VpcConfigInput). @@ -36,6 +42,7 @@ impl VpcConfigInput { pub struct VpcConfigInputBuilder { pub(crate) subnet_ids: ::std::option::Option<::std::vec::Vec<::std::string::String>>, pub(crate) security_group_ids: ::std::option::Option<::std::vec::Vec<::std::string::String>>, + pub(crate) ipv6_allowed_for_dual_stack: ::std::option::Option, } impl VpcConfigInputBuilder { /// Appends an item to `subnet_ids`. @@ -78,11 +85,26 @@ impl VpcConfigInputBuilder { pub fn get_security_group_ids(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> { &self.security_group_ids } + ///

    Set this to true to allow outbound IPv6 traffic on VPC canaries that are connected to dual-stack subnets. The default is false

    + pub fn ipv6_allowed_for_dual_stack(mut self, input: bool) -> Self { + self.ipv6_allowed_for_dual_stack = ::std::option::Option::Some(input); + self + } + ///

    Set this to true to allow outbound IPv6 traffic on VPC canaries that are connected to dual-stack subnets. The default is false

    + pub fn set_ipv6_allowed_for_dual_stack(mut self, input: ::std::option::Option) -> Self { + self.ipv6_allowed_for_dual_stack = input; + self + } + ///

    Set this to true to allow outbound IPv6 traffic on VPC canaries that are connected to dual-stack subnets. The default is false

    + pub fn get_ipv6_allowed_for_dual_stack(&self) -> &::std::option::Option { + &self.ipv6_allowed_for_dual_stack + } /// Consumes the builder and constructs a [`VpcConfigInput`](crate::types::VpcConfigInput). pub fn build(self) -> crate::types::VpcConfigInput { crate::types::VpcConfigInput { subnet_ids: self.subnet_ids, security_group_ids: self.security_group_ids, + ipv6_allowed_for_dual_stack: self.ipv6_allowed_for_dual_stack, } } } diff --git a/sdk/synthetics/src/types/_vpc_config_output.rs b/sdk/synthetics/src/types/_vpc_config_output.rs index adaee91d5df9..e0cb2982e522 100644 --- a/sdk/synthetics/src/types/_vpc_config_output.rs +++ b/sdk/synthetics/src/types/_vpc_config_output.rs @@ -10,6 +10,8 @@ pub struct VpcConfigOutput { pub subnet_ids: ::std::option::Option<::std::vec::Vec<::std::string::String>>, ///

    The IDs of the security groups for this canary.

    pub security_group_ids: ::std::option::Option<::std::vec::Vec<::std::string::String>>, + ///

    Indicates whether this canary allows outbound IPv6 traffic if it is connected to dual-stack subnets.

    + pub ipv6_allowed_for_dual_stack: ::std::option::Option, } impl VpcConfigOutput { ///

    The IDs of the VPC where this canary is to run.

    @@ -28,6 +30,10 @@ impl VpcConfigOutput { pub fn security_group_ids(&self) -> &[::std::string::String] { self.security_group_ids.as_deref().unwrap_or_default() } + ///

    Indicates whether this canary allows outbound IPv6 traffic if it is connected to dual-stack subnets.

    + pub fn ipv6_allowed_for_dual_stack(&self) -> ::std::option::Option { + self.ipv6_allowed_for_dual_stack + } } impl VpcConfigOutput { /// Creates a new builder-style object to manufacture [`VpcConfigOutput`](crate::types::VpcConfigOutput). @@ -43,6 +49,7 @@ pub struct VpcConfigOutputBuilder { pub(crate) vpc_id: ::std::option::Option<::std::string::String>, pub(crate) subnet_ids: ::std::option::Option<::std::vec::Vec<::std::string::String>>, pub(crate) security_group_ids: ::std::option::Option<::std::vec::Vec<::std::string::String>>, + pub(crate) ipv6_allowed_for_dual_stack: ::std::option::Option, } impl VpcConfigOutputBuilder { ///

    The IDs of the VPC where this canary is to run.

    @@ -99,12 +106,27 @@ impl VpcConfigOutputBuilder { pub fn get_security_group_ids(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> { &self.security_group_ids } + ///

    Indicates whether this canary allows outbound IPv6 traffic if it is connected to dual-stack subnets.

    + pub fn ipv6_allowed_for_dual_stack(mut self, input: bool) -> Self { + self.ipv6_allowed_for_dual_stack = ::std::option::Option::Some(input); + self + } + ///

    Indicates whether this canary allows outbound IPv6 traffic if it is connected to dual-stack subnets.

    + pub fn set_ipv6_allowed_for_dual_stack(mut self, input: ::std::option::Option) -> Self { + self.ipv6_allowed_for_dual_stack = input; + self + } + ///

    Indicates whether this canary allows outbound IPv6 traffic if it is connected to dual-stack subnets.

    + pub fn get_ipv6_allowed_for_dual_stack(&self) -> &::std::option::Option { + &self.ipv6_allowed_for_dual_stack + } /// Consumes the builder and constructs a [`VpcConfigOutput`](crate::types::VpcConfigOutput). pub fn build(self) -> crate::types::VpcConfigOutput { crate::types::VpcConfigOutput { vpc_id: self.vpc_id, subnet_ids: self.subnet_ids, security_group_ids: self.security_group_ids, + ipv6_allowed_for_dual_stack: self.ipv6_allowed_for_dual_stack, } } } diff --git a/versions.toml b/versions.toml index b34437533376..f652ccd49d20 100644 --- a/versions.toml +++ b/versions.toml @@ -46,9 +46,9 @@ model_hash = '5ad839d8aa2e17b3ef8299d0cd7a455d1c36b7f4090a84ae086e95f6bfb07459' [crates.aws-sdk-account] category = 'AwsSdk' -version = '1.52.0' -source_hash = '878ac696da79127a6481944a52701d3e271eac58bea84fd0864cbf52fdadfc6d' -model_hash = 'e053c02604629231c91529fefa603be657a56e45e1b3bb1af76c165721070ec9' +version = '1.53.0' +source_hash = 'fb59c072125474e045b079dbe51700f987a6b6e0e13375c13832e9edb423909d' +model_hash = '365773acf11f552b21421a7b199cd68d18eec8b4a7ee59bfbecfe9912311b8f6' [crates.aws-sdk-acm] category = 'AwsSdk' @@ -238,9 +238,9 @@ model_hash = '6c88734f78bce340f7be0e95b62be541dc7bb7c68778d7ddf214fa3748155631' [crates.aws-sdk-backup] category = 'AwsSdk' -version = '1.54.0' -source_hash = '70fb2bde232c50523b8ede6f757e5d3f3f9f97dde039393db975d5a6d4fb57cb' -model_hash = '5e23f144ddc51264dda5b42ebe32d43f2ee1cb3733538e9bf4ccd198f539f654' +version = '1.55.0' +source_hash = 'c6ce3c33dabe31c468183dbdb67386a92f9624299c120b8437cdac6c7adea54f' +model_hash = '09f3cb41ca93e53c19195e63c2992a92467e1c910421c28e12b9c2fa416d8c5e' [crates.aws-sdk-backupgateway] category = 'AwsSdk' @@ -248,11 +248,17 @@ version = '1.51.0' source_hash = 'be82fd18799ed97fd3614f088bc82eb419b3b728488a9814f27e0df1e5d06af4' model_hash = 'f14d6bf655e9a701fb322eef4a961b41aefb3c2686c5f9c48d8203bcda8df0e2' +[crates.aws-sdk-backupsearch] +category = 'AwsSdk' +version = '1.0.0' +source_hash = '6441689f3ad9d2219ded00cc6c99c56686aad401b9e1e831957bb255f19f14e3' +model_hash = '66fa4bdab3394f5d156cd8eb17636f6afc6c32447af1e5047c3b9dabb883bac4' + [crates.aws-sdk-batch] category = 'AwsSdk' -version = '1.59.0' -source_hash = '4fc2231af9b2cb0b85c983b31a9fa35ed4c27f17f25c630ef541088753903f8c' -model_hash = '1fb22a0d0a646e54d38bb05723c00e6e65a9f0a99f9e81fb18e8cd34f6b1646c' +version = '1.60.0' +source_hash = '09859d1efb40eb1fd808e66f654dee4cbf628ff6dd30d0a1ef337e5081797577' +model_hash = '0da425f63a75520c9566ce76b0b902a7456e393ed4d67f79f4a23711f1c86553' [crates.aws-sdk-bcmdataexports] category = 'AwsSdk' @@ -376,9 +382,9 @@ model_hash = '4d5b9c3c3e7c560691db17959b30ab0e57f6d150a8b9d1ed70a3764aa56abe7f' [crates.aws-sdk-cleanroomsml] category = 'AwsSdk' -version = '1.51.0' -source_hash = 'fbb0c82f981346e59c815d815d56bb623ca99b8b7bea51938f94d15a4947c82f' -model_hash = '20413500d3918eaa0e68bee6372d29e4f7e2b1333f67579f672def11a77a9981' +version = '1.52.0' +source_hash = 'c48992e5e1f0ab816cc74c2cb5a3a5b0d9c1cea676a3f4eaaed444f817a3006a' +model_hash = '72728b5a121032f279b185513445d3102ed111c049dc53e00cf52a44704b9648' [crates.aws-sdk-cloud9] category = 'AwsSdk' @@ -406,9 +412,9 @@ model_hash = 'd31b60e5c189db40cb89034efaea06e141e50286ba7068b37820caf4a6a5023a' [crates.aws-sdk-cloudfront] category = 'AwsSdk' -version = '1.56.0' -source_hash = '3acd1b3e308479e7d048410357120658ec250fd0c025011d69aa9278dd36bee9' -model_hash = 'cea180b80ad45d199d5b011557f79bd84a26e29f21a419251e624f8feb5daa80' +version = '1.57.0' +source_hash = '98992fde1189d55cc42d90ed73f0f83d05c34db882815ff72a225144d2414117' +model_hash = '20517c13b8d04fa68444672c70ab3b0122c51dbf002624a6fd14be957b296477' [crates.aws-sdk-cloudfrontkeyvaluestore] category = 'AwsSdk' @@ -526,9 +532,9 @@ model_hash = 'c6db5c090a27a7b7c92113bc8827999fff3130e382c9f5970fae1d1e4c81cda6' [crates.aws-sdk-codepipeline] category = 'AwsSdk' -version = '1.59.0' -source_hash = '4756a1dc6181171a9fea158bb2b3260286861e7f00eadf7b2c4f2a413385cb9f' -model_hash = '53579f2d49313a919cbaa62f4dda179f449b565f476e0b33f8dbd743f02b2920' +version = '1.60.0' +source_hash = '9910fb764855f1c1968aa9590f222d024b600305290688e01544280cff31ff33' +model_hash = '6a3fa7d19d46e7639f397b42657bba8199b5d2f8b03d6d6b7fb8a45e340e4afb' [crates.aws-sdk-codestarconnections] category = 'AwsSdk' @@ -814,9 +820,9 @@ model_hash = 'b6e23be351cb44f9f2b57d80f227604694a8bac84ed1467add8d019c824ac349' [crates.aws-sdk-ecs] category = 'AwsSdk' -version = '1.58.0' -source_hash = '1f86642eefafabdab705cc90657ba48820f3472bb5483fc9fac9c4e7eaeee59f' -model_hash = 'a5e68999f53c7988328c8dac059bcba91c9e49d34aaf1aec615765f360a447d1' +version = '1.59.0' +source_hash = 'b7dc67ba834ede6a25e2f0e255674b8def135e1cc3e3747ca97a0e273bd51f0c' +model_hash = '8962bffa2b3953a0686fa61859210119fb592d7de543cdca9420fd4e871a00cb' [crates.aws-sdk-efs] category = 'AwsSdk' @@ -1396,9 +1402,9 @@ model_hash = 'ad9b57505093a165cbe3fe1e84c3252c99cca170ba2de812a5c5ddad055219d4' [crates.aws-sdk-m2] category = 'AwsSdk' -version = '1.53.0' -source_hash = '6d1c9978c0e885df4002ef529508789261e8a2ec9ed2aca786689a993d9574d4' -model_hash = '8548a8c333c09820460f90f52b66c160d894023f79c55aaa9d1c5305b021519e' +version = '1.54.0' +source_hash = 'eb0b3ea33f14e3532317573d67cecd2e3a9cccddb70db8a62ae86376e6055266' +model_hash = 'c96a653fb2b5961cc2509f557a6ee74281ea2ee65c0fd18a15f73744c998e5da' [crates.aws-sdk-machinelearning] category = 'AwsSdk' @@ -2296,9 +2302,9 @@ model_hash = '4cafdfff1443f955a809c0c1f164e38c2c54307ace206332dd666c7d1db33e85' [crates.aws-sdk-synthetics] category = 'AwsSdk' -version = '1.53.0' -source_hash = 'e3cf6424765d8f3af9efe791d1fecb5e959e7460954b12b03ec4aeaadebcc3eb' -model_hash = '202d4c21becaa6252bc3096bfe90e6ea050722145916f96d89d9bdfe0d398995' +version = '1.54.0' +source_hash = 'c9fec79773b4819260a91165d1086c800d3c9e2f90a5614be9d81eece9fd4a94' +model_hash = 'dd226f5fc2d0e55aba7892cbb176756d628f3b8059ee7bbe6e2dc7fa1b359764' [crates.aws-sdk-taxsettings] category = 'AwsSdk' @@ -2595,416 +2601,14 @@ source_hash = '296a471b189f14535e95c799b1748c38bfae91febeac58b5bf0365f011d77a67' category = 'AwsRuntime' version = '0.0.0' source_hash = '939e0cadde03612879ddff985f14af5bed503bfee939828ff0f8110898c98fbc' - -[release] -tag = 'release-2024-12-18' - [release.crates] -aws-config = '1.5.11' -aws-runtime = '1.5.1' -aws-sdk-accessanalyzer = '1.56.0' -aws-sdk-account = '1.52.0' -aws-sdk-acm = '1.52.0' -aws-sdk-acmpca = '1.54.0' -aws-sdk-amp = '1.51.0' -aws-sdk-amplify = '1.55.0' -aws-sdk-amplifybackend = '1.51.0' -aws-sdk-amplifyuibuilder = '1.51.0' -aws-sdk-apigateway = '1.53.0' -aws-sdk-apigatewaymanagement = '1.51.0' -aws-sdk-apigatewayv2 = '1.51.0' -aws-sdk-appconfig = '1.55.0' -aws-sdk-appconfigdata = '1.51.0' -aws-sdk-appfabric = '1.51.0' -aws-sdk-appflow = '1.51.0' -aws-sdk-appintegrations = '1.52.0' -aws-sdk-applicationautoscaling = '1.56.0' -aws-sdk-applicationcostprofiler = '1.51.0' -aws-sdk-applicationdiscovery = '1.53.0' -aws-sdk-applicationinsights = '1.52.0' -aws-sdk-applicationsignals = '1.24.0' -aws-sdk-appmesh = '1.51.0' -aws-sdk-apprunner = '1.52.0' -aws-sdk-appstream = '1.54.0' -aws-sdk-appsync = '1.59.0' -aws-sdk-apptest = '1.21.0' -aws-sdk-arczonalshift = '1.52.0' -aws-sdk-artifact = '1.40.0' -aws-sdk-athena = '1.55.0' -aws-sdk-auditmanager = '1.52.0' -aws-sdk-autoscaling = '1.59.0' -aws-sdk-autoscalingplans = '1.51.0' -aws-sdk-b2bi = '1.55.0' -aws-sdk-backup = '1.54.0' -aws-sdk-backupgateway = '1.51.0' -aws-sdk-batch = '1.59.0' -aws-sdk-bcmdataexports = '1.49.0' -aws-sdk-bcmpricingcalculator = '1.3.0' -aws-sdk-bedrock = '1.65.0' -aws-sdk-bedrockagent = '1.68.0' -aws-sdk-bedrockagentruntime = '1.66.0' -aws-sdk-bedrockdataautomation = '1.1.0' -aws-sdk-bedrockdataautomationruntime = '1.1.0' -aws-sdk-bedrockruntime = '1.65.0' -aws-sdk-billing = '1.2.0' -aws-sdk-billingconductor = '1.52.0' -aws-sdk-braket = '1.53.0' -aws-sdk-budgets = '1.52.0' -aws-sdk-chatbot = '1.41.0' -aws-sdk-chime = '1.51.0' -aws-sdk-chimesdkidentity = '1.51.0' -aws-sdk-chimesdkmediapipelines = '1.53.0' -aws-sdk-chimesdkmeetings = '1.52.0' -aws-sdk-chimesdkmessaging = '1.51.0' -aws-sdk-chimesdkvoice = '1.53.0' -aws-sdk-cleanrooms = '1.59.0' -aws-sdk-cleanroomsml = '1.51.0' -aws-sdk-cloud9 = '1.52.0' -aws-sdk-cloudcontrol = '1.52.0' -aws-sdk-clouddirectory = '1.51.0' -aws-sdk-cloudformation = '1.57.0' -aws-sdk-cloudfront = '1.56.0' -aws-sdk-cloudfrontkeyvaluestore = '1.51.0' -aws-sdk-cloudhsm = '1.51.0' -aws-sdk-cloudhsmv2 = '1.53.0' -aws-sdk-cloudsearch = '1.51.0' -aws-sdk-cloudsearchdomain = '1.51.0' -aws-sdk-cloudtrail = '1.56.0' -aws-sdk-cloudtraildata = '1.51.0' -aws-sdk-cloudwatch = '1.57.0' -aws-sdk-cloudwatchevents = '1.51.0' -aws-sdk-cloudwatchlogs = '1.62.0' -aws-sdk-codeartifact = '1.54.0' -aws-sdk-codebuild = '1.64.0' -aws-sdk-codecatalyst = '1.52.0' -aws-sdk-codecommit = '1.52.0' -aws-sdk-codeconnections = '1.34.0' -aws-sdk-codedeploy = '1.53.0' -aws-sdk-codeguruprofiler = '1.51.0' -aws-sdk-codegurureviewer = '1.51.0' -aws-sdk-codegurusecurity = '1.52.0' -aws-sdk-codepipeline = '1.59.0' -aws-sdk-codestarconnections = '1.53.0' -aws-sdk-codestarnotifications = '1.51.0' -aws-sdk-cognitoidentity = '1.52.0' -aws-sdk-cognitoidentityprovider = '1.61.0' -aws-sdk-cognitosync = '1.51.0' -aws-sdk-comprehend = '1.51.0' -aws-sdk-comprehendmedical = '1.51.0' -aws-sdk-computeoptimizer = '1.53.0' -aws-sdk-config = '1.54.0' -aws-sdk-connect = '1.81.0' -aws-sdk-connectcampaigns = '1.53.0' -aws-sdk-connectcampaignsv2 = '1.3.0' -aws-sdk-connectcases = '1.54.0' -aws-sdk-connectcontactlens = '1.52.0' -aws-sdk-connectparticipant = '1.52.0' -aws-sdk-controlcatalog = '1.34.0' -aws-sdk-controltower = '1.56.0' -aws-sdk-costandusagereport = '1.52.0' -aws-sdk-costexplorer = '1.56.0' -aws-sdk-costoptimizationhub = '1.52.0' -aws-sdk-customerprofiles = '1.56.0' -aws-sdk-databasemigration = '1.54.0' -aws-sdk-databrew = '1.51.0' -aws-sdk-dataexchange = '1.52.0' -aws-sdk-datapipeline = '1.51.0' -aws-sdk-datasync = '1.55.0' -aws-sdk-datazone = '1.64.0' -aws-sdk-dax = '1.51.0' -aws-sdk-deadline = '1.36.0' -aws-sdk-detective = '1.51.0' -aws-sdk-devicefarm = '1.53.0' -aws-sdk-devopsguru = '1.51.0' -aws-sdk-directconnect = '1.53.0' -aws-sdk-directory = '1.53.0' -aws-sdk-directoryservicedata = '1.8.0' -aws-sdk-dlm = '1.51.0' -aws-sdk-docdb = '1.54.0' -aws-sdk-docdbelastic = '1.53.0' -aws-sdk-drs = '1.54.0' -aws-sdk-dsql = '1.1.0' -aws-sdk-dynamodb = '1.56.0' -aws-sdk-dynamodbstreams = '1.51.0' -aws-sdk-ebs = '1.51.0' -aws-sdk-ec2 = '1.98.0' -aws-sdk-ec2instanceconnect = '1.51.0' -aws-sdk-ecr = '1.54.0' -aws-sdk-ecrpublic = '1.51.0' -aws-sdk-ecs = '1.58.0' -aws-sdk-efs = '1.53.0' -aws-sdk-eks = '1.62.0' -aws-sdk-eksauth = '1.49.0' -aws-sdk-elasticache = '1.56.0' -aws-sdk-elasticbeanstalk = '1.52.0' -aws-sdk-elasticinference = '1.51.0' -aws-sdk-elasticloadbalancing = '1.52.0' -aws-sdk-elasticloadbalancingv2 = '1.59.0' -aws-sdk-elasticsearch = '1.54.0' -aws-sdk-elastictranscoder = '1.52.0' -aws-sdk-emr = '1.57.0' -aws-sdk-emrcontainers = '1.55.0' -aws-sdk-emrserverless = '1.56.0' -aws-sdk-entityresolution = '1.55.0' -aws-sdk-eventbridge = '1.54.0' -aws-sdk-evidently = '1.51.0' -aws-sdk-finspace = '1.55.0' -aws-sdk-finspacedata = '1.51.0' -aws-sdk-firehose = '1.57.0' -aws-sdk-fis = '1.54.0' -aws-sdk-fms = '1.55.0' -aws-sdk-forecast = '1.51.0' -aws-sdk-forecastquery = '1.51.0' -aws-sdk-frauddetector = '1.51.0' -aws-sdk-freetier = '1.49.0' -aws-sdk-fsx = '1.57.0' -aws-sdk-gamelift = '1.55.0' -aws-sdk-geomaps = '1.4.0' -aws-sdk-geoplaces = '1.4.0' -aws-sdk-georoutes = '1.4.0' -aws-sdk-glacier = '1.51.0' -aws-sdk-globalaccelerator = '1.53.0' -aws-sdk-glue = '1.73.0' -aws-sdk-grafana = '1.53.0' -aws-sdk-greengrass = '1.51.0' -aws-sdk-greengrassv2 = '1.52.0' -aws-sdk-groundstation = '1.52.0' -aws-sdk-guardduty = '1.60.0' -aws-sdk-health = '1.52.0' -aws-sdk-healthlake = '1.52.0' -aws-sdk-iam = '1.54.0' -aws-sdk-identitystore = '1.51.0' -aws-sdk-imagebuilder = '1.54.0' -aws-sdk-inspector = '1.51.0' -aws-sdk-inspector2 = '1.58.0' -aws-sdk-inspectorscan = '1.51.0' -aws-sdk-internetmonitor = '1.56.0' -aws-sdk-invoicing = '1.2.0' -aws-sdk-iot = '1.58.0' -aws-sdk-iot1clickdevices = '1.51.0' -aws-sdk-iot1clickprojects = '1.51.0' -aws-sdk-iotanalytics = '1.51.0' -aws-sdk-iotdataplane = '1.51.0' -aws-sdk-iotdeviceadvisor = '1.52.0' -aws-sdk-iotevents = '1.52.0' -aws-sdk-ioteventsdata = '1.51.0' -aws-sdk-iotfleethub = '1.51.0' -aws-sdk-iotfleetwise = '1.55.0' -aws-sdk-iotjobsdataplane = '1.52.0' -aws-sdk-iotsecuretunneling = '1.51.0' -aws-sdk-iotsitewise = '1.54.0' -aws-sdk-iotthingsgraph = '1.51.0' -aws-sdk-iottwinmaker = '1.51.0' -aws-sdk-iotwireless = '1.55.0' -aws-sdk-ivs = '1.57.0' -aws-sdk-ivschat = '1.52.0' -aws-sdk-ivsrealtime = '1.57.0' -aws-sdk-kafka = '1.55.0' -aws-sdk-kafkaconnect = '1.52.0' -aws-sdk-kendra = '1.53.0' -aws-sdk-kendraranking = '1.51.0' -aws-sdk-keyspaces = '1.54.0' -aws-sdk-kinesis = '1.53.0' -aws-sdk-kinesisanalytics = '1.51.0' -aws-sdk-kinesisanalyticsv2 = '1.55.0' -aws-sdk-kinesisvideo = '1.52.0' -aws-sdk-kinesisvideoarchivedmedia = '1.52.0' -aws-sdk-kinesisvideomedia = '1.51.0' -aws-sdk-kinesisvideosignaling = '1.51.0' -aws-sdk-kinesisvideowebrtcstorage = '1.52.0' -aws-sdk-kms = '1.52.0' -aws-sdk-lakeformation = '1.54.0' -aws-sdk-lambda = '1.61.0' -aws-sdk-launchwizard = '1.52.0' -aws-sdk-lexmodelbuilding = '1.51.0' -aws-sdk-lexmodelsv2 = '1.55.0' -aws-sdk-lexruntime = '1.51.0' -aws-sdk-lexruntimev2 = '1.51.0' -aws-sdk-licensemanager = '1.51.0' -aws-sdk-licensemanagerlinuxsubscriptions = '1.52.0' -aws-sdk-licensemanagerusersubscriptions = '1.52.0' -aws-sdk-lightsail = '1.55.0' -aws-sdk-location = '1.54.0' -aws-sdk-lookoutequipment = '1.53.0' -aws-sdk-lookoutmetrics = '1.51.0' -aws-sdk-lookoutvision = '1.51.0' -aws-sdk-m2 = '1.53.0' -aws-sdk-machinelearning = '1.51.0' -aws-sdk-macie2 = '1.53.0' -aws-sdk-mailmanager = '1.29.0' -aws-sdk-managedblockchain = '1.51.0' -aws-sdk-managedblockchainquery = '1.54.0' -aws-sdk-marketplaceagreement = '1.48.0' -aws-sdk-marketplacecatalog = '1.55.0' -aws-sdk-marketplacecommerceanalytics = '1.51.0' -aws-sdk-marketplacedeployment = '1.48.0' -aws-sdk-marketplaceentitlement = '1.52.0' -aws-sdk-marketplacemetering = '1.51.0' -aws-sdk-marketplacereporting = '1.7.0' -aws-sdk-mediaconnect = '1.54.0' -aws-sdk-mediaconvert = '1.60.0' -aws-sdk-medialive = '1.63.0' -aws-sdk-mediapackage = '1.51.0' -aws-sdk-mediapackagev2 = '1.57.0' -aws-sdk-mediapackagevod = '1.51.0' -aws-sdk-mediastore = '1.51.0' -aws-sdk-mediastoredata = '1.51.0' -aws-sdk-mediatailor = '1.53.0' -aws-sdk-medicalimaging = '1.54.0' -aws-sdk-memorydb = '1.53.0' -aws-sdk-mgn = '1.51.0' -aws-sdk-migrationhub = '1.52.0' -aws-sdk-migrationhubconfig = '1.51.0' -aws-sdk-migrationhuborchestrator = '1.52.0' -aws-sdk-migrationhubrefactorspaces = '1.51.0' -aws-sdk-migrationhubstrategy = '1.51.0' -aws-sdk-mq = '1.52.0' -aws-sdk-mturk = '1.51.0' -aws-sdk-mwaa = '1.56.0' -aws-sdk-neptune = '1.53.0' -aws-sdk-neptunedata = '1.51.0' -aws-sdk-neptunegraph = '1.50.0' -aws-sdk-networkfirewall = '1.53.0' -aws-sdk-networkflowmonitor = '1.2.0' -aws-sdk-networkmanager = '1.54.0' -aws-sdk-networkmonitor = '1.42.0' -aws-sdk-notifications = '1.2.0' -aws-sdk-notificationscontacts = '1.2.0' -aws-sdk-oam = '1.53.0' -aws-sdk-observabilityadmin = '1.2.0' -aws-sdk-omics = '1.56.0' -aws-sdk-opensearch = '1.64.0' -aws-sdk-opensearchserverless = '1.54.0' -aws-sdk-opsworks = '1.51.0' -aws-sdk-opsworkscm = '1.51.0' -aws-sdk-organizations = '1.58.0' -aws-sdk-osis = '1.53.0' -aws-sdk-outposts = '1.56.0' -aws-sdk-panorama = '1.51.0' -aws-sdk-partnercentralselling = '1.4.0' -aws-sdk-paymentcryptography = '1.56.0' -aws-sdk-paymentcryptographydata = '1.55.0' -aws-sdk-pcaconnectorad = '1.51.0' -aws-sdk-pcaconnectorscep = '1.21.0' -aws-sdk-pcs = '1.12.0' -aws-sdk-personalize = '1.53.0' -aws-sdk-personalizeevents = '1.51.0' -aws-sdk-personalizeruntime = '1.51.0' -aws-sdk-pi = '1.52.0' -aws-sdk-pinpoint = '1.53.0' -aws-sdk-pinpointemail = '1.51.0' -aws-sdk-pinpointsmsvoice = '1.51.0' -aws-sdk-pinpointsmsvoicev2 = '1.56.0' -aws-sdk-pipes = '1.54.0' -aws-sdk-polly = '1.53.0' -aws-sdk-pricing = '1.53.0' -aws-sdk-privatenetworks = '1.51.0' -aws-sdk-proton = '1.51.0' -aws-sdk-qapps = '1.19.0' -aws-sdk-qbusiness = '1.58.0' -aws-sdk-qconnect = '1.57.0' -aws-sdk-qldb = '1.51.0' -aws-sdk-qldbsession = '1.51.0' -aws-sdk-quicksight = '1.67.0' -aws-sdk-ram = '1.51.0' -aws-sdk-rbin = '1.53.0' -aws-sdk-rds = '1.70.0' -aws-sdk-rdsdata = '1.52.0' -aws-sdk-redshift = '1.56.0' -aws-sdk-redshiftdata = '1.53.0' -aws-sdk-redshiftserverless = '1.54.0' -aws-sdk-rekognition = '1.54.0' -aws-sdk-repostspace = '1.50.0' -aws-sdk-resiliencehub = '1.54.0' -aws-sdk-resourceexplorer2 = '1.54.0' -aws-sdk-resourcegroups = '1.53.0' -aws-sdk-resourcegroupstagging = '1.51.0' -aws-sdk-robomaker = '1.51.0' -aws-sdk-rolesanywhere = '1.55.0' -aws-sdk-route53 = '1.55.0' -aws-sdk-route53domains = '1.54.0' -aws-sdk-route53profiles = '1.30.0' -aws-sdk-route53recoverycluster = '1.51.0' -aws-sdk-route53recoverycontrolconfig = '1.51.0' -aws-sdk-route53recoveryreadiness = '1.51.0' -aws-sdk-route53resolver = '1.56.0' -aws-sdk-rum = '1.51.0' -aws-sdk-s3 = '1.66.0' -aws-sdk-s3control = '1.56.0' -aws-sdk-s3outposts = '1.51.0' -aws-sdk-s3tables = '1.1.0' -aws-sdk-sagemaker = '1.90.0' -aws-sdk-sagemakera2iruntime = '1.51.0' -aws-sdk-sagemakeredge = '1.51.0' -aws-sdk-sagemakerfeaturestoreruntime = '1.52.0' -aws-sdk-sagemakergeospatial = '1.51.0' -aws-sdk-sagemakermetrics = '1.52.0' -aws-sdk-sagemakerruntime = '1.53.0' -aws-sdk-savingsplans = '1.52.0' -aws-sdk-scheduler = '1.51.0' -aws-sdk-schemas = '1.51.0' -aws-sdk-secretsmanager = '1.55.0' -aws-sdk-securityhub = '1.55.0' -aws-sdk-securityir = '1.2.0' -aws-sdk-securitylake = '1.54.0' -aws-sdk-serverlessapplicationrepository = '1.51.0' -aws-sdk-servicecatalog = '1.52.0' -aws-sdk-servicecatalogappregistry = '1.51.0' -aws-sdk-servicediscovery = '1.52.0' -aws-sdk-servicequotas = '1.51.0' -aws-sdk-ses = '1.54.0' -aws-sdk-sesv2 = '1.58.0' -aws-sdk-sfn = '1.55.0' -aws-sdk-shield = '1.51.0' -aws-sdk-signer = '1.51.0' -aws-sdk-simspaceweaver = '1.51.0' -aws-sdk-sms = '1.51.0' -aws-sdk-snowball = '1.51.0' -aws-sdk-snowdevicemanagement = '1.51.0' -aws-sdk-sns = '1.52.0' -aws-sdk-socialmessaging = '1.6.0' -aws-sdk-sqs = '1.51.0' -aws-sdk-ssm = '1.57.0' -aws-sdk-ssmcontacts = '1.51.0' -aws-sdk-ssmincidents = '1.51.0' -aws-sdk-ssmquicksetup = '1.16.0' -aws-sdk-ssmsap = '1.53.0' -aws-sdk-sso = '1.51.0' -aws-sdk-ssoadmin = '1.51.0' -aws-sdk-ssooidc = '1.52.0' -aws-sdk-storagegateway = '1.55.0' -aws-sdk-sts = '1.52.0' -aws-sdk-supplychain = '1.44.0' -aws-sdk-support = '1.52.0' -aws-sdk-supportapp = '1.51.0' -aws-sdk-swf = '1.53.0' -aws-sdk-synthetics = '1.53.0' -aws-sdk-taxsettings = '1.25.0' -aws-sdk-textract = '1.51.0' -aws-sdk-timestreaminfluxdb = '1.36.0' -aws-sdk-timestreamquery = '1.54.0' -aws-sdk-timestreamwrite = '1.51.0' -aws-sdk-tnb = '1.52.0' -aws-sdk-transcribe = '1.52.0' -aws-sdk-transcribestreaming = '1.52.0' -aws-sdk-transfer = '1.57.0' -aws-sdk-translate = '1.51.0' -aws-sdk-trustedadvisor = '1.52.0' -aws-sdk-verifiedpermissions = '1.57.0' -aws-sdk-voiceid = '1.51.0' -aws-sdk-vpclattice = '1.53.0' -aws-sdk-waf = '1.52.0' -aws-sdk-wafregional = '1.52.0' -aws-sdk-wafv2 = '1.56.0' -aws-sdk-wellarchitected = '1.52.0' -aws-sdk-wisdom = '1.52.0' -aws-sdk-workdocs = '1.51.0' -aws-sdk-workmail = '1.52.0' -aws-sdk-workmailmessageflow = '1.51.0' -aws-sdk-workspaces = '1.61.0' -aws-sdk-workspacesthinclient = '1.52.0' -aws-sdk-workspacesweb = '1.55.0' -aws-sdk-xray = '1.52.0' -aws-smithy-async = '1.2.2' -aws-smithy-runtime = '1.7.5' -aws-smithy-types = '1.2.10' +aws-sdk-account = '1.53.0' +aws-sdk-backup = '1.55.0' +aws-sdk-backupsearch = '1.0.0' +aws-sdk-batch = '1.60.0' +aws-sdk-cleanroomsml = '1.52.0' +aws-sdk-cloudfront = '1.57.0' +aws-sdk-codepipeline = '1.60.0' +aws-sdk-ecs = '1.59.0' +aws-sdk-m2 = '1.54.0' +aws-sdk-synthetics = '1.54.0'