{-# 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.ColumnLevelPermissionRule where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
data ColumnLevelPermissionRule = ColumnLevelPermissionRule'
{
ColumnLevelPermissionRule -> Maybe (NonEmpty Text)
columnNames :: Prelude.Maybe (Prelude.NonEmpty Prelude.Text),
ColumnLevelPermissionRule -> Maybe (NonEmpty Text)
principals :: Prelude.Maybe (Prelude.NonEmpty Prelude.Text)
}
deriving (ColumnLevelPermissionRule -> ColumnLevelPermissionRule -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ColumnLevelPermissionRule -> ColumnLevelPermissionRule -> Bool
$c/= :: ColumnLevelPermissionRule -> ColumnLevelPermissionRule -> Bool
== :: ColumnLevelPermissionRule -> ColumnLevelPermissionRule -> Bool
$c== :: ColumnLevelPermissionRule -> ColumnLevelPermissionRule -> Bool
Prelude.Eq, ReadPrec [ColumnLevelPermissionRule]
ReadPrec ColumnLevelPermissionRule
Int -> ReadS ColumnLevelPermissionRule
ReadS [ColumnLevelPermissionRule]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ColumnLevelPermissionRule]
$creadListPrec :: ReadPrec [ColumnLevelPermissionRule]
readPrec :: ReadPrec ColumnLevelPermissionRule
$creadPrec :: ReadPrec ColumnLevelPermissionRule
readList :: ReadS [ColumnLevelPermissionRule]
$creadList :: ReadS [ColumnLevelPermissionRule]
readsPrec :: Int -> ReadS ColumnLevelPermissionRule
$creadsPrec :: Int -> ReadS ColumnLevelPermissionRule
Prelude.Read, Int -> ColumnLevelPermissionRule -> ShowS
[ColumnLevelPermissionRule] -> ShowS
ColumnLevelPermissionRule -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ColumnLevelPermissionRule] -> ShowS
$cshowList :: [ColumnLevelPermissionRule] -> ShowS
show :: ColumnLevelPermissionRule -> String
$cshow :: ColumnLevelPermissionRule -> String
showsPrec :: Int -> ColumnLevelPermissionRule -> ShowS
$cshowsPrec :: Int -> ColumnLevelPermissionRule -> ShowS
Prelude.Show, forall x.
Rep ColumnLevelPermissionRule x -> ColumnLevelPermissionRule
forall x.
ColumnLevelPermissionRule -> Rep ColumnLevelPermissionRule x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ColumnLevelPermissionRule x -> ColumnLevelPermissionRule
$cfrom :: forall x.
ColumnLevelPermissionRule -> Rep ColumnLevelPermissionRule x
Prelude.Generic)
newColumnLevelPermissionRule ::
ColumnLevelPermissionRule
newColumnLevelPermissionRule :: ColumnLevelPermissionRule
newColumnLevelPermissionRule =
ColumnLevelPermissionRule'
{ $sel:columnNames:ColumnLevelPermissionRule' :: Maybe (NonEmpty Text)
columnNames =
forall a. Maybe a
Prelude.Nothing,
$sel:principals:ColumnLevelPermissionRule' :: Maybe (NonEmpty Text)
principals = forall a. Maybe a
Prelude.Nothing
}
columnLevelPermissionRule_columnNames :: Lens.Lens' ColumnLevelPermissionRule (Prelude.Maybe (Prelude.NonEmpty Prelude.Text))
columnLevelPermissionRule_columnNames :: Lens' ColumnLevelPermissionRule (Maybe (NonEmpty Text))
columnLevelPermissionRule_columnNames = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ColumnLevelPermissionRule' {Maybe (NonEmpty Text)
columnNames :: Maybe (NonEmpty Text)
$sel:columnNames:ColumnLevelPermissionRule' :: ColumnLevelPermissionRule -> Maybe (NonEmpty Text)
columnNames} -> Maybe (NonEmpty Text)
columnNames) (\s :: ColumnLevelPermissionRule
s@ColumnLevelPermissionRule' {} Maybe (NonEmpty Text)
a -> ColumnLevelPermissionRule
s {$sel:columnNames:ColumnLevelPermissionRule' :: Maybe (NonEmpty Text)
columnNames = Maybe (NonEmpty Text)
a} :: ColumnLevelPermissionRule) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
columnLevelPermissionRule_principals :: Lens.Lens' ColumnLevelPermissionRule (Prelude.Maybe (Prelude.NonEmpty Prelude.Text))
columnLevelPermissionRule_principals :: Lens' ColumnLevelPermissionRule (Maybe (NonEmpty Text))
columnLevelPermissionRule_principals = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ColumnLevelPermissionRule' {Maybe (NonEmpty Text)
principals :: Maybe (NonEmpty Text)
$sel:principals:ColumnLevelPermissionRule' :: ColumnLevelPermissionRule -> Maybe (NonEmpty Text)
principals} -> Maybe (NonEmpty Text)
principals) (\s :: ColumnLevelPermissionRule
s@ColumnLevelPermissionRule' {} Maybe (NonEmpty Text)
a -> ColumnLevelPermissionRule
s {$sel:principals:ColumnLevelPermissionRule' :: Maybe (NonEmpty Text)
principals = Maybe (NonEmpty Text)
a} :: ColumnLevelPermissionRule) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instance Data.FromJSON ColumnLevelPermissionRule where
parseJSON :: Value -> Parser ColumnLevelPermissionRule
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"ColumnLevelPermissionRule"
( \Object
x ->
Maybe (NonEmpty Text)
-> Maybe (NonEmpty Text) -> ColumnLevelPermissionRule
ColumnLevelPermissionRule'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"ColumnNames")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"Principals")
)
instance Prelude.Hashable ColumnLevelPermissionRule where
hashWithSalt :: Int -> ColumnLevelPermissionRule -> Int
hashWithSalt Int
_salt ColumnLevelPermissionRule' {Maybe (NonEmpty Text)
principals :: Maybe (NonEmpty Text)
columnNames :: Maybe (NonEmpty Text)
$sel:principals:ColumnLevelPermissionRule' :: ColumnLevelPermissionRule -> Maybe (NonEmpty Text)
$sel:columnNames:ColumnLevelPermissionRule' :: ColumnLevelPermissionRule -> Maybe (NonEmpty Text)
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (NonEmpty Text)
columnNames
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (NonEmpty Text)
principals
instance Prelude.NFData ColumnLevelPermissionRule where
rnf :: ColumnLevelPermissionRule -> ()
rnf ColumnLevelPermissionRule' {Maybe (NonEmpty Text)
principals :: Maybe (NonEmpty Text)
columnNames :: Maybe (NonEmpty Text)
$sel:principals:ColumnLevelPermissionRule' :: ColumnLevelPermissionRule -> Maybe (NonEmpty Text)
$sel:columnNames:ColumnLevelPermissionRule' :: ColumnLevelPermissionRule -> Maybe (NonEmpty Text)
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe (NonEmpty Text)
columnNames
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe (NonEmpty Text)
principals
instance Data.ToJSON ColumnLevelPermissionRule where
toJSON :: ColumnLevelPermissionRule -> Value
toJSON ColumnLevelPermissionRule' {Maybe (NonEmpty Text)
principals :: Maybe (NonEmpty Text)
columnNames :: Maybe (NonEmpty Text)
$sel:principals:ColumnLevelPermissionRule' :: ColumnLevelPermissionRule -> Maybe (NonEmpty Text)
$sel:columnNames:ColumnLevelPermissionRule' :: ColumnLevelPermissionRule -> Maybe (NonEmpty Text)
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"ColumnNames" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (NonEmpty Text)
columnNames,
(Key
"Principals" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (NonEmpty Text)
principals
]
)