aws-sdk-route53recoveryreadiness 1.10.0 → 1.12.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,132 @@
1
+ # frozen_string_literal: true
2
+
3
+ # WARNING ABOUT GENERATED CODE
4
+ #
5
+ # This file is generated. See the contributing guide for more information:
6
+ # https://github.com/aws/aws-sdk-ruby/blob/version-3/CONTRIBUTING.md
7
+ #
8
+ # WARNING ABOUT GENERATED CODE
9
+
10
+
11
+ module Aws::Route53RecoveryReadiness
12
+ module Plugins
13
+ class Endpoints < Seahorse::Client::Plugin
14
+ option(
15
+ :endpoint_provider,
16
+ doc_type: 'Aws::Route53RecoveryReadiness::EndpointProvider',
17
+ docstring: 'The endpoint provider used to resolve endpoints. Any '\
18
+ 'object that responds to `#resolve_endpoint(parameters)` '\
19
+ 'where `parameters` is a Struct similar to '\
20
+ '`Aws::Route53RecoveryReadiness::EndpointParameters`'
21
+ ) do |cfg|
22
+ Aws::Route53RecoveryReadiness::EndpointProvider.new
23
+ end
24
+
25
+ # @api private
26
+ class Handler < Seahorse::Client::Handler
27
+ def call(context)
28
+ # If endpoint was discovered, do not resolve or apply the endpoint.
29
+ unless context[:discovered_endpoint]
30
+ params = parameters_for_operation(context)
31
+ endpoint = context.config.endpoint_provider.resolve_endpoint(params)
32
+
33
+ context.http_request.endpoint = endpoint.url
34
+ apply_endpoint_headers(context, endpoint.headers)
35
+ end
36
+
37
+ context[:endpoint_params] = params
38
+ context[:auth_scheme] =
39
+ Aws::Endpoints.resolve_auth_scheme(context, endpoint)
40
+
41
+ @handler.call(context)
42
+ end
43
+
44
+ private
45
+
46
+ def apply_endpoint_headers(context, headers)
47
+ headers.each do |key, values|
48
+ value = values
49
+ .compact
50
+ .map { |s| Seahorse::Util.escape_header_list_string(s.to_s) }
51
+ .join(',')
52
+
53
+ context.http_request.headers[key] = value
54
+ end
55
+ end
56
+
57
+ def parameters_for_operation(context)
58
+ case context.operation_name
59
+ when :create_cell
60
+ Aws::Route53RecoveryReadiness::Endpoints::CreateCell.build(context)
61
+ when :create_cross_account_authorization
62
+ Aws::Route53RecoveryReadiness::Endpoints::CreateCrossAccountAuthorization.build(context)
63
+ when :create_readiness_check
64
+ Aws::Route53RecoveryReadiness::Endpoints::CreateReadinessCheck.build(context)
65
+ when :create_recovery_group
66
+ Aws::Route53RecoveryReadiness::Endpoints::CreateRecoveryGroup.build(context)
67
+ when :create_resource_set
68
+ Aws::Route53RecoveryReadiness::Endpoints::CreateResourceSet.build(context)
69
+ when :delete_cell
70
+ Aws::Route53RecoveryReadiness::Endpoints::DeleteCell.build(context)
71
+ when :delete_cross_account_authorization
72
+ Aws::Route53RecoveryReadiness::Endpoints::DeleteCrossAccountAuthorization.build(context)
73
+ when :delete_readiness_check
74
+ Aws::Route53RecoveryReadiness::Endpoints::DeleteReadinessCheck.build(context)
75
+ when :delete_recovery_group
76
+ Aws::Route53RecoveryReadiness::Endpoints::DeleteRecoveryGroup.build(context)
77
+ when :delete_resource_set
78
+ Aws::Route53RecoveryReadiness::Endpoints::DeleteResourceSet.build(context)
79
+ when :get_architecture_recommendations
80
+ Aws::Route53RecoveryReadiness::Endpoints::GetArchitectureRecommendations.build(context)
81
+ when :get_cell
82
+ Aws::Route53RecoveryReadiness::Endpoints::GetCell.build(context)
83
+ when :get_cell_readiness_summary
84
+ Aws::Route53RecoveryReadiness::Endpoints::GetCellReadinessSummary.build(context)
85
+ when :get_readiness_check
86
+ Aws::Route53RecoveryReadiness::Endpoints::GetReadinessCheck.build(context)
87
+ when :get_readiness_check_resource_status
88
+ Aws::Route53RecoveryReadiness::Endpoints::GetReadinessCheckResourceStatus.build(context)
89
+ when :get_readiness_check_status
90
+ Aws::Route53RecoveryReadiness::Endpoints::GetReadinessCheckStatus.build(context)
91
+ when :get_recovery_group
92
+ Aws::Route53RecoveryReadiness::Endpoints::GetRecoveryGroup.build(context)
93
+ when :get_recovery_group_readiness_summary
94
+ Aws::Route53RecoveryReadiness::Endpoints::GetRecoveryGroupReadinessSummary.build(context)
95
+ when :get_resource_set
96
+ Aws::Route53RecoveryReadiness::Endpoints::GetResourceSet.build(context)
97
+ when :list_cells
98
+ Aws::Route53RecoveryReadiness::Endpoints::ListCells.build(context)
99
+ when :list_cross_account_authorizations
100
+ Aws::Route53RecoveryReadiness::Endpoints::ListCrossAccountAuthorizations.build(context)
101
+ when :list_readiness_checks
102
+ Aws::Route53RecoveryReadiness::Endpoints::ListReadinessChecks.build(context)
103
+ when :list_recovery_groups
104
+ Aws::Route53RecoveryReadiness::Endpoints::ListRecoveryGroups.build(context)
105
+ when :list_resource_sets
106
+ Aws::Route53RecoveryReadiness::Endpoints::ListResourceSets.build(context)
107
+ when :list_rules
108
+ Aws::Route53RecoveryReadiness::Endpoints::ListRules.build(context)
109
+ when :list_tags_for_resources
110
+ Aws::Route53RecoveryReadiness::Endpoints::ListTagsForResources.build(context)
111
+ when :tag_resource
112
+ Aws::Route53RecoveryReadiness::Endpoints::TagResource.build(context)
113
+ when :untag_resource
114
+ Aws::Route53RecoveryReadiness::Endpoints::UntagResource.build(context)
115
+ when :update_cell
116
+ Aws::Route53RecoveryReadiness::Endpoints::UpdateCell.build(context)
117
+ when :update_readiness_check
118
+ Aws::Route53RecoveryReadiness::Endpoints::UpdateReadinessCheck.build(context)
119
+ when :update_recovery_group
120
+ Aws::Route53RecoveryReadiness::Endpoints::UpdateRecoveryGroup.build(context)
121
+ when :update_resource_set
122
+ Aws::Route53RecoveryReadiness::Endpoints::UpdateResourceSet.build(context)
123
+ end
124
+ end
125
+ end
126
+
127
+ def add_handlers(handlers, _config)
128
+ handlers.add(Handler, step: :build, priority: 75)
129
+ end
130
+ end
131
+ end
132
+ end