{-# 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.EC2.Types.DirectoryServiceAuthentication
-- 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.EC2.Types.DirectoryServiceAuthentication where

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

-- | Describes an Active Directory.
--
-- /See:/ 'newDirectoryServiceAuthentication' smart constructor.
data DirectoryServiceAuthentication = DirectoryServiceAuthentication'
  { -- | The ID of the Active Directory used for authentication.
    DirectoryServiceAuthentication -> Maybe Text
directoryId :: Prelude.Maybe Prelude.Text
  }
  deriving (DirectoryServiceAuthentication
-> DirectoryServiceAuthentication -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DirectoryServiceAuthentication
-> DirectoryServiceAuthentication -> Bool
$c/= :: DirectoryServiceAuthentication
-> DirectoryServiceAuthentication -> Bool
== :: DirectoryServiceAuthentication
-> DirectoryServiceAuthentication -> Bool
$c== :: DirectoryServiceAuthentication
-> DirectoryServiceAuthentication -> Bool
Prelude.Eq, ReadPrec [DirectoryServiceAuthentication]
ReadPrec DirectoryServiceAuthentication
Int -> ReadS DirectoryServiceAuthentication
ReadS [DirectoryServiceAuthentication]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DirectoryServiceAuthentication]
$creadListPrec :: ReadPrec [DirectoryServiceAuthentication]
readPrec :: ReadPrec DirectoryServiceAuthentication
$creadPrec :: ReadPrec DirectoryServiceAuthentication
readList :: ReadS [DirectoryServiceAuthentication]
$creadList :: ReadS [DirectoryServiceAuthentication]
readsPrec :: Int -> ReadS DirectoryServiceAuthentication
$creadsPrec :: Int -> ReadS DirectoryServiceAuthentication
Prelude.Read, Int -> DirectoryServiceAuthentication -> ShowS
[DirectoryServiceAuthentication] -> ShowS
DirectoryServiceAuthentication -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DirectoryServiceAuthentication] -> ShowS
$cshowList :: [DirectoryServiceAuthentication] -> ShowS
show :: DirectoryServiceAuthentication -> String
$cshow :: DirectoryServiceAuthentication -> String
showsPrec :: Int -> DirectoryServiceAuthentication -> ShowS
$cshowsPrec :: Int -> DirectoryServiceAuthentication -> ShowS
Prelude.Show, forall x.
Rep DirectoryServiceAuthentication x
-> DirectoryServiceAuthentication
forall x.
DirectoryServiceAuthentication
-> Rep DirectoryServiceAuthentication x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DirectoryServiceAuthentication x
-> DirectoryServiceAuthentication
$cfrom :: forall x.
DirectoryServiceAuthentication
-> Rep DirectoryServiceAuthentication x
Prelude.Generic)

-- |
-- Create a value of 'DirectoryServiceAuthentication' 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:
--
-- 'directoryId', 'directoryServiceAuthentication_directoryId' - The ID of the Active Directory used for authentication.
newDirectoryServiceAuthentication ::
  DirectoryServiceAuthentication
newDirectoryServiceAuthentication :: DirectoryServiceAuthentication
newDirectoryServiceAuthentication =
  DirectoryServiceAuthentication'
    { $sel:directoryId:DirectoryServiceAuthentication' :: Maybe Text
directoryId =
        forall a. Maybe a
Prelude.Nothing
    }

-- | The ID of the Active Directory used for authentication.
directoryServiceAuthentication_directoryId :: Lens.Lens' DirectoryServiceAuthentication (Prelude.Maybe Prelude.Text)
directoryServiceAuthentication_directoryId :: Lens' DirectoryServiceAuthentication (Maybe Text)
directoryServiceAuthentication_directoryId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DirectoryServiceAuthentication' {Maybe Text
directoryId :: Maybe Text
$sel:directoryId:DirectoryServiceAuthentication' :: DirectoryServiceAuthentication -> Maybe Text
directoryId} -> Maybe Text
directoryId) (\s :: DirectoryServiceAuthentication
s@DirectoryServiceAuthentication' {} Maybe Text
a -> DirectoryServiceAuthentication
s {$sel:directoryId:DirectoryServiceAuthentication' :: Maybe Text
directoryId = Maybe Text
a} :: DirectoryServiceAuthentication)

instance Data.FromXML DirectoryServiceAuthentication where
  parseXML :: [Node] -> Either String DirectoryServiceAuthentication
parseXML [Node]
x =
    Maybe Text -> DirectoryServiceAuthentication
DirectoryServiceAuthentication'
      forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"directoryId")

instance
  Prelude.Hashable
    DirectoryServiceAuthentication
  where
  hashWithSalt :: Int -> DirectoryServiceAuthentication -> Int
hashWithSalt
    Int
_salt
    DirectoryServiceAuthentication' {Maybe Text
directoryId :: Maybe Text
$sel:directoryId:DirectoryServiceAuthentication' :: DirectoryServiceAuthentication -> Maybe Text
..} =
      Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
directoryId

instance
  Prelude.NFData
    DirectoryServiceAuthentication
  where
  rnf :: DirectoryServiceAuthentication -> ()
rnf DirectoryServiceAuthentication' {Maybe Text
directoryId :: Maybe Text
$sel:directoryId:DirectoryServiceAuthentication' :: DirectoryServiceAuthentication -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
directoryId