tremendous_ruby 5.1.0 → 5.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/tremendous/api/tremendous_api.rb +1125 -38
- data/lib/tremendous/models/allow_email.rb +225 -0
- data/lib/tremendous/models/allow_email1.rb +225 -0
- data/lib/tremendous/models/allow_ip.rb +225 -0
- data/lib/tremendous/models/allow_ip1.rb +225 -0
- data/lib/tremendous/models/base_order_for_create.rb +232 -0
- data/lib/tremendous/models/campaign_base.rb +287 -0
- data/lib/tremendous/models/create_member.rb +1 -35
- data/lib/tremendous/models/create_member_request.rb +1 -35
- data/lib/tremendous/models/create_order200_response.rb +1 -1
- data/lib/tremendous/models/create_order_request.rb +73 -217
- data/lib/tremendous/models/create_organization_request_copy_settings.rb +14 -2
- data/lib/tremendous/models/create_public_key.rb +222 -0
- data/lib/tremendous/models/create_public_key200_response.rb +221 -0
- data/lib/tremendous/models/create_public_key_request.rb +222 -0
- data/lib/tremendous/models/delete_fraud_rule200_response.rb +222 -0
- data/lib/tremendous/models/fraud_config_allow_email.rb +224 -0
- data/lib/tremendous/models/fraud_config_country.rb +275 -0
- data/lib/tremendous/models/fraud_config_country_update_list.rb +224 -0
- data/lib/tremendous/models/fraud_config_ip.rb +224 -0
- data/lib/tremendous/models/fraud_config_redeemed_rewards_amount.rb +292 -0
- data/lib/tremendous/models/fraud_config_redeemed_rewards_count.rb +292 -0
- data/lib/tremendous/models/fraud_config_review_email.rb +229 -0
- data/lib/tremendous/models/fraud_generic_response.rb +222 -0
- data/lib/tremendous/models/fraud_review.rb +351 -0
- data/lib/tremendous/models/fraud_review_geo.rb +235 -0
- data/lib/tremendous/models/{reward_with_link_delivery.rb → fraud_review_list_item.rb} +26 -51
- data/lib/tremendous/models/fraud_review_reason.rb +58 -0
- data/lib/tremendous/models/fraud_review_redemption_method.rb +44 -0
- data/lib/tremendous/models/fraud_review_related_rewards.rb +304 -0
- data/lib/tremendous/models/fraud_review_status.rb +41 -0
- data/lib/tremendous/models/fraud_rule200_response.rb +222 -0
- data/lib/tremendous/models/fraud_rule400_response.rb +221 -0
- data/lib/tremendous/models/fraud_rule422_response.rb +221 -0
- data/lib/tremendous/models/fraud_rule_request.rb +214 -0
- data/lib/tremendous/models/fraud_rule_request_config.rb +110 -0
- data/lib/tremendous/models/fraud_rule_type.rb +49 -0
- data/lib/tremendous/models/fraud_rules_list_item.rb +261 -0
- data/lib/tremendous/models/get_fraud_review200_response.rb +221 -0
- data/lib/tremendous/models/get_fraud_review200_response_fraud_review.rb +351 -0
- data/lib/tremendous/models/get_fraud_review200_response_fraud_review_geo.rb +236 -0
- data/lib/tremendous/models/get_fraud_review200_response_fraud_review_related_rewards.rb +305 -0
- data/lib/tremendous/models/get_member200_response_member.rb +2 -20
- data/lib/tremendous/models/list_campaigns200_response_campaigns_inner_email_style.rb +2 -0
- data/lib/tremendous/models/list_campaigns200_response_campaigns_inner_webpage_style.rb +1 -0
- data/lib/tremendous/models/list_forex_response.rb +223 -0
- data/lib/tremendous/models/list_fraud_reviews200_response.rb +223 -0
- data/lib/tremendous/models/{delivery_details_with_link.rb → list_fraud_reviews200_response_fraud_reviews_inner.rb} +26 -51
- data/lib/tremendous/models/list_fraud_rules200_response.rb +223 -0
- data/lib/tremendous/models/{create_order200_response_order_rewards_inner_delivery.rb → list_fraud_rules200_response_fraud_rules_inner.rb} +28 -63
- data/lib/tremendous/models/list_members200_response_members_inner.rb +2 -20
- data/lib/tremendous/models/list_rewards200_response_rewards_inner.rb +0 -21
- data/lib/tremendous/models/list_rewards200_response_rewards_inner_value.rb +1 -6
- data/lib/tremendous/models/list_roles200_response.rb +223 -0
- data/lib/tremendous/models/list_roles200_response_roles_inner.rb +275 -0
- data/lib/tremendous/models/member.rb +2 -20
- data/lib/tremendous/models/member_base.rb +2 -20
- data/lib/tremendous/models/member_with_events.rb +2 -20
- data/lib/tremendous/models/member_without_events.rb +2 -20
- data/lib/tremendous/models/order_without_link_reward.rb +0 -21
- data/lib/tremendous/models/public_key.rb +257 -0
- data/lib/tremendous/models/public_keys_response.rb +223 -0
- data/lib/tremendous/models/public_keys_response_public_keys_inner.rb +257 -0
- data/lib/tremendous/models/review_country.rb +276 -0
- data/lib/tremendous/models/review_country1.rb +225 -0
- data/lib/tremendous/models/review_email.rb +230 -0
- data/lib/tremendous/models/review_email1.rb +230 -0
- data/lib/tremendous/models/review_ip.rb +225 -0
- data/lib/tremendous/models/review_ip1.rb +225 -0
- data/lib/tremendous/models/review_redeemed_rewards_amount.rb +293 -0
- data/lib/tremendous/models/review_redeemed_rewards_count.rb +293 -0
- data/lib/tremendous/models/reward.rb +0 -21
- data/lib/tremendous/models/reward_base.rb +0 -21
- data/lib/tremendous/models/reward_for_order_create.rb +1 -22
- data/lib/tremendous/models/reward_value.rb +1 -6
- data/lib/tremendous/models/reward_without_link.rb +0 -21
- data/lib/tremendous/models/role.rb +275 -0
- data/lib/tremendous/models/{order_for_create.rb → single_reward_order.rb} +6 -12
- data/lib/tremendous/models/single_reward_order1.rb +242 -0
- data/lib/tremendous/models/{create_order_request_payment.rb → single_reward_order1_payment.rb} +3 -3
- data/lib/tremendous/models/{create_order_request_reward.rb → single_reward_order1_reward.rb} +5 -26
- data/lib/tremendous/models/{create_order_request_reward_custom_fields_inner.rb → single_reward_order1_reward_custom_fields_inner.rb} +3 -3
- data/lib/tremendous/models/{create_order_request_reward_delivery.rb → single_reward_order1_reward_delivery.rb} +3 -3
- data/lib/tremendous/models/{order_for_create_reward.rb → single_reward_order_reward.rb} +4 -25
- data/lib/tremendous/models/{create_order201_response.rb → single_reward_order_without_link.rb} +4 -4
- data/lib/tremendous/models/{order_with_link.rb → single_reward_order_without_link_order.rb} +10 -31
- data/lib/tremendous/models/test_public_key.rb +222 -0
- data/lib/tremendous/models/test_public_key_request.rb +222 -0
- data/lib/tremendous/models/update_campaign.rb +287 -0
- data/lib/tremendous/models/update_campaign_request.rb +257 -0
- data/lib/tremendous/models/update_fraud_rule_list200_response.rb +222 -0
- data/lib/tremendous/models/update_fraud_rule_list_request.rb +272 -0
- data/lib/tremendous/models/update_fraud_rule_list_request_config.rb +108 -0
- data/lib/tremendous/version.rb +1 -1
- data/lib/tremendous.rb +71 -15
- metadata +74 -18
- data/lib/tremendous/models/create_order200_response_order.rb +0 -400
- data/lib/tremendous/models/create_order200_response_order_rewards_inner.rb +0 -347
- data/lib/tremendous/models/order_with_link_rewards_inner.rb +0 -406
- data/lib/tremendous/models/reward_with_link.rb +0 -406
data/lib/tremendous/models/{create_order_request_payment.rb → single_reward_order1_payment.rb}
RENAMED
|
@@ -14,7 +14,7 @@ require 'date'
|
|
|
14
14
|
require 'time'
|
|
15
15
|
|
|
16
16
|
module Tremendous
|
|
17
|
-
class
|
|
17
|
+
class SingleRewardOrder1Payment
|
|
18
18
|
# Tremendous ID of the funding source that will be used to pay for the order. Use `balance` to use your Tremendous's balance.
|
|
19
19
|
attr_accessor :funding_source_id
|
|
20
20
|
|
|
@@ -47,13 +47,13 @@ module Tremendous
|
|
|
47
47
|
# @param [Hash] attributes Model attributes in the form of hash
|
|
48
48
|
def initialize(attributes = {})
|
|
49
49
|
if (!attributes.is_a?(Hash))
|
|
50
|
-
fail ArgumentError, "The input argument (attributes) must be a hash in `Tremendous::
|
|
50
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Tremendous::SingleRewardOrder1Payment` initialize method"
|
|
51
51
|
end
|
|
52
52
|
|
|
53
53
|
# check to see if the attribute exists and convert string to symbol for hash key
|
|
54
54
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
55
55
|
if (!self.class.attribute_map.key?(k.to_sym))
|
|
56
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `Tremendous::
|
|
56
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Tremendous::SingleRewardOrder1Payment`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
|
57
57
|
end
|
|
58
58
|
h[k.to_sym] = v
|
|
59
59
|
}
|
data/lib/tremendous/models/{create_order_request_reward.rb → single_reward_order1_reward.rb}
RENAMED
|
@@ -15,7 +15,7 @@ require 'time'
|
|
|
15
15
|
|
|
16
16
|
module Tremendous
|
|
17
17
|
# A single reward, sent to a recipient. A reward is always part of an order. Either `products` or `campaign_id` must be specified.
|
|
18
|
-
class
|
|
18
|
+
class SingleRewardOrder1Reward
|
|
19
19
|
# ID of the campaign in your account, that defines the available products (different gift cards, charity, etc.) that the recipient can choose from.
|
|
20
20
|
attr_accessor :campaign_id
|
|
21
21
|
|
|
@@ -63,9 +63,9 @@ module Tremendous
|
|
|
63
63
|
:'value' => :'ListRewards200ResponseRewardsInnerValue',
|
|
64
64
|
:'recipient' => :'ListRewards200ResponseRewardsInnerRecipient',
|
|
65
65
|
:'deliver_at' => :'Date',
|
|
66
|
-
:'custom_fields' => :'Array<
|
|
66
|
+
:'custom_fields' => :'Array<SingleRewardOrder1RewardCustomFieldsInner>',
|
|
67
67
|
:'language' => :'String',
|
|
68
|
-
:'delivery' => :'
|
|
68
|
+
:'delivery' => :'SingleRewardOrder1RewardDelivery'
|
|
69
69
|
}
|
|
70
70
|
end
|
|
71
71
|
|
|
@@ -80,13 +80,13 @@ module Tremendous
|
|
|
80
80
|
# @param [Hash] attributes Model attributes in the form of hash
|
|
81
81
|
def initialize(attributes = {})
|
|
82
82
|
if (!attributes.is_a?(Hash))
|
|
83
|
-
fail ArgumentError, "The input argument (attributes) must be a hash in `Tremendous::
|
|
83
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Tremendous::SingleRewardOrder1Reward` initialize method"
|
|
84
84
|
end
|
|
85
85
|
|
|
86
86
|
# check to see if the attribute exists and convert string to symbol for hash key
|
|
87
87
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
88
88
|
if (!self.class.attribute_map.key?(k.to_sym))
|
|
89
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `Tremendous::
|
|
89
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Tremendous::SingleRewardOrder1Reward`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
|
90
90
|
end
|
|
91
91
|
h[k.to_sym] = v
|
|
92
92
|
}
|
|
@@ -142,11 +142,6 @@ module Tremendous
|
|
|
142
142
|
invalid_properties.push('invalid value for "products", number of items must be greater than or equal to 1.')
|
|
143
143
|
end
|
|
144
144
|
|
|
145
|
-
pattern = Regexp.new(/YYYY-MM-DD/)
|
|
146
|
-
if !@deliver_at.nil? && @deliver_at !~ pattern
|
|
147
|
-
invalid_properties.push("invalid value for \"deliver_at\", must conform to the pattern #{pattern}.")
|
|
148
|
-
end
|
|
149
|
-
|
|
150
145
|
invalid_properties
|
|
151
146
|
end
|
|
152
147
|
|
|
@@ -156,7 +151,6 @@ module Tremendous
|
|
|
156
151
|
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
157
152
|
return false if !@campaign_id.nil? && @campaign_id !~ Regexp.new(/[A-Z0-9]{4,20}/)
|
|
158
153
|
return false if !@products.nil? && @products.length < 1
|
|
159
|
-
return false if !@deliver_at.nil? && @deliver_at !~ Regexp.new(/YYYY-MM-DD/)
|
|
160
154
|
true
|
|
161
155
|
end
|
|
162
156
|
|
|
@@ -185,21 +179,6 @@ module Tremendous
|
|
|
185
179
|
@products = products
|
|
186
180
|
end
|
|
187
181
|
|
|
188
|
-
# Custom attribute writer method with validation
|
|
189
|
-
# @param [Object] deliver_at Value to be assigned
|
|
190
|
-
def deliver_at=(deliver_at)
|
|
191
|
-
if deliver_at.nil?
|
|
192
|
-
fail ArgumentError, 'deliver_at cannot be nil'
|
|
193
|
-
end
|
|
194
|
-
|
|
195
|
-
pattern = Regexp.new(/YYYY-MM-DD/)
|
|
196
|
-
if deliver_at !~ pattern
|
|
197
|
-
fail ArgumentError, "invalid value for \"deliver_at\", must conform to the pattern #{pattern}."
|
|
198
|
-
end
|
|
199
|
-
|
|
200
|
-
@deliver_at = deliver_at
|
|
201
|
-
end
|
|
202
|
-
|
|
203
182
|
# Checks equality by comparing each attribute.
|
|
204
183
|
# @param [Object] Object to be compared
|
|
205
184
|
def ==(o)
|
|
@@ -15,7 +15,7 @@ require 'time'
|
|
|
15
15
|
|
|
16
16
|
module Tremendous
|
|
17
17
|
# Reward custom data for searching, tracking or copy (see [Adding custom fields to orders](https://developers.tremendous.com/reference/using-custom-fields-to-add-custom-data-to-rewards).)
|
|
18
|
-
class
|
|
18
|
+
class SingleRewardOrder1RewardCustomFieldsInner
|
|
19
19
|
# Tremendous ID of the custom field
|
|
20
20
|
attr_accessor :id
|
|
21
21
|
|
|
@@ -54,13 +54,13 @@ module Tremendous
|
|
|
54
54
|
# @param [Hash] attributes Model attributes in the form of hash
|
|
55
55
|
def initialize(attributes = {})
|
|
56
56
|
if (!attributes.is_a?(Hash))
|
|
57
|
-
fail ArgumentError, "The input argument (attributes) must be a hash in `Tremendous::
|
|
57
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Tremendous::SingleRewardOrder1RewardCustomFieldsInner` initialize method"
|
|
58
58
|
end
|
|
59
59
|
|
|
60
60
|
# check to see if the attribute exists and convert string to symbol for hash key
|
|
61
61
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
62
62
|
if (!self.class.attribute_map.key?(k.to_sym))
|
|
63
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `Tremendous::
|
|
63
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Tremendous::SingleRewardOrder1RewardCustomFieldsInner`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
|
64
64
|
end
|
|
65
65
|
h[k.to_sym] = v
|
|
66
66
|
}
|
|
@@ -15,7 +15,7 @@ require 'time'
|
|
|
15
15
|
|
|
16
16
|
module Tremendous
|
|
17
17
|
# Details on how the reward is delivered to the recipient.
|
|
18
|
-
class
|
|
18
|
+
class SingleRewardOrder1RewardDelivery
|
|
19
19
|
# How to deliver the reward to the recipient. <table> <thead> <tr> <th>Delivery Method</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td><code>EMAIL</code></td> <td>Deliver the reward to the recipient by email</td> </tr> <tr> <td><code>LINK</code></td> <td> <p>Deliver the reward to the recipient via a link.</p> <p>The link can be retrieved on a successfully ordered reward via the <code>/rewards</code> or <code>/rewards/{id}</code> endpoint. That link must then be delivered to the recipient out-of-band.</p> </td> </tr> <tr> <td><code>PHONE</code></td> <td>Deliver the reward to the recipient by SMS</td> </tr> </tbody> </table>
|
|
20
20
|
attr_accessor :method
|
|
21
21
|
|
|
@@ -70,13 +70,13 @@ module Tremendous
|
|
|
70
70
|
# @param [Hash] attributes Model attributes in the form of hash
|
|
71
71
|
def initialize(attributes = {})
|
|
72
72
|
if (!attributes.is_a?(Hash))
|
|
73
|
-
fail ArgumentError, "The input argument (attributes) must be a hash in `Tremendous::
|
|
73
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Tremendous::SingleRewardOrder1RewardDelivery` initialize method"
|
|
74
74
|
end
|
|
75
75
|
|
|
76
76
|
# check to see if the attribute exists and convert string to symbol for hash key
|
|
77
77
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
78
78
|
if (!self.class.attribute_map.key?(k.to_sym))
|
|
79
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `Tremendous::
|
|
79
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Tremendous::SingleRewardOrder1RewardDelivery`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
|
80
80
|
end
|
|
81
81
|
h[k.to_sym] = v
|
|
82
82
|
}
|
|
@@ -15,7 +15,7 @@ require 'time'
|
|
|
15
15
|
|
|
16
16
|
module Tremendous
|
|
17
17
|
# A single reward, sent to a recipient. A reward is always part of an order. Either `products` or `campaign_id` must be specified.
|
|
18
|
-
class
|
|
18
|
+
class SingleRewardOrderReward
|
|
19
19
|
# Tremendous ID of the reward
|
|
20
20
|
attr_accessor :id
|
|
21
21
|
|
|
@@ -80,7 +80,7 @@ module Tremendous
|
|
|
80
80
|
:'deliver_at' => :'Date',
|
|
81
81
|
:'custom_fields' => :'Array<RewardBaseCustomFieldsInner>',
|
|
82
82
|
:'language' => :'String',
|
|
83
|
-
:'delivery' => :'
|
|
83
|
+
:'delivery' => :'SingleRewardOrder1RewardDelivery'
|
|
84
84
|
}
|
|
85
85
|
end
|
|
86
86
|
|
|
@@ -95,13 +95,13 @@ module Tremendous
|
|
|
95
95
|
# @param [Hash] attributes Model attributes in the form of hash
|
|
96
96
|
def initialize(attributes = {})
|
|
97
97
|
if (!attributes.is_a?(Hash))
|
|
98
|
-
fail ArgumentError, "The input argument (attributes) must be a hash in `Tremendous::
|
|
98
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Tremendous::SingleRewardOrderReward` initialize method"
|
|
99
99
|
end
|
|
100
100
|
|
|
101
101
|
# check to see if the attribute exists and convert string to symbol for hash key
|
|
102
102
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
103
103
|
if (!self.class.attribute_map.key?(k.to_sym))
|
|
104
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `Tremendous::
|
|
104
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Tremendous::SingleRewardOrderReward`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
|
105
105
|
end
|
|
106
106
|
h[k.to_sym] = v
|
|
107
107
|
}
|
|
@@ -179,11 +179,6 @@ module Tremendous
|
|
|
179
179
|
invalid_properties.push('invalid value for "products", number of items must be greater than or equal to 1.')
|
|
180
180
|
end
|
|
181
181
|
|
|
182
|
-
pattern = Regexp.new(/YYYY-MM-DD/)
|
|
183
|
-
if !@deliver_at.nil? && @deliver_at !~ pattern
|
|
184
|
-
invalid_properties.push("invalid value for \"deliver_at\", must conform to the pattern #{pattern}.")
|
|
185
|
-
end
|
|
186
|
-
|
|
187
182
|
invalid_properties
|
|
188
183
|
end
|
|
189
184
|
|
|
@@ -195,7 +190,6 @@ module Tremendous
|
|
|
195
190
|
return false if !@order_id.nil? && @order_id !~ Regexp.new(/[A-Z0-9]{4,20}/)
|
|
196
191
|
return false if !@campaign_id.nil? && @campaign_id !~ Regexp.new(/[A-Z0-9]{4,20}/)
|
|
197
192
|
return false if !@products.nil? && @products.length < 1
|
|
198
|
-
return false if !@deliver_at.nil? && @deliver_at !~ Regexp.new(/YYYY-MM-DD/)
|
|
199
193
|
true
|
|
200
194
|
end
|
|
201
195
|
|
|
@@ -254,21 +248,6 @@ module Tremendous
|
|
|
254
248
|
@products = products
|
|
255
249
|
end
|
|
256
250
|
|
|
257
|
-
# Custom attribute writer method with validation
|
|
258
|
-
# @param [Object] deliver_at Value to be assigned
|
|
259
|
-
def deliver_at=(deliver_at)
|
|
260
|
-
if deliver_at.nil?
|
|
261
|
-
fail ArgumentError, 'deliver_at cannot be nil'
|
|
262
|
-
end
|
|
263
|
-
|
|
264
|
-
pattern = Regexp.new(/YYYY-MM-DD/)
|
|
265
|
-
if deliver_at !~ pattern
|
|
266
|
-
fail ArgumentError, "invalid value for \"deliver_at\", must conform to the pattern #{pattern}."
|
|
267
|
-
end
|
|
268
|
-
|
|
269
|
-
@deliver_at = deliver_at
|
|
270
|
-
end
|
|
271
|
-
|
|
272
251
|
# Checks equality by comparing each attribute.
|
|
273
252
|
# @param [Object] Object to be compared
|
|
274
253
|
def ==(o)
|
data/lib/tremendous/models/{create_order201_response.rb → single_reward_order_without_link.rb}
RENAMED
|
@@ -14,7 +14,7 @@ require 'date'
|
|
|
14
14
|
require 'time'
|
|
15
15
|
|
|
16
16
|
module Tremendous
|
|
17
|
-
class
|
|
17
|
+
class SingleRewardOrderWithoutLink
|
|
18
18
|
attr_accessor :order
|
|
19
19
|
|
|
20
20
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
@@ -32,7 +32,7 @@ module Tremendous
|
|
|
32
32
|
# Attribute type mapping.
|
|
33
33
|
def self.openapi_types
|
|
34
34
|
{
|
|
35
|
-
:'order' => :'
|
|
35
|
+
:'order' => :'SingleRewardOrderWithoutLinkOrder'
|
|
36
36
|
}
|
|
37
37
|
end
|
|
38
38
|
|
|
@@ -46,13 +46,13 @@ module Tremendous
|
|
|
46
46
|
# @param [Hash] attributes Model attributes in the form of hash
|
|
47
47
|
def initialize(attributes = {})
|
|
48
48
|
if (!attributes.is_a?(Hash))
|
|
49
|
-
fail ArgumentError, "The input argument (attributes) must be a hash in `Tremendous::
|
|
49
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Tremendous::SingleRewardOrderWithoutLink` initialize method"
|
|
50
50
|
end
|
|
51
51
|
|
|
52
52
|
# check to see if the attribute exists and convert string to symbol for hash key
|
|
53
53
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
54
54
|
if (!self.class.attribute_map.key?(k.to_sym))
|
|
55
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `Tremendous::
|
|
55
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Tremendous::SingleRewardOrderWithoutLink`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
|
56
56
|
end
|
|
57
57
|
h[k.to_sym] = v
|
|
58
58
|
}
|
|
@@ -15,7 +15,7 @@ require 'time'
|
|
|
15
15
|
|
|
16
16
|
module Tremendous
|
|
17
17
|
# An order wraps around the fulfilment of one or more rewards.
|
|
18
|
-
class
|
|
18
|
+
class SingleRewardOrderWithoutLinkOrder
|
|
19
19
|
# Tremendous ID of the order
|
|
20
20
|
attr_accessor :id
|
|
21
21
|
|
|
@@ -36,7 +36,7 @@ module Tremendous
|
|
|
36
36
|
# The ID for the invoice associated with this order
|
|
37
37
|
attr_accessor :invoice_id
|
|
38
38
|
|
|
39
|
-
attr_accessor :
|
|
39
|
+
attr_accessor :reward
|
|
40
40
|
|
|
41
41
|
class EnumAttributeValidator
|
|
42
42
|
attr_reader :datatype
|
|
@@ -70,7 +70,7 @@ module Tremendous
|
|
|
70
70
|
:'status' => :'status',
|
|
71
71
|
:'payment' => :'payment',
|
|
72
72
|
:'invoice_id' => :'invoice_id',
|
|
73
|
-
:'
|
|
73
|
+
:'reward' => :'reward'
|
|
74
74
|
}
|
|
75
75
|
end
|
|
76
76
|
|
|
@@ -89,7 +89,7 @@ module Tremendous
|
|
|
89
89
|
:'status' => :'String',
|
|
90
90
|
:'payment' => :'OrderBasePayment',
|
|
91
91
|
:'invoice_id' => :'String',
|
|
92
|
-
:'
|
|
92
|
+
:'reward' => :'OrderWithoutLinkReward'
|
|
93
93
|
}
|
|
94
94
|
end
|
|
95
95
|
|
|
@@ -105,13 +105,13 @@ module Tremendous
|
|
|
105
105
|
# @param [Hash] attributes Model attributes in the form of hash
|
|
106
106
|
def initialize(attributes = {})
|
|
107
107
|
if (!attributes.is_a?(Hash))
|
|
108
|
-
fail ArgumentError, "The input argument (attributes) must be a hash in `Tremendous::
|
|
108
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Tremendous::SingleRewardOrderWithoutLinkOrder` initialize method"
|
|
109
109
|
end
|
|
110
110
|
|
|
111
111
|
# check to see if the attribute exists and convert string to symbol for hash key
|
|
112
112
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
113
113
|
if (!self.class.attribute_map.key?(k.to_sym))
|
|
114
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `Tremendous::
|
|
114
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Tremendous::SingleRewardOrderWithoutLinkOrder`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
|
115
115
|
end
|
|
116
116
|
h[k.to_sym] = v
|
|
117
117
|
}
|
|
@@ -150,10 +150,8 @@ module Tremendous
|
|
|
150
150
|
self.invoice_id = attributes[:'invoice_id']
|
|
151
151
|
end
|
|
152
152
|
|
|
153
|
-
if attributes.key?(:'
|
|
154
|
-
|
|
155
|
-
self.rewards = value
|
|
156
|
-
end
|
|
153
|
+
if attributes.key?(:'reward')
|
|
154
|
+
self.reward = attributes[:'reward']
|
|
157
155
|
end
|
|
158
156
|
end
|
|
159
157
|
|
|
@@ -184,10 +182,6 @@ module Tremendous
|
|
|
184
182
|
invalid_properties.push('invalid value for "status", status cannot be nil.')
|
|
185
183
|
end
|
|
186
184
|
|
|
187
|
-
if !@rewards.nil? && @rewards.length < 1
|
|
188
|
-
invalid_properties.push('invalid value for "rewards", number of items must be greater than or equal to 1.')
|
|
189
|
-
end
|
|
190
|
-
|
|
191
185
|
invalid_properties
|
|
192
186
|
end
|
|
193
187
|
|
|
@@ -202,7 +196,6 @@ module Tremendous
|
|
|
202
196
|
return false if @status.nil?
|
|
203
197
|
status_validator = EnumAttributeValidator.new('String', ["CANCELED", "CART", "EXECUTED", "FAILED", "PENDING APPROVAL", "PENDING INTERNAL PAYMENT APPROVAL"])
|
|
204
198
|
return false unless status_validator.valid?(@status)
|
|
205
|
-
return false if !@rewards.nil? && @rewards.length < 1
|
|
206
199
|
true
|
|
207
200
|
end
|
|
208
201
|
|
|
@@ -242,20 +235,6 @@ module Tremendous
|
|
|
242
235
|
@status = status
|
|
243
236
|
end
|
|
244
237
|
|
|
245
|
-
# Custom attribute writer method with validation
|
|
246
|
-
# @param [Object] rewards Value to be assigned
|
|
247
|
-
def rewards=(rewards)
|
|
248
|
-
if rewards.nil?
|
|
249
|
-
fail ArgumentError, 'rewards cannot be nil'
|
|
250
|
-
end
|
|
251
|
-
|
|
252
|
-
if rewards.length < 1
|
|
253
|
-
fail ArgumentError, 'invalid value for "rewards", number of items must be greater than or equal to 1.'
|
|
254
|
-
end
|
|
255
|
-
|
|
256
|
-
@rewards = rewards
|
|
257
|
-
end
|
|
258
|
-
|
|
259
238
|
# Checks equality by comparing each attribute.
|
|
260
239
|
# @param [Object] Object to be compared
|
|
261
240
|
def ==(o)
|
|
@@ -268,7 +247,7 @@ module Tremendous
|
|
|
268
247
|
status == o.status &&
|
|
269
248
|
payment == o.payment &&
|
|
270
249
|
invoice_id == o.invoice_id &&
|
|
271
|
-
|
|
250
|
+
reward == o.reward
|
|
272
251
|
end
|
|
273
252
|
|
|
274
253
|
# @see the `==` method
|
|
@@ -280,7 +259,7 @@ module Tremendous
|
|
|
280
259
|
# Calculates hash code according to all attributes.
|
|
281
260
|
# @return [Integer] Hash code
|
|
282
261
|
def hash
|
|
283
|
-
[id, external_id, campaign_id, created_at, status, payment, invoice_id,
|
|
262
|
+
[id, external_id, campaign_id, created_at, status, payment, invoice_id, reward].hash
|
|
284
263
|
end
|
|
285
264
|
|
|
286
265
|
# Builds the object from hash
|
|
@@ -0,0 +1,222 @@
|
|
|
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 TestPublicKey
|
|
18
|
+
# A JWT token encoded with RS256, signed using the RSA private key corresponding to your public key.
|
|
19
|
+
attr_accessor :jwt
|
|
20
|
+
|
|
21
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
22
|
+
def self.attribute_map
|
|
23
|
+
{
|
|
24
|
+
:'jwt' => :'jwt'
|
|
25
|
+
}
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
# Returns all the JSON keys this model knows about
|
|
29
|
+
def self.acceptable_attributes
|
|
30
|
+
attribute_map.values
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
# Attribute type mapping.
|
|
34
|
+
def self.openapi_types
|
|
35
|
+
{
|
|
36
|
+
:'jwt' => :'String'
|
|
37
|
+
}
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
# List of attributes with nullable: true
|
|
41
|
+
def self.openapi_nullable
|
|
42
|
+
Set.new([
|
|
43
|
+
])
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
# Initializes the object
|
|
47
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
48
|
+
def initialize(attributes = {})
|
|
49
|
+
if (!attributes.is_a?(Hash))
|
|
50
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Tremendous::TestPublicKey` initialize method"
|
|
51
|
+
end
|
|
52
|
+
|
|
53
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
54
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
55
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
|
56
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Tremendous::TestPublicKey`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
|
57
|
+
end
|
|
58
|
+
h[k.to_sym] = v
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
if attributes.key?(:'jwt')
|
|
62
|
+
self.jwt = attributes[:'jwt']
|
|
63
|
+
else
|
|
64
|
+
self.jwt = nil
|
|
65
|
+
end
|
|
66
|
+
end
|
|
67
|
+
|
|
68
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
69
|
+
# @return Array for valid properties with the reasons
|
|
70
|
+
def list_invalid_properties
|
|
71
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
72
|
+
invalid_properties = Array.new
|
|
73
|
+
if @jwt.nil?
|
|
74
|
+
invalid_properties.push('invalid value for "jwt", jwt cannot be nil.')
|
|
75
|
+
end
|
|
76
|
+
|
|
77
|
+
invalid_properties
|
|
78
|
+
end
|
|
79
|
+
|
|
80
|
+
# Check to see if the all the properties in the model are valid
|
|
81
|
+
# @return true if the model is valid
|
|
82
|
+
def valid?
|
|
83
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
84
|
+
return false if @jwt.nil?
|
|
85
|
+
true
|
|
86
|
+
end
|
|
87
|
+
|
|
88
|
+
# Checks equality by comparing each attribute.
|
|
89
|
+
# @param [Object] Object to be compared
|
|
90
|
+
def ==(o)
|
|
91
|
+
return true if self.equal?(o)
|
|
92
|
+
self.class == o.class &&
|
|
93
|
+
jwt == o.jwt
|
|
94
|
+
end
|
|
95
|
+
|
|
96
|
+
# @see the `==` method
|
|
97
|
+
# @param [Object] Object to be compared
|
|
98
|
+
def eql?(o)
|
|
99
|
+
self == o
|
|
100
|
+
end
|
|
101
|
+
|
|
102
|
+
# Calculates hash code according to all attributes.
|
|
103
|
+
# @return [Integer] Hash code
|
|
104
|
+
def hash
|
|
105
|
+
[jwt].hash
|
|
106
|
+
end
|
|
107
|
+
|
|
108
|
+
# Builds the object from hash
|
|
109
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
110
|
+
# @return [Object] Returns the model itself
|
|
111
|
+
def self.build_from_hash(attributes)
|
|
112
|
+
return nil unless attributes.is_a?(Hash)
|
|
113
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
114
|
+
transformed_hash = {}
|
|
115
|
+
openapi_types.each_pair do |key, type|
|
|
116
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
117
|
+
transformed_hash["#{key}"] = nil
|
|
118
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
119
|
+
# check to ensure the input is an array given that the attribute
|
|
120
|
+
# is documented as an array but the input is not
|
|
121
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
122
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
123
|
+
end
|
|
124
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
125
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
126
|
+
end
|
|
127
|
+
end
|
|
128
|
+
new(transformed_hash)
|
|
129
|
+
end
|
|
130
|
+
|
|
131
|
+
# Deserializes the data based on type
|
|
132
|
+
# @param string type Data type
|
|
133
|
+
# @param string value Value to be deserialized
|
|
134
|
+
# @return [Object] Deserialized data
|
|
135
|
+
def self._deserialize(type, value)
|
|
136
|
+
case type.to_sym
|
|
137
|
+
when :Time
|
|
138
|
+
Time.parse(value)
|
|
139
|
+
when :Date
|
|
140
|
+
Date.parse(value)
|
|
141
|
+
when :String
|
|
142
|
+
value.to_s
|
|
143
|
+
when :Integer
|
|
144
|
+
value.to_i
|
|
145
|
+
when :Float
|
|
146
|
+
value.to_f
|
|
147
|
+
when :Boolean
|
|
148
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
149
|
+
true
|
|
150
|
+
else
|
|
151
|
+
false
|
|
152
|
+
end
|
|
153
|
+
when :Object
|
|
154
|
+
# generic object (usually a Hash), return directly
|
|
155
|
+
value
|
|
156
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
|
157
|
+
inner_type = Regexp.last_match[:inner_type]
|
|
158
|
+
value.map { |v| _deserialize(inner_type, v) }
|
|
159
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
160
|
+
k_type = Regexp.last_match[:k_type]
|
|
161
|
+
v_type = Regexp.last_match[:v_type]
|
|
162
|
+
{}.tap do |hash|
|
|
163
|
+
value.each do |k, v|
|
|
164
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
165
|
+
end
|
|
166
|
+
end
|
|
167
|
+
else # model
|
|
168
|
+
# models (e.g. Pet) or oneOf
|
|
169
|
+
klass = Tremendous.const_get(type)
|
|
170
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
171
|
+
end
|
|
172
|
+
end
|
|
173
|
+
|
|
174
|
+
# Returns the string representation of the object
|
|
175
|
+
# @return [String] String presentation of the object
|
|
176
|
+
def to_s
|
|
177
|
+
to_hash.to_s
|
|
178
|
+
end
|
|
179
|
+
|
|
180
|
+
# to_body is an alias to to_hash (backward compatibility)
|
|
181
|
+
# @return [Hash] Returns the object in the form of hash
|
|
182
|
+
def to_body
|
|
183
|
+
to_hash
|
|
184
|
+
end
|
|
185
|
+
|
|
186
|
+
# Returns the object in the form of hash
|
|
187
|
+
# @return [Hash] Returns the object in the form of hash
|
|
188
|
+
def to_hash
|
|
189
|
+
hash = {}
|
|
190
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
191
|
+
value = self.send(attr)
|
|
192
|
+
if value.nil?
|
|
193
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
194
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
195
|
+
end
|
|
196
|
+
|
|
197
|
+
hash[param] = _to_hash(value)
|
|
198
|
+
end
|
|
199
|
+
hash
|
|
200
|
+
end
|
|
201
|
+
|
|
202
|
+
# Outputs non-array value in the form of hash
|
|
203
|
+
# For object, use to_hash. Otherwise, just return the value
|
|
204
|
+
# @param [Object] value Any valid value
|
|
205
|
+
# @return [Hash] Returns the value in the form of hash
|
|
206
|
+
def _to_hash(value)
|
|
207
|
+
if value.is_a?(Array)
|
|
208
|
+
value.compact.map { |v| _to_hash(v) }
|
|
209
|
+
elsif value.is_a?(Hash)
|
|
210
|
+
{}.tap do |hash|
|
|
211
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
212
|
+
end
|
|
213
|
+
elsif value.respond_to? :to_hash
|
|
214
|
+
value.to_hash
|
|
215
|
+
else
|
|
216
|
+
value
|
|
217
|
+
end
|
|
218
|
+
end
|
|
219
|
+
|
|
220
|
+
end
|
|
221
|
+
|
|
222
|
+
end
|