ultracart_api 4.1.230 → 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 (37) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +19 -2
  3. data/docs/ItemAutoOrder.md +1 -1
  4. data/docs/SfvbApi.md +287 -0
  5. data/docs/SfvbApprovalCreateRequest.md +3 -1
  6. data/docs/SfvbCampaign.md +2 -0
  7. data/docs/SfvbCommsMember.md +22 -0
  8. data/docs/SfvbCommsMembersResponse.md +36 -0
  9. data/docs/SfvbFlow.md +2 -0
  10. data/docs/SfvbPostcardAddress.md +28 -0
  11. data/docs/SfvbPostcardCard.md +40 -0
  12. data/docs/SfvbPostcardTrackingResponse.md +34 -0
  13. data/docs/SfvbTransactionalChange.md +24 -0
  14. data/docs/SfvbTransactionalDeliveryOption.md +22 -0
  15. data/docs/SfvbTransactionalEmailDetail.md +30 -0
  16. data/docs/SfvbTransactionalEmailResponse.md +24 -0
  17. data/docs/SfvbTransactionalEmailUpdateRequest.md +28 -0
  18. data/docs/SfvbTransactionalSender.md +24 -0
  19. data/lib/ultracart_api/api/sfvb_api.rb +398 -0
  20. data/lib/ultracart_api/models/item_auto_order.rb +1 -1
  21. data/lib/ultracart_api/models/sfvb_approval_create_request.rb +15 -6
  22. data/lib/ultracart_api/models/sfvb_campaign.rb +11 -1
  23. data/lib/ultracart_api/models/sfvb_comms_member.rb +240 -0
  24. data/lib/ultracart_api/models/sfvb_comms_members_response.rb +314 -0
  25. data/lib/ultracart_api/models/sfvb_flow.rb +11 -1
  26. data/lib/ultracart_api/models/sfvb_postcard_address.rb +270 -0
  27. data/lib/ultracart_api/models/sfvb_postcard_card.rb +328 -0
  28. data/lib/ultracart_api/models/sfvb_postcard_tracking_response.rb +304 -0
  29. data/lib/ultracart_api/models/sfvb_transactional_change.rb +250 -0
  30. data/lib/ultracart_api/models/sfvb_transactional_delivery_option.rb +240 -0
  31. data/lib/ultracart_api/models/sfvb_transactional_email_detail.rb +283 -0
  32. data/lib/ultracart_api/models/sfvb_transactional_email_response.rb +253 -0
  33. data/lib/ultracart_api/models/sfvb_transactional_email_update_request.rb +272 -0
  34. data/lib/ultracart_api/models/sfvb_transactional_sender.rb +250 -0
  35. data/lib/ultracart_api/version.rb +1 -1
  36. data/lib/ultracart_api.rb +11 -0
  37. metadata +23 -1
