aws-sdk-clouddirectory 1.41.0 → 1.43.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,200 @@
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::CloudDirectory
12
+ module Plugins
13
+ class Endpoints < Seahorse::Client::Plugin
14
+ option(
15
+ :endpoint_provider,
16
+ doc_type: 'Aws::CloudDirectory::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::CloudDirectory::EndpointParameters`'
21
+ ) do |cfg|
22
+ Aws::CloudDirectory::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 :add_facet_to_object
60
+ Aws::CloudDirectory::Endpoints::AddFacetToObject.build(context)
61
+ when :apply_schema
62
+ Aws::CloudDirectory::Endpoints::ApplySchema.build(context)
63
+ when :attach_object
64
+ Aws::CloudDirectory::Endpoints::AttachObject.build(context)
65
+ when :attach_policy
66
+ Aws::CloudDirectory::Endpoints::AttachPolicy.build(context)
67
+ when :attach_to_index
68
+ Aws::CloudDirectory::Endpoints::AttachToIndex.build(context)
69
+ when :attach_typed_link
70
+ Aws::CloudDirectory::Endpoints::AttachTypedLink.build(context)
71
+ when :batch_read
72
+ Aws::CloudDirectory::Endpoints::BatchRead.build(context)
73
+ when :batch_write
74
+ Aws::CloudDirectory::Endpoints::BatchWrite.build(context)
75
+ when :create_directory
76
+ Aws::CloudDirectory::Endpoints::CreateDirectory.build(context)
77
+ when :create_facet
78
+ Aws::CloudDirectory::Endpoints::CreateFacet.build(context)
79
+ when :create_index
80
+ Aws::CloudDirectory::Endpoints::CreateIndex.build(context)
81
+ when :create_object
82
+ Aws::CloudDirectory::Endpoints::CreateObject.build(context)
83
+ when :create_schema
84
+ Aws::CloudDirectory::Endpoints::CreateSchema.build(context)
85
+ when :create_typed_link_facet
86
+ Aws::CloudDirectory::Endpoints::CreateTypedLinkFacet.build(context)
87
+ when :delete_directory
88
+ Aws::CloudDirectory::Endpoints::DeleteDirectory.build(context)
89
+ when :delete_facet
90
+ Aws::CloudDirectory::Endpoints::DeleteFacet.build(context)
91
+ when :delete_object
92
+ Aws::CloudDirectory::Endpoints::DeleteObject.build(context)
93
+ when :delete_schema
94
+ Aws::CloudDirectory::Endpoints::DeleteSchema.build(context)
95
+ when :delete_typed_link_facet
96
+ Aws::CloudDirectory::Endpoints::DeleteTypedLinkFacet.build(context)
97
+ when :detach_from_index
98
+ Aws::CloudDirectory::Endpoints::DetachFromIndex.build(context)
99
+ when :detach_object
100
+ Aws::CloudDirectory::Endpoints::DetachObject.build(context)
101
+ when :detach_policy
102
+ Aws::CloudDirectory::Endpoints::DetachPolicy.build(context)
103
+ when :detach_typed_link
104
+ Aws::CloudDirectory::Endpoints::DetachTypedLink.build(context)
105
+ when :disable_directory
106
+ Aws::CloudDirectory::Endpoints::DisableDirectory.build(context)
107
+ when :enable_directory
108
+ Aws::CloudDirectory::Endpoints::EnableDirectory.build(context)
109
+ when :get_applied_schema_version
110
+ Aws::CloudDirectory::Endpoints::GetAppliedSchemaVersion.build(context)
111
+ when :get_directory
112
+ Aws::CloudDirectory::Endpoints::GetDirectory.build(context)
113
+ when :get_facet
114
+ Aws::CloudDirectory::Endpoints::GetFacet.build(context)
115
+ when :get_link_attributes
116
+ Aws::CloudDirectory::Endpoints::GetLinkAttributes.build(context)
117
+ when :get_object_attributes
118
+ Aws::CloudDirectory::Endpoints::GetObjectAttributes.build(context)
119
+ when :get_object_information
120
+ Aws::CloudDirectory::Endpoints::GetObjectInformation.build(context)
121
+ when :get_schema_as_json
122
+ Aws::CloudDirectory::Endpoints::GetSchemaAsJson.build(context)
123
+ when :get_typed_link_facet_information
124
+ Aws::CloudDirectory::Endpoints::GetTypedLinkFacetInformation.build(context)
125
+ when :list_applied_schema_arns
126
+ Aws::CloudDirectory::Endpoints::ListAppliedSchemaArns.build(context)
127
+ when :list_attached_indices
128
+ Aws::CloudDirectory::Endpoints::ListAttachedIndices.build(context)
129
+ when :list_development_schema_arns
130
+ Aws::CloudDirectory::Endpoints::ListDevelopmentSchemaArns.build(context)
131
+ when :list_directories
132
+ Aws::CloudDirectory::Endpoints::ListDirectories.build(context)
133
+ when :list_facet_attributes
134
+ Aws::CloudDirectory::Endpoints::ListFacetAttributes.build(context)
135
+ when :list_facet_names
136
+ Aws::CloudDirectory::Endpoints::ListFacetNames.build(context)
137
+ when :list_incoming_typed_links
138
+ Aws::CloudDirectory::Endpoints::ListIncomingTypedLinks.build(context)
139
+ when :list_index
140
+ Aws::CloudDirectory::Endpoints::ListIndex.build(context)
141
+ when :list_managed_schema_arns
142
+ Aws::CloudDirectory::Endpoints::ListManagedSchemaArns.build(context)
143
+ when :list_object_attributes
144
+ Aws::CloudDirectory::Endpoints::ListObjectAttributes.build(context)
145
+ when :list_object_children
146
+ Aws::CloudDirectory::Endpoints::ListObjectChildren.build(context)
147
+ when :list_object_parent_paths
148
+ Aws::CloudDirectory::Endpoints::ListObjectParentPaths.build(context)
149
+ when :list_object_parents
150
+ Aws::CloudDirectory::Endpoints::ListObjectParents.build(context)
151
+ when :list_object_policies
152
+ Aws::CloudDirectory::Endpoints::ListObjectPolicies.build(context)
153
+ when :list_outgoing_typed_links
154
+ Aws::CloudDirectory::Endpoints::ListOutgoingTypedLinks.build(context)
155
+ when :list_policy_attachments
156
+ Aws::CloudDirectory::Endpoints::ListPolicyAttachments.build(context)
157
+ when :list_published_schema_arns
158
+ Aws::CloudDirectory::Endpoints::ListPublishedSchemaArns.build(context)
159
+ when :list_tags_for_resource
160
+ Aws::CloudDirectory::Endpoints::ListTagsForResource.build(context)
161
+ when :list_typed_link_facet_attributes
162
+ Aws::CloudDirectory::Endpoints::ListTypedLinkFacetAttributes.build(context)
163
+ when :list_typed_link_facet_names
164
+ Aws::CloudDirectory::Endpoints::ListTypedLinkFacetNames.build(context)
165
+ when :lookup_policy
166
+ Aws::CloudDirectory::Endpoints::LookupPolicy.build(context)
167
+ when :publish_schema
168
+ Aws::CloudDirectory::Endpoints::PublishSchema.build(context)
169
+ when :put_schema_from_json
170
+ Aws::CloudDirectory::Endpoints::PutSchemaFromJson.build(context)
171
+ when :remove_facet_from_object
172
+ Aws::CloudDirectory::Endpoints::RemoveFacetFromObject.build(context)
173
+ when :tag_resource
174
+ Aws::CloudDirectory::Endpoints::TagResource.build(context)
175
+ when :untag_resource
176
+ Aws::CloudDirectory::Endpoints::UntagResource.build(context)
177
+ when :update_facet
178
+ Aws::CloudDirectory::Endpoints::UpdateFacet.build(context)
179
+ when :update_link_attributes
180
+ Aws::CloudDirectory::Endpoints::UpdateLinkAttributes.build(context)
181
+ when :update_object_attributes
182
+ Aws::CloudDirectory::Endpoints::UpdateObjectAttributes.build(context)
183
+ when :update_schema
184
+ Aws::CloudDirectory::Endpoints::UpdateSchema.build(context)
185
+ when :update_typed_link_facet
186
+ Aws::CloudDirectory::Endpoints::UpdateTypedLinkFacet.build(context)
187
+ when :upgrade_applied_schema
188
+ Aws::CloudDirectory::Endpoints::UpgradeAppliedSchema.build(context)
189
+ when :upgrade_published_schema
190
+ Aws::CloudDirectory::Endpoints::UpgradePublishedSchema.build(context)
191
+ end
192
+ end
193
+ end
194
+
195
+ def add_handlers(handlers, _config)
196
+ handlers.add(Handler, step: :build, priority: 75)
197
+ end
198
+ end
199
+ end
200
+ end