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

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

  • :total_available_quantity (Integer)

    The value to assign to the #total_available_quantity property

  • :demanded_quantity (Integer)

    The value to assign to the #demanded_quantity property

  • :unit (String)

    The value to assign to the #unit property

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

    The value to assign to the #system_tags property



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

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

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

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

  self.demanded_quantity = attributes[:'demandedQuantity'] if attributes[:'demandedQuantity']

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

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

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

  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

#available_quantityInteger

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

Returns:

  • (Integer)


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

def available_quantity
  @available_quantity
end

#catalog_idString

[Required] The OCID of the availability catalog.

Returns:

  • (String)


19
20
21
# File 'lib/oci/capacity_management/models/occ_availability_summary.rb', line 19

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)


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

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)


28
29
30
# File 'lib/oci/capacity_management/models/occ_availability_summary.rb', line 28

def date_final_customer_order
  @date_final_customer_order
end

#demanded_quantityInteger

[Required] The quantity of resource currently demanded by the customer.

Returns:

  • (Integer)


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

def demanded_quantity
  @demanded_quantity
end

#namespaceString

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

Returns:

  • (String)


24
25
26
# File 'lib/oci/capacity_management/models/occ_availability_summary.rb', line 24

def namespace
  @namespace
end

#resource_nameString

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

Returns:

  • (String)


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

def resource_name
  @resource_name
end

#resource_typeString

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

Returns:

  • (String)


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

def resource_type
  @resource_type
end

#system_tagsHash<String, Hash<String, Object>>

System tags for this resource. Each key is predefined and scoped to a namespace. Example: {\"orcl-cloud\": {\"free-tier-retained\": \"true\"}}

Returns:

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


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

def system_tags
  @system_tags
end

#total_available_quantityInteger

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

Returns:

  • (Integer)


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

def total_available_quantity
  @total_available_quantity
end

#unitString

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

Returns:

  • (String)


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

def unit
  @unit
end

#workload_typeString

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

Returns:

  • (String)


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

def workload_type
  @workload_type
end

Class Method Details

.attribute_mapObject

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



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

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',
    'total_available_quantity': :'totalAvailableQuantity',
    'demanded_quantity': :'demandedQuantity',
    'unit': :'unit',
    'system_tags': :'systemTags'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
# File 'lib/oci/capacity_management/models/occ_availability_summary.rb', line 89

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',
    'total_available_quantity': :'Integer',
    'demanded_quantity': :'Integer',
    'unit': :'String',
    '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



217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
# File 'lib/oci/capacity_management/models/occ_availability_summary.rb', line 217

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 &&
    total_available_quantity == other.total_available_quantity &&
    demanded_quantity == other.demanded_quantity &&
    unit == other.unit &&
    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



258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
# File 'lib/oci/capacity_management/models/occ_availability_summary.rb', line 258

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


238
239
240
# File 'lib/oci/capacity_management/models/occ_availability_summary.rb', line 238

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



247
248
249
# File 'lib/oci/capacity_management/models/occ_availability_summary.rb', line 247

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

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



291
292
293
294
295
296
297
298
299
300
# File 'lib/oci/capacity_management/models/occ_availability_summary.rb', line 291

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



285
286
287
# File 'lib/oci/capacity_management/models/occ_availability_summary.rb', line 285

def to_s
  to_hash.to_s
end