{-# 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.ListPredictors
-- 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 predictors created using the CreatePredictor
-- operation. For each predictor, this operation returns a summary of its
-- properties, including its Amazon Resource Name (ARN). You can retrieve
-- the complete set of properties by using the ARN with the
-- DescribePredictor operation. You can filter the list using an array of
-- Filter objects.
--
-- This operation returns paginated results.
module Amazonka.Forecast.ListPredictors
  ( -- * Creating a Request
    ListPredictors (..),
    newListPredictors,

    -- * Request Lenses
    listPredictors_filters,
    listPredictors_nextToken,
    listPredictors_maxResults,

    -- * Destructuring the Response
    ListPredictorsResponse (..),
    newListPredictorsResponse,

    -- * Response Lenses
    listPredictorsResponse_nextToken,
    listPredictorsResponse_predictors,
    listPredictorsResponse_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:/ 'newListPredictors' smart constructor.
data ListPredictors = ListPredictors'
  { -- | 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 predictors 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 predictors that match the statement,
    --     specify @IS@. To exclude matching predictors, specify @IS_NOT@.
    --
    -- -   @Key@ - The name of the parameter to filter on. Valid values are
    --     @DatasetGroupArn@ and @Status@.
    --
    -- -   @Value@ - The value to match.
    --
    -- For example, to list all predictors whose status is ACTIVE, you would
    -- specify:
    --
    -- @\"Filters\": [ { \"Condition\": \"IS\", \"Key\": \"Status\", \"Value\": \"ACTIVE\" } ]@
    ListPredictors -> 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.
    ListPredictors -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The number of items to return in the response.
    ListPredictors -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural
  }
  deriving (ListPredictors -> ListPredictors -> Bool
(ListPredictors -> ListPredictors -> Bool)
-> (ListPredictors -> ListPredictors -> Bool) -> Eq ListPredictors
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListPredictors -> ListPredictors -> Bool
$c/= :: ListPredictors -> ListPredictors -> Bool
== :: ListPredictors -> ListPredictors -> Bool
$c== :: ListPredictors -> ListPredictors -> Bool
Prelude.Eq, ReadPrec [ListPredictors]
ReadPrec ListPredictors
Int -> ReadS ListPredictors
ReadS [ListPredictors]
(Int -> ReadS ListPredictors)
-> ReadS [ListPredictors]
-> ReadPrec ListPredictors
-> ReadPrec [ListPredictors]
-> Read ListPredictors
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListPredictors]
$creadListPrec :: ReadPrec [ListPredictors]
readPrec :: ReadPrec ListPredictors
$creadPrec :: ReadPrec ListPredictors
readList :: ReadS [ListPredictors]
$creadList :: ReadS [ListPredictors]
readsPrec :: Int -> ReadS ListPredictors
$creadsPrec :: Int -> ReadS ListPredictors
Prelude.Read, Int -> ListPredictors -> ShowS
[ListPredictors] -> ShowS
ListPredictors -> String
(Int -> ListPredictors -> ShowS)
-> (ListPredictors -> String)
-> ([ListPredictors] -> ShowS)
-> Show ListPredictors
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListPredictors] -> ShowS
$cshowList :: [ListPredictors] -> ShowS
show :: ListPredictors -> String
$cshow :: ListPredictors -> String
showsPrec :: Int -> ListPredictors -> ShowS
$cshowsPrec :: Int -> ListPredictors -> ShowS
Prelude.Show, (forall x. ListPredictors -> Rep ListPredictors x)
-> (forall x. Rep ListPredictors x -> ListPredictors)
-> Generic ListPredictors
forall x. Rep ListPredictors x -> ListPredictors
forall x. ListPredictors -> Rep ListPredictors x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListPredictors x -> ListPredictors
$cfrom :: forall x. ListPredictors -> Rep ListPredictors x
Prelude.Generic)

-- |
-- Create a value of 'ListPredictors' 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', 'listPredictors_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 predictors 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 predictors that match the statement,
--     specify @IS@. To exclude matching predictors, specify @IS_NOT@.
--
-- -   @Key@ - The name of the parameter to filter on. Valid values are
--     @DatasetGroupArn@ and @Status@.
--
-- -   @Value@ - The value to match.
--
-- For example, to list all predictors whose status is ACTIVE, you would
-- specify:
--
-- @\"Filters\": [ { \"Condition\": \"IS\", \"Key\": \"Status\", \"Value\": \"ACTIVE\" } ]@
--
-- 'nextToken', 'listPredictors_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', 'listPredictors_maxResults' - The number of items to return in the response.
newListPredictors ::
  ListPredictors
