tremendous_ruby 5.5.0 → 5.7.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 (63) hide show
  1. checksums.yaml +4 -4
  2. data/lib/tremendous/api/tremendous_api.rb +54 -256
  3. data/lib/tremendous/models/base_order_for_create.rb +1 -1
  4. data/lib/tremendous/models/create_order200_response.rb +1 -1
  5. data/lib/tremendous/models/create_order200_response_order.rb +403 -0
  6. data/lib/tremendous/models/create_order200_response_order_rewards_inner.rb +326 -0
  7. data/lib/tremendous/models/create_order200_response_order_rewards_inner_delivery.rb +296 -0
  8. data/lib/tremendous/models/{create_public_key_request.rb → create_order201_response.rb} +14 -15
  9. data/lib/tremendous/models/create_order_request.rb +1 -1
  10. data/lib/tremendous/models/create_organization.rb +51 -4
  11. data/lib/tremendous/models/create_organization200_response_organization.rb +20 -45
  12. data/lib/tremendous/models/{public_keys_response_public_keys_inner.rb → create_organization_for_response.rb} +72 -20
  13. data/lib/tremendous/models/{public_key.rb → create_organization_properties.rb} +57 -20
  14. data/lib/tremendous/models/create_organization_request.rb +7 -0
  15. data/lib/tremendous/models/create_report201_response.rb +231 -0
  16. data/lib/tremendous/models/create_report201_response_report.rb +291 -0
  17. data/lib/tremendous/models/create_report_request.rb +295 -0
  18. data/lib/tremendous/models/{create_public_key200_response.rb → create_report_request_filters.rb} +12 -17
  19. data/lib/tremendous/models/{create_invoice.rb → create_report_request_filters_digital_rewards.rb} +128 -32
  20. data/lib/tremendous/models/{create_public_key.rb → create_report_request_filters_digital_rewards_amount.rb} +22 -18
  21. data/lib/tremendous/models/{public_keys_response.rb → create_report_request_filters_digital_rewards_created_at.rb} +22 -19
  22. data/lib/tremendous/models/delivery_details.rb +0 -14
  23. data/lib/tremendous/models/delivery_details_with_link.rb +296 -0
  24. data/lib/tremendous/models/error_model.rb +11 -1
  25. data/lib/tremendous/models/fraud_rule400_response.rb +11 -1
  26. data/lib/tremendous/models/fraud_rule422_response.rb +11 -1
  27. data/lib/tremendous/models/fraud_rules_list_item.rb +4 -2
  28. data/lib/tremendous/models/generate_reward_link403_response.rb +11 -1
  29. data/lib/tremendous/models/invoice.rb +10 -1
  30. data/lib/tremendous/models/list_fraud_reviews200_response.rb +21 -4
  31. data/lib/tremendous/models/list_fraud_rules200_response_fraud_rules_inner.rb +4 -2
  32. data/lib/tremendous/models/list_funding_sources200_response_funding_sources_inner_meta.rb +37 -7
  33. data/lib/tremendous/models/list_funding_sources200_response_funding_sources_inner_meta_failure_details.rb +225 -0
  34. data/lib/tremendous/models/list_invoices200_response_invoices_inner.rb +10 -1
  35. data/lib/tremendous/models/list_orders200_response_orders_inner_payment.rb +4 -48
  36. data/lib/tremendous/models/list_rewards200_response_rewards_inner_delivery.rb +0 -14
  37. data/lib/tremendous/models/list_rewards401_response.rb +11 -1
  38. data/lib/tremendous/models/list_rewards401_response_errors.rb +4 -2
  39. data/lib/tremendous/models/list_rewards429_response.rb +11 -1
  40. data/lib/tremendous/models/order_base_payment.rb +4 -48
  41. data/lib/tremendous/models/order_with_link.rb +403 -0
  42. data/lib/tremendous/models/order_with_link_rewards_inner.rb +385 -0
  43. data/lib/tremendous/models/payment_details.rb +4 -48
  44. data/lib/tremendous/models/payout.rb +352 -0
  45. data/lib/tremendous/models/report.rb +291 -0
  46. data/lib/tremendous/models/resend_reward422_response.rb +11 -1
  47. data/lib/tremendous/models/resend_reward_request.rb +225 -0
  48. data/lib/tremendous/models/reward_for_order_create.rb +1 -1
  49. data/lib/tremendous/models/{single_reward_order1_reward.rb → reward_with_link.rb} +78 -16
  50. data/lib/tremendous/models/reward_with_link_delivery.rb +296 -0
  51. data/lib/tremendous/models/reward_without_link_delivery.rb +0 -14
  52. data/lib/tremendous/models/single_reward_order.rb +1 -1
  53. data/lib/tremendous/models/{single_reward_order1_payment.rb → single_reward_order_payment.rb} +3 -3
  54. data/lib/tremendous/models/single_reward_order_reward.rb +3 -75
  55. data/lib/tremendous/models/{single_reward_order1_reward_custom_fields_inner.rb → single_reward_order_reward_custom_fields_inner.rb} +3 -3
  56. data/lib/tremendous/models/{single_reward_order1_reward_delivery.rb → single_reward_order_reward_delivery.rb} +3 -3
  57. data/lib/tremendous/models/{test_public_key.rb → single_reward_order_with_link.rb} +14 -15
  58. data/lib/tremendous/models/single_reward_order_with_link_order.rb +403 -0
  59. data/lib/tremendous/version.rb +1 -1
  60. data/lib/tremendous.rb +27 -14
  61. metadata +29 -16
  62. data/lib/tremendous/models/single_reward_order1.rb +0 -242
  63. data/lib/tremendous/models/test_public_key_request.rb +0 -222
