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
|
@@ -14,17 +14,14 @@ require 'date'
|
|
|
14
14
|
require 'time'
|
|
15
15
|
|
|
16
16
|
module SmplkitGeneratedClient::App
|
|
17
|
-
#
|
|
18
|
-
class
|
|
17
|
+
# Admin-scope request envelope for replacing a subscription.
|
|
18
|
+
class AdminSubscriptionRequest < ApiModelBase
|
|
19
19
|
attr_accessor :data
|
|
20
20
|
|
|
21
|
-
attr_accessor :meta
|
|
22
|
-
|
|
23
21
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
24
22
|
def self.attribute_map
|
|
25
23
|
{
|
|
26
|
-
:'data' => :'data'
|
|
27
|
-
:'meta' => :'meta'
|
|
24
|
+
:'data' => :'data'
|
|
28
25
|
}
|
|
29
26
|
end
|
|
30
27
|
|
|
@@ -41,8 +38,7 @@ module SmplkitGeneratedClient::App
|
|
|
41
38
|
# Attribute type mapping.
|
|
42
39
|
def self.openapi_types
|
|
43
40
|
{
|
|
44
|
-
:'data' => :'
|
|
45
|
-
:'meta' => :'SubscriptionListMeta'
|
|
41
|
+
:'data' => :'AdminSubscriptionRequestResource'
|
|
46
42
|
}
|
|
47
43
|
end
|
|
48
44
|
|
|
@@ -56,29 +52,23 @@ module SmplkitGeneratedClient::App
|
|
|
56
52
|
# @param [Hash] attributes Model attributes in the form of hash
|
|
57
53
|
def initialize(attributes = {})
|
|
58
54
|
if (!attributes.is_a?(Hash))
|
|
59
|
-
fail ArgumentError, "The input argument (attributes) must be a hash in `SmplkitGeneratedClient::App::
|
|
55
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `SmplkitGeneratedClient::App::AdminSubscriptionRequest` initialize method"
|
|
60
56
|
end
|
|
61
57
|
|
|
62
58
|
# check to see if the attribute exists and convert string to symbol for hash key
|
|
63
59
|
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
64
60
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
65
61
|
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
66
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `SmplkitGeneratedClient::App::
|
|
62
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `SmplkitGeneratedClient::App::AdminSubscriptionRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
67
63
|
end
|
|
68
64
|
h[k.to_sym] = v
|
|
69
65
|
}
|
|
70
66
|
|
|
71
67
|
if attributes.key?(:'data')
|
|
72
|
-
|
|
73
|
-
self.data = value
|
|
74
|
-
end
|
|
68
|
+
self.data = attributes[:'data']
|
|
75
69
|
else
|
|
76
70
|
self.data = nil
|
|
77
71
|
end
|
|
78
|
-
|
|
79
|
-
if attributes.key?(:'meta')
|
|
80
|
-
self.meta = attributes[:'meta']
|
|
81
|
-
end
|
|
82
72
|
end
|
|
83
73
|
|
|
84
74
|
# Show invalid properties with the reasons. Usually used together with valid?
|
|
@@ -116,8 +106,7 @@ module SmplkitGeneratedClient::App
|
|
|
116
106
|
def ==(o)
|
|
117
107
|
return true if self.equal?(o)
|
|
118
108
|
self.class == o.class &&
|
|
119
|
-
data == o.data
|
|
120
|
-
meta == o.meta
|
|
109
|
+
data == o.data
|
|
121
110
|
end
|
|
122
111
|
|
|
123
112
|
# @see the `==` method
|
|
@@ -129,7 +118,7 @@ module SmplkitGeneratedClient::App
|
|
|
129
118
|
# Calculates hash code according to all attributes.
|
|
130
119
|
# @return [Integer] Hash code
|
|
131
120
|
def hash
|
|
132
|
-
[data
|
|
121
|
+
[data].hash
|
|
133
122
|
end
|
|
134
123
|
|
|
135
124
|
# Builds the object from hash
|
|
@@ -0,0 +1,190 @@
|
|
|
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
|
+
# Same as the customer request body plus the admin-only override field.
|
|
18
|
+
class AdminSubscriptionRequestAttributes < ApiModelBase
|
|
19
|
+
# Desired enrollments. Products listed are scheduled to be on the specified plan immediately (for upgrades and new enrollments) or at the end of the current billing period (for downgrades). Products not listed are scheduled to be dropped at the end of the current billing period.
|
|
20
|
+
attr_accessor :items
|
|
21
|
+
|
|
22
|
+
# Optional identifier of the payment method to bill against. If omitted, the account's default payment method is used.
|
|
23
|
+
attr_accessor :payment_method
|
|
24
|
+
|
|
25
|
+
# Administrator-set discount percentage (0–100). When set, the multi-product discount schedule is bypassed and this value is used directly. Setting `100` skips the billing provider entirely — the customer pays nothing. Pass `null` to clear any existing override and revert to the multi-product discount schedule.
|
|
26
|
+
attr_accessor :discount_override_pct
|
|
27
|
+
|
|
28
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
29
|
+
def self.attribute_map
|
|
30
|
+
{
|
|
31
|
+
:'items' => :'items',
|
|
32
|
+
:'payment_method' => :'payment_method',
|
|
33
|
+
:'discount_override_pct' => :'discount_override_pct'
|
|
34
|
+
}
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
# Returns attribute mapping this model knows about
|
|
38
|
+
def self.acceptable_attribute_map
|
|
39
|
+
attribute_map
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
# Returns all the JSON keys this model knows about
|
|
43
|
+
def self.acceptable_attributes
|
|
44
|
+
acceptable_attribute_map.values
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
# Attribute type mapping.
|
|
48
|
+
def self.openapi_types
|
|
49
|
+
{
|
|
50
|
+
:'items' => :'Array<SubscriptionItemRequest>',
|
|
51
|
+
:'payment_method' => :'String',
|
|
52
|
+
:'discount_override_pct' => :'Integer'
|
|
53
|
+
}
|
|
54
|
+
end
|
|
55
|
+
|
|
56
|
+
# List of attributes with nullable: true
|
|
57
|
+
def self.openapi_nullable
|
|
58
|
+
Set.new([
|
|
59
|
+
:'payment_method',
|
|
60
|
+
:'discount_override_pct'
|
|
61
|
+
])
|
|
62
|
+
end
|
|
63
|
+
|
|
64
|
+
# Initializes the object
|
|
65
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
66
|
+
def initialize(attributes = {})
|
|
67
|
+
if (!attributes.is_a?(Hash))
|
|
68
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `SmplkitGeneratedClient::App::AdminSubscriptionRequestAttributes` initialize method"
|
|
69
|
+
end
|
|
70
|
+
|
|
71
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
72
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
73
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
74
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
75
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `SmplkitGeneratedClient::App::AdminSubscriptionRequestAttributes`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
76
|
+
end
|
|
77
|
+
h[k.to_sym] = v
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
if attributes.key?(:'items')
|
|
81
|
+
if (value = attributes[:'items']).is_a?(Array)
|
|
82
|
+
self.items = value
|
|
83
|
+
end
|
|
84
|
+
else
|
|
85
|
+
self.items = nil
|
|
86
|
+
end
|
|
87
|
+
|
|
88
|
+
if attributes.key?(:'payment_method')
|
|
89
|
+
self.payment_method = attributes[:'payment_method']
|
|
90
|
+
end
|
|
91
|
+
|
|
92
|
+
if attributes.key?(:'discount_override_pct')
|
|
93
|
+
self.discount_override_pct = attributes[:'discount_override_pct']
|
|
94
|
+
end
|
|
95
|
+
end
|
|
96
|
+
|
|
97
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
98
|
+
# @return Array for valid properties with the reasons
|
|
99
|
+
def list_invalid_properties
|
|
100
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
101
|
+
invalid_properties = Array.new
|
|
102
|
+
if @items.nil?
|
|
103
|
+
invalid_properties.push('invalid value for "items", items cannot be nil.')
|
|
104
|
+
end
|
|
105
|
+
|
|
106
|
+
invalid_properties
|
|
107
|
+
end
|
|
108
|
+
|
|
109
|
+
# Check to see if the all the properties in the model are valid
|
|
110
|
+
# @return true if the model is valid
|
|
111
|
+
def valid?
|
|
112
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
113
|
+
return false if @items.nil?
|
|
114
|
+
true
|
|
115
|
+
end
|
|
116
|
+
|
|
117
|
+
# Custom attribute writer method with validation
|
|
118
|
+
# @param [Object] items Value to be assigned
|
|
119
|
+
def items=(items)
|
|
120
|
+
if items.nil?
|
|
121
|
+
fail ArgumentError, 'items cannot be nil'
|
|
122
|
+
end
|
|
123
|
+
|
|
124
|
+
@items = items
|
|
125
|
+
end
|
|
126
|
+
|
|
127
|
+
# Checks equality by comparing each attribute.
|
|
128
|
+
# @param [Object] Object to be compared
|
|
129
|
+
def ==(o)
|
|
130
|
+
return true if self.equal?(o)
|
|
131
|
+
self.class == o.class &&
|
|
132
|
+
items == o.items &&
|
|
133
|
+
payment_method == o.payment_method &&
|
|
134
|
+
discount_override_pct == o.discount_override_pct
|
|
135
|
+
end
|
|
136
|
+
|
|
137
|
+
# @see the `==` method
|
|
138
|
+
# @param [Object] Object to be compared
|
|
139
|
+
def eql?(o)
|
|
140
|
+
self == o
|
|
141
|
+
end
|
|
142
|
+
|
|
143
|
+
# Calculates hash code according to all attributes.
|
|
144
|
+
# @return [Integer] Hash code
|
|
145
|
+
def hash
|
|
146
|
+
[items, payment_method, discount_override_pct].hash
|
|
147
|
+
end
|
|
148
|
+
|
|
149
|
+
# Builds the object from hash
|
|
150
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
151
|
+
# @return [Object] Returns the model itself
|
|
152
|
+
def self.build_from_hash(attributes)
|
|
153
|
+
return nil unless attributes.is_a?(Hash)
|
|
154
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
155
|
+
transformed_hash = {}
|
|
156
|
+
openapi_types.each_pair do |key, type|
|
|
157
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
158
|
+
transformed_hash["#{key}"] = nil
|
|
159
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
160
|
+
# check to ensure the input is an array given that the attribute
|
|
161
|
+
# is documented as an array but the input is not
|
|
162
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
163
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
164
|
+
end
|
|
165
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
166
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
167
|
+
end
|
|
168
|
+
end
|
|
169
|
+
new(transformed_hash)
|
|
170
|
+
end
|
|
171
|
+
|
|
172
|
+
# Returns the object in the form of hash
|
|
173
|
+
# @return [Hash] Returns the object in the form of hash
|
|
174
|
+
def to_hash
|
|
175
|
+
hash = {}
|
|
176
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
177
|
+
value = self.send(attr)
|
|
178
|
+
if value.nil?
|
|
179
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
180
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
181
|
+
end
|
|
182
|
+
|
|
183
|
+
hash[param] = _to_hash(value)
|
|
184
|
+
end
|
|
185
|
+
hash
|
|
186
|
+
end
|
|
187
|
+
|
|
188
|
+
end
|
|
189
|
+
|
|
190
|
+
end
|
|
@@ -14,16 +14,41 @@ require 'date'
|
|
|
14
14
|
require 'time'
|
|
15
15
|
|
|
16
16
|
module SmplkitGeneratedClient::App
|
|
17
|
-
#
|
|
18
|
-
class
|
|
19
|
-
|
|
17
|
+
# Admin-scope resource object for a subscription update request.
|
|
18
|
+
class AdminSubscriptionRequestResource < ApiModelBase
|
|
19
|
+
attr_accessor :id
|
|
20
|
+
|
|
21
|
+
# JSON:API resource type.
|
|
20
22
|
attr_accessor :type
|
|
21
23
|
|
|
22
24
|
attr_accessor :attributes
|
|
23
25
|
|
|
26
|
+
class EnumAttributeValidator
|
|
27
|
+
attr_reader :datatype
|
|
28
|
+
attr_reader :allowable_values
|
|
29
|
+
|
|
30
|
+
def initialize(datatype, allowable_values)
|
|
31
|
+
@allowable_values = allowable_values.map do |value|
|
|
32
|
+
case datatype.to_s
|
|
33
|
+
when /Integer/i
|
|
34
|
+
value.to_i
|
|
35
|
+
when /Float/i
|
|
36
|
+
value.to_f
|
|
37
|
+
else
|
|
38
|
+
value
|
|
39
|
+
end
|
|
40
|
+
end
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
def valid?(value)
|
|
44
|
+
!value || allowable_values.include?(value)
|
|
45
|
+
end
|
|
46
|
+
end
|
|
47
|
+
|
|
24
48
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
25
49
|
def self.attribute_map
|
|
26
50
|
{
|
|
51
|
+
:'id' => :'id',
|
|
27
52
|
:'type' => :'type',
|
|
28
53
|
:'attributes' => :'attributes'
|
|
29
54
|
}
|
|
@@ -42,14 +67,16 @@ module SmplkitGeneratedClient::App
|
|
|
42
67
|
# Attribute type mapping.
|
|
43
68
|
def self.openapi_types
|
|
44
69
|
{
|
|
70
|
+
:'id' => :'String',
|
|
45
71
|
:'type' => :'String',
|
|
46
|
-
:'attributes' => :'
|
|
72
|
+
:'attributes' => :'AdminSubscriptionRequestAttributes'
|
|
47
73
|
}
|
|
48
74
|
end
|
|
49
75
|
|
|
50
76
|
# List of attributes with nullable: true
|
|
51
77
|
def self.openapi_nullable
|
|
52
78
|
Set.new([
|
|
79
|
+
:'id',
|
|
53
80
|
])
|
|
54
81
|
end
|
|
55
82
|
|
|
@@ -57,18 +84,22 @@ module SmplkitGeneratedClient::App
|
|
|
57
84
|
# @param [Hash] attributes Model attributes in the form of hash
|
|
58
85
|
def initialize(attributes = {})
|
|
59
86
|
if (!attributes.is_a?(Hash))
|
|
60
|
-
fail ArgumentError, "The input argument (attributes) must be a hash in `SmplkitGeneratedClient::App::
|
|
87
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `SmplkitGeneratedClient::App::AdminSubscriptionRequestResource` initialize method"
|
|
61
88
|
end
|
|
62
89
|
|
|
63
90
|
# check to see if the attribute exists and convert string to symbol for hash key
|
|
64
91
|
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
65
92
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
66
93
|
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
67
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `SmplkitGeneratedClient::App::
|
|
94
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `SmplkitGeneratedClient::App::AdminSubscriptionRequestResource`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
68
95
|
end
|
|
69
96
|
h[k.to_sym] = v
|
|
70
97
|
}
|
|
71
98
|
|
|
99
|
+
if attributes.key?(:'id')
|
|
100
|
+
self.id = attributes[:'id']
|
|
101
|
+
end
|
|
102
|
+
|
|
72
103
|
if attributes.key?(:'type')
|
|
73
104
|
self.type = attributes[:'type']
|
|
74
105
|
else
|
|
@@ -103,17 +134,19 @@ module SmplkitGeneratedClient::App
|
|
|
103
134
|
def valid?
|
|
104
135
|
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
105
136
|
return false if @type.nil?
|
|
137
|
+
type_validator = EnumAttributeValidator.new('String', ["subscription"])
|
|
138
|
+
return false unless type_validator.valid?(@type)
|
|
106
139
|
return false if @attributes.nil?
|
|
107
140
|
true
|
|
108
141
|
end
|
|
109
142
|
|
|
110
|
-
# Custom attribute writer method
|
|
111
|
-
# @param [Object] type
|
|
143
|
+
# Custom attribute writer method checking allowed values (enum).
|
|
144
|
+
# @param [Object] type Object to be assigned
|
|
112
145
|
def type=(type)
|
|
113
|
-
|
|
114
|
-
|
|
146
|
+
validator = EnumAttributeValidator.new('String', ["subscription"])
|
|
147
|
+
unless validator.valid?(type)
|
|
148
|
+
fail ArgumentError, "invalid value for \"type\", must be one of #{validator.allowable_values}."
|
|
115
149
|
end
|
|
116
|
-
|
|
117
150
|
@type = type
|
|
118
151
|
end
|
|
119
152
|
|
|
@@ -132,6 +165,7 @@ module SmplkitGeneratedClient::App
|
|
|
132
165
|
def ==(o)
|
|
133
166
|
return true if self.equal?(o)
|
|
134
167
|
self.class == o.class &&
|
|
168
|
+
id == o.id &&
|
|
135
169
|
type == o.type &&
|
|
136
170
|
attributes == o.attributes
|
|
137
171
|
end
|
|
@@ -145,7 +179,7 @@ module SmplkitGeneratedClient::App
|
|
|
145
179
|
# Calculates hash code according to all attributes.
|
|
146
180
|
# @return [Integer] Hash code
|
|
147
181
|
def hash
|
|
148
|
-
[type, attributes].hash
|
|
182
|
+
[id, type, attributes].hash
|
|
149
183
|
end
|
|
150
184
|
|
|
151
185
|
# Builds the object from hash
|
|
@@ -14,15 +14,15 @@ require 'date'
|
|
|
14
14
|
require 'time'
|
|
15
15
|
|
|
16
16
|
module SmplkitGeneratedClient::App
|
|
17
|
-
#
|
|
18
|
-
class
|
|
19
|
-
# Number of additional
|
|
17
|
+
# Hint describing how the customer could unlock a better discount.
|
|
18
|
+
class NextTierResponse < ApiModelBase
|
|
19
|
+
# Number of additional paid products required to reach the next discount tier.
|
|
20
20
|
attr_accessor :products_needed
|
|
21
21
|
|
|
22
22
|
# Discount percentage that would apply at the next tier.
|
|
23
23
|
attr_accessor :discount_pct
|
|
24
24
|
|
|
25
|
-
#
|
|
25
|
+
# Estimated additional monthly savings (in cents) at the next tier, compared to paying full list price for the added product.
|
|
26
26
|
attr_accessor :additional_savings_cents
|
|
27
27
|
|
|
28
28
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
@@ -63,14 +63,14 @@ module SmplkitGeneratedClient::App
|
|
|
63
63
|
# @param [Hash] attributes Model attributes in the form of hash
|
|
64
64
|
def initialize(attributes = {})
|
|
65
65
|
if (!attributes.is_a?(Hash))
|
|
66
|
-
fail ArgumentError, "The input argument (attributes) must be a hash in `SmplkitGeneratedClient::App::
|
|
66
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `SmplkitGeneratedClient::App::NextTierResponse` initialize method"
|
|
67
67
|
end
|
|
68
68
|
|
|
69
69
|
# check to see if the attribute exists and convert string to symbol for hash key
|
|
70
70
|
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
71
71
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
72
72
|
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
73
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `SmplkitGeneratedClient::App::
|
|
73
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `SmplkitGeneratedClient::App::NextTierResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
74
74
|
end
|
|
75
75
|
h[k.to_sym] = v
|
|
76
76
|
}
|