ultracart_api 4.1.229 → 4.1.231

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 (59) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +38 -2
  3. data/docs/ItemAutoOrder.md +6 -0
  4. data/docs/SfvbApi.md +846 -3
  5. data/docs/SfvbApprovalCreateRequest.md +3 -1
  6. data/docs/SfvbCampaign.md +2 -0
  7. data/docs/SfvbCommsFolder.md +28 -0
  8. data/docs/SfvbCommsFolderItem.md +22 -0
  9. data/docs/SfvbCommsFolderResponse.md +22 -0
  10. data/docs/SfvbCommsFolderWriteRequest.md +18 -0
  11. data/docs/SfvbCommsFoldersResponse.md +18 -0
  12. data/docs/SfvbCommsListDetail.md +34 -0
  13. data/docs/SfvbCommsListResponse.md +20 -0
  14. data/docs/SfvbCommsListWriteRequest.md +24 -0
  15. data/docs/SfvbCommsMember.md +22 -0
  16. data/docs/SfvbCommsMembersResponse.md +36 -0
  17. data/docs/SfvbFlow.md +2 -0
  18. data/docs/SfvbFlowWriteRequest.md +2 -2
  19. data/docs/SfvbPostcardAddress.md +28 -0
  20. data/docs/SfvbPostcardCard.md +40 -0
  21. data/docs/SfvbPostcardTrackingResponse.md +34 -0
  22. data/docs/SfvbSequenceStep.md +1 -1
  23. data/docs/SfvbStepCounts.md +1 -1
  24. data/docs/SfvbTransactionalChange.md +24 -0
  25. data/docs/SfvbTransactionalDeliveryOption.md +22 -0
  26. data/docs/SfvbTransactionalEmailDetail.md +30 -0
  27. data/docs/SfvbTransactionalEmailResponse.md +24 -0
  28. data/docs/SfvbTransactionalEmailUpdateRequest.md +28 -0
  29. data/docs/SfvbTransactionalSender.md +24 -0
  30. data/lib/ultracart_api/api/sfvb_api.rb +1220 -61
  31. data/lib/ultracart_api/models/item_auto_order.rb +35 -1
  32. data/lib/ultracart_api/models/sfvb_approval_create_request.rb +15 -6
  33. data/lib/ultracart_api/models/sfvb_campaign.rb +11 -1
  34. data/lib/ultracart_api/models/sfvb_comms_folder.rb +270 -0
  35. data/lib/ultracart_api/models/sfvb_comms_folder_item.rb +240 -0
  36. data/lib/ultracart_api/models/sfvb_comms_folder_response.rb +243 -0
  37. data/lib/ultracart_api/models/sfvb_comms_folder_write_request.rb +220 -0
  38. data/lib/ultracart_api/models/sfvb_comms_folders_response.rb +222 -0
  39. data/lib/ultracart_api/models/sfvb_comms_list_detail.rb +302 -0
  40. data/lib/ultracart_api/models/sfvb_comms_list_response.rb +231 -0
  41. data/lib/ultracart_api/models/sfvb_comms_list_write_request.rb +250 -0
  42. data/lib/ultracart_api/models/sfvb_comms_member.rb +240 -0
  43. data/lib/ultracart_api/models/sfvb_comms_members_response.rb +314 -0
  44. data/lib/ultracart_api/models/sfvb_flow.rb +11 -1
  45. data/lib/ultracart_api/models/sfvb_flow_write_request.rb +2 -2
  46. data/lib/ultracart_api/models/sfvb_postcard_address.rb +270 -0
  47. data/lib/ultracart_api/models/sfvb_postcard_card.rb +328 -0
  48. data/lib/ultracart_api/models/sfvb_postcard_tracking_response.rb +304 -0
  49. data/lib/ultracart_api/models/sfvb_sequence_step.rb +1 -1
  50. data/lib/ultracart_api/models/sfvb_step_counts.rb +1 -1
  51. data/lib/ultracart_api/models/sfvb_transactional_change.rb +250 -0
  52. data/lib/ultracart_api/models/sfvb_transactional_delivery_option.rb +240 -0
  53. data/lib/ultracart_api/models/sfvb_transactional_email_detail.rb +283 -0
  54. data/lib/ultracart_api/models/sfvb_transactional_email_response.rb +253 -0
  55. data/lib/ultracart_api/models/sfvb_transactional_email_update_request.rb +272 -0
  56. data/lib/ultracart_api/models/sfvb_transactional_sender.rb +250 -0
  57. data/lib/ultracart_api/version.rb +1 -1
  58. data/lib/ultracart_api.rb +19 -0
  59. metadata +40 -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. If auto_order_myaccount_frequency_schedules or auto_order_myaccount_frequency_day_counts is sent without this property, it is set to false; if none of the three are sent, it is left 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