newListPredictors :: ListPredictors
newListPredictors =
  ListPredictors' :: Maybe [Filter] -> Maybe Text -> Maybe Natural -> ListPredictors
ListPredictors'
    { $sel:filters:ListPredictors' :: Maybe [Filter]
filters = Maybe [Filter]
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListPredictors' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:ListPredictors' :: 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 predictors 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 predictors that match the statement,
--     specify @IS@. To exclude matching predictors, specify @IS_NOT@.
--
-- -   @Key@ - The name of the parameter to filter on. Valid values are
--     @DatasetGroupArn@ and @Status@.
--
-- -   @Value@ - The value to match.
--
-- For example, to list all predictors whose status is ACTIVE, you would
-- specify:
--
-- @\"Filters\": [ { \"Condition\": \"IS\", \"Key\": \"Status\", \"Value\": \"ACTIVE\" } ]@
listPredictors_filters :: Lens.Lens' ListPredictors (Prelude.Maybe [Filter])
listPredictors_filters :: (Maybe [Filter] -> f (Maybe [Filter]))
-> ListPredictors -> f ListPredictors
listPredictors_filters = (ListPredictors -> Maybe [Filter])
-> (ListPredictors -> Maybe [Filter] -> ListPredictors)
-> Lens
     ListPredictors ListPredictors (Maybe [Filter]) (Maybe [Filter])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListPredictors' {Maybe [Filter]
filters :: Maybe [Filter]
$sel:filters:ListPredictors' :: ListPredictors -> Maybe [Filter]
filters} -> Maybe [Filter]
filters) (\s :: ListPredictors
s@ListPredictors' {} Maybe [Filter]
a -> ListPredictors
s {$sel:filters:ListPredictors' :: Maybe [Filter]
filters = Maybe [Filter]
a} :: ListPredictors) ((Maybe [Filter] -> f (Maybe [Filter]))
 -> ListPredictors -> f ListPredictors)
-> ((Maybe [Filter] -> f (Maybe [Filter]))
    -> Maybe [Filter] -> f (Maybe [Filter]))
-> (Maybe [Filter] -> f (Maybe [Filter]))
-> ListPredictors
-> f ListPredictors
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.
listPredictors_nextToken :: Lens.Lens' ListPredictors (Prelude.Maybe Prelude.Text)
listPredictors_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListPredictors -> f ListPredictors
listPredictors_nextToken = (ListPredictors -> Maybe Text)
-> (ListPredictors -> Maybe Text -> ListPredictors)
-> Lens ListPredictors ListPredictors (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListPredictors' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListPredictors' :: ListPredictors -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListPredictors
s@ListPredictors' {} Maybe Text
a -> ListPredictors
s {$sel:nextToken:ListPredictors' :: Maybe Text
nextToken = Maybe Text
a} :: ListPredictors)

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

instance Core.AWSPager ListPredictors where
  page :: ListPredictors
-> AWSResponse ListPredictors -> Maybe ListPredictors
page ListPredictors
rq AWSResponse ListPredictors
rs
    | Maybe Text -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListPredictors
ListPredictorsResponse
rs
            ListPredictorsResponse
-> Getting (First Text) ListPredictorsResponse Text -> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListPredictorsResponse
-> Const (First Text) ListPredictorsResponse
Lens' ListPredictorsResponse (Maybe Text)
listPredictorsResponse_nextToken
              ((Maybe Text -> Const (First Text) (Maybe Text))
 -> ListPredictorsResponse
 -> Const (First Text) ListPredictorsResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListPredictorsResponse 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 ListPredictors
forall a. Maybe a
Prelude.Nothing
    | Maybe [PredictorSummary] -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListPredictors
ListPredictorsResponse
rs
            ListPredictorsResponse
-> Getting
     (First [PredictorSummary])
     ListPredictorsResponse
     [PredictorSummary]
-> Maybe [PredictorSummary]
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe [PredictorSummary]
 -> Const (First [PredictorSummary]) (Maybe [PredictorSummary]))
