{-# 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.EnvironmentResponse where
import qualified Amazonka.Core as Core
import Amazonka.Lambda.Types.EnvironmentError
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data EnvironmentResponse = EnvironmentResponse'
{
EnvironmentResponse
-> Maybe (Sensitive (HashMap Text (Sensitive Text)))
variables :: Prelude.Maybe (Core.Sensitive (Prelude.HashMap Prelude.Text (Core.Sensitive Prelude.Text))),
EnvironmentResponse -> Maybe EnvironmentError
error :: Prelude.Maybe EnvironmentError
}
deriving (EnvironmentResponse -> EnvironmentResponse -> Bool
(EnvironmentResponse -> EnvironmentResponse -> Bool)
-> (EnvironmentResponse -> EnvironmentResponse -> Bool)
-> Eq EnvironmentResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: EnvironmentResponse -> EnvironmentResponse -> Bool
$c/= :: EnvironmentResponse -> EnvironmentResponse -> Bool
== :: EnvironmentResponse -> EnvironmentResponse -> Bool
$c== :: EnvironmentResponse -> EnvironmentResponse -> Bool
Prelude.Eq, Int -> EnvironmentResponse -> ShowS
[EnvironmentResponse] -> ShowS
EnvironmentResponse -> String
(Int -> EnvironmentResponse -> ShowS)
-> (EnvironmentResponse -> String)
-> ([EnvironmentResponse] -> ShowS)
-> Show EnvironmentResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [EnvironmentResponse] -> ShowS
$cshowList :: [EnvironmentResponse] -> ShowS
show :: EnvironmentResponse -> String
$cshow :: EnvironmentResponse -> String
showsPrec :: Int -> EnvironmentResponse -> ShowS
$cshowsPrec :: Int -> EnvironmentResponse -> ShowS
Prelude.Show, (forall x. EnvironmentResponse -> Rep EnvironmentResponse x)
-> (forall x. Rep EnvironmentResponse x -> EnvironmentResponse)
-> Generic EnvironmentResponse
forall x. Rep EnvironmentResponse x -> EnvironmentResponse
forall x. EnvironmentResponse -> Rep EnvironmentResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep EnvironmentResponse x -> EnvironmentResponse
$cfrom :: forall x. EnvironmentResponse -> Rep EnvironmentResponse x
Prelude.Generic)
newEnvironmentResponse ::
EnvironmentResponse
newEnvironmentResponse :: EnvironmentResponse
newEnvironmentResponse =
EnvironmentResponse' :: Maybe (Sensitive (HashMap Text (Sensitive Text)))
-> Maybe EnvironmentError -> EnvironmentResponse
EnvironmentResponse'
{ $sel:variables:EnvironmentResponse' :: Maybe (Sensitive (HashMap Text (Sensitive Text)))
variables = Maybe (Sensitive (HashMap Text (Sensitive Text)))
forall a. Maybe a
Prelude.Nothing,
$sel:error:EnvironmentResponse' :: Maybe EnvironmentError
error = Maybe EnvironmentError
forall a. Maybe a
Prelude.Nothing
}
environmentResponse_variables :: Lens.Lens' EnvironmentResponse (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
environmentResponse_variables :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> EnvironmentResponse -> f EnvironmentResponse
environmentResponse_variables = (EnvironmentResponse
-> Maybe (Sensitive (HashMap Text (Sensitive Text))))
-> (EnvironmentResponse
-> Maybe (Sensitive (HashMap Text (Sensitive Text)))
-> EnvironmentResponse)
-> Lens
EnvironmentResponse
EnvironmentResponse
(Maybe (Sensitive (HashMap Text (Sensitive Text))))
(Maybe (Sensitive (HashMap Text (Sensitive Text))))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EnvironmentResponse' {Maybe (Sensitive (HashMap Text (Sensitive Text)))
variables :: Maybe (Sensitive (HashMap Text (Sensitive Text)))
$sel:variables:EnvironmentResponse' :: EnvironmentResponse
-> Maybe (Sensitive (HashMap Text (Sensitive Text)))
variables} -> Maybe (Sensitive (HashMap Text (Sensitive Text)))
variables) (\s :: EnvironmentResponse
s@EnvironmentResponse' {} Maybe (Sensitive (HashMap Text (Sensitive Text)))
a -> EnvironmentResponse
s {$sel:variables:EnvironmentResponse' :: Maybe (Sensitive (HashMap Text (Sensitive Text)))
variables = Maybe (Sensitive (HashMap Text (Sensitive Text)))
a} :: EnvironmentResponse) ((Maybe (Sensitive (HashMap Text (Sensitive Text)))
-> f (Maybe (Sensitive (HashMap Text (Sensitive Text)))))
-> EnvironmentResponse -> f EnvironmentResponse)
-> ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> Maybe (Sensitive (HashMap Text (Sensitive Text)))
-> f (Maybe (Sensitive (HashMap Text (Sensitive Text)))))
-> (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> EnvironmentResponse
-> f EnvironmentResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
(Sensitive (HashMap Text (Sensitive Text)))
(Sensitive (HashMap Text (Sensitive Text)))
(HashMap Text Text)
(HashMap Text Text)
-> Iso
(Maybe (Sensitive (HashMap Text (Sensitive Text))))
(Maybe (Sensitive (HashMap Text (Sensitive Text))))
(Maybe (HashMap Text Text))
(Maybe (HashMap Text Text))
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 (Exchange
(HashMap Text Text)
(HashMap Text Text)
(HashMap Text (Sensitive Text))
(Identity (HashMap Text (Sensitive Text)))
-> Exchange
(HashMap Text Text)
(HashMap Text Text)
(Sensitive (HashMap Text (Sensitive Text)))
(Identity (Sensitive (HashMap Text (Sensitive Text))))
forall a. Iso' (Sensitive a) a
Core._Sensitive (Exchange
(HashMap Text Text)
(HashMap Text Text)
(HashMap Text (Sensitive Text))
(Identity (HashMap Text (Sensitive Text)))
-> Exchange
(HashMap Text Text)
(HashMap Text Text)
(Sensitive (HashMap Text (Sensitive Text)))
(Identity (Sensitive (HashMap Text (Sensitive Text)))))
-> (Exchange
(HashMap Text Text)
(HashMap Text Text)
(HashMap Text Text)
(Identity (HashMap Text Text))
-> Exchange
(HashMap Text Text)
(HashMap Text Text)
(HashMap Text (Sensitive Text))
(Identity (HashMap Text (Sensitive Text))))
-> AnIso
(Sensitive (HashMap Text (Sensitive Text)))
(Sensitive (HashMap Text (Sensitive Text)))
(HashMap Text Text)
(HashMap Text Text)
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. Exchange
(HashMap Text Text)
(HashMap Text Text)
(HashMap Text Text)
(Identity (HashMap Text Text))
-> Exchange
(HashMap Text Text)
(HashMap Text Text)
(HashMap Text (Sensitive Text))
(Identity (HashMap Text (Sensitive Text)))
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced)
environmentResponse_error :: Lens.Lens' EnvironmentResponse (Prelude.Maybe EnvironmentError)
environmentResponse_error :: (Maybe EnvironmentError -> f (Maybe EnvironmentError))
-> EnvironmentResponse -> f EnvironmentResponse
environmentResponse_error = (EnvironmentResponse -> Maybe EnvironmentError)
-> (EnvironmentResponse
-> Maybe EnvironmentError -> EnvironmentResponse)
-> Lens
EnvironmentResponse
EnvironmentResponse
(Maybe EnvironmentError)
(Maybe EnvironmentError)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EnvironmentResponse' {Maybe EnvironmentError
error :: Maybe EnvironmentError
$sel:error:EnvironmentResponse' :: EnvironmentResponse -> Maybe EnvironmentError
error} -> Maybe EnvironmentError
error) (\s :: EnvironmentResponse
s@EnvironmentResponse' {} Maybe EnvironmentError
a -> EnvironmentResponse
s {$sel:error:EnvironmentResponse' :: Maybe EnvironmentError
error = Maybe EnvironmentError
a} :: EnvironmentResponse)
instance Core.FromJSON EnvironmentResponse where
parseJSON :: Value -> Parser EnvironmentResponse
parseJSON =
String
-> (Object -> Parser EnvironmentResponse)
-> Value
-> Parser EnvironmentResponse
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"EnvironmentResponse"
( \Object
x ->
Maybe (Sensitive (HashMap Text (Sensitive Text)))
-> Maybe EnvironmentError -> EnvironmentResponse
EnvironmentResponse'
(Maybe (Sensitive (HashMap Text (Sensitive Text)))
-> Maybe EnvironmentError -> EnvironmentResponse)
-> Parser (Maybe (Sensitive (HashMap Text (Sensitive Text))))
-> Parser (Maybe EnvironmentError -> EnvironmentResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object
-> Text
-> Parser
(Maybe (Maybe (Sensitive (HashMap Text (Sensitive Text)))))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Variables" Parser (Maybe (Maybe (Sensitive (HashMap Text (Sensitive Text)))))
-> Maybe (Sensitive (HashMap Text (Sensitive Text)))
-> Parser (Maybe (Sensitive (HashMap Text (Sensitive Text))))
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe (Sensitive (HashMap Text (Sensitive Text)))
forall a. Monoid a => a
Prelude.mempty)
Parser (Maybe EnvironmentError -> EnvironmentResponse)
-> Parser (Maybe EnvironmentError) -> Parser EnvironmentResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe EnvironmentError)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Error")
)
instance Prelude.Hashable EnvironmentResponse
instance Prelude.NFData EnvironmentResponse