tremendous_ruby 5.10.0 → 5.11.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 (229) hide show
  1. checksums.yaml +4 -4
  2. data/lib/tremendous/api/tremendous_api.rb +8 -5
  3. data/lib/tremendous/api_client.rb +1 -1
  4. data/lib/tremendous/api_error.rb +1 -1
  5. data/lib/tremendous/configuration.rb +1 -1
  6. data/lib/tremendous/models/allow_email.rb +20 -4
  7. data/lib/tremendous/models/allow_email1.rb +20 -4
  8. data/lib/tremendous/models/allow_ip.rb +20 -4
  9. data/lib/tremendous/models/allow_ip1.rb +20 -4
  10. data/lib/tremendous/models/balance_transaction.rb +60 -4
  11. data/lib/tremendous/models/balance_transaction_order.rb +10 -4
  12. data/lib/tremendous/models/balance_transaction_order_payment.rb +10 -4
  13. data/lib/tremendous/models/base_order_for_create.rb +20 -4
  14. data/lib/tremendous/models/campaign.rb +30 -4
  15. data/lib/tremendous/models/campaign_base.rb +10 -4
  16. data/lib/tremendous/models/channel.rb +3 -2
  17. data/lib/tremendous/models/connected_organization.rb +30 -4
  18. data/lib/tremendous/models/connected_organization_member.rb +20 -4
  19. data/lib/tremendous/models/connected_organization_member_member.rb +20 -4
  20. data/lib/tremendous/models/connected_organization_member_session.rb +50 -4
  21. data/lib/tremendous/models/connected_organization_organization.rb +30 -4
  22. data/lib/tremendous/models/create_api_key200_response.rb +10 -4
  23. data/lib/tremendous/models/create_campaign200_response.rb +20 -4
  24. data/lib/tremendous/models/create_campaign_request.rb +30 -4
  25. data/lib/tremendous/models/create_connected_organization200_response.rb +20 -4
  26. data/lib/tremendous/models/create_connected_organization_member200_response.rb +20 -4
  27. data/lib/tremendous/models/create_connected_organization_member_request.rb +20 -4
  28. data/lib/tremendous/models/create_connected_organization_member_session200_response.rb +20 -4
  29. data/lib/tremendous/models/create_connected_organization_member_session200_response_connected_organization_member_session.rb +50 -4
  30. data/lib/tremendous/models/create_connected_organization_member_session_request.rb +20 -4
  31. data/lib/tremendous/models/create_connected_organization_request.rb +20 -4
  32. data/lib/tremendous/models/create_invoice200_response.rb +20 -4
  33. data/lib/tremendous/models/create_invoice_request.rb +20 -4
  34. data/lib/tremendous/models/create_member.rb +30 -4
  35. data/lib/tremendous/models/create_member200_response.rb +20 -4
  36. data/lib/tremendous/models/create_member_request.rb +30 -4
  37. data/lib/tremendous/models/create_order200_response.rb +20 -4
  38. data/lib/tremendous/models/create_order200_response_order.rb +22 -6
  39. data/lib/tremendous/models/create_order200_response_order_rewards_inner.rb +10 -4
  40. data/lib/tremendous/models/create_order200_response_order_rewards_inner_delivery.rb +10 -4
  41. data/lib/tremendous/models/create_order_request.rb +1 -1
  42. data/lib/tremendous/models/create_organization.rb +40 -4
  43. data/lib/tremendous/models/create_organization200_response.rb +10 -4
  44. data/lib/tremendous/models/create_organization200_response_organization.rb +30 -4
  45. data/lib/tremendous/models/create_organization_for_response.rb +30 -4
  46. data/lib/tremendous/models/create_organization_properties.rb +10 -4
  47. data/lib/tremendous/models/create_organization_request.rb +40 -4
  48. data/lib/tremendous/models/create_organization_request_copy_settings.rb +10 -4
  49. data/lib/tremendous/models/create_report200_response.rb +20 -4
  50. data/lib/tremendous/models/create_report200_response_report.rb +10 -4
  51. data/lib/tremendous/models/create_report_request.rb +10 -4
  52. data/lib/tremendous/models/create_report_request_filters.rb +10 -4
  53. data/lib/tremendous/models/create_report_request_filters_digital_rewards.rb +10 -4
  54. data/lib/tremendous/models/create_report_request_filters_digital_rewards_amount.rb +10 -4
  55. data/lib/tremendous/models/create_report_request_filters_digital_rewards_created_at.rb +10 -4
  56. data/lib/tremendous/models/create_webhook200_response.rb +10 -4
  57. data/lib/tremendous/models/create_webhook_request.rb +20 -4
  58. data/lib/tremendous/models/currency_codes.rb +1 -1
  59. data/lib/tremendous/models/custom_field.rb +10 -4
  60. data/lib/tremendous/models/delete_fraud_rule200_response.rb +20 -4
  61. data/lib/tremendous/models/delivery_details.rb +10 -4
  62. data/lib/tremendous/models/delivery_details_with_link.rb +10 -4
  63. data/lib/tremendous/models/delivery_metadata.rb +10 -4
  64. data/lib/tremendous/models/delivery_method.rb +1 -1
  65. data/lib/tremendous/models/delivery_status.rb +1 -1
  66. data/lib/tremendous/models/error_model.rb +20 -4
  67. data/lib/tremendous/models/field.rb +10 -4
  68. data/lib/tremendous/models/fraud_config_allow_email.rb +20 -4
  69. data/lib/tremendous/models/fraud_config_country.rb +20 -4
  70. data/lib/tremendous/models/fraud_config_country_update_list.rb +20 -4
  71. data/lib/tremendous/models/fraud_config_ip.rb +20 -4
  72. data/lib/tremendous/models/fraud_config_redeemed_rewards_amount.rb +10 -4
  73. data/lib/tremendous/models/fraud_config_redeemed_rewards_count.rb +10 -4
  74. data/lib/tremendous/models/fraud_config_review_email.rb +10 -4
  75. data/lib/tremendous/models/fraud_generic_response.rb +20 -4
  76. data/lib/tremendous/models/fraud_review.rb +10 -4
  77. data/lib/tremendous/models/fraud_review_geo.rb +10 -4
  78. data/lib/tremendous/models/fraud_review_list_item.rb +10 -4
  79. data/lib/tremendous/models/fraud_review_reason.rb +1 -1
  80. data/lib/tremendous/models/fraud_review_redemption_method.rb +1 -1
  81. data/lib/tremendous/models/fraud_review_related_rewards.rb +10 -4
  82. data/lib/tremendous/models/fraud_review_risk.rb +1 -1
  83. data/lib/tremendous/models/fraud_review_status.rb +1 -1
  84. data/lib/tremendous/models/fraud_rule200_response.rb +20 -4
  85. data/lib/tremendous/models/fraud_rule400_response.rb +20 -4
  86. data/lib/tremendous/models/fraud_rule422_response.rb +20 -4
  87. data/lib/tremendous/models/fraud_rule_request.rb +10 -4
  88. data/lib/tremendous/models/fraud_rule_request_config.rb +1 -1
  89. data/lib/tremendous/models/fraud_rule_type.rb +1 -1
  90. data/lib/tremendous/models/fraud_rules_list_item.rb +10 -4
  91. data/lib/tremendous/models/funding_source.rb +22 -6
  92. data/lib/tremendous/models/generate_reward_link200_response.rb +20 -4
  93. data/lib/tremendous/models/generate_reward_link200_response_reward.rb +10 -4
  94. data/lib/tremendous/models/generate_reward_link403_response.rb +20 -4
  95. data/lib/tremendous/models/get_fraud_review200_response.rb +20 -4
  96. data/lib/tremendous/models/get_fraud_review200_response_fraud_review.rb +10 -4
  97. data/lib/tremendous/models/get_fraud_review200_response_fraud_review_geo.rb +10 -4
  98. data/lib/tremendous/models/get_fraud_review200_response_fraud_review_related_rewards.rb +10 -4
  99. data/lib/tremendous/models/get_funding_source200_response.rb +20 -4
  100. data/lib/tremendous/models/get_member200_response.rb +20 -4
  101. data/lib/tremendous/models/get_member200_response_member.rb +20 -4
  102. data/lib/tremendous/models/get_member200_response_member_events_inner.rb +10 -4
  103. data/lib/tremendous/models/get_order200_response.rb +20 -4
  104. data/lib/tremendous/models/get_organization200_response.rb +10 -4
  105. data/lib/tremendous/models/get_product_response.rb +20 -4
  106. data/lib/tremendous/models/get_reward200_response.rb +20 -4
  107. data/lib/tremendous/models/inline_object.rb +231 -0
  108. data/lib/tremendous/models/inline_object1.rb +237 -0
  109. data/lib/tremendous/models/inline_object1_reward.rb +263 -0
  110. data/lib/tremendous/models/invoice.rb +40 -4
  111. data/lib/tremendous/models/list_balance_transactions200_response.rb +20 -4
  112. data/lib/tremendous/models/list_balance_transactions200_response_transactions_inner.rb +60 -4
  113. data/lib/tremendous/models/list_balance_transactions200_response_transactions_inner_order.rb +10 -4
  114. data/lib/tremendous/models/list_balance_transactions200_response_transactions_inner_order_payment.rb +10 -4
  115. data/lib/tremendous/models/list_campaigns200_response.rb +20 -4
  116. data/lib/tremendous/models/list_campaigns200_response_campaigns_inner.rb +30 -4
  117. data/lib/tremendous/models/list_campaigns200_response_campaigns_inner_email_style.rb +10 -4
  118. data/lib/tremendous/models/list_campaigns200_response_campaigns_inner_webpage_style.rb +10 -4
  119. data/lib/tremendous/models/list_connected_organization_members200_response.rb +30 -4
  120. data/lib/tremendous/models/list_connected_organization_members200_response_connected_organization_members_inner.rb +20 -4
  121. data/lib/tremendous/models/list_connected_organization_members200_response_connected_organization_members_inner_member.rb +20 -4
  122. data/lib/tremendous/models/list_connected_organizations200_response.rb +30 -4
  123. data/lib/tremendous/models/list_connected_organizations200_response_connected_organizations_inner.rb +30 -4
  124. data/lib/tremendous/models/list_connected_organizations200_response_connected_organizations_inner_organization.rb +30 -4
  125. data/lib/tremendous/models/list_fields200_response.rb +10 -4
  126. data/lib/tremendous/models/list_fields200_response_fields_inner.rb +10 -4
  127. data/lib/tremendous/models/list_forex_response.rb +20 -4
  128. data/lib/tremendous/models/list_fraud_reviews200_response.rb +30 -4
  129. data/lib/tremendous/models/list_fraud_reviews200_response_fraud_reviews_inner.rb +10 -4
  130. data/lib/tremendous/models/list_fraud_rules200_response.rb +20 -4
  131. data/lib/tremendous/models/list_fraud_rules200_response_fraud_rules_inner.rb +10 -4
  132. data/lib/tremendous/models/list_funding_sources200_response.rb +20 -4
  133. data/lib/tremendous/models/list_funding_sources200_response_funding_sources_inner.rb +22 -6
  134. data/lib/tremendous/models/list_funding_sources200_response_funding_sources_inner_meta.rb +144 -6
  135. data/lib/tremendous/models/list_funding_sources200_response_funding_sources_inner_meta_failure_details.rb +10 -4
  136. data/lib/tremendous/models/list_invoices200_response.rb +30 -4
  137. data/lib/tremendous/models/list_invoices200_response_invoices_inner.rb +40 -4
  138. data/lib/tremendous/models/list_members200_response.rb +20 -4
  139. data/lib/tremendous/models/list_members200_response_members_inner.rb +20 -4
  140. data/lib/tremendous/models/list_orders200_response.rb +30 -4
  141. data/lib/tremendous/models/list_orders200_response_orders_inner.rb +22 -6
  142. data/lib/tremendous/models/list_orders200_response_orders_inner_payment.rb +10 -4
  143. data/lib/tremendous/models/list_orders200_response_orders_inner_payment_refund.rb +10 -4
  144. data/lib/tremendous/models/list_organizations200_response.rb +10 -4
  145. data/lib/tremendous/models/list_organizations200_response_organizations_inner.rb +30 -4
  146. data/lib/tremendous/models/list_products_response.rb +20 -4
  147. data/lib/tremendous/models/list_products_response_products_inner.rb +40 -4
  148. data/lib/tremendous/models/list_products_response_products_inner_countries_inner.rb +20 -4
  149. data/lib/tremendous/models/list_products_response_products_inner_documents.rb +10 -4
  150. data/lib/tremendous/models/list_products_response_products_inner_images_inner.rb +20 -4
  151. data/lib/tremendous/models/list_products_response_products_inner_skus_inner.rb +10 -4
  152. data/lib/tremendous/models/list_rewards200_response.rb +10 -4
  153. data/lib/tremendous/models/list_rewards200_response_rewards_inner.rb +10 -4
  154. data/lib/tremendous/models/list_rewards200_response_rewards_inner_custom_fields_inner.rb +10 -4
  155. data/lib/tremendous/models/list_rewards200_response_rewards_inner_delivery.rb +10 -4
  156. data/lib/tremendous/models/list_rewards200_response_rewards_inner_recipient.rb +10 -4
  157. data/lib/tremendous/models/list_rewards200_response_rewards_inner_value.rb +20 -4
  158. data/lib/tremendous/models/list_rewards401_response.rb +20 -4
  159. data/lib/tremendous/models/list_rewards401_response_errors.rb +10 -4
  160. data/lib/tremendous/models/list_rewards429_response.rb +20 -4
  161. data/lib/tremendous/models/list_roles200_response.rb +20 -4
  162. data/lib/tremendous/models/list_roles200_response_roles_inner.rb +30 -4
  163. data/lib/tremendous/models/list_webhook_events200_response.rb +10 -4
  164. data/lib/tremendous/models/list_webhooks200_response.rb +10 -4
  165. data/lib/tremendous/models/list_webhooks200_response_webhooks_inner.rb +10 -4
  166. data/lib/tremendous/models/member.rb +20 -4
  167. data/lib/tremendous/models/member_base.rb +20 -4
  168. data/lib/tremendous/models/member_with_events.rb +20 -4
  169. data/lib/tremendous/models/member_without_events.rb +20 -4
  170. data/lib/tremendous/models/order.rb +22 -6
  171. data/lib/tremendous/models/order_base.rb +22 -6
  172. data/lib/tremendous/models/order_base_payment.rb +10 -4
  173. data/lib/tremendous/models/order_status.rb +1 -1
  174. data/lib/tremendous/models/order_with_link.rb +22 -6
  175. data/lib/tremendous/models/order_with_link_rewards_inner.rb +10 -4
  176. data/lib/tremendous/models/order_without_link.rb +22 -6
  177. data/lib/tremendous/models/order_without_link_rewards_inner.rb +10 -4
  178. data/lib/tremendous/models/organization.rb +30 -4
  179. data/lib/tremendous/models/payment_details.rb +10 -4
  180. data/lib/tremendous/models/payment_details_refund.rb +10 -4
  181. data/lib/tremendous/models/payout.rb +10 -4
  182. data/lib/tremendous/models/product.rb +40 -4
  183. data/lib/tremendous/models/product_documents.rb +10 -4
  184. data/lib/tremendous/models/recipient.rb +10 -4
  185. data/lib/tremendous/models/refund_details.rb +10 -4
  186. data/lib/tremendous/models/report.rb +10 -4
  187. data/lib/tremendous/models/resend_reward422_response.rb +20 -4
  188. data/lib/tremendous/models/resend_reward_request.rb +10 -4
  189. data/lib/tremendous/models/review_country.rb +20 -4
  190. data/lib/tremendous/models/review_country1.rb +20 -4
  191. data/lib/tremendous/models/review_email.rb +10 -4
  192. data/lib/tremendous/models/review_email1.rb +10 -4
  193. data/lib/tremendous/models/review_ip.rb +20 -4
  194. data/lib/tremendous/models/review_ip1.rb +20 -4
  195. data/lib/tremendous/models/review_redeemed_rewards_amount.rb +10 -4
  196. data/lib/tremendous/models/review_redeemed_rewards_count.rb +10 -4
  197. data/lib/tremendous/models/reward.rb +10 -4
  198. data/lib/tremendous/models/reward_base.rb +10 -4
  199. data/lib/tremendous/models/reward_base_custom_fields_inner.rb +10 -4
  200. data/lib/tremendous/models/reward_for_order_create.rb +10 -4
  201. data/lib/tremendous/models/reward_link.rb +10 -4
  202. data/lib/tremendous/models/reward_token.rb +10 -4
  203. data/lib/tremendous/models/reward_value.rb +20 -4
  204. data/lib/tremendous/models/reward_with_link.rb +10 -4
  205. data/lib/tremendous/models/reward_with_link_delivery.rb +10 -4
  206. data/lib/tremendous/models/reward_without_link.rb +10 -4
  207. data/lib/tremendous/models/reward_without_link_delivery.rb +10 -4
  208. data/lib/tremendous/models/role.rb +30 -4
  209. data/lib/tremendous/models/simulate_webhook_request.rb +20 -4
  210. data/lib/tremendous/models/single_reward_order.rb +20 -4
  211. data/lib/tremendous/models/single_reward_order_payment.rb +20 -4
  212. data/lib/tremendous/models/single_reward_order_reward.rb +10 -4
  213. data/lib/tremendous/models/single_reward_order_reward_custom_fields_inner.rb +10 -4
  214. data/lib/tremendous/models/single_reward_order_reward_delivery.rb +10 -4
  215. data/lib/tremendous/models/single_reward_order_reward_delivery_meta.rb +10 -4
  216. data/lib/tremendous/models/single_reward_order_with_link.rb +20 -4
  217. data/lib/tremendous/models/single_reward_order_with_link_order.rb +22 -6
  218. data/lib/tremendous/models/single_reward_order_without_link.rb +20 -4
  219. data/lib/tremendous/models/single_reward_order_without_link_order.rb +22 -6
  220. data/lib/tremendous/models/update_campaign.rb +10 -4
  221. data/lib/tremendous/models/update_campaign_request.rb +10 -4
  222. data/lib/tremendous/models/update_fraud_rule_list200_response.rb +20 -4
  223. data/lib/tremendous/models/update_fraud_rule_list_request.rb +20 -4
  224. data/lib/tremendous/models/update_fraud_rule_list_request_config.rb +1 -1
  225. data/lib/tremendous/models/webhook.rb +10 -4
  226. data/lib/tremendous/models/webhook_post.rb +20 -4
  227. data/lib/tremendous/version.rb +1 -1
  228. data/lib/tremendous.rb +4 -1
  229. metadata +5 -2
