{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.FSx.Types.SelfManagedActiveDirectoryAttributes
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.FSx.Types.SelfManagedActiveDirectoryAttributes where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude

-- | The configuration of the self-managed Microsoft Active Directory (AD)
-- directory to which the Windows File Server or ONTAP storage virtual
-- machine (SVM) instance is joined.
--
-- /See:/ 'newSelfManagedActiveDirectoryAttributes' smart constructor.
data SelfManagedActiveDirectoryAttributes = SelfManagedActiveDirectoryAttributes'
  { -- | A list of up to three IP addresses of DNS servers or domain controllers
    -- in the self-managed AD directory.
    SelfManagedActiveDirectoryAttributes -> Maybe (NonEmpty Text)
dnsIps :: Prelude.Maybe (Prelude.NonEmpty Prelude.Text),
    -- | The fully qualified domain name of the self-managed AD directory.
    SelfManagedActiveDirectoryAttributes -> Maybe Text
domainName :: Prelude.Maybe Prelude.Text,
    -- | The name of the domain group whose members have administrative
    -- privileges for the FSx file system.
    SelfManagedActiveDirectoryAttributes -> Maybe Text
fileSystemAdministratorsGroup :: Prelude.Maybe Prelude.Text,
    -- | The fully qualified distinguished name of the organizational unit within
    -- the self-managed AD directory to which the Windows File Server or ONTAP
    -- storage virtual machine (SVM) instance is joined.
    SelfManagedActiveDirectoryAttributes -> Maybe Text
organizationalUnitDistinguishedName :: Prelude.Maybe Prelude.Text,
    -- | The user name for the service account on your self-managed AD domain
    -- that FSx uses to join to your AD domain.
    SelfManagedActiveDirectoryAttributes -> Maybe Text
userName :: Prelude.Maybe Prelude.Text
  }
  deriving (SelfManagedActiveDirectoryAttributes
-> SelfManagedActiveDirectoryAttributes -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SelfManagedActiveDirectoryAttributes
-> SelfManagedActiveDirectoryAttributes -> Bool
$c/= :: SelfManagedActiveDirectoryAttributes
-> SelfManagedActiveDirectoryAttributes -> Bool
== :: SelfManagedActiveDirectoryAttributes
-> SelfManagedActiveDirectoryAttributes -> Bool
$c== :: SelfManagedActiveDirectoryAttributes
-> SelfManagedActiveDirectoryAttributes -> Bool
Prelude.Eq, ReadPrec [SelfManagedActiveDirectoryAttributes]
ReadPrec SelfManagedActiveDirectoryAttributes
Int -> ReadS SelfManagedActiveDirectoryAttributes
ReadS [SelfManagedActiveDirectoryAttributes]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SelfManagedActiveDirectoryAttributes]
$creadListPrec :: ReadPrec [SelfManagedActiveDirectoryAttributes]
readPrec :: ReadPrec SelfManagedActiveDirectoryAttributes
$creadPrec :: ReadPrec SelfManagedActiveDirectoryAttributes
readList :: ReadS [SelfManagedActiveDirectoryAttributes]
$creadList :: ReadS [SelfManagedActiveDirectoryAttributes]
readsPrec :: Int -> ReadS SelfManagedActiveDirectoryAttributes
$creadsPrec :: Int -> ReadS SelfManagedActiveDirectoryAttributes
Prelude.Read, Int -> SelfManagedActiveDirectoryAttributes -> ShowS
[SelfManagedActiveDirectoryAttributes] -> ShowS
SelfManagedActiveDirectoryAttributes -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SelfManagedActiveDirectoryAttributes] -> ShowS
$cshowList :: [SelfManagedActiveDirectoryAttributes] -> ShowS
show :: SelfManagedActiveDirectoryAttributes -> String
$cshow :: SelfManagedActiveDirectoryAttributes -> String
showsPrec :: Int -> SelfManagedActiveDirectoryAttributes -> ShowS
$cshowsPrec :: Int -> SelfManagedActiveDirectoryAttributes -> ShowS
Prelude.Show, forall x.
Rep SelfManagedActiveDirectoryAttributes x
-> SelfManagedActiveDirectoryAttributes
forall x.
SelfManagedActiveDirectoryAttributes
-> Rep SelfManagedActiveDirectoryAttributes x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep SelfManagedActiveDirectoryAttributes x
-> SelfManagedActiveDirectoryAttributes
$cfrom :: forall x.
SelfManagedActiveDirectoryAttributes
-> Rep SelfManagedActiveDirectoryAttributes x
Prelude.Generic)

