{-# 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.ImageRepository where
import Amazonka.AppRunner.Types.ImageConfiguration
import Amazonka.AppRunner.Types.ImageRepositoryType
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 ImageRepository = ImageRepository'
{
ImageRepository -> Maybe ImageConfiguration
imageConfiguration :: Prelude.Maybe ImageConfiguration,
ImageRepository -> Text
imageIdentifier :: Prelude.Text,
ImageRepository -> ImageRepositoryType
imageRepositoryType :: ImageRepositoryType
}
deriving (ImageRepository -> ImageRepository -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ImageRepository -> ImageRepository -> Bool
$c/= :: ImageRepository -> ImageRepository -> Bool
== :: ImageRepository -> ImageRepository -> Bool
$c== :: ImageRepository -> ImageRepository -> Bool
Prelude.Eq, Int -> ImageRepository -> ShowS
[ImageRepository] -> ShowS
ImageRepository -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ImageRepository] -> ShowS
$cshowList :: [ImageRepository] -> ShowS
show :: ImageRepository -> String
$cshow :: ImageRepository -> String
showsPrec :: Int -> ImageRepository -> ShowS
$cshowsPrec :: Int -> ImageRepository -> ShowS
Prelude.Show, forall x. Rep ImageRepository x -> ImageRepository
forall x. ImageRepository -> Rep ImageRepository x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ImageRepository x -> ImageRepository
$cfrom :: forall x. ImageRepository -> Rep ImageRepository x
Prelude.Generic)
newImageRepository ::
Prelude.Text ->
ImageRepositoryType ->
ImageRepository
newImageRepository :: Text -> ImageRepositoryType -> ImageRepository
newImageRepository
Text
pImageIdentifier_
ImageRepositoryType
pImageRepositoryType_ =
ImageRepository'
{ $sel:imageConfiguration:ImageRepository' :: Maybe ImageConfiguration
imageConfiguration =
forall a. Maybe a
Prelude.Nothing,
$sel:imageIdentifier:ImageRepository' :: Text
imageIdentifier = Text
pImageIdentifier_,
$sel:imageRepositoryType:ImageRepository' :: ImageRepositoryType
imageRepositoryType = ImageRepositoryType
pImageRepositoryType_
}
imageRepository_imageConfiguration :: Lens.Lens' ImageRepository (Prelude.Maybe ImageConfiguration)
imageRepository_imageConfiguration :: Lens' ImageRepository (Maybe ImageConfiguration)
imageRepository_imageConfiguration = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ImageRepository' {Maybe ImageConfiguration
imageConfiguration :: Maybe ImageConfiguration
$sel:imageConfiguration:ImageRepository' :: ImageRepository -> Maybe ImageConfiguration
imageConfiguration} -> Maybe ImageConfiguration
imageConfiguration) (\s :: ImageRepository
s@ImageRepository' {} Maybe ImageConfiguration
a -> ImageRepository
s {$sel:imageConfiguration:ImageRepository' :: Maybe ImageConfiguration
imageConfiguration = Maybe ImageConfiguration
a} :: ImageRepository)
imageRepository_imageIdentifier :: Lens.Lens' ImageRepository Prelude.Text
imageRepository_imageIdentifier :: Lens' ImageRepository Text
imageRepository_imageIdentifier = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ImageRepository' {Text
imageIdentifier :: Text
$sel:imageIdentifier:ImageRepository' :: ImageRepository -> Text
imageIdentifier} -> Text
imageIdentifier) (\s :: ImageRepository
s@ImageRepository' {} Text
a -> ImageRepository
s {$sel:imageIdentifier:ImageRepository' :: Text
imageIdentifier = Text
a} :: ImageRepository)
imageRepository_imageRepositoryType :: Lens.Lens' ImageRepository ImageRepositoryType
imageRepository_imageRepositoryType :: Lens' ImageRepository ImageRepositoryType
imageRepository_imageRepositoryType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ImageRepository' {ImageRepositoryType
imageRepositoryType :: ImageRepositoryType
$sel:imageRepositoryType:ImageRepository' :: ImageRepository -> ImageRepositoryType
imageRepositoryType} -> ImageRepositoryType
imageRepositoryType) (\s :: ImageRepository
s@ImageRepository' {} ImageRepositoryType
a -> ImageRepository
s {$sel:imageRepositoryType:ImageRepository' :: ImageRepositoryType
imageRepositoryType = ImageRepositoryType
a} :: ImageRepository)
instance Data.FromJSON ImageRepository where
parseJSON :: Value -> Parser ImageRepository
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"ImageRepository"
( \Object
x ->
Maybe ImageConfiguration
-> Text -> ImageRepositoryType -> ImageRepository
ImageRepository'
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
"ImageConfiguration")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"ImageIdentifier")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"ImageRepositoryType")
)
instance Prelude.Hashable ImageRepository where
hashWithSalt :: Int -> ImageRepository -> Int
hashWithSalt Int
_salt ImageRepository' {Maybe ImageConfiguration
Text
ImageRepositoryType
imageRepositoryType :: ImageRepositoryType
imageIdentifier :: Text
imageConfiguration :: Maybe ImageConfiguration
$sel:imageRepositoryType:ImageRepository' :: ImageRepository -> ImageRepositoryType
$sel:imageIdentifier:ImageRepository' :: ImageRepository -> Text
$sel:imageConfiguration:ImageRepository' :: ImageRepository -> Maybe ImageConfiguration
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ImageConfiguration
imageConfiguration
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
imageIdentifier
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` ImageRepositoryType
imageRepositoryType
instance Prelude.NFData ImageRepository where
rnf :: ImageRepository -> ()
rnf ImageRepository' {Maybe ImageConfiguration
Text
ImageRepositoryType
imageRepositoryType :: ImageRepositoryType
imageIdentifier :: Text
imageConfiguration :: Maybe ImageConfiguration
$sel:imageRepositoryType:ImageRepository' :: ImageRepository -> ImageRepositoryType
$sel:imageIdentifier:ImageRepository' :: ImageRepository -> Text
$sel:imageConfiguration:ImageRepository' :: ImageRepository -> Maybe ImageConfiguration
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe ImageConfiguration
imageConfiguration
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
imageIdentifier
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf ImageRepositoryType
imageRepositoryType
instance Data.ToJSON ImageRepository where
toJSON :: ImageRepository -> Value
toJSON ImageRepository' {Maybe ImageConfiguration
Text
ImageRepositoryType
imageRepositoryType :: ImageRepositoryType
imageIdentifier :: Text
imageConfiguration :: Maybe ImageConfiguration
$sel:imageRepositoryType:ImageRepository' :: ImageRepository -> ImageRepositoryType
$sel:imageIdentifier:ImageRepository' :: ImageRepository -> Text
$sel:imageConfiguration:ImageRepository' :: ImageRepository -> Maybe ImageConfiguration
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"ImageConfiguration" 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 ImageConfiguration
imageConfiguration,
forall a. a -> Maybe a
Prelude.Just
(Key
"ImageIdentifier" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
imageIdentifier),
forall a. a -> Maybe a
Prelude.Just
(Key
"ImageRepositoryType" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= ImageRepositoryType
imageRepositoryType)
]
)