tremendous_ruby 5.3.0 → 5.5.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.
Files changed (192) hide show
  1. checksums.yaml +4 -4
  2. data/lib/tremendous/api/tremendous_api.rb +618 -56
  3. data/lib/tremendous/api_client.rb +31 -26
  4. data/lib/tremendous/api_error.rb +1 -1
  5. data/lib/tremendous/configuration.rb +2 -2
  6. data/lib/tremendous/models/allow_email.rb +225 -0
  7. data/lib/tremendous/models/allow_email1.rb +225 -0
  8. data/lib/tremendous/models/allow_ip.rb +225 -0
  9. data/lib/tremendous/models/allow_ip1.rb +225 -0
  10. data/lib/tremendous/models/balance_transaction.rb +37 -2
  11. data/lib/tremendous/models/base_order_for_create.rb +232 -0
  12. data/lib/tremendous/models/campaign.rb +1 -1
  13. data/lib/tremendous/models/campaign_base.rb +1 -1
  14. data/lib/tremendous/models/channel.rb +45 -0
  15. data/lib/tremendous/models/create_api_key200_response.rb +1 -1
  16. data/lib/tremendous/models/create_campaign201_response.rb +1 -1
  17. data/lib/tremendous/models/create_campaign_request.rb +1 -1
  18. data/lib/tremendous/models/create_invoice.rb +1 -1
  19. data/lib/tremendous/models/create_invoice200_response.rb +1 -1
  20. data/lib/tremendous/models/create_invoice_request.rb +1 -1
  21. data/lib/tremendous/models/create_member.rb +1 -1
  22. data/lib/tremendous/models/create_member200_response.rb +1 -1
  23. data/lib/tremendous/models/create_member_request.rb +1 -1
  24. data/lib/tremendous/models/create_order200_response.rb +2 -2
  25. data/lib/tremendous/models/create_order_request.rb +74 -218
  26. data/lib/tremendous/models/create_organization.rb +1 -1
  27. data/lib/tremendous/models/create_organization200_response.rb +1 -1
  28. data/lib/tremendous/models/create_organization200_response_organization.rb +1 -1
  29. data/lib/tremendous/models/create_organization_request.rb +1 -1
  30. data/lib/tremendous/models/create_organization_request_copy_settings.rb +1 -1
  31. data/lib/tremendous/models/create_public_key.rb +1 -1
  32. data/lib/tremendous/models/create_public_key200_response.rb +1 -1
  33. data/lib/tremendous/models/create_public_key_request.rb +1 -1
  34. data/lib/tremendous/models/create_webhook200_response.rb +1 -1
  35. data/lib/tremendous/models/create_webhook_request.rb +1 -1
  36. data/lib/tremendous/models/currency_codes.rb +1 -1
  37. data/lib/tremendous/models/custom_field.rb +1 -1
  38. data/lib/tremendous/models/delete_fraud_rule200_response.rb +222 -0
  39. data/lib/tremendous/models/delivery_details.rb +1 -1
  40. data/lib/tremendous/models/delivery_method.rb +1 -1
  41. data/lib/tremendous/models/delivery_status.rb +1 -1
  42. data/lib/tremendous/models/error_model.rb +1 -1
  43. data/lib/tremendous/models/field.rb +1 -1
  44. data/lib/tremendous/models/fraud_config_allow_email.rb +224 -0
  45. data/lib/tremendous/models/fraud_config_country.rb +275 -0
  46. data/lib/tremendous/models/fraud_config_country_update_list.rb +224 -0
  47. data/lib/tremendous/models/fraud_config_ip.rb +224 -0
  48. data/lib/tremendous/models/fraud_config_redeemed_rewards_amount.rb +292 -0
  49. data/lib/tremendous/models/fraud_config_redeemed_rewards_count.rb +292 -0
  50. data/lib/tremendous/models/fraud_config_review_email.rb +229 -0
  51. data/lib/tremendous/models/fraud_generic_response.rb +222 -0
  52. data/lib/tremendous/models/fraud_review.rb +351 -0
  53. data/lib/tremendous/models/fraud_review_geo.rb +235 -0
  54. data/lib/tremendous/models/{reward_with_link_delivery.rb → fraud_review_list_item.rb} +27 -52
  55. data/lib/tremendous/models/fraud_review_reason.rb +58 -0
  56. data/lib/tremendous/models/fraud_review_redemption_method.rb +44 -0
  57. data/lib/tremendous/models/fraud_review_related_rewards.rb +304 -0
  58. data/lib/tremendous/models/fraud_review_status.rb +41 -0
  59. data/lib/tremendous/models/fraud_rule200_response.rb +222 -0
  60. data/lib/tremendous/models/fraud_rule400_response.rb +221 -0
  61. data/lib/tremendous/models/fraud_rule422_response.rb +221 -0
  62. data/lib/tremendous/models/fraud_rule_request.rb +214 -0
  63. data/lib/tremendous/models/fraud_rule_request_config.rb +110 -0
  64. data/lib/tremendous/models/fraud_rule_type.rb +49 -0
  65. data/lib/tremendous/models/fraud_rules_list_item.rb +261 -0
  66. data/lib/tremendous/models/funding_source.rb +1 -1
  67. data/lib/tremendous/models/generate_reward_link200_response.rb +1 -1
  68. data/lib/tremendous/models/generate_reward_link200_response_reward.rb +1 -1
  69. data/lib/tremendous/models/generate_reward_link403_response.rb +1 -1
  70. data/lib/tremendous/models/generate_reward_token200_response.rb +1 -1
  71. data/lib/tremendous/models/generate_reward_token200_response_reward.rb +1 -1
  72. data/lib/tremendous/models/get_fraud_review200_response.rb +221 -0
  73. data/lib/tremendous/models/get_fraud_review200_response_fraud_review.rb +351 -0
  74. data/lib/tremendous/models/get_fraud_review200_response_fraud_review_geo.rb +236 -0
  75. data/lib/tremendous/models/get_fraud_review200_response_fraud_review_related_rewards.rb +305 -0
  76. data/lib/tremendous/models/get_funding_source200_response.rb +1 -1
  77. data/lib/tremendous/models/get_member200_response.rb +1 -1
  78. data/lib/tremendous/models/get_member200_response_member.rb +1 -1
  79. data/lib/tremendous/models/get_member200_response_member_events_inner.rb +1 -1
  80. data/lib/tremendous/models/get_organization200_response.rb +1 -1
  81. data/lib/tremendous/models/get_product_response.rb +1 -1
  82. data/lib/tremendous/models/get_reward200_response.rb +1 -1
  83. data/lib/tremendous/models/invoice.rb +1 -1
  84. data/lib/tremendous/models/list_balance_transactions200_response.rb +16 -9
  85. data/lib/tremendous/models/{list_balance_transactions200_response_invoices_inner.rb → list_balance_transactions200_response_transactions_inner.rb} +40 -5
  86. data/lib/tremendous/models/list_campaigns200_response.rb +1 -1
  87. data/lib/tremendous/models/list_campaigns200_response_campaigns_inner.rb +1 -1
  88. data/lib/tremendous/models/list_campaigns200_response_campaigns_inner_email_style.rb +3 -1
  89. data/lib/tremendous/models/list_campaigns200_response_campaigns_inner_webpage_style.rb +2 -1
  90. data/lib/tremendous/models/list_fields200_response.rb +1 -1
  91. data/lib/tremendous/models/list_fields200_response_fields_inner.rb +1 -1
  92. data/lib/tremendous/models/list_forex_response.rb +1 -1
  93. data/lib/tremendous/models/list_fraud_reviews200_response.rb +223 -0
  94. data/lib/tremendous/models/{delivery_details_with_link.rb → list_fraud_reviews200_response_fraud_reviews_inner.rb} +27 -52
  95. data/lib/tremendous/models/list_fraud_rules200_response.rb +223 -0
  96. data/lib/tremendous/models/{create_order200_response_order_rewards_inner_delivery.rb → list_fraud_rules200_response_fraud_rules_inner.rb} +29 -64
  97. data/lib/tremendous/models/list_funding_sources200_response.rb +1 -1
  98. data/lib/tremendous/models/list_funding_sources200_response_funding_sources_inner.rb +1 -1
  99. data/lib/tremendous/models/list_funding_sources200_response_funding_sources_inner_meta.rb +1 -1
  100. data/lib/tremendous/models/list_invoices200_response.rb +1 -1
  101. data/lib/tremendous/models/list_invoices200_response_invoices_inner.rb +1 -1
  102. data/lib/tremendous/models/list_members200_response.rb +1 -1
  103. data/lib/tremendous/models/list_members200_response_members_inner.rb +1 -1
  104. data/lib/tremendous/models/list_orders200_response.rb +1 -1
  105. data/lib/tremendous/models/list_orders200_response_orders_inner.rb +32 -8
  106. data/lib/tremendous/models/list_orders200_response_orders_inner_payment.rb +1 -1
  107. data/lib/tremendous/models/list_orders200_response_orders_inner_payment_refund.rb +1 -1
  108. data/lib/tremendous/models/list_organizations200_response.rb +1 -1
  109. data/lib/tremendous/models/list_organizations200_response_organizations_inner.rb +1 -1
  110. data/lib/tremendous/models/list_products_response.rb +1 -1
  111. data/lib/tremendous/models/list_products_response_products_inner.rb +1 -1
  112. data/lib/tremendous/models/list_products_response_products_inner_countries_inner.rb +1 -1
  113. data/lib/tremendous/models/list_products_response_products_inner_images_inner.rb +1 -1
  114. data/lib/tremendous/models/list_products_response_products_inner_skus_inner.rb +1 -1
  115. data/lib/tremendous/models/list_rewards200_response.rb +1 -1
  116. data/lib/tremendous/models/list_rewards200_response_rewards_inner.rb +1 -22
  117. data/lib/tremendous/models/list_rewards200_response_rewards_inner_custom_fields_inner.rb +1 -1
  118. data/lib/tremendous/models/list_rewards200_response_rewards_inner_delivery.rb +1 -1
  119. data/lib/tremendous/models/list_rewards200_response_rewards_inner_recipient.rb +1 -1
  120. data/lib/tremendous/models/list_rewards200_response_rewards_inner_value.rb +2 -7
  121. data/lib/tremendous/models/list_rewards401_response.rb +1 -1
  122. data/lib/tremendous/models/list_rewards401_response_errors.rb +1 -1
  123. data/lib/tremendous/models/list_rewards429_response.rb +1 -1
  124. data/lib/tremendous/models/list_roles200_response.rb +1 -1
  125. data/lib/tremendous/models/list_roles200_response_roles_inner.rb +1 -1
  126. data/lib/tremendous/models/list_webhook_events200_response.rb +1 -1
  127. data/lib/tremendous/models/list_webhooks200_response.rb +1 -1
  128. data/lib/tremendous/models/list_webhooks200_response_webhooks_inner.rb +1 -1
  129. data/lib/tremendous/models/member.rb +1 -1
  130. data/lib/tremendous/models/member_base.rb +1 -1
  131. data/lib/tremendous/models/member_with_events.rb +1 -1
  132. data/lib/tremendous/models/member_without_events.rb +1 -1
  133. data/lib/tremendous/models/order.rb +32 -8
  134. data/lib/tremendous/models/order_base.rb +24 -2
  135. data/lib/tremendous/models/order_base_payment.rb +1 -1
  136. data/lib/tremendous/models/order_status.rb +1 -1
  137. data/lib/tremendous/models/order_without_link.rb +32 -8
  138. data/lib/tremendous/models/{order_without_link_reward.rb → order_without_link_rewards_inner.rb} +4 -25
  139. data/lib/tremendous/models/organization.rb +1 -1
  140. data/lib/tremendous/models/payment_details.rb +1 -1
  141. data/lib/tremendous/models/payment_details_refund.rb +1 -1
  142. data/lib/tremendous/models/product.rb +1 -1
  143. data/lib/tremendous/models/public_key.rb +2 -2
  144. data/lib/tremendous/models/public_keys_response.rb +1 -1
  145. data/lib/tremendous/models/public_keys_response_public_keys_inner.rb +2 -2
  146. data/lib/tremendous/models/recipient.rb +1 -1
  147. data/lib/tremendous/models/refund_details.rb +1 -1
  148. data/lib/tremendous/models/resend_reward422_response.rb +1 -1
  149. data/lib/tremendous/models/review_country.rb +276 -0
  150. data/lib/tremendous/models/review_country1.rb +225 -0
  151. data/lib/tremendous/models/review_email.rb +230 -0
  152. data/lib/tremendous/models/review_email1.rb +230 -0
  153. data/lib/tremendous/models/review_ip.rb +225 -0
  154. data/lib/tremendous/models/review_ip1.rb +225 -0
  155. data/lib/tremendous/models/review_redeemed_rewards_amount.rb +293 -0
  156. data/lib/tremendous/models/review_redeemed_rewards_count.rb +293 -0
  157. data/lib/tremendous/models/reward.rb +1 -22
  158. data/lib/tremendous/models/reward_base.rb +1 -22
  159. data/lib/tremendous/models/reward_base_custom_fields_inner.rb +1 -1
  160. data/lib/tremendous/models/reward_for_order_create.rb +2 -23
  161. data/lib/tremendous/models/reward_link.rb +1 -1
  162. data/lib/tremendous/models/reward_token.rb +1 -1
  163. data/lib/tremendous/models/reward_value.rb +2 -7
  164. data/lib/tremendous/models/reward_without_link.rb +1 -22
  165. data/lib/tremendous/models/reward_without_link_delivery.rb +1 -1
  166. data/lib/tremendous/models/role.rb +1 -1
  167. data/lib/tremendous/models/simulate_webhook_request.rb +1 -1
  168. data/lib/tremendous/models/{order_for_create.rb → single_reward_order.rb} +7 -13
  169. data/lib/tremendous/models/single_reward_order1.rb +242 -0
  170. data/lib/tremendous/models/{create_order_request_payment.rb → single_reward_order1_payment.rb} +4 -4
  171. data/lib/tremendous/models/{create_order_request_reward.rb → single_reward_order1_reward.rb} +6 -27
  172. data/lib/tremendous/models/{create_order_request_reward_custom_fields_inner.rb → single_reward_order1_reward_custom_fields_inner.rb} +4 -4
  173. data/lib/tremendous/models/{create_order_request_reward_delivery.rb → single_reward_order1_reward_delivery.rb} +4 -4
  174. data/lib/tremendous/models/{order_for_create_reward.rb → single_reward_order_reward.rb} +5 -26
  175. data/lib/tremendous/models/{create_order201_response.rb → single_reward_order_without_link.rb} +5 -5
  176. data/lib/tremendous/models/{order_with_link.rb → single_reward_order_without_link_order.rb} +25 -22
  177. data/lib/tremendous/models/test_public_key.rb +1 -1
  178. data/lib/tremendous/models/test_public_key_request.rb +1 -1
  179. data/lib/tremendous/models/update_campaign.rb +1 -1
  180. data/lib/tremendous/models/update_campaign_request.rb +1 -1
  181. data/lib/tremendous/models/update_fraud_rule_list200_response.rb +222 -0
  182. data/lib/tremendous/models/update_fraud_rule_list_request.rb +272 -0
  183. data/lib/tremendous/models/update_fraud_rule_list_request_config.rb +108 -0
  184. data/lib/tremendous/models/webhook.rb +1 -1
  185. data/lib/tremendous/models/webhook_post.rb +1 -1
  186. data/lib/tremendous/version.rb +1 -1
  187. data/lib/tremendous.rb +60 -18
  188. metadata +62 -20
  189. data/lib/tremendous/models/create_order200_response_order.rb +0 -400
  190. data/lib/tremendous/models/create_order200_response_order_rewards_inner.rb +0 -347
  191. data/lib/tremendous/models/order_with_link_rewards_inner.rb +0 -406
  192. data/lib/tremendous/models/reward_with_link.rb +0 -406
