{-# 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.Personalize.ListSolutions
-- 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 solutions that use the given dataset group. When a
-- dataset group is not specified, all the solutions associated with the
-- account are listed. The response provides the properties for each
-- solution, including the Amazon Resource Name (ARN). For more information
-- on solutions, see CreateSolution.
--
-- This operation returns paginated results.
module Amazonka.Personalize.ListSolutions
  ( -- * Creating a Request
    ListSolutions (..),
    newListSolutions,

    -- * Request Lenses
    listSolutions_nextToken,
    listSolutions_datasetGroupArn,
    listSolutions_maxResults,

    -- * Destructuring the Response
    ListSolutionsResponse (..),
    newListSolutionsResponse,

    -- * Response Lenses
    listSolutionsResponse_nextToken,
    listSolutionsResponse_solutions,
    listSolutionsResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.Personalize.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | /See:/ 'newListSolutions' smart constructor.
data ListSolutions = ListSolutions'
  { -- | A token returned from the previous call to @ListSolutions@ for getting
    -- the next set of solutions (if they exist).
    ListSolutions -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The Amazon Resource Name (ARN) of the dataset group.
    ListSolutions -> Maybe Text
datasetGroupArn :: Prelude.Maybe Prelude.Text,
    -- | The maximum number of solutions to return.
    ListSolutions -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural
  }
  deriving (ListSolutions -> ListSolutions -> Bool
(ListSolutions -> ListSolutions -> Bool)
-> (ListSolutions -> ListSolutions -> Bool) -> Eq ListSolutions
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListSolutions -> ListSolutions -> Bool
$c/= :: ListSolutions -> ListSolutions -> Bool
== :: ListSolutions -> ListSolutions -> Bool
$c== :: ListSolutions -> ListSolutions -> Bool
Prelude.Eq, ReadPrec [ListSolutions]
ReadPrec ListSolutions
Int -> ReadS ListSolutions
ReadS [ListSolutions]
(Int -> ReadS ListSolutions)
-> ReadS [ListSolutions]
-> ReadPrec ListSolutions
-> ReadPrec [ListSolutions]
-> Read ListSolutions
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListSolutions]
$creadListPrec :: ReadPrec [ListSolutions]
readPrec :: ReadPrec ListSolutions
$creadPrec :: ReadPrec ListSolutions
readList :: ReadS [ListSolutions]
$creadList :: ReadS [ListSolutions]
readsPrec :: Int -> ReadS ListSolutions
$creadsPrec :: Int -> ReadS ListSolutions
Prelude.Read, Int -> ListSolutions -> ShowS
[ListSolutions] -> ShowS
ListSolutions -> String
(Int -> ListSolutions -> ShowS)
-> (ListSolutions -> String)
-> ([ListSolutions] -> ShowS)
-> Show ListSolutions
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListSolutions] -> ShowS
$cshowList :: [ListSolutions] -> ShowS
show :: ListSolutions -> String
$cshow :: ListSolutions -> String
showsPrec :: Int -> ListSolutions -> ShowS
$cshowsPrec :: Int -> ListSolutions -> ShowS
Prelude.Show, (forall x. ListSolutions -> Rep ListSolutions x)
-> (forall x. Rep ListSolutions x -> ListSolutions)
-> Generic ListSolutions
forall x. Rep ListSolutions x -> ListSolutions
forall x. ListSolutions -> Rep ListSolutions x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListSolutions x -> ListSolutions
$cfrom :: forall x. ListSolutions -> Rep ListSolutions x
Prelude.Generic)

-- |
-- Create a value of 'ListSolutions' 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', 'listSolutions_nextToken' - A token returned from the previous call to @ListSolutions@ for getting
-- the next set of solutions (if they exist).
--
-- 'datasetGroupArn', 'listSolutions_datasetGroupArn' - The Amazon Resource Name (ARN) of the dataset group.
--
-- 'maxResults', 'listSolutions_maxResults' - The maximum number of solutions to return.
newListSolutions ::
  ListSolutions
newListSolutions :: ListSolutions
newListSolutions =
  ListSolutions' :: Maybe Text -> Maybe Text -> Maybe Natural -> ListSolutions
ListSolutions'
    { $sel:nextToken:ListSolutions' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:datasetGroupArn:ListSolutions' :: Maybe Text
datasetGroupArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:ListSolutions' :: Maybe Natural
maxResults = Maybe Natural
forall a. Maybe a
Prelude.Nothing
    }

-- | A token returned from the previous call to @ListSolutions@ for getting
-- the next set of solutions (if they exist).
listSolutions_nextToken :: Lens.Lens' ListSolutions (Prelude.Maybe Prelude.Text)
listSolutions_nextToken :: (Maybe Text -> f (Maybe Text)) -> ListSolutions -> f ListSolutions
listSolutions_nextToken = (ListSolutions -> Maybe Text)
-> (ListSolutions -> Maybe Text -> ListSolutions)
-> Lens ListSolutions ListSolutions (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListSolutions' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListSolutions' :: ListSolutions -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListSolutions
s@ListSolutions' {} Maybe Text
a -> ListSolutions
s {$sel:nextToken:ListSolutions' :: Maybe Text
nextToken = Maybe Text
a} :: ListSolutions)

