ultracart_api 4.1.92 → 4.1.94

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 (31) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +22 -2
  3. data/docs/FraudApi.md +278 -0
  4. data/docs/FraudDeclineEmailRequest.md +18 -0
  5. data/docs/FraudLookupValues.md +28 -0
  6. data/docs/FraudLookupValuesResponse.md +26 -0
  7. data/docs/FraudRuleInsertRequest.md +76 -0
  8. data/docs/FraudRuleItemFilter.md +20 -0
  9. data/docs/FraudRulePublic.md +90 -0
  10. data/docs/FraudRuleResponse.md +26 -0
  11. data/docs/FraudRuleRotatingTransactionGatewayFilter.md +20 -0
  12. data/docs/FraudRuleSearchRequest.md +78 -0
  13. data/docs/FraudRuleStorefrontFilter.md +20 -0
  14. data/docs/FraudRulesResponse.md +26 -0
  15. data/docs/ItemVariantItem.md +2 -0
  16. data/lib/ultracart_api/api/fraud_api.rb +373 -0
  17. data/lib/ultracart_api/models/fraud_decline_email_request.rb +220 -0
  18. data/lib/ultracart_api/models/fraud_lookup_values.rb +270 -0
  19. data/lib/ultracart_api/models/fraud_lookup_values_response.rb +256 -0
  20. data/lib/ultracart_api/models/fraud_rule_insert_request.rb +583 -0
  21. data/lib/ultracart_api/models/fraud_rule_item_filter.rb +245 -0
  22. data/lib/ultracart_api/models/fraud_rule_public.rb +652 -0
  23. data/lib/ultracart_api/models/fraud_rule_response.rb +256 -0
  24. data/lib/ultracart_api/models/fraud_rule_rotating_transaction_gateway_filter.rb +230 -0
  25. data/lib/ultracart_api/models/fraud_rule_search_request.rb +572 -0
  26. data/lib/ultracart_api/models/fraud_rule_storefront_filter.rb +245 -0
  27. data/lib/ultracart_api/models/fraud_rules_response.rb +259 -0
  28. data/lib/ultracart_api/models/item_variant_item.rb +11 -1
  29. data/lib/ultracart_api/version.rb +1 -1
  30. data/lib/ultracart_api.rb +12 -0
  31. metadata +26 -2
