{-# 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.ListForecastExportJobs
-- 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)
--
-- Returns a list of forecast export jobs created using the
-- CreateForecastExportJob operation. For each forecast export job, this
-- operation returns a summary of its properties, including its Amazon
-- Resource Name (ARN). To retrieve the complete set of properties, use the
-- ARN with the DescribeForecastExportJob operation. You can filter the
-- list using an array of Filter objects.
--
-- This operation returns paginated results.
module Amazonka.Forecast.ListForecastExportJobs
  ( -- * Creating a Request
    ListForecastExportJobs (..),
    newListForecastExportJobs,

    -- * Request Lenses
    listForecastExportJobs_filters,
    listForecastExportJobs_nextToken,
    listForecastExportJobs_maxResults,

    -- * Destructuring the Response
    ListForecastExportJobsResponse (..),
    newListForecastExportJobsResponse,

    -- * Response Lenses
    listForecastExportJobsResponse_nextToken,
    listForecastExportJobsResponse_forecastExportJobs,
    listForecastExportJobsResponse_httpStatus,
  )
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:/ 'newListForecastExportJobs' smart constructor.
data ListForecastExportJobs = ListForecastExportJobs'
  { -- | An array of filters. For each filter, you provide a condition and a
    -- match statement. The condition is either @IS@ or @IS_NOT@, which
    -- specifies whether to include or exclude the forecast export jobs that
    -- match the statement from the list, respectively. The match statement
    -- consists of a key and a value.
    --
    -- __Filter properties__
    --
    -- -   @Condition@ - The condition to apply. Valid values are @IS@ and
    --     @IS_NOT@. To include the forecast export jobs that match the
    --     statement, specify @IS@. To exclude matching forecast export jobs,
    --     specify @IS_NOT@.
    --
    -- -   @Key@ - The name of the parameter to filter on. Valid values are
    --     @ForecastArn@ and @Status@.
    --
    -- -   @Value@ - The value to match.
    --
    -- For example, to list all jobs that export a forecast named
    -- /electricityforecast/, specify the following filter:
    --
    -- @\"Filters\": [ { \"Condition\": \"IS\", \"Key\": \"ForecastArn\", \"Value\": \"arn:aws:forecast:us-west-2:\<acct-id>:forecast\/electricityforecast\" } ]@
    ListForecastExportJobs -> Maybe [Filter]
filters :: Prelude.Maybe [Filter],
    -- | If the result of the previous request was truncated, the response
    -- includes a @NextToken@. To retrieve the next set of results, use the
    -- token in the next request. Tokens expire after 24 hours.
    ListForecastExportJobs -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The number of items to return in the response.
    ListForecastExportJobs -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural
  }
  deriving (ListForecastExportJobs -> ListForecastExportJobs -> Bool
(ListForecastExportJobs -> ListForecastExportJobs -> Bool)
-> (ListForecastExportJobs -> ListForecastExportJobs -> Bool)
-> Eq ListForecastExportJobs
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListForecastExportJobs -> ListForecastExportJobs -> Bool
$c/= :: ListForecastExportJobs -> ListForecastExportJobs -> Bool
== :: ListForecastExportJobs -> ListForecastExportJobs -> Bool
$c== :: ListForecastExportJobs -> ListForecastExportJobs -> Bool
Prelude.Eq, ReadPrec [ListForecastExportJobs]
ReadPrec ListForecastExportJobs
Int -> ReadS ListForecastExportJobs
ReadS [ListForecastExportJobs]
(Int -> ReadS ListForecastExportJobs)
-> ReadS [ListForecastExportJobs]
-> ReadPrec ListForecastExportJobs
-> ReadPrec [ListForecastExportJobs]
-> Read ListForecastExportJobs
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListForecastExportJobs]
$creadListPrec :: ReadPrec [ListForecastExportJobs]
readPrec :: ReadPrec ListForecastExportJobs
$creadPrec :: ReadPrec ListForecastExportJobs
readList :: ReadS [ListForecastExportJobs]
$creadList :: ReadS [ListForecastExportJobs]
readsPrec :: Int -> ReadS ListForecastExportJobs
$creadsPrec :: Int -> ReadS ListForecastExportJobs
Prelude.Read, Int -> ListForecastExportJobs -> ShowS
[ListForecastExportJobs] -> ShowS
ListForecastExportJobs -> String
(Int -> ListForecastExportJobs -> ShowS)
-> (ListForecastExportJobs -> String)
-> ([ListForecastExportJobs] -> ShowS)
-> Show ListForecastExportJobs
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListForecastExportJobs] -> ShowS
$cshowList :: [ListForecastExportJobs] -> ShowS
show :: ListForecastExportJobs -> String
$cshow :: ListForecastExportJobs -> String
showsPrec :: Int -> ListForecastExportJobs -> ShowS
$cshowsPrec :: Int -> ListForecastExportJobs -> ShowS
Prelude.Show, (forall x. ListForecastExportJobs -> Rep ListForecastExportJobs x)
-> (forall x.
    Rep ListForecastExportJobs x -> ListForecastExportJobs)
-> Generic ListForecastExportJobs
forall x. Rep ListForecastExportJobs x -> ListForecastExportJobs
forall x. ListForecastExportJobs -> Rep ListForecastExportJobs x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListForecastExportJobs x -> ListForecastExportJobs
$cfrom :: forall x. ListForecastExportJobs -> Rep ListForecastExportJobs x
Prelude.Generic)

-- |
-- Create a value of 'ListForecastExportJobs' 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:
--
-- 'filters', 'listForecastExportJobs_filters' - An array of filters. For each filter, you provide a condition and a
-- match statement. The condition is either @IS@ or @IS_NOT@, which
-- specifies whether to include or exclude the forecast export jobs that
-- match the statement from the list, respectively. The match statement
-- consists of a key and a value.
--
-- __Filter properties__
--
-- -   @Condition@ - The condition to apply. Valid values are @IS@ and
--     @IS_NOT@. To include the forecast export jobs that match the
--     statement, specify @IS@. To exclude matching forecast export jobs,
--     specify @IS_NOT@.
--
-- -   @Key@ - The name of the parameter to filter on. Valid values are
--     @ForecastArn@ and @Status@.
--
-- -   @Value@ - The value to match.
--
-- For example, to list all jobs that export a forecast named
-- /electricityforecast/, specify the following filter:
--
-- @\"Filters\": [ { \"Condition\": \"IS\", \"Key\": \"ForecastArn\", \"Value\": \"arn:aws:forecast:us-west-2:\<acct-id>:forecast\/electricityforecast\" } ]@
--
-- 'nextToken', 'listForecastExportJobs_nextToken' - If the result of the previous request was truncated, the response
-- includes a @NextToken@. To retrieve the next set of results, use the
-- token in the next request. Tokens expire after 24 hours.
--
-- 'maxResults', 'listForecastExportJobs_maxResults' - The number of items to return in the response.
newListForecastExportJobs ::
  ListForecastExportJobs
newListForecastExportJobs :: ListForecastExportJobs
newListForecastExportJobs =
  ListForecastExportJobs' :: Maybe [Filter]
-> Maybe Text -> Maybe Natural -> ListForecastExportJobs
ListForecastExportJobs'
    { $sel:filters:ListForecastExportJobs' :: Maybe [Filter]
filters = Maybe [Filter]
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListForecastExportJobs' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:ListForecastExportJobs' :: Maybe Natural
maxResults = Maybe Natural
forall a. Maybe a
Prelude.Nothing
    }

-- | An array of filters. For each filter, you provide a condition and a
-- match statement. The condition is either @IS@ or @IS_NOT@, which
-- specifies whether to include or exclude the forecast export jobs that
-- match the statement from the list, respectively. The match statement
-- consists of a key and a value.
--
-- __Filter properties__
--
-- -   @Condition@ - The condition to apply. Valid values are @IS@ and
--     @IS_NOT@. To include the forecast export jobs that match the
--     statement, specify @IS@. To exclude matching forecast export jobs,
--     specify @IS_NOT@.
--
-- -   @Key@ - The name of the parameter to filter on. Valid values are
--     @ForecastArn@ and @Status@.
--
-- -   @Value@ - The value to match.
--
-- For example, to list all jobs that export a forecast named
-- /electricityforecast/, specify the following filter:
--
-- @\"Filters\": [ { \"Condition\": \"IS\", \"Key\": \"ForecastArn\", \"Value\": \"arn:aws:forecast:us-west-2:\<acct-id>:forecast\/electricityforecast\" } ]@
listForecastExportJobs_filters :: Lens.Lens' ListForecastExportJobs (Prelude.Maybe [Filter])
listForecastExportJobs_filters :: (Maybe [Filter] -> f (Maybe [Filter]))
-> ListForecastExportJobs -> f ListForecastExportJobs
listForecastExportJobs_filters = (ListForecastExportJobs -> Maybe [Filter])
-> (ListForecastExportJobs
    -> Maybe [Filter] -> ListForecastExportJobs)
-> Lens
     ListForecastExportJobs
     ListForecastExportJobs
     (Maybe [Filter])
     (Maybe [Filter])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListForecastExportJobs' {Maybe [Filter]
filters :: Maybe [Filter]
$sel:filters:ListForecastExportJobs' :: ListForecastExportJobs -> Maybe [Filter]
filters} -> Maybe [Filter]
filters) (\s :: ListForecastExportJobs
s@ListForecastExportJobs' {} Maybe [Filter]
a -> ListForecastExportJobs
s {$sel:filters:ListForecastExportJobs' :: Maybe [Filter]
filters = Maybe [Filter]
a} :: ListForecastExportJobs) ((Maybe [Filter] -> f (Maybe [Filter]))
 -> ListForecastExportJobs -> f ListForecastExportJobs)
-> ((Maybe [Filter] -> f (Maybe [Filter]))
    -> Maybe [Filter] -> f (Maybe [Filter]))
-> (Maybe [Filter] -> f (Maybe [Filter]))
-> ListForecastExportJobs
-> f ListForecastExportJobs
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Filter] [Filter] [Filter] [Filter]
-> Iso
     (Maybe [Filter]) (Maybe [Filter]) (Maybe [Filter]) (Maybe [Filter])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso [Filter] [Filter] [Filter] [Filter]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | If the result of the previous request was truncated, the response
-- includes a @NextToken@. To retrieve the next set of results, use the
-- token in the next request. Tokens expire after 24 hours.
listForecastExportJobs_nextToken :: Lens.Lens' ListForecastExportJobs (Prelude.Maybe Prelude.Text)
listForecastExportJobs_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListForecastExportJobs -> f ListForecastExportJobs
listForecastExportJobs_nextToken = (ListForecastExportJobs -> Maybe Text)
-> (ListForecastExportJobs -> Maybe Text -> ListForecastExportJobs)
-> Lens
     ListForecastExportJobs
     ListForecastExportJobs
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListForecastExportJobs' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListForecastExportJobs' :: ListForecastExportJobs -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListForecastExportJobs
s@ListForecastExportJobs' {} Maybe Text
a -> ListForecastExportJobs
s {$sel:nextToken:ListForecastExportJobs' :: Maybe Text
nextToken = Maybe Text
a} :: ListForecastExportJobs)

-- | The number of items to return in the response.
listForecastExportJobs_maxResults :: Lens.Lens' ListForecastExportJobs (Prelude.Maybe Prelude.Natural)
listForecastExportJobs_maxResults :: (Maybe Natural -> f (Maybe Natural))
-> ListForecastExportJobs -> f ListForecastExportJobs
listForecastExportJobs_maxResults = (ListForecastExportJobs -> Maybe Natural)
-> (ListForecastExportJobs
    -> Maybe Natural -> ListForecastExportJobs)
-> Lens
     ListForecastExportJobs
     ListForecastExportJobs
     (Maybe Natural)
     (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListForecastExportJobs' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:ListForecastExportJobs' :: ListForecastExportJobs -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: ListForecastExportJobs
s@ListForecastExportJobs' {} Maybe Natural
a -> ListForecastExportJobs
s {$sel:maxResults:ListForecastExportJobs' :: Maybe Natural
maxResults = Maybe Natural
a} :: ListForecastExportJobs)

