{-# 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.CertificateAuthenticationRequest
-- 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.CertificateAuthenticationRequest 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

-- | Information about the client certificate to be used for authentication.
--
-- /See:/ 'newCertificateAuthenticationRequest' smart constructor.
data CertificateAuthenticationRequest = CertificateAuthenticationRequest'
  { -- | The ARN of the client certificate. The certificate must be signed by a
    -- certificate authority (CA) and it must be provisioned in Certificate
    -- Manager (ACM).
    CertificateAuthenticationRequest -> Maybe Text
clientRootCertificateChainArn :: Prelude.Maybe Prelude.Text
  }
  deriving (CertificateAuthenticationRequest
-> CertificateAuthenticationRequest -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CertificateAuthenticationRequest
-> CertificateAuthenticationRequest -> Bool
$c/= :: CertificateAuthenticationRequest
-> CertificateAuthenticationRequest -> Bool
== :: CertificateAuthenticationRequest
-> CertificateAuthenticationRequest -> Bool
$c== :: CertificateAuthenticationRequest
-> CertificateAuthenticationRequest -> Bool
Prelude.Eq, ReadPrec [CertificateAuthenticationRequest]
ReadPrec CertificateAuthenticationRequest
Int -> ReadS CertificateAuthenticationRequest
ReadS [CertificateAuthenticationRequest]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CertificateAuthenticationRequest]
$creadListPrec :: ReadPrec [CertificateAuthenticationRequest]
readPrec :: ReadPrec CertificateAuthenticationRequest
$creadPrec :: ReadPrec CertificateAuthenticationRequest
readList :: ReadS [CertificateAuthenticationRequest]
$creadList :: ReadS [CertificateAuthenticationRequest]
readsPrec :: Int -> ReadS CertificateAuthenticationRequest
$creadsPrec :: Int -> ReadS CertificateAuthenticationRequest
Prelude.Read, Int -> CertificateAuthenticationRequest -> ShowS
[CertificateAuthenticationRequest] -> ShowS
CertificateAuthenticationRequest -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CertificateAuthenticationRequest] -> ShowS
$cshowList :: [CertificateAuthenticationRequest] -> ShowS
show :: CertificateAuthenticationRequest -> String
$cshow :: CertificateAuthenticationRequest -> String
showsPrec :: Int -> CertificateAuthenticationRequest -> ShowS
$cshowsPrec :: Int -> CertificateAuthenticationRequest -> ShowS
Prelude.Show, forall x.
Rep CertificateAuthenticationRequest x
-> CertificateAuthenticationRequest
forall x.
CertificateAuthenticationRequest
-> Rep CertificateAuthenticationRequest x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CertificateAuthenticationRequest x
-> CertificateAuthenticationRequest
$cfrom :: forall x.
CertificateAuthenticationRequest
-> Rep CertificateAuthenticationRequest x
Prelude.Generic)

-- |
-- Create a value of 'CertificateAuthenticationRequest' 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:
--
-- 'clientRootCertificateChainArn', 'certificateAuthenticationRequest_clientRootCertificateChainArn' - The ARN of the client certificate. The certificate must be signed by a
-- certificate authority (CA) and it must be provisioned in Certificate
-- Manager (ACM).
newCertificateAuthenticationRequest ::
  CertificateAuthenticationRequest
newCertificateAuthenticationRequest :: CertificateAuthenticationRequest
newCertificateAuthenticationRequest =
  CertificateAuthenticationRequest'
    { $sel:clientRootCertificateChainArn:CertificateAuthenticationRequest' :: Maybe Text
clientRootCertificateChainArn =
        forall a. Maybe a
Prelude.Nothing
    }

-- | The ARN of the client certificate. The certificate must be signed by a
-- certificate authority (CA) and it must be provisioned in Certificate
-- Manager (ACM).
certificateAuthenticationRequest_clientRootCertificateChainArn :: Lens.Lens' CertificateAuthenticationRequest (Prelude.Maybe Prelude.Text)
certificateAuthenticationRequest_clientRootCertificateChainArn :: Lens' CertificateAuthenticationRequest (Maybe Text)
certificateAuthenticationRequest_clientRootCertificateChainArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CertificateAuthenticationRequest' {Maybe Text
clientRootCertificateChainArn :: Maybe Text
$sel:clientRootCertificateChainArn:CertificateAuthenticationRequest' :: CertificateAuthenticationRequest -> Maybe Text
clientRootCertificateChainArn} -> Maybe Text
clientRootCertificateChainArn) (\s :: CertificateAuthenticationRequest
s@CertificateAuthenticationRequest' {} Maybe Text
a -> CertificateAuthenticationRequest
s {$sel:clientRootCertificateChainArn:CertificateAuthenticationRequest' :: Maybe Text
clientRootCertificateChainArn = Maybe Text
a} :: CertificateAuthenticationRequest)

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

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

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