{-# 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.FraudDetector.DeleteBatchPredictionJob
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Deletes a batch prediction job.
module Amazonka.FraudDetector.DeleteBatchPredictionJob
  ( -- * Creating a Request
    DeleteBatchPredictionJob (..),
    newDeleteBatchPredictionJob,

    -- * Request Lenses
    deleteBatchPredictionJob_jobId,

    -- * Destructuring the Response
    DeleteBatchPredictionJobResponse (..),
    newDeleteBatchPredictionJobResponse,

    -- * Response Lenses
    deleteBatchPredictionJobResponse_httpStatus,
  )
where

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

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

-- |
-- Create a value of 'DeleteBatchPredictionJob' 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', 'deleteBatchPredictionJob_jobId' - The ID of the batch prediction job to delete.
newDeleteBatchPredictionJob ::
  -- | 'jobId'
  Prelude.Text ->
  DeleteBatchPredictionJob
newDeleteBatchPredictionJob :: Text -> DeleteBatchPredictionJob
newDeleteBatchPredictionJob Text
pJobId_ =
  DeleteBatchPredictionJob' {$sel:jobId:DeleteBatchPredictionJob' :: Text
jobId = Text
pJobId_}

-- | The ID of the batch prediction job to delete.
deleteBatchPredictionJob_jobId :: Lens.Lens' DeleteBatchPredictionJob Prelude.Text
deleteBatchPredictionJob_jobId :: Lens' DeleteBatchPredictionJob Text
deleteBatchPredictionJob_jobId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteBatchPredictionJob' {Text
jobId :: Text
$sel:jobId:DeleteBatchPredictionJob' :: DeleteBatchPredictionJob -> Text
jobId} -> Text
jobId) (\s :: DeleteBatchPredictionJob
s@DeleteBatchPredictionJob' {} Text
a -> DeleteBatchPredictionJob
s {$sel:jobId:DeleteBatchPredictionJob' :: Text
jobId = Text
a} :: DeleteBatchPredictionJob)

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

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

instance Data.ToHeaders DeleteBatchPredictionJob where
  toHeaders :: DeleteBatchPredictionJob -> 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
"AWSHawksNestServiceFacade.DeleteBatchPredictionJob" ::
                          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 DeleteBatchPredictionJob where
  toJSON :: DeleteBatchPredictionJob -> Value
toJSON DeleteBatchPredictionJob' {Text
jobId :: Text
$sel:jobId:DeleteBatchPredictionJob' :: DeleteBatchPredictionJob -> Text
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [forall a. a -> Maybe a
Prelude.Just (Key
"jobId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
jobId)]
      )

instance Data.ToPath DeleteBatchPredictionJob where
  toPath :: DeleteBatchPredictionJob -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"

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

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

-- |
-- Create a value of 'DeleteBatchPredictionJobResponse' 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', 'deleteBatchPredictionJobResponse_httpStatus' - The response's http status code.
newDeleteBatchPredictionJobResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  DeleteBatchPredictionJobResponse
newDeleteBatchPredictionJobResponse :: Int -> DeleteBatchPredictionJobResponse
newDeleteBatchPredictionJobResponse Int
pHttpStatus_ =
  DeleteBatchPredictionJobResponse'
    { $sel:httpStatus:DeleteBatchPredictionJobResponse' :: Int
httpStatus =
        Int
pHttpStatus_
    }

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

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