-- |
-- Create a value of 'SelfManagedActiveDirectoryAttributes' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'dnsIps', 'selfManagedActiveDirectoryAttributes_dnsIps' - A list of up to three IP addresses of DNS servers or domain controllers
-- in the self-managed AD directory.
--
-- 'domainName', 'selfManagedActiveDirectoryAttributes_domainName' - The fully qualified domain name of the self-managed AD directory.
--
-- 'fileSystemAdministratorsGroup', 'selfManagedActiveDirectoryAttributes_fileSystemAdministratorsGroup' - The name of the domain group whose members have administrative
-- privileges for the FSx file system.
--
-- 'organizationalUnitDistinguishedName', 'selfManagedActiveDirectoryAttributes_organizationalUnitDistinguishedName' - The fully qualified distinguished name of the organizational unit within
-- the self-managed AD directory to which the Windows File Server or ONTAP
-- storage virtual machine (SVM) instance is joined.
--
-- 'userName', 'selfManagedActiveDirectoryAttributes_userName' - The user name for the service account on your self-managed AD domain
-- that FSx uses to join to your AD domain.
newSelfManagedActiveDirectoryAttributes ::
  SelfManagedActiveDirectoryAttributes
newSelfManagedActiveDirectoryAttributes :: SelfManagedActiveDirectoryAttributes
newSelfManagedActiveDirectoryAttributes =
  SelfManagedActiveDirectoryAttributes'
    { $sel:dnsIps:SelfManagedActiveDirectoryAttributes' :: Maybe (NonEmpty Text)
dnsIps =
        forall a. Maybe a
Prelude.Nothing,
      $sel:domainName:SelfManagedActiveDirectoryAttributes' :: Maybe Text
domainName = forall a. Maybe a
Prelude.Nothing,
      $sel:fileSystemAdministratorsGroup:SelfManagedActiveDirectoryAttributes' :: Maybe Text
fileSystemAdministratorsGroup =
        forall a. Maybe a
Prelude.Nothing,
      $sel:organizationalUnitDistinguishedName:SelfManagedActiveDirectoryAttributes' :: Maybe Text
organizationalUnitDistinguishedName =
        forall a. Maybe a
Prelude.Nothing,
      $sel:userName:SelfManagedActiveDirectoryAttributes' :: Maybe Text
userName = forall a. Maybe a
Prelude.Nothing
    }

-- | A list of up to three IP addresses of DNS servers or domain controllers
-- in the self-managed AD directory.
selfManagedActiveDirectoryAttributes_dnsIps :: Lens.Lens' SelfManagedActiveDirectoryAttributes (Prelude.Maybe (Prelude.NonEmpty Prelude.Text))
selfManagedActiveDirectoryAttributes_dnsIps :: Lens' SelfManagedActiveDirectoryAttributes (Maybe (NonEmpty Text))
selfManagedActiveDirectoryAttributes_dnsIps = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SelfManagedActiveDirectoryAttributes' {Maybe (NonEmpty Text)
dnsIps :: Maybe (NonEmpty Text)
$sel:dnsIps:SelfManagedActiveDirectoryAttributes' :: SelfManagedActiveDirectoryAttributes -> Maybe (NonEmpty Text)
dnsIps} -> Maybe (NonEmpty Text)
dnsIps) (\s :: SelfManagedActiveDirectoryAttributes
s@SelfManagedActiveDirectoryAttributes' {} Maybe (NonEmpty Text)
a -> SelfManagedActiveDirectoryAttributes
s {$sel:dnsIps:SelfManagedActiveDirectoryAttributes' :: Maybe (NonEmpty Text)
dnsIps = Maybe (NonEmpty Text)
a} :: SelfManagedActiveDirectoryAttributes) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The fully qualified domain name of the self-managed AD directory.
selfManagedActiveDirectoryAttributes_domainName :: Lens.Lens' SelfManagedActiveDirectoryAttributes (Prelude.Maybe Prelude.Text)
selfManagedActiveDirectoryAttributes_domainName :: Lens' SelfManagedActiveDirectoryAttributes (Maybe Text)
selfManagedActiveDirectoryAttributes_domainName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SelfManagedActiveDirectoryAttributes' {Maybe Text
domainName :: Maybe Text
$sel:domainName:SelfManagedActiveDirectoryAttributes' :: SelfManagedActiveDirectoryAttributes -> Maybe Text
domainName} -> Maybe Text
domainName) (\s :: SelfManagedActiveDirectoryAttributes
s@SelfManagedActiveDirectoryAttributes' {} Maybe Text
a -> SelfManagedActiveDirectoryAttributes
s {$sel:domainName:SelfManagedActiveDirectoryAttributes' :: Maybe Text
domainName = Maybe Text
a} :: SelfManagedActiveDirectoryAttributes)