@@ -0,0 +1,236 @@
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 it's 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.8.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 GetFraudReview200ResponseFraudReviewGeo
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 all the JSON keys this model knows about
38
+ def self.acceptable_attributes
39
+ attribute_map.values
40
+ end
41
+
42
+ # Attribute type mapping.
43
+ def self.openapi_types
44
+ {
45
+ :'ip' => :'String',
46
+ :'country' => :'String',
47
+ :'city' => :'String'
48
+ }
49
+ end
50
+
51
+ # List of attributes with nullable: true
52
+ def self.openapi_nullable
53
+ Set.new([
54
+ ])
55
+ end
56
+
57
+ # Initializes the object
58
+ # @param [Hash] attributes Model attributes in the form of hash
59
+ def initialize(attributes = {})
60
+ if (!attributes.is_a?(Hash))
61
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Tremendous::GetFraudReview200ResponseFraudReviewGeo` initialize method"
62
+ end
63
+
64
+ # check to see if the attribute exists and convert string to symbol for hash key
65
+ attributes = attributes.each_with_object({}) { |(k, v), h|
66
+ if (!self.class.attribute_map.key?(k.to_sym))
67
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Tremendous::GetFraudReview200ResponseFraudReviewGeo`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
68
+ end
69
+ h[k.to_sym] = v
70
+ }
71
+
72
+ if attributes.key?(:'ip')
73
+ self.ip = attributes[:'ip']
74
+ end
75
+
76
+ if attributes.key?(:'country')
77
+ self.country = attributes[:'country']
78
+ end
79
+
80
+ if attributes.key?(:'city')
81
+ self.city = attributes[:'city']
82
+ end
83
+ end
84
+
85
+ # Show invalid properties with the reasons. Usually used together with valid?
86
+ # @return Array for valid properties with the reasons
87
+ def list_invalid_properties
88
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
89
+ invalid_properties = Array.new
90
+ invalid_properties
91
+ end
92
+
93
+ # Check to see if the all the properties in the model are valid
94
+ # @return true if the model is valid
95
+ def valid?
96
+ warn '[DEPRECATED] the `valid?` method is obsolete'
97
+ true
98
+ end
99
+
100
+ # Checks equality by comparing each attribute.
101
+ # @param [Object] Object to be compared
102
+ def ==(o)
103
+ return true if self.equal?(o)
104
+ self.class == o.class &&
105
+ ip == o.ip &&
106
+ country == o.country &&
107
+ city == o.city
108
+ end
109
+
110
+ # @see the `==` method
111
+ # @param [Object] Object to be compared
112
+ def eql?(o)
113
+ self == o
114
+ end
115
+
116
+ # Calculates hash code according to all attributes.
117
+ # @return [Integer] Hash code
118
+ def hash
119
+ [ip, country, city].hash
120
+ end
121
+
122
+ # Builds the object from hash
123
+ # @param [Hash] attributes Model attributes in the form of hash
124
+ # @return [Object] Returns the model itself
125
+ def self.build_from_hash(attributes)
126
+ return nil unless attributes.is_a?(Hash)
127
+ attributes = attributes.transform_keys(&:to_sym)
128
+ transformed_hash = {}
129
+ openapi_types.each_pair do |key, type|
130
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
131
+ transformed_hash["#{key}"] = nil
132
+ elsif type =~ /\AArray<(.*)>/i
133
+ # check to ensure the input is an array given that the attribute
134
+ # is documented as an array but the input is not
135
+ if attributes[attribute_map[key]].is_a?(Array)
136
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
137
+ end
138
+ elsif !attributes[attribute_map[key]].nil?
139
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
140
+ end
141
+ end
142
+ new(transformed_hash)
143
+ end
144
+
145
+ # Deserializes the data based on type
146
+ # @param string type Data type
147
+ # @param string value Value to be deserialized
148
+ # @return [Object] Deserialized data
149
+ def self._deserialize(type, value)
150
+ case type.to_sym
151
+ when :Time
152
+ Time.parse(value)
153
+ when :Date
154
+ Date.parse(value)
155
+ when :String
156
+ value.to_s
157
+ when :Integer
158
+ value.to_i
159
+ when :Float
160
+ value.to_f
161
+ when :Boolean
162
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
163
+ true
164
+ else
165
+ false
166
+ end
167
+ when :Object
168
+ # generic object (usually a Hash), return directly
169
+ value
170
+ when /\AArray<(?<inner_type>.+)>\z/
171
+ inner_type = Regexp.last_match[:inner_type]
172
+ value.map { |v| _deserialize(inner_type, v) }
173
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
174
+ k_type = Regexp.last_match[:k_type]
175
+ v_type = Regexp.last_match[:v_type]
176
+ {}.tap do |hash|
177
+ value.each do |k, v|
178
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
179
+ end
180
+ end
181
+ else # model
182
+ # models (e.g. Pet) or oneOf
183
+ klass = Tremendous.const_get(type)
184
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
185
+ end
186
+ end
187
+
188
+ # Returns the string representation of the object
189
+ # @return [String] String presentation of the object
190
+ def to_s
191
+ to_hash.to_s
192
+ end
193
+
194
+ # to_body is an alias to to_hash (backward compatibility)
195
+ # @return [Hash] Returns the object in the form of hash
196
+ def to_body
197
+ to_hash
198
+ end
199
+
200
+ # Returns the object in the form of hash
201
+ # @return [Hash] Returns the object in the form of hash
202
+ def to_hash
203
+ hash = {}
204
+ self.class.attribute_map.each_pair do |attr, param|
205
+ value = self.send(attr)
206
+ if value.nil?
207
+ is_nullable = self.class.openapi_nullable.include?(attr)
208
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
209
+ end
210
+
211
+ hash[param] = _to_hash(value)
212
+ end
213
+ hash
214
+ end
215
+
216
+ # Outputs non-array value in the form of hash
217
+ # For object, use to_hash. Otherwise, just return the value
218
+ # @param [Object] value Any valid value
219
+ # @return [Hash] Returns the value in the form of hash
220
+ def _to_hash(value)
221
+ if value.is_a?(Array)
222
+ value.compact.map { |v| _to_hash(v) }
223
+ elsif value.is_a?(Hash)
224
+ {}.tap do |hash|
225
+ value.each { |k, v| hash[k] = _to_hash(v) }
226
+ end
227
+ elsif value.respond_to? :to_hash
228
+ value.to_hash
229
+ else
230
+ value
231
+ end
232
+ end
233
+
234
+ end
235
+
236
+ end
@@ -0,0 +1,305 @@
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 it's 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.8.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module Tremendous
17
+ # The related rewards associated with the fraud review.
18
+ class GetFraudReview200ResponseFraudReviewRelatedRewards
19
+ # The IDs of rewards that have similar attributes to the fraud reward. A maximum of 100 IDs is returned.
20
+ attr_accessor :ids
21
+
22
+ # How many related rewards were found in total.
23
+ attr_accessor :count
24
+
25
+ # How many related rewards have been blocked.
26
+ attr_accessor :blocked_count
27
+
28
+ # Total amount claimed by the related rewards (in USD).
29
+ attr_accessor :aggregated_value
30
+
31
+ # Attribute mapping from ruby-style variable name to JSON key.
32
+ def self.attribute_map
33
+ {
34
+ :'ids' => :'ids',
35
+ :'count' => :'count',
36
+ :'blocked_count' => :'blocked_count',
37
+ :'aggregated_value' => :'aggregated_value'
38
+ }
39
+ end
40
+
41
+ # Returns all the JSON keys this model knows about
42
+ def self.acceptable_attributes
43
+ attribute_map.values
44
+ end
45
+
46
+ # Attribute type mapping.
47
+ def self.openapi_types
48
+ {
49
+ :'ids' => :'Array<String>',
50
+ :'count' => :'Float',
51
+ :'blocked_count' => :'Float',
52
+ :'aggregated_value' => :'Float'
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::GetFraudReview200ResponseFraudReviewRelatedRewards` initialize method"
67
+ end
68
+
69
+ # check to see if the attribute exists and convert string to symbol for hash key
70
+ attributes = attributes.each_with_object({}) { |(k, v), h|
71
+ if (!self.class.attribute_map.key?(k.to_sym))
72
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Tremendous::GetFraudReview200ResponseFraudReviewRelatedRewards`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
73
+ end
74
+ h[k.to_sym] = v
75
+ }
76
+
77
+ if attributes.key?(:'ids')
78
+ if (value = attributes[:'ids']).is_a?(Array)
79
+ self.ids = value
80
+ end
81
+ end
82
+
83
+ if attributes.key?(:'count')
84
+ self.count = attributes[:'count']
85
+ end
86
+
87
+ if attributes.key?(:'blocked_count')
88
+ self.blocked_count = attributes[:'blocked_count']
89
+ end
90
+
91
+ if attributes.key?(:'aggregated_value')
92
+ self.aggregated_value = attributes[:'aggregated_value']
93
+ end
94
+ end
95
+
96
+ # Show invalid properties with the reasons. Usually used together with valid?
97
+ # @return Array for valid properties with the reasons
98
+ def list_invalid_properties
99
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
100
+ invalid_properties = Array.new
101
+ if !@count.nil? && @count < 0
102
+ invalid_properties.push('invalid value for "count", must be greater than or equal to 0.')
103
+ end
104
+
105
+ if !@blocked_count.nil? && @blocked_count < 0
106
+ invalid_properties.push('invalid value for "blocked_count", must be greater than or equal to 0.')
107
+ end
108
+
109
+ if !@aggregated_value.nil? && @aggregated_value < 0
110
+ invalid_properties.push('invalid value for "aggregated_value", must be greater than or equal to 0.')
111
+ end
112
+
113
+ invalid_properties
114
+ end
115
+
116
+ # Check to see if the all the properties in the model are valid
117
+ # @return true if the model is valid
118
+ def valid?
119
+ warn '[DEPRECATED] the `valid?` method is obsolete'
120
+ return false if !@count.nil? && @count < 0
121
+ return false if !@blocked_count.nil? && @blocked_count < 0
122
+ return false if !@aggregated_value.nil? && @aggregated_value < 0
123
+ true
124
+ end
125
+
126
+ # Custom attribute writer method with validation
127
+ # @param [Object] count Value to be assigned
128
+ def count=(count)
129
+ if count.nil?
130
+ fail ArgumentError, 'count cannot be nil'
131
+ end
132
+
133
+ if count < 0
134
+ fail ArgumentError, 'invalid value for "count", must be greater than or equal to 0.'
135
+ end
136
+
137
+ @count = count
138
+ end
139
+
140
+ # Custom attribute writer method with validation
141
+ # @param [Object] blocked_count Value to be assigned
142
+ def blocked_count=(blocked_count)
143
+ if blocked_count.nil?
144
+ fail ArgumentError, 'blocked_count cannot be nil'
145
+ end
146
+
147
+ if blocked_count < 0
148
+ fail ArgumentError, 'invalid value for "blocked_count", must be greater than or equal to 0.'
149
+ end
150
+
151
+ @blocked_count = blocked_count
152
+ end
153
+
154
+ # Custom attribute writer method with validation
155
+ # @param [Object] aggregated_value Value to be assigned
156
+ def aggregated_value=(aggregated_value)
157
+ if aggregated_value.nil?
158
+ fail ArgumentError, 'aggregated_value cannot be nil'
159
+ end
160
+
161
+ if aggregated_value < 0
162
+ fail ArgumentError, 'invalid value for "aggregated_value", must be greater than or equal to 0.'
163
+ end
164
+
165
+ @aggregated_value = aggregated_value
166
+ end
167
+
168
+ # Checks equality by comparing each attribute.
169
+ # @param [Object] Object to be compared
170
+ def ==(o)
171
+ return true if self.equal?(o)
172
+ self.class == o.class &&
173
+ ids == o.ids &&
174
+ count == o.count &&
175
+ blocked_count == o.blocked_count &&
176
+ aggregated_value == o.aggregated_value
177
+ end
178
+
179
+ # @see the `==` method
180
+ # @param [Object] Object to be compared
181
+ def eql?(o)
182
+ self == o
183
+ end
184
+
185
+ # Calculates hash code according to all attributes.
186
+ # @return [Integer] Hash code
187
+ def hash
188
+ [ids, count, blocked_count, aggregated_value].hash
189
+ end
190
+
191
+ # Builds the object from hash
192
+ # @param [Hash] attributes Model attributes in the form of hash
193
+ # @return [Object] Returns the model itself
194
+ def self.build_from_hash(attributes)
195
+ return nil unless attributes.is_a?(Hash)
196
+ attributes = attributes.transform_keys(&:to_sym)
197
+ transformed_hash = {}
198
+ openapi_types.each_pair do |key, type|
199
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
200
+ transformed_hash["#{key}"] = nil
201
+ elsif type =~ /\AArray<(.*)>/i
202
+ # check to ensure the input is an array given that the attribute
203
+ # is documented as an array but the input is not
204
+ if attributes[attribute_map[key]].is_a?(Array)
205
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
206
+ end
207
+ elsif !attributes[attribute_map[key]].nil?
208
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
209
+ end
210
+ end
211
+ new(transformed_hash)
212
+ end
213
+
214
+ # Deserializes the data based on type
215
+ # @param string type Data type
216
+ # @param string value Value to be deserialized
217
+ # @return [Object] Deserialized data
218
+ def self._deserialize(type, value)
219
+ case type.to_sym
220
+ when :Time
221
+ Time.parse(value)
222
+ when :Date
223
+ Date.parse(value)
224
+ when :String
225
+ value.to_s
226
+ when :Integer
227
+ value.to_i
228
+ when :Float
229
+ value.to_f
230
+ when :Boolean
231
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
232
+ true
233
+ else
234
+ false
235
+ end
236
+ when :Object
237
+ # generic object (usually a Hash), return directly
238
+ value
239
+ when /\AArray<(?<inner_type>.+)>\z/
240
+ inner_type = Regexp.last_match[:inner_type]
241
+ value.map { |v| _deserialize(inner_type, v) }
242
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
243
+ k_type = Regexp.last_match[:k_type]
244
+ v_type = Regexp.last_match[:v_type]
245
+ {}.tap do |hash|
246
+ value.each do |k, v|
247
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
248
+ end
249
+ end
250
+ else # model
251
+ # models (e.g. Pet) or oneOf
252
+ klass = Tremendous.const_get(type)
253
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
254
+ end
255
+ end
256
+
257
+ # Returns the string representation of the object
258
+ # @return [String] String presentation of the object
259
+ def to_s
260
+ to_hash.to_s
261
+ end
262
+
263
+ # to_body is an alias to to_hash (backward compatibility)
264
+ # @return [Hash] Returns the object in the form of hash
265
+ def to_body
266
+ to_hash
267
+ end
268
+
269
+ # Returns the object in the form of hash
270
+ # @return [Hash] Returns the object in the form of hash
271
+ def to_hash
272
+ hash = {}
273
+ self.class.attribute_map.each_pair do |attr, param|
274
+ value = self.send(attr)
275
+ if value.nil?
276
+ is_nullable = self.class.openapi_nullable.include?(attr)
277
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
278
+ end
279
+
280
+ hash[param] = _to_hash(value)
281
+ end
282
+ hash
283
+ end
284
+
285
+ # Outputs non-array value in the form of hash
286
+ # For object, use to_hash. Otherwise, just return the value
287
+ # @param [Object] value Any valid value
288
+ # @return [Hash] Returns the value in the form of hash
289
+ def _to_hash(value)
290
+ if value.is_a?(Array)
291
+ value.compact.map { |v| _to_hash(v) }
292
+ elsif value.is_a?(Hash)
293
+ {}.tap do |hash|
294
+ value.each { |k, v| hash[k] = _to_hash(v) }
295
+ end
296
+ elsif value.respond_to? :to_hash
297
+ value.to_hash
298
+ else
299
+ value
300
+ end
301
+ end
302
+
303
+ end
304
+
305
+ end
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: 2
7
7
  Contact: developers@tremendous.com
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 7.3.0
9
+ Generator version: 7.8.0
10
10
 
