class OCI::Blockchain::Models::ScaledBlockchainPlatformPreview

Blockchain Platform Instance Description Preview after Scaling.

Attributes

compartment_id[RW]

[Required] Compartment Identifier @return [String]

component_details[RW]

@return [OCI::Blockchain::Models::BlockchainPlatformComponentDetails]

component_details_post_scaling[RW]

@return [OCI::Blockchain::Models::BlockchainPlatformComponentDetails]

compute_shape[RW]

[Required] Compute shape - STANDARD or ENTERPRISE_SMALL or ENTERPRISE_MEDIUM or ENTERPRISE_LARGE or ENTERPRISE_EXTRA_LARGE or ENTERPRISE_CUSTOM @return [String]

description[RW]

Platform Instance Description @return [String]

display_name[RW]

[Required] Platform Instance Display name, can be renamed @return [String]

host_ocpu_utilization_info[RW]

List of OcpuUtilization for all hosts @return [Array<OCI::Blockchain::Models::OcpuUtilizationInfo>]

host_ocpu_utilization_info_post_scaling[RW]

List of OcpuUtilization for all hosts after scaling @return [Array<OCI::Blockchain::Models::OcpuUtilizationInfo>]

id[RW]

[Required] unique identifier that is immutable on creation @return [String]

metering_preview[RW]

@return [OCI::Blockchain::Models::ScaledPlatformMeteringPreview]

new_vm_count[RW]

Number of new VMs that would be created @return [Integer]

replicas[RW]

@return [OCI::Blockchain::Models::ReplicaDetails]

replicas_post_scaling[RW]

@return [OCI::Blockchain::Models::ReplicaDetails]

scale_payload[RW]

@return [OCI::Blockchain::Models::ScaleBlockchainPlatformDetails]

storage_size_in_tbs[RW]

Storage size in TBs @return [Float]

storage_size_in_tbs_post_scaling[RW]

Storage size in TBs post scaling @return [Float]

Public Class Methods

attribute_map() click to toggle source

Attribute mapping from ruby-style variable name to JSON key.

# File lib/oci/blockchain/models/scaled_blockchain_platform_preview.rb, line 69
def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'id': :'id',
    'display_name': :'displayName',
    'compartment_id': :'compartmentId',
    'description': :'description',
    'compute_shape': :'computeShape',
    'storage_size_in_tbs': :'storageSizeInTBs',
    'storage_size_in_tbs_post_scaling': :'storageSizeInTBsPostScaling',
    'component_details': :'componentDetails',
    'replicas': :'replicas',
    'component_details_post_scaling': :'componentDetailsPostScaling',
    'replicas_post_scaling': :'replicasPostScaling',
    'host_ocpu_utilization_info': :'hostOcpuUtilizationInfo',
    'host_ocpu_utilization_info_post_scaling': :'hostOcpuUtilizationInfoPostScaling',
    'new_vm_count': :'newVmCount',
    'metering_preview': :'meteringPreview',
    'scale_payload': :'scalePayload'
    # rubocop:enable Style/SymbolLiteral
  }
end
new(attributes = {}) click to toggle source

