{-# 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.FIS.StopExperiment
(
StopExperiment (..),
newStopExperiment,
stopExperiment_id,
StopExperimentResponse (..),
newStopExperimentResponse,
stopExperimentResponse_experiment,
stopExperimentResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.FIS.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data StopExperiment = StopExperiment'
{
StopExperiment -> Text
id :: Prelude.Text
}
deriving (StopExperiment -> StopExperiment -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: StopExperiment -> StopExperiment -> Bool
$c/= :: StopExperiment -> StopExperiment -> Bool
== :: StopExperiment -> StopExperiment -> Bool
$c== :: StopExperiment -> StopExperiment -> Bool
Prelude.Eq, ReadPrec [StopExperiment]
ReadPrec StopExperiment
Int -> ReadS StopExperiment
ReadS [StopExperiment]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [StopExperiment]
$creadListPrec :: ReadPrec [StopExperiment]
readPrec :: ReadPrec StopExperiment
$creadPrec :: ReadPrec StopExperiment
readList :: ReadS [StopExperiment]
$creadList :: ReadS [StopExperiment]
readsPrec :: Int -> ReadS StopExperiment
$creadsPrec :: Int -> ReadS StopExperiment
Prelude.Read, Int -> StopExperiment -> ShowS
[StopExperiment] -> ShowS
StopExperiment -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [StopExperiment] -> ShowS
$cshowList :: [StopExperiment] -> ShowS
show :: StopExperiment -> String
$cshow :: StopExperiment -> String
showsPrec :: Int -> StopExperiment -> ShowS
$cshowsPrec :: Int -> StopExperiment -> ShowS
Prelude.Show, forall x. Rep StopExperiment x -> StopExperiment
forall x. StopExperiment -> Rep StopExperiment x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep StopExperiment x -> StopExperiment
$cfrom :: forall x. StopExperiment -> Rep StopExperiment x
Prelude.Generic)
newStopExperiment ::
Prelude.Text ->
StopExperiment
newStopExperiment :: Text -> StopExperiment
newStopExperiment Text
pId_ = StopExperiment' {$sel:id:StopExperiment' :: Text
id = Text
pId_}
stopExperiment_id :: Lens.Lens' StopExperiment Prelude.Text
stopExperiment_id :: Lens' StopExperiment Text
stopExperiment_id = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StopExperiment' {Text
id :: Text
$sel:id:StopExperiment' :: StopExperiment -> Text
id} -> Text
id) (\s :: StopExperiment
s@StopExperiment' {} Text
a -> StopExperiment
s {$sel:id:StopExperiment' :: Text
id = Text
a} :: StopExperiment)
instance Core.AWSRequest StopExperiment where
type
AWSResponse StopExperiment =
StopExperimentResponse
request :: (Service -> Service) -> StopExperiment -> Request StopExperiment
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 StopExperiment
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse StopExperiment)))
response =
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
( \Int
s ResponseHeaders
h Object
x ->
Maybe Experiment -> Int -> StopExperimentResponse
StopExperimentResponse'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"experiment")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
)
instance Prelude.Hashable StopExperiment where
hashWithSalt :: Int -> StopExperiment -> Int
hashWithSalt Int
_salt StopExperiment' {Text
id :: Text
$sel:id:StopExperiment' :: StopExperiment -> Text
..} =
Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
id
instance Prelude.NFData StopExperiment where
rnf :: StopExperiment -> ()
rnf StopExperiment' {Text
id :: Text
$sel:id:StopExperiment' :: StopExperiment -> Text
..} = forall a. NFData a => a -> ()
Prelude.rnf Text
id
instance Data.ToHeaders StopExperiment where
toHeaders :: StopExperiment -> ResponseHeaders
toHeaders =
forall a b. a -> b -> a
Prelude.const
( forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"Content-Type"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Data.ToPath StopExperiment where
toPath :: StopExperiment -> ByteString
toPath StopExperiment' {Text
id :: Text
$sel:id:StopExperiment' :: StopExperiment -> Text
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat [ByteString
"/experiments/", forall a. ToByteString a => a -> ByteString
Data.toBS Text
id]
instance Data.ToQuery StopExperiment where
toQuery :: StopExperiment -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data StopExperimentResponse = StopExperimentResponse'
{
StopExperimentResponse -> Maybe Experiment
experiment :: Prelude.Maybe Experiment,
StopExperimentResponse -> Int
httpStatus :: Prelude.Int
}
deriving (StopExperimentResponse -> StopExperimentResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: StopExperimentResponse -> StopExperimentResponse -> Bool
$c/= :: StopExperimentResponse -> StopExperimentResponse -> Bool
== :: StopExperimentResponse -> StopExperimentResponse -> Bool
$c== :: StopExperimentResponse -> StopExperimentResponse -> Bool
Prelude.Eq, ReadPrec [StopExperimentResponse]
ReadPrec StopExperimentResponse
Int -> ReadS StopExperimentResponse
ReadS [StopExperimentResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [StopExperimentResponse]
$creadListPrec :: ReadPrec [StopExperimentResponse]
readPrec :: ReadPrec StopExperimentResponse
$creadPrec :: ReadPrec StopExperimentResponse
readList :: ReadS [StopExperimentResponse]
$creadList :: ReadS [StopExperimentResponse]
readsPrec :: Int -> ReadS StopExperimentResponse
$creadsPrec :: Int -> ReadS StopExperimentResponse
Prelude.Read, Int -> StopExperimentResponse -> ShowS
[StopExperimentResponse] -> ShowS
StopExperimentResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [StopExperimentResponse] -> ShowS
$cshowList :: [StopExperimentResponse] -> ShowS
show :: StopExperimentResponse -> String
$cshow :: StopExperimentResponse -> String
showsPrec :: Int -> StopExperimentResponse -> ShowS
$cshowsPrec :: Int -> StopExperimentResponse -> ShowS
Prelude.Show, forall x. Rep StopExperimentResponse x -> StopExperimentResponse
forall x. StopExperimentResponse -> Rep StopExperimentResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep StopExperimentResponse x -> StopExperimentResponse
$cfrom :: forall x. StopExperimentResponse -> Rep StopExperimentResponse x
Prelude.Generic)
newStopExperimentResponse ::
Prelude.Int ->
StopExperimentResponse
newStopExperimentResponse :: Int -> StopExperimentResponse
newStopExperimentResponse Int
pHttpStatus_ =
StopExperimentResponse'
{ $sel:experiment:StopExperimentResponse' :: Maybe Experiment
experiment =
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:StopExperimentResponse' :: Int
httpStatus = Int
pHttpStatus_
}
stopExperimentResponse_experiment :: Lens.Lens' StopExperimentResponse (Prelude.Maybe Experiment)
stopExperimentResponse_experiment :: Lens' StopExperimentResponse (Maybe Experiment)
stopExperimentResponse_experiment = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StopExperimentResponse' {Maybe Experiment
experiment :: Maybe Experiment
$sel:experiment:StopExperimentResponse' :: StopExperimentResponse -> Maybe Experiment
experiment} -> Maybe Experiment
experiment) (\s :: StopExperimentResponse
s@StopExperimentResponse' {} Maybe Experiment
a -> StopExperimentResponse
s {$sel:experiment:StopExperimentResponse' :: Maybe Experiment
experiment = Maybe Experiment
a} :: StopExperimentResponse)
stopExperimentResponse_httpStatus :: Lens.Lens' StopExperimentResponse Prelude.Int
stopExperimentResponse_httpStatus :: Lens' StopExperimentResponse Int
stopExperimentResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StopExperimentResponse' {Int
httpStatus :: Int
$sel:httpStatus:StopExperimentResponse' :: StopExperimentResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: StopExperimentResponse
s@StopExperimentResponse' {} Int
a -> StopExperimentResponse
s {$sel:httpStatus:StopExperimentResponse' :: Int
httpStatus = Int
a} :: StopExperimentResponse)
instance Prelude.NFData StopExperimentResponse where
rnf :: StopExperimentResponse -> ()
rnf StopExperimentResponse' {Int
Maybe Experiment
httpStatus :: Int
experiment :: Maybe Experiment
$sel:httpStatus:StopExperimentResponse' :: StopExperimentResponse -> Int
$sel:experiment:StopExperimentResponse' :: StopExperimentResponse -> Maybe Experiment
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Experiment
experiment
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus