aws-sdk-locationservice 1.24.0 → 1.26.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,174 @@
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::LocationService
12
+ module Plugins
13
+ class Endpoints < Seahorse::Client::Plugin
14
+ option(
15
+ :endpoint_provider,
16
+ doc_type: 'Aws::LocationService::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::LocationService::EndpointParameters`'
21
+ ) do |cfg|
22
+ Aws::LocationService::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_tracker_consumer
60
+ Aws::LocationService::Endpoints::AssociateTrackerConsumer.build(context)
61
+ when :batch_delete_device_position_history
62
+ Aws::LocationService::Endpoints::BatchDeleteDevicePositionHistory.build(context)
63
+ when :batch_delete_geofence
64
+ Aws::LocationService::Endpoints::BatchDeleteGeofence.build(context)
65
+ when :batch_evaluate_geofences
66
+ Aws::LocationService::Endpoints::BatchEvaluateGeofences.build(context)
67
+ when :batch_get_device_position
68
+ Aws::LocationService::Endpoints::BatchGetDevicePosition.build(context)
69
+ when :batch_put_geofence
70
+ Aws::LocationService::Endpoints::BatchPutGeofence.build(context)
71
+ when :batch_update_device_position
72
+ Aws::LocationService::Endpoints::BatchUpdateDevicePosition.build(context)
73
+ when :calculate_route
74
+ Aws::LocationService::Endpoints::CalculateRoute.build(context)
75
+ when :calculate_route_matrix
76
+ Aws::LocationService::Endpoints::CalculateRouteMatrix.build(context)
77
+ when :create_geofence_collection
78
+ Aws::LocationService::Endpoints::CreateGeofenceCollection.build(context)
79
+ when :create_map
80
+ Aws::LocationService::Endpoints::CreateMap.build(context)
81
+ when :create_place_index
82
+ Aws::LocationService::Endpoints::CreatePlaceIndex.build(context)
83
+ when :create_route_calculator
84
+ Aws::LocationService::Endpoints::CreateRouteCalculator.build(context)
85
+ when :create_tracker
86
+ Aws::LocationService::Endpoints::CreateTracker.build(context)
87
+ when :delete_geofence_collection
88
+ Aws::LocationService::Endpoints::DeleteGeofenceCollection.build(context)
89
+ when :delete_map
90
+ Aws::LocationService::Endpoints::DeleteMap.build(context)
91
+ when :delete_place_index
92
+ Aws::LocationService::Endpoints::DeletePlaceIndex.build(context)
93
+ when :delete_route_calculator
94
+ Aws::LocationService::Endpoints::DeleteRouteCalculator.build(context)
95
+ when :delete_tracker
96
+ Aws::LocationService::Endpoints::DeleteTracker.build(context)
97
+ when :describe_geofence_collection
98
+ Aws::LocationService::Endpoints::DescribeGeofenceCollection.build(context)
99
+ when :describe_map
100
+ Aws::LocationService::Endpoints::DescribeMap.build(context)
101
+ when :describe_place_index
102
+ Aws::LocationService::Endpoints::DescribePlaceIndex.build(context)
103
+ when :describe_route_calculator
104
+ Aws::LocationService::Endpoints::DescribeRouteCalculator.build(context)
105
+ when :describe_tracker
106
+ Aws::LocationService::Endpoints::DescribeTracker.build(context)
107
+ when :disassociate_tracker_consumer
108
+ Aws::LocationService::Endpoints::DisassociateTrackerConsumer.build(context)
109
+ when :get_device_position
110
+ Aws::LocationService::Endpoints::GetDevicePosition.build(context)
111
+ when :get_device_position_history
112
+ Aws::LocationService::Endpoints::GetDevicePositionHistory.build(context)
113
+ when :get_geofence
114
+ Aws::LocationService::Endpoints::GetGeofence.build(context)
115
+ when :get_map_glyphs
116
+ Aws::LocationService::Endpoints::GetMapGlyphs.build(context)
117
+ when :get_map_sprites
118
+ Aws::LocationService::Endpoints::GetMapSprites.build(context)
119
+ when :get_map_style_descriptor
120
+ Aws::LocationService::Endpoints::GetMapStyleDescriptor.build(context)
121
+ when :get_map_tile
122
+ Aws::LocationService::Endpoints::GetMapTile.build(context)
123
+ when :get_place
124
+ Aws::LocationService::Endpoints::GetPlace.build(context)
125
+ when :list_device_positions
126
+ Aws::LocationService::Endpoints::ListDevicePositions.build(context)
127
+ when :list_geofence_collections
128
+ Aws::LocationService::Endpoints::ListGeofenceCollections.build(context)
129
+ when :list_geofences
130
+ Aws::LocationService::Endpoints::ListGeofences.build(context)
131
+ when :list_maps
132
+ Aws::LocationService::Endpoints::ListMaps.build(context)
133
+ when :list_place_indexes
134
+ Aws::LocationService::Endpoints::ListPlaceIndexes.build(context)
135
+ when :list_route_calculators
136
+ Aws::LocationService::Endpoints::ListRouteCalculators.build(context)
137
+ when :list_tags_for_resource
138
+ Aws::LocationService::Endpoints::ListTagsForResource.build(context)
139
+ when :list_tracker_consumers
140
+ Aws::LocationService::Endpoints::ListTrackerConsumers.build(context)
141
+ when :list_trackers
142
+ Aws::LocationService::Endpoints::ListTrackers.build(context)
143
+ when :put_geofence
144
+ Aws::LocationService::Endpoints::PutGeofence.build(context)
145
+ when :search_place_index_for_position
146
+ Aws::LocationService::Endpoints::SearchPlaceIndexForPosition.build(context)
147
+ when :search_place_index_for_suggestions
148
+ Aws::LocationService::Endpoints::SearchPlaceIndexForSuggestions.build(context)
149
+ when :search_place_index_for_text
150
+ Aws::LocationService::Endpoints::SearchPlaceIndexForText.build(context)
151
+ when :tag_resource
152
+ Aws::LocationService::Endpoints::TagResource.build(context)
153
+ when :untag_resource
154
+ Aws::LocationService::Endpoints::UntagResource.build(context)
155
+ when :update_geofence_collection
156
+ Aws::LocationService::Endpoints::UpdateGeofenceCollection.build(context)
157
+ when :update_map
158
+ Aws::LocationService::Endpoints::UpdateMap.build(context)
159
+ when :update_place_index
160
+ Aws::LocationService::Endpoints::UpdatePlaceIndex.build(context)
161
+ when :update_route_calculator
162
+ Aws::LocationService::Endpoints::UpdateRouteCalculator.build(context)
163
+ when :update_tracker
164
+ Aws::LocationService::Endpoints::UpdateTracker.build(context)
165
+ end
166
+ end
167
+ end
168
+
169
+ def add_handlers(handlers, _config)
170
+ handlers.add(Handler, step: :build, priority: 75)
171
+ end
172
+ end
173
+ end
174
+ end