{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}
module Amazonka.QuickSight.Types.RowLevelPermissionDataSet where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.QuickSight.Types.RowLevelPermissionFormatVersion
import Amazonka.QuickSight.Types.RowLevelPermissionPolicy
import Amazonka.QuickSight.Types.Status
data RowLevelPermissionDataSet = RowLevelPermissionDataSet'
{
RowLevelPermissionDataSet -> Maybe Status
status :: Prelude.Maybe Status,
RowLevelPermissionDataSet -> Maybe Text
namespace :: Prelude.Maybe Prelude.Text,
RowLevelPermissionDataSet -> Maybe RowLevelPermissionFormatVersion
formatVersion :: Prelude.Maybe RowLevelPermissionFormatVersion,
RowLevelPermissionDataSet -> Text
arn :: Prelude.Text,
RowLevelPermissionDataSet -> RowLevelPermissionPolicy
permissionPolicy :: RowLevelPermissionPolicy
}
deriving (RowLevelPermissionDataSet -> RowLevelPermissionDataSet -> Bool
(RowLevelPermissionDataSet -> RowLevelPermissionDataSet -> Bool)
-> (RowLevelPermissionDataSet -> RowLevelPermissionDataSet -> Bool)
-> Eq RowLevelPermissionDataSet
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RowLevelPermissionDataSet -> RowLevelPermissionDataSet -> Bool
$c/= :: RowLevelPermissionDataSet -> RowLevelPermissionDataSet -> Bool
== :: RowLevelPermissionDataSet -> RowLevelPermissionDataSet -> Bool
$c== :: RowLevelPermissionDataSet -> RowLevelPermissionDataSet -> Bool
Prelude.Eq, ReadPrec [RowLevelPermissionDataSet]
ReadPrec RowLevelPermissionDataSet
Int -> ReadS RowLevelPermissionDataSet
ReadS [RowLevelPermissionDataSet]
(Int -> ReadS RowLevelPermissionDataSet)
-> ReadS [RowLevelPermissionDataSet]
-> ReadPrec RowLevelPermissionDataSet
-> ReadPrec [RowLevelPermissionDataSet]
-> Read RowLevelPermissionDataSet
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [RowLevelPermissionDataSet]
$creadListPrec :: ReadPrec [RowLevelPermissionDataSet]
readPrec :: ReadPrec RowLevelPermissionDataSet
$creadPrec :: ReadPrec RowLevelPermissionDataSet
readList :: ReadS [RowLevelPermissionDataSet]
$creadList :: ReadS [RowLevelPermissionDataSet]
readsPrec :: Int -> ReadS RowLevelPermissionDataSet
$creadsPrec :: Int -> ReadS RowLevelPermissionDataSet
Prelude.Read, Int -> RowLevelPermissionDataSet -> ShowS
[RowLevelPermissionDataSet] -> ShowS
RowLevelPermissionDataSet -> String
(Int -> RowLevelPermissionDataSet -> ShowS)
-> (RowLevelPermissionDataSet -> String)
-> ([RowLevelPermissionDataSet] -> ShowS)
-> Show RowLevelPermissionDataSet
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RowLevelPermissionDataSet] -> ShowS
$cshowList :: [RowLevelPermissionDataSet] -> ShowS
show :: RowLevelPermissionDataSet -> String
$cshow :: RowLevelPermissionDataSet -> String
showsPrec :: Int -> RowLevelPermissionDataSet -> ShowS
$cshowsPrec :: Int -> RowLevelPermissionDataSet -> ShowS
Prelude.Show, (forall x.
RowLevelPermissionDataSet -> Rep RowLevelPermissionDataSet x)
-> (forall x.
Rep RowLevelPermissionDataSet x -> RowLevelPermissionDataSet)
-> Generic RowLevelPermissionDataSet
forall x.
Rep RowLevelPermissionDataSet x -> RowLevelPermissionDataSet
forall x.
RowLevelPermissionDataSet -> Rep RowLevelPermissionDataSet x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep RowLevelPermissionDataSet x -> RowLevelPermissionDataSet
$cfrom :: forall x.
RowLevelPermissionDataSet -> Rep RowLevelPermissionDataSet x
Prelude.Generic)
newRowLevelPermissionDataSet ::
Prelude.Text ->
RowLevelPermissionPolicy ->
RowLevelPermissionDataSet
newRowLevelPermissionDataSet :: Text -> RowLevelPermissionPolicy -> RowLevelPermissionDataSet
newRowLevelPermissionDataSet Text
pArn_ RowLevelPermissionPolicy
pPermissionPolicy_ =
RowLevelPermissionDataSet' :: Maybe Status
-> Maybe Text
-> Maybe RowLevelPermissionFormatVersion
-> Text
-> RowLevelPermissionPolicy
-> RowLevelPermissionDataSet
RowLevelPermissionDataSet'
{ $sel:status:RowLevelPermissionDataSet' :: Maybe Status
status =
Maybe Status
forall a. Maybe a
Prelude.Nothing,
$sel:namespace:RowLevelPermissionDataSet' :: Maybe Text
namespace = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:formatVersion:RowLevelPermissionDataSet' :: Maybe RowLevelPermissionFormatVersion
formatVersion = Maybe RowLevelPermissionFormatVersion
forall a. Maybe a
Prelude.Nothing,
$sel:arn:RowLevelPermissionDataSet' :: Text
arn = Text
pArn_,
$sel:permissionPolicy:RowLevelPermissionDataSet' :: RowLevelPermissionPolicy
permissionPolicy = RowLevelPermissionPolicy
pPermissionPolicy_
}
rowLevelPermissionDataSet_status :: Lens.Lens' RowLevelPermissionDataSet (Prelude.Maybe Status)
rowLevelPermissionDataSet_status :: (Maybe Status -> f (Maybe Status))
-> RowLevelPermissionDataSet -> f RowLevelPermissionDataSet
rowLevelPermissionDataSet_status = (RowLevelPermissionDataSet -> Maybe Status)
-> (RowLevelPermissionDataSet
-> Maybe Status -> RowLevelPermissionDataSet)
-> Lens
RowLevelPermissionDataSet
RowLevelPermissionDataSet
(Maybe Status)
(Maybe Status)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RowLevelPermissionDataSet' {Maybe Status
status :: Maybe Status
$sel:status:RowLevelPermissionDataSet' :: RowLevelPermissionDataSet -> Maybe Status
status} -> Maybe Status
status) (\s :: RowLevelPermissionDataSet
s@RowLevelPermissionDataSet' {} Maybe Status
a -> RowLevelPermissionDataSet
s {$sel:status:RowLevelPermissionDataSet' :: Maybe Status
status = Maybe Status
a} :: RowLevelPermissionDataSet)
rowLevelPermissionDataSet_namespace :: Lens.Lens' RowLevelPermissionDataSet (Prelude.Maybe Prelude.Text)
rowLevelPermissionDataSet_namespace :: (Maybe Text -> f (Maybe Text))
-> RowLevelPermissionDataSet -> f RowLevelPermissionDataSet
rowLevelPermissionDataSet_namespace = (RowLevelPermissionDataSet -> Maybe Text)
-> (RowLevelPermissionDataSet
-> Maybe Text -> RowLevelPermissionDataSet)
-> Lens
RowLevelPermissionDataSet
RowLevelPermissionDataSet
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RowLevelPermissionDataSet' {Maybe Text
namespace :: Maybe Text
$sel:namespace:RowLevelPermissionDataSet' :: RowLevelPermissionDataSet -> Maybe Text
namespace} -> Maybe Text
namespace) (\s :: RowLevelPermissionDataSet
s@RowLevelPermissionDataSet' {} Maybe Text
a -> RowLevelPermissionDataSet
s {$sel:namespace:RowLevelPermissionDataSet' :: Maybe Text
namespace = Maybe Text
a} :: RowLevelPermissionDataSet)
rowLevelPermissionDataSet_formatVersion :: Lens.Lens' RowLevelPermissionDataSet (Prelude.Maybe RowLevelPermissionFormatVersion)
rowLevelPermissionDataSet_formatVersion :: (Maybe RowLevelPermissionFormatVersion
-> f (Maybe RowLevelPermissionFormatVersion))
-> RowLevelPermissionDataSet -> f RowLevelPermissionDataSet
rowLevelPermissionDataSet_formatVersion = (RowLevelPermissionDataSet
-> Maybe RowLevelPermissionFormatVersion)
-> (RowLevelPermissionDataSet
-> Maybe RowLevelPermissionFormatVersion
-> RowLevelPermissionDataSet)
-> Lens
RowLevelPermissionDataSet
RowLevelPermissionDataSet
(Maybe RowLevelPermissionFormatVersion)
(Maybe RowLevelPermissionFormatVersion)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RowLevelPermissionDataSet' {Maybe RowLevelPermissionFormatVersion
formatVersion :: Maybe RowLevelPermissionFormatVersion
$sel:formatVersion:RowLevelPermissionDataSet' :: RowLevelPermissionDataSet -> Maybe RowLevelPermissionFormatVersion
formatVersion} -> Maybe RowLevelPermissionFormatVersion
formatVersion) (\s :: RowLevelPermissionDataSet
s@RowLevelPermissionDataSet' {} Maybe RowLevelPermissionFormatVersion
a -> RowLevelPermissionDataSet
s {$sel:formatVersion:RowLevelPermissionDataSet' :: Maybe RowLevelPermissionFormatVersion
formatVersion = Maybe RowLevelPermissionFormatVersion
a} :: RowLevelPermissionDataSet)
rowLevelPermissionDataSet_arn :: Lens.Lens' RowLevelPermissionDataSet Prelude.Text
rowLevelPermissionDataSet_arn :: (Text -> f Text)
-> RowLevelPermissionDataSet -> f RowLevelPermissionDataSet
rowLevelPermissionDataSet_arn = (RowLevelPermissionDataSet -> Text)
-> (RowLevelPermissionDataSet -> Text -> RowLevelPermissionDataSet)
-> Lens
RowLevelPermissionDataSet RowLevelPermissionDataSet Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RowLevelPermissionDataSet' {Text
arn :: Text
$sel:arn:RowLevelPermissionDataSet' :: RowLevelPermissionDataSet -> Text
arn} -> Text
arn) (\s :: RowLevelPermissionDataSet
s@RowLevelPermissionDataSet' {} Text
a -> RowLevelPermissionDataSet
s {$sel:arn:RowLevelPermissionDataSet' :: Text
arn = Text
a} :: RowLevelPermissionDataSet)
rowLevelPermissionDataSet_permissionPolicy :: Lens.Lens' RowLevelPermissionDataSet RowLevelPermissionPolicy
rowLevelPermissionDataSet_permissionPolicy :: (RowLevelPermissionPolicy -> f RowLevelPermissionPolicy)
-> RowLevelPermissionDataSet -> f RowLevelPermissionDataSet
rowLevelPermissionDataSet_permissionPolicy = (RowLevelPermissionDataSet -> RowLevelPermissionPolicy)
-> (RowLevelPermissionDataSet
-> RowLevelPermissionPolicy -> RowLevelPermissionDataSet)
-> Lens
RowLevelPermissionDataSet
RowLevelPermissionDataSet
RowLevelPermissionPolicy
RowLevelPermissionPolicy
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RowLevelPermissionDataSet' {RowLevelPermissionPolicy
permissionPolicy :: RowLevelPermissionPolicy
$sel:permissionPolicy:RowLevelPermissionDataSet' :: RowLevelPermissionDataSet -> RowLevelPermissionPolicy
permissionPolicy} -> RowLevelPermissionPolicy
permissionPolicy) (\s :: RowLevelPermissionDataSet
s@RowLevelPermissionDataSet' {} RowLevelPermissionPolicy
a -> RowLevelPermissionDataSet
s {$sel:permissionPolicy:RowLevelPermissionDataSet' :: RowLevelPermissionPolicy
permissionPolicy = RowLevelPermissionPolicy
a} :: RowLevelPermissionDataSet)
instance Core.FromJSON RowLevelPermissionDataSet where
parseJSON :: Value -> Parser RowLevelPermissionDataSet
parseJSON =
String
-> (Object -> Parser RowLevelPermissionDataSet)
-> Value
-> Parser RowLevelPermissionDataSet
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"RowLevelPermissionDataSet"
( \Object
x ->
Maybe Status
-> Maybe Text
-> Maybe RowLevelPermissionFormatVersion
-> Text
-> RowLevelPermissionPolicy
-> RowLevelPermissionDataSet
RowLevelPermissionDataSet'
(Maybe Status
-> Maybe Text
-> Maybe RowLevelPermissionFormatVersion
-> Text
-> RowLevelPermissionPolicy
-> RowLevelPermissionDataSet)
-> Parser (Maybe Status)
-> Parser
(Maybe Text
-> Maybe RowLevelPermissionFormatVersion
-> Text
-> RowLevelPermissionPolicy
-> RowLevelPermissionDataSet)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Status)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Status")
Parser
(Maybe Text
-> Maybe RowLevelPermissionFormatVersion
-> Text
-> RowLevelPermissionPolicy
-> RowLevelPermissionDataSet)
-> Parser (Maybe Text)
-> Parser
(Maybe RowLevelPermissionFormatVersion
-> Text -> RowLevelPermissionPolicy -> RowLevelPermissionDataSet)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Namespace")
Parser
(Maybe RowLevelPermissionFormatVersion
-> Text -> RowLevelPermissionPolicy -> RowLevelPermissionDataSet)
-> Parser (Maybe RowLevelPermissionFormatVersion)
-> Parser
(Text -> RowLevelPermissionPolicy -> RowLevelPermissionDataSet)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe RowLevelPermissionFormatVersion)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"FormatVersion")
Parser
(Text -> RowLevelPermissionPolicy -> RowLevelPermissionDataSet)
-> Parser Text
-> Parser (RowLevelPermissionPolicy -> RowLevelPermissionDataSet)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"Arn")
Parser (RowLevelPermissionPolicy -> RowLevelPermissionDataSet)
-> Parser RowLevelPermissionPolicy
-> Parser RowLevelPermissionDataSet
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser RowLevelPermissionPolicy
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"PermissionPolicy")
)
instance Prelude.Hashable RowLevelPermissionDataSet
instance Prelude.NFData RowLevelPermissionDataSet
instance Core.ToJSON RowLevelPermissionDataSet where
toJSON :: RowLevelPermissionDataSet -> Value
toJSON RowLevelPermissionDataSet' {Maybe Text
Maybe RowLevelPermissionFormatVersion
Maybe Status
Text
RowLevelPermissionPolicy
permissionPolicy :: RowLevelPermissionPolicy
arn :: Text
formatVersion :: Maybe RowLevelPermissionFormatVersion
namespace :: Maybe Text
status :: Maybe Status
$sel:permissionPolicy:RowLevelPermissionDataSet' :: RowLevelPermissionDataSet -> RowLevelPermissionPolicy
$sel:arn:RowLevelPermissionDataSet' :: RowLevelPermissionDataSet -> Text
$sel:formatVersion:RowLevelPermissionDataSet' :: RowLevelPermissionDataSet -> Maybe RowLevelPermissionFormatVersion
$sel:namespace:RowLevelPermissionDataSet' :: RowLevelPermissionDataSet -> Maybe Text
$sel:status:RowLevelPermissionDataSet' :: RowLevelPermissionDataSet -> Maybe Status
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"Status" Text -> Status -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Status -> Pair) -> Maybe Status -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Status
status,
(Text
"Namespace" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
namespace,
(Text
"FormatVersion" Text -> RowLevelPermissionFormatVersion -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (RowLevelPermissionFormatVersion -> Pair)
-> Maybe RowLevelPermissionFormatVersion -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe RowLevelPermissionFormatVersion
formatVersion,
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Arn" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
arn),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
(Text
"PermissionPolicy" Text -> RowLevelPermissionPolicy -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= RowLevelPermissionPolicy
permissionPolicy)
]
)