amazonka-personalize-runtime-2.0: Amazon Personalize Runtime SDK.
Copyright(c) 2013-2023 Brendan Hay
LicenseMozilla Public License, v. 2.0.
MaintainerBrendan Hay
Stabilityauto-generated
Portabilitynon-portable (GHC extensions)
Safe HaskellSafe-Inferred
LanguageHaskell2010

Amazonka.PersonalizeRuntime.GetRecommendations

Description

Returns a list of recommended items. For campaigns, the campaign's Amazon Resource Name (ARN) is required and the required user and item input depends on the recipe type used to create the solution backing the campaign as follows:

  • USER_PERSONALIZATION - userId required, itemId not used
  • RELATED_ITEMS - itemId required, userId not used

Campaigns that are backed by a solution created using a recipe of type PERSONALIZED_RANKING use the API.

For recommenders, the recommender's ARN is required and the required item and user input depends on the use case (domain-based recipe) backing the recommender. For information on use case requirements see Choosing recommender use cases.

Synopsis

Creating a Request

data GetRecommendations Source #

See: newGetRecommendations smart constructor.

Constructors

GetRecommendations' 

Fields

  • campaignArn :: Maybe Text

    The Amazon Resource Name (ARN) of the campaign to use for getting recommendations.

  • context :: Maybe (HashMap Text (Sensitive Text))

    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.

  • filterArn :: Maybe Text

    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.

  • filterValues :: Maybe (HashMap Text (Sensitive Text))

    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 and user segments.

  • itemId :: Maybe Text

    The item ID to provide recommendations for.

    Required for RELATED_ITEMS recipe type.

  • numResults :: Maybe Natural

    The number of results to return. The default is 25. The maximum is 500.

  • promotions :: Maybe [Promotion]

    The promotions to apply to the recommendation request. A promotion defines additional business rules that apply to a configurable subset of recommended items.

  • recommenderArn :: Maybe Text

    The Amazon Resource Name (ARN) of the recommender to use to get recommendations. Provide a recommender ARN if you created a Domain dataset group with a recommender for a domain use case.

  • userId :: Maybe Text

    The user ID to provide recommendations for.

    Required for USER_PERSONALIZATION recipe type.

Instances

Instances details
ToJSON GetRecommendations Source # 
Instance details

Defined in Amazonka.PersonalizeRuntime.GetRecommendations

ToHeaders GetRecommendations Source # 
Instance details

Defined in Amazonka.PersonalizeRuntime.GetRecommendations

ToPath GetRecommendations Source # 
Instance details

Defined in Amazonka.PersonalizeRuntime.GetRecommendations

ToQuery GetRecommendations Source # 
Instance details

Defined in Amazonka.PersonalizeRuntime.GetRecommendations

AWSRequest GetRecommendations Source # 
Instance details

Defined in Amazonka.PersonalizeRuntime.GetRecommendations

Associated Types

type AWSResponse GetRecommendations #

Generic GetRecommendations Source # 
Instance details

Defined in Amazonka.PersonalizeRuntime.GetRecommendations

Associated Types

type Rep GetRecommendations :: Type -> Type #

Show GetRecommendations Source # 
Instance details

Defined in Amazonka.PersonalizeRuntime.GetRecommendations

NFData GetRecommendations Source # 
Instance details

Defined in Amazonka.PersonalizeRuntime.GetRecommendations

Methods

rnf :: GetRecommendations -> () #

Eq GetRecommendations Source # 
Instance details

Defined in Amazonka.PersonalizeRuntime.GetRecommendations

Hashable GetRecommendations Source # 
Instance details

Defined in Amazonka.PersonalizeRuntime.GetRecommendations

type AWSResponse GetRecommendations Source # 
Instance details

Defined in Amazonka.PersonalizeRuntime.GetRecommendations

type Rep GetRecommendations Source # 
Instance details

Defined in Amazonka.PersonalizeRuntime.GetRecommendations

newGetRecommendations :: GetRecommendations 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:campaignArn:GetRecommendations', getRecommendations_campaignArn - The Amazon Resource Name (ARN) of the campaign to use for getting recommendations.

$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.

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.

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 and user segments.

GetRecommendations, getRecommendations_itemId - The item ID to provide recommendations for.

