tremendous_ruby 5.6.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.
@@ -0,0 +1,226 @@
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
+ # Amount of the rewards returned in the report
18
+ class CreateReportRequestFiltersDigitalRewardsAmount
19
+ # Minimum amount of the rewards that should be returned in the report
20
+ attr_accessor :gte
21
+
22
+ # Maximum amount of the rewards that should be returned in the report
23
+ attr_accessor :lte
24
+
25
+ # Attribute mapping from ruby-style variable name to JSON key.
26
+ def self.attribute_map
27
+ {
28
+ :'gte' => :'gte',
29
+ :'lte' => :'lte'
30
+ }
31
+ end
32
+
33
+ # Returns all the JSON keys this model knows about
34
+ def self.acceptable_attributes
35
+ attribute_map.values
36
+ end
37
+
38
+ # Attribute type mapping.
39
+ def self.openapi_types
40
+ {
41
+ :'gte' => :'Float',
42
+ :'lte' => :'Float'
43
+ }
44
+ end
45
+
46
+ # List of attributes with nullable: true
47
+ def self.openapi_nullable
48
+ Set.new([
49
+ ])
50
+ end
51
+
52
+ # Initializes the object
53
+ # @param [Hash] attributes Model attributes in the form of hash
54
+ def initialize(attributes = {})
55
+ if (!attributes.is_a?(Hash))
56
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Tremendous::CreateReportRequestFiltersDigitalRewardsAmount` initialize method"
57
+ end
58
+
59
+ # check to see if the attribute exists and convert string to symbol for hash key
60
+ attributes = attributes.each_with_object({}) { |(k, v), h|
61
+ if (!self.class.attribute_map.key?(k.to_sym))
62
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Tremendous::CreateReportRequestFiltersDigitalRewardsAmount`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
63
+ end
64
+ h[k.to_sym] = v
65
+ }
66
+
67
+ if attributes.key?(:'gte')
68
+ self.gte = attributes[:'gte']
69
+ end
70
+
71
+ if attributes.key?(:'lte')
72
+ self.lte = attributes[:'lte']
73
+ end
74
+ end
75
+
76
+ # Show invalid properties with the reasons. Usually used together with valid?
77
+ # @return Array for valid properties with the reasons
78
+ def list_invalid_properties
79
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
80
+ invalid_properties = Array.new
81
+ invalid_properties
82
+ end
83
+
84
+ # Check to see if the all the properties in the model are valid
85
+ # @return true if the model is valid
86
+ def valid?
87
+ warn '[DEPRECATED] the `valid?` method is obsolete'
88
+ true
89
+ end
90
+
91
+ # Checks equality by comparing each attribute.
92
+ # @param [Object] Object to be compared
93
+ def ==(o)
94
+ return true if self.equal?(o)
95
+ self.class == o.class &&
96
+ gte == o.gte &&
97
+ lte == o.lte
98
+ end
99
+
100
+ # @see the `==` method
101
+ # @param [Object] Object to be compared
102
+ def eql?(o)
103
+ self == o
104
+ end
105
+
106
+ # Calculates hash code according to all attributes.
107
+ # @return [Integer] Hash code
108
+ def hash
109
+ [gte, lte].hash
110
+ end
111
+
112
+ # Builds the object from hash
113
+ # @param [Hash] attributes Model attributes in the form of hash
114
+ # @return [Object] Returns the model itself
115
+ def self.build_from_hash(attributes)
116
+ return nil unless attributes.is_a?(Hash)
117
+ attributes = attributes.transform_keys(&:to_sym)
118
+ transformed_hash = {}
119
+ openapi_types.each_pair do |key, type|
120
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
121
+ transformed_hash["#{key}"] = nil
122
+ elsif type =~ /\AArray<(.*)>/i
123
+ # check to ensure the input is an array given that the attribute
124
+ # is documented as an array but the input is not
125
+ if attributes[attribute_map[key]].is_a?(Array)
126
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
127
+ end
128
+ elsif !attributes[attribute_map[key]].nil?
129
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
130
+ end
131
+ end
132
+ new(transformed_hash)
133
+ end
134
+
135
+ # Deserializes the data based on type
136
+ # @param string type Data type
137
+ # @param string value Value to be deserialized
138
+ # @return [Object] Deserialized data
139
+ def self._deserialize(type, value)
140
+ case type.to_sym
141
+ when :Time
142
+ Time.parse(value)
143
+ when :Date
144
+ Date.parse(value)
145
+ when :String
146
+ value.to_s
147
+ when :Integer
148
+ value.to_i
149
+ when :Float
150
+ value.to_f
151
+ when :Boolean
152
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
153
+ true
154
+ else
155
+ false
156
+ end
157
+ when :Object
158
+ # generic object (usually a Hash), return directly
159
+ value
160
+ when /\AArray<(?<inner_type>.+)>\z/
161
+ inner_type = Regexp.last_match[:inner_type]
162
+ value.map { |v| _deserialize(inner_type, v) }
163
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
164
+ k_type = Regexp.last_match[:k_type]
165
+ v_type = Regexp.last_match[:v_type]
166
+ {}.tap do |hash|
167
+ value.each do |k, v|
168
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
169
+ end
170
+ end
171
+ else # model
172
+ # models (e.g. Pet) or oneOf
173
+ klass = Tremendous.const_get(type)
174
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
175
+ end
176
+ end
177
+
178
+ # Returns the string representation of the object
179
+ # @return [String] String presentation of the object
180
+ def to_s
181
+ to_hash.to_s
182
+ end
183
+
184
+ # to_body is an alias to to_hash (backward compatibility)
185
+ # @return [Hash] Returns the object in the form of hash
186
+ def to_body
187
+ to_hash
188
+ end
189
+
190
+ # Returns the object in the form of hash
191
+ # @return [Hash] Returns the object in the form of hash
192
+ def to_hash
193
+ hash = {}
194
+ self.class.attribute_map.each_pair do |attr, param|
195
+ value = self.send(attr)
196
+ if value.nil?
197
+ is_nullable = self.class.openapi_nullable.include?(attr)
198
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
199
+ end
200
+
201
+ hash[param] = _to_hash(value)
202
+ end
203
+ hash
204
+ end
205
+
206
+ # Outputs non-array value in the form of hash
207
+ # For object, use to_hash. Otherwise, just return the value
208
+ # @param [Object] value Any valid value
209
+ # @return [Hash] Returns the value in the form of hash
210
+ def _to_hash(value)
211
+ if value.is_a?(Array)
212
+ value.compact.map { |v| _to_hash(v) }
213
+ elsif value.is_a?(Hash)
214
+ {}.tap do |hash|
215
+ value.each { |k, v| hash[k] = _to_hash(v) }
216
+ end
217
+ elsif value.respond_to? :to_hash
218
+ value.to_hash
219
+ else
220
+ value
221
+ end
222
+ end
223
+
224
+ end
225
+
226
+ end
@@ -0,0 +1,226 @@
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
+ # Creation dates of rewards returned in the report
18
+ class CreateReportRequestFiltersDigitalRewardsCreatedAt
19
+ # Minimum date the reward was created
20
+ attr_accessor :gte
21
+
22
+ # Maximum date the reward was created
23
+ attr_accessor :lte
24
+
25
+ # Attribute mapping from ruby-style variable name to JSON key.
26
+ def self.attribute_map
27
+ {
28
+ :'gte' => :'gte',
29
+ :'lte' => :'lte'
30
+ }
31
+ end
32
+
33
+ # Returns all the JSON keys this model knows about
34
+ def self.acceptable_attributes
35
+ attribute_map.values
36
+ end
37
+
38
+ # Attribute type mapping.
39
+ def self.openapi_types
40
+ {
41
+ :'gte' => :'Date',
42
+ :'lte' => :'Date'
43
+ }
44
+ end
45
+
46
+ # List of attributes with nullable: true
47
+ def self.openapi_nullable
48
+ Set.new([
49
+ ])
50
+ end
51
+
52
+ # Initializes the object
53
+ # @param [Hash] attributes Model attributes in the form of hash
54
+ def initialize(attributes = {})
55
+ if (!attributes.is_a?(Hash))
56
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Tremendous::CreateReportRequestFiltersDigitalRewardsCreatedAt` initialize method"
57
+ end
58
+
59
+ # check to see if the attribute exists and convert string to symbol for hash key
60
+ attributes = attributes.each_with_object({}) { |(k, v), h|
61
+ if (!self.class.attribute_map.key?(k.to_sym))
62
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Tremendous::CreateReportRequestFiltersDigitalRewardsCreatedAt`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
63
+ end
64
+ h[k.to_sym] = v
65
+ }
66
+
67
+ if attributes.key?(:'gte')
68
+ self.gte = attributes[:'gte']
69
+ end
70
+
71
+ if attributes.key?(:'lte')
72
+ self.lte = attributes[:'lte']
73
+ end
74
+ end
75
+
76
+ # Show invalid properties with the reasons. Usually used together with valid?
77
+ # @return Array for valid properties with the reasons
78
+ def list_invalid_properties
79
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
80
+ invalid_properties = Array.new
81
+ invalid_properties
82
+ end
83
+
84
+ # Check to see if the all the properties in the model are valid
85
+ # @return true if the model is valid
86
+ def valid?
87
+ warn '[DEPRECATED] the `valid?` method is obsolete'
88
+ true
89
+ end
90
+
91
+ # Checks equality by comparing each attribute.
92
+ # @param [Object] Object to be compared
93
+ def ==(o)
94
+ return true if self.equal?(o)
95
+ self.class == o.class &&
96
+ gte == o.gte &&
97
+ lte == o.lte
98
+ end
99
+
100
+ # @see the `==` method
101
+ # @param [Object] Object to be compared
102
+ def eql?(o)
103
+ self == o
104
+ end
105
+
106
+ # Calculates hash code according to all attributes.
107
+ # @return [Integer] Hash code
108
+ def hash
109
+ [gte, lte].hash
110
+ end
111
+
112
+ # Builds the object from hash
113
+ # @param [Hash] attributes Model attributes in the form of hash
114
+ # @return [Object] Returns the model itself
115
+ def self.build_from_hash(attributes)
116
+ return nil unless attributes.is_a?(Hash)
117
+ attributes = attributes.transform_keys(&:to_sym)
118
+ transformed_hash = {}
119
+ openapi_types.each_pair do |key, type|
120
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
121
+ transformed_hash["#{key}"] = nil
122
+ elsif type =~ /\AArray<(.*)>/i
123
+ # check to ensure the input is an array given that the attribute
124
+ # is documented as an array but the input is not
125
+ if attributes[attribute_map[key]].is_a?(Array)
126
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
127
+ end
128
+ elsif !attributes[attribute_map[key]].nil?
129
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
130
+ end
131
+ end
132
+ new(transformed_hash)
133
+ end
134
+
135
+ # Deserializes the data based on type
136
+ # @param string type Data type
137
+ # @param string value Value to be deserialized
138
+ # @return [Object] Deserialized data
139
+ def self._deserialize(type, value)
140
+ case type.to_sym
141
+ when :Time
142
+ Time.parse(value)
143
+ when :Date
144
+ Date.parse(value)
145
+ when :String
146
+ value.to_s
147
+ when :Integer
148
+ value.to_i
149
+ when :Float
150
+ value.to_f
151
+ when :Boolean
152
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
153
+ true
154
+ else
155
+ false
156
+ end
157
+ when :Object
158
+ # generic object (usually a Hash), return directly
159
+ value
160
+ when /\AArray<(?<inner_type>.+)>\z/
161
+ inner_type = Regexp.last_match[:inner_type]
162
+ value.map { |v| _deserialize(inner_type, v) }
163
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
164
+ k_type = Regexp.last_match[:k_type]
165
+ v_type = Regexp.last_match[:v_type]
166
+ {}.tap do |hash|
167
+ value.each do |k, v|
168
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
169
+ end
170
+ end
171
+ else # model
172
+ # models (e.g. Pet) or oneOf
173
+ klass = Tremendous.const_get(type)
174
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
175
+ end
176
+ end
177
+
178
+ # Returns the string representation of the object
179
+ # @return [String] String presentation of the object
180
+ def to_s
181
+ to_hash.to_s
182
+ end
183
+
184
+ # to_body is an alias to to_hash (backward compatibility)
185
+ # @return [Hash] Returns the object in the form of hash
186
+ def to_body
187
+ to_hash
188
+ end
189
+
190
+ # Returns the object in the form of hash
191
+ # @return [Hash] Returns the object in the form of hash
192
+ def to_hash
193
+ hash = {}
194
+ self.class.attribute_map.each_pair do |attr, param|
195
+ value = self.send(attr)
196
+ if value.nil?
197
+ is_nullable = self.class.openapi_nullable.include?(attr)
198
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
199
+ end
200
+
201
+ hash[param] = _to_hash(value)
202
+ end
203
+ hash
204
+ end
205
+
206
+ # Outputs non-array value in the form of hash
207
+ # For object, use to_hash. Otherwise, just return the value
208
+ # @param [Object] value Any valid value
209
+ # @return [Hash] Returns the value in the form of hash
210
+ def _to_hash(value)
211
+ if value.is_a?(Array)
212
+ value.compact.map { |v| _to_hash(v) }
213
+ elsif value.is_a?(Hash)
214
+ {}.tap do |hash|
215
+ value.each { |k, v| hash[k] = _to_hash(v) }
216
+ end
217
+ elsif value.respond_to? :to_hash
218
+ value.to_hash
219
+ else
220
+ value
221
+ end
222
+ end
223
+
224
+ end
225
+
226
+ end
@@ -48,9 +48,17 @@ module Tremendous
48
48
  # **Only available when `method` is set to `credit_card`.** Is this credit card expired
