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

    -- * Request Lenses
    listSolutionVersions_solutionArn,
    listSolutionVersions_nextToken,
    listSolutionVersions_maxResults,

    -- * Destructuring the Response
    ListSolutionVersionsResponse (..),
    newListSolutionVersionsResponse,

    -- * Response Lenses
    listSolutionVersionsResponse_nextToken,
    listSolutionVersionsResponse_solutionVersions,
    listSolutionVersionsResponse_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:/ 'newListSolutionVersions' smart constructor.
data ListSolutionVersions = ListSolutionVersions'
  { -- | The Amazon Resource Name (ARN) of the solution.
    ListSolutionVersions -> Maybe Text
solutionArn :: Prelude.Maybe Prelude.Text,
    -- | A token returned from the previous call to @ListSolutionVersions@ for
    -- getting the next set of solution versions (if they exist).
    ListSolutionVersions -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The maximum number of solution versions to return.
    ListSolutionVersions -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural
  }
  deriving (ListSolutionVersions -> ListSolutionVersions -> Bool
(ListSolutionVersions -> ListSolutionVersions -> Bool)
-> (ListSolutionVersions -> ListSolutionVersions -> Bool)
-> Eq ListSolutionVersions
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListSolutionVersions -> ListSolutionVersions -> Bool
$c/= :: ListSolutionVersions -> ListSolutionVersions -> Bool
== :: ListSolutionVersions -> ListSolutionVersions -> Bool
$c== :: ListSolutionVersions -> ListSolutionVersions -> Bool
Prelude.Eq, ReadPrec [ListSolutionVersions]
ReadPrec ListSolutionVersions
Int -> ReadS ListSolutionVersions
ReadS [ListSolutionVersions]
(Int -> ReadS ListSolutionVersions)
-> ReadS [ListSolutionVersions]
-> ReadPrec ListSolutionVersions
-> ReadPrec [ListSolutionVersions]
-> Read ListSolutionVersions
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListSolutionVersions]
$creadListPrec :: ReadPrec [ListSolutionVersions]
readPrec :: ReadPrec ListSolutionVersions
$creadPrec :: ReadPrec ListSolutionVersions
readList :: ReadS [ListSolutionVersions]
$creadList :: ReadS [ListSolutionVersions]
readsPrec :: Int -> ReadS ListSolutionVersions
$creadsPrec :: Int -> ReadS ListSolutionVersions
Prelude.Read, Int -> ListSolutionVersions -> ShowS
[ListSolutionVersions] -> ShowS
ListSolutionVersions -> String
(Int -> ListSolutionVersions -> ShowS)
-> (ListSolutionVersions -> String)
-> ([ListSolutionVersions] -> ShowS)
-> Show ListSolutionVersions
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListSolutionVersions] -> ShowS
$cshowList :: [ListSolutionVersions] -> ShowS
show :: ListSolutionVersions -> String
$cshow :: ListSolutionVersions -> String
showsPrec :: Int -> ListSolutionVersions -> ShowS
$cshowsPrec :: Int -> ListSolutionVersions -> ShowS
Prelude.Show, (forall x. ListSolutionVersions -> Rep ListSolutionVersions x)
-> (forall x. Rep ListSolutionVersions x -> ListSolutionVersions)
-> Generic ListSolutionVersions
forall x. Rep ListSolutionVersions x -> ListSolutionVersions
forall x. ListSolutionVersions -> Rep ListSolutionVersions x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListSolutionVersions x -> ListSolutionVersions
$cfrom :: forall x. ListSolutionVersions -> Rep ListSolutionVersions x
Prelude.Generic)

-- |
-- Create a value of 'ListSolutionVersions' 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:
--
-- 'solutionArn', 'listSolutionVersions_solutionArn' - The Amazon Resource Name (ARN) of the solution.
--
-- 'nextToken', 'listSolutionVersions_nextToken' - A token returned from the previous call to @ListSolutionVersions@ for
-- getting the next set of solution versions (if they exist).
--
-- 'maxResults', 'listSolutionVersions_maxResults' - The maximum number of solution versions to return.
newListSolutionVersions ::
  ListSolutionVersions
newListSolutionVersions :: ListSolutionVersions
newListSolutionVersions =
  ListSolutionVersions' :: Maybe Text -> Maybe Text -> Maybe Natural -> ListSolutionVersions
ListSolutionVersions'
    { $sel:solutionArn:ListSolutionVersions' :: Maybe Text
solutionArn =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListSolutionVersions' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:ListSolutionVersions' :: Maybe Natural
maxResults = Maybe Natural
forall a. Maybe a
Prelude.Nothing
    }