@@ -0,0 +1,296 @@
1
+ =begin
2
+ #API Endpoints
3
+
4
+ #Deliver monetary rewards and incentives to employees, customers, survey participants, and more through the Tremendous API. For organizational tasks, like managing your organization and it's members within Tremendous, please see the Tremendous Organizational API.
5
+
6
+ The version of the OpenAPI document: 2
7
+ Contact: developers@tremendous.com
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.8.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module Tremendous
17
+ # Details on how the reward is delivered to the recipient.
18
+ class RewardWithLinkDelivery
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
+ attr_accessor :method
21
+
22
+ # Current status of the delivery of the reward: * `SCHEDULED` - Reward is scheduled for delivery and will be delivered soon. * `FAILED` - Delivery of reward failed (e.g. email bounced). * `SUCCEEDED` - Reward was successfully delivered (email or text message delivered or reward link opened). * `PENDING` - Delivery is pending but not yet scheduled.
23
+ attr_accessor :status
24
+
25
+ # Link to redeem the reward at. You need to deliver this link to the recipient.
26
+ attr_accessor :link
27
+
28
+ class EnumAttributeValidator
29
+ attr_reader :datatype
30
+ attr_reader :allowable_values
31
+
32
+ def initialize(datatype, allowable_values)
33
+ @allowable_values = allowable_values.map do |value|
34
+ case datatype.to_s
35
+ when /Integer/i
36
+ value.to_i
37
+ when /Float/i
38
+ value.to_f
39
+ else
40
+ value
41
+ end
42
+ end
43
+ end
44
+
45
+ def valid?(value)
46
+ !value || allowable_values.include?(value)
47
+ end
48
+ end
49
+
50
+ # Attribute mapping from ruby-style variable name to JSON key.
51
+ def self.attribute_map
52
+ {
53
+ :'method' => :'method',
54
+ :'status' => :'status',
55
+ :'link' => :'link'
56
+ }
57
+ end
58
+
59
+ # Returns all the JSON keys this model knows about
60
+ def self.acceptable_attributes
61
+ attribute_map.values
62
+ end
63
+
64
+ # Attribute type mapping.
65
+ def self.openapi_types
66
+ {
67
+ :'method' => :'String',
68
+ :'status' => :'String',
69
+ :'link' => :'String'
70
+ }
71
+ end
72
+
73
+ # List of attributes with nullable: true
74
+ def self.openapi_nullable
75
+ Set.new([
76
+ ])
77
+ end
78
+
79
+ # Initializes the object
80
+ # @param [Hash] attributes Model attributes in the form of hash
81
+ def initialize(attributes = {})
82
+ if (!attributes.is_a?(Hash))
83
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Tremendous::RewardWithLinkDelivery` initialize method"
84
+ end
85
+
86
+ # check to see if the attribute exists and convert string to symbol for hash key
87
+ attributes = attributes.each_with_object({}) { |(k, v), h|
88
+ if (!self.class.attribute_map.key?(k.to_sym))
89
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Tremendous::RewardWithLinkDelivery`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
90
+ end
91
+ h[k.to_sym] = v
92
+ }
93
+
94
+ if attributes.key?(:'method')
95
+ self.method = attributes[:'method']
96
+ else
97
+ self.method = nil
98
+ end
99
+
100
+ if attributes.key?(:'status')
101
+ self.status = attributes[:'status']
102
+ else
103
+ self.status = nil
104
+ end
105
+
106
+ if attributes.key?(:'link')
107
+ self.link = attributes[:'link']
108
+ end
109
+ end
110
+
111
+ # Show invalid properties with the reasons. Usually used together with valid?
112
+ # @return Array for valid properties with the reasons
113
+ def list_invalid_properties
114
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
115
+ invalid_properties = Array.new
116
+ if @method.nil?
117
+ invalid_properties.push('invalid value for "method", method cannot be nil.')
118
+ end
119
+
120
+ if @status.nil?
121
+ invalid_properties.push('invalid value for "status", status cannot be nil.')
122
+ end
123
+
124
+ invalid_properties
125
+ end
126
+
127
+ # Check to see if the all the properties in the model are valid
128
+ # @return true if the model is valid
129
+ def valid?
130
+ warn '[DEPRECATED] the `valid?` method is obsolete'
131
+ return false if @method.nil?
132
+ method_validator = EnumAttributeValidator.new('String', ["EMAIL", "LINK", "PHONE"])
133
+ return false unless method_validator.valid?(@method)
134
+ return false if @status.nil?
135
+ status_validator = EnumAttributeValidator.new('String', ["SCHEDULED", "FAILED", "SUCCEEDED", "PENDING"])
136
+ return false unless status_validator.valid?(@status)
137
+ true
138
+ end
139
+
140
+ # Custom attribute writer method checking allowed values (enum).
141
+ # @param [Object] method Object to be assigned
142
+ def method=(method)
143
+ validator = EnumAttributeValidator.new('String', ["EMAIL", "LINK", "PHONE"])
144
+ unless validator.valid?(method)
145
+ fail ArgumentError, "invalid value for \"method\", must be one of #{validator.allowable_values}."
146
+ end
147
+ @method = method
148
+ end
149
+
150
+ # Custom attribute writer method checking allowed values (enum).
151
+ # @param [Object] status Object to be assigned
152
+ def status=(status)
153
+ validator = EnumAttributeValidator.new('String', ["SCHEDULED", "FAILED", "SUCCEEDED", "PENDING"])
154
+ unless validator.valid?(status)
155
+ fail ArgumentError, "invalid value for \"status\", must be one of #{validator.allowable_values}."
156
+ end
157
+ @status = status
158
+ end
159
+
160
+ # Checks equality by comparing each attribute.
161
+ # @param [Object] Object to be compared
162
+ def ==(o)
163
+ return true if self.equal?(o)
164
+ self.class == o.class &&
165
+ method == o.method &&
166
+ status == o.status &&
167
+ link == o.link
168
+ end
169
+
170
+ # @see the `==` method
171
+ # @param [Object] Object to be compared
172
+ def eql?(o)
173
+ self == o
174
+ end
175
+
176
+ # Calculates hash code according to all attributes.
177
+ # @return [Integer] Hash code
178
+ def hash
179
+ [method, status, link].hash
180
+ end
181
+
182
+ # Builds the object from hash
183
+ # @param [Hash] attributes Model attributes in the form of hash
184
+ # @return [Object] Returns the model itself
185
+ def self.build_from_hash(attributes)
186
+ return nil unless attributes.is_a?(Hash)
187
+ attributes = attributes.transform_keys(&:to_sym)
188
+ transformed_hash = {}
189
+ openapi_types.each_pair do |key, type|
190
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
191
+ transformed_hash["#{key}"] = nil
192
+ elsif type =~ /\AArray<(.*)>/i
193
+ # check to ensure the input is an array given that the attribute
194
+ # is documented as an array but the input is not
195
+ if attributes[attribute_map[key]].is_a?(Array)
196
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
197
+ end
198
+ elsif !attributes[attribute_map[key]].nil?
199
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
200
+ end
201
+ end
202
+ new(transformed_hash)
203
+ end
204
+
205
+ # Deserializes the data based on type
206
+ # @param string type Data type
207
+ # @param string value Value to be deserialized
208
+ # @return [Object] Deserialized data
209
+ def self._deserialize(type, value)
210
+ case type.to_sym
211
+ when :Time
212
+ Time.parse(value)
213
+ when :Date
214
+ Date.parse(value)
215
+ when :String
216
+ value.to_s
217
+ when :Integer
218
+ value.to_i
219
+ when :Float
220
+ value.to_f
221
+ when :Boolean
222
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
223
+ true
224
+ else
225
+ false
226
+ end
227
+ when :Object
228
+ # generic object (usually a Hash), return directly
229
+ value
230
+ when /\AArray<(?<inner_type>.+)>\z/
231
+ inner_type = Regexp.last_match[:inner_type]
232
+ value.map { |v| _deserialize(inner_type, v) }
233
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
234
+ k_type = Regexp.last_match[:k_type]
235
+ v_type = Regexp.last_match[:v_type]
236
+ {}.tap do |hash|
237
+ value.each do |k, v|
238
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
239
+ end
240
+ end
241
+ else # model
242
+ # models (e.g. Pet) or oneOf
243
+ klass = Tremendous.const_get(type)
244
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
245
+ end
246
+ end
247
+
248
+ # Returns the string representation of the object
249
+ # @return [String] String presentation of the object
250
+ def to_s
251
+ to_hash.to_s
252
+ end
253
+
254
+ # to_body is an alias to to_hash (backward compatibility)
255
+ # @return [Hash] Returns the object in the form of hash
256
+ def to_body
257
+ to_hash
258
+ end
259
+
260
+ # Returns the object in the form of hash
261
+ # @return [Hash] Returns the object in the form of hash
262
+ def to_hash
263
+ hash = {}
264
+ self.class.attribute_map.each_pair do |attr, param|
265
+ value = self.send(attr)
266
+ if value.nil?
267
+ is_nullable = self.class.openapi_nullable.include?(attr)
268
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
269
+ end
270
+
271
+ hash[param] = _to_hash(value)
272
+ end
273
+ hash
274
+ end
275
+
276
+ # Outputs non-array value in the form of hash
277
+ # For object, use to_hash. Otherwise, just return the value
278
+ # @param [Object] value Any valid value
279
+ # @return [Hash] Returns the value in the form of hash
280
+ def _to_hash(value)
281
+ if value.is_a?(Array)
282
+ value.compact.map { |v| _to_hash(v) }
283
+ elsif value.is_a?(Hash)
284
+ {}.tap do |hash|
285
+ value.each { |k, v| hash[k] = _to_hash(v) }
286
+ end
287
+ elsif value.respond_to? :to_hash
288
+ value.to_hash
289
+ else
290
+ value
291
+ end
292
+ end
293
+
294
+ end
295
+
296
+ end
@@ -88,14 +88,10 @@ module Tremendous
88
88
 
