ultracart_api 4.1.206 → 4.1.208

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.
@@ -0,0 +1,320 @@
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 SfvbCommsEmail
18
+ # When the email container was last changed (ISO 8601, UTC).
19
+ attr_accessor :container_last_modified_dts
20
+
21
+ # True when the email was deleted.
22
+ attr_accessor :deleted
23
+
24
+ # The email uuid. Use it with the email container (owner type email) and with the email render endpoint.
25
+ attr_accessor :email_uuid
26
+
27
+ # True while a change waits for review.
28
+ attr_accessor :pending_review
29
+
30
+ # The preview text an inbox shows after the subject.
31
+ attr_accessor :preview_text
32
+
33
+ # True when review rejected the email. Don't edit it without the merchant.
34
+ attr_accessor :rejected
35
+
36
+ # True when a change to this email must be reviewed before it sends.
37
+ attr_accessor :requires_review
38
+
39
+ # The step that sends this email.
40
+ attr_accessor :step_uuid
41
+
42
+ # The subject line.
43
+ attr_accessor :subject
44
+
45
+ # True for a transactional email, which skips the marketing footer rules.
46
+ attr_accessor :transactional
47
+
48
+ # The email version.
49
+ attr_accessor :version
50
+
51
+ # Attribute mapping from ruby-style variable name to JSON key.
52
+ def self.attribute_map
53
+ {
54
+ :'container_last_modified_dts' => :'container_last_modified_dts',
55
+ :'deleted' => :'deleted',
56
+ :'email_uuid' => :'email_uuid',
57
+ :'pending_review' => :'pending_review',
58
+ :'preview_text' => :'preview_text',
59
+ :'rejected' => :'rejected',
60
+ :'requires_review' => :'requires_review',
61
+ :'step_uuid' => :'step_uuid',
62
+ :'subject' => :'subject',
63
+ :'transactional' => :'transactional',
64
+ :'version' => :'version'
65
+ }
66
+ end
67
+
68
+ # Returns all the JSON keys this model knows about
69
+ def self.acceptable_attributes
70
+ attribute_map.values
71
+ end
72
+
73
+ # Attribute type mapping.
74
+ def self.openapi_types
75
+ {
76
+ :'container_last_modified_dts' => :'String',
77
+ :'deleted' => :'Boolean',
78
+ :'email_uuid' => :'String',
79
+ :'pending_review' => :'Boolean',
80
+ :'preview_text' => :'String',
81
+ :'rejected' => :'Boolean',
82
+ :'requires_review' => :'Boolean',
83
+ :'step_uuid' => :'String',
84
+ :'subject' => :'String',
85
+ :'transactional' => :'Boolean',
86
+ :'version' => :'Integer'
87
+ }
88
+ end
89
+
90
+ # List of attributes with nullable: true
91
+ def self.openapi_nullable
92
+ Set.new([
93
+ ])
94
+ end
95
+
96
+ # Initializes the object
97
+ # @param [Hash] attributes Model attributes in the form of hash
98
+ def initialize(attributes = {})
99
+ if (!attributes.is_a?(Hash))
100
+ fail ArgumentError, "The input argument (attributes) must be a hash in `UltracartClient::SfvbCommsEmail` initialize method"
101
+ end
102
+
103
+ # check to see if the attribute exists and convert string to symbol for hash key
104
+ attributes = attributes.each_with_object({}) { |(k, v), h|
105
+ if (!self.class.attribute_map.key?(k.to_sym))
106
+ fail ArgumentError, "`#{k}` is not a valid attribute in `UltracartClient::SfvbCommsEmail`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
107
+ end
108
+ h[k.to_sym] = v
109
+ }
110
+
111
+ if attributes.key?(:'container_last_modified_dts')
112
+ self.container_last_modified_dts = attributes[:'container_last_modified_dts']
113
+ end
114
+
115
+ if attributes.key?(:'deleted')
116
+ self.deleted = attributes[:'deleted']
117
+ end
118
+
119
+ if attributes.key?(:'email_uuid')
120
+ self.email_uuid = attributes[:'email_uuid']
121
+ end
122
+
123
+ if attributes.key?(:'pending_review')
124
+ self.pending_review = attributes[:'pending_review']
125
+ end
126
+
127
+ if attributes.key?(:'preview_text')
128
+ self.preview_text = attributes[:'preview_text']
129
+ end
130
+
131
+ if attributes.key?(:'rejected')
132
+ self.rejected = attributes[:'rejected']
133
+ end
134
+
135
+ if attributes.key?(:'requires_review')
136
+ self.requires_review = attributes[:'requires_review']
137
+ end
138
+
139
+ if attributes.key?(:'step_uuid')
140
+ self.step_uuid = attributes[:'step_uuid']
141
+ end
142
+
143
+ if attributes.key?(:'subject')
144
+ self.subject = attributes[:'subject']
145
+ end
146
+
147
+ if attributes.key?(:'transactional')
148
+ self.transactional = attributes[:'transactional']
149
+ end
150
+
151
+ if attributes.key?(:'version')
152
+ self.version = attributes[:'version']
153
+ end
154
+ end
155
+
156
+ # Show invalid properties with the reasons. Usually used together with valid?
157
+ # @return Array for valid properties with the reasons
158
+ def list_invalid_properties
159
+ invalid_properties = Array.new
160
+ invalid_properties
161
+ end
162
+
163
+ # Check to see if the all the properties in the model are valid
164
+ # @return true if the model is valid
165
+ def valid?
166
+ true
167
+ end
168
+
169
+ # Checks equality by comparing each attribute.
170
+ # @param [Object] Object to be compared
171
+ def ==(o)
172
+ return true if self.equal?(o)
173
+ self.class == o.class &&
174
+ container_last_modified_dts == o.container_last_modified_dts &&
175
+ deleted == o.deleted &&
176
+ email_uuid == o.email_uuid &&
177
+ pending_review == o.pending_review &&
178
+ preview_text == o.preview_text &&
179
+ rejected == o.rejected &&
180
+ requires_review == o.requires_review &&
181
+ step_uuid == o.step_uuid &&
182
+ subject == o.subject &&
183
+ transactional == o.transactional &&
184
+ version == o.version
185
+ end
186
+
187
+ # @see the `==` method
188
+ # @param [Object] Object to be compared
189
+ def eql?(o)
190
+ self == o
191
+ end
192
+
193
+ # Calculates hash code according to all attributes.
194
+ # @return [Integer] Hash code
195
+ def hash
196
+ [container_last_modified_dts, deleted, email_uuid, pending_review, preview_text, rejected, requires_review, step_uuid, subject, transactional, version].hash
197
+ end
198
+
199
+ # Builds the object from hash
200
+ # @param [Hash] attributes Model attributes in the form of hash
201
+ # @return [Object] Returns the model itself
202
+ def self.build_from_hash(attributes)
203
+ new.build_from_hash(attributes)
204
+ end
205
+
206
+ # Builds the object from hash
207
+ # @param [Hash] attributes Model attributes in the form of hash
208
+ # @return [Object] Returns the model itself
209
+ def build_from_hash(attributes)
210
+ return nil unless attributes.is_a?(Hash)
211
+ attributes = attributes.transform_keys(&:to_sym)
212
+ self.class.openapi_types.each_pair do |key, type|
213
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
214
+ self.send("#{key}=", nil)
215
+ elsif type =~ /\AArray<(.*)>/i
216
+ # check to ensure the input is an array given that the attribute
217
+ # is documented as an array but the input is not
218
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
219
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
220
+ end
221
+ elsif !attributes[self.class.attribute_map[key]].nil?
222
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
223
+ end
224
+ end
225
+
226
+ self
227
+ end
228
+
229
+ # Deserializes the data based on type
230
+ # @param string type Data type
231
+ # @param string value Value to be deserialized
232
+ # @return [Object] Deserialized data
233
+ def _deserialize(type, value)
234
+ case type.to_sym
235
+ when :Time
236
+ Time.parse(value)
237
+ when :Date
238
+ Date.parse(value)
239
+ when :String
240
+ value.to_s
241
+ when :Integer
242
+ value.to_i
243
+ when :Float
244
+ value.to_f
245
+ when :Boolean
246
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
247
+ true
248
+ else
249
+ false
250
+ end
251
+ when :Object
252
+ # generic object (usually a Hash), return directly
253
+ value
254
+ when /\AArray<(?<inner_type>.+)>\z/
255
+ inner_type = Regexp.last_match[:inner_type]
256
+ value.map { |v| _deserialize(inner_type, v) }
257
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
258
+ k_type = Regexp.last_match[:k_type]
259
+ v_type = Regexp.last_match[:v_type]
260
+ {}.tap do |hash|
261
+ value.each do |k, v|
262
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
263
+ end
264
+ end
265
+ else # model
266
+ # models (e.g. Pet) or oneOf
267
+ klass = UltracartClient.const_get(type)
268
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
269
+ end
270
+ end
271
+
272
+ # Returns the string representation of the object
273
+ # @return [String] String presentation of the object
274
+ def to_s
275
+ to_hash.to_s
276
+ end
277
+
278
+ # to_body is an alias to to_hash (backward compatibility)
279
+ # @return [Hash] Returns the object in the form of hash
280
+ def to_body
281
+ to_hash
282
+ end
283
+
284
+ # Returns the object in the form of hash
285
+ # @return [Hash] Returns the object in the form of hash
286
+ def to_hash
287
+ hash = {}
288
+ self.class.attribute_map.each_pair do |attr, param|
289
+ value = self.send(attr)
290
+ if value.nil?
291
+ is_nullable = self.class.openapi_nullable.include?(attr)
292
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
293
+ end
294
+
295
+ hash[param] = _to_hash(value)
296
+ end
297
+ hash
298
+ end
299
+
300
+ # Outputs non-array value in the form of hash
301
+ # For object, use to_hash. Otherwise, just return the value
302
+ # @param [Object] value Any valid value
303
+ # @return [Hash] Returns the value in the form of hash
304
+ def _to_hash(value)
305
+ if value.is_a?(Array)
306
+ value.compact.map { |v| _to_hash(v) }
307
+ elsif value.is_a?(Hash)
308
+ {}.tap do |hash|
309
+ value.each { |k, v| hash[k] = _to_hash(v) }
310
+ end
311
+ elsif value.respond_to? :to_hash
312
+ value.to_hash
313
+ else
314
+ value
315
+ end
316
+ end
317
+
318
+ end
319
+
320
+ end
@@ -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 SfvbCommsPostcard
18
+ # The back side container uuid (owner type postcardback).
19
+ attr_accessor :back_container_uuid
20
+
21
+ # When either side was last changed (ISO 8601, UTC).
22
+ attr_accessor :container_last_modified_dts
23
+
24
+ # True when the postcard was deleted.
25
+ attr_accessor :deleted
26
+
27
+ # The front side container uuid (owner type postcardfront).
28
+ attr_accessor :front_container_uuid
29
+
30
+ # The postcard uuid.
31
+ attr_accessor :postcard_uuid
32
+
33
+ # The step that sends this postcard.
34
+ attr_accessor :step_uuid
35
+
36
+ # Attribute mapping from ruby-style variable name to JSON key.
37
+ def self.attribute_map
38
+ {
39
+ :'back_container_uuid' => :'back_container_uuid',
40
+ :'container_last_modified_dts' => :'container_last_modified_dts',
41
+ :'deleted' => :'deleted',
42
+ :'front_container_uuid' => :'front_container_uuid',
43
+ :'postcard_uuid' => :'postcard_uuid',
44
+ :'step_uuid' => :'step_uuid'
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
+ :'back_container_uuid' => :'String',
57
+ :'container_last_modified_dts' => :'String',
58
+ :'deleted' => :'Boolean',
59
+ :'front_container_uuid' => :'String',
60
+ :'postcard_uuid' => :'String',
61
+ :'step_uuid' => :'String'
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::SfvbCommsPostcard` 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::SfvbCommsPostcard`. 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?(:'back_container_uuid')
87
+ self.back_container_uuid = attributes[:'back_container_uuid']
88
+ end
89
+
90
+ if attributes.key?(:'container_last_modified_dts')
91
+ self.container_last_modified_dts = attributes[:'container_last_modified_dts']
92
+ end
93
+
94
+ if attributes.key?(:'deleted')
95
+ self.deleted = attributes[:'deleted']
96
+ end
97
+
98
+ if attributes.key?(:'front_container_uuid')
99
+ self.front_container_uuid = attributes[:'front_container_uuid']
100
+ end
101
+
102
+ if attributes.key?(:'postcard_uuid')
103
+ self.postcard_uuid = attributes[:'postcard_uuid']
104
+ end
105
+
106
+ if attributes.key?(:'step_uuid')
107
+ self.step_uuid = attributes[:'step_uuid']
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
+ back_container_uuid == o.back_container_uuid &&
130
+ container_last_modified_dts == o.container_last_modified_dts &&
131
+ deleted == o.deleted &&
132
+ front_container_uuid == o.front_container_uuid &&
133
+ postcard_uuid == o.postcard_uuid &&
134
+ step_uuid == o.step_uuid
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
+ [back_container_uuid, container_last_modified_dts, deleted, front_container_uuid, postcard_uuid, step_uuid].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