{-# 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 #-}
module Amazonka.SageMaker.ListModels
(
ListModels (..),
newListModels,
listModels_nameContains,
listModels_creationTimeAfter,
listModels_nextToken,
listModels_sortOrder,
listModels_creationTimeBefore,
listModels_maxResults,
listModels_sortBy,
ListModelsResponse (..),
newListModelsResponse,
listModelsResponse_nextToken,
listModelsResponse_httpStatus,
listModelsResponse_models,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
import Amazonka.SageMaker.Types
data ListModels = ListModels'
{
ListModels -> Maybe Text
nameContains :: Prelude.Maybe Prelude.Text,
ListModels -> Maybe POSIX
creationTimeAfter :: Prelude.Maybe Core.POSIX,
ListModels -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
ListModels -> Maybe OrderKey
sortOrder :: Prelude.Maybe OrderKey,
ListModels -> Maybe POSIX
creationTimeBefore :: Prelude.Maybe Core.POSIX,
ListModels -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
ListModels -> Maybe ModelSortKey
sortBy :: Prelude.Maybe ModelSortKey
}
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)
newListModels ::
ListModels
newListModels :: ListModels
newListModels =
ListModels' :: Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe OrderKey
-> Maybe POSIX
-> Maybe Natural
-> Maybe ModelSortKey
-> ListModels
ListModels'
{ $sel:nameContains:ListModels' :: Maybe Text
nameContains = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:creationTimeAfter:ListModels' :: Maybe POSIX
creationTimeAfter = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
$sel:nextToken:ListModels' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:sortOrder:ListModels' :: Maybe OrderKey
sortOrder = Maybe OrderKey
forall a. Maybe a
Prelude.Nothing,
$sel:creationTimeBefore:ListModels' :: Maybe POSIX
creationTimeBefore = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
$sel:maxResults:ListModels' :: Maybe Natural
maxResults = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
$sel:sortBy:ListModels' :: Maybe ModelSortKey
sortBy = Maybe ModelSortKey
forall a. Maybe a
Prelude.Nothing
}
listModels_nameContains :: Lens.Lens' ListModels (Prelude.Maybe Prelude.Text)
listModels_nameContains :: (Maybe Text -> f (Maybe Text)) -> ListModels -> f ListModels
listModels_nameContains = (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
nameContains :: Maybe Text
$sel:nameContains:ListModels' :: ListModels -> Maybe Text
nameContains} -> Maybe Text
nameContains) (\s :: ListModels
s@ListModels' {} Maybe Text
a -> ListModels
s {$sel:nameContains:ListModels' :: Maybe Text
nameContains = Maybe Text
a} :: ListModels)
listModels_creationTimeAfter :: Lens.Lens' ListModels (Prelude.Maybe Prelude.UTCTime)
listModels_creationTimeAfter :: (Maybe UTCTime -> f (Maybe UTCTime)) -> ListModels -> f ListModels
listModels_creationTimeAfter = (ListModels -> Maybe POSIX)
-> (ListModels -> Maybe POSIX -> ListModels)
-> Lens ListModels ListModels (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListModels' {Maybe POSIX
creationTimeAfter :: Maybe POSIX
$sel:creationTimeAfter:ListModels' :: ListModels -> Maybe POSIX
creationTimeAfter} -> Maybe POSIX
creationTimeAfter) (\s :: ListModels
s@ListModels' {} Maybe POSIX
a -> ListModels
s {$sel:creationTimeAfter:ListModels' :: Maybe POSIX
creationTimeAfter = Maybe POSIX
a} :: ListModels) ((Maybe POSIX -> f (Maybe POSIX)) -> ListModels -> f ListModels)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
-> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> ListModels
-> f ListModels
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
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 POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time
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)
listModels_sortOrder :: Lens.Lens' ListModels (Prelude.Maybe OrderKey)
listModels_sortOrder :: (Maybe OrderKey -> f (Maybe OrderKey))
-> ListModels -> f ListModels
listModels_sortOrder = (ListModels -> Maybe OrderKey)
-> (ListModels -> Maybe OrderKey -> ListModels)
-> Lens ListModels ListModels (Maybe OrderKey) (Maybe OrderKey)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListModels' {Maybe OrderKey
sortOrder :: Maybe OrderKey
$sel:sortOrder:ListModels' :: ListModels -> Maybe OrderKey
sortOrder} -> Maybe OrderKey
sortOrder) (\s :: ListModels
s@ListModels' {} Maybe OrderKey
a -> ListModels
s {$sel:sortOrder:ListModels' :: Maybe OrderKey
sortOrder = Maybe OrderKey
a} :: ListModels)
listModels_creationTimeBefore :: Lens.Lens' ListModels (Prelude.Maybe Prelude.UTCTime)
listModels_creationTimeBefore :: (Maybe UTCTime -> f (Maybe UTCTime)) -> ListModels -> f ListModels
listModels_creationTimeBefore = (ListModels -> Maybe POSIX)
-> (ListModels -> Maybe POSIX -> ListModels)
-> Lens ListModels ListModels (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListModels' {Maybe POSIX
creationTimeBefore :: Maybe POSIX
$sel:creationTimeBefore:ListModels' :: ListModels -> Maybe POSIX
creationTimeBefore} -> Maybe POSIX
creationTimeBefore) (\s :: ListModels
s@ListModels' {} Maybe POSIX
a -> ListModels
s {$sel:creationTimeBefore:ListModels' :: Maybe POSIX
creationTimeBefore = Maybe POSIX
a} :: ListModels) ((Maybe POSIX -> f (Maybe POSIX)) -> ListModels -> f ListModels)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
-> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> ListModels
-> f ListModels
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
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 POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time
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)
listModels_sortBy :: Lens.Lens' ListModels (Prelude.Maybe ModelSortKey)
listModels_sortBy :: (Maybe ModelSortKey -> f (Maybe ModelSortKey))
-> ListModels -> f ListModels
listModels_sortBy = (ListModels -> Maybe ModelSortKey)
-> (ListModels -> Maybe ModelSortKey -> ListModels)
-> Lens
ListModels ListModels (Maybe ModelSortKey) (Maybe ModelSortKey)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListModels' {Maybe ModelSortKey
sortBy :: Maybe ModelSortKey
$sel:sortBy:ListModels' :: ListModels -> Maybe ModelSortKey
sortBy} -> Maybe ModelSortKey
sortBy) (\s :: ListModels
s@ListModels' {} Maybe ModelSortKey
a -> ListModels
s {$sel:sortBy:ListModels' :: Maybe ModelSortKey
sortBy = Maybe ModelSortKey
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
| [ModelSummary] -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop (AWSResponse ListModels
ListModelsResponse
rs ListModelsResponse
-> Getting [ModelSummary] ListModelsResponse [ModelSummary]
-> [ModelSummary]
forall s a. s -> Getting a s a -> a
Lens.^. Getting [ModelSummary] ListModelsResponse [ModelSummary]
Lens' ListModelsResponse [ModelSummary]
listModelsResponse_models) =
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, ToJSON a) => Service -> a -> Request a
Request.postJSON 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 -> Int -> [ModelSummary] -> ListModelsResponse
ListModelsResponse'
(Maybe Text -> Int -> [ModelSummary] -> ListModelsResponse)
-> Either String (Maybe Text)
-> Either String (Int -> [ModelSummary] -> 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 (Int -> [ModelSummary] -> ListModelsResponse)
-> Either String Int
-> Either String ([ModelSummary] -> 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))
Either String ([ModelSummary] -> ListModelsResponse)
-> Either String [ModelSummary] -> Either String ListModelsResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe [ModelSummary])
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"Models" Either String (Maybe [ModelSummary])
-> [ModelSummary] -> Either String [ModelSummary]
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ [ModelSummary]
forall a. Monoid a => a
Prelude.mempty)
)
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
"X-Amz-Target"
HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# (ByteString
"SageMaker.ListModels" :: 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 ListModels where
toJSON :: ListModels -> Value
toJSON ListModels' {Maybe Natural
Maybe Text
Maybe POSIX
Maybe ModelSortKey
Maybe OrderKey
sortBy :: Maybe ModelSortKey
maxResults :: Maybe Natural
creationTimeBefore :: Maybe POSIX
sortOrder :: Maybe OrderKey
nextToken :: Maybe Text
creationTimeAfter :: Maybe POSIX
nameContains :: Maybe Text
$sel:sortBy:ListModels' :: ListModels -> Maybe ModelSortKey
$sel:maxResults:ListModels' :: ListModels -> Maybe Natural
$sel:creationTimeBefore:ListModels' :: ListModels -> Maybe POSIX
$sel:sortOrder:ListModels' :: ListModels -> Maybe OrderKey
$sel:nextToken:ListModels' :: ListModels -> Maybe Text
$sel:creationTimeAfter:ListModels' :: ListModels -> Maybe POSIX
$sel:nameContains:ListModels' :: ListModels -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"NameContains" 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
nameContains,
(Text
"CreationTimeAfter" Text -> POSIX -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(POSIX -> Pair) -> Maybe POSIX -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe POSIX
creationTimeAfter,
(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
"SortOrder" Text -> OrderKey -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (OrderKey -> Pair) -> Maybe OrderKey -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe OrderKey
sortOrder,
(Text
"CreationTimeBefore" Text -> POSIX -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(POSIX -> Pair) -> Maybe POSIX -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe POSIX
creationTimeBefore,
(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,
(Text
"SortBy" Text -> ModelSortKey -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (ModelSortKey -> Pair) -> Maybe ModelSortKey -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe ModelSortKey
sortBy
]
)
instance Core.ToPath ListModels where
toPath :: ListModels -> ByteString
toPath = ByteString -> ListModels -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery ListModels where
toQuery :: ListModels -> QueryString
toQuery = QueryString -> ListModels -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data ListModelsResponse = ListModelsResponse'
{
ListModelsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
ListModelsResponse -> Int
httpStatus :: Prelude.Int,
ListModelsResponse -> [ModelSummary]
models :: [ModelSummary]
}
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)
newListModelsResponse ::
Prelude.Int ->
ListModelsResponse
newListModelsResponse :: Int -> ListModelsResponse
newListModelsResponse Int
pHttpStatus_ =
ListModelsResponse' :: Maybe Text -> Int -> [ModelSummary] -> ListModelsResponse
ListModelsResponse'
{ $sel:nextToken:ListModelsResponse' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:ListModelsResponse' :: Int
httpStatus = Int
pHttpStatus_,
$sel:models:ListModelsResponse' :: [ModelSummary]
models = [ModelSummary]
forall a. Monoid a => a
Prelude.mempty
}
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)
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)
listModelsResponse_models :: Lens.Lens' ListModelsResponse [ModelSummary]
listModelsResponse_models :: ([ModelSummary] -> f [ModelSummary])
-> ListModelsResponse -> f ListModelsResponse
listModelsResponse_models = (ListModelsResponse -> [ModelSummary])
-> (ListModelsResponse -> [ModelSummary] -> ListModelsResponse)
-> Lens' ListModelsResponse [ModelSummary]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListModelsResponse' {[ModelSummary]
models :: [ModelSummary]
$sel:models:ListModelsResponse' :: ListModelsResponse -> [ModelSummary]
models} -> [ModelSummary]
models) (\s :: ListModelsResponse
s@ListModelsResponse' {} [ModelSummary]
a -> ListModelsResponse
s {$sel:models:ListModelsResponse' :: [ModelSummary]
models = [ModelSummary]
a} :: ListModelsResponse) (([ModelSummary] -> f [ModelSummary])
-> ListModelsResponse -> f ListModelsResponse)
-> (([ModelSummary] -> f [ModelSummary])
-> [ModelSummary] -> f [ModelSummary])
-> ([ModelSummary] -> f [ModelSummary])
-> ListModelsResponse
-> f ListModelsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([ModelSummary] -> f [ModelSummary])
-> [ModelSummary] -> f [ModelSummary]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instance Prelude.NFData ListModelsResponse