89
89
  if attributes.key?(:'method')
90
90
  self.method = attributes[:'method']
91
- else
92
- self.method = nil
93
91
  end
94
92
 
95
93
  if attributes.key?(:'status')
96
94
  self.status = attributes[:'status']
97
- else
98
- self.status = nil
99
95
  end
100
96
  end
101
97
 
@@ -104,14 +100,6 @@ module Tremendous
104
100
  def list_invalid_properties
105
101
  warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
106
102
  invalid_properties = Array.new
107
- if @method.nil?
108
- invalid_properties.push('invalid value for "method", method cannot be nil.')
109
- end
110
-
111
- if @status.nil?
112
- invalid_properties.push('invalid value for "status", status cannot be nil.')
113
- end
114
-
115
103
  invalid_properties
116
104
  end
117
105
 
@@ -119,10 +107,8 @@ module Tremendous
119
107
  # @return true if the model is valid
120
108
  def valid?
121
109
  warn '[DEPRECATED] the `valid?` method is obsolete'
122
- return false if @method.nil?
123
110
  method_validator = EnumAttributeValidator.new('String', ["EMAIL", "LINK", "PHONE"])
124
111
  return false unless method_validator.valid?(@method)
125
- return false if @status.nil?
126
112
  status_validator = EnumAttributeValidator.new('String', ["SCHEDULED", "FAILED", "SUCCEEDED", "PENDING"])