49
49
  attr_accessor :expired
50
50
 
51
+ # **Only available when `method` is set to `credit_card`.** Year part of card's expiration date
52
+ attr_accessor :year
53
+
54
+ # **Only available when `method` is set to `credit_card`.** Month part of card's expiration date
55
+ attr_accessor :month
56
+
51
57
  # **Only available when `method` is set to `bank_account` or `credit_card`.** Point in time when the last order failed using this bank account or credit card as a funding source.
52
58
  attr_accessor :last_payment_failed_at
53
59
 
60
+ attr_accessor :failure_details
61
+
54
62
  class EnumAttributeValidator
55
63
  attr_reader :datatype
56
64
  attr_reader :allowable_values
@@ -87,7 +95,10 @@ module Tremendous
87
95
  :'network' => :'network',
88
96
  :'last4' => :'last4',
89
97
  :'expired' => :'expired',
90
- :'last_payment_failed_at' => :'last_payment_failed_at'
98
+ :'year' => :'year',
99
+ :'month' => :'month',
100
+ :'last_payment_failed_at' => :'last_payment_failed_at',
101
+ :'failure_details' => :'failure_details'
91
102
  }
92
103
  end
93
104
 
@@ -110,7 +121,10 @@ module Tremendous
110
121
  :'network' => :'String',
