plainrouter-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 (75) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE +202 -0
  3. data/README.md +59 -0
  4. data/lib/plainrouter/client.rb +44 -0
  5. data/lib/plainrouter/openapi/api/event_api.rb +213 -0
  6. data/lib/plainrouter/openapi/api/operations_api.rb +542 -0
  7. data/lib/plainrouter/openapi/api/sandbox_api.rb +272 -0
  8. data/lib/plainrouter/openapi/api_client.rb +441 -0
  9. data/lib/plainrouter/openapi/api_error.rb +58 -0
  10. data/lib/plainrouter/openapi/api_model_base.rb +88 -0
  11. data/lib/plainrouter/openapi/configuration.rb +399 -0
  12. data/lib/plainrouter/openapi/models/create_event200_response.rb +190 -0
  13. data/lib/plainrouter/openapi/models/create_event_request.rb +103 -0
  14. data/lib/plainrouter/openapi/models/create_event_request_any_of.rb +344 -0
  15. data/lib/plainrouter/openapi/models/create_event_request_any_of1.rb +346 -0
  16. data/lib/plainrouter/openapi/models/create_event_request_any_of_event_time.rb +104 -0
  17. data/lib/plainrouter/openapi/models/create_event_request_any_of_value_data.rb +186 -0
  18. data/lib/plainrouter/openapi/models/create_sandbox_key201_response.rb +320 -0
  19. data/lib/plainrouter/openapi/models/create_sandbox_key201_response_use.rb +216 -0
  20. data/lib/plainrouter/openapi/models/delete_user_data200_response.rb +268 -0
  21. data/lib/plainrouter/openapi/models/delete_user_data_request.rb +225 -0
  22. data/lib/plainrouter/openapi/models/delivery_status.rb +49 -0
  23. data/lib/plainrouter/openapi/models/destination.rb +354 -0
  24. data/lib/plainrouter/openapi/models/destination_credential_source.rb +40 -0
  25. data/lib/plainrouter/openapi/models/destination_status.rb +40 -0
  26. data/lib/plainrouter/openapi/models/destination_type.rb +39 -0
  27. data/lib/plainrouter/openapi/models/emq_snapshot.rb +344 -0
  28. data/lib/plainrouter/openapi/models/error_message.rb +164 -0
  29. data/lib/plainrouter/openapi/models/event.rb +782 -0
  30. data/lib/plainrouter/openapi/models/get_emq_report200_response.rb +166 -0
  31. data/lib/plainrouter/openapi/models/get_emq_report200_response_snapshots_inner.rb +342 -0
  32. data/lib/plainrouter/openapi/models/get_event200_response.rb +218 -0
  33. data/lib/plainrouter/openapi/models/get_event200_response_deliveries_inner.rb +440 -0
  34. data/lib/plainrouter/openapi/models/get_event200_response_event.rb +624 -0
  35. data/lib/plainrouter/openapi/models/get_event200_response_event_consent.rb +103 -0
  36. data/lib/plainrouter/openapi/models/get_event200_response_event_deliveries_inner.rb +414 -0
  37. data/lib/plainrouter/openapi/models/get_event200_response_lineage.rb +178 -0
  38. data/lib/plainrouter/openapi/models/get_event200_response_lineage_children_inner.rb +596 -0
  39. data/lib/plainrouter/openapi/models/get_event200_response_lineage_parent.rb +596 -0
  40. data/lib/plainrouter/openapi/models/get_reconciliation_report200_response.rb +192 -0
  41. data/lib/plainrouter/openapi/models/get_reconciliation_report200_response_reports_inner.rb +476 -0
  42. data/lib/plainrouter/openapi/models/get_reconciliation_report200_response_reports_inner_buckets_value.rb +216 -0
  43. data/lib/plainrouter/openapi/models/get_reconciliation_report200_response_reports_inner_event_counts.rb +190 -0
  44. data/lib/plainrouter/openapi/models/get_reconciliation_report200_response_reports_inner_event_counts_accepted.rb +103 -0
  45. data/lib/plainrouter/openapi/models/get_sandbox200_response.rb +372 -0
  46. data/lib/plainrouter/openapi/models/get_sandbox200_response_self_serve_key.rb +242 -0
  47. data/lib/plainrouter/openapi/models/get_sandbox200_response_try.rb +242 -0
  48. data/lib/plainrouter/openapi/models/get_sandbox200_response_try_body.rb +242 -0
  49. data/lib/plainrouter/openapi/models/get_sandbox200_response_try_body_value_data.rb +216 -0
  50. data/lib/plainrouter/openapi/models/jurisdiction_policy_class.rb +40 -0
  51. data/lib/plainrouter/openapi/models/list_events200_response.rb +190 -0
  52. data/lib/plainrouter/openapi/models/list_events200_response_events.rb +382 -0
  53. data/lib/plainrouter/openapi/models/list_events200_response_events_links_inner.rb +202 -0
  54. data/lib/plainrouter/openapi/models/list_events200_response_metrics.rb +228 -0
  55. data/lib/plainrouter/openapi/models/list_events_by_cursor200_response.rb +190 -0
  56. data/lib/plainrouter/openapi/models/list_events_by_cursor200_response_events.rb +252 -0
  57. data/lib/plainrouter/openapi/models/reconciliation_report.rb +464 -0
  58. data/lib/plainrouter/openapi/models/replay_deliveries202_response.rb +242 -0
  59. data/lib/plainrouter/openapi/models/replay_deliveries_request.rb +199 -0
  60. data/lib/plainrouter/openapi/models/send_test_purchase200_response.rb +224 -0
  61. data/lib/plainrouter/openapi/models/send_test_purchase422_response.rb +103 -0
  62. data/lib/plainrouter/openapi/models/send_test_purchase_request.rb +224 -0
  63. data/lib/plainrouter/openapi/models/set_destination_test_mode200_response.rb +190 -0
  64. data/lib/plainrouter/openapi/models/set_destination_test_mode200_response_destination.rb +338 -0
  65. data/lib/plainrouter/openapi/models/set_destination_test_mode_request.rb +189 -0
  66. data/lib/plainrouter/openapi/models/traffic_class.rb +40 -0
  67. data/lib/plainrouter/openapi/models/validate_sandbox_event200_response.rb +320 -0
  68. data/lib/plainrouter/openapi/models/validate_sandbox_event_request.rb +194 -0
  69. data/lib/plainrouter/openapi/models/validate_sandbox_event_request_value_data.rb +166 -0
  70. data/lib/plainrouter/openapi/models/validation_error.rb +192 -0
  71. data/lib/plainrouter/openapi/version.rb +15 -0
  72. data/lib/plainrouter/openapi.rb +102 -0
  73. data/lib/plainrouter/version.rb +6 -0
  74. data/lib/plainrouter.rb +10 -0
  75. metadata +176 -0
