pnap_bmc_api 2.2.1 → 2.3.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 (115) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +2 -0
  3. data/VERSION +1 -1
  4. data/docs/IpBlocksConfiguration.md +1 -1
  5. data/docs/OsConfigurationCloudInit.md +1 -1
  6. data/docs/OsConfigurationWindows.md +3 -1
  7. data/docs/PrivateNetworkConfiguration.md +1 -1
  8. data/docs/PublicNetworkConfiguration.md +1 -1
  9. data/docs/ReservationTransferDetails.md +18 -0
  10. data/docs/Server.md +3 -3
  11. data/docs/ServerCreate.md +3 -3
  12. data/docs/ServerNetworkUpdate.md +1 -1
  13. data/docs/ServerPrivateNetwork.md +4 -2
  14. data/docs/ServerProvision.md +1 -1
  15. data/docs/ServerPublicNetwork.md +5 -3
  16. data/docs/ServersApi.md +72 -0
  17. data/lib/pnap_bmc_api/api/quotas_api.rb +4 -4
  18. data/lib/pnap_bmc_api/api/servers_api.rb +97 -23
  19. data/lib/pnap_bmc_api/api/ssh_keys_api.rb +6 -6
  20. data/lib/pnap_bmc_api/api_client.rb +17 -14
  21. data/lib/pnap_bmc_api/api_error.rb +1 -1
  22. data/lib/pnap_bmc_api/api_model_base.rb +88 -0
  23. data/lib/pnap_bmc_api/configuration.rb +11 -1
  24. data/lib/pnap_bmc_api/models/action_result.rb +21 -78
  25. data/lib/pnap_bmc_api/models/delete_result.rb +31 -78
  26. data/lib/pnap_bmc_api/models/delete_ssh_key_result.rb +31 -78
  27. data/lib/pnap_bmc_api/models/error.rb +21 -78
  28. data/lib/pnap_bmc_api/models/esxi_datastore_configuration.rb +13 -80
  29. data/lib/pnap_bmc_api/models/esxi_os_configuration.rb +11 -78
  30. data/lib/pnap_bmc_api/models/gpu_configuration.rb +11 -78
  31. data/lib/pnap_bmc_api/models/ip_blocks_configuration.rb +12 -79
  32. data/lib/pnap_bmc_api/models/network_configuration.rb +11 -78
  33. data/lib/pnap_bmc_api/models/os_configuration.rb +11 -78
  34. data/lib/pnap_bmc_api/models/os_configuration_cloud_init.rb +11 -78
  35. data/lib/pnap_bmc_api/models/os_configuration_map.rb +11 -78
  36. data/lib/pnap_bmc_api/models/os_configuration_map_esxi.rb +11 -78
  37. data/lib/pnap_bmc_api/models/os_configuration_map_proxmox.rb +11 -78
  38. data/lib/pnap_bmc_api/models/os_configuration_netris_controller.rb +11 -78
  39. data/lib/pnap_bmc_api/models/os_configuration_netris_softgate.rb +11 -78
  40. data/lib/pnap_bmc_api/models/os_configuration_windows.rb +27 -82
  41. data/lib/pnap_bmc_api/models/private_network_configuration.rb +12 -79
  42. data/lib/pnap_bmc_api/models/public_network_configuration.rb +12 -79
  43. data/lib/pnap_bmc_api/models/quota.rb +61 -78
  44. data/lib/pnap_bmc_api/models/quota_edit_limit_request.rb +11 -78
  45. data/lib/pnap_bmc_api/models/quota_edit_limit_request_details.rb +22 -79
  46. data/lib/pnap_bmc_api/models/relinquish_ip_block.rb +11 -78
  47. data/lib/pnap_bmc_api/models/reservation_transfer_details.rb +166 -0
  48. data/lib/pnap_bmc_api/models/reset_result.rb +21 -78
  49. data/lib/pnap_bmc_api/models/server.rb +116 -83
  50. data/lib/pnap_bmc_api/models/server_create.rb +46 -83
  51. data/lib/pnap_bmc_api/models/server_ip_block.rb +21 -78
  52. data/lib/pnap_bmc_api/models/server_network_update.rb +12 -79
  53. data/lib/pnap_bmc_api/models/server_patch.rb +13 -80
  54. data/lib/pnap_bmc_api/models/server_private_network.rb +36 -83
  55. data/lib/pnap_bmc_api/models/server_provision.rb +24 -81
  56. data/lib/pnap_bmc_api/models/server_public_network.rb +36 -83
  57. data/lib/pnap_bmc_api/models/server_reserve.rb +21 -78
  58. data/lib/pnap_bmc_api/models/server_reset.rb +11 -78
  59. data/lib/pnap_bmc_api/models/ssh_key.rb +81 -78
  60. data/lib/pnap_bmc_api/models/ssh_key_create.rb +23 -80
  61. data/lib/pnap_bmc_api/models/ssh_key_update.rb +23 -80
  62. data/lib/pnap_bmc_api/models/storage_configuration.rb +11 -78
  63. data/lib/pnap_bmc_api/models/storage_configuration_root_partition.rb +11 -78
  64. data/lib/pnap_bmc_api/models/tag_assignment.rb +41 -78
  65. data/lib/pnap_bmc_api/models/tag_assignment_request.rb +21 -78
  66. data/lib/pnap_bmc_api/version.rb +1 -2
  67. data/lib/pnap_bmc_api.rb +3 -1
  68. data/pnap_bmc_api.gemspec +6 -6
  69. data/spec/api/quotas_api_spec.rb +1 -1
  70. data/spec/api/servers_api_spec.rb +14 -1
  71. data/spec/api/ssh_keys_api_spec.rb +1 -1
  72. data/spec/models/action_result_spec.rb +2 -2
  73. data/spec/models/delete_result_spec.rb +2 -2
  74. data/spec/models/delete_ssh_key_result_spec.rb +2 -2
  75. data/spec/models/error_spec.rb +2 -2
  76. data/spec/models/esxi_datastore_configuration_spec.rb +2 -2
  77. data/spec/models/esxi_os_configuration_spec.rb +2 -2
  78. data/spec/models/gpu_configuration_spec.rb +2 -2
  79. data/spec/models/ip_blocks_configuration_spec.rb +2 -2
  80. data/spec/models/network_configuration_spec.rb +2 -2
  81. data/spec/models/os_configuration_cloud_init_spec.rb +2 -2
  82. data/spec/models/os_configuration_map_esxi_spec.rb +2 -2
  83. data/spec/models/os_configuration_map_proxmox_spec.rb +2 -2
  84. data/spec/models/os_configuration_map_spec.rb +2 -2
  85. data/spec/models/os_configuration_netris_controller_spec.rb +2 -2
  86. data/spec/models/os_configuration_netris_softgate_spec.rb +2 -2
  87. data/spec/models/os_configuration_spec.rb +2 -2
  88. data/spec/models/os_configuration_windows_spec.rb +8 -2
  89. data/spec/models/private_network_configuration_spec.rb +2 -2
  90. data/spec/models/public_network_configuration_spec.rb +2 -2
  91. data/spec/models/quota_edit_limit_request_details_spec.rb +2 -2
  92. data/spec/models/quota_edit_limit_request_spec.rb +2 -2
  93. data/spec/models/quota_spec.rb +2 -2
  94. data/spec/models/relinquish_ip_block_spec.rb +2 -2
  95. data/spec/models/reservation_transfer_details_spec.rb +36 -0
  96. data/spec/models/reset_result_spec.rb +2 -2
  97. data/spec/models/server_create_spec.rb +2 -2
  98. data/spec/models/server_ip_block_spec.rb +2 -2
  99. data/spec/models/server_network_update_spec.rb +2 -2
  100. data/spec/models/server_patch_spec.rb +2 -2
  101. data/spec/models/server_private_network_spec.rb +8 -2
  102. data/spec/models/server_provision_spec.rb +2 -2
  103. data/spec/models/server_public_network_spec.rb +8 -2
  104. data/spec/models/server_reserve_spec.rb +2 -2
  105. data/spec/models/server_reset_spec.rb +2 -2
  106. data/spec/models/server_spec.rb +2 -2
  107. data/spec/models/ssh_key_create_spec.rb +2 -2
  108. data/spec/models/ssh_key_spec.rb +2 -2
  109. data/spec/models/ssh_key_update_spec.rb +2 -2
  110. data/spec/models/storage_configuration_root_partition_spec.rb +2 -2
  111. data/spec/models/storage_configuration_spec.rb +2 -2
  112. data/spec/models/tag_assignment_request_spec.rb +2 -2
  113. data/spec/models/tag_assignment_spec.rb +2 -2
  114. data/spec/spec_helper.rb +1 -1
  115. metadata +48 -39
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: 0.1
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 BmcApi
17
17
  # Object used to determine whether to relinquish ownership of the IP blocks upon unassignment from server or server deletion.
