{-# 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.Grafana.Types.AssertionAttributes where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data AssertionAttributes = AssertionAttributes'
{
AssertionAttributes -> Maybe Text
email :: Prelude.Maybe Prelude.Text,
AssertionAttributes -> Maybe Text
groups :: Prelude.Maybe Prelude.Text,
AssertionAttributes -> Maybe Text
org :: Prelude.Maybe Prelude.Text,
AssertionAttributes -> Maybe Text
role' :: Prelude.Maybe Prelude.Text,
AssertionAttributes -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
AssertionAttributes -> Maybe Text
login :: Prelude.Maybe Prelude.Text
}
deriving (AssertionAttributes -> AssertionAttributes -> Bool
(AssertionAttributes -> AssertionAttributes -> Bool)
-> (AssertionAttributes -> AssertionAttributes -> Bool)
-> Eq AssertionAttributes
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AssertionAttributes -> AssertionAttributes -> Bool
$c/= :: AssertionAttributes -> AssertionAttributes -> Bool
== :: AssertionAttributes -> AssertionAttributes -> Bool
$c== :: AssertionAttributes -> AssertionAttributes -> Bool
Prelude.Eq, ReadPrec [AssertionAttributes]
ReadPrec AssertionAttributes
Int -> ReadS AssertionAttributes
ReadS [AssertionAttributes]
(Int -> ReadS AssertionAttributes)
-> ReadS [AssertionAttributes]
-> ReadPrec AssertionAttributes
-> ReadPrec [AssertionAttributes]
-> Read AssertionAttributes
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AssertionAttributes]
$creadListPrec :: ReadPrec [AssertionAttributes]
readPrec :: ReadPrec AssertionAttributes
$creadPrec :: ReadPrec AssertionAttributes
readList :: ReadS [AssertionAttributes]
$creadList :: ReadS [AssertionAttributes]
readsPrec :: Int -> ReadS AssertionAttributes
$creadsPrec :: Int -> ReadS AssertionAttributes
Prelude.Read, Int -> AssertionAttributes -> ShowS
[AssertionAttributes] -> ShowS
AssertionAttributes -> String
(Int -> AssertionAttributes -> ShowS)
-> (AssertionAttributes -> String)
-> ([AssertionAttributes] -> ShowS)
-> Show AssertionAttributes
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AssertionAttributes] -> ShowS
$cshowList :: [AssertionAttributes] -> ShowS
show :: AssertionAttributes -> String
$cshow :: AssertionAttributes -> String
showsPrec :: Int -> AssertionAttributes -> ShowS
$cshowsPrec :: Int -> AssertionAttributes -> ShowS
Prelude.Show, (forall x. AssertionAttributes -> Rep AssertionAttributes x)
-> (forall x. Rep AssertionAttributes x -> AssertionAttributes)
-> Generic AssertionAttributes
forall x. Rep AssertionAttributes x -> AssertionAttributes
forall x. AssertionAttributes -> Rep AssertionAttributes x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep AssertionAttributes x -> AssertionAttributes
$cfrom :: forall x. AssertionAttributes -> Rep AssertionAttributes x
Prelude.Generic)
newAssertionAttributes ::
AssertionAttributes
newAssertionAttributes :: AssertionAttributes
newAssertionAttributes =
AssertionAttributes' :: Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> AssertionAttributes
AssertionAttributes'
{ $sel:email:AssertionAttributes' :: Maybe Text
email = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:groups:AssertionAttributes' :: Maybe Text
groups = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:org:AssertionAttributes' :: Maybe Text
org = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:role':AssertionAttributes' :: Maybe Text
role' = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:name:AssertionAttributes' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:login:AssertionAttributes' :: Maybe Text
login = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
assertionAttributes_email :: Lens.Lens' AssertionAttributes (Prelude.Maybe Prelude.Text)
assertionAttributes_email :: (Maybe Text -> f (Maybe Text))
-> AssertionAttributes -> f AssertionAttributes
assertionAttributes_email = (AssertionAttributes -> Maybe Text)
-> (AssertionAttributes -> Maybe Text -> AssertionAttributes)
-> Lens
AssertionAttributes AssertionAttributes (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssertionAttributes' {Maybe Text
email :: Maybe Text
$sel:email:AssertionAttributes' :: AssertionAttributes -> Maybe Text
email} -> Maybe Text
email) (\s :: AssertionAttributes
s@AssertionAttributes' {} Maybe Text
a -> AssertionAttributes
s {$sel:email:AssertionAttributes' :: Maybe Text
email = Maybe Text
a} :: AssertionAttributes)
assertionAttributes_groups :: Lens.Lens' AssertionAttributes (Prelude.Maybe Prelude.Text)
assertionAttributes_groups :: (Maybe Text -> f (Maybe Text))
-> AssertionAttributes -> f AssertionAttributes
assertionAttributes_groups = (AssertionAttributes -> Maybe Text)
-> (AssertionAttributes -> Maybe Text -> AssertionAttributes)
-> Lens
AssertionAttributes AssertionAttributes (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssertionAttributes' {Maybe Text
groups :: Maybe Text
$sel:groups:AssertionAttributes' :: AssertionAttributes -> Maybe Text
groups} -> Maybe Text
groups) (\s :: AssertionAttributes
s@AssertionAttributes' {} Maybe Text
a -> AssertionAttributes
s {$sel:groups:AssertionAttributes' :: Maybe Text
groups = Maybe Text
a} :: AssertionAttributes)
assertionAttributes_org :: Lens.Lens' AssertionAttributes (Prelude.Maybe Prelude.Text)
assertionAttributes_org :: (Maybe Text -> f (Maybe Text))
-> AssertionAttributes -> f AssertionAttributes
assertionAttributes_org = (AssertionAttributes -> Maybe Text)
-> (AssertionAttributes -> Maybe Text -> AssertionAttributes)
-> Lens
AssertionAttributes AssertionAttributes (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssertionAttributes' {Maybe Text
org :: Maybe Text
$sel:org:AssertionAttributes' :: AssertionAttributes -> Maybe Text
org} -> Maybe Text
org) (\s :: AssertionAttributes
s@AssertionAttributes' {} Maybe Text
a -> AssertionAttributes
s {$sel:org:AssertionAttributes' :: Maybe Text
org = Maybe Text
a} :: AssertionAttributes)
assertionAttributes_role :: Lens.Lens' AssertionAttributes (Prelude.Maybe Prelude.Text)
assertionAttributes_role :: (Maybe Text -> f (Maybe Text))
-> AssertionAttributes -> f AssertionAttributes
assertionAttributes_role = (AssertionAttributes -> Maybe Text)
-> (AssertionAttributes -> Maybe Text -> AssertionAttributes)
-> Lens
AssertionAttributes AssertionAttributes (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssertionAttributes' {Maybe Text
role' :: Maybe Text
$sel:role':AssertionAttributes' :: AssertionAttributes -> Maybe Text
role'} -> Maybe Text
role') (\s :: AssertionAttributes
s@AssertionAttributes' {} Maybe Text
a -> AssertionAttributes
s {$sel:role':AssertionAttributes' :: Maybe Text
role' = Maybe Text
a} :: AssertionAttributes)
assertionAttributes_name :: Lens.Lens' AssertionAttributes (Prelude.Maybe Prelude.Text)
assertionAttributes_name :: (Maybe Text -> f (Maybe Text))
-> AssertionAttributes -> f AssertionAttributes
assertionAttributes_name = (AssertionAttributes -> Maybe Text)
-> (AssertionAttributes -> Maybe Text -> AssertionAttributes)
-> Lens
AssertionAttributes AssertionAttributes (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssertionAttributes' {Maybe Text
name :: Maybe Text
$sel:name:AssertionAttributes' :: AssertionAttributes -> Maybe Text
name} -> Maybe Text
name) (\s :: AssertionAttributes
s@AssertionAttributes' {} Maybe Text
a -> AssertionAttributes
s {$sel:name:AssertionAttributes' :: Maybe Text
name = Maybe Text
a} :: AssertionAttributes)
assertionAttributes_login :: Lens.Lens' AssertionAttributes (Prelude.Maybe Prelude.Text)
assertionAttributes_login :: (Maybe Text -> f (Maybe Text))
-> AssertionAttributes -> f AssertionAttributes
assertionAttributes_login = (AssertionAttributes -> Maybe Text)
-> (AssertionAttributes -> Maybe Text -> AssertionAttributes)
-> Lens
AssertionAttributes AssertionAttributes (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssertionAttributes' {Maybe Text
login :: Maybe Text
$sel:login:AssertionAttributes' :: AssertionAttributes -> Maybe Text
login} -> Maybe Text
login) (\s :: AssertionAttributes
s@AssertionAttributes' {} Maybe Text
a -> AssertionAttributes
s {$sel:login:AssertionAttributes' :: Maybe Text
login = Maybe Text
a} :: AssertionAttributes)
instance Core.FromJSON AssertionAttributes where
parseJSON :: Value -> Parser AssertionAttributes
parseJSON =
String
-> (Object -> Parser AssertionAttributes)
-> Value
-> Parser AssertionAttributes
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"AssertionAttributes"
( \Object
x ->
Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> AssertionAttributes
AssertionAttributes'
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> AssertionAttributes)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> AssertionAttributes)
forall (f :: * -> *) a b. Functor 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
"email")
Parser
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> AssertionAttributes)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Maybe Text -> Maybe Text -> Maybe Text -> AssertionAttributes)
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
"groups")
Parser
(Maybe Text
-> Maybe Text -> Maybe Text -> Maybe Text -> AssertionAttributes)
-> Parser (Maybe Text)
-> Parser
(Maybe Text -> Maybe Text -> Maybe Text -> AssertionAttributes)
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
"org")
Parser
(Maybe Text -> Maybe Text -> Maybe Text -> AssertionAttributes)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe Text -> AssertionAttributes)
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
"role")
Parser (Maybe Text -> Maybe Text -> AssertionAttributes)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> AssertionAttributes)
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
"name")
Parser (Maybe Text -> AssertionAttributes)
-> Parser (Maybe Text) -> Parser AssertionAttributes
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
"login")
)
instance Prelude.Hashable AssertionAttributes
instance Prelude.NFData AssertionAttributes
instance Core.ToJSON AssertionAttributes where
toJSON :: AssertionAttributes -> Value
toJSON AssertionAttributes' {Maybe Text
login :: Maybe Text
name :: Maybe Text
role' :: Maybe Text
org :: Maybe Text
groups :: Maybe Text
email :: Maybe Text
$sel:login:AssertionAttributes' :: AssertionAttributes -> Maybe Text
$sel:name:AssertionAttributes' :: AssertionAttributes -> Maybe Text
$sel:role':AssertionAttributes' :: AssertionAttributes -> Maybe Text
$sel:org:AssertionAttributes' :: AssertionAttributes -> Maybe Text
$sel:groups:AssertionAttributes' :: AssertionAttributes -> Maybe Text
$sel:email:AssertionAttributes' :: AssertionAttributes -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"email" 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
email,
(Text
"groups" 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
groups,
(Text
"org" 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
org,
(Text
"role" 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
role',
(Text
"name" 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
name,
(Text
"login" 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
login
]
)