Class: OCI::CapacityManagement::Models::OccAvailabilitySummary
- Inherits:
-
Object
- Object
- OCI::CapacityManagement::Models::OccAvailabilitySummary
- 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
-
#available_quantity ⇒ Integer
[Required] The quantity of available resource that the customer can request.
-
#catalog_id ⇒ String
[Required] The OCID of the availability catalog.
-
#date_expected_capacity_handover ⇒ DateTime
[Required] The date by which the capacity requested by customers before dateFinalCustomerOrder needs to be fulfilled.
-
#date_final_customer_order ⇒ DateTime
[Required] The date by which the customer must place the order to have their capacity requirements met by the customer handover date.
-
#namespace ⇒ String
[Required] The name of the OCI service in consideration.
-
#resource_name ⇒ String
[Required] The name of the resource that the customer can request.
-
#resource_type ⇒ String
[Required] The different types of resources against which customers can place capacity requests.
-
#unit ⇒ String
[Required] The unit in which the resource available is measured.
-
#workload_type ⇒ String
[Required] The type of workload (Generic/ROW).
Class Method Summary collapse
-
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
-
.swagger_types ⇒ Object
Attribute type mapping.
Instance Method Summary collapse
-
#==(other) ⇒ Object
Checks equality by comparing each attribute.
-
#build_from_hash(attributes) ⇒ Object
Builds the object from hash.
- #eql?(other) ⇒ Boolean
-
#hash ⇒ Fixnum
Calculates hash code according to all attributes.
-
#initialize(attributes = {}) ⇒ OccAvailabilitySummary
constructor
Initializes the object.
-
#to_hash ⇒ Hash
Returns the object in the form of hash.
-
#to_s ⇒ String
Returns the string representation of the object.
Constructor Details
#initialize(attributes = {}) ⇒ OccAvailabilitySummary
Initializes the object
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_quantity ⇒ Integer
[Required] The quantity of available resource that the customer can request.
61 62 63 |
# File 'lib/oci/capacity_management/models/occ_availability_summary.rb', line 61 def available_quantity @available_quantity end |
#catalog_id ⇒ String
[Required] The OCID of the availability catalog.
32 33 34 |
# File 'lib/oci/capacity_management/models/occ_availability_summary.rb', line 32 def catalog_id @catalog_id end |
#date_expected_capacity_handover ⇒ DateTime
[Required] The date by which the capacity requested by customers before dateFinalCustomerOrder needs to be fulfilled.
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_order ⇒ DateTime
[Required] The date by which the customer must place the order to have their capacity requirements met by the customer handover date.
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 |
#namespace ⇒ String
[Required] The name of the OCI service in consideration. For example, Compute, Exadata, and so on.
37 38 39 |
# File 'lib/oci/capacity_management/models/occ_availability_summary.rb', line 37 def namespace @namespace end |
#resource_name ⇒ String
[Required] The name of the resource that the customer can request.
57 58 59 |
# File 'lib/oci/capacity_management/models/occ_availability_summary.rb', line 57 def resource_name @resource_name end |
#resource_type ⇒ String
[Required] The different types of resources against which customers can place capacity requests.
49 50 51 |
# File 'lib/oci/capacity_management/models/occ_availability_summary.rb', line 49 def resource_type @resource_type end |
#unit ⇒ String
[Required] The unit in which the resource available is measured.
65 66 67 |
# File 'lib/oci/capacity_management/models/occ_availability_summary.rb', line 65 def unit @unit end |
#workload_type ⇒ String
[Required] The type of workload (Generic/ROW).
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_map ⇒ Object
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_types ⇒ Object
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.
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
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
233 234 235 |
# File 'lib/oci/capacity_management/models/occ_availability_summary.rb', line 233 def eql?(other) self == other end |
#hash ⇒ Fixnum
Calculates hash code according to all attributes.
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_hash ⇒ 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_s ⇒ String
Returns the string representation 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 |