@@ -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,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 SfvbCommsMember
18
+ # When the customer joined the list or segment.
19
+ attr_accessor :added_dts
20
+
21
+ # The customer uuid, the same on every list, segment and flow.
22
+ attr_accessor :customer_uuid
23
+
24
+ # The email address, masked as w***a@example.com unless show_customer_data was sent.
25
+ attr_accessor :email
26
+
27
+ # Attribute mapping from ruby-style variable name to JSON key.
28
+ def self.attribute_map
29
+ {
30
+ :'added_dts' => :'added_dts',
31
+ :'customer_uuid' => :'customer_uuid',
32
+ :'email' => :'email'
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
+ :'added_dts' => :'String',
45
+ :'customer_uuid' => :'String',
46
+ :'email' => :'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::SfvbCommsMember` 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::SfvbCommsMember`. 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?(:'added_dts')
72
+ self.added_dts = attributes[:'added_dts']
73
+ end
74
+
75
+ if attributes.key?(:'customer_uuid')
76
+ self.customer_uuid = attributes[:'customer_uuid']
77
+ end
78
+
79
+ if attributes.key?(:'email')
80
+ self.email = attributes[:'email']
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
+ added_dts == o.added_dts &&
103
+ customer_uuid == o.customer_uuid &&
104
+ email == o.email
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
+ [added_dts, customer_uuid, email].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
@@ -0,0 +1,314 @@
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 SfvbCommsMembersResponse
18
+ # masked, or shown when show_customer_data was sent.
19
+ attr_accessor :customer_data
20
+
21
+ # The list, for a list's members.
22
+ attr_accessor :list_uuid
23
+
24
+ # This page of members.
25
+ attr_accessor :members
26
+
27
+ # What to keep in mind, such as how to handle customer data that is shown.
28
+ attr_accessor :notes
29
+
30
+ # The page number, from 1.
31
+ attr_accessor :page
32
+
33
+ # Members per page.
34
+ attr_accessor :page_size
35
+
36
+ # For a segment, true while it is being rebuilt, so the members are from the last rebuild.
37
+ attr_accessor :rebuild_required
38
+
39
+ # The segment, for a segment's members.
40
+ attr_accessor :segment_uuid
41
+
42
+ # How many members there are.
43
+ attr_accessor :total_members
44
+
45
+ # How many pages there are.
46
+ attr_accessor :total_pages
47
+
48
+ # Attribute mapping from ruby-style variable name to JSON key.
49
+ def self.attribute_map
50
+ {
51
+ :'customer_data' => :'customer_data',
52
+ :'list_uuid' => :'list_uuid',
53
+ :'members' => :'members',
54
+ :'notes' => :'notes',
55
+ :'page' => :'page',
56
+ :'page_size' => :'page_size',
57
+ :'rebuild_required' => :'rebuild_required',
58
+ :'segment_uuid' => :'segment_uuid',
59
+ :'total_members' => :'total_members',
60
+ :'total_pages' => :'total_pages'
61
+ }
62
+ end
63
+
64
+ # Returns all the JSON keys this model knows about
65
+ def self.acceptable_attributes
66
+ attribute_map.values
67
+ end
68
+
69
+ # Attribute type mapping.
70
+ def self.openapi_types
71
+ {
72
+ :'customer_data' => :'String',
73
+ :'list_uuid' => :'String',
74
+ :'members' => :'Array<SfvbCommsMember>',
75
+ :'notes' => :'Array<String>',
76
+ :'page' => :'Integer',
77
+ :'page_size' => :'Integer',
78
+ :'rebuild_required' => :'Boolean',
79
+ :'segment_uuid' => :'String',
80
+ :'total_members' => :'Integer',
81
+ :'total_pages' => :'Integer'
82
+ }
83
+ end
84
+
85
+ # List of attributes with nullable: true
86
+ def self.openapi_nullable
87
+ Set.new([
88
+ ])
89
+ end
90
+
91
+ # Initializes the object
92
+ # @param [Hash] attributes Model attributes in the form of hash
93
+ def initialize(attributes = {})
94
+ if (!attributes.is_a?(Hash))
95
+ fail ArgumentError, "The input argument (attributes) must be a hash in `UltracartClient::SfvbCommsMembersResponse` initialize method"
96
+ end
97
+
98
+ # check to see if the attribute exists and convert string to symbol for hash key
99
+ attributes = attributes.each_with_object({}) { |(k, v), h|
100
+ if (!self.class.attribute_map.key?(k.to_sym))
101
+ fail ArgumentError, "`#{k}` is not a valid attribute in `UltracartClient::SfvbCommsMembersResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
102
+ end
103
+ h[k.to_sym] = v
104
+ }
105
+
106
+ if attributes.key?(:'customer_data')
107
+ self.customer_data = attributes[:'customer_data']
108
+ end
109
+
110
+ if attributes.key?(:'list_uuid')
111
+ self.list_uuid = attributes[:'list_uuid']
112
+ end
113
+
114
+ if attributes.key?(:'members')
115
+ if (value = attributes[:'members']).is_a?(Array)
116
+ self.members = value
117
+ end
118
+ end
119
+
120
+ if attributes.key?(:'notes')
121
+ if (value = attributes[:'notes']).is_a?(Array)
122
+ self.notes = value
123
+ end
124
+ end
125
+
126
+ if attributes.key?(:'page')
127
+ self.page = attributes[:'page']
128
+ end
129
+
130
+ if attributes.key?(:'page_size')
131
+ self.page_size = attributes[:'page_size']
132
+ end
133
+
134
+ if attributes.key?(:'rebuild_required')
135
+ self.rebuild_required = attributes[:'rebuild_required']
136
+ end
137
+
138
+ if attributes.key?(:'segment_uuid')
139
+ self.segment_uuid = attributes[:'segment_uuid']
140
+ end
141
+
142
+ if attributes.key?(:'total_members')
143
+ self.total_members = attributes[:'total_members']
144
+ end
145
+
146
+ if attributes.key?(:'total_pages')
147
+ self.total_pages = attributes[:'total_pages']
148
+ end
149
+ end
150
+
151
+ # Show invalid properties with the reasons. Usually used together with valid?
152
+ # @return Array for valid properties with the reasons
153
+ def list_invalid_properties
154
+ invalid_properties = Array.new
155
+ invalid_properties
156
+ end
157
+
158
+ # Check to see if the all the properties in the model are valid
159
+ # @return true if the model is valid
160
+ def valid?
161
+ true
162
+ end
163
+
164
+ # Checks equality by comparing each attribute.
165
+ # @param [Object] Object to be compared
166
+ def ==(o)
167
+ return true if self.equal?(o)
168
+ self.class == o.class &&
169
+ customer_data == o.customer_data &&
170
+ list_uuid == o.list_uuid &&
171
+ members == o.members &&
172
+ notes == o.notes &&
173
+ page == o.page &&
174
+ page_size == o.page_size &&
175
+ rebuild_required == o.rebuild_required &&
176
+ segment_uuid == o.segment_uuid &&
177
+ total_members == o.total_members &&
178
+ total_pages == o.total_pages
179
+ end
180
+
181
+ # @see the `==` method
182
+ # @param [Object] Object to be compared
183
+ def eql?(o)
184
+ self == o
185
+ end
186
+
187
+ # Calculates hash code according to all attributes.
188
+ # @return [Integer] Hash code
189
+ def hash
190
+ [customer_data, list_uuid, members, notes, page, page_size, rebuild_required, segment_uuid, total_members, total_pages].hash
191
+ end
192
+
193
+ # Builds the object from hash
194
+ # @param [Hash] attributes Model attributes in the form of hash
195
+ # @return [Object] Returns the model itself
196
+ def self.build_from_hash(attributes)
197
+ new.build_from_hash(attributes)
198
+ end
199
+
200
+ # Builds the object from hash
201
+ # @param [Hash] attributes Model attributes in the form of hash
202
+ # @return [Object] Returns the model itself
203
+ def build_from_hash(attributes)
204
+ return nil unless attributes.is_a?(Hash)
205
+ attributes = attributes.transform_keys(&:to_sym)
206
+ self.class.openapi_types.each_pair do |key, type|
207
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
208
+ self.send("#{key}=", nil)
209
+ elsif type =~ /\AArray<(.*)>/i
210
+ # check to ensure the input is an array given that the attribute
211
+ # is documented as an array but the input is not
212
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
213
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
214
+ end
215
+ elsif !attributes[self.class.attribute_map[key]].nil?
216
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
217
+ end
218
+ end
219
+
220
+ self
221
+ end
222
+
223
+ # Deserializes the data based on type
224
+ # @param string type Data type
225
+ # @param string value Value to be deserialized
226
+ # @return [Object] Deserialized data
227
+ def _deserialize(type, value)
228
+ case type.to_sym
229
+ when :Time
230
+ Time.parse(value)
231
+ when :Date
232
+ Date.parse(value)
233
+ when :String
234
+ value.to_s
235
+ when :Integer
236
+ value.to_i
237
+ when :Float
238
+ value.to_f
239
+ when :Boolean
240
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
241
+ true
242
+ else
243
+ false
244
+ end
245
+ when :Object
246
+ # generic object (usually a Hash), return directly
247
+ value
248
+ when /\AArray<(?<inner_type>.+)>\z/
249
+ inner_type = Regexp.last_match[:inner_type]
250
+ value.map { |v| _deserialize(inner_type, v) }
251
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
252
+ k_type = Regexp.last_match[:k_type]
253
+ v_type = Regexp.last_match[:v_type]
254
+ {}.tap do |hash|
255
+ value.each do |k, v|
256
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
257
+ end
258
+ end
259
+ else # model
260
+ # models (e.g. Pet) or oneOf
261
+ klass = UltracartClient.const_get(type)
262
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
263
+ end
264
+ end
265
+
266
+ # Returns the string representation of the object
267
+ # @return [String] String presentation of the object
268
+ def to_s
269
+ to_hash.to_s
270
+ end
271
+
272
+ # to_body is an alias to to_hash (backward compatibility)
273
+ # @return [Hash] Returns the object in the form of hash
274
+ def to_body
275
+ to_hash
276
+ end
277
+
278
+ # Returns the object in the form of hash
279
+ # @return [Hash] Returns the object in the form of hash
280
+ def to_hash
281
+ hash = {}
282
+ self.class.attribute_map.each_pair do |attr, param|
283
+ value = self.send(attr)
284
+ if value.nil?
285
+ is_nullable = self.class.openapi_nullable.include?(attr)
286
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
287
+ end
288
+
289
+ hash[param] = _to_hash(value)
290
+ end
291
+ hash
292
+ end
293
+
294
+ # Outputs non-array value in the form of hash
295
+ # For object, use to_hash. Otherwise, just return the value
296
+ # @param [Object] value Any valid value
297
+ # @return [Hash] Returns the value in the form of hash
298
+ def _to_hash(value)
299
+ if value.is_a?(Array)
300
+ value.compact.map { |v| _to_hash(v) }
301
+ elsif value.is_a?(Hash)
302
+ {}.tap do |hash|
303
+ value.each { |k, v| hash[k] = _to_hash(v) }
304
+ end
305
+ elsif value.respond_to? :to_hash
306
+ value.to_hash
307
+ else
308
+ value
309
+ end
310
+ end
311
+
312
+ end
313
+
314
+ end