module Stratosphere.IoTWireless.ServiceProfile (
        module Exports, ServiceProfile(..), mkServiceProfile
    ) where
import qualified Data.Aeson as JSON
import qualified Stratosphere.Prelude as Prelude
import Stratosphere.Property
import {-# SOURCE #-} Stratosphere.IoTWireless.ServiceProfile.LoRaWANServiceProfileProperty as Exports
import Stratosphere.ResourceProperties
import Stratosphere.Tag
import Stratosphere.Value
data ServiceProfile
  = -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-iotwireless-serviceprofile.html>
    ServiceProfile {ServiceProfile -> ()
haddock_workaround_ :: (),
                    -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-iotwireless-serviceprofile.html#cfn-iotwireless-serviceprofile-lorawan>
                    ServiceProfile -> Maybe LoRaWANServiceProfileProperty
loRaWAN :: (Prelude.Maybe LoRaWANServiceProfileProperty),
                    -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-iotwireless-serviceprofile.html#cfn-iotwireless-serviceprofile-name>
                    ServiceProfile -> Maybe (Value Text)
name :: (Prelude.Maybe (Value Prelude.Text)),
                    -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-iotwireless-serviceprofile.html#cfn-iotwireless-serviceprofile-tags>
                    ServiceProfile -> Maybe [Tag]
tags :: (Prelude.Maybe [Tag])}
  deriving stock (ServiceProfile -> ServiceProfile -> Bool
(ServiceProfile -> ServiceProfile -> Bool)
-> (ServiceProfile -> ServiceProfile -> Bool) -> Eq ServiceProfile
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: ServiceProfile -> ServiceProfile -> Bool
== :: ServiceProfile -> ServiceProfile -> Bool
$c/= :: ServiceProfile -> ServiceProfile -> Bool
/= :: ServiceProfile -> ServiceProfile -> Bool
Prelude.Eq, Int -> ServiceProfile -> ShowS
[ServiceProfile] -> ShowS
ServiceProfile -> String
(Int -> ServiceProfile -> ShowS)
-> (ServiceProfile -> String)
-> ([ServiceProfile] -> ShowS)
-> Show ServiceProfile
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> ServiceProfile -> ShowS
showsPrec :: Int -> ServiceProfile -> ShowS
$cshow :: ServiceProfile -> String
show :: ServiceProfile -> String
$cshowList :: [ServiceProfile] -> ShowS
showList :: [ServiceProfile] -> ShowS
Prelude.Show)
mkServiceProfile :: ServiceProfile
mkServiceProfile :: ServiceProfile
mkServiceProfile
  = ServiceProfile
      {haddock_workaround_ :: ()
haddock_workaround_ = (), loRaWAN :: Maybe LoRaWANServiceProfileProperty
loRaWAN = Maybe LoRaWANServiceProfileProperty
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 ServiceProfile where
  toResourceProperties :: ServiceProfile -> ResourceProperties
toResourceProperties ServiceProfile {Maybe [Tag]
Maybe (Value Text)
Maybe LoRaWANServiceProfileProperty
()
haddock_workaround_ :: ServiceProfile -> ()
loRaWAN :: ServiceProfile -> Maybe LoRaWANServiceProfileProperty
name :: ServiceProfile -> Maybe (Value Text)
tags :: ServiceProfile -> Maybe [Tag]
haddock_workaround_ :: ()
loRaWAN :: Maybe LoRaWANServiceProfileProperty
name :: Maybe (Value Text)
tags :: Maybe [Tag]
..}
    = ResourceProperties
        {awsType :: Text
awsType = Text
"AWS::IoTWireless::ServiceProfile",
         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 -> LoRaWANServiceProfileProperty -> (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" (LoRaWANServiceProfileProperty -> (Key, Value))
-> Maybe LoRaWANServiceProfileProperty -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe LoRaWANServiceProfileProperty
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 ServiceProfile where
  toJSON :: ServiceProfile -> Value
toJSON ServiceProfile {Maybe [Tag]
Maybe (Value Text)
Maybe LoRaWANServiceProfileProperty
()
haddock_workaround_ :: ServiceProfile -> ()
loRaWAN :: ServiceProfile -> Maybe LoRaWANServiceProfileProperty
name :: ServiceProfile -> Maybe (Value Text)
tags :: ServiceProfile -> Maybe [Tag]
haddock_workaround_ :: ()
loRaWAN :: Maybe LoRaWANServiceProfileProperty
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 -> LoRaWANServiceProfileProperty -> (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" (LoRaWANServiceProfileProperty -> (Key, Value))
-> Maybe LoRaWANServiceProfileProperty -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe LoRaWANServiceProfileProperty
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" ServiceProfile where
  type PropertyType "LoRaWAN" ServiceProfile = LoRaWANServiceProfileProperty
  set :: PropertyType "LoRaWAN" ServiceProfile
-> ServiceProfile -> ServiceProfile
set PropertyType "LoRaWAN" ServiceProfile
newValue ServiceProfile {Maybe [Tag]
Maybe (Value Text)
Maybe LoRaWANServiceProfileProperty
()
haddock_workaround_ :: ServiceProfile -> ()
loRaWAN :: ServiceProfile -> Maybe LoRaWANServiceProfileProperty
name :: ServiceProfile -> Maybe (Value Text)
tags :: ServiceProfile -> Maybe [Tag]
haddock_workaround_ :: ()
loRaWAN :: Maybe LoRaWANServiceProfileProperty
name :: Maybe (Value Text)
tags :: Maybe [Tag]
..}
    = ServiceProfile {loRaWAN :: Maybe LoRaWANServiceProfileProperty
loRaWAN = LoRaWANServiceProfileProperty
-> Maybe LoRaWANServiceProfileProperty
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure PropertyType "LoRaWAN" ServiceProfile
LoRaWANServiceProfileProperty
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" ServiceProfile where
  type PropertyType "Name" ServiceProfile = Value Prelude.Text
  set :: PropertyType "Name" ServiceProfile
-> ServiceProfile -> ServiceProfile
set PropertyType "Name" ServiceProfile
newValue ServiceProfile {Maybe [Tag]
Maybe (Value Text)
Maybe LoRaWANServiceProfileProperty
()
haddock_workaround_ :: ServiceProfile -> ()
loRaWAN :: ServiceProfile -> Maybe LoRaWANServiceProfileProperty
name :: ServiceProfile -> Maybe (Value Text)
tags :: ServiceProfile -> Maybe [Tag]
haddock_workaround_ :: ()
loRaWAN :: Maybe LoRaWANServiceProfileProperty
name :: Maybe (Value Text)
tags :: Maybe [Tag]
..}
    = ServiceProfile {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" ServiceProfile
Value Text
newValue, Maybe [Tag]
Maybe LoRaWANServiceProfileProperty
()
haddock_workaround_ :: ()
loRaWAN :: Maybe LoRaWANServiceProfileProperty
tags :: Maybe [Tag]
haddock_workaround_ :: ()
loRaWAN :: Maybe LoRaWANServiceProfileProperty
tags :: Maybe [Tag]
..}
instance Property "Tags" ServiceProfile where
  type PropertyType "Tags" ServiceProfile = [Tag]
  set :: PropertyType "Tags" ServiceProfile
-> ServiceProfile -> ServiceProfile
set PropertyType "Tags" ServiceProfile
newValue ServiceProfile {Maybe [Tag]
Maybe (Value Text)
Maybe LoRaWANServiceProfileProperty
()
haddock_workaround_ :: ServiceProfile -> ()
loRaWAN :: ServiceProfile -> Maybe LoRaWANServiceProfileProperty
name :: ServiceProfile -> Maybe (Value Text)
tags :: ServiceProfile -> Maybe [Tag]
haddock_workaround_ :: ()
loRaWAN :: Maybe LoRaWANServiceProfileProperty
name :: Maybe (Value Text)
tags :: Maybe [Tag]
..}
    = ServiceProfile {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" ServiceProfile
newValue, Maybe (Value Text)
Maybe LoRaWANServiceProfileProperty
()
haddock_workaround_ :: ()
loRaWAN :: Maybe LoRaWANServiceProfileProperty
name :: Maybe (Value Text)
haddock_workaround_ :: ()
loRaWAN :: Maybe LoRaWANServiceProfileProperty
name :: Maybe (Value Text)
..}