{-# 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.Lambda.Types.AliasConfiguration where
import qualified Amazonka.Core as Core
import Amazonka.Lambda.Types.AliasRoutingConfiguration
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data AliasConfiguration = AliasConfiguration'
{
AliasConfiguration -> Maybe AliasRoutingConfiguration
routingConfig :: Prelude.Maybe AliasRoutingConfiguration,
AliasConfiguration -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
AliasConfiguration -> Maybe Text
functionVersion :: Prelude.Maybe Prelude.Text,
AliasConfiguration -> Maybe Text
aliasArn :: Prelude.Maybe Prelude.Text,
AliasConfiguration -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
AliasConfiguration -> Maybe Text
revisionId :: Prelude.Maybe Prelude.Text
}
deriving (AliasConfiguration -> AliasConfiguration -> Bool
(AliasConfiguration -> AliasConfiguration -> Bool)
-> (AliasConfiguration -> AliasConfiguration -> Bool)
-> Eq AliasConfiguration
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AliasConfiguration -> AliasConfiguration -> Bool
$c/= :: AliasConfiguration -> AliasConfiguration -> Bool
== :: AliasConfiguration -> AliasConfiguration -> Bool
$c== :: AliasConfiguration -> AliasConfiguration -> Bool
Prelude.Eq, ReadPrec [AliasConfiguration]
ReadPrec AliasConfiguration
Int -> ReadS AliasConfiguration
ReadS [AliasConfiguration]
(Int -> ReadS AliasConfiguration)
-> ReadS [AliasConfiguration]
-> ReadPrec AliasConfiguration
-> ReadPrec [AliasConfiguration]
-> Read AliasConfiguration
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AliasConfiguration]
$creadListPrec :: ReadPrec [AliasConfiguration]
readPrec :: ReadPrec AliasConfiguration
$creadPrec :: ReadPrec AliasConfiguration
readList :: ReadS [AliasConfiguration]
$creadList :: ReadS [AliasConfiguration]
readsPrec :: Int -> ReadS AliasConfiguration
$creadsPrec :: Int -> ReadS AliasConfiguration
Prelude.Read, Int -> AliasConfiguration -> ShowS
[AliasConfiguration] -> ShowS
AliasConfiguration -> String
(Int -> AliasConfiguration -> ShowS)
-> (AliasConfiguration -> String)
-> ([AliasConfiguration] -> ShowS)
-> Show AliasConfiguration
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AliasConfiguration] -> ShowS
$cshowList :: [AliasConfiguration] -> ShowS
show :: AliasConfiguration -> String
$cshow :: AliasConfiguration -> String
showsPrec :: Int -> AliasConfiguration -> ShowS
$cshowsPrec :: Int -> AliasConfiguration -> ShowS
Prelude.Show, (forall x. AliasConfiguration -> Rep AliasConfiguration x)
-> (forall x. Rep AliasConfiguration x -> AliasConfiguration)
-> Generic AliasConfiguration
forall x. Rep AliasConfiguration x -> AliasConfiguration
forall x. AliasConfiguration -> Rep AliasConfiguration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep AliasConfiguration x -> AliasConfiguration
$cfrom :: forall x. AliasConfiguration -> Rep AliasConfiguration x
Prelude.Generic)
newAliasConfiguration ::
AliasConfiguration
newAliasConfiguration :: AliasConfiguration
newAliasConfiguration =
AliasConfiguration' :: Maybe AliasRoutingConfiguration
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> AliasConfiguration
AliasConfiguration'
{ $sel:routingConfig:AliasConfiguration' :: Maybe AliasRoutingConfiguration
routingConfig =
Maybe AliasRoutingConfiguration
forall a. Maybe a
Prelude.Nothing,
$sel:name:AliasConfiguration' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:functionVersion:AliasConfiguration' :: Maybe Text
functionVersion = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:aliasArn:AliasConfiguration' :: Maybe Text
aliasArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:description:AliasConfiguration' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:revisionId:AliasConfiguration' :: Maybe Text
revisionId = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
aliasConfiguration_routingConfig :: Lens.Lens' AliasConfiguration (Prelude.Maybe AliasRoutingConfiguration)
aliasConfiguration_routingConfig :: (Maybe AliasRoutingConfiguration
-> f (Maybe AliasRoutingConfiguration))
-> AliasConfiguration -> f AliasConfiguration
aliasConfiguration_routingConfig = (AliasConfiguration -> Maybe AliasRoutingConfiguration)
-> (AliasConfiguration
-> Maybe AliasRoutingConfiguration -> AliasConfiguration)
-> Lens
AliasConfiguration
AliasConfiguration
(Maybe AliasRoutingConfiguration)
(Maybe AliasRoutingConfiguration)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AliasConfiguration' {Maybe AliasRoutingConfiguration
routingConfig :: Maybe AliasRoutingConfiguration
$sel:routingConfig:AliasConfiguration' :: AliasConfiguration -> Maybe AliasRoutingConfiguration
routingConfig} -> Maybe AliasRoutingConfiguration
routingConfig) (\s :: AliasConfiguration
s@AliasConfiguration' {} Maybe AliasRoutingConfiguration
a -> AliasConfiguration
s {$sel:routingConfig:AliasConfiguration' :: Maybe AliasRoutingConfiguration
routingConfig = Maybe AliasRoutingConfiguration
a} :: AliasConfiguration)
aliasConfiguration_name :: Lens.Lens' AliasConfiguration (Prelude.Maybe Prelude.Text)
aliasConfiguration_name :: (Maybe Text -> f (Maybe Text))
-> AliasConfiguration -> f AliasConfiguration
aliasConfiguration_name = (AliasConfiguration -> Maybe Text)
-> (AliasConfiguration -> Maybe Text -> AliasConfiguration)
-> Lens
AliasConfiguration AliasConfiguration (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AliasConfiguration' {Maybe Text
name :: Maybe Text
$sel:name:AliasConfiguration' :: AliasConfiguration -> Maybe Text
name} -> Maybe Text
name) (\s :: AliasConfiguration
s@AliasConfiguration' {} Maybe Text
a -> AliasConfiguration
s {$sel:name:AliasConfiguration' :: Maybe Text
name = Maybe Text
a} :: AliasConfiguration)
aliasConfiguration_functionVersion :: Lens.Lens' AliasConfiguration (Prelude.Maybe Prelude.Text)
aliasConfiguration_functionVersion :: (Maybe Text -> f (Maybe Text))
-> AliasConfiguration -> f AliasConfiguration
aliasConfiguration_functionVersion = (AliasConfiguration -> Maybe Text)
-> (AliasConfiguration -> Maybe Text -> AliasConfiguration)
-> Lens
AliasConfiguration AliasConfiguration (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AliasConfiguration' {Maybe Text
functionVersion :: Maybe Text
$sel:functionVersion:AliasConfiguration' :: AliasConfiguration -> Maybe Text
functionVersion} -> Maybe Text
functionVersion) (\s :: AliasConfiguration
s@AliasConfiguration' {} Maybe Text
a -> AliasConfiguration
s {$sel:functionVersion:AliasConfiguration' :: Maybe Text
functionVersion = Maybe Text
a} :: AliasConfiguration)
aliasConfiguration_aliasArn :: Lens.Lens' AliasConfiguration (Prelude.Maybe Prelude.Text)
aliasConfiguration_aliasArn :: (Maybe Text -> f (Maybe Text))
-> AliasConfiguration -> f AliasConfiguration
aliasConfiguration_aliasArn = (AliasConfiguration -> Maybe Text)
-> (AliasConfiguration -> Maybe Text -> AliasConfiguration)
-> Lens
AliasConfiguration AliasConfiguration (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AliasConfiguration' {Maybe Text
aliasArn :: Maybe Text
$sel:aliasArn:AliasConfiguration' :: AliasConfiguration -> Maybe Text
aliasArn} -> Maybe Text
aliasArn) (\s :: AliasConfiguration
s@AliasConfiguration' {} Maybe Text
a -> AliasConfiguration
s {$sel:aliasArn:AliasConfiguration' :: Maybe Text
aliasArn = Maybe Text
a} :: AliasConfiguration)
aliasConfiguration_description :: Lens.Lens' AliasConfiguration (Prelude.Maybe Prelude.Text)
aliasConfiguration_description :: (Maybe Text -> f (Maybe Text))
-> AliasConfiguration -> f AliasConfiguration
aliasConfiguration_description = (AliasConfiguration -> Maybe Text)
-> (AliasConfiguration -> Maybe Text -> AliasConfiguration)
-> Lens
AliasConfiguration AliasConfiguration (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AliasConfiguration' {Maybe Text
description :: Maybe Text
$sel:description:AliasConfiguration' :: AliasConfiguration -> Maybe Text
description} -> Maybe Text
description) (\s :: AliasConfiguration
s@AliasConfiguration' {} Maybe Text
a -> AliasConfiguration
s {$sel:description:AliasConfiguration' :: Maybe Text
description = Maybe Text
a} :: AliasConfiguration)
aliasConfiguration_revisionId :: Lens.Lens' AliasConfiguration (Prelude.Maybe Prelude.Text)
aliasConfiguration_revisionId :: (Maybe Text -> f (Maybe Text))
-> AliasConfiguration -> f AliasConfiguration
aliasConfiguration_revisionId = (AliasConfiguration -> Maybe Text)
-> (AliasConfiguration -> Maybe Text -> AliasConfiguration)
-> Lens
AliasConfiguration AliasConfiguration (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AliasConfiguration' {Maybe Text
revisionId :: Maybe Text
$sel:revisionId:AliasConfiguration' :: AliasConfiguration -> Maybe Text
revisionId} -> Maybe Text
revisionId) (\s :: AliasConfiguration
s@AliasConfiguration' {} Maybe Text
a -> AliasConfiguration
s {$sel:revisionId:AliasConfiguration' :: Maybe Text
revisionId = Maybe Text
a} :: AliasConfiguration)
instance Core.FromJSON AliasConfiguration where
parseJSON :: Value -> Parser AliasConfiguration
parseJSON =
String
-> (Object -> Parser AliasConfiguration)
-> Value
-> Parser AliasConfiguration
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"AliasConfiguration"
( \Object
x ->
Maybe AliasRoutingConfiguration
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> AliasConfiguration
AliasConfiguration'
(Maybe AliasRoutingConfiguration
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> AliasConfiguration)
-> Parser (Maybe AliasRoutingConfiguration)
-> Parser
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> AliasConfiguration)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe AliasRoutingConfiguration)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"RoutingConfig")
Parser
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> AliasConfiguration)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Maybe Text -> Maybe Text -> Maybe Text -> AliasConfiguration)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Name")
Parser
(Maybe Text
-> Maybe Text -> Maybe Text -> Maybe Text -> AliasConfiguration)
-> Parser (Maybe Text)
-> Parser
(Maybe Text -> Maybe Text -> Maybe Text -> AliasConfiguration)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"FunctionVersion")
Parser
(Maybe Text -> Maybe Text -> Maybe Text -> AliasConfiguration)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe Text -> AliasConfiguration)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"AliasArn")
Parser (Maybe Text -> Maybe Text -> AliasConfiguration)
-> Parser (Maybe Text) -> Parser (Maybe Text -> AliasConfiguration)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Description")
Parser (Maybe Text -> AliasConfiguration)
-> Parser (Maybe Text) -> Parser AliasConfiguration
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"RevisionId")
)
instance Prelude.Hashable AliasConfiguration
instance Prelude.NFData AliasConfiguration