Initializes the object @param [Hash] attributes Model attributes in the form of hash @option attributes [String] :id The value to assign to the {#id} property @option attributes [String] :display_name The value to assign to the {#display_name} property @option attributes [String] :compartment_id The value to assign to the {#compartment_id} property @option attributes [String] :description The value to assign to the {#description} property @option attributes [String] :compute_shape The value to assign to the {#compute_shape} property @option attributes [Float] :storage_size_in_tbs The value to assign to the {#storage_size_in_tbs} property @option attributes [Float] :storage_size_in_tbs_post_scaling The value to assign to the {#storage_size_in_tbs_post_scaling} property @option attributes [OCI::Blockchain::Models::BlockchainPlatformComponentDetails] :component_details The value to assign to the {#component_details} property @option attributes [OCI::Blockchain::Models::ReplicaDetails] :replicas The value to assign to the {#replicas} property @option attributes [OCI::Blockchain::Models::BlockchainPlatformComponentDetails] :component_details_post_scaling The value to assign to the {#component_details_post_scaling} property @option attributes [OCI::Blockchain::Models::ReplicaDetails] :replicas_post_scaling The value to assign to the {#replicas_post_scaling} property @option attributes [Array<OCI::Blockchain::Models::OcpuUtilizationInfo>] :host_ocpu_utilization_info The value to assign to the {#host_ocpu_utilization_info} property @option attributes [Array<OCI::Blockchain::Models::OcpuUtilizationInfo>] :host_ocpu_utilization_info_post_scaling The value to assign to the {#host_ocpu_utilization_info_post_scaling} property @option attributes [Integer] :new_vm_count The value to assign to the {#new_vm_count} property @option attributes [OCI::Blockchain::Models::ScaledPlatformMeteringPreview] :metering_preview The value to assign to the {#metering_preview} property @option attributes [OCI::Blockchain::Models::ScaleBlockchainPlatformDetails] :scale_payload The value to assign to the {#scale_payload} property

# File lib/oci/blockchain/models/scaled_blockchain_platform_preview.rb, line 138
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.id = attributes[:'id'] if attributes[:'id']

  self.display_name = attributes[:'displayName'] if attributes[:'displayName']

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

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

  self.compartment_id = attributes[:'compartmentId'] if attributes[:'compartmentId']

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

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

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

  self.compute_shape = attributes[:'computeShape'] if attributes[:'computeShape']

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

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

  self.storage_size_in_tbs = attributes[:'storageSizeInTBs'] if attributes[:'storageSizeInTBs']

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

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

  self.storage_size_in_tbs_post_scaling = attributes[:'storageSizeInTBsPostScaling'] if attributes[:'storageSizeInTBsPostScaling']

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

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

  self.component_details = attributes[:'componentDetails'] if attributes[:'componentDetails']

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

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

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

  self.component_details_post_scaling = attributes[:'componentDetailsPostScaling'] if attributes[:'componentDetailsPostScaling']

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

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

  self.replicas_post_scaling = attributes[:'replicasPostScaling'] if attributes[:'replicasPostScaling']

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

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

  self.host_ocpu_utilization_info = attributes[:'hostOcpuUtilizationInfo'] if attributes[:'hostOcpuUtilizationInfo']

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

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

  self.host_ocpu_utilization_info_post_scaling = attributes[:'hostOcpuUtilizationInfoPostScaling'] if attributes[:'hostOcpuUtilizationInfoPostScaling']

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

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

  self.new_vm_count = attributes[:'newVmCount'] if attributes[:'newVmCount']

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

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

  self.metering_preview = attributes[:'meteringPreview'] if attributes[:'meteringPreview']

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

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

  self.scale_payload = attributes[:'scalePayload'] if attributes[:'scalePayload']

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

  self.scale_payload = attributes[:'scale_payload'] if attributes[:'scale_payload']
end
swagger_types() click to toggle source

Attribute type mapping.

# File lib/oci/blockchain/models/scaled_blockchain_platform_preview.rb, line 93
def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'id': :'String',
    'display_name': :'String',
    'compartment_id': :'String',
    'description': :'String',
    'compute_shape': :'String',
    'storage_size_in_tbs': :'Float',
    'storage_size_in_tbs_post_scaling': :'Float',
    'component_details': :'OCI::Blockchain::Models::BlockchainPlatformComponentDetails',
    'replicas': :'OCI::Blockchain::Models::ReplicaDetails',
    'component_details_post_scaling': :'OCI::Blockchain::Models::BlockchainPlatformComponentDetails',
    'replicas_post_scaling': :'OCI::Blockchain::Models::ReplicaDetails',
    'host_ocpu_utilization_info': :'Array<OCI::Blockchain::Models::OcpuUtilizationInfo>',
    'host_ocpu_utilization_info_post_scaling': :'Array<OCI::Blockchain::Models::OcpuUtilizationInfo>',
    'new_vm_count': :'Integer',
    'metering_preview': :'OCI::Blockchain::Models::ScaledPlatformMeteringPreview',
    'scale_payload': :'OCI::Blockchain::Models::ScaleBlockchainPlatformDetails'
    # rubocop:enable Style/SymbolLiteral
  }
end

Public Instance Methods

==(other) click to toggle source

Checks equality by comparing each attribute. @param [Object] other the other object to be compared

# File lib/oci/blockchain/models/scaled_blockchain_platform_preview.rb, line 236
def ==(other)
  return true if equal?(other)

  self.class == other.class &&
    id == other.id &&
    display_name == other.display_name &&
    compartment_id == other.compartment_id &&
    description == other.description &&
    compute_shape == other.compute_shape &&
    storage_size_in_tbs == other.storage_size_in_tbs &&
    storage_size_in_tbs_post_scaling == other.storage_size_in_tbs_post_scaling &&
    component_details == other.component_details &&
    replicas == other.replicas &&
    component_details_post_scaling == other.component_details_post_scaling &&
    replicas_post_scaling == other.replicas_post_scaling &&
    host_ocpu_utilization_info == other.host_ocpu_utilization_info &&
    host_ocpu_utilization_info_post_scaling == other.host_ocpu_utilization_info_post_scaling &&
    new_vm_count == other.new_vm_count &&
    metering_preview == other.metering_preview &&
    scale_payload == other.scale_payload
end
build_from_hash(attributes) click to toggle source

Builds the object from hash @param [Hash] attributes Model attributes in the form of hash @return [Object] Returns the model itself

# File lib/oci/blockchain/models/scaled_blockchain_platform_preview.rb, line 281
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) click to toggle source

@see the `==` method @param [Object] other the other object to be compared

# File lib/oci/blockchain/models/scaled_blockchain_platform_preview.rb, line 261
def eql?(other)
  self == other
end
hash() click to toggle source

Calculates hash code according to all attributes. @return [Fixnum] Hash code

# File lib/oci/blockchain/models/scaled_blockchain_platform_preview.rb, line 270
def hash
  [id, display_name, compartment_id, description, compute_shape, storage_size_in_tbs, storage_size_in_tbs_post_scaling, component_details, replicas, component_details_post_scaling, replicas_post_scaling, host_ocpu_utilization_info, host_ocpu_utilization_info_post_scaling, new_vm_count, metering_preview, scale_payload].hash
end
to_hash() click to toggle source

Returns the object in the form of hash @return [Hash] Returns the object in the form of hash

# File lib/oci/blockchain/models/scaled_blockchain_platform_preview.rb, line 314
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() click to toggle source

Returns the string representation of the object @return [String] String presentation of the object

# File lib/oci/blockchain/models/scaled_blockchain_platform_preview.rb, line 308
def to_s
  to_hash.to_s
end

Private Instance Methods

_to_hash(value) click to toggle source

Outputs non-array value in the form of hash For object, use to_hash. Otherwise, just return the value @param [Object] value Any valid value @return [Hash] Returns the value in the form of hash

# File lib/oci/blockchain/models/scaled_blockchain_platform_preview.rb, line 331
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