11
11
  =end
12
12
 
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: 2
7
7
  Contact: developers@tremendous.com
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 7.3.0
9
+ Generator version: 7.8.0
10
10
 
11
11
  =end
12
12
 
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: 2
7
7
  Contact: developers@tremendous.com
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 7.3.0
9
+ Generator version: 7.8.0
10
10
 
11
11
  =end
12
12
 
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: 2
7
7
  Contact: developers@tremendous.com
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 7.3.0
9
+ Generator version: 7.8.0
10
10
 
11
11
  =end
12
12
 
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: 2
7
7
  Contact: developers@tremendous.com
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 7.3.0
9
+ Generator version: 7.8.0
10
10
 
11
11
  =end
12
12
 
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: 2
7
7
  Contact: developers@tremendous.com
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 7.3.0
9
+ Generator version: 7.8.0
10
10
 
11
11
  =end
12
12
 
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: 2
7
7
  Contact: developers@tremendous.com
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 7.3.0
9
+ Generator version: 7.8.0
10
10
 
11
11
  =end
12
12
 
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: 2
7
7
  Contact: developers@tremendous.com
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 7.3.0
9
+ Generator version: 7.8.0
10
10
 
11
11
  =end
12
12
 
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: 2
7
7
  Contact: developers@tremendous.com
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 7.3.0
9
+ Generator version: 7.8.0
10
10
 
