{-# 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.Synthetics.DeleteCanary
(
DeleteCanary (..),
newDeleteCanary,
deleteCanary_name,
DeleteCanaryResponse (..),
newDeleteCanaryResponse,
deleteCanaryResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
import Amazonka.Synthetics.Types
data DeleteCanary = DeleteCanary'
{
DeleteCanary -> Text
name :: Prelude.Text
}
deriving (DeleteCanary -> DeleteCanary -> Bool
(DeleteCanary -> DeleteCanary -> Bool)
-> (DeleteCanary -> DeleteCanary -> Bool) -> Eq DeleteCanary
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteCanary -> DeleteCanary -> Bool
$c/= :: DeleteCanary -> DeleteCanary -> Bool
== :: DeleteCanary -> DeleteCanary -> Bool
$c== :: DeleteCanary -> DeleteCanary -> Bool
Prelude.Eq, ReadPrec [DeleteCanary]
ReadPrec DeleteCanary
Int -> ReadS DeleteCanary
ReadS [DeleteCanary]
(Int -> ReadS DeleteCanary)
-> ReadS [DeleteCanary]
-> ReadPrec DeleteCanary
-> ReadPrec [DeleteCanary]
-> Read DeleteCanary
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteCanary]
$creadListPrec :: ReadPrec [DeleteCanary]
readPrec :: ReadPrec DeleteCanary
$creadPrec :: ReadPrec DeleteCanary
readList :: ReadS [DeleteCanary]
$creadList :: ReadS [DeleteCanary]
readsPrec :: Int -> ReadS DeleteCanary
$creadsPrec :: Int -> ReadS DeleteCanary
Prelude.Read, Int -> DeleteCanary -> ShowS
[DeleteCanary] -> ShowS
DeleteCanary -> String
(Int -> DeleteCanary -> ShowS)
-> (DeleteCanary -> String)
-> ([DeleteCanary] -> ShowS)
-> Show DeleteCanary
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteCanary] -> ShowS
$cshowList :: [DeleteCanary] -> ShowS
show :: DeleteCanary -> String
$cshow :: DeleteCanary -> String
showsPrec :: Int -> DeleteCanary -> ShowS
$cshowsPrec :: Int -> DeleteCanary -> ShowS
Prelude.Show, (forall x. DeleteCanary -> Rep DeleteCanary x)
-> (forall x. Rep DeleteCanary x -> DeleteCanary)
-> Generic DeleteCanary
forall x. Rep DeleteCanary x -> DeleteCanary
forall x. DeleteCanary -> Rep DeleteCanary x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteCanary x -> DeleteCanary
$cfrom :: forall x. DeleteCanary -> Rep DeleteCanary x
Prelude.Generic)
newDeleteCanary ::
Prelude.Text ->
DeleteCanary
newDeleteCanary :: Text -> DeleteCanary
newDeleteCanary Text
pName_ = DeleteCanary' :: Text -> DeleteCanary
DeleteCanary' {$sel:name:DeleteCanary' :: Text
name = Text
pName_}
deleteCanary_name :: Lens.Lens' DeleteCanary Prelude.Text
deleteCanary_name :: (Text -> f Text) -> DeleteCanary -> f DeleteCanary
deleteCanary_name = (DeleteCanary -> Text)
-> (DeleteCanary -> Text -> DeleteCanary)
-> Lens DeleteCanary DeleteCanary Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteCanary' {Text
name :: Text
$sel:name:DeleteCanary' :: DeleteCanary -> Text
name} -> Text
name) (\s :: DeleteCanary
s@DeleteCanary' {} Text
a -> DeleteCanary
s {$sel:name:DeleteCanary' :: Text
name = Text
a} :: DeleteCanary)
instance Core.AWSRequest DeleteCanary where
type AWSResponse DeleteCanary = DeleteCanaryResponse
request :: DeleteCanary -> Request DeleteCanary
request = Service -> DeleteCanary -> Request DeleteCanary
forall a. ToRequest a => Service -> a -> Request a
Request.delete Service
defaultService
response :: Logger
-> Service
-> Proxy DeleteCanary
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DeleteCanary)))
response =
(Int
-> ResponseHeaders
-> ()
-> Either String (AWSResponse DeleteCanary))
-> Logger
-> Service
-> Proxy DeleteCanary
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DeleteCanary)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> () -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveEmpty
( \Int
s ResponseHeaders
h ()
x ->
Int -> DeleteCanaryResponse
DeleteCanaryResponse'
(Int -> DeleteCanaryResponse)
-> Either String Int -> Either String DeleteCanaryResponse
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Int -> Either String Int
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (Int -> Int
forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
)
instance Prelude.Hashable DeleteCanary
instance Prelude.NFData DeleteCanary
instance Core.ToHeaders DeleteCanary where
toHeaders :: DeleteCanary -> ResponseHeaders
toHeaders =
ResponseHeaders -> DeleteCanary -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"Content-Type"
HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Core.ToPath DeleteCanary where
toPath :: DeleteCanary -> ByteString
toPath DeleteCanary' {Text
name :: Text
$sel:name:DeleteCanary' :: DeleteCanary -> Text
..} =
[ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat [ByteString
"/canary/", Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
name]
instance Core.ToQuery DeleteCanary where
toQuery :: DeleteCanary -> QueryString
toQuery = QueryString -> DeleteCanary -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data DeleteCanaryResponse = DeleteCanaryResponse'
{
DeleteCanaryResponse -> Int
httpStatus :: Prelude.Int
}
deriving (DeleteCanaryResponse -> DeleteCanaryResponse -> Bool
(DeleteCanaryResponse -> DeleteCanaryResponse -> Bool)
-> (DeleteCanaryResponse -> DeleteCanaryResponse -> Bool)
-> Eq DeleteCanaryResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteCanaryResponse -> DeleteCanaryResponse -> Bool
$c/= :: DeleteCanaryResponse -> DeleteCanaryResponse -> Bool
== :: DeleteCanaryResponse -> DeleteCanaryResponse -> Bool
$c== :: DeleteCanaryResponse -> DeleteCanaryResponse -> Bool
Prelude.Eq, ReadPrec [DeleteCanaryResponse]
ReadPrec DeleteCanaryResponse
Int -> ReadS DeleteCanaryResponse
ReadS [DeleteCanaryResponse]
(Int -> ReadS DeleteCanaryResponse)
-> ReadS [DeleteCanaryResponse]
-> ReadPrec DeleteCanaryResponse
-> ReadPrec [DeleteCanaryResponse]
-> Read DeleteCanaryResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteCanaryResponse]
$creadListPrec :: ReadPrec [DeleteCanaryResponse]
readPrec :: ReadPrec DeleteCanaryResponse
$creadPrec :: ReadPrec DeleteCanaryResponse
readList :: ReadS [DeleteCanaryResponse]
$creadList :: ReadS [DeleteCanaryResponse]
readsPrec :: Int -> ReadS DeleteCanaryResponse
$creadsPrec :: Int -> ReadS DeleteCanaryResponse
Prelude.Read, Int -> DeleteCanaryResponse -> ShowS
[DeleteCanaryResponse] -> ShowS
DeleteCanaryResponse -> String
(Int -> DeleteCanaryResponse -> ShowS)
-> (DeleteCanaryResponse -> String)
-> ([DeleteCanaryResponse] -> ShowS)
-> Show DeleteCanaryResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteCanaryResponse] -> ShowS
$cshowList :: [DeleteCanaryResponse] -> ShowS
show :: DeleteCanaryResponse -> String
$cshow :: DeleteCanaryResponse -> String
showsPrec :: Int -> DeleteCanaryResponse -> ShowS
$cshowsPrec :: Int -> DeleteCanaryResponse -> ShowS
Prelude.Show, (forall x. DeleteCanaryResponse -> Rep DeleteCanaryResponse x)
-> (forall x. Rep DeleteCanaryResponse x -> DeleteCanaryResponse)
-> Generic DeleteCanaryResponse
forall x. Rep DeleteCanaryResponse x -> DeleteCanaryResponse
forall x. DeleteCanaryResponse -> Rep DeleteCanaryResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteCanaryResponse x -> DeleteCanaryResponse
$cfrom :: forall x. DeleteCanaryResponse -> Rep DeleteCanaryResponse x
Prelude.Generic)
newDeleteCanaryResponse ::
Prelude.Int ->
DeleteCanaryResponse
newDeleteCanaryResponse :: Int -> DeleteCanaryResponse
newDeleteCanaryResponse Int
pHttpStatus_ =
DeleteCanaryResponse' :: Int -> DeleteCanaryResponse
DeleteCanaryResponse' {$sel:httpStatus:DeleteCanaryResponse' :: Int
httpStatus = Int
pHttpStatus_}
deleteCanaryResponse_httpStatus :: Lens.Lens' DeleteCanaryResponse Prelude.Int
deleteCanaryResponse_httpStatus :: (Int -> f Int) -> DeleteCanaryResponse -> f DeleteCanaryResponse
deleteCanaryResponse_httpStatus = (DeleteCanaryResponse -> Int)
-> (DeleteCanaryResponse -> Int -> DeleteCanaryResponse)
-> Lens DeleteCanaryResponse DeleteCanaryResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteCanaryResponse' {Int
httpStatus :: Int
$sel:httpStatus:DeleteCanaryResponse' :: DeleteCanaryResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DeleteCanaryResponse
s@DeleteCanaryResponse' {} Int
a -> DeleteCanaryResponse
s {$sel:httpStatus:DeleteCanaryResponse' :: Int
httpStatus = Int
a} :: DeleteCanaryResponse)
instance Prelude.NFData DeleteCanaryResponse