{-# 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 #-}
module Amazonka.AppMesh.Types.ListenerTlsFileCertificate 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
data ListenerTlsFileCertificate = ListenerTlsFileCertificate'
{
ListenerTlsFileCertificate -> Text
certificateChain :: Prelude.Text,
ListenerTlsFileCertificate -> Text
privateKey :: Prelude.Text
}
deriving (ListenerTlsFileCertificate -> ListenerTlsFileCertificate -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListenerTlsFileCertificate -> ListenerTlsFileCertificate -> Bool
$c/= :: ListenerTlsFileCertificate -> ListenerTlsFileCertificate -> Bool
== :: ListenerTlsFileCertificate -> ListenerTlsFileCertificate -> Bool
$c== :: ListenerTlsFileCertificate -> ListenerTlsFileCertificate -> Bool
Prelude.Eq, ReadPrec [ListenerTlsFileCertificate]
ReadPrec ListenerTlsFileCertificate
Int -> ReadS ListenerTlsFileCertificate
ReadS [ListenerTlsFileCertificate]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListenerTlsFileCertificate]
$creadListPrec :: ReadPrec [ListenerTlsFileCertificate]
readPrec :: ReadPrec ListenerTlsFileCertificate
$creadPrec :: ReadPrec ListenerTlsFileCertificate
readList :: ReadS [ListenerTlsFileCertificate]
$creadList :: ReadS [ListenerTlsFileCertificate]
readsPrec :: Int -> ReadS ListenerTlsFileCertificate
$creadsPrec :: Int -> ReadS ListenerTlsFileCertificate
Prelude.Read, Int -> ListenerTlsFileCertificate -> ShowS
[ListenerTlsFileCertificate] -> ShowS
ListenerTlsFileCertificate -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListenerTlsFileCertificate] -> ShowS
$cshowList :: [ListenerTlsFileCertificate] -> ShowS
show :: ListenerTlsFileCertificate -> String
$cshow :: ListenerTlsFileCertificate -> String
showsPrec :: Int -> ListenerTlsFileCertificate -> ShowS
$cshowsPrec :: Int -> ListenerTlsFileCertificate -> ShowS
Prelude.Show, forall x.
Rep ListenerTlsFileCertificate x -> ListenerTlsFileCertificate
forall x.
ListenerTlsFileCertificate -> Rep ListenerTlsFileCertificate x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListenerTlsFileCertificate x -> ListenerTlsFileCertificate
$cfrom :: forall x.
ListenerTlsFileCertificate -> Rep ListenerTlsFileCertificate x
Prelude.Generic)
newListenerTlsFileCertificate ::
Prelude.Text ->
Prelude.Text ->
ListenerTlsFileCertificate
newListenerTlsFileCertificate :: Text -> Text -> ListenerTlsFileCertificate
newListenerTlsFileCertificate
Text
pCertificateChain_
Text
pPrivateKey_ =
ListenerTlsFileCertificate'
{ $sel:certificateChain:ListenerTlsFileCertificate' :: Text
certificateChain =
Text
pCertificateChain_,
$sel:privateKey:ListenerTlsFileCertificate' :: Text
privateKey = Text
pPrivateKey_
}
listenerTlsFileCertificate_certificateChain :: Lens.Lens' ListenerTlsFileCertificate Prelude.Text
listenerTlsFileCertificate_certificateChain :: Lens' ListenerTlsFileCertificate Text
listenerTlsFileCertificate_certificateChain = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListenerTlsFileCertificate' {Text
certificateChain :: Text
$sel:certificateChain:ListenerTlsFileCertificate' :: ListenerTlsFileCertificate -> Text
certificateChain} -> Text
certificateChain) (\s :: ListenerTlsFileCertificate
s@ListenerTlsFileCertificate' {} Text
a -> ListenerTlsFileCertificate
s {$sel:certificateChain:ListenerTlsFileCertificate' :: Text
certificateChain = Text
a} :: ListenerTlsFileCertificate)
listenerTlsFileCertificate_privateKey :: Lens.Lens' ListenerTlsFileCertificate Prelude.Text
listenerTlsFileCertificate_privateKey :: Lens' ListenerTlsFileCertificate Text
listenerTlsFileCertificate_privateKey = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListenerTlsFileCertificate' {Text
privateKey :: Text
$sel:privateKey:ListenerTlsFileCertificate' :: ListenerTlsFileCertificate -> Text
privateKey} -> Text
privateKey) (\s :: ListenerTlsFileCertificate
s@ListenerTlsFileCertificate' {} Text
a -> ListenerTlsFileCertificate
s {$sel:privateKey:ListenerTlsFileCertificate' :: Text
privateKey = Text
a} :: ListenerTlsFileCertificate)
instance Data.FromJSON ListenerTlsFileCertificate where
parseJSON :: Value -> Parser ListenerTlsFileCertificate
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"ListenerTlsFileCertificate"
( \Object
x ->
Text -> Text -> ListenerTlsFileCertificate
ListenerTlsFileCertificate'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"certificateChain")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"privateKey")
)
instance Prelude.Hashable ListenerTlsFileCertificate where
hashWithSalt :: Int -> ListenerTlsFileCertificate -> Int
hashWithSalt Int
_salt ListenerTlsFileCertificate' {Text
privateKey :: Text
certificateChain :: Text
$sel:privateKey:ListenerTlsFileCertificate' :: ListenerTlsFileCertificate -> Text
$sel:certificateChain:ListenerTlsFileCertificate' :: ListenerTlsFileCertificate -> Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
certificateChain
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
privateKey
instance Prelude.NFData ListenerTlsFileCertificate where
rnf :: ListenerTlsFileCertificate -> ()
rnf ListenerTlsFileCertificate' {Text
privateKey :: Text
certificateChain :: Text
$sel:privateKey:ListenerTlsFileCertificate' :: ListenerTlsFileCertificate -> Text
$sel:certificateChain:ListenerTlsFileCertificate' :: ListenerTlsFileCertificate -> Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Text
certificateChain
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
privateKey
instance Data.ToJSON ListenerTlsFileCertificate where
toJSON :: ListenerTlsFileCertificate -> Value
toJSON ListenerTlsFileCertificate' {Text
privateKey :: Text
certificateChain :: Text
$sel:privateKey:ListenerTlsFileCertificate' :: ListenerTlsFileCertificate -> Text
$sel:certificateChain:ListenerTlsFileCertificate' :: ListenerTlsFileCertificate -> Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ forall a. a -> Maybe a
Prelude.Just
(Key
"certificateChain" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
certificateChain),
forall a. a -> Maybe a
Prelude.Just (Key
"privateKey" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
privateKey)
]
)