{-# 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.Personalize.ListSolutionVersions
(
ListSolutionVersions (..),
newListSolutionVersions,
listSolutionVersions_maxResults,
listSolutionVersions_nextToken,
listSolutionVersions_solutionArn,
ListSolutionVersionsResponse (..),
newListSolutionVersionsResponse,
listSolutionVersionsResponse_nextToken,
listSolutionVersionsResponse_solutionVersions,
listSolutionVersionsResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.Personalize.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data ListSolutionVersions = ListSolutionVersions'
{
ListSolutionVersions -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
ListSolutionVersions -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
ListSolutionVersions -> Maybe Text
solutionArn :: Prelude.Maybe Prelude.Text
}
deriving (ListSolutionVersions -> ListSolutionVersions -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListSolutionVersions -> ListSolutionVersions -> Bool
$c/= :: ListSolutionVersions -> ListSolutionVersions -> Bool
== :: ListSolutionVersions -> ListSolutionVersions -> Bool
$c== :: ListSolutionVersions -> ListSolutionVersions -> Bool
Prelude.Eq, ReadPrec [ListSolutionVersions]
ReadPrec ListSolutionVersions
Int -> ReadS ListSolutionVersions
ReadS [ListSolutionVersions]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListSolutionVersions]
$creadListPrec :: ReadPrec [ListSolutionVersions]
readPrec :: ReadPrec ListSolutionVersions
$creadPrec :: ReadPrec ListSolutionVersions
readList :: ReadS [ListSolutionVersions]
$creadList :: ReadS [ListSolutionVersions]
readsPrec :: Int -> ReadS ListSolutionVersions
$creadsPrec :: Int -> ReadS ListSolutionVersions
Prelude.Read, Int -> ListSolutionVersions -> ShowS
[ListSolutionVersions] -> ShowS
ListSolutionVersions -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListSolutionVersions] -> ShowS
$cshowList :: [ListSolutionVersions] -> ShowS
show :: ListSolutionVersions -> String
$cshow :: ListSolutionVersions -> String
showsPrec :: Int -> ListSolutionVersions -> ShowS
$cshowsPrec :: Int -> ListSolutionVersions -> ShowS
Prelude.Show, forall x. Rep ListSolutionVersions x -> ListSolutionVersions
forall x. ListSolutionVersions -> Rep ListSolutionVersions x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListSolutionVersions x -> ListSolutionVersions
$cfrom :: forall x. ListSolutionVersions -> Rep ListSolutionVersions x
Prelude.Generic)
newListSolutionVersions ::
ListSolutionVersions
newListSolutionVersions :: ListSolutionVersions
newListSolutionVersions =
ListSolutionVersions'
{ $sel:maxResults:ListSolutionVersions' :: Maybe Natural
maxResults = forall a. Maybe a
Prelude.Nothing,
$sel:nextToken:ListSolutionVersions' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
$sel:solutionArn:ListSolutionVersions' :: Maybe Text
solutionArn = forall a. Maybe a
Prelude.Nothing
}
listSolutionVersions_maxResults :: Lens.Lens' ListSolutionVersions (Prelude.Maybe Prelude.Natural)
listSolutionVersions_maxResults :: Lens' ListSolutionVersions (Maybe Natural)
listSolutionVersions_maxResults = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListSolutionVersions' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:ListSolutionVersions' :: ListSolutionVersions -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: ListSolutionVersions
s@ListSolutionVersions' {} Maybe Natural
a -> ListSolutionVersions
s {$sel:maxResults:ListSolutionVersions' :: Maybe Natural
maxResults = Maybe Natural
a} :: ListSolutionVersions)
listSolutionVersions_nextToken :: Lens.Lens' ListSolutionVersions (Prelude.Maybe Prelude.Text)
listSolutionVersions_nextToken :: Lens' ListSolutionVersions (Maybe Text)
listSolutionVersions_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListSolutionVersions' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListSolutionVersions' :: ListSolutionVersions -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListSolutionVersions
s@ListSolutionVersions' {} Maybe Text
a -> ListSolutionVersions
s {$sel:nextToken:ListSolutionVersions' :: Maybe Text
nextToken = Maybe Text
a} :: ListSolutionVersions)
listSolutionVersions_solutionArn :: Lens.Lens' ListSolutionVersions (Prelude.Maybe Prelude.Text)
listSolutionVersions_solutionArn :: Lens' ListSolutionVersions (Maybe Text)
listSolutionVersions_solutionArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListSolutionVersions' {Maybe Text
solutionArn :: Maybe Text
$sel:solutionArn:ListSolutionVersions' :: ListSolutionVersions -> Maybe Text
solutionArn} -> Maybe Text
solutionArn) (\s :: ListSolutionVersions
s@ListSolutionVersions' {} Maybe Text
a -> ListSolutionVersions
s {$sel:solutionArn:ListSolutionVersions' :: Maybe Text
solutionArn = Maybe Text
a} :: ListSolutionVersions)
instance Core.AWSPager ListSolutionVersions where
page :: ListSolutionVersions
-> AWSResponse ListSolutionVersions -> Maybe ListSolutionVersions
page ListSolutionVersions
rq AWSResponse ListSolutionVersions
rs
| forall a. AWSTruncated a => a -> Bool
Core.stop
( AWSResponse ListSolutionVersions
rs
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListSolutionVersionsResponse (Maybe Text)
listSolutionVersionsResponse_nextToken
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
) =
forall a. Maybe a
Prelude.Nothing
| forall a. AWSTruncated a => a -> Bool
Core.stop
( AWSResponse ListSolutionVersions
rs
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListSolutionVersionsResponse (Maybe [SolutionVersionSummary])
listSolutionVersionsResponse_solutionVersions
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
) =
forall a. Maybe a
Prelude.Nothing
| Bool
Prelude.otherwise =
forall a. a -> Maybe a
Prelude.Just
forall a b. (a -> b) -> a -> b
Prelude.$ ListSolutionVersions
rq
forall a b. a -> (a -> b) -> b
Prelude.& Lens' ListSolutionVersions (Maybe Text)
listSolutionVersions_nextToken
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListSolutionVersions
rs
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListSolutionVersionsResponse (Maybe Text)
listSolutionVersionsResponse_nextToken
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
instance Core.AWSRequest ListSolutionVersions where
type
AWSResponse ListSolutionVersions =
ListSolutionVersionsResponse
request :: (Service -> Service)
-> ListSolutionVersions -> Request ListSolutionVersions
request Service -> Service
overrides =
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy ListSolutionVersions
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse ListSolutionVersions)))
response =
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
( \Int
s ResponseHeaders
h Object
x ->
Maybe Text
-> Maybe [SolutionVersionSummary]
-> Int
-> ListSolutionVersionsResponse
ListSolutionVersionsResponse'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"nextToken")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x
forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"solutionVersions"
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty
)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
)
instance Prelude.Hashable ListSolutionVersions where
hashWithSalt :: Int -> ListSolutionVersions -> Int
hashWithSalt Int
_salt ListSolutionVersions' {Maybe Natural
Maybe Text
solutionArn :: Maybe Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:solutionArn:ListSolutionVersions' :: ListSolutionVersions -> Maybe Text
$sel:nextToken:ListSolutionVersions' :: ListSolutionVersions -> Maybe Text
$sel:maxResults:ListSolutionVersions' :: ListSolutionVersions -> Maybe Natural
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
maxResults
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
nextToken
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
solutionArn
instance Prelude.NFData ListSolutionVersions where
rnf :: ListSolutionVersions -> ()
rnf ListSolutionVersions' {Maybe Natural
Maybe Text
solutionArn :: Maybe Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:solutionArn:ListSolutionVersions' :: ListSolutionVersions -> Maybe Text
$sel:nextToken:ListSolutionVersions' :: ListSolutionVersions -> Maybe Text
$sel:maxResults:ListSolutionVersions' :: ListSolutionVersions -> Maybe Natural
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
maxResults
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
nextToken
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
solutionArn
instance Data.ToHeaders ListSolutionVersions where
toHeaders :: ListSolutionVersions -> ResponseHeaders
toHeaders =
forall a b. a -> b -> a
Prelude.const
( forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"X-Amz-Target"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"AmazonPersonalize.ListSolutionVersions" ::
Prelude.ByteString
),
HeaderName
"Content-Type"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Data.ToJSON ListSolutionVersions where
toJSON :: ListSolutionVersions -> Value
toJSON ListSolutionVersions' {Maybe Natural
Maybe Text
solutionArn :: Maybe Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:solutionArn:ListSolutionVersions' :: ListSolutionVersions -> Maybe Text
$sel:nextToken:ListSolutionVersions' :: ListSolutionVersions -> Maybe Text
$sel:maxResults:ListSolutionVersions' :: ListSolutionVersions -> Maybe Natural
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"maxResults" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
maxResults,
(Key
"nextToken" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
nextToken,
(Key
"solutionArn" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
solutionArn
]
)
instance Data.ToPath ListSolutionVersions where
toPath :: ListSolutionVersions -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Data.ToQuery ListSolutionVersions where
toQuery :: ListSolutionVersions -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data ListSolutionVersionsResponse = ListSolutionVersionsResponse'
{
ListSolutionVersionsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
ListSolutionVersionsResponse -> Maybe [SolutionVersionSummary]
solutionVersions :: Prelude.Maybe [SolutionVersionSummary],
ListSolutionVersionsResponse -> Int
httpStatus :: Prelude.Int
}
deriving (ListSolutionVersionsResponse
-> ListSolutionVersionsResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListSolutionVersionsResponse
-> ListSolutionVersionsResponse -> Bool
$c/= :: ListSolutionVersionsResponse
-> ListSolutionVersionsResponse -> Bool
== :: ListSolutionVersionsResponse
-> ListSolutionVersionsResponse -> Bool
$c== :: ListSolutionVersionsResponse
-> ListSolutionVersionsResponse -> Bool
Prelude.Eq, ReadPrec [ListSolutionVersionsResponse]
ReadPrec ListSolutionVersionsResponse
Int -> ReadS ListSolutionVersionsResponse
ReadS [ListSolutionVersionsResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListSolutionVersionsResponse]
$creadListPrec :: ReadPrec [ListSolutionVersionsResponse]
readPrec :: ReadPrec ListSolutionVersionsResponse
$creadPrec :: ReadPrec ListSolutionVersionsResponse
readList :: ReadS [ListSolutionVersionsResponse]
$creadList :: ReadS [ListSolutionVersionsResponse]
readsPrec :: Int -> ReadS ListSolutionVersionsResponse
$creadsPrec :: Int -> ReadS ListSolutionVersionsResponse
Prelude.Read, Int -> ListSolutionVersionsResponse -> ShowS
[ListSolutionVersionsResponse] -> ShowS
ListSolutionVersionsResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListSolutionVersionsResponse] -> ShowS
$cshowList :: [ListSolutionVersionsResponse] -> ShowS
show :: ListSolutionVersionsResponse -> String
$cshow :: ListSolutionVersionsResponse -> String
showsPrec :: Int -> ListSolutionVersionsResponse -> ShowS
$cshowsPrec :: Int -> ListSolutionVersionsResponse -> ShowS
Prelude.Show, forall x.
Rep ListSolutionVersionsResponse x -> ListSolutionVersionsResponse
forall x.
ListSolutionVersionsResponse -> Rep ListSolutionVersionsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListSolutionVersionsResponse x -> ListSolutionVersionsResponse
$cfrom :: forall x.
ListSolutionVersionsResponse -> Rep ListSolutionVersionsResponse x
Prelude.Generic)
newListSolutionVersionsResponse ::
Prelude.Int ->
ListSolutionVersionsResponse
newListSolutionVersionsResponse :: Int -> ListSolutionVersionsResponse
newListSolutionVersionsResponse Int
pHttpStatus_ =
ListSolutionVersionsResponse'
{ $sel:nextToken:ListSolutionVersionsResponse' :: Maybe Text
nextToken =
forall a. Maybe a
Prelude.Nothing,
$sel:solutionVersions:ListSolutionVersionsResponse' :: Maybe [SolutionVersionSummary]
solutionVersions = forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:ListSolutionVersionsResponse' :: Int
httpStatus = Int
pHttpStatus_
}
listSolutionVersionsResponse_nextToken :: Lens.Lens' ListSolutionVersionsResponse (Prelude.Maybe Prelude.Text)
listSolutionVersionsResponse_nextToken :: Lens' ListSolutionVersionsResponse (Maybe Text)
listSolutionVersionsResponse_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListSolutionVersionsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListSolutionVersionsResponse' :: ListSolutionVersionsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListSolutionVersionsResponse
s@ListSolutionVersionsResponse' {} Maybe Text
a -> ListSolutionVersionsResponse
s {$sel:nextToken:ListSolutionVersionsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListSolutionVersionsResponse)
listSolutionVersionsResponse_solutionVersions :: Lens.Lens' ListSolutionVersionsResponse (Prelude.Maybe [SolutionVersionSummary])
listSolutionVersionsResponse_solutionVersions :: Lens' ListSolutionVersionsResponse (Maybe [SolutionVersionSummary])
listSolutionVersionsResponse_solutionVersions = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListSolutionVersionsResponse' {Maybe [SolutionVersionSummary]
solutionVersions :: Maybe [SolutionVersionSummary]
$sel:solutionVersions:ListSolutionVersionsResponse' :: ListSolutionVersionsResponse -> Maybe [SolutionVersionSummary]
solutionVersions} -> Maybe [SolutionVersionSummary]
solutionVersions) (\s :: ListSolutionVersionsResponse
s@ListSolutionVersionsResponse' {} Maybe [SolutionVersionSummary]
a -> ListSolutionVersionsResponse
s {$sel:solutionVersions:ListSolutionVersionsResponse' :: Maybe [SolutionVersionSummary]
solutionVersions = Maybe [SolutionVersionSummary]
a} :: ListSolutionVersionsResponse) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
listSolutionVersionsResponse_httpStatus :: Lens.Lens' ListSolutionVersionsResponse Prelude.Int
listSolutionVersionsResponse_httpStatus :: Lens' ListSolutionVersionsResponse Int
listSolutionVersionsResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListSolutionVersionsResponse' {Int
httpStatus :: Int
$sel:httpStatus:ListSolutionVersionsResponse' :: ListSolutionVersionsResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: ListSolutionVersionsResponse
s@ListSolutionVersionsResponse' {} Int
a -> ListSolutionVersionsResponse
s {$sel:httpStatus:ListSolutionVersionsResponse' :: Int
httpStatus = Int
a} :: ListSolutionVersionsResponse)
instance Prelude.NFData ListSolutionVersionsResponse where
rnf :: ListSolutionVersionsResponse -> ()
rnf ListSolutionVersionsResponse' {Int
Maybe [SolutionVersionSummary]
Maybe Text
httpStatus :: Int
solutionVersions :: Maybe [SolutionVersionSummary]
nextToken :: Maybe Text
$sel:httpStatus:ListSolutionVersionsResponse' :: ListSolutionVersionsResponse -> Int
$sel:solutionVersions:ListSolutionVersionsResponse' :: ListSolutionVersionsResponse -> Maybe [SolutionVersionSummary]
$sel:nextToken:ListSolutionVersionsResponse' :: ListSolutionVersionsResponse -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
nextToken
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [SolutionVersionSummary]
solutionVersions
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus