{-# 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.ConnectCustomKeyStore
(
ConnectCustomKeyStore (..),
newConnectCustomKeyStore,
connectCustomKeyStore_customKeyStoreId,
ConnectCustomKeyStoreResponse (..),
newConnectCustomKeyStoreResponse,
connectCustomKeyStoreResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.KMS.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data ConnectCustomKeyStore = ConnectCustomKeyStore'
{
ConnectCustomKeyStore -> Text
customKeyStoreId :: Prelude.Text
}
deriving (ConnectCustomKeyStore -> ConnectCustomKeyStore -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ConnectCustomKeyStore -> ConnectCustomKeyStore -> Bool
$c/= :: ConnectCustomKeyStore -> ConnectCustomKeyStore -> Bool
== :: ConnectCustomKeyStore -> ConnectCustomKeyStore -> Bool
$c== :: ConnectCustomKeyStore -> ConnectCustomKeyStore -> Bool
Prelude.Eq, ReadPrec [ConnectCustomKeyStore]
ReadPrec ConnectCustomKeyStore
Int -> ReadS ConnectCustomKeyStore
ReadS [ConnectCustomKeyStore]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ConnectCustomKeyStore]
$creadListPrec :: ReadPrec [ConnectCustomKeyStore]
readPrec :: ReadPrec ConnectCustomKeyStore
$creadPrec :: ReadPrec ConnectCustomKeyStore
readList :: ReadS [ConnectCustomKeyStore]
$creadList :: ReadS [ConnectCustomKeyStore]
readsPrec :: Int -> ReadS ConnectCustomKeyStore
$creadsPrec :: Int -> ReadS ConnectCustomKeyStore
Prelude.Read, Int -> ConnectCustomKeyStore -> ShowS
[ConnectCustomKeyStore] -> ShowS
ConnectCustomKeyStore -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ConnectCustomKeyStore] -> ShowS
$cshowList :: [ConnectCustomKeyStore] -> ShowS
show :: ConnectCustomKeyStore -> String
$cshow :: ConnectCustomKeyStore -> String
showsPrec :: Int -> ConnectCustomKeyStore -> ShowS
$cshowsPrec :: Int -> ConnectCustomKeyStore -> ShowS
Prelude.Show, forall x. Rep ConnectCustomKeyStore x -> ConnectCustomKeyStore
forall x. ConnectCustomKeyStore -> Rep ConnectCustomKeyStore x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ConnectCustomKeyStore x -> ConnectCustomKeyStore
$cfrom :: forall x. ConnectCustomKeyStore -> Rep ConnectCustomKeyStore x
Prelude.Generic)
newConnectCustomKeyStore ::
Prelude.Text ->
ConnectCustomKeyStore
newConnectCustomKeyStore :: Text -> ConnectCustomKeyStore
newConnectCustomKeyStore Text
pCustomKeyStoreId_ =
ConnectCustomKeyStore'
{ $sel:customKeyStoreId:ConnectCustomKeyStore' :: Text
customKeyStoreId =
Text
pCustomKeyStoreId_
}
connectCustomKeyStore_customKeyStoreId :: Lens.Lens' ConnectCustomKeyStore Prelude.Text
connectCustomKeyStore_customKeyStoreId :: Lens' ConnectCustomKeyStore Text
connectCustomKeyStore_customKeyStoreId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ConnectCustomKeyStore' {Text
customKeyStoreId :: Text
$sel:customKeyStoreId:ConnectCustomKeyStore' :: ConnectCustomKeyStore -> Text
customKeyStoreId} -> Text
customKeyStoreId) (\s :: ConnectCustomKeyStore
s@ConnectCustomKeyStore' {} Text
a -> ConnectCustomKeyStore
s {$sel:customKeyStoreId:ConnectCustomKeyStore' :: Text
customKeyStoreId = Text
a} :: ConnectCustomKeyStore)
instance Core.AWSRequest ConnectCustomKeyStore where
type
AWSResponse ConnectCustomKeyStore =
ConnectCustomKeyStoreResponse
request :: (Service -> Service)
-> ConnectCustomKeyStore -> Request ConnectCustomKeyStore
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 ConnectCustomKeyStore
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse ConnectCustomKeyStore)))
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 -> ConnectCustomKeyStoreResponse
ConnectCustomKeyStoreResponse'
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 ConnectCustomKeyStore where
hashWithSalt :: Int -> ConnectCustomKeyStore -> Int
hashWithSalt Int
_salt ConnectCustomKeyStore' {Text
customKeyStoreId :: Text
$sel:customKeyStoreId:ConnectCustomKeyStore' :: ConnectCustomKeyStore -> Text
..} =
Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
customKeyStoreId
instance Prelude.NFData ConnectCustomKeyStore where
rnf :: ConnectCustomKeyStore -> ()
rnf ConnectCustomKeyStore' {Text
customKeyStoreId :: Text
$sel:customKeyStoreId:ConnectCustomKeyStore' :: ConnectCustomKeyStore -> Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Text
customKeyStoreId
instance Data.ToHeaders ConnectCustomKeyStore where
toHeaders :: ConnectCustomKeyStore -> 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
"TrentService.ConnectCustomKeyStore" ::
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 ConnectCustomKeyStore where
toJSON :: ConnectCustomKeyStore -> Value
toJSON ConnectCustomKeyStore' {Text
customKeyStoreId :: Text
$sel:customKeyStoreId:ConnectCustomKeyStore' :: ConnectCustomKeyStore -> Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ forall a. a -> Maybe a
Prelude.Just
(Key
"CustomKeyStoreId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
customKeyStoreId)
]
)
instance Data.ToPath ConnectCustomKeyStore where
toPath :: ConnectCustomKeyStore -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Data.ToQuery ConnectCustomKeyStore where
toQuery :: ConnectCustomKeyStore -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data ConnectCustomKeyStoreResponse = ConnectCustomKeyStoreResponse'
{
ConnectCustomKeyStoreResponse -> Int
httpStatus :: Prelude.Int
}
deriving (ConnectCustomKeyStoreResponse
-> ConnectCustomKeyStoreResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ConnectCustomKeyStoreResponse
-> ConnectCustomKeyStoreResponse -> Bool
$c/= :: ConnectCustomKeyStoreResponse
-> ConnectCustomKeyStoreResponse -> Bool
== :: ConnectCustomKeyStoreResponse
-> ConnectCustomKeyStoreResponse -> Bool
$c== :: ConnectCustomKeyStoreResponse
-> ConnectCustomKeyStoreResponse -> Bool
Prelude.Eq, ReadPrec [ConnectCustomKeyStoreResponse]
ReadPrec ConnectCustomKeyStoreResponse
Int -> ReadS ConnectCustomKeyStoreResponse
ReadS [ConnectCustomKeyStoreResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ConnectCustomKeyStoreResponse]
$creadListPrec :: ReadPrec [ConnectCustomKeyStoreResponse]
readPrec :: ReadPrec ConnectCustomKeyStoreResponse
$creadPrec :: ReadPrec ConnectCustomKeyStoreResponse
readList :: ReadS [ConnectCustomKeyStoreResponse]
$creadList :: ReadS [ConnectCustomKeyStoreResponse]
readsPrec :: Int -> ReadS ConnectCustomKeyStoreResponse
$creadsPrec :: Int -> ReadS ConnectCustomKeyStoreResponse
Prelude.Read, Int -> ConnectCustomKeyStoreResponse -> ShowS
[ConnectCustomKeyStoreResponse] -> ShowS
ConnectCustomKeyStoreResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ConnectCustomKeyStoreResponse] -> ShowS
$cshowList :: [ConnectCustomKeyStoreResponse] -> ShowS
show :: ConnectCustomKeyStoreResponse -> String
$cshow :: ConnectCustomKeyStoreResponse -> String
showsPrec :: Int -> ConnectCustomKeyStoreResponse -> ShowS
$cshowsPrec :: Int -> ConnectCustomKeyStoreResponse -> ShowS
Prelude.Show, forall x.
Rep ConnectCustomKeyStoreResponse x
-> ConnectCustomKeyStoreResponse
forall x.
ConnectCustomKeyStoreResponse
-> Rep ConnectCustomKeyStoreResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ConnectCustomKeyStoreResponse x
-> ConnectCustomKeyStoreResponse
$cfrom :: forall x.
ConnectCustomKeyStoreResponse
-> Rep ConnectCustomKeyStoreResponse x
Prelude.Generic)
newConnectCustomKeyStoreResponse ::
Prelude.Int ->
ConnectCustomKeyStoreResponse
newConnectCustomKeyStoreResponse :: Int -> ConnectCustomKeyStoreResponse
newConnectCustomKeyStoreResponse Int
pHttpStatus_ =
ConnectCustomKeyStoreResponse'
{ $sel:httpStatus:ConnectCustomKeyStoreResponse' :: Int
httpStatus =
Int
pHttpStatus_
}
connectCustomKeyStoreResponse_httpStatus :: Lens.Lens' ConnectCustomKeyStoreResponse Prelude.Int
connectCustomKeyStoreResponse_httpStatus :: Lens' ConnectCustomKeyStoreResponse Int
connectCustomKeyStoreResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ConnectCustomKeyStoreResponse' {Int
httpStatus :: Int
$sel:httpStatus:ConnectCustomKeyStoreResponse' :: ConnectCustomKeyStoreResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: ConnectCustomKeyStoreResponse
s@ConnectCustomKeyStoreResponse' {} Int
a -> ConnectCustomKeyStoreResponse
s {$sel:httpStatus:ConnectCustomKeyStoreResponse' :: Int
httpStatus = Int
a} :: ConnectCustomKeyStoreResponse)
instance Prelude.NFData ConnectCustomKeyStoreResponse where
rnf :: ConnectCustomKeyStoreResponse -> ()
rnf ConnectCustomKeyStoreResponse' {Int
httpStatus :: Int
$sel:httpStatus:ConnectCustomKeyStoreResponse' :: ConnectCustomKeyStoreResponse -> Int
..} =
forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus