{-# 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.LookoutVision.ListModels
-- 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 model in an Amazon Lookout for Vision project.
--
-- This operation requires permissions to perform the
-- @lookoutvision:ListModels@ operation.
--
-- This operation returns paginated results.
module Amazonka.LookoutVision.ListModels
  ( -- * Creating a Request
    ListModels (..),
    newListModels,

    -- * Request Lenses
    listModels_nextToken,
    listModels_maxResults,
    listModels_projectName,

    -- * Destructuring the Response
    ListModelsResponse (..),
    newListModelsResponse,

    -- * Response Lenses
    listModelsResponse_nextToken,
    listModelsResponse_models,
    listModelsResponse_httpStatus,
  )
where

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

-- | /See:/ 'newListModels' smart constructor.
data ListModels = ListModels'
  { -- | If the previous response was incomplete (because there is more data to
    -- retrieve), Amazon Lookout for Vision returns a pagination token in the
    -- response. You can use this pagination token to retrieve the next set of
    -- models.
    ListModels -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The maximum number of results to return per paginated call. The largest
    -- value you can specify is 100. If you specify a value greater than 100, a
    -- ValidationException error occurs. The default value is 100.
    ListModels -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
    -- | The name of the project that contains the model versions that you want
    -- to list.
    ListModels -> Text
projectName :: Prelude.Text
  }
  deriving (ListModels -> ListModels -> Bool
(ListModels -> ListModels -> Bool)
-> (ListModels -> ListModels -> Bool) -> Eq ListModels
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListModels -> ListModels -> Bool
$c/= :: ListModels -> ListModels -> Bool
== :: ListModels -> ListModels -> Bool
$c== :: ListModels -> ListModels -> Bool
Prelude.Eq, ReadPrec [ListModels]
ReadPrec ListModels
Int -> ReadS ListModels
ReadS [ListModels]
(Int -> ReadS ListModels)
-> ReadS [ListModels]
-> ReadPrec ListModels
-> ReadPrec [ListModels]
-> Read ListModels
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListModels]
$creadListPrec :: ReadPrec [ListModels]
readPrec :: ReadPrec ListModels
$creadPrec :: ReadPrec ListModels
readList :: ReadS [ListModels]
$creadList :: ReadS [ListModels]
readsPrec :: Int -> ReadS ListModels
$creadsPrec :: Int -> ReadS ListModels
Prelude.Read, Int -> ListModels -> ShowS
[ListModels] -> ShowS
ListModels -> String
(Int -> ListModels -> ShowS)
-> (ListModels -> String)
-> ([ListModels] -> ShowS)
-> Show ListModels
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListModels] -> ShowS
$cshowList :: [ListModels] -> ShowS
show :: ListModels -> String
$cshow :: ListModels -> String
showsPrec :: Int -> ListModels -> ShowS
$cshowsPrec :: Int -> ListModels -> ShowS
Prelude.Show, (forall x. ListModels -> Rep ListModels x)
-> (forall x. Rep ListModels x -> ListModels) -> Generic ListModels
forall x. Rep ListModels x -> ListModels
forall x. ListModels -> Rep ListModels x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListModels x -> ListModels
$cfrom :: forall x. ListModels -> Rep ListModels x
Prelude.Generic)

-- |
-- Create a value of 'ListModels' 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', 'listModels_nextToken' - If the previous response was incomplete (because there is more data to
-- retrieve), Amazon Lookout for Vision returns a pagination token in the
-- response. You can use this pagination token to retrieve the next set of
-- models.
--
-- 'maxResults', 'listModels_maxResults' - The maximum number of results to return per paginated call. The largest
-- value you can specify is 100. If you specify a value greater than 100, a
-- ValidationException error occurs. The default value is 100.
--
-- 'projectName', 'listModels_projectName' - The name of the project that contains the model versions that you want
-- to list.
newListModels ::
  -- | 'projectName'
  Prelude.Text ->
  ListModels
newListModels :: Text -> ListModels
newListModels Text
pProjectName_ =
  ListModels' :: Maybe Text -> Maybe Natural -> Text -> ListModels
ListModels'
    { $sel:nextToken:ListModels' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:ListModels' :: Maybe Natural
maxResults = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:projectName:ListModels' :: Text
projectName = Text
pProjectName_
    }

-- | If the previous response was incomplete (because there is more data to
-- retrieve), Amazon Lookout for Vision returns a pagination token in the
-- response. You can use this pagination token to retrieve the next set of
-- models.
listModels_nextToken :: Lens.Lens' ListModels (Prelude.Maybe Prelude.Text)
listModels_nextToken :: (Maybe Text -> f (Maybe Text)) -> ListModels -> f ListModels
listModels_nextToken = (ListModels -> Maybe Text)
-> (ListModels -> Maybe Text -> ListModels)
-> Lens ListModels ListModels (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListModels' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListModels' :: ListModels -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListModels
s@ListModels' {} Maybe Text
a -> ListModels
s {$sel:nextToken:ListModels' :: Maybe Text
nextToken = Maybe Text
a} :: ListModels)

