pnap_network_api 2.1.1 → 2.2.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 (59) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +1 -0
  3. data/VERSION +1 -1
  4. data/docs/BgpIpPrefix.md +24 -0
  5. data/docs/BgpPeerGroup.md +6 -2
  6. data/docs/BgpPeerGroupCreate.md +1 -1
  7. data/docs/NetworkMembership.md +1 -1
  8. data/docs/PrivateNetworkCreate.md +1 -1
  9. data/docs/PublicNetwork.md +1 -1
  10. data/docs/PublicNetworkCreate.md +1 -1
  11. data/lib/pnap_network_api/api/bgp_peer_groups_api.rb +6 -6
  12. data/lib/pnap_network_api/api/private_networks_api.rb +6 -6
  13. data/lib/pnap_network_api/api/public_networks_api.rb +8 -8
  14. data/lib/pnap_network_api/api_client.rb +17 -14
  15. data/lib/pnap_network_api/api_error.rb +1 -1
  16. data/lib/pnap_network_api/api_model_base.rb +88 -0
  17. data/lib/pnap_network_api/configuration.rb +11 -1
  18. data/lib/pnap_network_api/models/asn_details.rb +41 -78
  19. data/lib/pnap_network_api/models/bgp_ip_prefix.rb +247 -0
  20. data/lib/pnap_network_api/models/bgp_ipv4_prefix.rb +52 -79
  21. data/lib/pnap_network_api/models/bgp_peer_group.rb +184 -83
  22. data/lib/pnap_network_api/models/bgp_peer_group_create.rb +44 -81
  23. data/lib/pnap_network_api/models/bgp_peer_group_patch.rb +13 -80
  24. data/lib/pnap_network_api/models/error.rb +21 -78
  25. data/lib/pnap_network_api/models/network_membership.rb +42 -79
  26. data/lib/pnap_network_api/models/private_network.rb +103 -80
  27. data/lib/pnap_network_api/models/private_network_create.rb +24 -81
  28. data/lib/pnap_network_api/models/private_network_modify.rb +23 -80
  29. data/lib/pnap_network_api/models/private_network_server.rb +31 -78
  30. data/lib/pnap_network_api/models/public_network.rb +84 -81
  31. data/lib/pnap_network_api/models/public_network_create.rb +24 -81
  32. data/lib/pnap_network_api/models/public_network_ip_block.rb +41 -78
  33. data/lib/pnap_network_api/models/public_network_ip_block_create.rb +21 -78
  34. data/lib/pnap_network_api/models/public_network_modify.rb +13 -80
  35. data/lib/pnap_network_api/version.rb +1 -2
  36. data/lib/pnap_network_api.rb +3 -1
  37. data/pnap_network_api.gemspec +6 -6
  38. data/spec/api/bgp_peer_groups_api_spec.rb +1 -1
  39. data/spec/api/private_networks_api_spec.rb +1 -1
  40. data/spec/api/public_networks_api_spec.rb +1 -1
  41. data/spec/models/asn_details_spec.rb +2 -2
  42. data/spec/models/bgp_ip_prefix_spec.rb +54 -0
  43. data/spec/models/bgp_ipv4_prefix_spec.rb +2 -2
  44. data/spec/models/bgp_peer_group_create_spec.rb +2 -2
  45. data/spec/models/bgp_peer_group_patch_spec.rb +2 -2
  46. data/spec/models/bgp_peer_group_spec.rb +14 -2
  47. data/spec/models/error_spec.rb +2 -2
  48. data/spec/models/network_membership_spec.rb +2 -2
  49. data/spec/models/private_network_create_spec.rb +2 -2
  50. data/spec/models/private_network_modify_spec.rb +2 -2
  51. data/spec/models/private_network_server_spec.rb +2 -2
  52. data/spec/models/private_network_spec.rb +2 -2
  53. data/spec/models/public_network_create_spec.rb +2 -2
  54. data/spec/models/public_network_ip_block_create_spec.rb +2 -2
  55. data/spec/models/public_network_ip_block_spec.rb +2 -2
  56. data/spec/models/public_network_modify_spec.rb +2 -2
  57. data/spec/models/public_network_spec.rb +2 -2
  58. data/spec/spec_helper.rb +1 -1
  59. metadata +29 -16
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: 1.0
7
7
  Contact: support@phoenixnap.com
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 7.2.0
9
+ Generator version: 7.20.0
10
10
 
