ultracart_api 4.1.202 → 4.1.204

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 (35) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +32 -2
  3. data/docs/SfvbApi.md +897 -39
  4. data/docs/SfvbApprovalParams.md +4 -0
  5. data/docs/SfvbCommsDnsRecord.md +24 -0
  6. data/docs/SfvbCommsSendingDomain.md +38 -0
  7. data/docs/SfvbCommsSendingDomainsResponse.md +18 -0
  8. data/docs/SfvbCommsTwilioAccount.md +38 -0
  9. data/docs/SfvbCommsTwilioAccountResponse.md +20 -0
  10. data/docs/SfvbEvent.md +2 -2
  11. data/docs/SfvbSecretHandle.md +32 -0
  12. data/docs/SfvbSecretKind.md +30 -0
  13. data/docs/SfvbSecretKindsResponse.md +20 -0
  14. data/docs/SfvbSecretRequest.md +54 -0
  15. data/docs/SfvbSecretRequestCreate.md +30 -0
  16. data/docs/SfvbSecretRequestsResponse.md +18 -0
  17. data/docs/SfvbSecretSink.md +24 -0
  18. data/lib/ultracart_api/api/sfvb_api.rb +1059 -28
  19. data/lib/ultracart_api/models/sfvb_approval_params.rb +21 -1
  20. data/lib/ultracart_api/models/sfvb_comms_dns_record.rb +296 -0
  21. data/lib/ultracart_api/models/sfvb_comms_sending_domain.rb +356 -0
  22. data/lib/ultracart_api/models/sfvb_comms_sending_domains_response.rb +222 -0
  23. data/lib/ultracart_api/models/sfvb_comms_twilio_account.rb +322 -0
  24. data/lib/ultracart_api/models/sfvb_comms_twilio_account_response.rb +231 -0
  25. data/lib/ultracart_api/models/sfvb_event.rb +2 -2
  26. data/lib/ultracart_api/models/sfvb_secret_handle.rb +324 -0
  27. data/lib/ultracart_api/models/sfvb_secret_kind.rb +280 -0
  28. data/lib/ultracart_api/models/sfvb_secret_kinds_response.rb +234 -0
  29. data/lib/ultracart_api/models/sfvb_secret_request.rb +440 -0
  30. data/lib/ultracart_api/models/sfvb_secret_request_create.rb +284 -0
  31. data/lib/ultracart_api/models/sfvb_secret_requests_response.rb +222 -0
  32. data/lib/ultracart_api/models/sfvb_secret_sink.rb +250 -0
  33. data/lib/ultracart_api/version.rb +1 -1
  34. data/lib/ultracart_api.rb +12 -0
  35. metadata +26 -2
@@ -0,0 +1,324 @@
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 SfvbSecretHandle
18
+ # When it stops being usable, ISO 8601 UTC.
19
+ attr_accessor :expires_at
20
+
21
+ # The last few characters of the value, as a mask shows them, so the person can tell values apart. Empty until entered.
22
+ attr_accessor :fingerprint
23
+
24
+ # The handle. Safe to log and keep in plans. It works only for the sign-in that requested it.
25
+ attr_accessor :handle
26
+
27
+ # The bulk key it is for, or empty.
28
+ attr_accessor :key
29
+
30
+ # The secret field it can be written to.
31
+ attr_accessor :sink
32
+
33
+ # pending (no value yet), ready, in_use (a write holds it), consumed, revoked or expired.
34
+ attr_accessor :status
35
+
36
+ # The object it can be written to, or empty when the request named none.
37
+ attr_accessor :target_id
38
+
39
+ # Writes left. Empty once the handle is gone.
40
+ attr_accessor :uses_left
41
+
42
+ class EnumAttributeValidator
43
+ attr_reader :datatype
44
+ attr_reader :allowable_values
45
+
46
+ def initialize(datatype, allowable_values)
47
+ @allowable_values = allowable_values.map do |value|
48
+ case datatype.to_s
49
+ when /Integer/i
50
+ value.to_i
51
+ when /Float/i
52
+ value.to_f
53
+ else
54
+ value
55
+ end
56
+ end
57
+ end
58
+
59
+ def valid?(value)
60
+ !value || allowable_values.include?(value)
61
+ end
62
+ end
63
+
64
+ # Attribute mapping from ruby-style variable name to JSON key.
65
+ def self.attribute_map
66
+ {
67
+ :'expires_at' => :'expires_at',
68
+ :'fingerprint' => :'fingerprint',
69
+ :'handle' => :'handle',
70
+ :'key' => :'key',
71
+ :'sink' => :'sink',
72
+ :'status' => :'status',
73
+ :'target_id' => :'target_id',
74
+ :'uses_left' => :'uses_left'
75
+ }
76
+ end
77
+
78
+ # Returns all the JSON keys this model knows about
79
+ def self.acceptable_attributes
80
+ attribute_map.values
81
+ end
82
+
83
+ # Attribute type mapping.
84
+ def self.openapi_types
85
+ {
86
+ :'expires_at' => :'String',
87
+ :'fingerprint' => :'String',
88
+ :'handle' => :'String',
89
+ :'key' => :'String',
90
+ :'sink' => :'String',
91
+ :'status' => :'String',
92
+ :'target_id' => :'String',
93
+ :'uses_left' => :'Integer'
94
+ }
95
+ end
96
+
97
+ # List of attributes with nullable: true
98
+ def self.openapi_nullable
99
+ Set.new([
100
+ ])
101
+ end
102
+
103
+ # Initializes the object
104
+ # @param [Hash] attributes Model attributes in the form of hash
105
+ def initialize(attributes = {})
106
+ if (!attributes.is_a?(Hash))
107
+ fail ArgumentError, "The input argument (attributes) must be a hash in `UltracartClient::SfvbSecretHandle` initialize method"
108
+ end
109
+
110
+ # check to see if the attribute exists and convert string to symbol for hash key
111
+ attributes = attributes.each_with_object({}) { |(k, v), h|
112
+ if (!self.class.attribute_map.key?(k.to_sym))
113
+ fail ArgumentError, "`#{k}` is not a valid attribute in `UltracartClient::SfvbSecretHandle`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
114
+ end
115
+ h[k.to_sym] = v
116
+ }
117
+
118
+ if attributes.key?(:'expires_at')
119
+ self.expires_at = attributes[:'expires_at']
120
+ end
121
+
122
+ if attributes.key?(:'fingerprint')
123
+ self.fingerprint = attributes[:'fingerprint']
124
+ end
125
+
126
+ if attributes.key?(:'handle')
127
+ self.handle = attributes[:'handle']
128
+ end
129
+
130
+ if attributes.key?(:'key')
131
+ self.key = attributes[:'key']
132
+ end
133
+
134
+ if attributes.key?(:'sink')
135
+ self.sink = attributes[:'sink']
136
+ end
137
+
138
+ if attributes.key?(:'status')
139
+ self.status = attributes[:'status']
140
+ end
141
+
142
+ if attributes.key?(:'target_id')
143
+ self.target_id = attributes[:'target_id']
144
+ end
145
+
146
+ if attributes.key?(:'uses_left')
147
+ self.uses_left = attributes[:'uses_left']
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
+ status_validator = EnumAttributeValidator.new('String', ["pending", "ready", "in_use", "consumed", "revoked", "expired"])
162
+ return false unless status_validator.valid?(@status)
163
+ true
164
+ end
165
+
166
+ # Custom attribute writer method checking allowed values (enum).
167
+ # @param [Object] status Object to be assigned
168
+ def status=(status)
169
+ validator = EnumAttributeValidator.new('String', ["pending", "ready", "in_use", "consumed", "revoked", "expired"])
170
+ unless validator.valid?(status)
171
+ fail ArgumentError, "invalid value for \"status\", must be one of #{validator.allowable_values}."
172
+ end
173
+ @status = status
174
+ end
175
+
176
+ # Checks equality by comparing each attribute.
177
+ # @param [Object] Object to be compared
178
+ def ==(o)
179
+ return true if self.equal?(o)
180
+ self.class == o.class &&
181
+ expires_at == o.expires_at &&
182
+ fingerprint == o.fingerprint &&
183
+ handle == o.handle &&
184
+ key == o.key &&
185
+ sink == o.sink &&
186
+ status == o.status &&
187
+ target_id == o.target_id &&
188
+ uses_left == o.uses_left
189
+ end
190
+
191
+ # @see the `==` method
192
+ # @param [Object] Object to be compared
193
+ def eql?(o)
194
+ self == o
195
+ end
196
+
197
+ # Calculates hash code according to all attributes.
198
+ # @return [Integer] Hash code
199
+ def hash
200
+ [expires_at, fingerprint, handle, key, sink, status, target_id, uses_left].hash
201
+ end
202
+
203
+ # Builds the object from hash
204
+ # @param [Hash] attributes Model attributes in the form of hash
205
+ # @return [Object] Returns the model itself
206
+ def self.build_from_hash(attributes)
207
+ new.build_from_hash(attributes)
208
+ end
209
+
210
+ # Builds the object from hash
211
+ # @param [Hash] attributes Model attributes in the form of hash
212
+ # @return [Object] Returns the model itself
213
+ def build_from_hash(attributes)
214
+ return nil unless attributes.is_a?(Hash)
215
+ attributes = attributes.transform_keys(&:to_sym)
216
+ self.class.openapi_types.each_pair do |key, type|
217
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
218
+ self.send("#{key}=", nil)
219
+ elsif type =~ /\AArray<(.*)>/i
220
+ # check to ensure the input is an array given that the attribute
221
+ # is documented as an array but the input is not
222
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
223
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
224
+ end
225
+ elsif !attributes[self.class.attribute_map[key]].nil?
226
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
227
+ end
228
+ end
229
+
230
+ self
231
+ end
232
+
233
+ # Deserializes the data based on type
234
+ # @param string type Data type
235
+ # @param string value Value to be deserialized
236
+ # @return [Object] Deserialized data
237
+ def _deserialize(type, value)
238
+ case type.to_sym
239
+ when :Time
240
+ Time.parse(value)
241
+ when :Date
242
+ Date.parse(value)
243
+ when :String
244
+ value.to_s
245
+ when :Integer
246
+ value.to_i
247
+ when :Float
248
+ value.to_f
249
+ when :Boolean
250
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
251
+ true
252
+ else
253
+ false
254
+ end
255
+ when :Object
256
+ # generic object (usually a Hash), return directly
257
+ value
258
+ when /\AArray<(?<inner_type>.+)>\z/
259
+ inner_type = Regexp.last_match[:inner_type]
260
+ value.map { |v| _deserialize(inner_type, v) }
261
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
262
+ k_type = Regexp.last_match[:k_type]
263
+ v_type = Regexp.last_match[:v_type]
264
+ {}.tap do |hash|
265
+ value.each do |k, v|
266
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
267
+ end
268
+ end
269
+ else # model
270
+ # models (e.g. Pet) or oneOf
271
+ klass = UltracartClient.const_get(type)
272
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
273
+ end
274
+ end
275
+
276
+ # Returns the string representation of the object
277
+ # @return [String] String presentation of the object
278
+ def to_s
279
+ to_hash.to_s
280
+ end
281
+
282
+ # to_body is an alias to to_hash (backward compatibility)
283
+ # @return [Hash] Returns the object in the form of hash
284
+ def to_body
285
+ to_hash
286
+ end
287
+
288
+ # Returns the object in the form of hash
289
+ # @return [Hash] Returns the object in the form of hash
290
+ def to_hash
291
+ hash = {}
292
+ self.class.attribute_map.each_pair do |attr, param|
293
+ value = self.send(attr)
294
+ if value.nil?
295
+ is_nullable = self.class.openapi_nullable.include?(attr)
296
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
297
+ end
298
+
299
+ hash[param] = _to_hash(value)
300
+ end
301
+ hash
302
+ end
303
+
304
+ # Outputs non-array value in the form of hash
305
+ # For object, use to_hash. Otherwise, just return the value
306
+ # @param [Object] value Any valid value
307
+ # @return [Hash] Returns the value in the form of hash
308
+ def _to_hash(value)
309
+ if value.is_a?(Array)
310
+ value.compact.map { |v| _to_hash(v) }
311
+ elsif value.is_a?(Hash)
312
+ {}.tap do |hash|
313
+ value.each { |k, v| hash[k] = _to_hash(v) }
314
+ end
315
+ elsif value.respond_to? :to_hash
316
+ value.to_hash
317
+ else
318
+ value
319
+ end
320
+ end
321
+
322
+ end
323
+
324
+ end
@@ -0,0 +1,280 @@
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 SfvbSecretKind
18
+ # Where the value comes from.
19
+ attr_accessor :description
20
+
21
+ # What the value looks like. The request page checks it as it is typed, and the server again.
22
+ attr_accessor :format_hint
23
+
24
+ # The kind id.
25
+ attr_accessor :id
26
+
27
+ # What the person is told they are entering.
28
+ attr_accessor :label
29
+
30
+ # How many trailing characters a mask shows at most.
31
+ attr_accessor :mask_suffix
32
+
33
+ # Longest value accepted.
34
+ attr_accessor :max_length
35
+
36
+ # Shortest value accepted, after surrounding whitespace is removed.
37
+ attr_accessor :min_length
38
+
39
+ # Attribute mapping from ruby-style variable name to JSON key.
40
+ def self.attribute_map
41
+ {
42
+ :'description' => :'description',
43
+ :'format_hint' => :'format_hint',
44
+ :'id' => :'id',
45
+ :'label' => :'label',
46
+ :'mask_suffix' => :'mask_suffix',
47
+ :'max_length' => :'max_length',
48
+ :'min_length' => :'min_length'
49
+ }
50
+ end
51
+
52
+ # Returns all the JSON keys this model knows about
53
+ def self.acceptable_attributes
54
+ attribute_map.values
55
+ end
56
+
57
+ # Attribute type mapping.
58
+ def self.openapi_types
59
+ {
60
+ :'description' => :'String',
61
+ :'format_hint' => :'String',
62
+ :'id' => :'String',
63
+ :'label' => :'String',
64
+ :'mask_suffix' => :'Integer',
65
+ :'max_length' => :'Integer',
66
+ :'min_length' => :'Integer'
67
+ }
68
+ end
69
+
70
+ # List of attributes with nullable: true
71
+ def self.openapi_nullable
72
+ Set.new([
73
+ ])
74
+ end
75
+
76
+ # Initializes the object
77
+ # @param [Hash] attributes Model attributes in the form of hash
78
+ def initialize(attributes = {})
79
+ if (!attributes.is_a?(Hash))
80
+ fail ArgumentError, "The input argument (attributes) must be a hash in `UltracartClient::SfvbSecretKind` initialize method"
81
+ end
82
+
83
+ # check to see if the attribute exists and convert string to symbol for hash key
84
+ attributes = attributes.each_with_object({}) { |(k, v), h|
85
+ if (!self.class.attribute_map.key?(k.to_sym))
86
+ fail ArgumentError, "`#{k}` is not a valid attribute in `UltracartClient::SfvbSecretKind`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
87
+ end
88
+ h[k.to_sym] = v
89
+ }
90
+
91
+ if attributes.key?(:'description')
92
+ self.description = attributes[:'description']
93
+ end
94
+
95
+ if attributes.key?(:'format_hint')
96
+ self.format_hint = attributes[:'format_hint']
97
+ end
98
+
99
+ if attributes.key?(:'id')
100
+ self.id = attributes[:'id']
101
+ end
102
+
103
+ if attributes.key?(:'label')
104
+ self.label = attributes[:'label']
105
+ end
106
+
107
+ if attributes.key?(:'mask_suffix')
108
+ self.mask_suffix = attributes[:'mask_suffix']
109
+ end
110
+
111
+ if attributes.key?(:'max_length')
112
+ self.max_length = attributes[:'max_length']
113
+ end
114
+
115
+ if attributes.key?(:'min_length')
116
+ self.min_length = attributes[:'min_length']
117
+ end
118
+ end
119
+
120
+ # Show invalid properties with the reasons. Usually used together with valid?
121
+ # @return Array for valid properties with the reasons
122
+ def list_invalid_properties
123
+ invalid_properties = Array.new
124
+ invalid_properties
125
+ end
126
+
127
+ # Check to see if the all the properties in the model are valid
128
+ # @return true if the model is valid
129
+ def valid?
130
+ true
131
+ end
132
+
133
+ # Checks equality by comparing each attribute.
134
+ # @param [Object] Object to be compared
135
+ def ==(o)
136
+ return true if self.equal?(o)
137
+ self.class == o.class &&
138
+ description == o.description &&
139
+ format_hint == o.format_hint &&
140
+ id == o.id &&
141
+ label == o.label &&
142
+ mask_suffix == o.mask_suffix &&
143
+ max_length == o.max_length &&
144
+ min_length == o.min_length
145
+ end
146
+
147
+ # @see the `==` method
148
+ # @param [Object] Object to be compared
149
+ def eql?(o)
150
+ self == o
151
+ end
152
+
153
+ # Calculates hash code according to all attributes.
154
+ # @return [Integer] Hash code
155
+ def hash
156
+ [description, format_hint, id, label, mask_suffix, max_length, min_length].hash
157
+ end
158
+
159
+ # Builds the object from hash
160
+ # @param [Hash] attributes Model attributes in the form of hash
161
+ # @return [Object] Returns the model itself
162
+ def self.build_from_hash(attributes)
163
+ new.build_from_hash(attributes)
164
+ end
165
+
166
+ # Builds the object from hash
167
+ # @param [Hash] attributes Model attributes in the form of hash
168
+ # @return [Object] Returns the model itself
169
+ def build_from_hash(attributes)
170
+ return nil unless attributes.is_a?(Hash)
171
+ attributes = attributes.transform_keys(&:to_sym)
172
+ self.class.openapi_types.each_pair do |key, type|
173
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
174
+ self.send("#{key}=", nil)
175
+ elsif type =~ /\AArray<(.*)>/i
176
+ # check to ensure the input is an array given that the attribute
177
+ # is documented as an array but the input is not
178
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
179
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
180
+ end
181
+ elsif !attributes[self.class.attribute_map[key]].nil?
182
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
183
+ end
184
+ end
185
+
186
+ self
187
+ end
188
+
189
+ # Deserializes the data based on type
190
+ # @param string type Data type
191
+ # @param string value Value to be deserialized
192
+ # @return [Object] Deserialized data
193
+ def _deserialize(type, value)
194
+ case type.to_sym
195
+ when :Time
196
+ Time.parse(value)
197
+ when :Date
198
+ Date.parse(value)
199
+ when :String
200
+ value.to_s
201
+ when :Integer
202
+ value.to_i
203
+ when :Float
204
+ value.to_f
205
+ when :Boolean
206
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
207
+ true
208
+ else
209
+ false
210
+ end
211
+ when :Object
212
+ # generic object (usually a Hash), return directly
213
+ value
214
+ when /\AArray<(?<inner_type>.+)>\z/
215
+ inner_type = Regexp.last_match[:inner_type]
216
+ value.map { |v| _deserialize(inner_type, v) }
217
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
218
+ k_type = Regexp.last_match[:k_type]
219
+ v_type = Regexp.last_match[:v_type]
220
+ {}.tap do |hash|
221
+ value.each do |k, v|
222
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
223
+ end
224
+ end
225
+ else # model
226
+ # models (e.g. Pet) or oneOf
227
+ klass = UltracartClient.const_get(type)
228
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
229
+ end
230
+ end
231
+
232
+ # Returns the string representation of the object
233
+ # @return [String] String presentation of the object
234
+ def to_s
235
+ to_hash.to_s
236
+ end
237
+
238
+ # to_body is an alias to to_hash (backward compatibility)
239
+ # @return [Hash] Returns the object in the form of hash
240
+ def to_body
241
+ to_hash
242
+ end
243
+
244
+ # Returns the object in the form of hash
245
+ # @return [Hash] Returns the object in the form of hash
246
+ def to_hash
247
+ hash = {}
248
+ self.class.attribute_map.each_pair do |attr, param|
249
+ value = self.send(attr)
250
+ if value.nil?
251
+ is_nullable = self.class.openapi_nullable.include?(attr)
252
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
253
+ end
254
+
255
+ hash[param] = _to_hash(value)
256
+ end
257
+ hash
258
+ end
259
+
260
+ # Outputs non-array value in the form of hash
261
+ # For object, use to_hash. Otherwise, just return the value
262
+ # @param [Object] value Any valid value
263
+ # @return [Hash] Returns the value in the form of hash
264
+ def _to_hash(value)
265
+ if value.is_a?(Array)
266
+ value.compact.map { |v| _to_hash(v) }
267
+ elsif value.is_a?(Hash)
268
+ {}.tap do |hash|
269
+ value.each { |k, v| hash[k] = _to_hash(v) }
270
+ end
271
+ elsif value.respond_to? :to_hash
272
+ value.to_hash
273
+ else
274
+ value
275
+ end
276
+ end
277
+
278
+ end
279
+
280
+ end