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,190 @@
|
|
|
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
|
+
# The CRM's own stage or pipeline: its id, and its name when the CRM has one.
|
|
18
|
+
class CrmLabelled < ApiModelBase
|
|
19
|
+
attr_accessor :id
|
|
20
|
+
|
|
21
|
+
attr_accessor :label
|
|
22
|
+
|
|
23
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
24
|
+
def self.attribute_map
|
|
25
|
+
{
|
|
26
|
+
:'id' => :'id',
|
|
27
|
+
:'label' => :'label'
|
|
28
|
+
}
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
# Returns attribute mapping this model knows about
|
|
32
|
+
def self.acceptable_attribute_map
|
|
33
|
+
attribute_map
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
# Returns all the JSON keys this model knows about
|
|
37
|
+
def self.acceptable_attributes
|
|
38
|
+
acceptable_attribute_map.values
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
# Attribute type mapping.
|
|
42
|
+
def self.openapi_types
|
|
43
|
+
{
|
|
44
|
+
:'id' => :'String',
|
|
45
|
+
:'label' => :'String'
|
|
46
|
+
}
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
# List of attributes with nullable: true
|
|
50
|
+
def self.openapi_nullable
|
|
51
|
+
Set.new([
|
|
52
|
+
:'label'
|
|
53
|
+
])
|
|
54
|
+
end
|
|
55
|
+
|
|
56
|
+
# Returns attribute type mapping
|
|
57
|
+
def self.acceptable_openapi_types
|
|
58
|
+
openapi_types
|
|
59
|
+
end
|
|
60
|
+
|
|
61
|
+
# Returns the nullable attributes
|
|
62
|
+
def self.acceptable_openapi_nullable
|
|
63
|
+
openapi_nullable
|
|
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 `Appnigma::Generated::CrmLabelled` initialize method"
|
|
71
|
+
end
|
|
72
|
+
|
|
73
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
74
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
75
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
76
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
77
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Appnigma::Generated::CrmLabelled`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
78
|
+
end
|
|
79
|
+
h[k.to_sym] = v
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
if attributes.key?(:'id')
|
|
83
|
+
self.id = attributes[:'id']
|
|
84
|
+
else
|
|
85
|
+
self.id = nil
|
|
86
|
+
end
|
|
87
|
+
|
|
88
|
+
if attributes.key?(:'label')
|
|
89
|
+
self.label = attributes[:'label']
|
|
90
|
+
else
|
|
91
|
+
self.label = nil
|
|
92
|
+
end
|
|
93
|
+
end
|
|
94
|
+
|
|
95
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
96
|
+
# @return Array for valid properties with the reasons
|
|
97
|
+
def list_invalid_properties
|
|
98
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
99
|
+
invalid_properties = Array.new
|
|
100
|
+
if @id.nil?
|
|
101
|
+
invalid_properties.push('invalid value for "id", id cannot be nil.')
|
|
102
|
+
end
|
|
103
|
+
|
|
104
|
+
invalid_properties
|
|
105
|
+
end
|
|
106
|
+
|
|
107
|
+
# Check to see if the all the properties in the model are valid
|
|
108
|
+
# @return true if the model is valid
|
|
109
|
+
def valid?
|
|
110
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
111
|
+
return false if @id.nil?
|
|
112
|
+
true
|
|
113
|
+
end
|
|
114
|
+
|
|
115
|
+
# Custom attribute writer method with validation
|
|
116
|
+
# @param [Object] id Value to be assigned
|
|
117
|
+
def id=(id)
|
|
118
|
+
if id.nil?
|
|
119
|
+
fail ArgumentError, 'id cannot be nil'
|
|
120
|
+
end
|
|
121
|
+
|
|
122
|
+
@id = id
|
|
123
|
+
end
|
|
124
|
+
|
|
125
|
+
# Checks equality by comparing each attribute.
|
|
126
|
+
# @param [Object] Object to be compared
|
|
127
|
+
def ==(o)
|
|
128
|
+
return true if self.equal?(o)
|
|
129
|
+
self.class == o.class &&
|
|
130
|
+
id == o.id &&
|
|
131
|
+
label == o.label
|
|
132
|
+
end
|
|
133
|
+
|
|
134
|
+
# @see the `==` method
|
|
135
|
+
# @param [Object] Object to be compared
|
|
136
|
+
def eql?(o)
|
|
137
|
+
self == o
|
|
138
|
+
end
|
|
139
|
+
|
|
140
|
+
# Calculates hash code according to all attributes.
|
|
141
|
+
# @return [Integer] Hash code
|
|
142
|
+
def hash
|
|
143
|
+
[id, label].hash
|
|
144
|
+
end
|
|
145
|
+
|
|
146
|
+
# Builds the object from hash
|
|
147
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
148
|
+
# @return [Object] Returns the model itself
|
|
149
|
+
def self.build_from_hash(attributes)
|
|
150
|
+
return nil unless attributes.is_a?(Hash)
|
|
151
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
152
|
+
# include attributes inherited from allOf parents (the nearest declaration wins)
|
|
153
|
+
map = acceptable_attribute_map
|
|
154
|
+
transformed_hash = {}
|
|
155
|
+
acceptable_openapi_types.each_pair do |key, type|
|
|
156
|
+
if attributes.key?(map[key]) && attributes[map[key]].nil?
|
|
157
|
+
transformed_hash["#{key}"] = nil
|
|
158
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
159
|
+
# check to ensure the input is an array given that the attribute
|
|
160
|
+
# is documented as an array but the input is not
|
|
161
|
+
if attributes[map[key]].is_a?(Array)
|
|
162
|
+
transformed_hash["#{key}"] = attributes[map[key]].map { |v| _deserialize($1, v) }
|
|
163
|
+
end
|
|
164
|
+
elsif !attributes[map[key]].nil?
|
|
165
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[map[key]])
|
|
166
|
+
end
|
|
167
|
+
end
|
|
168
|
+
new(transformed_hash)
|
|
169
|
+
end
|
|
170
|
+
|
|
171
|
+
# Returns the object in the form of hash
|
|
172
|
+
# @return [Hash] Returns the object in the form of hash
|
|
173
|
+
def to_hash
|
|
174
|
+
hash = {}
|
|
175
|
+
# include attributes inherited from allOf parents (the nearest declaration wins)
|
|
176
|
+
self.class.acceptable_attribute_map.each_pair do |attr, param|
|
|
177
|
+
value = self.send(attr)
|
|
178
|
+
if value.nil?
|
|
179
|
+
is_nullable = self.class.acceptable_openapi_nullable.include?(attr)
|
|
180
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
181
|
+
end
|
|
182
|
+
|
|
183
|
+
hash[param] = _to_hash(value)
|
|
184
|
+
end
|
|
185
|
+
hash
|
|
186
|
+
end
|
|
187
|
+
|
|
188
|
+
end
|
|
189
|
+
|
|
190
|
+
end
|
|
@@ -0,0 +1,303 @@
|
|
|
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 CrmListInput < ApiModelBase
|
|
18
|
+
# Your own id for the end customer.
|
|
19
|
+
attr_accessor :end_customer_id
|
|
20
|
+
|
|
21
|
+
# The platform key, such as hubspot.
|
|
22
|
+
attr_accessor :platform
|
|
23
|
+
|
|
24
|
+
# 1 to 100. Default 100.
|
|
25
|
+
attr_accessor :limit
|
|
26
|
+
|
|
27
|
+
# The next value from the previous page.
|
|
28
|
+
attr_accessor :cursor
|
|
29
|
+
|
|
30
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
31
|
+
def self.attribute_map
|
|
32
|
+
{
|
|
33
|
+
:'end_customer_id' => :'endCustomerId',
|
|
34
|
+
:'platform' => :'platform',
|
|
35
|
+
:'limit' => :'limit',
|
|
36
|
+
:'cursor' => :'cursor'
|
|
37
|
+
}
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
# Returns attribute mapping this model knows about
|
|
41
|
+
def self.acceptable_attribute_map
|
|
42
|
+
attribute_map
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
# Returns all the JSON keys this model knows about
|
|
46
|
+
def self.acceptable_attributes
|
|
47
|
+
acceptable_attribute_map.values
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
# Attribute type mapping.
|
|
51
|
+
def self.openapi_types
|
|
52
|
+
{
|
|
53
|
+
:'end_customer_id' => :'String',
|
|
54
|
+
:'platform' => :'String',
|
|
55
|
+
:'limit' => :'Integer',
|
|
56
|
+
:'cursor' => :'String'
|
|
57
|
+
}
|
|
58
|
+
end
|
|
59
|
+
|
|
60
|
+
# List of attributes with nullable: true
|
|
61
|
+
def self.openapi_nullable
|
|
62
|
+
Set.new([
|
|
63
|
+
])
|
|
64
|
+
end
|
|
65
|
+
|
|
66
|
+
# Returns attribute type mapping
|
|
67
|
+
def self.acceptable_openapi_types
|
|
68
|
+
openapi_types
|
|
69
|
+
end
|
|
70
|
+
|
|
71
|
+
# Returns the nullable attributes
|
|
72
|
+
def self.acceptable_openapi_nullable
|
|
73
|
+
openapi_nullable
|
|
74
|
+
end
|
|
75
|
+
|
|
76
|
+
# Initializes the object
|
|
77
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
78
|
+
def initialize(attributes = {})
|
|
79
|
+
if (!attributes.is_a?(Hash))
|
|
80
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Appnigma::Generated::CrmListInput` initialize method"
|
|
81
|
+
end
|
|
82
|
+
|
|
83
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
84
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
85
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
86
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
87
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Appnigma::Generated::CrmListInput`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
88
|
+
end
|
|
89
|
+
h[k.to_sym] = v
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
if attributes.key?(:'end_customer_id')
|
|
93
|
+
self.end_customer_id = attributes[:'end_customer_id']
|
|
94
|
+
else
|
|
95
|
+
self.end_customer_id = nil
|
|
96
|
+
end
|
|
97
|
+
|
|
98
|
+
if attributes.key?(:'platform')
|
|
99
|
+
self.platform = attributes[:'platform']
|
|
100
|
+
else
|
|
101
|
+
self.platform = nil
|
|
102
|
+
end
|
|
103
|
+
|
|
104
|
+
if attributes.key?(:'limit')
|
|
105
|
+
self.limit = attributes[:'limit']
|
|
106
|
+
end
|
|
107
|
+
|
|
108
|
+
if attributes.key?(:'cursor')
|
|
109
|
+
self.cursor = attributes[:'cursor']
|
|
110
|
+
end
|
|
111
|
+
end
|
|
112
|
+
|
|
113
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
114
|
+
# @return Array for valid properties with the reasons
|
|
115
|
+
def list_invalid_properties
|
|
116
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
117
|
+
invalid_properties = Array.new
|
|
118
|
+
if @end_customer_id.nil?
|
|
119
|
+
invalid_properties.push('invalid value for "end_customer_id", end_customer_id cannot be nil.')
|
|
120
|
+
end
|
|
121
|
+
|
|
122
|
+
pattern = Regexp.new(/^[A-Za-z0-9._-]{1,100}$/)
|
|
123
|
+
if @end_customer_id !~ pattern
|
|
124
|
+
invalid_properties.push("invalid value for \"end_customer_id\", must conform to the pattern #{pattern}.")
|
|
125
|
+
end
|
|
126
|
+
|
|
127
|
+
if @platform.nil?
|
|
128
|
+
invalid_properties.push('invalid value for "platform", platform cannot be nil.')
|
|
129
|
+
end
|
|
130
|
+
|
|
131
|
+
pattern = Regexp.new(/^[a-z0-9]+(?:-[a-z0-9]+)*$/)
|
|
132
|
+
if @platform !~ pattern
|
|
133
|
+
invalid_properties.push("invalid value for \"platform\", must conform to the pattern #{pattern}.")
|
|
134
|
+
end
|
|
135
|
+
|
|
136
|
+
if !@limit.nil? && @limit > 100
|
|
137
|
+
invalid_properties.push('invalid value for "limit", must be smaller than or equal to 100.')
|
|
138
|
+
end
|
|
139
|
+
|
|
140
|
+
if !@limit.nil? && @limit < 1
|
|
141
|
+
invalid_properties.push('invalid value for "limit", must be greater than or equal to 1.')
|
|
142
|
+
end
|
|
143
|
+
|
|
144
|
+
if !@cursor.nil? && @cursor.to_s.length > 2000
|
|
145
|
+
invalid_properties.push('invalid value for "cursor", the character length must be smaller than or equal to 2000.')
|
|
146
|
+
end
|
|
147
|
+
|
|
148
|
+
if !@cursor.nil? && @cursor.to_s.length < 1
|
|
149
|
+
invalid_properties.push('invalid value for "cursor", the character length must be greater than or equal to 1.')
|
|
150
|
+
end
|
|
151
|
+
|
|
152
|
+
invalid_properties
|
|
153
|
+
end
|
|
154
|
+
|
|
155
|
+
# Check to see if the all the properties in the model are valid
|
|
156
|
+
# @return true if the model is valid
|
|
157
|
+
def valid?
|
|
158
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
159
|
+
return false if @end_customer_id.nil?
|
|
160
|
+
return false if @end_customer_id !~ Regexp.new(/^[A-Za-z0-9._-]{1,100}$/)
|
|
161
|
+
return false if @platform.nil?
|
|
162
|
+
return false if @platform !~ Regexp.new(/^[a-z0-9]+(?:-[a-z0-9]+)*$/)
|
|
163
|
+
return false if !@limit.nil? && @limit > 100
|
|
164
|
+
return false if !@limit.nil? && @limit < 1
|
|
165
|
+
return false if !@cursor.nil? && @cursor.to_s.length > 2000
|
|
166
|
+
return false if !@cursor.nil? && @cursor.to_s.length < 1
|
|
167
|
+
true
|
|
168
|
+
end
|
|
169
|
+
|
|
170
|
+
# Custom attribute writer method with validation
|
|
171
|
+
# @param [Object] end_customer_id Value to be assigned
|
|
172
|
+
def end_customer_id=(end_customer_id)
|
|
173
|
+
if end_customer_id.nil?
|
|
174
|
+
fail ArgumentError, 'end_customer_id cannot be nil'
|
|
175
|
+
end
|
|
176
|
+
|
|
177
|
+
pattern = Regexp.new(/^[A-Za-z0-9._-]{1,100}$/)
|
|
178
|
+
if end_customer_id !~ pattern
|
|
179
|
+
fail ArgumentError, "invalid value for \"end_customer_id\", must conform to the pattern #{pattern}."
|
|
180
|
+
end
|
|
181
|
+
|
|
182
|
+
@end_customer_id = end_customer_id
|
|
183
|
+
end
|
|
184
|
+
|
|
185
|
+
# Custom attribute writer method with validation
|
|
186
|
+
# @param [Object] platform Value to be assigned
|
|
187
|
+
def platform=(platform)
|
|
188
|
+
if platform.nil?
|
|
189
|
+
fail ArgumentError, 'platform cannot be nil'
|
|
190
|
+
end
|
|
191
|
+
|
|
192
|
+
pattern = Regexp.new(/^[a-z0-9]+(?:-[a-z0-9]+)*$/)
|
|
193
|
+
if platform !~ pattern
|
|
194
|
+
fail ArgumentError, "invalid value for \"platform\", must conform to the pattern #{pattern}."
|
|
195
|
+
end
|
|
196
|
+
|
|
197
|
+
@platform = platform
|
|
198
|
+
end
|
|
199
|
+
|
|
200
|
+
# Custom attribute writer method with validation
|
|
201
|
+
# @param [Object] limit Value to be assigned
|
|
202
|
+
def limit=(limit)
|
|
203
|
+
if limit.nil?
|
|
204
|
+
fail ArgumentError, 'limit cannot be nil'
|
|
205
|
+
end
|
|
206
|
+
|
|
207
|
+
if limit > 100
|
|
208
|
+
fail ArgumentError, 'invalid value for "limit", must be smaller than or equal to 100.'
|
|
209
|
+
end
|
|
210
|
+
|
|
211
|
+
if limit < 1
|
|
212
|
+
fail ArgumentError, 'invalid value for "limit", must be greater than or equal to 1.'
|
|
213
|
+
end
|
|
214
|
+
|
|
215
|
+
@limit = limit
|
|
216
|
+
end
|
|
217
|
+
|
|
218
|
+
# Custom attribute writer method with validation
|
|
219
|
+
# @param [Object] cursor Value to be assigned
|
|
220
|
+
def cursor=(cursor)
|
|
221
|
+
if cursor.nil?
|
|
222
|
+
fail ArgumentError, 'cursor cannot be nil'
|
|
223
|
+
end
|
|
224
|
+
|
|
225
|
+
if cursor.to_s.length > 2000
|
|
226
|
+
fail ArgumentError, 'invalid value for "cursor", the character length must be smaller than or equal to 2000.'
|
|
227
|
+
end
|
|
228
|
+
|
|
229
|
+
if cursor.to_s.length < 1
|
|
230
|
+
fail ArgumentError, 'invalid value for "cursor", the character length must be greater than or equal to 1.'
|
|
231
|
+
end
|
|
232
|
+
|
|
233
|
+
@cursor = cursor
|
|
234
|
+
end
|
|
235
|
+
|
|
236
|
+
# Checks equality by comparing each attribute.
|
|
237
|
+
# @param [Object] Object to be compared
|
|
238
|
+
def ==(o)
|
|
239
|
+
return true if self.equal?(o)
|
|
240
|
+
self.class == o.class &&
|
|
241
|
+
end_customer_id == o.end_customer_id &&
|
|
242
|
+
platform == o.platform &&
|
|
243
|
+
limit == o.limit &&
|
|
244
|
+
cursor == o.cursor
|
|
245
|
+
end
|
|
246
|
+
|
|
247
|
+
# @see the `==` method
|
|
248
|
+
# @param [Object] Object to be compared
|
|
249
|
+
def eql?(o)
|
|
250
|
+
self == o
|
|
251
|
+
end
|
|
252
|
+
|
|
253
|
+
# Calculates hash code according to all attributes.
|
|
254
|
+
# @return [Integer] Hash code
|
|
255
|
+
def hash
|
|
256
|
+
[end_customer_id, platform, limit, cursor].hash
|
|
257
|
+
end
|
|
258
|
+
|
|
259
|
+
# Builds the object from hash
|
|
260
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
261
|
+
# @return [Object] Returns the model itself
|
|
262
|
+
def self.build_from_hash(attributes)
|
|
263
|
+
return nil unless attributes.is_a?(Hash)
|
|
264
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
265
|
+
# include attributes inherited from allOf parents (the nearest declaration wins)
|
|
266
|
+
map = acceptable_attribute_map
|
|
267
|
+
transformed_hash = {}
|
|
268
|
+
acceptable_openapi_types.each_pair do |key, type|
|
|
269
|
+
if attributes.key?(map[key]) && attributes[map[key]].nil?
|
|
270
|
+
transformed_hash["#{key}"] = nil
|
|
271
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
272
|
+
# check to ensure the input is an array given that the attribute
|
|
273
|
+
# is documented as an array but the input is not
|
|
274
|
+
if attributes[map[key]].is_a?(Array)
|
|
275
|
+
transformed_hash["#{key}"] = attributes[map[key]].map { |v| _deserialize($1, v) }
|
|
276
|
+
end
|
|
277
|
+
elsif !attributes[map[key]].nil?
|
|
278
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[map[key]])
|
|
279
|
+
end
|
|
280
|
+
end
|
|
281
|
+
new(transformed_hash)
|
|
282
|
+
end
|
|
283
|
+
|
|
284
|
+
# Returns the object in the form of hash
|
|
285
|
+
# @return [Hash] Returns the object in the form of hash
|
|
286
|
+
def to_hash
|
|
287
|
+
hash = {}
|
|
288
|
+
# include attributes inherited from allOf parents (the nearest declaration wins)
|
|
289
|
+
self.class.acceptable_attribute_map.each_pair do |attr, param|
|
|
290
|
+
value = self.send(attr)
|
|
291
|
+
if value.nil?
|
|
292
|
+
is_nullable = self.class.acceptable_openapi_nullable.include?(attr)
|
|
293
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
294
|
+
end
|
|
295
|
+
|
|
296
|
+
hash[param] = _to_hash(value)
|
|
297
|
+
end
|
|
298
|
+
hash
|
|
299
|
+
end
|
|
300
|
+
|
|
301
|
+
end
|
|
302
|
+
|
|
303
|
+
end
|