127
113
  return false unless status_validator.valid?(@status)
128
114
  true
@@ -41,7 +41,7 @@ module Tremendous
41
41
  def self.openapi_types
42
42
  {
43
43
  :'external_id' => :'String',
44
- :'payment' => :'SingleRewardOrder1Payment',
44
+ :'payment' => :'SingleRewardOrderPayment',
45
45
  :'reward' => :'SingleRewardOrderReward'
46
46
  }
47
47
  end
@@ -14,7 +14,7 @@ require 'date'
14
14
  require 'time'
15
15
 
16
16
  module Tremendous
17
- class SingleRewardOrder1Payment
17
+ class SingleRewardOrderPayment
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::SingleRewardOrder1Payment` initialize method"
50
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Tremendous::SingleRewardOrderPayment` 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::SingleRewardOrder1Payment`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
56
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Tremendous::SingleRewardOrderPayment`. 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
  }
@@ -16,15 +16,6 @@ require 'time'
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
18
  class SingleRewardOrderReward
19
- # Tremendous ID of the reward
20
- attr_accessor :id
21
-
22
- # Tremendous ID of the order this reward is part of.
23
- attr_accessor :order_id
24
-
25
- # Date the reward was created
26
- attr_accessor :created_at
27
-
28
19
  # ID of the campaign in your account, that defines the available products (different gift cards, charity, etc.) that the recipient can choose from.
29
20
  attr_accessor :campaign_id
30
21
 
@@ -48,9 +39,6 @@ module Tremendous
48
39
  # Attribute mapping from ruby-style variable name to JSON key.
49
40
  def self.attribute_map
50
41
  {
51
- :'id' => :'id',
52
- :'order_id' => :'order_id',
53
- :'created_at' => :'created_at',
54
42
  :'campaign_id' => :'campaign_id',
55
43
  :'products' => :'products',
56
44
  :'value' => :'value',
@@ -70,17 +58,14 @@ module Tremendous
70
58
  # Attribute type mapping.
71
59
  def self.openapi_types
72
60
  {
73
- :'id' => :'String',
74
- :'order_id' => :'String',
75
- :'created_at' => :'Time',
76
61
  :'campaign_id' => :'String',
77
62
  :'products' => :'Array<String>',
78
63
  :'value' => :'ListRewards200ResponseRewardsInnerValue',
79
64
  :'recipient' => :'ListRewards200ResponseRewardsInnerRecipient',
80
65
  :'deliver_at' => :'Date',
81
- :'custom_fields' => :'Array<RewardBaseCustomFieldsInner>',
66
+ :'custom_fields' => :'Array<SingleRewardOrderRewardCustomFieldsInner>',
82
67
  :'language' => :'String',
83
- :'delivery' => :'SingleRewardOrder1RewardDelivery'
68
+ :'delivery' => :'SingleRewardOrderRewardDelivery'
84
69
  }
85
70
  end
86
71
 
@@ -106,18 +91,6 @@ module Tremendous
106
91
  h[k.to_sym] = v
107
92
  }
108
93
 
