{-# 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.ImageBuilder.Types.ImagePackage where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data ImagePackage = ImagePackage'
{
ImagePackage -> Maybe Text
packageName :: Prelude.Maybe Prelude.Text,
ImagePackage -> Maybe Text
packageVersion :: Prelude.Maybe Prelude.Text
}
deriving (ImagePackage -> ImagePackage -> Bool
(ImagePackage -> ImagePackage -> Bool)
-> (ImagePackage -> ImagePackage -> Bool) -> Eq ImagePackage
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ImagePackage -> ImagePackage -> Bool
$c/= :: ImagePackage -> ImagePackage -> Bool
== :: ImagePackage -> ImagePackage -> Bool
$c== :: ImagePackage -> ImagePackage -> Bool
Prelude.Eq, ReadPrec [ImagePackage]
ReadPrec ImagePackage
Int -> ReadS ImagePackage
ReadS [ImagePackage]
(Int -> ReadS ImagePackage)
-> ReadS [ImagePackage]
-> ReadPrec ImagePackage
-> ReadPrec [ImagePackage]
-> Read ImagePackage
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ImagePackage]
$creadListPrec :: ReadPrec [ImagePackage]
readPrec :: ReadPrec ImagePackage
$creadPrec :: ReadPrec ImagePackage
readList :: ReadS [ImagePackage]
$creadList :: ReadS [ImagePackage]
readsPrec :: Int -> ReadS ImagePackage
$creadsPrec :: Int -> ReadS ImagePackage
Prelude.Read, Int -> ImagePackage -> ShowS
[ImagePackage] -> ShowS
ImagePackage -> String
(Int -> ImagePackage -> ShowS)
-> (ImagePackage -> String)
-> ([ImagePackage] -> ShowS)
-> Show ImagePackage
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ImagePackage] -> ShowS
$cshowList :: [ImagePackage] -> ShowS
show :: ImagePackage -> String
$cshow :: ImagePackage -> String
showsPrec :: Int -> ImagePackage -> ShowS
$cshowsPrec :: Int -> ImagePackage -> ShowS
Prelude.Show, (forall x. ImagePackage -> Rep ImagePackage x)
-> (forall x. Rep ImagePackage x -> ImagePackage)
-> Generic ImagePackage
forall x. Rep ImagePackage x -> ImagePackage
forall x. ImagePackage -> Rep ImagePackage x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ImagePackage x -> ImagePackage
$cfrom :: forall x. ImagePackage -> Rep ImagePackage x
Prelude.Generic)
newImagePackage ::
ImagePackage
newImagePackage :: ImagePackage
newImagePackage =
ImagePackage' :: Maybe Text -> Maybe Text -> ImagePackage
ImagePackage'
{ $sel:packageName:ImagePackage' :: Maybe Text
packageName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:packageVersion:ImagePackage' :: Maybe Text
packageVersion = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
imagePackage_packageName :: Lens.Lens' ImagePackage (Prelude.Maybe Prelude.Text)
imagePackage_packageName :: (Maybe Text -> f (Maybe Text)) -> ImagePackage -> f ImagePackage
imagePackage_packageName = (ImagePackage -> Maybe Text)
-> (ImagePackage -> Maybe Text -> ImagePackage)
-> Lens ImagePackage ImagePackage (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ImagePackage' {Maybe Text
packageName :: Maybe Text
$sel:packageName:ImagePackage' :: ImagePackage -> Maybe Text
packageName} -> Maybe Text
packageName) (\s :: ImagePackage
s@ImagePackage' {} Maybe Text
a -> ImagePackage
s {$sel:packageName:ImagePackage' :: Maybe Text
packageName = Maybe Text
a} :: ImagePackage)
imagePackage_packageVersion :: Lens.Lens' ImagePackage (Prelude.Maybe Prelude.Text)
imagePackage_packageVersion :: (Maybe Text -> f (Maybe Text)) -> ImagePackage -> f ImagePackage
imagePackage_packageVersion = (ImagePackage -> Maybe Text)
-> (ImagePackage -> Maybe Text -> ImagePackage)
-> Lens ImagePackage ImagePackage (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ImagePackage' {Maybe Text
packageVersion :: Maybe Text
$sel:packageVersion:ImagePackage' :: ImagePackage -> Maybe Text
packageVersion} -> Maybe Text
packageVersion) (\s :: ImagePackage
s@ImagePackage' {} Maybe Text
a -> ImagePackage
s {$sel:packageVersion:ImagePackage' :: Maybe Text
packageVersion = Maybe Text
a} :: ImagePackage)
instance Core.FromJSON ImagePackage where
parseJSON :: Value -> Parser ImagePackage
parseJSON =
String
-> (Object -> Parser ImagePackage) -> Value -> Parser ImagePackage
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"ImagePackage"
( \Object
x ->
Maybe Text -> Maybe Text -> ImagePackage
ImagePackage'
(Maybe Text -> Maybe Text -> ImagePackage)
-> Parser (Maybe Text) -> Parser (Maybe Text -> ImagePackage)
forall (f :: * -> *) a b. Functor 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
"packageName")
Parser (Maybe Text -> ImagePackage)
-> Parser (Maybe Text) -> Parser ImagePackage
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
"packageVersion")
)
instance Prelude.Hashable ImagePackage
instance Prelude.NFData ImagePackage