{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.Pinpoint.Types.ListRecommenderConfigurationsResponse
-- 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)
module Amazonka.Pinpoint.Types.ListRecommenderConfigurationsResponse where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.Pinpoint.Types.RecommenderConfigurationResponse
import qualified Amazonka.Prelude as Prelude

-- | Provides information about all the recommender model configurations that
-- are associated with your Amazon Pinpoint account.
--
-- /See:/ 'newListRecommenderConfigurationsResponse' smart constructor.
data ListRecommenderConfigurationsResponse = ListRecommenderConfigurationsResponse'
  { -- | The string to use in a subsequent request to get the next page of
    -- results in a paginated response. This value is null if there are no
    -- additional pages.
    ListRecommenderConfigurationsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | An array of responses, one for each recommender model configuration
    -- that\'s associated with your Amazon Pinpoint account.
    ListRecommenderConfigurationsResponse
-> [RecommenderConfigurationResponse]
item :: [RecommenderConfigurationResponse]
  }
  deriving (ListRecommenderConfigurationsResponse
-> ListRecommenderConfigurationsResponse -> Bool
(ListRecommenderConfigurationsResponse
 -> ListRecommenderConfigurationsResponse -> Bool)
-> (ListRecommenderConfigurationsResponse
    -> ListRecommenderConfigurationsResponse -> Bool)
-> Eq ListRecommenderConfigurationsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListRecommenderConfigurationsResponse
-> ListRecommenderConfigurationsResponse -> Bool
$c/= :: ListRecommenderConfigurationsResponse
-> ListRecommenderConfigurationsResponse -> Bool
== :: ListRecommenderConfigurationsResponse
-> ListRecommenderConfigurationsResponse -> Bool
$c== :: ListRecommenderConfigurationsResponse
-> ListRecommenderConfigurationsResponse -> Bool
Prelude.Eq, ReadPrec [ListRecommenderConfigurationsResponse]
ReadPrec ListRecommenderConfigurationsResponse
Int -> ReadS ListRecommenderConfigurationsResponse
ReadS [ListRecommenderConfigurationsResponse]
(Int -> ReadS ListRecommenderConfigurationsResponse)
-> ReadS [ListRecommenderConfigurationsResponse]
-> ReadPrec ListRecommenderConfigurationsResponse
-> ReadPrec [ListRecommenderConfigurationsResponse]
-> Read ListRecommenderConfigurationsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListRecommenderConfigurationsResponse]
$creadListPrec :: ReadPrec [ListRecommenderConfigurationsResponse]
readPrec :: ReadPrec ListRecommenderConfigurationsResponse
$creadPrec :: ReadPrec ListRecommenderConfigurationsResponse
readList :: ReadS [ListRecommenderConfigurationsResponse]
$creadList :: ReadS [ListRecommenderConfigurationsResponse]
readsPrec :: Int -> ReadS ListRecommenderConfigurationsResponse
$creadsPrec :: Int -> ReadS ListRecommenderConfigurationsResponse
Prelude.Read, Int -> ListRecommenderConfigurationsResponse -> ShowS
[ListRecommenderConfigurationsResponse] -> ShowS
ListRecommenderConfigurationsResponse -> String
(Int -> ListRecommenderConfigurationsResponse -> ShowS)
-> (ListRecommenderConfigurationsResponse -> String)
-> ([ListRecommenderConfigurationsResponse] -> ShowS)
-> Show ListRecommenderConfigurationsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListRecommenderConfigurationsResponse] -> ShowS
$cshowList :: [ListRecommenderConfigurationsResponse] -> ShowS
show :: ListRecommenderConfigurationsResponse -> String
$cshow :: ListRecommenderConfigurationsResponse -> String
showsPrec :: Int -> ListRecommenderConfigurationsResponse -> ShowS
$cshowsPrec :: Int -> ListRecommenderConfigurationsResponse -> ShowS
Prelude.Show, (forall x.
 ListRecommenderConfigurationsResponse
 -> Rep ListRecommenderConfigurationsResponse x)
-> (forall x.
    Rep ListRecommenderConfigurationsResponse x
    -> ListRecommenderConfigurationsResponse)
-> Generic ListRecommenderConfigurationsResponse
forall x.
Rep ListRecommenderConfigurationsResponse x
-> ListRecommenderConfigurationsResponse
forall x.
ListRecommenderConfigurationsResponse
-> Rep ListRecommenderConfigurationsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListRecommenderConfigurationsResponse x
-> ListRecommenderConfigurationsResponse
$cfrom :: forall x.
ListRecommenderConfigurationsResponse
-> Rep ListRecommenderConfigurationsResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListRecommenderConfigurationsResponse' 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', 'listRecommenderConfigurationsResponse_nextToken' - The string to use in a subsequent request to get the next page of
-- results in a paginated response. This value is null if there are no
-- additional pages.
--
-- 'item', 'listRecommenderConfigurationsResponse_item' - An array of responses, one for each recommender model configuration
-- that\'s associated with your Amazon Pinpoint account.
newListRecommenderConfigurationsResponse ::
  ListRecommenderConfigurationsResponse
newListRecommenderConfigurationsResponse :: ListRecommenderConfigurationsResponse
newListRecommenderConfigurationsResponse =
  ListRecommenderConfigurationsResponse' :: Maybe Text
