{-# 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.DataBrew.ListRecipeVersions
-- 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)
--
-- Lists the versions of a particular DataBrew recipe, except for
-- @LATEST_WORKING@.
--
-- This operation returns paginated results.
module Amazonka.DataBrew.ListRecipeVersions
  ( -- * Creating a Request
    ListRecipeVersions (..),
    newListRecipeVersions,

    -- * Request Lenses
    listRecipeVersions_nextToken,
    listRecipeVersions_maxResults,
    listRecipeVersions_name,

    -- * Destructuring the Response
    ListRecipeVersionsResponse (..),
    newListRecipeVersionsResponse,

    -- * Response Lenses
    listRecipeVersionsResponse_nextToken,
    listRecipeVersionsResponse_httpStatus,
    listRecipeVersionsResponse_recipes,
  )
where

import qualified Amazonka.Core as Core
import Amazonka.DataBrew.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:/ 'newListRecipeVersions' smart constructor.
data ListRecipeVersions = ListRecipeVersions'
  { -- | The token returned by a previous call to retrieve the next set of
    -- results.
    ListRecipeVersions -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The maximum number of results to return in this request.
    ListRecipeVersions -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
    -- | The name of the recipe for which to return version information.
    ListRecipeVersions -> Text
name :: Prelude.Text
  }
  deriving (ListRecipeVersions -> ListRecipeVersions -> Bool
(ListRecipeVersions -> ListRecipeVersions -> Bool)
-> (ListRecipeVersions -> ListRecipeVersions -> Bool)
-> Eq ListRecipeVersions
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListRecipeVersions -> ListRecipeVersions -> Bool
$c/= :: ListRecipeVersions -> ListRecipeVersions -> Bool
== :: ListRecipeVersions -> ListRecipeVersions -> Bool
$c== :: ListRecipeVersions -> ListRecipeVersions -> Bool
Prelude.Eq, ReadPrec [ListRecipeVersions]
ReadPrec ListRecipeVersions
Int -> ReadS ListRecipeVersions
ReadS [ListRecipeVersions]
(Int -> ReadS ListRecipeVersions)
-> ReadS [ListRecipeVersions]
-> ReadPrec ListRecipeVersions
-> ReadPrec [ListRecipeVersions]
-> Read ListRecipeVersions
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListRecipeVersions]
$creadListPrec :: ReadPrec [ListRecipeVersions]
readPrec :: ReadPrec ListRecipeVersions
$creadPrec :: ReadPrec ListRecipeVersions
readList :: ReadS [ListRecipeVersions]
$creadList :: ReadS [ListRecipeVersions]
readsPrec :: Int -> ReadS ListRecipeVersions
$creadsPrec :: Int -> ReadS ListRecipeVersions
Prelude.Read, Int -> ListRecipeVersions -> ShowS
[ListRecipeVersions] -> ShowS
ListRecipeVersions -> String
(Int -> ListRecipeVersions -> ShowS)
-> (ListRecipeVersions -> String)
-> ([ListRecipeVersions] -> ShowS)
-> Show ListRecipeVersions
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListRecipeVersions] -> ShowS
$cshowList :: [ListRecipeVersions] -> ShowS
show :: ListRecipeVersions -> String
$cshow :: ListRecipeVersions -> String
showsPrec :: Int -> ListRecipeVersions -> ShowS
$cshowsPrec :: Int -> ListRecipeVersions -> ShowS
Prelude.Show, (forall x. ListRecipeVersions -> Rep ListRecipeVersions x)
-> (forall x. Rep ListRecipeVersions x -> ListRecipeVersions)
-> Generic ListRecipeVersions
forall x. Rep ListRecipeVersions x -> ListRecipeVersions
forall x. ListRecipeVersions -> Rep ListRecipeVersions x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListRecipeVersions x -> ListRecipeVersions
$cfrom :: forall x. ListRecipeVersions -> Rep ListRecipeVersions x
Prelude.Generic)

