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