{-# 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-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- 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 Amazonka.FraudDetector.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

-- | /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
(DeleteBatchPredictionJob -> DeleteBatchPredictionJob -> Bool)
-> (DeleteBatchPredictionJob -> DeleteBatchPredictionJob -> Bool)
-> Eq DeleteBatchPredictionJob
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]
(Int -> ReadS DeleteBatchPredictionJob)
-> ReadS [DeleteBatchPredictionJob]
-> ReadPrec DeleteBatchPredictionJob
-> ReadPrec [DeleteBatchPredictionJob]
-> Read 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
(Int -> DeleteBatchPredictionJob -> ShowS)
-> (DeleteBatchPredictionJob -> String)
-> ([DeleteBatchPredictionJob] -> ShowS)
-> Show DeleteBatchPredictionJob
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.
 DeleteBatchPredictionJob -> Rep DeleteBatchPredictionJob x)
-> (forall x.
    Rep DeleteBatchPredictionJob x -> DeleteBatchPredictionJob)
-> Generic DeleteBatchPredictionJob
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' :: Text -> DeleteBatchPredictionJob
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 :: (Text -> f Text)
-> DeleteBatchPredictionJob -> f DeleteBatchPredictionJob
deleteBatchPredictionJob_jobId = (DeleteBatchPredictionJob -> Text)
-> (DeleteBatchPredictionJob -> Text -> DeleteBatchPredictionJob)
-> Lens DeleteBatchPredictionJob DeleteBatchPredictionJob Text Text
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 :: DeleteBatchPredictionJob -> Request DeleteBatchPredictionJob
request = Service
-> DeleteBatchPredictionJob -> Request DeleteBatchPredictionJob
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy DeleteBatchPredictionJob
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DeleteBatchPredictionJob)))
response =
    (Int
 -> ResponseHeaders
 -> ()
 -> Either String (AWSResponse DeleteBatchPredictionJob))
-> Logger
-> Service
-> Proxy DeleteBatchPredictionJob
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DeleteBatchPredictionJob)))
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 -> DeleteBatchPredictionJobResponse
DeleteBatchPredictionJobResponse'
            (Int -> DeleteBatchPredictionJobResponse)
-> Either String Int
-> Either String DeleteBatchPredictionJobResponse
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 DeleteBatchPredictionJob

instance Prelude.NFData DeleteBatchPredictionJob

instance Core.ToHeaders DeleteBatchPredictionJob where
  toHeaders :: DeleteBatchPredictionJob -> ResponseHeaders
toHeaders =
    ResponseHeaders -> DeleteBatchPredictionJob -> 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
"AWSHawksNestServiceFacade.DeleteBatchPredictionJob" ::
                          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 DeleteBatchPredictionJob where
  toJSON :: DeleteBatchPredictionJob -> Value
toJSON DeleteBatchPredictionJob' {Text
jobId :: Text
$sel:jobId:DeleteBatchPredictionJob' :: DeleteBatchPredictionJob -> 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
"jobId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
jobId)]
      )

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

instance Core.ToQuery DeleteBatchPredictionJob where
  toQuery :: DeleteBatchPredictionJob -> QueryString
toQuery = QueryString -> DeleteBatchPredictionJob -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
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
(DeleteBatchPredictionJobResponse
 -> DeleteBatchPredictionJobResponse -> Bool)
-> (DeleteBatchPredictionJobResponse
    -> DeleteBatchPredictionJobResponse -> Bool)
-> Eq DeleteBatchPredictionJobResponse
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]
(Int -> ReadS DeleteBatchPredictionJobResponse)
-> ReadS [DeleteBatchPredictionJobResponse]
-> ReadPrec DeleteBatchPredictionJobResponse
-> ReadPrec [DeleteBatchPredictionJobResponse]
-> Read 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
(Int -> DeleteBatchPredictionJobResponse -> ShowS)
-> (DeleteBatchPredictionJobResponse -> String)
-> ([DeleteBatchPredictionJobResponse] -> ShowS)
-> Show DeleteBatchPredictionJobResponse
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.
 DeleteBatchPredictionJobResponse
 -> Rep DeleteBatchPredictionJobResponse x)
-> (forall x.
    Rep DeleteBatchPredictionJobResponse x
    -> DeleteBatchPredictionJobResponse)
-> Generic DeleteBatchPredictionJobResponse
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' :: Int -> DeleteBatchPredictionJobResponse
DeleteBatchPredictionJobResponse'
    { $sel:httpStatus:DeleteBatchPredictionJobResponse' :: Int
httpStatus =
        Int
pHttpStatus_
    }

-- | The response's http status code.
deleteBatchPredictionJobResponse_httpStatus :: Lens.Lens' DeleteBatchPredictionJobResponse Prelude.Int
deleteBatchPredictionJobResponse_httpStatus :: (Int -> f Int)
-> DeleteBatchPredictionJobResponse
-> f DeleteBatchPredictionJobResponse
deleteBatchPredictionJobResponse_httpStatus = (DeleteBatchPredictionJobResponse -> Int)
-> (DeleteBatchPredictionJobResponse
    -> Int -> DeleteBatchPredictionJobResponse)
-> Lens
     DeleteBatchPredictionJobResponse
     DeleteBatchPredictionJobResponse
     Int
     Int
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