Class: OCI::CapacityManagement::Models::OccHandoverResourceBlockSummary
- Inherits:
-
Object
- Object
- OCI::CapacityManagement::Models::OccHandoverResourceBlockSummary
- 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
-
#associated_capacity_requests ⇒ Array<OCI::CapacityManagement::Models::AssociatedCapacityRequestDetails>
[Required] A list containing details about the capacity requests against which the resources were provisioned by oracle.
-
#compartment_id ⇒ String
[Required] The OCID of the compartment where the resource block's are placed.
-
#handover_date ⇒ DateTime
[Required] The date on which the resource was handed over to the customer.
-
#handover_resource_name ⇒ String
[Required] The name of the resource handed over by oracle.
-
#id ⇒ String
[Required] The OCID of the resource block.
-
#namespace ⇒ String
[Required] The name of the OCI service in consideration.
-
#occ_customer_group_id ⇒ String
[Required] The OCID of the customer group for which the resources were provisioned.
-
#placement_details ⇒ OCI::CapacityManagement::Models::PlacementDetails
This attribute is required.
-
#total_handover_quantity ⇒ Integer
[Required] The total quantity of the resource that was made available to the customer by Oracle.
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 = {}) ⇒ OccHandoverResourceBlockSummary
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 = {}) ⇒ OccHandoverResourceBlockSummary
Initializes the object
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_requests ⇒ Array<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_id ⇒ String
[Required] The OCID of the compartment where the resource block's are placed.
26 27 28 |
# File 'lib/oci/capacity_management/models/occ_handover_resource_block_summary.rb', line 26 def compartment_id @compartment_id end |
#handover_date ⇒ DateTime
[Required] The date on which the resource was handed over to the customer.
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_name ⇒ String
[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.
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 |
#id ⇒ String
[Required] The OCID of the resource block.
21 22 23 |
# File 'lib/oci/capacity_management/models/occ_handover_resource_block_summary.rb', line 21 def id @id end |
#namespace ⇒ String
[Required] The name of the OCI service in consideration. For example Compute, Exadata and so on.
32 33 34 |
# File 'lib/oci/capacity_management/models/occ_handover_resource_block_summary.rb', line 32 def namespace @namespace end |
#occ_customer_group_id ⇒ String
[Required] The OCID of the customer group for which the resources were provisioned.
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_details ⇒ OCI::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_quantity ⇒ Integer
[Required] The total quantity of the resource that was made available to the customer by Oracle.
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_map ⇒ Object
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_types ⇒ Object
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.
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
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
204 205 206 |
# File 'lib/oci/capacity_management/models/occ_handover_resource_block_summary.rb', line 204 def eql?(other) self == other end |
#hash ⇒ Fixnum
Calculates hash code according to all attributes.
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_hash ⇒ 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_s ⇒ String
Returns the string representation 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 |