{-# 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.ImageConfigResponse where
import qualified Amazonka.Core as Core
import Amazonka.Lambda.Types.ImageConfig
import Amazonka.Lambda.Types.ImageConfigError
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data ImageConfigResponse = ImageConfigResponse'
{
ImageConfigResponse -> Maybe ImageConfig
imageConfig :: Prelude.Maybe ImageConfig,
ImageConfigResponse -> Maybe ImageConfigError
error :: Prelude.Maybe ImageConfigError
}
deriving (ImageConfigResponse -> ImageConfigResponse -> Bool
(ImageConfigResponse -> ImageConfigResponse -> Bool)
-> (ImageConfigResponse -> ImageConfigResponse -> Bool)
-> Eq ImageConfigResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ImageConfigResponse -> ImageConfigResponse -> Bool
$c/= :: ImageConfigResponse -> ImageConfigResponse -> Bool
== :: ImageConfigResponse -> ImageConfigResponse -> Bool
$c== :: ImageConfigResponse -> ImageConfigResponse -> Bool
Prelude.Eq, Int -> ImageConfigResponse -> ShowS
[ImageConfigResponse] -> ShowS
ImageConfigResponse -> String
(Int -> ImageConfigResponse -> ShowS)
-> (ImageConfigResponse -> String)
-> ([ImageConfigResponse] -> ShowS)
-> Show ImageConfigResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ImageConfigResponse] -> ShowS
$cshowList :: [ImageConfigResponse] -> ShowS
show :: ImageConfigResponse -> String
$cshow :: ImageConfigResponse -> String
showsPrec :: Int -> ImageConfigResponse -> ShowS
$cshowsPrec :: Int -> ImageConfigResponse -> ShowS
Prelude.Show, (forall x. ImageConfigResponse -> Rep ImageConfigResponse x)
-> (forall x. Rep ImageConfigResponse x -> ImageConfigResponse)
-> Generic ImageConfigResponse
forall x. Rep ImageConfigResponse x -> ImageConfigResponse
forall x. ImageConfigResponse -> Rep ImageConfigResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ImageConfigResponse x -> ImageConfigResponse
$cfrom :: forall x. ImageConfigResponse -> Rep ImageConfigResponse x
Prelude.Generic)
newImageConfigResponse ::
ImageConfigResponse
newImageConfigResponse :: ImageConfigResponse
newImageConfigResponse =
ImageConfigResponse' :: Maybe ImageConfig -> Maybe ImageConfigError -> ImageConfigResponse
ImageConfigResponse'
{ $sel:imageConfig:ImageConfigResponse' :: Maybe ImageConfig
imageConfig = Maybe ImageConfig
forall a. Maybe a
Prelude.Nothing,
$sel:error:ImageConfigResponse' :: Maybe ImageConfigError
error = Maybe ImageConfigError
forall a. Maybe a
Prelude.Nothing
}
imageConfigResponse_imageConfig :: Lens.Lens' ImageConfigResponse (Prelude.Maybe ImageConfig)
imageConfigResponse_imageConfig :: (Maybe ImageConfig -> f (Maybe ImageConfig))
-> ImageConfigResponse -> f ImageConfigResponse
imageConfigResponse_imageConfig = (ImageConfigResponse -> Maybe ImageConfig)
-> (ImageConfigResponse
-> Maybe ImageConfig -> ImageConfigResponse)
-> Lens
ImageConfigResponse
ImageConfigResponse
(Maybe ImageConfig)
(Maybe ImageConfig)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ImageConfigResponse' {Maybe ImageConfig
imageConfig :: Maybe ImageConfig
$sel:imageConfig:ImageConfigResponse' :: ImageConfigResponse -> Maybe ImageConfig
imageConfig} -> Maybe ImageConfig
imageConfig) (\s :: ImageConfigResponse
s@ImageConfigResponse' {} Maybe ImageConfig
a -> ImageConfigResponse
s {$sel:imageConfig:ImageConfigResponse' :: Maybe ImageConfig
imageConfig = Maybe ImageConfig
a} :: ImageConfigResponse)
imageConfigResponse_error :: Lens.Lens' ImageConfigResponse (Prelude.Maybe ImageConfigError)
imageConfigResponse_error :: (Maybe ImageConfigError -> f (Maybe ImageConfigError))
-> ImageConfigResponse -> f ImageConfigResponse
imageConfigResponse_error = (ImageConfigResponse -> Maybe ImageConfigError)
-> (ImageConfigResponse
-> Maybe ImageConfigError -> ImageConfigResponse)
-> Lens
ImageConfigResponse
ImageConfigResponse
(Maybe ImageConfigError)
(Maybe ImageConfigError)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ImageConfigResponse' {Maybe ImageConfigError
error :: Maybe ImageConfigError
$sel:error:ImageConfigResponse' :: ImageConfigResponse -> Maybe ImageConfigError
error} -> Maybe ImageConfigError
error) (\s :: ImageConfigResponse
s@ImageConfigResponse' {} Maybe ImageConfigError
a -> ImageConfigResponse
s {$sel:error:ImageConfigResponse' :: Maybe ImageConfigError
error = Maybe ImageConfigError
a} :: ImageConfigResponse)
instance Core.FromJSON ImageConfigResponse where
parseJSON :: Value -> Parser ImageConfigResponse
parseJSON =
String
-> (Object -> Parser ImageConfigResponse)
-> Value
-> Parser ImageConfigResponse
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"ImageConfigResponse"
( \Object
x ->
Maybe ImageConfig -> Maybe ImageConfigError -> ImageConfigResponse
ImageConfigResponse'
(Maybe ImageConfig
-> Maybe ImageConfigError -> ImageConfigResponse)
-> Parser (Maybe ImageConfig)
-> Parser (Maybe ImageConfigError -> ImageConfigResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe ImageConfig)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ImageConfig")
Parser (Maybe ImageConfigError -> ImageConfigResponse)
-> Parser (Maybe ImageConfigError) -> Parser ImageConfigResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe ImageConfigError)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Error")
)
instance Prelude.Hashable ImageConfigResponse
instance Prelude.NFData ImageConfigResponse