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,295 @@
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
+ class CreateReportRequest
18
+ # Type of report for retrieval. <table> <thead> <tr> <th>Report type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td><code>digital_rewards</code></td> <td>Report for Tremendous digital reward history</td> </tr> </tbody> </table>
19
+ attr_accessor :report_type
20
+
21
+ # Format the report will be generated in. <table> <thead> <tr> <th>Format</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td><code>csv</code></td> <td>CSV format for report</td> </tr> </tbody> </table>
22
+ attr_accessor :format
23
+
24
+ attr_accessor :filters
25
+
26
+ class EnumAttributeValidator
27
+ attr_reader :datatype
28
+ attr_reader :allowable_values
29
+
30
+ def initialize(datatype, allowable_values)
31
+ @allowable_values = allowable_values.map do |value|
32
+ case datatype.to_s
33
+ when /Integer/i
34
+ value.to_i
35
+ when /Float/i
36
+ value.to_f
37
+ else
38
+ value
39
+ end
40
+ end
41
+ end
42
+
43
+ def valid?(value)
44
+ !value || allowable_values.include?(value)
45
+ end
46
+ end
47
+
48
+ # Attribute mapping from ruby-style variable name to JSON key.
49
+ def self.attribute_map
50
+ {
51
+ :'report_type' => :'report_type',
52
+ :'format' => :'format',
53
+ :'filters' => :'filters'
54
+ }
55
+ end
56
+
57
+ # Returns all the JSON keys this model knows about
58
+ def self.acceptable_attributes
59
+ attribute_map.values
60
+ end
61
+
62
+ # Attribute type mapping.
63
+ def self.openapi_types
64
+ {
65
+ :'report_type' => :'String',
66
+ :'format' => :'String',
67
+ :'filters' => :'CreateReportRequestFilters'
68
+ }
69
+ end
70
+
71
+ # List of attributes with nullable: true
72
+ def self.openapi_nullable
73
+ Set.new([
74
+ :'filters'
75
+ ])
76
+ end
77
+
78
+ # Initializes the object
79
+ # @param [Hash] attributes Model attributes in the form of hash
80
+ def initialize(attributes = {})
81
+ if (!attributes.is_a?(Hash))
82
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Tremendous::CreateReportRequest` initialize method"
83
+ end
84
+
85
+ # check to see if the attribute exists and convert string to symbol for hash key
86
+ attributes = attributes.each_with_object({}) { |(k, v), h|
87
+ if (!self.class.attribute_map.key?(k.to_sym))
88
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Tremendous::CreateReportRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
89
+ end
90
+ h[k.to_sym] = v
91
+ }
92
+
93
+ if attributes.key?(:'report_type')
94
+ self.report_type = attributes[:'report_type']
95
+ else
96
+ self.report_type = nil
97
+ end
98
+
99
+ if attributes.key?(:'format')
100
+ self.format = attributes[:'format']
101
+ else
102
+ self.format = nil
103
+ end
104
+
105
+ if attributes.key?(:'filters')
106
+ self.filters = attributes[:'filters']
107
+ end
108
+ end
109
+
110
+ # Show invalid properties with the reasons. Usually used together with valid?
111
+ # @return Array for valid properties with the reasons
112
+ def list_invalid_properties
113
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
114
+ invalid_properties = Array.new
115
+ if @report_type.nil?
116
+ invalid_properties.push('invalid value for "report_type", report_type cannot be nil.')
117
+ end
118
+
119
+ if @format.nil?
120
+ invalid_properties.push('invalid value for "format", format cannot be nil.')
121
+ end
122
+
123
+ invalid_properties
124
+ end
125
+
126
+ # Check to see if the all the properties in the model are valid
127
+ # @return true if the model is valid
128
+ def valid?
129
+ warn '[DEPRECATED] the `valid?` method is obsolete'
130
+ return false if @report_type.nil?
131
+ report_type_validator = EnumAttributeValidator.new('String', ["digital_rewards"])
132
+ return false unless report_type_validator.valid?(@report_type)
133
+ return false if @format.nil?
134
+ format_validator = EnumAttributeValidator.new('String', ["csv"])
135
+ return false unless format_validator.valid?(@format)
136
+ true
137
+ end
138
+
139
+ # Custom attribute writer method checking allowed values (enum).
140
+ # @param [Object] report_type Object to be assigned
141
+ def report_type=(report_type)
142
+ validator = EnumAttributeValidator.new('String', ["digital_rewards"])
143
+ unless validator.valid?(report_type)
144
+ fail ArgumentError, "invalid value for \"report_type\", must be one of #{validator.allowable_values}."
145
+ end
146
+ @report_type = report_type
147
+ end
148
+
149
+ # Custom attribute writer method checking allowed values (enum).
150
+ # @param [Object] format Object to be assigned
151
+ def format=(format)
152
+ validator = EnumAttributeValidator.new('String', ["csv"])
153
+ unless validator.valid?(format)
154
+ fail ArgumentError, "invalid value for \"format\", must be one of #{validator.allowable_values}."
155
+ end
156
+ @format = format
157
+ end
158
+
159
+ # Checks equality by comparing each attribute.
160
+ # @param [Object] Object to be compared
161
+ def ==(o)
162
+ return true if self.equal?(o)
163
+ self.class == o.class &&
164
+ report_type == o.report_type &&
165
+ format == o.format &&
166
+ filters == o.filters
167
+ end
168
+
169
+ # @see the `==` method
170
+ # @param [Object] Object to be compared
171
+ def eql?(o)
172
+ self == o
173
+ end
174
+
175
+ # Calculates hash code according to all attributes.
176
+ # @return [Integer] Hash code
177
+ def hash
178
+ [report_type, format, filters].hash
179
+ end
180
+
181
+ # Builds the object from hash
182
+ # @param [Hash] attributes Model attributes in the form of hash
183
+ # @return [Object] Returns the model itself
184
+ def self.build_from_hash(attributes)
185
+ return nil unless attributes.is_a?(Hash)
186
+ attributes = attributes.transform_keys(&:to_sym)
187
+ transformed_hash = {}
188
+ openapi_types.each_pair do |key, type|
189
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
190
+ transformed_hash["#{key}"] = nil
191
+ elsif type =~ /\AArray<(.*)>/i
192
+ # check to ensure the input is an array given that the attribute
193
+ # is documented as an array but the input is not
194
+ if attributes[attribute_map[key]].is_a?(Array)
195
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
196
+ end
197
+ elsif !attributes[attribute_map[key]].nil?
198
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
199
+ end
200
+ end
201
+ new(transformed_hash)
202
+ end
203
+
204
+ # Deserializes the data based on type
205
+ # @param string type Data type
206
+ # @param string value Value to be deserialized
207
+ # @return [Object] Deserialized data
208
+ def self._deserialize(type, value)
209
+ case type.to_sym
210
+ when :Time
211
+ Time.parse(value)
212
+ when :Date
213
+ Date.parse(value)
214
+ when :String
215
+ value.to_s
216
+ when :Integer
217
+ value.to_i
218
+ when :Float
219
+ value.to_f
220
+ when :Boolean
221
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
222
+ true
223
+ else
224
+ false
225
+ end
226
+ when :Object
227
+ # generic object (usually a Hash), return directly
228
+ value
229
+ when /\AArray<(?<inner_type>.+)>\z/
230
+ inner_type = Regexp.last_match[:inner_type]
231
+ value.map { |v| _deserialize(inner_type, v) }
232
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
233
+ k_type = Regexp.last_match[:k_type]
234
+ v_type = Regexp.last_match[:v_type]
235
+ {}.tap do |hash|
236
+ value.each do |k, v|
237
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
238
+ end
239
+ end
240
+ else # model
241
+ # models (e.g. Pet) or oneOf
242
+ klass = Tremendous.const_get(type)
243
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
244
+ end
245
+ end
246
+
247
+ # Returns the string representation of the object
248
+ # @return [String] String presentation of the object
249
+ def to_s
250
+ to_hash.to_s
251
+ end
252
+
253
+ # to_body is an alias to to_hash (backward compatibility)
254
+ # @return [Hash] Returns the object in the form of hash
255
+ def to_body
256
+ to_hash
257
+ end
258
+
259
+ # Returns the object in the form of hash
260
+ # @return [Hash] Returns the object in the form of hash
261
+ def to_hash
262
+ hash = {}
263
+ self.class.attribute_map.each_pair do |attr, param|
264
+ value = self.send(attr)
265
+ if value.nil?
266
+ is_nullable = self.class.openapi_nullable.include?(attr)
267
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
268
+ end
269
+
270
+ hash[param] = _to_hash(value)
271
+ end
272
+ hash
273
+ end
274
+
275
+ # Outputs non-array value in the form of hash
276
+ # For object, use to_hash. Otherwise, just return the value
277
+ # @param [Object] value Any valid value
278
+ # @return [Hash] Returns the value in the form of hash
279
+ def _to_hash(value)
280
+ if value.is_a?(Array)
281
+ value.compact.map { |v| _to_hash(v) }
282
+ elsif value.is_a?(Hash)
283
+ {}.tap do |hash|
284
+ value.each { |k, v| hash[k] = _to_hash(v) }
285
+ end
286
+ elsif value.respond_to? :to_hash
287
+ value.to_hash
288
+ else
289
+ value
290
+ end
291
+ end
292
+
293
+ end
294
+
295
+ end
@@ -14,13 +14,14 @@ require 'date'
14
14
  require 'time'
15
15
 
16
16
  module Tremendous
17
- class CreatePublicKey200Response
18
- attr_accessor :public_key
17
+ # Filters to apply to the report. Corresponds to the filters provided in the dashboard
18
+ class CreateReportRequestFilters
19
+ attr_accessor :digital_rewards
19
20
 
20
21
  # Attribute mapping from ruby-style variable name to JSON key.
21
22
  def self.attribute_map
22
23
  {
23
- :'public_key' => :'public_key'
24
+ :'digital_rewards' => :'digital_rewards'
24
25
  }
25
26
  end
26
27
 
@@ -32,13 +33,14 @@ module Tremendous
32
33
  # Attribute type mapping.
33
34
  def self.openapi_types
34
35
  {
35
- :'public_key' => :'PublicKeysResponsePublicKeysInner'
36
+ :'digital_rewards' => :'CreateReportRequestFiltersDigitalRewards'
36
37
  }
37
38
  end
38
39
 
39
40
  # List of attributes with nullable: true
40
41
  def self.openapi_nullable
41
42
  Set.new([
43
+ :'digital_rewards'
42
44
  ])
43
45
  end
44
46
 
@@ -46,21 +48,19 @@ module Tremendous
46
48
  # @param [Hash] attributes Model attributes in the form of hash
47
49
  def initialize(attributes = {})
48
50
  if (!attributes.is_a?(Hash))
49
- fail ArgumentError, "The input argument (attributes) must be a hash in `Tremendous::CreatePublicKey200Response` initialize method"
51
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Tremendous::CreateReportRequestFilters` initialize method"
50
52
  end
