module Stratosphere.IoTWireless.DeviceProfile (
module Exports, DeviceProfile(..), mkDeviceProfile
) where
import qualified Data.Aeson as JSON
import qualified Stratosphere.Prelude as Prelude
import Stratosphere.Property
import {-# SOURCE #-} Stratosphere.IoTWireless.DeviceProfile.LoRaWANDeviceProfileProperty as Exports
import Stratosphere.ResourceProperties
import Stratosphere.Tag
import Stratosphere.Value
data DeviceProfile
=
DeviceProfile {DeviceProfile -> ()
haddock_workaround_ :: (),
DeviceProfile -> Maybe LoRaWANDeviceProfileProperty
loRaWAN :: (Prelude.Maybe LoRaWANDeviceProfileProperty),
DeviceProfile -> Maybe (Value Text)
name :: (Prelude.Maybe (Value Prelude.Text)),
DeviceProfile -> Maybe [Tag]
tags :: (Prelude.Maybe [Tag])}
deriving stock (DeviceProfile -> DeviceProfile -> Bool
(DeviceProfile -> DeviceProfile -> Bool)
-> (DeviceProfile -> DeviceProfile -> Bool) -> Eq DeviceProfile
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: DeviceProfile -> DeviceProfile -> Bool
== :: DeviceProfile -> DeviceProfile -> Bool
$c/= :: DeviceProfile -> DeviceProfile -> Bool
/= :: DeviceProfile -> DeviceProfile -> Bool
Prelude.Eq, Int -> DeviceProfile -> ShowS
[DeviceProfile] -> ShowS
DeviceProfile -> String
(Int -> DeviceProfile -> ShowS)
-> (DeviceProfile -> String)
-> ([DeviceProfile] -> ShowS)
-> Show DeviceProfile
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> DeviceProfile -> ShowS
showsPrec :: Int -> DeviceProfile -> ShowS
$cshow :: DeviceProfile -> String
show :: DeviceProfile -> String
$cshowList :: [DeviceProfile] -> ShowS
showList :: [DeviceProfile] -> ShowS
Prelude.Show)
mkDeviceProfile :: DeviceProfile
mkDeviceProfile :: DeviceProfile
mkDeviceProfile
= DeviceProfile
{haddock_workaround_ :: ()
haddock_workaround_ = (), loRaWAN :: Maybe LoRaWANDeviceProfileProperty
loRaWAN = Maybe LoRaWANDeviceProfileProperty
forall a. Maybe a
Prelude.Nothing,
name :: Maybe (Value Text)
name = Maybe (Value Text)
forall a. Maybe a
Prelude.Nothing, tags :: Maybe [Tag]
tags = Maybe [Tag]
forall a. Maybe a
Prelude.Nothing}
instance ToResourceProperties DeviceProfile where
toResourceProperties :: DeviceProfile -> ResourceProperties
toResourceProperties DeviceProfile {Maybe [Tag]
Maybe (Value Text)
Maybe LoRaWANDeviceProfileProperty
()
haddock_workaround_ :: DeviceProfile -> ()
loRaWAN :: DeviceProfile -> Maybe LoRaWANDeviceProfileProperty
name :: DeviceProfile -> Maybe (Value Text)
tags :: DeviceProfile -> Maybe [Tag]
haddock_workaround_ :: ()
loRaWAN :: Maybe LoRaWANDeviceProfileProperty
name :: Maybe (Value Text)
tags :: Maybe [Tag]
..}
= ResourceProperties
{awsType :: Text
awsType = Text
"AWS::IoTWireless::DeviceProfile",
supportsTags :: Bool
supportsTags = Bool
Prelude.True,
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 -> LoRaWANDeviceProfileProperty -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"LoRaWAN" (LoRaWANDeviceProfileProperty -> (Key, Value))
-> Maybe LoRaWANDeviceProfileProperty -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe LoRaWANDeviceProfileProperty
loRaWAN,
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
"Name" (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)
name,
Key -> [Tag] -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"Tags" ([Tag] -> (Key, Value)) -> Maybe [Tag] -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Tag]
tags])}
instance JSON.ToJSON DeviceProfile where
toJSON :: DeviceProfile -> Value
toJSON DeviceProfile {Maybe [Tag]
Maybe (Value Text)
Maybe LoRaWANDeviceProfileProperty
()
haddock_workaround_ :: DeviceProfile -> ()
loRaWAN :: DeviceProfile -> Maybe LoRaWANDeviceProfileProperty
name :: DeviceProfile -> Maybe (Value Text)
tags :: DeviceProfile -> Maybe [Tag]
haddock_workaround_ :: ()
loRaWAN :: Maybe LoRaWANDeviceProfileProperty
name :: Maybe (Value Text)
tags :: Maybe [Tag]
..}
= [(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 -> LoRaWANDeviceProfileProperty -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"LoRaWAN" (LoRaWANDeviceProfileProperty -> (Key, Value))
-> Maybe LoRaWANDeviceProfileProperty -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe LoRaWANDeviceProfileProperty
loRaWAN,
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
"Name" (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)
name,
Key -> [Tag] -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"Tags" ([Tag] -> (Key, Value)) -> Maybe [Tag] -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Tag]
tags]))
instance Property "LoRaWAN" DeviceProfile where
type PropertyType "LoRaWAN" DeviceProfile = LoRaWANDeviceProfileProperty
set :: PropertyType "LoRaWAN" DeviceProfile
-> DeviceProfile -> DeviceProfile
set PropertyType "LoRaWAN" DeviceProfile
newValue DeviceProfile {Maybe [Tag]
Maybe (Value Text)
Maybe LoRaWANDeviceProfileProperty
()
haddock_workaround_ :: DeviceProfile -> ()
loRaWAN :: DeviceProfile -> Maybe LoRaWANDeviceProfileProperty
name :: DeviceProfile -> Maybe (Value Text)
tags :: DeviceProfile -> Maybe [Tag]
haddock_workaround_ :: ()
loRaWAN :: Maybe LoRaWANDeviceProfileProperty
name :: Maybe (Value Text)
tags :: Maybe [Tag]
..}
= DeviceProfile {loRaWAN :: Maybe LoRaWANDeviceProfileProperty
loRaWAN = LoRaWANDeviceProfileProperty -> Maybe LoRaWANDeviceProfileProperty
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure PropertyType "LoRaWAN" DeviceProfile
LoRaWANDeviceProfileProperty
newValue, Maybe [Tag]
Maybe (Value Text)
()
haddock_workaround_ :: ()
name :: Maybe (Value Text)
tags :: Maybe [Tag]
haddock_workaround_ :: ()
name :: Maybe (Value Text)
tags :: Maybe [Tag]
..}
instance Property "Name" DeviceProfile where
type PropertyType "Name" DeviceProfile = Value Prelude.Text
set :: PropertyType "Name" DeviceProfile -> DeviceProfile -> DeviceProfile
set PropertyType "Name" DeviceProfile
newValue DeviceProfile {Maybe [Tag]
Maybe (Value Text)
Maybe LoRaWANDeviceProfileProperty
()
haddock_workaround_ :: DeviceProfile -> ()
loRaWAN :: DeviceProfile -> Maybe LoRaWANDeviceProfileProperty
name :: DeviceProfile -> Maybe (Value Text)
tags :: DeviceProfile -> Maybe [Tag]
haddock_workaround_ :: ()
loRaWAN :: Maybe LoRaWANDeviceProfileProperty
name :: Maybe (Value Text)
tags :: Maybe [Tag]
..}
= DeviceProfile {name :: Maybe (Value Text)
name = Value Text -> Maybe (Value Text)
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure PropertyType "Name" DeviceProfile
Value Text
newValue, Maybe [Tag]
Maybe LoRaWANDeviceProfileProperty
()
haddock_workaround_ :: ()
loRaWAN :: Maybe LoRaWANDeviceProfileProperty
tags :: Maybe [Tag]
haddock_workaround_ :: ()
loRaWAN :: Maybe LoRaWANDeviceProfileProperty
tags :: Maybe [Tag]
..}
instance Property "Tags" DeviceProfile where
type PropertyType "Tags" DeviceProfile = [Tag]
set :: PropertyType "Tags" DeviceProfile -> DeviceProfile -> DeviceProfile
set PropertyType "Tags" DeviceProfile
newValue DeviceProfile {Maybe [Tag]
Maybe (Value Text)
Maybe LoRaWANDeviceProfileProperty
()
haddock_workaround_ :: DeviceProfile -> ()
loRaWAN :: DeviceProfile -> Maybe LoRaWANDeviceProfileProperty
name :: DeviceProfile -> Maybe (Value Text)
tags :: DeviceProfile -> Maybe [Tag]
haddock_workaround_ :: ()
loRaWAN :: Maybe LoRaWANDeviceProfileProperty
name :: Maybe (Value Text)
tags :: Maybe [Tag]
..}
= DeviceProfile {tags :: Maybe [Tag]
tags = [Tag] -> Maybe [Tag]
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure [Tag]
PropertyType "Tags" DeviceProfile
newValue, Maybe (Value Text)
Maybe LoRaWANDeviceProfileProperty
()
haddock_workaround_ :: ()
loRaWAN :: Maybe LoRaWANDeviceProfileProperty
name :: Maybe (Value Text)
haddock_workaround_ :: ()
loRaWAN :: Maybe LoRaWANDeviceProfileProperty
name :: Maybe (Value Text)
..}