ultracart_api 4.1.231 → 4.1.232

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 (69) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +45 -2
  3. data/docs/ItemContentMultimedia.md +2 -0
  4. data/docs/SfvbApi.md +763 -39
  5. data/docs/SfvbApprovalCreateRequest.md +6 -0
  6. data/docs/SfvbCommsBranchStat.md +20 -0
  7. data/docs/SfvbCommsChange.md +22 -0
  8. data/docs/SfvbCommsClick.md +20 -0
  9. data/docs/SfvbCommsClicksResponse.md +26 -0
  10. data/docs/SfvbCommsDailyStat.md +30 -0
  11. data/docs/SfvbCommsDashboardResponse.md +24 -0
  12. data/docs/SfvbCommsDashboardRow.md +28 -0
  13. data/docs/SfvbCommsPlan.md +66 -0
  14. data/docs/SfvbCommsPlanResponse.md +20 -0
  15. data/docs/SfvbCommsProvider.md +28 -0
  16. data/docs/SfvbCommsProviderImportRequest.md +22 -0
  17. data/docs/SfvbCommsProviderImportResponse.md +26 -0
  18. data/docs/SfvbCommsProviderList.md +20 -0
  19. data/docs/SfvbCommsProvidersResponse.md +22 -0
  20. data/docs/SfvbCommsSender.md +24 -0
  21. data/docs/SfvbCommsSenderUpdate.md +22 -0
  22. data/docs/SfvbCommsSequenceStatsResponse.md +26 -0
  23. data/docs/SfvbCommsSettings.md +34 -0
  24. data/docs/SfvbCommsSettingsResponse.md +24 -0
  25. data/docs/SfvbCommsSettingsUpdateRequest.md +26 -0
  26. data/docs/SfvbCommsStat.md +54 -0
  27. data/docs/SfvbCommsStepStat.md +34 -0
  28. data/docs/SfvbCommsTemplate.md +30 -0
  29. data/docs/SfvbCommsTemplateResponse.md +24 -0
  30. data/docs/SfvbCommsTemplatesResponse.md +20 -0
  31. data/docs/SfvbCommsTestEmailRequest.md +24 -0
  32. data/docs/SfvbCommsTestPostcardRequest.md +36 -0
  33. data/docs/SfvbCommsTestSendResponse.md +32 -0
  34. data/docs/SfvbCommsTestSmsRequest.md +18 -0
  35. data/lib/ultracart_api/api/sfvb_api.rb +982 -10
  36. data/lib/ultracart_api/models/item_content_multimedia.rb +11 -1
  37. data/lib/ultracart_api/models/sfvb_approval_create_request.rb +30 -3
  38. data/lib/ultracart_api/models/sfvb_comms_branch_stat.rb +229 -0
  39. data/lib/ultracart_api/models/sfvb_comms_change.rb +240 -0
  40. data/lib/ultracart_api/models/sfvb_comms_click.rb +230 -0
  41. data/lib/ultracart_api/models/sfvb_comms_clicks_response.rb +264 -0
  42. data/lib/ultracart_api/models/sfvb_comms_daily_stat.rb +280 -0
  43. data/lib/ultracart_api/models/sfvb_comms_dashboard_response.rb +256 -0
  44. data/lib/ultracart_api/models/sfvb_comms_dashboard_row.rb +269 -0
  45. data/lib/ultracart_api/models/sfvb_comms_plan.rb +460 -0
  46. data/lib/ultracart_api/models/sfvb_comms_plan_response.rb +231 -0
  47. data/lib/ultracart_api/models/sfvb_comms_provider.rb +272 -0
  48. data/lib/ultracart_api/models/sfvb_comms_provider_import_request.rb +242 -0
  49. data/lib/ultracart_api/models/sfvb_comms_provider_import_response.rb +264 -0
  50. data/lib/ultracart_api/models/sfvb_comms_provider_list.rb +230 -0
  51. data/lib/ultracart_api/models/sfvb_comms_providers_response.rb +244 -0
  52. data/lib/ultracart_api/models/sfvb_comms_sender.rb +250 -0
  53. data/lib/ultracart_api/models/sfvb_comms_sender_update.rb +240 -0
  54. data/lib/ultracart_api/models/sfvb_comms_sequence_stats_response.rb +263 -0
  55. data/lib/ultracart_api/models/sfvb_comms_settings.rb +297 -0
  56. data/lib/ultracart_api/models/sfvb_comms_settings_response.rb +253 -0
  57. data/lib/ultracart_api/models/sfvb_comms_settings_update_request.rb +257 -0
  58. data/lib/ultracart_api/models/sfvb_comms_stat.rb +402 -0
  59. data/lib/ultracart_api/models/sfvb_comms_step_stat.rb +301 -0
  60. data/lib/ultracart_api/models/sfvb_comms_template.rb +280 -0
  61. data/lib/ultracart_api/models/sfvb_comms_template_response.rb +251 -0
  62. data/lib/ultracart_api/models/sfvb_comms_templates_response.rb +234 -0
  63. data/lib/ultracart_api/models/sfvb_comms_test_email_request.rb +252 -0
  64. data/lib/ultracart_api/models/sfvb_comms_test_postcard_request.rb +312 -0
  65. data/lib/ultracart_api/models/sfvb_comms_test_send_response.rb +292 -0
  66. data/lib/ultracart_api/models/sfvb_comms_test_sms_request.rb +220 -0
  67. data/lib/ultracart_api/version.rb +1 -1
  68. data/lib/ultracart_api.rb +29 -0
  69. metadata +59 -1
