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