18
- class RelinquishIpBlock
18
+ class RelinquishIpBlock < ApiModelBase
19
19
  # Determines whether the IPv4 and IPv6 blocks assigned to the server should be deleted or not.
20
20
  attr_accessor :delete_ip_blocks
21
21
 
@@ -26,9 +26,14 @@ module BmcApi
26
26
  }
27
27
  end
28
28
 
29
+ # Returns attribute mapping this model knows about
30
+ def self.acceptable_attribute_map
31
+ attribute_map
32
+ end
33
+
29
34
  # Returns all the JSON keys this model knows about
30
35
  def self.acceptable_attributes
31
- attribute_map.values
36
+ acceptable_attribute_map.values
32
37
  end
33
38
 
34
39
  # Attribute type mapping.
@@ -52,9 +57,10 @@ module BmcApi
52
57
  end
53
58
 
54
59
  # check to see if the attribute exists and convert string to symbol for hash key
60
+ acceptable_attribute_map = self.class.acceptable_attribute_map
55
61
  attributes = attributes.each_with_object({}) { |(k, v), h|
56
- if (!self.class.attribute_map.key?(k.to_sym))
57
- fail ArgumentError, "`#{k}` is not a valid attribute in `BmcApi::RelinquishIpBlock`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
62
+ if (!acceptable_attribute_map.key?(k.to_sym))
63
+ fail ArgumentError, "`#{k}` is not a valid attribute in `BmcApi::RelinquishIpBlock`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
58
64
  end
59
65
  h[k.to_sym] = v
60
66
  }