-- | The Amazon Resource Name (ARN) of the dataset group.
listSolutions_datasetGroupArn :: Lens.Lens' ListSolutions (Prelude.Maybe Prelude.Text)
listSolutions_datasetGroupArn :: (Maybe Text -> f (Maybe Text)) -> ListSolutions -> f ListSolutions
listSolutions_datasetGroupArn = (ListSolutions -> Maybe Text)
-> (ListSolutions -> Maybe Text -> ListSolutions)
-> Lens ListSolutions ListSolutions (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListSolutions' {Maybe Text
datasetGroupArn :: Maybe Text
$sel:datasetGroupArn:ListSolutions' :: ListSolutions -> Maybe Text
datasetGroupArn} -> Maybe Text
datasetGroupArn) (\s :: ListSolutions
s@ListSolutions' {} Maybe Text
a -> ListSolutions
s {$sel:datasetGroupArn:ListSolutions' :: Maybe Text
datasetGroupArn = Maybe Text
a} :: ListSolutions)

-- | The maximum number of solutions to return.
listSolutions_maxResults :: Lens.Lens' ListSolutions (Prelude.Maybe Prelude.Natural)
listSolutions_maxResults :: (Maybe Natural -> f (Maybe Natural))
-> ListSolutions -> f ListSolutions
listSolutions_maxResults = (ListSolutions -> Maybe Natural)
-> (ListSolutions -> Maybe Natural -> ListSolutions)
-> Lens ListSolutions ListSolutions (Maybe Natural) (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListSolutions' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:ListSolutions' :: ListSolutions -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: ListSolutions
s@ListSolutions' {} Maybe Natural
a -> ListSolutions
s {$sel:maxResults:ListSolutions' :: Maybe Natural
maxResults = Maybe Natural
a} :: ListSolutions)

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

instance Prelude.NFData ListSolutions

instance Core.ToHeaders ListSolutions where
  toHeaders :: ListSolutions -> ResponseHeaders
toHeaders =
    ResponseHeaders -> ListSolutions -> 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
"AmazonPersonalize.ListSolutions" ::
                          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 ListSolutions where
  toJSON :: ListSolutions -> Value
