timelogic-api 1.1.0 → 2.0.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.
- checksums.yaml +4 -4
- data/README.md +34 -13
- data/docs/JwkKey.md +5 -1
- data/docs/TimeApi.md +7 -5
- data/docs/TimezoneMatch.md +3 -23
- data/docs/{TimezoneOffsetResponse.md → TimezoneResponse.md} +7 -5
- data/lib/timelogic-api/api/time_api.rb +6 -21
- data/lib/timelogic-api/models/jwk_key.rb +26 -4
- data/lib/timelogic-api/models/time_payload_bulk_response.rb +28 -182
- data/lib/timelogic-api/models/timezone_match.rb +5 -186
- data/lib/timelogic-api/models/{timezone_offset_response.rb → timezone_response.rb} +19 -14
- data/lib/timelogic-api/version.rb +1 -1
- data/lib/timelogic-api.rb +1 -3
- metadata +3 -7
- data/docs/GetTimezone200Response.md +0 -49
- data/docs/TimezoneResolvedResponse.md +0 -42
- data/lib/timelogic-api/models/get_timezone200_response.rb +0 -105
- data/lib/timelogic-api/models/timezone_resolved_response.rb +0 -435
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 49f6a82695dfda49d957115714fe97e9aad50c0e6d09f0b8c31e8995d0e1d976
|
|
4
|
+
data.tar.gz: 8a08aaa29e1642126b76adf299bc04458badb2ae89080ed8904d0fad941f7acb
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: dfd0c854bcd88f1f35441f0f1c782140ee9822abf6d82e79df196befa945bf43c11f6b88603eed75b9469f56912d1580a6799fb5232e7c435f5d299e93a13701
|
|
7
|
+
data.tar.gz: e02c82d75e8618b3f884db95d5712361a473f2ef105b9c9ac3dbdd60952b14f0e0cade84d964031e003da30f23c0c523bd43337ef80fe3846e238b5a21a2970a
|
data/README.md
CHANGED
|
@@ -5,15 +5,15 @@ Official Ruby client for [TimeLogic API](https://api.timelogicapi.com): current
|
|
|
5
5
|
- the `/v1` client, generated from the [TimeLogic API contract](https://github.com/TimeLogic-API-LLC/timelogic-api-sdks/blob/main/openapi/openapi.yaml), with direct and RapidAPI transports;
|
|
6
6
|
- a [WorldTimeAPI-compatible client](#worldtimeapi-compatible-client) for the `/api/timezone` and `/api/ip` routes, which use worldtimeapi.org's paths, fields and plain-text format.
|
|
7
7
|
|
|
8
|
-
Package: [`timelogic-api`](https://rubygems.org/gems/timelogic-api), version
|
|
8
|
+
Package: [`timelogic-api`](https://rubygems.org/gems/timelogic-api), version 2.0.0. Changes are listed in the [changelog](https://github.com/TimeLogic-API-LLC/timelogic-api-sdks/blob/main/CHANGELOG.md).
|
|
9
9
|
|
|
10
10
|
## Install
|
|
11
11
|
|
|
12
12
|
```bash
|
|
13
|
-
gem install timelogic-api -v
|
|
13
|
+
gem install timelogic-api -v 2.0.0
|
|
14
14
|
```
|
|
15
15
|
|
|
16
|
-
Or in a Gemfile: `gem 'timelogic-api', '
|
|
16
|
+
Or in a Gemfile: `gem 'timelogic-api', '2.0.0'`. Requires Ruby 2.7+.
|
|
17
17
|
|
|
18
18
|
## Quick start
|
|
19
19
|
|
|
@@ -153,25 +153,46 @@ puts "#{raw.status} #{raw.headers['x-timelogic-signature']} #{raw.body}"
|
|
|
153
153
|
|
|
154
154
|
Routes, fields and errors: [WorldTimeAPI-compatible routes](#worldtimeapi-compatible-routes).
|
|
155
155
|
|
|
156
|
-
##
|
|
156
|
+
## Migrating from 1.x to 2.0
|
|
157
157
|
|
|
158
|
-
|
|
158
|
+
2.0 changes the `/v1` response types so that every response decodes into a typed model. The API itself is unchanged. What changed in the contract, for every language:
|
|
159
159
|
|
|
160
|
-
-
|
|
160
|
+
- `timezone` returns one model, `TimezoneResponse`: the time payload plus `offset`, `dst`, and `matching_zones` (present only for `offset` lookups). The `oneOf` wrapper `GetTimezone200Response` and its members `TimezoneResolvedResponse` and `TimezoneOffsetResponse` are removed.
|
|
161
|
+
- `TimezoneMatch` (the `matching_zones` item) is `timezone`, `offset` and `dst`, as the API returns it. It previously described a full time payload.
|
|
162
|
+
- `timezone` takes the `format` parameter, after `sign`.
|
|
163
|
+
- `JwkKey` lists the optional `key_ops` and `ext` members.
|
|
164
|
+
- `current` and `convert` no longer reject a comma-separated `tz` list longer than 64 characters or an `offset` list before sending it; an invalid value in a list comes back as a `BulkError` item.
|
|
161
165
|
|
|
162
|
-
|
|
163
|
-
require 'timelogic-api'
|
|
166
|
+
In this package:
|
|
164
167
|
|
|
165
|
-
|
|
168
|
+
- Bulk `get_current_time` / `convert_time` calls return `TimePayloadBulkResponse`, an `Array` of `TimePayload` and `BulkError` objects. 1.x returned `nil`.
|
|
169
|
+
- `get_timezone` returns `TimezoneResponse` and accepts `format:`. `matching_zones` holds `TimezoneMatch` objects. 1.x returned `nil` for `offset` lookups.
|
|
166
170
|
|
|
167
|
-
|
|
171
|
+
Before (1.x):
|
|
172
|
+
|
|
173
|
+
```ruby
|
|
168
174
|
items = time.get_current_time(tz: 'Europe/London,Asia/Tokyo', debug_return_type: 'Object')
|
|
169
|
-
puts items[1][:timezone]
|
|
175
|
+
puts items[1][:timezone]
|
|
176
|
+
```
|
|
170
177
|
|
|
171
|
-
|
|
172
|
-
|
|
178
|
+
After (2.0):
|
|
179
|
+
|
|
180
|
+
```ruby
|
|
181
|
+
time.get_current_time(tz: 'Europe/London,Nope/Zone').each do |item|
|
|
182
|
+
if item.is_a?(TimeLogic::Api::BulkError)
|
|
183
|
+
puts "#{item.item}: #{item.error.code}"
|
|
184
|
+
else
|
|
185
|
+
puts item.iso_local
|
|
186
|
+
end
|
|
187
|
+
end
|
|
188
|
+
|
|
189
|
+
puts time.get_timezone(offset: '+05:30').matching_zones.map(&:timezone).inspect # ["Asia/Colombo", "Asia/Kolkata"]
|
|
173
190
|
```
|
|
174
191
|
|
|
192
|
+
## Known issues
|
|
193
|
+
|
|
194
|
+
Checked against the live API for this release: every `/v1` operation, including bulk `current` / `convert` calls and `offset` lookups with `timezone`, decodes into the typed models. There are no known issues.
|
|
195
|
+
|
|
175
196
|
## How the API works
|
|
176
197
|
|
|
177
198
|
### Base URLs
|
data/docs/JwkKey.md
CHANGED
|
@@ -10,6 +10,8 @@
|
|
|
10
10
|
| **use** | **String** | | |
|
|
11
11
|
| **kid** | **String** | | |
|
|
12
12
|
| **x** | **String** | | |
|
|
13
|
+
| **key_ops** | **Array<String>** | Permitted key operations; published keys allow only `verify`. | [optional] |
|
|
14
|
+
| **ext** | **Boolean** | JWK extractable flag as exported by the signing worker; always `true`. | [optional] |
|
|
13
15
|
|
|
14
16
|
## Example
|
|
15
17
|
|
|
@@ -22,7 +24,9 @@ instance = TimeLogic::Api::JwkKey.new(
|
|
|
22
24
|
alg: null,
|
|
23
25
|
use: null,
|
|
24
26
|
kid: ed25519-2026-07-19,
|
|
25
|
-
x: null
|
|
27
|
+
x: null,
|
|
28
|
+
key_ops: null,
|
|
29
|
+
ext: null
|
|
26
30
|
)
|
|
27
31
|
```
|
|
28
32
|
|
data/docs/TimeApi.md
CHANGED
|
@@ -991,7 +991,7 @@ end
|
|
|
991
991
|
|
|
992
992
|
## get_timezone
|
|
993
993
|
|
|
994
|
-
> <
|
|
994
|
+
> <TimezoneResponse> get_timezone(opts)
|
|
995
995
|
|
|
996
996
|
Resolve timezone information for a target
|
|
997
997
|
|
|
@@ -1036,7 +1036,8 @@ opts = {
|
|
|
1036
1036
|
lon: -74.006, # Float | Longitude. Must be provided together with `lat`.
|
|
1037
1037
|
offset: '-04:00', # String | Fixed UTC offset in `+HH:MM` or `-HH:MM` format only (`+0530` and `+5` are rejected); URL-encode `+` as `%2B`, since an unencoded `+` is read as a space. An offset target returns `timezone=null`. On bulk-capable routes, a comma-separated list enables bulk mode with at most 10 values; request URLs are limited to 8192 characters.
|
|
1038
1038
|
auto_tz: true, # Boolean | Set to `true` to resolve using the caller IP from Cloudflare headers. Counts as a selector family, so it cannot be combined with `tz`, `ip`, `lat`/`lon` or `offset`. Not supported on `/v1/time/clock`. Enabled by `true`, `1` or `yes` (case-insensitive); any other value leaves it off without an error.
|
|
1039
|
-
sign: true # Boolean | Set to `true`, `1` or `yes` (case-insensitive) to ask the gateway to sign the final JSON response. Any other value, a bare `sign`, or repeated `sign` values leave the response unsigned. Every authenticated JSON response, including errors, then includes signing headers. Not supported on `/v1/time/clock`.
|
|
1039
|
+
sign: true, # Boolean | Set to `true`, `1` or `yes` (case-insensitive) to ask the gateway to sign the final JSON response. Any other value, a bare `sign`, or repeated `sign` values leave the response unsigned. Every authenticated JSON response, including errors, then includes signing headers. Not supported on `/v1/time/clock`.
|
|
1040
|
+
format: '%Y-%m-%d %H:%M:%S' # String | Custom date/time format template using supported `strftime`-style directives such as `%Y-%m-%d %H:%M:%S`. Supported directives: `%a %A %b %B %C %d %D %e %F %h %H %I %j %k %l %m %M %n %p %P %r %R %s %S %t %T %u %v %w %x %X %y %Y %z %:z %Z %%`, with the `-`, `_` and `0` padding flags on numeric directives. `%Z` prints the IANA zone name (or `UTC+HH:MM` for an offset target, `UTC` with no target), not an abbreviation. Any other directive (for example `%U`, `%f`, `%Q`) or a trailing `%` returns 400 INVALID_PARAMETER naming the directive.
|
|
1040
1041
|
}
|
|
1041
1042
|
|
|
1042
1043
|
begin
|
|
@@ -1052,7 +1053,7 @@ end
|
|
|
1052
1053
|
|
|
1053
1054
|
This returns an Array which contains the response data, status code and headers.
|
|
1054
1055
|
|
|
1055
|
-
> <Array(<
|
|
1056
|
+
> <Array(<TimezoneResponse>, Integer, Hash)> get_timezone_with_http_info(opts)
|
|
1056
1057
|
|
|
1057
1058
|
```ruby
|
|
1058
1059
|
begin
|
|
@@ -1060,7 +1061,7 @@ begin
|
|
|
1060
1061
|
data, status_code, headers = api_instance.get_timezone_with_http_info(opts)
|
|
1061
1062
|
p status_code # => 2xx
|
|
1062
1063
|
p headers # => { ... }
|
|
1063
|
-
p data # => <
|
|
1064
|
+
p data # => <TimezoneResponse>
|
|
1064
1065
|
rescue TimeLogic::Api::ApiError => e
|
|
1065
1066
|
puts "Error when calling TimeApi->get_timezone_with_http_info: #{e}"
|
|
1066
1067
|
end
|
|
@@ -1077,10 +1078,11 @@ end
|
|
|
1077
1078
|
| **offset** | **String** | Fixed UTC offset in `+HH:MM` or `-HH:MM` format only (`+0530` and `+5` are rejected); URL-encode `+` as `%2B`, since an unencoded `+` is read as a space. An offset target returns `timezone=null`. On bulk-capable routes, a comma-separated list enables bulk mode with at most 10 values; request URLs are limited to 8192 characters. | [optional] |
|
|
1078
1079
|
| **auto_tz** | **Boolean** | Set to `true` to resolve using the caller IP from Cloudflare headers. Counts as a selector family, so it cannot be combined with `tz`, `ip`, `lat`/`lon` or `offset`. Not supported on `/v1/time/clock`. Enabled by `true`, `1` or `yes` (case-insensitive); any other value leaves it off without an error. | [optional] |
|
|
1079
1080
|
| **sign** | **Boolean** | Set to `true`, `1` or `yes` (case-insensitive) to ask the gateway to sign the final JSON response. Any other value, a bare `sign`, or repeated `sign` values leave the response unsigned. Every authenticated JSON response, including errors, then includes signing headers. Not supported on `/v1/time/clock`. | [optional] |
|
|
1081
|
+
| **format** | **String** | Custom date/time format template using supported `strftime`-style directives such as `%Y-%m-%d %H:%M:%S`. Supported directives: `%a %A %b %B %C %d %D %e %F %h %H %I %j %k %l %m %M %n %p %P %r %R %s %S %t %T %u %v %w %x %X %y %Y %z %:z %Z %%`, with the `-`, `_` and `0` padding flags on numeric directives. `%Z` prints the IANA zone name (or `UTC+HH:MM` for an offset target, `UTC` with no target), not an abbreviation. Any other directive (for example `%U`, `%f`, `%Q`) or a trailing `%` returns 400 INVALID_PARAMETER naming the directive. | [optional] |
|
|
1080
1082
|
|
|
1081
1083
|
### Return type
|
|
1082
1084
|
|
|
1083
|
-
[**
|
|
1085
|
+
[**TimezoneResponse**](TimezoneResponse.md)
|
|
1084
1086
|
|
|
1085
1087
|
### Authorization
|
|
1086
1088
|
|
data/docs/TimezoneMatch.md
CHANGED
|
@@ -4,19 +4,9 @@
|
|
|
4
4
|
|
|
5
5
|
| Name | Type | Description | Notes |
|
|
6
6
|
| ---- | ---- | ----------- | ----- |
|
|
7
|
-
| **
|
|
8
|
-
| **
|
|
9
|
-
| **
|
|
10
|
-
| **iso_local** | **String** | | |
|
|
11
|
-
| **rfc2822** | **String** | | |
|
|
12
|
-
| **human** | **String** | | |
|
|
13
|
-
| **day_number** | **Integer** | Day of the week counted from Sunday (1 = Sunday, 2 = Monday ... 7 = Saturday). | |
|
|
14
|
-
| **day_short** | **String** | | |
|
|
15
|
-
| **day_full** | **String** | | |
|
|
16
|
-
| **timezone** | **String** | | |
|
|
17
|
-
| **formatted** | **String** | | [optional] |
|
|
18
|
-
| **offset** | **Integer** | | |
|
|
19
|
-
| **dst** | **Boolean** | | |
|
|
7
|
+
| **timezone** | **String** | IANA timezone name. | |
|
|
8
|
+
| **offset** | **Integer** | Current UTC offset of the zone in minutes. | |
|
|
9
|
+
| **dst** | **Boolean** | Whether daylight saving time is currently in effect in the zone. | |
|
|
20
10
|
|
|
21
11
|
## Example
|
|
22
12
|
|
|
@@ -24,17 +14,7 @@
|
|
|
24
14
|
require 'timelogic-api'
|
|
25
15
|
|
|
26
16
|
instance = TimeLogic::Api::TimezoneMatch.new(
|
|
27
|
-
unix: null,
|
|
28
|
-
unix_ms: null,
|
|
29
|
-
utc: null,
|
|
30
|
-
iso_local: null,
|
|
31
|
-
rfc2822: null,
|
|
32
|
-
human: null,
|
|
33
|
-
day_number: null,
|
|
34
|
-
day_short: null,
|
|
35
|
-
day_full: null,
|
|
36
17
|
timezone: null,
|
|
37
|
-
formatted: null,
|
|
38
18
|
offset: null,
|
|
39
19
|
dst: null
|
|
40
20
|
)
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# TimeLogic::Api::
|
|
1
|
+
# TimeLogic::Api::TimezoneResponse
|
|
2
2
|
|
|
3
3
|
## Properties
|
|
4
4
|
|
|
@@ -15,16 +15,17 @@
|
|
|
15
15
|
| **day_full** | **String** | | |
|
|
16
16
|
| **timezone** | **String** | | |
|
|
17
17
|
| **formatted** | **String** | | [optional] |
|
|
18
|
-
| **offset** | **Integer** |
|
|
19
|
-
| **dst** | **Boolean** |
|
|
20
|
-
| **
|
|
18
|
+
| **offset** | **Integer** | UTC offset of the resolved target in minutes, for example `-240` for UTC-04:00. | |
|
|
19
|
+
| **dst** | **Boolean** | Whether daylight saving time is in effect for the resolved target. Always `false` for `offset` lookups. | |
|
|
20
|
+
| **offset_seconds** | **Integer** | Exact UTC offset in seconds. Present only when the resolved offset has a seconds part (historical local mean time); no zone has one at the current instant, so lookups today do not include it. | [optional] |
|
|
21
|
+
| **matching_zones** | [**Array<TimezoneMatch>**](TimezoneMatch.md) | Present only for `offset=` lookups. The geographic zones whose current offset equals the requested one. `UTC` and `Etc/*` zones are intentionally excluded; use `tz=UTC` for UTC. | [optional] |
|
|
21
22
|
|
|
22
23
|
## Example
|
|
23
24
|
|
|
24
25
|
```ruby
|
|
25
26
|
require 'timelogic-api'
|
|
26
27
|
|
|
27
|
-
instance = TimeLogic::Api::
|
|
28
|
+
instance = TimeLogic::Api::TimezoneResponse.new(
|
|
28
29
|
unix: null,
|
|
29
30
|
unix_ms: null,
|
|
30
31
|
utc: null,
|
|
@@ -38,6 +39,7 @@ instance = TimeLogic::Api::TimezoneOffsetResponse.new(
|
|
|
38
39
|
formatted: null,
|
|
39
40
|
offset: null,
|
|
40
41
|
dst: null,
|
|
42
|
+
offset_seconds: null,
|
|
41
43
|
matching_zones: null
|
|
42
44
|
)
|
|
43
45
|
```
|
|
@@ -257,10 +257,6 @@ module TimeLogic::Api
|
|
|
257
257
|
fail ArgumentError, "invalid value for 'opts[:\"source_offset\"]' when calling TimeApi.convert_time, must conform to the pattern #{pattern}."
|
|
258
258
|
end
|
|
259
259
|
|
|
260
|
-
if @api_client.config.client_side_validation && !opts[:'tz'].nil? && opts[:'tz'].to_s.length > 64
|
|
261
|
-
fail ArgumentError, 'invalid value for "opts[:"tz"]" when calling TimeApi.convert_time, the character length must be smaller than or equal to 64.'
|
|
262
|
-
end
|
|
263
|
-
|
|
264
260
|
if @api_client.config.client_side_validation && !opts[:'lat'].nil? && opts[:'lat'] > 90
|
|
265
261
|
fail ArgumentError, 'invalid value for "opts[:"lat"]" when calling TimeApi.convert_time, must be smaller than or equal to 90.'
|
|
266
262
|
end
|
|
@@ -277,11 +273,6 @@ module TimeLogic::Api
|
|
|
277
273
|
fail ArgumentError, 'invalid value for "opts[:"lon"]" when calling TimeApi.convert_time, must be greater than or equal to -180.'
|
|
278
274
|
end
|
|
279
275
|
|
|
280
|
-
pattern = Regexp.new(/^[+-](0\d|1\d|2[0-3]):[0-5]\d$/)
|
|
281
|
-
if @api_client.config.client_side_validation && !opts[:'offset'].nil? && opts[:'offset'] !~ pattern
|
|
282
|
-
fail ArgumentError, "invalid value for 'opts[:\"offset\"]' when calling TimeApi.convert_time, must conform to the pattern #{pattern}."
|
|
283
|
-
end
|
|
284
|
-
|
|
285
276
|
# resource path
|
|
286
277
|
local_var_path = '/v1/time/convert'
|
|
287
278
|
|
|
@@ -851,10 +842,6 @@ module TimeLogic::Api
|
|
|
851
842
|
if @api_client.config.debugging
|
|
852
843
|
@api_client.config.logger.debug 'Calling API: TimeApi.get_current_time ...'
|
|
853
844
|
end
|
|
854
|
-
if @api_client.config.client_side_validation && !opts[:'tz'].nil? && opts[:'tz'].to_s.length > 64
|
|
855
|
-
fail ArgumentError, 'invalid value for "opts[:"tz"]" when calling TimeApi.get_current_time, the character length must be smaller than or equal to 64.'
|
|
856
|
-
end
|
|
857
|
-
|
|
858
845
|
if @api_client.config.client_side_validation && !opts[:'lat'].nil? && opts[:'lat'] > 90
|
|
859
846
|
fail ArgumentError, 'invalid value for "opts[:"lat"]" when calling TimeApi.get_current_time, must be smaller than or equal to 90.'
|
|
860
847
|
end
|
|
@@ -871,11 +858,6 @@ module TimeLogic::Api
|
|
|
871
858
|
fail ArgumentError, 'invalid value for "opts[:"lon"]" when calling TimeApi.get_current_time, must be greater than or equal to -180.'
|
|
872
859
|
end
|
|
873
860
|
|
|
874
|
-
pattern = Regexp.new(/^[+-](0\d|1\d|2[0-3]):[0-5]\d$/)
|
|
875
|
-
if @api_client.config.client_side_validation && !opts[:'offset'].nil? && opts[:'offset'] !~ pattern
|
|
876
|
-
fail ArgumentError, "invalid value for 'opts[:\"offset\"]' when calling TimeApi.get_current_time, must conform to the pattern #{pattern}."
|
|
877
|
-
end
|
|
878
|
-
|
|
879
861
|
# resource path
|
|
880
862
|
local_var_path = '/v1/time/current'
|
|
881
863
|
|
|
@@ -1258,7 +1240,8 @@ module TimeLogic::Api
|
|
|
1258
1240
|
# @option opts [String] :offset Fixed UTC offset in `+HH:MM` or `-HH:MM` format only (`+0530` and `+5` are rejected); URL-encode `+` as `%2B`, since an unencoded `+` is read as a space. An offset target returns `timezone=null`. On bulk-capable routes, a comma-separated list enables bulk mode with at most 10 values; request URLs are limited to 8192 characters.
|
|
1259
1241
|
# @option opts [Boolean] :auto_tz Set to `true` to resolve using the caller IP from Cloudflare headers. Counts as a selector family, so it cannot be combined with `tz`, `ip`, `lat`/`lon` or `offset`. Not supported on `/v1/time/clock`. Enabled by `true`, `1` or `yes` (case-insensitive); any other value leaves it off without an error.
|
|
1260
1242
|
# @option opts [Boolean] :sign Set to `true`, `1` or `yes` (case-insensitive) to ask the gateway to sign the final JSON response. Any other value, a bare `sign`, or repeated `sign` values leave the response unsigned. Every authenticated JSON response, including errors, then includes signing headers. Not supported on `/v1/time/clock`.
|
|
1261
|
-
# @
|
|
1243
|
+
# @option opts [String] :format Custom date/time format template using supported `strftime`-style directives such as `%Y-%m-%d %H:%M:%S`. Supported directives: `%a %A %b %B %C %d %D %e %F %h %H %I %j %k %l %m %M %n %p %P %r %R %s %S %t %T %u %v %w %x %X %y %Y %z %:z %Z %%`, with the `-`, `_` and `0` padding flags on numeric directives. `%Z` prints the IANA zone name (or `UTC+HH:MM` for an offset target, `UTC` with no target), not an abbreviation. Any other directive (for example `%U`, `%f`, `%Q`) or a trailing `%` returns 400 INVALID_PARAMETER naming the directive.
|
|
1244
|
+
# @return [TimezoneResponse]
|
|
1262
1245
|
def get_timezone(opts = {})
|
|
1263
1246
|
data, _status_code, _headers = get_timezone_with_http_info(opts)
|
|
1264
1247
|
data
|
|
@@ -1274,7 +1257,8 @@ module TimeLogic::Api
|
|
|
1274
1257
|
# @option opts [String] :offset Fixed UTC offset in `+HH:MM` or `-HH:MM` format only (`+0530` and `+5` are rejected); URL-encode `+` as `%2B`, since an unencoded `+` is read as a space. An offset target returns `timezone=null`. On bulk-capable routes, a comma-separated list enables bulk mode with at most 10 values; request URLs are limited to 8192 characters.
|
|
1275
1258
|
# @option opts [Boolean] :auto_tz Set to `true` to resolve using the caller IP from Cloudflare headers. Counts as a selector family, so it cannot be combined with `tz`, `ip`, `lat`/`lon` or `offset`. Not supported on `/v1/time/clock`. Enabled by `true`, `1` or `yes` (case-insensitive); any other value leaves it off without an error.
|
|
1276
1259
|
# @option opts [Boolean] :sign Set to `true`, `1` or `yes` (case-insensitive) to ask the gateway to sign the final JSON response. Any other value, a bare `sign`, or repeated `sign` values leave the response unsigned. Every authenticated JSON response, including errors, then includes signing headers. Not supported on `/v1/time/clock`.
|
|
1277
|
-
# @
|
|
1260
|
+
# @option opts [String] :format Custom date/time format template using supported `strftime`-style directives such as `%Y-%m-%d %H:%M:%S`. Supported directives: `%a %A %b %B %C %d %D %e %F %h %H %I %j %k %l %m %M %n %p %P %r %R %s %S %t %T %u %v %w %x %X %y %Y %z %:z %Z %%`, with the `-`, `_` and `0` padding flags on numeric directives. `%Z` prints the IANA zone name (or `UTC+HH:MM` for an offset target, `UTC` with no target), not an abbreviation. Any other directive (for example `%U`, `%f`, `%Q`) or a trailing `%` returns 400 INVALID_PARAMETER naming the directive.
|
|
1261
|
+
# @return [Array<(TimezoneResponse, Integer, Hash)>] TimezoneResponse data, response status code and response headers
|
|
1278
1262
|
def get_timezone_with_http_info(opts = {})
|
|
1279
1263
|
if @api_client.config.debugging
|
|
1280
1264
|
@api_client.config.logger.debug 'Calling API: TimeApi.get_timezone ...'
|
|
@@ -1316,6 +1300,7 @@ module TimeLogic::Api
|
|
|
1316
1300
|
query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
|
|
1317
1301
|
query_params[:'auto_tz'] = opts[:'auto_tz'] if !opts[:'auto_tz'].nil?
|
|
1318
1302
|
query_params[:'sign'] = opts[:'sign'] if !opts[:'sign'].nil?
|
|
1303
|
+
query_params[:'format'] = opts[:'format'] if !opts[:'format'].nil?
|
|
1319
1304
|
|
|
1320
1305
|
# header parameters
|
|
1321
1306
|
header_params = opts[:header_params] || {}
|
|
@@ -1329,7 +1314,7 @@ module TimeLogic::Api
|
|
|
1329
1314
|
post_body = opts[:debug_body]
|
|
1330
1315
|
|
|
1331
1316
|
# return_type
|
|
1332
|
-
return_type = opts[:debug_return_type] || '
|
|
1317
|
+
return_type = opts[:debug_return_type] || 'TimezoneResponse'
|
|
1333
1318
|
|
|
1334
1319
|
# auth_names
|
|
1335
1320
|
auth_names = opts[:debug_auth_names] || ['apiKeyHeader', 'bearerAuth', 'apiKeyQuery', 'rapidApiKey', 'rapidApiHost']
|
|
@@ -27,6 +27,12 @@ module TimeLogic::Api
|
|
|
27
27
|
|
|
28
28
|
attr_accessor :x
|
|
29
29
|
|
|
30
|
+
# Permitted key operations; published keys allow only `verify`.
|
|
31
|
+
attr_accessor :key_ops
|
|
32
|
+
|
|
33
|
+
# JWK extractable flag as exported by the signing worker; always `true`.
|
|
34
|
+
attr_accessor :ext
|
|
35
|
+
|
|
30
36
|
class EnumAttributeValidator
|
|
31
37
|
attr_reader :datatype
|
|
32
38
|
attr_reader :allowable_values
|
|
@@ -57,7 +63,9 @@ module TimeLogic::Api
|
|
|
57
63
|
:'alg' => :'alg',
|
|
58
64
|
:'use' => :'use',
|
|
59
65
|
:'kid' => :'kid',
|
|
60
|
-
:'x' => :'x'
|
|
66
|
+
:'x' => :'x',
|
|
67
|
+
:'key_ops' => :'key_ops',
|
|
68
|
+
:'ext' => :'ext'
|
|
61
69
|
}
|
|
62
70
|
end
|
|
63
71
|
|
|
@@ -74,7 +82,9 @@ module TimeLogic::Api
|
|
|
74
82
|
:'alg' => :'String',
|
|
75
83
|
:'use' => :'String',
|
|
76
84
|
:'kid' => :'String',
|
|
77
|
-
:'x' => :'String'
|
|
85
|
+
:'x' => :'String',
|
|
86
|
+
:'key_ops' => :'Array<String>',
|
|
87
|
+
:'ext' => :'Boolean'
|
|
78
88
|
}
|
|
79
89
|
end
|
|
80
90
|
|
|
@@ -134,6 +144,16 @@ module TimeLogic::Api
|
|
|
134
144
|
else
|
|
135
145
|
self.x = nil
|
|
136
146
|
end
|
|
147
|
+
|
|
148
|
+
if attributes.key?(:'key_ops')
|
|
149
|
+
if (value = attributes[:'key_ops']).is_a?(Array)
|
|
150
|
+
self.key_ops = value
|
|
151
|
+
end
|
|
152
|
+
end
|
|
153
|
+
|
|
154
|
+
if attributes.key?(:'ext')
|
|
155
|
+
self.ext = attributes[:'ext']
|
|
156
|
+
end
|
|
137
157
|
end
|
|
138
158
|
|
|
139
159
|
# Show invalid properties with the reasons. Usually used together with valid?
|
|
@@ -239,7 +259,9 @@ module TimeLogic::Api
|
|
|
239
259
|
alg == o.alg &&
|
|
240
260
|
use == o.use &&
|
|
241
261
|
kid == o.kid &&
|
|
242
|
-
x == o.x
|
|
262
|
+
x == o.x &&
|
|
263
|
+
key_ops == o.key_ops &&
|
|
264
|
+
ext == o.ext
|
|
243
265
|
end
|
|
244
266
|
|
|
245
267
|
# @see the `==` method
|
|
@@ -251,7 +273,7 @@ module TimeLogic::Api
|
|
|
251
273
|
# Calculates hash code according to all attributes.
|
|
252
274
|
# @return [Integer] Hash code
|
|
253
275
|
def hash
|
|
254
|
-
[kty, crv, alg, use, kid, x].hash
|
|
276
|
+
[kty, crv, alg, use, kid, x, key_ops, ext].hash
|
|
255
277
|
end
|
|
256
278
|
|
|
257
279
|
# Builds the object from hash
|
|
@@ -10,201 +10,47 @@ Generator version: 7.10.0
|
|
|
10
10
|
|
|
11
11
|
=end
|
|
12
12
|
|
|
13
|
-
require 'date'
|
|
14
|
-
require 'time'
|
|
15
|
-
|
|
16
13
|
module TimeLogic::Api
|
|
17
|
-
# Bulk response array returned when `/v1/time/current` or `/v1/time/convert`
|
|
14
|
+
# Bulk response array returned when `/v1/time/current` or `/v1/time/convert`
|
|
15
|
+
# receives one comma-separated `tz`, `ip`, or `offset` selector. Each item is
|
|
16
|
+
# a TimePayload or, for a selector that failed, a BulkError, in request order.
|
|
18
17
|
class TimePayloadBulkResponse < Array
|
|
19
|
-
#
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
end
|
|
24
|
-
|
|
25
|
-
#
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
{
|
|
33
|
-
}
|
|
34
|
-
end
|
|
35
|
-
|
|
36
|
-
# List of attributes with nullable: true
|
|
37
|
-
def self.openapi_nullable
|
|
38
|
-
Set.new([
|
|
39
|
-
])
|
|
40
|
-
end
|
|
41
|
-
|
|
42
|
-
# Initializes the object
|
|
43
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
|
44
|
-
def initialize(attributes = {})
|
|
45
|
-
if (!attributes.is_a?(Hash))
|
|
46
|
-
fail ArgumentError, "The input argument (attributes) must be a hash in `TimeLogic::Api::TimePayloadBulkResponse` initialize method"
|
|
18
|
+
# The oneOf caster calls build for models that answer openapi_one_of.
|
|
19
|
+
# This model is not a oneOf itself; it answers so its items are cast.
|
|
20
|
+
def self.openapi_one_of
|
|
21
|
+
[:TimePayloadBulkItem]
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
# Builds the bulk array from parsed JSON, or returns nil for anything else.
|
|
25
|
+
# @param [Array] data Parsed JSON array
|
|
26
|
+
# @return [TimePayloadBulkResponse, nil]
|
|
27
|
+
def self.build(data)
|
|
28
|
+
return nil unless data.is_a?(Array)
|
|
29
|
+
items = data.map do |item|
|
|
30
|
+
TimePayloadBulkItem.build(item) || fail(ArgumentError, "#{item} is neither a TimePayload nor a BulkError")
|
|
47
31
|
end
|
|
48
|
-
|
|
49
|
-
# check to see if the attribute exists and convert string to symbol for hash key
|
|
50
|
-
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
51
|
-
if (!self.class.attribute_map.key?(k.to_sym))
|
|
52
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `TimeLogic::Api::TimePayloadBulkResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
|
53
|
-
end
|
|
54
|
-
h[k.to_sym] = v
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
# call parent's initialize
|
|
58
|
-
super(attributes)
|
|
59
|
-
end
|
|
60
|
-
|
|
61
|
-
# Show invalid properties with the reasons. Usually used together with valid?
|
|
62
|
-
# @return Array for valid properties with the reasons
|
|
63
|
-
def list_invalid_properties
|
|
64
|
-
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
65
|
-
invalid_properties = super
|
|
66
|
-
invalid_properties
|
|
67
|
-
end
|
|
68
|
-
|
|
69
|
-
# Check to see if the all the properties in the model are valid
|
|
70
|
-
# @return true if the model is valid
|
|
71
|
-
def valid?
|
|
72
|
-
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
73
|
-
true && super
|
|
74
|
-
end
|
|
75
|
-
|
|
76
|
-
# Checks equality by comparing each attribute.
|
|
77
|
-
# @param [Object] Object to be compared
|
|
78
|
-
def ==(o)
|
|
79
|
-
return true if self.equal?(o)
|
|
80
|
-
self.class == o.class && super(o)
|
|
32
|
+
new(items)
|
|
81
33
|
end
|
|
82
34
|
|
|
83
|
-
# @see
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
self == o
|
|
35
|
+
# @see build
|
|
36
|
+
def self.build_from_hash(data)
|
|
37
|
+
build(data)
|
|
87
38
|
end
|
|
88
39
|
|
|
89
|
-
#
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
[].hash
|
|
40
|
+
# True when the item is a per-item error.
|
|
41
|
+
def self.bulk_error?(item)
|
|
42
|
+
item.is_a?(BulkError)
|
|
93
43
|
end
|
|
94
44
|
|
|
95
|
-
#
|
|
96
|
-
# @
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
return nil unless attributes.is_a?(Hash)
|
|
100
|
-
super(attributes)
|
|
101
|
-
attributes = attributes.transform_keys(&:to_sym)
|
|
102
|
-
transformed_hash = {}
|
|
103
|
-
openapi_types.each_pair do |key, type|
|
|
104
|
-
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
105
|
-
transformed_hash["#{key}"] = nil
|
|
106
|
-
elsif type =~ /\AArray<(.*)>/i
|
|
107
|
-
# check to ensure the input is an array given that the attribute
|
|
108
|
-
# is documented as an array but the input is not
|
|
109
|
-
if attributes[attribute_map[key]].is_a?(Array)
|
|
110
|
-
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
111
|
-
end
|
|
112
|
-
elsif !attributes[attribute_map[key]].nil?
|
|
113
|
-
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
114
|
-
end
|
|
115
|
-
end
|
|
116
|
-
new(transformed_hash)
|
|
117
|
-
end
|
|
118
|
-
|
|
119
|
-
# Deserializes the data based on type
|
|
120
|
-
# @param string type Data type
|
|
121
|
-
# @param string value Value to be deserialized
|
|
122
|
-
# @return [Object] Deserialized data
|
|
123
|
-
def self._deserialize(type, value)
|
|
124
|
-
case type.to_sym
|
|
125
|
-
when :Time
|
|
126
|
-
Time.parse(value)
|
|
127
|
-
when :Date
|
|
128
|
-
Date.parse(value)
|
|
129
|
-
when :String
|
|
130
|
-
value.to_s
|
|
131
|
-
when :Integer
|
|
132
|
-
value.to_i
|
|
133
|
-
when :Float
|
|
134
|
-
value.to_f
|
|
135
|
-
when :Boolean
|
|
136
|
-
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
137
|
-
true
|
|
138
|
-
else
|
|
139
|
-
false
|
|
140
|
-
end
|
|
141
|
-
when :Object
|
|
142
|
-
# generic object (usually a Hash), return directly
|
|
143
|
-
value
|
|
144
|
-
when /\AArray<(?<inner_type>.+)>\z/
|
|
145
|
-
inner_type = Regexp.last_match[:inner_type]
|
|
146
|
-
value.map { |v| _deserialize(inner_type, v) }
|
|
147
|
-
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
148
|
-
k_type = Regexp.last_match[:k_type]
|
|
149
|
-
v_type = Regexp.last_match[:v_type]
|
|
150
|
-
{}.tap do |hash|
|
|
151
|
-
value.each do |k, v|
|
|
152
|
-
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
153
|
-
end
|
|
154
|
-
end
|
|
155
|
-
else # model
|
|
156
|
-
# models (e.g. Pet) or oneOf
|
|
157
|
-
klass = TimeLogic::Api.const_get(type)
|
|
158
|
-
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
159
|
-
end
|
|
45
|
+
# Returns the items as plain hashes, in the API's JSON shape.
|
|
46
|
+
# @return [Array<Hash>]
|
|
47
|
+
def to_hash
|
|
48
|
+
map { |item| item.respond_to?(:to_hash) ? item.to_hash : item }
|
|
160
49
|
end
|
|
50
|
+
alias to_body to_hash
|
|
161
51
|
|
|
162
|
-
# Returns the string representation of the object
|
|
163
|
-
# @return [String] String presentation of the object
|
|
164
52
|
def to_s
|
|
165
53
|
to_hash.to_s
|
|
166
54
|
end
|
|
167
|
-
|
|
168
|
-
# to_body is an alias to to_hash (backward compatibility)
|
|
169
|
-
# @return [Hash] Returns the object in the form of hash
|
|
170
|
-
def to_body
|
|
171
|
-
to_hash
|
|
172
|
-
end
|
|
173
|
-
|
|
174
|
-
# Returns the object in the form of hash
|
|
175
|
-
# @return [Hash] Returns the object in the form of hash
|
|
176
|
-
def to_hash
|
|
177
|
-
hash = super
|
|
178
|
-
self.class.attribute_map.each_pair do |attr, param|
|
|
179
|
-
value = self.send(attr)
|
|
180
|
-
if value.nil?
|
|
181
|
-
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
182
|
-
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
183
|
-
end
|
|
184
|
-
|
|
185
|
-
hash[param] = _to_hash(value)
|
|
186
|
-
end
|
|
187
|
-
hash
|
|
188
|
-
end
|
|
189
|
-
|
|
190
|
-
# Outputs non-array value in the form of hash
|
|
191
|
-
# For object, use to_hash. Otherwise, just return the value
|
|
192
|
-
# @param [Object] value Any valid value
|
|
193
|
-
# @return [Hash] Returns the value in the form of hash
|
|
194
|
-
def _to_hash(value)
|
|
195
|
-
if value.is_a?(Array)
|
|
196
|
-
value.compact.map { |v| _to_hash(v) }
|
|
197
|
-
elsif value.is_a?(Hash)
|
|
198
|
-
{}.tap do |hash|
|
|
199
|
-
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
200
|
-
end
|
|
201
|
-
elsif value.respond_to? :to_hash
|
|
202
|
-
value.to_hash
|
|
203
|
-
else
|
|
204
|
-
value
|
|
205
|
-
end
|
|
206
|
-
end
|
|
207
|
-
|
|
208
55
|
end
|
|
209
|
-
|
|
210
56
|
end
|