module Stratosphere.LakeFormation.Permissions.DatabaseResourceProperty (
        DatabaseResourceProperty(..), mkDatabaseResourceProperty
    ) where
import qualified Data.Aeson as JSON
import qualified Stratosphere.Prelude as Prelude
import Stratosphere.Property
import Stratosphere.ResourceProperties
import Stratosphere.Value
data DatabaseResourceProperty
  = -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lakeformation-permissions-databaseresource.html>
    DatabaseResourceProperty {DatabaseResourceProperty -> ()
haddock_workaround_ :: (),
                              -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lakeformation-permissions-databaseresource.html#cfn-lakeformation-permissions-databaseresource-catalogid>
                              DatabaseResourceProperty -> Maybe (Value Text)
catalogId :: (Prelude.Maybe (Value Prelude.Text)),
                              -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lakeformation-permissions-databaseresource.html#cfn-lakeformation-permissions-databaseresource-name>
                              DatabaseResourceProperty -> Maybe (Value Text)
name :: (Prelude.Maybe (Value Prelude.Text))}
  deriving stock (DatabaseResourceProperty -> DatabaseResourceProperty -> Bool
(DatabaseResourceProperty -> DatabaseResourceProperty -> Bool)
-> (DatabaseResourceProperty -> DatabaseResourceProperty -> Bool)
-> Eq DatabaseResourceProperty
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: DatabaseResourceProperty -> DatabaseResourceProperty -> Bool
== :: DatabaseResourceProperty -> DatabaseResourceProperty -> Bool
$c/= :: DatabaseResourceProperty -> DatabaseResourceProperty -> Bool
/= :: DatabaseResourceProperty -> DatabaseResourceProperty -> Bool
Prelude.Eq, Int -> DatabaseResourceProperty -> ShowS
[DatabaseResourceProperty] -> ShowS
DatabaseResourceProperty -> String
(Int -> DatabaseResourceProperty -> ShowS)
-> (DatabaseResourceProperty -> String)
-> ([DatabaseResourceProperty] -> ShowS)
-> Show DatabaseResourceProperty
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> DatabaseResourceProperty -> ShowS
showsPrec :: Int -> DatabaseResourceProperty -> ShowS
$cshow :: DatabaseResourceProperty -> String
show :: DatabaseResourceProperty -> String
$cshowList :: [DatabaseResourceProperty] -> ShowS
showList :: [DatabaseResourceProperty] -> ShowS
Prelude.Show)
mkDatabaseResourceProperty :: DatabaseResourceProperty
mkDatabaseResourceProperty :: DatabaseResourceProperty
mkDatabaseResourceProperty
  = DatabaseResourceProperty
      {haddock_workaround_ :: ()
haddock_workaround_ = (), catalogId :: Maybe (Value Text)
catalogId = Maybe (Value Text)
forall a. Maybe a
Prelude.Nothing,
       name :: Maybe (Value Text)
name = Maybe (Value Text)
forall a. Maybe a
Prelude.Nothing}
instance ToResourceProperties DatabaseResourceProperty where
  toResourceProperties :: DatabaseResourceProperty -> ResourceProperties
toResourceProperties DatabaseResourceProperty {Maybe (Value Text)
()
haddock_workaround_ :: DatabaseResourceProperty -> ()
catalogId :: DatabaseResourceProperty -> Maybe (Value Text)
name :: DatabaseResourceProperty -> Maybe (Value Text)
haddock_workaround_ :: ()
catalogId :: Maybe (Value Text)
name :: Maybe (Value Text)
..}
    = ResourceProperties
        {awsType :: Text
awsType = Text
"AWS::LakeFormation::Permissions.DatabaseResource",
         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
"CatalogId" (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)
catalogId,
                            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])}
instance JSON.ToJSON DatabaseResourceProperty where
  toJSON :: DatabaseResourceProperty -> Value
toJSON DatabaseResourceProperty {Maybe (Value Text)
()
haddock_workaround_ :: DatabaseResourceProperty -> ()
catalogId :: DatabaseResourceProperty -> Maybe (Value Text)
name :: DatabaseResourceProperty -> Maybe (Value Text)
haddock_workaround_ :: ()
catalogId :: Maybe (Value Text)
name :: 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
"CatalogId" (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)
catalogId,
               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]))
instance Property "CatalogId" DatabaseResourceProperty where
  type PropertyType "CatalogId" DatabaseResourceProperty = Value Prelude.Text
  set :: PropertyType "CatalogId" DatabaseResourceProperty
-> DatabaseResourceProperty -> DatabaseResourceProperty
set PropertyType "CatalogId" DatabaseResourceProperty
newValue DatabaseResourceProperty {Maybe (Value Text)
()
haddock_workaround_ :: DatabaseResourceProperty -> ()
catalogId :: DatabaseResourceProperty -> Maybe (Value Text)
name :: DatabaseResourceProperty -> Maybe (Value Text)
haddock_workaround_ :: ()
catalogId :: Maybe (Value Text)
name :: Maybe (Value Text)
..}
    = DatabaseResourceProperty {catalogId :: Maybe (Value Text)
catalogId = Value Text -> Maybe (Value Text)
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure PropertyType "CatalogId" DatabaseResourceProperty
Value Text
newValue, Maybe (Value Text)
()
haddock_workaround_ :: ()
name :: Maybe (Value Text)
haddock_workaround_ :: ()
name :: Maybe (Value Text)
..}
instance Property "Name" DatabaseResourceProperty where
  type PropertyType "Name" DatabaseResourceProperty = Value Prelude.Text
  set :: PropertyType "Name" DatabaseResourceProperty
-> DatabaseResourceProperty -> DatabaseResourceProperty
set PropertyType "Name" DatabaseResourceProperty
newValue DatabaseResourceProperty {Maybe (Value Text)
()
haddock_workaround_ :: DatabaseResourceProperty -> ()
catalogId :: DatabaseResourceProperty -> Maybe (Value Text)
name :: DatabaseResourceProperty -> Maybe (Value Text)
haddock_workaround_ :: ()
catalogId :: Maybe (Value Text)
name :: Maybe (Value Text)
..}
    = DatabaseResourceProperty {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" DatabaseResourceProperty
Value Text
newValue, Maybe (Value Text)
()
haddock_workaround_ :: ()
catalogId :: Maybe (Value Text)
haddock_workaround_ :: ()
catalogId :: Maybe (Value Text)
..}