tremendous_ruby 5.9.0 → 5.10.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 (40) hide show
  1. checksums.yaml +4 -4
  2. data/lib/tremendous/api/tremendous_api.rb +522 -53
  3. data/lib/tremendous/models/connected_organization.rb +287 -0
  4. data/lib/tremendous/models/connected_organization_member.rb +330 -0
  5. data/lib/tremendous/models/connected_organization_member_member.rb +366 -0
  6. data/lib/tremendous/models/connected_organization_member_session.rb +311 -0
  7. data/lib/tremendous/models/connected_organization_organization.rb +324 -0
  8. data/lib/tremendous/models/create_campaign200_response.rb +221 -0
  9. data/lib/tremendous/models/create_connected_organization200_response.rb +221 -0
  10. data/lib/tremendous/models/create_connected_organization_member200_response.rb +221 -0
  11. data/lib/tremendous/models/create_connected_organization_member_request.rb +222 -0
  12. data/lib/tremendous/models/create_connected_organization_member_session200_response.rb +221 -0
  13. data/lib/tremendous/models/create_connected_organization_member_session200_response_connected_organization_member_session.rb +311 -0
  14. data/lib/tremendous/models/create_connected_organization_member_session_request.rb +222 -0
  15. data/lib/tremendous/models/create_connected_organization_request.rb +222 -0
  16. data/lib/tremendous/models/create_order200_response_order_rewards_inner_delivery.rb +1 -1
  17. data/lib/tremendous/models/create_organization_request_copy_settings.rb +16 -4
  18. data/lib/tremendous/models/create_report200_response.rb +231 -0
  19. data/lib/tremendous/models/create_report200_response_report.rb +291 -0
  20. data/lib/tremendous/models/delivery_details.rb +1 -1
  21. data/lib/tremendous/models/delivery_details_with_link.rb +1 -1
  22. data/lib/tremendous/models/funding_source.rb +35 -1
  23. data/lib/tremendous/models/list_connected_organization_members200_response.rb +240 -0
  24. data/lib/tremendous/models/list_connected_organization_members200_response_connected_organization_members_inner.rb +330 -0
  25. data/lib/tremendous/models/list_connected_organization_members200_response_connected_organization_members_inner_member.rb +366 -0
  26. data/lib/tremendous/models/list_connected_organizations200_response.rb +240 -0
  27. data/lib/tremendous/models/list_connected_organizations200_response_connected_organizations_inner.rb +287 -0
  28. data/lib/tremendous/models/list_connected_organizations200_response_connected_organizations_inner_organization.rb +324 -0
  29. data/lib/tremendous/models/list_funding_sources200_response_funding_sources_inner.rb +35 -1
  30. data/lib/tremendous/models/list_products_response_products_inner.rb +27 -7
  31. data/lib/tremendous/models/list_products_response_products_inner_documents.rb +236 -0
  32. data/lib/tremendous/models/list_products_response_products_inner_images_inner.rb +15 -4
  33. data/lib/tremendous/models/list_rewards200_response_rewards_inner_delivery.rb +1 -1
  34. data/lib/tremendous/models/product.rb +27 -7
  35. data/lib/tremendous/models/product_documents.rb +236 -0
  36. data/lib/tremendous/models/reward_with_link_delivery.rb +1 -1
  37. data/lib/tremendous/models/reward_without_link_delivery.rb +1 -1
  38. data/lib/tremendous/version.rb +1 -1
  39. data/lib/tremendous.rb +23 -5
  40. metadata +26 -7
