{-# 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.EnableLDAPS
(
EnableLDAPS (..),
newEnableLDAPS,
enableLDAPS_directoryId,
enableLDAPS_type,
EnableLDAPSResponse (..),
newEnableLDAPSResponse,
enableLDAPSResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import Amazonka.DirectoryService.Types
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data EnableLDAPS = EnableLDAPS'
{
EnableLDAPS -> Text
directoryId :: Prelude.Text,
EnableLDAPS -> LDAPSType
type' :: LDAPSType
}
deriving (EnableLDAPS -> EnableLDAPS -> Bool
(EnableLDAPS -> EnableLDAPS -> Bool)
-> (EnableLDAPS -> EnableLDAPS -> Bool) -> Eq EnableLDAPS
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: EnableLDAPS -> EnableLDAPS -> Bool
$c/= :: EnableLDAPS -> EnableLDAPS -> Bool
== :: EnableLDAPS -> EnableLDAPS -> Bool
$c== :: EnableLDAPS -> EnableLDAPS -> Bool
Prelude.Eq, ReadPrec [EnableLDAPS]
ReadPrec EnableLDAPS
Int -> ReadS EnableLDAPS
ReadS [EnableLDAPS]
(Int -> ReadS EnableLDAPS)
-> ReadS [EnableLDAPS]
-> ReadPrec EnableLDAPS
-> ReadPrec [EnableLDAPS]
-> Read EnableLDAPS
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [EnableLDAPS]
$creadListPrec :: ReadPrec [EnableLDAPS]
readPrec :: ReadPrec EnableLDAPS
$creadPrec :: ReadPrec EnableLDAPS
readList :: ReadS [EnableLDAPS]
$creadList :: ReadS [EnableLDAPS]
readsPrec :: Int -> ReadS EnableLDAPS
$creadsPrec :: Int -> ReadS EnableLDAPS
Prelude.Read, Int -> EnableLDAPS -> ShowS
[EnableLDAPS] -> ShowS
EnableLDAPS -> String
(Int -> EnableLDAPS -> ShowS)
-> (EnableLDAPS -> String)
-> ([EnableLDAPS] -> ShowS)
-> Show EnableLDAPS
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [EnableLDAPS] -> ShowS
$cshowList :: [EnableLDAPS] -> ShowS
show :: EnableLDAPS -> String
$cshow :: EnableLDAPS -> String
showsPrec :: Int -> EnableLDAPS -> ShowS
$cshowsPrec :: Int -> EnableLDAPS -> ShowS
Prelude.Show, (forall x. EnableLDAPS -> Rep EnableLDAPS x)
-> (forall x. Rep EnableLDAPS x -> EnableLDAPS)
-> Generic EnableLDAPS
forall x. Rep EnableLDAPS x -> EnableLDAPS
forall x. EnableLDAPS -> Rep EnableLDAPS x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep EnableLDAPS x -> EnableLDAPS
$cfrom :: forall x. EnableLDAPS -> Rep EnableLDAPS x
Prelude.Generic)
newEnableLDAPS ::
Prelude.Text ->
LDAPSType ->
EnableLDAPS
newEnableLDAPS :: Text -> LDAPSType -> EnableLDAPS
newEnableLDAPS Text
pDirectoryId_ LDAPSType
pType_ =
EnableLDAPS' :: Text -> LDAPSType -> EnableLDAPS
EnableLDAPS'
{ $sel:directoryId:EnableLDAPS' :: Text
directoryId = Text
pDirectoryId_,
$sel:type':EnableLDAPS' :: LDAPSType
type' = LDAPSType
pType_
}
enableLDAPS_directoryId :: Lens.Lens' EnableLDAPS Prelude.Text
enableLDAPS_directoryId :: (Text -> f Text) -> EnableLDAPS -> f EnableLDAPS
enableLDAPS_directoryId = (EnableLDAPS -> Text)
-> (EnableLDAPS -> Text -> EnableLDAPS)
-> Lens EnableLDAPS EnableLDAPS Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EnableLDAPS' {Text
directoryId :: Text
$sel:directoryId:EnableLDAPS' :: EnableLDAPS -> Text
directoryId} -> Text
directoryId) (\s :: EnableLDAPS
s@EnableLDAPS' {} Text
a -> EnableLDAPS
s {$sel:directoryId:EnableLDAPS' :: Text
directoryId = Text
a} :: EnableLDAPS)
enableLDAPS_type :: Lens.Lens' EnableLDAPS LDAPSType
enableLDAPS_type :: (LDAPSType -> f LDAPSType) -> EnableLDAPS -> f EnableLDAPS
enableLDAPS_type = (EnableLDAPS -> LDAPSType)
-> (EnableLDAPS -> LDAPSType -> EnableLDAPS)
-> Lens EnableLDAPS EnableLDAPS LDAPSType LDAPSType
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EnableLDAPS' {LDAPSType
type' :: LDAPSType
$sel:type':EnableLDAPS' :: EnableLDAPS -> LDAPSType
type'} -> LDAPSType
type') (\s :: EnableLDAPS
s@EnableLDAPS' {} LDAPSType
a -> EnableLDAPS
s {$sel:type':EnableLDAPS' :: LDAPSType
type' = LDAPSType
a} :: EnableLDAPS)
instance Core.AWSRequest EnableLDAPS where
type AWSResponse EnableLDAPS = EnableLDAPSResponse
request :: EnableLDAPS -> Request EnableLDAPS
request = Service -> EnableLDAPS -> Request EnableLDAPS
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy EnableLDAPS
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse EnableLDAPS)))
response =
(Int
-> ResponseHeaders
-> ()
-> Either String (AWSResponse EnableLDAPS))
-> Logger
-> Service
-> Proxy EnableLDAPS
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse EnableLDAPS)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> () -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveEmpty
( \Int
s ResponseHeaders
h ()
x ->
Int -> EnableLDAPSResponse
EnableLDAPSResponse'
(Int -> EnableLDAPSResponse)
-> Either String Int -> Either String EnableLDAPSResponse
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Int -> Either String Int
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (Int -> Int
forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
)
instance Prelude.Hashable EnableLDAPS
instance Prelude.NFData EnableLDAPS
instance Core.ToHeaders EnableLDAPS where
toHeaders :: EnableLDAPS -> ResponseHeaders
toHeaders =
ResponseHeaders -> EnableLDAPS -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"X-Amz-Target"
HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"DirectoryService_20150416.EnableLDAPS" ::
Prelude.ByteString
),
HeaderName
"Content-Type"
HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Core.ToJSON EnableLDAPS where
toJSON :: EnableLDAPS -> Value
toJSON EnableLDAPS' {Text
LDAPSType
type' :: LDAPSType
directoryId :: Text
$sel:type':EnableLDAPS' :: EnableLDAPS -> LDAPSType
$sel:directoryId:EnableLDAPS' :: EnableLDAPS -> Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"DirectoryId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
directoryId),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Type" Text -> LDAPSType -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= LDAPSType
type')
]
)
instance Core.ToPath EnableLDAPS where
toPath :: EnableLDAPS -> ByteString
toPath = ByteString -> EnableLDAPS -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery EnableLDAPS where
toQuery :: EnableLDAPS -> QueryString
toQuery = QueryString -> EnableLDAPS -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data EnableLDAPSResponse = EnableLDAPSResponse'
{
EnableLDAPSResponse -> Int
httpStatus :: Prelude.Int
}
deriving (EnableLDAPSResponse -> EnableLDAPSResponse -> Bool
(EnableLDAPSResponse -> EnableLDAPSResponse -> Bool)
-> (EnableLDAPSResponse -> EnableLDAPSResponse -> Bool)
-> Eq EnableLDAPSResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: EnableLDAPSResponse -> EnableLDAPSResponse -> Bool
$c/= :: EnableLDAPSResponse -> EnableLDAPSResponse -> Bool
== :: EnableLDAPSResponse -> EnableLDAPSResponse -> Bool
$c== :: EnableLDAPSResponse -> EnableLDAPSResponse -> Bool
Prelude.Eq, ReadPrec [EnableLDAPSResponse]
ReadPrec EnableLDAPSResponse
Int -> ReadS EnableLDAPSResponse
ReadS [EnableLDAPSResponse]
(Int -> ReadS EnableLDAPSResponse)
-> ReadS [EnableLDAPSResponse]
-> ReadPrec EnableLDAPSResponse
-> ReadPrec [EnableLDAPSResponse]
-> Read EnableLDAPSResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [EnableLDAPSResponse]
$creadListPrec :: ReadPrec [EnableLDAPSResponse]
readPrec :: ReadPrec EnableLDAPSResponse
$creadPrec :: ReadPrec EnableLDAPSResponse
readList :: ReadS [EnableLDAPSResponse]
$creadList :: ReadS [EnableLDAPSResponse]
readsPrec :: Int -> ReadS EnableLDAPSResponse
$creadsPrec :: Int -> ReadS EnableLDAPSResponse
Prelude.Read, Int -> EnableLDAPSResponse -> ShowS
[EnableLDAPSResponse] -> ShowS
EnableLDAPSResponse -> String
(Int -> EnableLDAPSResponse -> ShowS)
-> (EnableLDAPSResponse -> String)
-> ([EnableLDAPSResponse] -> ShowS)
-> Show EnableLDAPSResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [EnableLDAPSResponse] -> ShowS
$cshowList :: [EnableLDAPSResponse] -> ShowS
show :: EnableLDAPSResponse -> String
$cshow :: EnableLDAPSResponse -> String
showsPrec :: Int -> EnableLDAPSResponse -> ShowS
$cshowsPrec :: Int -> EnableLDAPSResponse -> ShowS
Prelude.Show, (forall x. EnableLDAPSResponse -> Rep EnableLDAPSResponse x)
-> (forall x. Rep EnableLDAPSResponse x -> EnableLDAPSResponse)
-> Generic EnableLDAPSResponse
forall x. Rep EnableLDAPSResponse x -> EnableLDAPSResponse
forall x. EnableLDAPSResponse -> Rep EnableLDAPSResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep EnableLDAPSResponse x -> EnableLDAPSResponse
$cfrom :: forall x. EnableLDAPSResponse -> Rep EnableLDAPSResponse x
Prelude.Generic)
newEnableLDAPSResponse ::
Prelude.Int ->
EnableLDAPSResponse
newEnableLDAPSResponse :: Int -> EnableLDAPSResponse
newEnableLDAPSResponse Int
pHttpStatus_ =
EnableLDAPSResponse' :: Int -> EnableLDAPSResponse
EnableLDAPSResponse' {$sel:httpStatus:EnableLDAPSResponse' :: Int
httpStatus = Int
pHttpStatus_}
enableLDAPSResponse_httpStatus :: Lens.Lens' EnableLDAPSResponse Prelude.Int
enableLDAPSResponse_httpStatus :: (Int -> f Int) -> EnableLDAPSResponse -> f EnableLDAPSResponse
enableLDAPSResponse_httpStatus = (EnableLDAPSResponse -> Int)
-> (EnableLDAPSResponse -> Int -> EnableLDAPSResponse)
-> Lens EnableLDAPSResponse EnableLDAPSResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EnableLDAPSResponse' {Int
httpStatus :: Int
$sel:httpStatus:EnableLDAPSResponse' :: EnableLDAPSResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: EnableLDAPSResponse
s@EnableLDAPSResponse' {} Int
a -> EnableLDAPSResponse
s {$sel:httpStatus:EnableLDAPSResponse' :: Int
httpStatus = Int
a} :: EnableLDAPSResponse)
instance Prelude.NFData EnableLDAPSResponse