{-# 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.PersonalizeRuntime.GetPersonalizedRanking
(
GetPersonalizedRanking (..),
newGetPersonalizedRanking,
getPersonalizedRanking_context,
getPersonalizedRanking_filterArn,
getPersonalizedRanking_filterValues,
getPersonalizedRanking_campaignArn,
getPersonalizedRanking_inputList,
getPersonalizedRanking_userId,
GetPersonalizedRankingResponse (..),
newGetPersonalizedRankingResponse,
getPersonalizedRankingResponse_personalizedRanking,
getPersonalizedRankingResponse_recommendationId,
getPersonalizedRankingResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.PersonalizeRuntime.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data GetPersonalizedRanking = GetPersonalizedRanking'
{
GetPersonalizedRanking -> Maybe (HashMap Text (Sensitive Text))
context :: Prelude.Maybe (Prelude.HashMap Prelude.Text (Core.Sensitive Prelude.Text)),
GetPersonalizedRanking -> Maybe Text
filterArn :: Prelude.Maybe Prelude.Text,
GetPersonalizedRanking -> Maybe (HashMap Text (Sensitive Text))
filterValues :: Prelude.Maybe (Prelude.HashMap Prelude.Text (Core.Sensitive Prelude.Text)),
GetPersonalizedRanking -> Text
campaignArn :: Prelude.Text,
GetPersonalizedRanking -> [Text]
inputList :: [Prelude.Text],
GetPersonalizedRanking -> Text
userId :: Prelude.Text
}
deriving (GetPersonalizedRanking -> GetPersonalizedRanking -> Bool
(GetPersonalizedRanking -> GetPersonalizedRanking -> Bool)
-> (GetPersonalizedRanking -> GetPersonalizedRanking -> Bool)
-> Eq GetPersonalizedRanking
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetPersonalizedRanking -> GetPersonalizedRanking -> Bool
$c/= :: GetPersonalizedRanking -> GetPersonalizedRanking -> Bool
== :: GetPersonalizedRanking -> GetPersonalizedRanking -> Bool
$c== :: GetPersonalizedRanking -> GetPersonalizedRanking -> Bool
Prelude.Eq, Int -> GetPersonalizedRanking -> ShowS
[GetPersonalizedRanking] -> ShowS
GetPersonalizedRanking -> String
(Int -> GetPersonalizedRanking -> ShowS)
-> (GetPersonalizedRanking -> String)
-> ([GetPersonalizedRanking] -> ShowS)
-> Show GetPersonalizedRanking
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetPersonalizedRanking] -> ShowS
$cshowList :: [GetPersonalizedRanking] -> ShowS
show :: GetPersonalizedRanking -> String
$cshow :: GetPersonalizedRanking -> String
showsPrec :: Int -> GetPersonalizedRanking -> ShowS
$cshowsPrec :: Int -> GetPersonalizedRanking -> ShowS
Prelude.Show, (forall x. GetPersonalizedRanking -> Rep GetPersonalizedRanking x)
-> (forall x.
Rep GetPersonalizedRanking x -> GetPersonalizedRanking)
-> Generic GetPersonalizedRanking
forall x. Rep GetPersonalizedRanking x -> GetPersonalizedRanking
forall x. GetPersonalizedRanking -> Rep GetPersonalizedRanking x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetPersonalizedRanking x -> GetPersonalizedRanking
$cfrom :: forall x. GetPersonalizedRanking -> Rep GetPersonalizedRanking x
Prelude.Generic)
newGetPersonalizedRanking ::
Prelude.Text ->
Prelude.Text ->
GetPersonalizedRanking
newGetPersonalizedRanking :: Text -> Text -> GetPersonalizedRanking
newGetPersonalizedRanking Text
pCampaignArn_ Text
pUserId_ =
GetPersonalizedRanking' :: Maybe (HashMap Text (Sensitive Text))
-> Maybe Text
-> Maybe (HashMap Text (Sensitive Text))
-> Text
-> [Text]
-> Text
-> GetPersonalizedRanking
GetPersonalizedRanking'
{ $sel:context:GetPersonalizedRanking' :: Maybe (HashMap Text (Sensitive Text))
context = Maybe (HashMap Text (Sensitive Text))
forall a. Maybe a
Prelude.Nothing,
$sel:filterArn:GetPersonalizedRanking' :: Maybe Text
filterArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:filterValues:GetPersonalizedRanking' :: Maybe (HashMap Text (Sensitive Text))
filterValues = Maybe (HashMap Text (Sensitive Text))
forall a. Maybe a
Prelude.Nothing,
$sel:campaignArn:GetPersonalizedRanking' :: Text
campaignArn = Text
pCampaignArn_,
$sel:inputList:GetPersonalizedRanking' :: [Text]
inputList = [Text]
forall a. Monoid a => a
Prelude.mempty,
$sel:userId:GetPersonalizedRanking' :: Text
userId = Text
pUserId_
}
getPersonalizedRanking_context :: Lens.Lens' GetPersonalizedRanking (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
getPersonalizedRanking_context :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> GetPersonalizedRanking -> f GetPersonalizedRanking
getPersonalizedRanking_context = (GetPersonalizedRanking -> Maybe (HashMap Text (Sensitive Text)))
-> (GetPersonalizedRanking
-> Maybe (HashMap Text (Sensitive Text)) -> GetPersonalizedRanking)
-> Lens
GetPersonalizedRanking
GetPersonalizedRanking
(Maybe (HashMap Text (Sensitive Text)))
(Maybe (HashMap Text (Sensitive Text)))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetPersonalizedRanking' {Maybe (HashMap Text (Sensitive Text))
context :: Maybe (HashMap Text (Sensitive Text))
$sel:context:GetPersonalizedRanking' :: GetPersonalizedRanking -> Maybe (HashMap Text (Sensitive Text))
context} -> Maybe (HashMap Text (Sensitive Text))
context) (\s :: GetPersonalizedRanking
s@GetPersonalizedRanking' {} Maybe (HashMap Text (Sensitive Text))
a -> GetPersonalizedRanking
s {$sel:context:GetPersonalizedRanking' :: Maybe (HashMap Text (Sensitive Text))
context = Maybe (HashMap Text (Sensitive Text))
a} :: GetPersonalizedRanking) ((Maybe (HashMap Text (Sensitive Text))
-> f (Maybe (HashMap Text (Sensitive Text))))
-> GetPersonalizedRanking -> f GetPersonalizedRanking)
-> ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> Maybe (HashMap Text (Sensitive Text))
-> f (Maybe (HashMap Text (Sensitive Text))))
-> (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> GetPersonalizedRanking
-> f GetPersonalizedRanking
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
(HashMap Text (Sensitive Text))
(HashMap Text (Sensitive Text))
(HashMap Text Text)
(HashMap Text Text)
-> Iso
(Maybe (HashMap Text (Sensitive Text)))
(Maybe (HashMap Text (Sensitive Text)))
(Maybe (HashMap Text Text))
(Maybe (HashMap Text Text))
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
(HashMap Text (Sensitive Text))
(HashMap Text (Sensitive Text))
(HashMap Text Text)
(HashMap Text Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
getPersonalizedRanking_filterArn :: Lens.Lens' GetPersonalizedRanking (Prelude.Maybe Prelude.Text)
getPersonalizedRanking_filterArn :: (Maybe Text -> f (Maybe Text))
-> GetPersonalizedRanking -> f GetPersonalizedRanking
getPersonalizedRanking_filterArn = (GetPersonalizedRanking -> Maybe Text)
-> (GetPersonalizedRanking -> Maybe Text -> GetPersonalizedRanking)
-> Lens
GetPersonalizedRanking
GetPersonalizedRanking
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetPersonalizedRanking' {Maybe Text
filterArn :: Maybe Text
$sel:filterArn:GetPersonalizedRanking' :: GetPersonalizedRanking -> Maybe Text
filterArn} -> Maybe Text
filterArn) (\s :: GetPersonalizedRanking
s@GetPersonalizedRanking' {} Maybe Text
a -> GetPersonalizedRanking
s {$sel:filterArn:GetPersonalizedRanking' :: Maybe Text
filterArn = Maybe Text
a} :: GetPersonalizedRanking)
getPersonalizedRanking_filterValues :: Lens.Lens' GetPersonalizedRanking (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
getPersonalizedRanking_filterValues :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> GetPersonalizedRanking -> f GetPersonalizedRanking
getPersonalizedRanking_filterValues = (GetPersonalizedRanking -> Maybe (HashMap Text (Sensitive Text)))
-> (GetPersonalizedRanking
-> Maybe (HashMap Text (Sensitive Text)) -> GetPersonalizedRanking)
-> Lens
GetPersonalizedRanking
GetPersonalizedRanking
(Maybe (HashMap Text (Sensitive Text)))
(Maybe (HashMap Text (Sensitive Text)))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetPersonalizedRanking' {Maybe (HashMap Text (Sensitive Text))
filterValues :: Maybe (HashMap Text (Sensitive Text))
$sel:filterValues:GetPersonalizedRanking' :: GetPersonalizedRanking -> Maybe (HashMap Text (Sensitive Text))
filterValues} -> Maybe (HashMap Text (Sensitive Text))
filterValues) (\s :: GetPersonalizedRanking
s@GetPersonalizedRanking' {} Maybe (HashMap Text (Sensitive Text))
a -> GetPersonalizedRanking
s {$sel:filterValues:GetPersonalizedRanking' :: Maybe (HashMap Text (Sensitive Text))
filterValues = Maybe (HashMap Text (Sensitive Text))
a} :: GetPersonalizedRanking) ((Maybe (HashMap Text (Sensitive Text))
-> f (Maybe (HashMap Text (Sensitive Text))))
-> GetPersonalizedRanking -> f GetPersonalizedRanking)
-> ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> Maybe (HashMap Text (Sensitive Text))
-> f (Maybe (HashMap Text (Sensitive Text))))
-> (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> GetPersonalizedRanking
-> f GetPersonalizedRanking
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
(HashMap Text (Sensitive Text))
(HashMap Text (Sensitive Text))
(HashMap Text Text)
(HashMap Text Text)
-> Iso
(Maybe (HashMap Text (Sensitive Text)))
(Maybe (HashMap Text (Sensitive Text)))
(Maybe (HashMap Text Text))
(Maybe (HashMap Text Text))
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
(HashMap Text (Sensitive Text))
(HashMap Text (Sensitive Text))
(HashMap Text Text)
(HashMap Text Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
getPersonalizedRanking_campaignArn :: Lens.Lens' GetPersonalizedRanking Prelude.Text
getPersonalizedRanking_campaignArn :: (Text -> f Text)
-> GetPersonalizedRanking -> f GetPersonalizedRanking
getPersonalizedRanking_campaignArn = (GetPersonalizedRanking -> Text)
-> (GetPersonalizedRanking -> Text -> GetPersonalizedRanking)
-> Lens GetPersonalizedRanking GetPersonalizedRanking Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetPersonalizedRanking' {Text
campaignArn :: Text
$sel:campaignArn:GetPersonalizedRanking' :: GetPersonalizedRanking -> Text
campaignArn} -> Text
campaignArn) (\s :: GetPersonalizedRanking
s@GetPersonalizedRanking' {} Text
a -> GetPersonalizedRanking
s {$sel:campaignArn:GetPersonalizedRanking' :: Text
campaignArn = Text
a} :: GetPersonalizedRanking)
getPersonalizedRanking_inputList :: Lens.Lens' GetPersonalizedRanking [Prelude.Text]
getPersonalizedRanking_inputList :: ([Text] -> f [Text])
-> GetPersonalizedRanking -> f GetPersonalizedRanking
getPersonalizedRanking_inputList = (GetPersonalizedRanking -> [Text])
-> (GetPersonalizedRanking -> [Text] -> GetPersonalizedRanking)
-> Lens GetPersonalizedRanking GetPersonalizedRanking [Text] [Text]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetPersonalizedRanking' {[Text]
inputList :: [Text]
$sel:inputList:GetPersonalizedRanking' :: GetPersonalizedRanking -> [Text]
inputList} -> [Text]
inputList) (\s :: GetPersonalizedRanking
s@GetPersonalizedRanking' {} [Text]
a -> GetPersonalizedRanking
s {$sel:inputList:GetPersonalizedRanking' :: [Text]
inputList = [Text]
a} :: GetPersonalizedRanking) (([Text] -> f [Text])
-> GetPersonalizedRanking -> f GetPersonalizedRanking)
-> (([Text] -> f [Text]) -> [Text] -> f [Text])
-> ([Text] -> f [Text])
-> GetPersonalizedRanking
-> f GetPersonalizedRanking
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([Text] -> f [Text]) -> [Text] -> f [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
getPersonalizedRanking_userId :: Lens.Lens' GetPersonalizedRanking Prelude.Text
getPersonalizedRanking_userId :: (Text -> f Text)
-> GetPersonalizedRanking -> f GetPersonalizedRanking
getPersonalizedRanking_userId = (GetPersonalizedRanking -> Text)
-> (GetPersonalizedRanking -> Text -> GetPersonalizedRanking)
-> Lens GetPersonalizedRanking GetPersonalizedRanking Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetPersonalizedRanking' {Text
userId :: Text
$sel:userId:GetPersonalizedRanking' :: GetPersonalizedRanking -> Text
userId} -> Text
userId) (\s :: GetPersonalizedRanking
s@GetPersonalizedRanking' {} Text
a -> GetPersonalizedRanking
s {$sel:userId:GetPersonalizedRanking' :: Text
userId = Text
a} :: GetPersonalizedRanking)
instance Core.AWSRequest GetPersonalizedRanking where
type
AWSResponse GetPersonalizedRanking =
GetPersonalizedRankingResponse
request :: GetPersonalizedRanking -> Request GetPersonalizedRanking
request = Service -> GetPersonalizedRanking -> Request GetPersonalizedRanking
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy GetPersonalizedRanking
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse GetPersonalizedRanking)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse GetPersonalizedRanking))
-> Logger
-> Service
-> Proxy GetPersonalizedRanking
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse GetPersonalizedRanking)))
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 [PredictedItem]
-> Maybe Text -> Int -> GetPersonalizedRankingResponse
GetPersonalizedRankingResponse'
(Maybe [PredictedItem]
-> Maybe Text -> Int -> GetPersonalizedRankingResponse)
-> Either String (Maybe [PredictedItem])
-> Either
String (Maybe Text -> Int -> GetPersonalizedRankingResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ( Object
x Object -> Text -> Either String (Maybe (Maybe [PredictedItem]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"personalizedRanking"
Either String (Maybe (Maybe [PredictedItem]))
-> Maybe [PredictedItem] -> Either String (Maybe [PredictedItem])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [PredictedItem]
forall a. Monoid a => a
Prelude.mempty
)
Either String (Maybe Text -> Int -> GetPersonalizedRankingResponse)
-> Either String (Maybe Text)
-> Either String (Int -> GetPersonalizedRankingResponse)
forall (f :: * -> *) a b. Applicative f => 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
"recommendationId")
Either String (Int -> GetPersonalizedRankingResponse)
-> Either String Int
-> Either String GetPersonalizedRankingResponse
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 GetPersonalizedRanking
instance Prelude.NFData GetPersonalizedRanking
instance Core.ToHeaders GetPersonalizedRanking where
toHeaders :: GetPersonalizedRanking -> ResponseHeaders
toHeaders =
ResponseHeaders -> GetPersonalizedRanking -> 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.ToJSON GetPersonalizedRanking where
toJSON :: GetPersonalizedRanking -> Value
toJSON GetPersonalizedRanking' {[Text]
Maybe Text
Maybe (HashMap Text (Sensitive Text))
Text
userId :: Text
inputList :: [Text]
campaignArn :: Text
filterValues :: Maybe (HashMap Text (Sensitive Text))
filterArn :: Maybe Text
context :: Maybe (HashMap Text (Sensitive Text))
$sel:userId:GetPersonalizedRanking' :: GetPersonalizedRanking -> Text
$sel:inputList:GetPersonalizedRanking' :: GetPersonalizedRanking -> [Text]
$sel:campaignArn:GetPersonalizedRanking' :: GetPersonalizedRanking -> Text
$sel:filterValues:GetPersonalizedRanking' :: GetPersonalizedRanking -> Maybe (HashMap Text (Sensitive Text))
$sel:filterArn:GetPersonalizedRanking' :: GetPersonalizedRanking -> Maybe Text
$sel:context:GetPersonalizedRanking' :: GetPersonalizedRanking -> Maybe (HashMap Text (Sensitive Text))
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"context" Text -> HashMap Text (Sensitive Text) -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (HashMap Text (Sensitive Text) -> Pair)
-> Maybe (HashMap Text (Sensitive Text)) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (HashMap Text (Sensitive Text))
context,
(Text
"filterArn" 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
filterArn,
(Text
"filterValues" Text -> HashMap Text (Sensitive Text) -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (HashMap Text (Sensitive Text) -> Pair)
-> Maybe (HashMap Text (Sensitive Text)) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (HashMap Text (Sensitive Text))
filterValues,
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"campaignArn" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
campaignArn),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"inputList" Text -> [Text] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= [Text]
inputList),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"userId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
userId)
]
)
instance Core.ToPath GetPersonalizedRanking where
toPath :: GetPersonalizedRanking -> ByteString
toPath = ByteString -> GetPersonalizedRanking -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/personalize-ranking"
instance Core.ToQuery GetPersonalizedRanking where
toQuery :: GetPersonalizedRanking -> QueryString
toQuery = QueryString -> GetPersonalizedRanking -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data GetPersonalizedRankingResponse = GetPersonalizedRankingResponse'
{
GetPersonalizedRankingResponse -> Maybe [PredictedItem]
personalizedRanking :: Prelude.Maybe [PredictedItem],
GetPersonalizedRankingResponse -> Maybe Text
recommendationId :: Prelude.Maybe Prelude.Text,
GetPersonalizedRankingResponse -> Int
httpStatus :: Prelude.Int
}
deriving (GetPersonalizedRankingResponse
-> GetPersonalizedRankingResponse -> Bool
(GetPersonalizedRankingResponse
-> GetPersonalizedRankingResponse -> Bool)
-> (GetPersonalizedRankingResponse
-> GetPersonalizedRankingResponse -> Bool)
-> Eq GetPersonalizedRankingResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetPersonalizedRankingResponse
-> GetPersonalizedRankingResponse -> Bool
$c/= :: GetPersonalizedRankingResponse
-> GetPersonalizedRankingResponse -> Bool
== :: GetPersonalizedRankingResponse
-> GetPersonalizedRankingResponse -> Bool
$c== :: GetPersonalizedRankingResponse
-> GetPersonalizedRankingResponse -> Bool
Prelude.Eq, ReadPrec [GetPersonalizedRankingResponse]
ReadPrec GetPersonalizedRankingResponse
Int -> ReadS GetPersonalizedRankingResponse
ReadS [GetPersonalizedRankingResponse]
(Int -> ReadS GetPersonalizedRankingResponse)
-> ReadS [GetPersonalizedRankingResponse]
-> ReadPrec GetPersonalizedRankingResponse
-> ReadPrec [GetPersonalizedRankingResponse]
-> Read GetPersonalizedRankingResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetPersonalizedRankingResponse]
$creadListPrec :: ReadPrec [GetPersonalizedRankingResponse]
readPrec :: ReadPrec GetPersonalizedRankingResponse
$creadPrec :: ReadPrec GetPersonalizedRankingResponse
readList :: ReadS [GetPersonalizedRankingResponse]
$creadList :: ReadS [GetPersonalizedRankingResponse]
readsPrec :: Int -> ReadS GetPersonalizedRankingResponse
$creadsPrec :: Int -> ReadS GetPersonalizedRankingResponse
Prelude.Read, Int -> GetPersonalizedRankingResponse -> ShowS
[GetPersonalizedRankingResponse] -> ShowS
GetPersonalizedRankingResponse -> String
(Int -> GetPersonalizedRankingResponse -> ShowS)
-> (GetPersonalizedRankingResponse -> String)
-> ([GetPersonalizedRankingResponse] -> ShowS)
-> Show GetPersonalizedRankingResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetPersonalizedRankingResponse] -> ShowS
$cshowList :: [GetPersonalizedRankingResponse] -> ShowS
show :: GetPersonalizedRankingResponse -> String
$cshow :: GetPersonalizedRankingResponse -> String
showsPrec :: Int -> GetPersonalizedRankingResponse -> ShowS
$cshowsPrec :: Int -> GetPersonalizedRankingResponse -> ShowS
Prelude.Show, (forall x.
GetPersonalizedRankingResponse
-> Rep GetPersonalizedRankingResponse x)
-> (forall x.
Rep GetPersonalizedRankingResponse x
-> GetPersonalizedRankingResponse)
-> Generic GetPersonalizedRankingResponse
forall x.
Rep GetPersonalizedRankingResponse x
-> GetPersonalizedRankingResponse
forall x.
GetPersonalizedRankingResponse
-> Rep GetPersonalizedRankingResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetPersonalizedRankingResponse x
-> GetPersonalizedRankingResponse
$cfrom :: forall x.
GetPersonalizedRankingResponse
-> Rep GetPersonalizedRankingResponse x
Prelude.Generic)
newGetPersonalizedRankingResponse ::
Prelude.Int ->
GetPersonalizedRankingResponse
newGetPersonalizedRankingResponse :: Int -> GetPersonalizedRankingResponse
newGetPersonalizedRankingResponse Int
pHttpStatus_ =
GetPersonalizedRankingResponse' :: Maybe [PredictedItem]
-> Maybe Text -> Int -> GetPersonalizedRankingResponse
GetPersonalizedRankingResponse'
{ $sel:personalizedRanking:GetPersonalizedRankingResponse' :: Maybe [PredictedItem]
personalizedRanking =
Maybe [PredictedItem]
forall a. Maybe a
Prelude.Nothing,
$sel:recommendationId:GetPersonalizedRankingResponse' :: Maybe Text
recommendationId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:GetPersonalizedRankingResponse' :: Int
httpStatus = Int
pHttpStatus_
}
getPersonalizedRankingResponse_personalizedRanking :: Lens.Lens' GetPersonalizedRankingResponse (Prelude.Maybe [PredictedItem])
getPersonalizedRankingResponse_personalizedRanking :: (Maybe [PredictedItem] -> f (Maybe [PredictedItem]))
-> GetPersonalizedRankingResponse
-> f GetPersonalizedRankingResponse
getPersonalizedRankingResponse_personalizedRanking = (GetPersonalizedRankingResponse -> Maybe [PredictedItem])
-> (GetPersonalizedRankingResponse
-> Maybe [PredictedItem] -> GetPersonalizedRankingResponse)
-> Lens
GetPersonalizedRankingResponse
GetPersonalizedRankingResponse
(Maybe [PredictedItem])
(Maybe [PredictedItem])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetPersonalizedRankingResponse' {Maybe [PredictedItem]
personalizedRanking :: Maybe [PredictedItem]
$sel:personalizedRanking:GetPersonalizedRankingResponse' :: GetPersonalizedRankingResponse -> Maybe [PredictedItem]
personalizedRanking} -> Maybe [PredictedItem]
personalizedRanking) (\s :: GetPersonalizedRankingResponse
s@GetPersonalizedRankingResponse' {} Maybe [PredictedItem]
a -> GetPersonalizedRankingResponse
s {$sel:personalizedRanking:GetPersonalizedRankingResponse' :: Maybe [PredictedItem]
personalizedRanking = Maybe [PredictedItem]
a} :: GetPersonalizedRankingResponse) ((Maybe [PredictedItem] -> f (Maybe [PredictedItem]))
-> GetPersonalizedRankingResponse
-> f GetPersonalizedRankingResponse)
-> ((Maybe [PredictedItem] -> f (Maybe [PredictedItem]))
-> Maybe [PredictedItem] -> f (Maybe [PredictedItem]))
-> (Maybe [PredictedItem] -> f (Maybe [PredictedItem]))
-> GetPersonalizedRankingResponse
-> f GetPersonalizedRankingResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
[PredictedItem] [PredictedItem] [PredictedItem] [PredictedItem]
-> Iso
(Maybe [PredictedItem])
(Maybe [PredictedItem])
(Maybe [PredictedItem])
(Maybe [PredictedItem])
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
[PredictedItem] [PredictedItem] [PredictedItem] [PredictedItem]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
getPersonalizedRankingResponse_recommendationId :: Lens.Lens' GetPersonalizedRankingResponse (Prelude.Maybe Prelude.Text)
getPersonalizedRankingResponse_recommendationId :: (Maybe Text -> f (Maybe Text))
-> GetPersonalizedRankingResponse
-> f GetPersonalizedRankingResponse
getPersonalizedRankingResponse_recommendationId = (GetPersonalizedRankingResponse -> Maybe Text)
-> (GetPersonalizedRankingResponse
-> Maybe Text -> GetPersonalizedRankingResponse)
-> Lens
GetPersonalizedRankingResponse
GetPersonalizedRankingResponse
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetPersonalizedRankingResponse' {Maybe Text
recommendationId :: Maybe Text
$sel:recommendationId:GetPersonalizedRankingResponse' :: GetPersonalizedRankingResponse -> Maybe Text
recommendationId} -> Maybe Text
recommendationId) (\s :: GetPersonalizedRankingResponse
s@GetPersonalizedRankingResponse' {} Maybe Text
a -> GetPersonalizedRankingResponse
s {$sel:recommendationId:GetPersonalizedRankingResponse' :: Maybe Text
recommendationId = Maybe Text
a} :: GetPersonalizedRankingResponse)
getPersonalizedRankingResponse_httpStatus :: Lens.Lens' GetPersonalizedRankingResponse Prelude.Int
getPersonalizedRankingResponse_httpStatus :: (Int -> f Int)
-> GetPersonalizedRankingResponse
-> f GetPersonalizedRankingResponse
getPersonalizedRankingResponse_httpStatus = (GetPersonalizedRankingResponse -> Int)
-> (GetPersonalizedRankingResponse
-> Int -> GetPersonalizedRankingResponse)
-> Lens
GetPersonalizedRankingResponse
GetPersonalizedRankingResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetPersonalizedRankingResponse' {Int
httpStatus :: Int
$sel:httpStatus:GetPersonalizedRankingResponse' :: GetPersonalizedRankingResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: GetPersonalizedRankingResponse
s@GetPersonalizedRankingResponse' {} Int
a -> GetPersonalizedRankingResponse
s {$sel:httpStatus:GetPersonalizedRankingResponse' :: Int
httpStatus = Int
a} :: GetPersonalizedRankingResponse)
instance
Prelude.NFData
GetPersonalizedRankingResponse