@@ -46,6 +46,8 @@ module UltracartClient
46
46
 
47
47
  attr_accessor :tracking_provider
48
48
 
49
+ attr_accessor :transactional_email
50
+
49
51
  class EnumAttributeValidator
50
52
  attr_reader :datatype
51
53
  attr_reader :allowable_values
@@ -83,7 +85,8 @@ module UltracartClient
83
85
  :'segment_update' => :'segment_update',
84
86
  :'site_seo' => :'site_seo',
85
87
  :'smart_attribution' => :'smart_attribution',
86
- :'tracking_provider' => :'tracking_provider'
88
+ :'tracking_provider' => :'tracking_provider',
89
+ :'transactional_email' => :'transactional_email'
87
90
  }
88
91
  end
89
92
 
@@ -107,7 +110,8 @@ module UltracartClient
107
110
  :'segment_update' => :'SfvbCommsSegmentWriteRequest',
108
111
  :'site_seo' => :'SfvbSiteSeoRequest',
109
112
  :'smart_attribution' => :'SfvbSmartAttributionRequest',
110
- :'tracking_provider' => :'SfvbTrackingProviderRequest'
113
+ :'tracking_provider' => :'SfvbTrackingProviderRequest',
114
+ :'transactional_email' => :'SfvbTransactionalEmailUpdateRequest'
111
115
  }
112
116
  end
113
117
 
@@ -187,6 +191,10 @@ module UltracartClient
187
191
  if attributes.key?(:'tracking_provider')
188
192
  self.tracking_provider = attributes[:'tracking_provider']
189
193
  end
194
+
195
+ if attributes.key?(:'transactional_email')
196
+ self.transactional_email = attributes[:'transactional_email']
197
+ end
190
198
  end
191
199
 
192
200
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -199,7 +207,7 @@ module UltracartClient
199
207
  # Check to see if the all the properties in the model are valid
200
208
  # @return true if the model is valid
201
209
  def valid?
202
- action_validator = EnumAttributeValidator.new('String', ["file.delete", "blog_post.delete", "file.put_script", "redirect.delete_batch", "experiment.start", "experiment.end", "upsell.enable", "item.attribute_batch", "item.pricing", "twilio_account.delete", "sending_domain.delete", "sequence_step.delete", "sequence_step.move", "sequence_step.enable_postcard", "segment.update", "smart_attribution.change", "smart_attribution.delete", "tracking_provider.change", "tracking_html.put", "affiliate_network.change", "affiliate_network.delete", "site_seo.change"])
210
+ action_validator = EnumAttributeValidator.new('String', ["file.delete", "blog_post.delete", "file.put_script", "redirect.delete_batch", "experiment.start", "experiment.end", "upsell.enable", "item.attribute_batch", "item.pricing", "twilio_account.delete", "sending_domain.delete", "sequence_step.delete", "sequence_step.move", "sequence_step.enable_postcard", "segment.update", "smart_attribution.change", "smart_attribution.delete", "tracking_provider.change", "tracking_html.put", "affiliate_network.change", "affiliate_network.delete", "site_seo.change", "transactional_email.update"])
203
211
  return false unless action_validator.valid?(@action)
204
212
  true
205
213
  end
@@ -207,7 +215,7 @@ module UltracartClient
207
215
  # Custom attribute writer method checking allowed values (enum).
208
216
  # @param [Object] action Object to be assigned
209
217
  def action=(action)
210
- validator = EnumAttributeValidator.new('String', ["file.delete", "blog_post.delete", "file.put_script", "redirect.delete_batch", "experiment.start", "experiment.end", "upsell.enable", "item.attribute_batch", "item.pricing", "twilio_account.delete", "sending_domain.delete", "sequence_step.delete", "sequence_step.move", "sequence_step.enable_postcard", "segment.update", "smart_attribution.change", "smart_attribution.delete", "tracking_provider.change", "tracking_html.put", "affiliate_network.change", "affiliate_network.delete", "site_seo.change"])
218
+ validator = EnumAttributeValidator.new('String', ["file.delete", "blog_post.delete", "file.put_script", "redirect.delete_batch", "experiment.start", "experiment.end", "upsell.enable", "item.attribute_batch", "item.pricing", "twilio_account.delete", "sending_domain.delete", "sequence_step.delete", "sequence_step.move", "sequence_step.enable_postcard", "segment.update", "smart_attribution.change", "smart_attribution.delete", "tracking_provider.change", "tracking_html.put", "affiliate_network.change", "affiliate_network.delete", "site_seo.change", "transactional_email.update"])
211
219
  unless validator.valid?(action)
