{-# 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.GetRecommendations
(
GetRecommendations (..),
newGetRecommendations,
getRecommendations_context,
getRecommendations_itemId,
getRecommendations_userId,
getRecommendations_numResults,
getRecommendations_filterArn,
getRecommendations_filterValues,
getRecommendations_campaignArn,
GetRecommendationsResponse (..),
newGetRecommendationsResponse,
getRecommendationsResponse_recommendationId,
getRecommendationsResponse_itemList,
getRecommendationsResponse_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 GetRecommendations = GetRecommendations'
{
GetRecommendations -> Maybe (HashMap Text (Sensitive Text))
context :: Prelude.Maybe (Prelude.HashMap Prelude.Text (Core.Sensitive Prelude.Text)),
GetRecommendations -> Maybe Text
itemId :: Prelude.Maybe Prelude.Text,
GetRecommendations -> Maybe Text
userId :: Prelude.Maybe Prelude.Text,
GetRecommendations -> Maybe Natural
numResults :: Prelude.Maybe Prelude.Natural,
GetRecommendations -> Maybe Text
filterArn :: Prelude.Maybe Prelude.Text,
GetRecommendations -> Maybe (HashMap Text (Sensitive Text))
filterValues :: Prelude.Maybe (Prelude.HashMap Prelude.Text (Core.Sensitive Prelude.Text)),
GetRecommendations -> Text
campaignArn :: Prelude.Text
}
deriving (GetRecommendations -> GetRecommendations -> Bool
(GetRecommendations -> GetRecommendations -> Bool)
-> (GetRecommendations -> GetRecommendations -> Bool)
-> Eq GetRecommendations
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetRecommendations -> GetRecommendations -> Bool
$c/= :: GetRecommendations -> GetRecommendations -> Bool
== :: GetRecommendations -> GetRecommendations -> Bool
$c== :: GetRecommendations -> GetRecommendations -> Bool
Prelude.Eq, Int -> GetRecommendations -> ShowS
[GetRecommendations] -> ShowS
GetRecommendations -> String
(Int -> GetRecommendations -> ShowS)
-> (GetRecommendations -> String)
-> ([GetRecommendations] -> ShowS)
-> Show GetRecommendations
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetRecommendations] -> ShowS
$cshowList :: [GetRecommendations] -> ShowS
show :: GetRecommendations -> String
$cshow :: GetRecommendations -> String
showsPrec :: Int -> GetRecommendations -> ShowS
$cshowsPrec :: Int -> GetRecommendations -> ShowS
Prelude.Show, (forall x. GetRecommendations -> Rep GetRecommendations x)
-> (forall x. Rep GetRecommendations x -> GetRecommendations)
-> Generic GetRecommendations
forall x. Rep GetRecommendations x -> GetRecommendations
forall x. GetRecommendations -> Rep GetRecommendations x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetRecommendations x -> GetRecommendations
$cfrom :: forall x. GetRecommendations -> Rep GetRecommendations x
Prelude.Generic)
newGetRecommendations ::
Prelude.Text ->
GetRecommendations
newGetRecommendations :: Text -> GetRecommendations
newGetRecommendations Text
pCampaignArn_ =
GetRecommendations' :: Maybe (HashMap Text (Sensitive Text))
-> Maybe Text
-> Maybe Text
-> Maybe Natural
-> Maybe Text
-> Maybe (HashMap Text (Sensitive Text))
-> Text
-> GetRecommendations
GetRecommendations'
{ $sel:context:GetRecommendations' :: Maybe (HashMap Text (Sensitive Text))
context = Maybe (HashMap Text (Sensitive Text))
forall a. Maybe a
Prelude.Nothing,
$sel:itemId:GetRecommendations' :: Maybe Text
itemId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:userId:GetRecommendations' :: Maybe Text
userId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:numResults:GetRecommendations' :: Maybe Natural
numResults = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
$sel:filterArn:GetRecommendations' :: Maybe Text
filterArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:filterValues:GetRecommendations' :: Maybe (HashMap Text (Sensitive Text))
filterValues = Maybe (HashMap Text (Sensitive Text))
forall a. Maybe a
Prelude.Nothing,
$sel:campaignArn:GetRecommendations' :: Text
campaignArn = Text
pCampaignArn_
}
getRecommendations_context :: Lens.Lens' GetRecommendations (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
getRecommendations_context :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> GetRecommendations -> f GetRecommendations
getRecommendations_context = (GetRecommendations -> Maybe (HashMap Text (Sensitive Text)))
-> (GetRecommendations
-> Maybe (HashMap Text (Sensitive Text)) -> GetRecommendations)
-> Lens
GetRecommendations
GetRecommendations
(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 (\GetRecommendations' {Maybe (HashMap Text (Sensitive Text))
context :: Maybe (HashMap Text (Sensitive Text))
$sel:context:GetRecommendations' :: GetRecommendations -> Maybe (HashMap Text (Sensitive Text))
context} -> Maybe (HashMap Text (Sensitive Text))
context) (\s :: GetRecommendations
s@GetRecommendations' {} Maybe (HashMap Text (Sensitive Text))
a -> GetRecommendations
s {$sel:context:GetRecommendations' :: Maybe (HashMap Text (Sensitive Text))
context = Maybe (HashMap Text (Sensitive Text))
a} :: GetRecommendations) ((Maybe (HashMap Text (Sensitive Text))
-> f (Maybe (HashMap Text (Sensitive Text))))
-> GetRecommendations -> f GetRecommendations)
-> ((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)))
-> GetRecommendations
-> f GetRecommendations
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
getRecommendations_itemId :: Lens.Lens' GetRecommendations (Prelude.Maybe Prelude.Text)
getRecommendations_itemId :: (Maybe Text -> f (Maybe Text))
-> GetRecommendations -> f GetRecommendations
getRecommendations_itemId = (GetRecommendations -> Maybe Text)
-> (GetRecommendations -> Maybe Text -> GetRecommendations)
-> Lens
GetRecommendations GetRecommendations (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetRecommendations' {Maybe Text
itemId :: Maybe Text
$sel:itemId:GetRecommendations' :: GetRecommendations -> Maybe Text
itemId} -> Maybe Text
itemId) (\s :: GetRecommendations
s@GetRecommendations' {} Maybe Text
a -> GetRecommendations
s {$sel:itemId:GetRecommendations' :: Maybe Text
itemId = Maybe Text
a} :: GetRecommendations)
getRecommendations_userId :: Lens.Lens' GetRecommendations (Prelude.Maybe Prelude.Text)
getRecommendations_userId :: (Maybe Text -> f (Maybe Text))
-> GetRecommendations -> f GetRecommendations
getRecommendations_userId = (GetRecommendations -> Maybe Text)
-> (GetRecommendations -> Maybe Text -> GetRecommendations)
-> Lens
GetRecommendations GetRecommendations (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetRecommendations' {Maybe Text
userId :: Maybe Text
$sel:userId:GetRecommendations' :: GetRecommendations -> Maybe Text
userId} -> Maybe Text
userId) (\s :: GetRecommendations
s@GetRecommendations' {} Maybe Text
a -> GetRecommendations
s {$sel:userId:GetRecommendations' :: Maybe Text
userId = Maybe Text
a} :: GetRecommendations)
getRecommendations_numResults :: Lens.Lens' GetRecommendations (Prelude.Maybe Prelude.Natural)
getRecommendations_numResults :: (Maybe Natural -> f (Maybe Natural))
-> GetRecommendations -> f GetRecommendations
getRecommendations_numResults = (GetRecommendations -> Maybe Natural)
-> (GetRecommendations -> Maybe Natural -> GetRecommendations)
-> Lens
GetRecommendations
GetRecommendations
(Maybe Natural)
(Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetRecommendations' {Maybe Natural
numResults :: Maybe Natural
$sel:numResults:GetRecommendations' :: GetRecommendations -> Maybe Natural
numResults} -> Maybe Natural
numResults) (\s :: GetRecommendations
s@GetRecommendations' {} Maybe Natural
a -> GetRecommendations
s {$sel:numResults:GetRecommendations' :: Maybe Natural
numResults = Maybe Natural
a} :: GetRecommendations)
getRecommendations_filterArn :: Lens.Lens' GetRecommendations (Prelude.Maybe Prelude.Text)
getRecommendations_filterArn :: (Maybe Text -> f (Maybe Text))
-> GetRecommendations -> f GetRecommendations
getRecommendations_filterArn = (GetRecommendations -> Maybe Text)
-> (GetRecommendations -> Maybe Text -> GetRecommendations)
-> Lens
GetRecommendations GetRecommendations (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetRecommendations' {Maybe Text
filterArn :: Maybe Text
$sel:filterArn:GetRecommendations' :: GetRecommendations -> Maybe Text
filterArn} -> Maybe Text
filterArn) (\s :: GetRecommendations
s@GetRecommendations' {} Maybe Text
a -> GetRecommendations
s {$sel:filterArn:GetRecommendations' :: Maybe Text
filterArn = Maybe Text
a} :: GetRecommendations)
getRecommendations_filterValues :: Lens.Lens' GetRecommendations (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
getRecommendations_filterValues :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> GetRecommendations -> f GetRecommendations
getRecommendations_filterValues = (GetRecommendations -> Maybe (HashMap Text (Sensitive Text)))
-> (GetRecommendations
-> Maybe (HashMap Text (Sensitive Text)) -> GetRecommendations)
-> Lens
GetRecommendations
GetRecommendations
(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 (\GetRecommendations' {Maybe (HashMap Text (Sensitive Text))
filterValues :: Maybe (HashMap Text (Sensitive Text))
$sel:filterValues:GetRecommendations' :: GetRecommendations -> Maybe (HashMap Text (Sensitive Text))
filterValues} -> Maybe (HashMap Text (Sensitive Text))
filterValues) (\s :: GetRecommendations
s@GetRecommendations' {} Maybe (HashMap Text (Sensitive Text))
a -> GetRecommendations
s {$sel:filterValues:GetRecommendations' :: Maybe (HashMap Text (Sensitive Text))
filterValues = Maybe (HashMap Text (Sensitive Text))
a} :: GetRecommendations) ((Maybe (HashMap Text (Sensitive Text))
-> f (Maybe (HashMap Text (Sensitive Text))))
-> GetRecommendations -> f GetRecommendations)
-> ((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)))
-> GetRecommendations
-> f GetRecommendations
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
getRecommendations_campaignArn :: Lens.Lens' GetRecommendations Prelude.Text
getRecommendations_campaignArn :: (Text -> f Text) -> GetRecommendations -> f GetRecommendations
getRecommendations_campaignArn = (GetRecommendations -> Text)
-> (GetRecommendations -> Text -> GetRecommendations)
-> Lens GetRecommendations GetRecommendations Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetRecommendations' {Text
campaignArn :: Text
$sel:campaignArn:GetRecommendations' :: GetRecommendations -> Text
campaignArn} -> Text
campaignArn) (\s :: GetRecommendations
s@GetRecommendations' {} Text
a -> GetRecommendations
s {$sel:campaignArn:GetRecommendations' :: Text
campaignArn = Text
a} :: GetRecommendations)
instance Core.AWSRequest GetRecommendations where
type
AWSResponse GetRecommendations =
GetRecommendationsResponse
request :: GetRecommendations -> Request GetRecommendations
request = Service -> GetRecommendations -> Request GetRecommendations
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy GetRecommendations
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse GetRecommendations)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse GetRecommendations))
-> Logger
-> Service
-> Proxy GetRecommendations
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse GetRecommendations)))
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 [PredictedItem] -> Int -> GetRecommendationsResponse
GetRecommendationsResponse'
(Maybe Text
-> Maybe [PredictedItem] -> Int -> GetRecommendationsResponse)
-> Either String (Maybe Text)
-> Either
String (Maybe [PredictedItem] -> Int -> GetRecommendationsResponse)
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
"recommendationId")
Either
String (Maybe [PredictedItem] -> Int -> GetRecommendationsResponse)
-> Either String (Maybe [PredictedItem])
-> Either String (Int -> GetRecommendationsResponse)
forall (f :: * -> *) a b. Applicative f => 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
"itemList" 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 (Int -> GetRecommendationsResponse)
-> Either String Int -> Either String GetRecommendationsResponse
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 GetRecommendations
instance Prelude.NFData GetRecommendations
instance Core.ToHeaders GetRecommendations where
toHeaders :: GetRecommendations -> ResponseHeaders
toHeaders =
ResponseHeaders -> GetRecommendations -> 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 GetRecommendations where
toJSON :: GetRecommendations -> Value
toJSON GetRecommendations' {Maybe Natural
Maybe Text
Maybe (HashMap Text (Sensitive Text))
Text
campaignArn :: Text
filterValues :: Maybe (HashMap Text (Sensitive Text))
filterArn :: Maybe Text
numResults :: Maybe Natural
userId :: Maybe Text
itemId :: Maybe Text
context :: Maybe (HashMap Text (Sensitive Text))
$sel:campaignArn:GetRecommendations' :: GetRecommendations -> Text
$sel:filterValues:GetRecommendations' :: GetRecommendations -> Maybe (HashMap Text (Sensitive Text))
$sel:filterArn:GetRecommendations' :: GetRecommendations -> Maybe Text
$sel:numResults:GetRecommendations' :: GetRecommendations -> Maybe Natural
$sel:userId:GetRecommendations' :: GetRecommendations -> Maybe Text
$sel:itemId:GetRecommendations' :: GetRecommendations -> Maybe Text
$sel:context:GetRecommendations' :: GetRecommendations -> 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
"itemId" 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
itemId,
(Text
"userId" 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
userId,
(Text
"numResults" 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
numResults,
(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)
]
)
instance Core.ToPath GetRecommendations where
toPath :: GetRecommendations -> ByteString
toPath = ByteString -> GetRecommendations -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/recommendations"
instance Core.ToQuery GetRecommendations where
toQuery :: GetRecommendations -> QueryString
toQuery = QueryString -> GetRecommendations -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data GetRecommendationsResponse = GetRecommendationsResponse'
{
GetRecommendationsResponse -> Maybe Text
recommendationId :: Prelude.Maybe Prelude.Text,
GetRecommendationsResponse -> Maybe [PredictedItem]
itemList :: Prelude.Maybe [PredictedItem],
GetRecommendationsResponse -> Int
httpStatus :: Prelude.Int
}
deriving (GetRecommendationsResponse -> GetRecommendationsResponse -> Bool
(GetRecommendationsResponse -> GetRecommendationsResponse -> Bool)
-> (GetRecommendationsResponse
-> GetRecommendationsResponse -> Bool)
-> Eq GetRecommendationsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetRecommendationsResponse -> GetRecommendationsResponse -> Bool
$c/= :: GetRecommendationsResponse -> GetRecommendationsResponse -> Bool
== :: GetRecommendationsResponse -> GetRecommendationsResponse -> Bool
$c== :: GetRecommendationsResponse -> GetRecommendationsResponse -> Bool
Prelude.Eq, ReadPrec [GetRecommendationsResponse]
ReadPrec GetRecommendationsResponse
Int -> ReadS GetRecommendationsResponse
ReadS [GetRecommendationsResponse]
(Int -> ReadS GetRecommendationsResponse)
-> ReadS [GetRecommendationsResponse]
-> ReadPrec GetRecommendationsResponse
-> ReadPrec [GetRecommendationsResponse]
-> Read GetRecommendationsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetRecommendationsResponse]
$creadListPrec :: ReadPrec [GetRecommendationsResponse]
readPrec :: ReadPrec GetRecommendationsResponse
$creadPrec :: ReadPrec GetRecommendationsResponse
readList :: ReadS [GetRecommendationsResponse]
$creadList :: ReadS [GetRecommendationsResponse]
readsPrec :: Int -> ReadS GetRecommendationsResponse
$creadsPrec :: Int -> ReadS GetRecommendationsResponse
Prelude.Read, Int -> GetRecommendationsResponse -> ShowS
[GetRecommendationsResponse] -> ShowS
GetRecommendationsResponse -> String
(Int -> GetRecommendationsResponse -> ShowS)
-> (GetRecommendationsResponse -> String)
-> ([GetRecommendationsResponse] -> ShowS)
-> Show GetRecommendationsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetRecommendationsResponse] -> ShowS
$cshowList :: [GetRecommendationsResponse] -> ShowS
show :: GetRecommendationsResponse -> String
$cshow :: GetRecommendationsResponse -> String
showsPrec :: Int -> GetRecommendationsResponse -> ShowS
$cshowsPrec :: Int -> GetRecommendationsResponse -> ShowS
Prelude.Show, (forall x.
GetRecommendationsResponse -> Rep GetRecommendationsResponse x)
-> (forall x.
Rep GetRecommendationsResponse x -> GetRecommendationsResponse)
-> Generic GetRecommendationsResponse
forall x.
Rep GetRecommendationsResponse x -> GetRecommendationsResponse
forall x.
GetRecommendationsResponse -> Rep GetRecommendationsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetRecommendationsResponse x -> GetRecommendationsResponse
$cfrom :: forall x.
GetRecommendationsResponse -> Rep GetRecommendationsResponse x
Prelude.Generic)
newGetRecommendationsResponse ::
Prelude.Int ->
GetRecommendationsResponse
newGetRecommendationsResponse :: Int -> GetRecommendationsResponse
newGetRecommendationsResponse Int
pHttpStatus_ =
GetRecommendationsResponse' :: Maybe Text
-> Maybe [PredictedItem] -> Int -> GetRecommendationsResponse
GetRecommendationsResponse'
{ $sel:recommendationId:GetRecommendationsResponse' :: Maybe Text
recommendationId =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:itemList:GetRecommendationsResponse' :: Maybe [PredictedItem]
itemList = Maybe [PredictedItem]
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:GetRecommendationsResponse' :: Int
httpStatus = Int
pHttpStatus_
}
getRecommendationsResponse_recommendationId :: Lens.Lens' GetRecommendationsResponse (Prelude.Maybe Prelude.Text)
getRecommendationsResponse_recommendationId :: (Maybe Text -> f (Maybe Text))
-> GetRecommendationsResponse -> f GetRecommendationsResponse
getRecommendationsResponse_recommendationId = (GetRecommendationsResponse -> Maybe Text)
-> (GetRecommendationsResponse
-> Maybe Text -> GetRecommendationsResponse)
-> Lens
GetRecommendationsResponse
GetRecommendationsResponse
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetRecommendationsResponse' {Maybe Text
recommendationId :: Maybe Text
$sel:recommendationId:GetRecommendationsResponse' :: GetRecommendationsResponse -> Maybe Text
recommendationId} -> Maybe Text
recommendationId) (\s :: GetRecommendationsResponse
s@GetRecommendationsResponse' {} Maybe Text
a -> GetRecommendationsResponse
s {$sel:recommendationId:GetRecommendationsResponse' :: Maybe Text
recommendationId = Maybe Text
a} :: GetRecommendationsResponse)
getRecommendationsResponse_itemList :: Lens.Lens' GetRecommendationsResponse (Prelude.Maybe [PredictedItem])
getRecommendationsResponse_itemList :: (Maybe [PredictedItem] -> f (Maybe [PredictedItem]))
-> GetRecommendationsResponse -> f GetRecommendationsResponse
getRecommendationsResponse_itemList = (GetRecommendationsResponse -> Maybe [PredictedItem])
-> (GetRecommendationsResponse
-> Maybe [PredictedItem] -> GetRecommendationsResponse)
-> Lens
GetRecommendationsResponse
GetRecommendationsResponse
(Maybe [PredictedItem])
(Maybe [PredictedItem])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetRecommendationsResponse' {Maybe [PredictedItem]
itemList :: Maybe [PredictedItem]
$sel:itemList:GetRecommendationsResponse' :: GetRecommendationsResponse -> Maybe [PredictedItem]
itemList} -> Maybe [PredictedItem]
itemList) (\s :: GetRecommendationsResponse
s@GetRecommendationsResponse' {} Maybe [PredictedItem]
a -> GetRecommendationsResponse
s {$sel:itemList:GetRecommendationsResponse' :: Maybe [PredictedItem]
itemList = Maybe [PredictedItem]
a} :: GetRecommendationsResponse) ((Maybe [PredictedItem] -> f (Maybe [PredictedItem]))
-> GetRecommendationsResponse -> f GetRecommendationsResponse)
-> ((Maybe [PredictedItem] -> f (Maybe [PredictedItem]))
-> Maybe [PredictedItem] -> f (Maybe [PredictedItem]))
-> (Maybe [PredictedItem] -> f (Maybe [PredictedItem]))
-> GetRecommendationsResponse
-> f GetRecommendationsResponse
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
getRecommendationsResponse_httpStatus :: Lens.Lens' GetRecommendationsResponse Prelude.Int
getRecommendationsResponse_httpStatus :: (Int -> f Int)
-> GetRecommendationsResponse -> f GetRecommendationsResponse
getRecommendationsResponse_httpStatus = (GetRecommendationsResponse -> Int)
-> (GetRecommendationsResponse
-> Int -> GetRecommendationsResponse)
-> Lens
GetRecommendationsResponse GetRecommendationsResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetRecommendationsResponse' {Int
httpStatus :: Int
$sel:httpStatus:GetRecommendationsResponse' :: GetRecommendationsResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: GetRecommendationsResponse
s@GetRecommendationsResponse' {} Int
a -> GetRecommendationsResponse
s {$sel:httpStatus:GetRecommendationsResponse' :: Int
httpStatus = Int
a} :: GetRecommendationsResponse)
instance Prelude.NFData GetRecommendationsResponse