timelogic-api 1.0.3 → 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.
Files changed (42) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +314 -133
  3. data/docs/BulkError.md +1 -1
  4. data/docs/CalendarResponse.md +2 -2
  5. data/docs/DstResponse.md +2 -2
  6. data/docs/ElapsedResponse.md +1 -1
  7. data/docs/ErrorResponse.md +1 -1
  8. data/docs/JwkKey.md +5 -1
  9. data/docs/TimeApi.md +157 -155
  10. data/docs/TimePayload.md +1 -1
  11. data/docs/TimezoneMatch.md +3 -23
  12. data/docs/TimezoneResponse.md +46 -0
  13. data/lib/timelogic-api/api/time_api.rb +175 -180
  14. data/lib/timelogic-api/api/utility_api.rb +1 -1
  15. data/lib/timelogic-api/api_client.rb +3 -1
  16. data/lib/timelogic-api/api_error.rb +1 -1
  17. data/lib/timelogic-api/configuration.rb +1 -1
  18. data/lib/timelogic-api/models/api_error.rb +1 -1
  19. data/lib/timelogic-api/models/bulk_error.rb +2 -2
  20. data/lib/timelogic-api/models/calendar_response.rb +3 -1
  21. data/lib/timelogic-api/models/diff_endpoint_ref.rb +1 -1
  22. data/lib/timelogic-api/models/diff_response.rb +1 -1
  23. data/lib/timelogic-api/models/dst_response.rb +3 -1
  24. data/lib/timelogic-api/models/elapsed_response.rb +2 -2
  25. data/lib/timelogic-api/models/error_response.rb +2 -2
  26. data/lib/timelogic-api/models/get_current_time200_response.rb +1 -1
  27. data/lib/timelogic-api/models/jwk_key.rb +27 -5
  28. data/lib/timelogic-api/models/jwks_response.rb +1 -1
  29. data/lib/timelogic-api/models/time_payload.rb +2 -1
  30. data/lib/timelogic-api/models/time_payload_bulk_item.rb +1 -1
  31. data/lib/timelogic-api/models/time_payload_bulk_response.rb +29 -183
  32. data/lib/timelogic-api/models/timezone_match.rb +6 -186
  33. data/lib/timelogic-api/models/{timezone_offset_response.rb → timezone_response.rb} +21 -14
  34. data/lib/timelogic-api/version.rb +1 -1
  35. data/lib/timelogic-api/world_time_api.rb +192 -0
  36. data/lib/timelogic-api.rb +3 -4
  37. metadata +5 -8
  38. data/docs/GetTimezone200Response.md +0 -49
  39. data/docs/TimezoneOffsetResponse.md +0 -44
  40. data/docs/TimezoneResolvedResponse.md +0 -42
  41. data/lib/timelogic-api/models/get_timezone200_response.rb +0 -105
  42. data/lib/timelogic-api/models/timezone_resolved_response.rb +0 -434
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: timelogic-api
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.3
4
+ version: 2.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - TimeLogic API LLC
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2026-09-29 00:00:00.000000000 Z
11
+ date: 2026-11-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: typhoeus
@@ -68,7 +68,6 @@ files:
68
68
  - docs/ElapsedResponse.md
69
69
  - docs/ErrorResponse.md
70
70
  - docs/GetCurrentTime200Response.md
71
- - docs/GetTimezone200Response.md
72
71
  - docs/JwkKey.md
73
72
  - docs/JwksResponse.md
74
73
  - docs/TimeApi.md
@@ -76,8 +75,7 @@ files:
76
75
  - docs/TimePayloadBulkItem.md
77
76
  - docs/TimePayloadBulkResponse.md
78
77
  - docs/TimezoneMatch.md
79
- - docs/TimezoneOffsetResponse.md
80
- - docs/TimezoneResolvedResponse.md
78
+ - docs/TimezoneResponse.md
81
79
  - docs/UtilityApi.md
82
80
  - lib/timelogic-api.rb
83
81
  - lib/timelogic-api/api/time_api.rb
@@ -94,17 +92,16 @@ files:
94
92
  - lib/timelogic-api/models/elapsed_response.rb
95
93
  - lib/timelogic-api/models/error_response.rb
96
94
  - lib/timelogic-api/models/get_current_time200_response.rb
97
- - lib/timelogic-api/models/get_timezone200_response.rb
98
95
  - lib/timelogic-api/models/jwk_key.rb
99
96
  - lib/timelogic-api/models/jwks_response.rb
100
97
  - lib/timelogic-api/models/time_payload.rb
