smplkit 3.0.8 → 3.0.9

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 (37) hide show
  1. checksums.yaml +4 -4
  2. data/lib/smplkit/_generated/app/lib/smplkit_app_client/api/billing_api.rb +0 -469
  3. data/lib/smplkit/_generated/app/lib/smplkit_app_client/api/subscription_api.rb +289 -0
  4. data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/{subscription_list_response.rb → admin_subscription_request.rb} +9 -20
  5. data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/admin_subscription_request_attributes.rb +190 -0
  6. data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/{create_subscription_data.rb → admin_subscription_request_resource.rb} +46 -12
  7. data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/{next_tier_meta.rb → next_tier_response.rb} +6 -6
  8. data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/subscription_change_projection.rb +321 -0
  9. data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/{create_subscription_attributes.rb → subscription_item_request.rb} +10 -21
  10. data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/{subscription_attributes.rb → subscription_item_response.rb} +66 -77
  11. data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/subscription_preview_attributes.rb +390 -0
  12. data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/subscription_preview_resource.rb +241 -0
  13. data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/{plan_change_request.rb → subscription_preview_response.rb} +20 -21
  14. data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/{create_subscription_body.rb → subscription_request.rb} +5 -5
  15. data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/subscription_request_attributes.rb +179 -0
  16. data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/subscription_request_resource.rb +227 -0
  17. data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/subscription_resource.rb +4 -2
  18. data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/subscription_response.rb +1 -1
  19. data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/{subscription_list_meta.rb → subscription_response_attributes.rb} +135 -62
  20. data/lib/smplkit/_generated/app/lib/smplkit_app_client.rb +15 -8
  21. data/lib/smplkit/_generated/app/spec/api/billing_api_spec.rb +0 -86
  22. data/lib/smplkit/_generated/app/spec/api/subscription_api_spec.rb +83 -0
  23. data/lib/smplkit/_generated/app/spec/models/{create_subscription_attributes_spec.rb → admin_subscription_request_attributes_spec.rb} +9 -9
  24. data/lib/smplkit/_generated/app/spec/models/admin_subscription_request_resource_spec.rb +52 -0
  25. data/lib/smplkit/_generated/app/spec/models/{plan_change_request_spec.rb → admin_subscription_request_spec.rb} +7 -7
  26. data/lib/smplkit/_generated/app/spec/models/{next_tier_meta_spec.rb → next_tier_response_spec.rb} +6 -6
  27. data/lib/smplkit/_generated/app/spec/models/{subscription_list_meta_spec.rb → subscription_change_projection_spec.rb} +20 -14
  28. data/lib/smplkit/_generated/app/spec/models/{create_subscription_data_spec.rb → subscription_item_request_spec.rb} +8 -8
  29. data/lib/smplkit/_generated/app/spec/models/{subscription_attributes_spec.rb → subscription_item_response_spec.rb} +12 -18
  30. data/lib/smplkit/_generated/app/spec/models/subscription_preview_attributes_spec.rb +88 -0
  31. data/lib/smplkit/_generated/app/spec/models/subscription_preview_resource_spec.rb +56 -0
  32. data/lib/smplkit/_generated/app/spec/models/subscription_preview_response_spec.rb +36 -0
  33. data/lib/smplkit/_generated/app/spec/models/{subscription_list_response_spec.rb → subscription_request_attributes_spec.rb} +8 -8
  34. data/lib/smplkit/_generated/app/spec/models/subscription_request_resource_spec.rb +52 -0
  35. data/lib/smplkit/_generated/app/spec/models/{create_subscription_body_spec.rb → subscription_request_spec.rb} +6 -6
  36. data/lib/smplkit/_generated/app/spec/models/subscription_response_attributes_spec.rb +100 -0
  37. metadata +31 -17
