Class: OCI::Dblm::Models::ResourceInfo
- Inherits:
-
Object
- Object
- OCI::Dblm::Models::ResourceInfo
- Defined in:
- lib/oci/dblm/models/resource_info.rb
Overview
The Resource Info.
Instance Attribute Summary collapse
-
#agent_id ⇒ String
The agent Id of the agent managing the resource.
-
#connector_id ⇒ String
[Required] The connector Id of the resource.
-
#db_platform_type ⇒ String
[Required] The platform type of the resource.
-
#db_version ⇒ String
[Required] The version of the resource.
-
#deployment_type ⇒ String
[Required] The deployment type of the resource.
-
#host_info ⇒ Array<OCI::Dblm::Models::HostInfo>
[Required] host info objects.
-
#is_cluster_db ⇒ BOOLEAN
True if it is a cluster db.
-
#license_type ⇒ String
[Required] The License Type of the resource.
-
#resource_compartment_id ⇒ String
[Required] The compartmentId of the resource.
-
#resource_id ⇒ String
[Required] The Id of the resource.
-
#resource_name ⇒ String
[Required] The name of the resource.
-
#resource_type ⇒ String
[Required] The type of the resource.
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 = {}) ⇒ ResourceInfo
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 = {}) ⇒ ResourceInfo
Initializes the object
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 183 184 185 186 187 188 189 190 191 192 193 194 |
# File 'lib/oci/dblm/models/resource_info.rb', line 117 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_compartment_id = attributes[:'resourceCompartmentId'] if attributes[:'resourceCompartmentId'] raise 'You cannot provide both :resourceCompartmentId and :resource_compartment_id' if attributes.key?(:'resourceCompartmentId') && attributes.key?(:'resource_compartment_id') self.resource_compartment_id = attributes[:'resource_compartment_id'] if attributes[:'resource_compartment_id'] 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.resource_id = attributes[:'resourceId'] if attributes[:'resourceId'] raise 'You cannot provide both :resourceId and :resource_id' if attributes.key?(:'resourceId') && attributes.key?(:'resource_id') self.resource_id = attributes[:'resource_id'] if attributes[:'resource_id'] 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.deployment_type = attributes[:'deploymentType'] if attributes[:'deploymentType'] raise 'You cannot provide both :deploymentType and :deployment_type' if attributes.key?(:'deploymentType') && attributes.key?(:'deployment_type') self.deployment_type = attributes[:'deployment_type'] if attributes[:'deployment_type'] self.connector_id = attributes[:'connectorId'] if attributes[:'connectorId'] raise 'You cannot provide both :connectorId and :connector_id' if attributes.key?(:'connectorId') && attributes.key?(:'connector_id') self.connector_id = attributes[:'connector_id'] if attributes[:'connector_id'] self.is_cluster_db = attributes[:'isClusterDb'] unless attributes[:'isClusterDb'].nil? raise 'You cannot provide both :isClusterDb and :is_cluster_db' if attributes.key?(:'isClusterDb') && attributes.key?(:'is_cluster_db') self.is_cluster_db = attributes[:'is_cluster_db'] unless attributes[:'is_cluster_db'].nil? self.host_info = attributes[:'hostInfo'] if attributes[:'hostInfo'] raise 'You cannot provide both :hostInfo and :host_info' if attributes.key?(:'hostInfo') && attributes.key?(:'host_info') self.host_info = attributes[:'host_info'] if attributes[:'host_info'] self.db_version = attributes[:'dbVersion'] if attributes[:'dbVersion'] raise 'You cannot provide both :dbVersion and :db_version' if attributes.key?(:'dbVersion') && attributes.key?(:'db_version') self.db_version = attributes[:'db_version'] if attributes[:'db_version'] self.db_platform_type = attributes[:'dbPlatformType'] if attributes[:'dbPlatformType'] raise 'You cannot provide both :dbPlatformType and :db_platform_type' if attributes.key?(:'dbPlatformType') && attributes.key?(:'db_platform_type') self.db_platform_type = attributes[:'db_platform_type'] if attributes[:'db_platform_type'] self.license_type = attributes[:'licenseType'] if attributes[:'licenseType'] raise 'You cannot provide both :licenseType and :license_type' if attributes.key?(:'licenseType') && attributes.key?(:'license_type') self.license_type = attributes[:'license_type'] if attributes[:'license_type'] self.agent_id = attributes[:'agentId'] if attributes[:'agentId'] raise 'You cannot provide both :agentId and :agent_id' if attributes.key?(:'agentId') && attributes.key?(:'agent_id') self.agent_id = attributes[:'agent_id'] if attributes[:'agent_id'] end |
Instance Attribute Details
#agent_id ⇒ String
The agent Id of the agent managing the resource.
57 58 59 |
# File 'lib/oci/dblm/models/resource_info.rb', line 57 def agent_id @agent_id end |
#connector_id ⇒ String
[Required] The connector Id of the resource.
33 34 35 |
# File 'lib/oci/dblm/models/resource_info.rb', line 33 def connector_id @connector_id end |
#db_platform_type ⇒ String
[Required] The platform type of the resource.
49 50 51 |
# File 'lib/oci/dblm/models/resource_info.rb', line 49 def db_platform_type @db_platform_type end |
#db_version ⇒ String
[Required] The version of the resource.
45 46 47 |
# File 'lib/oci/dblm/models/resource_info.rb', line 45 def db_version @db_version end |
#deployment_type ⇒ String
[Required] The deployment type of the resource.
29 30 31 |
# File 'lib/oci/dblm/models/resource_info.rb', line 29 def deployment_type @deployment_type end |
#host_info ⇒ Array<OCI::Dblm::Models::HostInfo>
[Required] host info objects
41 42 43 |
# File 'lib/oci/dblm/models/resource_info.rb', line 41 def host_info @host_info end |
#is_cluster_db ⇒ BOOLEAN
True if it is a cluster db.
37 38 39 |
# File 'lib/oci/dblm/models/resource_info.rb', line 37 def is_cluster_db @is_cluster_db end |
#license_type ⇒ String
[Required] The License Type of the resource.
53 54 55 |
# File 'lib/oci/dblm/models/resource_info.rb', line 53 def license_type @license_type end |
#resource_compartment_id ⇒ String
[Required] The compartmentId of the resource.
13 14 15 |
# File 'lib/oci/dblm/models/resource_info.rb', line 13 def resource_compartment_id @resource_compartment_id end |
#resource_id ⇒ String
[Required] The Id of the resource.
21 22 23 |
# File 'lib/oci/dblm/models/resource_info.rb', line 21 def resource_id @resource_id end |
#resource_name ⇒ String
[Required] The name of the resource.
17 18 19 |
# File 'lib/oci/dblm/models/resource_info.rb', line 17 def resource_name @resource_name end |
#resource_type ⇒ String
[Required] The type of the resource.
25 26 27 |
# File 'lib/oci/dblm/models/resource_info.rb', line 25 def resource_type @resource_type end |
Class Method Details
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 |
# File 'lib/oci/dblm/models/resource_info.rb', line 60 def self.attribute_map { # rubocop:disable Style/SymbolLiteral 'resource_compartment_id': :'resourceCompartmentId', 'resource_name': :'resourceName', 'resource_id': :'resourceId', 'resource_type': :'resourceType', 'deployment_type': :'deploymentType', 'connector_id': :'connectorId', 'is_cluster_db': :'isClusterDb', 'host_info': :'hostInfo', 'db_version': :'dbVersion', 'db_platform_type': :'dbPlatformType', 'license_type': :'licenseType', 'agent_id': :'agentId' # rubocop:enable Style/SymbolLiteral } end |
.swagger_types ⇒ Object
Attribute type mapping.
80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 |
# File 'lib/oci/dblm/models/resource_info.rb', line 80 def self.swagger_types { # rubocop:disable Style/SymbolLiteral 'resource_compartment_id': :'String', 'resource_name': :'String', 'resource_id': :'String', 'resource_type': :'String', 'deployment_type': :'String', 'connector_id': :'String', 'is_cluster_db': :'BOOLEAN', 'host_info': :'Array<OCI::Dblm::Models::HostInfo>', 'db_version': :'String', 'db_platform_type': :'String', 'license_type': :'String', 'agent_id': :'String' # rubocop:enable Style/SymbolLiteral } end |
Instance Method Details
#==(other) ⇒ Object
Checks equality by comparing each attribute.
203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 |
# File 'lib/oci/dblm/models/resource_info.rb', line 203 def ==(other) return true if equal?(other) self.class == other.class && resource_compartment_id == other.resource_compartment_id && resource_name == other.resource_name && resource_id == other.resource_id && resource_type == other.resource_type && deployment_type == other.deployment_type && connector_id == other.connector_id && is_cluster_db == other.is_cluster_db && host_info == other.host_info && db_version == other.db_version && db_platform_type == other.db_platform_type && license_type == other.license_type && agent_id == other.agent_id end |
#build_from_hash(attributes) ⇒ Object
Builds the object from hash
244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 |
# File 'lib/oci/dblm/models/resource_info.rb', line 244 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
224 225 226 |
# File 'lib/oci/dblm/models/resource_info.rb', line 224 def eql?(other) self == other end |
#hash ⇒ Fixnum
Calculates hash code according to all attributes.
233 234 235 |
# File 'lib/oci/dblm/models/resource_info.rb', line 233 def hash [resource_compartment_id, resource_name, resource_id, resource_type, deployment_type, connector_id, is_cluster_db, host_info, db_version, db_platform_type, license_type, agent_id].hash end |
#to_hash ⇒ Hash
Returns the object in the form of hash
277 278 279 280 281 282 283 284 285 286 |
# File 'lib/oci/dblm/models/resource_info.rb', line 277 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
271 272 273 |
# File 'lib/oci/dblm/models/resource_info.rb', line 271 def to_s to_hash.to_s end |