aws-sdk-greengrass 1.50.0 → 1.52.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,252 @@
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::Greengrass
12
+ module Plugins
13
+ class Endpoints < Seahorse::Client::Plugin
14
+ option(
15
+ :endpoint_provider,
16
+ doc_type: 'Aws::Greengrass::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::Greengrass::EndpointParameters`'
21
+ ) do |cfg|
22
+ Aws::Greengrass::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 :associate_role_to_group
60
+ Aws::Greengrass::Endpoints::AssociateRoleToGroup.build(context)
61
+ when :associate_service_role_to_account
62
+ Aws::Greengrass::Endpoints::AssociateServiceRoleToAccount.build(context)
63
+ when :create_connector_definition
64
+ Aws::Greengrass::Endpoints::CreateConnectorDefinition.build(context)
65
+ when :create_connector_definition_version
66
+ Aws::Greengrass::Endpoints::CreateConnectorDefinitionVersion.build(context)
67
+ when :create_core_definition
68
+ Aws::Greengrass::Endpoints::CreateCoreDefinition.build(context)
69
+ when :create_core_definition_version
70
+ Aws::Greengrass::Endpoints::CreateCoreDefinitionVersion.build(context)
71
+ when :create_deployment
72
+ Aws::Greengrass::Endpoints::CreateDeployment.build(context)
73
+ when :create_device_definition
74
+ Aws::Greengrass::Endpoints::CreateDeviceDefinition.build(context)
75
+ when :create_device_definition_version
76
+ Aws::Greengrass::Endpoints::CreateDeviceDefinitionVersion.build(context)
77
+ when :create_function_definition
78
+ Aws::Greengrass::Endpoints::CreateFunctionDefinition.build(context)
79
+ when :create_function_definition_version
80
+ Aws::Greengrass::Endpoints::CreateFunctionDefinitionVersion.build(context)
81
+ when :create_group
82
+ Aws::Greengrass::Endpoints::CreateGroup.build(context)
83
+ when :create_group_certificate_authority
84
+ Aws::Greengrass::Endpoints::CreateGroupCertificateAuthority.build(context)
85
+ when :create_group_version
86
+ Aws::Greengrass::Endpoints::CreateGroupVersion.build(context)
87
+ when :create_logger_definition
88
+ Aws::Greengrass::Endpoints::CreateLoggerDefinition.build(context)
89
+ when :create_logger_definition_version
90
+ Aws::Greengrass::Endpoints::CreateLoggerDefinitionVersion.build(context)
91
+ when :create_resource_definition
92
+ Aws::Greengrass::Endpoints::CreateResourceDefinition.build(context)
93
+ when :create_resource_definition_version
94
+ Aws::Greengrass::Endpoints::CreateResourceDefinitionVersion.build(context)
95
+ when :create_software_update_job
96
+ Aws::Greengrass::Endpoints::CreateSoftwareUpdateJob.build(context)
97
+ when :create_subscription_definition
98
+ Aws::Greengrass::Endpoints::CreateSubscriptionDefinition.build(context)
99
+ when :create_subscription_definition_version
100
+ Aws::Greengrass::Endpoints::CreateSubscriptionDefinitionVersion.build(context)
101
+ when :delete_connector_definition
102
+ Aws::Greengrass::Endpoints::DeleteConnectorDefinition.build(context)
103
+ when :delete_core_definition
104
+ Aws::Greengrass::Endpoints::DeleteCoreDefinition.build(context)
105
+ when :delete_device_definition
106
+ Aws::Greengrass::Endpoints::DeleteDeviceDefinition.build(context)
107
+ when :delete_function_definition
108
+ Aws::Greengrass::Endpoints::DeleteFunctionDefinition.build(context)
109
+ when :delete_group
110
+ Aws::Greengrass::Endpoints::DeleteGroup.build(context)
111
+ when :delete_logger_definition
112
+ Aws::Greengrass::Endpoints::DeleteLoggerDefinition.build(context)
113
+ when :delete_resource_definition
114
+ Aws::Greengrass::Endpoints::DeleteResourceDefinition.build(context)
115
+ when :delete_subscription_definition
116
+ Aws::Greengrass::Endpoints::DeleteSubscriptionDefinition.build(context)
117
+ when :disassociate_role_from_group
118
+ Aws::Greengrass::Endpoints::DisassociateRoleFromGroup.build(context)
119
+ when :disassociate_service_role_from_account
120
+ Aws::Greengrass::Endpoints::DisassociateServiceRoleFromAccount.build(context)
121
+ when :get_associated_role
122
+ Aws::Greengrass::Endpoints::GetAssociatedRole.build(context)
123
+ when :get_bulk_deployment_status
124
+ Aws::Greengrass::Endpoints::GetBulkDeploymentStatus.build(context)
125
+ when :get_connectivity_info
126
+ Aws::Greengrass::Endpoints::GetConnectivityInfo.build(context)
127
+ when :get_connector_definition
128
+ Aws::Greengrass::Endpoints::GetConnectorDefinition.build(context)
129
+ when :get_connector_definition_version
130
+ Aws::Greengrass::Endpoints::GetConnectorDefinitionVersion.build(context)
131
+ when :get_core_definition
132
+ Aws::Greengrass::Endpoints::GetCoreDefinition.build(context)
133
+ when :get_core_definition_version
134
+ Aws::Greengrass::Endpoints::GetCoreDefinitionVersion.build(context)
135
+ when :get_deployment_status
136
+ Aws::Greengrass::Endpoints::GetDeploymentStatus.build(context)
137
+ when :get_device_definition
138
+ Aws::Greengrass::Endpoints::GetDeviceDefinition.build(context)
139
+ when :get_device_definition_version
140
+ Aws::Greengrass::Endpoints::GetDeviceDefinitionVersion.build(context)
141
+ when :get_function_definition
142
+ Aws::Greengrass::Endpoints::GetFunctionDefinition.build(context)
143
+ when :get_function_definition_version
144
+ Aws::Greengrass::Endpoints::GetFunctionDefinitionVersion.build(context)
145
+ when :get_group
146
+ Aws::Greengrass::Endpoints::GetGroup.build(context)
147
+ when :get_group_certificate_authority
148
+ Aws::Greengrass::Endpoints::GetGroupCertificateAuthority.build(context)
149
+ when :get_group_certificate_configuration
150
+ Aws::Greengrass::Endpoints::GetGroupCertificateConfiguration.build(context)
151
+ when :get_group_version
152
+ Aws::Greengrass::Endpoints::GetGroupVersion.build(context)
153
+ when :get_logger_definition
154
+ Aws::Greengrass::Endpoints::GetLoggerDefinition.build(context)
155
+ when :get_logger_definition_version
156
+ Aws::Greengrass::Endpoints::GetLoggerDefinitionVersion.build(context)
157
+ when :get_resource_definition
158
+ Aws::Greengrass::Endpoints::GetResourceDefinition.build(context)
159
+ when :get_resource_definition_version
160
+ Aws::Greengrass::Endpoints::GetResourceDefinitionVersion.build(context)
161
+ when :get_service_role_for_account
162
+ Aws::Greengrass::Endpoints::GetServiceRoleForAccount.build(context)
163
+ when :get_subscription_definition
164
+ Aws::Greengrass::Endpoints::GetSubscriptionDefinition.build(context)
165
+ when :get_subscription_definition_version
166
+ Aws::Greengrass::Endpoints::GetSubscriptionDefinitionVersion.build(context)
167
+ when :get_thing_runtime_configuration
168
+ Aws::Greengrass::Endpoints::GetThingRuntimeConfiguration.build(context)
169
+ when :list_bulk_deployment_detailed_reports
170
+ Aws::Greengrass::Endpoints::ListBulkDeploymentDetailedReports.build(context)
171
+ when :list_bulk_deployments
172
+ Aws::Greengrass::Endpoints::ListBulkDeployments.build(context)
173
+ when :list_connector_definition_versions
174
+ Aws::Greengrass::Endpoints::ListConnectorDefinitionVersions.build(context)
175
+ when :list_connector_definitions
176
+ Aws::Greengrass::Endpoints::ListConnectorDefinitions.build(context)
177
+ when :list_core_definition_versions
178
+ Aws::Greengrass::Endpoints::ListCoreDefinitionVersions.build(context)
179
+ when :list_core_definitions
180
+ Aws::Greengrass::Endpoints::ListCoreDefinitions.build(context)
181
+ when :list_deployments
182
+ Aws::Greengrass::Endpoints::ListDeployments.build(context)
183
+ when :list_device_definition_versions
184
+ Aws::Greengrass::Endpoints::ListDeviceDefinitionVersions.build(context)
185
+ when :list_device_definitions
186
+ Aws::Greengrass::Endpoints::ListDeviceDefinitions.build(context)
187
+ when :list_function_definition_versions
188
+ Aws::Greengrass::Endpoints::ListFunctionDefinitionVersions.build(context)
189
+ when :list_function_definitions
190
+ Aws::Greengrass::Endpoints::ListFunctionDefinitions.build(context)
191
+ when :list_group_certificate_authorities
192
+ Aws::Greengrass::Endpoints::ListGroupCertificateAuthorities.build(context)
193
+ when :list_group_versions
194
+ Aws::Greengrass::Endpoints::ListGroupVersions.build(context)
195
+ when :list_groups
196
+ Aws::Greengrass::Endpoints::ListGroups.build(context)
197
+ when :list_logger_definition_versions
198
+ Aws::Greengrass::Endpoints::ListLoggerDefinitionVersions.build(context)
199
+ when :list_logger_definitions
200
+ Aws::Greengrass::Endpoints::ListLoggerDefinitions.build(context)
201
+ when :list_resource_definition_versions
202
+ Aws::Greengrass::Endpoints::ListResourceDefinitionVersions.build(context)
203
+ when :list_resource_definitions
204
+ Aws::Greengrass::Endpoints::ListResourceDefinitions.build(context)
205
+ when :list_subscription_definition_versions
206
+ Aws::Greengrass::Endpoints::ListSubscriptionDefinitionVersions.build(context)
207
+ when :list_subscription_definitions
208
+ Aws::Greengrass::Endpoints::ListSubscriptionDefinitions.build(context)
209
+ when :list_tags_for_resource
210
+ Aws::Greengrass::Endpoints::ListTagsForResource.build(context)
211
+ when :reset_deployments
212
+ Aws::Greengrass::Endpoints::ResetDeployments.build(context)
213
+ when :start_bulk_deployment
214
+ Aws::Greengrass::Endpoints::StartBulkDeployment.build(context)
215
+ when :stop_bulk_deployment
216
+ Aws::Greengrass::Endpoints::StopBulkDeployment.build(context)
217
+ when :tag_resource
218
+ Aws::Greengrass::Endpoints::TagResource.build(context)
219
+ when :untag_resource
220
+ Aws::Greengrass::Endpoints::UntagResource.build(context)
221
+ when :update_connectivity_info
222
+ Aws::Greengrass::Endpoints::UpdateConnectivityInfo.build(context)
223
+ when :update_connector_definition
224
+ Aws::Greengrass::Endpoints::UpdateConnectorDefinition.build(context)
225
+ when :update_core_definition
226
+ Aws::Greengrass::Endpoints::UpdateCoreDefinition.build(context)
227
+ when :update_device_definition
228
+ Aws::Greengrass::Endpoints::UpdateDeviceDefinition.build(context)
229
+ when :update_function_definition
230
+ Aws::Greengrass::Endpoints::UpdateFunctionDefinition.build(context)
231
+ when :update_group
232
+ Aws::Greengrass::Endpoints::UpdateGroup.build(context)
233
+ when :update_group_certificate_configuration
234
+ Aws::Greengrass::Endpoints::UpdateGroupCertificateConfiguration.build(context)
235
+ when :update_logger_definition
236
+ Aws::Greengrass::Endpoints::UpdateLoggerDefinition.build(context)
237
+ when :update_resource_definition
238
+ Aws::Greengrass::Endpoints::UpdateResourceDefinition.build(context)
239
+ when :update_subscription_definition
240
+ Aws::Greengrass::Endpoints::UpdateSubscriptionDefinition.build(context)
241
+ when :update_thing_runtime_configuration
242
+ Aws::Greengrass::Endpoints::UpdateThingRuntimeConfiguration.build(context)
243
+ end
244
+ end
245
+ end
246
+
247
+ def add_handlers(handlers, _config)
248
+ handlers.add(Handler, step: :build, priority: 75)
249
+ end
250
+ end
251
+ end
252
+ end