-- | The Amazon Resource Name (ARN) of the solution.
listSolutionVersions_solutionArn :: Lens.Lens' ListSolutionVersions (Prelude.Maybe Prelude.Text)
listSolutionVersions_solutionArn :: (Maybe Text -> f (Maybe Text))
-> ListSolutionVersions -> f ListSolutionVersions
listSolutionVersions_solutionArn = (ListSolutionVersions -> Maybe Text)
-> (ListSolutionVersions -> Maybe Text -> ListSolutionVersions)
-> Lens
     ListSolutionVersions ListSolutionVersions (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListSolutionVersions' {Maybe Text
solutionArn :: Maybe Text
$sel:solutionArn:ListSolutionVersions' :: ListSolutionVersions -> Maybe Text
solutionArn} -> Maybe Text
solutionArn) (\s :: ListSolutionVersions
s@ListSolutionVersions' {} Maybe Text
a -> ListSolutionVersions
s {$sel:solutionArn:ListSolutionVersions' :: Maybe Text
solutionArn = Maybe Text
a} :: ListSolutionVersions)

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

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

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

instance Prelude.NFData ListSolutionVersions

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

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

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

-- |
-- Create a value of 'ListSolutionVersionsResponse' 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', 'listSolutionVersionsResponse_nextToken' - A token for getting the next set of solution versions (if they exist).
--
-- 'solutionVersions', 'listSolutionVersionsResponse_solutionVersions' - A list of solution versions describing the version properties.
--
-- 'httpStatus', 'listSolutionVersionsResponse_httpStatus' - The response's http status code.
newListSolutionVersionsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListSolutionVersionsResponse
newListSolutionVersionsResponse :: Int -> ListSolutionVersionsResponse
newListSolutionVersionsResponse Int
pHttpStatus_ =
  ListSolutionVersionsResponse' :: Maybe Text
-> Maybe [SolutionVersionSummary]
-> Int
-> ListSolutionVersionsResponse
ListSolutionVersionsResponse'
    { $sel:nextToken:ListSolutionVersionsResponse' :: Maybe Text
nextToken =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:solutionVersions:ListSolutionVersionsResponse' :: Maybe [SolutionVersionSummary]
solutionVersions = Maybe [SolutionVersionSummary]
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListSolutionVersionsResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

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

-- | A list of solution versions describing the version properties.
listSolutionVersionsResponse_solutionVersions :: Lens.Lens' ListSolutionVersionsResponse (Prelude.Maybe [SolutionVersionSummary])
listSolutionVersionsResponse_solutionVersions :: (Maybe [SolutionVersionSummary]
 -> f (Maybe [SolutionVersionSummary]))
-> ListSolutionVersionsResponse -> f ListSolutionVersionsResponse
listSolutionVersionsResponse_solutionVersions = (ListSolutionVersionsResponse -> Maybe [SolutionVersionSummary])
-> (ListSolutionVersionsResponse
    -> Maybe [SolutionVersionSummary] -> ListSolutionVersionsResponse)
-> Lens'
     ListSolutionVersionsResponse (Maybe [SolutionVersionSummary])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListSolutionVersionsResponse' {Maybe [SolutionVersionSummary]
solutionVersions :: Maybe [SolutionVersionSummary]
$sel:solutionVersions:ListSolutionVersionsResponse' :: ListSolutionVersionsResponse -> Maybe [SolutionVersionSummary]
solutionVersions} -> Maybe [SolutionVersionSummary]
solutionVersions) (\s :: ListSolutionVersionsResponse
s@ListSolutionVersionsResponse' {} Maybe [SolutionVersionSummary]
a -> ListSolutionVersionsResponse
s {$sel:solutionVersions:ListSolutionVersionsResponse' :: Maybe [SolutionVersionSummary]
solutionVersions = Maybe [SolutionVersionSummary]
a} :: ListSolutionVersionsResponse) ((Maybe [SolutionVersionSummary]
  -> f (Maybe [SolutionVersionSummary]))
 -> ListSolutionVersionsResponse -> f ListSolutionVersionsResponse)
-> ((Maybe [SolutionVersionSummary]
     -> f (Maybe [SolutionVersionSummary]))
    -> Maybe [SolutionVersionSummary]
    -> f (Maybe [SolutionVersionSummary]))
-> (Maybe [SolutionVersionSummary]
    -> f (Maybe [SolutionVersionSummary]))
-> ListSolutionVersionsResponse
-> f ListSolutionVersionsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [SolutionVersionSummary]
  [SolutionVersionSummary]
  [SolutionVersionSummary]
  [SolutionVersionSummary]
-> Iso
     (Maybe [SolutionVersionSummary])
     (Maybe [SolutionVersionSummary])
     (Maybe [SolutionVersionSummary])
     (Maybe [SolutionVersionSummary])
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
  [SolutionVersionSummary]
  [SolutionVersionSummary]
  [SolutionVersionSummary]
  [SolutionVersionSummary]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

instance Prelude.NFData ListSolutionVersionsResponse