Class: OCI::DataScience::Models::StorageMountConfigurationDetails
- Inherits:
-
Object
- Object
- OCI::DataScience::Models::StorageMountConfigurationDetails
- Defined in:
- lib/oci/data_science/models/storage_mount_configuration_details.rb
Overview
The storage mount configuration details
This class has direct subclasses. If you are using this class as input to a service operations then you should favor using a subclass over the base class
Direct Known Subclasses
FileStorageMountConfigurationDetails, ObjectStorageMountConfigurationDetails
Constant Summary collapse
- STORAGE_TYPE_ENUM =
[ STORAGE_TYPE_FILE_STORAGE = 'FILE_STORAGE'.freeze, STORAGE_TYPE_OBJECT_STORAGE = 'OBJECT_STORAGE'.freeze, STORAGE_TYPE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze ].freeze
Instance Attribute Summary collapse
-
#destination_directory_name ⇒ String
[Required] The local directory name to be mounted.
-
#destination_path ⇒ String
The local path of the mounted directory, excluding directory name.
-
#storage_type ⇒ String
[Required] The type of storage.
Class Method Summary collapse
-
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
-
.get_subtype(object_hash) ⇒ Object
Given the hash representation of a subtype of this class, use the info in the hash to return the class of the subtype.
-
.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 = {}) ⇒ StorageMountConfigurationDetails
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 = {}) ⇒ StorageMountConfigurationDetails
Initializes the object
79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 |
# File 'lib/oci/data_science/models/storage_mount_configuration_details.rb', line 79 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.storage_type = attributes[:'storageType'] if attributes[:'storageType'] raise 'You cannot provide both :storageType and :storage_type' if attributes.key?(:'storageType') && attributes.key?(:'storage_type') self.storage_type = attributes[:'storage_type'] if attributes[:'storage_type'] self.destination_directory_name = attributes[:'destinationDirectoryName'] if attributes[:'destinationDirectoryName'] raise 'You cannot provide both :destinationDirectoryName and :destination_directory_name' if attributes.key?(:'destinationDirectoryName') && attributes.key?(:'destination_directory_name') self.destination_directory_name = attributes[:'destination_directory_name'] if attributes[:'destination_directory_name'] self.destination_path = attributes[:'destinationPath'] if attributes[:'destinationPath'] self.destination_path = "/" if destination_path.nil? && !attributes.key?(:'destinationPath') # rubocop:disable Style/StringLiterals raise 'You cannot provide both :destinationPath and :destination_path' if attributes.key?(:'destinationPath') && attributes.key?(:'destination_path') self.destination_path = attributes[:'destination_path'] if attributes[:'destination_path'] self.destination_path = "/" if destination_path.nil? && !attributes.key?(:'destinationPath') && !attributes.key?(:'destination_path') # rubocop:disable Style/StringLiterals end |
Instance Attribute Details
#destination_directory_name ⇒ String
[Required] The local directory name to be mounted
26 27 28 |
# File 'lib/oci/data_science/models/storage_mount_configuration_details.rb', line 26 def destination_directory_name @destination_directory_name end |
#destination_path ⇒ String
The local path of the mounted directory, excluding directory name.
30 31 32 |
# File 'lib/oci/data_science/models/storage_mount_configuration_details.rb', line 30 def destination_path @destination_path end |
#storage_type ⇒ String
[Required] The type of storage.
22 23 24 |
# File 'lib/oci/data_science/models/storage_mount_configuration_details.rb', line 22 def storage_type @storage_type end |
Class Method Details
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
33 34 35 36 37 38 39 40 41 |
# File 'lib/oci/data_science/models/storage_mount_configuration_details.rb', line 33 def self.attribute_map { # rubocop:disable Style/SymbolLiteral 'storage_type': :'storageType', 'destination_directory_name': :'destinationDirectoryName', 'destination_path': :'destinationPath' # rubocop:enable Style/SymbolLiteral } end |
.get_subtype(object_hash) ⇒ Object
Given the hash representation of a subtype of this class, use the info in the hash to return the class of the subtype.
59 60 61 62 63 64 65 66 67 |
# File 'lib/oci/data_science/models/storage_mount_configuration_details.rb', line 59 def self.get_subtype(object_hash) type = object_hash[:'storageType'] # rubocop:disable Style/SymbolLiteral return 'OCI::DataScience::Models::FileStorageMountConfigurationDetails' if type == 'FILE_STORAGE' return 'OCI::DataScience::Models::ObjectStorageMountConfigurationDetails' if type == 'OBJECT_STORAGE' # TODO: Log a warning when the subtype is not found. 'OCI::DataScience::Models::StorageMountConfigurationDetails' end |
.swagger_types ⇒ Object
Attribute type mapping.
44 45 46 47 48 49 50 51 52 |
# File 'lib/oci/data_science/models/storage_mount_configuration_details.rb', line 44 def self.swagger_types { # rubocop:disable Style/SymbolLiteral 'storage_type': :'String', 'destination_directory_name': :'String', 'destination_path': :'String' # rubocop:enable Style/SymbolLiteral } end |
Instance Method Details
#==(other) ⇒ Object
Checks equality by comparing each attribute.
126 127 128 129 130 131 132 133 |
# File 'lib/oci/data_science/models/storage_mount_configuration_details.rb', line 126 def ==(other) return true if equal?(other) self.class == other.class && storage_type == other.storage_type && destination_directory_name == other.destination_directory_name && destination_path == other.destination_path end |
#build_from_hash(attributes) ⇒ Object
Builds the object from hash
158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 |
# File 'lib/oci/data_science/models/storage_mount_configuration_details.rb', line 158 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
138 139 140 |
# File 'lib/oci/data_science/models/storage_mount_configuration_details.rb', line 138 def eql?(other) self == other end |
#hash ⇒ Fixnum
Calculates hash code according to all attributes.
147 148 149 |
# File 'lib/oci/data_science/models/storage_mount_configuration_details.rb', line 147 def hash [storage_type, destination_directory_name, destination_path].hash end |
#to_hash ⇒ Hash
Returns the object in the form of hash
191 192 193 194 195 196 197 198 199 200 |
# File 'lib/oci/data_science/models/storage_mount_configuration_details.rb', line 191 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
185 186 187 |
# File 'lib/oci/data_science/models/storage_mount_configuration_details.rb', line 185 def to_s to_hash.to_s end |