@@ -124,61 +130,6 @@ module BmcApi
124
130
  new(transformed_hash)
125
131
  end
126
132
 
127
- # Deserializes the data based on type
128
- # @param string type Data type
129
- # @param string value Value to be deserialized
130
- # @return [Object] Deserialized data
131
- def self._deserialize(type, value)
132
- case type.to_sym
133
- when :Time
134
- Time.parse(value)
135
- when :Date
136
- Date.parse(value)
137
- when :String
138
- value.to_s
139
- when :Integer
140
- value.to_i
141
- when :Float
142
- value.to_f
143
- when :Boolean
144
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
145
- true
146
- else
147
- false
148
- end
149
- when :Object
150
- # generic object (usually a Hash), return directly
151
- value
152
- when /\AArray<(?<inner_type>.+)>\z/
153
- inner_type = Regexp.last_match[:inner_type]
154
- value.map { |v| _deserialize(inner_type, v) }
155
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
156
- k_type = Regexp.last_match[:k_type]
157
- v_type = Regexp.last_match[:v_type]
158
- {}.tap do |hash|
159
- value.each do |k, v|
160
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
161
- end
162
- end
163
- else # model
164
- # models (e.g. Pet) or oneOf
165
- klass = BmcApi.const_get(type)
166
- klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
167
- end
168
- end
169
-
170
- # Returns the string representation of the object
171
- # @return [String] String presentation of the object
172
- def to_s
173
- to_hash.to_s
174
- end
175
-
176
- # to_body is an alias to to_hash (backward compatibility)
177
- # @return [Hash] Returns the object in the form of hash
178
- def to_body
179
- to_hash
180
- end
181
-
182
133
  # Returns the object in the form of hash
183
134
  # @return [Hash] Returns the object in the form of hash
184
135
  def to_hash
@@ -195,24 +146,6 @@ module BmcApi
195
146
  hash
196
147
  end
197
148
 
198
- # Outputs non-array value in the form of hash
199
- # For object, use to_hash. Otherwise, just return the value
200
- # @param [Object] value Any valid value
201
- # @return [Hash] Returns the value in the form of hash
202
- def _to_hash(value)
203
- if value.is_a?(Array)
204
- value.compact.map { |v| _to_hash(v) }
205
- elsif value.is_a?(Hash)
206
- {}.tap do |hash|
207
- value.each { |k, v| hash[k] = _to_hash(v) }
208
- end
209
- elsif value.respond_to? :to_hash
210
- value.to_hash
211
- else
212
- value
213
- end
214
- end
215
-
216
149
  end