-- |
-- Create a value of 'ListRecipeVersions' 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', 'listRecipeVersions_nextToken' - The token returned by a previous call to retrieve the next set of
-- results.
--
-- 'maxResults', 'listRecipeVersions_maxResults' - The maximum number of results to return in this request.
--
-- 'name', 'listRecipeVersions_name' - The name of the recipe for which to return version information.
newListRecipeVersions ::
  -- | 'name'
  Prelude.Text ->
  ListRecipeVersions
newListRecipeVersions :: Text -> ListRecipeVersions
newListRecipeVersions Text
pName_ =
  ListRecipeVersions' :: Maybe Text -> Maybe Natural -> Text -> ListRecipeVersions
ListRecipeVersions'
    { $sel:nextToken:ListRecipeVersions' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:ListRecipeVersions' :: Maybe Natural
maxResults = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:name:ListRecipeVersions' :: Text
name = Text
pName_
    }

-- | The token returned by a previous call to retrieve the next set of
-- results.
listRecipeVersions_nextToken :: Lens.Lens' ListRecipeVersions (Prelude.Maybe Prelude.Text)
listRecipeVersions_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListRecipeVersions -> f ListRecipeVersions
listRecipeVersions_nextToken = (ListRecipeVersions -> Maybe Text)
-> (ListRecipeVersions -> Maybe Text -> ListRecipeVersions)
-> Lens
     ListRecipeVersions ListRecipeVersions (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListRecipeVersions' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListRecipeVersions' :: ListRecipeVersions -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListRecipeVersions
s@ListRecipeVersions' {} Maybe Text
a -> ListRecipeVersions
s {$sel:nextToken:ListRecipeVersions' :: Maybe Text
nextToken = Maybe Text
a} :: ListRecipeVersions)

-- | The maximum number of results to return in this request.
listRecipeVersions_maxResults :: Lens.Lens' ListRecipeVersions (Prelude.Maybe Prelude.Natural)
listRecipeVersions_maxResults :: (Maybe Natural -> f (Maybe Natural))
-> ListRecipeVersions -> f ListRecipeVersions
listRecipeVersions_maxResults = (ListRecipeVersions -> Maybe Natural)
-> (ListRecipeVersions -> Maybe Natural -> ListRecipeVersions)
-> Lens
     ListRecipeVersions
     ListRecipeVersions
     (Maybe Natural)
     (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListRecipeVersions' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:ListRecipeVersions' :: ListRecipeVersions -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: ListRecipeVersions
s@ListRecipeVersions' {} Maybe Natural
a -> ListRecipeVersions
s {$sel:maxResults:ListRecipeVersions' :: Maybe Natural
maxResults = Maybe Natural
a} :: ListRecipeVersions)

-- | The name of the recipe for which to return version information.
listRecipeVersions_name :: Lens.Lens' ListRecipeVersions Prelude.Text
listRecipeVersions_name :: (Text -> f Text) -> ListRecipeVersions -> f ListRecipeVersions
listRecipeVersions_name = (ListRecipeVersions -> Text)
-> (ListRecipeVersions -> Text -> ListRecipeVersions)
-> Lens ListRecipeVersions ListRecipeVersions Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListRecipeVersions' {Text
name :: Text
$sel:name:ListRecipeVersions' :: ListRecipeVersions -> Text
name} -> Text
name) (\s :: ListRecipeVersions
s@ListRecipeVersions' {} Text
a -> ListRecipeVersions
s {$sel:name:ListRecipeVersions' :: Text
name = Text
a} :: ListRecipeVersions)

instance Core.AWSPager ListRecipeVersions where
  page :: ListRecipeVersions
-> AWSResponse ListRecipeVersions -> Maybe ListRecipeVersions
page ListRecipeVersions
rq AWSResponse ListRecipeVersions
rs
    | Maybe Text -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListRecipeVersions
ListRecipeVersionsResponse
rs
            ListRecipeVersionsResponse