@@ -0,0 +1,227 @@
1
+ =begin
2
+ #smplkit API
3
+
4
+ #API for the smplkit platform.
5
+
6
+ The version of the OpenAPI document: 0.1.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.22.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module SmplkitGeneratedClient::App
17
+ # JSON:API resource object for a subscription update request.
18
+ class SubscriptionRequestResource < ApiModelBase
19
+ # Subscription identifier; the server ignores this and uses the auth context.
20
+ attr_accessor :id
21
+
22
+ # JSON:API resource type.
23
+ attr_accessor :type
24
+
25
+ attr_accessor :attributes
26
+
27
+ class EnumAttributeValidator
28
+ attr_reader :datatype
29
+ attr_reader :allowable_values
30
+
31
+ def initialize(datatype, allowable_values)
32
+ @allowable_values = allowable_values.map do |value|
33
+ case datatype.to_s
34
+ when /Integer/i
35
+ value.to_i
36
+ when /Float/i
37
+ value.to_f
38
+ else
39
+ value
40
+ end
41
+ end
42
+ end
43
+
44
+ def valid?(value)
45
+ !value || allowable_values.include?(value)
46
+ end
47
+ end
48
+
49
+ # Attribute mapping from ruby-style variable name to JSON key.
50
+ def self.attribute_map
51
+ {
52
+ :'id' => :'id',
53
+ :'type' => :'type',
54
+ :'attributes' => :'attributes'
55
+ }
56
+ end
57
+
58
+ # Returns attribute mapping this model knows about
59
+ def self.acceptable_attribute_map
60
+ attribute_map
61
+ end
62
+
63
+ # Returns all the JSON keys this model knows about
64
+ def self.acceptable_attributes
65
+ acceptable_attribute_map.values
66
+ end
67
+
68
+ # Attribute type mapping.
69
+ def self.openapi_types
70
+ {
71
+ :'id' => :'String',
72
+ :'type' => :'String',
73
+ :'attributes' => :'SubscriptionRequestAttributes'
74
+ }
75
+ end
76
+
77
+ # List of attributes with nullable: true
78
+ def self.openapi_nullable
79
+ Set.new([
80
+ :'id',
81
+ ])
82
+ end
83
+
84
+ # Initializes the object
85
+ # @param [Hash] attributes Model attributes in the form of hash
86
+ def initialize(attributes = {})
87
+ if (!attributes.is_a?(Hash))
88
+ fail ArgumentError, "The input argument (attributes) must be a hash in `SmplkitGeneratedClient::App::SubscriptionRequestResource` initialize method"
89
+ end
90
+
91
+ # check to see if the attribute exists and convert string to symbol for hash key
92
+ acceptable_attribute_map = self.class.acceptable_attribute_map
93
+ attributes = attributes.each_with_object({}) { |(k, v), h|
94
+ if (!acceptable_attribute_map.key?(k.to_sym))
95
+ fail ArgumentError, "`#{k}` is not a valid attribute in `SmplkitGeneratedClient::App::SubscriptionRequestResource`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
96
+ end
97
+ h[k.to_sym] = v
98
+ }
99
+
100
+ if attributes.key?(:'id')
101
+ self.id = attributes[:'id']
102
+ end
103
+
104
+ if attributes.key?(:'type')
105
+ self.type = attributes[:'type']
106
+ else
107
+ self.type = nil
108
+ end
109
+
110
+ if attributes.key?(:'attributes')
111
+ self.attributes = attributes[:'attributes']
112
+ else
113
+ self.attributes = nil
114
+ end
115
+ end
116
+
117
+ # Show invalid properties with the reasons. Usually used together with valid?
118
+ # @return Array for valid properties with the reasons
119
+ def list_invalid_properties
120
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
121
+ invalid_properties = Array.new
122
+ if @type.nil?
123
+ invalid_properties.push('invalid value for "type", type cannot be nil.')
124
+ end
125
+
126
+ if @attributes.nil?
127
+ invalid_properties.push('invalid value for "attributes", attributes cannot be nil.')
128
+ end
129
+
130
+ invalid_properties
131
+ end
132
+
133
+ # Check to see if the all the properties in the model are valid
134
+ # @return true if the model is valid
135
+ def valid?
136
+ warn '[DEPRECATED] the `valid?` method is obsolete'
137
+ return false if @type.nil?
138
+ type_validator = EnumAttributeValidator.new('String', ["subscription"])
139
+ return false unless type_validator.valid?(@type)
140
+ return false if @attributes.nil?
141
+ true
142
+ end
143
+
144
+ # Custom attribute writer method checking allowed values (enum).
145
+ # @param [Object] type Object to be assigned
146
+ def type=(type)
147
+ validator = EnumAttributeValidator.new('String', ["subscription"])
148
+ unless validator.valid?(type)
149
+ fail ArgumentError, "invalid value for \"type\", must be one of #{validator.allowable_values}."
150
+ end
151
+ @type = type
152
+ end
153
+
154
+ # Custom attribute writer method with validation
155
+ # @param [Object] attributes Value to be assigned
156
+ def attributes=(attributes)
157
+ if attributes.nil?
158
+ fail ArgumentError, 'attributes cannot be nil'
159
+ end
160
+
161
+ @attributes = attributes
162
+ end
163
+
164
+ # Checks equality by comparing each attribute.
165
+ # @param [Object] Object to be compared
166
+ def ==(o)
167
+ return true if self.equal?(o)
168
+ self.class == o.class &&
169
+ id == o.id &&
170
+ type == o.type &&
171
+ attributes == o.attributes
172
+ end
173
+
174
+ # @see the `==` method
175
+ # @param [Object] Object to be compared
176
+ def eql?(o)
177
+ self == o
178
+ end
179
+
180
+ # Calculates hash code according to all attributes.
181
+ # @return [Integer] Hash code
182
+ def hash
183
+ [id, type, attributes].hash
184
+ end
185
+
186
+ # Builds the object from hash
187
+ # @param [Hash] attributes Model attributes in the form of hash
188
+ # @return [Object] Returns the model itself
189
+ def self.build_from_hash(attributes)
190
+ return nil unless attributes.is_a?(Hash)
191
+ attributes = attributes.transform_keys(&:to_sym)
192
+ transformed_hash = {}
193
+ openapi_types.each_pair do |key, type|
194
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
195
+ transformed_hash["#{key}"] = nil
196
+ elsif type =~ /\AArray<(.*)>/i
197
+ # check to ensure the input is an array given that the attribute
198
+ # is documented as an array but the input is not
199
+ if attributes[attribute_map[key]].is_a?(Array)
200
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
201
+ end
202
+ elsif !attributes[attribute_map[key]].nil?
203
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
204
+ end
205
+ end
206
+ new(transformed_hash)
207
+ end
208
+
209
+ # Returns the object in the form of hash
210
+ # @return [Hash] Returns the object in the form of hash
211
+ def to_hash
212
+ hash = {}
213
+ self.class.attribute_map.each_pair do |attr, param|
214
+ value = self.send(attr)
215
+ if value.nil?
216
+ is_nullable = self.class.openapi_nullable.include?(attr)
217
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
218
+ end
219
+
220
+ hash[param] = _to_hash(value)
221
+ end
222
+ hash
223
+ end
224
+
225
+ end
226
+
227
+ end
@@ -14,10 +14,12 @@ require 'date'
14
14
  require 'time'