Required for RELATED_ITEMS recipe type.

$sel:numResults:GetRecommendations', getRecommendations_numResults - The number of results to return. The default is 25. The maximum is 500.

$sel:promotions:GetRecommendations', getRecommendations_promotions - The promotions to apply to the recommendation request. A promotion defines additional business rules that apply to a configurable subset of recommended items.

$sel:recommenderArn:GetRecommendations', getRecommendations_recommenderArn - The Amazon Resource Name (ARN) of the recommender to use to get recommendations. Provide a recommender ARN if you created a Domain dataset group with a recommender for a domain use case.

$sel:userId:GetRecommendations', getRecommendations_userId - The user ID to provide recommendations for.

Required for USER_PERSONALIZATION recipe type.

Request Lenses

getRecommendations_campaignArn :: Lens' GetRecommendations (Maybe Text) Source #

The Amazon Resource Name (ARN) of the campaign to use for getting recommendations.

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_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 and user segments.

getRecommendations_itemId :: Lens' GetRecommendations (Maybe Text) Source #

The item ID to provide recommendations for.

Required for RELATED_ITEMS recipe type.

getRecommendations_numResults :: Lens' GetRecommendations (Maybe Natural) Source #

The number of results to return. The default is 25. The maximum is 500.

getRecommendations_promotions :: Lens' GetRecommendations (Maybe [Promotion]) Source #

The promotions to apply to the recommendation request. A promotion defines additional business rules that apply to a configurable subset of recommended items.

getRecommendations_recommenderArn :: Lens' GetRecommendations (Maybe Text) Source #

The Amazon Resource Name (ARN) of the recommender to use to get recommendations. Provide a recommender ARN if you created a Domain dataset group with a recommender for a domain use case.

getRecommendations_userId :: Lens' GetRecommendations (Maybe Text) Source #

The user ID to provide recommendations for.

Required for USER_PERSONALIZATION recipe type.

Destructuring the Response

data GetRecommendationsResponse Source #

See: newGetRecommendationsResponse smart constructor.

Constructors

GetRecommendationsResponse' 

Fields

Instances

Instances details
Generic GetRecommendationsResponse Source # 
Instance details

Defined in Amazonka.PersonalizeRuntime.GetRecommendations

Associated Types

type Rep GetRecommendationsResponse :: Type -> Type #

Read GetRecommendationsResponse Source # 
Instance details

Defined in Amazonka.PersonalizeRuntime.GetRecommendations

Show GetRecommendationsResponse Source # 
Instance details

Defined in Amazonka.PersonalizeRuntime.GetRecommendations

NFData GetRecommendationsResponse Source # 
Instance details

Defined in Amazonka.PersonalizeRuntime.GetRecommendations

Eq GetRecommendationsResponse Source # 
Instance details

Defined in Amazonka.PersonalizeRuntime.GetRecommendations

type Rep GetRecommendationsResponse Source # 
Instance details

Defined in Amazonka.PersonalizeRuntime.GetRecommendations

type Rep GetRecommendationsResponse = D1 ('MetaData "GetRecommendationsResponse" "Amazonka.PersonalizeRuntime.GetRecommendations" "amazonka-personalize-runtime-2.0-F3C1CsdiQVG5CxrVfC5dKS" 'False) (C1 ('MetaCons "GetRecommendationsResponse'" 'PrefixI 'True) (S1 ('MetaSel ('Just "itemList") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe [PredictedItem])) :*: (S1 ('MetaSel ('Just "recommendationId") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Text)) :*: S1 ('MetaSel ('Just "httpStatus") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Int))))

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:itemList:GetRecommendationsResponse', getRecommendationsResponse_itemList - A list of recommendations sorted in descending order by prediction score. There can be a maximum of 500 items in the list.

$sel:recommendationId:GetRecommendationsResponse', getRecommendationsResponse_recommendationId - The ID of the recommendation.

$sel:httpStatus:GetRecommendationsResponse', getRecommendationsResponse_httpStatus - The response's http status code.

Response Lenses

getRecommendationsResponse_itemList :: Lens' GetRecommendationsResponse (Maybe [PredictedItem]) Source #

A list of recommendations sorted in descending order by prediction score. There can be a maximum of 500 items in the list.