11
11
  =end
12
12
 
@@ -15,7 +15,7 @@ require 'time'
15
15
 
16
16
  module NetworkApi
17
17
  # Server details linked to the Private Network.
18
- class PrivateNetworkServer
18
+ class PrivateNetworkServer < ApiModelBase
19
19
  # The server identifier.
20
20
  attr_accessor :id
21
21
 
@@ -30,9 +30,14 @@ module NetworkApi
30
30
  }
31
31
  end
32
32
 
33
+ # Returns attribute mapping this model knows about
34
+ def self.acceptable_attribute_map
35
+ attribute_map
36
+ end
37
+
33
38
  # Returns all the JSON keys this model knows about
34
39
  def self.acceptable_attributes
35
- attribute_map.values
40
+ acceptable_attribute_map.values
36
41
  end
37
42
 
38
43
  # Attribute type mapping.
@@ -57,9 +62,10 @@ module NetworkApi
57
62
  end
58
63
 
59
64
  # check to see if the attribute exists and convert string to symbol for hash key
65
+ acceptable_attribute_map = self.class.acceptable_attribute_map
60
66
  attributes = attributes.each_with_object({}) { |(k, v), h|
61
- if (!self.class.attribute_map.key?(k.to_sym))
62
- fail ArgumentError, "`#{k}` is not a valid attribute in `NetworkApi::PrivateNetworkServer`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
67
+ if (!acceptable_attribute_map.key?(k.to_sym))
68
+ fail ArgumentError, "`#{k}` is not a valid attribute in `NetworkApi::PrivateNetworkServer`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
63
69
  end
64
70
  h[k.to_sym] = v
65
71
  }
@@ -104,6 +110,26 @@ module NetworkApi
104
110
  true
105
111
  end
106
112
 
113
+ # Custom attribute writer method with validation
114
+ # @param [Object] id Value to be assigned
115
+ def id=(id)
116
+ if id.nil?
117
+ fail ArgumentError, 'id cannot be nil'
118
+ end
119
+
120
+ @id = id
121
+ end
122
+
123
+ # Custom attribute writer method with validation
124
+ # @param [Object] ips Value to be assigned
125
+ def ips=(ips)
126
+ if ips.nil?
127
+ fail ArgumentError, 'ips cannot be nil'
128
+ end
129
+
130
+ @ips = ips
131
+ end
132
+
107
133
  # Checks equality by comparing each attribute.
108
134
  # @param [Object] Object to be compared
109
135
  def ==(o)
@@ -148,61 +174,6 @@ module NetworkApi
148
174
  new(transformed_hash)
149
175
  end
150
176
 
151
- # Deserializes the data based on type
152
- # @param string type Data type
153
- # @param string value Value to be deserialized
154
- # @return [Object] Deserialized data
155
- def self._deserialize(type, value)
156
- case type.to_sym
157
- when :Time
158
- Time.parse(value)
159
- when :Date
160
- Date.parse(value)
161
- when :String
162
- value.to_s
163
- when :Integer
164
- value.to_i
165
- when :Float
166
- value.to_f
167
- when :Boolean
168
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
169
- true
170
- else
171
- false
172
- end
173
- when :Object
174
- # generic object (usually a Hash), return directly
175
- value
176
- when /\AArray<(?<inner_type>.+)>\z/
177
- inner_type = Regexp.last_match[:inner_type]
178
- value.map { |v| _deserialize(inner_type, v) }
179
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
180
- k_type = Regexp.last_match[:k_type]
181
- v_type = Regexp.last_match[:v_type]
182
- {}.tap do |hash|
183
- value.each do |k, v|
184
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
185
- end
186
- end
187
- else # model
188
- # models (e.g. Pet) or oneOf
189
- klass = NetworkApi.const_get(type)
190
- klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
191
- end
192
- end
193
-
194
- # Returns the string representation of the object
195
- # @return [String] String presentation of the object
196
- def to_s
197
- to_hash.to_s
198
- end
199
-
200
- # to_body is an alias to to_hash (backward compatibility)
201
- # @return [Hash] Returns the object in the form of hash
202
- def to_body
203
- to_hash
204
- end
205
-
206
177
  # Returns the object in the form of hash
