{-# 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.IoT.RejectCertificateTransfer
(
RejectCertificateTransfer (..),
newRejectCertificateTransfer,
rejectCertificateTransfer_rejectReason,
rejectCertificateTransfer_certificateId,
RejectCertificateTransferResponse (..),
newRejectCertificateTransferResponse,
)
where
import qualified Amazonka.Core as Core
import Amazonka.IoT.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 RejectCertificateTransfer = RejectCertificateTransfer'
{
RejectCertificateTransfer -> Maybe Text
rejectReason :: Prelude.Maybe Prelude.Text,
RejectCertificateTransfer -> Text
certificateId :: Prelude.Text
}
deriving (RejectCertificateTransfer -> RejectCertificateTransfer -> Bool
(RejectCertificateTransfer -> RejectCertificateTransfer -> Bool)
-> (RejectCertificateTransfer -> RejectCertificateTransfer -> Bool)
-> Eq RejectCertificateTransfer
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RejectCertificateTransfer -> RejectCertificateTransfer -> Bool
$c/= :: RejectCertificateTransfer -> RejectCertificateTransfer -> Bool
== :: RejectCertificateTransfer -> RejectCertificateTransfer -> Bool
$c== :: RejectCertificateTransfer -> RejectCertificateTransfer -> Bool
Prelude.Eq, ReadPrec [RejectCertificateTransfer]
ReadPrec RejectCertificateTransfer
Int -> ReadS RejectCertificateTransfer
ReadS [RejectCertificateTransfer]
(Int -> ReadS RejectCertificateTransfer)
-> ReadS [RejectCertificateTransfer]
-> ReadPrec RejectCertificateTransfer
-> ReadPrec [RejectCertificateTransfer]
-> Read RejectCertificateTransfer
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [RejectCertificateTransfer]
$creadListPrec :: ReadPrec [RejectCertificateTransfer]
readPrec :: ReadPrec RejectCertificateTransfer
$creadPrec :: ReadPrec RejectCertificateTransfer
readList :: ReadS [RejectCertificateTransfer]
$creadList :: ReadS [RejectCertificateTransfer]
readsPrec :: Int -> ReadS RejectCertificateTransfer
$creadsPrec :: Int -> ReadS RejectCertificateTransfer
Prelude.Read, Int -> RejectCertificateTransfer -> ShowS
[RejectCertificateTransfer] -> ShowS
RejectCertificateTransfer -> String
(Int -> RejectCertificateTransfer -> ShowS)
-> (RejectCertificateTransfer -> String)
-> ([RejectCertificateTransfer] -> ShowS)
-> Show RejectCertificateTransfer
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RejectCertificateTransfer] -> ShowS
$cshowList :: [RejectCertificateTransfer] -> ShowS
show :: RejectCertificateTransfer -> String
$cshow :: RejectCertificateTransfer -> String
showsPrec :: Int -> RejectCertificateTransfer -> ShowS
$cshowsPrec :: Int -> RejectCertificateTransfer -> ShowS
Prelude.Show, (forall x.
RejectCertificateTransfer -> Rep RejectCertificateTransfer x)
-> (forall x.
Rep RejectCertificateTransfer x -> RejectCertificateTransfer)
-> Generic RejectCertificateTransfer
forall x.
Rep RejectCertificateTransfer x -> RejectCertificateTransfer
forall x.
RejectCertificateTransfer -> Rep RejectCertificateTransfer x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep RejectCertificateTransfer x -> RejectCertificateTransfer
$cfrom :: forall x.
RejectCertificateTransfer -> Rep RejectCertificateTransfer x
Prelude.Generic)
newRejectCertificateTransfer ::
Prelude.Text ->
RejectCertificateTransfer
newRejectCertificateTransfer :: Text -> RejectCertificateTransfer
newRejectCertificateTransfer Text
pCertificateId_ =
RejectCertificateTransfer' :: Maybe Text -> Text -> RejectCertificateTransfer
RejectCertificateTransfer'
{ $sel:rejectReason:RejectCertificateTransfer' :: Maybe Text
rejectReason =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:certificateId:RejectCertificateTransfer' :: Text
certificateId = Text
pCertificateId_
}
rejectCertificateTransfer_rejectReason :: Lens.Lens' RejectCertificateTransfer (Prelude.Maybe Prelude.Text)
rejectCertificateTransfer_rejectReason :: (Maybe Text -> f (Maybe Text))
-> RejectCertificateTransfer -> f RejectCertificateTransfer
rejectCertificateTransfer_rejectReason = (RejectCertificateTransfer -> Maybe Text)
-> (RejectCertificateTransfer
-> Maybe Text -> RejectCertificateTransfer)
-> Lens
RejectCertificateTransfer
RejectCertificateTransfer
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RejectCertificateTransfer' {Maybe Text
rejectReason :: Maybe Text
$sel:rejectReason:RejectCertificateTransfer' :: RejectCertificateTransfer -> Maybe Text
rejectReason} -> Maybe Text
rejectReason) (\s :: RejectCertificateTransfer
s@RejectCertificateTransfer' {} Maybe Text
a -> RejectCertificateTransfer
s {$sel:rejectReason:RejectCertificateTransfer' :: Maybe Text
rejectReason = Maybe Text
a} :: RejectCertificateTransfer)
rejectCertificateTransfer_certificateId :: Lens.Lens' RejectCertificateTransfer Prelude.Text
rejectCertificateTransfer_certificateId :: (Text -> f Text)
-> RejectCertificateTransfer -> f RejectCertificateTransfer
rejectCertificateTransfer_certificateId = (RejectCertificateTransfer -> Text)
-> (RejectCertificateTransfer -> Text -> RejectCertificateTransfer)
-> Lens
RejectCertificateTransfer RejectCertificateTransfer Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RejectCertificateTransfer' {Text
certificateId :: Text
$sel:certificateId:RejectCertificateTransfer' :: RejectCertificateTransfer -> Text
certificateId} -> Text
certificateId) (\s :: RejectCertificateTransfer
s@RejectCertificateTransfer' {} Text
a -> RejectCertificateTransfer
s {$sel:certificateId:RejectCertificateTransfer' :: Text
certificateId = Text
a} :: RejectCertificateTransfer)
instance Core.AWSRequest RejectCertificateTransfer where
type
AWSResponse RejectCertificateTransfer =
RejectCertificateTransferResponse
request :: RejectCertificateTransfer -> Request RejectCertificateTransfer
request = Service
-> RejectCertificateTransfer -> Request RejectCertificateTransfer
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.patchJSON Service
defaultService
response :: Logger
-> Service
-> Proxy RejectCertificateTransfer
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse RejectCertificateTransfer)))
response =
AWSResponse RejectCertificateTransfer
-> Logger
-> Service
-> Proxy RejectCertificateTransfer
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse RejectCertificateTransfer)))
forall (m :: * -> *) a.
MonadResource m =>
AWSResponse a
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveNull
AWSResponse RejectCertificateTransfer
RejectCertificateTransferResponse
RejectCertificateTransferResponse'
instance Prelude.Hashable RejectCertificateTransfer
instance Prelude.NFData RejectCertificateTransfer
instance Core.ToHeaders RejectCertificateTransfer where
toHeaders :: RejectCertificateTransfer -> [Header]
toHeaders = [Header] -> RejectCertificateTransfer -> [Header]
forall a b. a -> b -> a
Prelude.const [Header]
forall a. Monoid a => a
Prelude.mempty
instance Core.ToJSON RejectCertificateTransfer where
toJSON :: RejectCertificateTransfer -> Value
toJSON RejectCertificateTransfer' {Maybe Text
Text
certificateId :: Text
rejectReason :: Maybe Text
$sel:certificateId:RejectCertificateTransfer' :: RejectCertificateTransfer -> Text
$sel:rejectReason:RejectCertificateTransfer' :: RejectCertificateTransfer -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[(Text
"rejectReason" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
rejectReason]
)
instance Core.ToPath RejectCertificateTransfer where
toPath :: RejectCertificateTransfer -> ByteString
toPath RejectCertificateTransfer' {Maybe Text
Text
certificateId :: Text
rejectReason :: Maybe Text
$sel:certificateId:RejectCertificateTransfer' :: RejectCertificateTransfer -> Text
$sel:rejectReason:RejectCertificateTransfer' :: RejectCertificateTransfer -> Maybe Text
..} =
[ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"/reject-certificate-transfer/",
Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
certificateId
]
instance Core.ToQuery RejectCertificateTransfer where
toQuery :: RejectCertificateTransfer -> QueryString
toQuery = QueryString -> RejectCertificateTransfer -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data RejectCertificateTransferResponse = RejectCertificateTransferResponse'
{
}
deriving (RejectCertificateTransferResponse
-> RejectCertificateTransferResponse -> Bool
(RejectCertificateTransferResponse
-> RejectCertificateTransferResponse -> Bool)
-> (RejectCertificateTransferResponse
-> RejectCertificateTransferResponse -> Bool)
-> Eq RejectCertificateTransferResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RejectCertificateTransferResponse
-> RejectCertificateTransferResponse -> Bool
$c/= :: RejectCertificateTransferResponse
-> RejectCertificateTransferResponse -> Bool
== :: RejectCertificateTransferResponse
-> RejectCertificateTransferResponse -> Bool
$c== :: RejectCertificateTransferResponse
-> RejectCertificateTransferResponse -> Bool
Prelude.Eq, ReadPrec [RejectCertificateTransferResponse]
ReadPrec RejectCertificateTransferResponse
Int -> ReadS RejectCertificateTransferResponse
ReadS [RejectCertificateTransferResponse]
(Int -> ReadS RejectCertificateTransferResponse)
-> ReadS [RejectCertificateTransferResponse]
-> ReadPrec RejectCertificateTransferResponse
-> ReadPrec [RejectCertificateTransferResponse]
-> Read RejectCertificateTransferResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [RejectCertificateTransferResponse]
$creadListPrec :: ReadPrec [RejectCertificateTransferResponse]
readPrec :: ReadPrec RejectCertificateTransferResponse
$creadPrec :: ReadPrec RejectCertificateTransferResponse
readList :: ReadS [RejectCertificateTransferResponse]
$creadList :: ReadS [RejectCertificateTransferResponse]
readsPrec :: Int -> ReadS RejectCertificateTransferResponse
$creadsPrec :: Int -> ReadS RejectCertificateTransferResponse
Prelude.Read, Int -> RejectCertificateTransferResponse -> ShowS
[RejectCertificateTransferResponse] -> ShowS
RejectCertificateTransferResponse -> String
(Int -> RejectCertificateTransferResponse -> ShowS)
-> (RejectCertificateTransferResponse -> String)
-> ([RejectCertificateTransferResponse] -> ShowS)
-> Show RejectCertificateTransferResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RejectCertificateTransferResponse] -> ShowS
$cshowList :: [RejectCertificateTransferResponse] -> ShowS
show :: RejectCertificateTransferResponse -> String
$cshow :: RejectCertificateTransferResponse -> String
showsPrec :: Int -> RejectCertificateTransferResponse -> ShowS
$cshowsPrec :: Int -> RejectCertificateTransferResponse -> ShowS
Prelude.Show, (forall x.
RejectCertificateTransferResponse
-> Rep RejectCertificateTransferResponse x)
-> (forall x.
Rep RejectCertificateTransferResponse x
-> RejectCertificateTransferResponse)
-> Generic RejectCertificateTransferResponse
forall x.
Rep RejectCertificateTransferResponse x
-> RejectCertificateTransferResponse
forall x.
RejectCertificateTransferResponse
-> Rep RejectCertificateTransferResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep RejectCertificateTransferResponse x
-> RejectCertificateTransferResponse
$cfrom :: forall x.
RejectCertificateTransferResponse
-> Rep RejectCertificateTransferResponse x
Prelude.Generic)
newRejectCertificateTransferResponse ::
RejectCertificateTransferResponse
newRejectCertificateTransferResponse :: RejectCertificateTransferResponse
newRejectCertificateTransferResponse =
RejectCertificateTransferResponse
RejectCertificateTransferResponse'
instance
Prelude.NFData
RejectCertificateTransferResponse