module Stratosphere.LakeFormation.Permissions (
        module Exports, Permissions(..), mkPermissions
    ) where
import qualified Data.Aeson as JSON
import qualified Stratosphere.Prelude as Prelude
import Stratosphere.Property
import {-# SOURCE #-} Stratosphere.LakeFormation.Permissions.DataLakePrincipalProperty as Exports
import {-# SOURCE #-} Stratosphere.LakeFormation.Permissions.ResourceProperty as Exports
import Stratosphere.ResourceProperties
import Stratosphere.Value
data Permissions
  = -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lakeformation-permissions.html>
    Permissions {Permissions -> ()
haddock_workaround_ :: (),
                 -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lakeformation-permissions.html#cfn-lakeformation-permissions-datalakeprincipal>
                 Permissions -> DataLakePrincipalProperty
dataLakePrincipal :: DataLakePrincipalProperty,
                 -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lakeformation-permissions.html#cfn-lakeformation-permissions-permissions>
                 Permissions -> Maybe (ValueList Text)
permissions :: (Prelude.Maybe (ValueList Prelude.Text)),
                 -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lakeformation-permissions.html#cfn-lakeformation-permissions-permissionswithgrantoption>
                 Permissions -> Maybe (ValueList Text)
permissionsWithGrantOption :: (Prelude.Maybe (ValueList Prelude.Text)),
                 -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lakeformation-permissions.html#cfn-lakeformation-permissions-resource>
                 Permissions -> ResourceProperty
resource :: ResourceProperty}
  deriving stock (Permissions -> Permissions -> Bool
(Permissions -> Permissions -> Bool)
-> (Permissions -> Permissions -> Bool) -> Eq Permissions
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Permissions -> Permissions -> Bool
== :: Permissions -> Permissions -> Bool
$c/= :: Permissions -> Permissions -> Bool
/= :: Permissions -> Permissions -> Bool
Prelude.Eq, Int -> Permissions -> ShowS
[Permissions] -> ShowS
Permissions -> String
(Int -> Permissions -> ShowS)
-> (Permissions -> String)
-> ([Permissions] -> ShowS)
-> Show Permissions
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> Permissions -> ShowS
showsPrec :: Int -> Permissions -> ShowS
$cshow :: Permissions -> String
show :: Permissions -> String
$cshowList :: [Permissions] -> ShowS
showList :: [Permissions] -> ShowS
Prelude.Show)
mkPermissions ::
  DataLakePrincipalProperty -> ResourceProperty -> Permissions
mkPermissions :: DataLakePrincipalProperty -> ResourceProperty -> Permissions
mkPermissions DataLakePrincipalProperty
dataLakePrincipal ResourceProperty
resource
  = Permissions
      {haddock_workaround_ :: ()
haddock_workaround_ = (), dataLakePrincipal :: DataLakePrincipalProperty
dataLakePrincipal = DataLakePrincipalProperty
dataLakePrincipal,
       resource :: ResourceProperty
resource = ResourceProperty
resource, permissions :: Maybe (ValueList Text)
permissions = Maybe (ValueList Text)
forall a. Maybe a
Prelude.Nothing,
       permissionsWithGrantOption :: Maybe (ValueList Text)
permissionsWithGrantOption = Maybe (ValueList Text)
forall a. Maybe a
Prelude.Nothing}
instance ToResourceProperties Permissions where
  toResourceProperties :: Permissions -> ResourceProperties
toResourceProperties Permissions {Maybe (ValueList Text)
()
DataLakePrincipalProperty
ResourceProperty
haddock_workaround_ :: Permissions -> ()
dataLakePrincipal :: Permissions -> DataLakePrincipalProperty
permissions :: Permissions -> Maybe (ValueList Text)
permissionsWithGrantOption :: Permissions -> Maybe (ValueList Text)
resource :: Permissions -> ResourceProperty
haddock_workaround_ :: ()
dataLakePrincipal :: DataLakePrincipalProperty
permissions :: Maybe (ValueList Text)
permissionsWithGrantOption :: Maybe (ValueList Text)
resource :: ResourceProperty
..}
    = ResourceProperties
        {awsType :: Text
awsType = Text
"AWS::LakeFormation::Permissions",
         supportsTags :: Bool
supportsTags = Bool
Prelude.False,
         properties :: Object
properties = [Item Object] -> Object
forall l. IsList l => [Item l] -> l
Prelude.fromList
                        ([(Key, Value)] -> [(Key, Value)] -> [(Key, Value)]
forall a. Semigroup a => a -> a -> a
(Prelude.<>)
                           [Key
"DataLakePrincipal" Key -> DataLakePrincipalProperty -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
JSON..= DataLakePrincipalProperty
dataLakePrincipal,
                            Key
"Resource" Key -> ResourceProperty -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
JSON..= ResourceProperty
resource]
                           ([Maybe (Key, Value)] -> [(Key, Value)]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
                              [Key -> ValueList 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
"Permissions" (ValueList Text -> (Key, Value))
-> Maybe (ValueList Text) -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (ValueList Text)
permissions,
                               Key -> ValueList 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
"PermissionsWithGrantOption"
                                 (ValueList Text -> (Key, Value))
-> Maybe (ValueList Text) -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (ValueList Text)
permissionsWithGrantOption]))}
instance JSON.ToJSON Permissions where
  toJSON :: Permissions -> Value
toJSON Permissions {Maybe (ValueList Text)
()
DataLakePrincipalProperty
ResourceProperty
haddock_workaround_ :: Permissions -> ()
dataLakePrincipal :: Permissions -> DataLakePrincipalProperty
permissions :: Permissions -> Maybe (ValueList Text)
permissionsWithGrantOption :: Permissions -> Maybe (ValueList Text)
resource :: Permissions -> ResourceProperty
haddock_workaround_ :: ()
dataLakePrincipal :: DataLakePrincipalProperty
permissions :: Maybe (ValueList Text)
permissionsWithGrantOption :: Maybe (ValueList Text)
resource :: ResourceProperty
..}
    = [(Key, Value)] -> Value
JSON.object
        ([Item [(Key, Value)]] -> [(Key, Value)]
forall l. IsList l => [Item l] -> l
Prelude.fromList
           ([(Key, Value)] -> [(Key, Value)] -> [(Key, Value)]
forall a. Semigroup a => a -> a -> a
(Prelude.<>)
              [Key
"DataLakePrincipal" Key -> DataLakePrincipalProperty -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
JSON..= DataLakePrincipalProperty
dataLakePrincipal,
               Key
"Resource" Key -> ResourceProperty -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
JSON..= ResourceProperty
resource]
              ([Maybe (Key, Value)] -> [(Key, Value)]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
                 [Key -> ValueList 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
"Permissions" (ValueList Text -> (Key, Value))
-> Maybe (ValueList Text) -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (ValueList Text)
permissions,
                  Key -> ValueList 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
"PermissionsWithGrantOption"
                    (ValueList Text -> (Key, Value))
-> Maybe (ValueList Text) -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (ValueList Text)
permissionsWithGrantOption])))
instance Property "DataLakePrincipal" Permissions where
  type PropertyType "DataLakePrincipal" Permissions = DataLakePrincipalProperty
  set :: PropertyType "DataLakePrincipal" Permissions
-> Permissions -> Permissions
set PropertyType "DataLakePrincipal" Permissions
newValue Permissions {Maybe (ValueList Text)
()
DataLakePrincipalProperty
ResourceProperty
haddock_workaround_ :: Permissions -> ()
dataLakePrincipal :: Permissions -> DataLakePrincipalProperty
permissions :: Permissions -> Maybe (ValueList Text)
permissionsWithGrantOption :: Permissions -> Maybe (ValueList Text)
resource :: Permissions -> ResourceProperty
haddock_workaround_ :: ()
dataLakePrincipal :: DataLakePrincipalProperty
permissions :: Maybe (ValueList Text)
permissionsWithGrantOption :: Maybe (ValueList Text)
resource :: ResourceProperty
..}
    = Permissions {dataLakePrincipal :: DataLakePrincipalProperty
dataLakePrincipal = PropertyType "DataLakePrincipal" Permissions
DataLakePrincipalProperty
newValue, Maybe (ValueList Text)
()
ResourceProperty
haddock_workaround_ :: ()
permissions :: Maybe (ValueList Text)
permissionsWithGrantOption :: Maybe (ValueList Text)
resource :: ResourceProperty
haddock_workaround_ :: ()
permissions :: Maybe (ValueList Text)
permissionsWithGrantOption :: Maybe (ValueList Text)
resource :: ResourceProperty
..}
instance Property "Permissions" Permissions where
  type PropertyType "Permissions" Permissions = ValueList Prelude.Text
  set :: PropertyType "Permissions" Permissions
-> Permissions -> Permissions
set PropertyType "Permissions" Permissions
newValue Permissions {Maybe (ValueList Text)
()
DataLakePrincipalProperty
ResourceProperty
haddock_workaround_ :: Permissions -> ()
dataLakePrincipal :: Permissions -> DataLakePrincipalProperty
permissions :: Permissions -> Maybe (ValueList Text)
permissionsWithGrantOption :: Permissions -> Maybe (ValueList Text)
resource :: Permissions -> ResourceProperty
haddock_workaround_ :: ()
dataLakePrincipal :: DataLakePrincipalProperty
permissions :: Maybe (ValueList Text)
permissionsWithGrantOption :: Maybe (ValueList Text)
resource :: ResourceProperty
..}
    = Permissions {permissions :: Maybe (ValueList Text)
permissions = ValueList Text -> Maybe (ValueList Text)
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure PropertyType "Permissions" Permissions
ValueList Text
newValue, Maybe (ValueList Text)
()
DataLakePrincipalProperty
ResourceProperty
haddock_workaround_ :: ()
dataLakePrincipal :: DataLakePrincipalProperty
permissionsWithGrantOption :: Maybe (ValueList Text)
resource :: ResourceProperty
haddock_workaround_ :: ()
dataLakePrincipal :: DataLakePrincipalProperty
permissionsWithGrantOption :: Maybe (ValueList Text)
resource :: ResourceProperty
..}
instance Property "PermissionsWithGrantOption" Permissions where
  type PropertyType "PermissionsWithGrantOption" Permissions = ValueList Prelude.Text
  set :: PropertyType "PermissionsWithGrantOption" Permissions
-> Permissions -> Permissions
set PropertyType "PermissionsWithGrantOption" Permissions
newValue Permissions {Maybe (ValueList Text)
()
DataLakePrincipalProperty
ResourceProperty
haddock_workaround_ :: Permissions -> ()
dataLakePrincipal :: Permissions -> DataLakePrincipalProperty
permissions :: Permissions -> Maybe (ValueList Text)
permissionsWithGrantOption :: Permissions -> Maybe (ValueList Text)
resource :: Permissions -> ResourceProperty
haddock_workaround_ :: ()
dataLakePrincipal :: DataLakePrincipalProperty
permissions :: Maybe (ValueList Text)
permissionsWithGrantOption :: Maybe (ValueList Text)
resource :: ResourceProperty
..}
    = Permissions
        {permissionsWithGrantOption :: Maybe (ValueList Text)
permissionsWithGrantOption = ValueList Text -> Maybe (ValueList Text)
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure PropertyType "PermissionsWithGrantOption" Permissions
ValueList Text
newValue, Maybe (ValueList Text)
()
DataLakePrincipalProperty
ResourceProperty
haddock_workaround_ :: ()
dataLakePrincipal :: DataLakePrincipalProperty
permissions :: Maybe (ValueList Text)
resource :: ResourceProperty
haddock_workaround_ :: ()
dataLakePrincipal :: DataLakePrincipalProperty
permissions :: Maybe (ValueList Text)
resource :: ResourceProperty
..}
instance Property "Resource" Permissions where
  type PropertyType "Resource" Permissions = ResourceProperty
  set :: PropertyType "Resource" Permissions -> Permissions -> Permissions
set PropertyType "Resource" Permissions
newValue Permissions {Maybe (ValueList Text)
()
DataLakePrincipalProperty
ResourceProperty
haddock_workaround_ :: Permissions -> ()
dataLakePrincipal :: Permissions -> DataLakePrincipalProperty
permissions :: Permissions -> Maybe (ValueList Text)
permissionsWithGrantOption :: Permissions -> Maybe (ValueList Text)
resource :: Permissions -> ResourceProperty
haddock_workaround_ :: ()
dataLakePrincipal :: DataLakePrincipalProperty
permissions :: Maybe (ValueList Text)
permissionsWithGrantOption :: Maybe (ValueList Text)
resource :: ResourceProperty
..}
    = Permissions {resource :: ResourceProperty
resource = PropertyType "Resource" Permissions
ResourceProperty
newValue, Maybe (ValueList Text)
()
DataLakePrincipalProperty
haddock_workaround_ :: ()
dataLakePrincipal :: DataLakePrincipalProperty
permissions :: Maybe (ValueList Text)
permissionsWithGrantOption :: Maybe (ValueList Text)
haddock_workaround_ :: ()
dataLakePrincipal :: DataLakePrincipalProperty
permissions :: Maybe (ValueList Text)
permissionsWithGrantOption :: Maybe (ValueList Text)
..}