{-# 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 #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.Omics.CancelAnnotationImportJob
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Cancels an annotation import job.
module Amazonka.Omics.CancelAnnotationImportJob
  ( -- * Creating a Request
    CancelAnnotationImportJob (..),
    newCancelAnnotationImportJob,

    -- * Request Lenses
    cancelAnnotationImportJob_jobId,

    -- * Destructuring the Response
    CancelAnnotationImportJobResponse (..),
    newCancelAnnotationImportJobResponse,

    -- * Response Lenses
    cancelAnnotationImportJobResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.Omics.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | /See:/ 'newCancelAnnotationImportJob' smart constructor.
data CancelAnnotationImportJob = CancelAnnotationImportJob'
  { -- | The job\'s ID.
    CancelAnnotationImportJob -> Text
jobId :: Prelude.Text
  }
  deriving (CancelAnnotationImportJob -> CancelAnnotationImportJob -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CancelAnnotationImportJob -> CancelAnnotationImportJob -> Bool
$c/= :: CancelAnnotationImportJob -> CancelAnnotationImportJob -> Bool
== :: CancelAnnotationImportJob -> CancelAnnotationImportJob -> Bool
$c== :: CancelAnnotationImportJob -> CancelAnnotationImportJob -> Bool
Prelude.Eq, ReadPrec [CancelAnnotationImportJob]
ReadPrec CancelAnnotationImportJob
Int -> ReadS CancelAnnotationImportJob
ReadS [CancelAnnotationImportJob]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CancelAnnotationImportJob]
$creadListPrec :: ReadPrec [CancelAnnotationImportJob]
readPrec :: ReadPrec CancelAnnotationImportJob
$creadPrec :: ReadPrec CancelAnnotationImportJob
readList :: ReadS [CancelAnnotationImportJob]
$creadList :: ReadS [CancelAnnotationImportJob]
readsPrec :: Int -> ReadS CancelAnnotationImportJob
$creadsPrec :: Int -> ReadS CancelAnnotationImportJob
Prelude.Read, Int -> CancelAnnotationImportJob -> ShowS
[CancelAnnotationImportJob] -> ShowS
CancelAnnotationImportJob -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CancelAnnotationImportJob] -> ShowS
$cshowList :: [CancelAnnotationImportJob] -> ShowS
show :: CancelAnnotationImportJob -> String
$cshow :: CancelAnnotationImportJob -> String
showsPrec :: Int -> CancelAnnotationImportJob -> ShowS
$cshowsPrec :: Int -> CancelAnnotationImportJob -> ShowS
Prelude.Show, forall x.
Rep CancelAnnotationImportJob x -> CancelAnnotationImportJob
forall x.
CancelAnnotationImportJob -> Rep CancelAnnotationImportJob x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CancelAnnotationImportJob x -> CancelAnnotationImportJob
$cfrom :: forall x.
CancelAnnotationImportJob -> Rep CancelAnnotationImportJob x
Prelude.Generic)

-- |
-- Create a value of 'CancelAnnotationImportJob' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'jobId', 'cancelAnnotationImportJob_jobId' - The job\'s ID.
newCancelAnnotationImportJob ::
  -- | 'jobId'
  Prelude.Text ->
  CancelAnnotationImportJob
newCancelAnnotationImportJob :: Text -> CancelAnnotationImportJob
newCancelAnnotationImportJob Text
pJobId_ =
  CancelAnnotationImportJob' {$sel:jobId:CancelAnnotationImportJob' :: Text
jobId = Text
pJobId_}

-- | The job\'s ID.
cancelAnnotationImportJob_jobId :: Lens.Lens' CancelAnnotationImportJob Prelude.Text
cancelAnnotationImportJob_jobId :: Lens' CancelAnnotationImportJob Text
cancelAnnotationImportJob_jobId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CancelAnnotationImportJob' {Text
jobId :: Text
$sel:jobId:CancelAnnotationImportJob' :: CancelAnnotationImportJob -> Text
jobId} -> Text
jobId) (\s :: CancelAnnotationImportJob
s@CancelAnnotationImportJob' {} Text
a -> CancelAnnotationImportJob
s {$sel:jobId:CancelAnnotationImportJob' :: Text
jobId = Text
a} :: CancelAnnotationImportJob)

instance Core.AWSRequest CancelAnnotationImportJob where
  type
    AWSResponse CancelAnnotationImportJob =
      CancelAnnotationImportJobResponse
  request :: (Service -> Service)
-> CancelAnnotationImportJob -> Request CancelAnnotationImportJob
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 CancelAnnotationImportJob
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse CancelAnnotationImportJob)))
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 -> CancelAnnotationImportJobResponse
CancelAnnotationImportJobResponse'
            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 CancelAnnotationImportJob where
  hashWithSalt :: Int -> CancelAnnotationImportJob -> Int
hashWithSalt Int
_salt CancelAnnotationImportJob' {Text
jobId :: Text
$sel:jobId:CancelAnnotationImportJob' :: CancelAnnotationImportJob -> Text
..} =
    Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
jobId

instance Prelude.NFData CancelAnnotationImportJob where
  rnf :: CancelAnnotationImportJob -> ()
