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