15
15
 
16
16
  module SmplkitGeneratedClient::App
17
- # JSON:API resource envelope for a subscription. `id` must not be specified for create requests (the server assigns it).
17
+ # JSON:API resource object for a subscription.
18
18
  class SubscriptionResource < ApiModelBase
19
+ # Subscription identifier. Always `current` on response; absent on create-style requests.
19
20
  attr_accessor :id
20
21
 
22
+ # JSON:API resource type.
21
23
  attr_accessor :type
22
24
 
23
25
  attr_accessor :attributes
@@ -68,7 +70,7 @@ module SmplkitGeneratedClient::App
68
70
  {
69
71
  :'id' => :'String',
70
72
  :'type' => :'String',
71
- :'attributes' => :'SubscriptionAttributes'
73
+ :'attributes' => :'SubscriptionResponseAttributes'
72
74
  }
73
75
  end
74
76
 
@@ -14,7 +14,7 @@ require 'date'
14
14
  require 'time'
15
15
 
16
16
  module SmplkitGeneratedClient::App
17
- # JSON:API single-resource response envelope for a subscription.
17
+ # Single-resource response envelope for a subscription.
18
18
  class SubscriptionResponse < ApiModelBase
19
19
  attr_accessor :data
20
20
 
@@ -14,25 +14,40 @@ require 'date'
14
14
  require 'time'
