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
@@ -15,6 +15,9 @@ require 'time'
15
15
 
16
16
  module UltracartClient
17
17
  class ItemContentMultimedia
18
+ # AI generated alt text for the image. StoreFront uses this when description is empty.
19
+ attr_accessor :ai_alt_text
20
+
18
21
  # URL where the image can be downloaded from the cloud
19
22
  attr_accessor :cloud_url
20
23
 
@@ -88,6 +91,7 @@ module UltracartClient
88
91
  # Attribute mapping from ruby-style variable name to JSON key.
89
92
  def self.attribute_map
90
93
  {
94
+ :'ai_alt_text' => :'ai_alt_text',
91
95
  :'cloud_url' => :'cloud_url',
92
96
  :'cloud_url_expiration' => :'cloud_url_expiration',
93
97
  :'code' => :'code',
@@ -115,6 +119,7 @@ module UltracartClient
115
119
  # Attribute type mapping.
116
120
  def self.openapi_types
117
121
  {
122
+ :'ai_alt_text' => :'String',
118
123
  :'cloud_url' => :'String',
119
124
  :'cloud_url_expiration' => :'String',
120
125
  :'code' => :'String',
@@ -155,6 +160,10 @@ module UltracartClient
155
160
  h[k.to_sym] = v
156
161
  }
157
162
 
163
+ if attributes.key?(:'ai_alt_text')
164
+ self.ai_alt_text = attributes[:'ai_alt_text']
165
+ end
166
+
158
167
  if attributes.key?(:'cloud_url')
159
168
  self.cloud_url = attributes[:'cloud_url']
160
169
  end
@@ -297,6 +306,7 @@ module UltracartClient
297
306
  def ==(o)
298
307
  return true if self.equal?(o)
299
308
  self.class == o.class &&
309
+ ai_alt_text == o.ai_alt_text &&
300
310
  cloud_url == o.cloud_url &&
301
311
  cloud_url_expiration == o.cloud_url_expiration &&
302
312
  code == o.code &&
@@ -324,7 +334,7 @@ module UltracartClient
324
334
  # Calculates hash code according to all attributes.
325
335
  # @return [Integer] Hash code
326
336
  def hash
327
- [cloud_url, cloud_url_expiration, code, description, exclude_from_gallery, file_name, height, merchant_item_multimedia_oid, orphan, placeholder, size, temp_multimedia_oid, thumbnails, type, url, width].hash
337
+ [ai_alt_text, cloud_url, cloud_url_expiration, code, description, exclude_from_gallery, file_name, height, merchant_item_multimedia_oid, orphan, placeholder, size, temp_multimedia_oid, thumbnails, type, url, width].hash
328
338
  end
329
339
 
330
340
  # Builds the object from hash
@@ -20,6 +20,10 @@ module UltracartClient
20
20
 
21
21
  attr_accessor :affiliate_network
22
22
 
23
+ attr_accessor :comms_list_import
24
+
25
+ attr_accessor :comms_settings
26
+
23
27
  # For a file.put_script write, the exact script to be written, at most 256 KB. For tracking_html.put, the exact HTML the write will send, at most 256 KB. UltraCart reviews it and keeps only its hash, so send the same bytes again on the write. Leave it out for a revert, which names params.version.
24
28
  attr_accessor :content
25
29
 
@@ -32,6 +36,8 @@ module UltracartClient
32
36
 
33
37
  attr_accessor :params
34
38
 
39
+ attr_accessor :postcard_test_mail
40
+
35
41
  # Why the agent wants to do this, in a sentence. Shown to the person as unverified text, capped at 500 characters.
36
42
  attr_accessor :reason
37
43
 
@@ -75,11 +81,14 @@ module UltracartClient
75
81
  {
76
82
  :'action' => :'action',
77
83
  :'affiliate_network' => :'affiliate_network',
84
+ :'comms_list_import' => :'comms_list_import',
85
+ :'comms_settings' => :'comms_settings',
78
86
  :'content' => :'content',
79
87
  :'experiment_start' => :'experiment_start',
80
88
  :'item_attribute_rows' => :'item_attribute_rows',
81
89
  :'item_pricing' => :'item_pricing',
82
90
  :'params' => :'params',
91
+ :'postcard_test_mail' => :'postcard_test_mail',
83
92
  :'reason' => :'reason',
84
93
  :'redirect_rows' => :'redirect_rows',
85
94
  :'segment_update' => :'segment_update',
@@ -100,11 +109,14 @@ module UltracartClient
100
109
  {
101
110
  :'action' => :'String',
102
111
  :'affiliate_network' => :'SfvbAffiliateNetworkRequest',
112
+ :'comms_list_import' => :'SfvbCommsProviderImportRequest',
113
+ :'comms_settings' => :'SfvbCommsSettingsUpdateRequest',
103
114
  :'content' => :'String',
104
115
  :'experiment_start' => :'SfvbExperimentStartRequest',
105
116
  :'item_attribute_rows' => :'Array<SfvbItemAttributeBatchRow>',
106
117
  :'item_pricing' => :'SfvbItemPricingRequest',
107
118
  :'params' => :'SfvbApprovalParams',
119
+ :'postcard_test_mail' => :'SfvbCommsTestPostcardRequest',
108
120
  :'reason' => :'String',
109
121
  :'redirect_rows' => :'Array<SfvbRedirectDeleteRow>',
110
122
  :'segment_update' => :'SfvbCommsSegmentWriteRequest',
@@ -144,6 +156,14 @@ module UltracartClient
144
156
  self.affiliate_network = attributes[:'affiliate_network']
145
157
  end
146
158
 
159
+ if attributes.key?(:'comms_list_import')
160
+ self.comms_list_import = attributes[:'comms_list_import']
161
+ end
162
+
163
+ if attributes.key?(:'comms_settings')
164
+ self.comms_settings = attributes[:'comms_settings']
165
+ end
166
+
147
167
  if attributes.key?(:'content')
148
168
  self.content = attributes[:'content']
149
169
  end
@@ -166,6 +186,10 @@ module UltracartClient
166
186
  self.params = attributes[:'params']
167
187
  end
168
188
 
189
+ if attributes.key?(:'postcard_test_mail')
190
+ self.postcard_test_mail = attributes[:'postcard_test_mail']
191
+ end
192
+
169
193
  if attributes.key?(:'reason')
170
194
  self.reason = attributes[:'reason']
171
195
  end
@@ -207,7 +231,7 @@ module UltracartClient
207
231
  # Check to see if the all the properties in the model are valid
208
232
  # @return true if the model is valid
209
233
  def valid?
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"])
234
+ 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", "comms_settings.update", "comms_list.import", "postcard.test_mail"])
211
235
  return false unless action_validator.valid?(@action)
212
236
  true
213
237
  end
@@ -215,7 +239,7 @@ module UltracartClient
215
239
  # Custom attribute writer method checking allowed values (enum).
216
240
  # @param [Object] action Object to be assigned
217
241
  def action=(action)
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"])
242
+ 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", "comms_settings.update", "comms_list.import", "postcard.test_mail"])
219
243
  unless validator.valid?(action)
220
244
  fail ArgumentError, "invalid value for \"action\", must be one of #{validator.allowable_values}."
221
245
  end
@@ -229,11 +253,14 @@ module UltracartClient
229
253
  self.class == o.class &&
230
254
  action == o.action &&
231
255
  affiliate_network == o.affiliate_network &&
256
+ comms_list_import == o.comms_list_import &&
257
+ comms_settings == o.comms_settings &&
232
258
  content == o.content &&
233
259
  experiment_start == o.experiment_start &&
234
260
  item_attribute_rows == o.item_attribute_rows &&
235
261
  item_pricing == o.item_pricing &&
236
262
  params == o.params &&
263
+ postcard_test_mail == o.postcard_test_mail &&
237
264
  reason == o.reason &&
238
265
  redirect_rows == o.redirect_rows &&
239
266
  segment_update == o.segment_update &&
@@ -252,7 +279,7 @@ module UltracartClient
252
279
  # Calculates hash code according to all attributes.
253
280
  # @return [Integer] Hash code
254
281
  def 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
282
+ [action, affiliate_network, comms_list_import, comms_settings, content, experiment_start, item_attribute_rows, item_pricing, params, postcard_test_mail, reason, redirect_rows, segment_update, site_seo, smart_attribution, tracking_provider, transactional_email].hash
256
283
  end
257
284
 
258
285
  # Builds the object from hash
@@ -0,0 +1,229 @@
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 SfvbCommsBranchStat
18
+ # The side, as the admin names it (yes or no, left or right).
19
+ attr_accessor :label
20
+
21
+ attr_accessor :stats
22
+
23
+ # Attribute mapping from ruby-style variable name to JSON key.
24
+ def self.attribute_map
25
+ {
26
+ :'label' => :'label',
27
+ :'stats' => :'stats'
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
+ :'label' => :'String',
40
+ :'stats' => :'SfvbCommsStat'
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::SfvbCommsBranchStat` 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::SfvbCommsBranchStat`. 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?(:'label')
66
+ self.label = attributes[:'label']
67
+ end
68
+
69
+ if attributes.key?(:'stats')
70
+ self.stats = attributes[:'stats']
71
+ end
72
+ end
73
+
74
+ # Show invalid properties with the reasons. Usually used together with valid?
75
+ # @return Array for valid properties with the reasons
76
+ def list_invalid_properties
77
+ invalid_properties = Array.new
78
+ invalid_properties
79
+ end
80
+
81
+ # Check to see if the all the properties in the model are valid
82
+ # @return true if the model is valid
83
+ def valid?
84
+ true
85
+ end
86
+
87
+ # Checks equality by comparing each attribute.
88
+ # @param [Object] Object to be compared
89
+ def ==(o)
90
+ return true if self.equal?(o)
91
+ self.class == o.class &&
92
+ label == o.label &&
93
+ stats == o.stats
94
+ end
95
+
96
+ # @see the `==` method
97
+ # @param [Object] Object to be compared
98
+ def eql?(o)
99
+ self == o
100
+ end
101
+
102
+ # Calculates hash code according to all attributes.
103
+ # @return [Integer] Hash code
104
+ def hash
105
+ [label, stats].hash
106
+ end
107
+
108
+ # Builds the object from hash
109
+ # @param [Hash] attributes Model attributes in the form of hash
110
+ # @return [Object] Returns the model itself
111
+ def self.build_from_hash(attributes)
112
+ new.build_from_hash(attributes)
113
+ end
114
+
115
+ # Builds the object from hash
116
+ # @param [Hash] attributes Model attributes in the form of hash
117
+ # @return [Object] Returns the model itself
118
+ def build_from_hash(attributes)
119
+ return nil unless attributes.is_a?(Hash)
120
+ attributes = attributes.transform_keys(&:to_sym)
121
+ self.class.openapi_types.each_pair do |key, type|
122
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
123
+ self.send("#{key}=", nil)
124
+ elsif type =~ /\AArray<(.*)>/i
125
+ # check to ensure the input is an array given that the attribute
126
+ # is documented as an array but the input is not
127
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
128
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
129
+ end
130
+ elsif !attributes[self.class.attribute_map[key]].nil?
131
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
132
+ end
133
+ end
134
+
135
+ self
136
+ end
137
+
138
+ # Deserializes the data based on type
139
+ # @param string type Data type
140
+ # @param string value Value to be deserialized
141
+ # @return [Object] Deserialized data
142
+ def _deserialize(type, value)
143
+ case type.to_sym
144
+ when :Time
145
+ Time.parse(value)
146
+ when :Date
147
+ Date.parse(value)
148
+ when :String
149
+ value.to_s
150
+ when :Integer
151
+ value.to_i
152
+ when :Float
153
+ value.to_f
154
+ when :Boolean
155
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
156
+ true
157
+ else
158
+ false
159
+ end
160
+ when :Object
161
+ # generic object (usually a Hash), return directly
162
+ value
163
+ when /\AArray<(?<inner_type>.+)>\z/
164
+ inner_type = Regexp.last_match[:inner_type]
165
+ value.map { |v| _deserialize(inner_type, v) }
166
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
167
+ k_type = Regexp.last_match[:k_type]
168
+ v_type = Regexp.last_match[:v_type]
169
+ {}.tap do |hash|
170
+ value.each do |k, v|
171
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
172
+ end
173
+ end
174
+ else # model
175
+ # models (e.g. Pet) or oneOf
176
+ klass = UltracartClient.const_get(type)
177
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
178
+ end
179
+ end
180
+
181
+ # Returns the string representation of the object
182
+ # @return [String] String presentation of the object
183
+ def to_s
184
+ to_hash.to_s
185
+ end
186
+
187
+ # to_body is an alias to to_hash (backward compatibility)
188
+ # @return [Hash] Returns the object in the form of hash
189
+ def to_body
190
+ to_hash
191
+ end
192
+
193
+ # Returns the object in the form of hash
194
+ # @return [Hash] Returns the object in the form of hash
195
+ def to_hash
196
+ hash = {}
197
+ self.class.attribute_map.each_pair do |attr, param|
198
+ value = self.send(attr)
199
+ if value.nil?
200
+ is_nullable = self.class.openapi_nullable.include?(attr)
201
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
202
+ end
203
+
204
+ hash[param] = _to_hash(value)
205
+ end
206
+ hash
207
+ end
208
+
209
+ # Outputs non-array value in the form of hash
210
+ # For object, use to_hash. Otherwise, just return the value
211
+ # @param [Object] value Any valid value
212
+ # @return [Hash] Returns the value in the form of hash
213
+ def _to_hash(value)
214
+ if value.is_a?(Array)
215
+ value.compact.map { |v| _to_hash(v) }
216
+ elsif value.is_a?(Hash)
217
+ {}.tap do |hash|
218
+ value.each { |k, v| hash[k] = _to_hash(v) }
219
+ end
220
+ elsif value.respond_to? :to_hash
221
+ value.to_hash
222
+ else
223
+ value
224
+ end
225
+ end
226
+
227
+ end
228
+
229
+ 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 SfvbCommsChange
18
+ # The setting, such as postcard_return_address.city or marketing_sender.sending_domain_uuid.
19
+ attr_accessor :field
20
+
21
+ # The value before, or none.
22
+ attr_accessor :from
23
+
24
+ # The value after, or none.
25
+ attr_accessor :to
26
+
27
+ # Attribute mapping from ruby-style variable name to JSON key.
28
+ def self.attribute_map
29
+ {
30
+ :'field' => :'field',
31
+ :'from' => :'from',
32
+ :'to' => :'to'
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
+ :'field' => :'String',
45
+ :'from' => :'String',
46
+ :'to' => :'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::SfvbCommsChange` 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::SfvbCommsChange`. 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?(:'field')
72
+ self.field = attributes[:'field']
73
+ end
74
+
75
+ if attributes.key?(:'from')
76
+ self.from = attributes[:'from']
77
+ end
78
+
79
+ if attributes.key?(:'to')
80
+ self.to = attributes[:'to']
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
+ field == o.field &&
103
+ from == o.from &&
104
+ to == o.to
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
+ [field, from, to].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