Class: OCI::Cims::Models::Resource
- Inherits:
-
Object
- Object
- OCI::Cims::Models::Resource
- Defined in:
- lib/oci/cims/models/resource.rb
Overview
Details of Ticket Item
Constant Summary collapse
- REGION_ENUM =
[ REGION_DEV = 'DEV'.freeze, REGION_SEA = 'SEA'.freeze, REGION_INTEG_NEXT = 'INTEG_NEXT'.freeze, REGION_INTEG_STABLE = 'INTEG_STABLE'.freeze, REGION_PHX = 'PHX'.freeze, REGION_IAD = 'IAD'.freeze, REGION_FRA = 'FRA'.freeze, REGION_EU_FRANKFURT_1 = 'EU_FRANKFURT_1'.freeze, REGION_LHR = 'LHR'.freeze, REGION_YYZ = 'YYZ'.freeze, REGION_NRT = 'NRT'.freeze, REGION_US_LANGLEY_1 = 'US_LANGLEY_1'.freeze, REGION_US_LUKE_1 = 'US_LUKE_1'.freeze, REGION_ICN = 'ICN'.freeze, REGION_BOM = 'BOM'.freeze, REGION_GRU = 'GRU'.freeze, REGION_US_GOV_ASHBURN_1 = 'US_GOV_ASHBURN_1'.freeze, REGION_US_GOV_PHOENIX_1 = 'US_GOV_PHOENIX_1'.freeze, REGION_US_GOV_CHICAGO_1 = 'US_GOV_CHICAGO_1'.freeze, REGION_SYD = 'SYD'.freeze, REGION_ZRH = 'ZRH'.freeze, REGION_JED = 'JED'.freeze, REGION_AMS = 'AMS'.freeze, REGION_KIX = 'KIX'.freeze, REGION_MEL = 'MEL'.freeze, REGION_YUL = 'YUL'.freeze, REGION_HYD = 'HYD'.freeze, REGION_YNY = 'YNY'.freeze, REGION_TIW = 'TIW'.freeze, REGION_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze ].freeze
- AVAILABILITY_DOMAIN_ENUM =
[ AVAILABILITY_DOMAIN_DEV_1 = 'DEV_1'.freeze, AVAILABILITY_DOMAIN_DEV_2 = 'DEV_2'.freeze, AVAILABILITY_DOMAIN_DEV_3 = 'DEV_3'.freeze, AVAILABILITY_DOMAIN_INTEG_NEXT_1 = 'INTEG_NEXT_1'.freeze, AVAILABILITY_DOMAIN_INTEG_STABLE_1 = 'INTEG_STABLE_1'.freeze, AVAILABILITY_DOMAIN_SEA_AD_1 = 'SEA_AD_1'.freeze, AVAILABILITY_DOMAIN_SEA_AD_2 = 'SEA_AD_2'.freeze, AVAILABILITY_DOMAIN_SEA_AD_3 = 'SEA_AD_3'.freeze, AVAILABILITY_DOMAIN_PHX_AD_1 = 'PHX_AD_1'.freeze, AVAILABILITY_DOMAIN_PHX_AD_2 = 'PHX_AD_2'.freeze, AVAILABILITY_DOMAIN_PHX_AD_3 = 'PHX_AD_3'.freeze, AVAILABILITY_DOMAIN_US_ASHBURN_AD_1 = 'US_ASHBURN_AD_1'.freeze, AVAILABILITY_DOMAIN_US_ASHBURN_AD_2 = 'US_ASHBURN_AD_2'.freeze, AVAILABILITY_DOMAIN_US_ASHBURN_AD_3 = 'US_ASHBURN_AD_3'.freeze, AVAILABILITY_DOMAIN_US_ASHBURN_AD_4 = 'US_ASHBURN_AD_4'.freeze, AVAILABILITY_DOMAIN_EU_FRANKFURT_1_AD_1 = 'EU_FRANKFURT_1_AD_1'.freeze, AVAILABILITY_DOMAIN_EU_FRANKFURT_1_AD_2 = 'EU_FRANKFURT_1_AD_2'.freeze, AVAILABILITY_DOMAIN_EU_FRANKFURT_1_AD_3 = 'EU_FRANKFURT_1_AD_3'.freeze, AVAILABILITY_DOMAIN_UK_LONDON_1_AD_1 = 'UK_LONDON_1_AD_1'.freeze, AVAILABILITY_DOMAIN_UK_LONDON_1_AD_2 = 'UK_LONDON_1_AD_2'.freeze, AVAILABILITY_DOMAIN_UK_LONDON_1_AD_3 = 'UK_LONDON_1_AD_3'.freeze, AVAILABILITY_DOMAIN_CA_TORONTO_1_AD_1 = 'CA_TORONTO_1_AD_1'.freeze, AVAILABILITY_DOMAIN_AP_TOKYO_1_AD_1 = 'AP_TOKYO_1_AD_1'.freeze, AVAILABILITY_DOMAIN_AP_SEOUL_1_AD_1 = 'AP_SEOUL_1_AD_1'.freeze, AVAILABILITY_DOMAIN_AP_MUMBAI_1_AD_1 = 'AP_MUMBAI_1_AD_1'.freeze, AVAILABILITY_DOMAIN_SA_SAOPAULO_1_AD_1 = 'SA_SAOPAULO_1_AD_1'.freeze, AVAILABILITY_DOMAIN_US_LUKE_1_AD_1 = 'US_LUKE_1_AD_1'.freeze, AVAILABILITY_DOMAIN_US_LANGLEY_1_AD_1 = 'US_LANGLEY_1_AD_1'.freeze, AVAILABILITY_DOMAIN_ME_JEDDAH_1_AD_1 = 'ME_JEDDAH_1_AD_1'.freeze, AVAILABILITY_DOMAIN_AP_OSAKA_1_AD_1 = 'AP_OSAKA_1_AD_1'.freeze, AVAILABILITY_DOMAIN_AP_SYDNEY_1_AD_1 = 'AP_SYDNEY_1_AD_1'.freeze, AVAILABILITY_DOMAIN_EU_ZURICH_1_AD_1 = 'EU_ZURICH_1_AD_1'.freeze, AVAILABILITY_DOMAIN_EU_AMSTERDAM_1_AD_1 = 'EU_AMSTERDAM_1_AD_1'.freeze, AVAILABILITY_DOMAIN_AP_MELBOURNE_1_AD_1 = 'AP_MELBOURNE_1_AD_1'.freeze, AVAILABILITY_DOMAIN_CA_MONTREAL_1_AD_1 = 'CA_MONTREAL_1_AD_1'.freeze, AVAILABILITY_DOMAIN_AP_HYDERABAD_1_AD_1 = 'AP_HYDERABAD_1_AD_1'.freeze, AVAILABILITY_DOMAIN_AP_CHUNCHEON_1_AD_1 = 'AP_CHUNCHEON_1_AD_1'.freeze, AVAILABILITY_DOMAIN_US_TACOMA_1_AD_1 = 'US_TACOMA_1_AD_1'.freeze, AVAILABILITY_DOMAIN_NO_AD = 'NO_AD'.freeze, AVAILABILITY_DOMAIN_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze ].freeze
Instance Attribute Summary collapse
-
#availability_domain ⇒ String
List of OCI ADs.
- #item ⇒ OCI::Cims::Models::Item
-
#region ⇒ String
List of OCI regions.
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 = {}) ⇒ Resource
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 = {}) ⇒ Resource
Initializes the object
129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 |
# File 'lib/oci/cims/models/resource.rb', line 129 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.item = attributes[:'item'] if attributes[:'item'] self.region = attributes[:'region'] if attributes[:'region'] 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'] end |
Instance Attribute Details
#availability_domain ⇒ String
List of OCI ADs
96 97 98 |
# File 'lib/oci/cims/models/resource.rb', line 96 def availability_domain @availability_domain end |
#item ⇒ OCI::Cims::Models::Item
88 89 90 |
# File 'lib/oci/cims/models/resource.rb', line 88 def item @item end |
#region ⇒ String
List of OCI regions
92 93 94 |
# File 'lib/oci/cims/models/resource.rb', line 92 def region @region end |
Class Method Details
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
99 100 101 102 103 104 105 106 107 |
# File 'lib/oci/cims/models/resource.rb', line 99 def self.attribute_map { # rubocop:disable Style/SymbolLiteral 'item': :'item', 'region': :'region', 'availability_domain': :'availabilityDomain' # rubocop:enable Style/SymbolLiteral } end |
.swagger_types ⇒ Object
Attribute type mapping.
110 111 112 113 114 115 116 117 118 |
# File 'lib/oci/cims/models/resource.rb', line 110 def self.swagger_types { # rubocop:disable Style/SymbolLiteral 'item': :'OCI::Cims::Models::Item', 'region': :'String', 'availability_domain': :'String' # rubocop:enable Style/SymbolLiteral } end |
Instance Method Details
#==(other) ⇒ Object
Checks equality by comparing each attribute.
179 180 181 182 183 184 185 186 |
# File 'lib/oci/cims/models/resource.rb', line 179 def ==(other) return true if equal?(other) self.class == other.class && item == other.item && region == other.region && availability_domain == other.availability_domain end |
#build_from_hash(attributes) ⇒ Object
Builds the object from hash
211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 |
# File 'lib/oci/cims/models/resource.rb', line 211 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
191 192 193 |
# File 'lib/oci/cims/models/resource.rb', line 191 def eql?(other) self == other end |
#hash ⇒ Fixnum
Calculates hash code according to all attributes.
200 201 202 |
# File 'lib/oci/cims/models/resource.rb', line 200 def hash [item, region, availability_domain].hash end |
#to_hash ⇒ Hash
Returns the object in the form of hash
244 245 246 247 248 249 250 251 252 253 |
# File 'lib/oci/cims/models/resource.rb', line 244 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
238 239 240 |
# File 'lib/oci/cims/models/resource.rb', line 238 def to_s to_hash.to_s end |