{-# 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.RobOMaker.CancelWorldExportJob
(
CancelWorldExportJob (..),
newCancelWorldExportJob,
cancelWorldExportJob_job,
CancelWorldExportJobResponse (..),
newCancelWorldExportJobResponse,
cancelWorldExportJobResponse_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.RobOMaker.Types
data CancelWorldExportJob = CancelWorldExportJob'
{
CancelWorldExportJob -> Text
job :: Prelude.Text
}
deriving (CancelWorldExportJob -> CancelWorldExportJob -> Bool
(CancelWorldExportJob -> CancelWorldExportJob -> Bool)
-> (CancelWorldExportJob -> CancelWorldExportJob -> Bool)
-> Eq CancelWorldExportJob
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CancelWorldExportJob -> CancelWorldExportJob -> Bool
$c/= :: CancelWorldExportJob -> CancelWorldExportJob -> Bool
== :: CancelWorldExportJob -> CancelWorldExportJob -> Bool
$c== :: CancelWorldExportJob -> CancelWorldExportJob -> Bool
Prelude.Eq, ReadPrec [CancelWorldExportJob]
ReadPrec CancelWorldExportJob
Int -> ReadS CancelWorldExportJob
ReadS [CancelWorldExportJob]
(Int -> ReadS CancelWorldExportJob)
-> ReadS [CancelWorldExportJob]
-> ReadPrec CancelWorldExportJob
-> ReadPrec [CancelWorldExportJob]
-> Read CancelWorldExportJob
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CancelWorldExportJob]
$creadListPrec :: ReadPrec [CancelWorldExportJob]
readPrec :: ReadPrec CancelWorldExportJob
$creadPrec :: ReadPrec CancelWorldExportJob
readList :: ReadS [CancelWorldExportJob]
$creadList :: ReadS [CancelWorldExportJob]
readsPrec :: Int -> ReadS CancelWorldExportJob
$creadsPrec :: Int -> ReadS CancelWorldExportJob
Prelude.Read, Int -> CancelWorldExportJob -> ShowS
[CancelWorldExportJob] -> ShowS
CancelWorldExportJob -> String
(Int -> CancelWorldExportJob -> ShowS)
-> (CancelWorldExportJob -> String)
-> ([CancelWorldExportJob] -> ShowS)
-> Show CancelWorldExportJob
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CancelWorldExportJob] -> ShowS
$cshowList :: [CancelWorldExportJob] -> ShowS
show :: CancelWorldExportJob -> String
$cshow :: CancelWorldExportJob -> String
showsPrec :: Int -> CancelWorldExportJob -> ShowS
$cshowsPrec :: Int -> CancelWorldExportJob -> ShowS
Prelude.Show, (forall x. CancelWorldExportJob -> Rep CancelWorldExportJob x)
-> (forall x. Rep CancelWorldExportJob x -> CancelWorldExportJob)
-> Generic CancelWorldExportJob
forall x. Rep CancelWorldExportJob x -> CancelWorldExportJob
forall x. CancelWorldExportJob -> Rep CancelWorldExportJob x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CancelWorldExportJob x -> CancelWorldExportJob
$cfrom :: forall x. CancelWorldExportJob -> Rep CancelWorldExportJob x
Prelude.Generic)
newCancelWorldExportJob ::
Prelude.Text ->
CancelWorldExportJob
newCancelWorldExportJob :: Text -> CancelWorldExportJob
newCancelWorldExportJob Text
pJob_ =
CancelWorldExportJob' :: Text -> CancelWorldExportJob
CancelWorldExportJob' {$sel:job:CancelWorldExportJob' :: Text
job = Text
pJob_}
cancelWorldExportJob_job :: Lens.Lens' CancelWorldExportJob Prelude.Text
cancelWorldExportJob_job :: (Text -> f Text) -> CancelWorldExportJob -> f CancelWorldExportJob
cancelWorldExportJob_job = (CancelWorldExportJob -> Text)
-> (CancelWorldExportJob -> Text -> CancelWorldExportJob)
-> Lens CancelWorldExportJob CancelWorldExportJob Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CancelWorldExportJob' {Text
job :: Text
$sel:job:CancelWorldExportJob' :: CancelWorldExportJob -> Text
job} -> Text
job) (\s :: CancelWorldExportJob
s@CancelWorldExportJob' {} Text
a -> CancelWorldExportJob
s {$sel:job:CancelWorldExportJob' :: Text
job = Text
a} :: CancelWorldExportJob)
instance Core.AWSRequest CancelWorldExportJob where
type
AWSResponse CancelWorldExportJob =
CancelWorldExportJobResponse
request :: CancelWorldExportJob -> Request CancelWorldExportJob
request = Service -> CancelWorldExportJob -> Request CancelWorldExportJob
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy CancelWorldExportJob
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse CancelWorldExportJob)))
response =
(Int
-> ResponseHeaders
-> ()
-> Either String (AWSResponse CancelWorldExportJob))
-> Logger
-> Service
-> Proxy CancelWorldExportJob
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse CancelWorldExportJob)))
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 -> CancelWorldExportJobResponse
CancelWorldExportJobResponse'
(Int -> CancelWorldExportJobResponse)
-> Either String Int -> Either String CancelWorldExportJobResponse
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 CancelWorldExportJob
instance Prelude.NFData CancelWorldExportJob
instance Core.ToHeaders CancelWorldExportJob where
toHeaders :: CancelWorldExportJob -> ResponseHeaders
toHeaders =
ResponseHeaders -> CancelWorldExportJob -> 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 CancelWorldExportJob where
toJSON :: CancelWorldExportJob -> Value
toJSON CancelWorldExportJob' {Text
job :: Text
$sel:job:CancelWorldExportJob' :: CancelWorldExportJob -> 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
"job" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
job)]
)
instance Core.ToPath CancelWorldExportJob where
toPath :: CancelWorldExportJob -> ByteString
toPath = ByteString -> CancelWorldExportJob -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/cancelWorldExportJob"
instance Core.ToQuery CancelWorldExportJob where
toQuery :: CancelWorldExportJob -> QueryString
toQuery = QueryString -> CancelWorldExportJob -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data CancelWorldExportJobResponse = CancelWorldExportJobResponse'
{
CancelWorldExportJobResponse -> Int
httpStatus :: Prelude.Int
}
deriving (CancelWorldExportJobResponse
-> CancelWorldExportJobResponse -> Bool
(CancelWorldExportJobResponse
-> CancelWorldExportJobResponse -> Bool)
-> (CancelWorldExportJobResponse
-> CancelWorldExportJobResponse -> Bool)
-> Eq CancelWorldExportJobResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CancelWorldExportJobResponse
-> CancelWorldExportJobResponse -> Bool
$c/= :: CancelWorldExportJobResponse
-> CancelWorldExportJobResponse -> Bool
== :: CancelWorldExportJobResponse
-> CancelWorldExportJobResponse -> Bool
$c== :: CancelWorldExportJobResponse
-> CancelWorldExportJobResponse -> Bool
Prelude.Eq, ReadPrec [CancelWorldExportJobResponse]
ReadPrec CancelWorldExportJobResponse
Int -> ReadS CancelWorldExportJobResponse
ReadS [CancelWorldExportJobResponse]
(Int -> ReadS CancelWorldExportJobResponse)
-> ReadS [CancelWorldExportJobResponse]
-> ReadPrec CancelWorldExportJobResponse
-> ReadPrec [CancelWorldExportJobResponse]
-> Read CancelWorldExportJobResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CancelWorldExportJobResponse]
$creadListPrec :: ReadPrec [CancelWorldExportJobResponse]
readPrec :: ReadPrec CancelWorldExportJobResponse
$creadPrec :: ReadPrec CancelWorldExportJobResponse
readList :: ReadS [CancelWorldExportJobResponse]
$creadList :: ReadS [CancelWorldExportJobResponse]
readsPrec :: Int -> ReadS CancelWorldExportJobResponse
$creadsPrec :: Int -> ReadS CancelWorldExportJobResponse
Prelude.Read, Int -> CancelWorldExportJobResponse -> ShowS
[CancelWorldExportJobResponse] -> ShowS
CancelWorldExportJobResponse -> String
(Int -> CancelWorldExportJobResponse -> ShowS)
-> (CancelWorldExportJobResponse -> String)
-> ([CancelWorldExportJobResponse] -> ShowS)
-> Show CancelWorldExportJobResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CancelWorldExportJobResponse] -> ShowS
$cshowList :: [CancelWorldExportJobResponse] -> ShowS
show :: CancelWorldExportJobResponse -> String
$cshow :: CancelWorldExportJobResponse -> String
showsPrec :: Int -> CancelWorldExportJobResponse -> ShowS
$cshowsPrec :: Int -> CancelWorldExportJobResponse -> ShowS
Prelude.Show, (forall x.
CancelWorldExportJobResponse -> Rep CancelWorldExportJobResponse x)
-> (forall x.
Rep CancelWorldExportJobResponse x -> CancelWorldExportJobResponse)
-> Generic CancelWorldExportJobResponse
forall x.
Rep CancelWorldExportJobResponse x -> CancelWorldExportJobResponse
forall x.
CancelWorldExportJobResponse -> Rep CancelWorldExportJobResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CancelWorldExportJobResponse x -> CancelWorldExportJobResponse
$cfrom :: forall x.
CancelWorldExportJobResponse -> Rep CancelWorldExportJobResponse x
Prelude.Generic)
newCancelWorldExportJobResponse ::
Prelude.Int ->
CancelWorldExportJobResponse
newCancelWorldExportJobResponse :: Int -> CancelWorldExportJobResponse
newCancelWorldExportJobResponse Int
pHttpStatus_ =
CancelWorldExportJobResponse' :: Int -> CancelWorldExportJobResponse
CancelWorldExportJobResponse'
{ $sel:httpStatus:CancelWorldExportJobResponse' :: Int
httpStatus =
Int
pHttpStatus_
}
cancelWorldExportJobResponse_httpStatus :: Lens.Lens' CancelWorldExportJobResponse Prelude.Int
cancelWorldExportJobResponse_httpStatus :: (Int -> f Int)
-> CancelWorldExportJobResponse -> f CancelWorldExportJobResponse
cancelWorldExportJobResponse_httpStatus = (CancelWorldExportJobResponse -> Int)
-> (CancelWorldExportJobResponse
-> Int -> CancelWorldExportJobResponse)
-> Lens
CancelWorldExportJobResponse CancelWorldExportJobResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CancelWorldExportJobResponse' {Int
httpStatus :: Int
$sel:httpStatus:CancelWorldExportJobResponse' :: CancelWorldExportJobResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: CancelWorldExportJobResponse
s@CancelWorldExportJobResponse' {} Int
a -> CancelWorldExportJobResponse
s {$sel:httpStatus:CancelWorldExportJobResponse' :: Int
httpStatus = Int
a} :: CancelWorldExportJobResponse)
instance Prelude.NFData CancelWorldExportJobResponse