-> Getting (First Text) ListRecipeVersionsResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListRecipeVersionsResponse
-> Const (First Text) ListRecipeVersionsResponse
Lens' ListRecipeVersionsResponse (Maybe Text)
listRecipeVersionsResponse_nextToken
              ((Maybe Text -> Const (First Text) (Maybe Text))
 -> ListRecipeVersionsResponse
 -> Const (First Text) ListRecipeVersionsResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListRecipeVersionsResponse 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 ListRecipeVersions
forall a. Maybe a
Prelude.Nothing
    | [Recipe] -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        (AWSResponse ListRecipeVersions
ListRecipeVersionsResponse
rs ListRecipeVersionsResponse
-> Getting [Recipe] ListRecipeVersionsResponse [Recipe] -> [Recipe]
forall s a. s -> Getting a s a -> a
Lens.^. Getting [Recipe] ListRecipeVersionsResponse [Recipe]
Lens' ListRecipeVersionsResponse [Recipe]
listRecipeVersionsResponse_recipes) =
      Maybe ListRecipeVersions
forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
      ListRecipeVersions -> Maybe ListRecipeVersions
forall a. a -> Maybe a
Prelude.Just (ListRecipeVersions -> Maybe ListRecipeVersions)
-> ListRecipeVersions -> Maybe ListRecipeVersions
forall a b. (a -> b) -> a -> b
Prelude.$
        ListRecipeVersions
rq
          ListRecipeVersions
-> (ListRecipeVersions -> ListRecipeVersions) -> ListRecipeVersions
forall a b. a -> (a -> b) -> b
Prelude.& (Maybe Text -> Identity (Maybe Text))
-> ListRecipeVersions -> Identity ListRecipeVersions
Lens
  ListRecipeVersions ListRecipeVersions (Maybe Text) (Maybe Text)
listRecipeVersions_nextToken
          ((Maybe Text -> Identity (Maybe Text))
 -> ListRecipeVersions -> Identity ListRecipeVersions)
-> Maybe Text -> ListRecipeVersions -> ListRecipeVersions
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListRecipeVersions
ListRecipeVersionsResponse
rs
          ListRecipeVersionsResponse
-> Getting (First Text) ListRecipeVersionsResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListRecipeVersionsResponse
-> Const (First Text) ListRecipeVersionsResponse
Lens' ListRecipeVersionsResponse (Maybe Text)
listRecipeVersionsResponse_nextToken
            ((Maybe Text -> Const (First Text) (Maybe Text))
 -> ListRecipeVersionsResponse
 -> Const (First Text) ListRecipeVersionsResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListRecipeVersionsResponse 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 ListRecipeVersions where
  type
    AWSResponse ListRecipeVersions =
      ListRecipeVersionsResponse
  request :: ListRecipeVersions -> Request ListRecipeVersions
request = Service -> ListRecipeVersions -> Request ListRecipeVersions
forall a. ToRequest a => Service -> a -> Request a
Request.get Service
defaultService
  response :: Logger
-> Service
-> Proxy ListRecipeVersions
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse ListRecipeVersions)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse ListRecipeVersions))
-> Logger
-> Service
-> Proxy ListRecipeVersions
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse ListRecipeVersions)))
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 -> Int -> [Recipe] -> ListRecipeVersionsResponse
ListRecipeVersionsResponse'
            (Maybe Text -> Int -> [Recipe] -> ListRecipeVersionsResponse)
-> Either String (Maybe Text)
-> Either String (Int -> [Recipe] -> ListRecipeVersionsResponse)
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 (Int -> [Recipe] -> ListRecipeVersionsResponse)
-> Either String Int
-> Either String ([Recipe] -> ListRecipeVersionsResponse)
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))
            Either String ([Recipe] -> ListRecipeVersionsResponse)
-> Either String [Recipe]
-> Either String ListRecipeVersionsResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe [Recipe])
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"Recipes" Either String (Maybe [Recipe])
-> [Recipe] -> Either String [Recipe]
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ [Recipe]
forall a. Monoid a => a
Prelude.mempty)
      )

instance Prelude.Hashable ListRecipeVersions

instance Prelude.NFData ListRecipeVersions

instance Core.ToHeaders ListRecipeVersions where
  toHeaders :: ListRecipeVersions -> ResponseHeaders
