Class: OCI::Rover::Models::ShapeSummary

Inherits:
Object
  • Object
show all
Defined in:
lib/oci/rover/models/shape_summary.rb

Overview

A shape of a node on a Rover device.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ ShapeSummary

Initializes the object

Parameters:

  • attributes (Hash) (defaults to: {})

    Model attributes in the form of hash

Options Hash (attributes):

  • :gpu_description (String)

    The value to assign to the #gpu_description property

  • :gpus (Integer)

    The value to assign to the #gpus property

  • :memory_in_gbs (Float)

    The value to assign to the #memory_in_gbs property

  • :networking_bandwidth_in_gbps (Float)

    The value to assign to the #networking_bandwidth_in_gbps property

  • :ocpus (Integer)

    The value to assign to the #ocpus property

  • :processor_description (String)

    The value to assign to the #processor_description property

  • :shape (String)

    The value to assign to the #shape property

  • :usb_controller_description (String)

    The value to assign to the #usb_controller_description property

  • :number_of_usb_controllers (Integer)

    The value to assign to the #number_of_usb_controllers property

  • :tags (String)

    The value to assign to the #tags property

  • :freeform_tags (Hash<String, String>)

    The value to assign to the #freeform_tags property

  • :defined_tags (Hash<String, Hash<String, Object>>)

    The value to assign to the #defined_tags property

  • :system_tags (Hash<String, Hash<String, Object>>)

    The value to assign to the #system_tags property



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.tags = attributes[:'tags'] if attributes[:'tags']

  self.freeform_tags = attributes[:'freeformTags'] if attributes[:'freeformTags']

  raise 'You cannot provide both :freeformTags and :freeform_tags' if attributes.key?(:'freeformTags') && attributes.key?(:'freeform_tags')

  self.freeform_tags = attributes[:'freeform_tags'] if attributes[:'freeform_tags']

  self.defined_tags = attributes[:'definedTags'] if attributes[:'definedTags']

  raise 'You cannot provide both :definedTags and :defined_tags' if attributes.key?(:'definedTags') && attributes.key?(:'defined_tags')

  self.defined_tags = attributes[:'defined_tags'] if attributes[:'defined_tags']

  self.system_tags = attributes[:'systemTags'] if attributes[:'systemTags']

  raise 'You cannot provide both :systemTags and :system_tags' if attributes.key?(:'systemTags') && attributes.key?(:'system_tags')

  self.system_tags = attributes[:'system_tags'] if attributes[:'system_tags']
end

Instance Attribute Details

#defined_tagsHash<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\"}}

Returns:

  • (Hash<String, Hash<String, Object>>)


65
66
67
# File 'lib/oci/rover/models/shape_summary.rb', line 65

def defined_tags
  @defined_tags
end

#freeform_tagsHash<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\"}

Returns:

  • (Hash<String, String>)


58
59
60
# File 'lib/oci/rover/models/shape_summary.rb', line 58

def freeform_tags
  @freeform_tags
end

#gpu_descriptionString

A short description of the graphics processing unit (GPU) available for this shape.

Returns:

  • (String)


14
15
16
# File 'lib/oci/rover/models/shape_summary.rb', line 14

def gpu_description
  @gpu_description
end

#gpusInteger

The number of GPUs available for this shape.

Returns:

  • (Integer)


18
19
20
# File 'lib/oci/rover/models/shape_summary.rb', line 18

def gpus
  @gpus
end

#memory_in_gbsFloat

The default amount of memory available for this shape, in gigabytes.

Returns:

  • (Float)


22
23
24
# File 'lib/oci/rover/models/shape_summary.rb', line 22

def memory_in_gbs
  @memory_in_gbs
end

#networking_bandwidth_in_gbpsFloat

The networking bandwidth available for this shape, in gigabits per second.

Returns:

  • (Float)


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_controllersInteger

The number of USB controllers available for this shape.

Returns:

  • (Integer)


46
47
48
# File 'lib/oci/rover/models/shape_summary.rb', line 46

def number_of_usb_controllers
  @number_of_usb_controllers
end

#ocpusInteger

The default number of OCPUs available for this shape.

Returns:

  • (Integer)


30
31
32
# File 'lib/oci/rover/models/shape_summary.rb', line 30

def ocpus
  @ocpus
end

#processor_descriptionString

A short description of the shape's processor (CPU).

Returns:

  • (String)


34
35
36
# File 'lib/oci/rover/models/shape_summary.rb', line 34

def processor_description
  @processor_description
end

#shapeString

[Required] The name of the shape.

Returns:

  • (String)


38
39
40
# File 'lib/oci/rover/models/shape_summary.rb', line 38

def shape
  @shape
end

#system_tagsHash<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}}

Returns:

  • (Hash<String, Hash<String, Object>>)


72
73
74
# File 'lib/oci/rover/models/shape_summary.rb', line 72

def system_tags
  @system_tags
end

#tagsString

The tags associated with tagSlug.

Returns:

  • (String)


51
52
53
# File 'lib/oci/rover/models/shape_summary.rb', line 51

def tags
  @tags
end

#usb_controller_descriptionString

A short description of the USB controller available for this shape.

Returns:

  • (String)


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_mapObject

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_typesObject

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.

Parameters:

  • other (Object)

    the other object to be compared



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 &&
    tags == other.tags &&
    freeform_tags == other.freeform_tags &&
    defined_tags == other.defined_tags &&
    system_tags == other.system_tags
end

#build_from_hash(attributes) ⇒ Object

Builds the object from hash

Parameters:

  • attributes (Hash)

    Model attributes in the form of hash

Returns:

  • (Object)

    Returns the model itself



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

Parameters:

  • other (Object)

    the other object to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


237
238
239
# File 'lib/oci/rover/models/shape_summary.rb', line 237

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



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, tags, freeform_tags, defined_tags, system_tags].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (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_sString

Returns the string representation of the object

Returns:

  • (String)

    String presentation of the object



284
285
286
# File 'lib/oci/rover/models/shape_summary.rb', line 284

def to_s
  to_hash.to_s
end