{-# 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.SSOAdmin.Types.AccountAssignment where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.SSOAdmin.Types.PrincipalType
data AccountAssignment = AccountAssignment'
{
AccountAssignment -> Maybe Text
principalId :: Prelude.Maybe Prelude.Text,
AccountAssignment -> Maybe PrincipalType
principalType :: Prelude.Maybe PrincipalType,
AccountAssignment -> Maybe Text
accountId :: Prelude.Maybe Prelude.Text,
AccountAssignment -> Maybe Text
permissionSetArn :: Prelude.Maybe Prelude.Text
}
deriving (AccountAssignment -> AccountAssignment -> Bool
(AccountAssignment -> AccountAssignment -> Bool)
-> (AccountAssignment -> AccountAssignment -> Bool)
-> Eq AccountAssignment
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AccountAssignment -> AccountAssignment -> Bool
$c/= :: AccountAssignment -> AccountAssignment -> Bool
== :: AccountAssignment -> AccountAssignment -> Bool
$c== :: AccountAssignment -> AccountAssignment -> Bool
Prelude.Eq, ReadPrec [AccountAssignment]
ReadPrec AccountAssignment
Int -> ReadS AccountAssignment
ReadS [AccountAssignment]
(Int -> ReadS AccountAssignment)
-> ReadS [AccountAssignment]
-> ReadPrec AccountAssignment
-> ReadPrec [AccountAssignment]
-> Read AccountAssignment
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AccountAssignment]
$creadListPrec :: ReadPrec [AccountAssignment]
readPrec :: ReadPrec AccountAssignment
$creadPrec :: ReadPrec AccountAssignment
readList :: ReadS [AccountAssignment]
$creadList :: ReadS [AccountAssignment]
readsPrec :: Int -> ReadS AccountAssignment
$creadsPrec :: Int -> ReadS AccountAssignment
Prelude.Read, Int -> AccountAssignment -> ShowS
[AccountAssignment] -> ShowS
AccountAssignment -> String
(Int -> AccountAssignment -> ShowS)
-> (AccountAssignment -> String)
-> ([AccountAssignment] -> ShowS)
-> Show AccountAssignment
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AccountAssignment] -> ShowS
$cshowList :: [AccountAssignment] -> ShowS
show :: AccountAssignment -> String
$cshow :: AccountAssignment -> String
showsPrec :: Int -> AccountAssignment -> ShowS
$cshowsPrec :: Int -> AccountAssignment -> ShowS
Prelude.Show, (forall x. AccountAssignment -> Rep AccountAssignment x)
-> (forall x. Rep AccountAssignment x -> AccountAssignment)
-> Generic AccountAssignment
forall x. Rep AccountAssignment x -> AccountAssignment
forall x. AccountAssignment -> Rep AccountAssignment x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep AccountAssignment x -> AccountAssignment
$cfrom :: forall x. AccountAssignment -> Rep AccountAssignment x
Prelude.Generic)
newAccountAssignment ::
AccountAssignment
newAccountAssignment :: AccountAssignment
newAccountAssignment =
AccountAssignment' :: Maybe Text
-> Maybe PrincipalType
-> Maybe Text
-> Maybe Text
-> AccountAssignment
AccountAssignment'
{ $sel:principalId:AccountAssignment' :: Maybe Text
principalId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:principalType:AccountAssignment' :: Maybe PrincipalType
principalType = Maybe PrincipalType
forall a. Maybe a
Prelude.Nothing,
$sel:accountId:AccountAssignment' :: Maybe Text
accountId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:permissionSetArn:AccountAssignment' :: Maybe Text
permissionSetArn = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
accountAssignment_principalId :: Lens.Lens' AccountAssignment (Prelude.Maybe Prelude.Text)
accountAssignment_principalId :: (Maybe Text -> f (Maybe Text))
-> AccountAssignment -> f AccountAssignment
accountAssignment_principalId = (AccountAssignment -> Maybe Text)
-> (AccountAssignment -> Maybe Text -> AccountAssignment)
-> Lens
AccountAssignment AccountAssignment (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AccountAssignment' {Maybe Text
principalId :: Maybe Text
$sel:principalId:AccountAssignment' :: AccountAssignment -> Maybe Text
principalId} -> Maybe Text
principalId) (\s :: AccountAssignment
s@AccountAssignment' {} Maybe Text
a -> AccountAssignment
s {$sel:principalId:AccountAssignment' :: Maybe Text
principalId = Maybe Text
a} :: AccountAssignment)
accountAssignment_principalType :: Lens.Lens' AccountAssignment (Prelude.Maybe PrincipalType)
accountAssignment_principalType :: (Maybe PrincipalType -> f (Maybe PrincipalType))
-> AccountAssignment -> f AccountAssignment
accountAssignment_principalType = (AccountAssignment -> Maybe PrincipalType)
-> (AccountAssignment -> Maybe PrincipalType -> AccountAssignment)
-> Lens
AccountAssignment
AccountAssignment
(Maybe PrincipalType)
(Maybe PrincipalType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AccountAssignment' {Maybe PrincipalType
principalType :: Maybe PrincipalType
$sel:principalType:AccountAssignment' :: AccountAssignment -> Maybe PrincipalType
principalType} -> Maybe PrincipalType
principalType) (\s :: AccountAssignment
s@AccountAssignment' {} Maybe PrincipalType
a -> AccountAssignment
s {$sel:principalType:AccountAssignment' :: Maybe PrincipalType
principalType = Maybe PrincipalType
a} :: AccountAssignment)
accountAssignment_accountId :: Lens.Lens' AccountAssignment (Prelude.Maybe Prelude.Text)
accountAssignment_accountId :: (Maybe Text -> f (Maybe Text))
-> AccountAssignment -> f AccountAssignment
accountAssignment_accountId = (AccountAssignment -> Maybe Text)
-> (AccountAssignment -> Maybe Text -> AccountAssignment)
-> Lens
AccountAssignment AccountAssignment (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AccountAssignment' {Maybe Text
accountId :: Maybe Text
$sel:accountId:AccountAssignment' :: AccountAssignment -> Maybe Text
accountId} -> Maybe Text
accountId) (\s :: AccountAssignment
s@AccountAssignment' {} Maybe Text
a -> AccountAssignment
s {$sel:accountId:AccountAssignment' :: Maybe Text
accountId = Maybe Text
a} :: AccountAssignment)
accountAssignment_permissionSetArn :: Lens.Lens' AccountAssignment (Prelude.Maybe Prelude.Text)
accountAssignment_permissionSetArn :: (Maybe Text -> f (Maybe Text))
-> AccountAssignment -> f AccountAssignment
accountAssignment_permissionSetArn = (AccountAssignment -> Maybe Text)
-> (AccountAssignment -> Maybe Text -> AccountAssignment)
-> Lens
AccountAssignment AccountAssignment (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AccountAssignment' {Maybe Text
permissionSetArn :: Maybe Text
$sel:permissionSetArn:AccountAssignment' :: AccountAssignment -> Maybe Text
permissionSetArn} -> Maybe Text
permissionSetArn) (\s :: AccountAssignment
s@AccountAssignment' {} Maybe Text
a -> AccountAssignment
s {$sel:permissionSetArn:AccountAssignment' :: Maybe Text
permissionSetArn = Maybe Text
a} :: AccountAssignment)
instance Core.FromJSON AccountAssignment where
parseJSON :: Value -> Parser AccountAssignment
parseJSON =
String
-> (Object -> Parser AccountAssignment)
-> Value
-> Parser AccountAssignment
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"AccountAssignment"
( \Object
x ->
Maybe Text
-> Maybe PrincipalType
-> Maybe Text
-> Maybe Text
-> AccountAssignment
AccountAssignment'
(Maybe Text
-> Maybe PrincipalType
-> Maybe Text
-> Maybe Text
-> AccountAssignment)
-> Parser (Maybe Text)
-> Parser
(Maybe PrincipalType
-> Maybe Text -> Maybe Text -> AccountAssignment)
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
"PrincipalId")
Parser
(Maybe PrincipalType
-> Maybe Text -> Maybe Text -> AccountAssignment)
-> Parser (Maybe PrincipalType)
-> Parser (Maybe Text -> Maybe Text -> AccountAssignment)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe PrincipalType)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"PrincipalType")
Parser (Maybe Text -> Maybe Text -> AccountAssignment)
-> Parser (Maybe Text) -> Parser (Maybe Text -> AccountAssignment)
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")
Parser (Maybe Text -> AccountAssignment)
-> Parser (Maybe Text) -> Parser AccountAssignment
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
"PermissionSetArn")
)
instance Prelude.Hashable AccountAssignment
instance Prelude.NFData AccountAssignment