@@ -0,0 +1,372 @@
1
+ =begin
2
+ #PlainRouter Conversion API
3
+
4
+ #PlainRouter public Signals Conversion API.
5
+
6
+ The version of the OpenAPI document: 0.5.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.25.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module PlainRouter::OpenAPI
17
+ class GetSandbox200Response < ApiModelBase
18
+ attr_accessor :environment
19
+
20
+ attr_accessor :authentication_required
21
+
22
+ attr_accessor :account_required
23
+
24
+ attr_accessor :production_data
25
+
26
+ attr_accessor :persists_data
27
+
28
+ attr_accessor :provider_delivery
29
+
30
+ attr_accessor :description
31
+
32
+ attr_accessor :self_serve_key
33
+
34
+ attr_accessor :try
35
+
36
+ # Attribute mapping from ruby-style variable name to JSON key.
37
+ def self.attribute_map
38
+ {
39
+ :'environment' => :'environment',
40
+ :'authentication_required' => :'authentication_required',
41
+ :'account_required' => :'account_required',
42
+ :'production_data' => :'production_data',
43
+ :'persists_data' => :'persists_data',
44
+ :'provider_delivery' => :'provider_delivery',
45
+ :'description' => :'description',
46
+ :'self_serve_key' => :'self_serve_key',
47
+ :'try' => :'try'
48
+ }
49
+ end
50
+
51
+ # Returns attribute mapping this model knows about
52
+ def self.acceptable_attribute_map
53
+ attribute_map
54
+ end
55
+
56
+ # Returns all the JSON keys this model knows about
57
+ def self.acceptable_attributes
58
+ acceptable_attribute_map.values
59
+ end
60
+
61
+ # Attribute type mapping.
62
+ def self.openapi_types
63
+ {
64
+ :'environment' => :'String',
65
+ :'authentication_required' => :'Boolean',
66
+ :'account_required' => :'Boolean',
67
+ :'production_data' => :'Boolean',
68
+ :'persists_data' => :'Boolean',
69
+ :'provider_delivery' => :'Boolean',
70
+ :'description' => :'String',
71
+ :'self_serve_key' => :'GetSandbox200ResponseSelfServeKey',
72
+ :'try' => :'GetSandbox200ResponseTry'
73
+ }
74
+ end
75
+
76
+ # List of attributes with nullable: true
77
+ def self.openapi_nullable
78
+ Set.new([
79
+ ])
80
+ end
81
+
82
+ # Initializes the object
83
+ # @param [Hash] attributes Model attributes in the form of hash
84
+ def initialize(attributes = {})
85
+ if (!attributes.is_a?(Hash))
86
+ fail ArgumentError, "The input argument (attributes) must be a hash in `PlainRouter::OpenAPI::GetSandbox200Response` initialize method"
87
+ end
88
+
89
+ # check to see if the attribute exists and convert string to symbol for hash key
90
+ acceptable_attribute_map = self.class.acceptable_attribute_map
91
+ attributes = attributes.each_with_object({}) { |(k, v), h|
92
+ if (!acceptable_attribute_map.key?(k.to_sym))
93
+ fail ArgumentError, "`#{k}` is not a valid attribute in `PlainRouter::OpenAPI::GetSandbox200Response`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
94
+ end
95
+ h[k.to_sym] = v
96
+ }
97
+
98
+ if attributes.key?(:'environment')
99
+ self.environment = attributes[:'environment']
100
+ else
101
+ self.environment = nil
102
+ end
103
+
104
+ if attributes.key?(:'authentication_required')
105
+ self.authentication_required = attributes[:'authentication_required']
106
+ else
107
+ self.authentication_required = nil
108
+ end
109
+
110
+ if attributes.key?(:'account_required')
111
+ self.account_required = attributes[:'account_required']
112
+ else
113
+ self.account_required = nil
114
+ end
115
+
116
+ if attributes.key?(:'production_data')
117
+ self.production_data = attributes[:'production_data']
118
+ else
119
+ self.production_data = nil
120
+ end
121
+
122
+ if attributes.key?(:'persists_data')
123
+ self.persists_data = attributes[:'persists_data']
124
+ else
125
+ self.persists_data = nil
126
+ end
127
+
128
+ if attributes.key?(:'provider_delivery')
129
+ self.provider_delivery = attributes[:'provider_delivery']
130
+ else
131
+ self.provider_delivery = nil
132
+ end
133
+
134
+ if attributes.key?(:'description')
135
+ self.description = attributes[:'description']
136
+ else
137
+ self.description = nil
138
+ end
139
+
140
+ if attributes.key?(:'self_serve_key')
141
+ self.self_serve_key = attributes[:'self_serve_key']
142
+ else
143
+ self.self_serve_key = nil
144
+ end
145
+
146
+ if attributes.key?(:'try')
147
+ self.try = attributes[:'try']
148
+ else
149
+ self.try = nil
150
+ end
151
+ end
152
+
153
+ # Show invalid properties with the reasons. Usually used together with valid?
154
+ # @return Array for valid properties with the reasons
155
+ def list_invalid_properties
156
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
157
+ invalid_properties = Array.new
158
+ if @environment.nil?
159
+ invalid_properties.push('invalid value for "environment", environment cannot be nil.')
160
+ end
161
+
162
+ if @authentication_required.nil?
163
+ invalid_properties.push('invalid value for "authentication_required", authentication_required cannot be nil.')
164
+ end
165
+
166
+ if @account_required.nil?
167
+ invalid_properties.push('invalid value for "account_required", account_required cannot be nil.')
168
+ end
169
+
170
+ if @production_data.nil?
171
+ invalid_properties.push('invalid value for "production_data", production_data cannot be nil.')
172
+ end
173
+
174
+ if @persists_data.nil?
175
+ invalid_properties.push('invalid value for "persists_data", persists_data cannot be nil.')
176
+ end
177
+
178
+ if @provider_delivery.nil?
179
+ invalid_properties.push('invalid value for "provider_delivery", provider_delivery cannot be nil.')
180
+ end
181
+
182
+ if @description.nil?
183
+ invalid_properties.push('invalid value for "description", description cannot be nil.')
184
+ end
185
+
186
+ if @self_serve_key.nil?
187
+ invalid_properties.push('invalid value for "self_serve_key", self_serve_key cannot be nil.')
188
+ end
189
+
190
+ if @try.nil?
191
+ invalid_properties.push('invalid value for "try", try cannot be nil.')
192
+ end
193
+
194
+ invalid_properties
195
+ end
196
+
197
+ # Check to see if the all the properties in the model are valid
198
+ # @return true if the model is valid
199
+ def valid?
200
+ warn '[DEPRECATED] the `valid?` method is obsolete'
201
+ return false if @environment.nil?
202
+ return false if @authentication_required.nil?
203
+ return false if @account_required.nil?
204
+ return false if @production_data.nil?
205
+ return false if @persists_data.nil?
206
+ return false if @provider_delivery.nil?
207
+ return false if @description.nil?
208
+ return false if @self_serve_key.nil?
209
+ return false if @try.nil?
210
+ true
211
+ end
212
+
213
+ # Custom attribute writer method with validation
214
+ # @param [Object] environment Value to be assigned
215
+ def environment=(environment)
216
+ if environment.nil?
217
+ fail ArgumentError, 'environment cannot be nil'
218
+ end
219
+
220
+ @environment = environment
221
+ end
222
+
223
+ # Custom attribute writer method with validation
224
+ # @param [Object] authentication_required Value to be assigned
225
+ def authentication_required=(authentication_required)
226
+ if authentication_required.nil?
227
+ fail ArgumentError, 'authentication_required cannot be nil'
228
+ end
229
+
230
+ @authentication_required = authentication_required
231
+ end
232
+
233
+ # Custom attribute writer method with validation
234
+ # @param [Object] account_required Value to be assigned
235
+ def account_required=(account_required)
236
+ if account_required.nil?
237
+ fail ArgumentError, 'account_required cannot be nil'
238
+ end
239
+
240
+ @account_required = account_required
241
+ end
242
+
243
+ # Custom attribute writer method with validation
244
+ # @param [Object] production_data Value to be assigned
245
+ def production_data=(production_data)
246
+ if production_data.nil?
247
+ fail ArgumentError, 'production_data cannot be nil'
248
+ end
249
+
250
+ @production_data = production_data
251
+ end
252
+
253
+ # Custom attribute writer method with validation
254
+ # @param [Object] persists_data Value to be assigned
255
+ def persists_data=(persists_data)
256
+ if persists_data.nil?
257
+ fail ArgumentError, 'persists_data cannot be nil'
258
+ end
259
+
260
+ @persists_data = persists_data
261
+ end
262
+
263
+ # Custom attribute writer method with validation
264
+ # @param [Object] provider_delivery Value to be assigned
265
+ def provider_delivery=(provider_delivery)
266
+ if provider_delivery.nil?
267
+ fail ArgumentError, 'provider_delivery cannot be nil'
268
+ end
269
+
270
+ @provider_delivery = provider_delivery
271
+ end
272
+
273
+ # Custom attribute writer method with validation
274
+ # @param [Object] description Value to be assigned
275
+ def description=(description)
276
+ if description.nil?
277
+ fail ArgumentError, 'description cannot be nil'
278
+ end
279
+
280
+ @description = description
281
+ end
282
+
283
+ # Custom attribute writer method with validation
284
+ # @param [Object] self_serve_key Value to be assigned
285
+ def self_serve_key=(self_serve_key)
286
+ if self_serve_key.nil?
287
+ fail ArgumentError, 'self_serve_key cannot be nil'
288
+ end
289
+
290
+ @self_serve_key = self_serve_key
291
+ end
292
+
293
+ # Custom attribute writer method with validation
294
+ # @param [Object] try Value to be assigned
295
+ def try=(try)
296
+ if try.nil?
297
+ fail ArgumentError, 'try cannot be nil'
298
+ end
299
+
300
+ @try = try
301
+ end
302
+
303
+ # Checks equality by comparing each attribute.
304
+ # @param [Object] Object to be compared
305
+ def ==(o)
306
+ return true if self.equal?(o)
307
+ self.class == o.class &&
308
+ environment == o.environment &&
309
+ authentication_required == o.authentication_required &&
310
+ account_required == o.account_required &&
311
+ production_data == o.production_data &&
312
+ persists_data == o.persists_data &&
313
+ provider_delivery == o.provider_delivery &&
314
+ description == o.description &&
315
+ self_serve_key == o.self_serve_key &&
316
+ try == o.try
317
+ end
318
+
319
+ # @see the `==` method
320
+ # @param [Object] Object to be compared
321
+ def eql?(o)
322
+ self == o
323
+ end
324
+
325
+ # Calculates hash code according to all attributes.
326
+ # @return [Integer] Hash code
327
+ def hash
328
+ [environment, authentication_required, account_required, production_data, persists_data, provider_delivery, description, self_serve_key, try].hash
329
+ end
330
+
331
+ # Builds the object from hash
332
+ # @param [Hash] attributes Model attributes in the form of hash
333
+ # @return [Object] Returns the model itself
334
+ def self.build_from_hash(attributes)
335
+ return nil unless attributes.is_a?(Hash)
336
+ attributes = attributes.transform_keys(&:to_sym)
337
+ transformed_hash = {}
338
+ openapi_types.each_pair do |key, type|
339
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
340
+ transformed_hash["#{key}"] = nil
341
+ elsif type =~ /\AArray<(.*)>/i
342
+ # check to ensure the input is an array given that the attribute
343
+ # is documented as an array but the input is not
344
+ if attributes[attribute_map[key]].is_a?(Array)
345
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
346
+ end
347
+ elsif !attributes[attribute_map[key]].nil?
348
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
349
+ end
350
+ end
351
+ new(transformed_hash)
352
+ end
353
+
354
+ # Returns the object in the form of hash
355
+ # @return [Hash] Returns the object in the form of hash
356
+ def to_hash
357
+ hash = {}
358
+ self.class.attribute_map.each_pair do |attr, param|
359
+ value = self.send(attr)
360
+ if value.nil?
361
+ is_nullable = self.class.openapi_nullable.include?(attr)
362
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
363
+ end
364
+
365
+ hash[param] = _to_hash(value)
366
+ end
367
+ hash
368
+ end
369
+
370
+ end
371
+
372
+ end
@@ -0,0 +1,242 @@
1
+ =begin
2
+ #PlainRouter Conversion API
3
+
4
+ #PlainRouter public Signals Conversion API.
5
+
6
+ The version of the OpenAPI document: 0.5.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.25.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module PlainRouter::OpenAPI
17
+ class GetSandbox200ResponseSelfServeKey < ApiModelBase
18
+ attr_accessor :method
19
+
20
+ attr_accessor :url
21
+
22
+ attr_accessor :authentication_required
23
+
24
+ attr_accessor :description
25
+
26
+ # Attribute mapping from ruby-style variable name to JSON key.
27
+ def self.attribute_map
28
+ {
29
+ :'method' => :'method',
30
+ :'url' => :'url',
31
+ :'authentication_required' => :'authentication_required',
32
+ :'description' => :'description'
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
+ :'method' => :'String',
50
+ :'url' => :'String',
51
+ :'authentication_required' => :'Boolean',
52
+ :'description' => :'String'
53
+ }
54
+ end
55
+
56
+ # List of attributes with nullable: true
57
+ def self.openapi_nullable
58
+ Set.new([
59
+ ])
60
+ end
61
+
62
+ # Initializes the object
63
+ # @param [Hash] attributes Model attributes in the form of hash
64
+ def initialize(attributes = {})
65
+ if (!attributes.is_a?(Hash))
66
+ fail ArgumentError, "The input argument (attributes) must be a hash in `PlainRouter::OpenAPI::GetSandbox200ResponseSelfServeKey` initialize method"
67
+ end
68
+
69
+ # check to see if the attribute exists and convert string to symbol for hash key
70
+ acceptable_attribute_map = self.class.acceptable_attribute_map
71
+ attributes = attributes.each_with_object({}) { |(k, v), h|
72
+ if (!acceptable_attribute_map.key?(k.to_sym))
73
+ fail ArgumentError, "`#{k}` is not a valid attribute in `PlainRouter::OpenAPI::GetSandbox200ResponseSelfServeKey`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
74
+ end
75
+ h[k.to_sym] = v
76
+ }
77
+
78
+ if attributes.key?(:'method')
79
+ self.method = attributes[:'method']
80
+ else
81
+ self.method = nil
82
+ end
83
+
84
+ if attributes.key?(:'url')
85
+ self.url = attributes[:'url']
86
+ else
87
+ self.url = nil
88
+ end
89
+
90
+ if attributes.key?(:'authentication_required')
91
+ self.authentication_required = attributes[:'authentication_required']
92
+ else
93
+ self.authentication_required = nil
94
+ end
95
+
96
+ if attributes.key?(:'description')
97
+ self.description = attributes[:'description']
98
+ else
99
+ self.description = nil
100
+ end
101
+ end
102
+
103
+ # Show invalid properties with the reasons. Usually used together with valid?
104
+ # @return Array for valid properties with the reasons
105
+ def list_invalid_properties
106
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
107
+ invalid_properties = Array.new
108
+ if @method.nil?
109
+ invalid_properties.push('invalid value for "method", method cannot be nil.')
110
+ end
111
+
112
+ if @url.nil?
113
+ invalid_properties.push('invalid value for "url", url cannot be nil.')
114
+ end
115
+
116
+ if @authentication_required.nil?
117
+ invalid_properties.push('invalid value for "authentication_required", authentication_required cannot be nil.')
118
+ end
119
+
120
+ if @description.nil?
121
+ invalid_properties.push('invalid value for "description", description cannot be nil.')
122
+ end
123
+
124
+ invalid_properties
125
+ end
126
+
127
+ # Check to see if the all the properties in the model are valid
128
+ # @return true if the model is valid
129
+ def valid?
130
+ warn '[DEPRECATED] the `valid?` method is obsolete'
131
+ return false if @method.nil?
132
+ return false if @url.nil?
133
+ return false if @authentication_required.nil?
134
+ return false if @description.nil?
135
+ true
136
+ end
137
+
138
+ # Custom attribute writer method with validation
139
+ # @param [Object] method Value to be assigned
140
+ def method=(method)
141
+ if method.nil?
142
+ fail ArgumentError, 'method cannot be nil'
143
+ end
144
+
145
+ @method = method
146
+ end
147
+
148
+ # Custom attribute writer method with validation
149
+ # @param [Object] url Value to be assigned
150
+ def url=(url)
151
+ if url.nil?
152
+ fail ArgumentError, 'url cannot be nil'
153
+ end
154
+
155
+ @url = url
156
+ end
157
+
158
+ # Custom attribute writer method with validation
159
+ # @param [Object] authentication_required Value to be assigned
160
+ def authentication_required=(authentication_required)
161
+ if authentication_required.nil?
162
+ fail ArgumentError, 'authentication_required cannot be nil'
163
+ end
164
+
165
+ @authentication_required = authentication_required
166
+ end
167
+
168
+ # Custom attribute writer method with validation
169
+ # @param [Object] description Value to be assigned
170
+ def description=(description)
171
+ if description.nil?
172
+ fail ArgumentError, 'description cannot be nil'
173
+ end
174
+
175
+ @description = description
176
+ end
177
+
178
+ # Checks equality by comparing each attribute.
179
+ # @param [Object] Object to be compared
180
+ def ==(o)
181
+ return true if self.equal?(o)
182
+ self.class == o.class &&
183
+ method == o.method &&
184
+ url == o.url &&
185
+ authentication_required == o.authentication_required &&
186
+ description == o.description
187
+ end
188
+
189
+ # @see the `==` method
190
+ # @param [Object] Object to be compared
191
+ def eql?(o)
192
+ self == o
193
+ end
194
+
195
+ # Calculates hash code according to all attributes.
196
+ # @return [Integer] Hash code
197
+ def hash
198
+ [method, url, authentication_required, description].hash
199
+ end
200
+
201
+ # Builds the object from hash
202
+ # @param [Hash] attributes Model attributes in the form of hash
203
+ # @return [Object] Returns the model itself
204
+ def self.build_from_hash(attributes)
205
+ return nil unless attributes.is_a?(Hash)
206
+ attributes = attributes.transform_keys(&:to_sym)
207
+ transformed_hash = {}
208
+ openapi_types.each_pair do |key, type|
209
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
210
+ transformed_hash["#{key}"] = nil
211
+ elsif type =~ /\AArray<(.*)>/i
212
+ # check to ensure the input is an array given that the attribute
213
+ # is documented as an array but the input is not
214
+ if attributes[attribute_map[key]].is_a?(Array)
215
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
216
+ end
217
+ elsif !attributes[attribute_map[key]].nil?
218
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
219
+ end
220
+ end
221
+ new(transformed_hash)
222
+ end
223
+
224
+ # Returns the object in the form of hash
225
+ # @return [Hash] Returns the object in the form of hash
226
+ def to_hash
227
+ hash = {}
228
+ self.class.attribute_map.each_pair do |attr, param|
229
+ value = self.send(attr)
230
+ if value.nil?
231
+ is_nullable = self.class.openapi_nullable.include?(attr)
232
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
233
+ end
234
+
235
+ hash[param] = _to_hash(value)
236
+ end
237
+ hash
238
+ end
239
+
240
+ end
241
+
242
+ end