@@ -0,0 +1,263 @@
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 redemption token for a reward.
18
+ class InlineObject1Reward
19
+ # Tremendous ID of the reward
20
+ attr_accessor :id
21
+
22
+ # The token to redeem the reward.
23
+ attr_accessor :token
24
+
25
+ # Date the token expires
26
+ attr_accessor :expires_at
27
+
28
+ # Attribute mapping from ruby-style variable name to JSON key.
29
+ def self.attribute_map
30
+ {
31
+ :'id' => :'id',
32
+ :'token' => :'token',
33
+ :'expires_at' => :'expires_at'
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
+ :'id' => :'String',
51
+ :'token' => :'String',
52
+ :'expires_at' => :'Time'
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::InlineObject1Reward` 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::InlineObject1Reward`. 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?(:'id')
79
+ self.id = attributes[:'id']
80
+ end
81
+
82
+ if attributes.key?(:'token')
83
+ self.token = attributes[:'token']
84
+ end
85
+
86
+ if attributes.key?(:'expires_at')
87
+ self.expires_at = attributes[:'expires_at']
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
+ pattern = Regexp.new(/[A-Z0-9]{4,20}/)
97
+ if !@id.nil? && @id !~ pattern
98
+ invalid_properties.push("invalid value for \"id\", must conform to the pattern #{pattern}.")
99
+ end
100
+
101
+ invalid_properties
102
+ end
103
+
104
+ # Check to see if the all the properties in the model are valid
105
+ # @return true if the model is valid
106
+ def valid?
107
+ warn '[DEPRECATED] the `valid?` method is obsolete'
108
+ return false if !@id.nil? && @id !~ Regexp.new(/[A-Z0-9]{4,20}/)
109
+ true
110
+ end
111
+
112
+ # Custom attribute writer method with validation
113
+ # @param [Object] id Value to be assigned
114
+ def id=(id)
115
+ if id.nil?
116
+ fail ArgumentError, 'id cannot be nil'
117
+ end
118
+
119
+ pattern = Regexp.new(/[A-Z0-9]{4,20}/)
120
+ if id !~ pattern
121
+ fail ArgumentError, "invalid value for \"id\", must conform to the pattern #{pattern}."
122
+ end
123
+
124
+ @id = id
125
+ end
126
+
127
+ # Checks equality by comparing each attribute.
128
+ # @param [Object] Object to be compared
129
+ def ==(o)
130
+ return true if self.equal?(o)
131
+ self.class == o.class &&
132
+ id == o.id &&
133
+ token == o.token &&
134
+ expires_at == o.expires_at
135
+ end
136
+
137
+ # @see the `==` method
138
+ # @param [Object] Object to be compared
139
+ def eql?(o)
140
+ self == o
141
+ end
142
+
143
+ # Calculates hash code according to all attributes.
144
+ # @return [Integer] Hash code
145
+ def hash
146
+ [id, token, expires_at].hash
147
+ end
148
+
149
+ # Builds the object from hash
150
+ # @param [Hash] attributes Model attributes in the form of hash
151
+ # @return [Object] Returns the model itself
152
+ def self.build_from_hash(attributes)
153
+ return nil unless attributes.is_a?(Hash)
154
+ attributes = attributes.transform_keys(&:to_sym)
155
+ transformed_hash = {}
156
+ openapi_types.each_pair do |key, type|
157
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
158
+ transformed_hash["#{key}"] = nil
159
+ elsif type =~ /\AArray<(.*)>/i
160
+ # check to ensure the input is an array given that the attribute
161
+ # is documented as an array but the input is not
162
+ if attributes[attribute_map[key]].is_a?(Array)
163
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
164
+ end
165
+ elsif !attributes[attribute_map[key]].nil?
166
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
167
+ end
168
+ end
169
+ new(transformed_hash)
170
+ end
171
+
172
+ # Deserializes the data based on type
173
+ # @param string type Data type
174
+ # @param string value Value to be deserialized
175
+ # @return [Object] Deserialized data
176
+ def self._deserialize(type, value)
177
+ case type.to_sym
178
+ when :Time
179
+ Time.parse(value)
180
+ when :Date
181
+ Date.parse(value)
182
+ when :String
183
+ value.to_s
184
+ when :Integer
185
+ value.to_i
186
+ when :Float
187
+ value.to_f
188
+ when :Boolean
189
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
190
+ true
191
+ else
192
+ false
193
+ end
194
+ when :Object
195
+ # generic object (usually a Hash), return directly
196
+ value
197
+ when /\AArray<(?<inner_type>.+)>\z/
198
+ inner_type = Regexp.last_match[:inner_type]
199
+ value.map { |v| _deserialize(inner_type, v) }
200
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
201
+ k_type = Regexp.last_match[:k_type]
202
+ v_type = Regexp.last_match[:v_type]
203
+ {}.tap do |hash|
204
+ value.each do |k, v|
205
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
206
+ end
207
+ end
208
+ else # model
209
+ # models (e.g. Pet) or oneOf
210
+ klass = Tremendous.const_get(type)
211
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
212
+ end
213
+ end
214
+
215
+ # Returns the string representation of the object
216
+ # @return [String] String presentation of the object
217
+ def to_s
218
+ to_hash.to_s
219
+ end
220
+
221
+ # to_body is an alias to to_hash (backward compatibility)
222
+ # @return [Hash] Returns the object in the form of hash
223
+ def to_body
224
+ to_hash
225
+ end
226
+
227
+ # Returns the object in the form of hash
228
+ # @return [Hash] Returns the object in the form of hash
229
+ def to_hash
230
+ hash = {}
231
+ self.class.attribute_map.each_pair do |attr, param|
232
+ value = self.send(attr)
233
+ if value.nil?
234
+ is_nullable = self.class.openapi_nullable.include?(attr)
235
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
236
+ end
237
+
238
+ hash[param] = _to_hash(value)
239
+ end
240
+ hash
241
+ end
242
+
243
+ # Outputs non-array value in the form of hash
244
+ # For object, use to_hash. Otherwise, just return the value
245
+ # @param [Object] value Any valid value
246
+ # @return [Hash] Returns the value in the form of hash
247
+ def _to_hash(value)
248
+ if value.is_a?(Array)
249
+ value.compact.map { |v| _to_hash(v) }
250
+ elsif value.is_a?(Hash)
251
+ {}.tap do |hash|
252
+ value.each { |k, v| hash[k] = _to_hash(v) }
253
+ end
254
+ elsif value.respond_to? :to_hash
255
+ value.to_hash
256
+ else
257
+ value
258
+ end
259
+ end
260
+
261
+ end
262
+
263
+ 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
- Generator version: 7.8.0
9
+ Generator version: 7.12.0
10
10
 
11
11
  =end
12
12
 
@@ -79,9 +79,14 @@ module Tremendous
79
79
  }
