Copyright | (c) 2013-2021 Brendan Hay |
---|---|
License | Mozilla Public License, v. 2.0. |
Maintainer | Brendan Hay <brendan.g.hay+amazonka@gmail.com> |
Stability | auto-generated |
Portability | non-portable (GHC extensions) |
Safe Haskell | None |
Returns a list of recommended items. The required input depends on the recipe type used to create the solution backing the campaign, as follows:
- RELATED_ITEMS -
itemId
required,userId
not used - USER_PERSONALIZATION -
itemId
optional,userId
required
Campaigns that are backed by a solution created using a recipe of type PERSONALIZED_RANKING use the API.
Synopsis
- data GetRecommendations = GetRecommendations' {}
- newGetRecommendations :: Text -> GetRecommendations
- getRecommendations_context :: Lens' GetRecommendations (Maybe (HashMap Text Text))
- getRecommendations_itemId :: Lens' GetRecommendations (Maybe Text)
- getRecommendations_userId :: Lens' GetRecommendations (Maybe Text)
- getRecommendations_numResults :: Lens' GetRecommendations (Maybe Natural)
- getRecommendations_filterArn :: Lens' GetRecommendations (Maybe Text)
- getRecommendations_filterValues :: Lens' GetRecommendations (Maybe (HashMap Text Text))
- getRecommendations_campaignArn :: Lens' GetRecommendations Text
- data GetRecommendationsResponse = GetRecommendationsResponse' {
- recommendationId :: Maybe Text
- itemList :: Maybe [PredictedItem]
- httpStatus :: Int
- newGetRecommendationsResponse :: Int -> GetRecommendationsResponse
- getRecommendationsResponse_recommendationId :: Lens' GetRecommendationsResponse (Maybe Text)
- getRecommendationsResponse_itemList :: Lens' GetRecommendationsResponse (Maybe [PredictedItem])
- getRecommendationsResponse_httpStatus :: Lens' GetRecommendationsResponse Int
Creating a Request
data GetRecommendations Source #
See: newGetRecommendations
smart constructor.
GetRecommendations' | |
|
Instances
newGetRecommendations Source #
Create a value of GetRecommendations
with all optional fields omitted.
Use generic-lens or optics to modify other optional fields.
The following record fields are available, with the corresponding lenses provided for backwards compatibility:
$sel:context:GetRecommendations'
, getRecommendations_context
- The contextual metadata to use when getting recommendations. Contextual
metadata includes any interaction information that might be relevant
when getting a user's recommendations, such as the user's current
location or device type.
$sel:itemId:GetRecommendations'
, getRecommendations_itemId
- The item ID to provide recommendations for.
Required for RELATED_ITEMS
recipe type.
$sel:userId:GetRecommendations'
, getRecommendations_userId
- The user ID to provide recommendations for.
Required for USER_PERSONALIZATION
recipe type.
$sel:numResults:GetRecommendations'
, getRecommendations_numResults
- The number of results to return. The default is 25. The maximum is 500.
$sel:filterArn:GetRecommendations'
, getRecommendations_filterArn
- The ARN of the filter to apply to the returned recommendations. For more
information, see
Filtering Recommendations.
When using this parameter, be sure the filter resource is ACTIVE
.
$sel:filterValues:GetRecommendations'
, getRecommendations_filterValues
- The values to use when filtering recommendations. For each placeholder
parameter in your filter expression, provide the parameter name (in
matching case) as a key and the filter value(s) as the corresponding
value. Separate multiple values for one parameter with a comma.
For filter expressions that use an INCLUDE
element to include items,
you must provide values for all parameters that are defined in the
expression. For filters with expressions that use an EXCLUDE
element
to exclude items, you can omit the filter-values
.In this case, Amazon
Personalize doesn't use that portion of the expression to filter
recommendations.
For more information, see Filtering Recommendations.
$sel:campaignArn:GetRecommendations'
, getRecommendations_campaignArn
- The Amazon Resource Name (ARN) of the campaign to use for getting
recommendations.
Request Lenses
getRecommendations_context :: Lens' GetRecommendations (Maybe (HashMap Text Text)) Source #
The contextual metadata to use when getting recommendations. Contextual metadata includes any interaction information that might be relevant when getting a user's recommendations, such as the user's current location or device type.
getRecommendations_itemId :: Lens' GetRecommendations (Maybe Text) Source #
The item ID to provide recommendations for.
Required for RELATED_ITEMS
recipe type.
getRecommendations_userId :: Lens' GetRecommendations (Maybe Text) Source #
The user ID to provide recommendations for.
Required for USER_PERSONALIZATION
recipe type.
getRecommendations_numResults :: Lens' GetRecommendations (Maybe Natural) Source #
The number of results to return. The default is 25. The maximum is 500.
getRecommendations_filterArn :: Lens' GetRecommendations (Maybe Text) Source #
The ARN of the filter to apply to the returned recommendations. For more information, see Filtering Recommendations.
When using this parameter, be sure the filter resource is ACTIVE
.
getRecommendations_filterValues :: Lens' GetRecommendations (Maybe (HashMap Text Text)) Source #
The values to use when filtering recommendations. For each placeholder parameter in your filter expression, provide the parameter name (in matching case) as a key and the filter value(s) as the corresponding value. Separate multiple values for one parameter with a comma.
For filter expressions that use an INCLUDE
element to include items,
you must provide values for all parameters that are defined in the
expression. For filters with expressions that use an EXCLUDE
element
to exclude items, you can omit the filter-values
.In this case, Amazon
Personalize doesn't use that portion of the expression to filter
recommendations.
For more information, see Filtering Recommendations.
getRecommendations_campaignArn :: Lens' GetRecommendations Text Source #
The Amazon Resource Name (ARN) of the campaign to use for getting recommendations.
Destructuring the Response
data GetRecommendationsResponse Source #
See: newGetRecommendationsResponse
smart constructor.
GetRecommendationsResponse' | |
|
Instances
newGetRecommendationsResponse Source #
Create a value of GetRecommendationsResponse
with all optional fields omitted.
Use generic-lens or optics to modify other optional fields.
The following record fields are available, with the corresponding lenses provided for backwards compatibility:
$sel:recommendationId:GetRecommendationsResponse'
, getRecommendationsResponse_recommendationId
- The ID of the recommendation.
$sel:itemList:GetRecommendationsResponse'
, getRecommendationsResponse_itemList
- A list of recommendations sorted in ascending order by prediction score.
There can be a maximum of 500 items in the list.
$sel:httpStatus:GetRecommendationsResponse'
, getRecommendationsResponse_httpStatus
- The response's http status code.
Response Lenses
getRecommendationsResponse_recommendationId :: Lens' GetRecommendationsResponse (Maybe Text) Source #
The ID of the recommendation.
getRecommendationsResponse_itemList :: Lens' GetRecommendationsResponse (Maybe [PredictedItem]) Source #
A list of recommendations sorted in ascending order by prediction score. There can be a maximum of 500 items in the list.
getRecommendationsResponse_httpStatus :: Lens' GetRecommendationsResponse Int Source #
The response's http status code.