207
178
  # @return [Hash] Returns the object in the form of hash
208
179
  def to_hash
@@ -219,24 +190,6 @@ module NetworkApi
219
190
  hash
220
191
  end
221
192
 
222
- # Outputs non-array value in the form of hash
223
- # For object, use to_hash. Otherwise, just return the value
224
- # @param [Object] value Any valid value
225
- # @return [Hash] Returns the value in the form of hash
226
- def _to_hash(value)
227
- if value.is_a?(Array)
228
- value.compact.map { |v| _to_hash(v) }
229
- elsif value.is_a?(Hash)
230
- {}.tap do |hash|
231
- value.each { |k, v| hash[k] = _to_hash(v) }
232
- end
233
- elsif value.respond_to? :to_hash
234
- value.to_hash
235
- else
236
- value
237
- end
238
- end
239
-
240
193
  end
241
194
 
242
195
  end
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: 1.0
7
7
  Contact: support@phoenixnap.com
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 7.2.0
9
+ Generator version: 7.20.0
10
10
 
11
11
  =end
12
12
 
@@ -15,7 +15,7 @@ require 'time'
15
15
 
16
16
  module NetworkApi
17
17
  # Public Network details.
18
- class PublicNetwork
18
+ class PublicNetwork < ApiModelBase
19
19
  # The public network identifier.
20
20
  attr_accessor :id
21
21
 
@@ -28,7 +28,7 @@ module NetworkApi
28
28
  # The friendly name of this public network.
29
29
  attr_accessor :name
30
30
 
31
- # The location of this public network. Supported values are `PHX`, `ASH`, `SGP`, `NLD`, `CHI`, `SEA` and `AUS`.
31
+ # The location of this public network. Supported values are `PHX`, `ASH`, `SGP`, `NLD`, `CHI` and `SEA`.
32
32
  attr_accessor :location
33
33
 
34
34
  # The description of this public network.
@@ -62,9 +62,14 @@ module NetworkApi
62
62
  }
63
63
  end
64
64
 
65
+ # Returns attribute mapping this model knows about
66
+ def self.acceptable_attribute_map
67
+ attribute_map
68
+ end
69
+
65
70
  # Returns all the JSON keys this model knows about
66
71
  def self.acceptable_attributes
67
- attribute_map.values
72
+ acceptable_attribute_map.values
68
73
  end
69
74
 
70
75
  # Attribute type mapping.
@@ -97,9 +102,10 @@ module NetworkApi
97
102
  end
98
103
 
99
104
  # check to see if the attribute exists and convert string to symbol for hash key
105
+ acceptable_attribute_map = self.class.acceptable_attribute_map
100
106
  attributes = attributes.each_with_object({}) { |(k, v), h|
101
- if (!self.class.attribute_map.key?(k.to_sym))
102
- fail ArgumentError, "`#{k}` is not a valid attribute in `NetworkApi::PublicNetwork`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
107
+ if (!acceptable_attribute_map.key?(k.to_sym))
108
+ fail ArgumentError, "`#{k}` is not a valid attribute in `NetworkApi::PublicNetwork`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
103
109
  end
104
110
  h[k.to_sym] = v
105
111
  }
@@ -191,7 +197,7 @@ module NetworkApi
191
197
  end
192
198
 
193
199
  if @name.to_s.length < 1
194
- invalid_properties.push('invalid value for "name", the character length must be great than or equal to 1.')
200
+ invalid_properties.push('invalid value for "name", the character length must be greater than or equal to 1.')
195
201
  end
196
202
 
197
203
  if @location.nil?
