ibm_cloud_power 1.0.2 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (122) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +68 -0
  3. data/LICENSE.txt +202 -0
  4. data/README.md +56 -10
  5. data/docs/CloudConnection.md +41 -0
  6. data/docs/CloudConnectionCreate.md +23 -0
  7. data/docs/CloudConnectionEndpointClassic.md +19 -0
  8. data/docs/CloudConnectionEndpointGRE.md +19 -0
  9. data/docs/CloudConnectionEndpointVPC.md +19 -0
  10. data/docs/CloudConnectionGRETunnel.md +21 -0
  11. data/docs/CloudConnectionSpeed.md +16 -0
  12. data/docs/CloudConnectionUpdate.md +27 -0
  13. data/docs/CloudConnectionVPC.md +19 -0
  14. data/docs/CloudConnectionVirtualPrivateClouds.md +17 -0
  15. data/docs/CloudConnectionVirtualPrivateCloudsVirtualPrivateClouds.md +23 -0
  16. data/docs/CloudConnections.md +17 -0
  17. data/docs/CreateDataVolume.md +6 -6
  18. data/docs/CreateImage.md +3 -3
  19. data/docs/Image.md +2 -0
  20. data/docs/ImageReference.md +2 -0
  21. data/docs/MaximumStorageAllocation.md +21 -0
  22. data/docs/MultiVolumesCreate.md +6 -4
  23. data/docs/Network.md +1 -1
  24. data/docs/NetworkPort.md +2 -0
  25. data/docs/NetworkReference.md +1 -1
  26. data/docs/PCloudCloudConnectionsApi.md +394 -0
  27. data/docs/PCloudEventsApi.md +2 -2
  28. data/docs/PCloudImagesApi.md +104 -6
  29. data/docs/PCloudPVMInstancesApi.md +60 -5
  30. data/docs/PCloudPlacementGroupsApi.md +298 -0
  31. data/docs/PCloudStorageCapacityApi.md +196 -0
  32. data/docs/PCloudVolumesApi.md +344 -0
  33. data/docs/PVMInstance.md +3 -1
  34. data/docs/PVMInstanceCreate.md +5 -3
  35. data/docs/PlacementGroup.md +23 -0
  36. data/docs/PlacementGroupCreate.md +19 -0
  37. data/docs/PlacementGroupServer.md +17 -0
  38. data/docs/PlacementGroups.md +17 -0
  39. data/docs/SAPCreate.md +1 -1
  40. data/docs/StoragePoolCapacity.md +23 -0
  41. data/docs/StoragePoolsCapacity.md +19 -0
  42. data/docs/StorageTypeCapacity.md +21 -0
  43. data/docs/StorageTypesCapacity.md +19 -0
  44. data/docs/Volume.md +2 -0
  45. data/docs/VolumeReference.md +2 -0
  46. data/docs/VolumesCloneAsyncRequest.md +1 -1
  47. data/docs/VolumesCloneCancel.md +1 -1
  48. data/docs/VolumesCloneDetail.md +1 -1
  49. data/docs/VolumesCloneExecute.md +1 -1
  50. data/lib/ibm_cloud_power.rb +24 -0
  51. data/lib/ibm_cloud_power/api/p_cloud_cloud_connections_api.rb +560 -0
  52. data/lib/ibm_cloud_power/api/p_cloud_events_api.rb +2 -2
  53. data/lib/ibm_cloud_power/api/p_cloud_images_api.rb +133 -4
  54. data/lib/ibm_cloud_power/api/p_cloud_placement_groups_api.rb +430 -0
  55. data/lib/ibm_cloud_power/api/p_cloud_pvm_instances_api.rb +82 -5
  56. data/lib/ibm_cloud_power/api/p_cloud_storage_capacity_api.rb +274 -0
  57. data/lib/ibm_cloud_power/api/p_cloud_volumes_api.rb +477 -0
  58. data/lib/ibm_cloud_power/models/cloud_connection.rb +379 -0
  59. data/lib/ibm_cloud_power/models/cloud_connection_create.rb +249 -0
  60. data/lib/ibm_cloud_power/models/cloud_connection_endpoint_classic.rb +218 -0
  61. data/lib/ibm_cloud_power/models/cloud_connection_endpoint_gre.rb +221 -0
  62. data/lib/ibm_cloud_power/models/cloud_connection_endpoint_vpc.rb +221 -0
  63. data/lib/ibm_cloud_power/models/cloud_connection_gre_tunnel.rb +239 -0
  64. data/lib/ibm_cloud_power/models/cloud_connection_speed.rb +42 -0
  65. data/lib/ibm_cloud_power/models/cloud_connection_update.rb +257 -0
  66. data/lib/ibm_cloud_power/models/cloud_connection_virtual_private_clouds.rb +216 -0
  67. data/lib/ibm_cloud_power/models/cloud_connection_virtual_private_clouds_virtual_private_clouds.rb +259 -0
  68. data/lib/ibm_cloud_power/models/cloud_connection_vpc.rb +224 -0
  69. data/lib/ibm_cloud_power/models/cloud_connections.rb +216 -0
  70. data/lib/ibm_cloud_power/models/create_data_volume.rb +17 -17
  71. data/lib/ibm_cloud_power/models/create_image.rb +3 -3
  72. data/lib/ibm_cloud_power/models/image.rb +16 -1
  73. data/lib/ibm_cloud_power/models/image_reference.rb +16 -1
  74. data/lib/ibm_cloud_power/models/maximum_storage_allocation.rb +245 -0
  75. data/lib/ibm_cloud_power/models/multi_volumes_create.rb +17 -7
  76. data/lib/ibm_cloud_power/models/network.rb +1 -1
  77. data/lib/ibm_cloud_power/models/network_port.rb +11 -1
  78. data/lib/ibm_cloud_power/models/network_reference.rb +1 -1
  79. data/lib/ibm_cloud_power/models/placement_group.rb +295 -0
  80. data/lib/ibm_cloud_power/models/placement_group_create.rb +263 -0
  81. data/lib/ibm_cloud_power/models/placement_group_server.rb +214 -0
  82. data/lib/ibm_cloud_power/models/placement_groups.rb +216 -0
  83. data/lib/ibm_cloud_power/models/pvm_instance.rb +17 -5
  84. data/lib/ibm_cloud_power/models/pvm_instance_create.rb +16 -6
  85. data/lib/ibm_cloud_power/models/pvm_instance_reference.rb +2 -2
  86. data/lib/ibm_cloud_power/models/sap_create.rb +1 -1
  87. data/lib/ibm_cloud_power/models/storage_pool_capacity.rb +245 -0
  88. data/lib/ibm_cloud_power/models/storage_pools_capacity.rb +220 -0
  89. data/lib/ibm_cloud_power/models/storage_type_capacity.rb +231 -0
  90. data/lib/ibm_cloud_power/models/storage_types_capacity.rb +220 -0
  91. data/lib/ibm_cloud_power/models/volume.rb +11 -1
  92. data/lib/ibm_cloud_power/models/volume_reference.rb +11 -1
  93. data/lib/ibm_cloud_power/models/volumes_clone_async_request.rb +1 -1
  94. data/lib/ibm_cloud_power/models/volumes_clone_cancel.rb +1 -1
  95. data/lib/ibm_cloud_power/models/volumes_clone_detail.rb +1 -1
  96. data/lib/ibm_cloud_power/models/volumes_clone_execute.rb +1 -1
  97. data/lib/ibm_cloud_power/version.rb +1 -1
  98. data/spec/api/p_cloud_cloud_connections_api_spec.rb +132 -0
  99. data/spec/api/p_cloud_placement_groups_api_spec.rb +108 -0
  100. data/spec/api/p_cloud_storage_capacity_api_spec.rb +81 -0
  101. data/spec/models/cloud_connection_create_spec.rb +59 -0
  102. data/spec/models/cloud_connection_endpoint_classic_spec.rb +47 -0
  103. data/spec/models/cloud_connection_endpoint_gre_spec.rb +47 -0
  104. data/spec/models/cloud_connection_endpoint_vpc_spec.rb +47 -0
  105. data/spec/models/cloud_connection_gre_tunnel_spec.rb +53 -0
  106. data/spec/models/cloud_connection_spec.rb +113 -0
  107. data/spec/models/cloud_connection_speed_spec.rb +35 -0
  108. data/spec/models/cloud_connection_update_spec.rb +71 -0
  109. data/spec/models/cloud_connection_virtual_private_clouds_spec.rb +41 -0
  110. data/spec/models/cloud_connection_virtual_private_clouds_virtual_private_clouds_spec.rb +59 -0
  111. data/spec/models/cloud_connection_vpc_spec.rb +47 -0
  112. data/spec/models/cloud_connections_spec.rb +41 -0
  113. data/spec/models/maximum_storage_allocation_spec.rb +53 -0
  114. data/spec/models/placement_group_create_spec.rb +51 -0
  115. data/spec/models/placement_group_server_spec.rb +41 -0
  116. data/spec/models/placement_group_spec.rb +63 -0
  117. data/spec/models/placement_groups_spec.rb +41 -0
  118. data/spec/models/storage_pool_capacity_spec.rb +59 -0
  119. data/spec/models/storage_pools_capacity_spec.rb +47 -0
  120. data/spec/models/storage_type_capacity_spec.rb +53 -0
  121. data/spec/models/storage_types_capacity_spec.rb +47 -0
  122. metadata +130 -32
