module Stratosphere.IoTSiteWise.AssetModel.AttributeProperty (
        AttributeProperty(..), mkAttributeProperty
    ) where
import qualified Data.Aeson as JSON
import qualified Stratosphere.Prelude as Prelude
import Stratosphere.Property
import Stratosphere.ResourceProperties
import Stratosphere.Value
data AttributeProperty
  = -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iotsitewise-assetmodel-attribute.html>
    AttributeProperty {AttributeProperty -> ()
haddock_workaround_ :: (),
                       -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iotsitewise-assetmodel-attribute.html#cfn-iotsitewise-assetmodel-attribute-defaultvalue>
                       AttributeProperty -> Maybe (Value Text)
defaultValue :: (Prelude.Maybe (Value Prelude.Text))}
  deriving stock (AttributeProperty -> AttributeProperty -> Bool
(AttributeProperty -> AttributeProperty -> Bool)
-> (AttributeProperty -> AttributeProperty -> Bool)
-> Eq AttributeProperty
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: AttributeProperty -> AttributeProperty -> Bool
== :: AttributeProperty -> AttributeProperty -> Bool
$c/= :: AttributeProperty -> AttributeProperty -> Bool
/= :: AttributeProperty -> AttributeProperty -> Bool
Prelude.Eq, Int -> AttributeProperty -> ShowS
[AttributeProperty] -> ShowS
AttributeProperty -> String
(Int -> AttributeProperty -> ShowS)
-> (AttributeProperty -> String)
-> ([AttributeProperty] -> ShowS)
-> Show AttributeProperty
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> AttributeProperty -> ShowS
showsPrec :: Int -> AttributeProperty -> ShowS
$cshow :: AttributeProperty -> String
show :: AttributeProperty -> String
$cshowList :: [AttributeProperty] -> ShowS
showList :: [AttributeProperty] -> ShowS
Prelude.Show)
mkAttributeProperty :: AttributeProperty
mkAttributeProperty :: AttributeProperty
mkAttributeProperty
  = AttributeProperty
      {haddock_workaround_ :: ()
haddock_workaround_ = (), defaultValue :: Maybe (Value Text)
defaultValue = Maybe (Value Text)
forall a. Maybe a
Prelude.Nothing}
instance ToResourceProperties AttributeProperty where
  toResourceProperties :: AttributeProperty -> ResourceProperties
toResourceProperties AttributeProperty {Maybe (Value Text)
()
haddock_workaround_ :: AttributeProperty -> ()
defaultValue :: AttributeProperty -> Maybe (Value Text)
haddock_workaround_ :: ()
defaultValue :: Maybe (Value Text)
..}
    = ResourceProperties
        {awsType :: Text
awsType = Text
"AWS::IoTSiteWise::AssetModel.Attribute",
         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 -> 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
"DefaultValue" (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)
defaultValue])}
instance JSON.ToJSON AttributeProperty where
  toJSON :: AttributeProperty -> Value
toJSON AttributeProperty {Maybe (Value Text)
()
haddock_workaround_ :: AttributeProperty -> ()
defaultValue :: AttributeProperty -> Maybe (Value Text)
haddock_workaround_ :: ()
defaultValue :: 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 -> 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
"DefaultValue" (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)
defaultValue]))
instance Property "DefaultValue" AttributeProperty where
  type PropertyType "DefaultValue" AttributeProperty = Value Prelude.Text
  set :: PropertyType "DefaultValue" AttributeProperty
-> AttributeProperty -> AttributeProperty
set PropertyType "DefaultValue" AttributeProperty
newValue AttributeProperty {Maybe (Value Text)
()
haddock_workaround_ :: AttributeProperty -> ()
defaultValue :: AttributeProperty -> Maybe (Value Text)
haddock_workaround_ :: ()
defaultValue :: Maybe (Value Text)
..}
    = AttributeProperty {defaultValue :: Maybe (Value Text)
defaultValue = Value Text -> Maybe (Value Text)
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure PropertyType "DefaultValue" AttributeProperty
Value Text
newValue, ()
haddock_workaround_ :: ()
haddock_workaround_ :: ()
..}