-- | The maximum number of results to return per paginated call. The largest
-- value you can specify is 100. If you specify a value greater than 100, a
-- ValidationException error occurs. The default value is 100.
listModels_maxResults :: Lens.Lens' ListModels (Prelude.Maybe Prelude.Natural)
listModels_maxResults :: (Maybe Natural -> f (Maybe Natural)) -> ListModels -> f ListModels
listModels_maxResults = (ListModels -> Maybe Natural)
-> (ListModels -> Maybe Natural -> ListModels)
-> Lens ListModels ListModels (Maybe Natural) (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListModels' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:ListModels' :: ListModels -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: ListModels
s@ListModels' {} Maybe Natural
a -> ListModels
s {$sel:maxResults:ListModels' :: Maybe Natural
maxResults = Maybe Natural
a} :: ListModels)

-- | The name of the project that contains the model versions that you want
-- to list.
listModels_projectName :: Lens.Lens' ListModels Prelude.Text
listModels_projectName :: (Text -> f Text) -> ListModels -> f ListModels
listModels_projectName = (ListModels -> Text)
-> (ListModels -> Text -> ListModels)
-> Lens ListModels ListModels Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListModels' {Text
projectName :: Text
$sel:projectName:ListModels' :: ListModels -> Text
projectName} -> Text
projectName) (\s :: ListModels
s@ListModels' {} Text
a -> ListModels
s {$sel:projectName:ListModels' :: Text
projectName = Text
a} :: ListModels)

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

instance Prelude.NFData ListModels

instance Core.ToHeaders ListModels where
  toHeaders :: ListModels -> ResponseHeaders
toHeaders =
    ResponseHeaders -> ListModels -> 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 ListModels where
  toPath :: ListModels -> ByteString
toPath ListModels' {Maybe Natural
Maybe Text
Text
projectName :: Text
maxResults :: Maybe Natural
nextToken :: Maybe Text
$sel:projectName:ListModels' :: ListModels -> Text
$sel:maxResults:ListModels' :: ListModels -> Maybe Natural
$sel:nextToken:ListModels' :: ListModels -> Maybe Text
..} =
    [ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"/2020-11-20/projects/",
        Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
projectName,
        ByteString
"/models"
      ]

instance Core.ToQuery ListModels where
  toQuery :: ListModels -> QueryString
toQuery ListModels' {Maybe Natural
Maybe Text
Text
projectName :: Text
maxResults :: Maybe Natural
nextToken :: Maybe Text
$sel:projectName:ListModels' :: ListModels -> Text
$sel:maxResults:ListModels' :: ListModels -> Maybe Natural
$sel:nextToken:ListModels' :: ListModels -> 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
      ]

-- | /See:/ 'newListModelsResponse' smart constructor.
data ListModelsResponse = ListModelsResponse'
  { -- | If the response is truncated, Amazon Lookout for Vision returns this
    -- token that you can use in the subsequent request to retrieve the next
    -- set of models.
    ListModelsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | A list of model versions in the specified project.
    ListModelsResponse -> Maybe [ModelMetadata]
models :: Prelude.Maybe [ModelMetadata],
    -- | The response's http status code.
    ListModelsResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (ListModelsResponse -> ListModelsResponse -> Bool
(ListModelsResponse -> ListModelsResponse -> Bool)
-> (ListModelsResponse -> ListModelsResponse -> Bool)
-> Eq ListModelsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListModelsResponse -> ListModelsResponse -> Bool
$c/= :: ListModelsResponse -> ListModelsResponse -> Bool
== :: ListModelsResponse -> ListModelsResponse -> Bool
$c== :: ListModelsResponse -> ListModelsResponse -> Bool
Prelude.Eq, ReadPrec [ListModelsResponse]
ReadPrec ListModelsResponse
Int -> ReadS ListModelsResponse
ReadS [ListModelsResponse]
(Int -> ReadS ListModelsResponse)
-> ReadS [ListModelsResponse]
-> ReadPrec ListModelsResponse
-> ReadPrec [ListModelsResponse]
-> Read ListModelsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListModelsResponse]
$creadListPrec :: ReadPrec [ListModelsResponse]
readPrec :: ReadPrec ListModelsResponse
$creadPrec :: ReadPrec ListModelsResponse
readList :: ReadS [ListModelsResponse]
$creadList :: ReadS [ListModelsResponse]
readsPrec :: Int -> ReadS ListModelsResponse
$creadsPrec :: Int -> ReadS ListModelsResponse
Prelude.Read, Int -> ListModelsResponse -> ShowS
[ListModelsResponse] -> ShowS
ListModelsResponse -> String
(Int -> ListModelsResponse -> ShowS)
-> (ListModelsResponse -> String)
-> ([ListModelsResponse] -> ShowS)
-> Show ListModelsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListModelsResponse] -> ShowS
$cshowList :: [ListModelsResponse] -> ShowS
show :: ListModelsResponse -> String
$cshow :: ListModelsResponse -> String
showsPrec :: Int -> ListModelsResponse -> ShowS
$cshowsPrec :: Int -> ListModelsResponse -> ShowS
Prelude.Show, (forall x. ListModelsResponse -> Rep ListModelsResponse x)
-> (forall x. Rep ListModelsResponse x -> ListModelsResponse)
-> Generic ListModelsResponse
forall x. Rep ListModelsResponse x -> ListModelsResponse
forall x. ListModelsResponse -> Rep ListModelsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListModelsResponse x -> ListModelsResponse
$cfrom :: forall x. ListModelsResponse -> Rep ListModelsResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListModelsResponse' 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', 'listModelsResponse_nextToken' - If the response is truncated, Amazon Lookout for Vision returns this
-- token that you can use in the subsequent request to retrieve the next
-- set of models.
--
-- 'models', 'listModelsResponse_models' - A list of model versions in the specified project.
--
-- 'httpStatus', 'listModelsResponse_httpStatus' - The response's http status code.
newListModelsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListModelsResponse
newListModelsResponse :: Int -> ListModelsResponse
newListModelsResponse Int
pHttpStatus_ =
  ListModelsResponse' :: Maybe Text -> Maybe [ModelMetadata] -> Int -> ListModelsResponse
ListModelsResponse'
    { $sel:nextToken:ListModelsResponse' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:models:ListModelsResponse' :: Maybe [ModelMetadata]
models = Maybe [ModelMetadata]
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListModelsResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | If the response is truncated, Amazon Lookout for Vision returns this
-- token that you can use in the subsequent request to retrieve the next
-- set of models.
listModelsResponse_nextToken :: Lens.Lens' ListModelsResponse (Prelude.Maybe Prelude.Text)
listModelsResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListModelsResponse -> f ListModelsResponse
listModelsResponse_nextToken = (ListModelsResponse -> Maybe Text)
-> (ListModelsResponse -> Maybe Text -> ListModelsResponse)
-> Lens' ListModelsResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListModelsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListModelsResponse' :: ListModelsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListModelsResponse
s@ListModelsResponse' {} Maybe Text
a -> ListModelsResponse
s {$sel:nextToken:ListModelsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListModelsResponse)

-- | A list of model versions in the specified project.
listModelsResponse_models :: Lens.Lens' ListModelsResponse (Prelude.Maybe [ModelMetadata])
listModelsResponse_models :: (Maybe [ModelMetadata] -> f (Maybe [ModelMetadata]))
-> ListModelsResponse -> f ListModelsResponse
listModelsResponse_models = (ListModelsResponse -> Maybe [ModelMetadata])
-> (ListModelsResponse
    -> Maybe [ModelMetadata] -> ListModelsResponse)
-> Lens' ListModelsResponse (Maybe [ModelMetadata])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListModelsResponse' {Maybe [ModelMetadata]
models :: Maybe [ModelMetadata]
$sel:models:ListModelsResponse' :: ListModelsResponse -> Maybe [ModelMetadata]
models} -> Maybe [ModelMetadata]
models) (\s :: ListModelsResponse
s@ListModelsResponse' {} Maybe [ModelMetadata]
a -> ListModelsResponse
s {$sel:models:ListModelsResponse' :: Maybe [ModelMetadata]
models = Maybe [ModelMetadata]
a} :: ListModelsResponse) ((Maybe [ModelMetadata] -> f (Maybe [ModelMetadata]))
 -> ListModelsResponse -> f ListModelsResponse)
-> ((Maybe [ModelMetadata] -> f (Maybe [ModelMetadata]))
    -> Maybe [ModelMetadata] -> f (Maybe [ModelMetadata]))
-> (Maybe [ModelMetadata] -> f (Maybe [ModelMetadata]))
-> ListModelsResponse
-> f ListModelsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [ModelMetadata] [ModelMetadata] [ModelMetadata] [ModelMetadata]
-> Iso
     (Maybe [ModelMetadata])
     (Maybe [ModelMetadata])
     (Maybe [ModelMetadata])
     (Maybe [ModelMetadata])
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
  [ModelMetadata] [ModelMetadata] [ModelMetadata] [ModelMetadata]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

instance Prelude.NFData ListModelsResponse