{-# 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.CloudComponentStatus where
import qualified Amazonka.Core as Core
import Amazonka.GreengrassV2.Types.CloudComponentState
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data CloudComponentStatus = CloudComponentStatus'
{
CloudComponentStatus -> Maybe CloudComponentState
componentState :: Prelude.Maybe CloudComponentState,
CloudComponentStatus -> Maybe Text
message :: Prelude.Maybe Prelude.Text,
CloudComponentStatus -> Maybe (HashMap Text Text)
errors :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text)
}
deriving (CloudComponentStatus -> CloudComponentStatus -> Bool
(CloudComponentStatus -> CloudComponentStatus -> Bool)
-> (CloudComponentStatus -> CloudComponentStatus -> Bool)
-> Eq CloudComponentStatus
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CloudComponentStatus -> CloudComponentStatus -> Bool
$c/= :: CloudComponentStatus -> CloudComponentStatus -> Bool
== :: CloudComponentStatus -> CloudComponentStatus -> Bool
$c== :: CloudComponentStatus -> CloudComponentStatus -> Bool
Prelude.Eq, ReadPrec [CloudComponentStatus]
ReadPrec CloudComponentStatus
Int -> ReadS CloudComponentStatus
ReadS [CloudComponentStatus]
(Int -> ReadS CloudComponentStatus)
-> ReadS [CloudComponentStatus]
-> ReadPrec CloudComponentStatus
-> ReadPrec [CloudComponentStatus]
-> Read CloudComponentStatus
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CloudComponentStatus]
$creadListPrec :: ReadPrec [CloudComponentStatus]
readPrec :: ReadPrec CloudComponentStatus
$creadPrec :: ReadPrec CloudComponentStatus
readList :: ReadS [CloudComponentStatus]
$creadList :: ReadS [CloudComponentStatus]
readsPrec :: Int -> ReadS CloudComponentStatus
$creadsPrec :: Int -> ReadS CloudComponentStatus
Prelude.Read, Int -> CloudComponentStatus -> ShowS
[CloudComponentStatus] -> ShowS
CloudComponentStatus -> String
(Int -> CloudComponentStatus -> ShowS)
-> (CloudComponentStatus -> String)
-> ([CloudComponentStatus] -> ShowS)
-> Show CloudComponentStatus
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CloudComponentStatus] -> ShowS
$cshowList :: [CloudComponentStatus] -> ShowS
show :: CloudComponentStatus -> String
$cshow :: CloudComponentStatus -> String
showsPrec :: Int -> CloudComponentStatus -> ShowS
$cshowsPrec :: Int -> CloudComponentStatus -> ShowS
Prelude.Show, (forall x. CloudComponentStatus -> Rep CloudComponentStatus x)
-> (forall x. Rep CloudComponentStatus x -> CloudComponentStatus)
-> Generic CloudComponentStatus
forall x. Rep CloudComponentStatus x -> CloudComponentStatus
forall x. CloudComponentStatus -> Rep CloudComponentStatus x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CloudComponentStatus x -> CloudComponentStatus
$cfrom :: forall x. CloudComponentStatus -> Rep CloudComponentStatus x
Prelude.Generic)
newCloudComponentStatus ::
CloudComponentStatus
newCloudComponentStatus :: CloudComponentStatus
newCloudComponentStatus =
CloudComponentStatus' :: Maybe CloudComponentState
-> Maybe Text -> Maybe (HashMap Text Text) -> CloudComponentStatus
CloudComponentStatus'
{ $sel:componentState:CloudComponentStatus' :: Maybe CloudComponentState
componentState =
Maybe CloudComponentState
forall a. Maybe a
Prelude.Nothing,
$sel:message:CloudComponentStatus' :: Maybe Text
message = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:errors:CloudComponentStatus' :: Maybe (HashMap Text Text)
errors = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing
}
cloudComponentStatus_componentState :: Lens.Lens' CloudComponentStatus (Prelude.Maybe CloudComponentState)
cloudComponentStatus_componentState :: (Maybe CloudComponentState -> f (Maybe CloudComponentState))
-> CloudComponentStatus -> f CloudComponentStatus
cloudComponentStatus_componentState = (CloudComponentStatus -> Maybe CloudComponentState)
-> (CloudComponentStatus
-> Maybe CloudComponentState -> CloudComponentStatus)
-> Lens
CloudComponentStatus
CloudComponentStatus
(Maybe CloudComponentState)
(Maybe CloudComponentState)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CloudComponentStatus' {Maybe CloudComponentState
componentState :: Maybe CloudComponentState
$sel:componentState:CloudComponentStatus' :: CloudComponentStatus -> Maybe CloudComponentState
componentState} -> Maybe CloudComponentState
componentState) (\s :: CloudComponentStatus
s@CloudComponentStatus' {} Maybe CloudComponentState
a -> CloudComponentStatus
s {$sel:componentState:CloudComponentStatus' :: Maybe CloudComponentState
componentState = Maybe CloudComponentState
a} :: CloudComponentStatus)
cloudComponentStatus_message :: Lens.Lens' CloudComponentStatus (Prelude.Maybe Prelude.Text)
cloudComponentStatus_message :: (Maybe Text -> f (Maybe Text))
-> CloudComponentStatus -> f CloudComponentStatus
cloudComponentStatus_message = (CloudComponentStatus -> Maybe Text)
-> (CloudComponentStatus -> Maybe Text -> CloudComponentStatus)
-> Lens
CloudComponentStatus CloudComponentStatus (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CloudComponentStatus' {Maybe Text
message :: Maybe Text
$sel:message:CloudComponentStatus' :: CloudComponentStatus -> Maybe Text
message} -> Maybe Text
message) (\s :: CloudComponentStatus
s@CloudComponentStatus' {} Maybe Text
a -> CloudComponentStatus
s {$sel:message:CloudComponentStatus' :: Maybe Text
message = Maybe Text
a} :: CloudComponentStatus)
cloudComponentStatus_errors :: Lens.Lens' CloudComponentStatus (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
cloudComponentStatus_errors :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> CloudComponentStatus -> f CloudComponentStatus
cloudComponentStatus_errors = (CloudComponentStatus -> Maybe (HashMap Text Text))
-> (CloudComponentStatus
-> Maybe (HashMap Text Text) -> CloudComponentStatus)
-> Lens
CloudComponentStatus
CloudComponentStatus
(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 (\CloudComponentStatus' {Maybe (HashMap Text Text)
errors :: Maybe (HashMap Text Text)
$sel:errors:CloudComponentStatus' :: CloudComponentStatus -> Maybe (HashMap Text Text)
errors} -> Maybe (HashMap Text Text)
errors) (\s :: CloudComponentStatus
s@CloudComponentStatus' {} Maybe (HashMap Text Text)
a -> CloudComponentStatus
s {$sel:errors:CloudComponentStatus' :: Maybe (HashMap Text Text)
errors = Maybe (HashMap Text Text)
a} :: CloudComponentStatus) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> CloudComponentStatus -> f CloudComponentStatus)
-> ((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)))
-> CloudComponentStatus
-> f CloudComponentStatus
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
instance Core.FromJSON CloudComponentStatus where
parseJSON :: Value -> Parser CloudComponentStatus
parseJSON =
String
-> (Object -> Parser CloudComponentStatus)
-> Value
-> Parser CloudComponentStatus
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"CloudComponentStatus"
( \Object
x ->
Maybe CloudComponentState
-> Maybe Text -> Maybe (HashMap Text Text) -> CloudComponentStatus
CloudComponentStatus'
(Maybe CloudComponentState
-> Maybe Text -> Maybe (HashMap Text Text) -> CloudComponentStatus)
-> Parser (Maybe CloudComponentState)
-> Parser
(Maybe Text -> Maybe (HashMap Text Text) -> CloudComponentStatus)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe CloudComponentState)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"componentState")
Parser
(Maybe Text -> Maybe (HashMap Text Text) -> CloudComponentStatus)
-> Parser (Maybe Text)
-> Parser (Maybe (HashMap Text Text) -> CloudComponentStatus)
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
"message")
Parser (Maybe (HashMap Text Text) -> CloudComponentStatus)
-> Parser (Maybe (HashMap Text Text))
-> Parser CloudComponentStatus
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (Maybe (HashMap Text Text)))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"errors" Parser (Maybe (Maybe (HashMap Text Text)))
-> Maybe (HashMap Text Text) -> Parser (Maybe (HashMap Text Text))
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe (HashMap Text Text)
forall a. Monoid a => a
Prelude.mempty)
)
instance Prelude.Hashable CloudComponentStatus
instance Prelude.NFData CloudComponentStatus