tremendous_ruby 5.4.0 → 5.6.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 (197) hide show
  1. checksums.yaml +4 -4
  2. data/lib/tremendous/api/tremendous_api.rb +59 -399
  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 +1 -1
  7. data/lib/tremendous/models/allow_email1.rb +1 -1
  8. data/lib/tremendous/models/allow_ip.rb +1 -1
  9. data/lib/tremendous/models/allow_ip1.rb +1 -1
  10. data/lib/tremendous/models/balance_transaction.rb +37 -2
  11. data/lib/tremendous/models/base_order_for_create.rb +2 -2
  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_invoice200_response.rb +1 -1
  19. data/lib/tremendous/models/create_invoice_request.rb +1 -1
  20. data/lib/tremendous/models/create_member.rb +1 -1
  21. data/lib/tremendous/models/create_member200_response.rb +1 -1
  22. data/lib/tremendous/models/create_member_request.rb +1 -1
  23. data/lib/tremendous/models/create_order200_response.rb +2 -2
  24. data/lib/tremendous/models/create_order200_response_order.rb +403 -0
  25. data/lib/tremendous/models/create_order200_response_order_rewards_inner.rb +326 -0
  26. data/lib/tremendous/models/create_order200_response_order_rewards_inner_delivery.rb +296 -0
  27. data/lib/tremendous/models/{create_public_key_request.rb → create_order201_response.rb} +15 -16
  28. data/lib/tremendous/models/create_order_request.rb +2 -2
  29. data/lib/tremendous/models/create_organization.rb +52 -5
  30. data/lib/tremendous/models/create_organization200_response.rb +1 -1
  31. data/lib/tremendous/models/create_organization200_response_organization.rb +21 -46
  32. data/lib/tremendous/models/{public_keys_response_public_keys_inner.rb → create_organization_for_response.rb} +73 -21
  33. data/lib/tremendous/models/{public_key.rb → create_organization_properties.rb} +58 -21
  34. data/lib/tremendous/models/create_organization_request.rb +8 -1
  35. data/lib/tremendous/models/create_organization_request_copy_settings.rb +1 -1
  36. data/lib/tremendous/models/create_webhook200_response.rb +1 -1
  37. data/lib/tremendous/models/create_webhook_request.rb +1 -1
  38. data/lib/tremendous/models/currency_codes.rb +1 -1
  39. data/lib/tremendous/models/custom_field.rb +1 -1
  40. data/lib/tremendous/models/delete_fraud_rule200_response.rb +1 -1
  41. data/lib/tremendous/models/delivery_details.rb +1 -15
  42. data/lib/tremendous/models/delivery_details_with_link.rb +296 -0
  43. data/lib/tremendous/models/delivery_method.rb +1 -1
  44. data/lib/tremendous/models/delivery_status.rb +1 -1
  45. data/lib/tremendous/models/error_model.rb +12 -2
  46. data/lib/tremendous/models/field.rb +1 -1
  47. data/lib/tremendous/models/fraud_config_allow_email.rb +1 -1
  48. data/lib/tremendous/models/fraud_config_country.rb +1 -1
  49. data/lib/tremendous/models/fraud_config_country_update_list.rb +1 -1
  50. data/lib/tremendous/models/fraud_config_ip.rb +1 -1
  51. data/lib/tremendous/models/fraud_config_redeemed_rewards_amount.rb +1 -1
  52. data/lib/tremendous/models/fraud_config_redeemed_rewards_count.rb +1 -1
  53. data/lib/tremendous/models/fraud_config_review_email.rb +1 -1
  54. data/lib/tremendous/models/fraud_generic_response.rb +1 -1
  55. data/lib/tremendous/models/fraud_review.rb +2 -2
  56. data/lib/tremendous/models/fraud_review_geo.rb +1 -1
  57. data/lib/tremendous/models/fraud_review_list_item.rb +2 -2
  58. data/lib/tremendous/models/fraud_review_reason.rb +1 -1
  59. data/lib/tremendous/models/fraud_review_redemption_method.rb +1 -1
  60. data/lib/tremendous/models/fraud_review_related_rewards.rb +1 -1
  61. data/lib/tremendous/models/fraud_review_status.rb +1 -1
  62. data/lib/tremendous/models/fraud_rule200_response.rb +1 -1
  63. data/lib/tremendous/models/fraud_rule400_response.rb +12 -2
  64. data/lib/tremendous/models/fraud_rule422_response.rb +12 -2
  65. data/lib/tremendous/models/fraud_rule_request.rb +1 -1
  66. data/lib/tremendous/models/fraud_rule_request_config.rb +1 -1
  67. data/lib/tremendous/models/fraud_rule_type.rb +1 -1
  68. data/lib/tremendous/models/fraud_rules_list_item.rb +5 -3
  69. data/lib/tremendous/models/funding_source.rb +1 -1
  70. data/lib/tremendous/models/generate_reward_link200_response.rb +1 -1
  71. data/lib/tremendous/models/generate_reward_link200_response_reward.rb +1 -1
  72. data/lib/tremendous/models/generate_reward_link403_response.rb +12 -2
  73. data/lib/tremendous/models/generate_reward_token200_response.rb +1 -1
  74. data/lib/tremendous/models/generate_reward_token200_response_reward.rb +1 -1
  75. data/lib/tremendous/models/get_fraud_review200_response.rb +1 -1
  76. data/lib/tremendous/models/get_fraud_review200_response_fraud_review.rb +1 -1
  77. data/lib/tremendous/models/get_fraud_review200_response_fraud_review_geo.rb +1 -1
  78. data/lib/tremendous/models/get_fraud_review200_response_fraud_review_related_rewards.rb +1 -1
  79. data/lib/tremendous/models/get_funding_source200_response.rb +1 -1
  80. data/lib/tremendous/models/get_member200_response.rb +1 -1
  81. data/lib/tremendous/models/get_member200_response_member.rb +1 -1
  82. data/lib/tremendous/models/get_member200_response_member_events_inner.rb +1 -1
  83. data/lib/tremendous/models/get_organization200_response.rb +1 -1
  84. data/lib/tremendous/models/get_product_response.rb +1 -1
  85. data/lib/tremendous/models/get_reward200_response.rb +1 -1
  86. data/lib/tremendous/models/invoice.rb +11 -2
  87. data/lib/tremendous/models/list_balance_transactions200_response.rb +16 -9
  88. data/lib/tremendous/models/{list_balance_transactions200_response_invoices_inner.rb → list_balance_transactions200_response_transactions_inner.rb} +40 -5
  89. data/lib/tremendous/models/list_campaigns200_response.rb +1 -1
  90. data/lib/tremendous/models/list_campaigns200_response_campaigns_inner.rb +1 -1
  91. data/lib/tremendous/models/list_campaigns200_response_campaigns_inner_email_style.rb +1 -1
  92. data/lib/tremendous/models/list_campaigns200_response_campaigns_inner_webpage_style.rb +1 -1
  93. data/lib/tremendous/models/list_fields200_response.rb +1 -1
  94. data/lib/tremendous/models/list_fields200_response_fields_inner.rb +1 -1
  95. data/lib/tremendous/models/list_forex_response.rb +1 -1
  96. data/lib/tremendous/models/list_fraud_reviews200_response.rb +22 -5
  97. data/lib/tremendous/models/list_fraud_reviews200_response_fraud_reviews_inner.rb +1 -1
  98. data/lib/tremendous/models/list_fraud_rules200_response.rb +1 -1
  99. data/lib/tremendous/models/list_fraud_rules200_response_fraud_rules_inner.rb +5 -3
  100. data/lib/tremendous/models/list_funding_sources200_response.rb +1 -1
  101. data/lib/tremendous/models/list_funding_sources200_response_funding_sources_inner.rb +1 -1
  102. data/lib/tremendous/models/list_funding_sources200_response_funding_sources_inner_meta.rb +1 -1
  103. data/lib/tremendous/models/list_invoices200_response.rb +1 -1
  104. data/lib/tremendous/models/list_invoices200_response_invoices_inner.rb +11 -2
  105. data/lib/tremendous/models/list_members200_response.rb +1 -1
  106. data/lib/tremendous/models/list_members200_response_members_inner.rb +1 -1
  107. data/lib/tremendous/models/list_orders200_response.rb +1 -1
  108. data/lib/tremendous/models/list_orders200_response_orders_inner.rb +32 -8
  109. data/lib/tremendous/models/list_orders200_response_orders_inner_payment.rb +5 -49
  110. data/lib/tremendous/models/list_orders200_response_orders_inner_payment_refund.rb +1 -1
  111. data/lib/tremendous/models/list_organizations200_response.rb +1 -1
  112. data/lib/tremendous/models/list_organizations200_response_organizations_inner.rb +1 -1
  113. data/lib/tremendous/models/list_products_response.rb +1 -1
  114. data/lib/tremendous/models/list_products_response_products_inner.rb +1 -1
  115. data/lib/tremendous/models/list_products_response_products_inner_countries_inner.rb +1 -1
  116. data/lib/tremendous/models/list_products_response_products_inner_images_inner.rb +1 -1
  117. data/lib/tremendous/models/list_products_response_products_inner_skus_inner.rb +1 -1
  118. data/lib/tremendous/models/list_rewards200_response.rb +1 -1
  119. data/lib/tremendous/models/list_rewards200_response_rewards_inner.rb +1 -1
  120. data/lib/tremendous/models/list_rewards200_response_rewards_inner_custom_fields_inner.rb +1 -1
  121. data/lib/tremendous/models/list_rewards200_response_rewards_inner_delivery.rb +1 -15
  122. data/lib/tremendous/models/list_rewards200_response_rewards_inner_recipient.rb +1 -1
  123. data/lib/tremendous/models/list_rewards200_response_rewards_inner_value.rb +1 -1
  124. data/lib/tremendous/models/list_rewards401_response.rb +12 -2
  125. data/lib/tremendous/models/list_rewards401_response_errors.rb +5 -3
  126. data/lib/tremendous/models/list_rewards429_response.rb +12 -2
  127. data/lib/tremendous/models/list_roles200_response.rb +1 -1
  128. data/lib/tremendous/models/list_roles200_response_roles_inner.rb +1 -1
  129. data/lib/tremendous/models/list_webhook_events200_response.rb +1 -1
  130. data/lib/tremendous/models/list_webhooks200_response.rb +1 -1
  131. data/lib/tremendous/models/list_webhooks200_response_webhooks_inner.rb +1 -1
  132. data/lib/tremendous/models/member.rb +1 -1
  133. data/lib/tremendous/models/member_base.rb +1 -1
  134. data/lib/tremendous/models/member_with_events.rb +1 -1
  135. data/lib/tremendous/models/member_without_events.rb +1 -1
  136. data/lib/tremendous/models/order.rb +32 -8
  137. data/lib/tremendous/models/order_base.rb +24 -2
  138. data/lib/tremendous/models/order_base_payment.rb +5 -49
  139. data/lib/tremendous/models/order_status.rb +1 -1
  140. data/lib/tremendous/models/order_with_link.rb +403 -0
  141. data/lib/tremendous/models/order_with_link_rewards_inner.rb +385 -0
  142. data/lib/tremendous/models/order_without_link.rb +32 -8
  143. data/lib/tremendous/models/{order_without_link_reward.rb → order_without_link_rewards_inner.rb} +4 -4
  144. data/lib/tremendous/models/organization.rb +1 -1
  145. data/lib/tremendous/models/payment_details.rb +5 -49
  146. data/lib/tremendous/models/payment_details_refund.rb +1 -1
  147. data/lib/tremendous/models/payout.rb +340 -0
  148. data/lib/tremendous/models/product.rb +1 -1
  149. data/lib/tremendous/models/recipient.rb +1 -1
  150. data/lib/tremendous/models/refund_details.rb +1 -1
  151. data/lib/tremendous/models/resend_reward422_response.rb +12 -2
  152. data/lib/tremendous/models/review_country.rb +1 -1
  153. data/lib/tremendous/models/review_country1.rb +1 -1
  154. data/lib/tremendous/models/review_email.rb +1 -1
  155. data/lib/tremendous/models/review_email1.rb +1 -1
  156. data/lib/tremendous/models/review_ip.rb +1 -1
  157. data/lib/tremendous/models/review_ip1.rb +1 -1
  158. data/lib/tremendous/models/review_redeemed_rewards_amount.rb +1 -1
  159. data/lib/tremendous/models/review_redeemed_rewards_count.rb +1 -1
  160. data/lib/tremendous/models/reward.rb +1 -1
  161. data/lib/tremendous/models/reward_base.rb +1 -1
  162. data/lib/tremendous/models/reward_base_custom_fields_inner.rb +1 -1
  163. data/lib/tremendous/models/reward_for_order_create.rb +2 -2
  164. data/lib/tremendous/models/reward_link.rb +1 -1
  165. data/lib/tremendous/models/reward_token.rb +1 -1
  166. data/lib/tremendous/models/reward_value.rb +1 -1
  167. data/lib/tremendous/models/{single_reward_order1_reward.rb → reward_with_link.rb} +79 -17
  168. data/lib/tremendous/models/reward_with_link_delivery.rb +296 -0
  169. data/lib/tremendous/models/reward_without_link.rb +1 -1
  170. data/lib/tremendous/models/reward_without_link_delivery.rb +1 -15
  171. data/lib/tremendous/models/role.rb +1 -1
  172. data/lib/tremendous/models/simulate_webhook_request.rb +1 -1
  173. data/lib/tremendous/models/single_reward_order.rb +2 -2
  174. data/lib/tremendous/models/{single_reward_order1_payment.rb → single_reward_order_payment.rb} +4 -4
  175. data/lib/tremendous/models/single_reward_order_reward.rb +4 -76
  176. data/lib/tremendous/models/{single_reward_order1_reward_custom_fields_inner.rb → single_reward_order_reward_custom_fields_inner.rb} +4 -4
  177. data/lib/tremendous/models/{single_reward_order1_reward_delivery.rb → single_reward_order_reward_delivery.rb} +4 -4
  178. data/lib/tremendous/models/{test_public_key.rb → single_reward_order_with_link.rb} +15 -16
  179. data/lib/tremendous/models/single_reward_order_with_link_order.rb +403 -0
  180. data/lib/tremendous/models/single_reward_order_without_link.rb +1 -1
  181. data/lib/tremendous/models/single_reward_order_without_link_order.rb +32 -8
  182. data/lib/tremendous/models/update_campaign.rb +1 -1
  183. data/lib/tremendous/models/update_campaign_request.rb +1 -1
  184. data/lib/tremendous/models/update_fraud_rule_list200_response.rb +1 -1
  185. data/lib/tremendous/models/update_fraud_rule_list_request.rb +1 -1
  186. data/lib/tremendous/models/update_fraud_rule_list_request_config.rb +1 -1
  187. data/lib/tremendous/models/webhook.rb +1 -1
  188. data/lib/tremendous/models/webhook_post.rb +1 -1
  189. data/lib/tremendous/version.rb +1 -1
  190. data/lib/tremendous.rb +21 -17
  191. metadata +22 -18
  192. data/lib/tremendous/models/create_invoice.rb +0 -244
  193. data/lib/tremendous/models/create_public_key.rb +0 -222
  194. data/lib/tremendous/models/create_public_key200_response.rb +0 -221
  195. data/lib/tremendous/models/public_keys_response.rb +0 -223
  196. data/lib/tremendous/models/single_reward_order1.rb +0 -242
  197. data/lib/tremendous/models/test_public_key_request.rb +0 -222