@@ -0,0 +1,224 @@
1
+ =begin
2
+ #Power Cloud API
3
+
4
+ #IBM Power Cloud API for Power Hardware / Infrastructure
5
+
6
+ The version of the OpenAPI document: 1.0.0
7
+ Contact: kylej@us.ibm.com
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 5.0.0-beta2
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module IbmCloudPower
16
+ class CloudConnectionVPC
17
+ # CRN of the specific service
18
+ attr_accessor :vpc_id
19
+
20
+ # vpc name
21
+ attr_accessor :name
22
+
23
+ # Attribute mapping from ruby-style variable name to JSON key.
24
+ def self.attribute_map
25
+ {
26
+ :'vpc_id' => :'vpcID',
27
+ :'name' => :'name'
28
+ }
29
+ end
30
+
31
+ # Attribute type mapping.
32
+ def self.openapi_types
33
+ {
34
+ :'vpc_id' => :'String',
35
+ :'name' => :'String'
36
+ }
37
+ end
38
+
39
+ # List of attributes with nullable: true
40
+ def self.openapi_nullable
41
+ Set.new([
42
+ ])
43
+ end
44
+
45
+ # Initializes the object
46
+ # @param [Hash] attributes Model attributes in the form of hash
47
+ def initialize(attributes = {})
48
+ if (!attributes.is_a?(Hash))
49
+ fail ArgumentError, "The input argument (attributes) must be a hash in `IbmCloudPower::CloudConnectionVPC` initialize method"
50
+ end
51
+
52
+ # check to see if the attribute exists and convert string to symbol for hash key
53
+ attributes = attributes.each_with_object({}) { |(k, v), h|
54
+ if (!self.class.attribute_map.key?(k.to_sym))
55
+ fail ArgumentError, "`#{k}` is not a valid attribute in `IbmCloudPower::CloudConnectionVPC`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
56
+ end
57
+ h[k.to_sym] = v
58
+ }
59
+
60
+ if attributes.key?(:'vpc_id')
61
+ self.vpc_id = attributes[:'vpc_id']
62
+ end
63
+
64
+ if attributes.key?(:'name')
65
+ self.name = attributes[:'name']
66
+ end
67
+ end
68
+
69
+ # Show invalid properties with the reasons. Usually used together with valid?
70
+ # @return Array for valid properties with the reasons
71
+ def list_invalid_properties
72
+ invalid_properties = Array.new
73
+ if @vpc_id.nil?
74
+ invalid_properties.push('invalid value for "vpc_id", vpc_id cannot be nil.')
75
+ end
76
+
77
+ invalid_properties
78
+ end
79
+
80
+ # Check to see if the all the properties in the model are valid
81
+ # @return true if the model is valid
82
+ def valid?
83
+ return false if @vpc_id.nil?
84
+ true
85
+ end
86
+
87
+ # Checks equality by comparing each attribute.
88
+ # @param [Object] Object to be compared
89
+ def ==(o)
90
+ return true if self.equal?(o)
91
+ self.class == o.class &&
92
+ vpc_id == o.vpc_id &&
93
+ name == o.name
94
+ end
95
+
96
+ # @see the `==` method
97
+ # @param [Object] Object to be compared
98
+ def eql?(o)
99
+ self == o
100
+ end
101
+
102
+ # Calculates hash code according to all attributes.
103
+ # @return [Integer] Hash code
104
+ def hash
105
+ [vpc_id, name].hash
106
+ end
107
+
108
+ # Builds the object from hash
109
+ # @param [Hash] attributes Model attributes in the form of hash
110
+ # @return [Object] Returns the model itself
111
+ def self.build_from_hash(attributes)
112
+ new.build_from_hash(attributes)
113
+ end
114
+
115
+ # Builds the object from hash
116
+ # @param [Hash] attributes Model attributes in the form of hash
117
+ # @return [Object] Returns the model itself
118
+ def build_from_hash(attributes)
119
+ return nil unless attributes.is_a?(Hash)
120
+ self.class.openapi_types.each_pair do |key, type|
121
+ if type =~ /\AArray<(.*)>/i
122
+ # check to ensure the input is an array given that the attribute
123
+ # is documented as an array but the input is not
124
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
125
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
126
+ end
127
+ elsif !attributes[self.class.attribute_map[key]].nil?
128
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
129
+ elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
130
+ self.send("#{key}=", nil)
131
+ end
132
+ end
133
+
134
+ self
135
+ end
136
+
137
+ # Deserializes the data based on type
138
+ # @param string type Data type
139
+ # @param string value Value to be deserialized
140
+ # @return [Object] Deserialized data
141
+ def _deserialize(type, value)
142
+ case type.to_sym
143
+ when :DateTime
144
+ DateTime.parse(value)
145
+ when :Date
146
+ Date.parse(value)
147
+ when :String
148
+ value.to_s
149
+ when :Integer
150
+ value.to_i
151
+ when :Float
152
+ value.to_f
153
+ when :Boolean
154
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
155
+ true
156
+ else
157
+ false
158
+ end
159
+ when :Object
160
+ # generic object (usually a Hash), return directly
161
+ value
162
+ when /\AArray<(?<inner_type>.+)>\z/
163
+ inner_type = Regexp.last_match[:inner_type]
164
+ value.map { |v| _deserialize(inner_type, v) }
165
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
166
+ k_type = Regexp.last_match[:k_type]
167
+ v_type = Regexp.last_match[:v_type]
168
+ {}.tap do |hash|
169
+ value.each do |k, v|
170
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
171
+ end
172
+ end
173
+ else # model
174
+ IbmCloudPower.const_get(type).build_from_hash(value)
175
+ end
176
+ end
177
+
178
+ # Returns the string representation of the object
179
+ # @return [String] String presentation of the object
180
+ def to_s
181
+ to_hash.to_s
182
+ end
183
+
184
+ # to_body is an alias to to_hash (backward compatibility)
185
+ # @return [Hash] Returns the object in the form of hash
186
+ def to_body
187
+ to_hash
188
+ end
189
+
190
+ # Returns the object in the form of hash
191
+ # @return [Hash] Returns the object in the form of hash
192
+ def to_hash
193
+ hash = {}
194
+ self.class.attribute_map.each_pair do |attr, param|
195
+ value = self.send(attr)
196
+ if value.nil?
197
+ is_nullable = self.class.openapi_nullable.include?(attr)
198
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
199
+ end
200
+
201
+ hash[param] = _to_hash(value)
202
+ end
203
+ hash
204
+ end
205
+
206
+ # Outputs non-array value in the form of hash
207
+ # For object, use to_hash. Otherwise, just return the value
208
+ # @param [Object] value Any valid value
209
+ # @return [Hash] Returns the value in the form of hash
210
+ def _to_hash(value)
211
+ if value.is_a?(Array)
212
+ value.compact.map { |v| _to_hash(v) }
213
+ elsif value.is_a?(Hash)
214
+ {}.tap do |hash|
215
+ value.each { |k, v| hash[k] = _to_hash(v) }
216
+ end
217
+ elsif value.respond_to? :to_hash
218
+ value.to_hash
219
+ else
220
+ value
221
+ end
222
+ end
223
+ end
224
+ end
@@ -0,0 +1,216 @@
1
+ =begin
2
+ #Power Cloud API
3
+
4
+ #IBM Power Cloud API for Power Hardware / Infrastructure
5
+
6
+ The version of the OpenAPI document: 1.0.0
7
+ Contact: kylej@us.ibm.com
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 5.0.0-beta2
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module IbmCloudPower
16
+ class CloudConnections
17
+ # Cloud Connections
18
+ attr_accessor :cloud_connections
19
+
20
+ # Attribute mapping from ruby-style variable name to JSON key.
21
+ def self.attribute_map
22
+ {
23
+ :'cloud_connections' => :'cloudConnections'
24
+ }
25
+ end
26
+
27
+ # Attribute type mapping.
28
+ def self.openapi_types
29
+ {
30
+ :'cloud_connections' => :'Array<CloudConnection>'
31
+ }
32
+ end
33
+
34
+ # List of attributes with nullable: true
35
+ def self.openapi_nullable
36
+ Set.new([
37
+ ])
38
+ end
39
+
40
+ # Initializes the object
41
+ # @param [Hash] attributes Model attributes in the form of hash
42
+ def initialize(attributes = {})
43
+ if (!attributes.is_a?(Hash))
44
+ fail ArgumentError, "The input argument (attributes) must be a hash in `IbmCloudPower::CloudConnections` initialize method"
45
+ end
46
+
47
+ # check to see if the attribute exists and convert string to symbol for hash key
48
+ attributes = attributes.each_with_object({}) { |(k, v), h|
49
+ if (!self.class.attribute_map.key?(k.to_sym))
50
+ fail ArgumentError, "`#{k}` is not a valid attribute in `IbmCloudPower::CloudConnections`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
51
+ end
52
+ h[k.to_sym] = v
53
+ }
54
+
55
+ if attributes.key?(:'cloud_connections')
56
+ if (value = attributes[:'cloud_connections']).is_a?(Array)
57
+ self.cloud_connections = value
58
+ end
59
+ end
60
+ end
61
+
62
+ # Show invalid properties with the reasons. Usually used together with valid?
63
+ # @return Array for valid properties with the reasons
64
+ def list_invalid_properties
65
+ invalid_properties = Array.new
66
+ if @cloud_connections.nil?
67
+ invalid_properties.push('invalid value for "cloud_connections", cloud_connections cannot be nil.')
68
+ end
69
+
70
+ invalid_properties
71
+ end
72
+
73
+ # Check to see if the all the properties in the model are valid
74
+ # @return true if the model is valid
75
+ def valid?
76
+ return false if @cloud_connections.nil?
77
+ true
78
+ end
79
+
80
+ # Checks equality by comparing each attribute.
81
+ # @param [Object] Object to be compared
82
+ def ==(o)
83
+ return true if self.equal?(o)
84
+ self.class == o.class &&
85
+ cloud_connections == o.cloud_connections
86
+ end
87
+
88
+ # @see the `==` method
89
+ # @param [Object] Object to be compared
90
+ def eql?(o)
91
+ self == o
92
+ end
93
+
94
+ # Calculates hash code according to all attributes.
95
+ # @return [Integer] Hash code
96
+ def hash
97
+ [cloud_connections].hash
98
+ end
99
+
100
+ # Builds the object from hash
101
+ # @param [Hash] attributes Model attributes in the form of hash
102
+ # @return [Object] Returns the model itself
103
+ def self.build_from_hash(attributes)
104
+ new.build_from_hash(attributes)
105
+ end
106
+
107
+ # Builds the object from hash
108
+ # @param [Hash] attributes Model attributes in the form of hash
109
+ # @return [Object] Returns the model itself
110
+ def build_from_hash(attributes)
111
+ return nil unless attributes.is_a?(Hash)
112
+ self.class.openapi_types.each_pair do |key, type|
113
+ if type =~ /\AArray<(.*)>/i
114
+ # check to ensure the input is an array given that the attribute
115
+ # is documented as an array but the input is not
116
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
117
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
118
+ end
119
+ elsif !attributes[self.class.attribute_map[key]].nil?
120
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
121
+ elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
122
+ self.send("#{key}=", nil)
123
+ end
124
+ end
125
+
126
+ self
127
+ end
128
+
129
+ # Deserializes the data based on type
130
+ # @param string type Data type
131
+ # @param string value Value to be deserialized
132
+ # @return [Object] Deserialized data
133
+ def _deserialize(type, value)
134
+ case type.to_sym
135
+ when :DateTime
136
+ DateTime.parse(value)
137
+ when :Date
138
+ Date.parse(value)
139
+ when :String
140
+ value.to_s
141
+ when :Integer
142
+ value.to_i
143
+ when :Float
144
+ value.to_f
145
+ when :Boolean
146
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
147
+ true
148
+ else
149
+ false
150
+ end
151
+ when :Object
152
+ # generic object (usually a Hash), return directly
153
+ value
154
+ when /\AArray<(?<inner_type>.+)>\z/
155
+ inner_type = Regexp.last_match[:inner_type]
156
+ value.map { |v| _deserialize(inner_type, v) }
157
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
158
+ k_type = Regexp.last_match[:k_type]
159
+ v_type = Regexp.last_match[:v_type]
160
+ {}.tap do |hash|
161
+ value.each do |k, v|
162
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
163
+ end
164
+ end
165
+ else # model
166
+ IbmCloudPower.const_get(type).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
+ # Returns the object in the form of hash
183
+ # @return [Hash] Returns the object in the form of hash
184
+ def to_hash
185
+ hash = {}
186
+ self.class.attribute_map.each_pair do |attr, param|
187
+ value = self.send(attr)
188
+ if value.nil?
189
+ is_nullable = self.class.openapi_nullable.include?(attr)
190
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
191
+ end
192
+
193
+ hash[param] = _to_hash(value)
194
+ end
195
+ hash
196
+ end
197
+
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
+ end
216
+ end
@@ -14,12 +14,9 @@ require 'date'
14
14
 
