{-# 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 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 EnableLDAPS = EnableLDAPS'
{
EnableLDAPS -> Text
directoryId :: Prelude.Text,
EnableLDAPS -> LDAPSType
type' :: LDAPSType
}
deriving (EnableLDAPS -> EnableLDAPS -> Bool
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]
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
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. 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'
{ $sel:directoryId:EnableLDAPS' :: Text
directoryId = Text
pDirectoryId_,
$sel:type':EnableLDAPS' :: LDAPSType
type' = LDAPSType
pType_
}
enableLDAPS_directoryId :: Lens.Lens' EnableLDAPS Prelude.Text
enableLDAPS_directoryId :: Lens' EnableLDAPS Text
enableLDAPS_directoryId = 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 :: Lens' EnableLDAPS LDAPSType
enableLDAPS_type = 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 :: (Service -> Service) -> EnableLDAPS -> Request EnableLDAPS
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 EnableLDAPS
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse EnableLDAPS)))
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 -> EnableLDAPSResponse
EnableLDAPSResponse'
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 EnableLDAPS where
hashWithSalt :: Int -> EnableLDAPS -> Int
hashWithSalt Int
_salt EnableLDAPS' {Text
LDAPSType
type' :: LDAPSType
directoryId :: Text
$sel:type':EnableLDAPS' :: EnableLDAPS -> LDAPSType
$sel:directoryId:EnableLDAPS' :: EnableLDAPS -> Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
directoryId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` LDAPSType
type'
instance Prelude.NFData EnableLDAPS where
rnf :: EnableLDAPS -> ()
rnf EnableLDAPS' {Text
LDAPSType
type' :: LDAPSType
directoryId :: Text
$sel:type':EnableLDAPS' :: EnableLDAPS -> LDAPSType
$sel:directoryId:EnableLDAPS' :: EnableLDAPS -> Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Text
directoryId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf LDAPSType
type'
instance Data.ToHeaders EnableLDAPS where
toHeaders :: EnableLDAPS -> 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.EnableLDAPS" ::
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 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
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ forall a. a -> Maybe a
Prelude.Just (Key
"DirectoryId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
directoryId),
forall a. a -> Maybe a
Prelude.Just (Key
"Type" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= LDAPSType
type')
]
)
instance Data.ToPath EnableLDAPS where
toPath :: EnableLDAPS -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Data.ToQuery EnableLDAPS where
toQuery :: EnableLDAPS -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data EnableLDAPSResponse = EnableLDAPSResponse'
{
EnableLDAPSResponse -> Int
httpStatus :: Prelude.Int
}
deriving (EnableLDAPSResponse -> EnableLDAPSResponse -> Bool
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]
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
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. 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' {$sel:httpStatus:EnableLDAPSResponse' :: Int
httpStatus = Int
pHttpStatus_}
enableLDAPSResponse_httpStatus :: Lens.Lens' EnableLDAPSResponse Prelude.Int
enableLDAPSResponse_httpStatus :: Lens' EnableLDAPSResponse Int
enableLDAPSResponse_httpStatus = 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 where
rnf :: EnableLDAPSResponse -> ()
rnf EnableLDAPSResponse' {Int
httpStatus :: Int
$sel:httpStatus:EnableLDAPSResponse' :: EnableLDAPSResponse -> Int
..} = forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus