{-# 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-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 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 Amazonka.Forecast.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:/ '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
(DeleteForecastExportJob -> DeleteForecastExportJob -> Bool)
-> (DeleteForecastExportJob -> DeleteForecastExportJob -> Bool)
-> Eq DeleteForecastExportJob
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]
(Int -> ReadS DeleteForecastExportJob)
-> ReadS [DeleteForecastExportJob]
-> ReadPrec DeleteForecastExportJob
-> ReadPrec [DeleteForecastExportJob]
-> Read 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
(Int -> DeleteForecastExportJob -> ShowS)
-> (DeleteForecastExportJob -> String)
-> ([DeleteForecastExportJob] -> ShowS)
-> Show DeleteForecastExportJob
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.
 DeleteForecastExportJob -> Rep DeleteForecastExportJob x)
-> (forall x.
    Rep DeleteForecastExportJob x -> DeleteForecastExportJob)
-> Generic DeleteForecastExportJob
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' :: Text -> DeleteForecastExportJob
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 :: (Text -> f Text)
-> DeleteForecastExportJob -> f DeleteForecastExportJob
deleteForecastExportJob_forecastExportJobArn = (DeleteForecastExportJob -> Text)
-> (DeleteForecastExportJob -> Text -> DeleteForecastExportJob)
-> Lens DeleteForecastExportJob DeleteForecastExportJob Text Text
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 :: DeleteForecastExportJob -> Request DeleteForecastExportJob
request = Service
-> DeleteForecastExportJob -> Request DeleteForecastExportJob
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy DeleteForecastExportJob
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DeleteForecastExportJob)))
response =
    AWSResponse DeleteForecastExportJob
-> Logger
-> Service
-> Proxy DeleteForecastExportJob
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DeleteForecastExportJob)))
forall (m :: * -> *) a.
MonadResource m =>
AWSResponse a
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveNull
      AWSResponse DeleteForecastExportJob
DeleteForecastExportJobResponse
DeleteForecastExportJobResponse'

instance Prelude.Hashable DeleteForecastExportJob

instance Prelude.NFData DeleteForecastExportJob

instance Core.ToHeaders DeleteForecastExportJob where
  toHeaders :: DeleteForecastExportJob -> [Header]
toHeaders =
    [Header] -> DeleteForecastExportJob -> [Header]
forall a b. a -> b -> a
Prelude.const
      ( [[Header]] -> [Header]
forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"X-Amz-Target"
              HeaderName -> ByteString -> [Header]
forall a. ToHeader a => HeaderName -> a -> [Header]
Core.=# ( ByteString
"AmazonForecast.DeleteForecastExportJob" ::
                          Prelude.ByteString
                      ),
            HeaderName
"Content-Type"
              HeaderName -> ByteString -> [Header]
forall a. ToHeader a => HeaderName -> a -> [Header]
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Core.ToJSON DeleteForecastExportJob where
  toJSON :: DeleteForecastExportJob -> Value
toJSON DeleteForecastExportJob' {Text
forecastExportJobArn :: Text
$sel:forecastExportJobArn:DeleteForecastExportJob' :: DeleteForecastExportJob -> 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
"ForecastExportJobArn"
                  Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
forecastExportJobArn
              )
          ]
      )

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

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

-- | /See:/ 'newDeleteForecastExportJobResponse' smart constructor.
data DeleteForecastExportJobResponse = DeleteForecastExportJobResponse'
  {
  }
  deriving (DeleteForecastExportJobResponse
-> DeleteForecastExportJobResponse -> Bool
(DeleteForecastExportJobResponse
 -> DeleteForecastExportJobResponse -> Bool)
-> (DeleteForecastExportJobResponse
    -> DeleteForecastExportJobResponse -> Bool)
-> Eq DeleteForecastExportJobResponse
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]
(Int -> ReadS DeleteForecastExportJobResponse)
-> ReadS [DeleteForecastExportJobResponse]
-> ReadPrec DeleteForecastExportJobResponse
-> ReadPrec [DeleteForecastExportJobResponse]
-> Read 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
(Int -> DeleteForecastExportJobResponse -> ShowS)
-> (DeleteForecastExportJobResponse -> String)
-> ([DeleteForecastExportJobResponse] -> ShowS)
-> Show DeleteForecastExportJobResponse
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.
 DeleteForecastExportJobResponse
 -> Rep DeleteForecastExportJobResponse x)
-> (forall x.
    Rep DeleteForecastExportJobResponse x
    -> DeleteForecastExportJobResponse)
-> Generic DeleteForecastExportJobResponse
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