Class: OCI::CapacityManagement::Models::OccHandoverResourceBlockSummary

Inherits:
Object
  • Object
show all
Defined in:
lib/oci/capacity_management/models/occ_handover_resource_block_summary.rb

Overview

Details about the association of capacity requests with the corresponding resources handed over by oracle.

Constant Summary collapse

NAMESPACE_ENUM =
[
  NAMESPACE_COMPUTE = 'COMPUTE'.freeze,
  NAMESPACE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ OccHandoverResourceBlockSummary

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):



113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
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
# File 'lib/oci/capacity_management/models/occ_handover_resource_block_summary.rb', line 113

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

  self.occ_customer_group_id = attributes[:'occCustomerGroupId'] if attributes[:'occCustomerGroupId']

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

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

  self.handover_date = attributes[:'handoverDate'] if attributes[:'handoverDate']

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

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

  self.handover_resource_name = attributes[:'handoverResourceName'] if attributes[:'handoverResourceName']

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

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

  self.total_handover_quantity = attributes[:'totalHandoverQuantity'] if attributes[:'totalHandoverQuantity']

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

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

  self.associated_capacity_requests = attributes[:'associatedCapacityRequests'] if attributes[:'associatedCapacityRequests']

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

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

  self.placement_details = attributes[:'placementDetails'] if attributes[:'placementDetails']

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

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

Instance Attribute Details

#associated_capacity_requestsArray<OCI::CapacityManagement::Models::AssociatedCapacityRequestDetails>

[Required] A list containing details about the capacity requests against which the resources were provisioned by oracle.



58
59
60
# File 'lib/oci/capacity_management/models/occ_handover_resource_block_summary.rb', line 58

def associated_capacity_requests
  @associated_capacity_requests
end

#compartment_idString

[Required] The OCID of the compartment where the resource block's are placed.

Returns:

  • (String)


26
27
28
# File 'lib/oci/capacity_management/models/occ_handover_resource_block_summary.rb', line 26

def compartment_id
  @compartment_id
end

#handover_dateDateTime

[Required] The date on which the resource was handed over to the customer.

Returns:

  • (DateTime)


42
43
44
# File 'lib/oci/capacity_management/models/occ_handover_resource_block_summary.rb', line 42

def handover_date
  @handover_date
end

#handover_resource_nameString

[Required] The name of the resource handed over by oracle. For instance for compute namespace this will be the name of the bare metal hardware resource.

Returns:

  • (String)


48
49
50
# File 'lib/oci/capacity_management/models/occ_handover_resource_block_summary.rb', line 48

def handover_resource_name
  @handover_resource_name
end

#idString

[Required] The OCID of the resource block.

Returns:

  • (String)


21
22
23
# File 'lib/oci/capacity_management/models/occ_handover_resource_block_summary.rb', line 21

def id
  @id
end

#namespaceString

[Required] The name of the OCI service in consideration. For example Compute, Exadata and so on.

Returns:

  • (String)


32
33
34
# File 'lib/oci/capacity_management/models/occ_handover_resource_block_summary.rb', line 32

def namespace
  @namespace
end

#occ_customer_group_idString

[Required] The OCID of the customer group for which the resources were provisioned.

Returns:

  • (String)


37
38
39
# File 'lib/oci/capacity_management/models/occ_handover_resource_block_summary.rb', line 37

def occ_customer_group_id
  @occ_customer_group_id
end

#placement_detailsOCI::CapacityManagement::Models::PlacementDetails

This attribute is required.



62
63
64
# File 'lib/oci/capacity_management/models/occ_handover_resource_block_summary.rb', line 62

def placement_details
  @placement_details
end

#total_handover_quantityInteger

[Required] The total quantity of the resource that was made available to the customer by Oracle.

Returns:

  • (Integer)


53
54
55
# File 'lib/oci/capacity_management/models/occ_handover_resource_block_summary.rb', line 53

def total_handover_quantity
  @total_handover_quantity
end

Class Method Details

.attribute_mapObject

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



65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
# File 'lib/oci/capacity_management/models/occ_handover_resource_block_summary.rb', line 65

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'id': :'id',
    'compartment_id': :'compartmentId',
    'namespace': :'namespace',
    'occ_customer_group_id': :'occCustomerGroupId',
    'handover_date': :'handoverDate',
    'handover_resource_name': :'handoverResourceName',
    'total_handover_quantity': :'totalHandoverQuantity',
    'associated_capacity_requests': :'associatedCapacityRequests',
    'placement_details': :'placementDetails'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
# File 'lib/oci/capacity_management/models/occ_handover_resource_block_summary.rb', line 82

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'id': :'String',
    'compartment_id': :'String',
    'namespace': :'String',
    'occ_customer_group_id': :'String',
    'handover_date': :'DateTime',
    'handover_resource_name': :'String',
    'total_handover_quantity': :'Integer',
    'associated_capacity_requests': :'Array<OCI::CapacityManagement::Models::AssociatedCapacityRequestDetails>',
    'placement_details': :'OCI::CapacityManagement::Models::PlacementDetails'
    # 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



186
187
188
189
190
191
192
193
194
195
196
197
198
199
# File 'lib/oci/capacity_management/models/occ_handover_resource_block_summary.rb', line 186

def ==(other)
  return true if equal?(other)

  self.class == other.class &&
    id == other.id &&
    compartment_id == other.compartment_id &&
    namespace == other.namespace &&
    occ_customer_group_id == other.occ_customer_group_id &&
    handover_date == other.handover_date &&
    handover_resource_name == other.handover_resource_name &&
    total_handover_quantity == other.total_handover_quantity &&
    associated_capacity_requests == other.associated_capacity_requests &&
    placement_details == other.placement_details
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



224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
# File 'lib/oci/capacity_management/models/occ_handover_resource_block_summary.rb', line 224

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


204
205
206
# File 'lib/oci/capacity_management/models/occ_handover_resource_block_summary.rb', line 204

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



213
214
215
# File 'lib/oci/capacity_management/models/occ_handover_resource_block_summary.rb', line 213

def hash
  [id, compartment_id, namespace, occ_customer_group_id, handover_date, handover_resource_name, total_handover_quantity, associated_capacity_requests, placement_details].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



257
258
259
260
261
262
263
264
265
266
# File 'lib/oci/capacity_management/models/occ_handover_resource_block_summary.rb', line 257

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



251
252
253
# File 'lib/oci/capacity_management/models/occ_handover_resource_block_summary.rb', line 251

def to_s
  to_hash.to_s
end