15
15
  module IbmCloudPower
16
16
  class CreateDataVolume
17
- # Type of Disk, required if affinityPolicy not used
17
+ # Type of disk, required if affinityPolicy is not provided, otherwise ignored
18
18
  attr_accessor :disk_type
19
19
 
20
- # Volume pool where the volume will be located
21
- attr_accessor :volume_pool
22
-
23
20
  # Volume Name
24
21
  attr_accessor :name
25
22
 
@@ -29,12 +26,15 @@ module IbmCloudPower
29
26
  # Indicates if the volume is shareable between VMs
30
27
  attr_accessor :shareable
31
28
 
32
- # Affinity policy for data volume being created; requires affinityVolume to be specified
29
+ # Affinity policy for data volume being created; requires affinityPVMInstance or affinityVolume to be specified;
33
30
  attr_accessor :affinity_policy
34
31
 
35
- # Volume (ID or Name)to base volume affinity policy against; required if affinityPolicy provided
32
+ # Volume (ID or Name) to base volume affinity policy against; required if affinityPolicy is provided and affinityPVMInstance is not provided
36
33
  attr_accessor :affinity_volume
37
34
 
35
+ # PVM Instance (ID or Name) to base volume affinity policy against; required if affinityPolicy is provided and affinityVolume is not provided
36
+ attr_accessor :affinity_pvm_instance
37
+
38
38
  class EnumAttributeValidator
39
39
  attr_reader :datatype
40
40
  attr_reader :allowable_values
@@ -61,12 +61,12 @@ module IbmCloudPower
61
61
  def self.attribute_map
62
62
  {
63
63
  :'disk_type' => :'diskType',
64
- :'volume_pool' => :'volumePool',
65
64
  :'name' => :'name',
66
65
  :'size' => :'size',
67
66
  :'shareable' => :'shareable',
68
67
  :'affinity_policy' => :'affinityPolicy',
69
- :'affinity_volume' => :'affinityVolume'
68
+ :'affinity_volume' => :'affinityVolume',
69
+ :'affinity_pvm_instance' => :'affinityPVMInstance'
70
70
  }
71
71
  end
72
72
 
@@ -74,12 +74,12 @@ module IbmCloudPower
74
74
  def self.openapi_types
75
75
  {
76
76
  :'disk_type' => :'String',
77
- :'volume_pool' => :'String',
78
77
  :'name' => :'String',
79
78
  :'size' => :'Float',
80
79
  :'shareable' => :'Boolean',
81
80
  :'affinity_policy' => :'String',
82
- :'affinity_volume' => :'String'
81
+ :'affinity_volume' => :'String',
82
+ :'affinity_pvm_instance' => :'String'
83
83
  }
