ultracart_api 4.1.203 → 4.1.205

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.
@@ -24,6 +24,12 @@ module UltracartClient
24
24
  # For file.put_script, the SHA-256 of the exact bytes approved. Set by the server, never by the caller. The write must send bytes with this hash.
25
25
  attr_accessor :content_sha256
26
26
 
27
+ # For sending_domain.delete, the sending domain.
28
+ attr_accessor :domain
29
+
30
+ # For twilio_account.delete, the Twilio account's esp_twilio_uuid, as GET comms/twilio_account returns it.
31
+ attr_accessor :esp_twilio_uuid
32
+
27
33
  # For experiment.end, the experiment to end.
28
34
  attr_accessor :experiment_oid
29
35
 
@@ -91,6 +97,8 @@ module UltracartClient
91
97
  :'attribute_names' => :'attribute_names',
92
98
  :'blog_post_oid' => :'blog_post_oid',
93
99
  :'content_sha256' => :'content_sha256',
100
+ :'domain' => :'domain',
101
+ :'esp_twilio_uuid' => :'esp_twilio_uuid',
94
102
  :'experiment_oid' => :'experiment_oid',
95
103
  :'item_count' => :'item_count',
96
104
  :'merchant_item_oid' => :'merchant_item_oid',
@@ -118,6 +126,8 @@ module UltracartClient
118
126
  :'attribute_names' => :'Array<String>',
119
127
  :'blog_post_oid' => :'Integer',
120
128
  :'content_sha256' => :'String',
129
+ :'domain' => :'String',
130
+ :'esp_twilio_uuid' => :'String',
121
131
  :'experiment_oid' => :'Integer',
122
132
  :'item_count' => :'Integer',
123
133
  :'merchant_item_oid' => :'Integer',
@@ -169,6 +179,14 @@ module UltracartClient
169
179
  self.content_sha256 = attributes[:'content_sha256']
170
180
  end
171
181
 
182
+ if attributes.key?(:'domain')
183
+ self.domain = attributes[:'domain']
184
+ end
185
+
186
+ if attributes.key?(:'esp_twilio_uuid')
187
+ self.esp_twilio_uuid = attributes[:'esp_twilio_uuid']
188
+ end
189
+
172
190
  if attributes.key?(:'experiment_oid')
173
191
  self.experiment_oid = attributes[:'experiment_oid']
174
192
  end
@@ -255,6 +273,8 @@ module UltracartClient
255
273
  attribute_names == o.attribute_names &&
256
274
  blog_post_oid == o.blog_post_oid &&
257
275
  content_sha256 == o.content_sha256 &&
276
+ domain == o.domain &&
277
+ esp_twilio_uuid == o.esp_twilio_uuid &&
258
278
  experiment_oid == o.experiment_oid &&
259
279
  item_count == o.item_count &&
260
280
  merchant_item_oid == o.merchant_item_oid &&
@@ -279,7 +299,7 @@ module UltracartClient
279
299
  # Calculates hash code according to all attributes.
280
300
  # @return [Integer] Hash code
281
301
  def hash
282
- [attribute_names, blog_post_oid, content_sha256, experiment_oid, item_count, merchant_item_oid, path, request_sha256, rows_sha256, rule_count, slot, upsell_kind, upsell_oid, version, widget_id, winner_variation_number].hash
302
+ [attribute_names, blog_post_oid, content_sha256, domain, esp_twilio_uuid, experiment_oid, item_count, merchant_item_oid, path, request_sha256, rows_sha256, rule_count, slot, upsell_kind, upsell_oid, version, widget_id, winner_variation_number].hash
283
303
  end
284
304
 
285
305
  # Builds the object from hash
