Class: OCI::FileStorage::Models::CreateExportDetails

Inherits:
Object
  • Object
show all
Defined in:
lib/oci/file_storage/models/create_export_details.rb

Overview

Details for creating the export.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ CreateExportDetails

Initializes the object

Parameters:

  • attributes (Hash) (defaults to: {})

    Model attributes in the form of hash

Options Hash (attributes):



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
# 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

Instance Attribute Details

#export_optionsArray<OCI::FileStorage::Models::ClientOptions>

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.



34
35
36
# File 'lib/oci/file_storage/models/create_export_details.rb', line 34

def export_options
  @export_options
end

#export_set_idString

[Required] The OCID of this export's export set.

Returns:

  • (String)


38
39
40
# File 'lib/oci/file_storage/models/create_export_details.rb', line 38

def export_set_id
  @export_set_id
end

#file_system_idString

[Required] The OCID of this export's file system.

Returns:

  • (String)


42
43
44
# File 'lib/oci/file_storage/models/create_export_details.rb', line 42

def file_system_id
  @file_system_id
end

#pathString

[Required] Path used to access the associated file system.

Avoid entering confidential information.

Example: /mediafiles

Returns:

  • (String)


51
52
53
# File 'lib/oci/file_storage/models/create_export_details.rb', line 51

def path
  @path
end

Class Method Details

.attribute_mapObject

Attribute mapping from ruby-style variable name to JSON key.



54
55
56
57
58
59
60
61
62
63
# 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

.swagger_typesObject

Attribute type mapping.



66
67
68
69
70
71
72
73
74
75
# 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

Instance Method Details

#==(other) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • other (Object)

    the other object to be compared



121
122
123
124
125
126
127
128
129
# 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

#build_from_hash(attributes) ⇒ Object

Builds the object from hash

Parameters:

  • attributes (Hash)

    Model attributes in the form of hash

Returns:

  • (Object)

    Returns the model itself



154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
# 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

#eql?(other) ⇒ Boolean

Parameters:

  • other (Object)

    the other object to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


134
135
136
# File 'lib/oci/file_storage/models/create_export_details.rb', line 134

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



143
144
145
# 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

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



187
188
189
190
191
192
193
194
195
196
# 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

#to_sString

Returns the string representation of the object

Returns:

  • (String)

    String presentation of the object



181
182
183
# File 'lib/oci/file_storage/models/create_export_details.rb', line 181

def to_s
  to_hash.to_s
end