Class: OCI::Rover::Models::ShapeSummary
- Inherits:
-
Object
- Object
- OCI::Rover::Models::ShapeSummary
- Defined in:
- lib/oci/rover/models/shape_summary.rb
Overview
A shape of a node on a Rover device.
Instance Attribute Summary collapse
-
#defined_tags ⇒ Hash<String, Hash<String, Object>>
The defined tags associated with this resource, if any.
-
#freeform_tags ⇒ Hash<String, String>
The freeform tags associated with this resource, if any.
-
#gpu_description ⇒ String
A short description of the graphics processing unit (GPU) available for this shape.
-
#gpus ⇒ Integer
The number of GPUs available for this shape.
-
#memory_in_gbs ⇒ Float
The default amount of memory available for this shape, in gigabytes.
-
#networking_bandwidth_in_gbps ⇒ Float
The networking bandwidth available for this shape, in gigabits per second.
-
#number_of_usb_controllers ⇒ Integer
The number of USB controllers available for this shape.
-
#ocpus ⇒ Integer
The default number of OCPUs available for this shape.
-
#processor_description ⇒ String
A short description of the shape's processor (CPU).
-
#shape ⇒ String
[Required] The name of the shape.
-
#system_tags ⇒ Hash<String, Hash<String, Object>>
The system tags associated with this resource, if any.
-
#tags ⇒ String
The tags associated with tagSlug.
-
#usb_controller_description ⇒ String
A short description of the USB controller available for this shape.
Class Method Summary collapse
-
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
-
.swagger_types ⇒ Object
Attribute type mapping.
Instance Method Summary collapse
-
#==(other) ⇒ Object
Checks equality by comparing each attribute.
-
#build_from_hash(attributes) ⇒ Object
Builds the object from hash.
- #eql?(other) ⇒ Boolean
-
#hash ⇒ Fixnum
Calculates hash code according to all attributes.
-
#initialize(attributes = {}) ⇒ ShapeSummary
constructor
Initializes the object.
-
#to_hash ⇒ Hash
Returns the object in the form of hash.
-
#to_s ⇒ String
Returns the string representation of the object.
Constructor Details
#initialize(attributes = {}) ⇒ ShapeSummary
Initializes the object
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 |
# File 'lib/oci/rover/models/shape_summary.rb', line 135 def initialize(attributes = {}) return unless attributes.is_a?(Hash) # convert string to symbol for hash key attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } self.gpu_description = attributes[:'gpuDescription'] if attributes[:'gpuDescription'] self.gpu_description = "null" if gpu_description.nil? && !attributes.key?(:'gpuDescription') # rubocop:disable Style/StringLiterals raise 'You cannot provide both :gpuDescription and :gpu_description' if attributes.key?(:'gpuDescription') && attributes.key?(:'gpu_description') self.gpu_description = attributes[:'gpu_description'] if attributes[:'gpu_description'] self.gpu_description = "null" if gpu_description.nil? && !attributes.key?(:'gpuDescription') && !attributes.key?(:'gpu_description') # rubocop:disable Style/StringLiterals self.gpus = attributes[:'gpus'] if attributes[:'gpus'] self.memory_in_gbs = attributes[:'memoryInGBs'] if attributes[:'memoryInGBs'] raise 'You cannot provide both :memoryInGBs and :memory_in_gbs' if attributes.key?(:'memoryInGBs') && attributes.key?(:'memory_in_gbs') self.memory_in_gbs = attributes[:'memory_in_gbs'] if attributes[:'memory_in_gbs'] self.networking_bandwidth_in_gbps = attributes[:'networkingBandwidthInGbps'] if attributes[:'networkingBandwidthInGbps'] raise 'You cannot provide both :networkingBandwidthInGbps and :networking_bandwidth_in_gbps' if attributes.key?(:'networkingBandwidthInGbps') && attributes.key?(:'networking_bandwidth_in_gbps') self.networking_bandwidth_in_gbps = attributes[:'networking_bandwidth_in_gbps'] if attributes[:'networking_bandwidth_in_gbps'] self.ocpus = attributes[:'ocpus'] if attributes[:'ocpus'] self.processor_description = attributes[:'processorDescription'] if attributes[:'processorDescription'] raise 'You cannot provide both :processorDescription and :processor_description' if attributes.key?(:'processorDescription') && attributes.key?(:'processor_description') self.processor_description = attributes[:'processor_description'] if attributes[:'processor_description'] self.shape = attributes[:'shape'] if attributes[:'shape'] self.usb_controller_description = attributes[:'usbControllerDescription'] if attributes[:'usbControllerDescription'] self.usb_controller_description = "null" if usb_controller_description.nil? && !attributes.key?(:'usbControllerDescription') # rubocop:disable Style/StringLiterals raise 'You cannot provide both :usbControllerDescription and :usb_controller_description' if attributes.key?(:'usbControllerDescription') && attributes.key?(:'usb_controller_description') self.usb_controller_description = attributes[:'usb_controller_description'] if attributes[:'usb_controller_description'] self.usb_controller_description = "null" if usb_controller_description.nil? && !attributes.key?(:'usbControllerDescription') && !attributes.key?(:'usb_controller_description') # rubocop:disable Style/StringLiterals self.number_of_usb_controllers = attributes[:'numberOfUsbControllers'] if attributes[:'numberOfUsbControllers'] raise 'You cannot provide both :numberOfUsbControllers and :number_of_usb_controllers' if attributes.key?(:'numberOfUsbControllers') && attributes.key?(:'number_of_usb_controllers') self.number_of_usb_controllers = attributes[:'number_of_usb_controllers'] if attributes[:'number_of_usb_controllers'] self. = attributes[:'tags'] if attributes[:'tags'] self. = attributes[:'freeformTags'] if attributes[:'freeformTags'] raise 'You cannot provide both :freeformTags and :freeform_tags' if attributes.key?(:'freeformTags') && attributes.key?(:'freeform_tags') self. = attributes[:'freeform_tags'] if attributes[:'freeform_tags'] self. = attributes[:'definedTags'] if attributes[:'definedTags'] raise 'You cannot provide both :definedTags and :defined_tags' if attributes.key?(:'definedTags') && attributes.key?(:'defined_tags') self. = attributes[:'defined_tags'] if attributes[:'defined_tags'] self. = attributes[:'systemTags'] if attributes[:'systemTags'] raise 'You cannot provide both :systemTags and :system_tags' if attributes.key?(:'systemTags') && attributes.key?(:'system_tags') self. = attributes[:'system_tags'] if attributes[:'system_tags'] end |
Instance Attribute Details
#defined_tags ⇒ Hash<String, Hash<String, Object>>
The defined tags associated with this resource, if any. Each key is predefined and scoped to namespaces. For more information, see Resource Tags. Example: {\"Operations\": {\"CostCenter\": \"42\"}}
65 66 67 |
# File 'lib/oci/rover/models/shape_summary.rb', line 65 def @defined_tags end |
#freeform_tags ⇒ Hash<String, String>
The freeform tags associated with this resource, if any. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags. Example: {\"Department\": \"Finance\"}
58 59 60 |
# File 'lib/oci/rover/models/shape_summary.rb', line 58 def @freeform_tags end |
#gpu_description ⇒ String
A short description of the graphics processing unit (GPU) available for this shape.
14 15 16 |
# File 'lib/oci/rover/models/shape_summary.rb', line 14 def gpu_description @gpu_description end |
#gpus ⇒ Integer
The number of GPUs available for this shape.
18 19 20 |
# File 'lib/oci/rover/models/shape_summary.rb', line 18 def gpus @gpus end |
#memory_in_gbs ⇒ Float
The default amount of memory available for this shape, in gigabytes.
22 23 24 |
# File 'lib/oci/rover/models/shape_summary.rb', line 22 def memory_in_gbs @memory_in_gbs end |
#networking_bandwidth_in_gbps ⇒ Float
The networking bandwidth available for this shape, in gigabits per second.
26 27 28 |
# File 'lib/oci/rover/models/shape_summary.rb', line 26 def networking_bandwidth_in_gbps @networking_bandwidth_in_gbps end |
#number_of_usb_controllers ⇒ Integer
The number of USB controllers available for this shape.
46 47 48 |
# File 'lib/oci/rover/models/shape_summary.rb', line 46 def number_of_usb_controllers @number_of_usb_controllers end |
#ocpus ⇒ Integer
The default number of OCPUs available for this shape.
30 31 32 |
# File 'lib/oci/rover/models/shape_summary.rb', line 30 def ocpus @ocpus end |
#processor_description ⇒ String
A short description of the shape's processor (CPU).
34 35 36 |
# File 'lib/oci/rover/models/shape_summary.rb', line 34 def processor_description @processor_description end |
#shape ⇒ String
[Required] The name of the shape.
38 39 40 |
# File 'lib/oci/rover/models/shape_summary.rb', line 38 def shape @shape end |
#system_tags ⇒ Hash<String, Hash<String, Object>>
The system tags associated with this resource, if any. The system tags are set by Oracle cloud infrastructure services. Each key is predefined and scoped to namespaces. For more information, see Resource Tags. Example: {orcl-cloud: {free-tier-retain: true}}
72 73 74 |
# File 'lib/oci/rover/models/shape_summary.rb', line 72 def @system_tags end |
#tags ⇒ String
The tags associated with tagSlug.
51 52 53 |
# File 'lib/oci/rover/models/shape_summary.rb', line 51 def @tags end |
#usb_controller_description ⇒ String
A short description of the USB controller available for this shape.
42 43 44 |
# File 'lib/oci/rover/models/shape_summary.rb', line 42 def usb_controller_description @usb_controller_description end |
Class Method Details
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 |
# File 'lib/oci/rover/models/shape_summary.rb', line 75 def self.attribute_map { # rubocop:disable Style/SymbolLiteral 'gpu_description': :'gpuDescription', 'gpus': :'gpus', 'memory_in_gbs': :'memoryInGBs', 'networking_bandwidth_in_gbps': :'networkingBandwidthInGbps', 'ocpus': :'ocpus', 'processor_description': :'processorDescription', 'shape': :'shape', 'usb_controller_description': :'usbControllerDescription', 'number_of_usb_controllers': :'numberOfUsbControllers', 'tags': :'tags', 'freeform_tags': :'freeformTags', 'defined_tags': :'definedTags', 'system_tags': :'systemTags' # rubocop:enable Style/SymbolLiteral } end |
.swagger_types ⇒ Object
Attribute type mapping.
96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 |
# File 'lib/oci/rover/models/shape_summary.rb', line 96 def self.swagger_types { # rubocop:disable Style/SymbolLiteral 'gpu_description': :'String', 'gpus': :'Integer', 'memory_in_gbs': :'Float', 'networking_bandwidth_in_gbps': :'Float', 'ocpus': :'Integer', 'processor_description': :'String', 'shape': :'String', 'usb_controller_description': :'String', 'number_of_usb_controllers': :'Integer', 'tags': :'String', 'freeform_tags': :'Hash<String, String>', 'defined_tags': :'Hash<String, Hash<String, Object>>', 'system_tags': :'Hash<String, Hash<String, Object>>' # rubocop:enable Style/SymbolLiteral } end |
Instance Method Details
#==(other) ⇒ Object
Checks equality by comparing each attribute.
215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 |
# File 'lib/oci/rover/models/shape_summary.rb', line 215 def ==(other) return true if equal?(other) self.class == other.class && gpu_description == other.gpu_description && gpus == other.gpus && memory_in_gbs == other.memory_in_gbs && networking_bandwidth_in_gbps == other.networking_bandwidth_in_gbps && ocpus == other.ocpus && processor_description == other.processor_description && shape == other.shape && usb_controller_description == other.usb_controller_description && number_of_usb_controllers == other.number_of_usb_controllers && == other. && == other. && == other. && == other. end |
#build_from_hash(attributes) ⇒ Object
Builds the object from hash
257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 |
# File 'lib/oci/rover/models/shape_summary.rb', line 257 def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) self.class.swagger_types.each_pair do |key, type| if type =~ /^Array<(.*)>/i # check to ensure the input is an array given that the the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) public_method("#{key}=").call( attributes[self.class.attribute_map[key]] .map { |v| OCI::Internal::Util.convert_to_type(Regexp.last_match(1), v) } ) end elsif !attributes[self.class.attribute_map[key]].nil? public_method("#{key}=").call( OCI::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]]) ) end # or else data not found in attributes(hash), not an issue as the data can be optional end self end |
#eql?(other) ⇒ Boolean
237 238 239 |
# File 'lib/oci/rover/models/shape_summary.rb', line 237 def eql?(other) self == other end |
#hash ⇒ Fixnum
Calculates hash code according to all attributes.
246 247 248 |
# File 'lib/oci/rover/models/shape_summary.rb', line 246 def hash [gpu_description, gpus, memory_in_gbs, networking_bandwidth_in_gbps, ocpus, processor_description, shape, usb_controller_description, number_of_usb_controllers, , , , ].hash end |
#to_hash ⇒ Hash
Returns the object in the form of hash
290 291 292 293 294 295 296 297 298 299 |
# File 'lib/oci/rover/models/shape_summary.rb', line 290 def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = public_method(attr).call next if value.nil? && !instance_variable_defined?("@#{attr}") hash[param] = _to_hash(value) end hash end |
#to_s ⇒ String
Returns the string representation of the object
284 285 286 |
# File 'lib/oci/rover/models/shape_summary.rb', line 284 def to_s to_hash.to_s end |