15
15
 
16
16
  module SmplkitGeneratedClient::App
17
- # Discount and totals summary attached to a subscription collection response.
18
- class SubscriptionListMeta < ApiModelBase
19
- # Sum of list prices across all subscriptions in cents.
20
- attr_accessor :subtotal_cents
17
+ # Customer's subscription as returned by the API.
18
+ class SubscriptionResponseAttributes < ApiModelBase
19
+ # Lifecycle state of the subscription. `ACTIVE` while billing is current; `PAST_DUE` after a failed charge; `CANCELED` once the subscription has ended; `null` when the subscription has no billing object (fully comped at 100% discount).
20
+ attr_accessor :status
21
21
 
22
- # Effective discount percentage applied.
23
- attr_accessor :discount_pct
22
+ # ISO-8601 timestamp of the current billing period's start.
23
+ attr_accessor :current_period_start
24
24
 
25
- # Discount amount in cents.
26
- attr_accessor :discount_amount_cents
25
+ # ISO-8601 timestamp of the current billing period's end. Scheduled plan changes take effect at this moment.
26
+ attr_accessor :current_period_end
27
+
28
+ # Effective discount percentage applied to the subscription's monthly invoice. This is the value locked at the time of the customer's last subscription change; subsequent changes to the public discount schedule do not affect this customer until they themselves change their subscription.
29
+ attr_accessor :discount_pct
27
30
 
28
- # Source of the discount. `VOLUME` indicates the standard volume-discount schedule; `OVERRIDE` indicates a custom discount set on the account.
31
+ # `VOLUME` when the discount comes from the multi-product discount schedule; `OVERRIDE` when an administrator has applied a custom discount.
29
32
  attr_accessor :discount_source
30
33
 
31
- # Final monthly total in cents after the discount.
34
+ # Sum of all item list prices in cents, before discount.
35
+ attr_accessor :subtotal_cents
36
+
37
+ # Amount discounted from the subtotal in cents.
38
+ attr_accessor :discount_amount_cents
39
+
40
+ # Final monthly total in cents after the discount is applied.
32
41
  attr_accessor :total_cents
33
42
 
34
43
  attr_accessor :next_tier
35
44
 
45
+ # Identifier of the default payment method used to bill this subscription. `null` when the subscription has no associated payment method (e.g. fully comped).
46
+ attr_accessor :payment_method
47
+
48
+ # One entry per product currently enrolled on the subscription.
49
+ attr_accessor :items
50
+
36
51
  class EnumAttributeValidator
37
52
  attr_reader :datatype
38
53
  attr_reader :allowable_values
@@ -58,12 +73,17 @@ module SmplkitGeneratedClient::App
58
73
  # Attribute mapping from ruby-style variable name to JSON key.
59
74
  def self.attribute_map
60
75
  {
61
- :'subtotal_cents' => :'subtotal_cents',
76
+ :'status' => :'status',
77
+ :'current_period_start' => :'current_period_start',
78
+ :'current_period_end' => :'current_period_end',
62
79
  :'discount_pct' => :'discount_pct',
63
- :'discount_amount_cents' => :'discount_amount_cents',
64
80
  :'discount_source' => :'discount_source',
81
+ :'subtotal_cents' => :'subtotal_cents',
82
+ :'discount_amount_cents' => :'discount_amount_cents',
65
83
  :'total_cents' => :'total_cents',
66
- :'next_tier' => :'next_tier'
84
+ :'next_tier' => :'next_tier',
85
+ :'payment_method' => :'payment_method',
86
+ :'items' => :'items'
67
87
  }
68
88
  end
69
89
 
