Class: IbmCloudPower::SharedProcessorPoolDetailSharedProcessorPool
- Inherits:
-
ApiModelBase
- Object
- ApiModelBase
- IbmCloudPower::SharedProcessorPoolDetailSharedProcessorPool
- Defined in:
- lib/ibm_cloud_power/models/shared_processor_pool_detail_shared_processor_pool.rb
Instance Attribute Summary collapse
-
#allocated_cores ⇒ Object
The amount of allocated processor cores for the Shared Processor Pool.
-
#available_cores ⇒ Object
The amount of available processor cores for the Shared Processor Pool.
-
#creation_date ⇒ Object
The creation time of the Shared Processor Pool.
-
#crn ⇒ Object
The CRN for this resource.
-
#dedicated_host_id ⇒ Object
ID of the dedicated host where the Shared Processor Pool resides, if applicable.
-
#host_group ⇒ Object
The host group the host belongs to.
-
#host_id ⇒ Object
The ID of the host where the Shared Processor Pool resides.
-
#id ⇒ Object
The id of the Shared Processor Pool.
-
#name ⇒ Object
The name of the Shared Processor Pool.
-
#reserved_cores ⇒ Object
The amount of reserved processor cores for the Shared Processor Pool.
-
#shared_processor_pool_placement_groups ⇒ Object
list of Shared Processor Pool Placement Groups.
-
#status ⇒ Object
The status of the Shared Processor Pool.
-
#status_detail ⇒ Object
The status details of the Shared Processor Pool.
-
#user_tags ⇒ Object
List of user tags.
Class Method Summary collapse
-
.acceptable_attribute_map ⇒ Object
Returns attribute mapping this model knows about.
-
.acceptable_attributes ⇒ Object
Returns all the JSON keys this model knows about.
-
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
-
.build_from_hash(attributes) ⇒ Object
Builds the object from hash.
-
.openapi_all_of ⇒ Object
List of class defined in allOf (OpenAPI v3).
-
.openapi_nullable ⇒ Object
List of attributes with nullable: true.
-
.openapi_types ⇒ Object
Attribute type mapping.
Instance Method Summary collapse
-
#==(o) ⇒ Object
Checks equality by comparing each attribute.
- #eql?(o) ⇒ Boolean
-
#hash ⇒ Integer
Calculates hash code according to all attributes.
-
#initialize(attributes = {}) ⇒ SharedProcessorPoolDetailSharedProcessorPool
constructor
Initializes the object.
-
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons.
-
#to_hash ⇒ Hash
Returns the object in the form of hash.
-
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid.
Methods inherited from ApiModelBase
_deserialize, #_to_hash, #to_body, #to_s
Constructor Details
#initialize(attributes = {}) ⇒ SharedProcessorPoolDetailSharedProcessorPool
Initializes the object
125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 |
# File 'lib/ibm_cloud_power/models/shared_processor_pool_detail_shared_processor_pool.rb', line 125 def initialize(attributes = {}) if (!attributes.is_a?(Hash)) fail ArgumentError, "The input argument (attributes) must be a hash in `IbmCloudPower::SharedProcessorPoolDetailSharedProcessorPool` initialize method" end # check to see if the attribute exists and convert string to symbol for hash key acceptable_attribute_map = self.class.acceptable_attribute_map attributes = attributes.each_with_object({}) { |(k, v), h| if (!acceptable_attribute_map.key?(k.to_sym)) fail ArgumentError, "`#{k}` is not a valid attribute in `IbmCloudPower::SharedProcessorPoolDetailSharedProcessorPool`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } if attributes.key?(:'allocated_cores') self.allocated_cores = attributes[:'allocated_cores'] else self.allocated_cores = nil end if attributes.key?(:'available_cores') self.available_cores = attributes[:'available_cores'] else self.available_cores = nil end if attributes.key?(:'creation_date') self.creation_date = attributes[:'creation_date'] end if attributes.key?(:'crn') self.crn = attributes[:'crn'] end if attributes.key?(:'dedicated_host_id') self.dedicated_host_id = attributes[:'dedicated_host_id'] end if attributes.key?(:'host_group') self.host_group = attributes[:'host_group'] end if attributes.key?(:'host_id') self.host_id = attributes[:'host_id'] end if attributes.key?(:'id') self.id = attributes[:'id'] else self.id = nil end if attributes.key?(:'name') self.name = attributes[:'name'] else self.name = nil end if attributes.key?(:'reserved_cores') self.reserved_cores = attributes[:'reserved_cores'] else self.reserved_cores = nil end if attributes.key?(:'shared_processor_pool_placement_groups') if (value = attributes[:'shared_processor_pool_placement_groups']).is_a?(Array) self.shared_processor_pool_placement_groups = value end end if attributes.key?(:'status') self.status = attributes[:'status'] end if attributes.key?(:'status_detail') self.status_detail = attributes[:'status_detail'] end if attributes.key?(:'user_tags') if (value = attributes[:'user_tags']).is_a?(Array) self. = value end end end |
Instance Attribute Details
#allocated_cores ⇒ Object
The amount of allocated processor cores for the Shared Processor Pool
19 20 21 |
# File 'lib/ibm_cloud_power/models/shared_processor_pool_detail_shared_processor_pool.rb', line 19 def allocated_cores @allocated_cores end |
#available_cores ⇒ Object
The amount of available processor cores for the Shared Processor Pool
22 23 24 |
# File 'lib/ibm_cloud_power/models/shared_processor_pool_detail_shared_processor_pool.rb', line 22 def available_cores @available_cores end |
#creation_date ⇒ Object
The creation time of the Shared Processor Pool
25 26 27 |
# File 'lib/ibm_cloud_power/models/shared_processor_pool_detail_shared_processor_pool.rb', line 25 def creation_date @creation_date end |
#crn ⇒ Object
The CRN for this resource
28 29 30 |
# File 'lib/ibm_cloud_power/models/shared_processor_pool_detail_shared_processor_pool.rb', line 28 def crn @crn end |
#dedicated_host_id ⇒ Object
ID of the dedicated host where the Shared Processor Pool resides, if applicable
31 32 33 |
# File 'lib/ibm_cloud_power/models/shared_processor_pool_detail_shared_processor_pool.rb', line 31 def dedicated_host_id @dedicated_host_id end |
#host_group ⇒ Object
The host group the host belongs to
34 35 36 |
# File 'lib/ibm_cloud_power/models/shared_processor_pool_detail_shared_processor_pool.rb', line 34 def host_group @host_group end |
#host_id ⇒ Object
The ID of the host where the Shared Processor Pool resides
37 38 39 |
# File 'lib/ibm_cloud_power/models/shared_processor_pool_detail_shared_processor_pool.rb', line 37 def host_id @host_id end |
#id ⇒ Object
The id of the Shared Processor Pool
40 41 42 |
# File 'lib/ibm_cloud_power/models/shared_processor_pool_detail_shared_processor_pool.rb', line 40 def id @id end |
#name ⇒ Object
The name of the Shared Processor Pool
43 44 45 |
# File 'lib/ibm_cloud_power/models/shared_processor_pool_detail_shared_processor_pool.rb', line 43 def name @name end |
#reserved_cores ⇒ Object
The amount of reserved processor cores for the Shared Processor Pool
46 47 48 |
# File 'lib/ibm_cloud_power/models/shared_processor_pool_detail_shared_processor_pool.rb', line 46 def reserved_cores @reserved_cores end |
#shared_processor_pool_placement_groups ⇒ Object
list of Shared Processor Pool Placement Groups
49 50 51 |
# File 'lib/ibm_cloud_power/models/shared_processor_pool_detail_shared_processor_pool.rb', line 49 def shared_processor_pool_placement_groups @shared_processor_pool_placement_groups end |
#status ⇒ Object
The status of the Shared Processor Pool
52 53 54 |
# File 'lib/ibm_cloud_power/models/shared_processor_pool_detail_shared_processor_pool.rb', line 52 def status @status end |
#status_detail ⇒ Object
The status details of the Shared Processor Pool
55 56 57 |
# File 'lib/ibm_cloud_power/models/shared_processor_pool_detail_shared_processor_pool.rb', line 55 def status_detail @status_detail end |
#user_tags ⇒ Object
List of user tags
58 59 60 |
# File 'lib/ibm_cloud_power/models/shared_processor_pool_detail_shared_processor_pool.rb', line 58 def @user_tags end |
Class Method Details
.acceptable_attribute_map ⇒ Object
Returns attribute mapping this model knows about
81 82 83 |
# File 'lib/ibm_cloud_power/models/shared_processor_pool_detail_shared_processor_pool.rb', line 81 def self.acceptable_attribute_map attribute_map end |
.acceptable_attributes ⇒ Object
Returns all the JSON keys this model knows about
86 87 88 |
# File 'lib/ibm_cloud_power/models/shared_processor_pool_detail_shared_processor_pool.rb', line 86 def self.acceptable_attributes acceptable_attribute_map.values end |
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 |
# File 'lib/ibm_cloud_power/models/shared_processor_pool_detail_shared_processor_pool.rb', line 61 def self.attribute_map { :'allocated_cores' => :'allocatedCores', :'available_cores' => :'availableCores', :'creation_date' => :'creationDate', :'crn' => :'crn', :'dedicated_host_id' => :'dedicatedHostID', :'host_group' => :'hostGroup', :'host_id' => :'hostID', :'id' => :'id', :'name' => :'name', :'reserved_cores' => :'reservedCores', :'shared_processor_pool_placement_groups' => :'sharedProcessorPoolPlacementGroups', :'status' => :'status', :'status_detail' => :'statusDetail', :'user_tags' => :'userTags' } end |
.build_from_hash(attributes) ⇒ Object
Builds the object from hash
355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 |
# File 'lib/ibm_cloud_power/models/shared_processor_pool_detail_shared_processor_pool.rb', line 355 def self.build_from_hash(attributes) return nil unless attributes.is_a?(Hash) attributes = attributes.transform_keys(&:to_sym) transformed_hash = {} openapi_types.each_pair do |key, type| if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? transformed_hash["#{key}"] = nil elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[attribute_map[key]].is_a?(Array) transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } end elsif !attributes[attribute_map[key]].nil? transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) end end new(transformed_hash) end |
.openapi_all_of ⇒ Object
List of class defined in allOf (OpenAPI v3)
117 118 119 120 121 |
# File 'lib/ibm_cloud_power/models/shared_processor_pool_detail_shared_processor_pool.rb', line 117 def self.openapi_all_of [ :'SharedProcessorPool' ] end |
.openapi_nullable ⇒ Object
List of attributes with nullable: true
111 112 113 114 |
# File 'lib/ibm_cloud_power/models/shared_processor_pool_detail_shared_processor_pool.rb', line 111 def self.openapi_nullable Set.new([ ]) end |
.openapi_types ⇒ Object
Attribute type mapping.
91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 |
# File 'lib/ibm_cloud_power/models/shared_processor_pool_detail_shared_processor_pool.rb', line 91 def self.openapi_types { :'allocated_cores' => :'Float', :'available_cores' => :'Float', :'creation_date' => :'Time', :'crn' => :'String', :'dedicated_host_id' => :'String', :'host_group' => :'String', :'host_id' => :'Integer', :'id' => :'String', :'name' => :'String', :'reserved_cores' => :'Integer', :'shared_processor_pool_placement_groups' => :'Array<SharedProcessorPoolPlacementGroup>', :'status' => :'String', :'status_detail' => :'String', :'user_tags' => :'Array<String>' } end |
Instance Method Details
#==(o) ⇒ Object
Checks equality by comparing each attribute.
321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 |
# File 'lib/ibm_cloud_power/models/shared_processor_pool_detail_shared_processor_pool.rb', line 321 def ==(o) return true if self.equal?(o) self.class == o.class && allocated_cores == o.allocated_cores && available_cores == o.available_cores && creation_date == o.creation_date && crn == o.crn && dedicated_host_id == o.dedicated_host_id && host_group == o.host_group && host_id == o.host_id && id == o.id && name == o.name && reserved_cores == o.reserved_cores && shared_processor_pool_placement_groups == o.shared_processor_pool_placement_groups && status == o.status && status_detail == o.status_detail && == o. end |
#eql?(o) ⇒ Boolean
342 343 344 |
# File 'lib/ibm_cloud_power/models/shared_processor_pool_detail_shared_processor_pool.rb', line 342 def eql?(o) self == o end |
#hash ⇒ Integer
Calculates hash code according to all attributes.
348 349 350 |
# File 'lib/ibm_cloud_power/models/shared_processor_pool_detail_shared_processor_pool.rb', line 348 def hash [allocated_cores, available_cores, creation_date, crn, dedicated_host_id, host_group, host_id, id, name, reserved_cores, shared_processor_pool_placement_groups, status, status_detail, ].hash end |
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons. Usually used together with valid?
212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 |
# File 'lib/ibm_cloud_power/models/shared_processor_pool_detail_shared_processor_pool.rb', line 212 def list_invalid_properties warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new if @allocated_cores.nil? invalid_properties.push('invalid value for "allocated_cores", allocated_cores cannot be nil.') end if @available_cores.nil? invalid_properties.push('invalid value for "available_cores", available_cores cannot be nil.') end if @id.nil? invalid_properties.push('invalid value for "id", id cannot be nil.') end if @name.nil? invalid_properties.push('invalid value for "name", name cannot be nil.') end if @reserved_cores.nil? invalid_properties.push('invalid value for "reserved_cores", reserved_cores cannot be nil.') end if !@user_tags.nil? && @user_tags.length > 100 invalid_properties.push('invalid value for "user_tags", number of items must be less than or equal to 100.') end invalid_properties end |
#to_hash ⇒ Hash
Returns the object in the form of hash
377 378 379 380 381 382 383 384 385 386 387 388 389 |
# File 'lib/ibm_cloud_power/models/shared_processor_pool_detail_shared_processor_pool.rb', line 377 def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) if value.nil? is_nullable = self.class.openapi_nullable.include?(attr) next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) end hash[param] = _to_hash(value) end hash end |
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid
244 245 246 247 248 249 250 251 252 253 |
# File 'lib/ibm_cloud_power/models/shared_processor_pool_detail_shared_processor_pool.rb', line 244 def valid? warn '[DEPRECATED] the `valid?` method is obsolete' return false if @allocated_cores.nil? return false if @available_cores.nil? return false if @id.nil? return false if @name.nil? return false if @reserved_cores.nil? return false if !@user_tags.nil? && @user_tags.length > 100 true end |