{-# 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.DeleteCertificate
(
DeleteCertificate (..),
newDeleteCertificate,
deleteCertificate_forceDelete,
deleteCertificate_certificateId,
DeleteCertificateResponse (..),
newDeleteCertificateResponse,
)
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 DeleteCertificate = DeleteCertificate'
{
DeleteCertificate -> Maybe Bool
forceDelete :: Prelude.Maybe Prelude.Bool,
DeleteCertificate -> Text
certificateId :: Prelude.Text
}
deriving (DeleteCertificate -> DeleteCertificate -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteCertificate -> DeleteCertificate -> Bool
$c/= :: DeleteCertificate -> DeleteCertificate -> Bool
== :: DeleteCertificate -> DeleteCertificate -> Bool
$c== :: DeleteCertificate -> DeleteCertificate -> Bool
Prelude.Eq, ReadPrec [DeleteCertificate]
ReadPrec DeleteCertificate
Int -> ReadS DeleteCertificate
ReadS [DeleteCertificate]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteCertificate]
$creadListPrec :: ReadPrec [DeleteCertificate]
readPrec :: ReadPrec DeleteCertificate
$creadPrec :: ReadPrec DeleteCertificate
readList :: ReadS [DeleteCertificate]
$creadList :: ReadS [DeleteCertificate]
readsPrec :: Int -> ReadS DeleteCertificate
$creadsPrec :: Int -> ReadS DeleteCertificate
Prelude.Read, Int -> DeleteCertificate -> ShowS
[DeleteCertificate] -> ShowS
DeleteCertificate -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteCertificate] -> ShowS
$cshowList :: [DeleteCertificate] -> ShowS
show :: DeleteCertificate -> String
$cshow :: DeleteCertificate -> String
showsPrec :: Int -> DeleteCertificate -> ShowS
$cshowsPrec :: Int -> DeleteCertificate -> ShowS
Prelude.Show, forall x. Rep DeleteCertificate x -> DeleteCertificate
forall x. DeleteCertificate -> Rep DeleteCertificate x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteCertificate x -> DeleteCertificate
$cfrom :: forall x. DeleteCertificate -> Rep DeleteCertificate x
Prelude.Generic)
newDeleteCertificate ::
Prelude.Text ->
DeleteCertificate
newDeleteCertificate :: Text -> DeleteCertificate
newDeleteCertificate Text
pCertificateId_ =
DeleteCertificate'
{ $sel:forceDelete:DeleteCertificate' :: Maybe Bool
forceDelete = forall a. Maybe a
Prelude.Nothing,
$sel:certificateId:DeleteCertificate' :: Text
certificateId = Text
pCertificateId_
}
deleteCertificate_forceDelete :: Lens.Lens' DeleteCertificate (Prelude.Maybe Prelude.Bool)
deleteCertificate_forceDelete :: Lens' DeleteCertificate (Maybe Bool)
deleteCertificate_forceDelete = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteCertificate' {Maybe Bool
forceDelete :: Maybe Bool
$sel:forceDelete:DeleteCertificate' :: DeleteCertificate -> Maybe Bool
forceDelete} -> Maybe Bool
forceDelete) (\s :: DeleteCertificate
s@DeleteCertificate' {} Maybe Bool
a -> DeleteCertificate
s {$sel:forceDelete:DeleteCertificate' :: Maybe Bool
forceDelete = Maybe Bool
a} :: DeleteCertificate)
deleteCertificate_certificateId :: Lens.Lens' DeleteCertificate Prelude.Text
deleteCertificate_certificateId :: Lens' DeleteCertificate Text
deleteCertificate_certificateId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteCertificate' {Text
certificateId :: Text
$sel:certificateId:DeleteCertificate' :: DeleteCertificate -> Text
certificateId} -> Text
certificateId) (\s :: DeleteCertificate
s@DeleteCertificate' {} Text
a -> DeleteCertificate
s {$sel:certificateId:DeleteCertificate' :: Text
certificateId = Text
a} :: DeleteCertificate)
instance Core.AWSRequest DeleteCertificate where
type
AWSResponse DeleteCertificate =
DeleteCertificateResponse
request :: (Service -> Service)
-> DeleteCertificate -> Request DeleteCertificate
request Service -> Service
overrides =
forall a. ToRequest a => Service -> a -> Request a
Request.delete (Service -> Service
overrides Service
defaultService)
response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy DeleteCertificate
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DeleteCertificate)))
response =
forall (m :: * -> *) a.
MonadResource m =>
AWSResponse a
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveNull DeleteCertificateResponse
DeleteCertificateResponse'
instance Prelude.Hashable DeleteCertificate where
hashWithSalt :: Int -> DeleteCertificate -> Int
hashWithSalt Int
_salt DeleteCertificate' {Maybe Bool
Text
certificateId :: Text
forceDelete :: Maybe Bool
$sel:certificateId:DeleteCertificate' :: DeleteCertificate -> Text
$sel:forceDelete:DeleteCertificate' :: DeleteCertificate -> Maybe Bool
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
forceDelete
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
certificateId
instance Prelude.NFData DeleteCertificate where
rnf :: DeleteCertificate -> ()
rnf DeleteCertificate' {Maybe Bool
Text
certificateId :: Text
forceDelete :: Maybe Bool
$sel:certificateId:DeleteCertificate' :: DeleteCertificate -> Text
$sel:forceDelete:DeleteCertificate' :: DeleteCertificate -> Maybe Bool
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
forceDelete
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
certificateId
instance Data.ToHeaders DeleteCertificate where
toHeaders :: DeleteCertificate -> [Header]
toHeaders = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
instance Data.ToPath DeleteCertificate where
toPath :: DeleteCertificate -> ByteString
toPath DeleteCertificate' {Maybe Bool
Text
certificateId :: Text
forceDelete :: Maybe Bool
$sel:certificateId:DeleteCertificate' :: DeleteCertificate -> Text
$sel:forceDelete:DeleteCertificate' :: DeleteCertificate -> Maybe Bool
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ByteString
"/certificates/", forall a. ToByteString a => a -> ByteString
Data.toBS Text
certificateId]
instance Data.ToQuery DeleteCertificate where
toQuery :: DeleteCertificate -> QueryString
toQuery DeleteCertificate' {Maybe Bool
Text
certificateId :: Text
forceDelete :: Maybe Bool
$sel:certificateId:DeleteCertificate' :: DeleteCertificate -> Text
$sel:forceDelete:DeleteCertificate' :: DeleteCertificate -> Maybe Bool
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat [ByteString
"forceDelete" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Bool
forceDelete]
data DeleteCertificateResponse = DeleteCertificateResponse'
{
}
deriving (DeleteCertificateResponse -> DeleteCertificateResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteCertificateResponse -> DeleteCertificateResponse -> Bool
$c/= :: DeleteCertificateResponse -> DeleteCertificateResponse -> Bool
== :: DeleteCertificateResponse -> DeleteCertificateResponse -> Bool
$c== :: DeleteCertificateResponse -> DeleteCertificateResponse -> Bool
Prelude.Eq, ReadPrec [DeleteCertificateResponse]
ReadPrec DeleteCertificateResponse
Int -> ReadS DeleteCertificateResponse
ReadS [DeleteCertificateResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteCertificateResponse]
$creadListPrec :: ReadPrec [DeleteCertificateResponse]
readPrec :: ReadPrec DeleteCertificateResponse
$creadPrec :: ReadPrec DeleteCertificateResponse
readList :: ReadS [DeleteCertificateResponse]
$creadList :: ReadS [DeleteCertificateResponse]
readsPrec :: Int -> ReadS DeleteCertificateResponse
$creadsPrec :: Int -> ReadS DeleteCertificateResponse
Prelude.Read, Int -> DeleteCertificateResponse -> ShowS
[DeleteCertificateResponse] -> ShowS
DeleteCertificateResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteCertificateResponse] -> ShowS
$cshowList :: [DeleteCertificateResponse] -> ShowS
show :: DeleteCertificateResponse -> String
$cshow :: DeleteCertificateResponse -> String
showsPrec :: Int -> DeleteCertificateResponse -> ShowS
$cshowsPrec :: Int -> DeleteCertificateResponse -> ShowS
Prelude.Show, forall x.
Rep DeleteCertificateResponse x -> DeleteCertificateResponse
forall x.
DeleteCertificateResponse -> Rep DeleteCertificateResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DeleteCertificateResponse x -> DeleteCertificateResponse
$cfrom :: forall x.
DeleteCertificateResponse -> Rep DeleteCertificateResponse x
Prelude.Generic)
newDeleteCertificateResponse ::
DeleteCertificateResponse
newDeleteCertificateResponse :: DeleteCertificateResponse
newDeleteCertificateResponse =
DeleteCertificateResponse
DeleteCertificateResponse'
instance Prelude.NFData DeleteCertificateResponse where
rnf :: DeleteCertificateResponse -> ()
rnf DeleteCertificateResponse
_ = ()