-> [RecommenderConfigurationResponse]
-> ListRecommenderConfigurationsResponse
ListRecommenderConfigurationsResponse'
    { $sel:nextToken:ListRecommenderConfigurationsResponse' :: Maybe Text
nextToken =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:item:ListRecommenderConfigurationsResponse' :: [RecommenderConfigurationResponse]
item = [RecommenderConfigurationResponse]
forall a. Monoid a => a
Prelude.mempty
    }

-- | The string to use in a subsequent request to get the next page of
-- results in a paginated response. This value is null if there are no
-- additional pages.
listRecommenderConfigurationsResponse_nextToken :: Lens.Lens' ListRecommenderConfigurationsResponse (Prelude.Maybe Prelude.Text)
listRecommenderConfigurationsResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListRecommenderConfigurationsResponse
-> f ListRecommenderConfigurationsResponse
listRecommenderConfigurationsResponse_nextToken = (ListRecommenderConfigurationsResponse -> Maybe Text)
-> (ListRecommenderConfigurationsResponse
    -> Maybe Text -> ListRecommenderConfigurationsResponse)
-> Lens
     ListRecommenderConfigurationsResponse
     ListRecommenderConfigurationsResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListRecommenderConfigurationsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListRecommenderConfigurationsResponse' :: ListRecommenderConfigurationsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListRecommenderConfigurationsResponse
s@ListRecommenderConfigurationsResponse' {} Maybe Text
a -> ListRecommenderConfigurationsResponse
s {$sel:nextToken:ListRecommenderConfigurationsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListRecommenderConfigurationsResponse)

-- | An array of responses, one for each recommender model configuration
-- that\'s associated with your Amazon Pinpoint account.
listRecommenderConfigurationsResponse_item :: Lens.Lens' ListRecommenderConfigurationsResponse [RecommenderConfigurationResponse]
listRecommenderConfigurationsResponse_item :: ([RecommenderConfigurationResponse]
 -> f [RecommenderConfigurationResponse])
-> ListRecommenderConfigurationsResponse
-> f ListRecommenderConfigurationsResponse
listRecommenderConfigurationsResponse_item = (ListRecommenderConfigurationsResponse
 -> [RecommenderConfigurationResponse])
-> (ListRecommenderConfigurationsResponse
    -> [RecommenderConfigurationResponse]
    -> ListRecommenderConfigurationsResponse)
-> Lens
     ListRecommenderConfigurationsResponse
     ListRecommenderConfigurationsResponse
     [RecommenderConfigurationResponse]
     [RecommenderConfigurationResponse]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListRecommenderConfigurationsResponse' {[RecommenderConfigurationResponse]
item :: [RecommenderConfigurationResponse]
$sel:item:ListRecommenderConfigurationsResponse' :: ListRecommenderConfigurationsResponse
-> [RecommenderConfigurationResponse]
item} -> [RecommenderConfigurationResponse]
item) (\s :: ListRecommenderConfigurationsResponse
s@ListRecommenderConfigurationsResponse' {} [RecommenderConfigurationResponse]
a -> ListRecommenderConfigurationsResponse
s {$sel:item:ListRecommenderConfigurationsResponse' :: [RecommenderConfigurationResponse]
item = [RecommenderConfigurationResponse]
a} :: ListRecommenderConfigurationsResponse) (([RecommenderConfigurationResponse]
  -> f [RecommenderConfigurationResponse])
 -> ListRecommenderConfigurationsResponse
 -> f ListRecommenderConfigurationsResponse)
-> (([RecommenderConfigurationResponse]
     -> f [RecommenderConfigurationResponse])
    -> [RecommenderConfigurationResponse]
    -> f [RecommenderConfigurationResponse])
-> ([RecommenderConfigurationResponse]
    -> f [RecommenderConfigurationResponse])
-> ListRecommenderConfigurationsResponse
-> f ListRecommenderConfigurationsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([RecommenderConfigurationResponse]
 -> f [RecommenderConfigurationResponse])
-> [RecommenderConfigurationResponse]
-> f [RecommenderConfigurationResponse]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance
  Core.FromJSON
    ListRecommenderConfigurationsResponse
  where
  parseJSON :: Value -> Parser ListRecommenderConfigurationsResponse
parseJSON =
    String
-> (Object -> Parser ListRecommenderConfigurationsResponse)
-> Value
-> Parser ListRecommenderConfigurationsResponse
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"ListRecommenderConfigurationsResponse"
      ( \Object
x ->
          Maybe Text
-> [RecommenderConfigurationResponse]
-> ListRecommenderConfigurationsResponse
ListRecommenderConfigurationsResponse'
            (Maybe Text
 -> [RecommenderConfigurationResponse]
 -> ListRecommenderConfigurationsResponse)
-> Parser (Maybe Text)
-> Parser
     ([RecommenderConfigurationResponse]
      -> ListRecommenderConfigurationsResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"NextToken")
            Parser
  ([RecommenderConfigurationResponse]
   -> ListRecommenderConfigurationsResponse)
-> Parser [RecommenderConfigurationResponse]
-> Parser ListRecommenderConfigurationsResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe [RecommenderConfigurationResponse])
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Item" Parser (Maybe [RecommenderConfigurationResponse])
-> [RecommenderConfigurationResponse]
-> Parser [RecommenderConfigurationResponse]
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= [RecommenderConfigurationResponse]
forall a. Monoid a => a
Prelude.mempty)
      )

instance
  Prelude.Hashable
    ListRecommenderConfigurationsResponse

instance
  Prelude.NFData
    ListRecommenderConfigurationsResponse