aws-sdk-geomaps 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,231 @@
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::GeoMaps
12
+ # @api private
13
+ module ClientApi
14
+
15
+ include Seahorse::Model
16
+
17
+ AccessDeniedException = Shapes::StructureShape.new(name: 'AccessDeniedException')
18
+ ApiKey = Shapes::StringShape.new(name: 'ApiKey')
19
+ Blob = Shapes::BlobShape.new(name: 'Blob')
20
+ ColorScheme = Shapes::StringShape.new(name: 'ColorScheme')
21
+ CompactOverlay = Shapes::StringShape.new(name: 'CompactOverlay')
22
+ CountryCode = Shapes::StringShape.new(name: 'CountryCode')
23
+ DistanceMeters = Shapes::IntegerShape.new(name: 'DistanceMeters')
24
+ GeoJsonOverlay = Shapes::StringShape.new(name: 'GeoJsonOverlay')
25
+ GetGlyphsRequest = Shapes::StructureShape.new(name: 'GetGlyphsRequest')
26
+ GetGlyphsRequestFontStackString = Shapes::StringShape.new(name: 'GetGlyphsRequestFontStackString')
27
+ GetGlyphsRequestFontUnicodeRangeString = Shapes::StringShape.new(name: 'GetGlyphsRequestFontUnicodeRangeString')
28
+ GetGlyphsResponse = Shapes::StructureShape.new(name: 'GetGlyphsResponse')
29
+ GetSpritesRequest = Shapes::StructureShape.new(name: 'GetSpritesRequest')
30
+ GetSpritesRequestFileNameString = Shapes::StringShape.new(name: 'GetSpritesRequestFileNameString')
31
+ GetSpritesResponse = Shapes::StructureShape.new(name: 'GetSpritesResponse')
32
+ GetStaticMapRequest = Shapes::StructureShape.new(name: 'GetStaticMapRequest')
33
+ GetStaticMapRequestFileNameString = Shapes::StringShape.new(name: 'GetStaticMapRequestFileNameString')
34
+ GetStaticMapRequestHeightInteger = Shapes::IntegerShape.new(name: 'GetStaticMapRequestHeightInteger')
35
+ GetStaticMapRequestWidthInteger = Shapes::IntegerShape.new(name: 'GetStaticMapRequestWidthInteger')
36
+ GetStaticMapRequestZoomFloat = Shapes::FloatShape.new(name: 'GetStaticMapRequestZoomFloat')
37
+ GetStaticMapResponse = Shapes::StructureShape.new(name: 'GetStaticMapResponse')
38
+ GetStyleDescriptorRequest = Shapes::StructureShape.new(name: 'GetStyleDescriptorRequest')
39
+ GetStyleDescriptorResponse = Shapes::StructureShape.new(name: 'GetStyleDescriptorResponse')
40
+ GetTileRequest = Shapes::StructureShape.new(name: 'GetTileRequest')
41
+ GetTileRequestXString = Shapes::StringShape.new(name: 'GetTileRequestXString')
42
+ GetTileRequestYString = Shapes::StringShape.new(name: 'GetTileRequestYString')
43
+ GetTileRequestZString = Shapes::StringShape.new(name: 'GetTileRequestZString')
44
+ GetTileResponse = Shapes::StructureShape.new(name: 'GetTileResponse')
45
+ Integer = Shapes::IntegerShape.new(name: 'Integer')
46
+ InternalServerException = Shapes::StructureShape.new(name: 'InternalServerException')
47
+ MapStyle = Shapes::StringShape.new(name: 'MapStyle')
48
+ PositionListString = Shapes::StringShape.new(name: 'PositionListString')
49
+ PositionString = Shapes::StringShape.new(name: 'PositionString')
50
+ ScaleBarUnit = Shapes::StringShape.new(name: 'ScaleBarUnit')
51
+ StaticMapStyle = Shapes::StringShape.new(name: 'StaticMapStyle')
52
+ String = Shapes::StringShape.new(name: 'String')
53
+ ThrottlingException = Shapes::StructureShape.new(name: 'ThrottlingException')
54
+ Tileset = Shapes::StringShape.new(name: 'Tileset')
55
+ ValidationException = Shapes::StructureShape.new(name: 'ValidationException')
56
+ ValidationExceptionField = Shapes::StructureShape.new(name: 'ValidationExceptionField')
57
+ ValidationExceptionFieldList = Shapes::ListShape.new(name: 'ValidationExceptionFieldList')
58
+ ValidationExceptionReason = Shapes::StringShape.new(name: 'ValidationExceptionReason')
59
+ Variant = Shapes::StringShape.new(name: 'Variant')
60
+
61
+ AccessDeniedException.add_member(:message, Shapes::ShapeRef.new(shape: String, required: true, location_name: "message"))
62
+ AccessDeniedException.struct_class = Types::AccessDeniedException
63
+
64
+ GetGlyphsRequest.add_member(:font_stack, Shapes::ShapeRef.new(shape: GetGlyphsRequestFontStackString, required: true, location: "uri", location_name: "FontStack"))
65
+ GetGlyphsRequest.add_member(:font_unicode_range, Shapes::ShapeRef.new(shape: GetGlyphsRequestFontUnicodeRangeString, required: true, location: "uri", location_name: "FontUnicodeRange"))
66
+ GetGlyphsRequest.struct_class = Types::GetGlyphsRequest
67
+
68
+ GetGlyphsResponse.add_member(:blob, Shapes::ShapeRef.new(shape: Blob, location_name: "Blob"))
69
+ GetGlyphsResponse.add_member(:content_type, Shapes::ShapeRef.new(shape: String, location: "header", location_name: "Content-Type"))
70
+ GetGlyphsResponse.add_member(:cache_control, Shapes::ShapeRef.new(shape: String, location: "header", location_name: "Cache-Control"))
71
+ GetGlyphsResponse.add_member(:etag, Shapes::ShapeRef.new(shape: String, location: "header", location_name: "ETag"))
72
+ GetGlyphsResponse.struct_class = Types::GetGlyphsResponse
73
+ GetGlyphsResponse[:payload] = :blob
74
+ GetGlyphsResponse[:payload_member] = GetGlyphsResponse.member(:blob)
75
+
76
+ GetSpritesRequest.add_member(:file_name, Shapes::ShapeRef.new(shape: GetSpritesRequestFileNameString, required: true, location: "uri", location_name: "FileName"))
77
+ GetSpritesRequest.add_member(:style, Shapes::ShapeRef.new(shape: MapStyle, required: true, location: "uri", location_name: "Style"))
78
+ GetSpritesRequest.add_member(:color_scheme, Shapes::ShapeRef.new(shape: ColorScheme, required: true, location: "uri", location_name: "ColorScheme"))
79
+ GetSpritesRequest.add_member(:variant, Shapes::ShapeRef.new(shape: Variant, required: true, location: "uri", location_name: "Variant"))
80
+ GetSpritesRequest.struct_class = Types::GetSpritesRequest
81
+
82
+ GetSpritesResponse.add_member(:blob, Shapes::ShapeRef.new(shape: Blob, location_name: "Blob"))
83
+ GetSpritesResponse.add_member(:content_type, Shapes::ShapeRef.new(shape: String, location: "header", location_name: "Content-Type"))
84
+ GetSpritesResponse.add_member(:cache_control, Shapes::ShapeRef.new(shape: String, location: "header", location_name: "Cache-Control"))
85
+ GetSpritesResponse.add_member(:etag, Shapes::ShapeRef.new(shape: String, location: "header", location_name: "ETag"))
86
+ GetSpritesResponse.struct_class = Types::GetSpritesResponse
87
+ GetSpritesResponse[:payload] = :blob
88
+ GetSpritesResponse[:payload_member] = GetSpritesResponse.member(:blob)
89
+
90
+ GetStaticMapRequest.add_member(:bounding_box, Shapes::ShapeRef.new(shape: PositionListString, location: "querystring", location_name: "bounding-box"))
91
+ GetStaticMapRequest.add_member(:bounded_positions, Shapes::ShapeRef.new(shape: PositionListString, location: "querystring", location_name: "bounded-positions"))
92
+ GetStaticMapRequest.add_member(:center, Shapes::ShapeRef.new(shape: PositionString, location: "querystring", location_name: "center"))
93
+ GetStaticMapRequest.add_member(:compact_overlay, Shapes::ShapeRef.new(shape: CompactOverlay, location: "querystring", location_name: "compact-overlay"))
94
+ GetStaticMapRequest.add_member(:geo_json_overlay, Shapes::ShapeRef.new(shape: GeoJsonOverlay, location: "querystring", location_name: "geojson-overlay"))
95
+ GetStaticMapRequest.add_member(:height, Shapes::ShapeRef.new(shape: GetStaticMapRequestHeightInteger, required: true, location: "querystring", location_name: "height"))
96
+ GetStaticMapRequest.add_member(:key, Shapes::ShapeRef.new(shape: ApiKey, location: "querystring", location_name: "key"))
97
+ GetStaticMapRequest.add_member(:padding, Shapes::ShapeRef.new(shape: Integer, location: "querystring", location_name: "padding"))
98
+ GetStaticMapRequest.add_member(:radius, Shapes::ShapeRef.new(shape: DistanceMeters, location: "querystring", location_name: "radius", metadata: {"box"=>true}))
99
+ GetStaticMapRequest.add_member(:file_name, Shapes::ShapeRef.new(shape: GetStaticMapRequestFileNameString, required: true, location: "uri", location_name: "FileName"))
100
+ GetStaticMapRequest.add_member(:scale_bar_unit, Shapes::ShapeRef.new(shape: ScaleBarUnit, location: "querystring", location_name: "scale-unit"))
101
+ GetStaticMapRequest.add_member(:style, Shapes::ShapeRef.new(shape: StaticMapStyle, location: "querystring", location_name: "style"))
102
+ GetStaticMapRequest.add_member(:width, Shapes::ShapeRef.new(shape: GetStaticMapRequestWidthInteger, required: true, location: "querystring", location_name: "width"))
103
+ GetStaticMapRequest.add_member(:zoom, Shapes::ShapeRef.new(shape: GetStaticMapRequestZoomFloat, location: "querystring", location_name: "zoom"))
104
+ GetStaticMapRequest.struct_class = Types::GetStaticMapRequest
105
+
106
+ GetStaticMapResponse.add_member(:blob, Shapes::ShapeRef.new(shape: Blob, location_name: "Blob"))
107
+ GetStaticMapResponse.add_member(:content_type, Shapes::ShapeRef.new(shape: String, location: "header", location_name: "Content-Type"))
108
+ GetStaticMapResponse.add_member(:cache_control, Shapes::ShapeRef.new(shape: String, location: "header", location_name: "Cache-Control"))
109
+ GetStaticMapResponse.add_member(:etag, Shapes::ShapeRef.new(shape: String, location: "header", location_name: "ETag"))
110
+ GetStaticMapResponse.add_member(:pricing_bucket, Shapes::ShapeRef.new(shape: String, required: true, location: "header", location_name: "x-amz-geo-pricing-bucket"))
111
+ GetStaticMapResponse.struct_class = Types::GetStaticMapResponse
112
+ GetStaticMapResponse[:payload] = :blob
113
+ GetStaticMapResponse[:payload_member] = GetStaticMapResponse.member(:blob)
114
+
115
+ GetStyleDescriptorRequest.add_member(:style, Shapes::ShapeRef.new(shape: MapStyle, required: true, location: "uri", location_name: "Style"))
116
+ GetStyleDescriptorRequest.add_member(:color_scheme, Shapes::ShapeRef.new(shape: ColorScheme, location: "querystring", location_name: "color-scheme"))
117
+ GetStyleDescriptorRequest.add_member(:political_view, Shapes::ShapeRef.new(shape: CountryCode, location: "querystring", location_name: "political-view"))
118
+ GetStyleDescriptorRequest.add_member(:key, Shapes::ShapeRef.new(shape: ApiKey, location: "querystring", location_name: "key"))
119
+ GetStyleDescriptorRequest.struct_class = Types::GetStyleDescriptorRequest
120
+
121
+ GetStyleDescriptorResponse.add_member(:blob, Shapes::ShapeRef.new(shape: Blob, location_name: "Blob"))
122
+ GetStyleDescriptorResponse.add_member(:content_type, Shapes::ShapeRef.new(shape: String, location: "header", location_name: "Content-Type"))
123
+ GetStyleDescriptorResponse.add_member(:cache_control, Shapes::ShapeRef.new(shape: String, location: "header", location_name: "Cache-Control"))
124
+ GetStyleDescriptorResponse.add_member(:etag, Shapes::ShapeRef.new(shape: String, location: "header", location_name: "ETag"))
125
+ GetStyleDescriptorResponse.struct_class = Types::GetStyleDescriptorResponse
126
+ GetStyleDescriptorResponse[:payload] = :blob
127
+ GetStyleDescriptorResponse[:payload_member] = GetStyleDescriptorResponse.member(:blob)
128
+
129
+ GetTileRequest.add_member(:tileset, Shapes::ShapeRef.new(shape: Tileset, required: true, location: "uri", location_name: "Tileset"))
130
+ GetTileRequest.add_member(:z, Shapes::ShapeRef.new(shape: GetTileRequestZString, required: true, location: "uri", location_name: "Z"))
131
+ GetTileRequest.add_member(:x, Shapes::ShapeRef.new(shape: GetTileRequestXString, required: true, location: "uri", location_name: "X"))
132
+ GetTileRequest.add_member(:y, Shapes::ShapeRef.new(shape: GetTileRequestYString, required: true, location: "uri", location_name: "Y"))
133
+ GetTileRequest.add_member(:key, Shapes::ShapeRef.new(shape: ApiKey, location: "querystring", location_name: "key"))
134
+ GetTileRequest.struct_class = Types::GetTileRequest
135
+
136
+ GetTileResponse.add_member(:blob, Shapes::ShapeRef.new(shape: Blob, location_name: "Blob"))
137
+ GetTileResponse.add_member(:content_type, Shapes::ShapeRef.new(shape: String, location: "header", location_name: "Content-Type"))
138
+ GetTileResponse.add_member(:cache_control, Shapes::ShapeRef.new(shape: String, location: "header", location_name: "Cache-Control"))
139
+ GetTileResponse.add_member(:etag, Shapes::ShapeRef.new(shape: String, location: "header", location_name: "ETag"))
140
+ GetTileResponse.add_member(:pricing_bucket, Shapes::ShapeRef.new(shape: String, required: true, location: "header", location_name: "x-amz-geo-pricing-bucket"))
141
+ GetTileResponse.struct_class = Types::GetTileResponse
142
+ GetTileResponse[:payload] = :blob
143
+ GetTileResponse[:payload_member] = GetTileResponse.member(:blob)
144
+
145
+ InternalServerException.add_member(:message, Shapes::ShapeRef.new(shape: String, required: true, location_name: "message"))
146
+ InternalServerException.struct_class = Types::InternalServerException
147
+
148
+ ThrottlingException.add_member(:message, Shapes::ShapeRef.new(shape: String, required: true, location_name: "message"))
149
+ ThrottlingException.struct_class = Types::ThrottlingException
150
+
151
+ ValidationException.add_member(:message, Shapes::ShapeRef.new(shape: String, required: true, location_name: "message"))
152
+ ValidationException.add_member(:reason, Shapes::ShapeRef.new(shape: ValidationExceptionReason, required: true, location_name: "reason"))
153
+ ValidationException.add_member(:field_list, Shapes::ShapeRef.new(shape: ValidationExceptionFieldList, required: true, location_name: "fieldList"))
154
+ ValidationException.struct_class = Types::ValidationException
155
+
156
+ ValidationExceptionField.add_member(:name, Shapes::ShapeRef.new(shape: String, required: true, location_name: "name"))
157
+ ValidationExceptionField.add_member(:message, Shapes::ShapeRef.new(shape: String, required: true, location_name: "message"))
158
+ ValidationExceptionField.struct_class = Types::ValidationExceptionField
159
+
160
+ ValidationExceptionFieldList.member = Shapes::ShapeRef.new(shape: ValidationExceptionField)
161
+
162
+
163
+ # @api private
164
+ API = Seahorse::Model::Api.new.tap do |api|
165
+
166
+ api.version = "2020-11-19"
167
+
168
+ api.metadata = {
169
+ "apiVersion" => "2020-11-19",
170
+ "auth" => ["aws.auth#sigv4"],
171
+ "endpointPrefix" => "geo-maps",
172
+ "protocol" => "rest-json",
173
+ "protocols" => ["rest-json"],
174
+ "serviceFullName" => "Amazon Location Service Maps V2",
175
+ "serviceId" => "Geo Maps",
176
+ "signatureVersion" => "v4",
177
+ "signingName" => "geo-maps",
178
+ "uid" => "geo-maps-2020-11-19",
179
+ }
180
+
181
+ api.add_operation(:get_glyphs, Seahorse::Model::Operation.new.tap do |o|
182
+ o.name = "GetGlyphs"
183
+ o.http_method = "GET"
184
+ o.http_request_uri = "/glyphs/{FontStack}/{FontUnicodeRange}"
185
+ o.input = Shapes::ShapeRef.new(shape: GetGlyphsRequest)
186
+ o.output = Shapes::ShapeRef.new(shape: GetGlyphsResponse)
187
+ end)
188
+
189
+ api.add_operation(:get_sprites, Seahorse::Model::Operation.new.tap do |o|
190
+ o.name = "GetSprites"
191
+ o.http_method = "GET"
192
+ o.http_request_uri = "/styles/{Style}/{ColorScheme}/{Variant}/sprites/{FileName}"
193
+ o.input = Shapes::ShapeRef.new(shape: GetSpritesRequest)
194
+ o.output = Shapes::ShapeRef.new(shape: GetSpritesResponse)
195
+ end)
196
+
197
+ api.add_operation(:get_static_map, Seahorse::Model::Operation.new.tap do |o|
198
+ o.name = "GetStaticMap"
199
+ o.http_method = "GET"
200
+ o.http_request_uri = "/static/{FileName}"
201
+ o.input = Shapes::ShapeRef.new(shape: GetStaticMapRequest)
202
+ o.output = Shapes::ShapeRef.new(shape: GetStaticMapResponse)
203
+ o.errors << Shapes::ShapeRef.new(shape: InternalServerException)
204
+ o.errors << Shapes::ShapeRef.new(shape: AccessDeniedException)
205
+ o.errors << Shapes::ShapeRef.new(shape: ValidationException)
206
+ o.errors << Shapes::ShapeRef.new(shape: ThrottlingException)
207
+ end)
208
+
209
+ api.add_operation(:get_style_descriptor, Seahorse::Model::Operation.new.tap do |o|
210
+ o.name = "GetStyleDescriptor"
211
+ o.http_method = "GET"
212
+ o.http_request_uri = "/styles/{Style}/descriptor"
213
+ o.input = Shapes::ShapeRef.new(shape: GetStyleDescriptorRequest)
214
+ o.output = Shapes::ShapeRef.new(shape: GetStyleDescriptorResponse)
215
+ end)
216
+
217
+ api.add_operation(:get_tile, Seahorse::Model::Operation.new.tap do |o|
218
+ o.name = "GetTile"
219
+ o.http_method = "GET"
220
+ o.http_request_uri = "/tiles/{Tileset}/{Z}/{X}/{Y}"
221
+ o.input = Shapes::ShapeRef.new(shape: GetTileRequest)
222
+ o.output = Shapes::ShapeRef.new(shape: GetTileResponse)
223
+ o.errors << Shapes::ShapeRef.new(shape: InternalServerException)
224
+ o.errors << Shapes::ShapeRef.new(shape: AccessDeniedException)
225
+ o.errors << Shapes::ShapeRef.new(shape: ValidationException)
226
+ o.errors << Shapes::ShapeRef.new(shape: ThrottlingException)
227
+ end)
228
+ end
229
+
230
+ end
231
+ end
File without changes
@@ -0,0 +1,69 @@
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
+ module Aws::GeoMaps
11
+ # Endpoint parameters used to influence endpoints per request.
12
+ #
13
+ # @!attribute use_dual_stack
14
+ # When true, use the dual-stack endpoint. If the configured endpoint does not support dual-stack, dispatching the request MAY return an error.
15
+ #
16
+ # @return [Boolean]
17
+ #
18
+ # @!attribute use_fips
19
+ # 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.
20
+ #
21
+ # @return [Boolean]
22
+ #
23
+ # @!attribute endpoint
24
+ # Override the endpoint used to send this request
25
+ #
26
+ # @return [String]
27
+ #
28
+ # @!attribute region
29
+ # The AWS region used to dispatch the request.
30
+ #
31
+ # @return [String]
32
+ #
33
+ EndpointParameters = Struct.new(
34
+ :use_dual_stack,
35
+ :use_fips,
36
+ :endpoint,
37
+ :region,
38
+ ) do
39
+ include Aws::Structure
40
+
41
+ # @api private
42
+ class << self
43
+ PARAM_MAP = {
44
+ 'UseDualStack' => :use_dual_stack,
45
+ 'UseFIPS' => :use_fips,
46
+ 'Endpoint' => :endpoint,
47
+ 'Region' => :region,
48
+ }.freeze
49
+ end
50
+
51
+ def initialize(options = {})
52
+ self[:use_dual_stack] = options[:use_dual_stack]
53
+ self[:use_dual_stack] = false if self[:use_dual_stack].nil?
54
+ self[:use_fips] = options[:use_fips]
55
+ self[:use_fips] = false if self[:use_fips].nil?
56
+ self[:endpoint] = options[:endpoint]
57
+ self[:region] = options[:region]
58
+ end
59
+
60
+ def self.create(config, options={})
61
+ new({
62
+ use_dual_stack: config.use_dualstack_endpoint,
63
+ use_fips: config.use_fips_endpoint,
64
+ endpoint: (config.endpoint.to_s unless config.regional_endpoint),
65
+ region: config.region,
66
+ }.merge(options))
67
+ end
68
+ end
69
+ end
@@ -0,0 +1,78 @@
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
+ module Aws::GeoMaps
11
+ class EndpointProvider
12
+ def resolve_endpoint(parameters)
13
+ use_dual_stack = parameters.use_dual_stack
14
+ use_fips = parameters.use_fips
15
+ endpoint = parameters.endpoint
16
+ region = parameters.region
17
+ if Aws::Endpoints::Matchers.set?(endpoint)
18
+ if Aws::Endpoints::Matchers.boolean_equals?(use_fips, true)
19
+ raise ArgumentError, "Invalid Configuration: FIPS and custom endpoint are not supported"
20
+ end
21
+ if Aws::Endpoints::Matchers.boolean_equals?(use_dual_stack, true)
22
+ raise ArgumentError, "Invalid Configuration: Dualstack and custom endpoint are not supported"
23
+ end
24
+ return Aws::Endpoints::Endpoint.new(url: endpoint, headers: {}, properties: {})
25
+ end
26
+ if Aws::Endpoints::Matchers.set?(region)
27
+ if (partition_result = Aws::Endpoints::Matchers.aws_partition(region))
28
+ if Aws::Endpoints::Matchers.string_equals?(Aws::Endpoints::Matchers.attr(partition_result, "name"), "aws") && Aws::Endpoints::Matchers.boolean_equals?(use_fips, false) && Aws::Endpoints::Matchers.boolean_equals?(use_dual_stack, false)
29
+ return Aws::Endpoints::Endpoint.new(url: "https://maps.geo.#{region}.#{partition_result['dnsSuffix']}/v2", headers: {}, properties: {})
30
+ end
31
+ if Aws::Endpoints::Matchers.string_equals?(Aws::Endpoints::Matchers.attr(partition_result, "name"), "aws") && Aws::Endpoints::Matchers.boolean_equals?(use_fips, true) && Aws::Endpoints::Matchers.boolean_equals?(use_dual_stack, true)
32
+ return Aws::Endpoints::Endpoint.new(url: "https://maps.geo-fips.#{region}.#{partition_result['dualStackDnsSuffix']}/v2", headers: {}, properties: {})
33
+ end
34
+ if Aws::Endpoints::Matchers.string_equals?(Aws::Endpoints::Matchers.attr(partition_result, "name"), "aws") && Aws::Endpoints::Matchers.boolean_equals?(use_fips, true) && Aws::Endpoints::Matchers.boolean_equals?(use_dual_stack, false)
35
+ return Aws::Endpoints::Endpoint.new(url: "https://maps.geo-fips.#{region}.#{partition_result['dnsSuffix']}/v2", headers: {}, properties: {})
36
+ end
37
+ if Aws::Endpoints::Matchers.string_equals?(Aws::Endpoints::Matchers.attr(partition_result, "name"), "aws") && Aws::Endpoints::Matchers.boolean_equals?(use_fips, false) && Aws::Endpoints::Matchers.boolean_equals?(use_dual_stack, true)
38
+ return Aws::Endpoints::Endpoint.new(url: "https://maps.geo.#{region}.#{partition_result['dualStackDnsSuffix']}/v2", headers: {}, properties: {})
39
+ end
40
+ if Aws::Endpoints::Matchers.string_equals?(Aws::Endpoints::Matchers.attr(partition_result, "name"), "aws-us-gov") && Aws::Endpoints::Matchers.boolean_equals?(use_fips, false) && Aws::Endpoints::Matchers.boolean_equals?(use_dual_stack, false)
41
+ return Aws::Endpoints::Endpoint.new(url: "https://maps.geo.#{region}.us-gov.#{partition_result['dnsSuffix']}/v2", headers: {}, properties: {})
42
+ end
43
+ if Aws::Endpoints::Matchers.string_equals?(Aws::Endpoints::Matchers.attr(partition_result, "name"), "aws-us-gov") && Aws::Endpoints::Matchers.boolean_equals?(use_fips, true) && Aws::Endpoints::Matchers.boolean_equals?(use_dual_stack, true)
44
+ return Aws::Endpoints::Endpoint.new(url: "https://maps.geo-fips.#{region}.us-gov.#{partition_result['dualStackDnsSuffix']}/v2", headers: {}, properties: {})
45
+ end
46
+ if Aws::Endpoints::Matchers.string_equals?(Aws::Endpoints::Matchers.attr(partition_result, "name"), "aws-us-gov") && Aws::Endpoints::Matchers.boolean_equals?(use_fips, true) && Aws::Endpoints::Matchers.boolean_equals?(use_dual_stack, false)
47
+ return Aws::Endpoints::Endpoint.new(url: "https://maps.geo-fips.#{region}.us-gov.#{partition_result['dnsSuffix']}/v2", headers: {}, properties: {})
48
+ end
49
+ if Aws::Endpoints::Matchers.string_equals?(Aws::Endpoints::Matchers.attr(partition_result, "name"), "aws-us-gov") && Aws::Endpoints::Matchers.boolean_equals?(use_fips, false) && Aws::Endpoints::Matchers.boolean_equals?(use_dual_stack, true)
50
+ return Aws::Endpoints::Endpoint.new(url: "https://maps.geo.#{region}.us-gov.#{partition_result['dualStackDnsSuffix']}/v2", headers: {}, properties: {})
51
+ end
52
+ if Aws::Endpoints::Matchers.boolean_equals?(use_fips, true) && Aws::Endpoints::Matchers.boolean_equals?(use_dual_stack, true)
53
+ if Aws::Endpoints::Matchers.boolean_equals?(true, Aws::Endpoints::Matchers.attr(partition_result, "supportsFIPS")) && Aws::Endpoints::Matchers.boolean_equals?(true, Aws::Endpoints::Matchers.attr(partition_result, "supportsDualStack"))
54
+ return Aws::Endpoints::Endpoint.new(url: "https://geo-maps-fips.#{region}.#{partition_result['dualStackDnsSuffix']}", headers: {}, properties: {})
55
+ end
56
+ raise ArgumentError, "FIPS and DualStack are enabled, but this partition does not support one or both"
57
+ end
58
+ if Aws::Endpoints::Matchers.boolean_equals?(use_fips, true) && Aws::Endpoints::Matchers.boolean_equals?(use_dual_stack, false)
59
+ if Aws::Endpoints::Matchers.boolean_equals?(Aws::Endpoints::Matchers.attr(partition_result, "supportsFIPS"), true)
60
+ return Aws::Endpoints::Endpoint.new(url: "https://geo-maps-fips.#{region}.#{partition_result['dnsSuffix']}", headers: {}, properties: {})
61
+ end
62
+ raise ArgumentError, "FIPS is enabled but this partition does not support FIPS"
63
+ end
64
+ if Aws::Endpoints::Matchers.boolean_equals?(use_fips, false) && Aws::Endpoints::Matchers.boolean_equals?(use_dual_stack, true)
65
+ if Aws::Endpoints::Matchers.boolean_equals?(true, Aws::Endpoints::Matchers.attr(partition_result, "supportsDualStack"))
66
+ return Aws::Endpoints::Endpoint.new(url: "https://geo-maps.#{region}.#{partition_result['dualStackDnsSuffix']}", headers: {}, properties: {})
67
+ end
68
+ raise ArgumentError, "DualStack is enabled but this partition does not support DualStack"
69
+ end
70
+ return Aws::Endpoints::Endpoint.new(url: "https://geo-maps.#{region}.#{partition_result['dnsSuffix']}", headers: {}, properties: {})
71
+ end
72
+ end
73
+ raise ArgumentError, "Invalid Configuration: Missing Region"
74
+ raise ArgumentError, 'No endpoint could be resolved'
75
+
76
+ end
77
+ end
78
+ end
@@ -0,0 +1,20 @@
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::GeoMaps
12
+ # @api private
13
+ module Endpoints
14
+
15
+
16
+ def self.parameters_for_operation(context)
17
+ Aws::GeoMaps::EndpointParameters.create(context.config)
18
+ end
19
+ end
20
+ end
@@ -0,0 +1,120 @@
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
+ module Aws::GeoMaps
11
+
12
+ # When GeoMaps returns an error response, the Ruby SDK constructs and raises an error.
13
+ # These errors all extend Aws::GeoMaps::Errors::ServiceError < {Aws::Errors::ServiceError}
14
+ #
15
+ # You can rescue all GeoMaps errors using ServiceError:
16
+ #
17
+ # begin
18
+ # # do stuff
19
+ # rescue Aws::GeoMaps::Errors::ServiceError
20
+ # # rescues all GeoMaps API errors
21
+ # end
22
+ #
23
+ #
24
+ # ## Request Context
25
+ # ServiceError objects have a {Aws::Errors::ServiceError#context #context} method that returns
26
+ # information about the request that generated the error.
27
+ # See {Seahorse::Client::RequestContext} for more information.
28
+ #
29
+ # ## Error Classes
30
+ # * {AccessDeniedException}
31
+ # * {InternalServerException}
32
+ # * {ThrottlingException}
33
+ # * {ValidationException}
34
+ #
35
+ # Additionally, error classes are dynamically generated for service errors based on the error code
36
+ # if they are not defined above.
37
+ module Errors
38
+
39
+ extend Aws::Errors::DynamicErrors
40
+
41
+ class AccessDeniedException < ServiceError
42
+
43
+ # @param [Seahorse::Client::RequestContext] context
44
+ # @param [String] message
45
+ # @param [Aws::GeoMaps::Types::AccessDeniedException] data
46
+ def initialize(context, message, data = Aws::EmptyStructure.new)
47
+ super(context, message, data)
48
+ end
49
+
50
+ # @return [String]
51
+ def message
52
+ @message || @data[:message]
53
+ end
54
+ end
55
+
56
+ class InternalServerException < ServiceError
57
+
58
+ # @param [Seahorse::Client::RequestContext] context
59
+ # @param [String] message
60
+ # @param [Aws::GeoMaps::Types::InternalServerException] data
61
+ def initialize(context, message, data = Aws::EmptyStructure.new)
62
+ super(context, message, data)
63
+ end
64
+
65
+ # @return [String]
66
+ def message
67
+ @message || @data[:message]
68
+ end
69
+
70
+ def retryable?
71
+ true
72
+ end
73
+ end
74
+
75
+ class ThrottlingException < ServiceError
76
+
77
+ # @param [Seahorse::Client::RequestContext] context
78
+ # @param [String] message
79
+ # @param [Aws::GeoMaps::Types::ThrottlingException] data
80
+ def initialize(context, message, data = Aws::EmptyStructure.new)
81
+ super(context, message, data)
82
+ end
83
+
84
+ # @return [String]
85
+ def message
86
+ @message || @data[:message]
87
+ end
88
+
89
+ def retryable?
90
+ true
91
+ end
92
+ end
93
+
94
+ class ValidationException < ServiceError
95
+
96
+ # @param [Seahorse::Client::RequestContext] context
97
+ # @param [String] message
98
+ # @param [Aws::GeoMaps::Types::ValidationException] data
99
+ def initialize(context, message, data = Aws::EmptyStructure.new)
100
+ super(context, message, data)
101
+ end
102
+
103
+ # @return [String]
104
+ def message
105
+ @message || @data[:message]
106
+ end
107
+
108
+ # @return [String]
109
+ def reason
110
+ @data[:reason]
111
+ end
112
+
113
+ # @return [String]
114
+ def field_list
115
+ @data[:field_list]
116
+ end
117
+ end
118
+
119
+ end
120
+ end
@@ -0,0 +1,77 @@
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::GeoMaps
12
+ module Plugins
13
+ class Endpoints < Seahorse::Client::Plugin
14
+ option(
15
+ :endpoint_provider,
16
+ doc_type: 'Aws::GeoMaps::EndpointProvider',
17
+ rbs_type: 'untyped',
18
+ docstring: <<~DOCS) do |_cfg|
19
+ The endpoint provider used to resolve endpoints. Any object that responds to
20
+ `#resolve_endpoint(parameters)` where `parameters` is a Struct similar to
21
+ `Aws::GeoMaps::EndpointParameters`.
22
+ DOCS
23
+ Aws::GeoMaps::EndpointProvider.new
24
+ end
25
+
26
+ # @api private
27
+ class Handler < Seahorse::Client::Handler
28
+ def call(context)
29
+ unless context[:discovered_endpoint]
30
+ params = Aws::GeoMaps::Endpoints.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
+
36
+ context[:endpoint_params] = params
37
+ context[:endpoint_properties] = endpoint.properties
38
+ end
39
+
40
+ context[:auth_scheme] =
41
+ Aws::Endpoints.resolve_auth_scheme(context, endpoint)
42
+
43
+ with_metrics(context) { @handler.call(context) }
44
+ end
45
+
46
+ private
47
+
48
+ def with_metrics(context, &block)
49
+ metrics = []
50
+ metrics << 'ENDPOINT_OVERRIDE' unless context.config.regional_endpoint
51
+ if context[:auth_scheme] && context[:auth_scheme]['name'] == 'sigv4a'
52
+ metrics << 'SIGV4A_SIGNING'
53
+ end
54
+ if context.config.credentials&.credentials&.account_id
55
+ metrics << 'RESOLVED_ACCOUNT_ID'
56
+ end
57
+ Aws::Plugins::UserAgent.metric(*metrics, &block)
58
+ end
59
+
60
+ def apply_endpoint_headers(context, headers)
61
+ headers.each do |key, values|
62
+ value = values
63
+ .compact
64
+ .map { |s| Seahorse::Util.escape_header_list_string(s.to_s) }
65
+ .join(',')
66
+
67
+ context.http_request.headers[key] = value
68
+ end
69
+ end
70
+ end
71
+
72
+ def add_handlers(handlers, _config)
73
+ handlers.add(Handler, step: :build, priority: 75)
74
+ end
75
+ end
76
+ end
77
+ end
@@ -0,0 +1,26 @@
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
+ module Aws::GeoMaps
11
+
12
+ class Resource
13
+
14
+ # @param options ({})
15
+ # @option options [Client] :client
16
+ def initialize(options = {})
17
+ @client = options[:client] || Client.new(options)
18
+ end
19
+
20
+ # @return [Client]
21
+ def client
22
+ @client
23
+ end
24
+
25
+ end
26
+ end