@@ -80,18 +100,27 @@ module SmplkitGeneratedClient::App
80
100
  # Attribute type mapping.
81
101
  def self.openapi_types
82
102
  {
83
- :'subtotal_cents' => :'Integer',
103
+ :'status' => :'String',
104
+ :'current_period_start' => :'String',
105
+ :'current_period_end' => :'String',
84
106
  :'discount_pct' => :'Integer',
85
- :'discount_amount_cents' => :'Integer',
86
107
  :'discount_source' => :'String',
108
+ :'subtotal_cents' => :'Integer',
109
+ :'discount_amount_cents' => :'Integer',
87
110
  :'total_cents' => :'Integer',
88
- :'next_tier' => :'NextTierMeta'
111
+ :'next_tier' => :'NextTierResponse',
112
+ :'payment_method' => :'String',
113
+ :'items' => :'Array<SubscriptionItemResponse>'
89
114
  }
90
115
  end
91
116
 
92
117
  # List of attributes with nullable: true
93
118
  def self.openapi_nullable
94
119
  Set.new([
120
+ :'status',
121
+ :'current_period_start',
122
+ :'current_period_end',
123
+ :'payment_method',
95
124
  ])
96
125
  end
97
126
 
@@ -99,22 +128,28 @@ module SmplkitGeneratedClient::App
99
128
  # @param [Hash] attributes Model attributes in the form of hash
100
129
  def initialize(attributes = {})
101
130
  if (!attributes.is_a?(Hash))
102
- fail ArgumentError, "The input argument (attributes) must be a hash in `SmplkitGeneratedClient::App::SubscriptionListMeta` initialize method"
131
+ fail ArgumentError, "The input argument (attributes) must be a hash in `SmplkitGeneratedClient::App::SubscriptionResponseAttributes` initialize method"
103
132
  end
104
133
 
105
134
  # check to see if the attribute exists and convert string to symbol for hash key
106
135
  acceptable_attribute_map = self.class.acceptable_attribute_map
107
136
  attributes = attributes.each_with_object({}) { |(k, v), h|
108
137
  if (!acceptable_attribute_map.key?(k.to_sym))
109
- fail ArgumentError, "`#{k}` is not a valid attribute in `SmplkitGeneratedClient::App::SubscriptionListMeta`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
138
+ fail ArgumentError, "`#{k}` is not a valid attribute in `SmplkitGeneratedClient::App::SubscriptionResponseAttributes`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
110
139
  end
111
140
  h[k.to_sym] = v
112
141
  }
113
142
 
114
- if attributes.key?(:'subtotal_cents')
115
- self.subtotal_cents = attributes[:'subtotal_cents']
116
- else
117
- self.subtotal_cents = nil
143
+ if attributes.key?(:'status')
144
+ self.status = attributes[:'status']
145
+ end
146
+
147
+ if attributes.key?(:'current_period_start')
148
+ self.current_period_start = attributes[:'current_period_start']
149
+ end
150
+
151
+ if attributes.key?(:'current_period_end')
152
+ self.current_period_end = attributes[:'current_period_end']
118
153
  end
119
154
 
120
155
  if attributes.key?(:'discount_pct')
@@ -123,18 +158,24 @@ module SmplkitGeneratedClient::App
123
158
  self.discount_pct = nil
124
159
  end
125
160
 
126
- if attributes.key?(:'discount_amount_cents')
127
- self.discount_amount_cents = attributes[:'discount_amount_cents']
128
- else
129
- self.discount_amount_cents = nil
130
- end
131
-
132
161
  if attributes.key?(:'discount_source')
133
162
  self.discount_source = attributes[:'discount_source']
134
163
  else
135
164
  self.discount_source = nil
136
165
  end
137
166
 
167
+ if attributes.key?(:'subtotal_cents')
168
+ self.subtotal_cents = attributes[:'subtotal_cents']
169
+ else
170
+ self.subtotal_cents = nil
171
+ end
172
+
173
+ if attributes.key?(:'discount_amount_cents')
174
+ self.discount_amount_cents = attributes[:'discount_amount_cents']
175
+ else
176
+ self.discount_amount_cents = nil
177
+ end
178
+
138
179
  if attributes.key?(:'total_cents')
