Class: LinodeOpenapiClient::GetLinodeType200Response
- Inherits:
-
Object
- Object
- LinodeOpenapiClient::GetLinodeType200Response
- Defined in:
- lib/linode_openapi_client/models/get_linode_type200_response.rb
Overview
Returns collection of Linode types, including pricing and specifications for each type. These are used when [creating](techdocs.akamai.com/linode-api/reference/post-linode-instance) or [resizing](techdocs.akamai.com/linode-api/reference/post-resize-linode-instance) Linodes.
Defined Under Namespace
Classes: EnumAttributeValidator
Instance Attribute Summary collapse
-
#_class ⇒ Object
__Filterable__, Read-only The class of the Linode Type.
-
#addons ⇒ Object
Returns the value of attribute addons.
-
#disk ⇒ Object
__Filterable__, Read-only The Disk size, in MB, of the Linode Type.
-
#gpus ⇒ Object
__Filterable__, Read-only The number of GPUs this Linode Type offers.
-
#id ⇒ Object
Read-only The ID representing the Linode Type.
-
#label ⇒ Object
__Filterable__, Read-only The Linode Type’s label is for display purposes only.
-
#memory ⇒ Object
__Filterable__, Read-only Amount of RAM included in this Linode Type.
-
#network_out ⇒ Object
__Filterable__, Read-only The Mbits outbound bandwidth allocation.
-
#price ⇒ Object
Returns the value of attribute price.
-
#region_prices ⇒ Object
Returns the value of attribute region_prices.
-
#successor ⇒ Object
Read-only The Linode Type that a [mutate](techdocs.akamai.com/linode-api/reference/post-mutate-linode-instance) will upgrade to for a Linode of this type.
-
#transfer ⇒ Object
__Filterable__, Read-only The monthly outbound transfer amount, in MB.
-
#vcpus ⇒ Object
__Filterable__, Read-only The number of VCPU cores this Linode Type offers.
Class Method Summary collapse
-
._deserialize(type, value) ⇒ Object
Deserializes the data based on type.
-
.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.
-
#_to_hash(value) ⇒ Hash
Outputs non-array value in the form of hash For object, use to_hash.
- #eql?(o) ⇒ Boolean
-
#hash ⇒ Integer
Calculates hash code according to all attributes.
-
#initialize(attributes = {}) ⇒ GetLinodeType200Response
constructor
Initializes the object.
-
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons.
-
#to_body ⇒ Hash
to_body is an alias to to_hash (backward compatibility).
-
#to_hash ⇒ Hash
Returns the object in the form of hash.
-
#to_s ⇒ String
Returns the string representation of the object.
-
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid.
Constructor Details
#initialize(attributes = {}) ⇒ GetLinodeType200Response
Initializes the object
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 |
# File 'lib/linode_openapi_client/models/get_linode_type200_response.rb', line 129 def initialize(attributes = {}) if (!attributes.is_a?(Hash)) fail ArgumentError, "The input argument (attributes) must be a hash in `LinodeOpenapiClient::GetLinodeType200Response` initialize method" end # check to see if the attribute exists and convert string to symbol for hash key attributes = attributes.each_with_object({}) { |(k, v), h| if (!self.class.attribute_map.key?(k.to_sym)) fail ArgumentError, "`#{k}` is not a valid attribute in `LinodeOpenapiClient::GetLinodeType200Response`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect end h[k.to_sym] = v } if attributes.key?(:'addons') self.addons = attributes[:'addons'] end if attributes.key?(:'network_out') self.network_out = attributes[:'network_out'] end if attributes.key?(:'id') self.id = attributes[:'id'] end if attributes.key?(:'memory') self.memory = attributes[:'memory'] end if attributes.key?(:'disk') self.disk = attributes[:'disk'] end if attributes.key?(:'_class') self._class = attributes[:'_class'] end if attributes.key?(:'successor') self.successor = attributes[:'successor'] end if attributes.key?(:'gpus') self.gpus = attributes[:'gpus'] end if attributes.key?(:'vcpus') self.vcpus = attributes[:'vcpus'] end if attributes.key?(:'transfer') self.transfer = attributes[:'transfer'] end if attributes.key?(:'price') self.price = attributes[:'price'] end if attributes.key?(:'label') self.label = attributes[:'label'] end if attributes.key?(:'region_prices') if (value = attributes[:'region_prices']).is_a?(Array) self.region_prices = value end end end |
Instance Attribute Details
#_class ⇒ Object
__Filterable__, Read-only The class of the Linode Type. We currently offer six classes of compute instances: - ‘nanode` - Nanode instances are good for low-duty workloads, where performance isn’t critical. __Note__. As of June 16th, 2020, Nanodes became 1 GB Linodes in the Cloud Manager, however, the API, the CLI, and billing will continue to refer to these instances as Nanodes. - ‘standard` - Standard Shared instances are good for medium-duty workloads and are a good mix of performance, resources, and price. __Note__. As of June 16th, 2020, Standard Linodes in the Cloud Manager became Shared Linodes, however, the API, the CLI, and billing will continue to refer to these instances as Standard Linodes. - `dedicated` - Dedicated CPU instances are good for full-duty workloads where consistent performance is important. - `premium` (limited Regions) - In addition to the features of Dedicated instances, Premium instances come equipped with the latest AMD EPYC™ CPUs, ensuring your applications are running on the latest hardware with consistently high performance. Only available in [regions](techdocs.akamai.com/linode-api/reference/get-regions) with "Premium Plans" in their `capabilities` - `gpu` (limited Regions) - Linodes with dedicated NVIDIA Quadro® RTX 6000 GPUs accelerate highly specialized applications such as machine learning, AI, and video transcoding. Only available in [regions](techdocs.akamai.com/linode-api/reference/get-regions) with "GPU Linodes" in their `capabilities` - `highmem` - High Memory instances favor RAM over other resources, and can be good for memory hungry use cases like caching and in-memory databases. All High Memory plans contain dedicated CPU cores.
34 35 36 |
# File 'lib/linode_openapi_client/models/get_linode_type200_response.rb', line 34 def _class @_class end |
#addons ⇒ Object
Returns the value of attribute addons.
19 20 21 |
# File 'lib/linode_openapi_client/models/get_linode_type200_response.rb', line 19 def addons @addons end |
#disk ⇒ Object
__Filterable__, Read-only The Disk size, in MB, of the Linode Type.
31 32 33 |
# File 'lib/linode_openapi_client/models/get_linode_type200_response.rb', line 31 def disk @disk end |
#gpus ⇒ Object
__Filterable__, Read-only The number of GPUs this Linode Type offers.
40 41 42 |
# File 'lib/linode_openapi_client/models/get_linode_type200_response.rb', line 40 def gpus @gpus end |
#id ⇒ Object
Read-only The ID representing the Linode Type.
25 26 27 |
# File 'lib/linode_openapi_client/models/get_linode_type200_response.rb', line 25 def id @id end |
#label ⇒ Object
__Filterable__, Read-only The Linode Type’s label is for display purposes only.
51 52 53 |
# File 'lib/linode_openapi_client/models/get_linode_type200_response.rb', line 51 def label @label end |
#memory ⇒ Object
__Filterable__, Read-only Amount of RAM included in this Linode Type.
28 29 30 |
# File 'lib/linode_openapi_client/models/get_linode_type200_response.rb', line 28 def memory @memory end |
#network_out ⇒ Object
__Filterable__, Read-only The Mbits outbound bandwidth allocation.
22 23 24 |
# File 'lib/linode_openapi_client/models/get_linode_type200_response.rb', line 22 def network_out @network_out end |
#price ⇒ Object
Returns the value of attribute price.
48 49 50 |
# File 'lib/linode_openapi_client/models/get_linode_type200_response.rb', line 48 def price @price end |
#region_prices ⇒ Object
Returns the value of attribute region_prices.
53 54 55 |
# File 'lib/linode_openapi_client/models/get_linode_type200_response.rb', line 53 def region_prices @region_prices end |
#successor ⇒ Object
Read-only The Linode Type that a [mutate](techdocs.akamai.com/linode-api/reference/post-mutate-linode-instance) will upgrade to for a Linode of this type. If ‘null`, a Linode of this type may not mutate.
37 38 39 |
# File 'lib/linode_openapi_client/models/get_linode_type200_response.rb', line 37 def successor @successor end |
#transfer ⇒ Object
__Filterable__, Read-only The monthly outbound transfer amount, in MB.
46 47 48 |
# File 'lib/linode_openapi_client/models/get_linode_type200_response.rb', line 46 def transfer @transfer end |
#vcpus ⇒ Object
__Filterable__, Read-only The number of VCPU cores this Linode Type offers.
43 44 45 |
# File 'lib/linode_openapi_client/models/get_linode_type200_response.rb', line 43 def vcpus @vcpus end |
Class Method Details
._deserialize(type, value) ⇒ Object
Deserializes the data based on type
283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 |
# File 'lib/linode_openapi_client/models/get_linode_type200_response.rb', line 283 def self._deserialize(type, value) case type.to_sym when :Time Time.parse(value) when :Date Date.parse(value) when :String value.to_s when :Integer value.to_i when :Float value.to_f when :Boolean if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else false end when :Object # generic object (usually a Hash), return directly value when /\AArray<(?<inner_type>.+)>\z/ inner_type = Regexp.last_match[:inner_type] value.map { |v| _deserialize(inner_type, v) } when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/ k_type = Regexp.last_match[:k_type] v_type = Regexp.last_match[:v_type] {}.tap do |hash| value.each do |k, v| hash[_deserialize(k_type, k)] = _deserialize(v_type, v) end end else # model # models (e.g. Pet) or oneOf klass = LinodeOpenapiClient.const_get(type) klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end |
.acceptable_attributes ⇒ Object
Returns all the JSON keys this model knows about
97 98 99 |
# File 'lib/linode_openapi_client/models/get_linode_type200_response.rb', line 97 def self.acceptable_attributes attribute_map.values end |
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 |
# File 'lib/linode_openapi_client/models/get_linode_type200_response.rb', line 78 def self.attribute_map { :'addons' => :'addons', :'network_out' => :'network_out', :'id' => :'id', :'memory' => :'memory', :'disk' => :'disk', :'_class' => :'class', :'successor' => :'successor', :'gpus' => :'gpus', :'vcpus' => :'vcpus', :'transfer' => :'transfer', :'price' => :'price', :'label' => :'label', :'region_prices' => :'region_prices' } end |
.build_from_hash(attributes) ⇒ Object
Builds the object from hash
259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 |
# File 'lib/linode_openapi_client/models/get_linode_type200_response.rb', line 259 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
121 122 123 124 125 |
# File 'lib/linode_openapi_client/models/get_linode_type200_response.rb', line 121 def self.openapi_nullable Set.new([ :'successor', ]) end |
.openapi_types ⇒ Object
Attribute type mapping.
102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 |
# File 'lib/linode_openapi_client/models/get_linode_type200_response.rb', line 102 def self.openapi_types { :'addons' => :'GetLinodeType200ResponseAddons', :'network_out' => :'Integer', :'id' => :'String', :'memory' => :'Integer', :'disk' => :'Integer', :'_class' => :'String', :'successor' => :'String', :'gpus' => :'Integer', :'vcpus' => :'Integer', :'transfer' => :'Integer', :'price' => :'GetLinodeTypes200ResponseDataInnerPrice', :'label' => :'String', :'region_prices' => :'Array<GetLinodeType200ResponseRegionPricesInner>' } end |
Instance Method Details
#==(o) ⇒ Object
Checks equality by comparing each attribute.
226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 |
# File 'lib/linode_openapi_client/models/get_linode_type200_response.rb', line 226 def ==(o) return true if self.equal?(o) self.class == o.class && addons == o.addons && network_out == o.network_out && id == o.id && memory == o.memory && disk == o.disk && _class == o._class && successor == o.successor && gpus == o.gpus && vcpus == o.vcpus && transfer == o.transfer && price == o.price && label == o.label && region_prices == o.region_prices end |
#_to_hash(value) ⇒ Hash
Outputs non-array value in the form of hash For object, use to_hash. Otherwise, just return the value
354 355 356 357 358 359 360 361 362 363 364 365 366 |
# File 'lib/linode_openapi_client/models/get_linode_type200_response.rb', line 354 def _to_hash(value) if value.is_a?(Array) value.compact.map { |v| _to_hash(v) } elsif value.is_a?(Hash) {}.tap do |hash| value.each { |k, v| hash[k] = _to_hash(v) } end elsif value.respond_to? :to_hash value.to_hash else value end end |
#eql?(o) ⇒ Boolean
246 247 248 |
# File 'lib/linode_openapi_client/models/get_linode_type200_response.rb', line 246 def eql?(o) self == o end |
#hash ⇒ Integer
Calculates hash code according to all attributes.
252 253 254 |
# File 'lib/linode_openapi_client/models/get_linode_type200_response.rb', line 252 def hash [addons, network_out, id, memory, disk, _class, successor, gpus, vcpus, transfer, price, label, region_prices].hash end |
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons. Usually used together with valid?
199 200 201 202 203 |
# File 'lib/linode_openapi_client/models/get_linode_type200_response.rb', line 199 def list_invalid_properties warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new invalid_properties end |
#to_body ⇒ Hash
to_body is an alias to to_hash (backward compatibility)
330 331 332 |
# File 'lib/linode_openapi_client/models/get_linode_type200_response.rb', line 330 def to_body to_hash end |
#to_hash ⇒ Hash
Returns the object in the form of hash
336 337 338 339 340 341 342 343 344 345 346 347 348 |
# File 'lib/linode_openapi_client/models/get_linode_type200_response.rb', line 336 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 |
#to_s ⇒ String
Returns the string representation of the object
324 325 326 |
# File 'lib/linode_openapi_client/models/get_linode_type200_response.rb', line 324 def to_s to_hash.to_s end |
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid
207 208 209 210 211 212 |
# File 'lib/linode_openapi_client/models/get_linode_type200_response.rb', line 207 def valid? warn '[DEPRECATED] the `valid?` method is obsolete' _class_validator = EnumAttributeValidator.new('String', ["nanode", "standard", "dedicated", "premium", "gpu", "highmem"]) return false unless _class_validator.valid?(@_class) true end |