212
220
  fail ArgumentError, "invalid value for \"action\", must be one of #{validator.allowable_values}."
213
221
  end
@@ -231,7 +239,8 @@ module UltracartClient
231
239
  segment_update == o.segment_update &&
232
240
  site_seo == o.site_seo &&
233
241
  smart_attribution == o.smart_attribution &&
234
- tracking_provider == o.tracking_provider
242
+ tracking_provider == o.tracking_provider &&
243
+ transactional_email == o.transactional_email
235
244
  end
236
245
 
237
246
  # @see the `==` method
@@ -243,7 +252,7 @@ module UltracartClient
243
252
  # Calculates hash code according to all attributes.
244
253
  # @return [Integer] Hash code
245
254
  def hash
246
- [action, affiliate_network, content, experiment_start, item_attribute_rows, item_pricing, params, reason, redirect_rows, segment_update, site_seo, smart_attribution, tracking_provider].hash
255
+ [action, affiliate_network, content, experiment_start, item_attribute_rows, item_pricing, params, reason, redirect_rows, segment_update, site_seo, smart_attribution, tracking_provider, transactional_email].hash
247
256
  end
248
257
 
249
258
  # Builds the object from hash
@@ -66,6 +66,9 @@ module UltracartClient
66
66
  # The part of the from address before the at sign. Defaults to the storefront's marketing setting.
67
67
  attr_accessor :sending_user
68
68
 
69
+ # The number this campaign's SMS steps send from. Without one, every SMS step skips every customer, whatever the account's SMS settings say.
70
+ attr_accessor :sms_phone_number
71
+
69
72
  # The status, such as draft, scheduled, sending, sent or archived.
70
73
  attr_accessor :status
71
74
 
@@ -92,6 +95,7 @@ module UltracartClient
92
95
  :'sending_domain_uuid' => :'sending_domain_uuid',
93
96
  :'sending_name' => :'sending_name',
94
97
  :'sending_user' => :'sending_user',
98
+ :'sms_phone_number' => :'sms_phone_number',
95
99
  :'status' => :'status',
96
100
  :'status_dts' => :'status_dts'
97
101
  }
@@ -122,6 +126,7 @@ module UltracartClient
122
126
  :'sending_domain_uuid' => :'String',
123
127
  :'sending_name' => :'String',
124
128
  :'sending_user' => :'String',
129
+ :'sms_phone_number' => :'String',
125
130
  :'status' => :'String',
126
131
  :'status_dts' => :'String'
127
132
  }
@@ -224,6 +229,10 @@ module UltracartClient
224
229
  self.sending_user = attributes[:'sending_user']
225
230
  end
226
231
 
232
+ if attributes.key?(:'sms_phone_number')
233
+ self.sms_phone_number = attributes[:'sms_phone_number']
234
+ end
235
+
227
236
  if attributes.key?(:'status')
228
237
  self.status = attributes[:'status']
229
238
  end
@@ -268,6 +277,7 @@ module UltracartClient
268
277
  sending_domain_uuid == o.sending_domain_uuid &&
269
278
  sending_name == o.sending_name &&
270
279
  sending_user == o.sending_user &&
280
+ sms_phone_number == o.sms_phone_number &&
271
281
  status == o.status &&
272
282
  status_dts == o.status_dts
273
283
  end
@@ -281,7 +291,7 @@ module UltracartClient
281
291
  # Calculates hash code according to all attributes.
282
292
  # @return [Integer] Hash code
283
293
  def hash
284
- [campaign_uuid, communication_sequence_uuid, created_dts, deleted, emails, end_once_customer_purchases, end_once_customer_purchases_anywhere, hash_sha256, live, memberships, name, notes, postcards, scheduled_dts, sending_domain_uuid, sending_name, sending_user, status, status_dts].hash
294
+ [campaign_uuid, communication_sequence_uuid, created_dts, deleted, emails, end_once_customer_purchases, end_once_customer_purchases_anywhere, hash_sha256, live, memberships, name, notes, postcards, scheduled_dts, sending_domain_uuid, sending_name, sending_user, sms_phone_number, status, status_dts].hash
285
295
  end
286
296
 
287
297
  # 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