{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}
module Amazonka.DirectoryService.EnableSso
(
EnableSso (..),
newEnableSso,
enableSso_password,
enableSso_userName,
enableSso_directoryId,
EnableSsoResponse (..),
newEnableSsoResponse,
enableSsoResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.DirectoryService.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data EnableSso = EnableSso'
{
EnableSso -> Maybe (Sensitive Text)
password :: Prelude.Maybe (Data.Sensitive Prelude.Text),
EnableSso -> Maybe Text
userName :: Prelude.Maybe Prelude.Text,
EnableSso -> Text
directoryId :: Prelude.Text
}
deriving (EnableSso -> EnableSso -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: EnableSso -> EnableSso -> Bool
$c/= :: EnableSso -> EnableSso -> Bool
== :: EnableSso -> EnableSso -> Bool
$c== :: EnableSso -> EnableSso -> Bool
Prelude.Eq, Int -> EnableSso -> ShowS
[EnableSso] -> ShowS
EnableSso -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [EnableSso] -> ShowS
$cshowList :: [EnableSso] -> ShowS
show :: EnableSso -> String
$cshow :: EnableSso -> String
showsPrec :: Int -> EnableSso -> ShowS
$cshowsPrec :: Int -> EnableSso -> ShowS
Prelude.Show, forall x. Rep EnableSso x -> EnableSso
forall x. EnableSso -> Rep EnableSso x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep EnableSso x -> EnableSso
$cfrom :: forall x. EnableSso -> Rep EnableSso x
Prelude.Generic)
newEnableSso ::
Prelude.Text ->
EnableSso
newEnableSso :: Text -> EnableSso
newEnableSso Text
pDirectoryId_ =
EnableSso'
{ $sel:password:EnableSso' :: Maybe (Sensitive Text)
password = forall a. Maybe a
Prelude.Nothing,
$sel:userName:EnableSso' :: Maybe Text
userName = forall a. Maybe a
Prelude.Nothing,
$sel:directoryId:EnableSso' :: Text
directoryId = Text
pDirectoryId_
}
enableSso_password :: Lens.Lens' EnableSso (Prelude.Maybe Prelude.Text)
enableSso_password :: Lens' EnableSso (Maybe Text)
enableSso_password = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EnableSso' {Maybe (Sensitive Text)
password :: Maybe (Sensitive Text)
$sel:password:EnableSso' :: EnableSso -> Maybe (Sensitive Text)
password} -> Maybe (Sensitive Text)
password) (\s :: EnableSso
s@EnableSso' {} Maybe (Sensitive Text)
a -> EnableSso
s {$sel:password:EnableSso' :: Maybe (Sensitive Text)
password = Maybe (Sensitive Text)
a} :: EnableSso) 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 a. Iso' (Sensitive a) a
Data._Sensitive
enableSso_userName :: Lens.Lens' EnableSso (Prelude.Maybe Prelude.Text)
enableSso_userName :: Lens' EnableSso (Maybe Text)
enableSso_userName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EnableSso' {Maybe Text
userName :: Maybe Text
$sel:userName:EnableSso' :: EnableSso -> Maybe Text
userName} -> Maybe Text
userName) (\s :: EnableSso
s@EnableSso' {} Maybe Text
a -> EnableSso
s {$sel:userName:EnableSso' :: Maybe Text
userName = Maybe Text
a} :: EnableSso)
enableSso_directoryId :: Lens.Lens' EnableSso Prelude.Text
enableSso_directoryId :: Lens' EnableSso Text
enableSso_directoryId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EnableSso' {Text
directoryId :: Text
$sel:directoryId:EnableSso' :: EnableSso -> Text
directoryId} -> Text
directoryId) (\s :: EnableSso
s@EnableSso' {} Text
a -> EnableSso
s {$sel:directoryId:EnableSso' :: Text
directoryId = Text
a} :: EnableSso)
instance Core.AWSRequest EnableSso where
type AWSResponse EnableSso = EnableSsoResponse
request :: (Service -> Service) -> EnableSso -> Request EnableSso
request Service -> Service
overrides =
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy EnableSso
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse EnableSso)))
response =
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> () -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveEmpty
( \Int
s ResponseHeaders
h ()
x ->
Int -> EnableSsoResponse
EnableSsoResponse'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
)
instance Prelude.Hashable EnableSso where
hashWithSalt :: Int -> EnableSso -> Int
hashWithSalt Int
_salt EnableSso' {Maybe Text
Maybe (Sensitive Text)
Text
directoryId :: Text
userName :: Maybe Text
password :: Maybe (Sensitive Text)
$sel:directoryId:EnableSso' :: EnableSso -> Text
$sel:userName:EnableSso' :: EnableSso -> Maybe Text
$sel:password:EnableSso' :: EnableSso -> Maybe (Sensitive Text)
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (Sensitive Text)
password
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
userName
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
directoryId
instance Prelude.NFData EnableSso where
rnf :: EnableSso -> ()
rnf EnableSso' {Maybe Text
Maybe (Sensitive Text)
Text
directoryId :: Text
userName :: Maybe Text
password :: Maybe (Sensitive Text)
$sel:directoryId:EnableSso' :: EnableSso -> Text
$sel:userName:EnableSso' :: EnableSso -> Maybe Text
$sel:password:EnableSso' :: EnableSso -> Maybe (Sensitive Text)
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe (Sensitive Text)
password
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
userName
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
directoryId
instance Data.ToHeaders EnableSso where
toHeaders :: EnableSso -> ResponseHeaders
toHeaders =
forall a b. a -> b -> a
Prelude.const
( forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"X-Amz-Target"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"DirectoryService_20150416.EnableSso" ::
Prelude.ByteString
),
HeaderName
"Content-Type"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Data.ToJSON EnableSso where
toJSON :: EnableSso -> Value
toJSON EnableSso' {Maybe Text
Maybe (Sensitive Text)
Text
directoryId :: Text
userName :: Maybe Text
password :: Maybe (Sensitive Text)
$sel:directoryId:EnableSso' :: EnableSso -> Text
$sel:userName:EnableSso' :: EnableSso -> Maybe Text
$sel:password:EnableSso' :: EnableSso -> Maybe (Sensitive Text)
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"Password" 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 (Sensitive Text)
password,
(Key
"UserName" 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 Text
userName,
forall a. a -> Maybe a
Prelude.Just (Key
"DirectoryId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
directoryId)
]
)
instance Data.ToPath EnableSso where
toPath :: EnableSso -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Data.ToQuery EnableSso where
toQuery :: EnableSso -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data EnableSsoResponse = EnableSsoResponse'
{
EnableSsoResponse -> Int
httpStatus :: Prelude.Int
}
deriving (EnableSsoResponse -> EnableSsoResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: EnableSsoResponse -> EnableSsoResponse -> Bool
$c/= :: EnableSsoResponse -> EnableSsoResponse -> Bool
== :: EnableSsoResponse -> EnableSsoResponse -> Bool
$c== :: EnableSsoResponse -> EnableSsoResponse -> Bool
Prelude.Eq, ReadPrec [EnableSsoResponse]
ReadPrec EnableSsoResponse
Int -> ReadS EnableSsoResponse
ReadS [EnableSsoResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [EnableSsoResponse]
$creadListPrec :: ReadPrec [EnableSsoResponse]
readPrec :: ReadPrec EnableSsoResponse
$creadPrec :: ReadPrec EnableSsoResponse
readList :: ReadS [EnableSsoResponse]
$creadList :: ReadS [EnableSsoResponse]
readsPrec :: Int -> ReadS EnableSsoResponse
$creadsPrec :: Int -> ReadS EnableSsoResponse
Prelude.Read, Int -> EnableSsoResponse -> ShowS
[EnableSsoResponse] -> ShowS
EnableSsoResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [EnableSsoResponse] -> ShowS
$cshowList :: [EnableSsoResponse] -> ShowS
show :: EnableSsoResponse -> String
$cshow :: EnableSsoResponse -> String
showsPrec :: Int -> EnableSsoResponse -> ShowS
$cshowsPrec :: Int -> EnableSsoResponse -> ShowS
Prelude.Show, forall x. Rep EnableSsoResponse x -> EnableSsoResponse
forall x. EnableSsoResponse -> Rep EnableSsoResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep EnableSsoResponse x -> EnableSsoResponse
$cfrom :: forall x. EnableSsoResponse -> Rep EnableSsoResponse x
Prelude.Generic)
newEnableSsoResponse ::
Prelude.Int ->
EnableSsoResponse
newEnableSsoResponse :: Int -> EnableSsoResponse
newEnableSsoResponse Int
pHttpStatus_ =
EnableSsoResponse' {$sel:httpStatus:EnableSsoResponse' :: Int
httpStatus = Int
pHttpStatus_}
enableSsoResponse_httpStatus :: Lens.Lens' EnableSsoResponse Prelude.Int
enableSsoResponse_httpStatus :: Lens' EnableSsoResponse Int
enableSsoResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EnableSsoResponse' {Int
httpStatus :: Int
$sel:httpStatus:EnableSsoResponse' :: EnableSsoResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: EnableSsoResponse
s@EnableSsoResponse' {} Int
a -> EnableSsoResponse
s {$sel:httpStatus:EnableSsoResponse' :: Int
httpStatus = Int
a} :: EnableSsoResponse)
instance Prelude.NFData EnableSsoResponse where
rnf :: EnableSsoResponse -> ()
rnf EnableSsoResponse' {Int
httpStatus :: Int
$sel:httpStatus:EnableSsoResponse' :: EnableSsoResponse -> Int
..} = forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus