{-# 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.DeleteRun
(
DeleteRun (..),
newDeleteRun,
deleteRun_arn,
DeleteRunResponse (..),
newDeleteRunResponse,
deleteRunResponse_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 DeleteRun = DeleteRun'
{
DeleteRun -> Text
arn :: Prelude.Text
}
deriving (DeleteRun -> DeleteRun -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteRun -> DeleteRun -> Bool
$c/= :: DeleteRun -> DeleteRun -> Bool
== :: DeleteRun -> DeleteRun -> Bool
$c== :: DeleteRun -> DeleteRun -> Bool
Prelude.Eq, ReadPrec [DeleteRun]
ReadPrec DeleteRun
Int -> ReadS DeleteRun
ReadS [DeleteRun]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteRun]
$creadListPrec :: ReadPrec [DeleteRun]
readPrec :: ReadPrec DeleteRun
$creadPrec :: ReadPrec DeleteRun
readList :: ReadS [DeleteRun]
$creadList :: ReadS [DeleteRun]
readsPrec :: Int -> ReadS DeleteRun
$creadsPrec :: Int -> ReadS DeleteRun
Prelude.Read, Int -> DeleteRun -> ShowS
[DeleteRun] -> ShowS
DeleteRun -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteRun] -> ShowS
$cshowList :: [DeleteRun] -> ShowS
show :: DeleteRun -> String
$cshow :: DeleteRun -> String
showsPrec :: Int -> DeleteRun -> ShowS
$cshowsPrec :: Int -> DeleteRun -> ShowS
Prelude.Show, forall x. Rep DeleteRun x -> DeleteRun
forall x. DeleteRun -> Rep DeleteRun x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteRun x -> DeleteRun
$cfrom :: forall x. DeleteRun -> Rep DeleteRun x
Prelude.Generic)
newDeleteRun ::
Prelude.Text ->
DeleteRun
newDeleteRun :: Text -> DeleteRun
newDeleteRun Text
pArn_ = DeleteRun' {$sel:arn:DeleteRun' :: Text
arn = Text
pArn_}
deleteRun_arn :: Lens.Lens' DeleteRun Prelude.Text
deleteRun_arn :: Lens' DeleteRun Text
deleteRun_arn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteRun' {Text
arn :: Text
$sel:arn:DeleteRun' :: DeleteRun -> Text
arn} -> Text
arn) (\s :: DeleteRun
s@DeleteRun' {} Text
a -> DeleteRun
s {$sel:arn:DeleteRun' :: Text
arn = Text
a} :: DeleteRun)
instance Core.AWSRequest DeleteRun where
type AWSResponse DeleteRun = DeleteRunResponse
request :: (Service -> Service) -> DeleteRun -> Request DeleteRun
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 DeleteRun
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DeleteRun)))
response =
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> () -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveEmpty
( \Int
s ResponseHeaders
h ()
x ->
Int -> DeleteRunResponse
DeleteRunResponse'
forall (f :: * -> *) a b. Functor 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 DeleteRun where
hashWithSalt :: Int -> DeleteRun -> Int
hashWithSalt Int
_salt DeleteRun' {Text
arn :: Text
$sel:arn:DeleteRun' :: DeleteRun -> Text
..} =
Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
arn
instance Prelude.NFData DeleteRun where
rnf :: DeleteRun -> ()
rnf DeleteRun' {Text
arn :: Text
$sel:arn:DeleteRun' :: DeleteRun -> Text
..} = forall a. NFData a => a -> ()
Prelude.rnf Text
arn
instance Data.ToHeaders DeleteRun where
toHeaders :: DeleteRun -> 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.DeleteRun" ::
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 DeleteRun where
toJSON :: DeleteRun -> Value
toJSON DeleteRun' {Text
arn :: Text
$sel:arn:DeleteRun' :: DeleteRun -> 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 DeleteRun where
toPath :: DeleteRun -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Data.ToQuery DeleteRun where
toQuery :: DeleteRun -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data DeleteRunResponse = DeleteRunResponse'
{
DeleteRunResponse -> Int
httpStatus :: Prelude.Int
}
deriving (DeleteRunResponse -> DeleteRunResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteRunResponse -> DeleteRunResponse -> Bool
$c/= :: DeleteRunResponse -> DeleteRunResponse -> Bool
== :: DeleteRunResponse -> DeleteRunResponse -> Bool
$c== :: DeleteRunResponse -> DeleteRunResponse -> Bool
Prelude.Eq, ReadPrec [DeleteRunResponse]
ReadPrec DeleteRunResponse
Int -> ReadS DeleteRunResponse
ReadS [DeleteRunResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteRunResponse]
$creadListPrec :: ReadPrec [DeleteRunResponse]
readPrec :: ReadPrec DeleteRunResponse
$creadPrec :: ReadPrec DeleteRunResponse
readList :: ReadS [DeleteRunResponse]
$creadList :: ReadS [DeleteRunResponse]
readsPrec :: Int -> ReadS DeleteRunResponse
$creadsPrec :: Int -> ReadS DeleteRunResponse
Prelude.Read, Int -> DeleteRunResponse -> ShowS
[DeleteRunResponse] -> ShowS
DeleteRunResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteRunResponse] -> ShowS
$cshowList :: [DeleteRunResponse] -> ShowS
show :: DeleteRunResponse -> String
$cshow :: DeleteRunResponse -> String
showsPrec :: Int -> DeleteRunResponse -> ShowS
$cshowsPrec :: Int -> DeleteRunResponse -> ShowS
Prelude.Show, forall x. Rep DeleteRunResponse x -> DeleteRunResponse
forall x. DeleteRunResponse -> Rep DeleteRunResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteRunResponse x -> DeleteRunResponse
$cfrom :: forall x. DeleteRunResponse -> Rep DeleteRunResponse x
Prelude.Generic)
newDeleteRunResponse ::
Prelude.Int ->
DeleteRunResponse
newDeleteRunResponse :: Int -> DeleteRunResponse
newDeleteRunResponse Int
pHttpStatus_ =
DeleteRunResponse' {$sel:httpStatus:DeleteRunResponse' :: Int
httpStatus = Int
pHttpStatus_}
deleteRunResponse_httpStatus :: Lens.Lens' DeleteRunResponse Prelude.Int
deleteRunResponse_httpStatus :: Lens' DeleteRunResponse Int
deleteRunResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteRunResponse' {Int
httpStatus :: Int
$sel:httpStatus:DeleteRunResponse' :: DeleteRunResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DeleteRunResponse
s@DeleteRunResponse' {} Int
a -> DeleteRunResponse
s {$sel:httpStatus:DeleteRunResponse' :: Int
httpStatus = Int
a} :: DeleteRunResponse)
instance Prelude.NFData DeleteRunResponse where
rnf :: DeleteRunResponse -> ()
rnf DeleteRunResponse' {Int
httpStatus :: Int
$sel:httpStatus:DeleteRunResponse' :: DeleteRunResponse -> Int
..} = forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus