{-# 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.ImageVersion where
import qualified Amazonka.Core as Core
import Amazonka.ImageBuilder.Types.ImageType
import Amazonka.ImageBuilder.Types.Platform
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data ImageVersion = ImageVersion'
{
ImageVersion -> Maybe Platform
platform :: Prelude.Maybe Platform,
ImageVersion -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
ImageVersion -> Maybe Text
owner :: Prelude.Maybe Prelude.Text,
ImageVersion -> Maybe Text
dateCreated :: Prelude.Maybe Prelude.Text,
ImageVersion -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
ImageVersion -> Maybe Text
version :: Prelude.Maybe Prelude.Text,
ImageVersion -> Maybe ImageType
type' :: Prelude.Maybe ImageType,
ImageVersion -> Maybe Text
osVersion :: Prelude.Maybe Prelude.Text
}
deriving (ImageVersion -> ImageVersion -> Bool
(ImageVersion -> ImageVersion -> Bool)
-> (ImageVersion -> ImageVersion -> Bool) -> Eq ImageVersion
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ImageVersion -> ImageVersion -> Bool
$c/= :: ImageVersion -> ImageVersion -> Bool
== :: ImageVersion -> ImageVersion -> Bool
$c== :: ImageVersion -> ImageVersion -> Bool
Prelude.Eq, ReadPrec [ImageVersion]
ReadPrec ImageVersion
Int -> ReadS ImageVersion
ReadS [ImageVersion]
(Int -> ReadS ImageVersion)
-> ReadS [ImageVersion]
-> ReadPrec ImageVersion
-> ReadPrec [ImageVersion]
-> Read ImageVersion
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ImageVersion]
$creadListPrec :: ReadPrec [ImageVersion]
readPrec :: ReadPrec ImageVersion
$creadPrec :: ReadPrec ImageVersion
readList :: ReadS [ImageVersion]
$creadList :: ReadS [ImageVersion]
readsPrec :: Int -> ReadS ImageVersion
$creadsPrec :: Int -> ReadS ImageVersion
Prelude.Read, Int -> ImageVersion -> ShowS
[ImageVersion] -> ShowS
ImageVersion -> String
(Int -> ImageVersion -> ShowS)
-> (ImageVersion -> String)
-> ([ImageVersion] -> ShowS)
-> Show ImageVersion
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ImageVersion] -> ShowS
$cshowList :: [ImageVersion] -> ShowS
show :: ImageVersion -> String
$cshow :: ImageVersion -> String
showsPrec :: Int -> ImageVersion -> ShowS
$cshowsPrec :: Int -> ImageVersion -> ShowS
Prelude.Show, (forall x. ImageVersion -> Rep ImageVersion x)
-> (forall x. Rep ImageVersion x -> ImageVersion)
-> Generic ImageVersion
forall x. Rep ImageVersion x -> ImageVersion
forall x. ImageVersion -> Rep ImageVersion x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ImageVersion x -> ImageVersion
$cfrom :: forall x. ImageVersion -> Rep ImageVersion x
Prelude.Generic)
newImageVersion ::
ImageVersion
newImageVersion :: ImageVersion
newImageVersion =
ImageVersion' :: Maybe Platform
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe ImageType
-> Maybe Text
-> ImageVersion
ImageVersion'
{ $sel:platform:ImageVersion' :: Maybe Platform
platform = Maybe Platform
forall a. Maybe a
Prelude.Nothing,
$sel:arn:ImageVersion' :: Maybe Text
arn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:owner:ImageVersion' :: Maybe Text
owner = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:dateCreated:ImageVersion' :: Maybe Text
dateCreated = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:name:ImageVersion' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:version:ImageVersion' :: Maybe Text
version = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:type':ImageVersion' :: Maybe ImageType
type' = Maybe ImageType
forall a. Maybe a
Prelude.Nothing,
$sel:osVersion:ImageVersion' :: Maybe Text
osVersion = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
imageVersion_platform :: Lens.Lens' ImageVersion (Prelude.Maybe Platform)
imageVersion_platform :: (Maybe Platform -> f (Maybe Platform))
-> ImageVersion -> f ImageVersion
imageVersion_platform = (ImageVersion -> Maybe Platform)
-> (ImageVersion -> Maybe Platform -> ImageVersion)
-> Lens ImageVersion ImageVersion (Maybe Platform) (Maybe Platform)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ImageVersion' {Maybe Platform
platform :: Maybe Platform
$sel:platform:ImageVersion' :: ImageVersion -> Maybe Platform
platform} -> Maybe Platform
platform) (\s :: ImageVersion
s@ImageVersion' {} Maybe Platform
a -> ImageVersion
s {$sel:platform:ImageVersion' :: Maybe Platform
platform = Maybe Platform
a} :: ImageVersion)
imageVersion_arn :: Lens.Lens' ImageVersion (Prelude.Maybe Prelude.Text)
imageVersion_arn :: (Maybe Text -> f (Maybe Text)) -> ImageVersion -> f ImageVersion
imageVersion_arn = (ImageVersion -> Maybe Text)
-> (ImageVersion -> Maybe Text -> ImageVersion)
-> Lens ImageVersion ImageVersion (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ImageVersion' {Maybe Text
arn :: Maybe Text
$sel:arn:ImageVersion' :: ImageVersion -> Maybe Text
arn} -> Maybe Text
arn) (\s :: ImageVersion
s@ImageVersion' {} Maybe Text
a -> ImageVersion
s {$sel:arn:ImageVersion' :: Maybe Text
arn = Maybe Text
a} :: ImageVersion)
imageVersion_owner :: Lens.Lens' ImageVersion (Prelude.Maybe Prelude.Text)
imageVersion_owner :: (Maybe Text -> f (Maybe Text)) -> ImageVersion -> f ImageVersion
imageVersion_owner = (ImageVersion -> Maybe Text)
-> (ImageVersion -> Maybe Text -> ImageVersion)
-> Lens ImageVersion ImageVersion (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ImageVersion' {Maybe Text
owner :: Maybe Text
$sel:owner:ImageVersion' :: ImageVersion -> Maybe Text
owner} -> Maybe Text
owner) (\s :: ImageVersion
s@ImageVersion' {} Maybe Text
a -> ImageVersion
s {$sel:owner:ImageVersion' :: Maybe Text
owner = Maybe Text
a} :: ImageVersion)
imageVersion_dateCreated :: Lens.Lens' ImageVersion (Prelude.Maybe Prelude.Text)
imageVersion_dateCreated :: (Maybe Text -> f (Maybe Text)) -> ImageVersion -> f ImageVersion
imageVersion_dateCreated = (ImageVersion -> Maybe Text)
-> (ImageVersion -> Maybe Text -> ImageVersion)
-> Lens ImageVersion ImageVersion (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ImageVersion' {Maybe Text
dateCreated :: Maybe Text
$sel:dateCreated:ImageVersion' :: ImageVersion -> Maybe Text
dateCreated} -> Maybe Text
dateCreated) (\s :: ImageVersion
s@ImageVersion' {} Maybe Text
a -> ImageVersion
s {$sel:dateCreated:ImageVersion' :: Maybe Text
dateCreated = Maybe Text
a} :: ImageVersion)
imageVersion_name :: Lens.Lens' ImageVersion (Prelude.Maybe Prelude.Text)
imageVersion_name :: (Maybe Text -> f (Maybe Text)) -> ImageVersion -> f ImageVersion
imageVersion_name = (ImageVersion -> Maybe Text)
-> (ImageVersion -> Maybe Text -> ImageVersion)
-> Lens ImageVersion ImageVersion (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ImageVersion' {Maybe Text
name :: Maybe Text
$sel:name:ImageVersion' :: ImageVersion -> Maybe Text
name} -> Maybe Text
name) (\s :: ImageVersion
s@ImageVersion' {} Maybe Text
a -> ImageVersion
s {$sel:name:ImageVersion' :: Maybe Text
name = Maybe Text
a} :: ImageVersion)
imageVersion_version :: Lens.Lens' ImageVersion (Prelude.Maybe Prelude.Text)
imageVersion_version :: (Maybe Text -> f (Maybe Text)) -> ImageVersion -> f ImageVersion
imageVersion_version = (ImageVersion -> Maybe Text)
-> (ImageVersion -> Maybe Text -> ImageVersion)
-> Lens ImageVersion ImageVersion (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ImageVersion' {Maybe Text
version :: Maybe Text
$sel:version:ImageVersion' :: ImageVersion -> Maybe Text
version} -> Maybe Text
version) (\s :: ImageVersion
s@ImageVersion' {} Maybe Text
a -> ImageVersion
s {$sel:version:ImageVersion' :: Maybe Text
version = Maybe Text
a} :: ImageVersion)
imageVersion_type :: Lens.Lens' ImageVersion (Prelude.Maybe ImageType)
imageVersion_type :: (Maybe ImageType -> f (Maybe ImageType))
-> ImageVersion -> f ImageVersion
imageVersion_type = (ImageVersion -> Maybe ImageType)
-> (ImageVersion -> Maybe ImageType -> ImageVersion)
-> Lens
ImageVersion ImageVersion (Maybe ImageType) (Maybe ImageType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ImageVersion' {Maybe ImageType
type' :: Maybe ImageType
$sel:type':ImageVersion' :: ImageVersion -> Maybe ImageType
type'} -> Maybe ImageType
type') (\s :: ImageVersion
s@ImageVersion' {} Maybe ImageType
a -> ImageVersion
s {$sel:type':ImageVersion' :: Maybe ImageType
type' = Maybe ImageType
a} :: ImageVersion)
imageVersion_osVersion :: Lens.Lens' ImageVersion (Prelude.Maybe Prelude.Text)
imageVersion_osVersion :: (Maybe Text -> f (Maybe Text)) -> ImageVersion -> f ImageVersion
imageVersion_osVersion = (ImageVersion -> Maybe Text)
-> (ImageVersion -> Maybe Text -> ImageVersion)
-> Lens ImageVersion ImageVersion (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ImageVersion' {Maybe Text
osVersion :: Maybe Text
$sel:osVersion:ImageVersion' :: ImageVersion -> Maybe Text
osVersion} -> Maybe Text
osVersion) (\s :: ImageVersion
s@ImageVersion' {} Maybe Text
a -> ImageVersion
s {$sel:osVersion:ImageVersion' :: Maybe Text
osVersion = Maybe Text
a} :: ImageVersion)
instance Core.FromJSON ImageVersion where
parseJSON :: Value -> Parser ImageVersion
parseJSON =
String
-> (Object -> Parser ImageVersion) -> Value -> Parser ImageVersion
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"ImageVersion"
( \Object
x ->
Maybe Platform
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe ImageType
-> Maybe Text
-> ImageVersion
ImageVersion'
(Maybe Platform
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe ImageType
-> Maybe Text
-> ImageVersion)
-> Parser (Maybe Platform)
-> Parser
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe ImageType
-> Maybe Text
-> ImageVersion)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Platform)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"platform")
Parser
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe ImageType
-> Maybe Text
-> ImageVersion)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe ImageType
-> Maybe Text
-> ImageVersion)
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
"arn")
Parser
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe ImageType
-> Maybe Text
-> ImageVersion)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe ImageType
-> Maybe Text
-> ImageVersion)
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
"owner")
Parser
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe ImageType
-> Maybe Text
-> ImageVersion)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Maybe Text -> Maybe ImageType -> Maybe Text -> ImageVersion)
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
"dateCreated")
Parser
(Maybe Text
-> Maybe Text -> Maybe ImageType -> Maybe Text -> ImageVersion)
-> Parser (Maybe Text)
-> Parser
(Maybe Text -> Maybe ImageType -> Maybe Text -> ImageVersion)
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 ImageType -> Maybe Text -> ImageVersion)
-> Parser (Maybe Text)
-> Parser (Maybe ImageType -> Maybe Text -> ImageVersion)
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
"version")
Parser (Maybe ImageType -> Maybe Text -> ImageVersion)
-> Parser (Maybe ImageType) -> Parser (Maybe Text -> ImageVersion)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe ImageType)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"type")
Parser (Maybe Text -> ImageVersion)
-> Parser (Maybe Text) -> Parser ImageVersion
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
"osVersion")
)
instance Prelude.Hashable ImageVersion
instance Prelude.NFData ImageVersion