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