class OCI::FileStorage::Models::CreateExportDetails
Details for creating the export.
Attributes
Export options for the new export. If left unspecified, defaults to:
[ { \"source\" : \"0.0.0.0/0\", \"requirePrivilegedSourcePort\" : false, \"access\" : \"READ_WRITE\", \"identitySquash\" : \"NONE\" } ] **Note:** Mount targets do not have Internet-routable IP addresses. Therefore they will not be reachable from the Internet, even if an associated `ClientOptions` item has a source of `0.0.0.0/0`. **If set to the empty array then the export will not be visible to any clients.** The export's `exportOptions` can be changed after creation using the `UpdateExport` operation.
@return [Array<OCI::FileStorage::Models::ClientOptions>]
[Required] The [OCID](docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of this export's export set. @return [String]
[Required] The [OCID](docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of this export's file system. @return [String]
[Required] Path used to access the associated file system.
Avoid entering confidential information.
Example: `/mediafiles`
@return [String]
Public Class Methods
Attribute mapping from ruby-style variable name to JSON key.
# File lib/oci/file_storage/models/create_export_details.rb, line 54 def self.attribute_map { # rubocop:disable Style/SymbolLiteral 'export_options': :'exportOptions', 'export_set_id': :'exportSetId', 'file_system_id': :'fileSystemId', 'path': :'path' # rubocop:enable Style/SymbolLiteral } end
Initializes the object @param [Hash] attributes Model attributes in the form of hash @option attributes [Array<OCI::FileStorage::Models::ClientOptions>] :export_options The value to assign to the {#export_options} property @option attributes [String] :export_set_id The value to assign to the {#export_set_id} property @option attributes [String] :file_system_id The value to assign to the {#file_system_id} property @option attributes [String] :path The value to assign to the {#path} property
# File lib/oci/file_storage/models/create_export_details.rb, line 87 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.export_options = attributes[:'exportOptions'] if attributes[:'exportOptions'] raise 'You cannot provide both :exportOptions and :export_options' if attributes.key?(:'exportOptions') && attributes.key?(:'export_options') self.export_options = attributes[:'export_options'] if attributes[:'export_options'] self.export_set_id = attributes[:'exportSetId'] if attributes[:'exportSetId'] raise 'You cannot provide both :exportSetId and :export_set_id' if attributes.key?(:'exportSetId') && attributes.key?(:'export_set_id') self.export_set_id = attributes[:'export_set_id'] if attributes[:'export_set_id'] self.file_system_id = attributes[:'fileSystemId'] if attributes[:'fileSystemId'] raise 'You cannot provide both :fileSystemId and :file_system_id' if attributes.key?(:'fileSystemId') && attributes.key?(:'file_system_id') self.file_system_id = attributes[:'file_system_id'] if attributes[:'file_system_id'] self.path = attributes[:'path'] if attributes[:'path'] end
Attribute type mapping.
# File lib/oci/file_storage/models/create_export_details.rb, line 66 def self.swagger_types { # rubocop:disable Style/SymbolLiteral 'export_options': :'Array<OCI::FileStorage::Models::ClientOptions>', 'export_set_id': :'String', 'file_system_id': :'String', 'path': :'String' # rubocop:enable Style/SymbolLiteral } end
Public Instance Methods
Checks equality by comparing each attribute. @param [Object] other the other object to be compared
# File lib/oci/file_storage/models/create_export_details.rb, line 121 def ==(other) return true if equal?(other) self.class == other.class && export_options == other.export_options && export_set_id == other.export_set_id && file_system_id == other.file_system_id && path == other.path end
Builds the object from hash @param [Hash] attributes Model attributes in the form of hash @return [Object] Returns the model itself
# File lib/oci/file_storage/models/create_export_details.rb, line 154 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
@see the `==` method @param [Object] other the other object to be compared
# File lib/oci/file_storage/models/create_export_details.rb, line 134 def eql?(other) self == other end
Calculates hash code according to all attributes. @return [Fixnum] Hash code
# File lib/oci/file_storage/models/create_export_details.rb, line 143 def hash [export_options, export_set_id, file_system_id, path].hash end
Returns the object in the form of hash @return [Hash] Returns the object in the form of hash
# File lib/oci/file_storage/models/create_export_details.rb, line 187 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
Returns the string representation of the object @return [String] String presentation of the object
# File lib/oci/file_storage/models/create_export_details.rb, line 181 def to_s to_hash.to_s end
Private Instance Methods
Outputs non-array value in the form of hash For object, use to_hash. Otherwise, just return the value @param [Object] value Any valid value @return [Hash] Returns the value in the form of hash
# File lib/oci/file_storage/models/create_export_details.rb, line 204 def _to_hash(value) if value.is_a?(Array) value.compact.map { |v| _to_hash(v) } elsif value.is_a?(Hash) {}.tap do |hash| value.each { |k, v| hash[k] = _to_hash(v) } end elsif value.respond_to? :to_hash value.to_hash else value end end