80
80
  end
81
81
 
82
+ # Returns attribute mapping this model knows about
83
+ def self.acceptable_attribute_map
84
+ attribute_map
85
+ end
86
+
82
87
  # Returns all the JSON keys this model knows about
83
88
  def self.acceptable_attributes
84
- attribute_map.values
89
+ acceptable_attribute_map.values
85
90
  end
86
91
 
87
92
  # Attribute type mapping.
@@ -115,9 +120,10 @@ module Tremendous
115
120
  end
116
121
 
117
122
  # check to see if the attribute exists and convert string to symbol for hash key
123
+ acceptable_attribute_map = self.class.acceptable_attribute_map
118
124
  attributes = attributes.each_with_object({}) { |(k, v), h|
119
- if (!self.class.attribute_map.key?(k.to_sym))
120
- fail ArgumentError, "`#{k}` is not a valid attribute in `Tremendous::Invoice`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
125
+ if (!acceptable_attribute_map.key?(k.to_sym))
126
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Tremendous::Invoice`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
121
127
  end
122
128
  h[k.to_sym] = v
123
129
  }
@@ -210,6 +216,26 @@ module Tremendous
210
216
  true
211
217
  end
212
218
 
219
+ # Custom attribute writer method with validation
220
+ # @param [Object] id Value to be assigned
221
+ def id=(id)
222
+ if id.nil?
223
+ fail ArgumentError, 'id cannot be nil'
224
+ end
225
+
226
+ @id = id
227
+ end
228
+
229
+ # Custom attribute writer method with validation
230
+ # @param [Object] amount Value to be assigned
231
+ def amount=(amount)
232
+ if amount.nil?
233
+ fail ArgumentError, 'amount cannot be nil'
234
+ end
235
+
236
+ @amount = amount
237
+ end
238
+
213
239
  # Custom attribute writer method checking allowed values (enum).
214
240
  # @param [Object] status Object to be assigned
215
241
  def status=(status)
@@ -220,6 +246,16 @@ module Tremendous
220
246
  @status = status
221
247
  end
222
248
 
249
+ # Custom attribute writer method with validation
250
+ # @param [Object] created_at Value to be assigned
251
+ def created_at=(created_at)
252
+ if created_at.nil?
253
+ fail ArgumentError, 'created_at cannot be nil'
254
+ end
255
+
256
+ @created_at = created_at
257
+ end
258
+
223
259
  # Checks equality by comparing each attribute.
224
260
  # @param [Object] Object to be compared
225
261
  def ==(o)
@@ -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
- Generator version: 7.8.0
9
+ Generator version: 7.12.0
10
10
 
11
11
  =end
12
12
 
@@ -24,9 +24,14 @@ module Tremendous
24
24
  }
25
25
  end
26
26
 
27
+ # Returns attribute mapping this model knows about
28
+ def self.acceptable_attribute_map
29
+ attribute_map
30
+ end
31
+
27
32
  # Returns all the JSON keys this model knows about
28
33
  def self.acceptable_attributes
29
- attribute_map.values
34
+ acceptable_attribute_map.values
30
35
  end
31
36
 
32
37
  # Attribute type mapping.
@@ -50,9 +55,10 @@ module Tremendous
50
55
  end
51
56
 
52
57
  # check to see if the attribute exists and convert string to symbol for hash key
58
+ acceptable_attribute_map = self.class.acceptable_attribute_map
53
59
  attributes = attributes.each_with_object({}) { |(k, v), h|
54
- if (!self.class.attribute_map.key?(k.to_sym))
55
- fail ArgumentError, "`#{k}` is not a valid attribute in `Tremendous::ListBalanceTransactions200Response`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
60
+ if (!acceptable_attribute_map.key?(k.to_sym))
61
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Tremendous::ListBalanceTransactions200Response`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
56
62
  end
57
63
  h[k.to_sym] = v
58
64
  }
@@ -86,6 +92,16 @@ module Tremendous
86
92
  true
87
93
  end
88
94
 
95
+ # Custom attribute writer method with validation
96
+ # @param [Object] transactions Value to be assigned
97
+ def transactions=(transactions)
98
+ if transactions.nil?
99
+ fail ArgumentError, 'transactions cannot be nil'
100
+ end
101
+
102
+ @transactions = transactions
103
+ end
104
+
89
105
  # Checks equality by comparing each attribute.
90
106
  # @param [Object] Object to be compared
91
107
  def ==(o)
@@ -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
- Generator version: 7.8.0
9
+ Generator version: 7.12.0
10
10
 
11
11
  =end
12
12
 
@@ -45,9 +45,14 @@ module Tremendous
45
45
  }
46
46
  end
47
47
 
48
+ # Returns attribute mapping this model knows about
49
+ def self.acceptable_attribute_map
50
+ attribute_map
51
+ end
52
+
48
53
  # Returns all the JSON keys this model knows about
49
54
  def self.acceptable_attributes
50
- attribute_map.values
55
+ acceptable_attribute_map.values
51
56
  end
52
57
 
53
58
  # Attribute type mapping.
@@ -76,9 +81,10 @@ module Tremendous
76
81
  end
77
82
 
78
83
  # check to see if the attribute exists and convert string to symbol for hash key
84
+ acceptable_attribute_map = self.class.acceptable_attribute_map
79
85
  attributes = attributes.each_with_object({}) { |(k, v), h|
80
- if (!self.class.attribute_map.key?(k.to_sym))
81
- fail ArgumentError, "`#{k}` is not a valid attribute in `Tremendous::ListBalanceTransactions200ResponseTransactionsInner`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
86
+ if (!acceptable_attribute_map.key?(k.to_sym))
87
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Tremendous::ListBalanceTransactions200ResponseTransactionsInner`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
82
88
  end
83
89
  h[k.to_sym] = v
84
90
  }
@@ -158,6 +164,56 @@ module Tremendous
158
164
  true
159
165
  end
160
166
 
167
+ # Custom attribute writer method with validation
168
+ # @param [Object] created_at Value to be assigned
169
+ def created_at=(created_at)
170
+ if created_at.nil?
171
+ fail ArgumentError, 'created_at cannot be nil'
172
+ end
173
+
174
+ @created_at = created_at
175
+ end
176
+
177
+ # Custom attribute writer method with validation
178
+ # @param [Object] amount Value to be assigned
179
+ def amount=(amount)
180
+ if amount.nil?
181
+ fail ArgumentError, 'amount cannot be nil'
182
+ end
183
+
184
+ @amount = amount
185
+ end
186
+
187
+ # Custom attribute writer method with validation
188
+ # @param [Object] balance Value to be assigned
189
+ def balance=(balance)
190
+ if balance.nil?
191
+ fail ArgumentError, 'balance cannot be nil'
192
+ end
193
+
194
+ @balance = balance
195
+ end
196
+
197
+ # Custom attribute writer method with validation
198
+ # @param [Object] action Value to be assigned
199
+ def action=(action)
200
+ if action.nil?
201
+ fail ArgumentError, 'action cannot be nil'
202
+ end
203
+
204
+ @action = action
205
+ end
206
+
207
+ # Custom attribute writer method with validation
208
+ # @param [Object] description Value to be assigned
209
+ def description=(description)
210
+ if description.nil?
211
+ fail ArgumentError, 'description cannot be nil'
212
+ end
213
+
214
+ @description = description
215
+ end
216
+
161
217
  # Checks equality by comparing each attribute.
162
218
  # @param [Object] Object to be compared
163
219
  def ==(o)
@@ -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
- Generator version: 7.8.0
9
+ Generator version: 7.12.0
10
10
 
11
11
  =end
12
12
 
@@ -32,9 +32,14 @@ module Tremendous
32
32
  }
33
33
  end
34
34
 
35
+ # Returns attribute mapping this model knows about
36
+ def self.acceptable_attribute_map
37
+ attribute_map
38
+ end
39
+
35
40
  # Returns all the JSON keys this model knows about
36
41
  def self.acceptable_attributes
37
- attribute_map.values
42
+ acceptable_attribute_map.values
38
43
  end
39
44
 
40
45
  # Attribute type mapping.
@@ -61,9 +66,10 @@ module Tremendous
61
66
  end
62
67
 
63
68
  # check to see if the attribute exists and convert string to symbol for hash key
69
+ acceptable_attribute_map = self.class.acceptable_attribute_map
64
70
  attributes = attributes.each_with_object({}) { |(k, v), h|
65
- if (!self.class.attribute_map.key?(k.to_sym))
66
- fail ArgumentError, "`#{k}` is not a valid attribute in `Tremendous::ListBalanceTransactions200ResponseTransactionsInnerOrder`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
71
+ if (!acceptable_attribute_map.key?(k.to_sym))
72
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Tremendous::ListBalanceTransactions200ResponseTransactionsInnerOrder`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
67
73
  end
68
74
  h[k.to_sym] = v
69
75
  }
@@ -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
- Generator version: 7.8.0
9
+ Generator version: 7.12.0
10
10
 
11
11
  =end
12
12
 
@@ -40,9 +40,14 @@ module Tremendous
40
40
  }
41
41
  end
42
42
 
43
+ # Returns attribute mapping this model knows about
44
+ def self.acceptable_attribute_map
45
+ attribute_map
46
+ end
47
+
43
48
  # Returns all the JSON keys this model knows about
44
49
  def self.acceptable_attributes
45
- attribute_map.values
50
+ acceptable_attribute_map.values
46
51
  end
47
52
 
48
53
  # Attribute type mapping.
@@ -70,9 +75,10 @@ module Tremendous
70
75
  end
71
76
 
72
77
  # check to see if the attribute exists and convert string to symbol for hash key
78
+ acceptable_attribute_map = self.class.acceptable_attribute_map
73
79
  attributes = attributes.each_with_object({}) { |(k, v), h|
74
- if (!self.class.attribute_map.key?(k.to_sym))
75
- fail ArgumentError, "`#{k}` is not a valid attribute in `Tremendous::ListBalanceTransactions200ResponseTransactionsInnerOrderPayment`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
80
+ if (!acceptable_attribute_map.key?(k.to_sym))
81
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Tremendous::ListBalanceTransactions200ResponseTransactionsInnerOrderPayment`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
76
82
  end
77
83
  h[k.to_sym] = v
78
84
  }
@@ -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
- Generator version: 7.8.0
9
+ Generator version: 7.12.0
10
10
 
11
11
  =end
12
12
 
@@ -24,9 +24,14 @@ module Tremendous
24
24
  }
25
25
  end
26
26
 
27
+ # Returns attribute mapping this model knows about
28
+ def self.acceptable_attribute_map
29
+ attribute_map
30
+ end
31
+
27
32
  # Returns all the JSON keys this model knows about
28
33
  def self.acceptable_attributes
29
- attribute_map.values
34
+ acceptable_attribute_map.values
30
35
  end
31
36
 
32
37
  # Attribute type mapping.
@@ -50,9 +55,10 @@ module Tremendous
50
55
  end
51
56
 
52
57
  # check to see if the attribute exists and convert string to symbol for hash key
58
+ acceptable_attribute_map = self.class.acceptable_attribute_map
53
59
  attributes = attributes.each_with_object({}) { |(k, v), h|
54
- if (!self.class.attribute_map.key?(k.to_sym))
55
- fail ArgumentError, "`#{k}` is not a valid attribute in `Tremendous::ListCampaigns200Response`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
60
+ if (!acceptable_attribute_map.key?(k.to_sym))
61
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Tremendous::ListCampaigns200Response`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
56
62
  end
57
63
  h[k.to_sym] = v
58
64
  }
@@ -86,6 +92,16 @@ module Tremendous
86
92
  true
87
93
  end
88
94
 
95
+ # Custom attribute writer method with validation
96
+ # @param [Object] campaigns Value to be assigned
97
+ def campaigns=(campaigns)
98
+ if campaigns.nil?
99
+ fail ArgumentError, 'campaigns cannot be nil'
100
+ end
101
+
102
+ @campaigns = campaigns
103
+ end
104
+
89
105
  # Checks equality by comparing each attribute.
90
106
  # @param [Object] Object to be compared
91
107
  def ==(o)
@@ -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
- Generator version: 7.8.0
9
+ Generator version: 7.12.0
10
10
 
11
11
  =end
12
12
 
@@ -43,9 +43,14 @@ module Tremendous
43
43
  }
44
44
  end
45
45
 
46
+ # Returns attribute mapping this model knows about
47
+ def self.acceptable_attribute_map
48
+ attribute_map
49
+ end
50
+
46
51
  # Returns all the JSON keys this model knows about
47
52
  def self.acceptable_attributes
48
- attribute_map.values
53
+ acceptable_attribute_map.values
49
54
  end
50
55
 
51
56
  # Attribute type mapping.
@@ -75,9 +80,10 @@ module Tremendous
75
80
  end
76
81
 
77
82
  # check to see if the attribute exists and convert string to symbol for hash key
83
+ acceptable_attribute_map = self.class.acceptable_attribute_map
78
84
  attributes = attributes.each_with_object({}) { |(k, v), h|
79
- if (!self.class.attribute_map.key?(k.to_sym))
80
- fail ArgumentError, "`#{k}` is not a valid attribute in `Tremendous::ListCampaigns200ResponseCampaignsInner`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
85
+ if (!acceptable_attribute_map.key?(k.to_sym))
86
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Tremendous::ListCampaigns200ResponseCampaignsInner`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
81
87
  end
82
88
  h[k.to_sym] = v
83
89
  }
@@ -161,6 +167,26 @@ module Tremendous
161
167
  @id = id
162
168
  end
163
169
 
170
+ # Custom attribute writer method with validation
171
+ # @param [Object] name Value to be assigned
172
+ def name=(name)
173
+ if name.nil?
174
+ fail ArgumentError, 'name cannot be nil'
175
+ end
176
+
177
+ @name = name
178
+ end
179
+
180
+ # Custom attribute writer method with validation
181
+ # @param [Object] products Value to be assigned
182
+ def products=(products)
183
+ if products.nil?
184
+ fail ArgumentError, 'products cannot be nil'
185
+ end
186
+
187
+ @products = products
188
+ end
189
+
164
190
  # Checks equality by comparing each attribute.
165
191
  # @param [Object] Object to be compared
166
192
  def ==(o)