instance Core.AWSPager ListForecastExportJobs where
  page :: ListForecastExportJobs
-> AWSResponse ListForecastExportJobs
-> Maybe ListForecastExportJobs
page ListForecastExportJobs
rq AWSResponse ListForecastExportJobs
rs
    | Maybe Text -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListForecastExportJobs
ListForecastExportJobsResponse
rs
            ListForecastExportJobsResponse
-> Getting (First Text) ListForecastExportJobsResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListForecastExportJobsResponse
-> Const (First Text) ListForecastExportJobsResponse
Lens' ListForecastExportJobsResponse (Maybe Text)
listForecastExportJobsResponse_nextToken
              ((Maybe Text -> Const (First Text) (Maybe Text))
 -> ListForecastExportJobsResponse
 -> Const (First Text) ListForecastExportJobsResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListForecastExportJobsResponse Text
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Text -> Const (First Text) Text)
-> Maybe Text -> Const (First Text) (Maybe Text)
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
      Maybe ListForecastExportJobs
forall a. Maybe a
Prelude.Nothing
    | Maybe [ForecastExportJobSummary] -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListForecastExportJobs
ListForecastExportJobsResponse
rs
            ListForecastExportJobsResponse
-> Getting
     (First [ForecastExportJobSummary])
     ListForecastExportJobsResponse
     [ForecastExportJobSummary]
-> Maybe [ForecastExportJobSummary]
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe [ForecastExportJobSummary]
 -> Const
      (First [ForecastExportJobSummary])
      (Maybe [ForecastExportJobSummary]))
-> ListForecastExportJobsResponse
-> Const
     (First [ForecastExportJobSummary]) ListForecastExportJobsResponse
Lens'
  ListForecastExportJobsResponse (Maybe [ForecastExportJobSummary])
listForecastExportJobsResponse_forecastExportJobs
              ((Maybe [ForecastExportJobSummary]
  -> Const
       (First [ForecastExportJobSummary])
       (Maybe [ForecastExportJobSummary]))
 -> ListForecastExportJobsResponse
 -> Const
      (First [ForecastExportJobSummary]) ListForecastExportJobsResponse)
-> (([ForecastExportJobSummary]
     -> Const
          (First [ForecastExportJobSummary]) [ForecastExportJobSummary])
    -> Maybe [ForecastExportJobSummary]
    -> Const
         (First [ForecastExportJobSummary])
         (Maybe [ForecastExportJobSummary]))
-> Getting
     (First [ForecastExportJobSummary])
     ListForecastExportJobsResponse
     [ForecastExportJobSummary]
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([ForecastExportJobSummary]
 -> Const
      (First [ForecastExportJobSummary]) [ForecastExportJobSummary])
-> Maybe [ForecastExportJobSummary]
-> Const
     (First [ForecastExportJobSummary])
     (Maybe [ForecastExportJobSummary])
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
      Maybe ListForecastExportJobs
forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
      ListForecastExportJobs -> Maybe ListForecastExportJobs
forall a. a -> Maybe a
Prelude.Just (ListForecastExportJobs -> Maybe ListForecastExportJobs)
-> ListForecastExportJobs -> Maybe ListForecastExportJobs
forall a b. (a -> b) -> a -> b
Prelude.$
        ListForecastExportJobs
rq
          ListForecastExportJobs
-> (ListForecastExportJobs -> ListForecastExportJobs)
-> ListForecastExportJobs
forall a b. a -> (a -> b) -> b
Prelude.& (Maybe Text -> Identity (Maybe Text))
-> ListForecastExportJobs -> Identity ListForecastExportJobs
Lens
  ListForecastExportJobs
  ListForecastExportJobs
  (Maybe Text)
  (Maybe Text)
listForecastExportJobs_nextToken
          ((Maybe Text -> Identity (Maybe Text))
 -> ListForecastExportJobs -> Identity ListForecastExportJobs)
-> Maybe Text -> ListForecastExportJobs -> ListForecastExportJobs
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListForecastExportJobs
ListForecastExportJobsResponse
rs
          ListForecastExportJobsResponse
-> Getting (First Text) ListForecastExportJobsResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListForecastExportJobsResponse
-> Const (First Text) ListForecastExportJobsResponse
Lens' ListForecastExportJobsResponse (Maybe Text)
listForecastExportJobsResponse_nextToken
            ((Maybe Text -> Const (First Text) (Maybe Text))
 -> ListForecastExportJobsResponse
 -> Const (First Text) ListForecastExportJobsResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListForecastExportJobsResponse Text
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Text -> Const (First Text) Text)
-> Maybe Text -> Const (First Text) (Maybe Text)
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just

instance Core.AWSRequest ListForecastExportJobs where
  type
    AWSResponse ListForecastExportJobs =
      ListForecastExportJobsResponse
  request :: ListForecastExportJobs -> Request ListForecastExportJobs
request = Service -> ListForecastExportJobs -> Request ListForecastExportJobs
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy ListForecastExportJobs
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse ListForecastExportJobs)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse ListForecastExportJobs))
-> Logger
-> Service
-> Proxy ListForecastExportJobs
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse ListForecastExportJobs)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe Text
-> Maybe [ForecastExportJobSummary]
-> Int
-> ListForecastExportJobsResponse
ListForecastExportJobsResponse'
            (Maybe Text
 -> Maybe [ForecastExportJobSummary]
 -> Int
 -> ListForecastExportJobsResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe [ForecastExportJobSummary]
      -> Int -> ListForecastExportJobsResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"NextToken")
            Either
  String
  (Maybe [ForecastExportJobSummary]
   -> Int -> ListForecastExportJobsResponse)
-> Either String (Maybe [ForecastExportJobSummary])
-> Either String (Int -> ListForecastExportJobsResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object
-> Text -> Either String (Maybe (Maybe [ForecastExportJobSummary]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"ForecastExportJobs"
                            Either String (Maybe (Maybe [ForecastExportJobSummary]))
-> Maybe [ForecastExportJobSummary]
-> Either String (Maybe [ForecastExportJobSummary])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [ForecastExportJobSummary]
forall a. Monoid a => a
Prelude.mempty
                        )
            Either String (Int -> ListForecastExportJobsResponse)
-> Either String Int
-> Either String ListForecastExportJobsResponse
forall (f :: * -> *) a b. Applicative f => 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 ListForecastExportJobs

instance Prelude.NFData ListForecastExportJobs

instance Core.ToHeaders ListForecastExportJobs where
  toHeaders :: ListForecastExportJobs -> ResponseHeaders
toHeaders =
    ResponseHeaders -> ListForecastExportJobs -> 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
"AmazonForecast.ListForecastExportJobs" ::
                          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 ListForecastExportJobs where
  toJSON :: ListForecastExportJobs -> Value
toJSON ListForecastExportJobs' {Maybe Natural
Maybe [Filter]
Maybe Text
maxResults :: Maybe Natural
nextToken :: Maybe Text
filters :: Maybe [Filter]
$sel:maxResults:ListForecastExportJobs' :: ListForecastExportJobs -> Maybe Natural
$sel:nextToken:ListForecastExportJobs' :: ListForecastExportJobs -> Maybe Text
$sel:filters:ListForecastExportJobs' :: ListForecastExportJobs -> Maybe [Filter]
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"Filters" Text -> [Filter] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) ([Filter] -> Pair) -> Maybe [Filter] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Filter]
filters,
            (Text
"NextToken" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
nextToken,
            (Text
"MaxResults" Text -> Natural -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Natural -> Pair) -> Maybe Natural -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
maxResults
          ]
      )

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

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

