# 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
    #
    # Settings for Extended Groups username and group download.
    #
    class CacheUsernameDownloadSettings

      include MsRestAzure

      # @return [Boolean] Whether or not Extended Groups is enabled.
      attr_accessor :extended_groups

      # @return [UsernameSource] This setting determines how the cache gets
      # username and group names for clients. Possible values include: 'AD',
      # 'LDAP', 'File', 'None'. Default value: 'None' .
      attr_accessor :username_source

      # @return [String] The URI of the file containing group information (in
      # /etc/group file format). This field must be populated when
      # 'usernameSource' is set to 'File'.
      attr_accessor :group_file_uri

      # @return [String] The URI of the file containing user information (in
      # /etc/passwd file format). This field must be populated when
      # 'usernameSource' is set to 'File'.
      attr_accessor :user_file_uri

      # @return [String] The fully qualified domain name or IP address of the
      # LDAP server to use.
      attr_accessor :ldap_server

      # @return [String] The base distinguished name for the LDAP domain.
      attr_accessor :ldap_base_dn

      # @return [Boolean] Whether or not the LDAP connection should be
      # encrypted.
      attr_accessor :encrypt_ldap_connection

      # @return [Boolean] Determines if the certificates must be validated by a
      # certificate authority. When true, caCertificateURI must be provided.
      attr_accessor :require_valid_certificate

      # @return [Boolean] Determines if the certificate should be automatically
      # downloaded. This applies to 'caCertificateURI' only if
      # 'requireValidCertificate' is true.
      attr_accessor :auto_download_certificate

      # @return [String] The URI of the CA certificate to validate the LDAP
      # secure connection. This field must be populated when
      # 'requireValidCertificate' is set to true.
      attr_accessor :ca_certificate_uri

      # @return [UsernameDownloadedType] Indicates whether or not the HPC Cache
      # has performed the username download successfully. Possible values
      # include: 'Yes', 'No', 'Error'
      attr_accessor :username_downloaded

      # @return [CacheUsernameDownloadSettingsCredentials] When present, these
      # are the credentials for the secure LDAP connection.
      attr_accessor :credentials


      #
      # Mapper for CacheUsernameDownloadSettings class as Ruby Hash.
      # This will be used for serialization/deserialization.
      #
      def self.mapper()
        {
          client_side_validation: true,
          required: false,
          serialized_name: 'CacheUsernameDownloadSettings',
          type: {
            name: 'Composite',
            class_name: 'CacheUsernameDownloadSettings',
            model_properties: {
              extended_groups: {
                client_side_validation: true,
                required: false,
                serialized_name: 'extendedGroups',
                type: {
                  name: 'Boolean'
                }
              },
              username_source: {
                client_side_validation: true,
                required: false,
                serialized_name: 'usernameSource',
                default_value: 'None',
                type: {
                  name: 'String'
                }
              },
              group_file_uri: {
                client_side_validation: true,
                required: false,
                serialized_name: 'groupFileURI',
                type: {
                  name: 'String'
                }
              },
              user_file_uri: {
                client_side_validation: true,
                required: false,
                serialized_name: 'userFileURI',
                type: {
                  name: 'String'
                }
              },
              ldap_server: {
                client_side_validation: true,
                required: false,
                serialized_name: 'ldapServer',
                type: {
                  name: 'String'
                }
              },
              ldap_base_dn: {
                client_side_validation: true,
                required: false,
                serialized_name: 'ldapBaseDN',
                type: {
                  name: 'String'
                }
              },
              encrypt_ldap_connection: {
                client_side_validation: true,
                required: false,
                serialized_name: 'encryptLdapConnection',
                type: {
                  name: 'Boolean'
                }
              },
              require_valid_certificate: {
                client_side_validation: true,
                required: false,
                serialized_name: 'requireValidCertificate',
                type: {
                  name: 'Boolean'
                }
              },
              auto_download_certificate: {
                client_side_validation: true,
                required: false,
                serialized_name: 'autoDownloadCertificate',
                type: {
                  name: 'Boolean'
                }
              },
              ca_certificate_uri: {
                client_side_validation: true,
                required: false,
                serialized_name: 'caCertificateURI',
                type: {
                  name: 'String'
                }
              },
              username_downloaded: {
                client_side_validation: true,
                required: false,
                read_only: true,
                serialized_name: 'usernameDownloaded',
                type: {
                  name: 'String'
                }
              },
              credentials: {
                client_side_validation: true,
                required: false,
                serialized_name: 'credentials',
                type: {
                  name: 'Composite',
                  class_name: 'CacheUsernameDownloadSettingsCredentials'
                }
              }
            }
          }
        }
      end
    end
  end
end
