tremendous_ruby 5.12.0 → 5.14.0
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.
- checksums.yaml +4 -4
- data/lib/tremendous/api/tremendous_api.rb +202 -9
- data/lib/tremendous/models/allow_email.rb +9 -0
- data/lib/tremendous/models/allow_email1.rb +9 -0
- data/lib/tremendous/models/allow_ip.rb +9 -0
- data/lib/tremendous/models/allow_ip1.rb +9 -0
- data/lib/tremendous/models/create_invoice_request.rb +48 -2
- data/lib/tremendous/models/create_topup200_response.rb +220 -0
- data/lib/tremendous/models/create_topup_request.rb +292 -0
- data/lib/tremendous/models/custom_field.rb +1 -1
- data/lib/tremendous/models/fraud_config_allow_email.rb +9 -0
- data/lib/tremendous/models/fraud_config_ip.rb +9 -0
- data/lib/tremendous/models/fraud_config_review_email.rb +19 -0
- data/lib/tremendous/models/fraud_review.rb +66 -56
- data/lib/tremendous/models/fraud_review_base.rb +358 -0
- data/lib/tremendous/models/fraud_review_list_item.rb +85 -4
- data/lib/tremendous/models/fraud_review_redemption_method.rb +7 -5
- data/lib/tremendous/models/funding_source.rb +3 -3
- data/lib/tremendous/models/get_fraud_review200_response_fraud_review.rb +66 -56
- data/lib/tremendous/models/invoice.rb +26 -2
- data/lib/tremendous/models/list_fraud_reviews200_response_fraud_reviews_inner.rb +85 -4
- data/lib/tremendous/models/list_fraud_reviews200_response_fraud_reviews_inner_geo.rb +242 -0
- data/lib/tremendous/models/list_funding_sources200_response_funding_sources_inner.rb +3 -3
- data/lib/tremendous/models/list_funding_sources200_response_funding_sources_inner_meta.rb +7 -2
- data/lib/tremendous/models/list_invoices200_response_invoices_inner.rb +26 -2
- data/lib/tremendous/models/list_products_response_products_inner.rb +24 -2
- data/lib/tremendous/models/list_rewards200_response_rewards_inner_custom_fields_inner.rb +1 -1
- data/lib/tremendous/models/list_topups200_response.rb +232 -0
- data/lib/tremendous/models/list_topups200_response_topups_inner.rb +326 -0
- data/lib/tremendous/models/product.rb +24 -2
- data/lib/tremendous/models/review_email.rb +19 -0
- data/lib/tremendous/models/review_email1.rb +19 -0
- data/lib/tremendous/models/review_ip.rb +9 -0
- data/lib/tremendous/models/review_ip1.rb +9 -0
- data/lib/tremendous/models/reward_base_custom_fields_inner.rb +1 -1
- data/lib/tremendous/models/single_reward_order_reward_custom_fields_inner.rb +1 -1
- data/lib/tremendous/models/topup.rb +326 -0
- data/lib/tremendous/models/topup_create_request.rb +292 -0
- data/lib/tremendous/version.rb +1 -1
- data/lib/tremendous.rb +8 -1
- metadata +9 -1
|
@@ -0,0 +1,232 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#API Endpoints
|
|
3
|
+
|
|
4
|
+
#Deliver monetary rewards and incentives to employees, customers, survey participants, and more through the Tremendous API. For organizational tasks, like managing your organization and its members within Tremendous, please see the Tremendous Organizational API.
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: 2
|
|
7
|
+
Contact: developers@tremendous.com
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
Generator version: 7.12.0
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'date'
|
|
14
|
+
require 'time'
|
|
15
|
+
|
|
16
|
+
module Tremendous
|
|
17
|
+
class ListTopups200Response
|
|
18
|
+
attr_accessor :topups
|
|
19
|
+
|
|
20
|
+
# The total number of topups across all pages
|
|
21
|
+
attr_accessor :total_count
|
|
22
|
+
|
|
23
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
24
|
+
def self.attribute_map
|
|
25
|
+
{
|
|
26
|
+
:'topups' => :'topups',
|
|
27
|
+
:'total_count' => :'total_count'
|
|
28
|
+
}
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
# Returns attribute mapping this model knows about
|
|
32
|
+
def self.acceptable_attribute_map
|
|
33
|
+
attribute_map
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
# Returns all the JSON keys this model knows about
|
|
37
|
+
def self.acceptable_attributes
|
|
38
|
+
acceptable_attribute_map.values
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
# Attribute type mapping.
|
|
42
|
+
def self.openapi_types
|
|
43
|
+
{
|
|
44
|
+
:'topups' => :'Array<ListTopups200ResponseTopupsInner>',
|
|
45
|
+
:'total_count' => :'Integer'
|
|
46
|
+
}
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
# List of attributes with nullable: true
|
|
50
|
+
def self.openapi_nullable
|
|
51
|
+
Set.new([
|
|
52
|
+
])
|
|
53
|
+
end
|
|
54
|
+
|
|
55
|
+
# Initializes the object
|
|
56
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
57
|
+
def initialize(attributes = {})
|
|
58
|
+
if (!attributes.is_a?(Hash))
|
|
59
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Tremendous::ListTopups200Response` initialize method"
|
|
60
|
+
end
|
|
61
|
+
|
|
62
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
63
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
64
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
65
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
66
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Tremendous::ListTopups200Response`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
67
|
+
end
|
|
68
|
+
h[k.to_sym] = v
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
if attributes.key?(:'topups')
|
|
72
|
+
if (value = attributes[:'topups']).is_a?(Array)
|
|
73
|
+
self.topups = value
|
|
74
|
+
end
|
|
75
|
+
end
|
|
76
|
+
|
|
77
|
+
if attributes.key?(:'total_count')
|
|
78
|
+
self.total_count = attributes[:'total_count']
|
|
79
|
+
end
|
|
80
|
+
end
|
|
81
|
+
|
|
82
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
83
|
+
# @return Array for valid properties with the reasons
|
|
84
|
+
def list_invalid_properties
|
|
85
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
86
|
+
invalid_properties = Array.new
|
|
87
|
+
invalid_properties
|
|
88
|
+
end
|
|
89
|
+
|
|
90
|
+
# Check to see if the all the properties in the model are valid
|
|
91
|
+
# @return true if the model is valid
|
|
92
|
+
def valid?
|
|
93
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
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
|
+
topups == o.topups &&
|
|
103
|
+
total_count == o.total_count
|
|
104
|
+
end
|
|
105
|
+
|
|
106
|
+
# @see the `==` method
|
|
107
|
+
# @param [Object] Object to be compared
|
|
108
|
+
def eql?(o)
|
|
109
|
+
self == o
|
|
110
|
+
end
|
|
111
|
+
|
|
112
|
+
# Calculates hash code according to all attributes.
|
|
113
|
+
# @return [Integer] Hash code
|
|
114
|
+
def hash
|
|
115
|
+
[topups, total_count].hash
|
|
116
|
+
end
|
|
117
|
+
|
|
118
|
+
# Builds the object from hash
|
|
119
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
120
|
+
# @return [Object] Returns the model itself
|
|
121
|
+
def self.build_from_hash(attributes)
|
|
122
|
+
return nil unless attributes.is_a?(Hash)
|
|
123
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
124
|
+
transformed_hash = {}
|
|
125
|
+
openapi_types.each_pair do |key, type|
|
|
126
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
127
|
+
transformed_hash["#{key}"] = nil
|
|
128
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
129
|
+
# check to ensure the input is an array given that the attribute
|
|
130
|
+
# is documented as an array but the input is not
|
|
131
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
132
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
133
|
+
end
|
|
134
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
135
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
136
|
+
end
|
|
137
|
+
end
|
|
138
|
+
new(transformed_hash)
|
|
139
|
+
end
|
|
140
|
+
|
|
141
|
+
# Deserializes the data based on type
|
|
142
|
+
# @param string type Data type
|
|
143
|
+
# @param string value Value to be deserialized
|
|
144
|
+
# @return [Object] Deserialized data
|
|
145
|
+
def self._deserialize(type, value)
|
|
146
|
+
case type.to_sym
|
|
147
|
+
when :Time
|
|
148
|
+
Time.parse(value)
|
|
149
|
+
when :Date
|
|
150
|
+
Date.parse(value)
|
|
151
|
+
when :String
|
|
152
|
+
value.to_s
|
|
153
|
+
when :Integer
|
|
154
|
+
value.to_i
|
|
155
|
+
when :Float
|
|
156
|
+
value.to_f
|
|
157
|
+
when :Boolean
|
|
158
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
159
|
+
true
|
|
160
|
+
else
|
|
161
|
+
false
|
|
162
|
+
end
|
|
163
|
+
when :Object
|
|
164
|
+
# generic object (usually a Hash), return directly
|
|
165
|
+
value
|
|
166
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
|
167
|
+
inner_type = Regexp.last_match[:inner_type]
|
|
168
|
+
value.map { |v| _deserialize(inner_type, v) }
|
|
169
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
170
|
+
k_type = Regexp.last_match[:k_type]
|
|
171
|
+
v_type = Regexp.last_match[:v_type]
|
|
172
|
+
{}.tap do |hash|
|
|
173
|
+
value.each do |k, v|
|
|
174
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
175
|
+
end
|
|
176
|
+
end
|
|
177
|
+
else # model
|
|
178
|
+
# models (e.g. Pet) or oneOf
|
|
179
|
+
klass = Tremendous.const_get(type)
|
|
180
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
181
|
+
end
|
|
182
|
+
end
|
|
183
|
+
|
|
184
|
+
# Returns the string representation of the object
|
|
185
|
+
# @return [String] String presentation of the object
|
|
186
|
+
def to_s
|
|
187
|
+
to_hash.to_s
|
|
188
|
+
end
|
|
189
|
+
|
|
190
|
+
# to_body is an alias to to_hash (backward compatibility)
|
|
191
|
+
# @return [Hash] Returns the object in the form of hash
|
|
192
|
+
def to_body
|
|
193
|
+
to_hash
|
|
194
|
+
end
|
|
195
|
+
|
|
196
|
+
# Returns the object in the form of hash
|
|
197
|
+
# @return [Hash] Returns the object in the form of hash
|
|
198
|
+
def to_hash
|
|
199
|
+
hash = {}
|
|
200
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
201
|
+
value = self.send(attr)
|
|
202
|
+
if value.nil?
|
|
203
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
204
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
205
|
+
end
|
|
206
|
+
|
|
207
|
+
hash[param] = _to_hash(value)
|
|
208
|
+
end
|
|
209
|
+
hash
|
|
210
|
+
end
|
|
211
|
+
|
|
212
|
+
# Outputs non-array value in the form of hash
|
|
213
|
+
# For object, use to_hash. Otherwise, just return the value
|
|
214
|
+
# @param [Object] value Any valid value
|
|
215
|
+
# @return [Hash] Returns the value in the form of hash
|
|
216
|
+
def _to_hash(value)
|
|
217
|
+
if value.is_a?(Array)
|
|
218
|
+
value.compact.map { |v| _to_hash(v) }
|
|
219
|
+
elsif value.is_a?(Hash)
|
|
220
|
+
{}.tap do |hash|
|
|
221
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
222
|
+
end
|
|
223
|
+
elsif value.respond_to? :to_hash
|
|
224
|
+
value.to_hash
|
|
225
|
+
else
|
|
226
|
+
value
|
|
227
|
+
end
|
|
228
|
+
end
|
|
229
|
+
|
|
230
|
+
end
|
|
231
|
+
|
|
232
|
+
end
|
|
@@ -0,0 +1,326 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#API Endpoints
|
|
3
|
+
|
|
4
|
+
#Deliver monetary rewards and incentives to employees, customers, survey participants, and more through the Tremendous API. For organizational tasks, like managing your organization and its members within Tremendous, please see the Tremendous Organizational API.
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: 2
|
|
7
|
+
Contact: developers@tremendous.com
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
Generator version: 7.12.0
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'date'
|
|
14
|
+
require 'time'
|
|
15
|
+
|
|
16
|
+
module Tremendous
|
|
17
|
+
class ListTopups200ResponseTopupsInner
|
|
18
|
+
# Unique identifier for the topup request.
|
|
19
|
+
attr_accessor :id
|
|
20
|
+
|
|
21
|
+
# Amount in USD intended to be added to your organization’s balance.
|
|
22
|
+
attr_accessor :amount
|
|
23
|
+
|
|
24
|
+
# Amount of the processing fee for the topup (typically reserved for credit card topups).
|
|
25
|
+
attr_accessor :processing_fee
|
|
26
|
+
|
|
27
|
+
# ID of the funding_source object used for this topup.
|
|
28
|
+
attr_accessor :funding_source_id
|
|
29
|
+
|
|
30
|
+
# Status of the topup <table> <thead> <tr> <th> Status </th> <th> Description </th> </tr> </thead> <tbody> <tr> <td> <code> created </code> </td> <td> The topup is processing (and may be under review). </td> </tr> <tr> <td> <code> fully_credited </code> </td> <td> The funds have been added to the balance. </td> </tr> <tr> <td> <code> reversed </code> </td> <td> The topup was credited, but then reversed due to a chargeback or ACH return. </td> </tr> <tr> <td> <code> rejected </code> </td> <td> The topup was rejected by an admin. </td> </tr> </tbody> </table>
|
|
31
|
+
attr_accessor :status
|
|
32
|
+
|
|
33
|
+
# Timestamp indicating when the topup object was created (when the request was made).
|
|
34
|
+
attr_accessor :created_at
|
|
35
|
+
|
|
36
|
+
# Timestamp indicating when the topup amount was fully credited to the balance.
|
|
37
|
+
attr_accessor :fully_credited_at
|
|
38
|
+
|
|
39
|
+
# Timestamp indicating when the topup was rejected.
|
|
40
|
+
attr_accessor :rejected_at
|
|
41
|
+
|
|
42
|
+
# Timestamp indicating when the topup was reversed.
|
|
43
|
+
attr_accessor :reversed_at
|
|
44
|
+
|
|
45
|
+
# A sentence explaining why the topup was reversed.
|
|
46
|
+
attr_accessor :reversed_reason
|
|
47
|
+
|
|
48
|
+
# Idempotency key to prevent duplicate requests.
|
|
49
|
+
attr_accessor :idempotency_key
|
|
50
|
+
|
|
51
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
52
|
+
def self.attribute_map
|
|
53
|
+
{
|
|
54
|
+
:'id' => :'id',
|
|
55
|
+
:'amount' => :'amount',
|
|
56
|
+
:'processing_fee' => :'processing_fee',
|
|
57
|
+
:'funding_source_id' => :'funding_source_id',
|
|
58
|
+
:'status' => :'status',
|
|
59
|
+
:'created_at' => :'created_at',
|
|
60
|
+
:'fully_credited_at' => :'fully_credited_at',
|
|
61
|
+
:'rejected_at' => :'rejected_at',
|
|
62
|
+
:'reversed_at' => :'reversed_at',
|
|
63
|
+
:'reversed_reason' => :'reversed_reason',
|
|
64
|
+
:'idempotency_key' => :'idempotency_key'
|
|
65
|
+
}
|
|
66
|
+
end
|
|
67
|
+
|
|
68
|
+
# Returns attribute mapping this model knows about
|
|
69
|
+
def self.acceptable_attribute_map
|
|
70
|
+
attribute_map
|
|
71
|
+
end
|
|
72
|
+
|
|
73
|
+
# Returns all the JSON keys this model knows about
|
|
74
|
+
def self.acceptable_attributes
|
|
75
|
+
acceptable_attribute_map.values
|
|
76
|
+
end
|
|
77
|
+
|
|
78
|
+
# Attribute type mapping.
|
|
79
|
+
def self.openapi_types
|
|
80
|
+
{
|
|
81
|
+
:'id' => :'String',
|
|
82
|
+
:'amount' => :'Float',
|
|
83
|
+
:'processing_fee' => :'Float',
|
|
84
|
+
:'funding_source_id' => :'String',
|
|
85
|
+
:'status' => :'String',
|
|
86
|
+
:'created_at' => :'Time',
|
|
87
|
+
:'fully_credited_at' => :'Time',
|
|
88
|
+
:'rejected_at' => :'Time',
|
|
89
|
+
:'reversed_at' => :'Time',
|
|
90
|
+
:'reversed_reason' => :'String',
|
|
91
|
+
:'idempotency_key' => :'String'
|
|
92
|
+
}
|
|
93
|
+
end
|
|
94
|
+
|
|
95
|
+
# List of attributes with nullable: true
|
|
96
|
+
def self.openapi_nullable
|
|
97
|
+
Set.new([
|
|
98
|
+
:'fully_credited_at',
|
|
99
|
+
:'rejected_at',
|
|
100
|
+
:'reversed_at',
|
|
101
|
+
:'reversed_reason',
|
|
102
|
+
:'idempotency_key'
|
|
103
|
+
])
|
|
104
|
+
end
|
|
105
|
+
|
|
106
|
+
# Initializes the object
|
|
107
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
108
|
+
def initialize(attributes = {})
|
|
109
|
+
if (!attributes.is_a?(Hash))
|
|
110
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Tremendous::ListTopups200ResponseTopupsInner` initialize method"
|
|
111
|
+
end
|
|
112
|
+
|
|
113
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
114
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
115
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
116
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
117
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Tremendous::ListTopups200ResponseTopupsInner`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
118
|
+
end
|
|
119
|
+
h[k.to_sym] = v
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
if attributes.key?(:'id')
|
|
123
|
+
self.id = attributes[:'id']
|
|
124
|
+
end
|
|
125
|
+
|
|
126
|
+
if attributes.key?(:'amount')
|
|
127
|
+
self.amount = attributes[:'amount']
|
|
128
|
+
end
|
|
129
|
+
|
|
130
|
+
if attributes.key?(:'processing_fee')
|
|
131
|
+
self.processing_fee = attributes[:'processing_fee']
|
|
132
|
+
end
|
|
133
|
+
|
|
134
|
+
if attributes.key?(:'funding_source_id')
|
|
135
|
+
self.funding_source_id = attributes[:'funding_source_id']
|
|
136
|
+
end
|
|
137
|
+
|
|
138
|
+
if attributes.key?(:'status')
|
|
139
|
+
self.status = attributes[:'status']
|
|
140
|
+
end
|
|
141
|
+
|
|
142
|
+
if attributes.key?(:'created_at')
|
|
143
|
+
self.created_at = attributes[:'created_at']
|
|
144
|
+
end
|
|
145
|
+
|
|
146
|
+
if attributes.key?(:'fully_credited_at')
|
|
147
|
+
self.fully_credited_at = attributes[:'fully_credited_at']
|
|
148
|
+
end
|
|
149
|
+
|
|
150
|
+
if attributes.key?(:'rejected_at')
|
|
151
|
+
self.rejected_at = attributes[:'rejected_at']
|
|
152
|
+
end
|
|
153
|
+
|
|
154
|
+
if attributes.key?(:'reversed_at')
|
|
155
|
+
self.reversed_at = attributes[:'reversed_at']
|
|
156
|
+
end
|
|
157
|
+
|
|
158
|
+
if attributes.key?(:'reversed_reason')
|
|
159
|
+
self.reversed_reason = attributes[:'reversed_reason']
|
|
160
|
+
end
|
|
161
|
+
|
|
162
|
+
if attributes.key?(:'idempotency_key')
|
|
163
|
+
self.idempotency_key = attributes[:'idempotency_key']
|
|
164
|
+
end
|
|
165
|
+
end
|
|
166
|
+
|
|
167
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
168
|
+
# @return Array for valid properties with the reasons
|
|
169
|
+
def list_invalid_properties
|
|
170
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
171
|
+
invalid_properties = Array.new
|
|
172
|
+
invalid_properties
|
|
173
|
+
end
|
|
174
|
+
|
|
175
|
+
# Check to see if the all the properties in the model are valid
|
|
176
|
+
# @return true if the model is valid
|
|
177
|
+
def valid?
|
|
178
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
179
|
+
true
|
|
180
|
+
end
|
|
181
|
+
|
|
182
|
+
# Checks equality by comparing each attribute.
|
|
183
|
+
# @param [Object] Object to be compared
|
|
184
|
+
def ==(o)
|
|
185
|
+
return true if self.equal?(o)
|
|
186
|
+
self.class == o.class &&
|
|
187
|
+
id == o.id &&
|
|
188
|
+
amount == o.amount &&
|
|
189
|
+
processing_fee == o.processing_fee &&
|
|
190
|
+
funding_source_id == o.funding_source_id &&
|
|
191
|
+
status == o.status &&
|
|
192
|
+
created_at == o.created_at &&
|
|
193
|
+
fully_credited_at == o.fully_credited_at &&
|
|
194
|
+
rejected_at == o.rejected_at &&
|
|
195
|
+
reversed_at == o.reversed_at &&
|
|
196
|
+
reversed_reason == o.reversed_reason &&
|
|
197
|
+
idempotency_key == o.idempotency_key
|
|
198
|
+
end
|
|
199
|
+
|
|
200
|
+
# @see the `==` method
|
|
201
|
+
# @param [Object] Object to be compared
|
|
202
|
+
def eql?(o)
|
|
203
|
+
self == o
|
|
204
|
+
end
|
|
205
|
+
|
|
206
|
+
# Calculates hash code according to all attributes.
|
|
207
|
+
# @return [Integer] Hash code
|
|
208
|
+
def hash
|
|
209
|
+
[id, amount, processing_fee, funding_source_id, status, created_at, fully_credited_at, rejected_at, reversed_at, reversed_reason, idempotency_key].hash
|
|
210
|
+
end
|
|
211
|
+
|
|
212
|
+
# Builds the object from hash
|
|
213
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
214
|
+
# @return [Object] Returns the model itself
|
|
215
|
+
def self.build_from_hash(attributes)
|
|
216
|
+
return nil unless attributes.is_a?(Hash)
|
|
217
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
218
|
+
transformed_hash = {}
|
|
219
|
+
openapi_types.each_pair do |key, type|
|
|
220
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
221
|
+
transformed_hash["#{key}"] = nil
|
|
222
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
223
|
+
# check to ensure the input is an array given that the attribute
|
|
224
|
+
# is documented as an array but the input is not
|
|
225
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
226
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
227
|
+
end
|
|
228
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
229
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
230
|
+
end
|
|
231
|
+
end
|
|
232
|
+
new(transformed_hash)
|
|
233
|
+
end
|
|
234
|
+
|
|
235
|
+
# Deserializes the data based on type
|
|
236
|
+
# @param string type Data type
|
|
237
|
+
# @param string value Value to be deserialized
|
|
238
|
+
# @return [Object] Deserialized data
|
|
239
|
+
def self._deserialize(type, value)
|
|
240
|
+
case type.to_sym
|
|
241
|
+
when :Time
|
|
242
|
+
Time.parse(value)
|
|
243
|
+
when :Date
|
|
244
|
+
Date.parse(value)
|
|
245
|
+
when :String
|
|
246
|
+
value.to_s
|
|
247
|
+
when :Integer
|
|
248
|
+
value.to_i
|
|
249
|
+
when :Float
|
|
250
|
+
value.to_f
|
|
251
|
+
when :Boolean
|
|
252
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
253
|
+
true
|
|
254
|
+
else
|
|
255
|
+
false
|
|
256
|
+
end
|
|
257
|
+
when :Object
|
|
258
|
+
# generic object (usually a Hash), return directly
|
|
259
|
+
value
|
|
260
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
|
261
|
+
inner_type = Regexp.last_match[:inner_type]
|
|
262
|
+
value.map { |v| _deserialize(inner_type, v) }
|
|
263
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
264
|
+
k_type = Regexp.last_match[:k_type]
|
|
265
|
+
v_type = Regexp.last_match[:v_type]
|
|
266
|
+
{}.tap do |hash|
|
|
267
|
+
value.each do |k, v|
|
|
268
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
269
|
+
end
|
|
270
|
+
end
|
|
271
|
+
else # model
|
|
272
|
+
# models (e.g. Pet) or oneOf
|
|
273
|
+
klass = Tremendous.const_get(type)
|
|
274
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
275
|
+
end
|
|
276
|
+
end
|
|
277
|
+
|
|
278
|
+
# Returns the string representation of the object
|
|
279
|
+
# @return [String] String presentation of the object
|
|
280
|
+
def to_s
|
|
281
|
+
to_hash.to_s
|
|
282
|
+
end
|
|
283
|
+
|
|
284
|
+
# to_body is an alias to to_hash (backward compatibility)
|
|
285
|
+
# @return [Hash] Returns the object in the form of hash
|
|
286
|
+
def to_body
|
|
287
|
+
to_hash
|
|
288
|
+
end
|
|
289
|
+
|
|
290
|
+
# Returns the object in the form of hash
|
|
291
|
+
# @return [Hash] Returns the object in the form of hash
|
|
292
|
+
def to_hash
|
|
293
|
+
hash = {}
|
|
294
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
295
|
+
value = self.send(attr)
|
|
296
|
+
if value.nil?
|
|
297
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
298
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
299
|
+
end
|
|
300
|
+
|
|
301
|
+
hash[param] = _to_hash(value)
|
|
302
|
+
end
|
|
303
|
+
hash
|
|
304
|
+
end
|
|
305
|
+
|
|
306
|
+
# Outputs non-array value in the form of hash
|
|
307
|
+
# For object, use to_hash. Otherwise, just return the value
|
|
308
|
+
# @param [Object] value Any valid value
|
|
309
|
+
# @return [Hash] Returns the value in the form of hash
|
|
310
|
+
def _to_hash(value)
|
|
311
|
+
if value.is_a?(Array)
|
|
312
|
+
value.compact.map { |v| _to_hash(v) }
|
|
313
|
+
elsif value.is_a?(Hash)
|
|
314
|
+
{}.tap do |hash|
|
|
315
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
316
|
+
end
|
|
317
|
+
elsif value.respond_to? :to_hash
|
|
318
|
+
value.to_hash
|
|
319
|
+
else
|
|
320
|
+
value
|
|
321
|
+
end
|
|
322
|
+
end
|
|
323
|
+
|
|
324
|
+
end
|
|
325
|
+
|
|
326
|
+
end
|
|
@@ -24,9 +24,12 @@ module Tremendous
|
|
|
24
24
|
# Detailed description of the product. Mostly used for products with a `category` of `charities`.
|
|
25
25
|
attr_accessor :description
|
|
26
26
|
|
|
27
|
-
# The category of
|
|
27
|
+
# The category of the product <table> <thead> <tr> <th>Category</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td><code>ach</code></td> <td>Bank transfer to the recipient</td> </tr> <tr> <td><code>charity</code></td> <td>Donations to a charity</td> </tr> <tr> <td><code>instant_debit_transfer</code></td> <td>Instant debit transfer to the recipient</td> </tr> <tr> <td><code>merchant_card</code></td> <td>A gift card for a certain merchant (e.g. Amazon)</td> </tr> <tr> <td><code>paypal</code></td> <td>Payout via PayPal</td> </tr> <tr> <td><code>venmo</code></td> <td>Payout via Venmo</td> </tr> <tr> <td><code>visa_card</code></td> <td>Payout in form of a Visa debit card</td> </tr> <tr> <td><code>cash_app</code></td> <td>Payout via Cash App</td> </tr> </tbody> </table>
|
|
28
28
|
attr_accessor :category
|
|
29
29
|
|
|
30
|
+
# Additional classification for the product. Only applicable to products with a `category` of `merchant_card`. Possible subcategories: * `beauty_and_health` * `digital_financial_services` * `electronics` * `entertainment` * `fashion` * `food_and_drink` * `general_merchandise` * `grocery_and_supermarkets` * `home_and_living` * `mobility_and_fuel` * `sports_and_outdoor_gear` * `travel_and_hospitality`
|
|
31
|
+
attr_accessor :subcategory
|
|
32
|
+
|
|
30
33
|
# Legal disclosures for this product. Can be in HTML format.
|
|
31
34
|
attr_accessor :disclosure
|
|
32
35
|
|
|
@@ -76,6 +79,7 @@ module Tremendous
|
|
|
76
79
|
:'name' => :'name',
|
|
77
80
|
:'description' => :'description',
|
|
78
81
|
:'category' => :'category',
|
|
82
|
+
:'subcategory' => :'subcategory',
|
|
79
83
|
:'disclosure' => :'disclosure',
|
|
80
84
|
:'skus' => :'skus',
|
|
81
85
|
:'currency_codes' => :'currency_codes',
|
|
@@ -103,6 +107,7 @@ module Tremendous
|
|
|
103
107
|
:'name' => :'String',
|
|
104
108
|
:'description' => :'String',
|
|
105
109
|
:'category' => :'String',
|
|
110
|
+
:'subcategory' => :'String',
|
|
106
111
|
:'disclosure' => :'String',
|
|
107
112
|
:'skus' => :'Array<ListProductsResponseProductsInnerSkusInner>',
|
|
108
113
|
:'currency_codes' => :'Array<String>',
|
|
@@ -160,6 +165,10 @@ module Tremendous
|
|
|
160
165
|
self.category = nil
|
|
161
166
|
end
|
|
162
167
|
|
|
168
|
+
if attributes.key?(:'subcategory')
|
|
169
|
+
self.subcategory = attributes[:'subcategory']
|
|
170
|
+
end
|
|
171
|
+
|
|
163
172
|
if attributes.key?(:'disclosure')
|
|
164
173
|
self.disclosure = attributes[:'disclosure']
|
|
165
174
|
else
|
|
@@ -273,6 +282,8 @@ module Tremendous
|
|
|
273
282
|
return false if @category.nil?
|
|
274
283
|
category_validator = EnumAttributeValidator.new('String', ["ach", "charity", "instant_debit_transfer", "merchant_card", "paypal", "venmo", "visa_card", "cash_app"])
|
|
275
284
|
return false unless category_validator.valid?(@category)
|
|
285
|
+
subcategory_validator = EnumAttributeValidator.new('String', ["beauty_and_health", "digital_financial_services", "electronics", "entertainment", "fashion", "food_and_drink", "general_merchandise", "grocery_and_supermarkets", "home_and_living", "mobility_and_fuel", "sports_and_outdoor_gear", "travel_and_hospitality"])
|
|
286
|
+
return false unless subcategory_validator.valid?(@subcategory)
|
|
276
287
|
return false if @disclosure.nil?
|
|
277
288
|
return false if @currency_codes.nil?
|
|
278
289
|
return false if @currency_codes.length < 1
|
|
@@ -328,6 +339,16 @@ module Tremendous
|
|
|
328
339
|
@category = category
|
|
329
340
|
end
|
|
330
341
|
|
|
342
|
+
# Custom attribute writer method checking allowed values (enum).
|
|
343
|
+
# @param [Object] subcategory Object to be assigned
|
|
344
|
+
def subcategory=(subcategory)
|
|
345
|
+
validator = EnumAttributeValidator.new('String', ["beauty_and_health", "digital_financial_services", "electronics", "entertainment", "fashion", "food_and_drink", "general_merchandise", "grocery_and_supermarkets", "home_and_living", "mobility_and_fuel", "sports_and_outdoor_gear", "travel_and_hospitality"])
|
|
346
|
+
unless validator.valid?(subcategory)
|
|
347
|
+
fail ArgumentError, "invalid value for \"subcategory\", must be one of #{validator.allowable_values}."
|
|
348
|
+
end
|
|
349
|
+
@subcategory = subcategory
|
|
350
|
+
end
|
|
351
|
+
|
|
331
352
|
# Custom attribute writer method with validation
|
|
332
353
|
# @param [Object] disclosure Value to be assigned
|
|
333
354
|
def disclosure=(disclosure)
|
|
@@ -375,6 +396,7 @@ module Tremendous
|
|
|
375
396
|
name == o.name &&
|
|
376
397
|
description == o.description &&
|
|
377
398
|
category == o.category &&
|
|
399
|
+
subcategory == o.subcategory &&
|
|
378
400
|
disclosure == o.disclosure &&
|
|
379
401
|
skus == o.skus &&
|
|
380
402
|
currency_codes == o.currency_codes &&
|
|
@@ -393,7 +415,7 @@ module Tremendous
|
|
|
393
415
|
# Calculates hash code according to all attributes.
|
|
394
416
|
# @return [Integer] Hash code
|
|
395
417
|
def hash
|
|
396
|
-
[id, name, description, category, disclosure, skus, currency_codes, countries, images, usage_instructions, documents].hash
|
|
418
|
+
[id, name, description, category, subcategory, disclosure, skus, currency_codes, countries, images, usage_instructions, documents].hash
|
|
397
419
|
end
|
|
398
420
|
|
|
399
421
|
# Builds the object from hash
|
|
@@ -88,6 +88,10 @@ module Tremendous
|
|
|
88
88
|
def list_invalid_properties
|
|
89
89
|
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
90
90
|
invalid_properties = Array.new
|
|
91
|
+
if !@emails.nil? && @emails.length > 50000
|
|
92
|
+
invalid_properties.push('invalid value for "emails", number of items must be less than or equal to 50000.')
|
|
93
|
+
end
|
|
94
|
+
|
|
91
95
|
invalid_properties
|
|
92
96
|
end
|
|
93
97
|
|
|
@@ -95,9 +99,24 @@ module Tremendous
|
|
|
95
99
|
# @return true if the model is valid
|
|
96
100
|
def valid?
|
|
97
101
|
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
102
|
+
return false if !@emails.nil? && @emails.length > 50000
|
|
98
103
|
true
|
|
99
104
|
end
|
|
100
105
|
|
|
106
|
+
# Custom attribute writer method with validation
|
|
107
|
+
# @param [Object] emails Value to be assigned
|
|
108
|
+
def emails=(emails)
|
|
109
|
+
if emails.nil?
|
|
110
|
+
fail ArgumentError, 'emails cannot be nil'
|
|
111
|
+
end
|
|
112
|
+
|
|
113
|
+
if emails.length > 50000
|
|
114
|
+
fail ArgumentError, 'invalid value for "emails", number of items must be less than or equal to 50000.'
|
|
115
|
+
end
|
|
116
|
+
|
|
117
|
+
@emails = emails
|
|
118
|
+
end
|
|
119
|
+
|
|
101
120
|
# Checks equality by comparing each attribute.
|
|
102
121
|
# @param [Object] Object to be compared
|
|
103
122
|
def ==(o)
|