Class: IbmCloudPower::SAPProfile
- Inherits:
-
ApiModelBase
- Object
- ApiModelBase
- IbmCloudPower::SAPProfile
- Defined in:
- lib/ibm_cloud_power/models/sap_profile.rb
Defined Under Namespace
Classes: EnumAttributeValidator
Instance Attribute Summary collapse
-
#asaps ⇒ Object
Accelerated SAP Application Performance Standard.
-
#certified ⇒ Object
Has certification been performed on profile.
-
#cores ⇒ Object
Amount of cores.
-
#default_system ⇒ Object
System to use if not provided.
-
#deprecated ⇒ Object
Profile is deprecated.
-
#full_system_profile ⇒ Object
Requires full system for deployment.
-
#memory ⇒ Object
Amount of memory (in GiB).
-
#profile_id ⇒ Object
SAP Profile ID.
-
#saps ⇒ Object
SAP Application Performance Standard.
-
#smt_mode ⇒ Object
Required smt mode for that profile.
-
#supported_systems ⇒ Object
List of supported systems.
-
#type ⇒ Object
Type of profile.
-
#vpmem_volume ⇒ Object
Returns the value of attribute vpmem_volume.
-
#workload_types ⇒ Object
List of supported workload types.
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_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 = {}) ⇒ SAPProfile
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 = {}) ⇒ SAPProfile
Initializes the object
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 209 210 211 212 213 214 215 216 217 218 219 220 221 222 |
# File 'lib/ibm_cloud_power/models/sap_profile.rb', line 139 def initialize(attributes = {}) if (!attributes.is_a?(Hash)) fail ArgumentError, "The input argument (attributes) must be a hash in `IbmCloudPower::SAPProfile` 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::SAPProfile`. 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?(:'asaps') self.asaps = attributes[:'asaps'] end if attributes.key?(:'certified') self.certified = attributes[:'certified'] else self.certified = nil end if attributes.key?(:'cores') self.cores = attributes[:'cores'] else self.cores = nil end if attributes.key?(:'default_system') self.default_system = attributes[:'default_system'] end if attributes.key?(:'deprecated') self.deprecated = attributes[:'deprecated'] end if attributes.key?(:'full_system_profile') self.full_system_profile = attributes[:'full_system_profile'] end if attributes.key?(:'memory') self.memory = attributes[:'memory'] else self.memory = nil end if attributes.key?(:'profile_id') self.profile_id = attributes[:'profile_id'] else self.profile_id = nil end if attributes.key?(:'saps') self.saps = attributes[:'saps'] end if attributes.key?(:'smt_mode') self.smt_mode = attributes[:'smt_mode'] end if attributes.key?(:'supported_systems') if (value = attributes[:'supported_systems']).is_a?(Array) self.supported_systems = value end end if attributes.key?(:'type') self.type = attributes[:'type'] else self.type = 'balanced' end if attributes.key?(:'vpmem_volume') self.vpmem_volume = attributes[:'vpmem_volume'] end if attributes.key?(:'workload_types') if (value = attributes[:'workload_types']).is_a?(Array) self.workload_types = value end end end |
Instance Attribute Details
#asaps ⇒ Object
Accelerated SAP Application Performance Standard
19 20 21 |
# File 'lib/ibm_cloud_power/models/sap_profile.rb', line 19 def asaps @asaps end |
#certified ⇒ Object
Has certification been performed on profile
22 23 24 |
# File 'lib/ibm_cloud_power/models/sap_profile.rb', line 22 def certified @certified end |
#cores ⇒ Object
Amount of cores
25 26 27 |
# File 'lib/ibm_cloud_power/models/sap_profile.rb', line 25 def cores @cores end |
#default_system ⇒ Object
System to use if not provided
28 29 30 |
# File 'lib/ibm_cloud_power/models/sap_profile.rb', line 28 def default_system @default_system end |
#deprecated ⇒ Object
Profile is deprecated
31 32 33 |
# File 'lib/ibm_cloud_power/models/sap_profile.rb', line 31 def deprecated @deprecated end |
#full_system_profile ⇒ Object
Requires full system for deployment
34 35 36 |
# File 'lib/ibm_cloud_power/models/sap_profile.rb', line 34 def full_system_profile @full_system_profile end |
#memory ⇒ Object
Amount of memory (in GiB)
37 38 39 |
# File 'lib/ibm_cloud_power/models/sap_profile.rb', line 37 def memory @memory end |
#profile_id ⇒ Object
SAP Profile ID
40 41 42 |
# File 'lib/ibm_cloud_power/models/sap_profile.rb', line 40 def profile_id @profile_id end |
#saps ⇒ Object
SAP Application Performance Standard
43 44 45 |
# File 'lib/ibm_cloud_power/models/sap_profile.rb', line 43 def saps @saps end |
#smt_mode ⇒ Object
Required smt mode for that profile
46 47 48 |
# File 'lib/ibm_cloud_power/models/sap_profile.rb', line 46 def smt_mode @smt_mode end |
#supported_systems ⇒ Object
List of supported systems
49 50 51 |
# File 'lib/ibm_cloud_power/models/sap_profile.rb', line 49 def supported_systems @supported_systems end |
#type ⇒ Object
Type of profile
52 53 54 |
# File 'lib/ibm_cloud_power/models/sap_profile.rb', line 52 def type @type end |
#vpmem_volume ⇒ Object
Returns the value of attribute vpmem_volume.
54 55 56 |
# File 'lib/ibm_cloud_power/models/sap_profile.rb', line 54 def vpmem_volume @vpmem_volume end |
#workload_types ⇒ Object
List of supported workload types
57 58 59 |
# File 'lib/ibm_cloud_power/models/sap_profile.rb', line 57 def workload_types @workload_types end |
Class Method Details
.acceptable_attribute_map ⇒ Object
Returns attribute mapping this model knows about
102 103 104 |
# File 'lib/ibm_cloud_power/models/sap_profile.rb', line 102 def self.acceptable_attribute_map attribute_map end |
.acceptable_attributes ⇒ Object
Returns all the JSON keys this model knows about
107 108 109 |
# File 'lib/ibm_cloud_power/models/sap_profile.rb', line 107 def self.acceptable_attributes acceptable_attribute_map.values end |
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 |
# File 'lib/ibm_cloud_power/models/sap_profile.rb', line 82 def self.attribute_map { :'asaps' => :'asaps', :'certified' => :'certified', :'cores' => :'cores', :'default_system' => :'defaultSystem', :'deprecated' => :'deprecated', :'full_system_profile' => :'fullSystemProfile', :'memory' => :'memory', :'profile_id' => :'profileID', :'saps' => :'saps', :'smt_mode' => :'smtMode', :'supported_systems' => :'supportedSystems', :'type' => :'type', :'vpmem_volume' => :'vpmemVolume', :'workload_types' => :'workloadTypes' } end |
.build_from_hash(attributes) ⇒ Object
Builds the object from hash
364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 |
# File 'lib/ibm_cloud_power/models/sap_profile.rb', line 364 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_nullable ⇒ Object
List of attributes with nullable: true
132 133 134 135 |
# File 'lib/ibm_cloud_power/models/sap_profile.rb', line 132 def self.openapi_nullable Set.new([ ]) end |
.openapi_types ⇒ Object
Attribute type mapping.
112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 |
# File 'lib/ibm_cloud_power/models/sap_profile.rb', line 112 def self.openapi_types { :'asaps' => :'Integer', :'certified' => :'Boolean', :'cores' => :'Integer', :'default_system' => :'String', :'deprecated' => :'Boolean', :'full_system_profile' => :'Boolean', :'memory' => :'Integer', :'profile_id' => :'String', :'saps' => :'Integer', :'smt_mode' => :'Integer', :'supported_systems' => :'Array<String>', :'type' => :'String', :'vpmem_volume' => :'SAPProfileVpmemVolume', :'workload_types' => :'Array<String>' } end |
Instance Method Details
#==(o) ⇒ Object
Checks equality by comparing each attribute.
330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 |
# File 'lib/ibm_cloud_power/models/sap_profile.rb', line 330 def ==(o) return true if self.equal?(o) self.class == o.class && asaps == o.asaps && certified == o.certified && cores == o.cores && default_system == o.default_system && deprecated == o.deprecated && full_system_profile == o.full_system_profile && memory == o.memory && profile_id == o.profile_id && saps == o.saps && smt_mode == o.smt_mode && supported_systems == o.supported_systems && type == o.type && vpmem_volume == o.vpmem_volume && workload_types == o.workload_types end |
#eql?(o) ⇒ Boolean
351 352 353 |
# File 'lib/ibm_cloud_power/models/sap_profile.rb', line 351 def eql?(o) self == o end |
#hash ⇒ Integer
Calculates hash code according to all attributes.
357 358 359 |
# File 'lib/ibm_cloud_power/models/sap_profile.rb', line 357 def hash [asaps, certified, cores, default_system, deprecated, full_system_profile, memory, profile_id, saps, smt_mode, supported_systems, type, vpmem_volume, workload_types].hash end |
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons. Usually used together with valid?
226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 |
# File 'lib/ibm_cloud_power/models/sap_profile.rb', line 226 def list_invalid_properties warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new if @certified.nil? invalid_properties.push('invalid value for "certified", certified cannot be nil.') end if @cores.nil? invalid_properties.push('invalid value for "cores", cores cannot be nil.') end if @memory.nil? invalid_properties.push('invalid value for "memory", memory cannot be nil.') end if @profile_id.nil? invalid_properties.push('invalid value for "profile_id", profile_id cannot be nil.') end if @type.nil? invalid_properties.push('invalid value for "type", type cannot be nil.') end invalid_properties end |
#to_hash ⇒ Hash
Returns the object in the form of hash
386 387 388 389 390 391 392 393 394 395 396 397 398 |
# File 'lib/ibm_cloud_power/models/sap_profile.rb', line 386 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
254 255 256 257 258 259 260 261 262 263 264 265 266 |
# File 'lib/ibm_cloud_power/models/sap_profile.rb', line 254 def valid? warn '[DEPRECATED] the `valid?` method is obsolete' return false if @certified.nil? return false if @cores.nil? return false if @memory.nil? return false if @profile_id.nil? smt_mode_validator = EnumAttributeValidator.new('Integer', [4, 8]) return false unless smt_mode_validator.valid?(@smt_mode) return false if @type.nil? type_validator = EnumAttributeValidator.new('String', ["balanced", "compute", "memory", "non-production", "ultra-memory", "small", "sap-rise", "sap-rise-app"]) return false unless type_validator.valid?(@type) true end |