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

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

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

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

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

instance
  Data.ToQuery
    DirectoryServiceAuthenticationRequest
  where
  toQuery :: DirectoryServiceAuthenticationRequest -> QueryString
toQuery DirectoryServiceAuthenticationRequest' {Maybe Text
directoryId :: Maybe Text
$sel:directoryId:DirectoryServiceAuthenticationRequest' :: DirectoryServiceAuthenticationRequest -> Maybe Text
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat [ByteString
"DirectoryId" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
directoryId]