# encoding: utf-8
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.

module Azure::StorageCache::Mgmt::V2020_10_01
  module Models
    #
    # Rule to place restrictions on portions of the cache namespace being
    # presented to clients.
    #
    class NfsAccessRule

      include MsRestAzure

      # @return [NfsAccessRuleScope] Scope for this rule. The scope and filter
      # determine which clients match the rule. Possible values include:
      # 'default', 'network', 'host'
      attr_accessor :scope

      # @return [String] Filter applied to the scope for this rule. The
      # filter's format depends on its scope. 'default' scope matches all
      # clients and has no filter value. 'network' scope takes a filter in CIDR
      # format (for example, 10.99.1.0/24). 'host' takes an IP address or fully
      # qualified domain name as filter. If a client does not match any filter
      # rule and there is no default rule, access is denied.
      attr_accessor :filter

      # @return [NfsAccessRuleAccess] Access allowed by this rule. Possible
      # values include: 'no', 'ro', 'rw'
      attr_accessor :access

      # @return [Boolean] Allow SUID semantics.
      attr_accessor :suid

      # @return [Boolean] For the default policy, allow access to
      # subdirectories under the root export. If this is set to no, clients can
      # only mount the path '/'. If set to yes, clients can mount a deeper
      # path, like '/a/b'.
      attr_accessor :submount_access

      # @return [Boolean] Map root accesses to anonymousUID and anonymousGID.
      attr_accessor :root_squash

      # @return [String] UID value that replaces 0 when rootSquash is true.
      # Default value: '-2' .
      attr_accessor :anonymous_uid

      # @return [String] GID value that replaces 0 when rootSquash is true.
      # Default value: '-2' .
      attr_accessor :anonymous_gid


      #
      # Mapper for NfsAccessRule class as Ruby Hash.
      # This will be used for serialization/deserialization.
      #
      def self.mapper()
        {
          client_side_validation: true,
          required: false,
          serialized_name: 'NfsAccessRule',
          type: {
            name: 'Composite',
            class_name: 'NfsAccessRule',
            model_properties: {
              scope: {
                client_side_validation: true,
                required: true,
                serialized_name: 'scope',
                type: {
                  name: 'String'
                }
              },
              filter: {
                client_side_validation: true,
                required: false,
                serialized_name: 'filter',
                type: {
                  name: 'String'
                }
              },
              access: {
                client_side_validation: true,
                required: true,
                serialized_name: 'access',
                type: {
                  name: 'String'
                }
              },
              suid: {
                client_side_validation: true,
                required: false,
                serialized_name: 'suid',
                type: {
                  name: 'Boolean'
                }
              },
              submount_access: {
                client_side_validation: true,
                required: false,
                serialized_name: 'submountAccess',
                type: {
                  name: 'Boolean'
                }
              },
              root_squash: {
                client_side_validation: true,
                required: false,
                serialized_name: 'rootSquash',
                type: {
                  name: 'Boolean'
                }
              },
              anonymous_uid: {
                client_side_validation: true,
                required: false,
                serialized_name: 'anonymousUID',
                default_value: '-2',
                type: {
                  name: 'String'
                }
              },
              anonymous_gid: {
                client_side_validation: true,
                required: false,
                serialized_name: 'anonymousGID',
                default_value: '-2',
                type: {
                  name: 'String'
                }
              }
            }
          }
        }
      end
    end
  end
end
