{-# 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.CloudHSM.ModifyLunaClient
(
ModifyLunaClient (..),
newModifyLunaClient,
modifyLunaClient_clientArn,
modifyLunaClient_certificate,
ModifyLunaClientResponse (..),
newModifyLunaClientResponse,
modifyLunaClientResponse_clientArn,
modifyLunaClientResponse_httpStatus,
)
where
import Amazonka.CloudHSM.Types
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data ModifyLunaClient = ModifyLunaClient'
{
ModifyLunaClient -> Text
clientArn :: Prelude.Text,
ModifyLunaClient -> Text
certificate :: Prelude.Text
}
deriving (ModifyLunaClient -> ModifyLunaClient -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ModifyLunaClient -> ModifyLunaClient -> Bool
$c/= :: ModifyLunaClient -> ModifyLunaClient -> Bool
== :: ModifyLunaClient -> ModifyLunaClient -> Bool
$c== :: ModifyLunaClient -> ModifyLunaClient -> Bool
Prelude.Eq, ReadPrec [ModifyLunaClient]
ReadPrec ModifyLunaClient
Int -> ReadS ModifyLunaClient
ReadS [ModifyLunaClient]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ModifyLunaClient]
$creadListPrec :: ReadPrec [ModifyLunaClient]
readPrec :: ReadPrec ModifyLunaClient
$creadPrec :: ReadPrec ModifyLunaClient
readList :: ReadS [ModifyLunaClient]
$creadList :: ReadS [ModifyLunaClient]
readsPrec :: Int -> ReadS ModifyLunaClient
$creadsPrec :: Int -> ReadS ModifyLunaClient
Prelude.Read, Int -> ModifyLunaClient -> ShowS
[ModifyLunaClient] -> ShowS
ModifyLunaClient -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ModifyLunaClient] -> ShowS
$cshowList :: [ModifyLunaClient] -> ShowS
show :: ModifyLunaClient -> String
$cshow :: ModifyLunaClient -> String
showsPrec :: Int -> ModifyLunaClient -> ShowS
$cshowsPrec :: Int -> ModifyLunaClient -> ShowS
Prelude.Show, forall x. Rep ModifyLunaClient x -> ModifyLunaClient
forall x. ModifyLunaClient -> Rep ModifyLunaClient x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ModifyLunaClient x -> ModifyLunaClient
$cfrom :: forall x. ModifyLunaClient -> Rep ModifyLunaClient x
Prelude.Generic)
newModifyLunaClient ::
Prelude.Text ->
Prelude.Text ->
ModifyLunaClient
newModifyLunaClient :: Text -> Text -> ModifyLunaClient
newModifyLunaClient Text
pClientArn_ Text
pCertificate_ =
ModifyLunaClient'
{ $sel:clientArn:ModifyLunaClient' :: Text
clientArn = Text
pClientArn_,
$sel:certificate:ModifyLunaClient' :: Text
certificate = Text
pCertificate_
}
modifyLunaClient_clientArn :: Lens.Lens' ModifyLunaClient Prelude.Text
modifyLunaClient_clientArn :: Lens' ModifyLunaClient Text
modifyLunaClient_clientArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ModifyLunaClient' {Text
clientArn :: Text
$sel:clientArn:ModifyLunaClient' :: ModifyLunaClient -> Text
clientArn} -> Text
clientArn) (\s :: ModifyLunaClient
s@ModifyLunaClient' {} Text
a -> ModifyLunaClient
s {$sel:clientArn:ModifyLunaClient' :: Text
clientArn = Text
a} :: ModifyLunaClient)
modifyLunaClient_certificate :: Lens.Lens' ModifyLunaClient Prelude.Text
modifyLunaClient_certificate :: Lens' ModifyLunaClient Text
modifyLunaClient_certificate = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ModifyLunaClient' {Text
certificate :: Text
$sel:certificate:ModifyLunaClient' :: ModifyLunaClient -> Text
certificate} -> Text
certificate) (\s :: ModifyLunaClient
s@ModifyLunaClient' {} Text
a -> ModifyLunaClient
s {$sel:certificate:ModifyLunaClient' :: Text
certificate = Text
a} :: ModifyLunaClient)
instance Core.AWSRequest ModifyLunaClient where
type
AWSResponse ModifyLunaClient =
ModifyLunaClientResponse
request :: (Service -> Service)
-> ModifyLunaClient -> Request ModifyLunaClient
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 ModifyLunaClient
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse ModifyLunaClient)))
response =
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
( \Int
s ResponseHeaders
h Object
x ->
Maybe Text -> Int -> ModifyLunaClientResponse
ModifyLunaClientResponse'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"ClientArn")
forall (f :: * -> *) a b. Applicative f => 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 ModifyLunaClient where
hashWithSalt :: Int -> ModifyLunaClient -> Int
hashWithSalt Int
_salt ModifyLunaClient' {Text
certificate :: Text
clientArn :: Text
$sel:certificate:ModifyLunaClient' :: ModifyLunaClient -> Text
$sel:clientArn:ModifyLunaClient' :: ModifyLunaClient -> Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
clientArn
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
certificate
instance Prelude.NFData ModifyLunaClient where
rnf :: ModifyLunaClient -> ()
rnf ModifyLunaClient' {Text
certificate :: Text
clientArn :: Text
$sel:certificate:ModifyLunaClient' :: ModifyLunaClient -> Text
$sel:clientArn:ModifyLunaClient' :: ModifyLunaClient -> Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Text
clientArn
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
certificate
instance Data.ToHeaders ModifyLunaClient where
toHeaders :: ModifyLunaClient -> 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
"CloudHsmFrontendService.ModifyLunaClient" ::
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 ModifyLunaClient where
toJSON :: ModifyLunaClient -> Value
toJSON ModifyLunaClient' {Text
certificate :: Text
clientArn :: Text
$sel:certificate:ModifyLunaClient' :: ModifyLunaClient -> Text
$sel:clientArn:ModifyLunaClient' :: ModifyLunaClient -> Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ forall a. a -> Maybe a
Prelude.Just (Key
"ClientArn" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
clientArn),
forall a. a -> Maybe a
Prelude.Just (Key
"Certificate" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
certificate)
]
)
instance Data.ToPath ModifyLunaClient where
toPath :: ModifyLunaClient -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Data.ToQuery ModifyLunaClient where
toQuery :: ModifyLunaClient -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data ModifyLunaClientResponse = ModifyLunaClientResponse'
{
ModifyLunaClientResponse -> Maybe Text
clientArn :: Prelude.Maybe Prelude.Text,
ModifyLunaClientResponse -> Int
httpStatus :: Prelude.Int
}
deriving (ModifyLunaClientResponse -> ModifyLunaClientResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ModifyLunaClientResponse -> ModifyLunaClientResponse -> Bool
$c/= :: ModifyLunaClientResponse -> ModifyLunaClientResponse -> Bool
== :: ModifyLunaClientResponse -> ModifyLunaClientResponse -> Bool
$c== :: ModifyLunaClientResponse -> ModifyLunaClientResponse -> Bool
Prelude.Eq, ReadPrec [ModifyLunaClientResponse]
ReadPrec ModifyLunaClientResponse
Int -> ReadS ModifyLunaClientResponse
ReadS [ModifyLunaClientResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ModifyLunaClientResponse]
$creadListPrec :: ReadPrec [ModifyLunaClientResponse]
readPrec :: ReadPrec ModifyLunaClientResponse
$creadPrec :: ReadPrec ModifyLunaClientResponse
readList :: ReadS [ModifyLunaClientResponse]
$creadList :: ReadS [ModifyLunaClientResponse]
readsPrec :: Int -> ReadS ModifyLunaClientResponse
$creadsPrec :: Int -> ReadS ModifyLunaClientResponse
Prelude.Read, Int -> ModifyLunaClientResponse -> ShowS
[ModifyLunaClientResponse] -> ShowS
ModifyLunaClientResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ModifyLunaClientResponse] -> ShowS
$cshowList :: [ModifyLunaClientResponse] -> ShowS
show :: ModifyLunaClientResponse -> String
$cshow :: ModifyLunaClientResponse -> String
showsPrec :: Int -> ModifyLunaClientResponse -> ShowS
$cshowsPrec :: Int -> ModifyLunaClientResponse -> ShowS
Prelude.Show, forall x.
Rep ModifyLunaClientResponse x -> ModifyLunaClientResponse
forall x.
ModifyLunaClientResponse -> Rep ModifyLunaClientResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ModifyLunaClientResponse x -> ModifyLunaClientResponse
$cfrom :: forall x.
ModifyLunaClientResponse -> Rep ModifyLunaClientResponse x
Prelude.Generic)
newModifyLunaClientResponse ::
Prelude.Int ->
ModifyLunaClientResponse
newModifyLunaClientResponse :: Int -> ModifyLunaClientResponse
newModifyLunaClientResponse Int
pHttpStatus_ =
ModifyLunaClientResponse'
{ $sel:clientArn:ModifyLunaClientResponse' :: Maybe Text
clientArn =
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:ModifyLunaClientResponse' :: Int
httpStatus = Int
pHttpStatus_
}
modifyLunaClientResponse_clientArn :: Lens.Lens' ModifyLunaClientResponse (Prelude.Maybe Prelude.Text)
modifyLunaClientResponse_clientArn :: Lens' ModifyLunaClientResponse (Maybe Text)
modifyLunaClientResponse_clientArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ModifyLunaClientResponse' {Maybe Text
clientArn :: Maybe Text
$sel:clientArn:ModifyLunaClientResponse' :: ModifyLunaClientResponse -> Maybe Text
clientArn} -> Maybe Text
clientArn) (\s :: ModifyLunaClientResponse
s@ModifyLunaClientResponse' {} Maybe Text
a -> ModifyLunaClientResponse
s {$sel:clientArn:ModifyLunaClientResponse' :: Maybe Text
clientArn = Maybe Text
a} :: ModifyLunaClientResponse)
modifyLunaClientResponse_httpStatus :: Lens.Lens' ModifyLunaClientResponse Prelude.Int
modifyLunaClientResponse_httpStatus :: Lens' ModifyLunaClientResponse Int
modifyLunaClientResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ModifyLunaClientResponse' {Int
httpStatus :: Int
$sel:httpStatus:ModifyLunaClientResponse' :: ModifyLunaClientResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: ModifyLunaClientResponse
s@ModifyLunaClientResponse' {} Int
a -> ModifyLunaClientResponse
s {$sel:httpStatus:ModifyLunaClientResponse' :: Int
httpStatus = Int
a} :: ModifyLunaClientResponse)
instance Prelude.NFData ModifyLunaClientResponse where
rnf :: ModifyLunaClientResponse -> ()
rnf ModifyLunaClientResponse' {Int
Maybe Text
httpStatus :: Int
clientArn :: Maybe Text
$sel:httpStatus:ModifyLunaClientResponse' :: ModifyLunaClientResponse -> Int
$sel:clientArn:ModifyLunaClientResponse' :: ModifyLunaClientResponse -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
clientArn
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus