appnigma-sdk 1.0.0 → 2.0.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 (75) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +14 -0
  3. data/README.md +147 -35
  4. data/lib/appnigma/checks.rb +29 -5
  5. data/lib/appnigma/client.rb +20 -12
  6. data/lib/appnigma/connections.rb +25 -5
  7. data/lib/appnigma/constants.rb +14 -8
  8. data/lib/appnigma/errors.rb +31 -5
  9. data/lib/appnigma/generated/api/default_api.rb +253 -20
  10. data/lib/appnigma/generated/api_client.rb +1 -1
  11. data/lib/appnigma/generated/api_error.rb +1 -1
  12. data/lib/appnigma/generated/api_model_base.rb +1 -1
  13. data/lib/appnigma/generated/configuration.rb +1 -1
  14. data/lib/appnigma/generated/models/action_entry.rb +1 -1
  15. data/lib/appnigma/generated/models/connection_status.rb +3 -2
  16. data/lib/appnigma/generated/models/create_connection_link_input.rb +2 -13
  17. data/lib/appnigma/generated/models/create_connection_link_output.rb +1 -1
  18. data/lib/appnigma/generated/models/create_portal_link_input.rb +177 -0
  19. data/lib/appnigma/generated/models/create_portal_link_output.rb +205 -0
  20. data/lib/appnigma/generated/models/crm_company.rb +1 -1
  21. data/lib/appnigma/generated/models/crm_company_get_output.rb +1 -1
  22. data/lib/appnigma/generated/models/crm_company_list_output.rb +1 -1
  23. data/lib/appnigma/generated/models/crm_company_write_output.rb +1 -1
  24. data/lib/appnigma/generated/models/crm_contact.rb +1 -1
  25. data/lib/appnigma/generated/models/crm_contact_get_output.rb +1 -1
  26. data/lib/appnigma/generated/models/crm_contact_list_output.rb +1 -1
  27. data/lib/appnigma/generated/models/crm_contact_write_output.rb +1 -1
  28. data/lib/appnigma/generated/models/crm_create_input.rb +2 -13
  29. data/lib/appnigma/generated/models/crm_custom_field.rb +1 -1
  30. data/lib/appnigma/generated/models/crm_deal.rb +1 -1
  31. data/lib/appnigma/generated/models/crm_deal_create_input.rb +2 -13
  32. data/lib/appnigma/generated/models/crm_deal_get_output.rb +1 -1
  33. data/lib/appnigma/generated/models/crm_deal_list_output.rb +1 -1
  34. data/lib/appnigma/generated/models/crm_deal_write_output.rb +1 -1
  35. data/lib/appnigma/generated/models/crm_email.rb +1 -1
  36. data/lib/appnigma/generated/models/crm_get_input.rb +2 -13
  37. data/lib/appnigma/generated/models/crm_labelled.rb +1 -1
  38. data/lib/appnigma/generated/models/crm_list_input.rb +2 -13
  39. data/lib/appnigma/generated/models/crm_phone.rb +1 -1
  40. data/lib/appnigma/generated/models/crm_update_input.rb +2 -13
  41. data/lib/appnigma/generated/models/end_customer.rb +247 -0
  42. data/lib/appnigma/generated/models/end_customer_connection.rb +239 -0
  43. data/lib/appnigma/generated/models/function_entry.rb +74 -5
  44. data/lib/appnigma/generated/models/function_owner.rb +1 -1
  45. data/lib/appnigma/generated/models/function_owner_one_of.rb +1 -1
  46. data/lib/appnigma/generated/models/function_owner_one_of1.rb +18 -17
  47. data/lib/appnigma/generated/models/get_connection_input.rb +216 -0
  48. data/lib/appnigma/generated/models/get_connection_output.rb +18 -5
  49. data/lib/appnigma/generated/models/get_guide_output.rb +1 -1
  50. data/lib/appnigma/generated/models/json_value.rb +1 -1
  51. data/lib/appnigma/generated/models/list_actions_output.rb +1 -1
  52. data/lib/appnigma/generated/models/list_connections_output.rb +193 -0
  53. data/lib/appnigma/generated/models/list_functions_output.rb +1 -1
  54. data/lib/appnigma/generated/models/list_platforms_output.rb +1 -1
  55. data/lib/appnigma/generated/models/logic_conditional.rb +247 -0
  56. data/lib/appnigma/generated/models/platform_entry.rb +1 -1
  57. data/lib/appnigma/generated/models/platform_entry_coverage_inner.rb +1 -1
  58. data/lib/appnigma/generated/models/platform_request_input.rb +2 -13
  59. data/lib/appnigma/generated/models/platform_request_input_body.rb +1 -1
  60. data/lib/appnigma/generated/models/platform_request_output.rb +1 -1
  61. data/lib/appnigma/generated/models/ran_as.rb +1 -1
  62. data/lib/appnigma/generated/models/run_action_input.rb +2 -13
  63. data/lib/appnigma/generated/models/run_action_output.rb +1 -1
  64. data/lib/appnigma/generated/models/run_input.rb +37 -24
  65. data/lib/appnigma/generated/models/run_output.rb +1 -1
  66. data/lib/appnigma/generated/models/sdk_error.rb +1 -1
  67. data/lib/appnigma/generated/models/sdk_error_error.rb +3 -3
  68. data/lib/appnigma/generated/models/sdk_error_error_details.rb +12 -3
  69. data/lib/appnigma/generated/models/sdk_problem.rb +1 -1
  70. data/lib/appnigma/generated/version.rb +1 -1
  71. data/lib/appnigma/generated.rb +8 -1
  72. data/lib/appnigma/portal.rb +21 -0
  73. data/lib/appnigma/transport.rb +4 -4
  74. data/lib/appnigma/version.rb +2 -2
  75. metadata +9 -1