11
11
  =end
12
12
 
@@ -15,12 +15,12 @@ require 'time'
15
15
 
16
16
  module Tremendous
17
17
  class ListBalanceTransactions200Response
18
- attr_accessor :invoices
18
+ attr_accessor :transactions
19
19
 
20
20
  # Attribute mapping from ruby-style variable name to JSON key.
21
21
  def self.attribute_map
22
22
  {
23
- :'invoices' => :'invoices'
23
+ :'transactions' => :'transactions'
24
24
  }
25
25
  end
26
26
 
@@ -32,7 +32,7 @@ module Tremendous
32
32
  # Attribute type mapping.
33
33
  def self.openapi_types
34
34
  {
35
- :'invoices' => :'Array<ListBalanceTransactions200ResponseInvoicesInner>'
35
+ :'transactions' => :'Array<ListBalanceTransactions200ResponseTransactionsInner>'
36
36
  }
37
37
  end
38
38
 
@@ -57,10 +57,12 @@ module Tremendous
57
57
  h[k.to_sym] = v
58
58
  }
59
59
 
60
- if attributes.key?(:'invoices')
61
- if (value = attributes[:'invoices']).is_a?(Array)
62
- self.invoices = value
60
+ if attributes.key?(:'transactions')
61
+ if (value = attributes[:'transactions']).is_a?(Array)
62
+ self.transactions = value
63
63
  end
