{-# 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.IoTSiteWise.Types.GreengrassV2 where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data GreengrassV2 = GreengrassV2'
{
GreengrassV2 -> Text
coreDeviceThingName :: Prelude.Text
}
deriving (GreengrassV2 -> GreengrassV2 -> Bool
(GreengrassV2 -> GreengrassV2 -> Bool)
-> (GreengrassV2 -> GreengrassV2 -> Bool) -> Eq GreengrassV2
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GreengrassV2 -> GreengrassV2 -> Bool
$c/= :: GreengrassV2 -> GreengrassV2 -> Bool
== :: GreengrassV2 -> GreengrassV2 -> Bool
$c== :: GreengrassV2 -> GreengrassV2 -> Bool
Prelude.Eq, ReadPrec [GreengrassV2]
ReadPrec GreengrassV2
Int -> ReadS GreengrassV2
ReadS [GreengrassV2]
(Int -> ReadS GreengrassV2)
-> ReadS [GreengrassV2]
-> ReadPrec GreengrassV2
-> ReadPrec [GreengrassV2]
-> Read GreengrassV2
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GreengrassV2]
$creadListPrec :: ReadPrec [GreengrassV2]
readPrec :: ReadPrec GreengrassV2
$creadPrec :: ReadPrec GreengrassV2
readList :: ReadS [GreengrassV2]
$creadList :: ReadS [GreengrassV2]
readsPrec :: Int -> ReadS GreengrassV2
$creadsPrec :: Int -> ReadS GreengrassV2
Prelude.Read, Int -> GreengrassV2 -> ShowS
[GreengrassV2] -> ShowS
GreengrassV2 -> String
(Int -> GreengrassV2 -> ShowS)
-> (GreengrassV2 -> String)
-> ([GreengrassV2] -> ShowS)
-> Show GreengrassV2
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GreengrassV2] -> ShowS
$cshowList :: [GreengrassV2] -> ShowS
show :: GreengrassV2 -> String
$cshow :: GreengrassV2 -> String
showsPrec :: Int -> GreengrassV2 -> ShowS
$cshowsPrec :: Int -> GreengrassV2 -> ShowS
Prelude.Show, (forall x. GreengrassV2 -> Rep GreengrassV2 x)
-> (forall x. Rep GreengrassV2 x -> GreengrassV2)
-> Generic GreengrassV2
forall x. Rep GreengrassV2 x -> GreengrassV2
forall x. GreengrassV2 -> Rep GreengrassV2 x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GreengrassV2 x -> GreengrassV2
$cfrom :: forall x. GreengrassV2 -> Rep GreengrassV2 x
Prelude.Generic)
newGreengrassV2 ::
Prelude.Text ->
GreengrassV2
newGreengrassV2 :: Text -> GreengrassV2
newGreengrassV2 Text
pCoreDeviceThingName_ =
GreengrassV2' :: Text -> GreengrassV2
GreengrassV2'
{ $sel:coreDeviceThingName:GreengrassV2' :: Text
coreDeviceThingName =
Text
pCoreDeviceThingName_
}
greengrassV2_coreDeviceThingName :: Lens.Lens' GreengrassV2 Prelude.Text
greengrassV2_coreDeviceThingName :: (Text -> f Text) -> GreengrassV2 -> f GreengrassV2
greengrassV2_coreDeviceThingName = (GreengrassV2 -> Text)
-> (GreengrassV2 -> Text -> GreengrassV2)
-> Lens GreengrassV2 GreengrassV2 Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GreengrassV2' {Text
coreDeviceThingName :: Text
$sel:coreDeviceThingName:GreengrassV2' :: GreengrassV2 -> Text
coreDeviceThingName} -> Text
coreDeviceThingName) (\s :: GreengrassV2
s@GreengrassV2' {} Text
a -> GreengrassV2
s {$sel:coreDeviceThingName:GreengrassV2' :: Text
coreDeviceThingName = Text
a} :: GreengrassV2)
instance Core.FromJSON GreengrassV2 where
parseJSON :: Value -> Parser GreengrassV2
parseJSON =
String
-> (Object -> Parser GreengrassV2) -> Value -> Parser GreengrassV2
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"GreengrassV2"
( \Object
x ->
Text -> GreengrassV2
GreengrassV2'
(Text -> GreengrassV2) -> Parser Text -> Parser GreengrassV2
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"coreDeviceThingName")
)
instance Prelude.Hashable GreengrassV2
instance Prelude.NFData GreengrassV2
instance Core.ToJSON GreengrassV2 where
toJSON :: GreengrassV2 -> Value
toJSON GreengrassV2' {Text
coreDeviceThingName :: Text
$sel:coreDeviceThingName:GreengrassV2' :: GreengrassV2 -> Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
(Text
"coreDeviceThingName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
coreDeviceThingName)
]
)