google-maps-platform-sdk 1.0.0 → 1.0.3
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.
- checksums.yaml +4 -4
- data/README.md +30 -32
- data/lib/google_maps_platform/apis/base_api.rb +1 -1
- data/lib/google_maps_platform/apis/directions_api.rb +1 -1
- data/lib/google_maps_platform/apis/distance_matrix_api.rb +1 -1
- data/lib/google_maps_platform/apis/elevation_api.rb +1 -1
- data/lib/google_maps_platform/apis/geocoding_api.rb +1 -1
- data/lib/google_maps_platform/apis/geolocation_api.rb +1 -1
- data/lib/google_maps_platform/apis/places_api.rb +7 -7
- data/lib/google_maps_platform/apis/roads_api.rb +2 -2
- data/lib/google_maps_platform/apis/street_view_api.rb +2 -2
- data/lib/google_maps_platform/apis/time_zone_api.rb +1 -1
- data/lib/google_maps_platform/configuration.rb +20 -24
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 5b09a3851b9843abb1081fed17884afc10402fbcd5e2efbfab4d5c5dc0e318e3
|
|
4
|
+
data.tar.gz: 01cb327c409185dbde6767957c2e4c07632099136aa77e5b55bc44655e9db0ab
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 14eee19c1f7aa434c83dc055732bcb392377e4a83908559b7c15acc78e6a05703c1e2b392627cdb6e32dcd4a62d2a7d7a8fe2095ba1d45c6281e282af72a7022
|
|
7
|
+
data.tar.gz: 2654e52270a8816b1130a17fa26b0cbb4f6b0d7e840efff4b43c6562a7305354e94428c9770d4ec74a05f4748631b395ae7dfddd9a7e8f2a6a8501337a76dcd9
|
data/README.md
CHANGED
|
@@ -10,16 +10,16 @@ API Specification for Google Maps Platform
|
|
|
10
10
|
Install the gem from the command line:
|
|
11
11
|
|
|
12
12
|
```bash
|
|
13
|
-
gem install google-maps-platform-sdk -v 1.0.
|
|
13
|
+
gem install google-maps-platform-sdk -v 1.0.3
|
|
14
14
|
```
|
|
15
15
|
|
|
16
16
|
Or add the gem to your Gemfile and run `bundle`:
|
|
17
17
|
|
|
18
18
|
```ruby
|
|
19
|
-
gem 'google-maps-platform-sdk', '1.0.
|
|
19
|
+
gem 'google-maps-platform-sdk', '1.0.3'
|
|
20
20
|
```
|
|
21
21
|
|
|
22
|
-
For additional gem details, see the [RubyGems page for the google-maps-platform-sdk gem](https://rubygems.org/gems/google-maps-platform-sdk/versions/1.0.
|
|
22
|
+
For additional gem details, see the [RubyGems page for the google-maps-platform-sdk gem](https://rubygems.org/gems/google-maps-platform-sdk/versions/1.0.3).
|
|
23
23
|
|
|
24
24
|
## IRB Console Usage
|
|
25
25
|
|
|
@@ -58,13 +58,13 @@ ruby bin/console
|
|
|
58
58
|
|
|
59
59
|
## Initialize the API Client
|
|
60
60
|
|
|
61
|
-
**_Note:_** Documentation for the client can be found [here.](https://www.github.com/sdks-io/google-maps-platform-ruby-sdk/tree/1.0.
|
|
61
|
+
**_Note:_** Documentation for the client can be found [here.](https://www.github.com/sdks-io/google-maps-platform-ruby-sdk/tree/1.0.3/doc/client.md)
|
|
62
62
|
|
|
63
63
|
The following parameters are configurable for the API Client:
|
|
64
64
|
|
|
65
65
|
| Parameter | Type | Description |
|
|
66
66
|
| --- | --- | --- |
|
|
67
|
-
| environment | [`Environment`](https://www.github.com/sdks-io/google-maps-platform-ruby-sdk/tree/1.0.
|
|
67
|
+
| environment | [`Environment`](https://www.github.com/sdks-io/google-maps-platform-ruby-sdk/tree/1.0.3/README.md#environments) | The API environment. <br> **Default: `Environment.PRODUCTION`** |
|
|
68
68
|
| connection | `Faraday::Connection` | The Faraday connection object passed by the SDK user for making requests |
|
|
69
69
|
| adapter | `Faraday::Adapter` | The Faraday adapter object passed by the SDK user for performing http requests |
|
|
70
70
|
| timeout | `Float` | The value to use for connection timeout. <br> **Default: 30** |
|
|
@@ -74,9 +74,9 @@ The following parameters are configurable for the API Client:
|
|
|
74
74
|
| retry_statuses | `Array` | A list of HTTP statuses to retry. <br> **Default: [408, 413, 429, 500, 502, 503, 504, 521, 522, 524]** |
|
|
75
75
|
| retry_methods | `Array` | A list of HTTP methods to retry. <br> **Default: %i[get put]** |
|
|
76
76
|
| http_callback | `HttpCallBack` | The Http CallBack allows defining callables for pre and post API calls. |
|
|
77
|
-
| proxy_settings | [`ProxySettings`](https://www.github.com/sdks-io/google-maps-platform-ruby-sdk/tree/1.0.
|
|
78
|
-
| logging_configuration | [`LoggingConfiguration`](https://www.github.com/sdks-io/google-maps-platform-ruby-sdk/tree/1.0.
|
|
79
|
-
| custom_query_authentication_credentials | [`CustomQueryAuthenticationCredentials`](https://www.github.com/sdks-io/google-maps-platform-ruby-sdk/tree/1.0.
|
|
77
|
+
| proxy_settings | [`ProxySettings`](https://www.github.com/sdks-io/google-maps-platform-ruby-sdk/tree/1.0.3/doc/proxy-settings.md) | Optional proxy configuration to route HTTP requests through a proxy server. |
|
|
78
|
+
| logging_configuration | [`LoggingConfiguration`](https://www.github.com/sdks-io/google-maps-platform-ruby-sdk/tree/1.0.3/doc/logging-configuration.md) | The SDK logging configuration for API calls |
|
|
79
|
+
| custom_query_authentication_credentials | [`CustomQueryAuthenticationCredentials`](https://www.github.com/sdks-io/google-maps-platform-ruby-sdk/tree/1.0.3/doc/auth/custom-query-parameter.md) | The credential object for Custom Query Parameter |
|
|
80
80
|
|
|
81
81
|
The API client can be initialized as follows:
|
|
82
82
|
|
|
@@ -113,7 +113,7 @@ include GoogleMapsPlatform
|
|
|
113
113
|
client = Client.from_env
|
|
114
114
|
```
|
|
115
115
|
|
|
116
|
-
See the [`Environment-Based Client Initialization`](https://www.github.com/sdks-io/google-maps-platform-ruby-sdk/tree/1.0.
|
|
116
|
+
See the [`Environment-Based Client Initialization`](https://www.github.com/sdks-io/google-maps-platform-ruby-sdk/tree/1.0.3/doc/environment-based-client-initialization.md) section for details.
|
|
117
117
|
|
|
118
118
|
## Environments
|
|
119
119
|
|
|
@@ -124,46 +124,44 @@ The SDK can be configured to use a different environment for making API calls. A
|
|
|
124
124
|
| Name | Description |
|
|
125
125
|
| --- | --- |
|
|
126
126
|
| PRODUCTION | **Default** |
|
|
127
|
-
| ENVIRONMENT2 | - |
|
|
128
|
-
| ENVIRONMENT3 | - |
|
|
129
127
|
|
|
130
128
|
## Authorization
|
|
131
129
|
|
|
132
130
|
This API uses the following authentication schemes.
|
|
133
131
|
|
|
134
|
-
* [`ApiKeyAuth (Custom Query Parameter)`](https://www.github.com/sdks-io/google-maps-platform-ruby-sdk/tree/1.0.
|
|
132
|
+
* [`ApiKeyAuth (Custom Query Parameter)`](https://www.github.com/sdks-io/google-maps-platform-ruby-sdk/tree/1.0.3/doc/auth/custom-query-parameter.md)
|
|
135
133
|
|
|
136
134
|
## List of APIs
|
|
137
135
|
|
|
138
|
-
* [Geolocation API](https://www.github.com/sdks-io/google-maps-platform-ruby-sdk/tree/1.0.
|
|
139
|
-
* [Directions API](https://www.github.com/sdks-io/google-maps-platform-ruby-sdk/tree/1.0.
|
|
140
|
-
* [Elevation API](https://www.github.com/sdks-io/google-maps-platform-ruby-sdk/tree/1.0.
|
|
141
|
-
* [Geocoding API](https://www.github.com/sdks-io/google-maps-platform-ruby-sdk/tree/1.0.
|
|
142
|
-
* [Time Zone API](https://www.github.com/sdks-io/google-maps-platform-ruby-sdk/tree/1.0.
|
|
143
|
-
* [Roads API](https://www.github.com/sdks-io/google-maps-platform-ruby-sdk/tree/1.0.
|
|
144
|
-
* [Distance Matrix API](https://www.github.com/sdks-io/google-maps-platform-ruby-sdk/tree/1.0.
|
|
145
|
-
* [Places API](https://www.github.com/sdks-io/google-maps-platform-ruby-sdk/tree/1.0.
|
|
146
|
-
* [Street View API](https://www.github.com/sdks-io/google-maps-platform-ruby-sdk/tree/1.0.
|
|
136
|
+
* [Geolocation API](https://www.github.com/sdks-io/google-maps-platform-ruby-sdk/tree/1.0.3/doc/controllers/geolocation-api.md)
|
|
137
|
+
* [Directions API](https://www.github.com/sdks-io/google-maps-platform-ruby-sdk/tree/1.0.3/doc/controllers/directions-api.md)
|
|
138
|
+
* [Elevation API](https://www.github.com/sdks-io/google-maps-platform-ruby-sdk/tree/1.0.3/doc/controllers/elevation-api.md)
|
|
139
|
+
* [Geocoding API](https://www.github.com/sdks-io/google-maps-platform-ruby-sdk/tree/1.0.3/doc/controllers/geocoding-api.md)
|
|
140
|
+
* [Time Zone API](https://www.github.com/sdks-io/google-maps-platform-ruby-sdk/tree/1.0.3/doc/controllers/time-zone-api.md)
|
|
141
|
+
* [Roads API](https://www.github.com/sdks-io/google-maps-platform-ruby-sdk/tree/1.0.3/doc/controllers/roads-api.md)
|
|
142
|
+
* [Distance Matrix API](https://www.github.com/sdks-io/google-maps-platform-ruby-sdk/tree/1.0.3/doc/controllers/distance-matrix-api.md)
|
|
143
|
+
* [Places API](https://www.github.com/sdks-io/google-maps-platform-ruby-sdk/tree/1.0.3/doc/controllers/places-api.md)
|
|
144
|
+
* [Street View API](https://www.github.com/sdks-io/google-maps-platform-ruby-sdk/tree/1.0.3/doc/controllers/street-view-api.md)
|
|
147
145
|
|
|
148
146
|
## SDK Infrastructure
|
|
149
147
|
|
|
150
148
|
### Configuration
|
|
151
149
|
|
|
152
|
-
* [ProxySettings](https://www.github.com/sdks-io/google-maps-platform-ruby-sdk/tree/1.0.
|
|
153
|
-
* [Environment-Based Client Initialization](https://www.github.com/sdks-io/google-maps-platform-ruby-sdk/tree/1.0.
|
|
154
|
-
* [AbstractLogger](https://www.github.com/sdks-io/google-maps-platform-ruby-sdk/tree/1.0.
|
|
155
|
-
* [LoggingConfiguration](https://www.github.com/sdks-io/google-maps-platform-ruby-sdk/tree/1.0.
|
|
156
|
-
* [RequestLoggingConfiguration](https://www.github.com/sdks-io/google-maps-platform-ruby-sdk/tree/1.0.
|
|
157
|
-
* [ResponseLoggingConfiguration](https://www.github.com/sdks-io/google-maps-platform-ruby-sdk/tree/1.0.
|
|
150
|
+
* [ProxySettings](https://www.github.com/sdks-io/google-maps-platform-ruby-sdk/tree/1.0.3/doc/proxy-settings.md)
|
|
151
|
+
* [Environment-Based Client Initialization](https://www.github.com/sdks-io/google-maps-platform-ruby-sdk/tree/1.0.3/doc/environment-based-client-initialization.md)
|
|
152
|
+
* [AbstractLogger](https://www.github.com/sdks-io/google-maps-platform-ruby-sdk/tree/1.0.3/doc/abstract-logger.md)
|
|
153
|
+
* [LoggingConfiguration](https://www.github.com/sdks-io/google-maps-platform-ruby-sdk/tree/1.0.3/doc/logging-configuration.md)
|
|
154
|
+
* [RequestLoggingConfiguration](https://www.github.com/sdks-io/google-maps-platform-ruby-sdk/tree/1.0.3/doc/request-logging-configuration.md)
|
|
155
|
+
* [ResponseLoggingConfiguration](https://www.github.com/sdks-io/google-maps-platform-ruby-sdk/tree/1.0.3/doc/response-logging-configuration.md)
|
|
158
156
|
|
|
159
157
|
### HTTP
|
|
160
158
|
|
|
161
|
-
* [HttpResponse](https://www.github.com/sdks-io/google-maps-platform-ruby-sdk/tree/1.0.
|
|
162
|
-
* [HttpRequest](https://www.github.com/sdks-io/google-maps-platform-ruby-sdk/tree/1.0.
|
|
159
|
+
* [HttpResponse](https://www.github.com/sdks-io/google-maps-platform-ruby-sdk/tree/1.0.3/doc/http-response.md)
|
|
160
|
+
* [HttpRequest](https://www.github.com/sdks-io/google-maps-platform-ruby-sdk/tree/1.0.3/doc/http-request.md)
|
|
163
161
|
|
|
164
162
|
### Utilities
|
|
165
163
|
|
|
166
|
-
* [ApiResponse](https://www.github.com/sdks-io/google-maps-platform-ruby-sdk/tree/1.0.
|
|
167
|
-
* [ApiHelper](https://www.github.com/sdks-io/google-maps-platform-ruby-sdk/tree/1.0.
|
|
168
|
-
* [DateTimeHelper](https://www.github.com/sdks-io/google-maps-platform-ruby-sdk/tree/1.0.
|
|
164
|
+
* [ApiResponse](https://www.github.com/sdks-io/google-maps-platform-ruby-sdk/tree/1.0.3/doc/api-response.md)
|
|
165
|
+
* [ApiHelper](https://www.github.com/sdks-io/google-maps-platform-ruby-sdk/tree/1.0.3/doc/api-helper.md)
|
|
166
|
+
* [DateTimeHelper](https://www.github.com/sdks-io/google-maps-platform-ruby-sdk/tree/1.0.3/doc/date-time-helper.md)
|
|
169
167
|
|
|
@@ -10,7 +10,7 @@ module GoogleMapsPlatform
|
|
|
10
10
|
attr_accessor :config, :http_call_back
|
|
11
11
|
|
|
12
12
|
def self.user_agent
|
|
13
|
-
'Ruby-SDK/1.0.
|
|
13
|
+
'Ruby-SDK/1.0.3 (OS: {os-info}, Engine: {engine}/{engine-version})'
|
|
14
14
|
end
|
|
15
15
|
|
|
16
16
|
def self.user_agent_parameters
|
|
@@ -312,7 +312,7 @@ module GoogleMapsPlatform
|
|
|
312
312
|
@api_call
|
|
313
313
|
.request(new_request_builder(HttpMethodEnum::GET,
|
|
314
314
|
'/maps/api/directions/json',
|
|
315
|
-
Server::
|
|
315
|
+
Server::MAPS_APIS)
|
|
316
316
|
.query_param(new_parameter(destination, key: 'destination')
|
|
317
317
|
.is_required(true))
|
|
318
318
|
.query_param(new_parameter(origin, key: 'origin')
|
|
@@ -197,7 +197,7 @@ module GoogleMapsPlatform
|
|
|
197
197
|
@api_call
|
|
198
198
|
.request(new_request_builder(HttpMethodEnum::GET,
|
|
199
199
|
'/maps/api/distancematrix/json',
|
|
200
|
-
Server::
|
|
200
|
+
Server::MAPS_APIS)
|
|
201
201
|
.query_param(new_parameter(destinations, key: 'destinations')
|
|
202
202
|
.is_required(true))
|
|
203
203
|
.query_param(new_parameter(origins, key: 'origins')
|
|
@@ -55,7 +55,7 @@ module GoogleMapsPlatform
|
|
|
55
55
|
@api_call
|
|
56
56
|
.request(new_request_builder(HttpMethodEnum::GET,
|
|
57
57
|
'/maps/api/elevation/json',
|
|
58
|
-
Server::
|
|
58
|
+
Server::MAPS_APIS)
|
|
59
59
|
.query_param(new_parameter(locations, key: 'locations'))
|
|
60
60
|
.query_param(new_parameter(path, key: 'path'))
|
|
61
61
|
.query_param(new_parameter(samples, key: 'samples'))
|
|
@@ -192,7 +192,7 @@ module GoogleMapsPlatform
|
|
|
192
192
|
@api_call
|
|
193
193
|
.request(new_request_builder(HttpMethodEnum::GET,
|
|
194
194
|
'/maps/api/geocode/json',
|
|
195
|
-
Server::
|
|
195
|
+
Server::MAPS_APIS)
|
|
196
196
|
.query_param(new_parameter(address, key: 'address'))
|
|
197
197
|
.query_param(new_parameter(bounds, key: 'bounds'))
|
|
198
198
|
.query_param(new_parameter(components, key: 'components'))
|
|
@@ -24,7 +24,7 @@ module GoogleMapsPlatform
|
|
|
24
24
|
@api_call
|
|
25
25
|
.request(new_request_builder(HttpMethodEnum::POST,
|
|
26
26
|
'/geolocation/v1/geolocate',
|
|
27
|
-
Server::
|
|
27
|
+
Server::GOOGLE_APIS)
|
|
28
28
|
.header_param(new_parameter('application/json', key: 'Content-Type'))
|
|
29
29
|
.body_param(new_parameter(body))
|
|
30
30
|
.header_param(new_parameter('application/json', key: 'accept'))
|
|
@@ -126,7 +126,7 @@ module GoogleMapsPlatform
|
|
|
126
126
|
@api_call
|
|
127
127
|
.request(new_request_builder(HttpMethodEnum::GET,
|
|
128
128
|
'/maps/api/place/details/json',
|
|
129
|
-
Server::
|
|
129
|
+
Server::MAPS_APIS)
|
|
130
130
|
.query_param(new_parameter(place_id, key: 'place_id')
|
|
131
131
|
.is_required(true))
|
|
132
132
|
.query_param(new_parameter(fields, key: 'fields'))
|
|
@@ -240,7 +240,7 @@ module GoogleMapsPlatform
|
|
|
240
240
|
@api_call
|
|
241
241
|
.request(new_request_builder(HttpMethodEnum::GET,
|
|
242
242
|
'/maps/api/place/findplacefromtext/json',
|
|
243
|
-
Server::
|
|
243
|
+
Server::MAPS_APIS)
|
|
244
244
|
.query_param(new_parameter(input, key: 'input')
|
|
245
245
|
.is_required(true))
|
|
246
246
|
.query_param(new_parameter(inputtype, key: 'inputtype')
|
|
@@ -360,7 +360,7 @@ module GoogleMapsPlatform
|
|
|
360
360
|
@api_call
|
|
361
361
|
.request(new_request_builder(HttpMethodEnum::GET,
|
|
362
362
|
'/maps/api/place/nearbysearch/json',
|
|
363
|
-
Server::
|
|
363
|
+
Server::MAPS_APIS)
|
|
364
364
|
.query_param(new_parameter(location, key: 'location')
|
|
365
365
|
.is_required(true))
|
|
366
366
|
.query_param(new_parameter(radius, key: 'radius')
|
|
@@ -491,7 +491,7 @@ module GoogleMapsPlatform
|
|
|
491
491
|
@api_call
|
|
492
492
|
.request(new_request_builder(HttpMethodEnum::GET,
|
|
493
493
|
'/maps/api/place/textsearch/json',
|
|
494
|
-
Server::
|
|
494
|
+
Server::MAPS_APIS)
|
|
495
495
|
.query_param(new_parameter(query, key: 'query')
|
|
496
496
|
.is_required(true))
|
|
497
497
|
.query_param(new_parameter(radius, key: 'radius')
|
|
@@ -551,7 +551,7 @@ module GoogleMapsPlatform
|
|
|
551
551
|
@api_call
|
|
552
552
|
.request(new_request_builder(HttpMethodEnum::GET,
|
|
553
553
|
'/maps/api/place/photo',
|
|
554
|
-
Server::
|
|
554
|
+
Server::MAPS_APIS)
|
|
555
555
|
.query_param(new_parameter(photo_reference, key: 'photo_reference')
|
|
556
556
|
.is_required(true))
|
|
557
557
|
.query_param(new_parameter(maxheight, key: 'maxheight'))
|
|
@@ -634,7 +634,7 @@ module GoogleMapsPlatform
|
|
|
634
634
|
@api_call
|
|
635
635
|
.request(new_request_builder(HttpMethodEnum::GET,
|
|
636
636
|
'/maps/api/place/queryautocomplete/json',
|
|
637
|
-
Server::
|
|
637
|
+
Server::MAPS_APIS)
|
|
638
638
|
.query_param(new_parameter(input, key: 'input')
|
|
639
639
|
.is_required(true))
|
|
640
640
|
.query_param(new_parameter(radius, key: 'radius')
|
|
@@ -838,7 +838,7 @@ module GoogleMapsPlatform
|
|
|
838
838
|
@api_call
|
|
839
839
|
.request(new_request_builder(HttpMethodEnum::GET,
|
|
840
840
|
'/maps/api/place/autocomplete/json',
|
|
841
|
-
Server::
|
|
841
|
+
Server::MAPS_APIS)
|
|
842
842
|
.query_param(new_parameter(input, key: 'input')
|
|
843
843
|
.is_required(true))
|
|
844
844
|
.query_param(new_parameter(radius, key: 'radius')
|
|
@@ -36,7 +36,7 @@ module GoogleMapsPlatform
|
|
|
36
36
|
@api_call
|
|
37
37
|
.request(new_request_builder(HttpMethodEnum::GET,
|
|
38
38
|
'/v1/snaptoroads',
|
|
39
|
-
Server::
|
|
39
|
+
Server::ROADS_APIS)
|
|
40
40
|
.query_param(new_parameter(path, key: 'path')
|
|
41
41
|
.is_required(true))
|
|
42
42
|
.query_param(new_parameter(interpolate, key: 'interpolate'))
|
|
@@ -63,7 +63,7 @@ module GoogleMapsPlatform
|
|
|
63
63
|
@api_call
|
|
64
64
|
.request(new_request_builder(HttpMethodEnum::GET,
|
|
65
65
|
'/v1/nearestRoads',
|
|
66
|
-
Server::
|
|
66
|
+
Server::ROADS_APIS)
|
|
67
67
|
.query_param(new_parameter(points, key: 'points')
|
|
68
68
|
.is_required(true))
|
|
69
69
|
.header_param(new_parameter('application/json', key: 'accept'))
|
|
@@ -84,7 +84,7 @@ module GoogleMapsPlatform
|
|
|
84
84
|
@api_call
|
|
85
85
|
.request(new_request_builder(HttpMethodEnum::GET,
|
|
86
86
|
'/maps/api/streetview',
|
|
87
|
-
Server::
|
|
87
|
+
Server::MAPS_APIS)
|
|
88
88
|
.query_param(new_parameter(size, key: 'size')
|
|
89
89
|
.is_required(true))
|
|
90
90
|
.query_param(new_parameter(fov, key: 'fov'))
|
|
@@ -176,7 +176,7 @@ module GoogleMapsPlatform
|
|
|
176
176
|
@api_call
|
|
177
177
|
.request(new_request_builder(HttpMethodEnum::GET,
|
|
178
178
|
'/maps/api/streetview/metadata',
|
|
179
|
-
Server::
|
|
179
|
+
Server::MAPS_APIS)
|
|
180
180
|
.query_param(new_parameter(heading, key: 'heading'))
|
|
181
181
|
.query_param(new_parameter(location, key: 'location'))
|
|
182
182
|
.query_param(new_parameter(pano, key: 'pano'))
|
|
@@ -47,7 +47,7 @@ module GoogleMapsPlatform
|
|
|
47
47
|
@api_call
|
|
48
48
|
.request(new_request_builder(HttpMethodEnum::GET,
|
|
49
49
|
'/maps/api/timezone/json',
|
|
50
|
-
Server::
|
|
50
|
+
Server::MAPS_APIS)
|
|
51
51
|
.query_param(new_parameter(location, key: 'location')
|
|
52
52
|
.is_required(true))
|
|
53
53
|
.query_param(new_parameter(timestamp, key: 'timestamp')
|
|
@@ -7,39 +7,39 @@ module GoogleMapsPlatform
|
|
|
7
7
|
# An enum for SDK environments.
|
|
8
8
|
class Environment
|
|
9
9
|
ENVIRONMENT = [
|
|
10
|
-
PRODUCTION = '
|
|
11
|
-
ENVIRONMENT2 = 'environment2'.freeze,
|
|
12
|
-
ENVIRONMENT3 = 'environment3'.freeze
|
|
10
|
+
PRODUCTION = 'Production'.freeze
|
|
13
11
|
].freeze
|
|
14
12
|
|
|
15
13
|
# Converts a string or symbol into a valid Environment constant.
|
|
16
14
|
def self.from_value(value, default_value = PRODUCTION)
|
|
17
15
|
return default_value if value.nil?
|
|
18
16
|
|
|
19
|
-
|
|
20
|
-
case str
|
|
21
|
-
when 'production' then PRODUCTION
|
|
22
|
-
when 'environment2' then ENVIRONMENT2
|
|
23
|
-
when 'environment3' then ENVIRONMENT3
|
|
24
|
-
|
|
25
|
-
else
|
|
26
|
-
warn "[Environment] Unknown environment '#{value}', falling back to #{default_value} "
|
|
27
|
-
default_value
|
|
28
|
-
end
|
|
17
|
+
default_value
|
|
29
18
|
end
|
|
30
19
|
end
|
|
31
20
|
|
|
32
21
|
# An enum for API servers.
|
|
33
22
|
class Server
|
|
34
23
|
SERVER = [
|
|
35
|
-
|
|
24
|
+
GOOGLE_APIS = 'Google APIs'.freeze,
|
|
25
|
+
MAPS_APIS = 'Maps APIs'.freeze,
|
|
26
|
+
ROADS_APIS = 'Roads APIs'.freeze
|
|
36
27
|
].freeze
|
|
37
28
|
|
|
38
29
|
# Converts a string or symbol into a valid Server constant.
|
|
39
|
-
def self.from_value(value, default_value =
|
|
30
|
+
def self.from_value(value, default_value = GOOGLE_APIS)
|
|
40
31
|
return default_value if value.nil?
|
|
41
32
|
|
|
42
|
-
|
|
33
|
+
str = value.to_s.strip.downcase
|
|
34
|
+
case str
|
|
35
|
+
when 'google_apis' then GOOGLE_APIS
|
|
36
|
+
when 'maps_apis' then MAPS_APIS
|
|
37
|
+
when 'roads_apis' then ROADS_APIS
|
|
38
|
+
|
|
39
|
+
else
|
|
40
|
+
warn "[Server] Unknown server '#{value}', falling back to #{default_value} "
|
|
41
|
+
default_value
|
|
42
|
+
end
|
|
43
43
|
end
|
|
44
44
|
end
|
|
45
45
|
|
|
@@ -116,13 +116,9 @@ module GoogleMapsPlatform
|
|
|
116
116
|
# All the environments the SDK can run in.
|
|
117
117
|
ENVIRONMENTS = {
|
|
118
118
|
Environment::PRODUCTION => {
|
|
119
|
-
Server::
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
Server::DEFAULT => 'https://maps.googleapis.com'
|
|
123
|
-
},
|
|
124
|
-
Environment::ENVIRONMENT3 => {
|
|
125
|
-
Server::DEFAULT => 'https://roads.googleapis.com'
|
|
119
|
+
Server::GOOGLE_APIS => 'https://www.googleapis.com',
|
|
120
|
+
Server::MAPS_APIS => 'https://maps.googleapis.com',
|
|
121
|
+
Server::ROADS_APIS => 'https://roads.googleapis.com'
|
|
126
122
|
}
|
|
127
123
|
}.freeze
|
|
128
124
|
|
|
@@ -130,7 +126,7 @@ module GoogleMapsPlatform
|
|
|
130
126
|
# @param [Configuration::Server] server The server enum for which the base URI is
|
|
131
127
|
# required.
|
|
132
128
|
# @return [String] The base URI.
|
|
133
|
-
def get_base_uri(server = Server::
|
|
129
|
+
def get_base_uri(server = Server::MAPS_APIS)
|
|
134
130
|
ENVIRONMENTS[environment][server].clone
|
|
135
131
|
end
|
|
136
132
|
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: google-maps-platform-sdk
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.0.
|
|
4
|
+
version: 1.0.3
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- developer sdksio
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-02-
|
|
11
|
+
date: 2026-02-10 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: apimatic_core_interfaces
|