{-# 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.UpdateCertificate
(
UpdateCertificate (..),
newUpdateCertificate,
updateCertificate_certificateId,
updateCertificate_newStatus,
UpdateCertificateResponse (..),
newUpdateCertificateResponse,
)
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 UpdateCertificate = UpdateCertificate'
{
UpdateCertificate -> Text
certificateId :: Prelude.Text,
UpdateCertificate -> CertificateStatus
newStatus' :: CertificateStatus
}
deriving (UpdateCertificate -> UpdateCertificate -> Bool
(UpdateCertificate -> UpdateCertificate -> Bool)
-> (UpdateCertificate -> UpdateCertificate -> Bool)
-> Eq UpdateCertificate
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateCertificate -> UpdateCertificate -> Bool
$c/= :: UpdateCertificate -> UpdateCertificate -> Bool
== :: UpdateCertificate -> UpdateCertificate -> Bool
$c== :: UpdateCertificate -> UpdateCertificate -> Bool
Prelude.Eq, ReadPrec [UpdateCertificate]
ReadPrec UpdateCertificate
Int -> ReadS UpdateCertificate
ReadS [UpdateCertificate]
(Int -> ReadS UpdateCertificate)
-> ReadS [UpdateCertificate]
-> ReadPrec UpdateCertificate
-> ReadPrec [UpdateCertificate]
-> Read UpdateCertificate
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateCertificate]
$creadListPrec :: ReadPrec [UpdateCertificate]
readPrec :: ReadPrec UpdateCertificate
$creadPrec :: ReadPrec UpdateCertificate
readList :: ReadS [UpdateCertificate]
$creadList :: ReadS [UpdateCertificate]
readsPrec :: Int -> ReadS UpdateCertificate
$creadsPrec :: Int -> ReadS UpdateCertificate
Prelude.Read, Int -> UpdateCertificate -> ShowS
[UpdateCertificate] -> ShowS
UpdateCertificate -> String
(Int -> UpdateCertificate -> ShowS)
-> (UpdateCertificate -> String)
-> ([UpdateCertificate] -> ShowS)
-> Show UpdateCertificate
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateCertificate] -> ShowS
$cshowList :: [UpdateCertificate] -> ShowS
show :: UpdateCertificate -> String
$cshow :: UpdateCertificate -> String
showsPrec :: Int -> UpdateCertificate -> ShowS
$cshowsPrec :: Int -> UpdateCertificate -> ShowS
Prelude.Show, (forall x. UpdateCertificate -> Rep UpdateCertificate x)
-> (forall x. Rep UpdateCertificate x -> UpdateCertificate)
-> Generic UpdateCertificate
forall x. Rep UpdateCertificate x -> UpdateCertificate
forall x. UpdateCertificate -> Rep UpdateCertificate x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateCertificate x -> UpdateCertificate
$cfrom :: forall x. UpdateCertificate -> Rep UpdateCertificate x
Prelude.Generic)
newUpdateCertificate ::
Prelude.Text ->
CertificateStatus ->
UpdateCertificate
newUpdateCertificate :: Text -> CertificateStatus -> UpdateCertificate
newUpdateCertificate Text
pCertificateId_ CertificateStatus
pNewStatus_ =
UpdateCertificate' :: Text -> CertificateStatus -> UpdateCertificate
UpdateCertificate'
{ $sel:certificateId:UpdateCertificate' :: Text
certificateId = Text
pCertificateId_,
$sel:newStatus':UpdateCertificate' :: CertificateStatus
newStatus' = CertificateStatus
pNewStatus_
}
updateCertificate_certificateId :: Lens.Lens' UpdateCertificate Prelude.Text
updateCertificate_certificateId :: (Text -> f Text) -> UpdateCertificate -> f UpdateCertificate
updateCertificate_certificateId = (UpdateCertificate -> Text)
-> (UpdateCertificate -> Text -> UpdateCertificate)
-> Lens UpdateCertificate UpdateCertificate Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateCertificate' {Text
certificateId :: Text
$sel:certificateId:UpdateCertificate' :: UpdateCertificate -> Text
certificateId} -> Text
certificateId) (\s :: UpdateCertificate
s@UpdateCertificate' {} Text
a -> UpdateCertificate
s {$sel:certificateId:UpdateCertificate' :: Text
certificateId = Text
a} :: UpdateCertificate)
updateCertificate_newStatus :: Lens.Lens' UpdateCertificate CertificateStatus
updateCertificate_newStatus :: (CertificateStatus -> f CertificateStatus)
-> UpdateCertificate -> f UpdateCertificate
updateCertificate_newStatus = (UpdateCertificate -> CertificateStatus)
-> (UpdateCertificate -> CertificateStatus -> UpdateCertificate)
-> Lens
UpdateCertificate
UpdateCertificate
CertificateStatus
CertificateStatus
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateCertificate' {CertificateStatus
newStatus' :: CertificateStatus
$sel:newStatus':UpdateCertificate' :: UpdateCertificate -> CertificateStatus
newStatus'} -> CertificateStatus
newStatus') (\s :: UpdateCertificate
s@UpdateCertificate' {} CertificateStatus
a -> UpdateCertificate
s {$sel:newStatus':UpdateCertificate' :: CertificateStatus
newStatus' = CertificateStatus
a} :: UpdateCertificate)
instance Core.AWSRequest UpdateCertificate where
type
AWSResponse UpdateCertificate =
UpdateCertificateResponse
request :: UpdateCertificate -> Request UpdateCertificate
request = Service -> UpdateCertificate -> Request UpdateCertificate
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.putJSON Service
defaultService
response :: Logger
-> Service
-> Proxy UpdateCertificate
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse UpdateCertificate)))
response =
AWSResponse UpdateCertificate
-> Logger
-> Service
-> Proxy UpdateCertificate
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse UpdateCertificate)))
forall (m :: * -> *) a.
MonadResource m =>
AWSResponse a
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveNull AWSResponse UpdateCertificate
UpdateCertificateResponse
UpdateCertificateResponse'
instance Prelude.Hashable UpdateCertificate
instance Prelude.NFData UpdateCertificate
instance Core.ToHeaders UpdateCertificate where
toHeaders :: UpdateCertificate -> [Header]
toHeaders = [Header] -> UpdateCertificate -> [Header]
forall a b. a -> b -> a
Prelude.const [Header]
forall a. Monoid a => a
Prelude.mempty
instance Core.ToJSON UpdateCertificate where
toJSON :: UpdateCertificate -> Value
toJSON = Value -> UpdateCertificate -> Value
forall a b. a -> b -> a
Prelude.const (Object -> Value
Core.Object Object
forall a. Monoid a => a
Prelude.mempty)
instance Core.ToPath UpdateCertificate where
toPath :: UpdateCertificate -> ByteString
toPath UpdateCertificate' {Text
CertificateStatus
newStatus' :: CertificateStatus
certificateId :: Text
$sel:newStatus':UpdateCertificate' :: UpdateCertificate -> CertificateStatus
$sel:certificateId:UpdateCertificate' :: UpdateCertificate -> Text
..} =
[ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ByteString
"/certificates/", Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
certificateId]
instance Core.ToQuery UpdateCertificate where
toQuery :: UpdateCertificate -> QueryString
toQuery UpdateCertificate' {Text
CertificateStatus
newStatus' :: CertificateStatus
certificateId :: Text
$sel:newStatus':UpdateCertificate' :: UpdateCertificate -> CertificateStatus
$sel:certificateId:UpdateCertificate' :: UpdateCertificate -> Text
..} =
[QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat [ByteString
"newStatus" ByteString -> CertificateStatus -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: CertificateStatus
newStatus']
data UpdateCertificateResponse = UpdateCertificateResponse'
{
}
deriving (UpdateCertificateResponse -> UpdateCertificateResponse -> Bool
(UpdateCertificateResponse -> UpdateCertificateResponse -> Bool)
-> (UpdateCertificateResponse -> UpdateCertificateResponse -> Bool)
-> Eq UpdateCertificateResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateCertificateResponse -> UpdateCertificateResponse -> Bool
$c/= :: UpdateCertificateResponse -> UpdateCertificateResponse -> Bool
== :: UpdateCertificateResponse -> UpdateCertificateResponse -> Bool
$c== :: UpdateCertificateResponse -> UpdateCertificateResponse -> Bool
Prelude.Eq, ReadPrec [UpdateCertificateResponse]
ReadPrec UpdateCertificateResponse
Int -> ReadS UpdateCertificateResponse
ReadS [UpdateCertificateResponse]
(Int -> ReadS UpdateCertificateResponse)
-> ReadS [UpdateCertificateResponse]
-> ReadPrec UpdateCertificateResponse
-> ReadPrec [UpdateCertificateResponse]
-> Read UpdateCertificateResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateCertificateResponse]
$creadListPrec :: ReadPrec [UpdateCertificateResponse]
readPrec :: ReadPrec UpdateCertificateResponse
$creadPrec :: ReadPrec UpdateCertificateResponse
readList :: ReadS [UpdateCertificateResponse]
$creadList :: ReadS [UpdateCertificateResponse]
readsPrec :: Int -> ReadS UpdateCertificateResponse
$creadsPrec :: Int -> ReadS UpdateCertificateResponse
Prelude.Read, Int -> UpdateCertificateResponse -> ShowS
[UpdateCertificateResponse] -> ShowS
UpdateCertificateResponse -> String
(Int -> UpdateCertificateResponse -> ShowS)
-> (UpdateCertificateResponse -> String)
-> ([UpdateCertificateResponse] -> ShowS)
-> Show UpdateCertificateResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateCertificateResponse] -> ShowS
$cshowList :: [UpdateCertificateResponse] -> ShowS
show :: UpdateCertificateResponse -> String
$cshow :: UpdateCertificateResponse -> String
showsPrec :: Int -> UpdateCertificateResponse -> ShowS
$cshowsPrec :: Int -> UpdateCertificateResponse -> ShowS
Prelude.Show, (forall x.
UpdateCertificateResponse -> Rep UpdateCertificateResponse x)
-> (forall x.
Rep UpdateCertificateResponse x -> UpdateCertificateResponse)
-> Generic UpdateCertificateResponse
forall x.
Rep UpdateCertificateResponse x -> UpdateCertificateResponse
forall x.
UpdateCertificateResponse -> Rep UpdateCertificateResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpdateCertificateResponse x -> UpdateCertificateResponse
$cfrom :: forall x.
UpdateCertificateResponse -> Rep UpdateCertificateResponse x
Prelude.Generic)
newUpdateCertificateResponse ::
UpdateCertificateResponse
newUpdateCertificateResponse :: UpdateCertificateResponse
newUpdateCertificateResponse =
UpdateCertificateResponse
UpdateCertificateResponse'
instance Prelude.NFData UpdateCertificateResponse