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