139
180
  self.total_cents = attributes[:'total_cents']
140
181
  else
@@ -144,6 +185,18 @@ module SmplkitGeneratedClient::App
144
185
  if attributes.key?(:'next_tier')
145
186
  self.next_tier = attributes[:'next_tier']
146
187
  end
188
+
189
+ if attributes.key?(:'payment_method')
190
+ self.payment_method = attributes[:'payment_method']
191
+ end
192
+
193
+ if attributes.key?(:'items')
194
+ if (value = attributes[:'items']).is_a?(Array)
195
+ self.items = value
196
+ end
197
+ else
198
+ self.items = nil
199
+ end
147
200
  end
148
201
 
149
202
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -151,26 +204,30 @@ module SmplkitGeneratedClient::App
151
204
  def list_invalid_properties
152
205
  warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
153
206
  invalid_properties = Array.new
154
- if @subtotal_cents.nil?
155
- invalid_properties.push('invalid value for "subtotal_cents", subtotal_cents cannot be nil.')
156
- end
157
-
158
207
  if @discount_pct.nil?
159
208
  invalid_properties.push('invalid value for "discount_pct", discount_pct cannot be nil.')
160
209
  end
161
210
 
162
- if @discount_amount_cents.nil?
163
- invalid_properties.push('invalid value for "discount_amount_cents", discount_amount_cents cannot be nil.')
164
- end
165
-
166
211
  if @discount_source.nil?
167
212
  invalid_properties.push('invalid value for "discount_source", discount_source cannot be nil.')
168
213
  end
169
214
 
215
+ if @subtotal_cents.nil?
216
+ invalid_properties.push('invalid value for "subtotal_cents", subtotal_cents cannot be nil.')
217
+ end
218
+
219
+ if @discount_amount_cents.nil?
220
+ invalid_properties.push('invalid value for "discount_amount_cents", discount_amount_cents cannot be nil.')
221
+ end
222
+
170
223
  if @total_cents.nil?
171
224
  invalid_properties.push('invalid value for "total_cents", total_cents cannot be nil.')
172
225
  end
173
226
 
227
+ if @items.nil?
228
+ invalid_properties.push('invalid value for "items", items cannot be nil.')
229
+ end
230
+
174
231
  invalid_properties
175
232
  end
176
233
 
@@ -178,26 +235,17 @@ module SmplkitGeneratedClient::App
178
235
  # @return true if the model is valid
179
236
  def valid?
180
237
  warn '[DEPRECATED] the `valid?` method is obsolete'
181
- return false if @subtotal_cents.nil?
182
238
  return false if @discount_pct.nil?
183
- return false if @discount_amount_cents.nil?
184
239
  return false if @discount_source.nil?
185
240
  discount_source_validator = EnumAttributeValidator.new('String', ["VOLUME", "OVERRIDE"])
186
241
  return false unless discount_source_validator.valid?(@discount_source)
242
+ return false if @subtotal_cents.nil?
243
+ return false if @discount_amount_cents.nil?
187
244
  return false if @total_cents.nil?
245
+ return false if @items.nil?
188
246
  true
189
247
  end
190
248
 
191
- # Custom attribute writer method with validation
192
- # @param [Object] subtotal_cents Value to be assigned
193
- def subtotal_cents=(subtotal_cents)
194
- if subtotal_cents.nil?
195
- fail ArgumentError, 'subtotal_cents cannot be nil'
196
- end
197
-
198
- @subtotal_cents = subtotal_cents
199
- end
200
-
201
249
  # Custom attribute writer method with validation
202
250
  # @param [Object] discount_pct Value to be assigned
203
251
  def discount_pct=(discount_pct)
@@ -208,16 +256,6 @@ module SmplkitGeneratedClient::App
208
256
  @discount_pct = discount_pct
209
257
  end
210
258
 