@@ -3,7 +3,7 @@
3
3
 
4
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
5
 
6
- The version of the OpenAPI document: 3.0.0
6
+ The version of the OpenAPI document: 4.0.0
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
9
  Generator version: 7.26.0
@@ -15,7 +15,7 @@ require 'time'
15
15
 
16
16
  module Appnigma::Generated
17
17
  class CrmListInput < ApiModelBase
18
- # Your own id for the end customer.
18
+ # Your own id for the end customer: it must be 1 to 255 characters, with no control characters and not only spaces. Stored exactly as sent: ids that differ only in case or spaces are different end customers.
19
19
  attr_accessor :end_customer_id
20
20
 
21
21
  # The platform key, such as hubspot.
@@ -119,11 +119,6 @@ module Appnigma::Generated
119
119
  invalid_properties.push('invalid value for "end_customer_id", end_customer_id cannot be nil.')
120
120
  end
121
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
122
  if @platform.nil?
128
123
  invalid_properties.push('invalid value for "platform", platform cannot be nil.')
129
124
  end
@@ -157,7 +152,6 @@ module Appnigma::Generated
157
152
  def valid?
158
153
  warn '[DEPRECATED] the `valid?` method is obsolete'
159
154
  return false if @end_customer_id.nil?
160
- return false if @end_customer_id !~ Regexp.new(/^[A-Za-z0-9._-]{1,100}$/)
161
155
  return false if @platform.nil?
162
156
  return false if @platform !~ Regexp.new(/^[a-z0-9]+(?:-[a-z0-9]+)*$/)
163
157
  return false if !@limit.nil? && @limit > 100
@@ -174,11 +168,6 @@ module Appnigma::Generated
174
168
  fail ArgumentError, 'end_customer_id cannot be nil'
175
169
  end
176
170
 
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
171
  @end_customer_id = end_customer_id
183
172
  end
184
173
 
@@ -3,7 +3,7 @@
3
3
 
4
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
5
 
6
- The version of the OpenAPI document: 3.0.0
6
+ The version of the OpenAPI document: 4.0.0
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
9
  Generator version: 7.26.0
@@ -3,7 +3,7 @@
3
3
 
4
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
5
 
6
- The version of the OpenAPI document: 3.0.0
6
+ The version of the OpenAPI document: 4.0.0
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
9
  Generator version: 7.26.0
@@ -15,7 +15,7 @@ require 'time'
15
15
 
16
16
  module Appnigma::Generated
17
17
  class CrmUpdateInput < ApiModelBase
18
- # Your own id for the end customer.
18
+ # Your own id for the end customer: it must be 1 to 255 characters, with no control characters and not only spaces. Stored exactly as sent: ids that differ only in case or spaces are different end customers.
19
19
  attr_accessor :end_customer_id
