smplkit 3.0.7 → 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.
- checksums.yaml +4 -4
- data/lib/smplkit/_generated/app/lib/smplkit_app_client/api/api_keys_api.rb +7 -0
- data/lib/smplkit/_generated/app/lib/smplkit_app_client/api/billing_api.rb +16 -464
- data/lib/smplkit/_generated/app/lib/smplkit_app_client/api/context_types_api.rb +7 -0
- data/lib/smplkit/_generated/app/lib/smplkit_app_client/api/contexts_api.rb +7 -0
- data/lib/smplkit/_generated/app/lib/smplkit_app_client/api/environments_api.rb +7 -0
- data/lib/smplkit/_generated/app/lib/smplkit_app_client/api/invitations_api.rb +7 -0
- data/lib/smplkit/_generated/app/lib/smplkit_app_client/api/metrics_api.rb +23 -2
- data/lib/smplkit/_generated/app/lib/smplkit_app_client/api/plans_api.rb +9 -2
- data/lib/smplkit/_generated/app/lib/smplkit_app_client/api/products_api.rb +9 -2
- data/lib/smplkit/_generated/app/lib/smplkit_app_client/api/services_api.rb +7 -0
- data/lib/smplkit/_generated/app/lib/smplkit_app_client/api/subscription_api.rb +289 -0
- data/lib/smplkit/_generated/app/lib/smplkit_app_client/api/users_api.rb +7 -0
- data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/{subscription_list_response.rb → admin_subscription_request.rb} +9 -20
- data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/admin_subscription_request_attributes.rb +190 -0
- data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/{create_subscription_data.rb → admin_subscription_request_resource.rb} +46 -12
- data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/{next_tier_meta.rb → next_tier_response.rb} +6 -6
- data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/subscription_change_projection.rb +321 -0
- data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/{create_subscription_attributes.rb → subscription_item_request.rb} +10 -21
- data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/{subscription_attributes.rb → subscription_item_response.rb} +66 -77
- data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/subscription_preview_attributes.rb +390 -0
- data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/subscription_preview_resource.rb +241 -0
- data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/{plan_change_request.rb → subscription_preview_response.rb} +20 -21
- data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/{create_subscription_body.rb → subscription_request.rb} +5 -5
- data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/subscription_request_attributes.rb +179 -0
- data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/subscription_request_resource.rb +227 -0
- data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/subscription_resource.rb +4 -2
- data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/subscription_response.rb +1 -1
- data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/{subscription_list_meta.rb → subscription_response_attributes.rb} +135 -62
- data/lib/smplkit/_generated/app/lib/smplkit_app_client.rb +15 -8
- data/lib/smplkit/_generated/app/spec/api/api_keys_api_spec.rb +1 -0
- data/lib/smplkit/_generated/app/spec/api/billing_api_spec.rb +3 -86
- data/lib/smplkit/_generated/app/spec/api/context_types_api_spec.rb +1 -0
- data/lib/smplkit/_generated/app/spec/api/contexts_api_spec.rb +1 -0
- data/lib/smplkit/_generated/app/spec/api/environments_api_spec.rb +1 -0
- data/lib/smplkit/_generated/app/spec/api/invitations_api_spec.rb +1 -0
- data/lib/smplkit/_generated/app/spec/api/metrics_api_spec.rb +4 -1
- data/lib/smplkit/_generated/app/spec/api/plans_api_spec.rb +2 -1
- data/lib/smplkit/_generated/app/spec/api/products_api_spec.rb +2 -1
- data/lib/smplkit/_generated/app/spec/api/services_api_spec.rb +1 -0
- data/lib/smplkit/_generated/app/spec/api/subscription_api_spec.rb +83 -0
- data/lib/smplkit/_generated/app/spec/api/users_api_spec.rb +1 -0
- data/lib/smplkit/_generated/app/spec/models/{create_subscription_attributes_spec.rb → admin_subscription_request_attributes_spec.rb} +9 -9
- data/lib/smplkit/_generated/app/spec/models/admin_subscription_request_resource_spec.rb +52 -0
- data/lib/smplkit/_generated/app/spec/models/{plan_change_request_spec.rb → admin_subscription_request_spec.rb} +7 -7
- data/lib/smplkit/_generated/app/spec/models/{next_tier_meta_spec.rb → next_tier_response_spec.rb} +6 -6
- data/lib/smplkit/_generated/app/spec/models/{subscription_list_meta_spec.rb → subscription_change_projection_spec.rb} +20 -14
- data/lib/smplkit/_generated/app/spec/models/{create_subscription_data_spec.rb → subscription_item_request_spec.rb} +8 -8
- data/lib/smplkit/_generated/app/spec/models/{subscription_attributes_spec.rb → subscription_item_response_spec.rb} +12 -18
- data/lib/smplkit/_generated/app/spec/models/subscription_preview_attributes_spec.rb +88 -0
- data/lib/smplkit/_generated/app/spec/models/subscription_preview_resource_spec.rb +56 -0
- data/lib/smplkit/_generated/app/spec/models/subscription_preview_response_spec.rb +36 -0
- data/lib/smplkit/_generated/app/spec/models/{subscription_list_response_spec.rb → subscription_request_attributes_spec.rb} +8 -8
- data/lib/smplkit/_generated/app/spec/models/subscription_request_resource_spec.rb +52 -0
- data/lib/smplkit/_generated/app/spec/models/{create_subscription_body_spec.rb → subscription_request_spec.rb} +6 -6
- data/lib/smplkit/_generated/app/spec/models/subscription_response_attributes_spec.rb +100 -0
- metadata +31 -17
data/lib/smplkit/_generated/app/lib/smplkit_app_client/models/subscription_change_projection.rb
ADDED
|
@@ -0,0 +1,321 @@
|
|
|
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
|
+
# Per-item projected effect of a subscription change.
|
|
18
|
+
class SubscriptionChangeProjection < ApiModelBase
|
|
19
|
+
# Product key affected by this change.
|
|
20
|
+
attr_accessor :product
|
|
21
|
+
|
|
22
|
+
# Current plan for this product, or `FREE` if it is being added.
|
|
23
|
+
attr_accessor :from_plan
|
|
24
|
+
|
|
25
|
+
# Plan the product will be on after the change. `FREE` indicates the enrollment will be dropped.
|
|
26
|
+
attr_accessor :to_plan
|
|
27
|
+
|
|
28
|
+
# Monthly cost in cents of this enrollment after the change. `0` when the enrollment will be dropped.
|
|
29
|
+
attr_accessor :monthly_cents
|
|
30
|
+
|
|
31
|
+
# `IMMEDIATE` when the change takes effect at confirmation time (and a prorated charge may apply today). `NEXT_PERIOD` when the change takes effect at the end of the current billing period.
|
|
32
|
+
attr_accessor :effect
|
|
33
|
+
|
|
34
|
+
# When `effect` is `IMMEDIATE`, the estimated prorated charge for the remainder of the current billing period in cents. Always `0` when `effect` is `NEXT_PERIOD`.
|
|
35
|
+
attr_accessor :prorated_charge_today_cents
|
|
36
|
+
|
|
37
|
+
# When `effect` is `NEXT_PERIOD`, the ISO-8601 timestamp at which the change takes effect. `null` when `effect` is `IMMEDIATE` (the change applies on confirmation).
|
|
38
|
+
attr_accessor :starts_at
|
|
39
|
+
|
|
40
|
+
class EnumAttributeValidator
|
|
41
|
+
attr_reader :datatype
|
|
42
|
+
attr_reader :allowable_values
|
|
43
|
+
|
|
44
|
+
def initialize(datatype, allowable_values)
|
|
45
|
+
@allowable_values = allowable_values.map do |value|
|
|
46
|
+
case datatype.to_s
|
|
47
|
+
when /Integer/i
|
|
48
|
+
value.to_i
|
|
49
|
+
when /Float/i
|
|
50
|
+
value.to_f
|
|
51
|
+
else
|
|
52
|
+
value
|
|
53
|
+
end
|
|
54
|
+
end
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
def valid?(value)
|
|
58
|
+
!value || allowable_values.include?(value)
|
|
59
|
+
end
|
|
60
|
+
end
|
|
61
|
+
|
|
62
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
63
|
+
def self.attribute_map
|
|
64
|
+
{
|
|
65
|
+
:'product' => :'product',
|
|
66
|
+
:'from_plan' => :'from_plan',
|
|
67
|
+
:'to_plan' => :'to_plan',
|
|
68
|
+
:'monthly_cents' => :'monthly_cents',
|
|
69
|
+
:'effect' => :'effect',
|
|
70
|
+
:'prorated_charge_today_cents' => :'prorated_charge_today_cents',
|
|
71
|
+
:'starts_at' => :'starts_at'
|
|
72
|
+
}
|
|
73
|
+
end
|
|
74
|
+
|
|
75
|
+
# Returns attribute mapping this model knows about
|
|
76
|
+
def self.acceptable_attribute_map
|
|
77
|
+
attribute_map
|
|
78
|
+
end
|
|
79
|
+
|
|
80
|
+
# Returns all the JSON keys this model knows about
|
|
81
|
+
def self.acceptable_attributes
|
|
82
|
+
acceptable_attribute_map.values
|
|
83
|
+
end
|
|
84
|
+
|
|
85
|
+
# Attribute type mapping.
|
|
86
|
+
def self.openapi_types
|
|
87
|
+
{
|
|
88
|
+
:'product' => :'String',
|
|
89
|
+
:'from_plan' => :'String',
|
|
90
|
+
:'to_plan' => :'String',
|
|
91
|
+
:'monthly_cents' => :'Integer',
|
|
92
|
+
:'effect' => :'String',
|
|
93
|
+
:'prorated_charge_today_cents' => :'Integer',
|
|
94
|
+
:'starts_at' => :'String'
|
|
95
|
+
}
|
|
96
|
+
end
|
|
97
|
+
|
|
98
|
+
# List of attributes with nullable: true
|
|
99
|
+
def self.openapi_nullable
|
|
100
|
+
Set.new([
|
|
101
|
+
:'starts_at'
|
|
102
|
+
])
|
|
103
|
+
end
|
|
104
|
+
|
|
105
|
+
# Initializes the object
|
|
106
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
107
|
+
def initialize(attributes = {})
|
|
108
|
+
if (!attributes.is_a?(Hash))
|
|
109
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `SmplkitGeneratedClient::App::SubscriptionChangeProjection` initialize method"
|
|
110
|
+
end
|
|
111
|
+
|
|
112
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
113
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
114
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
115
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
116
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `SmplkitGeneratedClient::App::SubscriptionChangeProjection`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
117
|
+
end
|
|
118
|
+
h[k.to_sym] = v
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
if attributes.key?(:'product')
|
|
122
|
+
self.product = attributes[:'product']
|
|
123
|
+
else
|
|
124
|
+
self.product = nil
|
|
125
|
+
end
|
|
126
|
+
|
|
127
|
+
if attributes.key?(:'from_plan')
|
|
128
|
+
self.from_plan = attributes[:'from_plan']
|
|
129
|
+
else
|
|
130
|
+
self.from_plan = nil
|
|
131
|
+
end
|
|
132
|
+
|
|
133
|
+
if attributes.key?(:'to_plan')
|
|
134
|
+
self.to_plan = attributes[:'to_plan']
|
|
135
|
+
else
|
|
136
|
+
self.to_plan = nil
|
|
137
|
+
end
|
|
138
|
+
|
|
139
|
+
if attributes.key?(:'monthly_cents')
|
|
140
|
+
self.monthly_cents = attributes[:'monthly_cents']
|
|
141
|
+
else
|
|
142
|
+
self.monthly_cents = nil
|
|
143
|
+
end
|
|
144
|
+
|
|
145
|
+
if attributes.key?(:'effect')
|
|
146
|
+
self.effect = attributes[:'effect']
|
|
147
|
+
else
|
|
148
|
+
self.effect = nil
|
|
149
|
+
end
|
|
150
|
+
|
|
151
|
+
if attributes.key?(:'prorated_charge_today_cents')
|
|
152
|
+
self.prorated_charge_today_cents = attributes[:'prorated_charge_today_cents']
|
|
153
|
+
else
|
|
154
|
+
self.prorated_charge_today_cents = 0
|
|
155
|
+
end
|
|
156
|
+
|
|
157
|
+
if attributes.key?(:'starts_at')
|
|
158
|
+
self.starts_at = attributes[:'starts_at']
|
|
159
|
+
end
|
|
160
|
+
end
|
|
161
|
+
|
|
162
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
163
|
+
# @return Array for valid properties with the reasons
|
|
164
|
+
def list_invalid_properties
|
|
165
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
166
|
+
invalid_properties = Array.new
|
|
167
|
+
if @product.nil?
|
|
168
|
+
invalid_properties.push('invalid value for "product", product cannot be nil.')
|
|
169
|
+
end
|
|
170
|
+
|
|
171
|
+
if @from_plan.nil?
|
|
172
|
+
invalid_properties.push('invalid value for "from_plan", from_plan cannot be nil.')
|
|
173
|
+
end
|
|
174
|
+
|
|
175
|
+
if @to_plan.nil?
|
|
176
|
+
invalid_properties.push('invalid value for "to_plan", to_plan cannot be nil.')
|
|
177
|
+
end
|
|
178
|
+
|
|
179
|
+
if @monthly_cents.nil?
|
|
180
|
+
invalid_properties.push('invalid value for "monthly_cents", monthly_cents cannot be nil.')
|
|
181
|
+
end
|
|
182
|
+
|
|
183
|
+
if @effect.nil?
|
|
184
|
+
invalid_properties.push('invalid value for "effect", effect cannot be nil.')
|
|
185
|
+
end
|
|
186
|
+
|
|
187
|
+
invalid_properties
|
|
188
|
+
end
|
|
189
|
+
|
|
190
|
+
# Check to see if the all the properties in the model are valid
|
|
191
|
+
# @return true if the model is valid
|
|
192
|
+
def valid?
|
|
193
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
194
|
+
return false if @product.nil?
|
|
195
|
+
return false if @from_plan.nil?
|
|
196
|
+
return false if @to_plan.nil?
|
|
197
|
+
return false if @monthly_cents.nil?
|
|
198
|
+
return false if @effect.nil?
|
|
199
|
+
effect_validator = EnumAttributeValidator.new('String', ["IMMEDIATE", "NEXT_PERIOD"])
|
|
200
|
+
return false unless effect_validator.valid?(@effect)
|
|
201
|
+
true
|
|
202
|
+
end
|
|
203
|
+
|
|
204
|
+
# Custom attribute writer method with validation
|
|
205
|
+
# @param [Object] product Value to be assigned
|
|
206
|
+
def product=(product)
|
|
207
|
+
if product.nil?
|
|
208
|
+
fail ArgumentError, 'product cannot be nil'
|
|
209
|
+
end
|
|
210
|
+
|
|
211
|
+
@product = product
|
|
212
|
+
end
|
|
213
|
+
|
|
214
|
+
# Custom attribute writer method with validation
|
|
215
|
+
# @param [Object] from_plan Value to be assigned
|
|
216
|
+
def from_plan=(from_plan)
|
|
217
|
+
if from_plan.nil?
|
|
218
|
+
fail ArgumentError, 'from_plan cannot be nil'
|
|
219
|
+
end
|
|
220
|
+
|
|
221
|
+
@from_plan = from_plan
|
|
222
|
+
end
|
|
223
|
+
|
|
224
|
+
# Custom attribute writer method with validation
|
|
225
|
+
# @param [Object] to_plan Value to be assigned
|
|
226
|
+
def to_plan=(to_plan)
|
|
227
|
+
if to_plan.nil?
|
|
228
|
+
fail ArgumentError, 'to_plan cannot be nil'
|
|
229
|
+
end
|
|
230
|
+
|
|
231
|
+
@to_plan = to_plan
|
|
232
|
+
end
|
|
233
|
+
|
|
234
|
+
# Custom attribute writer method with validation
|
|
235
|
+
# @param [Object] monthly_cents Value to be assigned
|
|
236
|
+
def monthly_cents=(monthly_cents)
|
|
237
|
+
if monthly_cents.nil?
|
|
238
|
+
fail ArgumentError, 'monthly_cents cannot be nil'
|
|
239
|
+
end
|
|
240
|
+
|
|
241
|
+
@monthly_cents = monthly_cents
|
|
242
|
+
end
|
|
243
|
+
|
|
244
|
+
# Custom attribute writer method checking allowed values (enum).
|
|
245
|
+
# @param [Object] effect Object to be assigned
|
|
246
|
+
def effect=(effect)
|
|
247
|
+
validator = EnumAttributeValidator.new('String', ["IMMEDIATE", "NEXT_PERIOD"])
|
|
248
|
+
unless validator.valid?(effect)
|
|
249
|
+
fail ArgumentError, "invalid value for \"effect\", must be one of #{validator.allowable_values}."
|
|
250
|
+
end
|
|
251
|
+
@effect = effect
|
|
252
|
+
end
|
|
253
|
+
|
|
254
|
+
# Checks equality by comparing each attribute.
|
|
255
|
+
# @param [Object] Object to be compared
|
|
256
|
+
def ==(o)
|
|
257
|
+
return true if self.equal?(o)
|
|
258
|
+
self.class == o.class &&
|
|
259
|
+
product == o.product &&
|
|
260
|
+
from_plan == o.from_plan &&
|
|
261
|
+
to_plan == o.to_plan &&
|
|
262
|
+
monthly_cents == o.monthly_cents &&
|
|
263
|
+
effect == o.effect &&
|
|
264
|
+
prorated_charge_today_cents == o.prorated_charge_today_cents &&
|
|
265
|
+
starts_at == o.starts_at
|
|
266
|
+
end
|
|
267
|
+
|
|
268
|
+
# @see the `==` method
|
|
269
|
+
# @param [Object] Object to be compared
|
|
270
|
+
def eql?(o)
|
|
271
|
+
self == o
|
|
272
|
+
end
|
|
273
|
+
|
|
274
|
+
# Calculates hash code according to all attributes.
|
|
275
|
+
# @return [Integer] Hash code
|
|
276
|
+
def hash
|
|
277
|
+
[product, from_plan, to_plan, monthly_cents, effect, prorated_charge_today_cents, starts_at].hash
|
|
278
|
+
end
|
|
279
|
+
|
|
280
|
+
# Builds the object from hash
|
|
281
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
282
|
+
# @return [Object] Returns the model itself
|
|
283
|
+
def self.build_from_hash(attributes)
|
|
284
|
+
return nil unless attributes.is_a?(Hash)
|
|
285
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
286
|
+
transformed_hash = {}
|
|
287
|
+
openapi_types.each_pair do |key, type|
|
|
288
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
289
|
+
transformed_hash["#{key}"] = nil
|
|
290
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
291
|
+
# check to ensure the input is an array given that the attribute
|
|
292
|
+
# is documented as an array but the input is not
|
|
293
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
294
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
295
|
+
end
|
|
296
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
297
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
298
|
+
end
|
|
299
|
+
end
|
|
300
|
+
new(transformed_hash)
|
|
301
|
+
end
|
|
302
|
+
|
|
303
|
+
# Returns the object in the form of hash
|
|
304
|
+
# @return [Hash] Returns the object in the form of hash
|
|
305
|
+
def to_hash
|
|
306
|
+
hash = {}
|
|
307
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
308
|
+
value = self.send(attr)
|
|
309
|
+
if value.nil?
|
|
310
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
311
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
312
|
+
end
|
|
313
|
+
|
|
314
|
+
hash[param] = _to_hash(value)
|
|
315
|
+
end
|
|
316
|
+
hash
|
|
317
|
+
end
|
|
318
|
+
|
|
319
|
+
end
|
|
320
|
+
|
|
321
|
+
end
|
|
@@ -14,23 +14,19 @@ require 'date'
|
|
|
14
14
|
require 'time'
|
|
15
15
|
|
|
16
16
|
module SmplkitGeneratedClient::App
|
|
17
|
-
#
|
|
18
|
-
class
|
|
19
|
-
# Product key
|
|
17
|
+
# One product enrollment as supplied by the caller. The caller supplies the *desired* (product, plan) pair for each product they want enrolled. Products absent from the request are interpreted as scheduled-for-drop at the end of the current billing period.
|
|
18
|
+
class SubscriptionItemRequest < ApiModelBase
|
|
19
|
+
# Product key (e.g. `audit`, `config`, `flags`, `logging`).
|
|
20
20
|
attr_accessor :product
|
|
21
21
|
|
|
22
|
-
#
|
|
22
|
+
# Target plan for this product. Must be a paid plan such as `STANDARD` or `PRO`; the free plan is implicit when a product is not listed.
|
|
23
23
|
attr_accessor :plan
|
|
24
24
|
|
|
25
|
-
# UUID of a payment method on file to bill against. If omitted, the account's default payment method is used.
|
|
26
|
-
attr_accessor :payment_method
|
|
27
|
-
|
|
28
25
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
29
26
|
def self.attribute_map
|
|
30
27
|
{
|
|
31
28
|
:'product' => :'product',
|
|
32
|
-
:'plan' => :'plan'
|
|
33
|
-
:'payment_method' => :'payment_method'
|
|
29
|
+
:'plan' => :'plan'
|
|
34
30
|
}
|
|
35
31
|
end
|
|
36
32
|
|
|
@@ -48,15 +44,13 @@ module SmplkitGeneratedClient::App
|
|
|
48
44
|
def self.openapi_types
|
|
49
45
|
{
|
|
50
46
|
:'product' => :'String',
|
|
51
|
-
:'plan' => :'String'
|
|
52
|
-
:'payment_method' => :'String'
|
|
47
|
+
:'plan' => :'String'
|
|
53
48
|
}
|
|
54
49
|
end
|
|
55
50
|
|
|
56
51
|
# List of attributes with nullable: true
|
|
57
52
|
def self.openapi_nullable
|
|
58
53
|
Set.new([
|
|
59
|
-
:'payment_method'
|
|
60
54
|
])
|
|
61
55
|
end
|
|
62
56
|
|
|
@@ -64,14 +58,14 @@ module SmplkitGeneratedClient::App
|
|
|
64
58
|
# @param [Hash] attributes Model attributes in the form of hash
|
|
65
59
|
def initialize(attributes = {})
|
|
66
60
|
if (!attributes.is_a?(Hash))
|
|
67
|
-
fail ArgumentError, "The input argument (attributes) must be a hash in `SmplkitGeneratedClient::App::
|
|
61
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `SmplkitGeneratedClient::App::SubscriptionItemRequest` initialize method"
|
|
68
62
|
end
|
|
69
63
|
|
|
70
64
|
# check to see if the attribute exists and convert string to symbol for hash key
|
|
71
65
|
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
72
66
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
73
67
|
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
74
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `SmplkitGeneratedClient::App::
|
|
68
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `SmplkitGeneratedClient::App::SubscriptionItemRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
75
69
|
end
|
|
76
70
|
h[k.to_sym] = v
|
|
77
71
|
}
|
|
@@ -87,10 +81,6 @@ module SmplkitGeneratedClient::App
|
|
|
87
81
|
else
|
|
88
82
|
self.plan = nil
|
|
89
83
|
end
|
|
90
|
-
|
|
91
|
-
if attributes.key?(:'payment_method')
|
|
92
|
-
self.payment_method = attributes[:'payment_method']
|
|
93
|
-
end
|
|
94
84
|
end
|
|
95
85
|
|
|
96
86
|
# Show invalid properties with the reasons. Usually used together with valid?
|
|
@@ -144,8 +134,7 @@ module SmplkitGeneratedClient::App
|
|
|
144
134
|
return true if self.equal?(o)
|
|
145
135
|
self.class == o.class &&
|
|
146
136
|
product == o.product &&
|
|
147
|
-
plan == o.plan
|
|
148
|
-
payment_method == o.payment_method
|
|
137
|
+
plan == o.plan
|
|
149
138
|
end
|
|
150
139
|
|
|
151
140
|
# @see the `==` method
|
|
@@ -157,7 +146,7 @@ module SmplkitGeneratedClient::App
|
|
|
157
146
|
# Calculates hash code according to all attributes.
|
|
158
147
|
# @return [Integer] Hash code
|
|
159
148
|
def hash
|
|
160
|
-
[product, plan
|
|
149
|
+
[product, plan].hash
|
|
161
150
|
end
|
|
162
151
|
|
|
163
152
|
# Builds the object from hash
|
|
@@ -14,39 +14,35 @@ require 'date'
|
|
|
14
14
|
require 'time'
|
|
15
15
|
|
|
16
16
|
module SmplkitGeneratedClient::App
|
|
17
|
-
#
|
|
18
|
-
class
|
|
19
|
-
#
|
|
17
|
+
# One product enrollment as exposed in subscription responses.
|
|
18
|
+
class SubscriptionItemResponse < ApiModelBase
|
|
19
|
+
# Unique identifier for this enrollment.
|
|
20
|
+
attr_accessor :id
|
|
21
|
+
|
|
22
|
+
# Product key (e.g. `audit`, `config`, `flags`, `logging`).
|
|
20
23
|
attr_accessor :product
|
|
21
24
|
|
|
22
|
-
#
|
|
25
|
+
# Current plan for this product (e.g. `STANDARD`, `PRO`).
|
|
23
26
|
attr_accessor :plan
|
|
24
27
|
|
|
25
|
-
#
|
|
26
|
-
attr_accessor :
|
|
27
|
-
|
|
28
|
-
# When `true`, the subscription is complimentary and is not billed through the billing provider.
|
|
29
|
-
attr_accessor :comped
|
|
28
|
+
# Monthly list price for this enrollment, in cents. This value is locked at the time the enrollment was created or last had its plan changed; subsequent changes to the public price list do not affect this enrollment until the customer themselves changes their plan.
|
|
29
|
+
attr_accessor :price_monthly_cents
|
|
30
30
|
|
|
31
|
-
# When
|
|
32
|
-
attr_accessor :
|
|
31
|
+
# When a plan change is scheduled for the end of the current billing period, this is the plan that will take effect. Otherwise `null`. The value `FREE` indicates the enrollment will be dropped.
|
|
32
|
+
attr_accessor :pending_plan_change
|
|
33
33
|
|
|
34
|
-
#
|
|
35
|
-
attr_accessor :
|
|
36
|
-
|
|
37
|
-
# Stripe payment intent client secret returned when a subscription create requires additional authentication (3DS). Returned only on create.
|
|
38
|
-
attr_accessor :client_secret
|
|
34
|
+
# ISO-8601 timestamp at which the pending plan change takes effect. Matches the subscription's `current_period_end`.
|
|
35
|
+
attr_accessor :scheduled_change_effective_at
|
|
39
36
|
|
|
40
37
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
41
38
|
def self.attribute_map
|
|
42
39
|
{
|
|
40
|
+
:'id' => :'id',
|
|
43
41
|
:'product' => :'product',
|
|
44
42
|
:'plan' => :'plan',
|
|
45
|
-
:'
|
|
46
|
-
:'
|
|
47
|
-
:'
|
|
48
|
-
:'current_period_end' => :'current_period_end',
|
|
49
|
-
:'client_secret' => :'client_secret'
|
|
43
|
+
:'price_monthly_cents' => :'price_monthly_cents',
|
|
44
|
+
:'pending_plan_change' => :'pending_plan_change',
|
|
45
|
+
:'scheduled_change_effective_at' => :'scheduled_change_effective_at'
|
|
50
46
|
}
|
|
51
47
|
end
|
|
52
48
|
|
|
@@ -63,22 +59,20 @@ module SmplkitGeneratedClient::App
|
|
|
63
59
|
# Attribute type mapping.
|
|
64
60
|
def self.openapi_types
|
|
65
61
|
{
|
|
62
|
+
:'id' => :'String',
|
|
66
63
|
:'product' => :'String',
|
|
67
64
|
:'plan' => :'String',
|
|
68
|
-
:'
|
|
69
|
-
:'
|
|
70
|
-
:'
|
|
71
|
-
:'current_period_end' => :'String',
|
|
72
|
-
:'client_secret' => :'String'
|
|
65
|
+
:'price_monthly_cents' => :'Integer',
|
|
66
|
+
:'pending_plan_change' => :'String',
|
|
67
|
+
:'scheduled_change_effective_at' => :'String'
|
|
73
68
|
}
|
|
74
69
|
end
|
|
75
70
|
|
|
76
71
|
# List of attributes with nullable: true
|
|
77
72
|
def self.openapi_nullable
|
|
78
73
|
Set.new([
|
|
79
|
-
:'
|
|
80
|
-
:'
|
|
81
|
-
:'client_secret'
|
|
74
|
+
:'pending_plan_change',
|
|
75
|
+
:'scheduled_change_effective_at'
|
|
82
76
|
])
|
|
83
77
|
end
|
|
84
78
|
|
|
@@ -86,18 +80,24 @@ module SmplkitGeneratedClient::App
|
|
|
86
80
|
# @param [Hash] attributes Model attributes in the form of hash
|
|
87
81
|
def initialize(attributes = {})
|
|
88
82
|
if (!attributes.is_a?(Hash))
|
|
89
|
-
fail ArgumentError, "The input argument (attributes) must be a hash in `SmplkitGeneratedClient::App::
|
|
83
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `SmplkitGeneratedClient::App::SubscriptionItemResponse` initialize method"
|
|
90
84
|
end
|
|
91
85
|
|
|
92
86
|
# check to see if the attribute exists and convert string to symbol for hash key
|
|
93
87
|
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
94
88
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
95
89
|
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
96
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `SmplkitGeneratedClient::App::
|
|
90
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `SmplkitGeneratedClient::App::SubscriptionItemResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
97
91
|
end
|
|
98
92
|
h[k.to_sym] = v
|
|
99
93
|
}
|
|
100
94
|
|
|
95
|
+
if attributes.key?(:'id')
|
|
96
|
+
self.id = attributes[:'id']
|
|
97
|
+
else
|
|
98
|
+
self.id = nil
|
|
99
|
+
end
|
|
100
|
+
|
|
101
101
|
if attributes.key?(:'product')
|
|
102
102
|
self.product = attributes[:'product']
|
|
103
103
|
else
|
|
@@ -110,28 +110,18 @@ module SmplkitGeneratedClient::App
|
|
|
110
110
|
self.plan = nil
|
|
111
111
|
end
|
|
112
112
|
|
|
113
|
-
if attributes.key?(:'
|
|
114
|
-
self.
|
|
115
|
-
end
|
|
116
|
-
|
|
117
|
-
if attributes.key?(:'comped')
|
|
118
|
-
self.comped = attributes[:'comped']
|
|
119
|
-
else
|
|
120
|
-
self.comped = nil
|
|
121
|
-
end
|
|
122
|
-
|
|
123
|
-
if attributes.key?(:'stripe_managed')
|
|
124
|
-
self.stripe_managed = attributes[:'stripe_managed']
|
|
113
|
+
if attributes.key?(:'price_monthly_cents')
|
|
114
|
+
self.price_monthly_cents = attributes[:'price_monthly_cents']
|
|
125
115
|
else
|
|
126
|
-
self.
|
|
116
|
+
self.price_monthly_cents = nil
|
|
127
117
|
end
|
|
128
118
|
|
|
129
|
-
if attributes.key?(:'
|
|
130
|
-
self.
|
|
119
|
+
if attributes.key?(:'pending_plan_change')
|
|
120
|
+
self.pending_plan_change = attributes[:'pending_plan_change']
|
|
131
121
|
end
|
|
132
122
|
|
|
133
|
-
if attributes.key?(:'
|
|
134
|
-
self.
|
|
123
|
+
if attributes.key?(:'scheduled_change_effective_at')
|
|
124
|
+
self.scheduled_change_effective_at = attributes[:'scheduled_change_effective_at']
|
|
135
125
|
end
|
|
136
126
|
end
|
|
137
127
|
|
|
@@ -140,6 +130,10 @@ module SmplkitGeneratedClient::App
|
|
|
140
130
|
def list_invalid_properties
|
|
141
131
|
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
142
132
|
invalid_properties = Array.new
|
|
133
|
+
if @id.nil?
|
|
134
|
+
invalid_properties.push('invalid value for "id", id cannot be nil.')
|
|
135
|
+
end
|
|
136
|
+
|
|
143
137
|
if @product.nil?
|
|
144
138
|
invalid_properties.push('invalid value for "product", product cannot be nil.')
|
|
145
139
|
end
|
|
@@ -148,12 +142,8 @@ module SmplkitGeneratedClient::App
|
|
|
148
142
|
invalid_properties.push('invalid value for "plan", plan cannot be nil.')
|
|
149
143
|
end
|
|
150
144
|
|
|
151
|
-
if @
|
|
152
|
-
invalid_properties.push('invalid value for "
|
|
153
|
-
end
|
|
154
|
-
|
|
155
|
-
if @stripe_managed.nil?
|
|
156
|
-
invalid_properties.push('invalid value for "stripe_managed", stripe_managed cannot be nil.')
|
|
145
|
+
if @price_monthly_cents.nil?
|
|
146
|
+
invalid_properties.push('invalid value for "price_monthly_cents", price_monthly_cents cannot be nil.')
|
|
157
147
|
end
|
|
158
148
|
|
|
159
149
|
invalid_properties
|
|
@@ -163,13 +153,23 @@ module SmplkitGeneratedClient::App
|
|
|
163
153
|
# @return true if the model is valid
|
|
164
154
|
def valid?
|
|
165
155
|
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
156
|
+
return false if @id.nil?
|
|
166
157
|
return false if @product.nil?
|
|
167
158
|
return false if @plan.nil?
|
|
168
|
-
return false if @
|
|
169
|
-
return false if @stripe_managed.nil?
|
|
159
|
+
return false if @price_monthly_cents.nil?
|
|
170
160
|
true
|
|
171
161
|
end
|
|
172
162
|
|
|
163
|
+
# Custom attribute writer method with validation
|
|
164
|
+
# @param [Object] id Value to be assigned
|
|
165
|
+
def id=(id)
|
|
166
|
+
if id.nil?
|
|
167
|
+
fail ArgumentError, 'id cannot be nil'
|
|
168
|
+
end
|
|
169
|
+
|
|
170
|
+
@id = id
|
|
171
|
+
end
|
|
172
|
+
|
|
173
173
|
# Custom attribute writer method with validation
|
|
174
174
|
# @param [Object] product Value to be assigned
|
|
175
175
|
def product=(product)
|
|
@@ -191,23 +191,13 @@ module SmplkitGeneratedClient::App
|
|
|
191
191
|
end
|
|
192
192
|
|
|
193
193
|
# Custom attribute writer method with validation
|
|
194
|
-
# @param [Object]
|
|
195
|
-
def
|
|
196
|
-
if
|
|
197
|
-
fail ArgumentError, '
|
|
198
|
-
end
|
|
199
|
-
|
|
200
|
-
@comped = comped
|
|
201
|
-
end
|
|
202
|
-
|
|
203
|
-
# Custom attribute writer method with validation
|
|
204
|
-
# @param [Object] stripe_managed Value to be assigned
|
|
205
|
-
def stripe_managed=(stripe_managed)
|
|
206
|
-
if stripe_managed.nil?
|
|
207
|
-
fail ArgumentError, 'stripe_managed cannot be nil'
|
|
194
|
+
# @param [Object] price_monthly_cents Value to be assigned
|
|
195
|
+
def price_monthly_cents=(price_monthly_cents)
|
|
196
|
+
if price_monthly_cents.nil?
|
|
197
|
+
fail ArgumentError, 'price_monthly_cents cannot be nil'
|
|
208
198
|
end
|
|
209
199
|
|
|
210
|
-
@
|
|
200
|
+
@price_monthly_cents = price_monthly_cents
|
|
211
201
|
end
|
|
212
202
|
|
|
213
203
|
# Checks equality by comparing each attribute.
|
|
@@ -215,13 +205,12 @@ module SmplkitGeneratedClient::App
|
|
|
215
205
|
def ==(o)
|
|
216
206
|
return true if self.equal?(o)
|
|
217
207
|
self.class == o.class &&
|
|
208
|
+
id == o.id &&
|
|
218
209
|
product == o.product &&
|
|
219
210
|
plan == o.plan &&
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
current_period_end == o.current_period_end &&
|
|
224
|
-
client_secret == o.client_secret
|
|
211
|
+
price_monthly_cents == o.price_monthly_cents &&
|
|
212
|
+
pending_plan_change == o.pending_plan_change &&
|
|
213
|
+
scheduled_change_effective_at == o.scheduled_change_effective_at
|
|
225
214
|
end
|
|
226
215
|
|
|
227
216
|
# @see the `==` method
|
|
@@ -233,7 +222,7 @@ module SmplkitGeneratedClient::App
|
|
|
233
222
|
# Calculates hash code according to all attributes.
|
|
234
223
|
# @return [Integer] Hash code
|
|
235
224
|
def hash
|
|
236
|
-
[product, plan,
|
|
225
|
+
[id, product, plan, price_monthly_cents, pending_plan_change, scheduled_change_effective_at].hash
|
|
237
226
|
end
|
|
238
227
|
|
|
239
228
|
# Builds the object from hash
|