64
+ else
65
+ self.transactions = nil
64
66
  end
65
67
  end
66
68
 
@@ -69,6 +71,10 @@ module Tremendous
69
71
  def list_invalid_properties
70
72
  warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
71
73
  invalid_properties = Array.new
74
+ if @transactions.nil?
75
+ invalid_properties.push('invalid value for "transactions", transactions cannot be nil.')
76
+ end
77
+
72
78
  invalid_properties
73
79
  end
74
80
 
@@ -76,6 +82,7 @@ module Tremendous
76
82
  # @return true if the model is valid
77
83
  def valid?
78
84
  warn '[DEPRECATED] the `valid?` method is obsolete'
85
+ return false if @transactions.nil?
79
86
  true
80
87
  end
81
88
 
@@ -84,7 +91,7 @@ module Tremendous
84
91
  def ==(o)
85
92
  return true if self.equal?(o)
86
93
  self.class == o.class &&
87
- invoices == o.invoices
94
+ transactions == o.transactions
88
95
  end
89
96
 
90
97
  # @see the `==` method
@@ -96,7 +103,7 @@ module Tremendous
96
103
  # Calculates hash code according to all attributes.
97
104
  # @return [Integer] Hash code
98
105
  def hash
99
- [invoices].hash
106
+ [transactions].hash
100
107
  end
101
108
 
102
109
  # Builds the object from hash