-- | /See:/ 'newListForecastExportJobsResponse' smart constructor.
data ListForecastExportJobsResponse = ListForecastExportJobsResponse'
  { -- | If the response is truncated, Amazon Forecast returns this token. To
    -- retrieve the next set of results, use the token in the next request.
    ListForecastExportJobsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | An array of objects that summarize each export job\'s properties.
    ListForecastExportJobsResponse -> Maybe [ForecastExportJobSummary]
forecastExportJobs :: Prelude.Maybe [ForecastExportJobSummary],
    -- | The response's http status code.
    ListForecastExportJobsResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (ListForecastExportJobsResponse
-> ListForecastExportJobsResponse -> Bool
(ListForecastExportJobsResponse
 -> ListForecastExportJobsResponse -> Bool)
-> (ListForecastExportJobsResponse
    -> ListForecastExportJobsResponse -> Bool)
-> Eq ListForecastExportJobsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListForecastExportJobsResponse
-> ListForecastExportJobsResponse -> Bool
$c/= :: ListForecastExportJobsResponse
-> ListForecastExportJobsResponse -> Bool
== :: ListForecastExportJobsResponse
-> ListForecastExportJobsResponse -> Bool
$c== :: ListForecastExportJobsResponse
-> ListForecastExportJobsResponse -> Bool
Prelude.Eq, ReadPrec [ListForecastExportJobsResponse]
ReadPrec ListForecastExportJobsResponse
Int -> ReadS ListForecastExportJobsResponse
ReadS [ListForecastExportJobsResponse]
(Int -> ReadS ListForecastExportJobsResponse)
-> ReadS [ListForecastExportJobsResponse]
-> ReadPrec ListForecastExportJobsResponse
-> ReadPrec [ListForecastExportJobsResponse]
-> Read ListForecastExportJobsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListForecastExportJobsResponse]
$creadListPrec :: ReadPrec [ListForecastExportJobsResponse]
readPrec :: ReadPrec ListForecastExportJobsResponse
$creadPrec :: ReadPrec ListForecastExportJobsResponse
readList :: ReadS [ListForecastExportJobsResponse]
$creadList :: ReadS [ListForecastExportJobsResponse]
readsPrec :: Int -> ReadS ListForecastExportJobsResponse
$creadsPrec :: Int -> ReadS ListForecastExportJobsResponse
Prelude.Read, Int -> ListForecastExportJobsResponse -> ShowS
[ListForecastExportJobsResponse] -> ShowS
ListForecastExportJobsResponse -> String
(Int -> ListForecastExportJobsResponse -> ShowS)
-> (ListForecastExportJobsResponse -> String)
-> ([ListForecastExportJobsResponse] -> ShowS)
-> Show ListForecastExportJobsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListForecastExportJobsResponse] -> ShowS
$cshowList :: [ListForecastExportJobsResponse] -> ShowS
show :: ListForecastExportJobsResponse -> String
$cshow :: ListForecastExportJobsResponse -> String
showsPrec :: Int -> ListForecastExportJobsResponse -> ShowS
$cshowsPrec :: Int -> ListForecastExportJobsResponse -> ShowS
Prelude.Show, (forall x.
 ListForecastExportJobsResponse
 -> Rep ListForecastExportJobsResponse x)
-> (forall x.
    Rep ListForecastExportJobsResponse x
    -> ListForecastExportJobsResponse)
-> Generic ListForecastExportJobsResponse
forall x.
Rep ListForecastExportJobsResponse x
-> ListForecastExportJobsResponse
forall x.
ListForecastExportJobsResponse
-> Rep ListForecastExportJobsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListForecastExportJobsResponse x
-> ListForecastExportJobsResponse
$cfrom :: forall x.
ListForecastExportJobsResponse
-> Rep ListForecastExportJobsResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListForecastExportJobsResponse' 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:
--
-- 'nextToken', 'listForecastExportJobsResponse_nextToken' - If the response is truncated, Amazon Forecast returns this token. To
-- retrieve the next set of results, use the token in the next request.
--
-- 'forecastExportJobs', 'listForecastExportJobsResponse_forecastExportJobs' - An array of objects that summarize each export job\'s properties.
--
-- 'httpStatus', 'listForecastExportJobsResponse_httpStatus' - The response's http status code.
newListForecastExportJobsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListForecastExportJobsResponse
newListForecastExportJobsResponse :: Int -> ListForecastExportJobsResponse
newListForecastExportJobsResponse Int
pHttpStatus_ =
  ListForecastExportJobsResponse' :: Maybe Text
-> Maybe [ForecastExportJobSummary]
-> Int
-> ListForecastExportJobsResponse
ListForecastExportJobsResponse'
    { $sel:nextToken:ListForecastExportJobsResponse' :: Maybe Text
nextToken =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:forecastExportJobs:ListForecastExportJobsResponse' :: Maybe [ForecastExportJobSummary]
forecastExportJobs = Maybe [ForecastExportJobSummary]
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListForecastExportJobsResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | If the response is truncated, Amazon Forecast returns this token. To
-- retrieve the next set of results, use the token in the next request.
listForecastExportJobsResponse_nextToken :: Lens.Lens' ListForecastExportJobsResponse (Prelude.Maybe Prelude.Text)
listForecastExportJobsResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListForecastExportJobsResponse
-> f ListForecastExportJobsResponse
listForecastExportJobsResponse_nextToken = (ListForecastExportJobsResponse -> Maybe Text)
-> (ListForecastExportJobsResponse
    -> Maybe Text -> ListForecastExportJobsResponse)
-> Lens' ListForecastExportJobsResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListForecastExportJobsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListForecastExportJobsResponse' :: ListForecastExportJobsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListForecastExportJobsResponse
s@ListForecastExportJobsResponse' {} Maybe Text
a -> ListForecastExportJobsResponse
s {$sel:nextToken:ListForecastExportJobsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListForecastExportJobsResponse)

-- | An array of objects that summarize each export job\'s properties.
listForecastExportJobsResponse_forecastExportJobs :: Lens.Lens' ListForecastExportJobsResponse (Prelude.Maybe [ForecastExportJobSummary])
listForecastExportJobsResponse_forecastExportJobs :: (Maybe [ForecastExportJobSummary]
 -> f (Maybe [ForecastExportJobSummary]))
-> ListForecastExportJobsResponse
-> f ListForecastExportJobsResponse
listForecastExportJobsResponse_forecastExportJobs = (ListForecastExportJobsResponse
 -> Maybe [ForecastExportJobSummary])
-> (ListForecastExportJobsResponse
    -> Maybe [ForecastExportJobSummary]
    -> ListForecastExportJobsResponse)
-> Lens'
     ListForecastExportJobsResponse (Maybe [ForecastExportJobSummary])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListForecastExportJobsResponse' {Maybe [ForecastExportJobSummary]
forecastExportJobs :: Maybe [ForecastExportJobSummary]
$sel:forecastExportJobs:ListForecastExportJobsResponse' :: ListForecastExportJobsResponse -> Maybe [ForecastExportJobSummary]
forecastExportJobs} -> Maybe [ForecastExportJobSummary]
forecastExportJobs) (\s :: ListForecastExportJobsResponse
s@ListForecastExportJobsResponse' {} Maybe [ForecastExportJobSummary]
a -> ListForecastExportJobsResponse
s {$sel:forecastExportJobs:ListForecastExportJobsResponse' :: Maybe [ForecastExportJobSummary]
forecastExportJobs = Maybe [ForecastExportJobSummary]
a} :: ListForecastExportJobsResponse) ((Maybe [ForecastExportJobSummary]
  -> f (Maybe [ForecastExportJobSummary]))
 -> ListForecastExportJobsResponse
 -> f ListForecastExportJobsResponse)
-> ((Maybe [ForecastExportJobSummary]
     -> f (Maybe [ForecastExportJobSummary]))
    -> Maybe [ForecastExportJobSummary]
    -> f (Maybe [ForecastExportJobSummary]))
-> (Maybe [ForecastExportJobSummary]
    -> f (Maybe [ForecastExportJobSummary]))
-> ListForecastExportJobsResponse
-> f ListForecastExportJobsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [ForecastExportJobSummary]
  [ForecastExportJobSummary]
  [ForecastExportJobSummary]
  [ForecastExportJobSummary]
-> Iso
     (Maybe [ForecastExportJobSummary])
     (Maybe [ForecastExportJobSummary])
     (Maybe [ForecastExportJobSummary])
     (Maybe [ForecastExportJobSummary])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso
  [ForecastExportJobSummary]
  [ForecastExportJobSummary]
  [ForecastExportJobSummary]
  [ForecastExportJobSummary]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

instance
  Prelude.NFData
    ListForecastExportJobsResponse