-- | The name of the domain group whose members have administrative
-- privileges for the FSx file system.
selfManagedActiveDirectoryAttributes_fileSystemAdministratorsGroup :: Lens.Lens' SelfManagedActiveDirectoryAttributes (Prelude.Maybe Prelude.Text)
selfManagedActiveDirectoryAttributes_fileSystemAdministratorsGroup :: Lens' SelfManagedActiveDirectoryAttributes (Maybe Text)
selfManagedActiveDirectoryAttributes_fileSystemAdministratorsGroup = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SelfManagedActiveDirectoryAttributes' {Maybe Text
fileSystemAdministratorsGroup :: Maybe Text
$sel:fileSystemAdministratorsGroup:SelfManagedActiveDirectoryAttributes' :: SelfManagedActiveDirectoryAttributes -> Maybe Text
fileSystemAdministratorsGroup} -> Maybe Text
fileSystemAdministratorsGroup) (\s :: SelfManagedActiveDirectoryAttributes
s@SelfManagedActiveDirectoryAttributes' {} Maybe Text
a -> SelfManagedActiveDirectoryAttributes
s {$sel:fileSystemAdministratorsGroup:SelfManagedActiveDirectoryAttributes' :: Maybe Text
fileSystemAdministratorsGroup = Maybe Text
a} :: SelfManagedActiveDirectoryAttributes)

-- | The fully qualified distinguished name of the organizational unit within
-- the self-managed AD directory to which the Windows File Server or ONTAP
-- storage virtual machine (SVM) instance is joined.
selfManagedActiveDirectoryAttributes_organizationalUnitDistinguishedName :: Lens.Lens' SelfManagedActiveDirectoryAttributes (Prelude.Maybe Prelude.Text)
selfManagedActiveDirectoryAttributes_organizationalUnitDistinguishedName :: Lens' SelfManagedActiveDirectoryAttributes (Maybe Text)
selfManagedActiveDirectoryAttributes_organizationalUnitDistinguishedName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SelfManagedActiveDirectoryAttributes' {Maybe Text
organizationalUnitDistinguishedName :: Maybe Text
$sel:organizationalUnitDistinguishedName:SelfManagedActiveDirectoryAttributes' :: SelfManagedActiveDirectoryAttributes -> Maybe Text
organizationalUnitDistinguishedName} -> Maybe Text
organizationalUnitDistinguishedName) (\s :: SelfManagedActiveDirectoryAttributes
s@SelfManagedActiveDirectoryAttributes' {} Maybe Text
a -> SelfManagedActiveDirectoryAttributes
s {$sel:organizationalUnitDistinguishedName:SelfManagedActiveDirectoryAttributes' :: Maybe Text
organizationalUnitDistinguishedName = Maybe Text
a} :: SelfManagedActiveDirectoryAttributes)

