ultracart_api 4.1.229 → 4.1.230
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/README.md +21 -2
- data/docs/ItemAutoOrder.md +6 -0
- data/docs/SfvbApi.md +557 -1
- data/docs/SfvbCommsFolder.md +28 -0
- data/docs/SfvbCommsFolderItem.md +22 -0
- data/docs/SfvbCommsFolderResponse.md +22 -0
- data/docs/SfvbCommsFolderWriteRequest.md +18 -0
- data/docs/SfvbCommsFoldersResponse.md +18 -0
- data/docs/SfvbCommsListDetail.md +34 -0
- data/docs/SfvbCommsListResponse.md +20 -0
- data/docs/SfvbCommsListWriteRequest.md +24 -0
- data/docs/SfvbFlowWriteRequest.md +2 -2
- data/docs/SfvbSequenceStep.md +1 -1
- data/docs/SfvbStepCounts.md +1 -1
- data/lib/ultracart_api/api/sfvb_api.rb +785 -24
- data/lib/ultracart_api/models/item_auto_order.rb +35 -1
- data/lib/ultracart_api/models/sfvb_comms_folder.rb +270 -0
- data/lib/ultracart_api/models/sfvb_comms_folder_item.rb +240 -0
- data/lib/ultracart_api/models/sfvb_comms_folder_response.rb +243 -0
- data/lib/ultracart_api/models/sfvb_comms_folder_write_request.rb +220 -0
- data/lib/ultracart_api/models/sfvb_comms_folders_response.rb +222 -0
- data/lib/ultracart_api/models/sfvb_comms_list_detail.rb +302 -0
- data/lib/ultracart_api/models/sfvb_comms_list_response.rb +231 -0
- data/lib/ultracart_api/models/sfvb_comms_list_write_request.rb +250 -0
- data/lib/ultracart_api/models/sfvb_flow_write_request.rb +2 -2
- data/lib/ultracart_api/models/sfvb_sequence_step.rb +1 -1
- data/lib/ultracart_api/models/sfvb_step_counts.rb +1 -1
- data/lib/ultracart_api/version.rb +1 -1
- data/lib/ultracart_api.rb +8 -0
- metadata +18 -2
|
@@ -45,6 +45,15 @@ module UltracartClient
|
|
|
45
45
|
# List of downgrade items presented to customer service representatives
|
|
46
46
|
attr_accessor :auto_order_downgrade_items
|
|
47
47
|
|
|
48
|
+
# Day counts (1 to 365, at most 20) a customer may switch this auto-enrolled item to from MyAccount, for example [30, 60, 90]. Requires the advanced auto order settings to be enabled on the account. Omit to leave unchanged; send an empty array to clear.
|
|
49
|
+
attr_accessor :auto_order_myaccount_frequency_day_counts
|
|
50
|
+
|
|
51
|
+
# True if the MyAccount frequency change is only offered once the item is on its last auto order step. Omit to leave unchanged.
|
|
52
|
+
attr_accessor :auto_order_myaccount_frequency_last_step_only
|
|
53
|
+
|
|
54
|
+
# Standard schedules a customer may switch this auto-enrolled item to from MyAccount. Requires the advanced auto order settings to be enabled on the account. Omit to leave unchanged; send an empty array to clear.
|
|
55
|
+
attr_accessor :auto_order_myaccount_frequency_schedules
|
|
56
|
+
|
|
48
57
|
# True if the rebill processing of this item is paused
|
|
49
58
|
attr_accessor :auto_order_paused
|
|
50
59
|
|
|
@@ -94,6 +103,9 @@ module UltracartClient
|
|
|
94
103
|
:'auto_order_cancel_minimum_rebill_count' => :'auto_order_cancel_minimum_rebill_count',
|
|
95
104
|
:'auto_order_cancel_minimum_rebill_value' => :'auto_order_cancel_minimum_rebill_value',
|
|
96
105
|
:'auto_order_downgrade_items' => :'auto_order_downgrade_items',
|
|
106
|
+
:'auto_order_myaccount_frequency_day_counts' => :'auto_order_myaccount_frequency_day_counts',
|
|
107
|
+
:'auto_order_myaccount_frequency_last_step_only' => :'auto_order_myaccount_frequency_last_step_only',
|
|
108
|
+
:'auto_order_myaccount_frequency_schedules' => :'auto_order_myaccount_frequency_schedules',
|
|
97
109
|
:'auto_order_paused' => :'auto_order_paused',
|
|
98
110
|
:'auto_order_prohibit_expiring_cards' => :'auto_order_prohibit_expiring_cards',
|
|
99
111
|
:'auto_order_schedules' => :'auto_order_schedules',
|
|
@@ -127,6 +139,9 @@ module UltracartClient
|
|
|
127
139
|
:'auto_order_cancel_minimum_rebill_count' => :'Integer',
|
|
128
140
|
:'auto_order_cancel_minimum_rebill_value' => :'Float',
|
|
129
141
|
:'auto_order_downgrade_items' => :'Array<String>',
|
|
142
|
+
:'auto_order_myaccount_frequency_day_counts' => :'Array<Integer>',
|
|
143
|
+
:'auto_order_myaccount_frequency_last_step_only' => :'Boolean',
|
|
144
|
+
:'auto_order_myaccount_frequency_schedules' => :'Array<String>',
|
|
130
145
|
:'auto_order_paused' => :'Boolean',
|
|
131
146
|
:'auto_order_prohibit_expiring_cards' => :'Integer',
|
|
132
147
|
:'auto_order_schedules' => :'Array<String>',
|
|
@@ -205,6 +220,22 @@ module UltracartClient
|
|
|
205
220
|
end
|
|
206
221
|
end
|
|
207
222
|
|
|
223
|
+
if attributes.key?(:'auto_order_myaccount_frequency_day_counts')
|
|
224
|
+
if (value = attributes[:'auto_order_myaccount_frequency_day_counts']).is_a?(Array)
|
|
225
|
+
self.auto_order_myaccount_frequency_day_counts = value
|
|
226
|
+
end
|
|
227
|
+
end
|
|
228
|
+
|
|
229
|
+
if attributes.key?(:'auto_order_myaccount_frequency_last_step_only')
|
|
230
|
+
self.auto_order_myaccount_frequency_last_step_only = attributes[:'auto_order_myaccount_frequency_last_step_only']
|
|
231
|
+
end
|
|
232
|
+
|
|
233
|
+
if attributes.key?(:'auto_order_myaccount_frequency_schedules')
|
|
234
|
+
if (value = attributes[:'auto_order_myaccount_frequency_schedules']).is_a?(Array)
|
|
235
|
+
self.auto_order_myaccount_frequency_schedules = value
|
|
236
|
+
end
|
|
237
|
+
end
|
|
238
|
+
|
|
208
239
|
if attributes.key?(:'auto_order_paused')
|
|
209
240
|
self.auto_order_paused = attributes[:'auto_order_paused']
|
|
210
241
|
end
|
|
@@ -303,6 +334,9 @@ module UltracartClient
|
|
|
303
334
|
auto_order_cancel_minimum_rebill_count == o.auto_order_cancel_minimum_rebill_count &&
|
|
304
335
|
auto_order_cancel_minimum_rebill_value == o.auto_order_cancel_minimum_rebill_value &&
|
|
305
336
|
auto_order_downgrade_items == o.auto_order_downgrade_items &&
|
|
337
|
+
auto_order_myaccount_frequency_day_counts == o.auto_order_myaccount_frequency_day_counts &&
|
|
338
|
+
auto_order_myaccount_frequency_last_step_only == o.auto_order_myaccount_frequency_last_step_only &&
|
|
339
|
+
auto_order_myaccount_frequency_schedules == o.auto_order_myaccount_frequency_schedules &&
|
|
306
340
|
auto_order_paused == o.auto_order_paused &&
|
|
307
341
|
auto_order_prohibit_expiring_cards == o.auto_order_prohibit_expiring_cards &&
|
|
308
342
|
auto_order_schedules == o.auto_order_schedules &&
|
|
@@ -326,7 +360,7 @@ module UltracartClient
|
|
|
326
360
|
# Calculates hash code according to all attributes.
|
|
327
361
|
# @return [Integer] Hash code
|
|
328
362
|
def hash
|
|
329
|
-
[auth_future_amount, auth_test_amount, auto_order_cancel_charge_minimum_balance, auto_order_cancel_item_id, auto_order_cancel_item_oid, auto_order_cancel_minimum_life_time_count, auto_order_cancel_minimum_life_time_value, auto_order_cancel_minimum_rebill_count, auto_order_cancel_minimum_rebill_value, auto_order_downgrade_items, auto_order_paused, auto_order_prohibit_expiring_cards, auto_order_schedules, auto_order_upgrade_items, auto_order_upsell, auto_order_upsell_no_easy_cancel, auto_order_upsell_one_per_customer, auto_orderable, cancel_other_auto_orders, free_shipping_auto_order, refund_other_auto_orders, steps].hash
|
|
363
|
+
[auth_future_amount, auth_test_amount, auto_order_cancel_charge_minimum_balance, auto_order_cancel_item_id, auto_order_cancel_item_oid, auto_order_cancel_minimum_life_time_count, auto_order_cancel_minimum_life_time_value, auto_order_cancel_minimum_rebill_count, auto_order_cancel_minimum_rebill_value, auto_order_downgrade_items, auto_order_myaccount_frequency_day_counts, auto_order_myaccount_frequency_last_step_only, auto_order_myaccount_frequency_schedules, auto_order_paused, auto_order_prohibit_expiring_cards, auto_order_schedules, auto_order_upgrade_items, auto_order_upsell, auto_order_upsell_no_easy_cancel, auto_order_upsell_one_per_customer, auto_orderable, cancel_other_auto_orders, free_shipping_auto_order, refund_other_auto_orders, steps].hash
|
|
330
364
|
end
|
|
331
365
|
|
|
332
366
|
# Builds the object from hash
|
|
@@ -0,0 +1,270 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#UltraCart Rest API V2
|
|
3
|
+
|
|
4
|
+
#UltraCart REST API Version 2
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: 2.0.0
|
|
7
|
+
Contact: support@ultracart.com
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
OpenAPI Generator version: 6.0.1-SNAPSHOT
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'date'
|
|
14
|
+
require 'time'
|
|
15
|
+
|
|
16
|
+
module UltracartClient
|
|
17
|
+
class SfvbCommsFolder
|
|
18
|
+
# The folder uuid.
|
|
19
|
+
attr_accessor :folder_uuid
|
|
20
|
+
|
|
21
|
+
# The hash of the name. Send it as If-Match to rename or delete the folder.
|
|
22
|
+
attr_accessor :hash_sha256
|
|
23
|
+
|
|
24
|
+
# How many lists are filed in it.
|
|
25
|
+
attr_accessor :list_count
|
|
26
|
+
|
|
27
|
+
# The folder name.
|
|
28
|
+
attr_accessor :name
|
|
29
|
+
|
|
30
|
+
# How many segments are filed in it.
|
|
31
|
+
attr_accessor :segment_count
|
|
32
|
+
|
|
33
|
+
# True for a folder the admin manages, which can't be renamed or deleted here.
|
|
34
|
+
attr_accessor :system_generated
|
|
35
|
+
|
|
36
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
37
|
+
def self.attribute_map
|
|
38
|
+
{
|
|
39
|
+
:'folder_uuid' => :'folder_uuid',
|
|
40
|
+
:'hash_sha256' => :'hash_sha256',
|
|
41
|
+
:'list_count' => :'list_count',
|
|
42
|
+
:'name' => :'name',
|
|
43
|
+
:'segment_count' => :'segment_count',
|
|
44
|
+
:'system_generated' => :'system_generated'
|
|
45
|
+
}
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
# Returns all the JSON keys this model knows about
|
|
49
|
+
def self.acceptable_attributes
|
|
50
|
+
attribute_map.values
|
|
51
|
+
end
|
|
52
|
+
|
|
53
|
+
# Attribute type mapping.
|
|
54
|
+
def self.openapi_types
|
|
55
|
+
{
|
|
56
|
+
:'folder_uuid' => :'String',
|
|
57
|
+
:'hash_sha256' => :'String',
|
|
58
|
+
:'list_count' => :'Integer',
|
|
59
|
+
:'name' => :'String',
|
|
60
|
+
:'segment_count' => :'Integer',
|
|
61
|
+
:'system_generated' => :'Boolean'
|
|
62
|
+
}
|
|
63
|
+
end
|
|
64
|
+
|
|
65
|
+
# List of attributes with nullable: true
|
|
66
|
+
def self.openapi_nullable
|
|
67
|
+
Set.new([
|
|
68
|
+
])
|
|
69
|
+
end
|
|
70
|
+
|
|
71
|
+
# Initializes the object
|
|
72
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
73
|
+
def initialize(attributes = {})
|
|
74
|
+
if (!attributes.is_a?(Hash))
|
|
75
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `UltracartClient::SfvbCommsFolder` initialize method"
|
|
76
|
+
end
|
|
77
|
+
|
|
78
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
79
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
80
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
|
81
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `UltracartClient::SfvbCommsFolder`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
|
82
|
+
end
|
|
83
|
+
h[k.to_sym] = v
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
if attributes.key?(:'folder_uuid')
|
|
87
|
+
self.folder_uuid = attributes[:'folder_uuid']
|
|
88
|
+
end
|
|
89
|
+
|
|
90
|
+
if attributes.key?(:'hash_sha256')
|
|
91
|
+
self.hash_sha256 = attributes[:'hash_sha256']
|
|
92
|
+
end
|
|
93
|
+
|
|
94
|
+
if attributes.key?(:'list_count')
|
|
95
|
+
self.list_count = attributes[:'list_count']
|
|
96
|
+
end
|
|
97
|
+
|
|
98
|
+
if attributes.key?(:'name')
|
|
99
|
+
self.name = attributes[:'name']
|
|
100
|
+
end
|
|
101
|
+
|
|
102
|
+
if attributes.key?(:'segment_count')
|
|
103
|
+
self.segment_count = attributes[:'segment_count']
|
|
104
|
+
end
|
|
105
|
+
|
|
106
|
+
if attributes.key?(:'system_generated')
|
|
107
|
+
self.system_generated = attributes[:'system_generated']
|
|
108
|
+
end
|
|
109
|
+
end
|
|
110
|
+
|
|
111
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
112
|
+
# @return Array for valid properties with the reasons
|
|
113
|
+
def list_invalid_properties
|
|
114
|
+
invalid_properties = Array.new
|
|
115
|
+
invalid_properties
|
|
116
|
+
end
|
|
117
|
+
|
|
118
|
+
# Check to see if the all the properties in the model are valid
|
|
119
|
+
# @return true if the model is valid
|
|
120
|
+
def valid?
|
|
121
|
+
true
|
|
122
|
+
end
|
|
123
|
+
|
|
124
|
+
# Checks equality by comparing each attribute.
|
|
125
|
+
# @param [Object] Object to be compared
|
|
126
|
+
def ==(o)
|
|
127
|
+
return true if self.equal?(o)
|
|
128
|
+
self.class == o.class &&
|
|
129
|
+
folder_uuid == o.folder_uuid &&
|
|
130
|
+
hash_sha256 == o.hash_sha256 &&
|
|
131
|
+
list_count == o.list_count &&
|
|
132
|
+
name == o.name &&
|
|
133
|
+
segment_count == o.segment_count &&
|
|
134
|
+
system_generated == o.system_generated
|
|
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
|
+
[folder_uuid, hash_sha256, list_count, name, segment_count, system_generated].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
|
+
new.build_from_hash(attributes)
|
|
154
|
+
end
|
|
155
|
+
|
|
156
|
+
# Builds the object from hash
|
|
157
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
158
|
+
# @return [Object] Returns the model itself
|
|
159
|
+
def build_from_hash(attributes)
|
|
160
|
+
return nil unless attributes.is_a?(Hash)
|
|
161
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
162
|
+
self.class.openapi_types.each_pair do |key, type|
|
|
163
|
+
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
|
164
|
+
self.send("#{key}=", nil)
|
|
165
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
166
|
+
# check to ensure the input is an array given that the attribute
|
|
167
|
+
# is documented as an array but the input is not
|
|
168
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
|
169
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
|
170
|
+
end
|
|
171
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
|
172
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
|
173
|
+
end
|
|
174
|
+
end
|
|
175
|
+
|
|
176
|
+
self
|
|
177
|
+
end
|
|
178
|
+
|
|
179
|
+
# Deserializes the data based on type
|
|
180
|
+
# @param string type Data type
|
|
181
|
+
# @param string value Value to be deserialized
|
|
182
|
+
# @return [Object] Deserialized data
|
|
183
|
+
def _deserialize(type, value)
|
|
184
|
+
case type.to_sym
|
|
185
|
+
when :Time
|
|
186
|
+
Time.parse(value)
|
|
187
|
+
when :Date
|
|
188
|
+
Date.parse(value)
|
|
189
|
+
when :String
|
|
190
|
+
value.to_s
|
|
191
|
+
when :Integer
|
|
192
|
+
value.to_i
|
|
193
|
+
when :Float
|
|
194
|
+
value.to_f
|
|
195
|
+
when :Boolean
|
|
196
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
197
|
+
true
|
|
198
|
+
else
|
|
199
|
+
false
|
|
200
|
+
end
|
|
201
|
+
when :Object
|
|
202
|
+
# generic object (usually a Hash), return directly
|
|
203
|
+
value
|
|
204
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
|
205
|
+
inner_type = Regexp.last_match[:inner_type]
|
|
206
|
+
value.map { |v| _deserialize(inner_type, v) }
|
|
207
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
208
|
+
k_type = Regexp.last_match[:k_type]
|
|
209
|
+
v_type = Regexp.last_match[:v_type]
|
|
210
|
+
{}.tap do |hash|
|
|
211
|
+
value.each do |k, v|
|
|
212
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
213
|
+
end
|
|
214
|
+
end
|
|
215
|
+
else # model
|
|
216
|
+
# models (e.g. Pet) or oneOf
|
|
217
|
+
klass = UltracartClient.const_get(type)
|
|
218
|
+
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
219
|
+
end
|
|
220
|
+
end
|
|
221
|
+
|
|
222
|
+
# Returns the string representation of the object
|
|
223
|
+
# @return [String] String presentation of the object
|
|
224
|
+
def to_s
|
|
225
|
+
to_hash.to_s
|
|
226
|
+
end
|
|
227
|
+
|
|
228
|
+
# to_body is an alias to to_hash (backward compatibility)
|
|
229
|
+
# @return [Hash] Returns the object in the form of hash
|
|
230
|
+
def to_body
|
|
231
|
+
to_hash
|
|
232
|
+
end
|
|
233
|
+
|
|
234
|
+
# Returns the object in the form of hash
|
|
235
|
+
# @return [Hash] Returns the object in the form of hash
|
|
236
|
+
def to_hash
|
|
237
|
+
hash = {}
|
|
238
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
239
|
+
value = self.send(attr)
|
|
240
|
+
if value.nil?
|
|
241
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
242
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
243
|
+
end
|
|
244
|
+
|
|
245
|
+
hash[param] = _to_hash(value)
|
|
246
|
+
end
|
|
247
|
+
hash
|
|
248
|
+
end
|
|
249
|
+
|
|
250
|
+
# Outputs non-array value in the form of hash
|
|
251
|
+
# For object, use to_hash. Otherwise, just return the value
|
|
252
|
+
# @param [Object] value Any valid value
|
|
253
|
+
# @return [Hash] Returns the value in the form of hash
|
|
254
|
+
def _to_hash(value)
|
|
255
|
+
if value.is_a?(Array)
|
|
256
|
+
value.compact.map { |v| _to_hash(v) }
|
|
257
|
+
elsif value.is_a?(Hash)
|
|
258
|
+
{}.tap do |hash|
|
|
259
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
260
|
+
end
|
|
261
|
+
elsif value.respond_to? :to_hash
|
|
262
|
+
value.to_hash
|
|
263
|
+
else
|
|
264
|
+
value
|
|
265
|
+
end
|
|
266
|
+
end
|
|
267
|
+
|
|
268
|
+
end
|
|
269
|
+
|
|
270
|
+
end
|
|
@@ -0,0 +1,240 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#UltraCart Rest API V2
|
|
3
|
+
|
|
4
|
+
#UltraCart REST API Version 2
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: 2.0.0
|
|
7
|
+
Contact: support@ultracart.com
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
OpenAPI Generator version: 6.0.1-SNAPSHOT
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'date'
|
|
14
|
+
require 'time'
|
|
15
|
+
|
|
16
|
+
module UltracartClient
|
|
17
|
+
class SfvbCommsFolderItem
|
|
18
|
+
# The list or segment name.
|
|
19
|
+
attr_accessor :name
|
|
20
|
+
|
|
21
|
+
# list or segment.
|
|
22
|
+
attr_accessor :type
|
|
23
|
+
|
|
24
|
+
# The list or segment uuid.
|
|
25
|
+
attr_accessor :uuid
|
|
26
|
+
|
|
27
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
28
|
+
def self.attribute_map
|
|
29
|
+
{
|
|
30
|
+
:'name' => :'name',
|
|
31
|
+
:'type' => :'type',
|
|
32
|
+
:'uuid' => :'uuid'
|
|
33
|
+
}
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
# Returns all the JSON keys this model knows about
|
|
37
|
+
def self.acceptable_attributes
|
|
38
|
+
attribute_map.values
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
# Attribute type mapping.
|
|
42
|
+
def self.openapi_types
|
|
43
|
+
{
|
|
44
|
+
:'name' => :'String',
|
|
45
|
+
:'type' => :'String',
|
|
46
|
+
:'uuid' => :'String'
|
|
47
|
+
}
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
# List of attributes with nullable: true
|
|
51
|
+
def self.openapi_nullable
|
|
52
|
+
Set.new([
|
|
53
|
+
])
|
|
54
|
+
end
|
|
55
|
+
|
|
56
|
+
# Initializes the object
|
|
57
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
58
|
+
def initialize(attributes = {})
|
|
59
|
+
if (!attributes.is_a?(Hash))
|
|
60
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `UltracartClient::SfvbCommsFolderItem` initialize method"
|
|
61
|
+
end
|
|
62
|
+
|
|
63
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
64
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
65
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
|
66
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `UltracartClient::SfvbCommsFolderItem`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
|
67
|
+
end
|
|
68
|
+
h[k.to_sym] = v
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
if attributes.key?(:'name')
|
|
72
|
+
self.name = attributes[:'name']
|
|
73
|
+
end
|
|
74
|
+
|
|
75
|
+
if attributes.key?(:'type')
|
|
76
|
+
self.type = attributes[:'type']
|
|
77
|
+
end
|
|
78
|
+
|
|
79
|
+
if attributes.key?(:'uuid')
|
|
80
|
+
self.uuid = attributes[:'uuid']
|
|
81
|
+
end
|
|
82
|
+
end
|
|
83
|
+
|
|
84
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
85
|
+
# @return Array for valid properties with the reasons
|
|
86
|
+
def list_invalid_properties
|
|
87
|
+
invalid_properties = Array.new
|
|
88
|
+
invalid_properties
|
|
89
|
+
end
|
|
90
|
+
|
|
91
|
+
# Check to see if the all the properties in the model are valid
|
|
92
|
+
# @return true if the model is valid
|
|
93
|
+
def valid?
|
|
94
|
+
true
|
|
95
|
+
end
|
|
96
|
+
|
|
97
|
+
# Checks equality by comparing each attribute.
|
|
98
|
+
# @param [Object] Object to be compared
|
|
99
|
+
def ==(o)
|
|
100
|
+
return true if self.equal?(o)
|
|
101
|
+
self.class == o.class &&
|
|
102
|
+
name == o.name &&
|
|
103
|
+
type == o.type &&
|
|
104
|
+
uuid == o.uuid
|
|
105
|
+
end
|
|
106
|
+
|
|
107
|
+
# @see the `==` method
|
|
108
|
+
# @param [Object] Object to be compared
|
|
109
|
+
def eql?(o)
|
|
110
|
+
self == o
|
|
111
|
+
end
|
|
112
|
+
|
|
113
|
+
# Calculates hash code according to all attributes.
|
|
114
|
+
# @return [Integer] Hash code
|
|
115
|
+
def hash
|
|
116
|
+
[name, type, uuid].hash
|
|
117
|
+
end
|
|
118
|
+
|
|
119
|
+
# Builds the object from hash
|
|
120
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
121
|
+
# @return [Object] Returns the model itself
|
|
122
|
+
def self.build_from_hash(attributes)
|
|
123
|
+
new.build_from_hash(attributes)
|
|
124
|
+
end
|
|
125
|
+
|
|
126
|
+
# Builds the object from hash
|
|
127
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
128
|
+
# @return [Object] Returns the model itself
|
|
129
|
+
def build_from_hash(attributes)
|
|
130
|
+
return nil unless attributes.is_a?(Hash)
|
|
131
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
132
|
+
self.class.openapi_types.each_pair do |key, type|
|
|
133
|
+
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
|
134
|
+
self.send("#{key}=", nil)
|
|
135
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
136
|
+
# check to ensure the input is an array given that the attribute
|
|
137
|
+
# is documented as an array but the input is not
|
|
138
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
|
139
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
|
140
|
+
end
|
|
141
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
|
142
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
|
143
|
+
end
|
|
144
|
+
end
|
|
145
|
+
|
|
146
|
+
self
|
|
147
|
+
end
|
|
148
|
+
|
|
149
|
+
# Deserializes the data based on type
|
|
150
|
+
# @param string type Data type
|
|
151
|
+
# @param string value Value to be deserialized
|
|
152
|
+
# @return [Object] Deserialized data
|
|
153
|
+
def _deserialize(type, value)
|
|
154
|
+
case type.to_sym
|
|
155
|
+
when :Time
|
|
156
|
+
Time.parse(value)
|
|
157
|
+
when :Date
|
|
158
|
+
Date.parse(value)
|
|
159
|
+
when :String
|
|
160
|
+
value.to_s
|
|
161
|
+
when :Integer
|
|
162
|
+
value.to_i
|
|
163
|
+
when :Float
|
|
164
|
+
value.to_f
|
|
165
|
+
when :Boolean
|
|
166
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
167
|
+
true
|
|
168
|
+
else
|
|
169
|
+
false
|
|
170
|
+
end
|
|
171
|
+
when :Object
|
|
172
|
+
# generic object (usually a Hash), return directly
|
|
173
|
+
value
|
|
174
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
|
175
|
+
inner_type = Regexp.last_match[:inner_type]
|
|
176
|
+
value.map { |v| _deserialize(inner_type, v) }
|
|
177
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
178
|
+
k_type = Regexp.last_match[:k_type]
|
|
179
|
+
v_type = Regexp.last_match[:v_type]
|
|
180
|
+
{}.tap do |hash|
|
|
181
|
+
value.each do |k, v|
|
|
182
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
183
|
+
end
|
|
184
|
+
end
|
|
185
|
+
else # model
|
|
186
|
+
# models (e.g. Pet) or oneOf
|
|
187
|
+
klass = UltracartClient.const_get(type)
|
|
188
|
+
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
189
|
+
end
|
|
190
|
+
end
|
|
191
|
+
|
|
192
|
+
# Returns the string representation of the object
|
|
193
|
+
# @return [String] String presentation of the object
|
|
194
|
+
def to_s
|
|
195
|
+
to_hash.to_s
|
|
196
|
+
end
|
|
197
|
+
|
|
198
|
+
# to_body is an alias to to_hash (backward compatibility)
|
|
199
|
+
# @return [Hash] Returns the object in the form of hash
|
|
200
|
+
def to_body
|
|
201
|
+
to_hash
|
|
202
|
+
end
|
|
203
|
+
|
|
204
|
+
# Returns the object in the form of hash
|
|
205
|
+
# @return [Hash] Returns the object in the form of hash
|
|
206
|
+
def to_hash
|
|
207
|
+
hash = {}
|
|
208
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
209
|
+
value = self.send(attr)
|
|
210
|
+
if value.nil?
|
|
211
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
212
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
213
|
+
end
|
|
214
|
+
|
|
215
|
+
hash[param] = _to_hash(value)
|
|
216
|
+
end
|
|
217
|
+
hash
|
|
218
|
+
end
|
|
219
|
+
|
|
220
|
+
# Outputs non-array value in the form of hash
|
|
221
|
+
# For object, use to_hash. Otherwise, just return the value
|
|
222
|
+
# @param [Object] value Any valid value
|
|
223
|
+
# @return [Hash] Returns the value in the form of hash
|
|
224
|
+
def _to_hash(value)
|
|
225
|
+
if value.is_a?(Array)
|
|
226
|
+
value.compact.map { |v| _to_hash(v) }
|
|
227
|
+
elsif value.is_a?(Hash)
|
|
228
|
+
{}.tap do |hash|
|
|
229
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
230
|
+
end
|
|
231
|
+
elsif value.respond_to? :to_hash
|
|
232
|
+
value.to_hash
|
|
233
|
+
else
|
|
234
|
+
value
|
|
235
|
+
end
|
|
236
|
+
end
|
|
237
|
+
|
|
238
|
+
end
|
|
239
|
+
|
|
240
|
+
end
|