-> ListPredictorsResponse
-> Const (First [PredictorSummary]) ListPredictorsResponse
Lens' ListPredictorsResponse (Maybe [PredictorSummary])
listPredictorsResponse_predictors
              ((Maybe [PredictorSummary]
  -> Const (First [PredictorSummary]) (Maybe [PredictorSummary]))
 -> ListPredictorsResponse
 -> Const (First [PredictorSummary]) ListPredictorsResponse)
-> (([PredictorSummary]
     -> Const (First [PredictorSummary]) [PredictorSummary])
    -> Maybe [PredictorSummary]
    -> Const (First [PredictorSummary]) (Maybe [PredictorSummary]))
-> Getting
     (First [PredictorSummary])
     ListPredictorsResponse
     [PredictorSummary]
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([PredictorSummary]
 -> Const (First [PredictorSummary]) [PredictorSummary])
-> Maybe [PredictorSummary]
-> Const (First [PredictorSummary]) (Maybe [PredictorSummary])
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
      Maybe ListPredictors
forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
      ListPredictors -> Maybe ListPredictors
forall a. a -> Maybe a
Prelude.Just (ListPredictors -> Maybe ListPredictors)
-> ListPredictors -> Maybe ListPredictors
forall a b. (a -> b) -> a -> b
Prelude.$
        ListPredictors
rq
          ListPredictors
-> (ListPredictors -> ListPredictors) -> ListPredictors
forall a b. a -> (a -> b) -> b
Prelude.& (Maybe Text -> Identity (Maybe Text))
-> ListPredictors -> Identity ListPredictors
Lens ListPredictors ListPredictors (Maybe Text) (Maybe Text)
listPredictors_nextToken
          ((Maybe Text -> Identity (Maybe Text))
 -> ListPredictors -> Identity ListPredictors)
-> Maybe Text -> ListPredictors -> ListPredictors
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListPredictors
ListPredictorsResponse
rs
          ListPredictorsResponse
-> Getting (First Text) ListPredictorsResponse Text -> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListPredictorsResponse
-> Const (First Text) ListPredictorsResponse
Lens' ListPredictorsResponse (Maybe Text)
listPredictorsResponse_nextToken ((Maybe Text -> Const (First Text) (Maybe Text))
 -> ListPredictorsResponse
 -> Const (First Text) ListPredictorsResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListPredictorsResponse 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 ListPredictors where
  type
    AWSResponse ListPredictors =
      ListPredictorsResponse
  request :: ListPredictors -> Request ListPredictors
request = Service -> ListPredictors -> Request ListPredictors
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy ListPredictors
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse ListPredictors)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse ListPredictors))
-> Logger
-> Service
-> Proxy ListPredictors
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse ListPredictors)))
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 [PredictorSummary] -> Int -> ListPredictorsResponse
ListPredictorsResponse'
            (Maybe Text
 -> Maybe [PredictorSummary] -> Int -> ListPredictorsResponse)