20
20
 
21
21
  # The platform key, such as hubspot.
@@ -125,11 +125,6 @@ module Appnigma::Generated
125
125
  invalid_properties.push('invalid value for "end_customer_id", end_customer_id cannot be nil.')
126
126
  end
127
127
 
128
- pattern = Regexp.new(/^[A-Za-z0-9._-]{1,100}$/)
129
- if @end_customer_id !~ pattern
130
- invalid_properties.push("invalid value for \"end_customer_id\", must conform to the pattern #{pattern}.")
131
- end
132
-
133
128
  if @platform.nil?
134
129
  invalid_properties.push('invalid value for "platform", platform cannot be nil.')
135
130
  end
@@ -163,7 +158,6 @@ module Appnigma::Generated
163
158
  def valid?
164
159
  warn '[DEPRECATED] the `valid?` method is obsolete'
165
160
  return false if @end_customer_id.nil?
166
- return false if @end_customer_id !~ Regexp.new(/^[A-Za-z0-9._-]{1,100}$/)
167
161
  return false if @platform.nil?
168
162
  return false if @platform !~ Regexp.new(/^[a-z0-9]+(?:-[a-z0-9]+)*$/)
169
163
  return false if @id.nil?
@@ -180,11 +174,6 @@ module Appnigma::Generated
180
174
  fail ArgumentError, 'end_customer_id cannot be nil'
181
175
  end
182
176
 
183
- pattern = Regexp.new(/^[A-Za-z0-9._-]{1,100}$/)
184
- if end_customer_id !~ pattern
185
- fail ArgumentError, "invalid value for \"end_customer_id\", must conform to the pattern #{pattern}."
186
- end
187
-
188
177
  @end_customer_id = end_customer_id
189
178
  end
190
179
 
