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