{-# 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 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 ConnectCustomKeyStore = ConnectCustomKeyStore'
{
ConnectCustomKeyStore -> Text
customKeyStoreId :: Prelude.Text
}
deriving (ConnectCustomKeyStore -> ConnectCustomKeyStore -> Bool
(ConnectCustomKeyStore -> ConnectCustomKeyStore -> Bool)
-> (ConnectCustomKeyStore -> ConnectCustomKeyStore -> Bool)
-> Eq ConnectCustomKeyStore
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]
(Int -> ReadS ConnectCustomKeyStore)
-> ReadS [ConnectCustomKeyStore]
-> ReadPrec ConnectCustomKeyStore
-> ReadPrec [ConnectCustomKeyStore]
-> Read 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
(Int -> ConnectCustomKeyStore -> ShowS)
-> (ConnectCustomKeyStore -> String)
-> ([ConnectCustomKeyStore] -> ShowS)
-> Show ConnectCustomKeyStore
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. ConnectCustomKeyStore -> Rep ConnectCustomKeyStore x)
-> (forall x. Rep ConnectCustomKeyStore x -> ConnectCustomKeyStore)
-> Generic ConnectCustomKeyStore
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' :: Text -> ConnectCustomKeyStore
ConnectCustomKeyStore'
{ $sel:customKeyStoreId:ConnectCustomKeyStore' :: Text
customKeyStoreId =
Text
pCustomKeyStoreId_
}
connectCustomKeyStore_customKeyStoreId :: Lens.Lens' ConnectCustomKeyStore Prelude.Text
connectCustomKeyStore_customKeyStoreId :: (Text -> f Text)
-> ConnectCustomKeyStore -> f ConnectCustomKeyStore
connectCustomKeyStore_customKeyStoreId = (ConnectCustomKeyStore -> Text)
-> (ConnectCustomKeyStore -> Text -> ConnectCustomKeyStore)
-> Lens ConnectCustomKeyStore ConnectCustomKeyStore Text Text
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 :: ConnectCustomKeyStore -> Request ConnectCustomKeyStore
request = Service -> ConnectCustomKeyStore -> Request ConnectCustomKeyStore
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy ConnectCustomKeyStore
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse ConnectCustomKeyStore)))
response =
(Int
-> ResponseHeaders
-> ()
-> Either String (AWSResponse ConnectCustomKeyStore))
-> Logger
-> Service
-> Proxy ConnectCustomKeyStore
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse ConnectCustomKeyStore)))
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 -> ConnectCustomKeyStoreResponse
ConnectCustomKeyStoreResponse'
(Int -> ConnectCustomKeyStoreResponse)
-> Either String Int -> Either String ConnectCustomKeyStoreResponse
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 ConnectCustomKeyStore
instance Prelude.NFData ConnectCustomKeyStore
instance Core.ToHeaders ConnectCustomKeyStore where
toHeaders :: ConnectCustomKeyStore -> ResponseHeaders
toHeaders =
ResponseHeaders -> ConnectCustomKeyStore -> 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.ConnectCustomKeyStore" ::
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 ConnectCustomKeyStore where
toJSON :: ConnectCustomKeyStore -> Value
toJSON ConnectCustomKeyStore' {Text
customKeyStoreId :: Text
$sel:customKeyStoreId:ConnectCustomKeyStore' :: ConnectCustomKeyStore -> 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 ConnectCustomKeyStore where
toPath :: ConnectCustomKeyStore -> ByteString
toPath = ByteString -> ConnectCustomKeyStore -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery ConnectCustomKeyStore where
toQuery :: ConnectCustomKeyStore -> QueryString
toQuery = QueryString -> ConnectCustomKeyStore -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data ConnectCustomKeyStoreResponse = ConnectCustomKeyStoreResponse'
{
ConnectCustomKeyStoreResponse -> Int
httpStatus :: Prelude.Int
}
deriving (ConnectCustomKeyStoreResponse
-> ConnectCustomKeyStoreResponse -> Bool
(ConnectCustomKeyStoreResponse
-> ConnectCustomKeyStoreResponse -> Bool)
-> (ConnectCustomKeyStoreResponse
-> ConnectCustomKeyStoreResponse -> Bool)
-> Eq ConnectCustomKeyStoreResponse
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]
(Int -> ReadS ConnectCustomKeyStoreResponse)
-> ReadS [ConnectCustomKeyStoreResponse]
-> ReadPrec ConnectCustomKeyStoreResponse
-> ReadPrec [ConnectCustomKeyStoreResponse]
-> Read 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
(Int -> ConnectCustomKeyStoreResponse -> ShowS)
-> (ConnectCustomKeyStoreResponse -> String)
-> ([ConnectCustomKeyStoreResponse] -> ShowS)
-> Show ConnectCustomKeyStoreResponse
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.
ConnectCustomKeyStoreResponse
-> Rep ConnectCustomKeyStoreResponse x)
-> (forall x.
Rep ConnectCustomKeyStoreResponse x
-> ConnectCustomKeyStoreResponse)
-> Generic ConnectCustomKeyStoreResponse
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' :: Int -> ConnectCustomKeyStoreResponse
ConnectCustomKeyStoreResponse'
{ $sel:httpStatus:ConnectCustomKeyStoreResponse' :: Int
httpStatus =
Int
pHttpStatus_
}
connectCustomKeyStoreResponse_httpStatus :: Lens.Lens' ConnectCustomKeyStoreResponse Prelude.Int
connectCustomKeyStoreResponse_httpStatus :: (Int -> f Int)
-> ConnectCustomKeyStoreResponse -> f ConnectCustomKeyStoreResponse
connectCustomKeyStoreResponse_httpStatus = (ConnectCustomKeyStoreResponse -> Int)
-> (ConnectCustomKeyStoreResponse
-> Int -> ConnectCustomKeyStoreResponse)
-> Lens
ConnectCustomKeyStoreResponse ConnectCustomKeyStoreResponse Int Int
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