{-# 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.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data ListenerTlsFileCertificate = ListenerTlsFileCertificate'
{
ListenerTlsFileCertificate -> Text
certificateChain :: Prelude.Text,
ListenerTlsFileCertificate -> Text
privateKey :: Prelude.Text
}
deriving (ListenerTlsFileCertificate -> ListenerTlsFileCertificate -> Bool
(ListenerTlsFileCertificate -> ListenerTlsFileCertificate -> Bool)
-> (ListenerTlsFileCertificate
-> ListenerTlsFileCertificate -> Bool)
-> Eq ListenerTlsFileCertificate
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]
(Int -> ReadS ListenerTlsFileCertificate)
-> ReadS [ListenerTlsFileCertificate]
-> ReadPrec ListenerTlsFileCertificate
-> ReadPrec [ListenerTlsFileCertificate]
-> Read 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
(Int -> ListenerTlsFileCertificate -> ShowS)
-> (ListenerTlsFileCertificate -> String)
-> ([ListenerTlsFileCertificate] -> ShowS)
-> Show ListenerTlsFileCertificate
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.
ListenerTlsFileCertificate -> Rep ListenerTlsFileCertificate x)
-> (forall x.
Rep ListenerTlsFileCertificate x -> ListenerTlsFileCertificate)
-> Generic ListenerTlsFileCertificate
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' :: Text -> Text -> ListenerTlsFileCertificate
ListenerTlsFileCertificate'
{ $sel:certificateChain:ListenerTlsFileCertificate' :: Text
certificateChain =
Text
pCertificateChain_,
$sel:privateKey:ListenerTlsFileCertificate' :: Text
privateKey = Text
pPrivateKey_
}
listenerTlsFileCertificate_certificateChain :: Lens.Lens' ListenerTlsFileCertificate Prelude.Text
listenerTlsFileCertificate_certificateChain :: (Text -> f Text)
-> ListenerTlsFileCertificate -> f ListenerTlsFileCertificate
listenerTlsFileCertificate_certificateChain = (ListenerTlsFileCertificate -> Text)
-> (ListenerTlsFileCertificate
-> Text -> ListenerTlsFileCertificate)
-> Lens
ListenerTlsFileCertificate ListenerTlsFileCertificate Text Text
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 :: (Text -> f Text)
-> ListenerTlsFileCertificate -> f ListenerTlsFileCertificate
listenerTlsFileCertificate_privateKey = (ListenerTlsFileCertificate -> Text)
-> (ListenerTlsFileCertificate
-> Text -> ListenerTlsFileCertificate)
-> Lens
ListenerTlsFileCertificate ListenerTlsFileCertificate Text Text
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 Core.FromJSON ListenerTlsFileCertificate where
parseJSON :: Value -> Parser ListenerTlsFileCertificate
parseJSON =
String
-> (Object -> Parser ListenerTlsFileCertificate)
-> Value
-> Parser ListenerTlsFileCertificate
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"ListenerTlsFileCertificate"
( \Object
x ->
Text -> Text -> ListenerTlsFileCertificate
ListenerTlsFileCertificate'
(Text -> Text -> ListenerTlsFileCertificate)
-> Parser Text -> Parser (Text -> ListenerTlsFileCertificate)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"certificateChain")
Parser (Text -> ListenerTlsFileCertificate)
-> Parser Text -> Parser ListenerTlsFileCertificate
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"privateKey")
)
instance Prelude.Hashable ListenerTlsFileCertificate
instance Prelude.NFData ListenerTlsFileCertificate
instance Core.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
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
(Text
"certificateChain" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
certificateChain),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"privateKey" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
privateKey)
]
)