@@ -235,6 +241,36 @@ module NetworkApi
235
241
  true
236
242
  end
237
243
 
244
+ # Custom attribute writer method with validation
245
+ # @param [Object] id Value to be assigned
246
+ def id=(id)
247
+ if id.nil?
248
+ fail ArgumentError, 'id cannot be nil'
249
+ end
250
+
251
+ @id = id
252
+ end
253
+
254
+ # Custom attribute writer method with validation
255
+ # @param [Object] vlan_id Value to be assigned
256
+ def vlan_id=(vlan_id)
257
+ if vlan_id.nil?
258
+ fail ArgumentError, 'vlan_id cannot be nil'
259
+ end
260
+
261
+ @vlan_id = vlan_id
262
+ end
263
+
264
+ # Custom attribute writer method with validation
265
+ # @param [Object] memberships Value to be assigned
266
+ def memberships=(memberships)
267
+ if memberships.nil?
268
+ fail ArgumentError, 'memberships cannot be nil'
269
+ end
270
+
271
+ @memberships = memberships
272
+ end
273
+
238
274
  # Custom attribute writer method with validation
239
275
  # @param [Object] name Value to be assigned
240
276
  def name=(name)
@@ -247,12 +283,22 @@ module NetworkApi
247
283
  end
248
284
 
249
285
  if name.to_s.length < 1
250
- fail ArgumentError, 'invalid value for "name", the character length must be great than or equal to 1.'
286
+ fail ArgumentError, 'invalid value for "name", the character length must be greater than or equal to 1.'
251
287
  end
252
288
 
253
289
  @name = name
254
290
  end
255
291
 
292
+ # Custom attribute writer method with validation
293
+ # @param [Object] location Value to be assigned
294
+ def location=(location)
295
+ if location.nil?
296
+ fail ArgumentError, 'location cannot be nil'
297
+ end
298
+
299
+ @location = location
300
+ end
301
+
256
302
  # Custom attribute writer method with validation
257
303
  # @param [Object] description Value to be assigned
258
304
  def description=(description)
@@ -267,6 +313,36 @@ module NetworkApi
267
313
  @description = description
268
314
  end
269
315
 
316
+ # Custom attribute writer method with validation
317
+ # @param [Object] status Value to be assigned
318
+ def status=(status)
319
+ if status.nil?
320
+ fail ArgumentError, 'status cannot be nil'
321
+ end
322
+
323
+ @status = status
324
+ end
325
+
326
+ # Custom attribute writer method with validation
327
+ # @param [Object] created_on Value to be assigned
328
+ def created_on=(created_on)
329
+ if created_on.nil?
330
+ fail ArgumentError, 'created_on cannot be nil'
331
+ end
332
+
333
+ @created_on = created_on
334
+ end
335
+
336
+ # Custom attribute writer method with validation
337
+ # @param [Object] ip_blocks Value to be assigned
338
+ def ip_blocks=(ip_blocks)
339
+ if ip_blocks.nil?
340
+ fail ArgumentError, 'ip_blocks cannot be nil'
341
+ end
342
+
343
+ @ip_blocks = ip_blocks
344
+ end
345
+
270
346
  # Checks equality by comparing each attribute.
271
347
  # @param [Object] Object to be compared
272
348
  def ==(o)
@@ -319,61 +395,6 @@ module NetworkApi
319
395
  new(transformed_hash)
320
396
  end
321
397
 
