aws-sdk-workspacesweb 1.5.0 → 1.7.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,170 @@
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::WorkSpacesWeb
12
+ module Plugins
13
+ class Endpoints < Seahorse::Client::Plugin
14
+ option(
15
+ :endpoint_provider,
16
+ doc_type: 'Aws::WorkSpacesWeb::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::WorkSpacesWeb::EndpointParameters`'
21
+ ) do |cfg|
22
+ Aws::WorkSpacesWeb::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_browser_settings
60
+ Aws::WorkSpacesWeb::Endpoints::AssociateBrowserSettings.build(context)
61
+ when :associate_network_settings
62
+ Aws::WorkSpacesWeb::Endpoints::AssociateNetworkSettings.build(context)
63
+ when :associate_trust_store
64
+ Aws::WorkSpacesWeb::Endpoints::AssociateTrustStore.build(context)
65
+ when :associate_user_access_logging_settings
66
+ Aws::WorkSpacesWeb::Endpoints::AssociateUserAccessLoggingSettings.build(context)
67
+ when :associate_user_settings
68
+ Aws::WorkSpacesWeb::Endpoints::AssociateUserSettings.build(context)
69
+ when :create_browser_settings
70
+ Aws::WorkSpacesWeb::Endpoints::CreateBrowserSettings.build(context)
71
+ when :create_identity_provider
72
+ Aws::WorkSpacesWeb::Endpoints::CreateIdentityProvider.build(context)
73
+ when :create_network_settings
74
+ Aws::WorkSpacesWeb::Endpoints::CreateNetworkSettings.build(context)
75
+ when :create_portal
76
+ Aws::WorkSpacesWeb::Endpoints::CreatePortal.build(context)
77
+ when :create_trust_store
78
+ Aws::WorkSpacesWeb::Endpoints::CreateTrustStore.build(context)
79
+ when :create_user_access_logging_settings
80
+ Aws::WorkSpacesWeb::Endpoints::CreateUserAccessLoggingSettings.build(context)
81
+ when :create_user_settings
82
+ Aws::WorkSpacesWeb::Endpoints::CreateUserSettings.build(context)
83
+ when :delete_browser_settings
84
+ Aws::WorkSpacesWeb::Endpoints::DeleteBrowserSettings.build(context)
85
+ when :delete_identity_provider
86
+ Aws::WorkSpacesWeb::Endpoints::DeleteIdentityProvider.build(context)
87
+ when :delete_network_settings
88
+ Aws::WorkSpacesWeb::Endpoints::DeleteNetworkSettings.build(context)
89
+ when :delete_portal
90
+ Aws::WorkSpacesWeb::Endpoints::DeletePortal.build(context)
91
+ when :delete_trust_store
92
+ Aws::WorkSpacesWeb::Endpoints::DeleteTrustStore.build(context)
93
+ when :delete_user_access_logging_settings
94
+ Aws::WorkSpacesWeb::Endpoints::DeleteUserAccessLoggingSettings.build(context)
95
+ when :delete_user_settings
96
+ Aws::WorkSpacesWeb::Endpoints::DeleteUserSettings.build(context)
97
+ when :disassociate_browser_settings
98
+ Aws::WorkSpacesWeb::Endpoints::DisassociateBrowserSettings.build(context)
99
+ when :disassociate_network_settings
100
+ Aws::WorkSpacesWeb::Endpoints::DisassociateNetworkSettings.build(context)
101
+ when :disassociate_trust_store
102
+ Aws::WorkSpacesWeb::Endpoints::DisassociateTrustStore.build(context)
103
+ when :disassociate_user_access_logging_settings
104
+ Aws::WorkSpacesWeb::Endpoints::DisassociateUserAccessLoggingSettings.build(context)
105
+ when :disassociate_user_settings
106
+ Aws::WorkSpacesWeb::Endpoints::DisassociateUserSettings.build(context)
107
+ when :get_browser_settings
108
+ Aws::WorkSpacesWeb::Endpoints::GetBrowserSettings.build(context)
109
+ when :get_identity_provider
110
+ Aws::WorkSpacesWeb::Endpoints::GetIdentityProvider.build(context)
111
+ when :get_network_settings
112
+ Aws::WorkSpacesWeb::Endpoints::GetNetworkSettings.build(context)
113
+ when :get_portal
114
+ Aws::WorkSpacesWeb::Endpoints::GetPortal.build(context)
115
+ when :get_portal_service_provider_metadata
116
+ Aws::WorkSpacesWeb::Endpoints::GetPortalServiceProviderMetadata.build(context)
117
+ when :get_trust_store
118
+ Aws::WorkSpacesWeb::Endpoints::GetTrustStore.build(context)
119
+ when :get_trust_store_certificate
120
+ Aws::WorkSpacesWeb::Endpoints::GetTrustStoreCertificate.build(context)
121
+ when :get_user_access_logging_settings
122
+ Aws::WorkSpacesWeb::Endpoints::GetUserAccessLoggingSettings.build(context)
123
+ when :get_user_settings
124
+ Aws::WorkSpacesWeb::Endpoints::GetUserSettings.build(context)
125
+ when :list_browser_settings
126
+ Aws::WorkSpacesWeb::Endpoints::ListBrowserSettings.build(context)
127
+ when :list_identity_providers
128
+ Aws::WorkSpacesWeb::Endpoints::ListIdentityProviders.build(context)
129
+ when :list_network_settings
130
+ Aws::WorkSpacesWeb::Endpoints::ListNetworkSettings.build(context)
131
+ when :list_portals
132
+ Aws::WorkSpacesWeb::Endpoints::ListPortals.build(context)
133
+ when :list_tags_for_resource
134
+ Aws::WorkSpacesWeb::Endpoints::ListTagsForResource.build(context)
135
+ when :list_trust_store_certificates
136
+ Aws::WorkSpacesWeb::Endpoints::ListTrustStoreCertificates.build(context)
137
+ when :list_trust_stores
138
+ Aws::WorkSpacesWeb::Endpoints::ListTrustStores.build(context)
139
+ when :list_user_access_logging_settings
140
+ Aws::WorkSpacesWeb::Endpoints::ListUserAccessLoggingSettings.build(context)
141
+ when :list_user_settings
142
+ Aws::WorkSpacesWeb::Endpoints::ListUserSettings.build(context)
143
+ when :tag_resource
144
+ Aws::WorkSpacesWeb::Endpoints::TagResource.build(context)
145
+ when :untag_resource
146
+ Aws::WorkSpacesWeb::Endpoints::UntagResource.build(context)
147
+ when :update_browser_settings
148
+ Aws::WorkSpacesWeb::Endpoints::UpdateBrowserSettings.build(context)
149
+ when :update_identity_provider
150
+ Aws::WorkSpacesWeb::Endpoints::UpdateIdentityProvider.build(context)
151
+ when :update_network_settings
152
+ Aws::WorkSpacesWeb::Endpoints::UpdateNetworkSettings.build(context)
153
+ when :update_portal
154
+ Aws::WorkSpacesWeb::Endpoints::UpdatePortal.build(context)
155
+ when :update_trust_store
156
+ Aws::WorkSpacesWeb::Endpoints::UpdateTrustStore.build(context)
157
+ when :update_user_access_logging_settings
158
+ Aws::WorkSpacesWeb::Endpoints::UpdateUserAccessLoggingSettings.build(context)
159
+ when :update_user_settings
160
+ Aws::WorkSpacesWeb::Endpoints::UpdateUserSettings.build(context)
161
+ end
162
+ end
163
+ end
164
+
165
+ def add_handlers(handlers, _config)
166
+ handlers.add(Handler, step: :build, priority: 75)
167
+ end
168
+ end
169
+ end
170
+ end