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