toHeaders =
    ResponseHeaders -> ListRecipeVersions -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
      ( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ 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.ToPath ListRecipeVersions where
  toPath :: ListRecipeVersions -> ByteString
toPath = ByteString -> ListRecipeVersions -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/recipeVersions"

instance Core.ToQuery ListRecipeVersions where
  toQuery :: ListRecipeVersions -> QueryString
toQuery ListRecipeVersions' {Maybe Natural
Maybe Text
Text
name :: Text
maxResults :: Maybe Natural
nextToken :: Maybe Text
$sel:name:ListRecipeVersions' :: ListRecipeVersions -> Text
$sel:maxResults:ListRecipeVersions' :: ListRecipeVersions -> Maybe Natural
$sel:nextToken:ListRecipeVersions' :: ListRecipeVersions -> Maybe Text
..} =
    [QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"nextToken" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
nextToken,
        ByteString
"maxResults" ByteString -> Maybe Natural -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Natural
maxResults,
        ByteString
"name" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
name
      ]

-- | /See:/ 'newListRecipeVersionsResponse' smart constructor.
data ListRecipeVersionsResponse = ListRecipeVersionsResponse'
  { -- | A token that you can use in a subsequent call to retrieve the next set
    -- of results.
    ListRecipeVersionsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    ListRecipeVersionsResponse -> Int
httpStatus :: Prelude.Int,
    -- | A list of versions for the specified recipe.
    ListRecipeVersionsResponse -> [Recipe]
recipes :: [Recipe]
  }
  deriving (ListRecipeVersionsResponse -> ListRecipeVersionsResponse -> Bool
(ListRecipeVersionsResponse -> ListRecipeVersionsResponse -> Bool)
-> (ListRecipeVersionsResponse
    -> ListRecipeVersionsResponse -> Bool)
-> Eq ListRecipeVersionsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListRecipeVersionsResponse -> ListRecipeVersionsResponse -> Bool
$c/= :: ListRecipeVersionsResponse -> ListRecipeVersionsResponse -> Bool
== :: ListRecipeVersionsResponse -> ListRecipeVersionsResponse -> Bool
$c== :: ListRecipeVersionsResponse -> ListRecipeVersionsResponse -> Bool
Prelude.Eq, ReadPrec [ListRecipeVersionsResponse]
ReadPrec ListRecipeVersionsResponse
Int -> ReadS ListRecipeVersionsResponse
ReadS [ListRecipeVersionsResponse]
(Int -> ReadS ListRecipeVersionsResponse)
-> ReadS [ListRecipeVersionsResponse]
-> ReadPrec ListRecipeVersionsResponse
-> ReadPrec [ListRecipeVersionsResponse]
-> Read ListRecipeVersionsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListRecipeVersionsResponse]
$creadListPrec :: ReadPrec [ListRecipeVersionsResponse]
readPrec :: ReadPrec ListRecipeVersionsResponse
$creadPrec :: ReadPrec ListRecipeVersionsResponse
readList :: ReadS [ListRecipeVersionsResponse]
$creadList :: ReadS [ListRecipeVersionsResponse]
readsPrec :: Int -> ReadS ListRecipeVersionsResponse
$creadsPrec :: Int -> ReadS ListRecipeVersionsResponse
Prelude.Read, Int -> ListRecipeVersionsResponse -> ShowS
[ListRecipeVersionsResponse] -> ShowS
ListRecipeVersionsResponse -> String
(Int -> ListRecipeVersionsResponse -> ShowS)
-> (ListRecipeVersionsResponse -> String)
-> ([ListRecipeVersionsResponse] -> ShowS)
-> Show ListRecipeVersionsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListRecipeVersionsResponse] -> ShowS
$cshowList :: [ListRecipeVersionsResponse] -> ShowS
show :: ListRecipeVersionsResponse -> String
$cshow :: ListRecipeVersionsResponse -> String
showsPrec :: Int -> ListRecipeVersionsResponse -> ShowS
$cshowsPrec :: Int -> ListRecipeVersionsResponse -> ShowS
Prelude.Show, (forall x.
 ListRecipeVersionsResponse -> Rep ListRecipeVersionsResponse x)
-> (forall x.
    Rep ListRecipeVersionsResponse x -> ListRecipeVersionsResponse)