@@ -0,0 +1,296 @@
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 SfvbCommsDnsRecord
18
+ # The host name, relative to the domain. @ is the domain itself.
19
+ attr_accessor :name
20
+
21
+ # What the record is for. verification proves the domain is yours, spf lists who may send for it, and dkim signs its mail.
22
+ attr_accessor :purpose
23
+
24
+ # The record type.
25
+ attr_accessor :type
26
+
27
+ # The value to publish.
28
+ attr_accessor :value
29
+
30
+ class EnumAttributeValidator
31
+ attr_reader :datatype
32
+ attr_reader :allowable_values
33
+
34
+ def initialize(datatype, allowable_values)
35
+ @allowable_values = allowable_values.map do |value|
36
+ case datatype.to_s
37
+ when /Integer/i
38
+ value.to_i
39
+ when /Float/i
40
+ value.to_f
41
+ else
42
+ value
43
+ end
44
+ end
45
+ end
46
+
47
+ def valid?(value)
48
+ !value || allowable_values.include?(value)
49
+ end
50
+ end
51
+
52
+ # Attribute mapping from ruby-style variable name to JSON key.
53
+ def self.attribute_map
54
+ {
55
+ :'name' => :'name',
56
+ :'purpose' => :'purpose',
57
+ :'type' => :'type',
58
+ :'value' => :'value'
59
+ }
60
+ end
61
+
62
+ # Returns all the JSON keys this model knows about
63
+ def self.acceptable_attributes
64
+ attribute_map.values
65
+ end
66
+
67
+ # Attribute type mapping.
68
+ def self.openapi_types
69
+ {
70
+ :'name' => :'String',
71
+ :'purpose' => :'String',
72
+ :'type' => :'String',
73
+ :'value' => :'String'
74
+ }
75
+ end
76
+
77
+ # List of attributes with nullable: true
78
+ def self.openapi_nullable
79
+ Set.new([
80
+ ])
81
+ end
82
+
83
+ # Initializes the object
84
+ # @param [Hash] attributes Model attributes in the form of hash
85
+ def initialize(attributes = {})
86
+ if (!attributes.is_a?(Hash))
87
+ fail ArgumentError, "The input argument (attributes) must be a hash in `UltracartClient::SfvbCommsDnsRecord` initialize method"
88
+ end
89
+
90
+ # check to see if the attribute exists and convert string to symbol for hash key
91
+ attributes = attributes.each_with_object({}) { |(k, v), h|
92
+ if (!self.class.attribute_map.key?(k.to_sym))
93
+ fail ArgumentError, "`#{k}` is not a valid attribute in `UltracartClient::SfvbCommsDnsRecord`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
94
+ end
95
+ h[k.to_sym] = v
96
+ }
97
+
98
+ if attributes.key?(:'name')
99
+ self.name = attributes[:'name']
100
+ end
101
+
102
+ if attributes.key?(:'purpose')
103
+ self.purpose = attributes[:'purpose']
104
+ end
105
+
106
+ if attributes.key?(:'type')
107
+ self.type = attributes[:'type']
108
+ end
109
+
110
+ if attributes.key?(:'value')
111
+ self.value = attributes[:'value']
112
+ end
113
+ end
114
+
115
+ # Show invalid properties with the reasons. Usually used together with valid?
116
+ # @return Array for valid properties with the reasons
117
+ def list_invalid_properties
118
+ invalid_properties = Array.new
119
+ invalid_properties
120
+ end
121
+
122
+ # Check to see if the all the properties in the model are valid
123
+ # @return true if the model is valid
124
+ def valid?
125
+ purpose_validator = EnumAttributeValidator.new('String', ["verification", "spf", "dkim"])
126
+ return false unless purpose_validator.valid?(@purpose)
127
+ type_validator = EnumAttributeValidator.new('String', ["TXT", "CNAME"])
128
+ return false unless type_validator.valid?(@type)
129
+ true
130
+ end
131
+
132
+ # Custom attribute writer method checking allowed values (enum).
133
+ # @param [Object] purpose Object to be assigned
134
+ def purpose=(purpose)
135
+ validator = EnumAttributeValidator.new('String', ["verification", "spf", "dkim"])
136
+ unless validator.valid?(purpose)
137
+ fail ArgumentError, "invalid value for \"purpose\", must be one of #{validator.allowable_values}."
138
+ end
139
+ @purpose = purpose
140
+ end
141
+
142
+ # Custom attribute writer method checking allowed values (enum).
143
+ # @param [Object] type Object to be assigned
144
+ def type=(type)
145
+ validator = EnumAttributeValidator.new('String', ["TXT", "CNAME"])
146
+ unless validator.valid?(type)
147
+ fail ArgumentError, "invalid value for \"type\", must be one of #{validator.allowable_values}."
148
+ end
149
+ @type = type
150
+ end
151
+
152
+ # Checks equality by comparing each attribute.
153
+ # @param [Object] Object to be compared
154
+ def ==(o)
155
+ return true if self.equal?(o)
156
+ self.class == o.class &&
157
+ name == o.name &&
158
+ purpose == o.purpose &&
159
+ type == o.type &&
160
+ value == o.value
161
+ end
162
+
163
+ # @see the `==` method
164
+ # @param [Object] Object to be compared
165
+ def eql?(o)
166
+ self == o
167
+ end
168
+
169
+ # Calculates hash code according to all attributes.
170
+ # @return [Integer] Hash code
171
+ def hash
172
+ [name, purpose, type, value].hash
173
+ end
174
+
175
+ # Builds the object from hash
176
+ # @param [Hash] attributes Model attributes in the form of hash
177
+ # @return [Object] Returns the model itself
178
+ def self.build_from_hash(attributes)
179
+ new.build_from_hash(attributes)
180
+ end
181
+
182
+ # Builds the object from hash
183
+ # @param [Hash] attributes Model attributes in the form of hash
184
+ # @return [Object] Returns the model itself
185
+ def build_from_hash(attributes)
186
+ return nil unless attributes.is_a?(Hash)
187
+ attributes = attributes.transform_keys(&:to_sym)
188
+ self.class.openapi_types.each_pair do |key, type|
189
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
190
+ self.send("#{key}=", nil)
191
+ elsif type =~ /\AArray<(.*)>/i
192
+ # check to ensure the input is an array given that the attribute
193
+ # is documented as an array but the input is not
194
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
195
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
196
+ end
197
+ elsif !attributes[self.class.attribute_map[key]].nil?
198
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
199
+ end
200
+ end
201
+
202
+ self
203
+ end
204
+
205
+ # Deserializes the data based on type
206
+ # @param string type Data type
207
+ # @param string value Value to be deserialized
208
+ # @return [Object] Deserialized data
209
+ def _deserialize(type, value)
210
+ case type.to_sym
211
+ when :Time
212
+ Time.parse(value)
213
+ when :Date
214
+ Date.parse(value)
215
+ when :String
216
+ value.to_s
217
+ when :Integer
218
+ value.to_i
219
+ when :Float
220
+ value.to_f
221
+ when :Boolean
222
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
223
+ true
224
+ else
225
+ false
226
+ end
227
+ when :Object
228
+ # generic object (usually a Hash), return directly
229
+ value
230
+ when /\AArray<(?<inner_type>.+)>\z/
231
+ inner_type = Regexp.last_match[:inner_type]
232
+ value.map { |v| _deserialize(inner_type, v) }
233
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
234
+ k_type = Regexp.last_match[:k_type]
235
+ v_type = Regexp.last_match[:v_type]
236
+ {}.tap do |hash|
237
+ value.each do |k, v|
238
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
239
+ end
240
+ end
241
+ else # model
242
+ # models (e.g. Pet) or oneOf
243
+ klass = UltracartClient.const_get(type)
244
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
245
+ end
246
+ end
247
+
248
+ # Returns the string representation of the object
249
+ # @return [String] String presentation of the object
250
+ def to_s
251
+ to_hash.to_s
252
+ end
253
+
254
+ # to_body is an alias to to_hash (backward compatibility)
255
+ # @return [Hash] Returns the object in the form of hash
256
+ def to_body
257
+ to_hash
258
+ end
259
+
260
+ # Returns the object in the form of hash
261
+ # @return [Hash] Returns the object in the form of hash
262
+ def to_hash
263
+ hash = {}
264
+ self.class.attribute_map.each_pair do |attr, param|
265
+ value = self.send(attr)
266
+ if value.nil?
267
+ is_nullable = self.class.openapi_nullable.include?(attr)
268
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
269
+ end
270
+
271
+ hash[param] = _to_hash(value)
272
+ end
273
+ hash
274
+ end
275
+
276
+ # Outputs non-array value in the form of hash
277
+ # For object, use to_hash. Otherwise, just return the value
278
+ # @param [Object] value Any valid value
279
+ # @return [Hash] Returns the value in the form of hash
280
+ def _to_hash(value)
281
+ if value.is_a?(Array)
282
+ value.compact.map { |v| _to_hash(v) }
283
+ elsif value.is_a?(Hash)
284
+ {}.tap do |hash|
285
+ value.each { |k, v| hash[k] = _to_hash(v) }
286
+ end
287
+ elsif value.respond_to? :to_hash
288
+ value.to_hash
289
+ else
290
+ value
291
+ end
292
+ end
293
+
294
+ end
295
+
296
+ end