111
122
  :'last4' => :'String',
112
123
  :'expired' => :'Boolean',
113
- :'last_payment_failed_at' => :'Time'
124
+ :'year' => :'String',
125
+ :'month' => :'String',
126
+ :'last_payment_failed_at' => :'Time',
127
+ :'failure_details' => :'ListFundingSources200ResponseFundingSourcesInnerMetaFailureDetails'
114
128
  }
115
129
  end
116
130
 
@@ -118,7 +132,8 @@ module Tremendous
118
132
  def self.openapi_nullable
119
133
  Set.new([
120
134
  :'bank_name',
121
- :'last_payment_failed_at'
135
+ :'last_payment_failed_at',
136
+ :'failure_details'
122
137
  ])
123
138
  end
124
139
 
@@ -181,9 +196,21 @@ module Tremendous
181
196
  self.expired = attributes[:'expired']
182
197
  end
183
198
 
199
+ if attributes.key?(:'year')
200
+ self.year = attributes[:'year']
201
+ end
202
+
203
+ if attributes.key?(:'month')
204
+ self.month = attributes[:'month']
205
+ end
206
+
184
207
  if attributes.key?(:'last_payment_failed_at')
185
208
  self.last_payment_failed_at = attributes[:'last_payment_failed_at']
186
209
  end
210
+
211
+ if attributes.key?(:'failure_details')
212
+ self.failure_details = attributes[:'failure_details']
213
+ end
187
214
  end
188
215
 
189
216
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -217,7 +244,7 @@ module Tremendous
217
244
  return false unless account_type_validator.valid?(@account_type)
218
245
  return false if !@account_number_mask.nil? && @account_number_mask !~ Regexp.new(/[0-9]{4}/)
219
246
  return false if !@account_routing_mask.nil? && @account_routing_mask !~ Regexp.new(/[0-9]{4}/)
220
- network_validator = EnumAttributeValidator.new('String', ["MasterCard", "Amex", "JCB", "Diner's Club", "visa", "discover", "laser", "elo", "maestro", "solo"])
247
+ network_validator = EnumAttributeValidator.new('String', ["MasterCard", "Amex", "JCB", "Diner's Club", "Visa", "Discover", "Laser", "Elo", "Maestro", "Solo"])
221
248
  return false unless network_validator.valid?(@network)
222
249
  return false if !@last4.nil? && @last4 !~ Regexp.new(/[0-9]{4}/)
223
250
  true
@@ -266,7 +293,7 @@ module Tremendous
266
293
  # Custom attribute writer method checking allowed values (enum).
267
294
  # @param [Object] network Object to be assigned
