{-# 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.ComponentVersion where
import qualified Amazonka.Core as Core
import Amazonka.ImageBuilder.Types.ComponentType
import Amazonka.ImageBuilder.Types.Platform
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data ComponentVersion = ComponentVersion'
{
ComponentVersion -> Maybe Platform
platform :: Prelude.Maybe Platform,
ComponentVersion -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
ComponentVersion -> Maybe (NonEmpty Text)
supportedOsVersions :: Prelude.Maybe (Prelude.NonEmpty Prelude.Text),
ComponentVersion -> Maybe Text
owner :: Prelude.Maybe Prelude.Text,
ComponentVersion -> Maybe Text
dateCreated :: Prelude.Maybe Prelude.Text,
ComponentVersion -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
ComponentVersion -> Maybe Text
version :: Prelude.Maybe Prelude.Text,
ComponentVersion -> Maybe ComponentType
type' :: Prelude.Maybe ComponentType,
ComponentVersion -> Maybe Text
description :: Prelude.Maybe Prelude.Text
}
deriving (ComponentVersion -> ComponentVersion -> Bool
(ComponentVersion -> ComponentVersion -> Bool)
-> (ComponentVersion -> ComponentVersion -> Bool)
-> Eq ComponentVersion
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ComponentVersion -> ComponentVersion -> Bool
$c/= :: ComponentVersion -> ComponentVersion -> Bool
== :: ComponentVersion -> ComponentVersion -> Bool
$c== :: ComponentVersion -> ComponentVersion -> Bool
Prelude.Eq, ReadPrec [ComponentVersion]
ReadPrec ComponentVersion
Int -> ReadS ComponentVersion
ReadS [ComponentVersion]
(Int -> ReadS ComponentVersion)
-> ReadS [ComponentVersion]
-> ReadPrec ComponentVersion
-> ReadPrec [ComponentVersion]
-> Read ComponentVersion
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ComponentVersion]
$creadListPrec :: ReadPrec [ComponentVersion]
readPrec :: ReadPrec ComponentVersion
$creadPrec :: ReadPrec ComponentVersion
readList :: ReadS [ComponentVersion]
$creadList :: ReadS [ComponentVersion]
readsPrec :: Int -> ReadS ComponentVersion
$creadsPrec :: Int -> ReadS ComponentVersion
Prelude.Read, Int -> ComponentVersion -> ShowS
[ComponentVersion] -> ShowS
ComponentVersion -> String
(Int -> ComponentVersion -> ShowS)
-> (ComponentVersion -> String)
-> ([ComponentVersion] -> ShowS)
-> Show ComponentVersion
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ComponentVersion] -> ShowS
$cshowList :: [ComponentVersion] -> ShowS
show :: ComponentVersion -> String
$cshow :: ComponentVersion -> String
showsPrec :: Int -> ComponentVersion -> ShowS
$cshowsPrec :: Int -> ComponentVersion -> ShowS
Prelude.Show, (forall x. ComponentVersion -> Rep ComponentVersion x)
-> (forall x. Rep ComponentVersion x -> ComponentVersion)
-> Generic ComponentVersion
forall x. Rep ComponentVersion x -> ComponentVersion
forall x. ComponentVersion -> Rep ComponentVersion x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ComponentVersion x -> ComponentVersion
$cfrom :: forall x. ComponentVersion -> Rep ComponentVersion x
Prelude.Generic)
newComponentVersion ::
ComponentVersion
newComponentVersion :: ComponentVersion
newComponentVersion =
ComponentVersion' :: Maybe Platform
-> Maybe Text
-> Maybe (NonEmpty Text)
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe ComponentType
-> Maybe Text
-> ComponentVersion
ComponentVersion'
{ $sel:platform:ComponentVersion' :: Maybe Platform
platform = Maybe Platform
forall a. Maybe a
Prelude.Nothing,
$sel:arn:ComponentVersion' :: Maybe Text
arn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:supportedOsVersions:ComponentVersion' :: Maybe (NonEmpty Text)
supportedOsVersions = Maybe (NonEmpty Text)
forall a. Maybe a
Prelude.Nothing,
$sel:owner:ComponentVersion' :: Maybe Text
owner = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:dateCreated:ComponentVersion' :: Maybe Text
dateCreated = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:name:ComponentVersion' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:version:ComponentVersion' :: Maybe Text
version = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:type':ComponentVersion' :: Maybe ComponentType
type' = Maybe ComponentType
forall a. Maybe a
Prelude.Nothing,
$sel:description:ComponentVersion' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
componentVersion_platform :: Lens.Lens' ComponentVersion (Prelude.Maybe Platform)
componentVersion_platform :: (Maybe Platform -> f (Maybe Platform))
-> ComponentVersion -> f ComponentVersion
componentVersion_platform = (ComponentVersion -> Maybe Platform)
-> (ComponentVersion -> Maybe Platform -> ComponentVersion)
-> Lens
ComponentVersion ComponentVersion (Maybe Platform) (Maybe Platform)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ComponentVersion' {Maybe Platform
platform :: Maybe Platform
$sel:platform:ComponentVersion' :: ComponentVersion -> Maybe Platform
platform} -> Maybe Platform
platform) (\s :: ComponentVersion
s@ComponentVersion' {} Maybe Platform
a -> ComponentVersion
s {$sel:platform:ComponentVersion' :: Maybe Platform
platform = Maybe Platform
a} :: ComponentVersion)
componentVersion_arn :: Lens.Lens' ComponentVersion (Prelude.Maybe Prelude.Text)
componentVersion_arn :: (Maybe Text -> f (Maybe Text))
-> ComponentVersion -> f ComponentVersion
componentVersion_arn = (ComponentVersion -> Maybe Text)
-> (ComponentVersion -> Maybe Text -> ComponentVersion)
-> Lens ComponentVersion ComponentVersion (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ComponentVersion' {Maybe Text
arn :: Maybe Text
$sel:arn:ComponentVersion' :: ComponentVersion -> Maybe Text
arn} -> Maybe Text
arn) (\s :: ComponentVersion
s@ComponentVersion' {} Maybe Text
a -> ComponentVersion
s {$sel:arn:ComponentVersion' :: Maybe Text
arn = Maybe Text
a} :: ComponentVersion)
componentVersion_supportedOsVersions :: Lens.Lens' ComponentVersion (Prelude.Maybe (Prelude.NonEmpty Prelude.Text))
componentVersion_supportedOsVersions :: (Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
-> ComponentVersion -> f ComponentVersion
componentVersion_supportedOsVersions = (ComponentVersion -> Maybe (NonEmpty Text))
-> (ComponentVersion -> Maybe (NonEmpty Text) -> ComponentVersion)
-> Lens
ComponentVersion
ComponentVersion
(Maybe (NonEmpty Text))
(Maybe (NonEmpty Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ComponentVersion' {Maybe (NonEmpty Text)
supportedOsVersions :: Maybe (NonEmpty Text)
$sel:supportedOsVersions:ComponentVersion' :: ComponentVersion -> Maybe (NonEmpty Text)
supportedOsVersions} -> Maybe (NonEmpty Text)
supportedOsVersions) (\s :: ComponentVersion
s@ComponentVersion' {} Maybe (NonEmpty Text)
a -> ComponentVersion
s {$sel:supportedOsVersions:ComponentVersion' :: Maybe (NonEmpty Text)
supportedOsVersions = Maybe (NonEmpty Text)
a} :: ComponentVersion) ((Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
-> ComponentVersion -> f ComponentVersion)
-> ((Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
-> Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
-> (Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
-> ComponentVersion
-> f ComponentVersion
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
(NonEmpty Text) (NonEmpty Text) (NonEmpty Text) (NonEmpty Text)
-> Iso
(Maybe (NonEmpty Text))
(Maybe (NonEmpty Text))
(Maybe (NonEmpty Text))
(Maybe (NonEmpty 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 AnIso
(NonEmpty Text) (NonEmpty Text) (NonEmpty Text) (NonEmpty Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
componentVersion_owner :: Lens.Lens' ComponentVersion (Prelude.Maybe Prelude.Text)
componentVersion_owner :: (Maybe Text -> f (Maybe Text))
-> ComponentVersion -> f ComponentVersion
componentVersion_owner = (ComponentVersion -> Maybe Text)
-> (ComponentVersion -> Maybe Text -> ComponentVersion)
-> Lens ComponentVersion ComponentVersion (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ComponentVersion' {Maybe Text
owner :: Maybe Text
$sel:owner:ComponentVersion' :: ComponentVersion -> Maybe Text
owner} -> Maybe Text
owner) (\s :: ComponentVersion
s@ComponentVersion' {} Maybe Text
a -> ComponentVersion
s {$sel:owner:ComponentVersion' :: Maybe Text
owner = Maybe Text
a} :: ComponentVersion)
componentVersion_dateCreated :: Lens.Lens' ComponentVersion (Prelude.Maybe Prelude.Text)
componentVersion_dateCreated :: (Maybe Text -> f (Maybe Text))
-> ComponentVersion -> f ComponentVersion
componentVersion_dateCreated = (ComponentVersion -> Maybe Text)
-> (ComponentVersion -> Maybe Text -> ComponentVersion)
-> Lens ComponentVersion ComponentVersion (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ComponentVersion' {Maybe Text
dateCreated :: Maybe Text
$sel:dateCreated:ComponentVersion' :: ComponentVersion -> Maybe Text
dateCreated} -> Maybe Text
dateCreated) (\s :: ComponentVersion
s@ComponentVersion' {} Maybe Text
a -> ComponentVersion
s {$sel:dateCreated:ComponentVersion' :: Maybe Text
dateCreated = Maybe Text
a} :: ComponentVersion)
componentVersion_name :: Lens.Lens' ComponentVersion (Prelude.Maybe Prelude.Text)
componentVersion_name :: (Maybe Text -> f (Maybe Text))
-> ComponentVersion -> f ComponentVersion
componentVersion_name = (ComponentVersion -> Maybe Text)
-> (ComponentVersion -> Maybe Text -> ComponentVersion)
-> Lens ComponentVersion ComponentVersion (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ComponentVersion' {Maybe Text
name :: Maybe Text
$sel:name:ComponentVersion' :: ComponentVersion -> Maybe Text
name} -> Maybe Text
name) (\s :: ComponentVersion
s@ComponentVersion' {} Maybe Text
a -> ComponentVersion
s {$sel:name:ComponentVersion' :: Maybe Text
name = Maybe Text
a} :: ComponentVersion)
componentVersion_version :: Lens.Lens' ComponentVersion (Prelude.Maybe Prelude.Text)
componentVersion_version :: (Maybe Text -> f (Maybe Text))
-> ComponentVersion -> f ComponentVersion
componentVersion_version = (ComponentVersion -> Maybe Text)
-> (ComponentVersion -> Maybe Text -> ComponentVersion)
-> Lens ComponentVersion ComponentVersion (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ComponentVersion' {Maybe Text
version :: Maybe Text
$sel:version:ComponentVersion' :: ComponentVersion -> Maybe Text
version} -> Maybe Text
version) (\s :: ComponentVersion
s@ComponentVersion' {} Maybe Text
a -> ComponentVersion
s {$sel:version:ComponentVersion' :: Maybe Text
version = Maybe Text
a} :: ComponentVersion)
componentVersion_type :: Lens.Lens' ComponentVersion (Prelude.Maybe ComponentType)
componentVersion_type :: (Maybe ComponentType -> f (Maybe ComponentType))
-> ComponentVersion -> f ComponentVersion
componentVersion_type = (ComponentVersion -> Maybe ComponentType)
-> (ComponentVersion -> Maybe ComponentType -> ComponentVersion)
-> Lens
ComponentVersion
ComponentVersion
(Maybe ComponentType)
(Maybe ComponentType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ComponentVersion' {Maybe ComponentType
type' :: Maybe ComponentType
$sel:type':ComponentVersion' :: ComponentVersion -> Maybe ComponentType
type'} -> Maybe ComponentType
type') (\s :: ComponentVersion
s@ComponentVersion' {} Maybe ComponentType
a -> ComponentVersion
s {$sel:type':ComponentVersion' :: Maybe ComponentType
type' = Maybe ComponentType
a} :: ComponentVersion)
componentVersion_description :: Lens.Lens' ComponentVersion (Prelude.Maybe Prelude.Text)
componentVersion_description :: (Maybe Text -> f (Maybe Text))
-> ComponentVersion -> f ComponentVersion
componentVersion_description = (ComponentVersion -> Maybe Text)
-> (ComponentVersion -> Maybe Text -> ComponentVersion)
-> Lens ComponentVersion ComponentVersion (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ComponentVersion' {Maybe Text
description :: Maybe Text
$sel:description:ComponentVersion' :: ComponentVersion -> Maybe Text
description} -> Maybe Text
description) (\s :: ComponentVersion
s@ComponentVersion' {} Maybe Text
a -> ComponentVersion
s {$sel:description:ComponentVersion' :: Maybe Text
description = Maybe Text
a} :: ComponentVersion)
instance Core.FromJSON ComponentVersion where
parseJSON :: Value -> Parser ComponentVersion
parseJSON =
String
-> (Object -> Parser ComponentVersion)
-> Value
-> Parser ComponentVersion
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"ComponentVersion"
( \Object
x ->
Maybe Platform
-> Maybe Text
-> Maybe (NonEmpty Text)
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe ComponentType
-> Maybe Text
-> ComponentVersion
ComponentVersion'
(Maybe Platform
-> Maybe Text
-> Maybe (NonEmpty Text)
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe ComponentType
-> Maybe Text
-> ComponentVersion)
-> Parser (Maybe Platform)
-> Parser
(Maybe Text
-> Maybe (NonEmpty Text)
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe ComponentType
-> Maybe Text
-> ComponentVersion)
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 (NonEmpty Text)
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe ComponentType
-> Maybe Text
-> ComponentVersion)
-> Parser (Maybe Text)
-> Parser
(Maybe (NonEmpty Text)
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe ComponentType
-> Maybe Text
-> ComponentVersion)
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 (NonEmpty Text)
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe ComponentType
-> Maybe Text
-> ComponentVersion)
-> Parser (Maybe (NonEmpty Text))
-> Parser
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe ComponentType
-> Maybe Text
-> ComponentVersion)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (NonEmpty Text))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"supportedOsVersions")
Parser
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe ComponentType
-> Maybe Text
-> ComponentVersion)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe ComponentType
-> Maybe Text
-> ComponentVersion)
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 ComponentType
-> Maybe Text
-> ComponentVersion)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Maybe Text
-> Maybe ComponentType
-> Maybe Text
-> ComponentVersion)
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 ComponentType
-> Maybe Text
-> ComponentVersion)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Maybe ComponentType -> Maybe Text -> ComponentVersion)
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 ComponentType -> Maybe Text -> ComponentVersion)
-> Parser (Maybe Text)
-> Parser (Maybe ComponentType -> Maybe Text -> ComponentVersion)
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 ComponentType -> Maybe Text -> ComponentVersion)
-> Parser (Maybe ComponentType)
-> Parser (Maybe Text -> ComponentVersion)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe ComponentType)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"type")
Parser (Maybe Text -> ComponentVersion)
-> Parser (Maybe Text) -> Parser ComponentVersion
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
"description")
)
instance Prelude.Hashable ComponentVersion
instance Prelude.NFData ComponentVersion