101
98
  - lib/timelogic-api/models/time_payload_bulk_item.rb
102
99
  - lib/timelogic-api/models/time_payload_bulk_response.rb
103
100
  - lib/timelogic-api/models/timezone_match.rb
104
- - lib/timelogic-api/models/timezone_offset_response.rb
105
- - lib/timelogic-api/models/timezone_resolved_response.rb
101
+ - lib/timelogic-api/models/timezone_response.rb
106
102
  - lib/timelogic-api/transport_configuration.rb
107
103
  - lib/timelogic-api/version.rb
104
+ - lib/timelogic-api/world_time_api.rb
108
105
  homepage: https://github.com/TimeLogic-API-LLC/timelogic-api-sdks
109
106
  licenses:
110
107
  - Unlicense
@@ -1,49 +0,0 @@
1
- # TimeLogic::Api::GetTimezone200Response
2
-
3
- ## Class instance methods
4
-
5
- ### `openapi_one_of`
6
-
7
- Returns the list of classes defined in oneOf.
8
-
9
- #### Example
10
-
11
- ```ruby
12
- require 'timelogic-api'
13
-
14
- TimeLogic::Api::GetTimezone200Response.openapi_one_of
15
- # =>
16
- # [
17
- # :'TimezoneOffsetResponse',
18
- # :'TimezoneResolvedResponse'
19
- # ]
20
- ```
21
-
22
- ### build
23
-
24
- Find the appropriate object from the `openapi_one_of` list and casts the data into it.
25
-
26
- #### Example
27
-
28
- ```ruby
29
- require 'timelogic-api'
30
-
31
- TimeLogic::Api::GetTimezone200Response.build(data)
32
- # => #<TimezoneOffsetResponse:0x00007fdd4aab02a0>
33
-
34
- TimeLogic::Api::GetTimezone200Response.build(data_that_doesnt_match)
35
- # => nil
36
- ```
37
-
38
- #### Parameters
39
-
40
- | Name | Type | Description |
41
- | ---- | ---- | ----------- |
42
- | **data** | **Mixed** | data to be matched against the list of oneOf items |
43
-
44
- #### Return type
45
-
46
- - `TimezoneOffsetResponse`
47
- - `TimezoneResolvedResponse`
48
- - `nil` (if no type matches)
49
-
@@ -1,44 +0,0 @@
1
- # TimeLogic::Api::TimezoneOffsetResponse
2
-
3
- ## Properties
4
-
5
- | Name | Type | Description | Notes |
6
- | ---- | ---- | ----------- | ----- |
7
- | **unix** | **Integer** | | |
8
- | **unix_ms** | **Integer** | | |
9
- | **utc** | **Time** | | |
10
- | **iso_local** | **String** | | |
11
- | **rfc2822** | **String** | | |
12
- | **human** | **String** | | |
13
- | **day_number** | **Integer** | | |
14
- | **day_short** | **String** | | |
15
- | **day_full** | **String** | | |
16
- | **timezone** | **String** | | |
17
- | **formatted** | **String** | | [optional] |
18
- | **offset** | **Integer** | | |
19
- | **dst** | **Boolean** | | |
20
- | **matching_zones** | [**Array&lt;TimezoneMatch&gt;**](TimezoneMatch.md) | | |
21
-
22
- ## Example
23
-
24
- ```ruby
25
- require 'timelogic-api'
26
-
27
- instance = TimeLogic::Api::TimezoneOffsetResponse.new(
28
- unix: null,
29
- unix_ms: null,
30
- utc: null,
31
- iso_local: null,
32
- rfc2822: null,
33
- human: null,
34
- day_number: null,
35
- day_short: null,
36
- day_full: null,
37
- timezone: null,
38
- formatted: null,
39
- offset: null,
40
- dst: null,
41
- matching_zones: null
42
- )
43
- ```
44
-
@@ -1,42 +0,0 @@
1
- # TimeLogic::Api::TimezoneResolvedResponse
2
-
3
- ## Properties
4
-
5
- | Name | Type | Description | Notes |
6
- | ---- | ---- | ----------- | ----- |
7
- | **unix** | **Integer** | | |
8
- | **unix_ms** | **Integer** | | |
9
- | **utc** | **Time** | | |
10
- | **iso_local** | **String** | | |
11
- | **rfc2822** | **String** | | |
12
- | **human** | **String** | | |
13
- | **day_number** | **Integer** | | |
14
- | **day_short** | **String** | | |
15
- | **day_full** | **String** | | |
16
- | **timezone** | **String** | | |
17
- | **formatted** | **String** | | [optional] |
18
- | **offset** | **Integer** | | |
19
- | **dst** | **Boolean** | | |
20
-
21
- ## Example
22
-
23
- ```ruby
24
- require 'timelogic-api'
25
-
26
- instance = TimeLogic::Api::TimezoneResolvedResponse.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
- timezone: null,
37
- formatted: null,
38
- offset: null,
39
- dst: null
40
- )
41
- ```
42
-
@@ -1,105 +0,0 @@
1
- =begin
2
- #TimeLogic API | A World Time API
3
-
4
- # Official public API contract for TimeLogic API.
5
-
6
- The version of the OpenAPI document: 1.0.0
7
-
8
- Generated by: https://github.com/TimeLogic-API-LLC/timelogic-api-sdks.git
9
- Generator version: 7.10.0
10
-
11
- =end
12
-
13
- require 'date'
14
- require 'time'
15
-
16
- module TimeLogic::Api
17
- module GetTimezone200Response
18
- class << self
19
- # List of class defined in oneOf (OpenAPI v3)
20
- def openapi_one_of
21
- [
22
- :'TimezoneOffsetResponse',
23
- :'TimezoneResolvedResponse'
24
- ]
25
- end
26
-
27
- # Builds the object
28
- # @param [Mixed] Data to be matched against the list of oneOf items
29
- # @return [Object] Returns the model or the data itself
30
- def build(data)
31
- # Go through the list of oneOf items and attempt to identify the appropriate one.
32
- # Note:
33
- # - We do not attempt to check whether exactly one item matches.
34
- # - No advanced validation of types in some cases (e.g. "x: { type: string }" will happily match { x: 123 })
35
- # due to the way the deserialization is made in the base_object template (it just casts without verifying).
36
- # - TODO: scalar values are de facto behaving as if they were nullable.
37
- # - TODO: logging when debugging is set.
38
- openapi_one_of.each do |klass|
39
- begin
40
- next if klass == :AnyType # "nullable: true"
41
- typed_data = find_and_cast_into_type(klass, data)
42
- return typed_data if typed_data
43
- rescue # rescue all errors so we keep iterating even if the current item lookup raises
44
- end
45
- end
46
-
47
- openapi_one_of.include?(:AnyType) ? data : nil
48
- end
49
-
50
- private
51
-
52
- SchemaMismatchError = Class.new(StandardError)
53
-
54
- # Note: 'File' is missing here because in the regular case we get the data _after_ a call to JSON.parse.
55
- def find_and_cast_into_type(klass, data)
56
- return if data.nil?
57
-
58
- case klass.to_s
59
- when 'Boolean'
60
- return data if data.instance_of?(TrueClass) || data.instance_of?(FalseClass)
61
- when 'Float'
62
- return data if data.instance_of?(Float)
63
- when 'Integer'
64
- return data if data.instance_of?(Integer)
65
- when 'Time'
66
- return Time.parse(data)
67
- when 'Date'
68
- return Date.parse(data)
69
- when 'String'
70
- return data if data.instance_of?(String)
71
- when 'Object' # "type: object"
72
- return data if data.instance_of?(Hash)
73
- when /\AArray<(?<sub_type>.+)>\z/ # "type: array"
74
- if data.instance_of?(Array)
75
- sub_type = Regexp.last_match[:sub_type]
76
- return data.map { |item| find_and_cast_into_type(sub_type, item) }
77
- end
78
- when /\AHash<String, (?<sub_type>.+)>\z/ # "type: object" with "additionalProperties: { ... }"
79
- if data.instance_of?(Hash) && data.keys.all? { |k| k.instance_of?(Symbol) || k.instance_of?(String) }
80
- sub_type = Regexp.last_match[:sub_type]
81
- return data.each_with_object({}) { |(k, v), hsh| hsh[k] = find_and_cast_into_type(sub_type, v) }
82
- end
83
- else # model
84
- const = TimeLogic::Api.const_get(klass)
85
- if const
86
- if const.respond_to?(:openapi_one_of) # nested oneOf model
87
- model = const.build(data)
88
- return model if model
89
- else
90
- # raise if data contains keys that are not known to the model
91
- raise if const.respond_to?(:acceptable_attributes) && !(data.keys - const.acceptable_attributes).empty?
92
- model = const.build_from_hash(data)
93
- return model if model
94
- end
95
- end
96
- end
97
-
98
- raise # if no match by now, raise
99
- rescue
100
- raise SchemaMismatchError, "#{data} doesn't match the #{klass} type"
101
- end
102
- end
103
- end
104
-
105
- end