{-# 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.TlsValidationContextTrust where
import Amazonka.AppMesh.Types.TlsValidationContextAcmTrust
import Amazonka.AppMesh.Types.TlsValidationContextFileTrust
import Amazonka.AppMesh.Types.TlsValidationContextSdsTrust
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data TlsValidationContextTrust = TlsValidationContextTrust'
{
TlsValidationContextTrust -> Maybe TlsValidationContextAcmTrust
acm :: Prelude.Maybe TlsValidationContextAcmTrust,
TlsValidationContextTrust -> Maybe TlsValidationContextSdsTrust
sds :: Prelude.Maybe TlsValidationContextSdsTrust,
TlsValidationContextTrust -> Maybe TlsValidationContextFileTrust
file :: Prelude.Maybe TlsValidationContextFileTrust
}
deriving (TlsValidationContextTrust -> TlsValidationContextTrust -> Bool
(TlsValidationContextTrust -> TlsValidationContextTrust -> Bool)
-> (TlsValidationContextTrust -> TlsValidationContextTrust -> Bool)
-> Eq TlsValidationContextTrust
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: TlsValidationContextTrust -> TlsValidationContextTrust -> Bool
$c/= :: TlsValidationContextTrust -> TlsValidationContextTrust -> Bool
== :: TlsValidationContextTrust -> TlsValidationContextTrust -> Bool
$c== :: TlsValidationContextTrust -> TlsValidationContextTrust -> Bool
Prelude.Eq, ReadPrec [TlsValidationContextTrust]
ReadPrec TlsValidationContextTrust
Int -> ReadS TlsValidationContextTrust
ReadS [TlsValidationContextTrust]
(Int -> ReadS TlsValidationContextTrust)
-> ReadS [TlsValidationContextTrust]
-> ReadPrec TlsValidationContextTrust
-> ReadPrec [TlsValidationContextTrust]
-> Read TlsValidationContextTrust
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [TlsValidationContextTrust]
$creadListPrec :: ReadPrec [TlsValidationContextTrust]
readPrec :: ReadPrec TlsValidationContextTrust
$creadPrec :: ReadPrec TlsValidationContextTrust
readList :: ReadS [TlsValidationContextTrust]
$creadList :: ReadS [TlsValidationContextTrust]
readsPrec :: Int -> ReadS TlsValidationContextTrust
$creadsPrec :: Int -> ReadS TlsValidationContextTrust
Prelude.Read, Int -> TlsValidationContextTrust -> ShowS
[TlsValidationContextTrust] -> ShowS
TlsValidationContextTrust -> String
(Int -> TlsValidationContextTrust -> ShowS)
-> (TlsValidationContextTrust -> String)
-> ([TlsValidationContextTrust] -> ShowS)
-> Show TlsValidationContextTrust
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [TlsValidationContextTrust] -> ShowS
$cshowList :: [TlsValidationContextTrust] -> ShowS
show :: TlsValidationContextTrust -> String
$cshow :: TlsValidationContextTrust -> String
showsPrec :: Int -> TlsValidationContextTrust -> ShowS
$cshowsPrec :: Int -> TlsValidationContextTrust -> ShowS
Prelude.Show, (forall x.
TlsValidationContextTrust -> Rep TlsValidationContextTrust x)
-> (forall x.
Rep TlsValidationContextTrust x -> TlsValidationContextTrust)
-> Generic TlsValidationContextTrust
forall x.
Rep TlsValidationContextTrust x -> TlsValidationContextTrust
forall x.
TlsValidationContextTrust -> Rep TlsValidationContextTrust x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep TlsValidationContextTrust x -> TlsValidationContextTrust
$cfrom :: forall x.
TlsValidationContextTrust -> Rep TlsValidationContextTrust x
Prelude.Generic)
newTlsValidationContextTrust ::
TlsValidationContextTrust
newTlsValidationContextTrust :: TlsValidationContextTrust
newTlsValidationContextTrust =
TlsValidationContextTrust' :: Maybe TlsValidationContextAcmTrust
-> Maybe TlsValidationContextSdsTrust
-> Maybe TlsValidationContextFileTrust
-> TlsValidationContextTrust
TlsValidationContextTrust'
{ $sel:acm:TlsValidationContextTrust' :: Maybe TlsValidationContextAcmTrust
acm = Maybe TlsValidationContextAcmTrust
forall a. Maybe a
Prelude.Nothing,
$sel:sds:TlsValidationContextTrust' :: Maybe TlsValidationContextSdsTrust
sds = Maybe TlsValidationContextSdsTrust
forall a. Maybe a
Prelude.Nothing,
$sel:file:TlsValidationContextTrust' :: Maybe TlsValidationContextFileTrust
file = Maybe TlsValidationContextFileTrust
forall a. Maybe a
Prelude.Nothing
}
tlsValidationContextTrust_acm :: Lens.Lens' TlsValidationContextTrust (Prelude.Maybe TlsValidationContextAcmTrust)
tlsValidationContextTrust_acm :: (Maybe TlsValidationContextAcmTrust
-> f (Maybe TlsValidationContextAcmTrust))
-> TlsValidationContextTrust -> f TlsValidationContextTrust
tlsValidationContextTrust_acm = (TlsValidationContextTrust -> Maybe TlsValidationContextAcmTrust)
-> (TlsValidationContextTrust
-> Maybe TlsValidationContextAcmTrust -> TlsValidationContextTrust)
-> Lens
TlsValidationContextTrust
TlsValidationContextTrust
(Maybe TlsValidationContextAcmTrust)
(Maybe TlsValidationContextAcmTrust)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TlsValidationContextTrust' {Maybe TlsValidationContextAcmTrust
acm :: Maybe TlsValidationContextAcmTrust
$sel:acm:TlsValidationContextTrust' :: TlsValidationContextTrust -> Maybe TlsValidationContextAcmTrust
acm} -> Maybe TlsValidationContextAcmTrust
acm) (\s :: TlsValidationContextTrust
s@TlsValidationContextTrust' {} Maybe TlsValidationContextAcmTrust
a -> TlsValidationContextTrust
s {$sel:acm:TlsValidationContextTrust' :: Maybe TlsValidationContextAcmTrust
acm = Maybe TlsValidationContextAcmTrust
a} :: TlsValidationContextTrust)
tlsValidationContextTrust_sds :: Lens.Lens' TlsValidationContextTrust (Prelude.Maybe TlsValidationContextSdsTrust)
tlsValidationContextTrust_sds :: (Maybe TlsValidationContextSdsTrust
-> f (Maybe TlsValidationContextSdsTrust))
-> TlsValidationContextTrust -> f TlsValidationContextTrust
tlsValidationContextTrust_sds = (TlsValidationContextTrust -> Maybe TlsValidationContextSdsTrust)
-> (TlsValidationContextTrust
-> Maybe TlsValidationContextSdsTrust -> TlsValidationContextTrust)
-> Lens
TlsValidationContextTrust
TlsValidationContextTrust
(Maybe TlsValidationContextSdsTrust)
(Maybe TlsValidationContextSdsTrust)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TlsValidationContextTrust' {Maybe TlsValidationContextSdsTrust
sds :: Maybe TlsValidationContextSdsTrust
$sel:sds:TlsValidationContextTrust' :: TlsValidationContextTrust -> Maybe TlsValidationContextSdsTrust
sds} -> Maybe TlsValidationContextSdsTrust
sds) (\s :: TlsValidationContextTrust
s@TlsValidationContextTrust' {} Maybe TlsValidationContextSdsTrust
a -> TlsValidationContextTrust
s {$sel:sds:TlsValidationContextTrust' :: Maybe TlsValidationContextSdsTrust
sds = Maybe TlsValidationContextSdsTrust
a} :: TlsValidationContextTrust)
tlsValidationContextTrust_file :: Lens.Lens' TlsValidationContextTrust (Prelude.Maybe TlsValidationContextFileTrust)
tlsValidationContextTrust_file :: (Maybe TlsValidationContextFileTrust
-> f (Maybe TlsValidationContextFileTrust))
-> TlsValidationContextTrust -> f TlsValidationContextTrust
tlsValidationContextTrust_file = (TlsValidationContextTrust -> Maybe TlsValidationContextFileTrust)
-> (TlsValidationContextTrust
-> Maybe TlsValidationContextFileTrust
-> TlsValidationContextTrust)
-> Lens
TlsValidationContextTrust
TlsValidationContextTrust
(Maybe TlsValidationContextFileTrust)
(Maybe TlsValidationContextFileTrust)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TlsValidationContextTrust' {Maybe TlsValidationContextFileTrust
file :: Maybe TlsValidationContextFileTrust
$sel:file:TlsValidationContextTrust' :: TlsValidationContextTrust -> Maybe TlsValidationContextFileTrust
file} -> Maybe TlsValidationContextFileTrust
file) (\s :: TlsValidationContextTrust
s@TlsValidationContextTrust' {} Maybe TlsValidationContextFileTrust
a -> TlsValidationContextTrust
s {$sel:file:TlsValidationContextTrust' :: Maybe TlsValidationContextFileTrust
file = Maybe TlsValidationContextFileTrust
a} :: TlsValidationContextTrust)
instance Core.FromJSON TlsValidationContextTrust where
parseJSON :: Value -> Parser TlsValidationContextTrust
parseJSON =
String
-> (Object -> Parser TlsValidationContextTrust)
-> Value
-> Parser TlsValidationContextTrust
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"TlsValidationContextTrust"
( \Object
x ->
Maybe TlsValidationContextAcmTrust
-> Maybe TlsValidationContextSdsTrust
-> Maybe TlsValidationContextFileTrust
-> TlsValidationContextTrust
TlsValidationContextTrust'
(Maybe TlsValidationContextAcmTrust
-> Maybe TlsValidationContextSdsTrust
-> Maybe TlsValidationContextFileTrust
-> TlsValidationContextTrust)
-> Parser (Maybe TlsValidationContextAcmTrust)
-> Parser
(Maybe TlsValidationContextSdsTrust
-> Maybe TlsValidationContextFileTrust
-> TlsValidationContextTrust)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe TlsValidationContextAcmTrust)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"acm")
Parser
(Maybe TlsValidationContextSdsTrust
-> Maybe TlsValidationContextFileTrust
-> TlsValidationContextTrust)
-> Parser (Maybe TlsValidationContextSdsTrust)
-> Parser
(Maybe TlsValidationContextFileTrust -> TlsValidationContextTrust)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe TlsValidationContextSdsTrust)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"sds")
Parser
(Maybe TlsValidationContextFileTrust -> TlsValidationContextTrust)
-> Parser (Maybe TlsValidationContextFileTrust)
-> Parser TlsValidationContextTrust
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe TlsValidationContextFileTrust)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"file")
)
instance Prelude.Hashable TlsValidationContextTrust
instance Prelude.NFData TlsValidationContextTrust
instance Core.ToJSON TlsValidationContextTrust where
toJSON :: TlsValidationContextTrust -> Value
toJSON TlsValidationContextTrust' {Maybe TlsValidationContextAcmTrust
Maybe TlsValidationContextFileTrust
Maybe TlsValidationContextSdsTrust
file :: Maybe TlsValidationContextFileTrust
sds :: Maybe TlsValidationContextSdsTrust
acm :: Maybe TlsValidationContextAcmTrust
$sel:file:TlsValidationContextTrust' :: TlsValidationContextTrust -> Maybe TlsValidationContextFileTrust
$sel:sds:TlsValidationContextTrust' :: TlsValidationContextTrust -> Maybe TlsValidationContextSdsTrust
$sel:acm:TlsValidationContextTrust' :: TlsValidationContextTrust -> Maybe TlsValidationContextAcmTrust
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"acm" Text -> TlsValidationContextAcmTrust -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (TlsValidationContextAcmTrust -> Pair)
-> Maybe TlsValidationContextAcmTrust -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe TlsValidationContextAcmTrust
acm,
(Text
"sds" Text -> TlsValidationContextSdsTrust -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (TlsValidationContextSdsTrust -> Pair)
-> Maybe TlsValidationContextSdsTrust -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe TlsValidationContextSdsTrust
sds,
(Text
"file" Text -> TlsValidationContextFileTrust -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (TlsValidationContextFileTrust -> Pair)
-> Maybe TlsValidationContextFileTrust -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe TlsValidationContextFileTrust
file
]
)