{-# 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.ThingTypeDefinition where
import qualified Amazonka.Core as Core
import Amazonka.IoT.Types.ThingTypeMetadata
import Amazonka.IoT.Types.ThingTypeProperties
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data ThingTypeDefinition = ThingTypeDefinition'
{
ThingTypeDefinition -> Maybe ThingTypeProperties
thingTypeProperties :: Prelude.Maybe ThingTypeProperties,
ThingTypeDefinition -> Maybe Text
thingTypeName :: Prelude.Maybe Prelude.Text,
ThingTypeDefinition -> Maybe ThingTypeMetadata
thingTypeMetadata :: Prelude.Maybe ThingTypeMetadata,
ThingTypeDefinition -> Maybe Text
thingTypeArn :: Prelude.Maybe Prelude.Text
}
deriving (ThingTypeDefinition -> ThingTypeDefinition -> Bool
(ThingTypeDefinition -> ThingTypeDefinition -> Bool)
-> (ThingTypeDefinition -> ThingTypeDefinition -> Bool)
-> Eq ThingTypeDefinition
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ThingTypeDefinition -> ThingTypeDefinition -> Bool
$c/= :: ThingTypeDefinition -> ThingTypeDefinition -> Bool
== :: ThingTypeDefinition -> ThingTypeDefinition -> Bool
$c== :: ThingTypeDefinition -> ThingTypeDefinition -> Bool
Prelude.Eq, ReadPrec [ThingTypeDefinition]
ReadPrec ThingTypeDefinition
Int -> ReadS ThingTypeDefinition
ReadS [ThingTypeDefinition]
(Int -> ReadS ThingTypeDefinition)
-> ReadS [ThingTypeDefinition]
-> ReadPrec ThingTypeDefinition
-> ReadPrec [ThingTypeDefinition]
-> Read ThingTypeDefinition
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ThingTypeDefinition]
$creadListPrec :: ReadPrec [ThingTypeDefinition]
readPrec :: ReadPrec ThingTypeDefinition
$creadPrec :: ReadPrec ThingTypeDefinition
readList :: ReadS [ThingTypeDefinition]
$creadList :: ReadS [ThingTypeDefinition]
readsPrec :: Int -> ReadS ThingTypeDefinition
$creadsPrec :: Int -> ReadS ThingTypeDefinition
Prelude.Read, Int -> ThingTypeDefinition -> ShowS
[ThingTypeDefinition] -> ShowS
ThingTypeDefinition -> String
(Int -> ThingTypeDefinition -> ShowS)
-> (ThingTypeDefinition -> String)
-> ([ThingTypeDefinition] -> ShowS)
-> Show ThingTypeDefinition
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ThingTypeDefinition] -> ShowS
$cshowList :: [ThingTypeDefinition] -> ShowS
show :: ThingTypeDefinition -> String
$cshow :: ThingTypeDefinition -> String
showsPrec :: Int -> ThingTypeDefinition -> ShowS
$cshowsPrec :: Int -> ThingTypeDefinition -> ShowS
Prelude.Show, (forall x. ThingTypeDefinition -> Rep ThingTypeDefinition x)
-> (forall x. Rep ThingTypeDefinition x -> ThingTypeDefinition)
-> Generic ThingTypeDefinition
forall x. Rep ThingTypeDefinition x -> ThingTypeDefinition
forall x. ThingTypeDefinition -> Rep ThingTypeDefinition x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ThingTypeDefinition x -> ThingTypeDefinition
$cfrom :: forall x. ThingTypeDefinition -> Rep ThingTypeDefinition x
Prelude.Generic)
newThingTypeDefinition ::
ThingTypeDefinition
newThingTypeDefinition :: ThingTypeDefinition
newThingTypeDefinition =
ThingTypeDefinition' :: Maybe ThingTypeProperties
-> Maybe Text
-> Maybe ThingTypeMetadata
-> Maybe Text
-> ThingTypeDefinition
ThingTypeDefinition'
{ $sel:thingTypeProperties:ThingTypeDefinition' :: Maybe ThingTypeProperties
thingTypeProperties =
Maybe ThingTypeProperties
forall a. Maybe a
Prelude.Nothing,
$sel:thingTypeName:ThingTypeDefinition' :: Maybe Text
thingTypeName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:thingTypeMetadata:ThingTypeDefinition' :: Maybe ThingTypeMetadata
thingTypeMetadata = Maybe ThingTypeMetadata
forall a. Maybe a
Prelude.Nothing,
$sel:thingTypeArn:ThingTypeDefinition' :: Maybe Text
thingTypeArn = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
thingTypeDefinition_thingTypeProperties :: Lens.Lens' ThingTypeDefinition (Prelude.Maybe ThingTypeProperties)
thingTypeDefinition_thingTypeProperties :: (Maybe ThingTypeProperties -> f (Maybe ThingTypeProperties))
-> ThingTypeDefinition -> f ThingTypeDefinition
thingTypeDefinition_thingTypeProperties = (ThingTypeDefinition -> Maybe ThingTypeProperties)
-> (ThingTypeDefinition
-> Maybe ThingTypeProperties -> ThingTypeDefinition)
-> Lens
ThingTypeDefinition
ThingTypeDefinition
(Maybe ThingTypeProperties)
(Maybe ThingTypeProperties)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ThingTypeDefinition' {Maybe ThingTypeProperties
thingTypeProperties :: Maybe ThingTypeProperties
$sel:thingTypeProperties:ThingTypeDefinition' :: ThingTypeDefinition -> Maybe ThingTypeProperties
thingTypeProperties} -> Maybe ThingTypeProperties
thingTypeProperties) (\s :: ThingTypeDefinition
s@ThingTypeDefinition' {} Maybe ThingTypeProperties
a -> ThingTypeDefinition
s {$sel:thingTypeProperties:ThingTypeDefinition' :: Maybe ThingTypeProperties
thingTypeProperties = Maybe ThingTypeProperties
a} :: ThingTypeDefinition)
thingTypeDefinition_thingTypeName :: Lens.Lens' ThingTypeDefinition (Prelude.Maybe Prelude.Text)
thingTypeDefinition_thingTypeName :: (Maybe Text -> f (Maybe Text))
-> ThingTypeDefinition -> f ThingTypeDefinition
thingTypeDefinition_thingTypeName = (ThingTypeDefinition -> Maybe Text)
-> (ThingTypeDefinition -> Maybe Text -> ThingTypeDefinition)
-> Lens
ThingTypeDefinition ThingTypeDefinition (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ThingTypeDefinition' {Maybe Text
thingTypeName :: Maybe Text
$sel:thingTypeName:ThingTypeDefinition' :: ThingTypeDefinition -> Maybe Text
thingTypeName} -> Maybe Text
thingTypeName) (\s :: ThingTypeDefinition
s@ThingTypeDefinition' {} Maybe Text
a -> ThingTypeDefinition
s {$sel:thingTypeName:ThingTypeDefinition' :: Maybe Text
thingTypeName = Maybe Text
a} :: ThingTypeDefinition)
thingTypeDefinition_thingTypeMetadata :: Lens.Lens' ThingTypeDefinition (Prelude.Maybe ThingTypeMetadata)
thingTypeDefinition_thingTypeMetadata :: (Maybe ThingTypeMetadata -> f (Maybe ThingTypeMetadata))
-> ThingTypeDefinition -> f ThingTypeDefinition
thingTypeDefinition_thingTypeMetadata = (ThingTypeDefinition -> Maybe ThingTypeMetadata)
-> (ThingTypeDefinition
-> Maybe ThingTypeMetadata -> ThingTypeDefinition)
-> Lens
ThingTypeDefinition
ThingTypeDefinition
(Maybe ThingTypeMetadata)
(Maybe ThingTypeMetadata)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ThingTypeDefinition' {Maybe ThingTypeMetadata
thingTypeMetadata :: Maybe ThingTypeMetadata
$sel:thingTypeMetadata:ThingTypeDefinition' :: ThingTypeDefinition -> Maybe ThingTypeMetadata
thingTypeMetadata} -> Maybe ThingTypeMetadata
thingTypeMetadata) (\s :: ThingTypeDefinition
s@ThingTypeDefinition' {} Maybe ThingTypeMetadata
a -> ThingTypeDefinition
s {$sel:thingTypeMetadata:ThingTypeDefinition' :: Maybe ThingTypeMetadata
thingTypeMetadata = Maybe ThingTypeMetadata
a} :: ThingTypeDefinition)
thingTypeDefinition_thingTypeArn :: Lens.Lens' ThingTypeDefinition (Prelude.Maybe Prelude.Text)
thingTypeDefinition_thingTypeArn :: (Maybe Text -> f (Maybe Text))
-> ThingTypeDefinition -> f ThingTypeDefinition
thingTypeDefinition_thingTypeArn = (ThingTypeDefinition -> Maybe Text)
-> (ThingTypeDefinition -> Maybe Text -> ThingTypeDefinition)
-> Lens
ThingTypeDefinition ThingTypeDefinition (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ThingTypeDefinition' {Maybe Text
thingTypeArn :: Maybe Text
$sel:thingTypeArn:ThingTypeDefinition' :: ThingTypeDefinition -> Maybe Text
thingTypeArn} -> Maybe Text
thingTypeArn) (\s :: ThingTypeDefinition
s@ThingTypeDefinition' {} Maybe Text
a -> ThingTypeDefinition
s {$sel:thingTypeArn:ThingTypeDefinition' :: Maybe Text
thingTypeArn = Maybe Text
a} :: ThingTypeDefinition)
instance Core.FromJSON ThingTypeDefinition where
parseJSON :: Value -> Parser ThingTypeDefinition
parseJSON =
String
-> (Object -> Parser ThingTypeDefinition)
-> Value
-> Parser ThingTypeDefinition
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"ThingTypeDefinition"
( \Object
x ->
Maybe ThingTypeProperties
-> Maybe Text
-> Maybe ThingTypeMetadata
-> Maybe Text
-> ThingTypeDefinition
ThingTypeDefinition'
(Maybe ThingTypeProperties
-> Maybe Text
-> Maybe ThingTypeMetadata
-> Maybe Text
-> ThingTypeDefinition)
-> Parser (Maybe ThingTypeProperties)
-> Parser
(Maybe Text
-> Maybe ThingTypeMetadata -> Maybe Text -> ThingTypeDefinition)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe ThingTypeProperties)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"thingTypeProperties")
Parser
(Maybe Text
-> Maybe ThingTypeMetadata -> Maybe Text -> ThingTypeDefinition)
-> Parser (Maybe Text)
-> Parser
(Maybe ThingTypeMetadata -> Maybe Text -> ThingTypeDefinition)
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
"thingTypeName")
Parser
(Maybe ThingTypeMetadata -> Maybe Text -> ThingTypeDefinition)
-> Parser (Maybe ThingTypeMetadata)
-> Parser (Maybe Text -> ThingTypeDefinition)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe ThingTypeMetadata)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"thingTypeMetadata")
Parser (Maybe Text -> ThingTypeDefinition)
-> Parser (Maybe Text) -> Parser ThingTypeDefinition
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
"thingTypeArn")
)
instance Prelude.Hashable ThingTypeDefinition
instance Prelude.NFData ThingTypeDefinition