-- | The user name for the service account on your self-managed AD domain
-- that FSx uses to join to your AD domain.
selfManagedActiveDirectoryAttributes_userName :: Lens.Lens' SelfManagedActiveDirectoryAttributes (Prelude.Maybe Prelude.Text)
selfManagedActiveDirectoryAttributes_userName :: Lens' SelfManagedActiveDirectoryAttributes (Maybe Text)
selfManagedActiveDirectoryAttributes_userName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SelfManagedActiveDirectoryAttributes' {Maybe Text
userName :: Maybe Text
$sel:userName:SelfManagedActiveDirectoryAttributes' :: SelfManagedActiveDirectoryAttributes -> Maybe Text
userName} -> Maybe Text
userName) (\s :: SelfManagedActiveDirectoryAttributes
s@SelfManagedActiveDirectoryAttributes' {} Maybe Text
a -> SelfManagedActiveDirectoryAttributes
s {$sel:userName:SelfManagedActiveDirectoryAttributes' :: Maybe Text
userName = Maybe Text
a} :: SelfManagedActiveDirectoryAttributes)

instance
  Data.FromJSON
    SelfManagedActiveDirectoryAttributes
  where
  parseJSON :: Value -> Parser SelfManagedActiveDirectoryAttributes
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"SelfManagedActiveDirectoryAttributes"
      ( \Object
x ->
          Maybe (NonEmpty Text)
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> SelfManagedActiveDirectoryAttributes
SelfManagedActiveDirectoryAttributes'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"DnsIps")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"DomainName")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"FileSystemAdministratorsGroup")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"OrganizationalUnitDistinguishedName")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"UserName")
      )

instance
  Prelude.Hashable
    SelfManagedActiveDirectoryAttributes
  where
  hashWithSalt :: Int -> SelfManagedActiveDirectoryAttributes -> Int
hashWithSalt
    Int
_salt
    SelfManagedActiveDirectoryAttributes' {Maybe (NonEmpty Text)
Maybe Text
userName :: Maybe Text
organizationalUnitDistinguishedName :: Maybe Text
fileSystemAdministratorsGroup :: Maybe Text
domainName :: Maybe Text
dnsIps :: Maybe (NonEmpty Text)
$sel:userName:SelfManagedActiveDirectoryAttributes' :: SelfManagedActiveDirectoryAttributes -> Maybe Text
$sel:organizationalUnitDistinguishedName:SelfManagedActiveDirectoryAttributes' :: SelfManagedActiveDirectoryAttributes -> Maybe Text
$sel:fileSystemAdministratorsGroup:SelfManagedActiveDirectoryAttributes' :: SelfManagedActiveDirectoryAttributes -> Maybe Text
$sel:domainName:SelfManagedActiveDirectoryAttributes' :: SelfManagedActiveDirectoryAttributes -> Maybe Text
$sel:dnsIps:SelfManagedActiveDirectoryAttributes' :: SelfManagedActiveDirectoryAttributes -> Maybe (NonEmpty Text)
..} =
      Int
_salt
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (NonEmpty Text)
dnsIps
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
domainName
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
fileSystemAdministratorsGroup
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
organizationalUnitDistinguishedName
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
userName

instance
  Prelude.NFData
    SelfManagedActiveDirectoryAttributes
  where
  rnf :: SelfManagedActiveDirectoryAttributes -> ()
rnf SelfManagedActiveDirectoryAttributes' {Maybe (NonEmpty Text)
Maybe Text
userName :: Maybe Text
organizationalUnitDistinguishedName :: Maybe Text
fileSystemAdministratorsGroup :: Maybe Text
domainName :: Maybe Text
dnsIps :: Maybe (NonEmpty Text)
$sel:userName:SelfManagedActiveDirectoryAttributes' :: SelfManagedActiveDirectoryAttributes -> Maybe Text
$sel:organizationalUnitDistinguishedName:SelfManagedActiveDirectoryAttributes' :: SelfManagedActiveDirectoryAttributes -> Maybe Text
$sel:fileSystemAdministratorsGroup:SelfManagedActiveDirectoryAttributes' :: SelfManagedActiveDirectoryAttributes -> Maybe Text
$sel:domainName:SelfManagedActiveDirectoryAttributes' :: SelfManagedActiveDirectoryAttributes -> Maybe Text
$sel:dnsIps:SelfManagedActiveDirectoryAttributes' :: SelfManagedActiveDirectoryAttributes -> Maybe (NonEmpty Text)
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe (NonEmpty Text)
dnsIps
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
domainName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
fileSystemAdministratorsGroup
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
organizationalUnitDistinguishedName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
userName