appnigma-sdk 0.1.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 +7 -0
- data/LICENSE +21 -0
- data/README.md +359 -0
- data/lib/appnigma/checks.rb +90 -0
- data/lib/appnigma/client.rb +118 -0
- data/lib/appnigma/connections.rb +31 -0
- data/lib/appnigma/constants.rb +80 -0
- data/lib/appnigma/crm.rb +40 -0
- data/lib/appnigma/errors.rb +135 -0
- data/lib/appnigma/generated/api/default_api.rb +972 -0
- data/lib/appnigma/generated/api_client.rb +441 -0
- data/lib/appnigma/generated/api_error.rb +58 -0
- data/lib/appnigma/generated/api_model_base.rb +88 -0
- data/lib/appnigma/generated/configuration.rb +392 -0
- data/lib/appnigma/generated/models/connection_status.rb +41 -0
- data/lib/appnigma/generated/models/create_connection_link_input.rb +265 -0
- data/lib/appnigma/generated/models/create_connection_link_output.rb +205 -0
- data/lib/appnigma/generated/models/crm_company.rb +322 -0
- data/lib/appnigma/generated/models/crm_company_get_output.rb +177 -0
- data/lib/appnigma/generated/models/crm_company_list_output.rb +192 -0
- data/lib/appnigma/generated/models/crm_contact.rb +404 -0
- data/lib/appnigma/generated/models/crm_contact_get_output.rb +177 -0
- data/lib/appnigma/generated/models/crm_contact_list_output.rb +192 -0
- data/lib/appnigma/generated/models/crm_custom_field.rb +189 -0
- data/lib/appnigma/generated/models/crm_deal.rb +479 -0
- data/lib/appnigma/generated/models/crm_deal_get_output.rb +177 -0
- data/lib/appnigma/generated/models/crm_deal_list_output.rb +192 -0
- data/lib/appnigma/generated/models/crm_email.rb +249 -0
- data/lib/appnigma/generated/models/crm_get_input.rb +272 -0
- data/lib/appnigma/generated/models/crm_labelled.rb +190 -0
- data/lib/appnigma/generated/models/crm_list_input.rb +303 -0
- data/lib/appnigma/generated/models/crm_phone.rb +249 -0
- data/lib/appnigma/generated/models/function_entry.rb +346 -0
- data/lib/appnigma/generated/models/function_owner.rb +105 -0
- data/lib/appnigma/generated/models/function_owner_one_of.rb +201 -0
- data/lib/appnigma/generated/models/function_owner_one_of1.rb +227 -0
- data/lib/appnigma/generated/models/get_connection_output.rb +251 -0
- data/lib/appnigma/generated/models/get_guide_output.rb +178 -0
- data/lib/appnigma/generated/models/json_value.rb +106 -0
- data/lib/appnigma/generated/models/list_functions_output.rb +179 -0
- data/lib/appnigma/generated/models/platform_request_input.rb +314 -0
- data/lib/appnigma/generated/models/platform_request_input_body.rb +104 -0
- data/lib/appnigma/generated/models/platform_request_output.rb +221 -0
- data/lib/appnigma/generated/models/post_input.rb +327 -0
- data/lib/appnigma/generated/models/post_input_record_value.rb +104 -0
- data/lib/appnigma/generated/models/post_output.rb +203 -0
- data/lib/appnigma/generated/models/pull_input.rb +335 -0
- data/lib/appnigma/generated/models/pull_output.rb +191 -0
- data/lib/appnigma/generated/models/pull_output_records_inner.rb +205 -0
- data/lib/appnigma/generated/models/run_input.rb +332 -0
- data/lib/appnigma/generated/models/run_output.rb +164 -0
- data/lib/appnigma/generated/models/sdk_error.rb +177 -0
- data/lib/appnigma/generated/models/sdk_error_error.rb +254 -0
- data/lib/appnigma/generated/models/sdk_error_error_details.rb +211 -0
- data/lib/appnigma/generated/models/sdk_problem.rb +205 -0
- data/lib/appnigma/generated/version.rb +15 -0
- data/lib/appnigma/generated.rb +82 -0
- data/lib/appnigma/names.rb +62 -0
- data/lib/appnigma/retry.rb +80 -0
- data/lib/appnigma/transport.rb +138 -0
- data/lib/appnigma/version.rb +9 -0
- data/lib/appnigma.rb +16 -0
- metadata +155 -0
|
@@ -0,0 +1,335 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#Appnigma SDK API
|
|
3
|
+
|
|
4
|
+
#The routes a customer's product calls through an Appnigma SDK. Every answer carries a request id in X-Request-Id; quote it when you write to support.
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: 1.0.0
|
|
7
|
+
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
Generator version: 7.26.0
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'date'
|
|
14
|
+
require 'time'
|
|
15
|
+
|
|
16
|
+
module Appnigma::Generated
|
|
17
|
+
class PullInput < ApiModelBase
|
|
18
|
+
# Your own id for the end customer.
|
|
19
|
+
attr_accessor :end_customer_id
|
|
20
|
+
|
|
21
|
+
# Only hubspot for now: post and pull work on HubSpot until unified data replaces them.
|
|
22
|
+
attr_accessor :platform
|
|
23
|
+
|
|
24
|
+
attr_accessor :object
|
|
25
|
+
|
|
26
|
+
# 1 to 100. Default 100.
|
|
27
|
+
attr_accessor :limit
|
|
28
|
+
|
|
29
|
+
# The next marker from the previous page.
|
|
30
|
+
attr_accessor :after
|
|
31
|
+
|
|
32
|
+
class EnumAttributeValidator
|
|
33
|
+
attr_reader :datatype
|
|
34
|
+
attr_reader :allowable_values
|
|
35
|
+
|
|
36
|
+
def initialize(datatype, allowable_values)
|
|
37
|
+
@allowable_values = allowable_values.map do |value|
|
|
38
|
+
case datatype.to_s
|
|
39
|
+
when /Integer/i
|
|
40
|
+
value.to_i
|
|
41
|
+
when /Float/i
|
|
42
|
+
value.to_f
|
|
43
|
+
else
|
|
44
|
+
value
|
|
45
|
+
end
|
|
46
|
+
end
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
def valid?(value)
|
|
50
|
+
!value || allowable_values.include?(value)
|
|
51
|
+
end
|
|
52
|
+
end
|
|
53
|
+
|
|
54
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
55
|
+
def self.attribute_map
|
|
56
|
+
{
|
|
57
|
+
:'end_customer_id' => :'endCustomerId',
|
|
58
|
+
:'platform' => :'platform',
|
|
59
|
+
:'object' => :'object',
|
|
60
|
+
:'limit' => :'limit',
|
|
61
|
+
:'after' => :'after'
|
|
62
|
+
}
|
|
63
|
+
end
|
|
64
|
+
|
|
65
|
+
# Returns attribute mapping this model knows about
|
|
66
|
+
def self.acceptable_attribute_map
|
|
67
|
+
attribute_map
|
|
68
|
+
end
|
|
69
|
+
|
|
70
|
+
# Returns all the JSON keys this model knows about
|
|
71
|
+
def self.acceptable_attributes
|
|
72
|
+
acceptable_attribute_map.values
|
|
73
|
+
end
|
|
74
|
+
|
|
75
|
+
# Attribute type mapping.
|
|
76
|
+
def self.openapi_types
|
|
77
|
+
{
|
|
78
|
+
:'end_customer_id' => :'String',
|
|
79
|
+
:'platform' => :'String',
|
|
80
|
+
:'object' => :'String',
|
|
81
|
+
:'limit' => :'Integer',
|
|
82
|
+
:'after' => :'String'
|
|
83
|
+
}
|
|
84
|
+
end
|
|
85
|
+
|
|
86
|
+
# List of attributes with nullable: true
|
|
87
|
+
def self.openapi_nullable
|
|
88
|
+
Set.new([
|
|
89
|
+
])
|
|
90
|
+
end
|
|
91
|
+
|
|
92
|
+
# Returns attribute type mapping
|
|
93
|
+
def self.acceptable_openapi_types
|
|
94
|
+
openapi_types
|
|
95
|
+
end
|
|
96
|
+
|
|
97
|
+
# Returns the nullable attributes
|
|
98
|
+
def self.acceptable_openapi_nullable
|
|
99
|
+
openapi_nullable
|
|
100
|
+
end
|
|
101
|
+
|
|
102
|
+
# Initializes the object
|
|
103
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
104
|
+
def initialize(attributes = {})
|
|
105
|
+
if (!attributes.is_a?(Hash))
|
|
106
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Appnigma::Generated::PullInput` initialize method"
|
|
107
|
+
end
|
|
108
|
+
|
|
109
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
110
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
111
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
112
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
113
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Appnigma::Generated::PullInput`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
114
|
+
end
|
|
115
|
+
h[k.to_sym] = v
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
if attributes.key?(:'end_customer_id')
|
|
119
|
+
self.end_customer_id = attributes[:'end_customer_id']
|
|
120
|
+
else
|
|
121
|
+
self.end_customer_id = nil
|
|
122
|
+
end
|
|
123
|
+
|
|
124
|
+
if attributes.key?(:'platform')
|
|
125
|
+
self.platform = attributes[:'platform']
|
|
126
|
+
else
|
|
127
|
+
self.platform = nil
|
|
128
|
+
end
|
|
129
|
+
|
|
130
|
+
if attributes.key?(:'object')
|
|
131
|
+
self.object = attributes[:'object']
|
|
132
|
+
else
|
|
133
|
+
self.object = nil
|
|
134
|
+
end
|
|
135
|
+
|
|
136
|
+
if attributes.key?(:'limit')
|
|
137
|
+
self.limit = attributes[:'limit']
|
|
138
|
+
end
|
|
139
|
+
|
|
140
|
+
if attributes.key?(:'after')
|
|
141
|
+
self.after = attributes[:'after']
|
|
142
|
+
end
|
|
143
|
+
end
|
|
144
|
+
|
|
145
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
146
|
+
# @return Array for valid properties with the reasons
|
|
147
|
+
def list_invalid_properties
|
|
148
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
149
|
+
invalid_properties = Array.new
|
|
150
|
+
if @end_customer_id.nil?
|
|
151
|
+
invalid_properties.push('invalid value for "end_customer_id", end_customer_id cannot be nil.')
|
|
152
|
+
end
|
|
153
|
+
|
|
154
|
+
pattern = Regexp.new(/^[A-Za-z0-9._-]{1,100}$/)
|
|
155
|
+
if @end_customer_id !~ pattern
|
|
156
|
+
invalid_properties.push("invalid value for \"end_customer_id\", must conform to the pattern #{pattern}.")
|
|
157
|
+
end
|
|
158
|
+
|
|
159
|
+
if @platform.nil?
|
|
160
|
+
invalid_properties.push('invalid value for "platform", platform cannot be nil.')
|
|
161
|
+
end
|
|
162
|
+
|
|
163
|
+
if @object.nil?
|
|
164
|
+
invalid_properties.push('invalid value for "object", object cannot be nil.')
|
|
165
|
+
end
|
|
166
|
+
|
|
167
|
+
if !@limit.nil? && @limit > 100
|
|
168
|
+
invalid_properties.push('invalid value for "limit", must be smaller than or equal to 100.')
|
|
169
|
+
end
|
|
170
|
+
|
|
171
|
+
if !@limit.nil? && @limit < 1
|
|
172
|
+
invalid_properties.push('invalid value for "limit", must be greater than or equal to 1.')
|
|
173
|
+
end
|
|
174
|
+
|
|
175
|
+
if !@after.nil? && @after.to_s.length < 1
|
|
176
|
+
invalid_properties.push('invalid value for "after", the character length must be greater than or equal to 1.')
|
|
177
|
+
end
|
|
178
|
+
|
|
179
|
+
invalid_properties
|
|
180
|
+
end
|
|
181
|
+
|
|
182
|
+
# Check to see if the all the properties in the model are valid
|
|
183
|
+
# @return true if the model is valid
|
|
184
|
+
def valid?
|
|
185
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
186
|
+
return false if @end_customer_id.nil?
|
|
187
|
+
return false if @end_customer_id !~ Regexp.new(/^[A-Za-z0-9._-]{1,100}$/)
|
|
188
|
+
return false if @platform.nil?
|
|
189
|
+
platform_validator = EnumAttributeValidator.new('String', ["hubspot"])
|
|
190
|
+
return false unless platform_validator.valid?(@platform)
|
|
191
|
+
return false if @object.nil?
|
|
192
|
+
object_validator = EnumAttributeValidator.new('String', ["contact", "company", "deal"])
|
|
193
|
+
return false unless object_validator.valid?(@object)
|
|
194
|
+
return false if !@limit.nil? && @limit > 100
|
|
195
|
+
return false if !@limit.nil? && @limit < 1
|
|
196
|
+
return false if !@after.nil? && @after.to_s.length < 1
|
|
197
|
+
true
|
|
198
|
+
end
|
|
199
|
+
|
|
200
|
+
# Custom attribute writer method with validation
|
|
201
|
+
# @param [Object] end_customer_id Value to be assigned
|
|
202
|
+
def end_customer_id=(end_customer_id)
|
|
203
|
+
if end_customer_id.nil?
|
|
204
|
+
fail ArgumentError, 'end_customer_id cannot be nil'
|
|
205
|
+
end
|
|
206
|
+
|
|
207
|
+
pattern = Regexp.new(/^[A-Za-z0-9._-]{1,100}$/)
|
|
208
|
+
if end_customer_id !~ pattern
|
|
209
|
+
fail ArgumentError, "invalid value for \"end_customer_id\", must conform to the pattern #{pattern}."
|
|
210
|
+
end
|
|
211
|
+
|
|
212
|
+
@end_customer_id = end_customer_id
|
|
213
|
+
end
|
|
214
|
+
|
|
215
|
+
# Custom attribute writer method checking allowed values (enum).
|
|
216
|
+
# @param [Object] platform Object to be assigned
|
|
217
|
+
def platform=(platform)
|
|
218
|
+
validator = EnumAttributeValidator.new('String', ["hubspot"])
|
|
219
|
+
unless validator.valid?(platform)
|
|
220
|
+
fail ArgumentError, "invalid value for \"platform\", must be one of #{validator.allowable_values}."
|
|
221
|
+
end
|
|
222
|
+
@platform = platform
|
|
223
|
+
end
|
|
224
|
+
|
|
225
|
+
# Custom attribute writer method checking allowed values (enum).
|
|
226
|
+
# @param [Object] object Object to be assigned
|
|
227
|
+
def object=(object)
|
|
228
|
+
validator = EnumAttributeValidator.new('String', ["contact", "company", "deal"])
|
|
229
|
+
unless validator.valid?(object)
|
|
230
|
+
fail ArgumentError, "invalid value for \"object\", must be one of #{validator.allowable_values}."
|
|
231
|
+
end
|
|
232
|
+
@object = object
|
|
233
|
+
end
|
|
234
|
+
|
|
235
|
+
# Custom attribute writer method with validation
|
|
236
|
+
# @param [Object] limit Value to be assigned
|
|
237
|
+
def limit=(limit)
|
|
238
|
+
if limit.nil?
|
|
239
|
+
fail ArgumentError, 'limit cannot be nil'
|
|
240
|
+
end
|
|
241
|
+
|
|
242
|
+
if limit > 100
|
|
243
|
+
fail ArgumentError, 'invalid value for "limit", must be smaller than or equal to 100.'
|
|
244
|
+
end
|
|
245
|
+
|
|
246
|
+
if limit < 1
|
|
247
|
+
fail ArgumentError, 'invalid value for "limit", must be greater than or equal to 1.'
|
|
248
|
+
end
|
|
249
|
+
|
|
250
|
+
@limit = limit
|
|
251
|
+
end
|
|
252
|
+
|
|
253
|
+
# Custom attribute writer method with validation
|
|
254
|
+
# @param [Object] after Value to be assigned
|
|
255
|
+
def after=(after)
|
|
256
|
+
if after.nil?
|
|
257
|
+
fail ArgumentError, 'after cannot be nil'
|
|
258
|
+
end
|
|
259
|
+
|
|
260
|
+
if after.to_s.length < 1
|
|
261
|
+
fail ArgumentError, 'invalid value for "after", the character length must be greater than or equal to 1.'
|
|
262
|
+
end
|
|
263
|
+
|
|
264
|
+
@after = after
|
|
265
|
+
end
|
|
266
|
+
|
|
267
|
+
# Checks equality by comparing each attribute.
|
|
268
|
+
# @param [Object] Object to be compared
|
|
269
|
+
def ==(o)
|
|
270
|
+
return true if self.equal?(o)
|
|
271
|
+
self.class == o.class &&
|
|
272
|
+
end_customer_id == o.end_customer_id &&
|
|
273
|
+
platform == o.platform &&
|
|
274
|
+
object == o.object &&
|
|
275
|
+
limit == o.limit &&
|
|
276
|
+
after == o.after
|
|
277
|
+
end
|
|
278
|
+
|
|
279
|
+
# @see the `==` method
|
|
280
|
+
# @param [Object] Object to be compared
|
|
281
|
+
def eql?(o)
|
|
282
|
+
self == o
|
|
283
|
+
end
|
|
284
|
+
|
|
285
|
+
# Calculates hash code according to all attributes.
|
|
286
|
+
# @return [Integer] Hash code
|
|
287
|
+
def hash
|
|
288
|
+
[end_customer_id, platform, object, limit, after].hash
|
|
289
|
+
end
|
|
290
|
+
|
|
291
|
+
# Builds the object from hash
|
|
292
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
293
|
+
# @return [Object] Returns the model itself
|
|
294
|
+
def self.build_from_hash(attributes)
|
|
295
|
+
return nil unless attributes.is_a?(Hash)
|
|
296
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
297
|
+
# include attributes inherited from allOf parents (the nearest declaration wins)
|
|
298
|
+
map = acceptable_attribute_map
|
|
299
|
+
transformed_hash = {}
|
|
300
|
+
acceptable_openapi_types.each_pair do |key, type|
|
|
301
|
+
if attributes.key?(map[key]) && attributes[map[key]].nil?
|
|
302
|
+
transformed_hash["#{key}"] = nil
|
|
303
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
304
|
+
# check to ensure the input is an array given that the attribute
|
|
305
|
+
# is documented as an array but the input is not
|
|
306
|
+
if attributes[map[key]].is_a?(Array)
|
|
307
|
+
transformed_hash["#{key}"] = attributes[map[key]].map { |v| _deserialize($1, v) }
|
|
308
|
+
end
|
|
309
|
+
elsif !attributes[map[key]].nil?
|
|
310
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[map[key]])
|
|
311
|
+
end
|
|
312
|
+
end
|
|
313
|
+
new(transformed_hash)
|
|
314
|
+
end
|
|
315
|
+
|
|
316
|
+
# Returns the object in the form of hash
|
|
317
|
+
# @return [Hash] Returns the object in the form of hash
|
|
318
|
+
def to_hash
|
|
319
|
+
hash = {}
|
|
320
|
+
# include attributes inherited from allOf parents (the nearest declaration wins)
|
|
321
|
+
self.class.acceptable_attribute_map.each_pair do |attr, param|
|
|
322
|
+
value = self.send(attr)
|
|
323
|
+
if value.nil?
|
|
324
|
+
is_nullable = self.class.acceptable_openapi_nullable.include?(attr)
|
|
325
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
326
|
+
end
|
|
327
|
+
|
|
328
|
+
hash[param] = _to_hash(value)
|
|
329
|
+
end
|
|
330
|
+
hash
|
|
331
|
+
end
|
|
332
|
+
|
|
333
|
+
end
|
|
334
|
+
|
|
335
|
+
end
|
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#Appnigma SDK API
|
|
3
|
+
|
|
4
|
+
#The routes a customer's product calls through an Appnigma SDK. Every answer carries a request id in X-Request-Id; quote it when you write to support.
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: 1.0.0
|
|
7
|
+
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
Generator version: 7.26.0
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'date'
|
|
14
|
+
require 'time'
|
|
15
|
+
|
|
16
|
+
module Appnigma::Generated
|
|
17
|
+
class PullOutput < ApiModelBase
|
|
18
|
+
attr_accessor :records
|
|
19
|
+
|
|
20
|
+
attr_accessor :_next
|
|
21
|
+
|
|
22
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
23
|
+
def self.attribute_map
|
|
24
|
+
{
|
|
25
|
+
:'records' => :'records',
|
|
26
|
+
:'_next' => :'next'
|
|
27
|
+
}
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
# Returns attribute mapping this model knows about
|
|
31
|
+
def self.acceptable_attribute_map
|
|
32
|
+
attribute_map
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
# Returns all the JSON keys this model knows about
|
|
36
|
+
def self.acceptable_attributes
|
|
37
|
+
acceptable_attribute_map.values
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
# Attribute type mapping.
|
|
41
|
+
def self.openapi_types
|
|
42
|
+
{
|
|
43
|
+
:'records' => :'Array<PullOutputRecordsInner>',
|
|
44
|
+
:'_next' => :'String'
|
|
45
|
+
}
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
# List of attributes with nullable: true
|
|
49
|
+
def self.openapi_nullable
|
|
50
|
+
Set.new([
|
|
51
|
+
:'_next'
|
|
52
|
+
])
|
|
53
|
+
end
|
|
54
|
+
|
|
55
|
+
# Returns attribute type mapping
|
|
56
|
+
def self.acceptable_openapi_types
|
|
57
|
+
openapi_types
|
|
58
|
+
end
|
|
59
|
+
|
|
60
|
+
# Returns the nullable attributes
|
|
61
|
+
def self.acceptable_openapi_nullable
|
|
62
|
+
openapi_nullable
|
|
63
|
+
end
|
|
64
|
+
|
|
65
|
+
# Initializes the object
|
|
66
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
67
|
+
def initialize(attributes = {})
|
|
68
|
+
if (!attributes.is_a?(Hash))
|
|
69
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Appnigma::Generated::PullOutput` initialize method"
|
|
70
|
+
end
|
|
71
|
+
|
|
72
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
73
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
74
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
75
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
76
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Appnigma::Generated::PullOutput`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
77
|
+
end
|
|
78
|
+
h[k.to_sym] = v
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
if attributes.key?(:'records')
|
|
82
|
+
if (value = attributes[:'records']).is_a?(Array)
|
|
83
|
+
self.records = value
|
|
84
|
+
end
|
|
85
|
+
else
|
|
86
|
+
self.records = nil
|
|
87
|
+
end
|
|
88
|
+
|
|
89
|
+
if attributes.key?(:'_next')
|
|
90
|
+
self._next = attributes[:'_next']
|
|
91
|
+
else
|
|
92
|
+
self._next = nil
|
|
93
|
+
end
|
|
94
|
+
end
|
|
95
|
+
|
|
96
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
97
|
+
# @return Array for valid properties with the reasons
|
|
98
|
+
def list_invalid_properties
|
|
99
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
100
|
+
invalid_properties = Array.new
|
|
101
|
+
if @records.nil?
|
|
102
|
+
invalid_properties.push('invalid value for "records", records cannot be nil.')
|
|
103
|
+
end
|
|
104
|
+
|
|
105
|
+
invalid_properties
|
|
106
|
+
end
|
|
107
|
+
|
|
108
|
+
# Check to see if the all the properties in the model are valid
|
|
109
|
+
# @return true if the model is valid
|
|
110
|
+
def valid?
|
|
111
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
112
|
+
return false if @records.nil?
|
|
113
|
+
true
|
|
114
|
+
end
|
|
115
|
+
|
|
116
|
+
# Custom attribute writer method with validation
|
|
117
|
+
# @param [Object] records Value to be assigned
|
|
118
|
+
def records=(records)
|
|
119
|
+
if records.nil?
|
|
120
|
+
fail ArgumentError, 'records cannot be nil'
|
|
121
|
+
end
|
|
122
|
+
|
|
123
|
+
@records = records
|
|
124
|
+
end
|
|
125
|
+
|
|
126
|
+
# Checks equality by comparing each attribute.
|
|
127
|
+
# @param [Object] Object to be compared
|
|
128
|
+
def ==(o)
|
|
129
|
+
return true if self.equal?(o)
|
|
130
|
+
self.class == o.class &&
|
|
131
|
+
records == o.records &&
|
|
132
|
+
_next == o._next
|
|
133
|
+
end
|
|
134
|
+
|
|
135
|
+
# @see the `==` method
|
|
136
|
+
# @param [Object] Object to be compared
|
|
137
|
+
def eql?(o)
|
|
138
|
+
self == o
|
|
139
|
+
end
|
|
140
|
+
|
|
141
|
+
# Calculates hash code according to all attributes.
|
|
142
|
+
# @return [Integer] Hash code
|
|
143
|
+
def hash
|
|
144
|
+
[records, _next].hash
|
|
145
|
+
end
|
|
146
|
+
|
|
147
|
+
# Builds the object from hash
|
|
148
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
149
|
+
# @return [Object] Returns the model itself
|
|
150
|
+
def self.build_from_hash(attributes)
|
|
151
|
+
return nil unless attributes.is_a?(Hash)
|
|
152
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
153
|
+
# include attributes inherited from allOf parents (the nearest declaration wins)
|
|
154
|
+
map = acceptable_attribute_map
|
|
155
|
+
transformed_hash = {}
|
|
156
|
+
acceptable_openapi_types.each_pair do |key, type|
|
|
157
|
+
if attributes.key?(map[key]) && attributes[map[key]].nil?
|
|
158
|
+
transformed_hash["#{key}"] = nil
|
|
159
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
160
|
+
# check to ensure the input is an array given that the attribute
|
|
161
|
+
# is documented as an array but the input is not
|
|
162
|
+
if attributes[map[key]].is_a?(Array)
|
|
163
|
+
transformed_hash["#{key}"] = attributes[map[key]].map { |v| _deserialize($1, v) }
|
|
164
|
+
end
|
|
165
|
+
elsif !attributes[map[key]].nil?
|
|
166
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[map[key]])
|
|
167
|
+
end
|
|
168
|
+
end
|
|
169
|
+
new(transformed_hash)
|
|
170
|
+
end
|
|
171
|
+
|
|
172
|
+
# Returns the object in the form of hash
|
|
173
|
+
# @return [Hash] Returns the object in the form of hash
|
|
174
|
+
def to_hash
|
|
175
|
+
hash = {}
|
|
176
|
+
# include attributes inherited from allOf parents (the nearest declaration wins)
|
|
177
|
+
self.class.acceptable_attribute_map.each_pair do |attr, param|
|
|
178
|
+
value = self.send(attr)
|
|
179
|
+
if value.nil?
|
|
180
|
+
is_nullable = self.class.acceptable_openapi_nullable.include?(attr)
|
|
181
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
182
|
+
end
|
|
183
|
+
|
|
184
|
+
hash[param] = _to_hash(value)
|
|
185
|
+
end
|
|
186
|
+
hash
|
|
187
|
+
end
|
|
188
|
+
|
|
189
|
+
end
|
|
190
|
+
|
|
191
|
+
end
|