Class: OCI::CapacityManagement::Models::OccCapacityRequestBaseDetails
- Inherits:
-
Object
- Object
- OCI::CapacityManagement::Models::OccCapacityRequestBaseDetails
- Defined in:
- lib/oci/capacity_management/models/occ_capacity_request_base_details.rb
Overview
The details of the create capacity request. This model serves as a base for different namespaces.
Instance Attribute Summary collapse
-
#actual_handover_quantity ⇒ Integer
The actual handed over quantity of resources at the time of request resolution.
-
#associated_occ_handover_resource_block_list ⇒ Array<OCI::CapacityManagement::Models::AssociatedOccHandoverResourceBlock>
A list containing details about occHandoverResourceBlocks which were handed over for the corresponding resource name.
-
#availability_domain ⇒ String
The availability domain of the resource which is to be transferred.
-
#date_actual_handover ⇒ DateTime
The date on which the actual handover quantity of resources is delivered.
-
#date_expected_handover ⇒ DateTime
The date on which the latest increment to supplied quantity of resources was delivered.
-
#demand_quantity ⇒ Integer
[Required] The number of compute server's with name <resourceName> required by the user.
-
#expected_handover_quantity ⇒ Integer
The incremental quantity of resources supplied as the provisioning is underway.
-
#resource_name ⇒ String
[Required] The name of the COMPUTE server shape for which the request is made.
-
#resource_type ⇒ String
[Required] The type of the resource against which the user wants to place a capacity request.
-
#source_workload_type ⇒ String
The WorkloadType from where capacity request are to be transferred.
-
#workload_type ⇒ String
[Required] The type of the 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 = {}) ⇒ OccCapacityRequestBaseDetails
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 = {}) ⇒ OccCapacityRequestBaseDetails
Initializes the object
111 112 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 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 |
# File 'lib/oci/capacity_management/models/occ_capacity_request_base_details.rb', line 111 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.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.source_workload_type = attributes[:'sourceWorkloadType'] if attributes[:'sourceWorkloadType'] raise 'You cannot provide both :sourceWorkloadType and :source_workload_type' if attributes.key?(:'sourceWorkloadType') && attributes.key?(:'source_workload_type') self.source_workload_type = attributes[:'source_workload_type'] if attributes[:'source_workload_type'] self.expected_handover_quantity = attributes[:'expectedHandoverQuantity'] if attributes[:'expectedHandoverQuantity'] raise 'You cannot provide both :expectedHandoverQuantity and :expected_handover_quantity' if attributes.key?(:'expectedHandoverQuantity') && attributes.key?(:'expected_handover_quantity') self.expected_handover_quantity = attributes[:'expected_handover_quantity'] if attributes[:'expected_handover_quantity'] self.date_expected_handover = attributes[:'dateExpectedHandover'] if attributes[:'dateExpectedHandover'] raise 'You cannot provide both :dateExpectedHandover and :date_expected_handover' if attributes.key?(:'dateExpectedHandover') && attributes.key?(:'date_expected_handover') self.date_expected_handover = attributes[:'date_expected_handover'] if attributes[:'date_expected_handover'] self.actual_handover_quantity = attributes[:'actualHandoverQuantity'] if attributes[:'actualHandoverQuantity'] raise 'You cannot provide both :actualHandoverQuantity and :actual_handover_quantity' if attributes.key?(:'actualHandoverQuantity') && attributes.key?(:'actual_handover_quantity') self.actual_handover_quantity = attributes[:'actual_handover_quantity'] if attributes[:'actual_handover_quantity'] self.date_actual_handover = attributes[:'dateActualHandover'] if attributes[:'dateActualHandover'] raise 'You cannot provide both :dateActualHandover and :date_actual_handover' if attributes.key?(:'dateActualHandover') && attributes.key?(:'date_actual_handover') self.date_actual_handover = attributes[:'date_actual_handover'] if attributes[:'date_actual_handover'] self.availability_domain = attributes[:'availabilityDomain'] if attributes[:'availabilityDomain'] raise 'You cannot provide both :availabilityDomain and :availability_domain' if attributes.key?(:'availabilityDomain') && attributes.key?(:'availability_domain') self.availability_domain = attributes[:'availability_domain'] if attributes[:'availability_domain'] self.associated_occ_handover_resource_block_list = attributes[:'associatedOccHandoverResourceBlockList'] if attributes[:'associatedOccHandoverResourceBlockList'] raise 'You cannot provide both :associatedOccHandoverResourceBlockList and :associated_occ_handover_resource_block_list' if attributes.key?(:'associatedOccHandoverResourceBlockList') && attributes.key?(:'associated_occ_handover_resource_block_list') self.associated_occ_handover_resource_block_list = attributes[:'associated_occ_handover_resource_block_list'] if attributes[:'associated_occ_handover_resource_block_list'] 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.demand_quantity = attributes[:'demandQuantity'] if attributes[:'demandQuantity'] raise 'You cannot provide both :demandQuantity and :demand_quantity' if attributes.key?(:'demandQuantity') && attributes.key?(:'demand_quantity') self.demand_quantity = attributes[:'demand_quantity'] if attributes[:'demand_quantity'] end |
Instance Attribute Details
#actual_handover_quantity ⇒ Integer
The actual handed over quantity of resources at the time of request resolution.
33 34 35 |
# File 'lib/oci/capacity_management/models/occ_capacity_request_base_details.rb', line 33 def actual_handover_quantity @actual_handover_quantity end |
#associated_occ_handover_resource_block_list ⇒ Array<OCI::CapacityManagement::Models::AssociatedOccHandoverResourceBlock>
A list containing details about occHandoverResourceBlocks which were handed over for the corresponding resource name.
46 47 48 |
# File 'lib/oci/capacity_management/models/occ_capacity_request_base_details.rb', line 46 def associated_occ_handover_resource_block_list @associated_occ_handover_resource_block_list end |
#availability_domain ⇒ String
The availability domain of the resource which is to be transferred. Note that this is only required for Capacity Request Transfer requests.
41 42 43 |
# File 'lib/oci/capacity_management/models/occ_capacity_request_base_details.rb', line 41 def availability_domain @availability_domain end |
#date_actual_handover ⇒ DateTime
The date on which the actual handover quantity of resources is delivered.
37 38 39 |
# File 'lib/oci/capacity_management/models/occ_capacity_request_base_details.rb', line 37 def date_actual_handover @date_actual_handover end |
#date_expected_handover ⇒ DateTime
The date on which the latest increment to supplied quantity of resources was delivered.
29 30 31 |
# File 'lib/oci/capacity_management/models/occ_capacity_request_base_details.rb', line 29 def date_expected_handover @date_expected_handover end |
#demand_quantity ⇒ Integer
[Required] The number of compute server's with name <resourceName> required by the user.
54 55 56 |
# File 'lib/oci/capacity_management/models/occ_capacity_request_base_details.rb', line 54 def demand_quantity @demand_quantity end |
#expected_handover_quantity ⇒ Integer
The incremental quantity of resources supplied as the provisioning is underway.
25 26 27 |
# File 'lib/oci/capacity_management/models/occ_capacity_request_base_details.rb', line 25 def expected_handover_quantity @expected_handover_quantity end |
#resource_name ⇒ String
[Required] The name of the COMPUTE server shape for which the request is made. Do not use CAPACITY_CONSTRAINT as the resource name.
50 51 52 |
# File 'lib/oci/capacity_management/models/occ_capacity_request_base_details.rb', line 50 def resource_name @resource_name end |
#resource_type ⇒ String
[Required] The type of the resource against which the user wants to place a capacity request.
13 14 15 |
# File 'lib/oci/capacity_management/models/occ_capacity_request_base_details.rb', line 13 def resource_type @resource_type end |
#source_workload_type ⇒ String
The WorkloadType from where capacity request are to be transferred.
21 22 23 |
# File 'lib/oci/capacity_management/models/occ_capacity_request_base_details.rb', line 21 def source_workload_type @source_workload_type end |
#workload_type ⇒ String
[Required] The type of the workload (Generic/ROW).
17 18 19 |
# File 'lib/oci/capacity_management/models/occ_capacity_request_base_details.rb', line 17 def workload_type @workload_type end |
Class Method Details
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 |
# File 'lib/oci/capacity_management/models/occ_capacity_request_base_details.rb', line 57 def self.attribute_map { # rubocop:disable Style/SymbolLiteral 'resource_type': :'resourceType', 'workload_type': :'workloadType', 'source_workload_type': :'sourceWorkloadType', 'expected_handover_quantity': :'expectedHandoverQuantity', 'date_expected_handover': :'dateExpectedHandover', 'actual_handover_quantity': :'actualHandoverQuantity', 'date_actual_handover': :'dateActualHandover', 'availability_domain': :'availabilityDomain', 'associated_occ_handover_resource_block_list': :'associatedOccHandoverResourceBlockList', 'resource_name': :'resourceName', 'demand_quantity': :'demandQuantity' # rubocop:enable Style/SymbolLiteral } end |
.swagger_types ⇒ Object
Attribute type mapping.
76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 |
# File 'lib/oci/capacity_management/models/occ_capacity_request_base_details.rb', line 76 def self.swagger_types { # rubocop:disable Style/SymbolLiteral 'resource_type': :'String', 'workload_type': :'String', 'source_workload_type': :'String', 'expected_handover_quantity': :'Integer', 'date_expected_handover': :'DateTime', 'actual_handover_quantity': :'Integer', 'date_actual_handover': :'DateTime', 'availability_domain': :'String', 'associated_occ_handover_resource_block_list': :'Array<OCI::CapacityManagement::Models::AssociatedOccHandoverResourceBlock>', 'resource_name': :'String', 'demand_quantity': :'Integer' # rubocop:enable Style/SymbolLiteral } end |
Instance Method Details
#==(other) ⇒ Object
Checks equality by comparing each attribute.
191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 |
# File 'lib/oci/capacity_management/models/occ_capacity_request_base_details.rb', line 191 def ==(other) return true if equal?(other) self.class == other.class && resource_type == other.resource_type && workload_type == other.workload_type && source_workload_type == other.source_workload_type && expected_handover_quantity == other.expected_handover_quantity && date_expected_handover == other.date_expected_handover && actual_handover_quantity == other.actual_handover_quantity && date_actual_handover == other.date_actual_handover && availability_domain == other.availability_domain && associated_occ_handover_resource_block_list == other.associated_occ_handover_resource_block_list && resource_name == other.resource_name && demand_quantity == other.demand_quantity end |
#build_from_hash(attributes) ⇒ Object
Builds the object from hash
231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 |
# File 'lib/oci/capacity_management/models/occ_capacity_request_base_details.rb', line 231 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
211 212 213 |
# File 'lib/oci/capacity_management/models/occ_capacity_request_base_details.rb', line 211 def eql?(other) self == other end |
#hash ⇒ Fixnum
Calculates hash code according to all attributes.
220 221 222 |
# File 'lib/oci/capacity_management/models/occ_capacity_request_base_details.rb', line 220 def hash [resource_type, workload_type, source_workload_type, expected_handover_quantity, date_expected_handover, actual_handover_quantity, date_actual_handover, availability_domain, associated_occ_handover_resource_block_list, resource_name, demand_quantity].hash end |
#to_hash ⇒ Hash
Returns the object in the form of hash
264 265 266 267 268 269 270 271 272 273 |
# File 'lib/oci/capacity_management/models/occ_capacity_request_base_details.rb', line 264 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
258 259 260 |
# File 'lib/oci/capacity_management/models/occ_capacity_request_base_details.rb', line 258 def to_s to_hash.to_s end |