211
- # Custom attribute writer method with validation
212
- # @param [Object] discount_amount_cents Value to be assigned
213
- def discount_amount_cents=(discount_amount_cents)
214
- if discount_amount_cents.nil?
215
- fail ArgumentError, 'discount_amount_cents cannot be nil'
216
- end
217
-
218
- @discount_amount_cents = discount_amount_cents
219
- end
220
-
221
259
  # Custom attribute writer method checking allowed values (enum).
222
260
  # @param [Object] discount_source Object to be assigned
223
261
  def discount_source=(discount_source)
@@ -228,6 +266,26 @@ module SmplkitGeneratedClient::App
228
266
  @discount_source = discount_source
229
267
  end
230
268
 
269
+ # Custom attribute writer method with validation
270
+ # @param [Object] subtotal_cents Value to be assigned
271
+ def subtotal_cents=(subtotal_cents)
272
+ if subtotal_cents.nil?
273
+ fail ArgumentError, 'subtotal_cents cannot be nil'
274
+ end
275
+
276
+ @subtotal_cents = subtotal_cents
277
+ end
278
+
279
+ # Custom attribute writer method with validation
280
+ # @param [Object] discount_amount_cents Value to be assigned
281
+ def discount_amount_cents=(discount_amount_cents)
282
+ if discount_amount_cents.nil?
283
+ fail ArgumentError, 'discount_amount_cents cannot be nil'
284
+ end
285
+
286
+ @discount_amount_cents = discount_amount_cents
287
+ end
288
+
231
289
  # Custom attribute writer method with validation
232
290
  # @param [Object] total_cents Value to be assigned
233
291
  def total_cents=(total_cents)
@@ -238,17 +296,32 @@ module SmplkitGeneratedClient::App
238
296
  @total_cents = total_cents
239
297
  end
240
298
 
299
+ # Custom attribute writer method with validation
300
+ # @param [Object] items Value to be assigned
301
+ def items=(items)
302
+ if items.nil?
303
+ fail ArgumentError, 'items cannot be nil'
304
+ end
305
+
306
+ @items = items
307
+ end
308
+
241
309
  # Checks equality by comparing each attribute.
242
310
  # @param [Object] Object to be compared
243
311
  def ==(o)
244
312
  return true if self.equal?(o)
245
313
  self.class == o.class &&
246
- subtotal_cents == o.subtotal_cents &&
314
+ status == o.status &&
315
+ current_period_start == o.current_period_start &&
316
+ current_period_end == o.current_period_end &&
247
317
  discount_pct == o.discount_pct &&
248
- discount_amount_cents == o.discount_amount_cents &&
249
318
  discount_source == o.discount_source &&
319
+ subtotal_cents == o.subtotal_cents &&
320
+ discount_amount_cents == o.discount_amount_cents &&
250
321
  total_cents == o.total_cents &&
251
- next_tier == o.next_tier
322
+ next_tier == o.next_tier &&
323
+ payment_method == o.payment_method &&
324
+ items == o.items
252
325
  end
253
326
 
254
327
  # @see the `==` method
@@ -260,7 +333,7 @@ module SmplkitGeneratedClient::App
260
333
  # Calculates hash code according to all attributes.
261
334
  # @return [Integer] Hash code
262
335
  def hash
263
- [subtotal_cents, discount_pct, discount_amount_cents, discount_source, total_cents, next_tier].hash
336
+ [status, current_period_start, current_period_end, discount_pct, discount_source, subtotal_cents, discount_amount_cents, total_cents, next_tier, payment_method, items].hash
264
337
  end
265
338
 
266
339
  # Builds the object from hash
@@ -26,6 +26,9 @@ require 'smplkit_app_client/models/account_wipe_request'
26
26
  require 'smplkit_app_client/models/add_payment_method_attributes'
27
27
  require 'smplkit_app_client/models/add_payment_method_body'
28
28
  require 'smplkit_app_client/models/add_payment_method_data'
29
+ require 'smplkit_app_client/models/admin_subscription_request'
30
+ require 'smplkit_app_client/models/admin_subscription_request_attributes'
31
+ require 'smplkit_app_client/models/admin_subscription_request_resource'
29
32
  require 'smplkit_app_client/models/api_key'
