{-# 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-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.Pinpoint.Types.ListRecommenderConfigurationsResponse where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
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
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]
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
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.
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'
    { $sel:nextToken:ListRecommenderConfigurationsResponse' :: Maybe Text
nextToken =
        forall a. Maybe a
Prelude.Nothing,
      $sel:item:ListRecommenderConfigurationsResponse' :: [RecommenderConfigurationResponse]
item = 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 :: Lens' ListRecommenderConfigurationsResponse (Maybe Text)
listRecommenderConfigurationsResponse_nextToken = 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 :: Lens'
  ListRecommenderConfigurationsResponse
  [RecommenderConfigurationResponse]
listRecommenderConfigurationsResponse_item = 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) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

instance
  Prelude.Hashable
    ListRecommenderConfigurationsResponse
  where
  hashWithSalt :: Int -> ListRecommenderConfigurationsResponse -> Int
hashWithSalt
    Int
_salt
    ListRecommenderConfigurationsResponse' {[RecommenderConfigurationResponse]
Maybe Text
item :: [RecommenderConfigurationResponse]
nextToken :: Maybe Text
$sel:item:ListRecommenderConfigurationsResponse' :: ListRecommenderConfigurationsResponse
-> [RecommenderConfigurationResponse]
$sel:nextToken:ListRecommenderConfigurationsResponse' :: ListRecommenderConfigurationsResponse -> Maybe Text
..} =
      Int
_salt
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
nextToken
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` [RecommenderConfigurationResponse]
item

instance
  Prelude.NFData
    ListRecommenderConfigurationsResponse
  where
  rnf :: ListRecommenderConfigurationsResponse -> ()
rnf ListRecommenderConfigurationsResponse' {[RecommenderConfigurationResponse]
Maybe Text
item :: [RecommenderConfigurationResponse]
nextToken :: Maybe Text
$sel:item:ListRecommenderConfigurationsResponse' :: ListRecommenderConfigurationsResponse
-> [RecommenderConfigurationResponse]
$sel:nextToken:ListRecommenderConfigurationsResponse' :: ListRecommenderConfigurationsResponse -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
nextToken
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf [RecommenderConfigurationResponse]
item