{-# 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.SSO.Types.RoleInfo where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data RoleInfo = RoleInfo'
{
RoleInfo -> Maybe Text
roleName :: Prelude.Maybe Prelude.Text,
RoleInfo -> Maybe Text
accountId :: Prelude.Maybe Prelude.Text
}
deriving (RoleInfo -> RoleInfo -> Bool
(RoleInfo -> RoleInfo -> Bool)
-> (RoleInfo -> RoleInfo -> Bool) -> Eq RoleInfo
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RoleInfo -> RoleInfo -> Bool
$c/= :: RoleInfo -> RoleInfo -> Bool
== :: RoleInfo -> RoleInfo -> Bool
$c== :: RoleInfo -> RoleInfo -> Bool
Prelude.Eq, ReadPrec [RoleInfo]
ReadPrec RoleInfo
Int -> ReadS RoleInfo
ReadS [RoleInfo]
(Int -> ReadS RoleInfo)
-> ReadS [RoleInfo]
-> ReadPrec RoleInfo
-> ReadPrec [RoleInfo]
-> Read RoleInfo
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [RoleInfo]
$creadListPrec :: ReadPrec [RoleInfo]
readPrec :: ReadPrec RoleInfo
$creadPrec :: ReadPrec RoleInfo
readList :: ReadS [RoleInfo]
$creadList :: ReadS [RoleInfo]
readsPrec :: Int -> ReadS RoleInfo
$creadsPrec :: Int -> ReadS RoleInfo
Prelude.Read, Int -> RoleInfo -> ShowS
[RoleInfo] -> ShowS
RoleInfo -> String
(Int -> RoleInfo -> ShowS)
-> (RoleInfo -> String) -> ([RoleInfo] -> ShowS) -> Show RoleInfo
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RoleInfo] -> ShowS
$cshowList :: [RoleInfo] -> ShowS
show :: RoleInfo -> String
$cshow :: RoleInfo -> String
showsPrec :: Int -> RoleInfo -> ShowS
$cshowsPrec :: Int -> RoleInfo -> ShowS
Prelude.Show, (forall x. RoleInfo -> Rep RoleInfo x)
-> (forall x. Rep RoleInfo x -> RoleInfo) -> Generic RoleInfo
forall x. Rep RoleInfo x -> RoleInfo
forall x. RoleInfo -> Rep RoleInfo x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep RoleInfo x -> RoleInfo
$cfrom :: forall x. RoleInfo -> Rep RoleInfo x
Prelude.Generic)
newRoleInfo ::
RoleInfo
newRoleInfo :: RoleInfo
newRoleInfo =
RoleInfo' :: Maybe Text -> Maybe Text -> RoleInfo
RoleInfo'
{ $sel:roleName:RoleInfo' :: Maybe Text
roleName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:accountId:RoleInfo' :: Maybe Text
accountId = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
roleInfo_roleName :: Lens.Lens' RoleInfo (Prelude.Maybe Prelude.Text)
roleInfo_roleName :: (Maybe Text -> f (Maybe Text)) -> RoleInfo -> f RoleInfo
roleInfo_roleName = (RoleInfo -> Maybe Text)
-> (RoleInfo -> Maybe Text -> RoleInfo)
-> Lens RoleInfo RoleInfo (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RoleInfo' {Maybe Text
roleName :: Maybe Text
$sel:roleName:RoleInfo' :: RoleInfo -> Maybe Text
roleName} -> Maybe Text
roleName) (\s :: RoleInfo
s@RoleInfo' {} Maybe Text
a -> RoleInfo
s {$sel:roleName:RoleInfo' :: Maybe Text
roleName = Maybe Text
a} :: RoleInfo)
roleInfo_accountId :: Lens.Lens' RoleInfo (Prelude.Maybe Prelude.Text)
roleInfo_accountId :: (Maybe Text -> f (Maybe Text)) -> RoleInfo -> f RoleInfo
roleInfo_accountId = (RoleInfo -> Maybe Text)
-> (RoleInfo -> Maybe Text -> RoleInfo)
-> Lens RoleInfo RoleInfo (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RoleInfo' {Maybe Text
accountId :: Maybe Text
$sel:accountId:RoleInfo' :: RoleInfo -> Maybe Text
accountId} -> Maybe Text
accountId) (\s :: RoleInfo
s@RoleInfo' {} Maybe Text
a -> RoleInfo
s {$sel:accountId:RoleInfo' :: Maybe Text
accountId = Maybe Text
a} :: RoleInfo)
instance Core.FromJSON RoleInfo where
parseJSON :: Value -> Parser RoleInfo
parseJSON =
String -> (Object -> Parser RoleInfo) -> Value -> Parser RoleInfo
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"RoleInfo"
( \Object
x ->
Maybe Text -> Maybe Text -> RoleInfo
RoleInfo'
(Maybe Text -> Maybe Text -> RoleInfo)
-> Parser (Maybe Text) -> Parser (Maybe Text -> RoleInfo)
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
"roleName")
Parser (Maybe Text -> RoleInfo)
-> Parser (Maybe Text) -> Parser RoleInfo
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
"accountId")
)
instance Prelude.Hashable RoleInfo
instance Prelude.NFData RoleInfo