30
33
  require 'smplkit_app_client/models/api_key_list_response'
31
34
  require 'smplkit_app_client/models/api_key_request'
@@ -46,9 +49,6 @@ require 'smplkit_app_client/models/context_type_list_response'
46
49
  require 'smplkit_app_client/models/context_type_request'
47
50
  require 'smplkit_app_client/models/context_type_resource'
48
51
  require 'smplkit_app_client/models/context_type_response'
49
- require 'smplkit_app_client/models/create_subscription_attributes'
50
- require 'smplkit_app_client/models/create_subscription_body'
51
- require 'smplkit_app_client/models/create_subscription_data'
52
52
  require 'smplkit_app_client/models/email'
53
53
  require 'smplkit_app_client/models/email_resource'
54
54
  require 'smplkit_app_client/models/email_response'
@@ -84,7 +84,7 @@ require 'smplkit_app_client/models/metric_resource'
84
84
  require 'smplkit_app_client/models/metric_rollup_attributes'
85
85
  require 'smplkit_app_client/models/metric_rollup_list_response'
86
86
  require 'smplkit_app_client/models/metric_rollup_resource'
87
- require 'smplkit_app_client/models/next_tier_meta'
87
+ require 'smplkit_app_client/models/next_tier_response'
88
88
  require 'smplkit_app_client/models/oidc_provider'
89
89
  require 'smplkit_app_client/models/page_meta'
90
90
  require 'smplkit_app_client/models/payment_method'
@@ -93,7 +93,6 @@ require 'smplkit_app_client/models/payment_method_request'
93
93
  require 'smplkit_app_client/models/payment_method_resource'
94
94
  require 'smplkit_app_client/models/payment_method_response'
95
95
  require 'smplkit_app_client/models/plan'
96
- require 'smplkit_app_client/models/plan_change_request'
97
96
  require 'smplkit_app_client/models/plan_definition'
98
97
  require 'smplkit_app_client/models/plan_list_response'
99
98
  require 'smplkit_app_client/models/plan_resource'
@@ -109,11 +108,18 @@ require 'smplkit_app_client/models/service_response'
109
108
  require 'smplkit_app_client/models/setup_intent_attributes'
110
109
  require 'smplkit_app_client/models/setup_intent_resource'
111
110
  require 'smplkit_app_client/models/setup_intent_response'
112
- require 'smplkit_app_client/models/subscription_attributes'
113
- require 'smplkit_app_client/models/subscription_list_meta'
114
- require 'smplkit_app_client/models/subscription_list_response'
111
+ require 'smplkit_app_client/models/subscription_change_projection'
112
+ require 'smplkit_app_client/models/subscription_item_request'
113
+ require 'smplkit_app_client/models/subscription_item_response'
114
+ require 'smplkit_app_client/models/subscription_preview_attributes'
115
+ require 'smplkit_app_client/models/subscription_preview_resource'
116
+ require 'smplkit_app_client/models/subscription_preview_response'
117
+ require 'smplkit_app_client/models/subscription_request'
118
+ require 'smplkit_app_client/models/subscription_request_attributes'
119
+ require 'smplkit_app_client/models/subscription_request_resource'
115
120
  require 'smplkit_app_client/models/subscription_resource'
116
121
  require 'smplkit_app_client/models/subscription_response'
122
+ require 'smplkit_app_client/models/subscription_response_attributes'
117
123
  require 'smplkit_app_client/models/user'
118
124
  require 'smplkit_app_client/models/user_list_meta'
119
125
  require 'smplkit_app_client/models/user_list_response'
@@ -138,6 +144,7 @@ require 'smplkit_app_client/api/metrics_api'
138
144
  require 'smplkit_app_client/api/plans_api'
139
145
  require 'smplkit_app_client/api/products_api'
140
146
  require 'smplkit_app_client/api/services_api'
147
+ require 'smplkit_app_client/api/subscription_api'
141
148
  require 'smplkit_app_client/api/users_api'
142
149
 
143
150
  module SmplkitGeneratedClient::App