51
53
 
52
54
  # check to see if the attribute exists and convert string to symbol for hash key
53
55
  attributes = attributes.each_with_object({}) { |(k, v), h|
54
56
  if (!self.class.attribute_map.key?(k.to_sym))
55
- fail ArgumentError, "`#{k}` is not a valid attribute in `Tremendous::CreatePublicKey200Response`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
57
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Tremendous::CreateReportRequestFilters`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
56
58
  end
57
59
  h[k.to_sym] = v
58
60
  }
59
61
 
60
- if attributes.key?(:'public_key')
61
- self.public_key = attributes[:'public_key']
62
- else
63
- self.public_key = nil
62
+ if attributes.key?(:'digital_rewards')
63
+ self.digital_rewards = attributes[:'digital_rewards']
64
64
  end
65
65
  end
66
66
 
@@ -69,10 +69,6 @@ module Tremendous
69
69
  def list_invalid_properties
70
70
  warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
71
71
  invalid_properties = Array.new
72
- if @public_key.nil?
73
- invalid_properties.push('invalid value for "public_key", public_key cannot be nil.')
74
- end
75
-
76
72
  invalid_properties
77
73
  end
78
74
 
@@ -80,7 +76,6 @@ module Tremendous
80
76
  # @return true if the model is valid
81
77
  def valid?
82
78
  warn '[DEPRECATED] the `valid?` method is obsolete'
83
- return false if @public_key.nil?
84
79
  true
85
80
  end
86
81
 
@@ -89,7 +84,7 @@ module Tremendous
89
84
  def ==(o)
90
85
  return true if self.equal?(o)
91
86
  self.class == o.class &&
92
- public_key == o.public_key
87
+ digital_rewards == o.digital_rewards
93
88
  end
94
89
 
95
90
  # @see the `==` method
@@ -101,7 +96,7 @@ module Tremendous
101
96
  # Calculates hash code according to all attributes.
102
97
  # @return [Integer] Hash code
103
98
  def hash
104
- [public_key].hash
99
+ [digital_rewards].hash
105
100
  end
106
101
 
107
102
  # Builds the object from hash
@@ -14,22 +14,63 @@ require 'date'
14
14
  require 'time'
15
15
 
16
16
  module Tremendous
17
- class CreateInvoice
18
- # Reference to the purchase order number within your organization
19
- attr_accessor :po_number
20
-
21
- # Amount of the invoice in USD
17
+ # Filters object for a `report_type: digital_rewards` report
18
+ class CreateReportRequestFiltersDigitalRewards
22
19
  attr_accessor :amount
23
20
 
24
- # A note to be included in the invoice. This is for your internal use and will not be visible to the recipient.
25
- attr_accessor :memo
21
+ # ID of the Tremendous campaign that this report should be limited to
22
+ attr_accessor :campaign_id
23
+
24
+ attr_accessor :created_at
25
+
26
+ # Delivery date for gifts that should be returned in the report
27
+ attr_accessor :delivered_at
28
+
29
+ # Delivery method for rewards returned in the report
30
+ attr_accessor :delivery_method
31
+
32
+ # ID of the Tremendous order that this report should be limited to
33
+ attr_accessor :order_id
34
+
35
+ # Order status for rewards returned in the report
36
+ attr_accessor :order_status
37
+
38
+ # Status for rewards returned in the report
39
+ attr_accessor :status
40
+
41
+ class EnumAttributeValidator
42
+ attr_reader :datatype
43
+ attr_reader :allowable_values
44
+
45
+ def initialize(datatype, allowable_values)
46
+ @allowable_values = allowable_values.map do |value|
47
+ case datatype.to_s
48
+ when /Integer/i
49
+ value.to_i
50
+ when /Float/i
51
+ value.to_f
52
+ else
53
+ value
54
+ end
55
+ end
56
+ end
57
+
58
+ def valid?(value)
59
+ !value || allowable_values.include?(value)
60
+ end
61
+ end
26
62
 
27
63
  # Attribute mapping from ruby-style variable name to JSON key.
28
64
  def self.attribute_map
29
65
  {
30
- :'po_number' => :'po_number',
31
66
  :'amount' => :'amount',
32
- :'memo' => :'memo'
67
+ :'campaign_id' => :'campaign_id',
68
+ :'created_at' => :'created_at',
69
+ :'delivered_at' => :'delivered_at',
70
+ :'delivery_method' => :'delivery_method',
71
+ :'order_id' => :'order_id',
72
+ :'order_status' => :'order_status',
73
+ :'status' => :'status'
33
74
  }
34
75
  end
35
76
 
@@ -41,17 +82,28 @@ module Tremendous
41
82
  # Attribute type mapping.
42
83
  def self.openapi_types
43
84
  {
44
- :'po_number' => :'String',
45
- :'amount' => :'Float',
46
- :'memo' => :'String'
85
+ :'amount' => :'CreateReportRequestFiltersDigitalRewardsAmount',
86
+ :'campaign_id' => :'String',
87
+ :'created_at' => :'CreateReportRequestFiltersDigitalRewardsCreatedAt',
88
+ :'delivered_at' => :'Date',
89
+ :'delivery_method' => :'String',
90
+ :'order_id' => :'String',
91
+ :'order_status' => :'String',
92
+ :'status' => :'Array<String>'
47
93
  }
48
94
  end
49
95
 
50
96
  # List of attributes with nullable: true
51
97
  def self.openapi_nullable
52
98
  Set.new([
53
- :'po_number',
54
- :'memo'
99
+ :'amount',
100
+ :'campaign_id',
101
+ :'created_at',
102
+ :'delivered_at',
103
+ :'delivery_method',
104
+ :'order_id',
105
+ :'order_status',
106
+ :'status'
55
107
  ])
56
108
  end
57
109
 
@@ -59,29 +111,49 @@ module Tremendous
59
111
  # @param [Hash] attributes Model attributes in the form of hash
60
112
  def initialize(attributes = {})
61
113
  if (!attributes.is_a?(Hash))
62
- fail ArgumentError, "The input argument (attributes) must be a hash in `Tremendous::CreateInvoice` initialize method"
114
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Tremendous::CreateReportRequestFiltersDigitalRewards` initialize method"
63
115
  end
64
116
 
65
117
  # check to see if the attribute exists and convert string to symbol for hash key
66
118
  attributes = attributes.each_with_object({}) { |(k, v), h|
67
119
  if (!self.class.attribute_map.key?(k.to_sym))
68
- fail ArgumentError, "`#{k}` is not a valid attribute in `Tremendous::CreateInvoice`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
120
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Tremendous::CreateReportRequestFiltersDigitalRewards`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
69
121
  end
70
122
  h[k.to_sym] = v
71
123
  }
72
124
 
73
- if attributes.key?(:'po_number')
74
- self.po_number = attributes[:'po_number']
75
- end
76
-
77
125
  if attributes.key?(:'amount')
78
126
  self.amount = attributes[:'amount']
79
- else
80
- self.amount = nil
81
127
  end
82
128
 
83
- if attributes.key?(:'memo')
84
- self.memo = attributes[:'memo']
129
+ if attributes.key?(:'campaign_id')
130
+ self.campaign_id = attributes[:'campaign_id']
131
+ end
132
+
133
+ if attributes.key?(:'created_at')
134
+ self.created_at = attributes[:'created_at']
135
+ end
136
+
137
+ if attributes.key?(:'delivered_at')
138
+ self.delivered_at = attributes[:'delivered_at']
139
+ end
140
+
141
+ if attributes.key?(:'delivery_method')
142
+ self.delivery_method = attributes[:'delivery_method']
143
+ end
144
+
145
+ if attributes.key?(:'order_id')
146
+ self.order_id = attributes[:'order_id']
147
+ end
148
+
149
+ if attributes.key?(:'order_status')
150
+ self.order_status = attributes[:'order_status']
151
+ end
152
+
153
+ if attributes.key?(:'status')
154
+ if (value = attributes[:'status']).is_a?(Array)
155
+ self.status = value
156
+ end
85
157
  end
86
158
  end
87
159
 
@@ -90,10 +162,6 @@ module Tremendous
90
162
  def list_invalid_properties
91
163
  warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
92
164
  invalid_properties = Array.new
93
- if @amount.nil?
94
- invalid_properties.push('invalid value for "amount", amount cannot be nil.')
95
- end
96
-
97
165
  invalid_properties
98
166
  end
99
167
 
@@ -101,18 +169,46 @@ module Tremendous
101
169
  # @return true if the model is valid
102
170
  def valid?
103
171
  warn '[DEPRECATED] the `valid?` method is obsolete'
104
- return false if @amount.nil?
172
+ delivery_method_validator = EnumAttributeValidator.new('String', ["phone", "email", "link", "mail", "direct"])
173
+ return false unless delivery_method_validator.valid?(@delivery_method)
174
+ order_status_validator = EnumAttributeValidator.new('String', ["executed", "canceled", "failed", "pending_approval"])
175
+ return false unless order_status_validator.valid?(@order_status)
105
176
  true
106
177
  end
107
178
 
179
+ # Custom attribute writer method checking allowed values (enum).
180
+ # @param [Object] delivery_method Object to be assigned
181
+ def delivery_method=(delivery_method)
182
+ validator = EnumAttributeValidator.new('String', ["phone", "email", "link", "mail", "direct"])
183
+ unless validator.valid?(delivery_method)
184
+ fail ArgumentError, "invalid value for \"delivery_method\", must be one of #{validator.allowable_values}."
185
+ end
186
+ @delivery_method = delivery_method
187
+ end
188
+
189
+ # Custom attribute writer method checking allowed values (enum).
190
+ # @param [Object] order_status Object to be assigned
191
+ def order_status=(order_status)
192
+ validator = EnumAttributeValidator.new('String', ["executed", "canceled", "failed", "pending_approval"])
193
+ unless validator.valid?(order_status)
194
+ fail ArgumentError, "invalid value for \"order_status\", must be one of #{validator.allowable_values}."
195
+ end
196
+ @order_status = order_status
197
+ end
198
+
108
199
  # Checks equality by comparing each attribute.
109
200
  # @param [Object] Object to be compared
110
201
  def ==(o)
111
202
  return true if self.equal?(o)
112
203
  self.class == o.class &&
113
- po_number == o.po_number &&
114
204
  amount == o.amount &&
115
- memo == o.memo
205
+ campaign_id == o.campaign_id &&
206
+ created_at == o.created_at &&
207
+ delivered_at == o.delivered_at &&
208
+ delivery_method == o.delivery_method &&
209
+ order_id == o.order_id &&
210
+ order_status == o.order_status &&
211
+ status == o.status
116
212
  end
117
213
 
118
214
  # @see the `==` method
@@ -124,7 +220,7 @@ module Tremendous
124
220
  # Calculates hash code according to all attributes.
125
221
  # @return [Integer] Hash code
126
222
  def hash
127
- [po_number, amount, memo].hash
223
+ [amount, campaign_id, created_at, delivered_at, delivery_method, order_id, order_status, status].hash
128
224
  end
129
225
 
130
226
  # Builds the object from hash