217
150
 
218
151
  end
@@ -0,0 +1,166 @@
1
+ =begin
2
+ #Bare Metal Cloud API
3
+
4
+ #Create, power off, power on, reset, reboot, or shut down your server with the Bare Metal Cloud API. Deprovision servers, get or edit SSH key details, assign public IPs, assign servers to networks and a lot more. Manage your infrastructure more efficiently using just a few simple API calls.<br> <br> <span class='pnap-api-knowledge-base-link'> Knowledge base articles to help you can be found <a href='https://phoenixnap.com/kb/how-to-deploy-bare-metal-cloud-server' target='_blank'>here</a> </span><br> <br> <b>All URLs are relative to (https://api.phoenixnap.com/bmc/v1/)</b>
5
+
6
+ The version of the OpenAPI document: 0.1
7
+ Contact: support@phoenixnap.com
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.20.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module BmcApi
17
+ # Reservation transfer details.
18
+ class ReservationTransferDetails < ApiModelBase
19
+ # ID of target server to transfer reservation to.
20
+ attr_accessor :target_server_id
21
+
22
+ # Attribute mapping from ruby-style variable name to JSON key.
23
+ def self.attribute_map
24
+ {
25
+ :'target_server_id' => :'targetServerId'
26
+ }
27
+ end
28
+
29
+ # Returns attribute mapping this model knows about
30
+ def self.acceptable_attribute_map
31
+ attribute_map
32
+ end
33
+
34
+ # Returns all the JSON keys this model knows about
35
+ def self.acceptable_attributes
36
+ acceptable_attribute_map.values
37
+ end
38
+
39
+ # Attribute type mapping.
40
+ def self.openapi_types
41
+ {
42
+ :'target_server_id' => :'String'
43
+ }
44
+ end
45
+
46
+ # List of attributes with nullable: true
47
+ def self.openapi_nullable
48
+ Set.new([
49
+ ])
50
+ end
51
+
52
+ # Initializes the object
53
+ # @param [Hash] attributes Model attributes in the form of hash
54
+ def initialize(attributes = {})
55
+ if (!attributes.is_a?(Hash))
56
+ fail ArgumentError, "The input argument (attributes) must be a hash in `BmcApi::ReservationTransferDetails` initialize method"
57
+ end
58
+
59
+ # check to see if the attribute exists and convert string to symbol for hash key
60
+ acceptable_attribute_map = self.class.acceptable_attribute_map
61
+ attributes = attributes.each_with_object({}) { |(k, v), h|
62
+ if (!acceptable_attribute_map.key?(k.to_sym))
63
+ fail ArgumentError, "`#{k}` is not a valid attribute in `BmcApi::ReservationTransferDetails`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
64
+ end
65
+ h[k.to_sym] = v
66
+ }
67
+
68
+ if attributes.key?(:'target_server_id')
69
+ self.target_server_id = attributes[:'target_server_id']
70
+ else
71
+ self.target_server_id = nil
72
+ end
73
+ end
74
+
75
+ # Show invalid properties with the reasons. Usually used together with valid?
76
+ # @return Array for valid properties with the reasons
77
+ def list_invalid_properties
78
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
79
+ invalid_properties = Array.new
80
+ if @target_server_id.nil?
81
+ invalid_properties.push('invalid value for "target_server_id", target_server_id cannot be nil.')
82
+ end
83
+
84
+ invalid_properties
85
+ end
86
+
87
+ # Check to see if the all the properties in the model are valid
88
+ # @return true if the model is valid
89
+ def valid?
90
+ warn '[DEPRECATED] the `valid?` method is obsolete'
91
+ return false if @target_server_id.nil?
92
+ true
93
+ end
94
+
95
+ # Custom attribute writer method with validation
96
+ # @param [Object] target_server_id Value to be assigned
97
+ def target_server_id=(target_server_id)
98
+ if target_server_id.nil?
99
+ fail ArgumentError, 'target_server_id cannot be nil'
100
+ end
101
+
102
+ @target_server_id = target_server_id
103
+ end
104
+
105
+ # Checks equality by comparing each attribute.
106
+ # @param [Object] Object to be compared
107
+ def ==(o)
108
+ return true if self.equal?(o)
109
+ self.class == o.class &&
110
+ target_server_id == o.target_server_id
111
+ end
112
+
113
+ # @see the `==` method
114
+ # @param [Object] Object to be compared
115
+ def eql?(o)
116
+ self == o
117
+ end
118
+
119
+ # Calculates hash code according to all attributes.
120
+ # @return [Integer] Hash code
121
+ def hash
122
+ [target_server_id].hash
123
+ end
124
+
125
+ # Builds the object from hash
126
+ # @param [Hash] attributes Model attributes in the form of hash
127
+ # @return [Object] Returns the model itself
128
+ def self.build_from_hash(attributes)
129
+ return nil unless attributes.is_a?(Hash)
130
+ attributes = attributes.transform_keys(&:to_sym)
131
+ transformed_hash = {}
132
+ openapi_types.each_pair do |key, type|
133
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
134
+ transformed_hash["#{key}"] = nil
135
+ elsif type =~ /\AArray<(.*)>/i
136
+ # check to ensure the input is an array given that the attribute
137
+ # is documented as an array but the input is not
138
+ if attributes[attribute_map[key]].is_a?(Array)
139
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
140
+ end
141
+ elsif !attributes[attribute_map[key]].nil?
142
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
143
+ end
144
+ end
145
+ new(transformed_hash)
146
+ end
147
+
148
+ # Returns the object in the form of hash
149
+ # @return [Hash] Returns the object in the form of hash
150
+ def to_hash
151
+ hash = {}
152
+ self.class.attribute_map.each_pair do |attr, param|
153
+ value = self.send(attr)
154
+ if value.nil?
155
+ is_nullable = self.class.openapi_nullable.include?(attr)
156
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
157
+ end
158
+
159
+ hash[param] = _to_hash(value)
160
+ end
161
+ hash
162
+ end
163
+
164
+ end
165
+
166
+ end
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: 0.1
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 BmcApi
17
17
  # Result of a successful reset action.
