{-# 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.ComponentConfigurationUpdate where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data ComponentConfigurationUpdate = ComponentConfigurationUpdate'
{
ComponentConfigurationUpdate -> Maybe [Text]
reset :: Prelude.Maybe [Prelude.Text],
ComponentConfigurationUpdate -> Maybe Text
merge :: Prelude.Maybe Prelude.Text
}
deriving (ComponentConfigurationUpdate
-> ComponentConfigurationUpdate -> Bool
(ComponentConfigurationUpdate
-> ComponentConfigurationUpdate -> Bool)
-> (ComponentConfigurationUpdate
-> ComponentConfigurationUpdate -> Bool)
-> Eq ComponentConfigurationUpdate
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ComponentConfigurationUpdate
-> ComponentConfigurationUpdate -> Bool
$c/= :: ComponentConfigurationUpdate
-> ComponentConfigurationUpdate -> Bool
== :: ComponentConfigurationUpdate
-> ComponentConfigurationUpdate -> Bool
$c== :: ComponentConfigurationUpdate
-> ComponentConfigurationUpdate -> Bool
Prelude.Eq, ReadPrec [ComponentConfigurationUpdate]
ReadPrec ComponentConfigurationUpdate
Int -> ReadS ComponentConfigurationUpdate
ReadS [ComponentConfigurationUpdate]
(Int -> ReadS ComponentConfigurationUpdate)
-> ReadS [ComponentConfigurationUpdate]
-> ReadPrec ComponentConfigurationUpdate
-> ReadPrec [ComponentConfigurationUpdate]
-> Read ComponentConfigurationUpdate
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ComponentConfigurationUpdate]
$creadListPrec :: ReadPrec [ComponentConfigurationUpdate]
readPrec :: ReadPrec ComponentConfigurationUpdate
$creadPrec :: ReadPrec ComponentConfigurationUpdate
readList :: ReadS [ComponentConfigurationUpdate]
$creadList :: ReadS [ComponentConfigurationUpdate]
readsPrec :: Int -> ReadS ComponentConfigurationUpdate
$creadsPrec :: Int -> ReadS ComponentConfigurationUpdate
Prelude.Read, Int -> ComponentConfigurationUpdate -> ShowS
[ComponentConfigurationUpdate] -> ShowS
ComponentConfigurationUpdate -> String
(Int -> ComponentConfigurationUpdate -> ShowS)
-> (ComponentConfigurationUpdate -> String)
-> ([ComponentConfigurationUpdate] -> ShowS)
-> Show ComponentConfigurationUpdate
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ComponentConfigurationUpdate] -> ShowS
$cshowList :: [ComponentConfigurationUpdate] -> ShowS
show :: ComponentConfigurationUpdate -> String
$cshow :: ComponentConfigurationUpdate -> String
showsPrec :: Int -> ComponentConfigurationUpdate -> ShowS
$cshowsPrec :: Int -> ComponentConfigurationUpdate -> ShowS
Prelude.Show, (forall x.
ComponentConfigurationUpdate -> Rep ComponentConfigurationUpdate x)
-> (forall x.
Rep ComponentConfigurationUpdate x -> ComponentConfigurationUpdate)
-> Generic ComponentConfigurationUpdate
forall x.
Rep ComponentConfigurationUpdate x -> ComponentConfigurationUpdate
forall x.
ComponentConfigurationUpdate -> Rep ComponentConfigurationUpdate x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ComponentConfigurationUpdate x -> ComponentConfigurationUpdate
$cfrom :: forall x.
ComponentConfigurationUpdate -> Rep ComponentConfigurationUpdate x
Prelude.Generic)
newComponentConfigurationUpdate ::
ComponentConfigurationUpdate
newComponentConfigurationUpdate :: ComponentConfigurationUpdate
newComponentConfigurationUpdate =
ComponentConfigurationUpdate' :: Maybe [Text] -> Maybe Text -> ComponentConfigurationUpdate
ComponentConfigurationUpdate'
{ $sel:reset:ComponentConfigurationUpdate' :: Maybe [Text]
reset =
Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
$sel:merge:ComponentConfigurationUpdate' :: Maybe Text
merge = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
componentConfigurationUpdate_reset :: Lens.Lens' ComponentConfigurationUpdate (Prelude.Maybe [Prelude.Text])
componentConfigurationUpdate_reset :: (Maybe [Text] -> f (Maybe [Text]))
-> ComponentConfigurationUpdate -> f ComponentConfigurationUpdate
componentConfigurationUpdate_reset = (ComponentConfigurationUpdate -> Maybe [Text])
-> (ComponentConfigurationUpdate
-> Maybe [Text] -> ComponentConfigurationUpdate)
-> Lens
ComponentConfigurationUpdate
ComponentConfigurationUpdate
(Maybe [Text])
(Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ComponentConfigurationUpdate' {Maybe [Text]
reset :: Maybe [Text]
$sel:reset:ComponentConfigurationUpdate' :: ComponentConfigurationUpdate -> Maybe [Text]
reset} -> Maybe [Text]
reset) (\s :: ComponentConfigurationUpdate
s@ComponentConfigurationUpdate' {} Maybe [Text]
a -> ComponentConfigurationUpdate
s {$sel:reset:ComponentConfigurationUpdate' :: Maybe [Text]
reset = Maybe [Text]
a} :: ComponentConfigurationUpdate) ((Maybe [Text] -> f (Maybe [Text]))
-> ComponentConfigurationUpdate -> f ComponentConfigurationUpdate)
-> ((Maybe [Text] -> f (Maybe [Text]))
-> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> ComponentConfigurationUpdate
-> f ComponentConfigurationUpdate
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [Text]) (Maybe [Text]) (Maybe [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 [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
componentConfigurationUpdate_merge :: Lens.Lens' ComponentConfigurationUpdate (Prelude.Maybe Prelude.Text)
componentConfigurationUpdate_merge :: (Maybe Text -> f (Maybe Text))
-> ComponentConfigurationUpdate -> f ComponentConfigurationUpdate
componentConfigurationUpdate_merge = (ComponentConfigurationUpdate -> Maybe Text)
-> (ComponentConfigurationUpdate
-> Maybe Text -> ComponentConfigurationUpdate)
-> Lens
ComponentConfigurationUpdate
ComponentConfigurationUpdate
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ComponentConfigurationUpdate' {Maybe Text
merge :: Maybe Text
$sel:merge:ComponentConfigurationUpdate' :: ComponentConfigurationUpdate -> Maybe Text
merge} -> Maybe Text
merge) (\s :: ComponentConfigurationUpdate
s@ComponentConfigurationUpdate' {} Maybe Text
a -> ComponentConfigurationUpdate
s {$sel:merge:ComponentConfigurationUpdate' :: Maybe Text
merge = Maybe Text
a} :: ComponentConfigurationUpdate)
instance Core.FromJSON ComponentConfigurationUpdate where
parseJSON :: Value -> Parser ComponentConfigurationUpdate
parseJSON =
String
-> (Object -> Parser ComponentConfigurationUpdate)
-> Value
-> Parser ComponentConfigurationUpdate
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"ComponentConfigurationUpdate"
( \Object
x ->
Maybe [Text] -> Maybe Text -> ComponentConfigurationUpdate
ComponentConfigurationUpdate'
(Maybe [Text] -> Maybe Text -> ComponentConfigurationUpdate)
-> Parser (Maybe [Text])
-> Parser (Maybe Text -> ComponentConfigurationUpdate)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe (Maybe [Text]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"reset" Parser (Maybe (Maybe [Text]))
-> Maybe [Text] -> Parser (Maybe [Text])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [Text]
forall a. Monoid a => a
Prelude.mempty)
Parser (Maybe Text -> ComponentConfigurationUpdate)
-> Parser (Maybe Text) -> Parser ComponentConfigurationUpdate
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
"merge")
)
instance
Prelude.Hashable
ComponentConfigurationUpdate
instance Prelude.NFData ComponentConfigurationUpdate
instance Core.ToJSON ComponentConfigurationUpdate where
toJSON :: ComponentConfigurationUpdate -> Value
toJSON ComponentConfigurationUpdate' {Maybe [Text]
Maybe Text
merge :: Maybe Text
reset :: Maybe [Text]
$sel:merge:ComponentConfigurationUpdate' :: ComponentConfigurationUpdate -> Maybe Text
$sel:reset:ComponentConfigurationUpdate' :: ComponentConfigurationUpdate -> Maybe [Text]
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"reset" 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]
reset,
(Text
"merge" 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
merge
]
)