322
- # Deserializes the data based on type
323
- # @param string type Data type
324
- # @param string value Value to be deserialized
325
- # @return [Object] Deserialized data
326
- def self._deserialize(type, value)
327
- case type.to_sym
328
- when :Time
329
- Time.parse(value)
330
- when :Date
331
- Date.parse(value)
332
- when :String
333
- value.to_s
334
- when :Integer
335
- value.to_i
336
- when :Float
337
- value.to_f
338
- when :Boolean
339
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
340
- true
341
- else
342
- false
343
- end
344
- when :Object
345
- # generic object (usually a Hash), return directly
346
- value
347
- when /\AArray<(?<inner_type>.+)>\z/
348
- inner_type = Regexp.last_match[:inner_type]
349
- value.map { |v| _deserialize(inner_type, v) }
350
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
351
- k_type = Regexp.last_match[:k_type]
352
- v_type = Regexp.last_match[:v_type]
353
- {}.tap do |hash|
354
- value.each do |k, v|
355
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
356
- end
357
- end
358
- else # model
359
- # models (e.g. Pet) or oneOf
360
- klass = NetworkApi.const_get(type)
361
- klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
362
- end
363
- end
364
-
365
- # Returns the string representation of the object
366
- # @return [String] String presentation of the object
367
- def to_s
368
- to_hash.to_s
369
- end
370
-
371
- # to_body is an alias to to_hash (backward compatibility)
372
- # @return [Hash] Returns the object in the form of hash
373
- def to_body
374
- to_hash
375
- end
376
-
377
398
  # Returns the object in the form of hash
378
399
  # @return [Hash] Returns the object in the form of hash
379
400
  def to_hash
@@ -390,24 +411,6 @@ module NetworkApi
390
411
  hash
391
412
  end
392
413
 
393
- # Outputs non-array value in the form of hash
394
- # For object, use to_hash. Otherwise, just return the value
395
- # @param [Object] value Any valid value
396
- # @return [Hash] Returns the value in the form of hash
397
- def _to_hash(value)
398
- if value.is_a?(Array)
399
- value.compact.map { |v| _to_hash(v) }
400
- elsif value.is_a?(Hash)
401
- {}.tap do |hash|
402
- value.each { |k, v| hash[k] = _to_hash(v) }
403
- end
404
- elsif value.respond_to? :to_hash
405
- value.to_hash
406
- else
407
- value
408
- end
409
- end
410
-
411
414
  end
412
415
 
413
416
  end
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: 1.0
7
7
  Contact: support@phoenixnap.com
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 7.2.0
9
+ Generator version: 7.20.0
10
10
 
11
11
  =end
12
12
 
@@ -15,14 +15,14 @@ require 'time'
15
15
 
16
16
  module NetworkApi
17
17
  # Details of Public Network to be created.
18
- class PublicNetworkCreate
18
+ class PublicNetworkCreate < ApiModelBase
19
19
  # The friendly name of this public network. This name should be unique.
20
20
  attr_accessor :name
21
21
 
22
22
  # The description of this public network.
23
23
  attr_accessor :description
24
24
 
25
- # The location of this public network. Supported values are `PHX`, `ASH`, `SGP`, `NLD`, `CHI`, `SEA` and `AUS`.
25
+ # The location of this public network. Supported values are `PHX`, `ASH`, `SGP`, `NLD`, `CHI` and `SEA`.
26
26
  attr_accessor :location
27
27
 
28
28
  # The VLAN that will be assigned to this network.
@@ -46,9 +46,14 @@ module NetworkApi
46
46
  }
47
47
  end
48
48
 
49
+ # Returns attribute mapping this model knows about
50
+ def self.acceptable_attribute_map
51
+ attribute_map
52
+ end
53
+
49
54
  # Returns all the JSON keys this model knows about
50
55
  def self.acceptable_attributes
51
- attribute_map.values
56
+ acceptable_attribute_map.values
52
57
  end
53
58
 
54
59
  # Attribute type mapping.
@@ -77,9 +82,10 @@ module NetworkApi
77
82
  end
78
83
 
79
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
80
86
  attributes = attributes.each_with_object({}) { |(k, v), h|
81
- if (!self.class.attribute_map.key?(k.to_sym))
82
- fail ArgumentError, "`#{k}` is not a valid attribute in `NetworkApi::PublicNetworkCreate`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
87
+ if (!acceptable_attribute_map.key?(k.to_sym))
88
+ fail ArgumentError, "`#{k}` is not a valid attribute in `NetworkApi::PublicNetworkCreate`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
83
89
  end
84
90
  h[k.to_sym] = v
85
91
  }
@@ -129,7 +135,7 @@ module NetworkApi
129
135
  end
130
136
 