84
84
  end
85
85
 
@@ -108,10 +108,6 @@ module IbmCloudPower
108
108
  self.disk_type = attributes[:'disk_type']
109
109
  end
110
110
 
111
- if attributes.key?(:'volume_pool')
112
- self.volume_pool = attributes[:'volume_pool']
113
- end
114
-
115
111
  if attributes.key?(:'name')
116
112
  self.name = attributes[:'name']
117
113
  end
@@ -131,6 +127,10 @@ module IbmCloudPower
131
127
  if attributes.key?(:'affinity_volume')
132
128
  self.affinity_volume = attributes[:'affinity_volume']
133
129
  end
130
+
131
+ if attributes.key?(:'affinity_pvm_instance')
132
+ self.affinity_pvm_instance = attributes[:'affinity_pvm_instance']
133
+ end
134
134
  end
135
135
 
136
136
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -174,12 +174,12 @@ module IbmCloudPower
174
174
  return true if self.equal?(o)
175
175
  self.class == o.class &&
176
176
  disk_type == o.disk_type &&
177
- volume_pool == o.volume_pool &&
178
177
  name == o.name &&
179
178
  size == o.size &&
180
179
  shareable == o.shareable &&
181
180
  affinity_policy == o.affinity_policy &&
182
- affinity_volume == o.affinity_volume
181
+ affinity_volume == o.affinity_volume &&
182
+ affinity_pvm_instance == o.affinity_pvm_instance
183
183
  end
184
184
 
185
185
  # @see the `==` method
@@ -191,7 +191,7 @@ module IbmCloudPower
191
191
  # Calculates hash code according to all attributes.
192
192
  # @return [Integer] Hash code
193
193
  def hash
194
- [disk_type, volume_pool, name, size, shareable, affinity_policy, affinity_volume].hash
194
+ [disk_type, name, size, shareable, affinity_policy, affinity_volume, affinity_pvm_instance].hash
195
195
  end
196
196
 
197
197
  # Builds the object from hash