268
295
  def network=(network)
269
- validator = EnumAttributeValidator.new('String', ["MasterCard", "Amex", "JCB", "Diner's Club", "visa", "discover", "laser", "elo", "maestro", "solo"])
296
+ validator = EnumAttributeValidator.new('String', ["MasterCard", "Amex", "JCB", "Diner's Club", "Visa", "Discover", "Laser", "Elo", "Maestro", "Solo"])
270
297
  unless validator.valid?(network)
271
298
  fail ArgumentError, "invalid value for \"network\", must be one of #{validator.allowable_values}."
272
299
  end
@@ -304,7 +331,10 @@ module Tremendous
304
331
  network == o.network &&
305
332
  last4 == o.last4 &&
306
333
  expired == o.expired &&
307
- last_payment_failed_at == o.last_payment_failed_at
334
+ year == o.year &&
335
+ month == o.month &&
336
+ last_payment_failed_at == o.last_payment_failed_at &&
337
+ failure_details == o.failure_details
308
338
  end
309
339
 
310
340
  # @see the `==` method
@@ -316,7 +346,7 @@ module Tremendous
316
346
  # Calculates hash code according to all attributes.
317
347
  # @return [Integer] Hash code
318
348
  def hash
319
- [available_cents, pending_cents, accountholder_name, account_type, bank_name, account_number_mask, account_routing_mask, refundable, network, last4, expired, last_payment_failed_at].hash
349
+ [available_cents, pending_cents, accountholder_name, account_type, bank_name, account_number_mask, account_routing_mask, refundable, network, last4, expired, year, month, last_payment_failed_at, failure_details].hash
320
350
  end
321
351
 
322
352
  # Builds the object from hash