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.
- checksums.yaml +4 -4
- data/lib/tremendous/api/tremendous_api.rb +522 -53
- data/lib/tremendous/models/connected_organization.rb +287 -0
- data/lib/tremendous/models/connected_organization_member.rb +330 -0
- data/lib/tremendous/models/connected_organization_member_member.rb +366 -0
- data/lib/tremendous/models/connected_organization_member_session.rb +311 -0
- data/lib/tremendous/models/connected_organization_organization.rb +324 -0
- data/lib/tremendous/models/create_campaign200_response.rb +221 -0
- data/lib/tremendous/models/create_connected_organization200_response.rb +221 -0
- data/lib/tremendous/models/create_connected_organization_member200_response.rb +221 -0
- data/lib/tremendous/models/create_connected_organization_member_request.rb +222 -0
- data/lib/tremendous/models/create_connected_organization_member_session200_response.rb +221 -0
- data/lib/tremendous/models/create_connected_organization_member_session200_response_connected_organization_member_session.rb +311 -0
- data/lib/tremendous/models/create_connected_organization_member_session_request.rb +222 -0
- data/lib/tremendous/models/create_connected_organization_request.rb +222 -0
- data/lib/tremendous/models/create_order200_response_order_rewards_inner_delivery.rb +1 -1
- data/lib/tremendous/models/create_organization_request_copy_settings.rb +16 -4
- data/lib/tremendous/models/create_report200_response.rb +231 -0
- data/lib/tremendous/models/create_report200_response_report.rb +291 -0
- data/lib/tremendous/models/delivery_details.rb +1 -1
- data/lib/tremendous/models/delivery_details_with_link.rb +1 -1
- data/lib/tremendous/models/funding_source.rb +35 -1
- data/lib/tremendous/models/list_connected_organization_members200_response.rb +240 -0
- data/lib/tremendous/models/list_connected_organization_members200_response_connected_organization_members_inner.rb +330 -0
- data/lib/tremendous/models/list_connected_organization_members200_response_connected_organization_members_inner_member.rb +366 -0
- data/lib/tremendous/models/list_connected_organizations200_response.rb +240 -0
- data/lib/tremendous/models/list_connected_organizations200_response_connected_organizations_inner.rb +287 -0
- data/lib/tremendous/models/list_connected_organizations200_response_connected_organizations_inner_organization.rb +324 -0
- data/lib/tremendous/models/list_funding_sources200_response_funding_sources_inner.rb +35 -1
- data/lib/tremendous/models/list_products_response_products_inner.rb +27 -7
- data/lib/tremendous/models/list_products_response_products_inner_documents.rb +236 -0
- data/lib/tremendous/models/list_products_response_products_inner_images_inner.rb +15 -4
- data/lib/tremendous/models/list_rewards200_response_rewards_inner_delivery.rb +1 -1
- data/lib/tremendous/models/product.rb +27 -7
- data/lib/tremendous/models/product_documents.rb +236 -0
- data/lib/tremendous/models/reward_with_link_delivery.rb +1 -1
- data/lib/tremendous/models/reward_without_link_delivery.rb +1 -1
- data/lib/tremendous/version.rb +1 -1
- data/lib/tremendous.rb +23 -5
- metadata +26 -7
@@ -0,0 +1,231 @@
|
|
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 CreateReport200Response
|
18
|
+
attr_accessor :report
|
19
|
+
|
20
|
+
# Report status message
|
21
|
+
attr_accessor :message
|
22
|
+
|
23
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
24
|
+
def self.attribute_map
|
25
|
+
{
|
26
|
+
:'report' => :'report',
|
27
|
+
:'message' => :'message'
|
28
|
+
}
|
29
|
+
end
|
30
|
+
|
31
|
+
# Returns all the JSON keys this model knows about
|
32
|
+
def self.acceptable_attributes
|
33
|
+
attribute_map.values
|
34
|
+
end
|
35
|
+
|
36
|
+
# Attribute type mapping.
|
37
|
+
def self.openapi_types
|
38
|
+
{
|
39
|
+
:'report' => :'CreateReport200ResponseReport',
|
40
|
+
:'message' => :'String'
|
41
|
+
}
|
42
|
+
end
|
43
|
+
|
44
|
+
# List of attributes with nullable: true
|
45
|
+
def self.openapi_nullable
|
46
|
+
Set.new([
|
47
|
+
])
|
48
|
+
end
|
49
|
+
|
50
|
+
# Initializes the object
|
51
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
52
|
+
def initialize(attributes = {})
|
53
|
+
if (!attributes.is_a?(Hash))
|
54
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Tremendous::CreateReport200Response` initialize method"
|
55
|
+
end
|
56
|
+
|
57
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
58
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
59
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
60
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Tremendous::CreateReport200Response`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
61
|
+
end
|
62
|
+
h[k.to_sym] = v
|
63
|
+
}
|
64
|
+
|
65
|
+
if attributes.key?(:'report')
|
66
|
+
self.report = attributes[:'report']
|
67
|
+
else
|
68
|
+
self.report = nil
|
69
|
+
end
|
70
|
+
|
71
|
+
if attributes.key?(:'message')
|
72
|
+
self.message = attributes[:'message']
|
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
|
+
if @report.nil?
|
82
|
+
invalid_properties.push('invalid value for "report", report cannot be nil.')
|
83
|
+
end
|
84
|
+
|
85
|
+
invalid_properties
|
86
|
+
end
|
87
|
+
|
88
|
+
# Check to see if the all the properties in the model are valid
|
89
|
+
# @return true if the model is valid
|
90
|
+
def valid?
|
91
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
92
|
+
return false if @report.nil?
|
93
|
+
true
|
94
|
+
end
|
95
|
+
|
96
|
+
# Checks equality by comparing each attribute.
|
97
|
+
# @param [Object] Object to be compared
|
98
|
+
def ==(o)
|
99
|
+
return true if self.equal?(o)
|
100
|
+
self.class == o.class &&
|
101
|
+
report == o.report &&
|
102
|
+
message == o.message
|
103
|
+
end
|
104
|
+
|
105
|
+
# @see the `==` method
|
106
|
+
# @param [Object] Object to be compared
|
107
|
+
def eql?(o)
|
108
|
+
self == o
|
109
|
+
end
|
110
|
+
|
111
|
+
# Calculates hash code according to all attributes.
|
112
|
+
# @return [Integer] Hash code
|
113
|
+
def hash
|
114
|
+
[report, message].hash
|
115
|
+
end
|
116
|
+
|
117
|
+
# Builds the object from hash
|
118
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
119
|
+
# @return [Object] Returns the model itself
|
120
|
+
def self.build_from_hash(attributes)
|
121
|
+
return nil unless attributes.is_a?(Hash)
|
122
|
+
attributes = attributes.transform_keys(&:to_sym)
|
123
|
+
transformed_hash = {}
|
124
|
+
openapi_types.each_pair do |key, type|
|
125
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
126
|
+
transformed_hash["#{key}"] = nil
|
127
|
+
elsif type =~ /\AArray<(.*)>/i
|
128
|
+
# check to ensure the input is an array given that the attribute
|
129
|
+
# is documented as an array but the input is not
|
130
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
131
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
132
|
+
end
|
133
|
+
elsif !attributes[attribute_map[key]].nil?
|
134
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
135
|
+
end
|
136
|
+
end
|
137
|
+
new(transformed_hash)
|
138
|
+
end
|
139
|
+
|
140
|
+
# Deserializes the data based on type
|
141
|
+
# @param string type Data type
|
142
|
+
# @param string value Value to be deserialized
|
143
|
+
# @return [Object] Deserialized data
|
144
|
+
def self._deserialize(type, value)
|
145
|
+
case type.to_sym
|
146
|
+
when :Time
|
147
|
+
Time.parse(value)
|
148
|
+
when :Date
|
149
|
+
Date.parse(value)
|
150
|
+
when :String
|
151
|
+
value.to_s
|
152
|
+
when :Integer
|
153
|
+
value.to_i
|
154
|
+
when :Float
|
155
|
+
value.to_f
|
156
|
+
when :Boolean
|
157
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
158
|
+
true
|
159
|
+
else
|
160
|
+
false
|
161
|
+
end
|
162
|
+
when :Object
|
163
|
+
# generic object (usually a Hash), return directly
|
164
|
+
value
|
165
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
166
|
+
inner_type = Regexp.last_match[:inner_type]
|
167
|
+
value.map { |v| _deserialize(inner_type, v) }
|
168
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
169
|
+
k_type = Regexp.last_match[:k_type]
|
170
|
+
v_type = Regexp.last_match[:v_type]
|
171
|
+
{}.tap do |hash|
|
172
|
+
value.each do |k, v|
|
173
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
174
|
+
end
|
175
|
+
end
|
176
|
+
else # model
|
177
|
+
# models (e.g. Pet) or oneOf
|
178
|
+
klass = Tremendous.const_get(type)
|
179
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
180
|
+
end
|
181
|
+
end
|
182
|
+
|
183
|
+
# Returns the string representation of the object
|
184
|
+
# @return [String] String presentation of the object
|
185
|
+
def to_s
|
186
|
+
to_hash.to_s
|
187
|
+
end
|
188
|
+
|
189
|
+
# to_body is an alias to to_hash (backward compatibility)
|
190
|
+
# @return [Hash] Returns the object in the form of hash
|
191
|
+
def to_body
|
192
|
+
to_hash
|
193
|
+
end
|
194
|
+
|
195
|
+
# Returns the object in the form of hash
|
196
|
+
# @return [Hash] Returns the object in the form of hash
|
197
|
+
def to_hash
|
198
|
+
hash = {}
|
199
|
+
self.class.attribute_map.each_pair do |attr, param|
|
200
|
+
value = self.send(attr)
|
201
|
+
if value.nil?
|
202
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
203
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
204
|
+
end
|
205
|
+
|
206
|
+
hash[param] = _to_hash(value)
|
207
|
+
end
|
208
|
+
hash
|
209
|
+
end
|
210
|
+
|
211
|
+
# Outputs non-array value in the form of hash
|
212
|
+
# For object, use to_hash. Otherwise, just return the value
|
213
|
+
# @param [Object] value Any valid value
|
214
|
+
# @return [Hash] Returns the value in the form of hash
|
215
|
+
def _to_hash(value)
|
216
|
+
if value.is_a?(Array)
|
217
|
+
value.compact.map { |v| _to_hash(v) }
|
218
|
+
elsif value.is_a?(Hash)
|
219
|
+
{}.tap do |hash|
|
220
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
221
|
+
end
|
222
|
+
elsif value.respond_to? :to_hash
|
223
|
+
value.to_hash
|
224
|
+
else
|
225
|
+
value
|
226
|
+
end
|
227
|
+
end
|
228
|
+
|
229
|
+
end
|
230
|
+
|
231
|
+
end
|
@@ -0,0 +1,291 @@
|
|
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
|
+
# Reports represent a collection of your Tremendous data that can be filtered and downloaded. The report object that is returned has a unique ID, a status, and an predicted time of report generation completion. When the report generation is complete, it will also contain an expiring url where you can retrieve your report.
|
18
|
+
class CreateReport200ResponseReport
|
19
|
+
# Tremendous ID of the report, used to retrieve your report
|
20
|
+
attr_accessor :id
|
21
|
+
|
22
|
+
# Status of this report <table> <thead> <tr> <th>Status</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td><code>CREATED</code></td> <td>Report has been created</td> </tr> <tr> <td><code>PROCESSING</code></td> <td>Report is currently being generated</td> </tr> <tr> <td><code>READY_FOR_DOWNLOAD</code></td> <td>Report generation is complete and ready for download</td> </tr> <tr> <td><code>FAILED</code></td> <td>Report failed to generate</td> </tr> </tbody> </table>
|
23
|
+
attr_accessor :status
|
24
|
+
|
25
|
+
# Timestamp of when the report was created
|
26
|
+
attr_accessor :created_at
|
27
|
+
|
28
|
+
# Timestamp of when the report is expected to finish generating. If the report is complete, this will return the time the report completed generating at.
|
29
|
+
attr_accessor :expected_completion_at
|
30
|
+
|
31
|
+
# URL to download the report. Only returned when the report generation is complete and report is ready for download. URL is valid for 7 days from generation completion
|
32
|
+
attr_accessor :url
|
33
|
+
|
34
|
+
class EnumAttributeValidator
|
35
|
+
attr_reader :datatype
|
36
|
+
attr_reader :allowable_values
|
37
|
+
|
38
|
+
def initialize(datatype, allowable_values)
|
39
|
+
@allowable_values = allowable_values.map do |value|
|
40
|
+
case datatype.to_s
|
41
|
+
when /Integer/i
|
42
|
+
value.to_i
|
43
|
+
when /Float/i
|
44
|
+
value.to_f
|
45
|
+
else
|
46
|
+
value
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
50
|
+
|
51
|
+
def valid?(value)
|
52
|
+
!value || allowable_values.include?(value)
|
53
|
+
end
|
54
|
+
end
|
55
|
+
|
56
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
57
|
+
def self.attribute_map
|
58
|
+
{
|
59
|
+
:'id' => :'id',
|
60
|
+
:'status' => :'status',
|
61
|
+
:'created_at' => :'created_at',
|
62
|
+
:'expected_completion_at' => :'expected_completion_at',
|
63
|
+
:'url' => :'url'
|
64
|
+
}
|
65
|
+
end
|
66
|
+
|
67
|
+
# Returns all the JSON keys this model knows about
|
68
|
+
def self.acceptable_attributes
|
69
|
+
attribute_map.values
|
70
|
+
end
|
71
|
+
|
72
|
+
# Attribute type mapping.
|
73
|
+
def self.openapi_types
|
74
|
+
{
|
75
|
+
:'id' => :'String',
|
76
|
+
:'status' => :'String',
|
77
|
+
:'created_at' => :'Time',
|
78
|
+
:'expected_completion_at' => :'Time',
|
79
|
+
:'url' => :'String'
|
80
|
+
}
|
81
|
+
end
|
82
|
+
|
83
|
+
# List of attributes with nullable: true
|
84
|
+
def self.openapi_nullable
|
85
|
+
Set.new([
|
86
|
+
:'url'
|
87
|
+
])
|
88
|
+
end
|
89
|
+
|
90
|
+
# Initializes the object
|
91
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
92
|
+
def initialize(attributes = {})
|
93
|
+
if (!attributes.is_a?(Hash))
|
94
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Tremendous::CreateReport200ResponseReport` initialize method"
|
95
|
+
end
|
96
|
+
|
97
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
98
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
99
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
100
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Tremendous::CreateReport200ResponseReport`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
101
|
+
end
|
102
|
+
h[k.to_sym] = v
|
103
|
+
}
|
104
|
+
|
105
|
+
if attributes.key?(:'id')
|
106
|
+
self.id = attributes[:'id']
|
107
|
+
end
|
108
|
+
|
109
|
+
if attributes.key?(:'status')
|
110
|
+
self.status = attributes[:'status']
|
111
|
+
end
|
112
|
+
|
113
|
+
if attributes.key?(:'created_at')
|
114
|
+
self.created_at = attributes[:'created_at']
|
115
|
+
end
|
116
|
+
|
117
|
+
if attributes.key?(:'expected_completion_at')
|
118
|
+
self.expected_completion_at = attributes[:'expected_completion_at']
|
119
|
+
end
|
120
|
+
|
121
|
+
if attributes.key?(:'url')
|
122
|
+
self.url = attributes[:'url']
|
123
|
+
end
|
124
|
+
end
|
125
|
+
|
126
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
127
|
+
# @return Array for valid properties with the reasons
|
128
|
+
def list_invalid_properties
|
129
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
130
|
+
invalid_properties = Array.new
|
131
|
+
invalid_properties
|
132
|
+
end
|
133
|
+
|
134
|
+
# Check to see if the all the properties in the model are valid
|
135
|
+
# @return true if the model is valid
|
136
|
+
def valid?
|
137
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
138
|
+
status_validator = EnumAttributeValidator.new('String', ["CREATED", "PROCESSING", "READY_FOR_DOWNLOAD", "FAILED"])
|
139
|
+
return false unless status_validator.valid?(@status)
|
140
|
+
true
|
141
|
+
end
|
142
|
+
|
143
|
+
# Custom attribute writer method checking allowed values (enum).
|
144
|
+
# @param [Object] status Object to be assigned
|
145
|
+
def status=(status)
|
146
|
+
validator = EnumAttributeValidator.new('String', ["CREATED", "PROCESSING", "READY_FOR_DOWNLOAD", "FAILED"])
|
147
|
+
unless validator.valid?(status)
|
148
|
+
fail ArgumentError, "invalid value for \"status\", must be one of #{validator.allowable_values}."
|
149
|
+
end
|
150
|
+
@status = status
|
151
|
+
end
|
152
|
+
|
153
|
+
# Checks equality by comparing each attribute.
|
154
|
+
# @param [Object] Object to be compared
|
155
|
+
def ==(o)
|
156
|
+
return true if self.equal?(o)
|
157
|
+
self.class == o.class &&
|
158
|
+
id == o.id &&
|
159
|
+
status == o.status &&
|
160
|
+
created_at == o.created_at &&
|
161
|
+
expected_completion_at == o.expected_completion_at &&
|
162
|
+
url == o.url
|
163
|
+
end
|
164
|
+
|
165
|
+
# @see the `==` method
|
166
|
+
# @param [Object] Object to be compared
|
167
|
+
def eql?(o)
|
168
|
+
self == o
|
169
|
+
end
|
170
|
+
|
171
|
+
# Calculates hash code according to all attributes.
|
172
|
+
# @return [Integer] Hash code
|
173
|
+
def hash
|
174
|
+
[id, status, created_at, expected_completion_at, url].hash
|
175
|
+
end
|
176
|
+
|
177
|
+
# Builds the object from hash
|
178
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
179
|
+
# @return [Object] Returns the model itself
|
180
|
+
def self.build_from_hash(attributes)
|
181
|
+
return nil unless attributes.is_a?(Hash)
|
182
|
+
attributes = attributes.transform_keys(&:to_sym)
|
183
|
+
transformed_hash = {}
|
184
|
+
openapi_types.each_pair do |key, type|
|
185
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
186
|
+
transformed_hash["#{key}"] = nil
|
187
|
+
elsif type =~ /\AArray<(.*)>/i
|
188
|
+
# check to ensure the input is an array given that the attribute
|
189
|
+
# is documented as an array but the input is not
|
190
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
191
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
192
|
+
end
|
193
|
+
elsif !attributes[attribute_map[key]].nil?
|
194
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
195
|
+
end
|
196
|
+
end
|
197
|
+
new(transformed_hash)
|
198
|
+
end
|
199
|
+
|
200
|
+
# Deserializes the data based on type
|
201
|
+
# @param string type Data type
|
202
|
+
# @param string value Value to be deserialized
|
203
|
+
# @return [Object] Deserialized data
|
204
|
+
def self._deserialize(type, value)
|
205
|
+
case type.to_sym
|
206
|
+
when :Time
|
207
|
+
Time.parse(value)
|
208
|
+
when :Date
|
209
|
+
Date.parse(value)
|
210
|
+
when :String
|
211
|
+
value.to_s
|
212
|
+
when :Integer
|
213
|
+
value.to_i
|
214
|
+
when :Float
|
215
|
+
value.to_f
|
216
|
+
when :Boolean
|
217
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
218
|
+
true
|
219
|
+
else
|
220
|
+
false
|
221
|
+
end
|
222
|
+
when :Object
|
223
|
+
# generic object (usually a Hash), return directly
|
224
|
+
value
|
225
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
226
|
+
inner_type = Regexp.last_match[:inner_type]
|
227
|
+
value.map { |v| _deserialize(inner_type, v) }
|
228
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
229
|
+
k_type = Regexp.last_match[:k_type]
|
230
|
+
v_type = Regexp.last_match[:v_type]
|
231
|
+
{}.tap do |hash|
|
232
|
+
value.each do |k, v|
|
233
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
234
|
+
end
|
235
|
+
end
|
236
|
+
else # model
|
237
|
+
# models (e.g. Pet) or oneOf
|
238
|
+
klass = Tremendous.const_get(type)
|
239
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
240
|
+
end
|
241
|
+
end
|
242
|
+
|
243
|
+
# Returns the string representation of the object
|
244
|
+
# @return [String] String presentation of the object
|
245
|
+
def to_s
|
246
|
+
to_hash.to_s
|
247
|
+
end
|
248
|
+
|
249
|
+
# to_body is an alias to to_hash (backward compatibility)
|
250
|
+
# @return [Hash] Returns the object in the form of hash
|
251
|
+
def to_body
|
252
|
+
to_hash
|
253
|
+
end
|
254
|
+
|
255
|
+
# Returns the object in the form of hash
|
256
|
+
# @return [Hash] Returns the object in the form of hash
|
257
|
+
def to_hash
|
258
|
+
hash = {}
|
259
|
+
self.class.attribute_map.each_pair do |attr, param|
|
260
|
+
value = self.send(attr)
|
261
|
+
if value.nil?
|
262
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
263
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
264
|
+
end
|
265
|
+
|
266
|
+
hash[param] = _to_hash(value)
|
267
|
+
end
|
268
|
+
hash
|
269
|
+
end
|
270
|
+
|
271
|
+
# Outputs non-array value in the form of hash
|
272
|
+
# For object, use to_hash. Otherwise, just return the value
|
273
|
+
# @param [Object] value Any valid value
|
274
|
+
# @return [Hash] Returns the value in the form of hash
|
275
|
+
def _to_hash(value)
|
276
|
+
if value.is_a?(Array)
|
277
|
+
value.compact.map { |v| _to_hash(v) }
|
278
|
+
elsif value.is_a?(Hash)
|
279
|
+
{}.tap do |hash|
|
280
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
281
|
+
end
|
282
|
+
elsif value.respond_to? :to_hash
|
283
|
+
value.to_hash
|
284
|
+
else
|
285
|
+
value
|
286
|
+
end
|
287
|
+
end
|
288
|
+
|
289
|
+
end
|
290
|
+
|
291
|
+
end
|
@@ -19,7 +19,7 @@ module Tremendous
|
|
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
|
|
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
|
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 active). * `PENDING` - Delivery is pending but not yet scheduled.
|
23
23
|
attr_accessor :status
|
24
24
|
|
25
25
|
class EnumAttributeValidator
|
@@ -19,7 +19,7 @@ module Tremendous
|
|
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
|
|
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
|
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 active). * `PENDING` - Delivery is pending but not yet scheduled.
|
23
23
|
attr_accessor :status
|
24
24
|
|
25
25
|
# Link to redeem the reward at. You need to deliver this link to the recipient.
|
@@ -21,6 +21,12 @@ module Tremendous
|
|
21
21
|
# You can pay for rewards using different payment methods on Tremendous: <table> <thead> <tr> <th>Payment Method</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td><code>balance</code></td> <td>Pre-funded balance in your Tremendous account to draw funds from to send rewards to recipients.</td> </tr> <tr> <td><code>bank_account</code></td> <td>Bank account to draw funds from to send rewards to recipients.</td> </tr> <tr> <td><code>credit_card</code></td> <td>Credit card to draw funds from to send rewards to recipients.</td> </tr> <tr> <td><code>invoice</code></td> <td>Send rewards to recipients and pay by invoice.</td> </tr> </tbody> </table>
|
22
22
|
attr_accessor :method
|
23
23
|
|
24
|
+
# Indicates the level of access granted for using this funding source. Permissions is an array containing the following: * `api_orders` * `dashboard_orders` * `balance_funding`
|
25
|
+
attr_accessor :usage_permissions
|
26
|
+
|
27
|
+
# Status of the funding_source
|
28
|
+
attr_accessor :status
|
29
|
+
|
24
30
|
# **Only available when `method` is set to `invoice`.**
|
25
31
|
attr_accessor :type
|
26
32
|
|
@@ -53,6 +59,8 @@ module Tremendous
|
|
53
59
|
{
|
54
60
|
:'id' => :'id',
|
55
61
|
:'method' => :'method',
|
62
|
+
:'usage_permissions' => :'usage_permissions',
|
63
|
+
:'status' => :'status',
|
56
64
|
:'type' => :'type',
|
57
65
|
:'meta' => :'meta'
|
58
66
|
}
|
@@ -68,6 +76,8 @@ module Tremendous
|
|
68
76
|
{
|
69
77
|
:'id' => :'String',
|
70
78
|
:'method' => :'String',
|
79
|
+
:'usage_permissions' => :'Array<String>',
|
80
|
+
:'status' => :'String',
|
71
81
|
:'type' => :'String',
|
72
82
|
:'meta' => :'ListFundingSources200ResponseFundingSourcesInnerMeta'
|
73
83
|
}
|
@@ -106,6 +116,16 @@ module Tremendous
|
|
106
116
|
self.method = nil
|
107
117
|
end
|
108
118
|
|
119
|
+
if attributes.key?(:'usage_permissions')
|
120
|
+
if (value = attributes[:'usage_permissions']).is_a?(Array)
|
121
|
+
self.usage_permissions = value
|
122
|
+
end
|
123
|
+
end
|
124
|
+
|
125
|
+
if attributes.key?(:'status')
|
126
|
+
self.status = attributes[:'status']
|
127
|
+
end
|
128
|
+
|
109
129
|
if attributes.key?(:'type')
|
110
130
|
self.type = attributes[:'type']
|
111
131
|
end
|
@@ -151,6 +171,8 @@ module Tremendous
|
|
151
171
|
return false if @method.nil?
|
152
172
|
method_validator = EnumAttributeValidator.new('String', ["balance", "bank_account", "credit_card", "invoice"])
|
153
173
|
return false unless method_validator.valid?(@method)
|
174
|
+
status_validator = EnumAttributeValidator.new('String', ["active", "deleted", "pending_confirmation", "failed"])
|
175
|
+
return false unless status_validator.valid?(@status)
|
154
176
|
type_validator = EnumAttributeValidator.new('String', ["COMMERCIAL", "PRO_FORMA", "PREFUNDING_ONLY"])
|
155
177
|
return false unless type_validator.valid?(@type)
|
156
178
|
return false if @meta.nil?
|
@@ -182,6 +204,16 @@ module Tremendous
|
|
182
204
|
@method = method
|
183
205
|
end
|
184
206
|
|
207
|
+
# Custom attribute writer method checking allowed values (enum).
|
208
|
+
# @param [Object] status Object to be assigned
|
209
|
+
def status=(status)
|
210
|
+
validator = EnumAttributeValidator.new('String', ["active", "deleted", "pending_confirmation", "failed"])
|
211
|
+
unless validator.valid?(status)
|
212
|
+
fail ArgumentError, "invalid value for \"status\", must be one of #{validator.allowable_values}."
|
213
|
+
end
|
214
|
+
@status = status
|
215
|
+
end
|
216
|
+
|
185
217
|
# Custom attribute writer method checking allowed values (enum).
|
186
218
|
# @param [Object] type Object to be assigned
|
187
219
|
def type=(type)
|
@@ -199,6 +231,8 @@ module Tremendous
|
|
199
231
|
self.class == o.class &&
|
200
232
|
id == o.id &&
|
201
233
|
method == o.method &&
|
234
|
+
usage_permissions == o.usage_permissions &&
|
235
|
+
status == o.status &&
|
202
236
|
type == o.type &&
|
203
237
|
meta == o.meta
|
204
238
|
end
|
@@ -212,7 +246,7 @@ module Tremendous
|
|
212
246
|
# Calculates hash code according to all attributes.
|
213
247
|
# @return [Integer] Hash code
|
214
248
|
def hash
|
215
|
-
[id, method, type, meta].hash
|
249
|
+
[id, method, usage_permissions, status, type, meta].hash
|
216
250
|
end
|
217
251
|
|
218
252
|
# Builds the object from hash
|