{-# 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 qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.IoT.Types
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
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]
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
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. 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'
{ $sel:certificateId:UpdateCertificate' :: Text
certificateId = Text
pCertificateId_,
$sel:newStatus':UpdateCertificate' :: CertificateStatus
newStatus' = CertificateStatus
pNewStatus_
}
updateCertificate_certificateId :: Lens.Lens' UpdateCertificate Prelude.Text
updateCertificate_certificateId :: Lens' UpdateCertificate Text
updateCertificate_certificateId = 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 :: Lens' UpdateCertificate CertificateStatus
updateCertificate_newStatus = 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 :: (Service -> Service)
-> UpdateCertificate -> Request UpdateCertificate
request Service -> Service
overrides =
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.putJSON (Service -> Service
overrides Service
defaultService)
response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy UpdateCertificate
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse UpdateCertificate)))
response =
forall (m :: * -> *) a.
MonadResource m =>
AWSResponse a
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveNull UpdateCertificateResponse
UpdateCertificateResponse'
instance Prelude.Hashable UpdateCertificate where
hashWithSalt :: Int -> UpdateCertificate -> Int
hashWithSalt Int
_salt UpdateCertificate' {Text
CertificateStatus
newStatus' :: CertificateStatus
certificateId :: Text
$sel:newStatus':UpdateCertificate' :: UpdateCertificate -> CertificateStatus
$sel:certificateId:UpdateCertificate' :: UpdateCertificate -> Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
certificateId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` CertificateStatus
newStatus'
instance Prelude.NFData UpdateCertificate where
rnf :: UpdateCertificate -> ()
rnf UpdateCertificate' {Text
CertificateStatus
newStatus' :: CertificateStatus
certificateId :: Text
$sel:newStatus':UpdateCertificate' :: UpdateCertificate -> CertificateStatus
$sel:certificateId:UpdateCertificate' :: UpdateCertificate -> Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Text
certificateId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf CertificateStatus
newStatus'
instance Data.ToHeaders UpdateCertificate where
toHeaders :: UpdateCertificate -> [Header]
toHeaders = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
instance Data.ToJSON UpdateCertificate where
toJSON :: UpdateCertificate -> Value
toJSON = forall a b. a -> b -> a
Prelude.const (Object -> Value
Data.Object forall a. Monoid a => a
Prelude.mempty)
instance Data.ToPath UpdateCertificate where
toPath :: UpdateCertificate -> ByteString
toPath UpdateCertificate' {Text
CertificateStatus
newStatus' :: CertificateStatus
certificateId :: Text
$sel:newStatus':UpdateCertificate' :: UpdateCertificate -> CertificateStatus
$sel:certificateId:UpdateCertificate' :: UpdateCertificate -> Text
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ByteString
"/certificates/", forall a. ToByteString a => a -> ByteString
Data.toBS Text
certificateId]
instance Data.ToQuery UpdateCertificate where
toQuery :: UpdateCertificate -> QueryString
toQuery UpdateCertificate' {Text
CertificateStatus
newStatus' :: CertificateStatus
certificateId :: Text
$sel:newStatus':UpdateCertificate' :: UpdateCertificate -> CertificateStatus
$sel:certificateId:UpdateCertificate' :: UpdateCertificate -> Text
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat [ByteString
"newStatus" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: CertificateStatus
newStatus']
data UpdateCertificateResponse = UpdateCertificateResponse'
{
}
deriving (UpdateCertificateResponse -> UpdateCertificateResponse -> Bool
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]
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
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.
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 where
rnf :: UpdateCertificateResponse -> ()
rnf UpdateCertificateResponse
_ = ()