{-# 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.ComponentCandidate where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data ComponentCandidate = ComponentCandidate'
{
ComponentCandidate -> Maybe Text
componentVersion :: Prelude.Maybe Prelude.Text,
ComponentCandidate -> Maybe (HashMap Text Text)
versionRequirements :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
ComponentCandidate -> Maybe Text
componentName :: Prelude.Maybe Prelude.Text
}
deriving (ComponentCandidate -> ComponentCandidate -> Bool
(ComponentCandidate -> ComponentCandidate -> Bool)
-> (ComponentCandidate -> ComponentCandidate -> Bool)
-> Eq ComponentCandidate
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ComponentCandidate -> ComponentCandidate -> Bool
$c/= :: ComponentCandidate -> ComponentCandidate -> Bool
== :: ComponentCandidate -> ComponentCandidate -> Bool
$c== :: ComponentCandidate -> ComponentCandidate -> Bool
Prelude.Eq, ReadPrec [ComponentCandidate]
ReadPrec ComponentCandidate
Int -> ReadS ComponentCandidate
ReadS [ComponentCandidate]
(Int -> ReadS ComponentCandidate)
-> ReadS [ComponentCandidate]
-> ReadPrec ComponentCandidate
-> ReadPrec [ComponentCandidate]
-> Read ComponentCandidate
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ComponentCandidate]
$creadListPrec :: ReadPrec [ComponentCandidate]
readPrec :: ReadPrec ComponentCandidate
$creadPrec :: ReadPrec ComponentCandidate
readList :: ReadS [ComponentCandidate]
$creadList :: ReadS [ComponentCandidate]
readsPrec :: Int -> ReadS ComponentCandidate
$creadsPrec :: Int -> ReadS ComponentCandidate
Prelude.Read, Int -> ComponentCandidate -> ShowS
[ComponentCandidate] -> ShowS
ComponentCandidate -> String
(Int -> ComponentCandidate -> ShowS)
-> (ComponentCandidate -> String)
-> ([ComponentCandidate] -> ShowS)
-> Show ComponentCandidate
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ComponentCandidate] -> ShowS
$cshowList :: [ComponentCandidate] -> ShowS
show :: ComponentCandidate -> String
$cshow :: ComponentCandidate -> String
showsPrec :: Int -> ComponentCandidate -> ShowS
$cshowsPrec :: Int -> ComponentCandidate -> ShowS
Prelude.Show, (forall x. ComponentCandidate -> Rep ComponentCandidate x)
-> (forall x. Rep ComponentCandidate x -> ComponentCandidate)
-> Generic ComponentCandidate
forall x. Rep ComponentCandidate x -> ComponentCandidate
forall x. ComponentCandidate -> Rep ComponentCandidate x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ComponentCandidate x -> ComponentCandidate
$cfrom :: forall x. ComponentCandidate -> Rep ComponentCandidate x
Prelude.Generic)
newComponentCandidate ::
ComponentCandidate
newComponentCandidate :: ComponentCandidate
newComponentCandidate =
ComponentCandidate' :: Maybe Text
-> Maybe (HashMap Text Text) -> Maybe Text -> ComponentCandidate
ComponentCandidate'
{ $sel:componentVersion:ComponentCandidate' :: Maybe Text
componentVersion =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:versionRequirements:ComponentCandidate' :: Maybe (HashMap Text Text)
versionRequirements = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing,
$sel:componentName:ComponentCandidate' :: Maybe Text
componentName = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
componentCandidate_componentVersion :: Lens.Lens' ComponentCandidate (Prelude.Maybe Prelude.Text)
componentCandidate_componentVersion :: (Maybe Text -> f (Maybe Text))
-> ComponentCandidate -> f ComponentCandidate
componentCandidate_componentVersion = (ComponentCandidate -> Maybe Text)
-> (ComponentCandidate -> Maybe Text -> ComponentCandidate)
-> Lens
ComponentCandidate ComponentCandidate (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ComponentCandidate' {Maybe Text
componentVersion :: Maybe Text
$sel:componentVersion:ComponentCandidate' :: ComponentCandidate -> Maybe Text
componentVersion} -> Maybe Text
componentVersion) (\s :: ComponentCandidate
s@ComponentCandidate' {} Maybe Text
a -> ComponentCandidate
s {$sel:componentVersion:ComponentCandidate' :: Maybe Text
componentVersion = Maybe Text
a} :: ComponentCandidate)
componentCandidate_versionRequirements :: Lens.Lens' ComponentCandidate (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
componentCandidate_versionRequirements :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> ComponentCandidate -> f ComponentCandidate
componentCandidate_versionRequirements = (ComponentCandidate -> Maybe (HashMap Text Text))
-> (ComponentCandidate
-> Maybe (HashMap Text Text) -> ComponentCandidate)
-> Lens
ComponentCandidate
ComponentCandidate
(Maybe (HashMap Text Text))
(Maybe (HashMap Text Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ComponentCandidate' {Maybe (HashMap Text Text)
versionRequirements :: Maybe (HashMap Text Text)
$sel:versionRequirements:ComponentCandidate' :: ComponentCandidate -> Maybe (HashMap Text Text)
versionRequirements} -> Maybe (HashMap Text Text)
versionRequirements) (\s :: ComponentCandidate
s@ComponentCandidate' {} Maybe (HashMap Text Text)
a -> ComponentCandidate
s {$sel:versionRequirements:ComponentCandidate' :: Maybe (HashMap Text Text)
versionRequirements = Maybe (HashMap Text Text)
a} :: ComponentCandidate) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> ComponentCandidate -> f ComponentCandidate)
-> ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> ComponentCandidate
-> f ComponentCandidate
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
(HashMap Text Text)
(HashMap Text Text)
(HashMap Text Text)
(HashMap Text Text)
-> Iso
(Maybe (HashMap Text Text))
(Maybe (HashMap Text Text))
(Maybe (HashMap Text Text))
(Maybe (HashMap Text 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
(HashMap Text Text)
(HashMap Text Text)
(HashMap Text Text)
(HashMap Text Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
componentCandidate_componentName :: Lens.Lens' ComponentCandidate (Prelude.Maybe Prelude.Text)
componentCandidate_componentName :: (Maybe Text -> f (Maybe Text))
-> ComponentCandidate -> f ComponentCandidate
componentCandidate_componentName = (ComponentCandidate -> Maybe Text)
-> (ComponentCandidate -> Maybe Text -> ComponentCandidate)
-> Lens
ComponentCandidate ComponentCandidate (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ComponentCandidate' {Maybe Text
componentName :: Maybe Text
$sel:componentName:ComponentCandidate' :: ComponentCandidate -> Maybe Text
componentName} -> Maybe Text
componentName) (\s :: ComponentCandidate
s@ComponentCandidate' {} Maybe Text
a -> ComponentCandidate
s {$sel:componentName:ComponentCandidate' :: Maybe Text
componentName = Maybe Text
a} :: ComponentCandidate)
instance Prelude.Hashable ComponentCandidate
instance Prelude.NFData ComponentCandidate
instance Core.ToJSON ComponentCandidate where
toJSON :: ComponentCandidate -> Value
toJSON ComponentCandidate' {Maybe Text
Maybe (HashMap Text Text)
componentName :: Maybe Text
versionRequirements :: Maybe (HashMap Text Text)
componentVersion :: Maybe Text
$sel:componentName:ComponentCandidate' :: ComponentCandidate -> Maybe Text
$sel:versionRequirements:ComponentCandidate' :: ComponentCandidate -> Maybe (HashMap Text Text)
$sel:componentVersion:ComponentCandidate' :: ComponentCandidate -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"componentVersion" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
componentVersion,
(Text
"versionRequirements" Text -> HashMap Text Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(HashMap Text Text -> Pair)
-> Maybe (HashMap Text Text) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (HashMap Text Text)
versionRequirements,
(Text
"componentName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
componentName
]
)