-> Either String (Maybe Text)
-> Either
     String (Maybe [PredictorSummary] -> Int -> ListPredictorsResponse)
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 [PredictorSummary] -> Int -> ListPredictorsResponse)
-> Either String (Maybe [PredictorSummary])
-> Either String (Int -> ListPredictorsResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe (Maybe [PredictorSummary]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"Predictors" Either String (Maybe (Maybe [PredictorSummary]))
-> Maybe [PredictorSummary]
-> Either String (Maybe [PredictorSummary])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [PredictorSummary]
forall a. Monoid a => a
Prelude.mempty)
            Either String (Int -> ListPredictorsResponse)
-> Either String Int -> Either String ListPredictorsResponse
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 ListPredictors

instance Prelude.NFData ListPredictors

instance Core.ToHeaders ListPredictors where
  toHeaders :: ListPredictors -> ResponseHeaders
toHeaders =
    ResponseHeaders -> ListPredictors -> 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.ListPredictors" ::
                          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 ListPredictors where
  toJSON :: ListPredictors -> Value
toJSON ListPredictors' {Maybe Natural
Maybe [Filter]
Maybe Text
maxResults :: Maybe Natural
nextToken :: Maybe Text
filters :: Maybe [Filter]
$sel:maxResults:ListPredictors' :: ListPredictors -> Maybe Natural
$sel:nextToken:ListPredictors' :: ListPredictors -> Maybe Text
$sel:filters:ListPredictors' :: ListPredictors -> 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 ListPredictors where
  toPath :: ListPredictors -> ByteString
toPath = ByteString -> ListPredictors -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"

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

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

-- |
-- Create a value of 'ListPredictorsResponse' 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', 'listPredictorsResponse_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.
--
-- 'predictors', 'listPredictorsResponse_predictors' - An array of objects that summarize each predictor\'s properties.
--
-- 'httpStatus', 'listPredictorsResponse_httpStatus' - The response's http status code.
newListPredictorsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListPredictorsResponse
newListPredictorsResponse :: Int -> ListPredictorsResponse
newListPredictorsResponse Int
pHttpStatus_ =
  ListPredictorsResponse' :: Maybe Text
-> Maybe [PredictorSummary] -> Int -> ListPredictorsResponse
ListPredictorsResponse'
    { $sel:nextToken:ListPredictorsResponse' :: Maybe Text
nextToken =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:predictors:ListPredictorsResponse' :: Maybe [PredictorSummary]
predictors = Maybe [PredictorSummary]
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListPredictorsResponse' :: 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.
listPredictorsResponse_nextToken :: Lens.Lens' ListPredictorsResponse (Prelude.Maybe Prelude.Text)
listPredictorsResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListPredictorsResponse -> f ListPredictorsResponse
listPredictorsResponse_nextToken = (ListPredictorsResponse -> Maybe Text)
-> (ListPredictorsResponse -> Maybe Text -> ListPredictorsResponse)
-> Lens' ListPredictorsResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListPredictorsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListPredictorsResponse' :: ListPredictorsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListPredictorsResponse
s@ListPredictorsResponse' {} Maybe Text
a -> ListPredictorsResponse
s {$sel:nextToken:ListPredictorsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListPredictorsResponse)

-- | An array of objects that summarize each predictor\'s properties.
listPredictorsResponse_predictors :: Lens.Lens' ListPredictorsResponse (Prelude.Maybe [PredictorSummary])
listPredictorsResponse_predictors :: (Maybe [PredictorSummary] -> f (Maybe [PredictorSummary]))
-> ListPredictorsResponse -> f ListPredictorsResponse
listPredictorsResponse_predictors = (ListPredictorsResponse -> Maybe [PredictorSummary])
-> (ListPredictorsResponse
    -> Maybe [PredictorSummary] -> ListPredictorsResponse)
-> Lens' ListPredictorsResponse (Maybe [PredictorSummary])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListPredictorsResponse' {Maybe [PredictorSummary]
predictors :: Maybe [PredictorSummary]
$sel:predictors:ListPredictorsResponse' :: ListPredictorsResponse -> Maybe [PredictorSummary]
predictors} -> Maybe [PredictorSummary]
predictors) (\s :: ListPredictorsResponse
s@ListPredictorsResponse' {} Maybe [PredictorSummary]
a -> ListPredictorsResponse
s {$sel:predictors:ListPredictorsResponse' :: Maybe [PredictorSummary]
predictors = Maybe [PredictorSummary]
a} :: ListPredictorsResponse) ((Maybe [PredictorSummary] -> f (Maybe [PredictorSummary]))
 -> ListPredictorsResponse -> f ListPredictorsResponse)
-> ((Maybe [PredictorSummary] -> f (Maybe [PredictorSummary]))
    -> Maybe [PredictorSummary] -> f (Maybe [PredictorSummary]))
-> (Maybe [PredictorSummary] -> f (Maybe [PredictorSummary]))
-> ListPredictorsResponse
-> f ListPredictorsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [PredictorSummary]
  [PredictorSummary]
  [PredictorSummary]
  [PredictorSummary]
-> Iso
     (Maybe [PredictorSummary])
     (Maybe [PredictorSummary])
     (Maybe [PredictorSummary])
     (Maybe [PredictorSummary])
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
  [PredictorSummary]
  [PredictorSummary]
  [PredictorSummary]
  [PredictorSummary]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

instance Prelude.NFData ListPredictorsResponse