module Stratosphere.IoT.Thing (
module Exports, Thing(..), mkThing
) where
import qualified Data.Aeson as JSON
import qualified Stratosphere.Prelude as Prelude
import Stratosphere.Property
import {-# SOURCE #-} Stratosphere.IoT.Thing.AttributePayloadProperty as Exports
import Stratosphere.ResourceProperties
import Stratosphere.Value
data Thing
=
Thing {Thing -> ()
haddock_workaround_ :: (),
Thing -> Maybe AttributePayloadProperty
attributePayload :: (Prelude.Maybe AttributePayloadProperty),
Thing -> Maybe (Value Text)
thingName :: (Prelude.Maybe (Value Prelude.Text))}
deriving stock (Thing -> Thing -> Bool
(Thing -> Thing -> Bool) -> (Thing -> Thing -> Bool) -> Eq Thing
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Thing -> Thing -> Bool
== :: Thing -> Thing -> Bool
$c/= :: Thing -> Thing -> Bool
/= :: Thing -> Thing -> Bool
Prelude.Eq, Int -> Thing -> ShowS
[Thing] -> ShowS
Thing -> String
(Int -> Thing -> ShowS)
-> (Thing -> String) -> ([Thing] -> ShowS) -> Show Thing
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> Thing -> ShowS
showsPrec :: Int -> Thing -> ShowS
$cshow :: Thing -> String
show :: Thing -> String
$cshowList :: [Thing] -> ShowS
showList :: [Thing] -> ShowS
Prelude.Show)
mkThing :: Thing
mkThing :: Thing
mkThing
= Thing
{haddock_workaround_ :: ()
haddock_workaround_ = (), attributePayload :: Maybe AttributePayloadProperty
attributePayload = Maybe AttributePayloadProperty
forall a. Maybe a
Prelude.Nothing,
thingName :: Maybe (Value Text)
thingName = Maybe (Value Text)
forall a. Maybe a
Prelude.Nothing}
instance ToResourceProperties Thing where
toResourceProperties :: Thing -> ResourceProperties
toResourceProperties Thing {Maybe (Value Text)
Maybe AttributePayloadProperty
()
haddock_workaround_ :: Thing -> ()
attributePayload :: Thing -> Maybe AttributePayloadProperty
thingName :: Thing -> Maybe (Value Text)
haddock_workaround_ :: ()
attributePayload :: Maybe AttributePayloadProperty
thingName :: Maybe (Value Text)
..}
= ResourceProperties
{awsType :: Text
awsType = Text
"AWS::IoT::Thing", supportsTags :: Bool
supportsTags = Bool
Prelude.False,
properties :: Object
properties = [Item Object] -> Object
forall l. IsList l => [Item l] -> l
Prelude.fromList
([Maybe (Key, Value)] -> [(Key, Value)]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[Key -> AttributePayloadProperty -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"AttributePayload" (AttributePayloadProperty -> (Key, Value))
-> Maybe AttributePayloadProperty -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe AttributePayloadProperty
attributePayload,
Key -> Value Text -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"ThingName" (Value Text -> (Key, Value))
-> Maybe (Value Text) -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (Value Text)
thingName])}
instance JSON.ToJSON Thing where
toJSON :: Thing -> Value
toJSON Thing {Maybe (Value Text)
Maybe AttributePayloadProperty
()
haddock_workaround_ :: Thing -> ()
attributePayload :: Thing -> Maybe AttributePayloadProperty
thingName :: Thing -> Maybe (Value Text)
haddock_workaround_ :: ()
attributePayload :: Maybe AttributePayloadProperty
thingName :: Maybe (Value Text)
..}
= [(Key, Value)] -> Value
JSON.object
([Item [(Key, Value)]] -> [(Key, Value)]
forall l. IsList l => [Item l] -> l
Prelude.fromList
([Maybe (Key, Value)] -> [(Key, Value)]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[Key -> AttributePayloadProperty -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"AttributePayload" (AttributePayloadProperty -> (Key, Value))
-> Maybe AttributePayloadProperty -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe AttributePayloadProperty
attributePayload,
Key -> Value Text -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"ThingName" (Value Text -> (Key, Value))
-> Maybe (Value Text) -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (Value Text)
thingName]))
instance Property "AttributePayload" Thing where
type PropertyType "AttributePayload" Thing = AttributePayloadProperty
set :: PropertyType "AttributePayload" Thing -> Thing -> Thing
set PropertyType "AttributePayload" Thing
newValue Thing {Maybe (Value Text)
Maybe AttributePayloadProperty
()
haddock_workaround_ :: Thing -> ()
attributePayload :: Thing -> Maybe AttributePayloadProperty
thingName :: Thing -> Maybe (Value Text)
haddock_workaround_ :: ()
attributePayload :: Maybe AttributePayloadProperty
thingName :: Maybe (Value Text)
..}
= Thing {attributePayload :: Maybe AttributePayloadProperty
attributePayload = AttributePayloadProperty -> Maybe AttributePayloadProperty
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure PropertyType "AttributePayload" Thing
AttributePayloadProperty
newValue, Maybe (Value Text)
()
haddock_workaround_ :: ()
thingName :: Maybe (Value Text)
haddock_workaround_ :: ()
thingName :: Maybe (Value Text)
..}
instance Property "ThingName" Thing where
type PropertyType "ThingName" Thing = Value Prelude.Text
set :: PropertyType "ThingName" Thing -> Thing -> Thing
set PropertyType "ThingName" Thing
newValue Thing {Maybe (Value Text)
Maybe AttributePayloadProperty
()
haddock_workaround_ :: Thing -> ()
attributePayload :: Thing -> Maybe AttributePayloadProperty
thingName :: Thing -> Maybe (Value Text)
haddock_workaround_ :: ()
attributePayload :: Maybe AttributePayloadProperty
thingName :: Maybe (Value Text)
..}
= Thing {thingName :: Maybe (Value Text)
thingName = Value Text -> Maybe (Value Text)
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure PropertyType "ThingName" Thing
Value Text
newValue, Maybe AttributePayloadProperty
()
haddock_workaround_ :: ()
attributePayload :: Maybe AttributePayloadProperty
haddock_workaround_ :: ()
attributePayload :: Maybe AttributePayloadProperty
..}