rnf CancelAnnotationImportJob' {Text
jobId :: Text
$sel:jobId:CancelAnnotationImportJob' :: CancelAnnotationImportJob -> Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Text
jobId

instance Data.ToHeaders CancelAnnotationImportJob where
  toHeaders :: CancelAnnotationImportJob -> 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 CancelAnnotationImportJob where
  toPath :: CancelAnnotationImportJob -> ByteString
toPath CancelAnnotationImportJob' {Text
jobId :: Text
$sel:jobId:CancelAnnotationImportJob' :: CancelAnnotationImportJob -> Text
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ByteString
"/import/annotation/", forall a. ToByteString a => a -> ByteString
Data.toBS Text
jobId]

instance Data.ToQuery CancelAnnotationImportJob where
  toQuery :: CancelAnnotationImportJob -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty

-- | /See:/ 'newCancelAnnotationImportJobResponse' smart constructor.
data CancelAnnotationImportJobResponse = CancelAnnotationImportJobResponse'
  { -- | The response's http status code.
    CancelAnnotationImportJobResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (CancelAnnotationImportJobResponse
-> CancelAnnotationImportJobResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CancelAnnotationImportJobResponse
-> CancelAnnotationImportJobResponse -> Bool
$c/= :: CancelAnnotationImportJobResponse
-> CancelAnnotationImportJobResponse -> Bool
== :: CancelAnnotationImportJobResponse
-> CancelAnnotationImportJobResponse -> Bool
$c== :: CancelAnnotationImportJobResponse
-> CancelAnnotationImportJobResponse -> Bool
Prelude.Eq, ReadPrec [CancelAnnotationImportJobResponse]
ReadPrec CancelAnnotationImportJobResponse
Int -> ReadS CancelAnnotationImportJobResponse
ReadS [CancelAnnotationImportJobResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CancelAnnotationImportJobResponse]
$creadListPrec :: ReadPrec [CancelAnnotationImportJobResponse]
readPrec :: ReadPrec CancelAnnotationImportJobResponse
$creadPrec :: ReadPrec CancelAnnotationImportJobResponse
readList :: ReadS [CancelAnnotationImportJobResponse]
$creadList :: ReadS [CancelAnnotationImportJobResponse]
readsPrec :: Int -> ReadS CancelAnnotationImportJobResponse
$creadsPrec :: Int -> ReadS CancelAnnotationImportJobResponse
Prelude.Read, Int -> CancelAnnotationImportJobResponse -> ShowS
[CancelAnnotationImportJobResponse] -> ShowS
CancelAnnotationImportJobResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CancelAnnotationImportJobResponse] -> ShowS
$cshowList :: [CancelAnnotationImportJobResponse] -> ShowS
show :: CancelAnnotationImportJobResponse -> String
$cshow :: CancelAnnotationImportJobResponse -> String
showsPrec :: Int -> CancelAnnotationImportJobResponse -> ShowS
$cshowsPrec :: Int -> CancelAnnotationImportJobResponse -> ShowS
Prelude.Show, forall x.
Rep CancelAnnotationImportJobResponse x
-> CancelAnnotationImportJobResponse
forall x.
CancelAnnotationImportJobResponse
-> Rep CancelAnnotationImportJobResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CancelAnnotationImportJobResponse x
-> CancelAnnotationImportJobResponse
$cfrom :: forall x.
CancelAnnotationImportJobResponse
-> Rep CancelAnnotationImportJobResponse x
Prelude.Generic)

-- |
-- Create a value of 'CancelAnnotationImportJobResponse' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'httpStatus', 'cancelAnnotationImportJobResponse_httpStatus' - The response's http status code.
newCancelAnnotationImportJobResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  CancelAnnotationImportJobResponse
newCancelAnnotationImportJobResponse :: Int -> CancelAnnotationImportJobResponse
newCancelAnnotationImportJobResponse Int
pHttpStatus_ =
  CancelAnnotationImportJobResponse'
    { $sel:httpStatus:CancelAnnotationImportJobResponse' :: Int
httpStatus =
        Int
pHttpStatus_
    }

-- | The response's http status code.
cancelAnnotationImportJobResponse_httpStatus :: Lens.Lens' CancelAnnotationImportJobResponse Prelude.Int
cancelAnnotationImportJobResponse_httpStatus :: Lens' CancelAnnotationImportJobResponse Int
cancelAnnotationImportJobResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CancelAnnotationImportJobResponse' {Int
httpStatus :: Int
$sel:httpStatus:CancelAnnotationImportJobResponse' :: CancelAnnotationImportJobResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: CancelAnnotationImportJobResponse
s@CancelAnnotationImportJobResponse' {} Int
a -> CancelAnnotationImportJobResponse
s {$sel:httpStatus:CancelAnnotationImportJobResponse' :: Int
httpStatus = Int
a} :: CancelAnnotationImportJobResponse)

instance
  Prelude.NFData
    CancelAnnotationImportJobResponse
  where
  rnf :: CancelAnnotationImportJobResponse -> ()
rnf CancelAnnotationImportJobResponse' {Int
httpStatus :: Int
$sel:httpStatus:CancelAnnotationImportJobResponse' :: CancelAnnotationImportJobResponse -> Int
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus