{-# 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.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
data ComponentConfigurationUpdate = ComponentConfigurationUpdate'
{
ComponentConfigurationUpdate -> Maybe Text
merge :: Prelude.Maybe Prelude.Text,
ComponentConfigurationUpdate -> Maybe [Text]
reset :: Prelude.Maybe [Prelude.Text]
}
deriving (ComponentConfigurationUpdate
-> ComponentConfigurationUpdate -> Bool
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]
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
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.
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'
{ $sel:merge:ComponentConfigurationUpdate' :: Maybe Text
merge =
forall a. Maybe a
Prelude.Nothing,
$sel:reset:ComponentConfigurationUpdate' :: Maybe [Text]
reset = forall a. Maybe a
Prelude.Nothing
}
componentConfigurationUpdate_merge :: Lens.Lens' ComponentConfigurationUpdate (Prelude.Maybe Prelude.Text)
componentConfigurationUpdate_merge :: Lens' ComponentConfigurationUpdate (Maybe Text)
componentConfigurationUpdate_merge = 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)
componentConfigurationUpdate_reset :: Lens.Lens' ComponentConfigurationUpdate (Prelude.Maybe [Prelude.Text])
componentConfigurationUpdate_reset :: Lens' ComponentConfigurationUpdate (Maybe [Text])
componentConfigurationUpdate_reset = 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) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instance Data.FromJSON ComponentConfigurationUpdate where
parseJSON :: Value -> Parser ComponentConfigurationUpdate
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"ComponentConfigurationUpdate"
( \Object
x ->
Maybe Text -> Maybe [Text] -> ComponentConfigurationUpdate
ComponentConfigurationUpdate'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"merge")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"reset" forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty)
)
instance
Prelude.Hashable
ComponentConfigurationUpdate
where
hashWithSalt :: Int -> ComponentConfigurationUpdate -> Int
hashWithSalt Int
_salt ComponentConfigurationUpdate' {Maybe [Text]
Maybe Text
reset :: Maybe [Text]
merge :: Maybe Text
$sel:reset:ComponentConfigurationUpdate' :: ComponentConfigurationUpdate -> Maybe [Text]
$sel:merge:ComponentConfigurationUpdate' :: ComponentConfigurationUpdate -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
merge
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Text]
reset
instance Prelude.NFData ComponentConfigurationUpdate where
rnf :: ComponentConfigurationUpdate -> ()
rnf ComponentConfigurationUpdate' {Maybe [Text]
Maybe Text
reset :: Maybe [Text]
merge :: Maybe Text
$sel:reset:ComponentConfigurationUpdate' :: ComponentConfigurationUpdate -> Maybe [Text]
$sel:merge:ComponentConfigurationUpdate' :: ComponentConfigurationUpdate -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
merge seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Text]
reset
instance Data.ToJSON ComponentConfigurationUpdate where
toJSON :: ComponentConfigurationUpdate -> Value
toJSON ComponentConfigurationUpdate' {Maybe [Text]
Maybe Text
reset :: Maybe [Text]
merge :: Maybe Text
$sel:reset:ComponentConfigurationUpdate' :: ComponentConfigurationUpdate -> Maybe [Text]
$sel:merge:ComponentConfigurationUpdate' :: ComponentConfigurationUpdate -> Maybe Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"merge" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
merge,
(Key
"reset" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Text]
reset
]
)