toJSON ListSolutions' {Maybe Natural
Maybe Text
maxResults :: Maybe Natural
datasetGroupArn :: Maybe Text
nextToken :: Maybe Text
$sel:maxResults:ListSolutions' :: ListSolutions -> Maybe Natural
$sel:datasetGroupArn:ListSolutions' :: ListSolutions -> Maybe Text
$sel:nextToken:ListSolutions' :: ListSolutions -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (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
"datasetGroupArn" 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
datasetGroupArn,
            (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 ListSolutions where
  toPath :: ListSolutions -> ByteString
toPath = ByteString -> ListSolutions -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"

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

-- | /See:/ 'newListSolutionsResponse' smart constructor.
data ListSolutionsResponse = ListSolutionsResponse'
  { -- | A token for getting the next set of solutions (if they exist).
    ListSolutionsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | A list of the current solutions.
    ListSolutionsResponse -> Maybe [SolutionSummary]
solutions :: Prelude.Maybe [SolutionSummary],
    -- | The response's http status code.
    ListSolutionsResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (ListSolutionsResponse -> ListSolutionsResponse -> Bool
(ListSolutionsResponse -> ListSolutionsResponse -> Bool)
-> (ListSolutionsResponse -> ListSolutionsResponse -> Bool)
-> Eq ListSolutionsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListSolutionsResponse -> ListSolutionsResponse -> Bool
$c/= :: ListSolutionsResponse -> ListSolutionsResponse -> Bool
== :: ListSolutionsResponse -> ListSolutionsResponse -> Bool
$c== :: ListSolutionsResponse -> ListSolutionsResponse -> Bool
Prelude.Eq, ReadPrec [ListSolutionsResponse]
ReadPrec ListSolutionsResponse
Int -> ReadS ListSolutionsResponse
ReadS [ListSolutionsResponse]
(Int -> ReadS ListSolutionsResponse)
-> ReadS [ListSolutionsResponse]
-> ReadPrec ListSolutionsResponse
-> ReadPrec [ListSolutionsResponse]
-> Read ListSolutionsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListSolutionsResponse]
$creadListPrec :: ReadPrec [ListSolutionsResponse]
readPrec :: ReadPrec ListSolutionsResponse
$creadPrec :: ReadPrec ListSolutionsResponse
readList :: ReadS [ListSolutionsResponse]
$creadList :: ReadS [ListSolutionsResponse]
readsPrec :: Int -> ReadS ListSolutionsResponse
$creadsPrec :: Int -> ReadS ListSolutionsResponse
Prelude.Read, Int -> ListSolutionsResponse -> ShowS
[ListSolutionsResponse] -> ShowS
ListSolutionsResponse -> String
(Int -> ListSolutionsResponse -> ShowS)
-> (ListSolutionsResponse -> String)
-> ([ListSolutionsResponse] -> ShowS)
-> Show ListSolutionsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListSolutionsResponse] -> ShowS
$cshowList :: [ListSolutionsResponse] -> ShowS
show :: ListSolutionsResponse -> String
$cshow :: ListSolutionsResponse -> String
showsPrec :: Int -> ListSolutionsResponse -> ShowS
$cshowsPrec :: Int -> ListSolutionsResponse -> ShowS
Prelude.Show, (forall x. ListSolutionsResponse -> Rep ListSolutionsResponse x)
-> (forall x. Rep ListSolutionsResponse x -> ListSolutionsResponse)
-> Generic ListSolutionsResponse
forall x. Rep ListSolutionsResponse x -> ListSolutionsResponse
forall x. ListSolutionsResponse -> Rep ListSolutionsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListSolutionsResponse x -> ListSolutionsResponse
$cfrom :: forall x. ListSolutionsResponse -> Rep ListSolutionsResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListSolutionsResponse' 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', 'listSolutionsResponse_nextToken' - A token for getting the next set of solutions (if they exist).
--
-- 'solutions', 'listSolutionsResponse_solutions' - A list of the current solutions.
--
-- 'httpStatus', 'listSolutionsResponse_httpStatus' - The response's http status code.
newListSolutionsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListSolutionsResponse
newListSolutionsResponse :: Int -> ListSolutionsResponse
newListSolutionsResponse Int
pHttpStatus_ =
  ListSolutionsResponse' :: Maybe Text
-> Maybe [SolutionSummary] -> Int -> ListSolutionsResponse
ListSolutionsResponse'
    { $sel:nextToken:ListSolutionsResponse' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:solutions:ListSolutionsResponse' :: Maybe [SolutionSummary]
solutions = Maybe [SolutionSummary]
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListSolutionsResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | A token for getting the next set of solutions (if they exist).
listSolutionsResponse_nextToken :: Lens.Lens' ListSolutionsResponse (Prelude.Maybe Prelude.Text)
listSolutionsResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListSolutionsResponse -> f ListSolutionsResponse
listSolutionsResponse_nextToken = (ListSolutionsResponse -> Maybe Text)
-> (ListSolutionsResponse -> Maybe Text -> ListSolutionsResponse)
-> Lens' ListSolutionsResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListSolutionsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListSolutionsResponse' :: ListSolutionsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListSolutionsResponse
s@ListSolutionsResponse' {} Maybe Text
a -> ListSolutionsResponse
s {$sel:nextToken:ListSolutionsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListSolutionsResponse)

-- | A list of the current solutions.
listSolutionsResponse_solutions :: Lens.Lens' ListSolutionsResponse (Prelude.Maybe [SolutionSummary])
listSolutionsResponse_solutions :: (Maybe [SolutionSummary] -> f (Maybe [SolutionSummary]))
-> ListSolutionsResponse -> f ListSolutionsResponse
listSolutionsResponse_solutions = (ListSolutionsResponse -> Maybe [SolutionSummary])
-> (ListSolutionsResponse
    -> Maybe [SolutionSummary] -> ListSolutionsResponse)
-> Lens' ListSolutionsResponse (Maybe [SolutionSummary])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListSolutionsResponse' {Maybe [SolutionSummary]
solutions :: Maybe [SolutionSummary]
$sel:solutions:ListSolutionsResponse' :: ListSolutionsResponse -> Maybe [SolutionSummary]
solutions} -> Maybe [SolutionSummary]
solutions) (\s :: ListSolutionsResponse
s@ListSolutionsResponse' {} Maybe [SolutionSummary]
a -> ListSolutionsResponse
s {$sel:solutions:ListSolutionsResponse' :: Maybe [SolutionSummary]
solutions = Maybe [SolutionSummary]
a} :: ListSolutionsResponse) ((Maybe [SolutionSummary] -> f (Maybe [SolutionSummary]))
 -> ListSolutionsResponse -> f ListSolutionsResponse)
-> ((Maybe [SolutionSummary] -> f (Maybe [SolutionSummary]))
    -> Maybe [SolutionSummary] -> f (Maybe [SolutionSummary]))
-> (Maybe [SolutionSummary] -> f (Maybe [SolutionSummary]))
-> ListSolutionsResponse
-> f ListSolutionsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [SolutionSummary]
  [SolutionSummary]
  [SolutionSummary]
  [SolutionSummary]
-> Iso
     (Maybe [SolutionSummary])
     (Maybe [SolutionSummary])
     (Maybe [SolutionSummary])
     (Maybe [SolutionSummary])
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
  [SolutionSummary]
  [SolutionSummary]
  [SolutionSummary]
  [SolutionSummary]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

instance Prelude.NFData ListSolutionsResponse