@@ -0,0 +1,247 @@
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: 4.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 EndCustomer < ApiModelBase
18
+ # Your own id for the end customer, exactly as you sent it
19
+ attr_accessor :end_customer_id
20
+
21
+ # The folder for this end customer's own logic, end-customers/<logicFolderKey>/ in your logic repo. Null only for an end customer connected before the key existed, until the backfill has run.
22
+ attr_accessor :logic_folder_key
23
+
24
+ # True when the live version holds at least one function written for this end customer
25
+ attr_accessor :has_custom_logic
26
+
27
+ # Every connection of theirs, on every platform, whatever the filters asked
28
+ attr_accessor :connections
29
+
30
+ # Attribute mapping from ruby-style variable name to JSON key.
31
+ def self.attribute_map
32
+ {
33
+ :'end_customer_id' => :'endCustomerId',
34
+ :'logic_folder_key' => :'logicFolderKey',
35
+ :'has_custom_logic' => :'hasCustomLogic',
36
+ :'connections' => :'connections'
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
+ :'logic_folder_key' => :'String',
55
+ :'has_custom_logic' => :'Boolean',
56
+ :'connections' => :'Array<EndCustomerConnection>'
57
+ }
58
+ end
59
+
60
+ # List of attributes with nullable: true
61
+ def self.openapi_nullable
62
+ Set.new([
63
+ :'logic_folder_key',
64
+ ])
65
+ end
66
+
67
+ # Returns attribute type mapping
68
+ def self.acceptable_openapi_types
69
+ openapi_types
70
+ end
71
+
72
+ # Returns the nullable attributes
73
+ def self.acceptable_openapi_nullable
74
+ openapi_nullable
75
+ end
76
+
77
+ # Initializes the object
78
+ # @param [Hash] attributes Model attributes in the form of hash
79
+ def initialize(attributes = {})
80
+ if (!attributes.is_a?(Hash))
81
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Appnigma::Generated::EndCustomer` initialize method"
82
+ end
83
+
84
+ # check to see if the attribute exists and convert string to symbol for hash key
85
+ acceptable_attribute_map = self.class.acceptable_attribute_map
86
+ attributes = attributes.each_with_object({}) { |(k, v), h|
87
+ if (!acceptable_attribute_map.key?(k.to_sym))
88
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Appnigma::Generated::EndCustomer`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
89
+ end
90
+ h[k.to_sym] = v
91
+ }
92
+
93
+ if attributes.key?(:'end_customer_id')
94
+ self.end_customer_id = attributes[:'end_customer_id']
95
+ else
96
+ self.end_customer_id = nil
97
+ end
98
+
99
+ if attributes.key?(:'logic_folder_key')
100
+ self.logic_folder_key = attributes[:'logic_folder_key']
101
+ else
102
+ self.logic_folder_key = nil
103
+ end
104
+
105
+ if attributes.key?(:'has_custom_logic')
106
+ self.has_custom_logic = attributes[:'has_custom_logic']
107
+ else
108
+ self.has_custom_logic = nil
109
+ end
110
+
111
+ if attributes.key?(:'connections')
112
+ if (value = attributes[:'connections']).is_a?(Array)
113
+ self.connections = value
114
+ end
115
+ else
116
+ self.connections = nil
117
+ end
118
+ end
119
+
120
+ # Show invalid properties with the reasons. Usually used together with valid?
121
+ # @return Array for valid properties with the reasons
122
+ def list_invalid_properties
123
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
124
+ invalid_properties = Array.new
125
+ if @end_customer_id.nil?
126
+ invalid_properties.push('invalid value for "end_customer_id", end_customer_id cannot be nil.')
127
+ end
128
+
129
+ if @has_custom_logic.nil?
130
+ invalid_properties.push('invalid value for "has_custom_logic", has_custom_logic cannot be nil.')
131
+ end
132
+
133
+ if @connections.nil?
134
+ invalid_properties.push('invalid value for "connections", connections cannot be nil.')
135
+ end
136
+
137
+ invalid_properties
138
+ end
139
+
140
+ # Check to see if the all the properties in the model are valid
141
+ # @return true if the model is valid
142
+ def valid?
143
+ warn '[DEPRECATED] the `valid?` method is obsolete'
144
+ return false if @end_customer_id.nil?
145
+ return false if @has_custom_logic.nil?
146
+ return false if @connections.nil?
147
+ true
148
+ end
149
+
150
+ # Custom attribute writer method with validation
151
+ # @param [Object] end_customer_id Value to be assigned
152
+ def end_customer_id=(end_customer_id)
153
+ if end_customer_id.nil?
154
+ fail ArgumentError, 'end_customer_id cannot be nil'
155
+ end
156
+
157
+ @end_customer_id = end_customer_id
158
+ end
159
+
160
+ # Custom attribute writer method with validation
161
+ # @param [Object] has_custom_logic Value to be assigned
162
+ def has_custom_logic=(has_custom_logic)
163
+ if has_custom_logic.nil?
164
+ fail ArgumentError, 'has_custom_logic cannot be nil'
165
+ end
166
+
167
+ @has_custom_logic = has_custom_logic
168
+ end
169
+
170
+ # Custom attribute writer method with validation
171
+ # @param [Object] connections Value to be assigned
172
+ def connections=(connections)
173
+ if connections.nil?
174
+ fail ArgumentError, 'connections cannot be nil'
175
+ end
176
+
177
+ @connections = connections
178
+ end
179
+
180
+ # Checks equality by comparing each attribute.
181
+ # @param [Object] Object to be compared
182
+ def ==(o)
183
+ return true if self.equal?(o)
184
+ self.class == o.class &&
185
+ end_customer_id == o.end_customer_id &&
186
+ logic_folder_key == o.logic_folder_key &&
187
+ has_custom_logic == o.has_custom_logic &&
188
+ connections == o.connections
189
+ end
190
+
191
+ # @see the `==` method
192
+ # @param [Object] Object to be compared
193
+ def eql?(o)
194
+ self == o
195
+ end
196
+
197
+ # Calculates hash code according to all attributes.
198
+ # @return [Integer] Hash code
199
+ def hash
200
+ [end_customer_id, logic_folder_key, has_custom_logic, connections].hash
201
+ end
202
+
203
+ # Builds the object from hash
204
+ # @param [Hash] attributes Model attributes in the form of hash
205
+ # @return [Object] Returns the model itself
206
+ def self.build_from_hash(attributes)
207
+ return nil unless attributes.is_a?(Hash)
208
+ attributes = attributes.transform_keys(&:to_sym)
209
+ # include attributes inherited from allOf parents (the nearest declaration wins)
210
+ map = acceptable_attribute_map
211
+ transformed_hash = {}
212
+ acceptable_openapi_types.each_pair do |key, type|
213
+ if attributes.key?(map[key]) && attributes[map[key]].nil?
214
+ transformed_hash["#{key}"] = nil
215
+ elsif type =~ /\AArray<(.*)>/i
216
+ # check to ensure the input is an array given that the attribute
217
+ # is documented as an array but the input is not
218
+ if attributes[map[key]].is_a?(Array)
219
+ transformed_hash["#{key}"] = attributes[map[key]].map { |v| _deserialize($1, v) }
220
+ end
221
+ elsif !attributes[map[key]].nil?
222
+ transformed_hash["#{key}"] = _deserialize(type, attributes[map[key]])
223
+ end
224
+ end
225
+ new(transformed_hash)
226
+ end
227
+
228
+ # Returns the object in the form of hash
229
+ # @return [Hash] Returns the object in the form of hash
230
+ def to_hash
231
+ hash = {}
232
+ # include attributes inherited from allOf parents (the nearest declaration wins)
233
+ self.class.acceptable_attribute_map.each_pair do |attr, param|
234
+ value = self.send(attr)
235
+ if value.nil?
236
+ is_nullable = self.class.acceptable_openapi_nullable.include?(attr)
237
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
238
+ end
239
+
240
+ hash[param] = _to_hash(value)
241
+ end
242
+ hash
243
+ end
244
+
245
+ end
246
+
247
+ end
@@ -0,0 +1,239 @@
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: 4.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 EndCustomerConnection < ApiModelBase
18
+ # The platform key
19
+ attr_accessor :platform
20
+
21
+ attr_accessor :status
22
+
23
+ # ISO 8601, in UTC. Null while pending.
24
+ attr_accessor :connected_at
25
+
26
+ class EnumAttributeValidator
27
+ attr_reader :datatype
28
+ attr_reader :allowable_values
29
+
30
+ def initialize(datatype, allowable_values)
31
+ @allowable_values = allowable_values.map do |value|
32
+ case datatype.to_s
33
+ when /Integer/i
34
+ value.to_i
35
+ when /Float/i
36
+ value.to_f
37
+ else
38
+ value
39
+ end
40
+ end
41
+ end
42
+
43
+ def valid?(value)
44
+ !value || allowable_values.include?(value)
45
+ end
46
+ end
47
+
48
+ # Attribute mapping from ruby-style variable name to JSON key.
49
+ def self.attribute_map
50
+ {
51
+ :'platform' => :'platform',
52
+ :'status' => :'status',
53
+ :'connected_at' => :'connectedAt'
54
+ }
55
+ end
56
+
57
+ # Returns attribute mapping this model knows about
58
+ def self.acceptable_attribute_map
59
+ attribute_map
60
+ end
61
+
62
+ # Returns all the JSON keys this model knows about
63
+ def self.acceptable_attributes
64
+ acceptable_attribute_map.values
65
+ end
66
+
67
+ # Attribute type mapping.
68
+ def self.openapi_types
69
+ {
70
+ :'platform' => :'String',
71
+ :'status' => :'ConnectionStatus',
72
+ :'connected_at' => :'String'
73
+ }
74
+ end
75
+
76
+ # List of attributes with nullable: true
77
+ def self.openapi_nullable
78
+ Set.new([
79
+ :'connected_at'
80
+ ])
81
+ end
82
+
83
+ # Returns attribute type mapping
84
+ def self.acceptable_openapi_types
85
+ openapi_types
86
+ end
87
+
88
+ # Returns the nullable attributes
89
+ def self.acceptable_openapi_nullable
90
+ openapi_nullable
91
+ end
92
+
93
+ # Initializes the object
94
+ # @param [Hash] attributes Model attributes in the form of hash
95
+ def initialize(attributes = {})
96
+ if (!attributes.is_a?(Hash))
97
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Appnigma::Generated::EndCustomerConnection` initialize method"
98
+ end
99
+
100
+ # check to see if the attribute exists and convert string to symbol for hash key
101
+ acceptable_attribute_map = self.class.acceptable_attribute_map
102
+ attributes = attributes.each_with_object({}) { |(k, v), h|
103
+ if (!acceptable_attribute_map.key?(k.to_sym))
104
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Appnigma::Generated::EndCustomerConnection`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
105
+ end
106
+ h[k.to_sym] = v
107
+ }
108
+
109
+ if attributes.key?(:'platform')
110
+ self.platform = attributes[:'platform']
111
+ else
112
+ self.platform = nil
113
+ end
114
+
115
+ if attributes.key?(:'status')
116
+ self.status = attributes[:'status']
117
+ else
118
+ self.status = nil
119
+ end
120
+
121
+ if attributes.key?(:'connected_at')
122
+ self.connected_at = attributes[:'connected_at']
123
+ else
124
+ self.connected_at = nil
125
+ end
126
+ end
127
+
128
+ # Show invalid properties with the reasons. Usually used together with valid?
129
+ # @return Array for valid properties with the reasons
130
+ def list_invalid_properties
131
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
132
+ invalid_properties = Array.new
133
+ if @platform.nil?
134
+ invalid_properties.push('invalid value for "platform", platform cannot be nil.')
135
+ end
136
+
137
+ if @status.nil?
138
+ invalid_properties.push('invalid value for "status", status cannot be nil.')
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 @platform.nil?
149
+ return false if @status.nil?
150
+ true
151
+ end
152
+
153
+ # Custom attribute writer method with validation
154
+ # @param [Object] platform Value to be assigned
155
+ def platform=(platform)
156
+ if platform.nil?
157
+ fail ArgumentError, 'platform cannot be nil'
158
+ end
159
+
160
+ @platform = platform
161
+ end
162
+
163
+ # Custom attribute writer method with validation
164
+ # @param [Object] status Value to be assigned
165
+ def status=(status)
166
+ if status.nil?
167
+ fail ArgumentError, 'status cannot be nil'
168
+ end
169
+
170
+ @status = status
171
+ end
172
+
173
+ # Checks equality by comparing each attribute.
174
+ # @param [Object] Object to be compared
175
+ def ==(o)
176
+ return true if self.equal?(o)
177
+ self.class == o.class &&
178
+ platform == o.platform &&
179
+ status == o.status &&
180
+ connected_at == o.connected_at
181
+ end
182
+
183
+ # @see the `==` method
184
+ # @param [Object] Object to be compared
185
+ def eql?(o)
186
+ self == o
187
+ end
188
+
189
+ # Calculates hash code according to all attributes.
190
+ # @return [Integer] Hash code
191
+ def hash
192
+ [platform, status, connected_at].hash
193
+ end
194
+
195
+ # Builds the object from hash
196
+ # @param [Hash] attributes Model attributes in the form of hash
197
+ # @return [Object] Returns the model itself
198
+ def self.build_from_hash(attributes)
199
+ return nil unless attributes.is_a?(Hash)
200
+ attributes = attributes.transform_keys(&:to_sym)
201
+ # include attributes inherited from allOf parents (the nearest declaration wins)
202
+ map = acceptable_attribute_map
203
+ transformed_hash = {}
204
+ acceptable_openapi_types.each_pair do |key, type|
205
+ if attributes.key?(map[key]) && attributes[map[key]].nil?
206
+ transformed_hash["#{key}"] = nil
207
+ elsif type =~ /\AArray<(.*)>/i
208
+ # check to ensure the input is an array given that the attribute
209
+ # is documented as an array but the input is not
210
+ if attributes[map[key]].is_a?(Array)
211
+ transformed_hash["#{key}"] = attributes[map[key]].map { |v| _deserialize($1, v) }
212
+ end
213
+ elsif !attributes[map[key]].nil?
214
+ transformed_hash["#{key}"] = _deserialize(type, attributes[map[key]])
215
+ end
216
+ end
217
+ new(transformed_hash)
218
+ end
219
+
220
+ # Returns the object in the form of hash
221
+ # @return [Hash] Returns the object in the form of hash
222
+ def to_hash
223
+ hash = {}
224
+ # include attributes inherited from allOf parents (the nearest declaration wins)
225
+ self.class.acceptable_attribute_map.each_pair do |attr, param|
226
+ value = self.send(attr)
227
+ if value.nil?
228
+ is_nullable = self.class.acceptable_openapi_nullable.include?(attr)
229
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
230
+ end
231
+
232
+ hash[param] = _to_hash(value)
233
+ end
234
+ hash
235
+ end
236
+
237
+ end
238
+
239
+ end