109
- if attributes.key?(:'id')
110
- self.id = attributes[:'id']
111
- end
112
-
113
- if attributes.key?(:'order_id')
114
- self.order_id = attributes[:'order_id']
115
- end
116
-
117
- if attributes.key?(:'created_at')
118
- self.created_at = attributes[:'created_at']
119
- end
120
-
121
94
  if attributes.key?(:'campaign_id')
122
95
  self.campaign_id = attributes[:'campaign_id']
123
96
  end
@@ -160,16 +133,6 @@ module Tremendous
160
133
  def list_invalid_properties
161
134
  warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
162
135
  invalid_properties = Array.new
163
- pattern = Regexp.new(/[A-Z0-9]{4,20}/)
164
- if !@id.nil? && @id !~ pattern
165
- invalid_properties.push("invalid value for \"id\", must conform to the pattern #{pattern}.")
166
- end
167
-
168
- pattern = Regexp.new(/[A-Z0-9]{4,20}/)
169
- if !@order_id.nil? && @order_id !~ pattern
170
- invalid_properties.push("invalid value for \"order_id\", must conform to the pattern #{pattern}.")
171
- end
172
-
173
136
  pattern = Regexp.new(/[A-Z0-9]{4,20}/)
174
137
  if !@campaign_id.nil? && @campaign_id !~ pattern
175
138
  invalid_properties.push("invalid value for \"campaign_id\", must conform to the pattern #{pattern}.")
@@ -186,43 +149,11 @@ module Tremendous
186
149
  # @return true if the model is valid
187
150
  def valid?
188
151
  warn '[DEPRECATED] the `valid?` method is obsolete'
189
- return false if !@id.nil? && @id !~ Regexp.new(/[A-Z0-9]{4,20}/)
190
- return false if !@order_id.nil? && @order_id !~ Regexp.new(/[A-Z0-9]{4,20}/)
191
152
  return false if !@campaign_id.nil? && @campaign_id !~ Regexp.new(/[A-Z0-9]{4,20}/)
192
153
  return false if !@products.nil? && @products.length < 1
193
154
  true
194
155
  end
195
156
 
196
- # Custom attribute writer method with validation
197
- # @param [Object] id Value to be assigned
198
- def id=(id)
199
- if id.nil?
200
- fail ArgumentError, 'id cannot be nil'
201
- end
202
-
203
- pattern = Regexp.new(/[A-Z0-9]{4,20}/)
204
- if id !~ pattern
205
- fail ArgumentError, "invalid value for \"id\", must conform to the pattern #{pattern}."
206
- end
207
-
208
- @id = id
209
- end
210
-
211
- # Custom attribute writer method with validation
212
- # @param [Object] order_id Value to be assigned
213
- def order_id=(order_id)
214
- if order_id.nil?
215
- fail ArgumentError, 'order_id cannot be nil'
216
- end
217
-
218
- pattern = Regexp.new(/[A-Z0-9]{4,20}/)
219
- if order_id !~ pattern
220
- fail ArgumentError, "invalid value for \"order_id\", must conform to the pattern #{pattern}."
221
- end
222
-
223
- @order_id = order_id
224
- end
225
-
226
157
  # Custom attribute writer method with validation
227
158
  # @param [Object] campaign_id Value to be assigned
228
159
  def campaign_id=(campaign_id)
@@ -253,9 +184,6 @@ module Tremendous
253
184
  def ==(o)
254
185
  return true if self.equal?(o)
255
186
  self.class == o.class &&
256
- id == o.id &&
257
- order_id == o.order_id &&
258
- created_at == o.created_at &&
259
187
  campaign_id == o.campaign_id &&
260
188
  products == o.products &&
261
189
  value == o.value &&
@@ -275,7 +203,7 @@ module Tremendous
275
203
  # Calculates hash code according to all attributes.
276
204
  # @return [Integer] Hash code
277
205
  def hash
278
- [id, order_id, created_at, campaign_id, products, value, recipient, deliver_at, custom_fields, language, delivery].hash
206
+ [campaign_id, products, value, recipient, deliver_at, custom_fields, language, delivery].hash
279
207
  end
280
208
 