18
- class ResetResult
18
+ class ResetResult < ApiModelBase
19
19
  # Message describing the reset result.
20
20
  attr_accessor :result
21
21
 
@@ -33,9 +33,14 @@ module BmcApi
33
33
  }
34
34
  end
35
35
 
36
+ # Returns attribute mapping this model knows about
37
+ def self.acceptable_attribute_map
38
+ attribute_map
39
+ end
40
+
36
41
  # Returns all the JSON keys this model knows about
37
42
  def self.acceptable_attributes
38
- attribute_map.values
43
+ acceptable_attribute_map.values
39
44
  end
40
45
 
41
46
  # Attribute type mapping.
@@ -61,9 +66,10 @@ module BmcApi
61
66
  end
62
67
 
63
68
  # check to see if the attribute exists and convert string to symbol for hash key
69
+ acceptable_attribute_map = self.class.acceptable_attribute_map
64
70
  attributes = attributes.each_with_object({}) { |(k, v), h|
65
- if (!self.class.attribute_map.key?(k.to_sym))
66
- fail ArgumentError, "`#{k}` is not a valid attribute in `BmcApi::ResetResult`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
71
+ if (!acceptable_attribute_map.key?(k.to_sym))
72
+ fail ArgumentError, "`#{k}` is not a valid attribute in `BmcApi::ResetResult`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
67
73
  end
68
74
  h[k.to_sym] = v
69
75
  }
@@ -103,6 +109,16 @@ module BmcApi
103
109
  true
104
110
  end
105
111
 
112
+ # Custom attribute writer method with validation
113
+ # @param [Object] result Value to be assigned
114
+ def result=(result)
115
+ if result.nil?
116
+ fail ArgumentError, 'result cannot be nil'
117
+ end
118
+
119
+ @result = result
120
+ end
121
+
106
122
  # Checks equality by comparing each attribute.
107
123
  # @param [Object] Object to be compared
108
124
  def ==(o)
@@ -148,61 +164,6 @@ module BmcApi
148
164
  new(transformed_hash)
149
165
  end
150
166
 
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 = BmcApi.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
167
  # Returns the object in the form of hash
207
168
  # @return [Hash] Returns the object in the form of hash
208
169
  def to_hash
@@ -219,24 +180,6 @@ module BmcApi
219
180
  hash
220
181
  end
221
182
 
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
183
  end
241
184
 
242
185
  end