131
137
  if @name.to_s.length < 1
132
- invalid_properties.push('invalid value for "name", the character length must be great than or equal to 1.')
138
+ invalid_properties.push('invalid value for "name", the character length must be greater than or equal to 1.')
133
139
  end
134
140
 
135
141
  pattern = Regexp.new(/^(?=.*[a-zA-Z])([a-zA-Z0-9(). -])+$/)
@@ -188,7 +194,7 @@ module NetworkApi
188
194
  end
189
195
 
190
196
  if name.to_s.length < 1
191
- fail ArgumentError, 'invalid value for "name", the character length must be great than or equal to 1.'
197
+ fail ArgumentError, 'invalid value for "name", the character length must be greater than or equal to 1.'
192
198
  end
193
199
 
194
200
  pattern = Regexp.new(/^(?=.*[a-zA-Z])([a-zA-Z0-9(). -])+$/)
@@ -213,6 +219,16 @@ module NetworkApi
213
219
  @description = description
214
220
  end
215
221
 
222
+ # Custom attribute writer method with validation
223
+ # @param [Object] location Value to be assigned
224
+ def location=(location)
225
+ if location.nil?
226
+ fail ArgumentError, 'location cannot be nil'
227
+ end
228
+
229
+ @location = location
230
+ end
231
+
216
232
  # Custom attribute writer method with validation
217
233
  # @param [Object] vlan_id Value to be assigned
218
234
  def vlan_id=(vlan_id)
@@ -293,61 +309,6 @@ module NetworkApi
293
309
  new(transformed_hash)
294
310
  end
295
311
 
296
- # Deserializes the data based on type
297
- # @param string type Data type
298
- # @param string value Value to be deserialized
299
- # @return [Object] Deserialized data
300
- def self._deserialize(type, value)
301
- case type.to_sym
302
- when :Time
303
- Time.parse(value)
304
- when :Date
305
- Date.parse(value)
306
- when :String
307
- value.to_s
308
- when :Integer
309
- value.to_i
310
- when :Float
311
- value.to_f
312
- when :Boolean
313
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
314
- true
315
- else
316
- false
317
- end
318
- when :Object
319
- # generic object (usually a Hash), return directly
320
- value
321
- when /\AArray<(?<inner_type>.+)>\z/
322
- inner_type = Regexp.last_match[:inner_type]
323
- value.map { |v| _deserialize(inner_type, v) }
324
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
325
- k_type = Regexp.last_match[:k_type]
326
- v_type = Regexp.last_match[:v_type]
327
- {}.tap do |hash|
328
- value.each do |k, v|
329
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
330
- end
331
- end
332
- else # model
333
- # models (e.g. Pet) or oneOf
334
- klass = NetworkApi.const_get(type)
335
- klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
336
- end
337
- end
338
-
339
- # Returns the string representation of the object
340
- # @return [String] String presentation of the object
341
- def to_s
342
- to_hash.to_s
343
- end
344
-
345
- # to_body is an alias to to_hash (backward compatibility)
346
- # @return [Hash] Returns the object in the form of hash
347
- def to_body
348
- to_hash
349
- end
350
-
351
312
  # Returns the object in the form of hash
352
313
  # @return [Hash] Returns the object in the form of hash
353
314
  def to_hash
@@ -364,24 +325,6 @@ module NetworkApi
364
325
  hash
365
326
  end
366
327
 
367
- # Outputs non-array value in the form of hash
368
- # For object, use to_hash. Otherwise, just return the value
369
- # @param [Object] value Any valid value
370
- # @return [Hash] Returns the value in the form of hash
371
- def _to_hash(value)
372
- if value.is_a?(Array)
373
- value.compact.map { |v| _to_hash(v) }
374
- elsif value.is_a?(Hash)
375
- {}.tap do |hash|
376
- value.each { |k, v| hash[k] = _to_hash(v) }
377
- end
378
- elsif value.respond_to? :to_hash
379
- value.to_hash
380
- else
381
- value
382
- end
383
- end
384
-
385
328
  end
386
329
 
387
330
  end