tremendous_ruby 5.13.0 → 5.15.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 +265 -7
- data/lib/tremendous/models/create_field.rb +320 -0
- data/lib/tremendous/models/create_field200_response.rb +237 -0
- data/lib/tremendous/models/create_field_request.rb +320 -0
- data/lib/tremendous/models/create_field_request_data.rb +224 -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/field.rb +37 -5
- 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/get_fraud_review200_response_fraud_review.rb +66 -56
- data/lib/tremendous/models/invoice.rb +26 -2
- data/lib/tremendous/models/list_fields200_response_fields_inner.rb +37 -5
- data/lib/tremendous/models/list_fields200_response_fields_inner_data.rb +236 -0
- 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_meta.rb +5 -0
- data/lib/tremendous/models/list_invoices200_response_invoices_inner.rb +26 -2
- 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/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 +13 -1
- metadata +14 -1
|
@@ -22,8 +22,28 @@ module Tremendous
|
|
|
22
22
|
# The array may contain multiple reasons, depending on which rule(s) flagged the reward for review. Reasons can be any of the following: * `Disallowed IP` * `Disallowed email` * `Disallowed country` * `Over reward dollar limit` * `Over reward count limit` * `VPN detected` * `Device related to multiple emails` * `Device or account related to multiple emails` * `IP on a Tremendous fraud list` * `Bank account on a Tremendous fraud list` * `Fingerprint on a Tremendous fraud list` * `Email on a Tremendous fraud list` * `Phone on a Tremendous fraud list` * `IP related to a blocked reward` * `Device related to a blocked reward` * `Bank account related to a blocked reward` * `Fingerprint related to a blocked reward` * `Email related to a blocked reward` * `Phone related to a blocked reward` * `Allowed IP` * `Allowed email`
|
|
23
23
|
attr_accessor :reasons
|
|
24
24
|
|
|
25
|
+
# The device fingerprint, if known.
|
|
26
|
+
attr_accessor :device_id
|
|
27
|
+
|
|
28
|
+
# The product selected to claim the reward
|
|
29
|
+
attr_accessor :redemption_method
|
|
30
|
+
|
|
31
|
+
# Date the reward was redeemed
|
|
32
|
+
attr_accessor :redeemed_at
|
|
33
|
+
|
|
34
|
+
attr_accessor :geo
|
|
35
|
+
|
|
25
36
|
attr_accessor :reward
|
|
26
37
|
|
|
38
|
+
# The name of the person who reviewed the reward, or `Automatic Review` if the reward was blocked automatically. Rewards can be automatically blocked if they remain in the flagged fraud queue for more than 30 days. This field is only present if the status is not `flagged`.
|
|
39
|
+
attr_accessor :reviewed_by
|
|
40
|
+
|
|
41
|
+
# When the reward was blocked or released following fraud review. This field is only present if the status is not `flagged`.
|
|
42
|
+
attr_accessor :reviewed_at
|
|
43
|
+
|
|
44
|
+
# A hash of the destination account for redemption methods that require providing 3rd party account details (e.g., PayPal, Venmo, ACH/CashApp, international bank transfers, etc.). The hash is globally unique by redemption method + account combination. This field is omitted for redemption methods that don't have a destination account (e.g., merchant cards, charities, etc.).
|
|
45
|
+
attr_accessor :redemption_method_account_hash
|
|
46
|
+
|
|
27
47
|
class EnumAttributeValidator
|
|
28
48
|
attr_reader :datatype
|
|
29
49
|
attr_reader :allowable_values
|
|
@@ -51,7 +71,14 @@ module Tremendous
|
|
|
51
71
|
{
|
|
52
72
|
:'status' => :'status',
|
|
53
73
|
:'reasons' => :'reasons',
|
|
54
|
-
:'
|
|
74
|
+
:'device_id' => :'device_id',
|
|
75
|
+
:'redemption_method' => :'redemption_method',
|
|
76
|
+
:'redeemed_at' => :'redeemed_at',
|
|
77
|
+
:'geo' => :'geo',
|
|
78
|
+
:'reward' => :'reward',
|
|
79
|
+
:'reviewed_by' => :'reviewed_by',
|
|
80
|
+
:'reviewed_at' => :'reviewed_at',
|
|
81
|
+
:'redemption_method_account_hash' => :'redemption_method_account_hash'
|
|
55
82
|
}
|
|
56
83
|
end
|
|
57
84
|
|
|
@@ -70,7 +97,14 @@ module Tremendous
|
|
|
70
97
|
{
|
|
71
98
|
:'status' => :'String',
|
|
72
99
|
:'reasons' => :'Array<String>',
|
|
73
|
-
:'
|
|
100
|
+
:'device_id' => :'String',
|
|
101
|
+
:'redemption_method' => :'String',
|
|
102
|
+
:'redeemed_at' => :'Time',
|
|
103
|
+
:'geo' => :'ListFraudReviews200ResponseFraudReviewsInnerGeo',
|
|
104
|
+
:'reward' => :'ListRewards200ResponseRewardsInner',
|
|
105
|
+
:'reviewed_by' => :'String',
|
|
106
|
+
:'reviewed_at' => :'Time',
|
|
107
|
+
:'redemption_method_account_hash' => :'String'
|
|
74
108
|
}
|
|
75
109
|
end
|
|
76
110
|
|
|
@@ -106,9 +140,37 @@ module Tremendous
|
|
|
106
140
|
end
|
|
107
141
|
end
|
|
108
142
|
|
|
143
|
+
if attributes.key?(:'device_id')
|
|
144
|
+
self.device_id = attributes[:'device_id']
|
|
145
|
+
end
|
|
146
|
+
|
|
147
|
+
if attributes.key?(:'redemption_method')
|
|
148
|
+
self.redemption_method = attributes[:'redemption_method']
|
|
149
|
+
end
|
|
150
|
+
|
|
151
|
+
if attributes.key?(:'redeemed_at')
|
|
152
|
+
self.redeemed_at = attributes[:'redeemed_at']
|
|
153
|
+
end
|
|
154
|
+
|
|
155
|
+
if attributes.key?(:'geo')
|
|
156
|
+
self.geo = attributes[:'geo']
|
|
157
|
+
end
|
|
158
|
+
|
|
109
159
|
if attributes.key?(:'reward')
|
|
110
160
|
self.reward = attributes[:'reward']
|
|
111
161
|
end
|
|
162
|
+
|
|
163
|
+
if attributes.key?(:'reviewed_by')
|
|
164
|
+
self.reviewed_by = attributes[:'reviewed_by']
|
|
165
|
+
end
|
|
166
|
+
|
|
167
|
+
if attributes.key?(:'reviewed_at')
|
|
168
|
+
self.reviewed_at = attributes[:'reviewed_at']
|
|
169
|
+
end
|
|
170
|
+
|
|
171
|
+
if attributes.key?(:'redemption_method_account_hash')
|
|
172
|
+
self.redemption_method_account_hash = attributes[:'redemption_method_account_hash']
|
|
173
|
+
end
|
|
112
174
|
end
|
|
113
175
|
|
|
114
176
|
# Show invalid properties with the reasons. Usually used together with valid?
|
|
@@ -125,6 +187,8 @@ module Tremendous
|
|
|
125
187
|
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
126
188
|
status_validator = EnumAttributeValidator.new('String', ["flagged", "blocked", "released"])
|
|
127
189
|
return false unless status_validator.valid?(@status)
|
|
190
|
+
redemption_method_validator = EnumAttributeValidator.new('String', ["bank transfer", "charity", "instant debit transfer", "international bank transfer", "merchant card", "paypal", "venmo", "visa card"])
|
|
191
|
+
return false unless redemption_method_validator.valid?(@redemption_method)
|
|
128
192
|
true
|
|
129
193
|
end
|
|
130
194
|
|
|
@@ -138,6 +202,16 @@ module Tremendous
|
|
|
138
202
|
@status = status
|
|
139
203
|
end
|
|
140
204
|
|
|
205
|
+
# Custom attribute writer method checking allowed values (enum).
|
|
206
|
+
# @param [Object] redemption_method Object to be assigned
|
|
207
|
+
def redemption_method=(redemption_method)
|
|
208
|
+
validator = EnumAttributeValidator.new('String', ["bank transfer", "charity", "instant debit transfer", "international bank transfer", "merchant card", "paypal", "venmo", "visa card"])
|
|
209
|
+
unless validator.valid?(redemption_method)
|
|
210
|
+
fail ArgumentError, "invalid value for \"redemption_method\", must be one of #{validator.allowable_values}."
|
|
211
|
+
end
|
|
212
|
+
@redemption_method = redemption_method
|
|
213
|
+
end
|
|
214
|
+
|
|
141
215
|
# Checks equality by comparing each attribute.
|
|
142
216
|
# @param [Object] Object to be compared
|
|
143
217
|
def ==(o)
|
|
@@ -145,7 +219,14 @@ module Tremendous
|
|
|
145
219
|
self.class == o.class &&
|
|
146
220
|
status == o.status &&
|
|
147
221
|
reasons == o.reasons &&
|
|
148
|
-
|
|
222
|
+
device_id == o.device_id &&
|
|
223
|
+
redemption_method == o.redemption_method &&
|
|
224
|
+
redeemed_at == o.redeemed_at &&
|
|
225
|
+
geo == o.geo &&
|
|
226
|
+
reward == o.reward &&
|
|
227
|
+
reviewed_by == o.reviewed_by &&
|
|
228
|
+
reviewed_at == o.reviewed_at &&
|
|
229
|
+
redemption_method_account_hash == o.redemption_method_account_hash
|
|
149
230
|
end
|
|
150
231
|
|
|
151
232
|
# @see the `==` method
|
|
@@ -157,7 +238,7 @@ module Tremendous
|
|
|
157
238
|
# Calculates hash code according to all attributes.
|
|
158
239
|
# @return [Integer] Hash code
|
|
159
240
|
def hash
|
|
160
|
-
[status, reasons, reward].hash
|
|
241
|
+
[status, reasons, device_id, redemption_method, redeemed_at, geo, reward, reviewed_by, reviewed_at, redemption_method_account_hash].hash
|
|
161
242
|
end
|
|
162
243
|
|
|
163
244
|
# Builds the object from hash
|
|
@@ -0,0 +1,242 @@
|
|
|
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
|
+
# The Geo location, based on the recipient's IP.
|
|
18
|
+
class ListFraudReviews200ResponseFraudReviewsInnerGeo
|
|
19
|
+
# The recipient's IP.
|
|
20
|
+
attr_accessor :ip
|
|
21
|
+
|
|
22
|
+
# The country code (ISO-3166 alpha-2 character code) linked to the recipient's IP.
|
|
23
|
+
attr_accessor :country
|
|
24
|
+
|
|
25
|
+
# The city associated with the recipient's IP.
|
|
26
|
+
attr_accessor :city
|
|
27
|
+
|
|
28
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
29
|
+
def self.attribute_map
|
|
30
|
+
{
|
|
31
|
+
:'ip' => :'ip',
|
|
32
|
+
:'country' => :'country',
|
|
33
|
+
:'city' => :'city'
|
|
34
|
+
}
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
# Returns attribute mapping this model knows about
|
|
38
|
+
def self.acceptable_attribute_map
|
|
39
|
+
attribute_map
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
# Returns all the JSON keys this model knows about
|
|
43
|
+
def self.acceptable_attributes
|
|
44
|
+
acceptable_attribute_map.values
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
# Attribute type mapping.
|
|
48
|
+
def self.openapi_types
|
|
49
|
+
{
|
|
50
|
+
:'ip' => :'String',
|
|
51
|
+
:'country' => :'String',
|
|
52
|
+
:'city' => :'String'
|
|
53
|
+
}
|
|
54
|
+
end
|
|
55
|
+
|
|
56
|
+
# List of attributes with nullable: true
|
|
57
|
+
def self.openapi_nullable
|
|
58
|
+
Set.new([
|
|
59
|
+
])
|
|
60
|
+
end
|
|
61
|
+
|
|
62
|
+
# Initializes the object
|
|
63
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
64
|
+
def initialize(attributes = {})
|
|
65
|
+
if (!attributes.is_a?(Hash))
|
|
66
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Tremendous::ListFraudReviews200ResponseFraudReviewsInnerGeo` initialize method"
|
|
67
|
+
end
|
|
68
|
+
|
|
69
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
70
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
71
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
72
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
73
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Tremendous::ListFraudReviews200ResponseFraudReviewsInnerGeo`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
74
|
+
end
|
|
75
|
+
h[k.to_sym] = v
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
if attributes.key?(:'ip')
|
|
79
|
+
self.ip = attributes[:'ip']
|
|
80
|
+
end
|
|
81
|
+
|
|
82
|
+
if attributes.key?(:'country')
|
|
83
|
+
self.country = attributes[:'country']
|
|
84
|
+
end
|
|
85
|
+
|
|
86
|
+
if attributes.key?(:'city')
|
|
87
|
+
self.city = attributes[:'city']
|
|
88
|
+
end
|
|
89
|
+
end
|
|
90
|
+
|
|
91
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
92
|
+
# @return Array for valid properties with the reasons
|
|
93
|
+
def list_invalid_properties
|
|
94
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
95
|
+
invalid_properties = Array.new
|
|
96
|
+
invalid_properties
|
|
97
|
+
end
|
|
98
|
+
|
|
99
|
+
# Check to see if the all the properties in the model are valid
|
|
100
|
+
# @return true if the model is valid
|
|
101
|
+
def valid?
|
|
102
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
103
|
+
true
|
|
104
|
+
end
|
|
105
|
+
|
|
106
|
+
# Checks equality by comparing each attribute.
|
|
107
|
+
# @param [Object] Object to be compared
|
|
108
|
+
def ==(o)
|
|
109
|
+
return true if self.equal?(o)
|
|
110
|
+
self.class == o.class &&
|
|
111
|
+
ip == o.ip &&
|
|
112
|
+
country == o.country &&
|
|
113
|
+
city == o.city
|
|
114
|
+
end
|
|
115
|
+
|
|
116
|
+
# @see the `==` method
|
|
117
|
+
# @param [Object] Object to be compared
|
|
118
|
+
def eql?(o)
|
|
119
|
+
self == o
|
|
120
|
+
end
|
|
121
|
+
|
|
122
|
+
# Calculates hash code according to all attributes.
|
|
123
|
+
# @return [Integer] Hash code
|
|
124
|
+
def hash
|
|
125
|
+
[ip, country, city].hash
|
|
126
|
+
end
|
|
127
|
+
|
|
128
|
+
# Builds the object from hash
|
|
129
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
130
|
+
# @return [Object] Returns the model itself
|
|
131
|
+
def self.build_from_hash(attributes)
|
|
132
|
+
return nil unless attributes.is_a?(Hash)
|
|
133
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
134
|
+
transformed_hash = {}
|
|
135
|
+
openapi_types.each_pair do |key, type|
|
|
136
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
137
|
+
transformed_hash["#{key}"] = nil
|
|
138
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
139
|
+
# check to ensure the input is an array given that the attribute
|
|
140
|
+
# is documented as an array but the input is not
|
|
141
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
142
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
143
|
+
end
|
|
144
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
145
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
146
|
+
end
|
|
147
|
+
end
|
|
148
|
+
new(transformed_hash)
|
|
149
|
+
end
|
|
150
|
+
|
|
151
|
+
# Deserializes the data based on type
|
|
152
|
+
# @param string type Data type
|
|
153
|
+
# @param string value Value to be deserialized
|
|
154
|
+
# @return [Object] Deserialized data
|
|
155
|
+
def self._deserialize(type, value)
|
|
156
|
+
case type.to_sym
|
|
157
|
+
when :Time
|
|
158
|
+
Time.parse(value)
|
|
159
|
+
when :Date
|
|
160
|
+
Date.parse(value)
|
|
161
|
+
when :String
|
|
162
|
+
value.to_s
|
|
163
|
+
when :Integer
|
|
164
|
+
value.to_i
|
|
165
|
+
when :Float
|
|
166
|
+
value.to_f
|
|
167
|
+
when :Boolean
|
|
168
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
169
|
+
true
|
|
170
|
+
else
|
|
171
|
+
false
|
|
172
|
+
end
|
|
173
|
+
when :Object
|
|
174
|
+
# generic object (usually a Hash), return directly
|
|
175
|
+
value
|
|
176
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
|
177
|
+
inner_type = Regexp.last_match[:inner_type]
|
|
178
|
+
value.map { |v| _deserialize(inner_type, v) }
|
|
179
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
180
|
+
k_type = Regexp.last_match[:k_type]
|
|
181
|
+
v_type = Regexp.last_match[:v_type]
|
|
182
|
+
{}.tap do |hash|
|
|
183
|
+
value.each do |k, v|
|
|
184
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
185
|
+
end
|
|
186
|
+
end
|
|
187
|
+
else # model
|
|
188
|
+
# models (e.g. Pet) or oneOf
|
|
189
|
+
klass = Tremendous.const_get(type)
|
|
190
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
191
|
+
end
|
|
192
|
+
end
|
|
193
|
+
|
|
194
|
+
# Returns the string representation of the object
|
|
195
|
+
# @return [String] String presentation of the object
|
|
196
|
+
def to_s
|
|
197
|
+
to_hash.to_s
|
|
198
|
+
end
|
|
199
|
+
|
|
200
|
+
# to_body is an alias to to_hash (backward compatibility)
|
|
201
|
+
# @return [Hash] Returns the object in the form of hash
|
|
202
|
+
def to_body
|
|
203
|
+
to_hash
|
|
204
|
+
end
|
|
205
|
+
|
|
206
|
+
# Returns the object in the form of hash
|
|
207
|
+
# @return [Hash] Returns the object in the form of hash
|
|
208
|
+
def to_hash
|
|
209
|
+
hash = {}
|
|
210
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
211
|
+
value = self.send(attr)
|
|
212
|
+
if value.nil?
|
|
213
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
214
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
215
|
+
end
|
|
216
|
+
|
|
217
|
+
hash[param] = _to_hash(value)
|
|
218
|
+
end
|
|
219
|
+
hash
|
|
220
|
+
end
|
|
221
|
+
|
|
222
|
+
# Outputs non-array value in the form of hash
|
|
223
|
+
# For object, use to_hash. Otherwise, just return the value
|
|
224
|
+
# @param [Object] value Any valid value
|
|
225
|
+
# @return [Hash] Returns the value in the form of hash
|
|
226
|
+
def _to_hash(value)
|
|
227
|
+
if value.is_a?(Array)
|
|
228
|
+
value.compact.map { |v| _to_hash(v) }
|
|
229
|
+
elsif value.is_a?(Hash)
|
|
230
|
+
{}.tap do |hash|
|
|
231
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
232
|
+
end
|
|
233
|
+
elsif value.respond_to? :to_hash
|
|
234
|
+
value.to_hash
|
|
235
|
+
else
|
|
236
|
+
value
|
|
237
|
+
end
|
|
238
|
+
end
|
|
239
|
+
|
|
240
|
+
end
|
|
241
|
+
|
|
242
|
+
end
|
|
@@ -22,9 +22,12 @@ module Tremendous
|
|
|
22
22
|
# Reference to the purchase order number within your organization
|
|
23
23
|
attr_accessor :po_number
|
|
24
24
|
|
|
25
|
-
# Amount of the invoice
|
|
25
|
+
# Amount of the invoice
|
|
26
26
|
attr_accessor :amount
|
|
27
27
|
|
|
28
|
+
# Currency of the invoice
|
|
29
|
+
attr_accessor :currency
|
|
30
|
+
|
|
28
31
|
attr_accessor :international
|
|
29
32
|
|
|
30
33
|
# Status of this invoice <table> <thead> <tr> <th>Status</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td><code>DELETED</code></td> <td>Invoice has been deleted by your organization</td> </tr> <tr> <td><code>PAID</code></td> <td>Invoice has been paid by your organization</td> </tr> <tr> <td><code>OPEN</code></td> <td>Invoice has been created by your organization but has not been paid, yet</td> </tr> </tbody> </table>
|
|
@@ -70,6 +73,7 @@ module Tremendous
|
|
|
70
73
|
:'id' => :'id',
|
|
71
74
|
:'po_number' => :'po_number',
|
|
72
75
|
:'amount' => :'amount',
|
|
76
|
+
:'currency' => :'currency',
|
|
73
77
|
:'international' => :'international',
|
|
74
78
|
:'status' => :'status',
|
|
75
79
|
:'orders' => :'orders',
|
|
@@ -95,6 +99,7 @@ module Tremendous
|
|
|
95
99
|
:'id' => :'String',
|
|
96
100
|
:'po_number' => :'String',
|
|
97
101
|
:'amount' => :'Float',
|
|
102
|
+
:'currency' => :'String',
|
|
98
103
|
:'international' => :'Boolean',
|
|
99
104
|
:'status' => :'String',
|
|
100
105
|
:'orders' => :'Array<String>',
|
|
@@ -144,6 +149,12 @@ module Tremendous
|
|
|
144
149
|
self.amount = nil
|
|
145
150
|
end
|
|
146
151
|
|
|
152
|
+
if attributes.key?(:'currency')
|
|
153
|
+
self.currency = attributes[:'currency']
|
|
154
|
+
else
|
|
155
|
+
self.currency = 'USD'
|
|
156
|
+
end
|
|
157
|
+
|
|
147
158
|
if attributes.key?(:'international')
|
|
148
159
|
self.international = attributes[:'international']
|
|
149
160
|
end
|
|
@@ -209,6 +220,8 @@ module Tremendous
|
|
|
209
220
|
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
210
221
|
return false if @id.nil?
|
|
211
222
|
return false if @amount.nil?
|
|
223
|
+
currency_validator = EnumAttributeValidator.new('String', ["USD", "EUR", "GBP"])
|
|
224
|
+
return false unless currency_validator.valid?(@currency)
|
|
212
225
|
return false if @status.nil?
|
|
213
226
|
status_validator = EnumAttributeValidator.new('String', ["DELETED", "PAID", "OPEN", "MARKED_AS_PAID"])
|
|
214
227
|
return false unless status_validator.valid?(@status)
|
|
@@ -236,6 +249,16 @@ module Tremendous
|
|
|
236
249
|
@amount = amount
|
|
237
250
|
end
|
|
238
251
|
|
|
252
|
+
# Custom attribute writer method checking allowed values (enum).
|
|
253
|
+
# @param [Object] currency Object to be assigned
|
|
254
|
+
def currency=(currency)
|
|
255
|
+
validator = EnumAttributeValidator.new('String', ["USD", "EUR", "GBP"])
|
|
256
|
+
unless validator.valid?(currency)
|
|
257
|
+
fail ArgumentError, "invalid value for \"currency\", must be one of #{validator.allowable_values}."
|
|
258
|
+
end
|
|
259
|
+
@currency = currency
|
|
260
|
+
end
|
|
261
|
+
|
|
239
262
|
# Custom attribute writer method checking allowed values (enum).
|
|
240
263
|
# @param [Object] status Object to be assigned
|
|
241
264
|
def status=(status)
|
|
@@ -264,6 +287,7 @@ module Tremendous
|
|
|
264
287
|
id == o.id &&
|
|
265
288
|
po_number == o.po_number &&
|
|
266
289
|
amount == o.amount &&
|
|
290
|
+
currency == o.currency &&
|
|
267
291
|
international == o.international &&
|
|
268
292
|
status == o.status &&
|
|
269
293
|
orders == o.orders &&
|
|
@@ -281,7 +305,7 @@ module Tremendous
|
|
|
281
305
|
# Calculates hash code according to all attributes.
|
|
282
306
|
# @return [Integer] Hash code
|
|
283
307
|
def hash
|
|
284
|
-
[id, po_number, amount, international, status, orders, rewards, created_at, paid_at].hash
|
|
308
|
+
[id, po_number, amount, currency, international, status, orders, rewards, created_at, paid_at].hash
|
|
285
309
|
end
|
|
286
310
|
|
|
287
311
|
# Builds the object from hash
|