Class: OCI::CapacityManagement::Models::OccAvailabilitySummary

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

Overview

The details about the available capacity and constraints for different resource types present in the availability catalog.

Constant Summary collapse

NAMESPACE_ENUM =
[
  NAMESPACE_COMPUTE = 'COMPUTE'.freeze,
  NAMESPACE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze
RESOURCE_TYPE_ENUM =
[
  RESOURCE_TYPE_SERVER_HW = 'SERVER_HW'.freeze,
  RESOURCE_TYPE_CAPACITY_CONSTRAINT = 'CAPACITY_CONSTRAINT'.freeze,
  RESOURCE_TYPE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze
WORKLOAD_TYPE_ENUM =
[
  WORKLOAD_TYPE_GENERIC = 'GENERIC'.freeze,
  WORKLOAD_TYPE_ROW = 'ROW'.freeze,
  WORKLOAD_TYPE_US_PROD = 'US_PROD'.freeze,
  WORKLOAD_TYPE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ OccAvailabilitySummary

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):

  • :catalog_id (String)

    The value to assign to the #catalog_id property

  • :namespace (String)

    The value to assign to the #namespace property

  • :date_final_customer_order (DateTime)

    The value to assign to the #date_final_customer_order property

  • :date_expected_capacity_handover (DateTime)

    The value to assign to the #date_expected_capacity_handover property

  • :resource_type (String)

    The value to assign to the #resource_type property

  • :workload_type (String)

    The value to assign to the #workload_type property

  • :resource_name (String)

    The value to assign to the #resource_name property

  • :available_quantity (Integer)

    The value to assign to the #available_quantity property

  • :unit (String)

    The value to assign to the #unit property



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
165
166
167
# File 'lib/oci/capacity_management/models/occ_availability_summary.rb', line 116

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

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

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

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

  self.date_final_customer_order = attributes[:'dateFinalCustomerOrder'] if attributes[:'dateFinalCustomerOrder']

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

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

  self.date_expected_capacity_handover = attributes[:'dateExpectedCapacityHandover'] if attributes[:'dateExpectedCapacityHandover']

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

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

  self.resource_type = attributes[:'resourceType'] if attributes[:'resourceType']

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

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

  self.workload_type = attributes[:'workloadType'] if attributes[:'workloadType']

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

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

  self.resource_name = attributes[:'resourceName'] if attributes[:'resourceName']

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

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

  self.available_quantity = attributes[:'availableQuantity'] if attributes[:'availableQuantity']

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

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

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

Instance Attribute Details

#available_quantityInteger

[Required] The quantity of available resource that the customer can request.

Returns:

  • (Integer)


61
62
63
# File 'lib/oci/capacity_management/models/occ_availability_summary.rb', line 61

def available_quantity
  @available_quantity
end

#catalog_idString

[Required] The OCID of the availability catalog.

Returns:

  • (String)


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

def catalog_id
  @catalog_id
end

#date_expected_capacity_handoverDateTime

[Required] The date by which the capacity requested by customers before dateFinalCustomerOrder needs to be fulfilled.

Returns:

  • (DateTime)


45
46
47
# File 'lib/oci/capacity_management/models/occ_availability_summary.rb', line 45

def date_expected_capacity_handover
  @date_expected_capacity_handover
end

#date_final_customer_orderDateTime

[Required] The date by which the customer must place the order to have their capacity requirements met by the customer handover date.

Returns:

  • (DateTime)


41
42
43
# File 'lib/oci/capacity_management/models/occ_availability_summary.rb', line 41

def date_final_customer_order
  @date_final_customer_order
end

#namespaceString

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

Returns:

  • (String)


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

def namespace
  @namespace
end

#resource_nameString

[Required] The name of the resource that the customer can request.

Returns:

  • (String)


57
58
59
# File 'lib/oci/capacity_management/models/occ_availability_summary.rb', line 57

def resource_name
  @resource_name
end

#resource_typeString

[Required] The different types of resources against which customers can place capacity requests.

Returns:

  • (String)


49
50
51
# File 'lib/oci/capacity_management/models/occ_availability_summary.rb', line 49

def resource_type
  @resource_type
end

#unitString

[Required] The unit in which the resource available is measured.

Returns:

  • (String)


65
66
67
# File 'lib/oci/capacity_management/models/occ_availability_summary.rb', line 65

def unit
  @unit
end

#workload_typeString

[Required] The type of workload (Generic/ROW).

Returns:

  • (String)


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

def workload_type
  @workload_type
end

Class Method Details

.attribute_mapObject

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



68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
# File 'lib/oci/capacity_management/models/occ_availability_summary.rb', line 68

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'catalog_id': :'catalogId',
    'namespace': :'namespace',
    'date_final_customer_order': :'dateFinalCustomerOrder',
    'date_expected_capacity_handover': :'dateExpectedCapacityHandover',
    'resource_type': :'resourceType',
    'workload_type': :'workloadType',
    'resource_name': :'resourceName',
    'available_quantity': :'availableQuantity',
    'unit': :'unit'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
# File 'lib/oci/capacity_management/models/occ_availability_summary.rb', line 85

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'catalog_id': :'String',
    'namespace': :'String',
    'date_final_customer_order': :'DateTime',
    'date_expected_capacity_handover': :'DateTime',
    'resource_type': :'String',
    'workload_type': :'String',
    'resource_name': :'String',
    'available_quantity': :'Integer',
    'unit': :'String'
    # 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
# File 'lib/oci/capacity_management/models/occ_availability_summary.rb', line 215

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

  self.class == other.class &&
    catalog_id == other.catalog_id &&
    namespace == other.namespace &&
    date_final_customer_order == other.date_final_customer_order &&
    date_expected_capacity_handover == other.date_expected_capacity_handover &&
    resource_type == other.resource_type &&
    workload_type == other.workload_type &&
    resource_name == other.resource_name &&
    available_quantity == other.available_quantity &&
    unit == other.unit
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



253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
# File 'lib/oci/capacity_management/models/occ_availability_summary.rb', line 253

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


233
234
235
# File 'lib/oci/capacity_management/models/occ_availability_summary.rb', line 233

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



242
243
244
# File 'lib/oci/capacity_management/models/occ_availability_summary.rb', line 242

def hash
  [catalog_id, namespace, date_final_customer_order, date_expected_capacity_handover, resource_type, workload_type, resource_name, available_quantity, unit].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



286
287
288
289
290
291
292
293
294
295
# File 'lib/oci/capacity_management/models/occ_availability_summary.rb', line 286

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



280
281
282
# File 'lib/oci/capacity_management/models/occ_availability_summary.rb', line 280

def to_s
  to_hash.to_s
end