Class: OCI::CloudBridge::Models::UpdateInventoryAssetDetails
- Inherits:
-
UpdateAssetDetails
- Object
- UpdateAssetDetails
- OCI::CloudBridge::Models::UpdateInventoryAssetDetails
- Defined in:
- lib/oci/cloud_bridge/models/update_inventory_asset_details.rb
Overview
The information of a JSON formatted asset to be updated.
Constant Summary collapse
- ENVIRONMENT_TYPE_ENUM =
[ ENVIRONMENT_TYPE_SOURCE = 'SOURCE'.freeze, ENVIRONMENT_TYPE_DESTINATION = 'DESTINATION'.freeze ].freeze
Constants inherited from UpdateAssetDetails
OCI::CloudBridge::Models::UpdateAssetDetails::ASSET_TYPE_ENUM
Instance Attribute Summary collapse
-
#asset_class_name ⇒ String
[Required] The class name of the asset.
-
#asset_class_version ⇒ String
[Required] The version of the asset class.
-
#asset_details ⇒ Hash<String, Object>
[Required] The details of the asset.
-
#environment_type ⇒ String
Specifies if this is the Source or Destination point for migration - different assets may be discovered depending on setting.
Attributes inherited from UpdateAssetDetails
#asset_source_ids, #asset_type, #defined_tags, #display_name, #freeform_tags
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 = {}) ⇒ UpdateInventoryAssetDetails
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.
Methods inherited from UpdateAssetDetails
Constructor Details
#initialize(attributes = {}) ⇒ UpdateInventoryAssetDetails
Initializes the object
81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 |
# File 'lib/oci/cloud_bridge/models/update_inventory_asset_details.rb', line 81 def initialize(attributes = {}) return unless attributes.is_a?(Hash) attributes['assetType'] = 'INVENTORY_ASSET' super(attributes) # convert string to symbol for hash key attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } self.asset_class_name = attributes[:'assetClassName'] if attributes[:'assetClassName'] raise 'You cannot provide both :assetClassName and :asset_class_name' if attributes.key?(:'assetClassName') && attributes.key?(:'asset_class_name') self.asset_class_name = attributes[:'asset_class_name'] if attributes[:'asset_class_name'] self.asset_class_version = attributes[:'assetClassVersion'] if attributes[:'assetClassVersion'] raise 'You cannot provide both :assetClassVersion and :asset_class_version' if attributes.key?(:'assetClassVersion') && attributes.key?(:'asset_class_version') self.asset_class_version = attributes[:'asset_class_version'] if attributes[:'asset_class_version'] self.asset_details = attributes[:'assetDetails'] if attributes[:'assetDetails'] raise 'You cannot provide both :assetDetails and :asset_details' if attributes.key?(:'assetDetails') && attributes.key?(:'asset_details') self.asset_details = attributes[:'asset_details'] if attributes[:'asset_details'] self.environment_type = attributes[:'environmentType'] if attributes[:'environmentType'] self.environment_type = "SOURCE" if environment_type.nil? && !attributes.key?(:'environmentType') # rubocop:disable Style/StringLiterals raise 'You cannot provide both :environmentType and :environment_type' if attributes.key?(:'environmentType') && attributes.key?(:'environment_type') self.environment_type = attributes[:'environment_type'] if attributes[:'environment_type'] self.environment_type = "SOURCE" if environment_type.nil? && !attributes.key?(:'environmentType') && !attributes.key?(:'environment_type') # rubocop:disable Style/StringLiterals end |
Instance Attribute Details
#asset_class_name ⇒ String
[Required] The class name of the asset.
19 20 21 |
# File 'lib/oci/cloud_bridge/models/update_inventory_asset_details.rb', line 19 def asset_class_name @asset_class_name end |
#asset_class_version ⇒ String
[Required] The version of the asset class.
23 24 25 |
# File 'lib/oci/cloud_bridge/models/update_inventory_asset_details.rb', line 23 def asset_class_version @asset_class_version end |
#asset_details ⇒ Hash<String, Object>
[Required] The details of the asset.
27 28 29 |
# File 'lib/oci/cloud_bridge/models/update_inventory_asset_details.rb', line 27 def asset_details @asset_details end |
#environment_type ⇒ String
Specifies if this is the Source or Destination point for migration - different assets may be discovered depending on setting.
31 32 33 |
# File 'lib/oci/cloud_bridge/models/update_inventory_asset_details.rb', line 31 def environment_type @environment_type end |
Class Method Details
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 |
# File 'lib/oci/cloud_bridge/models/update_inventory_asset_details.rb', line 34 def self.attribute_map { # rubocop:disable Style/SymbolLiteral 'display_name': :'displayName', 'asset_type': :'assetType', 'asset_source_ids': :'assetSourceIds', 'freeform_tags': :'freeformTags', 'defined_tags': :'definedTags', 'asset_class_name': :'assetClassName', 'asset_class_version': :'assetClassVersion', 'asset_details': :'assetDetails', 'environment_type': :'environmentType' # rubocop:enable Style/SymbolLiteral } end |
.swagger_types ⇒ Object
Attribute type mapping.
51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 |
# File 'lib/oci/cloud_bridge/models/update_inventory_asset_details.rb', line 51 def self.swagger_types { # rubocop:disable Style/SymbolLiteral 'display_name': :'String', 'asset_type': :'String', 'asset_source_ids': :'Array<String>', 'freeform_tags': :'Hash<String, String>', 'defined_tags': :'Hash<String, Hash<String, Object>>', 'asset_class_name': :'String', 'asset_class_version': :'String', 'asset_details': :'Hash<String, Object>', 'environment_type': :'String' # rubocop:enable Style/SymbolLiteral } end |
Instance Method Details
#==(other) ⇒ Object
Checks equality by comparing each attribute.
133 134 135 136 137 138 139 140 141 142 143 144 145 146 |
# File 'lib/oci/cloud_bridge/models/update_inventory_asset_details.rb', line 133 def ==(other) return true if equal?(other) self.class == other.class && display_name == other.display_name && asset_type == other.asset_type && asset_source_ids == other.asset_source_ids && == other. && == other. && asset_class_name == other.asset_class_name && asset_class_version == other.asset_class_version && asset_details == other.asset_details && environment_type == other.environment_type end |
#build_from_hash(attributes) ⇒ Object
Builds the object from hash
171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 |
# File 'lib/oci/cloud_bridge/models/update_inventory_asset_details.rb', line 171 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
151 152 153 |
# File 'lib/oci/cloud_bridge/models/update_inventory_asset_details.rb', line 151 def eql?(other) self == other end |
#hash ⇒ Fixnum
Calculates hash code according to all attributes.
160 161 162 |
# File 'lib/oci/cloud_bridge/models/update_inventory_asset_details.rb', line 160 def hash [display_name, asset_type, asset_source_ids, , , asset_class_name, asset_class_version, asset_details, environment_type].hash end |
#to_hash ⇒ Hash
Returns the object in the form of hash
204 205 206 207 208 209 210 211 212 213 |
# File 'lib/oci/cloud_bridge/models/update_inventory_asset_details.rb', line 204 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
198 199 200 |
# File 'lib/oci/cloud_bridge/models/update_inventory_asset_details.rb', line 198 def to_s to_hash.to_s end |