{-# 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.DeviceFarm.StopRun
(
StopRun (..),
newStopRun,
stopRun_arn,
StopRunResponse (..),
newStopRunResponse,
stopRunResponse_run,
stopRunResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.DeviceFarm.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data StopRun = StopRun'
{
StopRun -> Text
arn :: Prelude.Text
}
deriving (StopRun -> StopRun -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: StopRun -> StopRun -> Bool
$c/= :: StopRun -> StopRun -> Bool
== :: StopRun -> StopRun -> Bool
$c== :: StopRun -> StopRun -> Bool
Prelude.Eq, ReadPrec [StopRun]
ReadPrec StopRun
Int -> ReadS StopRun
ReadS [StopRun]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [StopRun]
$creadListPrec :: ReadPrec [StopRun]
readPrec :: ReadPrec StopRun
$creadPrec :: ReadPrec StopRun
readList :: ReadS [StopRun]
$creadList :: ReadS [StopRun]
readsPrec :: Int -> ReadS StopRun
$creadsPrec :: Int -> ReadS StopRun
Prelude.Read, Int -> StopRun -> ShowS
[StopRun] -> ShowS
StopRun -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [StopRun] -> ShowS
$cshowList :: [StopRun] -> ShowS
show :: StopRun -> String
$cshow :: StopRun -> String
showsPrec :: Int -> StopRun -> ShowS
$cshowsPrec :: Int -> StopRun -> ShowS
Prelude.Show, forall x. Rep StopRun x -> StopRun
forall x. StopRun -> Rep StopRun x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep StopRun x -> StopRun
$cfrom :: forall x. StopRun -> Rep StopRun x
Prelude.Generic)
newStopRun ::
Prelude.Text ->
StopRun
newStopRun :: Text -> StopRun
newStopRun Text
pArn_ = StopRun' {$sel:arn:StopRun' :: Text
arn = Text
pArn_}
stopRun_arn :: Lens.Lens' StopRun Prelude.Text
stopRun_arn :: Lens' StopRun Text
stopRun_arn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StopRun' {Text
arn :: Text
$sel:arn:StopRun' :: StopRun -> Text
arn} -> Text
arn) (\s :: StopRun
s@StopRun' {} Text
a -> StopRun
s {$sel:arn:StopRun' :: Text
arn = Text
a} :: StopRun)
instance Core.AWSRequest StopRun where
type AWSResponse StopRun = StopRunResponse
request :: (Service -> Service) -> StopRun -> Request StopRun
request Service -> Service
overrides =
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy StopRun
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse StopRun)))
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 Run -> Int -> StopRunResponse
StopRunResponse'
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
"run")
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 StopRun where
hashWithSalt :: Int -> StopRun -> Int
hashWithSalt Int
_salt StopRun' {Text
arn :: Text
$sel:arn:StopRun' :: StopRun -> Text
..} =
Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
arn
instance Prelude.NFData StopRun where
rnf :: StopRun -> ()
rnf StopRun' {Text
arn :: Text
$sel:arn:StopRun' :: StopRun -> Text
..} = forall a. NFData a => a -> ()
Prelude.rnf Text
arn
instance Data.ToHeaders StopRun where
toHeaders :: StopRun -> ResponseHeaders
toHeaders =
forall a b. a -> b -> a
Prelude.const
( forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"X-Amz-Target"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"DeviceFarm_20150623.StopRun" ::
Prelude.ByteString
),
HeaderName
"Content-Type"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Data.ToJSON StopRun where
toJSON :: StopRun -> Value
toJSON StopRun' {Text
arn :: Text
$sel:arn:StopRun' :: StopRun -> Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[forall a. a -> Maybe a
Prelude.Just (Key
"arn" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
arn)]
)
instance Data.ToPath StopRun where
toPath :: StopRun -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Data.ToQuery StopRun where
toQuery :: StopRun -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data StopRunResponse = StopRunResponse'
{
StopRunResponse -> Maybe Run
run :: Prelude.Maybe Run,
StopRunResponse -> Int
httpStatus :: Prelude.Int
}
deriving (StopRunResponse -> StopRunResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: StopRunResponse -> StopRunResponse -> Bool
$c/= :: StopRunResponse -> StopRunResponse -> Bool
== :: StopRunResponse -> StopRunResponse -> Bool
$c== :: StopRunResponse -> StopRunResponse -> Bool
Prelude.Eq, ReadPrec [StopRunResponse]
ReadPrec StopRunResponse
Int -> ReadS StopRunResponse
ReadS [StopRunResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [StopRunResponse]
$creadListPrec :: ReadPrec [StopRunResponse]
readPrec :: ReadPrec StopRunResponse
$creadPrec :: ReadPrec StopRunResponse
readList :: ReadS [StopRunResponse]
$creadList :: ReadS [StopRunResponse]
readsPrec :: Int -> ReadS StopRunResponse
$creadsPrec :: Int -> ReadS StopRunResponse
Prelude.Read, Int -> StopRunResponse -> ShowS
[StopRunResponse] -> ShowS
StopRunResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [StopRunResponse] -> ShowS
$cshowList :: [StopRunResponse] -> ShowS
show :: StopRunResponse -> String
$cshow :: StopRunResponse -> String
showsPrec :: Int -> StopRunResponse -> ShowS
$cshowsPrec :: Int -> StopRunResponse -> ShowS
Prelude.Show, forall x. Rep StopRunResponse x -> StopRunResponse
forall x. StopRunResponse -> Rep StopRunResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep StopRunResponse x -> StopRunResponse
$cfrom :: forall x. StopRunResponse -> Rep StopRunResponse x
Prelude.Generic)
newStopRunResponse ::
Prelude.Int ->
StopRunResponse
newStopRunResponse :: Int -> StopRunResponse
newStopRunResponse Int
pHttpStatus_ =
StopRunResponse'
{ $sel:run:StopRunResponse' :: Maybe Run
run = forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:StopRunResponse' :: Int
httpStatus = Int
pHttpStatus_
}
stopRunResponse_run :: Lens.Lens' StopRunResponse (Prelude.Maybe Run)
stopRunResponse_run :: Lens' StopRunResponse (Maybe Run)
stopRunResponse_run = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StopRunResponse' {Maybe Run
run :: Maybe Run
$sel:run:StopRunResponse' :: StopRunResponse -> Maybe Run
run} -> Maybe Run
run) (\s :: StopRunResponse
s@StopRunResponse' {} Maybe Run
a -> StopRunResponse
s {$sel:run:StopRunResponse' :: Maybe Run
run = Maybe Run
a} :: StopRunResponse)
stopRunResponse_httpStatus :: Lens.Lens' StopRunResponse Prelude.Int
stopRunResponse_httpStatus :: Lens' StopRunResponse Int
stopRunResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StopRunResponse' {Int
httpStatus :: Int
$sel:httpStatus:StopRunResponse' :: StopRunResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: StopRunResponse
s@StopRunResponse' {} Int
a -> StopRunResponse
s {$sel:httpStatus:StopRunResponse' :: Int
httpStatus = Int
a} :: StopRunResponse)
instance Prelude.NFData StopRunResponse where
rnf :: StopRunResponse -> ()
rnf StopRunResponse' {Int
Maybe Run
httpStatus :: Int
run :: Maybe Run
$sel:httpStatus:StopRunResponse' :: StopRunResponse -> Int
$sel:run:StopRunResponse' :: StopRunResponse -> Maybe Run
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Run
run
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus