{-# 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.Transfer.Types.IdentityProviderDetails where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data IdentityProviderDetails = IdentityProviderDetails'
{
IdentityProviderDetails -> Maybe Text
invocationRole :: Prelude.Maybe Prelude.Text,
IdentityProviderDetails -> Maybe Text
directoryId :: Prelude.Maybe Prelude.Text,
IdentityProviderDetails -> Maybe Text
url :: Prelude.Maybe Prelude.Text
}
deriving (IdentityProviderDetails -> IdentityProviderDetails -> Bool
(IdentityProviderDetails -> IdentityProviderDetails -> Bool)
-> (IdentityProviderDetails -> IdentityProviderDetails -> Bool)
-> Eq IdentityProviderDetails
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: IdentityProviderDetails -> IdentityProviderDetails -> Bool
$c/= :: IdentityProviderDetails -> IdentityProviderDetails -> Bool
== :: IdentityProviderDetails -> IdentityProviderDetails -> Bool
$c== :: IdentityProviderDetails -> IdentityProviderDetails -> Bool
Prelude.Eq, ReadPrec [IdentityProviderDetails]
ReadPrec IdentityProviderDetails
Int -> ReadS IdentityProviderDetails
ReadS [IdentityProviderDetails]
(Int -> ReadS IdentityProviderDetails)
-> ReadS [IdentityProviderDetails]
-> ReadPrec IdentityProviderDetails
-> ReadPrec [IdentityProviderDetails]
-> Read IdentityProviderDetails
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [IdentityProviderDetails]
$creadListPrec :: ReadPrec [IdentityProviderDetails]
readPrec :: ReadPrec IdentityProviderDetails
$creadPrec :: ReadPrec IdentityProviderDetails
readList :: ReadS [IdentityProviderDetails]
$creadList :: ReadS [IdentityProviderDetails]
readsPrec :: Int -> ReadS IdentityProviderDetails
$creadsPrec :: Int -> ReadS IdentityProviderDetails
Prelude.Read, Int -> IdentityProviderDetails -> ShowS
[IdentityProviderDetails] -> ShowS
IdentityProviderDetails -> String
(Int -> IdentityProviderDetails -> ShowS)
-> (IdentityProviderDetails -> String)
-> ([IdentityProviderDetails] -> ShowS)
-> Show IdentityProviderDetails
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [IdentityProviderDetails] -> ShowS
$cshowList :: [IdentityProviderDetails] -> ShowS
show :: IdentityProviderDetails -> String
$cshow :: IdentityProviderDetails -> String
showsPrec :: Int -> IdentityProviderDetails -> ShowS
$cshowsPrec :: Int -> IdentityProviderDetails -> ShowS
Prelude.Show, (forall x.
IdentityProviderDetails -> Rep IdentityProviderDetails x)
-> (forall x.
Rep IdentityProviderDetails x -> IdentityProviderDetails)
-> Generic IdentityProviderDetails
forall x. Rep IdentityProviderDetails x -> IdentityProviderDetails
forall x. IdentityProviderDetails -> Rep IdentityProviderDetails x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep IdentityProviderDetails x -> IdentityProviderDetails
$cfrom :: forall x. IdentityProviderDetails -> Rep IdentityProviderDetails x
Prelude.Generic)
newIdentityProviderDetails ::
IdentityProviderDetails
newIdentityProviderDetails :: IdentityProviderDetails
newIdentityProviderDetails =
IdentityProviderDetails' :: Maybe Text -> Maybe Text -> Maybe Text -> IdentityProviderDetails
IdentityProviderDetails'
{ $sel:invocationRole:IdentityProviderDetails' :: Maybe Text
invocationRole =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:directoryId:IdentityProviderDetails' :: Maybe Text
directoryId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:url:IdentityProviderDetails' :: Maybe Text
url = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
identityProviderDetails_invocationRole :: Lens.Lens' IdentityProviderDetails (Prelude.Maybe Prelude.Text)
identityProviderDetails_invocationRole :: (Maybe Text -> f (Maybe Text))
-> IdentityProviderDetails -> f IdentityProviderDetails
identityProviderDetails_invocationRole = (IdentityProviderDetails -> Maybe Text)
-> (IdentityProviderDetails
-> Maybe Text -> IdentityProviderDetails)
-> Lens
IdentityProviderDetails
IdentityProviderDetails
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\IdentityProviderDetails' {Maybe Text
invocationRole :: Maybe Text
$sel:invocationRole:IdentityProviderDetails' :: IdentityProviderDetails -> Maybe Text
invocationRole} -> Maybe Text
invocationRole) (\s :: IdentityProviderDetails
s@IdentityProviderDetails' {} Maybe Text
a -> IdentityProviderDetails
s {$sel:invocationRole:IdentityProviderDetails' :: Maybe Text
invocationRole = Maybe Text
a} :: IdentityProviderDetails)
identityProviderDetails_directoryId :: Lens.Lens' IdentityProviderDetails (Prelude.Maybe Prelude.Text)
identityProviderDetails_directoryId :: (Maybe Text -> f (Maybe Text))
-> IdentityProviderDetails -> f IdentityProviderDetails
identityProviderDetails_directoryId = (IdentityProviderDetails -> Maybe Text)
-> (IdentityProviderDetails
-> Maybe Text -> IdentityProviderDetails)
-> Lens
IdentityProviderDetails
IdentityProviderDetails
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\IdentityProviderDetails' {Maybe Text
directoryId :: Maybe Text
$sel:directoryId:IdentityProviderDetails' :: IdentityProviderDetails -> Maybe Text
directoryId} -> Maybe Text
directoryId) (\s :: IdentityProviderDetails
s@IdentityProviderDetails' {} Maybe Text
a -> IdentityProviderDetails
s {$sel:directoryId:IdentityProviderDetails' :: Maybe Text
directoryId = Maybe Text
a} :: IdentityProviderDetails)
identityProviderDetails_url :: Lens.Lens' IdentityProviderDetails (Prelude.Maybe Prelude.Text)
identityProviderDetails_url :: (Maybe Text -> f (Maybe Text))
-> IdentityProviderDetails -> f IdentityProviderDetails
identityProviderDetails_url = (IdentityProviderDetails -> Maybe Text)
-> (IdentityProviderDetails
-> Maybe Text -> IdentityProviderDetails)
-> Lens
IdentityProviderDetails
IdentityProviderDetails
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\IdentityProviderDetails' {Maybe Text
url :: Maybe Text
$sel:url:IdentityProviderDetails' :: IdentityProviderDetails -> Maybe Text
url} -> Maybe Text
url) (\s :: IdentityProviderDetails
s@IdentityProviderDetails' {} Maybe Text
a -> IdentityProviderDetails
s {$sel:url:IdentityProviderDetails' :: Maybe Text
url = Maybe Text
a} :: IdentityProviderDetails)
instance Core.FromJSON IdentityProviderDetails where
parseJSON :: Value -> Parser IdentityProviderDetails
parseJSON =
String
-> (Object -> Parser IdentityProviderDetails)
-> Value
-> Parser IdentityProviderDetails
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"IdentityProviderDetails"
( \Object
x ->
Maybe Text -> Maybe Text -> Maybe Text -> IdentityProviderDetails
IdentityProviderDetails'
(Maybe Text -> Maybe Text -> Maybe Text -> IdentityProviderDetails)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe Text -> IdentityProviderDetails)
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
"InvocationRole")
Parser (Maybe Text -> Maybe Text -> IdentityProviderDetails)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> IdentityProviderDetails)
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
"DirectoryId")
Parser (Maybe Text -> IdentityProviderDetails)
-> Parser (Maybe Text) -> Parser IdentityProviderDetails
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
"Url")
)
instance Prelude.Hashable IdentityProviderDetails
instance Prelude.NFData IdentityProviderDetails
instance Core.ToJSON IdentityProviderDetails where
toJSON :: IdentityProviderDetails -> Value
toJSON IdentityProviderDetails' {Maybe Text
url :: Maybe Text
directoryId :: Maybe Text
invocationRole :: Maybe Text
$sel:url:IdentityProviderDetails' :: IdentityProviderDetails -> Maybe Text
$sel:directoryId:IdentityProviderDetails' :: IdentityProviderDetails -> Maybe Text
$sel:invocationRole:IdentityProviderDetails' :: IdentityProviderDetails -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"InvocationRole" 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
invocationRole,
(Text
"DirectoryId" 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
directoryId,
(Text
"Url" 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
url
]
)