-> Generic ListRecipeVersionsResponse
forall x.
Rep ListRecipeVersionsResponse x -> ListRecipeVersionsResponse
forall x.
ListRecipeVersionsResponse -> Rep ListRecipeVersionsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListRecipeVersionsResponse x -> ListRecipeVersionsResponse
$cfrom :: forall x.
ListRecipeVersionsResponse -> Rep ListRecipeVersionsResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListRecipeVersionsResponse' 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', 'listRecipeVersionsResponse_nextToken' - A token that you can use in a subsequent call to retrieve the next set
-- of results.
--
-- 'httpStatus', 'listRecipeVersionsResponse_httpStatus' - The response's http status code.
--
-- 'recipes', 'listRecipeVersionsResponse_recipes' - A list of versions for the specified recipe.
newListRecipeVersionsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListRecipeVersionsResponse
newListRecipeVersionsResponse :: Int -> ListRecipeVersionsResponse
newListRecipeVersionsResponse Int
pHttpStatus_ =
  ListRecipeVersionsResponse' :: Maybe Text -> Int -> [Recipe] -> ListRecipeVersionsResponse
ListRecipeVersionsResponse'
    { $sel:nextToken:ListRecipeVersionsResponse' :: Maybe Text
nextToken =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListRecipeVersionsResponse' :: Int
httpStatus = Int
pHttpStatus_,
      $sel:recipes:ListRecipeVersionsResponse' :: [Recipe]
recipes = [Recipe]
forall a. Monoid a => a
Prelude.mempty
    }

-- | A token that you can use in a subsequent call to retrieve the next set
-- of results.
listRecipeVersionsResponse_nextToken :: Lens.Lens' ListRecipeVersionsResponse (Prelude.Maybe Prelude.Text)
listRecipeVersionsResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListRecipeVersionsResponse -> f ListRecipeVersionsResponse
listRecipeVersionsResponse_nextToken = (ListRecipeVersionsResponse -> Maybe Text)
-> (ListRecipeVersionsResponse
    -> Maybe Text -> ListRecipeVersionsResponse)
-> Lens' ListRecipeVersionsResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListRecipeVersionsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListRecipeVersionsResponse' :: ListRecipeVersionsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListRecipeVersionsResponse
s@ListRecipeVersionsResponse' {} Maybe Text
a -> ListRecipeVersionsResponse
s {$sel:nextToken:ListRecipeVersionsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListRecipeVersionsResponse)

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

-- | A list of versions for the specified recipe.
listRecipeVersionsResponse_recipes :: Lens.Lens' ListRecipeVersionsResponse [Recipe]
listRecipeVersionsResponse_recipes :: ([Recipe] -> f [Recipe])
-> ListRecipeVersionsResponse -> f ListRecipeVersionsResponse
listRecipeVersionsResponse_recipes = (ListRecipeVersionsResponse -> [Recipe])
-> (ListRecipeVersionsResponse
    -> [Recipe] -> ListRecipeVersionsResponse)
-> Lens' ListRecipeVersionsResponse [Recipe]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListRecipeVersionsResponse' {[Recipe]
recipes :: [Recipe]
$sel:recipes:ListRecipeVersionsResponse' :: ListRecipeVersionsResponse -> [Recipe]
recipes} -> [Recipe]
recipes) (\s :: ListRecipeVersionsResponse
s@ListRecipeVersionsResponse' {} [Recipe]
a -> ListRecipeVersionsResponse
s {$sel:recipes:ListRecipeVersionsResponse' :: [Recipe]
recipes = [Recipe]
a} :: ListRecipeVersionsResponse) (([Recipe] -> f [Recipe])
 -> ListRecipeVersionsResponse -> f ListRecipeVersionsResponse)
-> (([Recipe] -> f [Recipe]) -> [Recipe] -> f [Recipe])
-> ([Recipe] -> f [Recipe])
-> ListRecipeVersionsResponse
-> f ListRecipeVersionsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([Recipe] -> f [Recipe]) -> [Recipe] -> f [Recipe]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance Prelude.NFData ListRecipeVersionsResponse