celitech 2.0.7

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 (63) hide show
  1. checksums.yaml +7 -0
  2. data/README.md +225 -0
  3. data/lib/celitech/client.rb +81 -0
  4. data/lib/celitech/config.rb +48 -0
  5. data/lib/celitech/environment.rb +7 -0
  6. data/lib/celitech/error.rb +50 -0
  7. data/lib/celitech/http/connection.rb +321 -0
  8. data/lib/celitech/http/hooks.rb +17 -0
  9. data/lib/celitech/http/oauth_token_manager.rb +76 -0
  10. data/lib/celitech/http/response.rb +35 -0
  11. data/lib/celitech/models/bad_request.rb +47 -0
  12. data/lib/celitech/models/create_purchase_ok_response.rb +63 -0
  13. data/lib/celitech/models/create_purchase_ok_response_profile.rb +75 -0
  14. data/lib/celitech/models/create_purchase_ok_response_purchase.rb +111 -0
  15. data/lib/celitech/models/create_purchase_request.rb +155 -0
  16. data/lib/celitech/models/create_purchase_request_language.rb +14 -0
  17. data/lib/celitech/models/create_purchase_v2_ok_response.rb +63 -0
  18. data/lib/celitech/models/create_purchase_v2_ok_response_profile.rb +96 -0
  19. data/lib/celitech/models/create_purchase_v2_ok_response_purchase.rb +70 -0
  20. data/lib/celitech/models/create_purchase_v2_request.rb +156 -0
  21. data/lib/celitech/models/create_purchase_v2_request_language.rb +14 -0
  22. data/lib/celitech/models/destinations.rb +80 -0
  23. data/lib/celitech/models/device.rb +80 -0
  24. data/lib/celitech/models/edit_purchase_ok_response.rb +90 -0
  25. data/lib/celitech/models/edit_purchase_request.rb +90 -0
  26. data/lib/celitech/models/get_esim_device_ok_response.rb +52 -0
  27. data/lib/celitech/models/get_esim_history_ok_response.rb +52 -0
  28. data/lib/celitech/models/get_esim_history_ok_response_esim.rb +61 -0
  29. data/lib/celitech/models/get_esim_ok_response.rb +52 -0
  30. data/lib/celitech/models/get_esim_ok_response_esim.rb +116 -0
  31. data/lib/celitech/models/get_purchase_consumption_ok_response.rb +70 -0
  32. data/lib/celitech/models/grant_type.rb +10 -0
  33. data/lib/celitech/models/history.rb +70 -0
  34. data/lib/celitech/models/list_destinations_ok_response.rb +51 -0
  35. data/lib/celitech/models/list_packages_ok_response.rb +64 -0
  36. data/lib/celitech/models/list_purchases_ok_response.rb +64 -0
  37. data/lib/celitech/models/o_auth_token_request.rb +84 -0
  38. data/lib/celitech/models/o_auth_token_response.rb +60 -0
  39. data/lib/celitech/models/open_model.rb +30 -0
  40. data/lib/celitech/models/package.rb +111 -0
  41. data/lib/celitech/models/packages.rb +121 -0
  42. data/lib/celitech/models/purchases.rb +178 -0
  43. data/lib/celitech/models/purchases_esim.rb +51 -0
  44. data/lib/celitech/models/serializable.rb +63 -0
  45. data/lib/celitech/models/token_ok_response.rb +47 -0
  46. data/lib/celitech/models/top_up_esim_ok_response.rb +63 -0
  47. data/lib/celitech/models/top_up_esim_ok_response_profile.rb +51 -0
  48. data/lib/celitech/models/top_up_esim_ok_response_purchase.rb +111 -0
  49. data/lib/celitech/models/top_up_esim_request.rb +145 -0
  50. data/lib/celitech/models/unauthorized.rb +47 -0
  51. data/lib/celitech/models/union_type.rb +12 -0
  52. data/lib/celitech/serializers/form_serializer.rb +41 -0
  53. data/lib/celitech/serializers/json_serializer.rb +41 -0
  54. data/lib/celitech/services/destinations.rb +59 -0
  55. data/lib/celitech/services/e_sim.rb +108 -0
  56. data/lib/celitech/services/i_frame.rb +59 -0
  57. data/lib/celitech/services/o_auth.rb +49 -0
  58. data/lib/celitech/services/packages.rb +82 -0
  59. data/lib/celitech/services/purchases.rb +195 -0
  60. data/lib/celitech/validator.rb +42 -0
  61. data/lib/celitech/version.rb +5 -0
  62. data/lib/celitech.rb +64 -0
  63. metadata +162 -0
