{-# 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.ListImageVersions
(
ListImageVersions (..),
newListImageVersions,
listImageVersions_lastModifiedTimeBefore,
listImageVersions_creationTimeAfter,
listImageVersions_nextToken,
listImageVersions_sortOrder,
listImageVersions_lastModifiedTimeAfter,
listImageVersions_creationTimeBefore,
listImageVersions_maxResults,
listImageVersions_sortBy,
listImageVersions_imageName,
ListImageVersionsResponse (..),
newListImageVersionsResponse,
listImageVersionsResponse_nextToken,
listImageVersionsResponse_imageVersions,
listImageVersionsResponse_httpStatus,
)
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 ListImageVersions = ListImageVersions'
{
ListImageVersions -> Maybe POSIX
lastModifiedTimeBefore :: Prelude.Maybe Core.POSIX,
ListImageVersions -> Maybe POSIX
creationTimeAfter :: Prelude.Maybe Core.POSIX,
ListImageVersions -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
ListImageVersions -> Maybe ImageVersionSortOrder
sortOrder :: Prelude.Maybe ImageVersionSortOrder,
ListImageVersions -> Maybe POSIX
lastModifiedTimeAfter :: Prelude.Maybe Core.POSIX,
ListImageVersions -> Maybe POSIX
creationTimeBefore :: Prelude.Maybe Core.POSIX,
ListImageVersions -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
ListImageVersions -> Maybe ImageVersionSortBy
sortBy :: Prelude.Maybe ImageVersionSortBy,
ListImageVersions -> Text
imageName :: Prelude.Text
}
deriving (ListImageVersions -> ListImageVersions -> Bool
(ListImageVersions -> ListImageVersions -> Bool)
-> (ListImageVersions -> ListImageVersions -> Bool)
-> Eq ListImageVersions
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListImageVersions -> ListImageVersions -> Bool
$c/= :: ListImageVersions -> ListImageVersions -> Bool
== :: ListImageVersions -> ListImageVersions -> Bool
$c== :: ListImageVersions -> ListImageVersions -> Bool
Prelude.Eq, ReadPrec [ListImageVersions]
ReadPrec ListImageVersions
Int -> ReadS ListImageVersions
ReadS [ListImageVersions]
(Int -> ReadS ListImageVersions)
-> ReadS [ListImageVersions]
-> ReadPrec ListImageVersions
-> ReadPrec [ListImageVersions]
-> Read ListImageVersions
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListImageVersions]
$creadListPrec :: ReadPrec [ListImageVersions]
readPrec :: ReadPrec ListImageVersions
$creadPrec :: ReadPrec ListImageVersions
readList :: ReadS [ListImageVersions]
$creadList :: ReadS [ListImageVersions]
readsPrec :: Int -> ReadS ListImageVersions
$creadsPrec :: Int -> ReadS ListImageVersions
Prelude.Read, Int -> ListImageVersions -> ShowS
[ListImageVersions] -> ShowS
ListImageVersions -> String
(Int -> ListImageVersions -> ShowS)
-> (ListImageVersions -> String)
-> ([ListImageVersions] -> ShowS)
-> Show ListImageVersions
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListImageVersions] -> ShowS
$cshowList :: [ListImageVersions] -> ShowS
show :: ListImageVersions -> String
$cshow :: ListImageVersions -> String
showsPrec :: Int -> ListImageVersions -> ShowS
$cshowsPrec :: Int -> ListImageVersions -> ShowS
Prelude.Show, (forall x. ListImageVersions -> Rep ListImageVersions x)
-> (forall x. Rep ListImageVersions x -> ListImageVersions)
-> Generic ListImageVersions
forall x. Rep ListImageVersions x -> ListImageVersions
forall x. ListImageVersions -> Rep ListImageVersions x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListImageVersions x -> ListImageVersions
$cfrom :: forall x. ListImageVersions -> Rep ListImageVersions x
Prelude.Generic)
newListImageVersions ::
Prelude.Text ->
ListImageVersions
newListImageVersions :: Text -> ListImageVersions
newListImageVersions Text
pImageName_ =
ListImageVersions' :: Maybe POSIX
-> Maybe POSIX
-> Maybe Text
-> Maybe ImageVersionSortOrder
-> Maybe POSIX
-> Maybe POSIX
-> Maybe Natural
-> Maybe ImageVersionSortBy
-> Text
-> ListImageVersions
ListImageVersions'
{ $sel:lastModifiedTimeBefore:ListImageVersions' :: Maybe POSIX
lastModifiedTimeBefore =
Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
$sel:creationTimeAfter:ListImageVersions' :: Maybe POSIX
creationTimeAfter = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
$sel:nextToken:ListImageVersions' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:sortOrder:ListImageVersions' :: Maybe ImageVersionSortOrder
sortOrder = Maybe ImageVersionSortOrder
forall a. Maybe a
Prelude.Nothing,
$sel:lastModifiedTimeAfter:ListImageVersions' :: Maybe POSIX
lastModifiedTimeAfter = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
$sel:creationTimeBefore:ListImageVersions' :: Maybe POSIX
creationTimeBefore = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
$sel:maxResults:ListImageVersions' :: Maybe Natural
maxResults = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
$sel:sortBy:ListImageVersions' :: Maybe ImageVersionSortBy
sortBy = Maybe ImageVersionSortBy
forall a. Maybe a
Prelude.Nothing,
$sel:imageName:ListImageVersions' :: Text
imageName = Text
pImageName_
}
listImageVersions_lastModifiedTimeBefore :: Lens.Lens' ListImageVersions (Prelude.Maybe Prelude.UTCTime)
listImageVersions_lastModifiedTimeBefore :: (Maybe UTCTime -> f (Maybe UTCTime))
-> ListImageVersions -> f ListImageVersions
listImageVersions_lastModifiedTimeBefore = (ListImageVersions -> Maybe POSIX)
-> (ListImageVersions -> Maybe POSIX -> ListImageVersions)
-> Lens
ListImageVersions ListImageVersions (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListImageVersions' {Maybe POSIX
lastModifiedTimeBefore :: Maybe POSIX
$sel:lastModifiedTimeBefore:ListImageVersions' :: ListImageVersions -> Maybe POSIX
lastModifiedTimeBefore} -> Maybe POSIX
lastModifiedTimeBefore) (\s :: ListImageVersions
s@ListImageVersions' {} Maybe POSIX
a -> ListImageVersions
s {$sel:lastModifiedTimeBefore:ListImageVersions' :: Maybe POSIX
lastModifiedTimeBefore = Maybe POSIX
a} :: ListImageVersions) ((Maybe POSIX -> f (Maybe POSIX))
-> ListImageVersions -> f ListImageVersions)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
-> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> ListImageVersions
-> f ListImageVersions
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
listImageVersions_creationTimeAfter :: Lens.Lens' ListImageVersions (Prelude.Maybe Prelude.UTCTime)
listImageVersions_creationTimeAfter :: (Maybe UTCTime -> f (Maybe UTCTime))
-> ListImageVersions -> f ListImageVersions
listImageVersions_creationTimeAfter = (ListImageVersions -> Maybe POSIX)
-> (ListImageVersions -> Maybe POSIX -> ListImageVersions)
-> Lens
ListImageVersions ListImageVersions (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListImageVersions' {Maybe POSIX
creationTimeAfter :: Maybe POSIX
$sel:creationTimeAfter:ListImageVersions' :: ListImageVersions -> Maybe POSIX
creationTimeAfter} -> Maybe POSIX
creationTimeAfter) (\s :: ListImageVersions
s@ListImageVersions' {} Maybe POSIX
a -> ListImageVersions
s {$sel:creationTimeAfter:ListImageVersions' :: Maybe POSIX
creationTimeAfter = Maybe POSIX
a} :: ListImageVersions) ((Maybe POSIX -> f (Maybe POSIX))
-> ListImageVersions -> f ListImageVersions)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
-> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> ListImageVersions
-> f ListImageVersions
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
listImageVersions_nextToken :: Lens.Lens' ListImageVersions (Prelude.Maybe Prelude.Text)
listImageVersions_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListImageVersions -> f ListImageVersions
listImageVersions_nextToken = (ListImageVersions -> Maybe Text)
-> (ListImageVersions -> Maybe Text -> ListImageVersions)
-> Lens
ListImageVersions ListImageVersions (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListImageVersions' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListImageVersions' :: ListImageVersions -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListImageVersions
s@ListImageVersions' {} Maybe Text
a -> ListImageVersions
s {$sel:nextToken:ListImageVersions' :: Maybe Text
nextToken = Maybe Text
a} :: ListImageVersions)
listImageVersions_sortOrder :: Lens.Lens' ListImageVersions (Prelude.Maybe ImageVersionSortOrder)
listImageVersions_sortOrder :: (Maybe ImageVersionSortOrder -> f (Maybe ImageVersionSortOrder))
-> ListImageVersions -> f ListImageVersions
listImageVersions_sortOrder = (ListImageVersions -> Maybe ImageVersionSortOrder)
-> (ListImageVersions
-> Maybe ImageVersionSortOrder -> ListImageVersions)
-> Lens
ListImageVersions
ListImageVersions
(Maybe ImageVersionSortOrder)
(Maybe ImageVersionSortOrder)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListImageVersions' {Maybe ImageVersionSortOrder
sortOrder :: Maybe ImageVersionSortOrder
$sel:sortOrder:ListImageVersions' :: ListImageVersions -> Maybe ImageVersionSortOrder
sortOrder} -> Maybe ImageVersionSortOrder
sortOrder) (\s :: ListImageVersions
s@ListImageVersions' {} Maybe ImageVersionSortOrder
a -> ListImageVersions
s {$sel:sortOrder:ListImageVersions' :: Maybe ImageVersionSortOrder
sortOrder = Maybe ImageVersionSortOrder
a} :: ListImageVersions)
listImageVersions_lastModifiedTimeAfter :: Lens.Lens' ListImageVersions (Prelude.Maybe Prelude.UTCTime)
listImageVersions_lastModifiedTimeAfter :: (Maybe UTCTime -> f (Maybe UTCTime))
-> ListImageVersions -> f ListImageVersions
listImageVersions_lastModifiedTimeAfter = (ListImageVersions -> Maybe POSIX)
-> (ListImageVersions -> Maybe POSIX -> ListImageVersions)
-> Lens
ListImageVersions ListImageVersions (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListImageVersions' {Maybe POSIX
lastModifiedTimeAfter :: Maybe POSIX
$sel:lastModifiedTimeAfter:ListImageVersions' :: ListImageVersions -> Maybe POSIX
lastModifiedTimeAfter} -> Maybe POSIX
lastModifiedTimeAfter) (\s :: ListImageVersions
s@ListImageVersions' {} Maybe POSIX
a -> ListImageVersions
s {$sel:lastModifiedTimeAfter:ListImageVersions' :: Maybe POSIX
lastModifiedTimeAfter = Maybe POSIX
a} :: ListImageVersions) ((Maybe POSIX -> f (Maybe POSIX))
-> ListImageVersions -> f ListImageVersions)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
-> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> ListImageVersions
-> f ListImageVersions
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
listImageVersions_creationTimeBefore :: Lens.Lens' ListImageVersions (Prelude.Maybe Prelude.UTCTime)
listImageVersions_creationTimeBefore :: (Maybe UTCTime -> f (Maybe UTCTime))
-> ListImageVersions -> f ListImageVersions
listImageVersions_creationTimeBefore = (ListImageVersions -> Maybe POSIX)
-> (ListImageVersions -> Maybe POSIX -> ListImageVersions)
-> Lens
ListImageVersions ListImageVersions (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListImageVersions' {Maybe POSIX
creationTimeBefore :: Maybe POSIX
$sel:creationTimeBefore:ListImageVersions' :: ListImageVersions -> Maybe POSIX
creationTimeBefore} -> Maybe POSIX
creationTimeBefore) (\s :: ListImageVersions
s@ListImageVersions' {} Maybe POSIX
a -> ListImageVersions
s {$sel:creationTimeBefore:ListImageVersions' :: Maybe POSIX
creationTimeBefore = Maybe POSIX
a} :: ListImageVersions) ((Maybe POSIX -> f (Maybe POSIX))
-> ListImageVersions -> f ListImageVersions)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
-> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> ListImageVersions
-> f ListImageVersions
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
listImageVersions_maxResults :: Lens.Lens' ListImageVersions (Prelude.Maybe Prelude.Natural)
listImageVersions_maxResults :: (Maybe Natural -> f (Maybe Natural))
-> ListImageVersions -> f ListImageVersions
listImageVersions_maxResults = (ListImageVersions -> Maybe Natural)
-> (ListImageVersions -> Maybe Natural -> ListImageVersions)
-> Lens
ListImageVersions ListImageVersions (Maybe Natural) (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListImageVersions' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:ListImageVersions' :: ListImageVersions -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: ListImageVersions
s@ListImageVersions' {} Maybe Natural
a -> ListImageVersions
s {$sel:maxResults:ListImageVersions' :: Maybe Natural
maxResults = Maybe Natural
a} :: ListImageVersions)
listImageVersions_sortBy :: Lens.Lens' ListImageVersions (Prelude.Maybe ImageVersionSortBy)
listImageVersions_sortBy :: (Maybe ImageVersionSortBy -> f (Maybe ImageVersionSortBy))
-> ListImageVersions -> f ListImageVersions
listImageVersions_sortBy = (ListImageVersions -> Maybe ImageVersionSortBy)
-> (ListImageVersions
-> Maybe ImageVersionSortBy -> ListImageVersions)
-> Lens
ListImageVersions
ListImageVersions
(Maybe ImageVersionSortBy)
(Maybe ImageVersionSortBy)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListImageVersions' {Maybe ImageVersionSortBy
sortBy :: Maybe ImageVersionSortBy
$sel:sortBy:ListImageVersions' :: ListImageVersions -> Maybe ImageVersionSortBy
sortBy} -> Maybe ImageVersionSortBy
sortBy) (\s :: ListImageVersions
s@ListImageVersions' {} Maybe ImageVersionSortBy
a -> ListImageVersions
s {$sel:sortBy:ListImageVersions' :: Maybe ImageVersionSortBy
sortBy = Maybe ImageVersionSortBy
a} :: ListImageVersions)
listImageVersions_imageName :: Lens.Lens' ListImageVersions Prelude.Text
listImageVersions_imageName :: (Text -> f Text) -> ListImageVersions -> f ListImageVersions
listImageVersions_imageName = (ListImageVersions -> Text)
-> (ListImageVersions -> Text -> ListImageVersions)
-> Lens ListImageVersions ListImageVersions Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListImageVersions' {Text
imageName :: Text
$sel:imageName:ListImageVersions' :: ListImageVersions -> Text
imageName} -> Text
imageName) (\s :: ListImageVersions
s@ListImageVersions' {} Text
a -> ListImageVersions
s {$sel:imageName:ListImageVersions' :: Text
imageName = Text
a} :: ListImageVersions)
instance Core.AWSPager ListImageVersions where
page :: ListImageVersions
-> AWSResponse ListImageVersions -> Maybe ListImageVersions
page ListImageVersions
rq AWSResponse ListImageVersions
rs
| Maybe Text -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
( AWSResponse ListImageVersions
ListImageVersionsResponse
rs
ListImageVersionsResponse
-> Getting (First Text) ListImageVersionsResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListImageVersionsResponse
-> Const (First Text) ListImageVersionsResponse
Lens' ListImageVersionsResponse (Maybe Text)
listImageVersionsResponse_nextToken
((Maybe Text -> Const (First Text) (Maybe Text))
-> ListImageVersionsResponse
-> Const (First Text) ListImageVersionsResponse)
-> ((Text -> Const (First Text) Text)
-> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListImageVersionsResponse 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 ListImageVersions
forall a. Maybe a
Prelude.Nothing
| Maybe [ImageVersion] -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
( AWSResponse ListImageVersions
ListImageVersionsResponse
rs
ListImageVersionsResponse
-> Getting
(First [ImageVersion]) ListImageVersionsResponse [ImageVersion]
-> Maybe [ImageVersion]
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe [ImageVersion]
-> Const (First [ImageVersion]) (Maybe [ImageVersion]))
-> ListImageVersionsResponse
-> Const (First [ImageVersion]) ListImageVersionsResponse
Lens' ListImageVersionsResponse (Maybe [ImageVersion])
listImageVersionsResponse_imageVersions
((Maybe [ImageVersion]
-> Const (First [ImageVersion]) (Maybe [ImageVersion]))
-> ListImageVersionsResponse
-> Const (First [ImageVersion]) ListImageVersionsResponse)
-> (([ImageVersion] -> Const (First [ImageVersion]) [ImageVersion])
-> Maybe [ImageVersion]
-> Const (First [ImageVersion]) (Maybe [ImageVersion]))
-> Getting
(First [ImageVersion]) ListImageVersionsResponse [ImageVersion]
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([ImageVersion] -> Const (First [ImageVersion]) [ImageVersion])
-> Maybe [ImageVersion]
-> Const (First [ImageVersion]) (Maybe [ImageVersion])
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
) =
Maybe ListImageVersions
forall a. Maybe a
Prelude.Nothing
| Bool
Prelude.otherwise =
ListImageVersions -> Maybe ListImageVersions
forall a. a -> Maybe a
Prelude.Just (ListImageVersions -> Maybe ListImageVersions)
-> ListImageVersions -> Maybe ListImageVersions
forall a b. (a -> b) -> a -> b
Prelude.$
ListImageVersions
rq
ListImageVersions
-> (ListImageVersions -> ListImageVersions) -> ListImageVersions
forall a b. a -> (a -> b) -> b
Prelude.& (Maybe Text -> Identity (Maybe Text))
-> ListImageVersions -> Identity ListImageVersions
Lens ListImageVersions ListImageVersions (Maybe Text) (Maybe Text)
listImageVersions_nextToken
((Maybe Text -> Identity (Maybe Text))
-> ListImageVersions -> Identity ListImageVersions)
-> Maybe Text -> ListImageVersions -> ListImageVersions
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListImageVersions
ListImageVersionsResponse
rs
ListImageVersionsResponse
-> Getting (First Text) ListImageVersionsResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListImageVersionsResponse
-> Const (First Text) ListImageVersionsResponse
Lens' ListImageVersionsResponse (Maybe Text)
listImageVersionsResponse_nextToken
((Maybe Text -> Const (First Text) (Maybe Text))
-> ListImageVersionsResponse
-> Const (First Text) ListImageVersionsResponse)
-> ((Text -> Const (First Text) Text)
-> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListImageVersionsResponse 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 ListImageVersions where
type
AWSResponse ListImageVersions =
ListImageVersionsResponse
request :: ListImageVersions -> Request ListImageVersions
request = Service -> ListImageVersions -> Request ListImageVersions
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy ListImageVersions
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse ListImageVersions)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse ListImageVersions))
-> Logger
-> Service
-> Proxy ListImageVersions
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse ListImageVersions)))
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 [ImageVersion] -> Int -> ListImageVersionsResponse
ListImageVersionsResponse'
(Maybe Text
-> Maybe [ImageVersion] -> Int -> ListImageVersionsResponse)
-> Either String (Maybe Text)
-> Either
String (Maybe [ImageVersion] -> Int -> ListImageVersionsResponse)
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 [ImageVersion] -> Int -> ListImageVersionsResponse)
-> Either String (Maybe [ImageVersion])
-> Either String (Int -> ListImageVersionsResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe (Maybe [ImageVersion]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"ImageVersions" Either String (Maybe (Maybe [ImageVersion]))
-> Maybe [ImageVersion] -> Either String (Maybe [ImageVersion])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [ImageVersion]
forall a. Monoid a => a
Prelude.mempty)
Either String (Int -> ListImageVersionsResponse)
-> Either String Int -> Either String ListImageVersionsResponse
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 ListImageVersions
instance Prelude.NFData ListImageVersions
instance Core.ToHeaders ListImageVersions where
toHeaders :: ListImageVersions -> ResponseHeaders
toHeaders =
ResponseHeaders -> ListImageVersions -> 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.ListImageVersions" ::
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 ListImageVersions where
toJSON :: ListImageVersions -> Value
toJSON ListImageVersions' {Maybe Natural
Maybe Text
Maybe POSIX
Maybe ImageVersionSortBy
Maybe ImageVersionSortOrder
Text
imageName :: Text
sortBy :: Maybe ImageVersionSortBy
maxResults :: Maybe Natural
creationTimeBefore :: Maybe POSIX
lastModifiedTimeAfter :: Maybe POSIX
sortOrder :: Maybe ImageVersionSortOrder
nextToken :: Maybe Text
creationTimeAfter :: Maybe POSIX
lastModifiedTimeBefore :: Maybe POSIX
$sel:imageName:ListImageVersions' :: ListImageVersions -> Text
$sel:sortBy:ListImageVersions' :: ListImageVersions -> Maybe ImageVersionSortBy
$sel:maxResults:ListImageVersions' :: ListImageVersions -> Maybe Natural
$sel:creationTimeBefore:ListImageVersions' :: ListImageVersions -> Maybe POSIX
$sel:lastModifiedTimeAfter:ListImageVersions' :: ListImageVersions -> Maybe POSIX
$sel:sortOrder:ListImageVersions' :: ListImageVersions -> Maybe ImageVersionSortOrder
$sel:nextToken:ListImageVersions' :: ListImageVersions -> Maybe Text
$sel:creationTimeAfter:ListImageVersions' :: ListImageVersions -> Maybe POSIX
$sel:lastModifiedTimeBefore:ListImageVersions' :: ListImageVersions -> Maybe POSIX
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"LastModifiedTimeBefore" 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
lastModifiedTimeBefore,
(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 -> ImageVersionSortOrder -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (ImageVersionSortOrder -> Pair)
-> Maybe ImageVersionSortOrder -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe ImageVersionSortOrder
sortOrder,
(Text
"LastModifiedTimeAfter" 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
lastModifiedTimeAfter,
(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 -> ImageVersionSortBy -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (ImageVersionSortBy -> Pair)
-> Maybe ImageVersionSortBy -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe ImageVersionSortBy
sortBy,
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"ImageName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
imageName)
]
)
instance Core.ToPath ListImageVersions where
toPath :: ListImageVersions -> ByteString
toPath = ByteString -> ListImageVersions -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery ListImageVersions where
toQuery :: ListImageVersions -> QueryString
toQuery = QueryString -> ListImageVersions -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data ListImageVersionsResponse = ListImageVersionsResponse'
{
ListImageVersionsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
ListImageVersionsResponse -> Maybe [ImageVersion]
imageVersions :: Prelude.Maybe [ImageVersion],
ListImageVersionsResponse -> Int
httpStatus :: Prelude.Int
}
deriving (ListImageVersionsResponse -> ListImageVersionsResponse -> Bool
(ListImageVersionsResponse -> ListImageVersionsResponse -> Bool)
-> (ListImageVersionsResponse -> ListImageVersionsResponse -> Bool)
-> Eq ListImageVersionsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListImageVersionsResponse -> ListImageVersionsResponse -> Bool
$c/= :: ListImageVersionsResponse -> ListImageVersionsResponse -> Bool
== :: ListImageVersionsResponse -> ListImageVersionsResponse -> Bool
$c== :: ListImageVersionsResponse -> ListImageVersionsResponse -> Bool
Prelude.Eq, ReadPrec [ListImageVersionsResponse]
ReadPrec ListImageVersionsResponse
Int -> ReadS ListImageVersionsResponse
ReadS [ListImageVersionsResponse]
(Int -> ReadS ListImageVersionsResponse)
-> ReadS [ListImageVersionsResponse]
-> ReadPrec ListImageVersionsResponse
-> ReadPrec [ListImageVersionsResponse]
-> Read ListImageVersionsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListImageVersionsResponse]
$creadListPrec :: ReadPrec [ListImageVersionsResponse]
readPrec :: ReadPrec ListImageVersionsResponse
$creadPrec :: ReadPrec ListImageVersionsResponse
readList :: ReadS [ListImageVersionsResponse]
$creadList :: ReadS [ListImageVersionsResponse]
readsPrec :: Int -> ReadS ListImageVersionsResponse
$creadsPrec :: Int -> ReadS ListImageVersionsResponse
Prelude.Read, Int -> ListImageVersionsResponse -> ShowS
[ListImageVersionsResponse] -> ShowS
ListImageVersionsResponse -> String
(Int -> ListImageVersionsResponse -> ShowS)
-> (ListImageVersionsResponse -> String)
-> ([ListImageVersionsResponse] -> ShowS)
-> Show ListImageVersionsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListImageVersionsResponse] -> ShowS
$cshowList :: [ListImageVersionsResponse] -> ShowS
show :: ListImageVersionsResponse -> String
$cshow :: ListImageVersionsResponse -> String
showsPrec :: Int -> ListImageVersionsResponse -> ShowS
$cshowsPrec :: Int -> ListImageVersionsResponse -> ShowS
Prelude.Show, (forall x.
ListImageVersionsResponse -> Rep ListImageVersionsResponse x)
-> (forall x.
Rep ListImageVersionsResponse x -> ListImageVersionsResponse)
-> Generic ListImageVersionsResponse
forall x.
Rep ListImageVersionsResponse x -> ListImageVersionsResponse
forall x.
ListImageVersionsResponse -> Rep ListImageVersionsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListImageVersionsResponse x -> ListImageVersionsResponse
$cfrom :: forall x.
ListImageVersionsResponse -> Rep ListImageVersionsResponse x
Prelude.Generic)
newListImageVersionsResponse ::
Prelude.Int ->
ListImageVersionsResponse
newListImageVersionsResponse :: Int -> ListImageVersionsResponse
newListImageVersionsResponse Int
pHttpStatus_ =
ListImageVersionsResponse' :: Maybe Text
-> Maybe [ImageVersion] -> Int -> ListImageVersionsResponse
ListImageVersionsResponse'
{ $sel:nextToken:ListImageVersionsResponse' :: Maybe Text
nextToken =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:imageVersions:ListImageVersionsResponse' :: Maybe [ImageVersion]
imageVersions = Maybe [ImageVersion]
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:ListImageVersionsResponse' :: Int
httpStatus = Int
pHttpStatus_
}
listImageVersionsResponse_nextToken :: Lens.Lens' ListImageVersionsResponse (Prelude.Maybe Prelude.Text)
listImageVersionsResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListImageVersionsResponse -> f ListImageVersionsResponse
listImageVersionsResponse_nextToken = (ListImageVersionsResponse -> Maybe Text)
-> (ListImageVersionsResponse
-> Maybe Text -> ListImageVersionsResponse)
-> Lens' ListImageVersionsResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListImageVersionsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListImageVersionsResponse' :: ListImageVersionsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListImageVersionsResponse
s@ListImageVersionsResponse' {} Maybe Text
a -> ListImageVersionsResponse
s {$sel:nextToken:ListImageVersionsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListImageVersionsResponse)
listImageVersionsResponse_imageVersions :: Lens.Lens' ListImageVersionsResponse (Prelude.Maybe [ImageVersion])
listImageVersionsResponse_imageVersions :: (Maybe [ImageVersion] -> f (Maybe [ImageVersion]))
-> ListImageVersionsResponse -> f ListImageVersionsResponse
listImageVersionsResponse_imageVersions = (ListImageVersionsResponse -> Maybe [ImageVersion])
-> (ListImageVersionsResponse
-> Maybe [ImageVersion] -> ListImageVersionsResponse)
-> Lens' ListImageVersionsResponse (Maybe [ImageVersion])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListImageVersionsResponse' {Maybe [ImageVersion]
imageVersions :: Maybe [ImageVersion]
$sel:imageVersions:ListImageVersionsResponse' :: ListImageVersionsResponse -> Maybe [ImageVersion]
imageVersions} -> Maybe [ImageVersion]
imageVersions) (\s :: ListImageVersionsResponse
s@ListImageVersionsResponse' {} Maybe [ImageVersion]
a -> ListImageVersionsResponse
s {$sel:imageVersions:ListImageVersionsResponse' :: Maybe [ImageVersion]
imageVersions = Maybe [ImageVersion]
a} :: ListImageVersionsResponse) ((Maybe [ImageVersion] -> f (Maybe [ImageVersion]))
-> ListImageVersionsResponse -> f ListImageVersionsResponse)
-> ((Maybe [ImageVersion] -> f (Maybe [ImageVersion]))
-> Maybe [ImageVersion] -> f (Maybe [ImageVersion]))
-> (Maybe [ImageVersion] -> f (Maybe [ImageVersion]))
-> ListImageVersionsResponse
-> f ListImageVersionsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [ImageVersion] [ImageVersion] [ImageVersion] [ImageVersion]
-> Iso
(Maybe [ImageVersion])
(Maybe [ImageVersion])
(Maybe [ImageVersion])
(Maybe [ImageVersion])
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 [ImageVersion] [ImageVersion] [ImageVersion] [ImageVersion]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
listImageVersionsResponse_httpStatus :: Lens.Lens' ListImageVersionsResponse Prelude.Int
listImageVersionsResponse_httpStatus :: (Int -> f Int)
-> ListImageVersionsResponse -> f ListImageVersionsResponse
listImageVersionsResponse_httpStatus = (ListImageVersionsResponse -> Int)
-> (ListImageVersionsResponse -> Int -> ListImageVersionsResponse)
-> Lens ListImageVersionsResponse ListImageVersionsResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListImageVersionsResponse' {Int
httpStatus :: Int
$sel:httpStatus:ListImageVersionsResponse' :: ListImageVersionsResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: ListImageVersionsResponse
s@ListImageVersionsResponse' {} Int
a -> ListImageVersionsResponse
s {$sel:httpStatus:ListImageVersionsResponse' :: Int
httpStatus = Int
a} :: ListImageVersionsResponse)
instance Prelude.NFData ListImageVersionsResponse