@@ -0,0 +1,221 @@
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 its 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 CreateConnectedOrganizationMemberSession200Response
18
+ attr_accessor :connected_organization_member_session
19
+
20
+ # Attribute mapping from ruby-style variable name to JSON key.
21
+ def self.attribute_map
22
+ {
23
+ :'connected_organization_member_session' => :'connected_organization_member_session'
24
+ }
25
+ end
26
+
27
+ # Returns all the JSON keys this model knows about
28
+ def self.acceptable_attributes
29
+ attribute_map.values
30
+ end
31
+
32
+ # Attribute type mapping.
33
+ def self.openapi_types
34
+ {
35
+ :'connected_organization_member_session' => :'CreateConnectedOrganizationMemberSession200ResponseConnectedOrganizationMemberSession'
36
+ }
37
+ end
38
+
39
+ # List of attributes with nullable: true
40
+ def self.openapi_nullable
41
+ Set.new([
42
+ ])
43
+ end
44
+
45
+ # Initializes the object
46
+ # @param [Hash] attributes Model attributes in the form of hash
47
+ def initialize(attributes = {})
48
+ if (!attributes.is_a?(Hash))
49
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Tremendous::CreateConnectedOrganizationMemberSession200Response` initialize method"
50
+ end
51
+
52
+ # check to see if the attribute exists and convert string to symbol for hash key
53
+ attributes = attributes.each_with_object({}) { |(k, v), h|
54
+ if (!self.class.attribute_map.key?(k.to_sym))
55
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Tremendous::CreateConnectedOrganizationMemberSession200Response`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
56
+ end
57
+ h[k.to_sym] = v
58
+ }
59
+
60
+ if attributes.key?(:'connected_organization_member_session')
61
+ self.connected_organization_member_session = attributes[:'connected_organization_member_session']
62
+ else
63
+ self.connected_organization_member_session = nil
64
+ end
65
+ end
66
+
67
+ # Show invalid properties with the reasons. Usually used together with valid?
68
+ # @return Array for valid properties with the reasons
69
+ def list_invalid_properties
70
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
71
+ invalid_properties = Array.new
72
+ if @connected_organization_member_session.nil?
73
+ invalid_properties.push('invalid value for "connected_organization_member_session", connected_organization_member_session cannot be nil.')
74
+ end
75
+
76
+ invalid_properties
77
+ end
78
+
79
+ # Check to see if the all the properties in the model are valid
80
+ # @return true if the model is valid
81
+ def valid?
82
+ warn '[DEPRECATED] the `valid?` method is obsolete'
83
+ return false if @connected_organization_member_session.nil?
84
+ true
85
+ end
86
+
87
+ # Checks equality by comparing each attribute.
88
+ # @param [Object] Object to be compared
89
+ def ==(o)
90
+ return true if self.equal?(o)
91
+ self.class == o.class &&
92
+ connected_organization_member_session == o.connected_organization_member_session
93
+ end
94
+
95
+ # @see the `==` method
96
+ # @param [Object] Object to be compared
97
+ def eql?(o)
98
+ self == o
99
+ end
100
+
101
+ # Calculates hash code according to all attributes.
102
+ # @return [Integer] Hash code
103
+ def hash
104
+ [connected_organization_member_session].hash
105
+ end
106
+
107
+ # Builds the object from hash
108
+ # @param [Hash] attributes Model attributes in the form of hash
109
+ # @return [Object] Returns the model itself
110
+ def self.build_from_hash(attributes)
111
+ return nil unless attributes.is_a?(Hash)
112
+ attributes = attributes.transform_keys(&:to_sym)
113
+ transformed_hash = {}
114
+ openapi_types.each_pair do |key, type|
115
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
116
+ transformed_hash["#{key}"] = nil
117
+ elsif type =~ /\AArray<(.*)>/i
118
+ # check to ensure the input is an array given that the attribute
119
+ # is documented as an array but the input is not
120
+ if attributes[attribute_map[key]].is_a?(Array)
121
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
122
+ end
123
+ elsif !attributes[attribute_map[key]].nil?
124
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
125
+ end
126
+ end
127
+ new(transformed_hash)
128
+ end
129
+
130
+ # Deserializes the data based on type
131
+ # @param string type Data type
132
+ # @param string value Value to be deserialized
133
+ # @return [Object] Deserialized data
134
+ def self._deserialize(type, value)
135
+ case type.to_sym
136
+ when :Time
137
+ Time.parse(value)
138
+ when :Date
139
+ Date.parse(value)
140
+ when :String
141
+ value.to_s
142
+ when :Integer
143
+ value.to_i
144
+ when :Float
145
+ value.to_f
146
+ when :Boolean
147
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
148
+ true
149
+ else
150
+ false
151
+ end
152
+ when :Object
153
+ # generic object (usually a Hash), return directly
154
+ value
155
+ when /\AArray<(?<inner_type>.+)>\z/
156
+ inner_type = Regexp.last_match[:inner_type]
157
+ value.map { |v| _deserialize(inner_type, v) }
158
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
159
+ k_type = Regexp.last_match[:k_type]
160
+ v_type = Regexp.last_match[:v_type]
161
+ {}.tap do |hash|
162
+ value.each do |k, v|
163
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
164
+ end
165
+ end
166
+ else # model
167
+ # models (e.g. Pet) or oneOf
168
+ klass = Tremendous.const_get(type)
169
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
170
+ end
171
+ end
172
+
173
+ # Returns the string representation of the object
174
+ # @return [String] String presentation of the object
175
+ def to_s
176
+ to_hash.to_s
177
+ end
178
+
179
+ # to_body is an alias to to_hash (backward compatibility)
180
+ # @return [Hash] Returns the object in the form of hash
181
+ def to_body
182
+ to_hash
183
+ end
184
+
185
+ # Returns the object in the form of hash
186
+ # @return [Hash] Returns the object in the form of hash
187
+ def to_hash
188
+ hash = {}
189
+ self.class.attribute_map.each_pair do |attr, param|
190
+ value = self.send(attr)
191
+ if value.nil?
192
+ is_nullable = self.class.openapi_nullable.include?(attr)
193
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
194
+ end
195
+
196
+ hash[param] = _to_hash(value)
197
+ end
198
+ hash
199
+ end
200
+
201
+ # Outputs non-array value in the form of hash
202
+ # For object, use to_hash. Otherwise, just return the value
203
+ # @param [Object] value Any valid value
204
+ # @return [Hash] Returns the value in the form of hash
205
+ def _to_hash(value)
206
+ if value.is_a?(Array)
207
+ value.compact.map { |v| _to_hash(v) }
208
+ elsif value.is_a?(Hash)
209
+ {}.tap do |hash|
210
+ value.each { |k, v| hash[k] = _to_hash(v) }
211
+ end
212
+ elsif value.respond_to? :to_hash
213
+ value.to_hash
214
+ else
215
+ value
216
+ end
217
+ end
218
+
219
+ end
220
+
221
+ end
@@ -0,0 +1,311 @@
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 its 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 CreateConnectedOrganizationMemberSession200ResponseConnectedOrganizationMemberSession
18
+ # Tremendous' identifier for the connected organization member.
19
+ attr_accessor :connected_organization_member_id
20
+
21
+ # The URL to start the \"Tremendous for Platforms\" flow.
22
+ attr_accessor :url
23
+
24
+ # The URL used for links that redirect the user back to your site when they've completed their actions on Tremendous.
25
+ attr_accessor :return_url
26
+
27
+ # Timestamp of when the session will expire.
28
+ attr_accessor :expires_at
29
+
30
+ # Timestamp of when the session was created.
31
+ attr_accessor :created_at
32
+
33
+ # Attribute mapping from ruby-style variable name to JSON key.
34
+ def self.attribute_map
35
+ {
36
+ :'connected_organization_member_id' => :'connected_organization_member_id',
37
+ :'url' => :'url',
38
+ :'return_url' => :'return_url',
39
+ :'expires_at' => :'expires_at',
40
+ :'created_at' => :'created_at'
41
+ }
42
+ end
43
+
44
+ # Returns all the JSON keys this model knows about
45
+ def self.acceptable_attributes
46
+ attribute_map.values
47
+ end
48
+
49
+ # Attribute type mapping.
50
+ def self.openapi_types
51
+ {
52
+ :'connected_organization_member_id' => :'String',
53
+ :'url' => :'String',
54
+ :'return_url' => :'String',
55
+ :'expires_at' => :'Time',
56
+ :'created_at' => :'Time'
57
+ }
58
+ end
59
+
60
+ # List of attributes with nullable: true
61
+ def self.openapi_nullable
62
+ Set.new([
63
+ ])
64
+ end
65
+
66
+ # Initializes the object
67
+ # @param [Hash] attributes Model attributes in the form of hash
68
+ def initialize(attributes = {})
69
+ if (!attributes.is_a?(Hash))
70
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Tremendous::CreateConnectedOrganizationMemberSession200ResponseConnectedOrganizationMemberSession` initialize method"
71
+ end
72
+
73
+ # check to see if the attribute exists and convert string to symbol for hash key
74
+ attributes = attributes.each_with_object({}) { |(k, v), h|
75
+ if (!self.class.attribute_map.key?(k.to_sym))
76
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Tremendous::CreateConnectedOrganizationMemberSession200ResponseConnectedOrganizationMemberSession`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
77
+ end
78
+ h[k.to_sym] = v
79
+ }
80
+
81
+ if attributes.key?(:'connected_organization_member_id')
82
+ self.connected_organization_member_id = attributes[:'connected_organization_member_id']
83
+ else
84
+ self.connected_organization_member_id = nil
85
+ end
86
+
87
+ if attributes.key?(:'url')
88
+ self.url = attributes[:'url']
89
+ else
90
+ self.url = nil
91
+ end
92
+
93
+ if attributes.key?(:'return_url')
94
+ self.return_url = attributes[:'return_url']
95
+ else
96
+ self.return_url = nil
97
+ end
98
+
99
+ if attributes.key?(:'expires_at')
100
+ self.expires_at = attributes[:'expires_at']
101
+ else
102
+ self.expires_at = nil
103
+ end
104
+
105
+ if attributes.key?(:'created_at')
106
+ self.created_at = attributes[:'created_at']
107
+ else
108
+ self.created_at = nil
109
+ end
110
+ end
111
+
112
+ # Show invalid properties with the reasons. Usually used together with valid?
113
+ # @return Array for valid properties with the reasons
114
+ def list_invalid_properties
115
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
116
+ invalid_properties = Array.new
117
+ if @connected_organization_member_id.nil?
118
+ invalid_properties.push('invalid value for "connected_organization_member_id", connected_organization_member_id cannot be nil.')
119
+ end
120
+
121
+ pattern = Regexp.new(/[A-Z0-9]{4,20}/)
122
+ if @connected_organization_member_id !~ pattern
123
+ invalid_properties.push("invalid value for \"connected_organization_member_id\", must conform to the pattern #{pattern}.")
124
+ end
125
+
126
+ if @url.nil?
127
+ invalid_properties.push('invalid value for "url", url cannot be nil.')
128
+ end
129
+
130
+ if @return_url.nil?
131
+ invalid_properties.push('invalid value for "return_url", return_url cannot be nil.')
132
+ end
133
+
134
+ if @expires_at.nil?
135
+ invalid_properties.push('invalid value for "expires_at", expires_at cannot be nil.')
136
+ end
137
+
138
+ if @created_at.nil?
139
+ invalid_properties.push('invalid value for "created_at", created_at cannot be nil.')
140
+ end
141
+
142
+ invalid_properties
143
+ end
144
+
145
+ # Check to see if the all the properties in the model are valid
146
+ # @return true if the model is valid
147
+ def valid?
148
+ warn '[DEPRECATED] the `valid?` method is obsolete'
149
+ return false if @connected_organization_member_id.nil?
150
+ return false if @connected_organization_member_id !~ Regexp.new(/[A-Z0-9]{4,20}/)
151
+ return false if @url.nil?
152
+ return false if @return_url.nil?
153
+ return false if @expires_at.nil?
154
+ return false if @created_at.nil?
155
+ true
156
+ end
157
+
158
+ # Custom attribute writer method with validation
159
+ # @param [Object] connected_organization_member_id Value to be assigned
160
+ def connected_organization_member_id=(connected_organization_member_id)
161
+ if connected_organization_member_id.nil?
162
+ fail ArgumentError, 'connected_organization_member_id cannot be nil'
163
+ end
164
+
165
+ pattern = Regexp.new(/[A-Z0-9]{4,20}/)
166
+ if connected_organization_member_id !~ pattern
167
+ fail ArgumentError, "invalid value for \"connected_organization_member_id\", must conform to the pattern #{pattern}."
168
+ end
169
+
170
+ @connected_organization_member_id = connected_organization_member_id
171
+ end
172
+
173
+ # Checks equality by comparing each attribute.
174
+ # @param [Object] Object to be compared
175
+ def ==(o)
176
+ return true if self.equal?(o)
177
+ self.class == o.class &&
178
+ connected_organization_member_id == o.connected_organization_member_id &&
179
+ url == o.url &&
180
+ return_url == o.return_url &&
181
+ expires_at == o.expires_at &&
182
+ created_at == o.created_at
183
+ end
184
+
185
+ # @see the `==` method
186
+ # @param [Object] Object to be compared
187
+ def eql?(o)
188
+ self == o
189
+ end
190
+
191
+ # Calculates hash code according to all attributes.
192
+ # @return [Integer] Hash code
193
+ def hash
194
+ [connected_organization_member_id, url, return_url, expires_at, created_at].hash
195
+ end
196
+
197
+ # Builds the object from hash
198
+ # @param [Hash] attributes Model attributes in the form of hash
199
+ # @return [Object] Returns the model itself
200
+ def self.build_from_hash(attributes)
201
+ return nil unless attributes.is_a?(Hash)
202
+ attributes = attributes.transform_keys(&:to_sym)
203
+ transformed_hash = {}
204
+ openapi_types.each_pair do |key, type|
205
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
206
+ transformed_hash["#{key}"] = nil
207
+ elsif type =~ /\AArray<(.*)>/i
208
+ # check to ensure the input is an array given that the attribute
209
+ # is documented as an array but the input is not
210
+ if attributes[attribute_map[key]].is_a?(Array)
211
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
212
+ end
213
+ elsif !attributes[attribute_map[key]].nil?
214
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
215
+ end
216
+ end
217
+ new(transformed_hash)
218
+ end
219
+
220
+ # Deserializes the data based on type
221
+ # @param string type Data type
222
+ # @param string value Value to be deserialized
223
+ # @return [Object] Deserialized data
224
+ def self._deserialize(type, value)
225
+ case type.to_sym
226
+ when :Time
227
+ Time.parse(value)
228
+ when :Date
229
+ Date.parse(value)
230
+ when :String
231
+ value.to_s
232
+ when :Integer
233
+ value.to_i
234
+ when :Float
235
+ value.to_f
236
+ when :Boolean
237
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
238
+ true
239
+ else
240
+ false
241
+ end
242
+ when :Object
243
+ # generic object (usually a Hash), return directly
244
+ value
245
+ when /\AArray<(?<inner_type>.+)>\z/
246
+ inner_type = Regexp.last_match[:inner_type]
247
+ value.map { |v| _deserialize(inner_type, v) }
248
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
249
+ k_type = Regexp.last_match[:k_type]
250
+ v_type = Regexp.last_match[:v_type]
251
+ {}.tap do |hash|
252
+ value.each do |k, v|
253
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
254
+ end
255
+ end
256
+ else # model
257
+ # models (e.g. Pet) or oneOf
258
+ klass = Tremendous.const_get(type)
259
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
260
+ end
261
+ end
262
+
263
+ # Returns the string representation of the object
264
+ # @return [String] String presentation of the object
265
+ def to_s
266
+ to_hash.to_s
267
+ end
268
+
269
+ # to_body is an alias to to_hash (backward compatibility)
270
+ # @return [Hash] Returns the object in the form of hash
271
+ def to_body
272
+ to_hash
273
+ end
274
+
275
+ # Returns the object in the form of hash
276
+ # @return [Hash] Returns the object in the form of hash
277
+ def to_hash
278
+ hash = {}
279
+ self.class.attribute_map.each_pair do |attr, param|
280
+ value = self.send(attr)
281
+ if value.nil?
282
+ is_nullable = self.class.openapi_nullable.include?(attr)
283
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
284
+ end
285
+
286
+ hash[param] = _to_hash(value)
287
+ end
288
+ hash
289
+ end
290
+
291
+ # Outputs non-array value in the form of hash
292
+ # For object, use to_hash. Otherwise, just return the value
293
+ # @param [Object] value Any valid value
294
+ # @return [Hash] Returns the value in the form of hash
295
+ def _to_hash(value)
296
+ if value.is_a?(Array)
297
+ value.compact.map { |v| _to_hash(v) }
298
+ elsif value.is_a?(Hash)
299
+ {}.tap do |hash|
300
+ value.each { |k, v| hash[k] = _to_hash(v) }
301
+ end
302
+ elsif value.respond_to? :to_hash
303
+ value.to_hash
304
+ else
305
+ value
306
+ end
307
+ end
308
+
309
+ end
310
+
311
+ end