tremendous_ruby 5.24.0 → 5.28.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 +163 -9
- data/lib/tremendous/api_client.rb +3 -2
- data/lib/tremendous/configuration.rb +10 -0
- data/lib/tremendous/models/campaign.rb +14 -6
- data/lib/tremendous/models/campaign_base.rb +14 -6
- data/lib/tremendous/models/connected_organization_member_member.rb +6 -4
- data/lib/tremendous/models/connected_organization_member_session.rb +27 -1
- data/lib/tremendous/models/connected_organization_organization.rb +3 -5
- data/lib/tremendous/models/{generate_reward_token200_response_reward.rb → create_api_key_request.rb} +51 -53
- data/lib/tremendous/models/create_campaign_request.rb +14 -6
- data/lib/tremendous/models/create_connected_organization_member_session200_response_connected_organization_member_session.rb +27 -1
- data/lib/tremendous/models/create_connected_organization_member_session_request.rb +33 -4
- data/lib/tremendous/models/create_connected_organization_request.rb +13 -4
- data/lib/tremendous/models/{create_report201_response_report.rb → create_connected_organization_request_kyb_prefill.rb} +102 -81
- data/lib/tremendous/models/create_field.rb +6 -4
- data/lib/tremendous/models/create_field_request.rb +6 -4
- data/lib/tremendous/models/create_invoice_request.rb +6 -10
- data/lib/tremendous/models/create_order200_response_order.rb +9 -9
- data/lib/tremendous/models/create_order200_response_order_rewards_inner_delivery.rb +13 -9
- data/lib/tremendous/models/create_report200_response_report.rb +3 -5
- data/lib/tremendous/models/create_report_request.rb +12 -8
- data/lib/tremendous/models/create_report_request_filters_digital_rewards.rb +6 -10
- data/lib/tremendous/models/delivery_details.rb +7 -11
- data/lib/tremendous/models/delivery_details_with_link.rb +13 -9
- data/lib/tremendous/models/field.rb +3 -5
- data/lib/tremendous/models/fraud_config_country.rb +6 -4
- data/lib/tremendous/models/fraud_config_redeemed_rewards_amount.rb +6 -4
- data/lib/tremendous/models/fraud_config_redeemed_rewards_count.rb +6 -4
- data/lib/tremendous/models/{create_campaign201_response.rb → fraud_config_review_vpn.rb} +21 -19
- data/lib/tremendous/models/fraud_review.rb +10 -16
- data/lib/tremendous/models/fraud_review_base.rb +7 -11
- data/lib/tremendous/models/fraud_review_list_item.rb +7 -11
- data/lib/tremendous/models/fraud_review_reason.rb +2 -1
- data/lib/tremendous/models/fraud_rule_request_config.rb +2 -1
- data/lib/tremendous/models/fraud_rules_list_item.rb +4 -6
- data/lib/tremendous/models/funding_source.rb +12 -14
- data/lib/tremendous/models/get_fraud_review200_response_fraud_review.rb +10 -16
- data/lib/tremendous/models/get_member200_response_member.rb +6 -4
- data/lib/tremendous/models/get_member200_response_member_events_inner.rb +3 -5
- data/lib/tremendous/models/invoice.rb +12 -14
- data/lib/tremendous/models/list_campaigns200_response_campaigns_inner.rb +14 -6
- data/lib/tremendous/models/list_campaigns200_response_campaigns_inner_auto_add_product_rule.rb +301 -0
- data/lib/tremendous/models/list_connected_organization_members200_response_connected_organization_members_inner_member.rb +6 -4
- data/lib/tremendous/models/list_connected_organizations200_response_connected_organizations_inner_organization.rb +3 -5
- data/lib/tremendous/models/list_fields200_response_fields_inner.rb +3 -5
- data/lib/tremendous/models/list_fraud_reviews200_response_fraud_reviews_inner.rb +7 -11
- data/lib/tremendous/models/list_fraud_rules200_response_fraud_rules_inner.rb +4 -6
- data/lib/tremendous/models/list_funding_sources200_response_funding_sources_inner.rb +12 -14
- data/lib/tremendous/models/list_funding_sources200_response_funding_sources_inner_meta.rb +6 -10
- data/lib/tremendous/models/list_invoices200_response_invoices_inner.rb +12 -14
- data/lib/tremendous/models/list_members200_response_members_inner.rb +6 -4
- data/lib/tremendous/models/list_orders200_response_orders_inner.rb +9 -9
- data/lib/tremendous/models/list_organizations200_response_organizations_inner.rb +3 -5
- data/lib/tremendous/models/list_products_response_products_inner.rb +11 -11
- data/lib/tremendous/models/list_products_response_products_inner_images_inner.rb +6 -4
- data/lib/tremendous/models/list_rewards200_response_rewards_inner_delivery.rb +7 -11
- data/lib/tremendous/models/list_rewards200_response_rewards_inner_value.rb +3 -5
- data/lib/tremendous/models/member.rb +6 -4
- data/lib/tremendous/models/member_base.rb +6 -4
- data/lib/tremendous/models/member_with_events.rb +6 -4
- data/lib/tremendous/models/member_without_events.rb +6 -4
- data/lib/tremendous/models/order.rb +9 -9
- data/lib/tremendous/models/order_base.rb +9 -9
- data/lib/tremendous/models/order_with_link.rb +9 -9
- data/lib/tremendous/models/order_without_link.rb +9 -9
- data/lib/tremendous/models/organization.rb +3 -5
- data/lib/tremendous/models/payout.rb +3 -5
- data/lib/tremendous/models/product.rb +11 -11
- data/lib/tremendous/models/report.rb +3 -5
- data/lib/tremendous/models/review_country.rb +6 -4
- data/lib/tremendous/models/review_redeemed_rewards_amount.rb +6 -4
- data/lib/tremendous/models/review_redeemed_rewards_count.rb +6 -4
- data/lib/tremendous/models/{generate_reward_token200_response.rb → review_vpn.rb} +22 -19
- data/lib/tremendous/models/reward_value.rb +3 -5
- data/lib/tremendous/models/reward_with_link_delivery.rb +13 -9
- data/lib/tremendous/models/reward_without_link_delivery.rb +7 -11
- data/lib/tremendous/models/single_reward_order_reward_delivery.rb +4 -6
- data/lib/tremendous/models/single_reward_order_with_link_order.rb +9 -9
- data/lib/tremendous/models/single_reward_order_without_link_order.rb +9 -9
- data/lib/tremendous/models/update_campaign.rb +14 -6
- data/lib/tremendous/models/update_campaign_request.rb +14 -6
- data/lib/tremendous/models/update_fraud_rule_list_request.rb +6 -4
- data/lib/tremendous/models/{get_fraud_review200_response_fraud_review_geo.rb → update_member.rb} +28 -32
- data/lib/tremendous/models/{create_report201_response.rb → update_member_request.rb} +34 -27
- data/lib/tremendous/version.rb +1 -1
- data/lib/tremendous.rb +7 -0
- metadata +22 -8
- data/lib/tremendous/models/create_order201_response.rb +0 -221
|
@@ -30,6 +30,8 @@ module Tremendous
|
|
|
30
30
|
# Determines whether fees for premium products are added to the order total (`SENDER`) or deducted from the recipient's reward amount (`RECIPIENT`). Campaigns with `RECIPIENT` must include at least one fee-free product.
|
|
31
31
|
attr_accessor :fee_charged_to
|
|
32
32
|
|
|
33
|
+
attr_accessor :auto_add_product_rule
|
|
34
|
+
|
|
33
35
|
attr_accessor :webpage_style
|
|
34
36
|
|
|
35
37
|
attr_accessor :email_style
|
|
@@ -64,6 +66,7 @@ module Tremendous
|
|
|
64
66
|
:'description' => :'description',
|
|
65
67
|
:'products' => :'products',
|
|
66
68
|
:'fee_charged_to' => :'fee_charged_to',
|
|
69
|
+
:'auto_add_product_rule' => :'auto_add_product_rule',
|
|
67
70
|
:'webpage_style' => :'webpage_style',
|
|
68
71
|
:'email_style' => :'email_style'
|
|
69
72
|
}
|
|
@@ -87,6 +90,7 @@ module Tremendous
|
|
|
87
90
|
:'description' => :'String',
|
|
88
91
|
:'products' => :'Array<String>',
|
|
89
92
|
:'fee_charged_to' => :'String',
|
|
93
|
+
:'auto_add_product_rule' => :'ListCampaigns200ResponseCampaignsInnerAutoAddProductRule',
|
|
90
94
|
:'webpage_style' => :'ListCampaigns200ResponseCampaignsInnerWebpageStyle',
|
|
91
95
|
:'email_style' => :'ListCampaigns200ResponseCampaignsInnerEmailStyle'
|
|
92
96
|
}
|
|
@@ -97,6 +101,7 @@ module Tremendous
|
|
|
97
101
|
Set.new([
|
|
98
102
|
:'description',
|
|
99
103
|
:'fee_charged_to',
|
|
104
|
+
:'auto_add_product_rule',
|
|
100
105
|
])
|
|
101
106
|
end
|
|
102
107
|
|
|
@@ -144,6 +149,10 @@ module Tremendous
|
|
|
144
149
|
self.fee_charged_to = attributes[:'fee_charged_to']
|
|
145
150
|
end
|
|
146
151
|
|
|
152
|
+
if attributes.key?(:'auto_add_product_rule')
|
|
153
|
+
self.auto_add_product_rule = attributes[:'auto_add_product_rule']
|
|
154
|
+
end
|
|
155
|
+
|
|
147
156
|
if attributes.key?(:'webpage_style')
|
|
148
157
|
self.webpage_style = attributes[:'webpage_style']
|
|
149
158
|
end
|
|
@@ -221,13 +230,11 @@ module Tremendous
|
|
|
221
230
|
@products = products
|
|
222
231
|
end
|
|
223
232
|
|
|
224
|
-
# Custom attribute writer method
|
|
233
|
+
# Custom attribute writer method for enum attributes. Any value is accepted
|
|
234
|
+
# so that enum values added to the API don't break deserialization on
|
|
235
|
+
# older versions of this gem.
|
|
225
236
|
# @param [Object] fee_charged_to Object to be assigned
|
|
226
237
|
def fee_charged_to=(fee_charged_to)
|
|
227
|
-
validator = EnumAttributeValidator.new('String', ["SENDER", "RECIPIENT"])
|
|
228
|
-
unless validator.valid?(fee_charged_to)
|
|
229
|
-
fail ArgumentError, "invalid value for \"fee_charged_to\", must be one of #{validator.allowable_values}."
|
|
230
|
-
end
|
|
231
238
|
@fee_charged_to = fee_charged_to
|
|
232
239
|
end
|
|
233
240
|
|
|
@@ -241,6 +248,7 @@ module Tremendous
|
|
|
241
248
|
description == o.description &&
|
|
242
249
|
products == o.products &&
|
|
243
250
|
fee_charged_to == o.fee_charged_to &&
|
|
251
|
+
auto_add_product_rule == o.auto_add_product_rule &&
|
|
244
252
|
webpage_style == o.webpage_style &&
|
|
245
253
|
email_style == o.email_style
|
|
246
254
|
end
|
|
@@ -254,7 +262,7 @@ module Tremendous
|
|
|
254
262
|
# Calculates hash code according to all attributes.
|
|
255
263
|
# @return [Integer] Hash code
|
|
256
264
|
def hash
|
|
257
|
-
[id, name, description, products, fee_charged_to, webpage_style, email_style].hash
|
|
265
|
+
[id, name, description, products, fee_charged_to, auto_add_product_rule, webpage_style, email_style].hash
|
|
258
266
|
end
|
|
259
267
|
|
|
260
268
|
# Builds the object from hash
|
|
@@ -30,6 +30,8 @@ module Tremendous
|
|
|
30
30
|
# Determines whether fees for premium products are added to the order total (`SENDER`) or deducted from the recipient's reward amount (`RECIPIENT`). Campaigns with `RECIPIENT` must include at least one fee-free product.
|
|
31
31
|
attr_accessor :fee_charged_to
|
|
32
32
|
|
|
33
|
+
attr_accessor :auto_add_product_rule
|
|
34
|
+
|
|
33
35
|
attr_accessor :webpage_style
|
|
34
36
|
|
|
35
37
|
attr_accessor :email_style
|
|
@@ -64,6 +66,7 @@ module Tremendous
|
|
|
64
66
|
:'description' => :'description',
|
|
65
67
|
:'products' => :'products',
|
|
66
68
|
:'fee_charged_to' => :'fee_charged_to',
|
|
69
|
+
:'auto_add_product_rule' => :'auto_add_product_rule',
|
|
67
70
|
:'webpage_style' => :'webpage_style',
|
|
68
71
|
:'email_style' => :'email_style'
|
|
69
72
|
}
|
|
@@ -87,6 +90,7 @@ module Tremendous
|
|
|
87
90
|
:'description' => :'String',
|
|
88
91
|
:'products' => :'Array<String>',
|
|
89
92
|
:'fee_charged_to' => :'String',
|
|
93
|
+
:'auto_add_product_rule' => :'ListCampaigns200ResponseCampaignsInnerAutoAddProductRule',
|
|
90
94
|
:'webpage_style' => :'ListCampaigns200ResponseCampaignsInnerWebpageStyle',
|
|
91
95
|
:'email_style' => :'ListCampaigns200ResponseCampaignsInnerEmailStyle'
|
|
92
96
|
}
|
|
@@ -97,6 +101,7 @@ module Tremendous
|
|
|
97
101
|
Set.new([
|
|
98
102
|
:'description',
|
|
99
103
|
:'fee_charged_to',
|
|
104
|
+
:'auto_add_product_rule',
|
|
100
105
|
])
|
|
101
106
|
end
|
|
102
107
|
|
|
@@ -138,6 +143,10 @@ module Tremendous
|
|
|
138
143
|
self.fee_charged_to = attributes[:'fee_charged_to']
|
|
139
144
|
end
|
|
140
145
|
|
|
146
|
+
if attributes.key?(:'auto_add_product_rule')
|
|
147
|
+
self.auto_add_product_rule = attributes[:'auto_add_product_rule']
|
|
148
|
+
end
|
|
149
|
+
|
|
141
150
|
if attributes.key?(:'webpage_style')
|
|
142
151
|
self.webpage_style = attributes[:'webpage_style']
|
|
143
152
|
end
|
|
@@ -185,13 +194,11 @@ module Tremendous
|
|
|
185
194
|
@id = id
|
|
186
195
|
end
|
|
187
196
|
|
|
188
|
-
# Custom attribute writer method
|
|
197
|
+
# Custom attribute writer method for enum attributes. Any value is accepted
|
|
198
|
+
# so that enum values added to the API don't break deserialization on
|
|
199
|
+
# older versions of this gem.
|
|
189
200
|
# @param [Object] fee_charged_to Object to be assigned
|
|
190
201
|
def fee_charged_to=(fee_charged_to)
|
|
191
|
-
validator = EnumAttributeValidator.new('String', ["SENDER", "RECIPIENT"])
|
|
192
|
-
unless validator.valid?(fee_charged_to)
|
|
193
|
-
fail ArgumentError, "invalid value for \"fee_charged_to\", must be one of #{validator.allowable_values}."
|
|
194
|
-
end
|
|
195
202
|
@fee_charged_to = fee_charged_to
|
|
196
203
|
end
|
|
197
204
|
|
|
@@ -205,6 +212,7 @@ module Tremendous
|
|
|
205
212
|
description == o.description &&
|
|
206
213
|
products == o.products &&
|
|
207
214
|
fee_charged_to == o.fee_charged_to &&
|
|
215
|
+
auto_add_product_rule == o.auto_add_product_rule &&
|
|
208
216
|
webpage_style == o.webpage_style &&
|
|
209
217
|
email_style == o.email_style
|
|
210
218
|
end
|
|
@@ -218,7 +226,7 @@ module Tremendous
|
|
|
218
226
|
# Calculates hash code according to all attributes.
|
|
219
227
|
# @return [Integer] Hash code
|
|
220
228
|
def hash
|
|
221
|
-
[id, name, description, products, fee_charged_to, webpage_style, email_style].hash
|
|
229
|
+
[id, name, description, products, fee_charged_to, auto_add_product_rule, webpage_style, email_style].hash
|
|
222
230
|
end
|
|
223
231
|
|
|
224
232
|
# Builds the object from hash
|
|
@@ -228,13 +228,15 @@ module Tremendous
|
|
|
228
228
|
@email = email
|
|
229
229
|
end
|
|
230
230
|
|
|
231
|
-
# Custom attribute writer method
|
|
231
|
+
# Custom attribute writer method for enum attributes. Any value is accepted
|
|
232
|
+
# so that enum values added to the API don't break deserialization on
|
|
233
|
+
# older versions of this gem.
|
|
232
234
|
# @param [Object] status Object to be assigned
|
|
233
235
|
def status=(status)
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
fail ArgumentError, "invalid value for \"status\", must be one of #{validator.allowable_values}."
|
|
236
|
+
if status.nil?
|
|
237
|
+
fail ArgumentError, 'status cannot be nil'
|
|
237
238
|
end
|
|
239
|
+
|
|
238
240
|
@status = status
|
|
239
241
|
end
|
|
240
242
|
|
|
@@ -24,6 +24,9 @@ module Tremendous
|
|
|
24
24
|
# The URL used for links that redirect the user back to your site when they've completed their actions on Tremendous.
|
|
25
25
|
attr_accessor :return_url
|
|
26
26
|
|
|
27
|
+
# The opaque `state` value provided when the session was created, forwarded on the initial OAuth grant redirect. `null` when no value was set.
|
|
28
|
+
attr_accessor :state
|
|
29
|
+
|
|
27
30
|
# Timestamp of when the session will expire.
|
|
28
31
|
attr_accessor :expires_at
|
|
29
32
|
|
|
@@ -36,6 +39,7 @@ module Tremendous
|
|
|
36
39
|
:'connected_organization_member_id' => :'connected_organization_member_id',
|
|
37
40
|
:'url' => :'url',
|
|
38
41
|
:'return_url' => :'return_url',
|
|
42
|
+
:'state' => :'state',
|
|
39
43
|
:'expires_at' => :'expires_at',
|
|
40
44
|
:'created_at' => :'created_at'
|
|
41
45
|
}
|
|
@@ -57,6 +61,7 @@ module Tremendous
|
|
|
57
61
|
:'connected_organization_member_id' => :'String',
|
|
58
62
|
:'url' => :'String',
|
|
59
63
|
:'return_url' => :'String',
|
|
64
|
+
:'state' => :'String',
|
|
60
65
|
:'expires_at' => :'Time',
|
|
61
66
|
:'created_at' => :'Time'
|
|
62
67
|
}
|
|
@@ -65,6 +70,7 @@ module Tremendous
|
|
|
65
70
|
# List of attributes with nullable: true
|
|
66
71
|
def self.openapi_nullable
|
|
67
72
|
Set.new([
|
|
73
|
+
:'state',
|
|
68
74
|
])
|
|
69
75
|
end
|
|
70
76
|
|
|
@@ -102,6 +108,10 @@ module Tremendous
|
|
|
102
108
|
self.return_url = nil
|
|
103
109
|
end
|
|
104
110
|
|
|
111
|
+
if attributes.key?(:'state')
|
|
112
|
+
self.state = attributes[:'state']
|
|
113
|
+
end
|
|
114
|
+
|
|
105
115
|
if attributes.key?(:'expires_at')
|
|
106
116
|
self.expires_at = attributes[:'expires_at']
|
|
107
117
|
else
|
|
@@ -137,6 +147,10 @@ module Tremendous
|
|
|
137
147
|
invalid_properties.push('invalid value for "return_url", return_url cannot be nil.')
|
|
138
148
|
end
|
|
139
149
|
|
|
150
|
+
if !@state.nil? && @state.to_s.length > 1024
|
|
151
|
+
invalid_properties.push('invalid value for "state", the character length must be smaller than or equal to 1024.')
|
|
152
|
+
end
|
|
153
|
+
|
|
140
154
|
if @expires_at.nil?
|
|
141
155
|
invalid_properties.push('invalid value for "expires_at", expires_at cannot be nil.')
|
|
142
156
|
end
|
|
@@ -156,6 +170,7 @@ module Tremendous
|
|
|
156
170
|
return false if @connected_organization_member_id !~ Regexp.new(/[A-Z0-9]{4,20}/)
|
|
157
171
|
return false if @url.nil?
|
|
158
172
|
return false if @return_url.nil?
|
|
173
|
+
return false if !@state.nil? && @state.to_s.length > 1024
|
|
159
174
|
return false if @expires_at.nil?
|
|
160
175
|
return false if @created_at.nil?
|
|
161
176
|
true
|
|
@@ -196,6 +211,16 @@ module Tremendous
|
|
|
196
211
|
@return_url = return_url
|
|
197
212
|
end
|
|
198
213
|
|
|
214
|
+
# Custom attribute writer method with validation
|
|
215
|
+
# @param [Object] state Value to be assigned
|
|
216
|
+
def state=(state)
|
|
217
|
+
if !state.nil? && state.to_s.length > 1024
|
|
218
|
+
fail ArgumentError, 'invalid value for "state", the character length must be smaller than or equal to 1024.'
|
|
219
|
+
end
|
|
220
|
+
|
|
221
|
+
@state = state
|
|
222
|
+
end
|
|
223
|
+
|
|
199
224
|
# Custom attribute writer method with validation
|
|
200
225
|
# @param [Object] expires_at Value to be assigned
|
|
201
226
|
def expires_at=(expires_at)
|
|
@@ -224,6 +249,7 @@ module Tremendous
|
|
|
224
249
|
connected_organization_member_id == o.connected_organization_member_id &&
|
|
225
250
|
url == o.url &&
|
|
226
251
|
return_url == o.return_url &&
|
|
252
|
+
state == o.state &&
|
|
227
253
|
expires_at == o.expires_at &&
|
|
228
254
|
created_at == o.created_at
|
|
229
255
|
end
|
|
@@ -237,7 +263,7 @@ module Tremendous
|
|
|
237
263
|
# Calculates hash code according to all attributes.
|
|
238
264
|
# @return [Integer] Hash code
|
|
239
265
|
def hash
|
|
240
|
-
[connected_organization_member_id, url, return_url, expires_at, created_at].hash
|
|
266
|
+
[connected_organization_member_id, url, return_url, state, expires_at, created_at].hash
|
|
241
267
|
end
|
|
242
268
|
|
|
243
269
|
# Builds the object from hash
|
|
@@ -208,13 +208,11 @@ module Tremendous
|
|
|
208
208
|
@website = website
|
|
209
209
|
end
|
|
210
210
|
|
|
211
|
-
# Custom attribute writer method
|
|
211
|
+
# Custom attribute writer method for enum attributes. Any value is accepted
|
|
212
|
+
# so that enum values added to the API don't break deserialization on
|
|
213
|
+
# older versions of this gem.
|
|
212
214
|
# @param [Object] status Object to be assigned
|
|
213
215
|
def status=(status)
|
|
214
|
-
validator = EnumAttributeValidator.new('String', ["PENDING", "APPROVED", "REJECTED"])
|
|
215
|
-
unless validator.valid?(status)
|
|
216
|
-
fail ArgumentError, "invalid value for \"status\", must be one of #{validator.allowable_values}."
|
|
217
|
-
end
|
|
218
216
|
@status = status
|
|
219
217
|
end
|
|
220
218
|
|
data/lib/tremendous/models/{generate_reward_token200_response_reward.rb → create_api_key_request.rb}
RENAMED
|
@@ -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.
|
|
9
|
+
Generator version: 7.12.0
|
|
10
10
|
|
|
11
11
|
=end
|
|
12
12
|
|
|
@@ -14,37 +14,53 @@ require 'date'
|
|
|
14
14
|
require 'time'
|
|
15
15
|
|
|
16
16
|
module Tremendous
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
17
|
+
class CreateApiKeyRequest
|
|
18
|
+
# The key's permission level. `read_write` (the default) can make any request. `read_only` keys can't run data-altering requests: they're limited to GET requests and non-writing POST requests, like `/reports`. Omit for `read_write`.
|
|
19
|
+
attr_accessor :permission
|
|
20
|
+
|
|
21
|
+
class EnumAttributeValidator
|
|
22
|
+
attr_reader :datatype
|
|
23
|
+
attr_reader :allowable_values
|
|
24
|
+
|
|
25
|
+
def initialize(datatype, allowable_values)
|
|
26
|
+
@allowable_values = allowable_values.map do |value|
|
|
27
|
+
case datatype.to_s
|
|
28
|
+
when /Integer/i
|
|
29
|
+
value.to_i
|
|
30
|
+
when /Float/i
|
|
31
|
+
value.to_f
|
|
32
|
+
else
|
|
33
|
+
value
|
|
34
|
+
end
|
|
35
|
+
end
|
|
36
|
+
end
|
|
24
37
|
|
|
25
|
-
|
|
26
|
-
|
|
38
|
+
def valid?(value)
|
|
39
|
+
!value || allowable_values.include?(value)
|
|
40
|
+
end
|
|
41
|
+
end
|
|
27
42
|
|
|
28
43
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
29
44
|
def self.attribute_map
|
|
30
45
|
{
|
|
31
|
-
:'
|
|
32
|
-
:'token' => :'token',
|
|
33
|
-
:'expires_at' => :'expires_at'
|
|
46
|
+
:'permission' => :'permission'
|
|
34
47
|
}
|
|
35
48
|
end
|
|
36
49
|
|
|
50
|
+
# Returns attribute mapping this model knows about
|
|
51
|
+
def self.acceptable_attribute_map
|
|
52
|
+
attribute_map
|
|
53
|
+
end
|
|
54
|
+
|
|
37
55
|
# Returns all the JSON keys this model knows about
|
|
38
56
|
def self.acceptable_attributes
|
|
39
|
-
|
|
57
|
+
acceptable_attribute_map.values
|
|
40
58
|
end
|
|
41
59
|
|
|
42
60
|
# Attribute type mapping.
|
|
43
61
|
def self.openapi_types
|
|
44
62
|
{
|
|
45
|
-
:'
|
|
46
|
-
:'token' => :'String',
|
|
47
|
-
:'expires_at' => :'Time'
|
|
63
|
+
:'permission' => :'String'
|
|
48
64
|
}
|
|
49
65
|
end
|
|
50
66
|
|
|
@@ -58,27 +74,22 @@ module Tremendous
|
|
|
58
74
|
# @param [Hash] attributes Model attributes in the form of hash
|
|
59
75
|
def initialize(attributes = {})
|
|
60
76
|
if (!attributes.is_a?(Hash))
|
|
61
|
-
fail ArgumentError, "The input argument (attributes) must be a hash in `Tremendous::
|
|
77
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Tremendous::CreateApiKeyRequest` initialize method"
|
|
62
78
|
end
|
|
63
79
|
|
|
64
80
|
# check to see if the attribute exists and convert string to symbol for hash key
|
|
81
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
65
82
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
66
|
-
if (!
|
|
67
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `Tremendous::
|
|
83
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
84
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Tremendous::CreateApiKeyRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
68
85
|
end
|
|
69
86
|
h[k.to_sym] = v
|
|
70
87
|
}
|
|
71
88
|
|
|
72
|
-
if attributes.key?(:'
|
|
73
|
-
self.
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
if attributes.key?(:'token')
|
|
77
|
-
self.token = attributes[:'token']
|
|
78
|
-
end
|
|
79
|
-
|
|
80
|
-
if attributes.key?(:'expires_at')
|
|
81
|
-
self.expires_at = attributes[:'expires_at']
|
|
89
|
+
if attributes.key?(:'permission')
|
|
90
|
+
self.permission = attributes[:'permission']
|
|
91
|
+
else
|
|
92
|
+
self.permission = 'read_write'
|
|
82
93
|
end
|
|
83
94
|
end
|
|
84
95
|
|
|
@@ -87,11 +98,6 @@ module Tremendous
|
|
|
87
98
|
def list_invalid_properties
|
|
88
99
|
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
89
100
|
invalid_properties = Array.new
|
|
90
|
-
pattern = Regexp.new(/[A-Z0-9]{4,20}/)
|
|
91
|
-
if !@id.nil? && @id !~ pattern
|
|
92
|
-
invalid_properties.push("invalid value for \"id\", must conform to the pattern #{pattern}.")
|
|
93
|
-
end
|
|
94
|
-
|
|
95
101
|
invalid_properties
|
|
96
102
|
end
|
|
97
103
|
|
|
@@ -99,23 +105,17 @@ module Tremendous
|
|
|
99
105
|
# @return true if the model is valid
|
|
100
106
|
def valid?
|
|
101
107
|
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
102
|
-
|
|
108
|
+
permission_validator = EnumAttributeValidator.new('String', ["read_write", "read_only"])
|
|
109
|
+
return false unless permission_validator.valid?(@permission)
|
|
103
110
|
true
|
|
104
111
|
end
|
|
105
112
|
|
|
106
|
-
# Custom attribute writer method
|
|
107
|
-
#
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
pattern = Regexp.new(/[A-Z0-9]{4,20}/)
|
|
114
|
-
if id !~ pattern
|
|
115
|
-
fail ArgumentError, "invalid value for \"id\", must conform to the pattern #{pattern}."
|
|
116
|
-
end
|
|
117
|
-
|
|
118
|
-
@id = id
|
|
113
|
+
# Custom attribute writer method for enum attributes. Any value is accepted
|
|
114
|
+
# so that enum values added to the API don't break deserialization on
|
|
115
|
+
# older versions of this gem.
|
|
116
|
+
# @param [Object] permission Object to be assigned
|
|
117
|
+
def permission=(permission)
|
|
118
|
+
@permission = permission
|
|
119
119
|
end
|
|
120
120
|
|
|
121
121
|
# Checks equality by comparing each attribute.
|
|
@@ -123,9 +123,7 @@ module Tremendous
|
|
|
123
123
|
def ==(o)
|
|
124
124
|
return true if self.equal?(o)
|
|
125
125
|
self.class == o.class &&
|
|
126
|
-
|
|
127
|
-
token == o.token &&
|
|
128
|
-
expires_at == o.expires_at
|
|
126
|
+
permission == o.permission
|
|
129
127
|
end
|
|
130
128
|
|
|
131
129
|
# @see the `==` method
|
|
@@ -137,7 +135,7 @@ module Tremendous
|
|
|
137
135
|
# Calculates hash code according to all attributes.
|
|
138
136
|
# @return [Integer] Hash code
|
|
139
137
|
def hash
|
|
140
|
-
[
|
|
138
|
+
[permission].hash
|
|
141
139
|
end
|
|
142
140
|
|
|
143
141
|
# Builds the object from hash
|
|
@@ -28,6 +28,8 @@ module Tremendous
|
|
|
28
28
|
# Determines whether fees for premium products are added to the order total (`SENDER`) or deducted from the recipient's reward amount (`RECIPIENT`). Campaigns with `RECIPIENT` must include at least one fee-free product.
|
|
29
29
|
attr_accessor :fee_charged_to
|
|
30
30
|
|
|
31
|
+
attr_accessor :auto_add_product_rule
|
|
32
|
+
|
|
31
33
|
attr_accessor :webpage_style
|
|
32
34
|
|
|
33
35
|
attr_accessor :email_style
|
|
@@ -61,6 +63,7 @@ module Tremendous
|
|
|
61
63
|
:'description' => :'description',
|
|
62
64
|
:'products' => :'products',
|
|
63
65
|
:'fee_charged_to' => :'fee_charged_to',
|
|
66
|
+
:'auto_add_product_rule' => :'auto_add_product_rule',
|
|
64
67
|
:'webpage_style' => :'webpage_style',
|
|
65
68
|
:'email_style' => :'email_style'
|
|
66
69
|
}
|
|
@@ -83,6 +86,7 @@ module Tremendous
|
|
|
83
86
|
:'description' => :'String',
|
|
84
87
|
:'products' => :'Array<String>',
|
|
85
88
|
:'fee_charged_to' => :'String',
|
|
89
|
+
:'auto_add_product_rule' => :'ListCampaigns200ResponseCampaignsInnerAutoAddProductRule',
|
|
86
90
|
:'webpage_style' => :'ListCampaigns200ResponseCampaignsInnerWebpageStyle',
|
|
87
91
|
:'email_style' => :'ListCampaigns200ResponseCampaignsInnerEmailStyle'
|
|
88
92
|
}
|
|
@@ -93,6 +97,7 @@ module Tremendous
|
|
|
93
97
|
Set.new([
|
|
94
98
|
:'description',
|
|
95
99
|
:'fee_charged_to',
|
|
100
|
+
:'auto_add_product_rule',
|
|
96
101
|
])
|
|
97
102
|
end
|
|
98
103
|
|
|
@@ -136,6 +141,10 @@ module Tremendous
|
|
|
136
141
|
self.fee_charged_to = attributes[:'fee_charged_to']
|
|
137
142
|
end
|
|
138
143
|
|
|
144
|
+
if attributes.key?(:'auto_add_product_rule')
|
|
145
|
+
self.auto_add_product_rule = attributes[:'auto_add_product_rule']
|
|
146
|
+
end
|
|
147
|
+
|
|
139
148
|
if attributes.key?(:'webpage_style')
|
|
140
149
|
self.webpage_style = attributes[:'webpage_style']
|
|
141
150
|
end
|
|
@@ -192,13 +201,11 @@ module Tremendous
|
|
|
192
201
|
@products = products
|
|
193
202
|
end
|
|
194
203
|
|
|
195
|
-
# Custom attribute writer method
|
|
204
|
+
# Custom attribute writer method for enum attributes. Any value is accepted
|
|
205
|
+
# so that enum values added to the API don't break deserialization on
|
|
206
|
+
# older versions of this gem.
|
|
196
207
|
# @param [Object] fee_charged_to Object to be assigned
|
|
197
208
|
def fee_charged_to=(fee_charged_to)
|
|
198
|
-
validator = EnumAttributeValidator.new('String', ["SENDER", "RECIPIENT"])
|
|
199
|
-
unless validator.valid?(fee_charged_to)
|
|
200
|
-
fail ArgumentError, "invalid value for \"fee_charged_to\", must be one of #{validator.allowable_values}."
|
|
201
|
-
end
|
|
202
209
|
@fee_charged_to = fee_charged_to
|
|
203
210
|
end
|
|
204
211
|
|
|
@@ -211,6 +218,7 @@ module Tremendous
|
|
|
211
218
|
description == o.description &&
|
|
212
219
|
products == o.products &&
|
|
213
220
|
fee_charged_to == o.fee_charged_to &&
|
|
221
|
+
auto_add_product_rule == o.auto_add_product_rule &&
|
|
214
222
|
webpage_style == o.webpage_style &&
|
|
215
223
|
email_style == o.email_style
|
|
216
224
|
end
|
|
@@ -224,7 +232,7 @@ module Tremendous
|
|
|
224
232
|
# Calculates hash code according to all attributes.
|
|
225
233
|
# @return [Integer] Hash code
|
|
226
234
|
def hash
|
|
227
|
-
[name, description, products, fee_charged_to, webpage_style, email_style].hash
|
|
235
|
+
[name, description, products, fee_charged_to, auto_add_product_rule, webpage_style, email_style].hash
|
|
228
236
|
end
|
|
229
237
|
|
|
230
238
|
# Builds the object from hash
|
|
@@ -24,6 +24,9 @@ module Tremendous
|
|
|
24
24
|
# The URL used for links that redirect the user back to your site when they've completed their actions on Tremendous.
|
|
25
25
|
attr_accessor :return_url
|
|
26
26
|
|
|
27
|
+
# The opaque `state` value provided when the session was created, forwarded on the initial OAuth grant redirect. `null` when no value was set.
|
|
28
|
+
attr_accessor :state
|
|
29
|
+
|
|
27
30
|
# Timestamp of when the session will expire.
|
|
28
31
|
attr_accessor :expires_at
|
|
29
32
|
|
|
@@ -36,6 +39,7 @@ module Tremendous
|
|
|
36
39
|
:'connected_organization_member_id' => :'connected_organization_member_id',
|
|
37
40
|
:'url' => :'url',
|
|
38
41
|
:'return_url' => :'return_url',
|
|
42
|
+
:'state' => :'state',
|
|
39
43
|
:'expires_at' => :'expires_at',
|
|
40
44
|
:'created_at' => :'created_at'
|
|
41
45
|
}
|
|
@@ -57,6 +61,7 @@ module Tremendous
|
|
|
57
61
|
:'connected_organization_member_id' => :'String',
|
|
58
62
|
:'url' => :'String',
|
|
59
63
|
:'return_url' => :'String',
|
|
64
|
+
:'state' => :'String',
|
|
60
65
|
:'expires_at' => :'Time',
|
|
61
66
|
:'created_at' => :'Time'
|
|
62
67
|
}
|
|
@@ -65,6 +70,7 @@ module Tremendous
|
|
|
65
70
|
# List of attributes with nullable: true
|
|
66
71
|
def self.openapi_nullable
|
|
67
72
|
Set.new([
|
|
73
|
+
:'state',
|
|
68
74
|
])
|
|
69
75
|
end
|
|
70
76
|
|
|
@@ -102,6 +108,10 @@ module Tremendous
|
|
|
102
108
|
self.return_url = nil
|
|
103
109
|
end
|
|
104
110
|
|
|
111
|
+
if attributes.key?(:'state')
|
|
112
|
+
self.state = attributes[:'state']
|
|
113
|
+
end
|
|
114
|
+
|
|
105
115
|
if attributes.key?(:'expires_at')
|
|
106
116
|
self.expires_at = attributes[:'expires_at']
|
|
107
117
|
else
|
|
@@ -137,6 +147,10 @@ module Tremendous
|
|
|
137
147
|
invalid_properties.push('invalid value for "return_url", return_url cannot be nil.')
|
|
138
148
|
end
|
|
139
149
|
|
|
150
|
+
if !@state.nil? && @state.to_s.length > 1024
|
|
151
|
+
invalid_properties.push('invalid value for "state", the character length must be smaller than or equal to 1024.')
|
|
152
|
+
end
|
|
153
|
+
|
|
140
154
|
if @expires_at.nil?
|
|
141
155
|
invalid_properties.push('invalid value for "expires_at", expires_at cannot be nil.')
|
|
142
156
|
end
|
|
@@ -156,6 +170,7 @@ module Tremendous
|
|
|
156
170
|
return false if @connected_organization_member_id !~ Regexp.new(/[A-Z0-9]{4,20}/)
|
|
157
171
|
return false if @url.nil?
|
|
158
172
|
return false if @return_url.nil?
|
|
173
|
+
return false if !@state.nil? && @state.to_s.length > 1024
|
|
159
174
|
return false if @expires_at.nil?
|
|
160
175
|
return false if @created_at.nil?
|
|
161
176
|
true
|
|
@@ -196,6 +211,16 @@ module Tremendous
|
|
|
196
211
|
@return_url = return_url
|
|
197
212
|
end
|
|
198
213
|
|
|
214
|
+
# Custom attribute writer method with validation
|
|
215
|
+
# @param [Object] state Value to be assigned
|
|
216
|
+
def state=(state)
|
|
217
|
+
if !state.nil? && state.to_s.length > 1024
|
|
218
|
+
fail ArgumentError, 'invalid value for "state", the character length must be smaller than or equal to 1024.'
|
|
219
|
+
end
|
|
220
|
+
|
|
221
|
+
@state = state
|
|
222
|
+
end
|
|
223
|
+
|
|
199
224
|
# Custom attribute writer method with validation
|
|
200
225
|
# @param [Object] expires_at Value to be assigned
|
|
201
226
|
def expires_at=(expires_at)
|
|
@@ -224,6 +249,7 @@ module Tremendous
|
|
|
224
249
|
connected_organization_member_id == o.connected_organization_member_id &&
|
|
225
250
|
url == o.url &&
|
|
226
251
|
return_url == o.return_url &&
|
|
252
|
+
state == o.state &&
|
|
227
253
|
expires_at == o.expires_at &&
|
|
228
254
|
created_at == o.created_at
|
|
229
255
|
end
|
|
@@ -237,7 +263,7 @@ module Tremendous
|
|
|
237
263
|
# Calculates hash code according to all attributes.
|
|
238
264
|
# @return [Integer] Hash code
|
|
239
265
|
def hash
|
|
240
|
-
[connected_organization_member_id, url, return_url, expires_at, created_at].hash
|
|
266
|
+
[connected_organization_member_id, url, return_url, state, expires_at, created_at].hash
|
|
241
267
|
end
|
|
242
268
|
|
|
243
269
|
# Builds the object from hash
|