@@ -0,0 +1,121 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Celitech
4
+ module Models
5
+ class Packages
6
+ include ::Celitech::Models::Serializable
7
+ include ::Celitech::Models::OpenModel
8
+
9
+ def self.wire_keys
10
+ {
11
+ id: 'id',
12
+ destination: 'destination',
13
+ destination_iso2: 'destinationISO2',
14
+ data_limit_in_bytes: 'dataLimitInBytes',
15
+ data_limit_in_gb: 'dataLimitInGB',
16
+ min_days: 'minDays',
17
+ max_days: 'maxDays',
18
+ price_in_cents: 'priceInCents',
19
+ }.freeze
20
+ end
21
+
22
+ def id
23
+ val = @id
24
+ val.equal?(::Celitech::Models::UNSET) ? nil : val
25
+ end
26
+
27
+ def destination
28
+ val = @destination
29
+ val.equal?(::Celitech::Models::UNSET) ? nil : val
30
+ end
31
+
32
+ def destination_iso2
33
+ val = @destination_iso2
34
+ val.equal?(::Celitech::Models::UNSET) ? nil : val
35
+ end
36
+
37
+ def data_limit_in_bytes
38
+ val = @data_limit_in_bytes
39
+ val.equal?(::Celitech::Models::UNSET) ? nil : val
40
+ end
41
+
42
+ def data_limit_in_gb
43
+ val = @data_limit_in_gb
44
+ val.equal?(::Celitech::Models::UNSET) ? nil : val
45
+ end
46
+
47
+ def min_days
48
+ val = @min_days
49
+ val.equal?(::Celitech::Models::UNSET) ? nil : val
50
+ end
51
+
52
+ def max_days
53
+ val = @max_days
54
+ val.equal?(::Celitech::Models::UNSET) ? nil : val
55
+ end
56
+
57
+ def price_in_cents
58
+ val = @price_in_cents
59
+ val.equal?(::Celitech::Models::UNSET) ? nil : val
60
+ end
61
+
62
+ attr_reader :additional_properties
63
+
64
+ def initialize(
65
+ id: ::Celitech::Models::UNSET,
66
+ destination: ::Celitech::Models::UNSET,
67
+ destination_iso2: ::Celitech::Models::UNSET,
68
+ data_limit_in_bytes: ::Celitech::Models::UNSET,
69
+ data_limit_in_gb: ::Celitech::Models::UNSET,
70
+ min_days: ::Celitech::Models::UNSET,
71
+ max_days: ::Celitech::Models::UNSET,
72
+ price_in_cents: ::Celitech::Models::UNSET,
73
+ additional_properties: {}
74
+ )
75
+ @id = id
76
+ @destination = destination
77
+ @destination_iso2 = destination_iso2
78
+ @data_limit_in_bytes = data_limit_in_bytes
79
+ @data_limit_in_gb = data_limit_in_gb
80
+ @min_days = min_days
81
+ @max_days = max_days
82
+ @price_in_cents = price_in_cents
83
+ @additional_properties = additional_properties
84
+ end
85
+
86
+ def self.from_hash(hash)
87
+ return unless hash
88
+
89
+ new(
90
+ id: hash.fetch('id', ::Celitech::Models::UNSET),
91
+ destination: hash.fetch('destination', ::Celitech::Models::UNSET),
92
+ destination_iso2: hash.fetch('destinationISO2', ::Celitech::Models::UNSET),
93
+ data_limit_in_bytes: hash.fetch('dataLimitInBytes', ::Celitech::Models::UNSET),
94
+ data_limit_in_gb: hash.fetch('dataLimitInGB', ::Celitech::Models::UNSET),
95
+ min_days: hash.fetch('minDays', ::Celitech::Models::UNSET),
96
+ max_days: hash.fetch('maxDays', ::Celitech::Models::UNSET),
97
+ price_in_cents: hash.fetch('priceInCents', ::Celitech::Models::UNSET),
98
+ additional_properties:
99
+ hash.except('id', 'destination', 'destinationISO2', 'dataLimitInBytes', 'dataLimitInGB', 'minDays', 'maxDays', 'priceInCents'),
100
+ )
101
+ end
102
+
103
+ def attributes
104
+ {
105
+ id: @id,
106
+ destination: @destination,
107
+ destination_iso2: @destination_iso2,
108
+ data_limit_in_bytes: @data_limit_in_bytes,
109
+ data_limit_in_gb: @data_limit_in_gb,
110
+ min_days: @min_days,
111
+ max_days: @max_days,
112
+ price_in_cents: @price_in_cents,
113
+ }
114
+ end
115
+
116
+ def open_model_extras
117
+ @additional_properties
118
+ end
119
+ end
120
+ end
121
+ end
@@ -0,0 +1,178 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Celitech
4
+ module Models
5
+ class Purchases
6
+ include ::Celitech::Models::Serializable
7
+ include ::Celitech::Models::OpenModel
8
+
9
+ def self.wire_keys
10
+ {
11
+ id: 'id',
12
+ start_date: 'startDate',
13
+ end_date: 'endDate',
14
+ duration: 'duration',
15
+ created_date: 'createdDate',
16
+ start_time: 'startTime',
17
+ end_time: 'endTime',
18
+ created_at: 'createdAt',
19
+ package: 'package',
20
+ esim: 'esim',
21
+ source: 'source',
22
+ purchase_type: 'purchaseType',
23
+ reference_id: 'referenceId',
24
+ }.freeze
25
+ end
26
+
27
+ def id
28
+ val = @id
29
+ val.equal?(::Celitech::Models::UNSET) ? nil : val
30
+ end
31
+
32
+ def start_date
33
+ val = @start_date
34
+ val.equal?(::Celitech::Models::UNSET) ? nil : val
35
+ end
36
+
37
+ def end_date
38
+ val = @end_date
39
+ val.equal?(::Celitech::Models::UNSET) ? nil : val
40
+ end
41
+
42
+ def duration
43
+ val = @duration
44
+ val.equal?(::Celitech::Models::UNSET) ? nil : val
45
+ end
46
+
47
+ def created_date
48
+ val = @created_date
49
+ val.equal?(::Celitech::Models::UNSET) ? nil : val
50
+ end
51
+
52
+ def start_time
53
+ val = @start_time
54
+ val.equal?(::Celitech::Models::UNSET) ? nil : val
55
+ end
56
+
57
+ def end_time
58
+ val = @end_time
59
+ val.equal?(::Celitech::Models::UNSET) ? nil : val
60
+ end
61
+
62
+ def created_at
63
+ val = @created_at
64
+ val.equal?(::Celitech::Models::UNSET) ? nil : val
65
+ end
66
+
67
+ def package
68
+ val = @package
69
+ val.equal?(::Celitech::Models::UNSET) ? nil : val
70
+ end
71
+
72
+ def esim
73
+ val = @esim
74
+ val.equal?(::Celitech::Models::UNSET) ? nil : val
75
+ end
76
+
77
+ def source
78
+ val = @source
79
+ val.equal?(::Celitech::Models::UNSET) ? nil : val
80
+ end
81
+
82
+ def purchase_type
83
+ val = @purchase_type
84
+ val.equal?(::Celitech::Models::UNSET) ? nil : val
85
+ end
86
+
87
+ def reference_id
88
+ val = @reference_id
89
+ val.equal?(::Celitech::Models::UNSET) ? nil : val
90
+ end
91
+
92
+ attr_reader :additional_properties
93
+
94
+ def initialize(
95
+ id: ::Celitech::Models::UNSET,
96
+ start_date: ::Celitech::Models::UNSET,
97
+ end_date: ::Celitech::Models::UNSET,
98
+ duration: ::Celitech::Models::UNSET,
99
+ created_date: ::Celitech::Models::UNSET,
100
+ start_time: ::Celitech::Models::UNSET,
101
+ end_time: ::Celitech::Models::UNSET,
102
+ created_at: ::Celitech::Models::UNSET,
103
+ package: ::Celitech::Models::UNSET,
104
+ esim: ::Celitech::Models::UNSET,
105
+ source: ::Celitech::Models::UNSET,
106
+ purchase_type: ::Celitech::Models::UNSET,
107
+ reference_id: ::Celitech::Models::UNSET,
108
+ additional_properties: {}
109
+ )
110
+ @id = id
111
+ @start_date = start_date
112
+ @end_date = end_date
113
+ @duration = duration
114
+ @created_date = created_date
115
+ @start_time = start_time
116
+ @end_time = end_time
117
+ @created_at = created_at
118
+ @package = package
119
+ @esim = esim
120
+ @source = source
121
+ @purchase_type = purchase_type
122
+ @reference_id = reference_id
123
+ @additional_properties = additional_properties
124
+ end
125
+
126
+ def self.from_hash(hash)
127
+ return unless hash
128
+
129
+ new(
130
+ id: hash.fetch('id', ::Celitech::Models::UNSET),
131
+ start_date: hash.fetch('startDate', ::Celitech::Models::UNSET),
132
+ end_date: hash.fetch('endDate', ::Celitech::Models::UNSET),
133
+ duration: hash.fetch('duration', ::Celitech::Models::UNSET),
134
+ created_date: hash.fetch('createdDate', ::Celitech::Models::UNSET),
135
+ start_time: hash.fetch('startTime', ::Celitech::Models::UNSET),
136
+ end_time: hash.fetch('endTime', ::Celitech::Models::UNSET),
137
+ created_at: hash.fetch('createdAt', ::Celitech::Models::UNSET),
138
+ package:
139
+ hash.key?('package') ? ::Celitech::Models::Package.from_hash(hash['package']) : ::Celitech::Models::UNSET,
140
+ esim:
141
+ hash.key?('esim') ? ::Celitech::Models::PurchasesEsim.from_hash(hash['esim']) : ::Celitech::Models::UNSET,
142
+ source: hash.fetch('source', ::Celitech::Models::UNSET),
143
+ purchase_type: hash.fetch('purchaseType', ::Celitech::Models::UNSET),
144
+ reference_id: hash.fetch('referenceId', ::Celitech::Models::UNSET),
145
+ additional_properties:
146
+ hash.except('id', 'startDate', 'endDate', 'duration', 'createdDate', 'startTime', 'endTime', 'createdAt', 'package', 'esim', 'source', 'purchaseType', 'referenceId'),
147
+ )
148
+ end
149
+
150
+ def attributes
151
+ {
152
+ id: @id,
153
+ start_date: @start_date,
154
+ end_date: @end_date,
155
+ duration: @duration,
156
+ created_date: @created_date,
157
+ start_time: @start_time,
158
+ end_time: @end_time,
159
+ created_at: @created_at,
160
+ package: @package,
161
+ esim: @esim,
162
+ source: @source,
163
+ purchase_type: @purchase_type,
164
+ reference_id: @reference_id,
165
+ }
166
+ end
167
+
168
+ def validate!
169
+ @package&.validate! if !@package.equal?(::Celitech::Models::UNSET) && @package.respond_to?(:validate!)
170
+ @esim&.validate! if !@esim.equal?(::Celitech::Models::UNSET) && @esim.respond_to?(:validate!)
171
+ end
172
+
173
+ def open_model_extras
174
+ @additional_properties
175
+ end
176
+ end
177
+ end
178
+ end
@@ -0,0 +1,51 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Celitech
4
+ module Models
5
+ class PurchasesEsim
6
+ include ::Celitech::Models::Serializable
7
+ include ::Celitech::Models::OpenModel
8
+
9
+ def self.wire_keys
10
+ {
11
+ iccid: 'iccid',
12
+ }.freeze
13
+ end
14
+
15
+ def iccid
16
+ val = @iccid
17
+ val.equal?(::Celitech::Models::UNSET) ? nil : val
18
+ end
19
+
20
+ attr_reader :additional_properties
21
+
22
+ def initialize(iccid: ::Celitech::Models::UNSET, additional_properties: {})
23
+ @iccid = iccid
24
+ @additional_properties = additional_properties
25
+ end
26
+
27
+ def self.from_hash(hash)
28
+ return unless hash
29
+
30
+ new(
31
+ iccid: hash.fetch('iccid', ::Celitech::Models::UNSET),
32
+ additional_properties: hash.except('iccid'),
33
+ )
34
+ end
35
+
36
+ def attributes
37
+ {
38
+ iccid: @iccid,
39
+ }
40
+ end
41
+
42
+ def validate!
43
+ Validator.validate_string!(@iccid, 'iccid', min_length: 18, max_length: 22) unless @iccid.equal?(::Celitech::Models::UNSET)
44
+ end
45
+
46
+ def open_model_extras
47
+ @additional_properties
48
+ end
49
+ end
50
+ end
51
+ end
@@ -0,0 +1,63 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Celitech
4
+ module Models
5
+ # Sentinel value for model fields that were never explicitly set.
6
+ # Distinguishes "field not provided" from "field explicitly set to nil",
7
+ # which matters for PATCH requests where nil means "clear this field".
8
+ UNSET = Object.new.tap do |o|
9
+ o.define_singleton_method(:inspect) { 'UNSET' }
10
+ o.define_singleton_method(:to_s) { 'UNSET' }
11
+ end.freeze
12
+
13
+ # Marker module for generated model classes.
14
+ #
15
+ # Including classes must implement:
16
+ # - .wire_keys → { attr_sym: 'wire_name', ... }.freeze
17
+ # - .from_hash(hash) → model instance or nil
18
+ # - #attributes → { attr_sym: raw_value, ... }
19
+ #
20
+ # In return, this module provides:
21
+ # - #to_h → { attr_sym: value, ... } with nested models recursively converted,
22
+ # omitting fields set to UNSET but preserving explicit nil
23
+ module Serializable
24
+ def self.included(base)
25
+ base.extend(ClassMethods)
26
+ end
27
+
28
+ module ClassMethods
29
+ def wire_keys
30
+ raise NotImplementedError, "#{name} must implement .wire_keys"
31
+ end
32
+
33
+ def from_hash(_hash)
34
+ raise NotImplementedError, "#{name} must implement .from_hash"
35
+ end
36
+ end
37
+
38
+ def to_h
39
+ self.class.wire_keys.each_with_object({}) do |(attr, _key), hash|
40
+ val = attributes[attr]
41
+ next if val.equal?(UNSET)
42
+
43
+ hash[attr] = coerce_to_h(val)
44
+ end
45
+ end
46
+
47
+ def attributes
48
+ raise NotImplementedError, "#{self.class} must implement #attributes"
49
+ end
50
+
51
+ private
52
+
53
+ def coerce_to_h(val)
54
+ return val.to_h if val.is_a?(Serializable)
55
+ return val.map { |item| coerce_to_h(item) } if val.is_a?(Array)
56
+ # Typed maps (additionalProperties): recurse values, preserving the dynamic string keys.
57
+ return val.transform_values { |item| coerce_to_h(item) } if val.is_a?(Hash)
58
+
59
+ val
60
+ end
61
+ end
62
+ end
63
+ end
@@ -0,0 +1,47 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Celitech
4
+ module Models
5
+ class TokenOkResponse
6
+ include ::Celitech::Models::Serializable
7
+ include ::Celitech::Models::OpenModel
8
+
9
+ def self.wire_keys
10
+ {
11
+ token: 'token',
12
+ }.freeze
13
+ end
14
+
15
+ def token
16
+ val = @token
17
+ val.equal?(::Celitech::Models::UNSET) ? nil : val
18
+ end
19
+
20
+ attr_reader :additional_properties
21
+
22
+ def initialize(token: ::Celitech::Models::UNSET, additional_properties: {})
23
+ @token = token
24
+ @additional_properties = additional_properties
25
+ end
26
+
27
+ def self.from_hash(hash)
28
+ return unless hash
29
+
30
+ new(
31
+ token: hash.fetch('token', ::Celitech::Models::UNSET),
32
+ additional_properties: hash.except('token'),
33
+ )
34
+ end
35
+
36
+ def attributes
37
+ {
38
+ token: @token,
39
+ }
40
+ end
41
+
42
+ def open_model_extras
43
+ @additional_properties
44
+ end
45
+ end
46
+ end
47
+ end
@@ -0,0 +1,63 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Celitech
4
+ module Models
5
+ class TopUpEsimOkResponse
6
+ include ::Celitech::Models::Serializable
7
+ include ::Celitech::Models::OpenModel
8
+
9
+ def self.wire_keys
10
+ {
11
+ purchase: 'purchase',
12
+ profile: 'profile',
13
+ }.freeze
14
+ end
15
+
16
+ def purchase
17
+ val = @purchase
18
+ val.equal?(::Celitech::Models::UNSET) ? nil : val
19
+ end
20
+
21
+ def profile
22
+ val = @profile
23
+ val.equal?(::Celitech::Models::UNSET) ? nil : val
24
+ end
25
+
26
+ attr_reader :additional_properties
27
+
28
+ def initialize(purchase: ::Celitech::Models::UNSET, profile: ::Celitech::Models::UNSET, additional_properties: {})
29
+ @purchase = purchase
30
+ @profile = profile
31
+ @additional_properties = additional_properties
32
+ end
33
+
34
+ def self.from_hash(hash)
35
+ return unless hash
36
+
37
+ new(
38
+ purchase:
39
+ hash.key?('purchase') ? ::Celitech::Models::TopUpEsimOkResponsePurchase.from_hash(hash['purchase']) : ::Celitech::Models::UNSET,
40
+ profile:
41
+ hash.key?('profile') ? ::Celitech::Models::TopUpEsimOkResponseProfile.from_hash(hash['profile']) : ::Celitech::Models::UNSET,
42
+ additional_properties: hash.except('purchase', 'profile'),
43
+ )
44
+ end
45
+
46
+ def attributes
47
+ {
48
+ purchase: @purchase,
49
+ profile: @profile,
50
+ }
51
+ end
52
+
53
+ def validate!
54
+ @purchase&.validate! if !@purchase.equal?(::Celitech::Models::UNSET) && @purchase.respond_to?(:validate!)
55
+ @profile&.validate! if !@profile.equal?(::Celitech::Models::UNSET) && @profile.respond_to?(:validate!)
56
+ end
57
+
58
+ def open_model_extras
59
+ @additional_properties
60
+ end
61
+ end
62
+ end
63
+ end
@@ -0,0 +1,51 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Celitech
4
+ module Models
5
+ class TopUpEsimOkResponseProfile
6
+ include ::Celitech::Models::Serializable
7
+ include ::Celitech::Models::OpenModel
8
+
9
+ def self.wire_keys
10
+ {
11
+ iccid: 'iccid',
12
+ }.freeze
13
+ end
14
+
15
+ def iccid
16
+ val = @iccid
17
+ val.equal?(::Celitech::Models::UNSET) ? nil : val
18
+ end
19
+
20
+ attr_reader :additional_properties
21
+
22
+ def initialize(iccid: ::Celitech::Models::UNSET, additional_properties: {})
23
+ @iccid = iccid
24
+ @additional_properties = additional_properties
25
+ end
26
+
27
+ def self.from_hash(hash)
28
+ return unless hash
29
+
30
+ new(
31
+ iccid: hash.fetch('iccid', ::Celitech::Models::UNSET),
32
+ additional_properties: hash.except('iccid'),
33
+ )
34
+ end
35
+
36
+ def attributes
37
+ {
38
+ iccid: @iccid,
39
+ }
40
+ end
41
+
42
+ def validate!
43
+ Validator.validate_string!(@iccid, 'iccid', min_length: 18, max_length: 22) unless @iccid.equal?(::Celitech::Models::UNSET)
44
+ end
45
+
46
+ def open_model_extras
47
+ @additional_properties
48
+ end
49
+ end
50
+ end
51
+ end
@@ -0,0 +1,111 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Celitech
4
+ module Models
5
+ class TopUpEsimOkResponsePurchase
6
+ include ::Celitech::Models::Serializable
7
+ include ::Celitech::Models::OpenModel
8
+
9
+ def self.wire_keys
10
+ {
11
+ id: 'id',
12
+ package_id: 'packageId',
13
+ start_date: 'startDate',
14
+ end_date: 'endDate',
15
+ created_date: 'createdDate',
16
+ start_time: 'startTime',
17
+ end_time: 'endTime',
18
+ }.freeze
19
+ end
20
+
21
+ def id
22
+ val = @id
23
+ val.equal?(::Celitech::Models::UNSET) ? nil : val
24
+ end
25
+
26
+ def package_id
27
+ val = @package_id
28
+ val.equal?(::Celitech::Models::UNSET) ? nil : val
29
+ end
30
+
31
+ def start_date
32
+ val = @start_date
33
+ val.equal?(::Celitech::Models::UNSET) ? nil : val
34
+ end
35
+
36
+ def end_date
37
+ val = @end_date
38
+ val.equal?(::Celitech::Models::UNSET) ? nil : val
39
+ end
40
+
41
+ def created_date
42
+ val = @created_date
43
+ val.equal?(::Celitech::Models::UNSET) ? nil : val
44
+ end
45
+
46
+ def start_time
47
+ val = @start_time
48
+ val.equal?(::Celitech::Models::UNSET) ? nil : val
49
+ end
50
+
51
+ def end_time
52
+ val = @end_time
53
+ val.equal?(::Celitech::Models::UNSET) ? nil : val
54
+ end
55
+
56
+ attr_reader :additional_properties
57
+
58
+ def initialize(
59
+ id: ::Celitech::Models::UNSET,
60
+ package_id: ::Celitech::Models::UNSET,
61
+ start_date: ::Celitech::Models::UNSET,
62
+ end_date: ::Celitech::Models::UNSET,
63
+ created_date: ::Celitech::Models::UNSET,
64
+ start_time: ::Celitech::Models::UNSET,
65
+ end_time: ::Celitech::Models::UNSET,
66
+ additional_properties: {}
67
+ )
68
+ @id = id
69
+ @package_id = package_id
70
+ @start_date = start_date
71
+ @end_date = end_date
72
+ @created_date = created_date
73
+ @start_time = start_time
74
+ @end_time = end_time
75
+ @additional_properties = additional_properties
76
+ end
77
+
78
+ def self.from_hash(hash)
79
+ return unless hash
80
+
81
+ new(
82
+ id: hash.fetch('id', ::Celitech::Models::UNSET),
83
+ package_id: hash.fetch('packageId', ::Celitech::Models::UNSET),
84
+ start_date: hash.fetch('startDate', ::Celitech::Models::UNSET),
85
+ end_date: hash.fetch('endDate', ::Celitech::Models::UNSET),
86
+ created_date: hash.fetch('createdDate', ::Celitech::Models::UNSET),
87
+ start_time: hash.fetch('startTime', ::Celitech::Models::UNSET),
88
+ end_time: hash.fetch('endTime', ::Celitech::Models::UNSET),
89
+ additional_properties:
90
+ hash.except('id', 'packageId', 'startDate', 'endDate', 'createdDate', 'startTime', 'endTime'),
91
+ )
92
+ end
93
+
94
+ def attributes
95
+ {
96
+ id: @id,
97
+ package_id: @package_id,
98
+ start_date: @start_date,
99
+ end_date: @end_date,
100
+ created_date: @created_date,
101
+ start_time: @start_time,
102
+ end_time: @end_time,
103
+ }
104
+ end
105
+
106
+ def open_model_extras
107
+ @additional_properties
108
+ end
109
+ end
110
+ end
111
+ end