{-# 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.Forecast.DeleteForecastExportJob
-- 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 forecast export job created using the CreateForecastExportJob
-- operation. You can delete only export jobs that have a status of
-- @ACTIVE@ or @CREATE_FAILED@. To get the status, use the
-- DescribeForecastExportJob operation.
module Amazonka.Forecast.DeleteForecastExportJob
  ( -- * Creating a Request
    DeleteForecastExportJob (..),
    newDeleteForecastExportJob,

    -- * Request Lenses
    deleteForecastExportJob_forecastExportJobArn,

    -- * Destructuring the Response
    DeleteForecastExportJobResponse (..),
    newDeleteForecastExportJobResponse,
  )
where

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

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

-- |
-- Create a value of 'DeleteForecastExportJob' 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:
--
-- 'forecastExportJobArn', 'deleteForecastExportJob_forecastExportJobArn' - The Amazon Resource Name (ARN) of the forecast export job to delete.
newDeleteForecastExportJob ::
  -- | 'forecastExportJobArn'
  Prelude.Text ->
  DeleteForecastExportJob
newDeleteForecastExportJob :: Text -> DeleteForecastExportJob
newDeleteForecastExportJob Text
pForecastExportJobArn_ =
  DeleteForecastExportJob'
    { $sel:forecastExportJobArn:DeleteForecastExportJob' :: Text
forecastExportJobArn =
        Text
pForecastExportJobArn_
    }

-- | The Amazon Resource Name (ARN) of the forecast export job to delete.
deleteForecastExportJob_forecastExportJobArn :: Lens.Lens' DeleteForecastExportJob Prelude.Text
deleteForecastExportJob_forecastExportJobArn :: Lens' DeleteForecastExportJob Text
deleteForecastExportJob_forecastExportJobArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteForecastExportJob' {Text
forecastExportJobArn :: Text
$sel:forecastExportJobArn:DeleteForecastExportJob' :: DeleteForecastExportJob -> Text
forecastExportJobArn} -> Text
forecastExportJobArn) (\s :: DeleteForecastExportJob
s@DeleteForecastExportJob' {} Text
a -> DeleteForecastExportJob
s {$sel:forecastExportJobArn:DeleteForecastExportJob' :: Text
forecastExportJobArn = Text
a} :: DeleteForecastExportJob)

instance Core.AWSRequest DeleteForecastExportJob where
  type
    AWSResponse DeleteForecastExportJob =
      DeleteForecastExportJobResponse
  request :: (Service -> Service)
-> DeleteForecastExportJob -> Request DeleteForecastExportJob
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 DeleteForecastExportJob
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DeleteForecastExportJob)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
AWSResponse a
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveNull
      DeleteForecastExportJobResponse
DeleteForecastExportJobResponse'

instance Prelude.Hashable DeleteForecastExportJob where
  hashWithSalt :: Int -> DeleteForecastExportJob -> Int
hashWithSalt Int
_salt DeleteForecastExportJob' {Text
forecastExportJobArn :: Text
$sel:forecastExportJobArn:DeleteForecastExportJob' :: DeleteForecastExportJob -> Text
..} =
    Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
forecastExportJobArn

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

instance Data.ToHeaders DeleteForecastExportJob where
  toHeaders :: DeleteForecastExportJob -> [Header]
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 -> [Header]
Data.=# ( ByteString
"AmazonForecast.DeleteForecastExportJob" ::
                          Prelude.ByteString
                      ),
            HeaderName
"Content-Type"
              forall a. ToHeader a => HeaderName -> a -> [Header]
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Data.ToJSON DeleteForecastExportJob where
  toJSON :: DeleteForecastExportJob -> Value
toJSON DeleteForecastExportJob' {Text
forecastExportJobArn :: Text
$sel:forecastExportJobArn:DeleteForecastExportJob' :: DeleteForecastExportJob -> Text
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ forall a. a -> Maybe a
Prelude.Just
              ( Key
"ForecastExportJobArn"
                  forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
forecastExportJobArn
              )
          ]
      )

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

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

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

-- |
-- Create a value of 'DeleteForecastExportJobResponse' 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.
newDeleteForecastExportJobResponse ::
  DeleteForecastExportJobResponse
newDeleteForecastExportJobResponse :: DeleteForecastExportJobResponse
newDeleteForecastExportJobResponse =
  DeleteForecastExportJobResponse
DeleteForecastExportJobResponse'

instance
  Prelude.NFData
    DeleteForecastExportJobResponse
  where
  rnf :: DeleteForecastExportJobResponse -> ()
rnf DeleteForecastExportJobResponse
_ = ()