{-# 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.StopCanary
(
StopCanary (..),
newStopCanary,
stopCanary_name,
StopCanaryResponse (..),
newStopCanaryResponse,
stopCanaryResponse_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 StopCanary = StopCanary'
{
StopCanary -> Text
name :: Prelude.Text
}
deriving (StopCanary -> StopCanary -> Bool
(StopCanary -> StopCanary -> Bool)
-> (StopCanary -> StopCanary -> Bool) -> Eq StopCanary
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: StopCanary -> StopCanary -> Bool
$c/= :: StopCanary -> StopCanary -> Bool
== :: StopCanary -> StopCanary -> Bool
$c== :: StopCanary -> StopCanary -> Bool
Prelude.Eq, ReadPrec [StopCanary]
ReadPrec StopCanary
Int -> ReadS StopCanary
ReadS [StopCanary]
(Int -> ReadS StopCanary)
-> ReadS [StopCanary]
-> ReadPrec StopCanary
-> ReadPrec [StopCanary]
-> Read StopCanary
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [StopCanary]
$creadListPrec :: ReadPrec [StopCanary]
readPrec :: ReadPrec StopCanary
$creadPrec :: ReadPrec StopCanary
readList :: ReadS [StopCanary]
$creadList :: ReadS [StopCanary]
readsPrec :: Int -> ReadS StopCanary
$creadsPrec :: Int -> ReadS StopCanary
Prelude.Read, Int -> StopCanary -> ShowS
[StopCanary] -> ShowS
StopCanary -> String
(Int -> StopCanary -> ShowS)
-> (StopCanary -> String)
-> ([StopCanary] -> ShowS)
-> Show StopCanary
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [StopCanary] -> ShowS
$cshowList :: [StopCanary] -> ShowS
show :: StopCanary -> String
$cshow :: StopCanary -> String
showsPrec :: Int -> StopCanary -> ShowS
$cshowsPrec :: Int -> StopCanary -> ShowS
Prelude.Show, (forall x. StopCanary -> Rep StopCanary x)
-> (forall x. Rep StopCanary x -> StopCanary) -> Generic StopCanary
forall x. Rep StopCanary x -> StopCanary
forall x. StopCanary -> Rep StopCanary x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep StopCanary x -> StopCanary
$cfrom :: forall x. StopCanary -> Rep StopCanary x
Prelude.Generic)
newStopCanary ::
Prelude.Text ->
StopCanary
newStopCanary :: Text -> StopCanary
newStopCanary Text
pName_ = StopCanary' :: Text -> StopCanary
StopCanary' {$sel:name:StopCanary' :: Text
name = Text
pName_}
stopCanary_name :: Lens.Lens' StopCanary Prelude.Text
stopCanary_name :: (Text -> f Text) -> StopCanary -> f StopCanary
stopCanary_name = (StopCanary -> Text)
-> (StopCanary -> Text -> StopCanary)
-> Lens StopCanary StopCanary Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StopCanary' {Text
name :: Text
$sel:name:StopCanary' :: StopCanary -> Text
name} -> Text
name) (\s :: StopCanary
s@StopCanary' {} Text
a -> StopCanary
s {$sel:name:StopCanary' :: Text
name = Text
a} :: StopCanary)
instance Core.AWSRequest StopCanary where
type AWSResponse StopCanary = StopCanaryResponse
request :: StopCanary -> Request StopCanary
request = Service -> StopCanary -> Request StopCanary
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy StopCanary
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse StopCanary)))
response =
(Int
-> ResponseHeaders -> () -> Either String (AWSResponse StopCanary))
-> Logger
-> Service
-> Proxy StopCanary
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse StopCanary)))
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 -> StopCanaryResponse
StopCanaryResponse'
(Int -> StopCanaryResponse)
-> Either String Int -> Either String StopCanaryResponse
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 StopCanary
instance Prelude.NFData StopCanary
instance Core.ToHeaders StopCanary where
toHeaders :: StopCanary -> ResponseHeaders
toHeaders =
ResponseHeaders -> StopCanary -> 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.ToJSON StopCanary where
toJSON :: StopCanary -> Value
toJSON = Value -> StopCanary -> Value
forall a b. a -> b -> a
Prelude.const (Object -> Value
Core.Object Object
forall a. Monoid a => a
Prelude.mempty)
instance Core.ToPath StopCanary where
toPath :: StopCanary -> ByteString
toPath StopCanary' {Text
name :: Text
$sel:name:StopCanary' :: StopCanary -> 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, ByteString
"/stop"]
instance Core.ToQuery StopCanary where
toQuery :: StopCanary -> QueryString
toQuery = QueryString -> StopCanary -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data StopCanaryResponse = StopCanaryResponse'
{
StopCanaryResponse -> Int
httpStatus :: Prelude.Int
}
deriving (StopCanaryResponse -> StopCanaryResponse -> Bool
(StopCanaryResponse -> StopCanaryResponse -> Bool)
-> (StopCanaryResponse -> StopCanaryResponse -> Bool)
-> Eq StopCanaryResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: StopCanaryResponse -> StopCanaryResponse -> Bool
$c/= :: StopCanaryResponse -> StopCanaryResponse -> Bool
== :: StopCanaryResponse -> StopCanaryResponse -> Bool
$c== :: StopCanaryResponse -> StopCanaryResponse -> Bool
Prelude.Eq, ReadPrec [StopCanaryResponse]
ReadPrec StopCanaryResponse
Int -> ReadS StopCanaryResponse
ReadS [StopCanaryResponse]
(Int -> ReadS StopCanaryResponse)
-> ReadS [StopCanaryResponse]
-> ReadPrec StopCanaryResponse
-> ReadPrec [StopCanaryResponse]
-> Read StopCanaryResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [StopCanaryResponse]
$creadListPrec :: ReadPrec [StopCanaryResponse]
readPrec :: ReadPrec StopCanaryResponse
$creadPrec :: ReadPrec StopCanaryResponse
readList :: ReadS [StopCanaryResponse]
$creadList :: ReadS [StopCanaryResponse]
readsPrec :: Int -> ReadS StopCanaryResponse
$creadsPrec :: Int -> ReadS StopCanaryResponse
Prelude.Read, Int -> StopCanaryResponse -> ShowS
[StopCanaryResponse] -> ShowS
StopCanaryResponse -> String
(Int -> StopCanaryResponse -> ShowS)
-> (StopCanaryResponse -> String)
-> ([StopCanaryResponse] -> ShowS)
-> Show StopCanaryResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [StopCanaryResponse] -> ShowS
$cshowList :: [StopCanaryResponse] -> ShowS
show :: StopCanaryResponse -> String
$cshow :: StopCanaryResponse -> String
showsPrec :: Int -> StopCanaryResponse -> ShowS
$cshowsPrec :: Int -> StopCanaryResponse -> ShowS
Prelude.Show, (forall x. StopCanaryResponse -> Rep StopCanaryResponse x)
-> (forall x. Rep StopCanaryResponse x -> StopCanaryResponse)
-> Generic StopCanaryResponse
forall x. Rep StopCanaryResponse x -> StopCanaryResponse
forall x. StopCanaryResponse -> Rep StopCanaryResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep StopCanaryResponse x -> StopCanaryResponse
$cfrom :: forall x. StopCanaryResponse -> Rep StopCanaryResponse x
Prelude.Generic)
newStopCanaryResponse ::
Prelude.Int ->
StopCanaryResponse
newStopCanaryResponse :: Int -> StopCanaryResponse
newStopCanaryResponse Int
pHttpStatus_ =
StopCanaryResponse' :: Int -> StopCanaryResponse
StopCanaryResponse' {$sel:httpStatus:StopCanaryResponse' :: Int
httpStatus = Int
pHttpStatus_}
stopCanaryResponse_httpStatus :: Lens.Lens' StopCanaryResponse Prelude.Int
stopCanaryResponse_httpStatus :: (Int -> f Int) -> StopCanaryResponse -> f StopCanaryResponse
stopCanaryResponse_httpStatus = (StopCanaryResponse -> Int)
-> (StopCanaryResponse -> Int -> StopCanaryResponse)
-> Lens StopCanaryResponse StopCanaryResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StopCanaryResponse' {Int
httpStatus :: Int
$sel:httpStatus:StopCanaryResponse' :: StopCanaryResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: StopCanaryResponse
s@StopCanaryResponse' {} Int
a -> StopCanaryResponse
s {$sel:httpStatus:StopCanaryResponse' :: Int
httpStatus = Int
a} :: StopCanaryResponse)
instance Prelude.NFData StopCanaryResponse