281
209
  # Builds the object from hash
@@ -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 SingleRewardOrder1RewardCustomFieldsInner
18
+ class SingleRewardOrderRewardCustomFieldsInner
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::SingleRewardOrder1RewardCustomFieldsInner` initialize method"
57
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Tremendous::SingleRewardOrderRewardCustomFieldsInner` 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::SingleRewardOrder1RewardCustomFieldsInner`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
63
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Tremendous::SingleRewardOrderRewardCustomFieldsInner`. 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 SingleRewardOrder1RewardDelivery
18
+ class SingleRewardOrderRewardDelivery
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::SingleRewardOrder1RewardDelivery` initialize method"
73
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Tremendous::SingleRewardOrderRewardDelivery` 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::SingleRewardOrder1RewardDelivery`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
79
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Tremendous::SingleRewardOrderRewardDelivery`. 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
  }
@@ -14,14 +14,13 @@ require 'date'
14
14
  require 'time'
15
15
 
16
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
17
+ class SingleRewardOrderWithLink
18
+ attr_accessor :order
20
19
 
21
20
  # Attribute mapping from ruby-style variable name to JSON key.
22
21
  def self.attribute_map
23
22
  {
24
- :'jwt' => :'jwt'
23
+ :'order' => :'order'
25
24
  }
26
25
  end
27
26
 
@@ -33,7 +32,7 @@ module Tremendous
33
32
  # Attribute type mapping.
34
33
  def self.openapi_types
35
34
  {
36
- :'jwt' => :'String'
35
+ :'order' => :'SingleRewardOrderWithLinkOrder'
37
36
  }
38
37
  end
39
38
 
@@ -47,21 +46,21 @@ module Tremendous
47
46
  # @param [Hash] attributes Model attributes in the form of hash
48
47
  def initialize(attributes = {})
49
48
  if (!attributes.is_a?(Hash))
50
- fail ArgumentError, "The input argument (attributes) must be a hash in `Tremendous::TestPublicKey` initialize method"
49
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Tremendous::SingleRewardOrderWithLink` initialize method"
51
50
  end
52
51
 
53
52
  # check to see if the attribute exists and convert string to symbol for hash key
54
53
  attributes = attributes.each_with_object({}) { |(k, v), h|
55
54
  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
55
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Tremendous::SingleRewardOrderWithLink`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
57
56
  end
58
57
  h[k.to_sym] = v
59
58
  }
60
59
 
61
- if attributes.key?(:'jwt')
62
- self.jwt = attributes[:'jwt']
60
+ if attributes.key?(:'order')
61
+ self.order = attributes[:'order']
63
62
  else
64
- self.jwt = nil
63
+ self.order = nil
65
64
  end
66
65
  end
67
66
 
@@ -70,8 +69,8 @@ module Tremendous
70
69
  def list_invalid_properties
71
70
  warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
72
71
  invalid_properties = Array.new
73
- if @jwt.nil?
74
- invalid_properties.push('invalid value for "jwt", jwt cannot be nil.')
72
+ if @order.nil?
73
+ invalid_properties.push('invalid value for "order", order cannot be nil.')
75
74
  end
76
75
 
77
76
  invalid_properties
@@ -81,7 +80,7 @@ module Tremendous
81
80
  # @return true if the model is valid
82
81
  def valid?
83
82
  warn '[DEPRECATED] the `valid?` method is obsolete'
84
- return false if @jwt.nil?
83
+ return false if @order.nil?
85
84
  true
86
85
  end
87
86
 
@@ -90,7 +89,7 @@ module Tremendous
90
89
  def ==(o)
91
90
  return true if self.equal?(o)
92
91
  self.class == o.class &&
93
- jwt == o.jwt
92
+ order == o.order
94
93
  end
95
94
 
96
95
  # @see the `==` method
@@ -102,7 +101,7 @@ module Tremendous
102
101
  # Calculates hash code according to all attributes.
103
102
  # @return [Integer] Hash code
104
103
  def hash
105
- [jwt].hash
104
+ [order].hash
106
105
  end
107
106
 
108
107
  # Builds the object from hash