@@ -1,221 +0,0 @@
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
- OpenAPI Generator version: 7.3.0
10
-
11
- =end
12
-
13
- require 'date'
14
- require 'time'
15
-
16
- module Tremendous
17
- class CreatePublicKey200Response
18
- attr_accessor :public_key
19
-
20
- # Attribute mapping from ruby-style variable name to JSON key.
21
- def self.attribute_map
22
- {
23
- :'public_key' => :'public_key'
24
- }
25
- end
26
-
27
- # Returns all the JSON keys this model knows about
28
- def self.acceptable_attributes
29
- attribute_map.values
30
- end
31
-
32
- # Attribute type mapping.
33
- def self.openapi_types
34
- {
35
- :'public_key' => :'PublicKeysResponsePublicKeysInner'
36
- }
37
- end
38
-
39
- # List of attributes with nullable: true
40
- def self.openapi_nullable
41
- Set.new([
42
- ])
43
- end
44
-
45
- # Initializes the object
46
- # @param [Hash] attributes Model attributes in the form of hash
47
- def initialize(attributes = {})
48
- if (!attributes.is_a?(Hash))
49
- fail ArgumentError, "The input argument (attributes) must be a hash in `Tremendous::CreatePublicKey200Response` initialize method"
50
- end
51
-
52
- # check to see if the attribute exists and convert string to symbol for hash key
53
- 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::CreatePublicKey200Response`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
56
- end
57
- h[k.to_sym] = v
58
- }
59
-
60
- if attributes.key?(:'public_key')
61
- self.public_key = attributes[:'public_key']
62
- else
63
- self.public_key = nil
64
- end
65
- end
66
-
67
- # Show invalid properties with the reasons. Usually used together with valid?
68
- # @return Array for valid properties with the reasons
69
- def list_invalid_properties
70
- warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
71
- invalid_properties = Array.new
72
- if @public_key.nil?
73
- invalid_properties.push('invalid value for "public_key", public_key cannot be nil.')
74
- end
75
-
76
- invalid_properties
77
- end
78
-
79
- # Check to see if the all the properties in the model are valid
80
- # @return true if the model is valid
81
- def valid?
82
- warn '[DEPRECATED] the `valid?` method is obsolete'
83
- return false if @public_key.nil?
84
- true
85
- end
86
-
87
- # Checks equality by comparing each attribute.
88
- # @param [Object] Object to be compared
89
- def ==(o)
90
- return true if self.equal?(o)
91
- self.class == o.class &&
92
- public_key == o.public_key
93
- end
94
-
95
- # @see the `==` method
96
- # @param [Object] Object to be compared
97
- def eql?(o)
98
- self == o
99
- end
100
-
101
- # Calculates hash code according to all attributes.
102
- # @return [Integer] Hash code
103
- def hash
104
- [public_key].hash
105
- end
106
-
107
- # Builds the object from hash
108
- # @param [Hash] attributes Model attributes in the form of hash
109
- # @return [Object] Returns the model itself
110
- def self.build_from_hash(attributes)
111
- return nil unless attributes.is_a?(Hash)
112
- attributes = attributes.transform_keys(&:to_sym)
113
- transformed_hash = {}
114
- openapi_types.each_pair do |key, type|
115
- if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
116
- transformed_hash["#{key}"] = nil
117
- elsif type =~ /\AArray<(.*)>/i
118
- # check to ensure the input is an array given that the attribute
119
- # is documented as an array but the input is not
120
- if attributes[attribute_map[key]].is_a?(Array)
121
- transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
122
- end
123
- elsif !attributes[attribute_map[key]].nil?
124
- transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
125
- end
126
- end
127
- new(transformed_hash)
128
- end
129
-
130
- # Deserializes the data based on type
131
- # @param string type Data type
132
- # @param string value Value to be deserialized
133
- # @return [Object] Deserialized data
134
- def self._deserialize(type, value)
135
- case type.to_sym
136
- when :Time
137
- Time.parse(value)
138
- when :Date
139
- Date.parse(value)
140
- when :String
141
- value.to_s
142
- when :Integer
143
- value.to_i
144
- when :Float
145
- value.to_f
146
- when :Boolean
147
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
148
- true
149
- else
150
- false
151
- end
152
- when :Object
153
- # generic object (usually a Hash), return directly
154
- value
155
- when /\AArray<(?<inner_type>.+)>\z/
156
- inner_type = Regexp.last_match[:inner_type]
157
- value.map { |v| _deserialize(inner_type, v) }
158
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
159
- k_type = Regexp.last_match[:k_type]
160
- v_type = Regexp.last_match[:v_type]
161
- {}.tap do |hash|
162
- value.each do |k, v|
163
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
164
- end
165
- end
166
- else # model
167
- # models (e.g. Pet) or oneOf
168
- klass = Tremendous.const_get(type)
169
- klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
170
- end
171
- end
172
-
173
- # Returns the string representation of the object
174
- # @return [String] String presentation of the object
175
- def to_s
176
- to_hash.to_s
177
- end
178
-
179
- # to_body is an alias to to_hash (backward compatibility)
180
- # @return [Hash] Returns the object in the form of hash
181
- def to_body
182
- to_hash
183
- end
184
-
185
- # Returns the object in the form of hash
186
- # @return [Hash] Returns the object in the form of hash
187
- def to_hash
188
- hash = {}
189
- self.class.attribute_map.each_pair do |attr, param|
190
- value = self.send(attr)
191
- if value.nil?
192
- is_nullable = self.class.openapi_nullable.include?(attr)
193
- next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
194
- end
195
-
196
- hash[param] = _to_hash(value)
197
- end
198
- hash
199
- end
200
-
201
- # Outputs non-array value in the form of hash
202
- # For object, use to_hash. Otherwise, just return the value
203
- # @param [Object] value Any valid value
204
- # @return [Hash] Returns the value in the form of hash
205
- def _to_hash(value)
206
- if value.is_a?(Array)
207
- value.compact.map { |v| _to_hash(v) }
208
- elsif value.is_a?(Hash)
209
- {}.tap do |hash|
210
- value.each { |k, v| hash[k] = _to_hash(v) }
211
- end
212
- elsif value.respond_to? :to_hash
213
- value.to_hash
214
- else
215
- value
216
- end
217
- end
218
-
219
- end
220
-
221
- end
@@ -1,223 +0,0 @@
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
- OpenAPI Generator version: 7.3.0
10
-
11
- =end
12
-
13
- require 'date'
14
- require 'time'
15
-
16
- module Tremendous
17
- class PublicKeysResponse
18
- attr_accessor :public_keys
19
-
20
- # Attribute mapping from ruby-style variable name to JSON key.
21
- def self.attribute_map
22
- {
23
- :'public_keys' => :'public_keys'
24
- }
25
- end
26
-
27
- # Returns all the JSON keys this model knows about
28
- def self.acceptable_attributes
29
- attribute_map.values
30
- end
31
-
32
- # Attribute type mapping.
33
- def self.openapi_types
34
- {
35
- :'public_keys' => :'Array<PublicKeysResponsePublicKeysInner>'
36
- }
37
- end
38
-
39
- # List of attributes with nullable: true
40
- def self.openapi_nullable
41
- Set.new([
42
- ])
43
- end
44
-
45
- # Initializes the object
46
- # @param [Hash] attributes Model attributes in the form of hash
47
- def initialize(attributes = {})
48
- if (!attributes.is_a?(Hash))
49
- fail ArgumentError, "The input argument (attributes) must be a hash in `Tremendous::PublicKeysResponse` initialize method"
50
- end
51
-
52
- # check to see if the attribute exists and convert string to symbol for hash key
53
- 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::PublicKeysResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
56
- end
57
- h[k.to_sym] = v
58
- }
59
-
60
- if attributes.key?(:'public_keys')
61
- if (value = attributes[:'public_keys']).is_a?(Array)
62
- self.public_keys = value
63
- end
64
- else
65
- self.public_keys = nil
66
- end
67
- end
68
-
69
- # Show invalid properties with the reasons. Usually used together with valid?
70
- # @return Array for valid properties with the reasons
71
- def list_invalid_properties
72
- warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
73
- invalid_properties = Array.new
74
- if @public_keys.nil?
75
- invalid_properties.push('invalid value for "public_keys", public_keys cannot be nil.')
76
- end
77
-
78
- invalid_properties
79
- end
80
-
81
- # Check to see if the all the properties in the model are valid
82
- # @return true if the model is valid
83
- def valid?
84
- warn '[DEPRECATED] the `valid?` method is obsolete'
85
- return false if @public_keys.nil?
86
- true
87
- end
88
-
89
- # Checks equality by comparing each attribute.
90
- # @param [Object] Object to be compared
91
- def ==(o)
92
- return true if self.equal?(o)
93
- self.class == o.class &&
94
- public_keys == o.public_keys
95
- end
96
-
97
- # @see the `==` method
98
- # @param [Object] Object to be compared
99
- def eql?(o)
100
- self == o
101
- end
102
-
103
- # Calculates hash code according to all attributes.
104
- # @return [Integer] Hash code
105
- def hash
106
- [public_keys].hash
107
- end
108
-
109
- # Builds the object from hash
110
- # @param [Hash] attributes Model attributes in the form of hash
111
- # @return [Object] Returns the model itself
112
- def self.build_from_hash(attributes)
113
- return nil unless attributes.is_a?(Hash)
114
- attributes = attributes.transform_keys(&:to_sym)
115
- transformed_hash = {}
116
- openapi_types.each_pair do |key, type|
117
- if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
118
- transformed_hash["#{key}"] = nil
119
- elsif type =~ /\AArray<(.*)>/i
120
- # check to ensure the input is an array given that the attribute
121
- # is documented as an array but the input is not
122
- if attributes[attribute_map[key]].is_a?(Array)
123
- transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
124
- end
125
- elsif !attributes[attribute_map[key]].nil?
126
- transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
127
- end
128
- end
129
- new(transformed_hash)
130
- end
131
-
132
- # Deserializes the data based on type
133
- # @param string type Data type
134
- # @param string value Value to be deserialized
135
- # @return [Object] Deserialized data
136
- def self._deserialize(type, value)
137
- case type.to_sym
138
- when :Time
139
- Time.parse(value)
140
- when :Date
141
- Date.parse(value)
142
- when :String
143
- value.to_s
144
- when :Integer
145
- value.to_i
146
- when :Float
147
- value.to_f
148
- when :Boolean
149
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
150
- true
151
- else
152
- false
153
- end
154
- when :Object
155
- # generic object (usually a Hash), return directly
156
- value
157
- when /\AArray<(?<inner_type>.+)>\z/
158
- inner_type = Regexp.last_match[:inner_type]
159
- value.map { |v| _deserialize(inner_type, v) }
160
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
161
- k_type = Regexp.last_match[:k_type]
162
- v_type = Regexp.last_match[:v_type]
163
- {}.tap do |hash|
164
- value.each do |k, v|
165
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
166
- end
167
- end
168
- else # model
169
- # models (e.g. Pet) or oneOf
170
- klass = Tremendous.const_get(type)
171
- klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
172
- end
173
- end
174
-
175
- # Returns the string representation of the object
176
- # @return [String] String presentation of the object
177
- def to_s
178
- to_hash.to_s
179
- end
180
-
181
- # to_body is an alias to to_hash (backward compatibility)
182
- # @return [Hash] Returns the object in the form of hash
183
- def to_body
184
- to_hash
185
- end
186
-
187
- # Returns the object in the form of hash
188
- # @return [Hash] Returns the object in the form of hash
189
- def to_hash
190
- hash = {}
191
- self.class.attribute_map.each_pair do |attr, param|
192
- value = self.send(attr)
193
- if value.nil?
194
- is_nullable = self.class.openapi_nullable.include?(attr)
195
- next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
196
- end
197
-
198
- hash[param] = _to_hash(value)
199
- end
200
- hash
201
- end
202
-
203
- # Outputs non-array value in the form of hash
204
- # For object, use to_hash. Otherwise, just return the value
205
- # @param [Object] value Any valid value
206
- # @return [Hash] Returns the value in the form of hash
207
- def _to_hash(value)
208
- if value.is_a?(Array)
209
- value.compact.map { |v| _to_hash(v) }
210
- elsif value.is_a?(Hash)
211
- {}.tap do |hash|
212
- value.each { |k, v| hash[k] = _to_hash(v) }
213
- end
214
- elsif value.respond_to? :to_hash
215
- value.to_hash
216
- else
217
- value
218
- end
219
- end
220
-
221
- end
222
-
223
- end
@@ -1,242 +0,0 @@
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
- OpenAPI Generator version: 7.3.0
10
-
11
- =end
12
-
13
- require 'date'
14
- require 'time'
15
-
16
- module Tremendous
17
- # An order that contains a single reward. The reward is sent to a single recipient.
18
- class SingleRewardOrder1
19
- # Reference for this order, supplied by the customer. When set, `external_id` makes order idempotent. All requests that use the same `external_id` after the initial order creation, will result in a response that returns the data of the initially created order. The response will have a `201` response code. These responses **fail** to create any further orders. It also allows for retrieving by `external_id` instead of `id` only.
20
- attr_accessor :external_id
21
-
22
- attr_accessor :payment
23
-
24
- attr_accessor :reward
25
-
26
- # Attribute mapping from ruby-style variable name to JSON key.
27
- def self.attribute_map
28
- {
29
- :'external_id' => :'external_id',
30
- :'payment' => :'payment',
31
- :'reward' => :'reward'
32
- }
33
- end
34
-
35
- # Returns all the JSON keys this model knows about
36
- def self.acceptable_attributes
37
- attribute_map.values
38
- end
39
-
40
- # Attribute type mapping.
41
- def self.openapi_types
42
- {
43
- :'external_id' => :'String',
44
- :'payment' => :'SingleRewardOrder1Payment',
45
- :'reward' => :'SingleRewardOrder1Reward'
46
- }
47
- end
48
-
49
- # List of attributes with nullable: true
50
- def self.openapi_nullable
51
- Set.new([
52
- :'external_id',
53
- ])
54
- end
55
-
56
- # Initializes the object
57
- # @param [Hash] attributes Model attributes in the form of hash
58
- def initialize(attributes = {})
59
- if (!attributes.is_a?(Hash))
60
- fail ArgumentError, "The input argument (attributes) must be a hash in `Tremendous::SingleRewardOrder1` initialize method"
61
- end
62
-
63
- # check to see if the attribute exists and convert string to symbol for hash key
64
- 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::SingleRewardOrder1`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
67
- end
68
- h[k.to_sym] = v
69
- }
70
-
71
- if attributes.key?(:'external_id')
72
- self.external_id = attributes[:'external_id']
73
- end
74
-
75
- if attributes.key?(:'payment')
76
- self.payment = attributes[:'payment']
77
- end
78
-
79
- if attributes.key?(:'reward')
80
- self.reward = attributes[:'reward']
81
- else
82
- self.reward = nil
83
- end
84
- end
85
-
86
- # Show invalid properties with the reasons. Usually used together with valid?
87
- # @return Array for valid properties with the reasons
88
- def list_invalid_properties
89
- warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
90
- invalid_properties = Array.new
91
- if @reward.nil?
92
- invalid_properties.push('invalid value for "reward", reward cannot be nil.')
93
- end
94
-
95
- invalid_properties
96
- end
97
-
98
- # Check to see if the all the properties in the model are valid
99
- # @return true if the model is valid
100
- def valid?
101
- warn '[DEPRECATED] the `valid?` method is obsolete'
102
- return false if @reward.nil?
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
- external_id == o.external_id &&
112
- payment == o.payment &&
113
- reward == o.reward
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
- [external_id, payment, reward].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