{-# 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.VirtualGatewayClientPolicyTls where
import Amazonka.AppMesh.Types.VirtualGatewayClientTlsCertificate
import Amazonka.AppMesh.Types.VirtualGatewayTlsValidationContext
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data VirtualGatewayClientPolicyTls = VirtualGatewayClientPolicyTls'
{
VirtualGatewayClientPolicyTls -> Maybe [Natural]
ports :: Prelude.Maybe [Prelude.Natural],
VirtualGatewayClientPolicyTls
-> Maybe VirtualGatewayClientTlsCertificate
certificate :: Prelude.Maybe VirtualGatewayClientTlsCertificate,
VirtualGatewayClientPolicyTls -> Maybe Bool
enforce :: Prelude.Maybe Prelude.Bool,
VirtualGatewayClientPolicyTls -> VirtualGatewayTlsValidationContext
validation :: VirtualGatewayTlsValidationContext
}
deriving (VirtualGatewayClientPolicyTls
-> VirtualGatewayClientPolicyTls -> Bool
(VirtualGatewayClientPolicyTls
-> VirtualGatewayClientPolicyTls -> Bool)
-> (VirtualGatewayClientPolicyTls
-> VirtualGatewayClientPolicyTls -> Bool)
-> Eq VirtualGatewayClientPolicyTls
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: VirtualGatewayClientPolicyTls
-> VirtualGatewayClientPolicyTls -> Bool
$c/= :: VirtualGatewayClientPolicyTls
-> VirtualGatewayClientPolicyTls -> Bool
== :: VirtualGatewayClientPolicyTls
-> VirtualGatewayClientPolicyTls -> Bool
$c== :: VirtualGatewayClientPolicyTls
-> VirtualGatewayClientPolicyTls -> Bool
Prelude.Eq, ReadPrec [VirtualGatewayClientPolicyTls]
ReadPrec VirtualGatewayClientPolicyTls
Int -> ReadS VirtualGatewayClientPolicyTls
ReadS [VirtualGatewayClientPolicyTls]
(Int -> ReadS VirtualGatewayClientPolicyTls)
-> ReadS [VirtualGatewayClientPolicyTls]
-> ReadPrec VirtualGatewayClientPolicyTls
-> ReadPrec [VirtualGatewayClientPolicyTls]
-> Read VirtualGatewayClientPolicyTls
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [VirtualGatewayClientPolicyTls]
$creadListPrec :: ReadPrec [VirtualGatewayClientPolicyTls]
readPrec :: ReadPrec VirtualGatewayClientPolicyTls
$creadPrec :: ReadPrec VirtualGatewayClientPolicyTls
readList :: ReadS [VirtualGatewayClientPolicyTls]
$creadList :: ReadS [VirtualGatewayClientPolicyTls]
readsPrec :: Int -> ReadS VirtualGatewayClientPolicyTls
$creadsPrec :: Int -> ReadS VirtualGatewayClientPolicyTls
Prelude.Read, Int -> VirtualGatewayClientPolicyTls -> ShowS
[VirtualGatewayClientPolicyTls] -> ShowS
VirtualGatewayClientPolicyTls -> String
(Int -> VirtualGatewayClientPolicyTls -> ShowS)
-> (VirtualGatewayClientPolicyTls -> String)
-> ([VirtualGatewayClientPolicyTls] -> ShowS)
-> Show VirtualGatewayClientPolicyTls
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [VirtualGatewayClientPolicyTls] -> ShowS
$cshowList :: [VirtualGatewayClientPolicyTls] -> ShowS
show :: VirtualGatewayClientPolicyTls -> String
$cshow :: VirtualGatewayClientPolicyTls -> String
showsPrec :: Int -> VirtualGatewayClientPolicyTls -> ShowS
$cshowsPrec :: Int -> VirtualGatewayClientPolicyTls -> ShowS
Prelude.Show, (forall x.
VirtualGatewayClientPolicyTls
-> Rep VirtualGatewayClientPolicyTls x)
-> (forall x.
Rep VirtualGatewayClientPolicyTls x
-> VirtualGatewayClientPolicyTls)
-> Generic VirtualGatewayClientPolicyTls
forall x.
Rep VirtualGatewayClientPolicyTls x
-> VirtualGatewayClientPolicyTls
forall x.
VirtualGatewayClientPolicyTls
-> Rep VirtualGatewayClientPolicyTls x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep VirtualGatewayClientPolicyTls x
-> VirtualGatewayClientPolicyTls
$cfrom :: forall x.
VirtualGatewayClientPolicyTls
-> Rep VirtualGatewayClientPolicyTls x
Prelude.Generic)
newVirtualGatewayClientPolicyTls ::
VirtualGatewayTlsValidationContext ->
VirtualGatewayClientPolicyTls
newVirtualGatewayClientPolicyTls :: VirtualGatewayTlsValidationContext -> VirtualGatewayClientPolicyTls
newVirtualGatewayClientPolicyTls VirtualGatewayTlsValidationContext
pValidation_ =
VirtualGatewayClientPolicyTls' :: Maybe [Natural]
-> Maybe VirtualGatewayClientTlsCertificate
-> Maybe Bool
-> VirtualGatewayTlsValidationContext
-> VirtualGatewayClientPolicyTls
VirtualGatewayClientPolicyTls'
{ $sel:ports:VirtualGatewayClientPolicyTls' :: Maybe [Natural]
ports =
Maybe [Natural]
forall a. Maybe a
Prelude.Nothing,
$sel:certificate:VirtualGatewayClientPolicyTls' :: Maybe VirtualGatewayClientTlsCertificate
certificate = Maybe VirtualGatewayClientTlsCertificate
forall a. Maybe a
Prelude.Nothing,
$sel:enforce:VirtualGatewayClientPolicyTls' :: Maybe Bool
enforce = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
$sel:validation:VirtualGatewayClientPolicyTls' :: VirtualGatewayTlsValidationContext
validation = VirtualGatewayTlsValidationContext
pValidation_
}
virtualGatewayClientPolicyTls_ports :: Lens.Lens' VirtualGatewayClientPolicyTls (Prelude.Maybe [Prelude.Natural])
virtualGatewayClientPolicyTls_ports :: (Maybe [Natural] -> f (Maybe [Natural]))
-> VirtualGatewayClientPolicyTls -> f VirtualGatewayClientPolicyTls
virtualGatewayClientPolicyTls_ports = (VirtualGatewayClientPolicyTls -> Maybe [Natural])
-> (VirtualGatewayClientPolicyTls
-> Maybe [Natural] -> VirtualGatewayClientPolicyTls)
-> Lens
VirtualGatewayClientPolicyTls
VirtualGatewayClientPolicyTls
(Maybe [Natural])
(Maybe [Natural])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VirtualGatewayClientPolicyTls' {Maybe [Natural]
ports :: Maybe [Natural]
$sel:ports:VirtualGatewayClientPolicyTls' :: VirtualGatewayClientPolicyTls -> Maybe [Natural]
ports} -> Maybe [Natural]
ports) (\s :: VirtualGatewayClientPolicyTls
s@VirtualGatewayClientPolicyTls' {} Maybe [Natural]
a -> VirtualGatewayClientPolicyTls
s {$sel:ports:VirtualGatewayClientPolicyTls' :: Maybe [Natural]
ports = Maybe [Natural]
a} :: VirtualGatewayClientPolicyTls) ((Maybe [Natural] -> f (Maybe [Natural]))
-> VirtualGatewayClientPolicyTls
-> f VirtualGatewayClientPolicyTls)
-> ((Maybe [Natural] -> f (Maybe [Natural]))
-> Maybe [Natural] -> f (Maybe [Natural]))
-> (Maybe [Natural] -> f (Maybe [Natural]))
-> VirtualGatewayClientPolicyTls
-> f VirtualGatewayClientPolicyTls
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Natural] [Natural] [Natural] [Natural]
-> Iso
(Maybe [Natural])
(Maybe [Natural])
(Maybe [Natural])
(Maybe [Natural])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso [Natural] [Natural] [Natural] [Natural]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
virtualGatewayClientPolicyTls_certificate :: Lens.Lens' VirtualGatewayClientPolicyTls (Prelude.Maybe VirtualGatewayClientTlsCertificate)
virtualGatewayClientPolicyTls_certificate :: (Maybe VirtualGatewayClientTlsCertificate
-> f (Maybe VirtualGatewayClientTlsCertificate))
-> VirtualGatewayClientPolicyTls -> f VirtualGatewayClientPolicyTls
virtualGatewayClientPolicyTls_certificate = (VirtualGatewayClientPolicyTls
-> Maybe VirtualGatewayClientTlsCertificate)
-> (VirtualGatewayClientPolicyTls
-> Maybe VirtualGatewayClientTlsCertificate
-> VirtualGatewayClientPolicyTls)
-> Lens
VirtualGatewayClientPolicyTls
VirtualGatewayClientPolicyTls
(Maybe VirtualGatewayClientTlsCertificate)
(Maybe VirtualGatewayClientTlsCertificate)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VirtualGatewayClientPolicyTls' {Maybe VirtualGatewayClientTlsCertificate
certificate :: Maybe VirtualGatewayClientTlsCertificate
$sel:certificate:VirtualGatewayClientPolicyTls' :: VirtualGatewayClientPolicyTls
-> Maybe VirtualGatewayClientTlsCertificate
certificate} -> Maybe VirtualGatewayClientTlsCertificate
certificate) (\s :: VirtualGatewayClientPolicyTls
s@VirtualGatewayClientPolicyTls' {} Maybe VirtualGatewayClientTlsCertificate
a -> VirtualGatewayClientPolicyTls
s {$sel:certificate:VirtualGatewayClientPolicyTls' :: Maybe VirtualGatewayClientTlsCertificate
certificate = Maybe VirtualGatewayClientTlsCertificate
a} :: VirtualGatewayClientPolicyTls)
virtualGatewayClientPolicyTls_enforce :: Lens.Lens' VirtualGatewayClientPolicyTls (Prelude.Maybe Prelude.Bool)
virtualGatewayClientPolicyTls_enforce :: (Maybe Bool -> f (Maybe Bool))
-> VirtualGatewayClientPolicyTls -> f VirtualGatewayClientPolicyTls
virtualGatewayClientPolicyTls_enforce = (VirtualGatewayClientPolicyTls -> Maybe Bool)
-> (VirtualGatewayClientPolicyTls
-> Maybe Bool -> VirtualGatewayClientPolicyTls)
-> Lens
VirtualGatewayClientPolicyTls
VirtualGatewayClientPolicyTls
(Maybe Bool)
(Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VirtualGatewayClientPolicyTls' {Maybe Bool
enforce :: Maybe Bool
$sel:enforce:VirtualGatewayClientPolicyTls' :: VirtualGatewayClientPolicyTls -> Maybe Bool
enforce} -> Maybe Bool
enforce) (\s :: VirtualGatewayClientPolicyTls
s@VirtualGatewayClientPolicyTls' {} Maybe Bool
a -> VirtualGatewayClientPolicyTls
s {$sel:enforce:VirtualGatewayClientPolicyTls' :: Maybe Bool
enforce = Maybe Bool
a} :: VirtualGatewayClientPolicyTls)
virtualGatewayClientPolicyTls_validation :: Lens.Lens' VirtualGatewayClientPolicyTls VirtualGatewayTlsValidationContext
virtualGatewayClientPolicyTls_validation :: (VirtualGatewayTlsValidationContext
-> f VirtualGatewayTlsValidationContext)
-> VirtualGatewayClientPolicyTls -> f VirtualGatewayClientPolicyTls
virtualGatewayClientPolicyTls_validation = (VirtualGatewayClientPolicyTls
-> VirtualGatewayTlsValidationContext)
-> (VirtualGatewayClientPolicyTls
-> VirtualGatewayTlsValidationContext
-> VirtualGatewayClientPolicyTls)
-> Lens
VirtualGatewayClientPolicyTls
VirtualGatewayClientPolicyTls
VirtualGatewayTlsValidationContext
VirtualGatewayTlsValidationContext
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VirtualGatewayClientPolicyTls' {VirtualGatewayTlsValidationContext
validation :: VirtualGatewayTlsValidationContext
$sel:validation:VirtualGatewayClientPolicyTls' :: VirtualGatewayClientPolicyTls -> VirtualGatewayTlsValidationContext
validation} -> VirtualGatewayTlsValidationContext
validation) (\s :: VirtualGatewayClientPolicyTls
s@VirtualGatewayClientPolicyTls' {} VirtualGatewayTlsValidationContext
a -> VirtualGatewayClientPolicyTls
s {$sel:validation:VirtualGatewayClientPolicyTls' :: VirtualGatewayTlsValidationContext
validation = VirtualGatewayTlsValidationContext
a} :: VirtualGatewayClientPolicyTls)
instance Core.FromJSON VirtualGatewayClientPolicyTls where
parseJSON :: Value -> Parser VirtualGatewayClientPolicyTls
parseJSON =
String
-> (Object -> Parser VirtualGatewayClientPolicyTls)
-> Value
-> Parser VirtualGatewayClientPolicyTls
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"VirtualGatewayClientPolicyTls"
( \Object
x ->
Maybe [Natural]
-> Maybe VirtualGatewayClientTlsCertificate
-> Maybe Bool
-> VirtualGatewayTlsValidationContext
-> VirtualGatewayClientPolicyTls
VirtualGatewayClientPolicyTls'
(Maybe [Natural]
-> Maybe VirtualGatewayClientTlsCertificate
-> Maybe Bool
-> VirtualGatewayTlsValidationContext
-> VirtualGatewayClientPolicyTls)
-> Parser (Maybe [Natural])
-> Parser
(Maybe VirtualGatewayClientTlsCertificate
-> Maybe Bool
-> VirtualGatewayTlsValidationContext
-> VirtualGatewayClientPolicyTls)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe (Maybe [Natural]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ports" Parser (Maybe (Maybe [Natural]))
-> Maybe [Natural] -> Parser (Maybe [Natural])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [Natural]
forall a. Monoid a => a
Prelude.mempty)
Parser
(Maybe VirtualGatewayClientTlsCertificate
-> Maybe Bool
-> VirtualGatewayTlsValidationContext
-> VirtualGatewayClientPolicyTls)
-> Parser (Maybe VirtualGatewayClientTlsCertificate)
-> Parser
(Maybe Bool
-> VirtualGatewayTlsValidationContext
-> VirtualGatewayClientPolicyTls)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe VirtualGatewayClientTlsCertificate)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"certificate")
Parser
(Maybe Bool
-> VirtualGatewayTlsValidationContext
-> VirtualGatewayClientPolicyTls)
-> Parser (Maybe Bool)
-> Parser
(VirtualGatewayTlsValidationContext
-> VirtualGatewayClientPolicyTls)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"enforce")
Parser
(VirtualGatewayTlsValidationContext
-> VirtualGatewayClientPolicyTls)
-> Parser VirtualGatewayTlsValidationContext
-> Parser VirtualGatewayClientPolicyTls
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser VirtualGatewayTlsValidationContext
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"validation")
)
instance
Prelude.Hashable
VirtualGatewayClientPolicyTls
instance Prelude.NFData VirtualGatewayClientPolicyTls
instance Core.ToJSON VirtualGatewayClientPolicyTls where
toJSON :: VirtualGatewayClientPolicyTls -> Value
toJSON VirtualGatewayClientPolicyTls' {Maybe Bool
Maybe [Natural]
Maybe VirtualGatewayClientTlsCertificate
VirtualGatewayTlsValidationContext
validation :: VirtualGatewayTlsValidationContext
enforce :: Maybe Bool
certificate :: Maybe VirtualGatewayClientTlsCertificate
ports :: Maybe [Natural]
$sel:validation:VirtualGatewayClientPolicyTls' :: VirtualGatewayClientPolicyTls -> VirtualGatewayTlsValidationContext
$sel:enforce:VirtualGatewayClientPolicyTls' :: VirtualGatewayClientPolicyTls -> Maybe Bool
$sel:certificate:VirtualGatewayClientPolicyTls' :: VirtualGatewayClientPolicyTls
-> Maybe VirtualGatewayClientTlsCertificate
$sel:ports:VirtualGatewayClientPolicyTls' :: VirtualGatewayClientPolicyTls -> Maybe [Natural]
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"ports" Text -> [Natural] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) ([Natural] -> Pair) -> Maybe [Natural] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Natural]
ports,
(Text
"certificate" Text -> VirtualGatewayClientTlsCertificate -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (VirtualGatewayClientTlsCertificate -> Pair)
-> Maybe VirtualGatewayClientTlsCertificate -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe VirtualGatewayClientTlsCertificate
certificate,
(Text
"enforce" Text -> Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Bool -> Pair) -> Maybe Bool -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
enforce,
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"validation" Text -> VirtualGatewayTlsValidationContext -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= VirtualGatewayTlsValidationContext
validation)
]
)