{-# 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.KMS.DisconnectCustomKeyStore
(
DisconnectCustomKeyStore (..),
newDisconnectCustomKeyStore,
disconnectCustomKeyStore_customKeyStoreId,
DisconnectCustomKeyStoreResponse (..),
newDisconnectCustomKeyStoreResponse,
disconnectCustomKeyStoreResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import Amazonka.KMS.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 DisconnectCustomKeyStore = DisconnectCustomKeyStore'
{
DisconnectCustomKeyStore -> Text
customKeyStoreId :: Prelude.Text
}
deriving (DisconnectCustomKeyStore -> DisconnectCustomKeyStore -> Bool
(DisconnectCustomKeyStore -> DisconnectCustomKeyStore -> Bool)
-> (DisconnectCustomKeyStore -> DisconnectCustomKeyStore -> Bool)
-> Eq DisconnectCustomKeyStore
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DisconnectCustomKeyStore -> DisconnectCustomKeyStore -> Bool
$c/= :: DisconnectCustomKeyStore -> DisconnectCustomKeyStore -> Bool
== :: DisconnectCustomKeyStore -> DisconnectCustomKeyStore -> Bool
$c== :: DisconnectCustomKeyStore -> DisconnectCustomKeyStore -> Bool
Prelude.Eq, ReadPrec [DisconnectCustomKeyStore]
ReadPrec DisconnectCustomKeyStore
Int -> ReadS DisconnectCustomKeyStore
ReadS [DisconnectCustomKeyStore]
(Int -> ReadS DisconnectCustomKeyStore)
-> ReadS [DisconnectCustomKeyStore]
-> ReadPrec DisconnectCustomKeyStore
-> ReadPrec [DisconnectCustomKeyStore]
-> Read DisconnectCustomKeyStore
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DisconnectCustomKeyStore]
$creadListPrec :: ReadPrec [DisconnectCustomKeyStore]
readPrec :: ReadPrec DisconnectCustomKeyStore
$creadPrec :: ReadPrec DisconnectCustomKeyStore
readList :: ReadS [DisconnectCustomKeyStore]
$creadList :: ReadS [DisconnectCustomKeyStore]
readsPrec :: Int -> ReadS DisconnectCustomKeyStore
$creadsPrec :: Int -> ReadS DisconnectCustomKeyStore
Prelude.Read, Int -> DisconnectCustomKeyStore -> ShowS
[DisconnectCustomKeyStore] -> ShowS
DisconnectCustomKeyStore -> String
(Int -> DisconnectCustomKeyStore -> ShowS)
-> (DisconnectCustomKeyStore -> String)
-> ([DisconnectCustomKeyStore] -> ShowS)
-> Show DisconnectCustomKeyStore
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DisconnectCustomKeyStore] -> ShowS
$cshowList :: [DisconnectCustomKeyStore] -> ShowS
show :: DisconnectCustomKeyStore -> String
$cshow :: DisconnectCustomKeyStore -> String
showsPrec :: Int -> DisconnectCustomKeyStore -> ShowS
$cshowsPrec :: Int -> DisconnectCustomKeyStore -> ShowS
Prelude.Show, (forall x.
DisconnectCustomKeyStore -> Rep DisconnectCustomKeyStore x)
-> (forall x.
Rep DisconnectCustomKeyStore x -> DisconnectCustomKeyStore)
-> Generic DisconnectCustomKeyStore
forall x.
Rep DisconnectCustomKeyStore x -> DisconnectCustomKeyStore
forall x.
DisconnectCustomKeyStore -> Rep DisconnectCustomKeyStore x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DisconnectCustomKeyStore x -> DisconnectCustomKeyStore
$cfrom :: forall x.
DisconnectCustomKeyStore -> Rep DisconnectCustomKeyStore x
Prelude.Generic)
newDisconnectCustomKeyStore ::
Prelude.Text ->
DisconnectCustomKeyStore
newDisconnectCustomKeyStore :: Text -> DisconnectCustomKeyStore
newDisconnectCustomKeyStore Text
pCustomKeyStoreId_ =
DisconnectCustomKeyStore' :: Text -> DisconnectCustomKeyStore
DisconnectCustomKeyStore'
{ $sel:customKeyStoreId:DisconnectCustomKeyStore' :: Text
customKeyStoreId =
Text
pCustomKeyStoreId_
}
disconnectCustomKeyStore_customKeyStoreId :: Lens.Lens' DisconnectCustomKeyStore Prelude.Text
disconnectCustomKeyStore_customKeyStoreId :: (Text -> f Text)
-> DisconnectCustomKeyStore -> f DisconnectCustomKeyStore
disconnectCustomKeyStore_customKeyStoreId = (DisconnectCustomKeyStore -> Text)
-> (DisconnectCustomKeyStore -> Text -> DisconnectCustomKeyStore)
-> Lens DisconnectCustomKeyStore DisconnectCustomKeyStore Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DisconnectCustomKeyStore' {Text
customKeyStoreId :: Text
$sel:customKeyStoreId:DisconnectCustomKeyStore' :: DisconnectCustomKeyStore -> Text
customKeyStoreId} -> Text
customKeyStoreId) (\s :: DisconnectCustomKeyStore
s@DisconnectCustomKeyStore' {} Text
a -> DisconnectCustomKeyStore
s {$sel:customKeyStoreId:DisconnectCustomKeyStore' :: Text
customKeyStoreId = Text
a} :: DisconnectCustomKeyStore)
instance Core.AWSRequest DisconnectCustomKeyStore where
type
AWSResponse DisconnectCustomKeyStore =
DisconnectCustomKeyStoreResponse
request :: DisconnectCustomKeyStore -> Request DisconnectCustomKeyStore
request = Service
-> DisconnectCustomKeyStore -> Request DisconnectCustomKeyStore
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy DisconnectCustomKeyStore
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DisconnectCustomKeyStore)))
response =
(Int
-> ResponseHeaders
-> ()
-> Either String (AWSResponse DisconnectCustomKeyStore))
-> Logger
-> Service
-> Proxy DisconnectCustomKeyStore
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DisconnectCustomKeyStore)))
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 -> DisconnectCustomKeyStoreResponse
DisconnectCustomKeyStoreResponse'
(Int -> DisconnectCustomKeyStoreResponse)
-> Either String Int
-> Either String DisconnectCustomKeyStoreResponse
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 DisconnectCustomKeyStore
instance Prelude.NFData DisconnectCustomKeyStore
instance Core.ToHeaders DisconnectCustomKeyStore where
toHeaders :: DisconnectCustomKeyStore -> ResponseHeaders
toHeaders =
ResponseHeaders -> DisconnectCustomKeyStore -> 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
"TrentService.DisconnectCustomKeyStore" ::
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 DisconnectCustomKeyStore where
toJSON :: DisconnectCustomKeyStore -> Value
toJSON DisconnectCustomKeyStore' {Text
customKeyStoreId :: Text
$sel:customKeyStoreId:DisconnectCustomKeyStore' :: DisconnectCustomKeyStore -> 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
"CustomKeyStoreId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
customKeyStoreId)
]
)
instance Core.ToPath DisconnectCustomKeyStore where
toPath :: DisconnectCustomKeyStore -> ByteString
toPath = ByteString -> DisconnectCustomKeyStore -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery DisconnectCustomKeyStore where
toQuery :: DisconnectCustomKeyStore -> QueryString
toQuery = QueryString -> DisconnectCustomKeyStore -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data DisconnectCustomKeyStoreResponse = DisconnectCustomKeyStoreResponse'
{
DisconnectCustomKeyStoreResponse -> Int
httpStatus :: Prelude.Int
}
deriving (DisconnectCustomKeyStoreResponse
-> DisconnectCustomKeyStoreResponse -> Bool
(DisconnectCustomKeyStoreResponse
-> DisconnectCustomKeyStoreResponse -> Bool)
-> (DisconnectCustomKeyStoreResponse
-> DisconnectCustomKeyStoreResponse -> Bool)
-> Eq DisconnectCustomKeyStoreResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DisconnectCustomKeyStoreResponse
-> DisconnectCustomKeyStoreResponse -> Bool
$c/= :: DisconnectCustomKeyStoreResponse
-> DisconnectCustomKeyStoreResponse -> Bool
== :: DisconnectCustomKeyStoreResponse
-> DisconnectCustomKeyStoreResponse -> Bool
$c== :: DisconnectCustomKeyStoreResponse
-> DisconnectCustomKeyStoreResponse -> Bool
Prelude.Eq, ReadPrec [DisconnectCustomKeyStoreResponse]
ReadPrec DisconnectCustomKeyStoreResponse
Int -> ReadS DisconnectCustomKeyStoreResponse
ReadS [DisconnectCustomKeyStoreResponse]
(Int -> ReadS DisconnectCustomKeyStoreResponse)
-> ReadS [DisconnectCustomKeyStoreResponse]
-> ReadPrec DisconnectCustomKeyStoreResponse
-> ReadPrec [DisconnectCustomKeyStoreResponse]
-> Read DisconnectCustomKeyStoreResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DisconnectCustomKeyStoreResponse]
$creadListPrec :: ReadPrec [DisconnectCustomKeyStoreResponse]
readPrec :: ReadPrec DisconnectCustomKeyStoreResponse
$creadPrec :: ReadPrec DisconnectCustomKeyStoreResponse
readList :: ReadS [DisconnectCustomKeyStoreResponse]
$creadList :: ReadS [DisconnectCustomKeyStoreResponse]
readsPrec :: Int -> ReadS DisconnectCustomKeyStoreResponse
$creadsPrec :: Int -> ReadS DisconnectCustomKeyStoreResponse
Prelude.Read, Int -> DisconnectCustomKeyStoreResponse -> ShowS
[DisconnectCustomKeyStoreResponse] -> ShowS
DisconnectCustomKeyStoreResponse -> String
(Int -> DisconnectCustomKeyStoreResponse -> ShowS)
-> (DisconnectCustomKeyStoreResponse -> String)
-> ([DisconnectCustomKeyStoreResponse] -> ShowS)
-> Show DisconnectCustomKeyStoreResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DisconnectCustomKeyStoreResponse] -> ShowS
$cshowList :: [DisconnectCustomKeyStoreResponse] -> ShowS
show :: DisconnectCustomKeyStoreResponse -> String
$cshow :: DisconnectCustomKeyStoreResponse -> String
showsPrec :: Int -> DisconnectCustomKeyStoreResponse -> ShowS
$cshowsPrec :: Int -> DisconnectCustomKeyStoreResponse -> ShowS
Prelude.Show, (forall x.
DisconnectCustomKeyStoreResponse
-> Rep DisconnectCustomKeyStoreResponse x)
-> (forall x.
Rep DisconnectCustomKeyStoreResponse x
-> DisconnectCustomKeyStoreResponse)
-> Generic DisconnectCustomKeyStoreResponse
forall x.
Rep DisconnectCustomKeyStoreResponse x
-> DisconnectCustomKeyStoreResponse
forall x.
DisconnectCustomKeyStoreResponse
-> Rep DisconnectCustomKeyStoreResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DisconnectCustomKeyStoreResponse x
-> DisconnectCustomKeyStoreResponse
$cfrom :: forall x.
DisconnectCustomKeyStoreResponse
-> Rep DisconnectCustomKeyStoreResponse x
Prelude.Generic)
newDisconnectCustomKeyStoreResponse ::
Prelude.Int ->
DisconnectCustomKeyStoreResponse
newDisconnectCustomKeyStoreResponse :: Int -> DisconnectCustomKeyStoreResponse
newDisconnectCustomKeyStoreResponse Int
pHttpStatus_ =
DisconnectCustomKeyStoreResponse' :: Int -> DisconnectCustomKeyStoreResponse
DisconnectCustomKeyStoreResponse'
{ $sel:httpStatus:DisconnectCustomKeyStoreResponse' :: Int
httpStatus =
Int
pHttpStatus_
}
disconnectCustomKeyStoreResponse_httpStatus :: Lens.Lens' DisconnectCustomKeyStoreResponse Prelude.Int
disconnectCustomKeyStoreResponse_httpStatus :: (Int -> f Int)
-> DisconnectCustomKeyStoreResponse
-> f DisconnectCustomKeyStoreResponse
disconnectCustomKeyStoreResponse_httpStatus = (DisconnectCustomKeyStoreResponse -> Int)
-> (DisconnectCustomKeyStoreResponse
-> Int -> DisconnectCustomKeyStoreResponse)
-> Lens
DisconnectCustomKeyStoreResponse
DisconnectCustomKeyStoreResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DisconnectCustomKeyStoreResponse' {Int
httpStatus :: Int
$sel:httpStatus:DisconnectCustomKeyStoreResponse' :: DisconnectCustomKeyStoreResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DisconnectCustomKeyStoreResponse
s@DisconnectCustomKeyStoreResponse' {} Int
a -> DisconnectCustomKeyStoreResponse
s {$sel:httpStatus:DisconnectCustomKeyStoreResponse' :: Int
httpStatus = Int
a} :: DisconnectCustomKeyStoreResponse)
instance
Prelude.NFData
DisconnectCustomKeyStoreResponse