@@ -0,0 +1,245 @@
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 FraudRuleItemFilter
18
+ # Unique item id of this item filter
19
+ attr_accessor :merchant_item_id
20
+
21
+ # Unique object identifier of this item
22
+ attr_accessor :merchant_item_oid
23
+
24
+ # Attribute mapping from ruby-style variable name to JSON key.
25
+ def self.attribute_map
26
+ {
27
+ :'merchant_item_id' => :'merchant_item_id',
28
+ :'merchant_item_oid' => :'merchant_item_oid'
29
+ }
30
+ end
31
+
32
+ # Returns all the JSON keys this model knows about
33
+ def self.acceptable_attributes
34
+ attribute_map.values
35
+ end
36
+
37
+ # Attribute type mapping.
38
+ def self.openapi_types
39
+ {
40
+ :'merchant_item_id' => :'String',
41
+ :'merchant_item_oid' => :'Integer'
42
+ }
43
+ end
44
+
45
+ # List of attributes with nullable: true
46
+ def self.openapi_nullable
47
+ Set.new([
48
+ ])
49
+ end
50
+
51
+ # Initializes the object
52
+ # @param [Hash] attributes Model attributes in the form of hash
53
+ def initialize(attributes = {})
54
+ if (!attributes.is_a?(Hash))
55
+ fail ArgumentError, "The input argument (attributes) must be a hash in `UltracartClient::FraudRuleItemFilter` initialize method"
56
+ end
57
+
58
+ # check to see if the attribute exists and convert string to symbol for hash key
59
+ attributes = attributes.each_with_object({}) { |(k, v), h|
60
+ if (!self.class.attribute_map.key?(k.to_sym))
61
+ fail ArgumentError, "`#{k}` is not a valid attribute in `UltracartClient::FraudRuleItemFilter`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
62
+ end
63
+ h[k.to_sym] = v
64
+ }
65
+
66
+ if attributes.key?(:'merchant_item_id')
67
+ self.merchant_item_id = attributes[:'merchant_item_id']
68
+ end
69
+
70
+ if attributes.key?(:'merchant_item_oid')
71
+ self.merchant_item_oid = attributes[:'merchant_item_oid']
72
+ end
73
+ end
74
+
75
+ # Show invalid properties with the reasons. Usually used together with valid?
76
+ # @return Array for valid properties with the reasons
77
+ def list_invalid_properties
78
+ invalid_properties = Array.new
79
+ if !@merchant_item_id.nil? && @merchant_item_id.to_s.length > 20
80
+ invalid_properties.push('invalid value for "merchant_item_id", the character length must be smaller than or equal to 20.')
81
+ end
82
+
83
+ invalid_properties
84
+ end
85
+
86
+ # Check to see if the all the properties in the model are valid
87
+ # @return true if the model is valid
88
+ def valid?
89
+ return false if !@merchant_item_id.nil? && @merchant_item_id.to_s.length > 20
90
+ true
91
+ end
92
+
93
+ # Custom attribute writer method with validation
94
+ # @param [Object] merchant_item_id Value to be assigned
95
+ def merchant_item_id=(merchant_item_id)
96
+ if !merchant_item_id.nil? && merchant_item_id.to_s.length > 20
97
+ fail ArgumentError, 'invalid value for "merchant_item_id", the character length must be smaller than or equal to 20.'
98
+ end
99
+
100
+ @merchant_item_id = merchant_item_id
101
+ end
102
+
103
+ # Checks equality by comparing each attribute.
104
+ # @param [Object] Object to be compared
105
+ def ==(o)
106
+ return true if self.equal?(o)
107
+ self.class == o.class &&
108
+ merchant_item_id == o.merchant_item_id &&
109
+ merchant_item_oid == o.merchant_item_oid
110
+ end
111
+
112
+ # @see the `==` method
113
+ # @param [Object] Object to be compared
114
+ def eql?(o)
115
+ self == o
116
+ end
117
+
118
+ # Calculates hash code according to all attributes.
119
+ # @return [Integer] Hash code
120
+ def hash
121
+ [merchant_item_id, merchant_item_oid].hash
122
+ end
123
+
124
+ # Builds the object from hash
125
+ # @param [Hash] attributes Model attributes in the form of hash
126
+ # @return [Object] Returns the model itself
127
+ def self.build_from_hash(attributes)
128
+ new.build_from_hash(attributes)
129
+ end
130
+
131
+ # Builds the object from hash
132
+ # @param [Hash] attributes Model attributes in the form of hash
133
+ # @return [Object] Returns the model itself
134
+ def build_from_hash(attributes)
135
+ return nil unless attributes.is_a?(Hash)
136
+ attributes = attributes.transform_keys(&:to_sym)
137
+ self.class.openapi_types.each_pair do |key, type|
138
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
139
+ self.send("#{key}=", nil)
140
+ elsif type =~ /\AArray<(.*)>/i
141
+ # check to ensure the input is an array given that the attribute
142
+ # is documented as an array but the input is not
143
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
144
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
145
+ end
146
+ elsif !attributes[self.class.attribute_map[key]].nil?
147
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
148
+ end
149
+ end
150
+
151
+ self
152
+ end
153
+
154
+ # Deserializes the data based on type
155
+ # @param string type Data type
156
+ # @param string value Value to be deserialized
157
+ # @return [Object] Deserialized data
158
+ def _deserialize(type, value)
159
+ case type.to_sym
160
+ when :Time
161
+ Time.parse(value)
162
+ when :Date
163
+ Date.parse(value)
164
+ when :String
165
+ value.to_s
166
+ when :Integer
167
+ value.to_i
168
+ when :Float
169
+ value.to_f
170
+ when :Boolean
171
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
172
+ true
173
+ else
174
+ false
175
+ end
176
+ when :Object
177
+ # generic object (usually a Hash), return directly
178
+ value
179
+ when /\AArray<(?<inner_type>.+)>\z/
180
+ inner_type = Regexp.last_match[:inner_type]
181
+ value.map { |v| _deserialize(inner_type, v) }
182
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
183
+ k_type = Regexp.last_match[:k_type]
184
+ v_type = Regexp.last_match[:v_type]
185
+ {}.tap do |hash|
186
+ value.each do |k, v|
187
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
188
+ end
189
+ end
190
+ else # model
191
+ # models (e.g. Pet) or oneOf
192
+ klass = UltracartClient.const_get(type)
193
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
194
+ end
195
+ end
196
+
197
+ # Returns the string representation of the object
198
+ # @return [String] String presentation of the object
199
+ def to_s
200
+ to_hash.to_s
201
+ end
202
+
203
+ # to_body is an alias to to_hash (backward compatibility)
204
+ # @return [Hash] Returns the object in the form of hash
205
+ def to_body
206
+ to_hash
207
+ end
208
+
209
+ # Returns the object in the form of hash
210
+ # @return [Hash] Returns the object in the form of hash
211
+ def to_hash
212
+ hash = {}
213
+ self.class.attribute_map.each_pair do |attr, param|
214
+ value = self.send(attr)
215
+ if value.nil?
216
+ is_nullable = self.class.openapi_nullable.include?(attr)
217
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
218
+ end
219
+
220
+ hash[param] = _to_hash(value)
221
+ end
222
+ hash
223
+ end
224
+
225
+ # Outputs non-array value in the form of hash
226
+ # For object, use to_hash. Otherwise, just return the value
227
+ # @param [Object] value Any valid value
228
+ # @return [Hash] Returns the value in the form of hash
229
+ def _to_hash(value)
230
+ if value.is_a?(Array)
231
+ value.compact.map { |v| _to_hash(v) }
232
+ elsif value.is_a?(Hash)
233
+ {}.tap do |hash|
234
+ value.each { |k, v| hash[k] = _to_hash(v) }
235
+ end
236
+ elsif value.respond_to? :to_hash
237
+ value.to_hash
238
+ else
239
+ value
240
+ end
241
+ end
242
+
243
+ end
244
+
245
+ end