{-# 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.GreengrassV2.Types.ComponentLatestVersion where
import qualified Amazonka.Core as Core
import Amazonka.GreengrassV2.Types.ComponentPlatform
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data ComponentLatestVersion = ComponentLatestVersion'
{
ComponentLatestVersion -> Maybe [ComponentPlatform]
platforms :: Prelude.Maybe [ComponentPlatform],
ComponentLatestVersion -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
ComponentLatestVersion -> Maybe Text
componentVersion :: Prelude.Maybe Prelude.Text,
ComponentLatestVersion -> Maybe POSIX
creationTimestamp :: Prelude.Maybe Core.POSIX,
ComponentLatestVersion -> Maybe Text
publisher :: Prelude.Maybe Prelude.Text,
ComponentLatestVersion -> Maybe Text
description :: Prelude.Maybe Prelude.Text
}
deriving (ComponentLatestVersion -> ComponentLatestVersion -> Bool
(ComponentLatestVersion -> ComponentLatestVersion -> Bool)
-> (ComponentLatestVersion -> ComponentLatestVersion -> Bool)
-> Eq ComponentLatestVersion
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ComponentLatestVersion -> ComponentLatestVersion -> Bool
$c/= :: ComponentLatestVersion -> ComponentLatestVersion -> Bool
== :: ComponentLatestVersion -> ComponentLatestVersion -> Bool
$c== :: ComponentLatestVersion -> ComponentLatestVersion -> Bool
Prelude.Eq, ReadPrec [ComponentLatestVersion]
ReadPrec ComponentLatestVersion
Int -> ReadS ComponentLatestVersion
ReadS [ComponentLatestVersion]
(Int -> ReadS ComponentLatestVersion)
-> ReadS [ComponentLatestVersion]
-> ReadPrec ComponentLatestVersion
-> ReadPrec [ComponentLatestVersion]
-> Read ComponentLatestVersion
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ComponentLatestVersion]
$creadListPrec :: ReadPrec [ComponentLatestVersion]
readPrec :: ReadPrec ComponentLatestVersion
$creadPrec :: ReadPrec ComponentLatestVersion
readList :: ReadS [ComponentLatestVersion]
$creadList :: ReadS [ComponentLatestVersion]
readsPrec :: Int -> ReadS ComponentLatestVersion
$creadsPrec :: Int -> ReadS ComponentLatestVersion
Prelude.Read, Int -> ComponentLatestVersion -> ShowS
[ComponentLatestVersion] -> ShowS
ComponentLatestVersion -> String
(Int -> ComponentLatestVersion -> ShowS)
-> (ComponentLatestVersion -> String)
-> ([ComponentLatestVersion] -> ShowS)
-> Show ComponentLatestVersion
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ComponentLatestVersion] -> ShowS
$cshowList :: [ComponentLatestVersion] -> ShowS
show :: ComponentLatestVersion -> String
$cshow :: ComponentLatestVersion -> String
showsPrec :: Int -> ComponentLatestVersion -> ShowS
$cshowsPrec :: Int -> ComponentLatestVersion -> ShowS
Prelude.Show, (forall x. ComponentLatestVersion -> Rep ComponentLatestVersion x)
-> (forall x.
Rep ComponentLatestVersion x -> ComponentLatestVersion)
-> Generic ComponentLatestVersion
forall x. Rep ComponentLatestVersion x -> ComponentLatestVersion
forall x. ComponentLatestVersion -> Rep ComponentLatestVersion x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ComponentLatestVersion x -> ComponentLatestVersion
$cfrom :: forall x. ComponentLatestVersion -> Rep ComponentLatestVersion x
Prelude.Generic)
newComponentLatestVersion ::
ComponentLatestVersion
newComponentLatestVersion :: ComponentLatestVersion
newComponentLatestVersion =
ComponentLatestVersion' :: Maybe [ComponentPlatform]
-> Maybe Text
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> ComponentLatestVersion
ComponentLatestVersion'
{ $sel:platforms:ComponentLatestVersion' :: Maybe [ComponentPlatform]
platforms =
Maybe [ComponentPlatform]
forall a. Maybe a
Prelude.Nothing,
$sel:arn:ComponentLatestVersion' :: Maybe Text
arn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:componentVersion:ComponentLatestVersion' :: Maybe Text
componentVersion = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:creationTimestamp:ComponentLatestVersion' :: Maybe POSIX
creationTimestamp = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
$sel:publisher:ComponentLatestVersion' :: Maybe Text
publisher = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:description:ComponentLatestVersion' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
componentLatestVersion_platforms :: Lens.Lens' ComponentLatestVersion (Prelude.Maybe [ComponentPlatform])
componentLatestVersion_platforms :: (Maybe [ComponentPlatform] -> f (Maybe [ComponentPlatform]))
-> ComponentLatestVersion -> f ComponentLatestVersion
componentLatestVersion_platforms = (ComponentLatestVersion -> Maybe [ComponentPlatform])
-> (ComponentLatestVersion
-> Maybe [ComponentPlatform] -> ComponentLatestVersion)
-> Lens
ComponentLatestVersion
ComponentLatestVersion
(Maybe [ComponentPlatform])
(Maybe [ComponentPlatform])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ComponentLatestVersion' {Maybe [ComponentPlatform]
platforms :: Maybe [ComponentPlatform]
$sel:platforms:ComponentLatestVersion' :: ComponentLatestVersion -> Maybe [ComponentPlatform]
platforms} -> Maybe [ComponentPlatform]
platforms) (\s :: ComponentLatestVersion
s@ComponentLatestVersion' {} Maybe [ComponentPlatform]
a -> ComponentLatestVersion
s {$sel:platforms:ComponentLatestVersion' :: Maybe [ComponentPlatform]
platforms = Maybe [ComponentPlatform]
a} :: ComponentLatestVersion) ((Maybe [ComponentPlatform] -> f (Maybe [ComponentPlatform]))
-> ComponentLatestVersion -> f ComponentLatestVersion)
-> ((Maybe [ComponentPlatform] -> f (Maybe [ComponentPlatform]))
-> Maybe [ComponentPlatform] -> f (Maybe [ComponentPlatform]))
-> (Maybe [ComponentPlatform] -> f (Maybe [ComponentPlatform]))
-> ComponentLatestVersion
-> f ComponentLatestVersion
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
[ComponentPlatform]
[ComponentPlatform]
[ComponentPlatform]
[ComponentPlatform]
-> Iso
(Maybe [ComponentPlatform])
(Maybe [ComponentPlatform])
(Maybe [ComponentPlatform])
(Maybe [ComponentPlatform])
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
[ComponentPlatform]
[ComponentPlatform]
[ComponentPlatform]
[ComponentPlatform]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
componentLatestVersion_arn :: Lens.Lens' ComponentLatestVersion (Prelude.Maybe Prelude.Text)
componentLatestVersion_arn :: (Maybe Text -> f (Maybe Text))
-> ComponentLatestVersion -> f ComponentLatestVersion
componentLatestVersion_arn = (ComponentLatestVersion -> Maybe Text)
-> (ComponentLatestVersion -> Maybe Text -> ComponentLatestVersion)
-> Lens
ComponentLatestVersion
ComponentLatestVersion
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ComponentLatestVersion' {Maybe Text
arn :: Maybe Text
$sel:arn:ComponentLatestVersion' :: ComponentLatestVersion -> Maybe Text
arn} -> Maybe Text
arn) (\s :: ComponentLatestVersion
s@ComponentLatestVersion' {} Maybe Text
a -> ComponentLatestVersion
s {$sel:arn:ComponentLatestVersion' :: Maybe Text
arn = Maybe Text
a} :: ComponentLatestVersion)
componentLatestVersion_componentVersion :: Lens.Lens' ComponentLatestVersion (Prelude.Maybe Prelude.Text)
componentLatestVersion_componentVersion :: (Maybe Text -> f (Maybe Text))
-> ComponentLatestVersion -> f ComponentLatestVersion
componentLatestVersion_componentVersion = (ComponentLatestVersion -> Maybe Text)
-> (ComponentLatestVersion -> Maybe Text -> ComponentLatestVersion)
-> Lens
ComponentLatestVersion
ComponentLatestVersion
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ComponentLatestVersion' {Maybe Text
componentVersion :: Maybe Text
$sel:componentVersion:ComponentLatestVersion' :: ComponentLatestVersion -> Maybe Text
componentVersion} -> Maybe Text
componentVersion) (\s :: ComponentLatestVersion
s@ComponentLatestVersion' {} Maybe Text
a -> ComponentLatestVersion
s {$sel:componentVersion:ComponentLatestVersion' :: Maybe Text
componentVersion = Maybe Text
a} :: ComponentLatestVersion)
componentLatestVersion_creationTimestamp :: Lens.Lens' ComponentLatestVersion (Prelude.Maybe Prelude.UTCTime)
componentLatestVersion_creationTimestamp :: (Maybe UTCTime -> f (Maybe UTCTime))
-> ComponentLatestVersion -> f ComponentLatestVersion
componentLatestVersion_creationTimestamp = (ComponentLatestVersion -> Maybe POSIX)
-> (ComponentLatestVersion
-> Maybe POSIX -> ComponentLatestVersion)
-> Lens
ComponentLatestVersion
ComponentLatestVersion
(Maybe POSIX)
(Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ComponentLatestVersion' {Maybe POSIX
creationTimestamp :: Maybe POSIX
$sel:creationTimestamp:ComponentLatestVersion' :: ComponentLatestVersion -> Maybe POSIX
creationTimestamp} -> Maybe POSIX
creationTimestamp) (\s :: ComponentLatestVersion
s@ComponentLatestVersion' {} Maybe POSIX
a -> ComponentLatestVersion
s {$sel:creationTimestamp:ComponentLatestVersion' :: Maybe POSIX
creationTimestamp = Maybe POSIX
a} :: ComponentLatestVersion) ((Maybe POSIX -> f (Maybe POSIX))
-> ComponentLatestVersion -> f ComponentLatestVersion)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
-> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> ComponentLatestVersion
-> f ComponentLatestVersion
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
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 POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time
componentLatestVersion_publisher :: Lens.Lens' ComponentLatestVersion (Prelude.Maybe Prelude.Text)
componentLatestVersion_publisher :: (Maybe Text -> f (Maybe Text))
-> ComponentLatestVersion -> f ComponentLatestVersion
componentLatestVersion_publisher = (ComponentLatestVersion -> Maybe Text)
-> (ComponentLatestVersion -> Maybe Text -> ComponentLatestVersion)
-> Lens
ComponentLatestVersion
ComponentLatestVersion
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ComponentLatestVersion' {Maybe Text
publisher :: Maybe Text
$sel:publisher:ComponentLatestVersion' :: ComponentLatestVersion -> Maybe Text
publisher} -> Maybe Text
publisher) (\s :: ComponentLatestVersion
s@ComponentLatestVersion' {} Maybe Text
a -> ComponentLatestVersion
s {$sel:publisher:ComponentLatestVersion' :: Maybe Text
publisher = Maybe Text
a} :: ComponentLatestVersion)
componentLatestVersion_description :: Lens.Lens' ComponentLatestVersion (Prelude.Maybe Prelude.Text)
componentLatestVersion_description :: (Maybe Text -> f (Maybe Text))
-> ComponentLatestVersion -> f ComponentLatestVersion
componentLatestVersion_description = (ComponentLatestVersion -> Maybe Text)
-> (ComponentLatestVersion -> Maybe Text -> ComponentLatestVersion)
-> Lens
ComponentLatestVersion
ComponentLatestVersion
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ComponentLatestVersion' {Maybe Text
description :: Maybe Text
$sel:description:ComponentLatestVersion' :: ComponentLatestVersion -> Maybe Text
description} -> Maybe Text
description) (\s :: ComponentLatestVersion
s@ComponentLatestVersion' {} Maybe Text
a -> ComponentLatestVersion
s {$sel:description:ComponentLatestVersion' :: Maybe Text
description = Maybe Text
a} :: ComponentLatestVersion)
instance Core.FromJSON ComponentLatestVersion where
parseJSON :: Value -> Parser ComponentLatestVersion
parseJSON =
String
-> (Object -> Parser ComponentLatestVersion)
-> Value
-> Parser ComponentLatestVersion
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"ComponentLatestVersion"
( \Object
x ->
Maybe [ComponentPlatform]
-> Maybe Text
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> ComponentLatestVersion
ComponentLatestVersion'
(Maybe [ComponentPlatform]
-> Maybe Text
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> ComponentLatestVersion)
-> Parser (Maybe [ComponentPlatform])
-> Parser
(Maybe Text
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> ComponentLatestVersion)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe (Maybe [ComponentPlatform]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"platforms" Parser (Maybe (Maybe [ComponentPlatform]))
-> Maybe [ComponentPlatform] -> Parser (Maybe [ComponentPlatform])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [ComponentPlatform]
forall a. Monoid a => a
Prelude.mempty)
Parser
(Maybe Text
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> ComponentLatestVersion)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> ComponentLatestVersion)
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 POSIX
-> Maybe Text
-> Maybe Text
-> ComponentLatestVersion)
-> Parser (Maybe Text)
-> Parser
(Maybe POSIX -> Maybe Text -> Maybe Text -> ComponentLatestVersion)
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
"componentVersion")
Parser
(Maybe POSIX -> Maybe Text -> Maybe Text -> ComponentLatestVersion)
-> Parser (Maybe POSIX)
-> Parser (Maybe Text -> Maybe Text -> ComponentLatestVersion)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"creationTimestamp")
Parser (Maybe Text -> Maybe Text -> ComponentLatestVersion)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> ComponentLatestVersion)
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
"publisher")
Parser (Maybe Text -> ComponentLatestVersion)
-> Parser (Maybe Text) -> Parser ComponentLatestVersion
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 ComponentLatestVersion
instance Prelude.NFData ComponentLatestVersion