{-# 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.DeleteUpload
(
DeleteUpload (..),
newDeleteUpload,
deleteUpload_arn,
DeleteUploadResponse (..),
newDeleteUploadResponse,
deleteUploadResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import Amazonka.DeviceFarm.Types
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data DeleteUpload = DeleteUpload'
{
DeleteUpload -> Text
arn :: Prelude.Text
}
deriving (DeleteUpload -> DeleteUpload -> Bool
(DeleteUpload -> DeleteUpload -> Bool)
-> (DeleteUpload -> DeleteUpload -> Bool) -> Eq DeleteUpload
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteUpload -> DeleteUpload -> Bool
$c/= :: DeleteUpload -> DeleteUpload -> Bool
== :: DeleteUpload -> DeleteUpload -> Bool
$c== :: DeleteUpload -> DeleteUpload -> Bool
Prelude.Eq, ReadPrec [DeleteUpload]
ReadPrec DeleteUpload
Int -> ReadS DeleteUpload
ReadS [DeleteUpload]
(Int -> ReadS DeleteUpload)
-> ReadS [DeleteUpload]
-> ReadPrec DeleteUpload
-> ReadPrec [DeleteUpload]
-> Read DeleteUpload
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteUpload]
$creadListPrec :: ReadPrec [DeleteUpload]
readPrec :: ReadPrec DeleteUpload
$creadPrec :: ReadPrec DeleteUpload
readList :: ReadS [DeleteUpload]
$creadList :: ReadS [DeleteUpload]
readsPrec :: Int -> ReadS DeleteUpload
$creadsPrec :: Int -> ReadS DeleteUpload
Prelude.Read, Int -> DeleteUpload -> ShowS
[DeleteUpload] -> ShowS
DeleteUpload -> String
(Int -> DeleteUpload -> ShowS)
-> (DeleteUpload -> String)
-> ([DeleteUpload] -> ShowS)
-> Show DeleteUpload
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteUpload] -> ShowS
$cshowList :: [DeleteUpload] -> ShowS
show :: DeleteUpload -> String
$cshow :: DeleteUpload -> String
showsPrec :: Int -> DeleteUpload -> ShowS
$cshowsPrec :: Int -> DeleteUpload -> ShowS
Prelude.Show, (forall x. DeleteUpload -> Rep DeleteUpload x)
-> (forall x. Rep DeleteUpload x -> DeleteUpload)
-> Generic DeleteUpload
forall x. Rep DeleteUpload x -> DeleteUpload
forall x. DeleteUpload -> Rep DeleteUpload x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteUpload x -> DeleteUpload
$cfrom :: forall x. DeleteUpload -> Rep DeleteUpload x
Prelude.Generic)
newDeleteUpload ::
Prelude.Text ->
DeleteUpload
newDeleteUpload :: Text -> DeleteUpload
newDeleteUpload Text
pArn_ = DeleteUpload' :: Text -> DeleteUpload
DeleteUpload' {$sel:arn:DeleteUpload' :: Text
arn = Text
pArn_}
deleteUpload_arn :: Lens.Lens' DeleteUpload Prelude.Text
deleteUpload_arn :: (Text -> f Text) -> DeleteUpload -> f DeleteUpload
deleteUpload_arn = (DeleteUpload -> Text)
-> (DeleteUpload -> Text -> DeleteUpload)
-> Lens DeleteUpload DeleteUpload Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteUpload' {Text
arn :: Text
$sel:arn:DeleteUpload' :: DeleteUpload -> Text
arn} -> Text
arn) (\s :: DeleteUpload
s@DeleteUpload' {} Text
a -> DeleteUpload
s {$sel:arn:DeleteUpload' :: Text
arn = Text
a} :: DeleteUpload)
instance Core.AWSRequest DeleteUpload where
type AWSResponse DeleteUpload = DeleteUploadResponse
request :: DeleteUpload -> Request DeleteUpload
request = Service -> DeleteUpload -> Request DeleteUpload
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy DeleteUpload
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DeleteUpload)))
response =
(Int
-> ResponseHeaders
-> ()
-> Either String (AWSResponse DeleteUpload))
-> Logger
-> Service
-> Proxy DeleteUpload
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DeleteUpload)))
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 -> DeleteUploadResponse
DeleteUploadResponse'
(Int -> DeleteUploadResponse)
-> Either String Int -> Either String DeleteUploadResponse
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 DeleteUpload
instance Prelude.NFData DeleteUpload
instance Core.ToHeaders DeleteUpload where
toHeaders :: DeleteUpload -> ResponseHeaders
toHeaders =
ResponseHeaders -> DeleteUpload -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"X-Amz-Target"
HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"DeviceFarm_20150623.DeleteUpload" ::
Prelude.ByteString
),
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 DeleteUpload where
toJSON :: DeleteUpload -> Value
toJSON DeleteUpload' {Text
arn :: Text
$sel:arn:DeleteUpload' :: DeleteUpload -> Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"arn" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
arn)]
)
instance Core.ToPath DeleteUpload where
toPath :: DeleteUpload -> ByteString
toPath = ByteString -> DeleteUpload -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery DeleteUpload where
toQuery :: DeleteUpload -> QueryString
toQuery = QueryString -> DeleteUpload -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data DeleteUploadResponse = DeleteUploadResponse'
{
DeleteUploadResponse -> Int
httpStatus :: Prelude.Int
}
deriving (DeleteUploadResponse -> DeleteUploadResponse -> Bool
(DeleteUploadResponse -> DeleteUploadResponse -> Bool)
-> (DeleteUploadResponse -> DeleteUploadResponse -> Bool)
-> Eq DeleteUploadResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteUploadResponse -> DeleteUploadResponse -> Bool
$c/= :: DeleteUploadResponse -> DeleteUploadResponse -> Bool
== :: DeleteUploadResponse -> DeleteUploadResponse -> Bool
$c== :: DeleteUploadResponse -> DeleteUploadResponse -> Bool
Prelude.Eq, ReadPrec [DeleteUploadResponse]
ReadPrec DeleteUploadResponse
Int -> ReadS DeleteUploadResponse
ReadS [DeleteUploadResponse]
(Int -> ReadS DeleteUploadResponse)
-> ReadS [DeleteUploadResponse]
-> ReadPrec DeleteUploadResponse
-> ReadPrec [DeleteUploadResponse]
-> Read DeleteUploadResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteUploadResponse]
$creadListPrec :: ReadPrec [DeleteUploadResponse]
readPrec :: ReadPrec DeleteUploadResponse
$creadPrec :: ReadPrec DeleteUploadResponse
readList :: ReadS [DeleteUploadResponse]
$creadList :: ReadS [DeleteUploadResponse]
readsPrec :: Int -> ReadS DeleteUploadResponse
$creadsPrec :: Int -> ReadS DeleteUploadResponse
Prelude.Read, Int -> DeleteUploadResponse -> ShowS
[DeleteUploadResponse] -> ShowS
DeleteUploadResponse -> String
(Int -> DeleteUploadResponse -> ShowS)
-> (DeleteUploadResponse -> String)
-> ([DeleteUploadResponse] -> ShowS)
-> Show DeleteUploadResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteUploadResponse] -> ShowS
$cshowList :: [DeleteUploadResponse] -> ShowS
show :: DeleteUploadResponse -> String
$cshow :: DeleteUploadResponse -> String
showsPrec :: Int -> DeleteUploadResponse -> ShowS
$cshowsPrec :: Int -> DeleteUploadResponse -> ShowS
Prelude.Show, (forall x. DeleteUploadResponse -> Rep DeleteUploadResponse x)
-> (forall x. Rep DeleteUploadResponse x -> DeleteUploadResponse)
-> Generic DeleteUploadResponse
forall x. Rep DeleteUploadResponse x -> DeleteUploadResponse
forall x. DeleteUploadResponse -> Rep DeleteUploadResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteUploadResponse x -> DeleteUploadResponse
$cfrom :: forall x. DeleteUploadResponse -> Rep DeleteUploadResponse x
Prelude.Generic)
newDeleteUploadResponse ::
Prelude.Int ->
DeleteUploadResponse
newDeleteUploadResponse :: Int -> DeleteUploadResponse
newDeleteUploadResponse Int
pHttpStatus_ =
DeleteUploadResponse' :: Int -> DeleteUploadResponse
DeleteUploadResponse' {$sel:httpStatus:DeleteUploadResponse' :: Int
httpStatus = Int
pHttpStatus_}
deleteUploadResponse_httpStatus :: Lens.Lens' DeleteUploadResponse Prelude.Int
deleteUploadResponse_httpStatus :: (Int -> f Int) -> DeleteUploadResponse -> f DeleteUploadResponse
deleteUploadResponse_httpStatus = (DeleteUploadResponse -> Int)
-> (DeleteUploadResponse -> Int -> DeleteUploadResponse)
-> Lens DeleteUploadResponse DeleteUploadResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteUploadResponse' {Int
httpStatus :: Int
$sel:httpStatus:DeleteUploadResponse' :: DeleteUploadResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DeleteUploadResponse
s@DeleteUploadResponse' {} Int
a -> DeleteUploadResponse
s {$sel:httpStatus:DeleteUploadResponse' :: Int
httpStatus = Int
a} :: DeleteUploadResponse)
instance Prelude.NFData DeleteUploadResponse