{-# 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.IoT.Types.ThingGroupDocument where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data ThingGroupDocument = ThingGroupDocument'
{
ThingGroupDocument -> Maybe [Text]
parentGroupNames :: Prelude.Maybe [Prelude.Text],
ThingGroupDocument -> Maybe Text
thingGroupId :: Prelude.Maybe Prelude.Text,
ThingGroupDocument -> Maybe Text
thingGroupName :: Prelude.Maybe Prelude.Text,
ThingGroupDocument -> Maybe (HashMap Text Text)
attributes :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
ThingGroupDocument -> Maybe Text
thingGroupDescription :: Prelude.Maybe Prelude.Text
}
deriving (ThingGroupDocument -> ThingGroupDocument -> Bool
(ThingGroupDocument -> ThingGroupDocument -> Bool)
-> (ThingGroupDocument -> ThingGroupDocument -> Bool)
-> Eq ThingGroupDocument
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ThingGroupDocument -> ThingGroupDocument -> Bool
$c/= :: ThingGroupDocument -> ThingGroupDocument -> Bool
== :: ThingGroupDocument -> ThingGroupDocument -> Bool
$c== :: ThingGroupDocument -> ThingGroupDocument -> Bool
Prelude.Eq, ReadPrec [ThingGroupDocument]
ReadPrec ThingGroupDocument
Int -> ReadS ThingGroupDocument
ReadS [ThingGroupDocument]
(Int -> ReadS ThingGroupDocument)
-> ReadS [ThingGroupDocument]
-> ReadPrec ThingGroupDocument
-> ReadPrec [ThingGroupDocument]
-> Read ThingGroupDocument
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ThingGroupDocument]
$creadListPrec :: ReadPrec [ThingGroupDocument]
readPrec :: ReadPrec ThingGroupDocument
$creadPrec :: ReadPrec ThingGroupDocument
readList :: ReadS [ThingGroupDocument]
$creadList :: ReadS [ThingGroupDocument]
readsPrec :: Int -> ReadS ThingGroupDocument
$creadsPrec :: Int -> ReadS ThingGroupDocument
Prelude.Read, Int -> ThingGroupDocument -> ShowS
[ThingGroupDocument] -> ShowS
ThingGroupDocument -> String
(Int -> ThingGroupDocument -> ShowS)
-> (ThingGroupDocument -> String)
-> ([ThingGroupDocument] -> ShowS)
-> Show ThingGroupDocument
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ThingGroupDocument] -> ShowS
$cshowList :: [ThingGroupDocument] -> ShowS
show :: ThingGroupDocument -> String
$cshow :: ThingGroupDocument -> String
showsPrec :: Int -> ThingGroupDocument -> ShowS
$cshowsPrec :: Int -> ThingGroupDocument -> ShowS
Prelude.Show, (forall x. ThingGroupDocument -> Rep ThingGroupDocument x)
-> (forall x. Rep ThingGroupDocument x -> ThingGroupDocument)
-> Generic ThingGroupDocument
forall x. Rep ThingGroupDocument x -> ThingGroupDocument
forall x. ThingGroupDocument -> Rep ThingGroupDocument x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ThingGroupDocument x -> ThingGroupDocument
$cfrom :: forall x. ThingGroupDocument -> Rep ThingGroupDocument x
Prelude.Generic)
newThingGroupDocument ::
ThingGroupDocument
newThingGroupDocument :: ThingGroupDocument
newThingGroupDocument =
ThingGroupDocument' :: Maybe [Text]
-> Maybe Text
-> Maybe Text
-> Maybe (HashMap Text Text)
-> Maybe Text
-> ThingGroupDocument
ThingGroupDocument'
{ $sel:parentGroupNames:ThingGroupDocument' :: Maybe [Text]
parentGroupNames =
Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
$sel:thingGroupId:ThingGroupDocument' :: Maybe Text
thingGroupId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:thingGroupName:ThingGroupDocument' :: Maybe Text
thingGroupName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:attributes:ThingGroupDocument' :: Maybe (HashMap Text Text)
attributes = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing,
$sel:thingGroupDescription:ThingGroupDocument' :: Maybe Text
thingGroupDescription = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
thingGroupDocument_parentGroupNames :: Lens.Lens' ThingGroupDocument (Prelude.Maybe [Prelude.Text])
thingGroupDocument_parentGroupNames :: (Maybe [Text] -> f (Maybe [Text]))
-> ThingGroupDocument -> f ThingGroupDocument
thingGroupDocument_parentGroupNames = (ThingGroupDocument -> Maybe [Text])
-> (ThingGroupDocument -> Maybe [Text] -> ThingGroupDocument)
-> Lens
ThingGroupDocument ThingGroupDocument (Maybe [Text]) (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ThingGroupDocument' {Maybe [Text]
parentGroupNames :: Maybe [Text]
$sel:parentGroupNames:ThingGroupDocument' :: ThingGroupDocument -> Maybe [Text]
parentGroupNames} -> Maybe [Text]
parentGroupNames) (\s :: ThingGroupDocument
s@ThingGroupDocument' {} Maybe [Text]
a -> ThingGroupDocument
s {$sel:parentGroupNames:ThingGroupDocument' :: Maybe [Text]
parentGroupNames = Maybe [Text]
a} :: ThingGroupDocument) ((Maybe [Text] -> f (Maybe [Text]))
-> ThingGroupDocument -> f ThingGroupDocument)
-> ((Maybe [Text] -> f (Maybe [Text]))
-> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> ThingGroupDocument
-> f ThingGroupDocument
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
thingGroupDocument_thingGroupId :: Lens.Lens' ThingGroupDocument (Prelude.Maybe Prelude.Text)
thingGroupDocument_thingGroupId :: (Maybe Text -> f (Maybe Text))
-> ThingGroupDocument -> f ThingGroupDocument
thingGroupDocument_thingGroupId = (ThingGroupDocument -> Maybe Text)
-> (ThingGroupDocument -> Maybe Text -> ThingGroupDocument)
-> Lens
ThingGroupDocument ThingGroupDocument (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ThingGroupDocument' {Maybe Text
thingGroupId :: Maybe Text
$sel:thingGroupId:ThingGroupDocument' :: ThingGroupDocument -> Maybe Text
thingGroupId} -> Maybe Text
thingGroupId) (\s :: ThingGroupDocument
s@ThingGroupDocument' {} Maybe Text
a -> ThingGroupDocument
s {$sel:thingGroupId:ThingGroupDocument' :: Maybe Text
thingGroupId = Maybe Text
a} :: ThingGroupDocument)
thingGroupDocument_thingGroupName :: Lens.Lens' ThingGroupDocument (Prelude.Maybe Prelude.Text)
thingGroupDocument_thingGroupName :: (Maybe Text -> f (Maybe Text))
-> ThingGroupDocument -> f ThingGroupDocument
thingGroupDocument_thingGroupName = (ThingGroupDocument -> Maybe Text)
-> (ThingGroupDocument -> Maybe Text -> ThingGroupDocument)
-> Lens
ThingGroupDocument ThingGroupDocument (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ThingGroupDocument' {Maybe Text
thingGroupName :: Maybe Text
$sel:thingGroupName:ThingGroupDocument' :: ThingGroupDocument -> Maybe Text
thingGroupName} -> Maybe Text
thingGroupName) (\s :: ThingGroupDocument
s@ThingGroupDocument' {} Maybe Text
a -> ThingGroupDocument
s {$sel:thingGroupName:ThingGroupDocument' :: Maybe Text
thingGroupName = Maybe Text
a} :: ThingGroupDocument)
thingGroupDocument_attributes :: Lens.Lens' ThingGroupDocument (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
thingGroupDocument_attributes :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> ThingGroupDocument -> f ThingGroupDocument
thingGroupDocument_attributes = (ThingGroupDocument -> Maybe (HashMap Text Text))
-> (ThingGroupDocument
-> Maybe (HashMap Text Text) -> ThingGroupDocument)
-> Lens
ThingGroupDocument
ThingGroupDocument
(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 (\ThingGroupDocument' {Maybe (HashMap Text Text)
attributes :: Maybe (HashMap Text Text)
$sel:attributes:ThingGroupDocument' :: ThingGroupDocument -> Maybe (HashMap Text Text)
attributes} -> Maybe (HashMap Text Text)
attributes) (\s :: ThingGroupDocument
s@ThingGroupDocument' {} Maybe (HashMap Text Text)
a -> ThingGroupDocument
s {$sel:attributes:ThingGroupDocument' :: Maybe (HashMap Text Text)
attributes = Maybe (HashMap Text Text)
a} :: ThingGroupDocument) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> ThingGroupDocument -> f ThingGroupDocument)
-> ((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)))
-> ThingGroupDocument
-> f ThingGroupDocument
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
thingGroupDocument_thingGroupDescription :: Lens.Lens' ThingGroupDocument (Prelude.Maybe Prelude.Text)
thingGroupDocument_thingGroupDescription :: (Maybe Text -> f (Maybe Text))
-> ThingGroupDocument -> f ThingGroupDocument
thingGroupDocument_thingGroupDescription = (ThingGroupDocument -> Maybe Text)
-> (ThingGroupDocument -> Maybe Text -> ThingGroupDocument)
-> Lens
ThingGroupDocument ThingGroupDocument (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ThingGroupDocument' {Maybe Text
thingGroupDescription :: Maybe Text
$sel:thingGroupDescription:ThingGroupDocument' :: ThingGroupDocument -> Maybe Text
thingGroupDescription} -> Maybe Text
thingGroupDescription) (\s :: ThingGroupDocument
s@ThingGroupDocument' {} Maybe Text
a -> ThingGroupDocument
s {$sel:thingGroupDescription:ThingGroupDocument' :: Maybe Text
thingGroupDescription = Maybe Text
a} :: ThingGroupDocument)
instance Core.FromJSON ThingGroupDocument where
parseJSON :: Value -> Parser ThingGroupDocument
parseJSON =
String
-> (Object -> Parser ThingGroupDocument)
-> Value
-> Parser ThingGroupDocument
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"ThingGroupDocument"
( \Object
x ->
Maybe [Text]
-> Maybe Text
-> Maybe Text
-> Maybe (HashMap Text Text)
-> Maybe Text
-> ThingGroupDocument
ThingGroupDocument'
(Maybe [Text]
-> Maybe Text
-> Maybe Text
-> Maybe (HashMap Text Text)
-> Maybe Text
-> ThingGroupDocument)
-> Parser (Maybe [Text])
-> Parser
(Maybe Text
-> Maybe Text
-> Maybe (HashMap Text Text)
-> Maybe Text
-> ThingGroupDocument)
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
"parentGroupNames"
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
-> Maybe Text
-> Maybe (HashMap Text Text)
-> Maybe Text
-> ThingGroupDocument)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Maybe (HashMap Text Text) -> Maybe Text -> ThingGroupDocument)
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
"thingGroupId")
Parser
(Maybe Text
-> Maybe (HashMap Text Text) -> Maybe Text -> ThingGroupDocument)
-> Parser (Maybe Text)
-> Parser
(Maybe (HashMap Text Text) -> Maybe Text -> ThingGroupDocument)
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
"thingGroupName")
Parser
(Maybe (HashMap Text Text) -> Maybe Text -> ThingGroupDocument)
-> Parser (Maybe (HashMap Text Text))
-> Parser (Maybe Text -> ThingGroupDocument)
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
"attributes" 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)
Parser (Maybe Text -> ThingGroupDocument)
-> Parser (Maybe Text) -> Parser ThingGroupDocument
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
"thingGroupDescription")
)
instance Prelude.Hashable ThingGroupDocument
instance Prelude.NFData ThingGroupDocument