@@ -0,0 +1,460 @@
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 SfvbCommsPlan
18
+ # Customers being mailed now.
19
+ attr_accessor :active_customers
20
+
21
+ # True when the account may import lists from another email provider.
22
+ attr_accessor :allow_list_import
23
+
24
+ # True when shipment tracking emails are allowed.
25
+ attr_accessor :allow_tracking_emails
26
+
27
+ # Emails bounced.
28
+ attr_accessor :bounce_count
29
+
30
+ # The bounce percentage.
31
+ attr_accessor :bounce_percentage
32
+
33
+ # Emails delivered.
34
+ attr_accessor :delivered_count
35
+
36
+ # The starting sending limit for a new account.
37
+ attr_accessor :initial_sending_limits
38
+
39
+ # The most customers the plan mails.
40
+ attr_accessor :max_active_customers
41
+
42
+ # The daily sending cap.
43
+ attr_accessor :max_emails_per_day
44
+
45
+ # The hourly sending cap.
46
+ attr_accessor :max_emails_per_hour
47
+
48
+ # The monthly sending cap.
49
+ attr_accessor :max_emails_per_month
50
+
51
+ # True when sending is paused for spam complaints.
52
+ attr_accessor :paused_for_spam
53
+
54
+ # Customers the plan covers.
55
+ attr_accessor :plan_customers
56
+
57
+ # Emails a month the plan covers.
58
+ attr_accessor :plan_emails
59
+
60
+ # The plan, such as small.
61
+ attr_accessor :plan_name
62
+
63
+ # The plan's display name.
64
+ attr_accessor :plan_name_formatted
65
+
66
+ # When set, only customers who ordered within this many days are mailed.
67
+ attr_accessor :require_order_within_last_days
68
+
69
+ # Emails sent in the last day.
70
+ attr_accessor :sent_emails_per_day
71
+
72
+ # Emails sent in the last hour.
73
+ attr_accessor :sent_emails_per_hour
74
+
75
+ # Emails sent in the last month.
76
+ attr_accessor :sent_emails_per_month
77
+
78
+ # Spam complaints.
79
+ attr_accessor :spam_count
80
+
81
+ # The spam complaint percentage at which sending pauses.
82
+ attr_accessor :spam_percent_limit
83
+
84
+ # The spam complaint percentage.
85
+ attr_accessor :spam_percentage
86
+
87
+ # Customers allowed in all.
88
+ attr_accessor :total_customers
89
+
90
+ # Emails a month allowed in all.
91
+ attr_accessor :total_emails
92
+
93
+ # Attribute mapping from ruby-style variable name to JSON key.
94
+ def self.attribute_map
95
+ {
96
+ :'active_customers' => :'active_customers',
97
+ :'allow_list_import' => :'allow_list_import',
98
+ :'allow_tracking_emails' => :'allow_tracking_emails',
99
+ :'bounce_count' => :'bounce_count',
100
+ :'bounce_percentage' => :'bounce_percentage',
101
+ :'delivered_count' => :'delivered_count',
102
+ :'initial_sending_limits' => :'initial_sending_limits',
103
+ :'max_active_customers' => :'max_active_customers',
104
+ :'max_emails_per_day' => :'max_emails_per_day',
105
+ :'max_emails_per_hour' => :'max_emails_per_hour',
106
+ :'max_emails_per_month' => :'max_emails_per_month',
107
+ :'paused_for_spam' => :'paused_for_spam',
108
+ :'plan_customers' => :'plan_customers',
109
+ :'plan_emails' => :'plan_emails',
110
+ :'plan_name' => :'plan_name',
111
+ :'plan_name_formatted' => :'plan_name_formatted',
112
+ :'require_order_within_last_days' => :'require_order_within_last_days',
113
+ :'sent_emails_per_day' => :'sent_emails_per_day',
114
+ :'sent_emails_per_hour' => :'sent_emails_per_hour',
115
+ :'sent_emails_per_month' => :'sent_emails_per_month',
116
+ :'spam_count' => :'spam_count',
117
+ :'spam_percent_limit' => :'spam_percent_limit',
118
+ :'spam_percentage' => :'spam_percentage',
119
+ :'total_customers' => :'total_customers',
120
+ :'total_emails' => :'total_emails'
121
+ }
122
+ end
123
+
124
+ # Returns all the JSON keys this model knows about
125
+ def self.acceptable_attributes
126
+ attribute_map.values
127
+ end
128
+
129
+ # Attribute type mapping.
130
+ def self.openapi_types
131
+ {
132
+ :'active_customers' => :'Integer',
133
+ :'allow_list_import' => :'Boolean',
134
+ :'allow_tracking_emails' => :'Boolean',
135
+ :'bounce_count' => :'Integer',
136
+ :'bounce_percentage' => :'Float',
137
+ :'delivered_count' => :'Integer',
138
+ :'initial_sending_limits' => :'Integer',
139
+ :'max_active_customers' => :'Integer',
140
+ :'max_emails_per_day' => :'Integer',
141
+ :'max_emails_per_hour' => :'Integer',
142
+ :'max_emails_per_month' => :'Integer',
143
+ :'paused_for_spam' => :'Boolean',
144
+ :'plan_customers' => :'Integer',
145
+ :'plan_emails' => :'Integer',
146
+ :'plan_name' => :'String',
147
+ :'plan_name_formatted' => :'String',
148
+ :'require_order_within_last_days' => :'Integer',
149
+ :'sent_emails_per_day' => :'Integer',
150
+ :'sent_emails_per_hour' => :'Integer',
151
+ :'sent_emails_per_month' => :'Integer',
152
+ :'spam_count' => :'Integer',
153
+ :'spam_percent_limit' => :'Integer',
154
+ :'spam_percentage' => :'Float',
155
+ :'total_customers' => :'Integer',
156
+ :'total_emails' => :'Integer'
157
+ }
158
+ end
159
+
160
+ # List of attributes with nullable: true
161
+ def self.openapi_nullable
162
+ Set.new([
163
+ ])
164
+ end
165
+
166
+ # Initializes the object
167
+ # @param [Hash] attributes Model attributes in the form of hash
168
+ def initialize(attributes = {})
169
+ if (!attributes.is_a?(Hash))
170
+ fail ArgumentError, "The input argument (attributes) must be a hash in `UltracartClient::SfvbCommsPlan` initialize method"
171
+ end
172
+
173
+ # check to see if the attribute exists and convert string to symbol for hash key
174
+ attributes = attributes.each_with_object({}) { |(k, v), h|
175
+ if (!self.class.attribute_map.key?(k.to_sym))
176
+ fail ArgumentError, "`#{k}` is not a valid attribute in `UltracartClient::SfvbCommsPlan`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
177
+ end
178
+ h[k.to_sym] = v
179
+ }
180
+
181
+ if attributes.key?(:'active_customers')
182
+ self.active_customers = attributes[:'active_customers']
183
+ end
184
+
185
+ if attributes.key?(:'allow_list_import')
186
+ self.allow_list_import = attributes[:'allow_list_import']
187
+ end
188
+
189
+ if attributes.key?(:'allow_tracking_emails')
190
+ self.allow_tracking_emails = attributes[:'allow_tracking_emails']
191
+ end
192
+
193
+ if attributes.key?(:'bounce_count')
194
+ self.bounce_count = attributes[:'bounce_count']
195
+ end
196
+
197
+ if attributes.key?(:'bounce_percentage')
198
+ self.bounce_percentage = attributes[:'bounce_percentage']
199
+ end
200
+
201
+ if attributes.key?(:'delivered_count')
202
+ self.delivered_count = attributes[:'delivered_count']
203
+ end
204
+
205
+ if attributes.key?(:'initial_sending_limits')
206
+ self.initial_sending_limits = attributes[:'initial_sending_limits']
207
+ end
208
+
209
+ if attributes.key?(:'max_active_customers')
210
+ self.max_active_customers = attributes[:'max_active_customers']
211
+ end
212
+
213
+ if attributes.key?(:'max_emails_per_day')
214
+ self.max_emails_per_day = attributes[:'max_emails_per_day']
215
+ end
216
+
217
+ if attributes.key?(:'max_emails_per_hour')
218
+ self.max_emails_per_hour = attributes[:'max_emails_per_hour']
219
+ end
220
+
221
+ if attributes.key?(:'max_emails_per_month')
222
+ self.max_emails_per_month = attributes[:'max_emails_per_month']
223
+ end
224
+
225
+ if attributes.key?(:'paused_for_spam')
226
+ self.paused_for_spam = attributes[:'paused_for_spam']
227
+ end
228
+
229
+ if attributes.key?(:'plan_customers')
230
+ self.plan_customers = attributes[:'plan_customers']
231
+ end
232
+
233
+ if attributes.key?(:'plan_emails')
234
+ self.plan_emails = attributes[:'plan_emails']
235
+ end
236
+
237
+ if attributes.key?(:'plan_name')
238
+ self.plan_name = attributes[:'plan_name']
239
+ end
240
+
241
+ if attributes.key?(:'plan_name_formatted')
242
+ self.plan_name_formatted = attributes[:'plan_name_formatted']
243
+ end
244
+
245
+ if attributes.key?(:'require_order_within_last_days')
246
+ self.require_order_within_last_days = attributes[:'require_order_within_last_days']
247
+ end
248
+
249
+ if attributes.key?(:'sent_emails_per_day')
250
+ self.sent_emails_per_day = attributes[:'sent_emails_per_day']
251
+ end
252
+
253
+ if attributes.key?(:'sent_emails_per_hour')
254
+ self.sent_emails_per_hour = attributes[:'sent_emails_per_hour']
255
+ end
256
+
257
+ if attributes.key?(:'sent_emails_per_month')
258
+ self.sent_emails_per_month = attributes[:'sent_emails_per_month']
259
+ end
260
+
261
+ if attributes.key?(:'spam_count')
262
+ self.spam_count = attributes[:'spam_count']
263
+ end
264
+
265
+ if attributes.key?(:'spam_percent_limit')
266
+ self.spam_percent_limit = attributes[:'spam_percent_limit']
267
+ end
268
+
269
+ if attributes.key?(:'spam_percentage')
270
+ self.spam_percentage = attributes[:'spam_percentage']
271
+ end
272
+
273
+ if attributes.key?(:'total_customers')
274
+ self.total_customers = attributes[:'total_customers']
275
+ end
276
+
277
+ if attributes.key?(:'total_emails')
278
+ self.total_emails = attributes[:'total_emails']
279
+ end
280
+ end
281
+
282
+ # Show invalid properties with the reasons. Usually used together with valid?
283
+ # @return Array for valid properties with the reasons
284
+ def list_invalid_properties
285
+ invalid_properties = Array.new
286
+ invalid_properties
287
+ end
288
+
289
+ # Check to see if the all the properties in the model are valid
290
+ # @return true if the model is valid
291
+ def valid?
292
+ true
293
+ end
294
+
295
+ # Checks equality by comparing each attribute.
296
+ # @param [Object] Object to be compared
297
+ def ==(o)
298
+ return true if self.equal?(o)
299
+ self.class == o.class &&
300
+ active_customers == o.active_customers &&
301
+ allow_list_import == o.allow_list_import &&
302
+ allow_tracking_emails == o.allow_tracking_emails &&
303
+ bounce_count == o.bounce_count &&
304
+ bounce_percentage == o.bounce_percentage &&
305
+ delivered_count == o.delivered_count &&
306
+ initial_sending_limits == o.initial_sending_limits &&
307
+ max_active_customers == o.max_active_customers &&
308
+ max_emails_per_day == o.max_emails_per_day &&
309
+ max_emails_per_hour == o.max_emails_per_hour &&
310
+ max_emails_per_month == o.max_emails_per_month &&
311
+ paused_for_spam == o.paused_for_spam &&
312
+ plan_customers == o.plan_customers &&
313
+ plan_emails == o.plan_emails &&
314
+ plan_name == o.plan_name &&
315
+ plan_name_formatted == o.plan_name_formatted &&
316
+ require_order_within_last_days == o.require_order_within_last_days &&
317
+ sent_emails_per_day == o.sent_emails_per_day &&
318
+ sent_emails_per_hour == o.sent_emails_per_hour &&
319
+ sent_emails_per_month == o.sent_emails_per_month &&
320
+ spam_count == o.spam_count &&
321
+ spam_percent_limit == o.spam_percent_limit &&
322
+ spam_percentage == o.spam_percentage &&
323
+ total_customers == o.total_customers &&
324
+ total_emails == o.total_emails
325
+ end
326
+
327
+ # @see the `==` method
328
+ # @param [Object] Object to be compared
329
+ def eql?(o)
330
+ self == o
331
+ end
332
+
333
+ # Calculates hash code according to all attributes.
334
+ # @return [Integer] Hash code
335
+ def hash
336
+ [active_customers, allow_list_import, allow_tracking_emails, bounce_count, bounce_percentage, delivered_count, initial_sending_limits, max_active_customers, max_emails_per_day, max_emails_per_hour, max_emails_per_month, paused_for_spam, plan_customers, plan_emails, plan_name, plan_name_formatted, require_order_within_last_days, sent_emails_per_day, sent_emails_per_hour, sent_emails_per_month, spam_count, spam_percent_limit, spam_percentage, total_customers, total_emails].hash
337
+ end
338
+
339
+ # Builds the object from hash
340
+ # @param [Hash] attributes Model attributes in the form of hash
341
+ # @return [Object] Returns the model itself
342
+ def self.build_from_hash(attributes)
343
+ new.build_from_hash(attributes)
344
+ end
345
+
346
+ # Builds the object from hash
347
+ # @param [Hash] attributes Model attributes in the form of hash
348
+ # @return [Object] Returns the model itself
349
+ def build_from_hash(attributes)
350
+ return nil unless attributes.is_a?(Hash)
351
+ attributes = attributes.transform_keys(&:to_sym)
352
+ self.class.openapi_types.each_pair do |key, type|
353
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
354
+ self.send("#{key}=", nil)
355
+ elsif type =~ /\AArray<(.*)>/i
356
+ # check to ensure the input is an array given that the attribute
357
+ # is documented as an array but the input is not
358
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
359
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
360
+ end
361
+ elsif !attributes[self.class.attribute_map[key]].nil?
362
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
363
+ end
364
+ end
365
+
366
+ self
367
+ end
368
+
369
+ # Deserializes the data based on type
370
+ # @param string type Data type
371
+ # @param string value Value to be deserialized
372
+ # @return [Object] Deserialized data
373
+ def _deserialize(type, value)
374
+ case type.to_sym
375
+ when :Time
376
+ Time.parse(value)
377
+ when :Date
378
+ Date.parse(value)
379
+ when :String
380
+ value.to_s
381
+ when :Integer
382
+ value.to_i
383
+ when :Float
384
+ value.to_f
385
+ when :Boolean
386
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
387
+ true
388
+ else
389
+ false
390
+ end
391
+ when :Object
392
+ # generic object (usually a Hash), return directly
393
+ value
394
+ when /\AArray<(?<inner_type>.+)>\z/
395
+ inner_type = Regexp.last_match[:inner_type]
396
+ value.map { |v| _deserialize(inner_type, v) }
397
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
398
+ k_type = Regexp.last_match[:k_type]
399
+ v_type = Regexp.last_match[:v_type]
400
+ {}.tap do |hash|
401
+ value.each do |k, v|
402
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
403
+ end
404
+ end
405
+ else # model
406
+ # models (e.g. Pet) or oneOf
407
+ klass = UltracartClient.const_get(type)
408
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
409
+ end
410
+ end
411
+
412
+ # Returns the string representation of the object
413
+ # @return [String] String presentation of the object
414
+ def to_s
415
+ to_hash.to_s
416
+ end
417
+
418
+ # to_body is an alias to to_hash (backward compatibility)
419
+ # @return [Hash] Returns the object in the form of hash
420
+ def to_body
421
+ to_hash
422
+ end
423
+
424
+ # Returns the object in the form of hash
425
+ # @return [Hash] Returns the object in the form of hash
426
+ def to_hash
427
+ hash = {}
428
+ self.class.attribute_map.each_pair do |attr, param|
429
+ value = self.send(attr)
430
+ if value.nil?
431
+ is_nullable = self.class.openapi_nullable.include?(attr)
432
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
433
+ end
434
+
435
+ hash[param] = _to_hash(value)
436
+ end
437
+ hash
438
+ end
439
+
440
+ # Outputs non-array value in the form of hash
441
+ # For object, use to_hash. Otherwise, just return the value
442
+ # @param [Object] value Any valid value
443
+ # @return [Hash] Returns the value in the form of hash
444
+ def _to_hash(value)
445
+ if value.is_a?(Array)
446
+ value.compact.map { |v| _to_hash(v) }
447
+ elsif value.is_a?(Hash)
448
+ {}.tap do |hash|
449
+ value.each { |k, v| hash[k] = _to_hash(v) }
450
+ end
451
+ elsif value.respond_to? :to_hash
452
+ value.to_hash
453
+ else
454
+ value
455
+ end
456
+ end
457
+
458
+ end
459
+
460
+ end
@@ -0,0 +1,231 @@
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 SfvbCommsPlanResponse
18
+ # What stands out, such as a paused account or a cap nearly reached.
19
+ attr_accessor :notes
20
+
21
+ attr_accessor :plan
22
+
23
+ # Attribute mapping from ruby-style variable name to JSON key.
24
+ def self.attribute_map
25
+ {
26
+ :'notes' => :'notes',
27
+ :'plan' => :'plan'
28
+ }
29
+ end
30
+
31
+ # Returns all the JSON keys this model knows about
32
+ def self.acceptable_attributes
33
+ attribute_map.values
34
+ end
35
+
36
+ # Attribute type mapping.
37
+ def self.openapi_types
38
+ {
39
+ :'notes' => :'Array<String>',
40
+ :'plan' => :'SfvbCommsPlan'
41
+ }
42
+ end
43
+
44
+ # List of attributes with nullable: true
45
+ def self.openapi_nullable
46
+ Set.new([
47
+ ])
48
+ end
49
+
50
+ # Initializes the object
51
+ # @param [Hash] attributes Model attributes in the form of hash
52
+ def initialize(attributes = {})
53
+ if (!attributes.is_a?(Hash))
54
+ fail ArgumentError, "The input argument (attributes) must be a hash in `UltracartClient::SfvbCommsPlanResponse` initialize method"
55
+ end
56
+
57
+ # check to see if the attribute exists and convert string to symbol for hash key
58
+ attributes = attributes.each_with_object({}) { |(k, v), h|
59
+ if (!self.class.attribute_map.key?(k.to_sym))
60
+ fail ArgumentError, "`#{k}` is not a valid attribute in `UltracartClient::SfvbCommsPlanResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
61
+ end
62
+ h[k.to_sym] = v
63
+ }
64
+
65
+ if attributes.key?(:'notes')
66
+ if (value = attributes[:'notes']).is_a?(Array)
67
+ self.notes = value
68
+ end
69
+ end
70
+
71
+ if attributes.key?(:'plan')
72
+ self.plan = attributes[:'plan']
73
+ end
74
+ end
75
+
76
+ # Show invalid properties with the reasons. Usually used together with valid?
77
+ # @return Array for valid properties with the reasons
78
+ def list_invalid_properties
79
+ invalid_properties = Array.new
80
+ invalid_properties
81
+ end
82
+
83
+ # Check to see if the all the properties in the model are valid
84
+ # @return true if the model is valid
85
+ def valid?
86
+ true
87
+ end
88
+
89
+ # Checks equality by comparing each attribute.
90
+ # @param [Object] Object to be compared
91
+ def ==(o)
92
+ return true if self.equal?(o)
93
+ self.class == o.class &&
94
+ notes == o.notes &&
95
+ plan == o.plan
96
+ end
97
+
98
+ # @see the `==` method
99
+ # @param [Object] Object to be compared
100
+ def eql?(o)
101
+ self == o
102
+ end
103
+
104
+ # Calculates hash code according to all attributes.
105
+ # @return [Integer] Hash code
106
+ def hash
107
+ [notes, plan].hash
108
+ end
109
+
110
+ # Builds the object from hash
111
+ # @param [Hash] attributes Model attributes in the form of hash
112
+ # @return [Object] Returns the model itself
113
+ def self.build_from_hash(attributes)
114
+ new.build_from_hash(attributes)
115
+ end
116
+
117
+ # Builds the object from hash
118
+ # @param [Hash] attributes Model attributes in the form of hash
119
+ # @return [Object] Returns the model itself
120
+ def build_from_hash(attributes)
121
+ return nil unless attributes.is_a?(Hash)
122
+ attributes = attributes.transform_keys(&:to_sym)
123
+ self.class.openapi_types.each_pair do |key, type|
124
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
125
+ self.send("#{key}=", nil)
126
+ elsif type =~ /\AArray<(.*)>/i
127
+ # check to ensure the input is an array given that the attribute
128
+ # is documented as an array but the input is not
129
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
130
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
131
+ end
132
+ elsif !attributes[self.class.attribute_map[key]].nil?
133
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
134
+ end
135
+ end
136
+
137
+ self
138
+ end
139
+
140
+ # Deserializes the data based on type
141
+ # @param string type Data type
142
+ # @param string value Value to be deserialized
143
+ # @return [Object] Deserialized data
144
+ def _deserialize(type, value)
145
+ case type.to_sym
146
+ when :Time
147
+ Time.parse(value)
148
+ when :Date
149
+ Date.parse(value)
150
+ when :String
151
+ value.to_s
152
+ when :Integer
153
+ value.to_i
154
+ when :Float
155
+ value.to_f
156
+ when :Boolean
157
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
158
+ true
159
+ else
160
+ false
161
+ end
162
+ when :Object
163
+ # generic object (usually a Hash), return directly
164
+ value
165
+ when /\AArray<(?<inner_type>.+)>\z/
166
+ inner_type = Regexp.last_match[:inner_type]
167
+ value.map { |v| _deserialize(inner_type, v) }
168
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
169
+ k_type = Regexp.last_match[:k_type]
170
+ v_type = Regexp.last_match[:v_type]
171
+ {}.tap do |hash|
172
+ value.each do |k, v|
173
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
174
+ end
175
+ end
176
+ else # model
177
+ # models (e.g. Pet) or oneOf
178
+ klass = UltracartClient.const_get(type)
179
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
180
+ end
181
+ end
182
+
183
+ # Returns the string representation of the object
184
+ # @return [String] String presentation of the object
185
+ def to_s
186
+ to_hash.to_s
187
+ end
188
+
189
+ # to_body is an alias to to_hash (backward compatibility)
190
+ # @return [Hash] Returns the object in the form of hash
191
+ def to_body
192
+ to_hash
193
+ end
194
+
195
+ # Returns the object in the form of hash
196
+ # @return [Hash] Returns the object in the form of hash
197
+ def to_hash
198
+ hash = {}
199
+ self.class.attribute_map.each_pair do |attr, param|
200
+ value = self.send(attr)
201
+ if value.nil?
202
+ is_nullable = self.class.openapi_nullable.include?(attr)
203
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
204
+ end
205
+
206
+ hash[param] = _to_hash(value)
207
+ end
208
+ hash
209
+ end
210
+
211
+ # Outputs non-array value in the form of hash
212
+ # For object, use to_hash. Otherwise, just return the value
213
+ # @param [Object] value Any valid value
214
+ # @return [Hash] Returns the value in the form of hash
215
+ def _to_hash(value)
216
+ if value.is_a?(Array)
217
+ value.compact.map { |v| _to_hash(v) }
218
+ elsif value.is_a?(Hash)
219
+ {}.tap do |hash|
220
+ value.each { |k, v| hash[k] = _to_hash(v) }
221
+ end
222
+ elsif value.respond_to? :to_hash
223
+ value.to_hash
224
+ else
225
+ value
226
+ end
227
+ end
228
+
229
+ end
230
+
231
+ end