Documentation ¶
Overview ¶
Package personalizeruntime provides the client and types for making API requests to Amazon Personalize Runtime.
See https://docs.aws.amazon.com/goto/WebAPI/personalize-runtime-2018-05-22 for more information on this service.
See personalizeruntime package documentation for more information. https://docs.aws.amazon.com/sdk-for-go/api/service/personalizeruntime/
Using the Client ¶
To use Amazon Personalize Runtime with the SDK use the New function to create a new service client. With that client you can make API requests to the service. These clients are safe to use concurrently.
See the SDK's documentation for more information on how to use the SDK. https://docs.aws.amazon.com/sdk-for-go/api/
See aws.Config documentation for more information on configuring SDK clients. https://docs.aws.amazon.com/sdk-for-go/api/aws/#Config
See the Amazon Personalize Runtime client for more information on creating client for this service. https://docs.aws.amazon.com/sdk-for-go/api/service/personalizeruntime/#New
Index ¶
- Constants
- type Client
- type GetPersonalizedRankingInput
- type GetPersonalizedRankingOutput
- type GetPersonalizedRankingRequest
- type GetPersonalizedRankingResponse
- type GetRecommendationsInput
- type GetRecommendationsOutput
- type GetRecommendationsRequest
- type GetRecommendationsResponse
- type PredictedItem
Constants ¶
const ( ServiceName = "Amazon Personalize Runtime" // Service's name ServiceID = "PersonalizeRuntime" // Service's identifier EndpointsID = "personalize-runtime" // Service's Endpoint identifier )
const ( // ErrCodeInvalidInputException for service response error code // "InvalidInputException". // // Provide a valid value for the field or parameter. ErrCodeInvalidInputException = "InvalidInputException" // ErrCodeResourceNotFoundException for service response error code // "ResourceNotFoundException". // // The specified resource does not exist. ErrCodeResourceNotFoundException = "ResourceNotFoundException" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
Client provides the API operation methods for making requests to Amazon Personalize Runtime. See this package's package overview docs for details on the service.
The client's methods are safe to use concurrently. It is not safe to modify mutate any of the struct's properties though.
func New ¶
New creates a new instance of the client from the provided Config.
Example:
// Create a client from just a config. svc := personalizeruntime.New(myConfig)
func (*Client) GetPersonalizedRankingRequest ¶
func (c *Client) GetPersonalizedRankingRequest(input *GetPersonalizedRankingInput) GetPersonalizedRankingRequest
GetPersonalizedRankingRequest returns a request value for making API operation for Amazon Personalize Runtime.
Re-ranks a list of recommended items for the given user. The first item in the list is deemed the most likely item to be of interest to the user.
The solution backing the campaign must have been created using a recipe of type PERSONALIZED_RANKING.
// Example sending a request using GetPersonalizedRankingRequest. req := client.GetPersonalizedRankingRequest(params) resp, err := req.Send(context.TODO()) if err == nil { fmt.Println(resp) }
Please also see https://docs.aws.amazon.com/goto/WebAPI/personalize-runtime-2018-05-22/GetPersonalizedRanking
func (*Client) GetRecommendationsRequest ¶
func (c *Client) GetRecommendationsRequest(input *GetRecommendationsInput) GetRecommendationsRequest
GetRecommendationsRequest returns a request value for making API operation for Amazon Personalize Runtime.
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.
// Example sending a request using GetRecommendationsRequest. req := client.GetRecommendationsRequest(params) resp, err := req.Send(context.TODO()) if err == nil { fmt.Println(resp) }
Please also see https://docs.aws.amazon.com/goto/WebAPI/personalize-runtime-2018-05-22/GetRecommendations
type GetPersonalizedRankingInput ¶
type GetPersonalizedRankingInput struct { // The Amazon Resource Name (ARN) of the campaign to use for generating the // personalized ranking. // // CampaignArn is a required field CampaignArn *string `locationName:"campaignArn" type:"string" required:"true"` // 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. // For more information, see Contextual Metadata. Context map[string]string `locationName:"context" type:"map"` // A list of items (itemId's) to rank. If an item was not included in the training // dataset, the item is appended to the end of the reranked list. The maximum // is 500. // // InputList is a required field InputList []string `locationName:"inputList" type:"list" required:"true"` // The user for which you want the campaign to provide a personalized ranking. // // UserId is a required field UserId *string `locationName:"userId" type:"string" required:"true"` // contains filtered or unexported fields }
func (GetPersonalizedRankingInput) MarshalFields ¶
func (s GetPersonalizedRankingInput) MarshalFields(e protocol.FieldEncoder) error
MarshalFields encodes the AWS API shape using the passed in protocol encoder.
func (GetPersonalizedRankingInput) String ¶
func (s GetPersonalizedRankingInput) String() string
String returns the string representation
func (*GetPersonalizedRankingInput) Validate ¶
func (s *GetPersonalizedRankingInput) Validate() error
Validate inspects the fields of the type to determine if they are valid.
type GetPersonalizedRankingOutput ¶
type GetPersonalizedRankingOutput struct { // A list of items in order of most likely interest to the user. The maximum // is 500. PersonalizedRanking []PredictedItem `locationName:"personalizedRanking" type:"list"` // contains filtered or unexported fields }
func (GetPersonalizedRankingOutput) MarshalFields ¶
func (s GetPersonalizedRankingOutput) MarshalFields(e protocol.FieldEncoder) error
MarshalFields encodes the AWS API shape using the passed in protocol encoder.
func (GetPersonalizedRankingOutput) String ¶
func (s GetPersonalizedRankingOutput) String() string
String returns the string representation
type GetPersonalizedRankingRequest ¶
type GetPersonalizedRankingRequest struct { *aws.Request Input *GetPersonalizedRankingInput Copy func(*GetPersonalizedRankingInput) GetPersonalizedRankingRequest }
GetPersonalizedRankingRequest is the request type for the GetPersonalizedRanking API operation.
func (GetPersonalizedRankingRequest) Send ¶
func (r GetPersonalizedRankingRequest) Send(ctx context.Context) (*GetPersonalizedRankingResponse, error)
Send marshals and sends the GetPersonalizedRanking API request.
type GetPersonalizedRankingResponse ¶
type GetPersonalizedRankingResponse struct { *GetPersonalizedRankingOutput // contains filtered or unexported fields }
GetPersonalizedRankingResponse is the response type for the GetPersonalizedRanking API operation.
func (*GetPersonalizedRankingResponse) SDKResponseMetdata ¶
func (r *GetPersonalizedRankingResponse) SDKResponseMetdata() *aws.Response
SDKResponseMetdata returns the response metadata for the GetPersonalizedRanking request.
type GetRecommendationsInput ¶
type GetRecommendationsInput struct { // The Amazon Resource Name (ARN) of the campaign to use for getting recommendations. // // CampaignArn is a required field CampaignArn *string `locationName:"campaignArn" type:"string" required:"true"` // 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. // For more information, see Contextual Metadata. Context map[string]string `locationName:"context" type:"map"` // The item ID to provide recommendations for. // // Required for RELATED_ITEMS recipe type. ItemId *string `locationName:"itemId" type:"string"` // The number of results to return. The default is 25. The maximum is 500. NumResults *int64 `locationName:"numResults" type:"integer"` // The user ID to provide recommendations for. // // Required for USER_PERSONALIZATION recipe type. UserId *string `locationName:"userId" type:"string"` // contains filtered or unexported fields }
func (GetRecommendationsInput) MarshalFields ¶
func (s GetRecommendationsInput) MarshalFields(e protocol.FieldEncoder) error
MarshalFields encodes the AWS API shape using the passed in protocol encoder.
func (GetRecommendationsInput) String ¶
func (s GetRecommendationsInput) String() string
String returns the string representation
func (*GetRecommendationsInput) Validate ¶
func (s *GetRecommendationsInput) Validate() error
Validate inspects the fields of the type to determine if they are valid.
type GetRecommendationsOutput ¶
type GetRecommendationsOutput struct { // A list of recommendations sorted in ascending order by prediction score. // There can be a maximum of 500 items in the list. ItemList []PredictedItem `locationName:"itemList" type:"list"` // contains filtered or unexported fields }
func (GetRecommendationsOutput) MarshalFields ¶
func (s GetRecommendationsOutput) MarshalFields(e protocol.FieldEncoder) error
MarshalFields encodes the AWS API shape using the passed in protocol encoder.
func (GetRecommendationsOutput) String ¶
func (s GetRecommendationsOutput) String() string
String returns the string representation
type GetRecommendationsRequest ¶
type GetRecommendationsRequest struct { *aws.Request Input *GetRecommendationsInput Copy func(*GetRecommendationsInput) GetRecommendationsRequest }
GetRecommendationsRequest is the request type for the GetRecommendations API operation.
func (GetRecommendationsRequest) Send ¶
func (r GetRecommendationsRequest) Send(ctx context.Context) (*GetRecommendationsResponse, error)
Send marshals and sends the GetRecommendations API request.
type GetRecommendationsResponse ¶
type GetRecommendationsResponse struct { *GetRecommendationsOutput // contains filtered or unexported fields }
GetRecommendationsResponse is the response type for the GetRecommendations API operation.
func (*GetRecommendationsResponse) SDKResponseMetdata ¶
func (r *GetRecommendationsResponse) SDKResponseMetdata() *aws.Response
SDKResponseMetdata returns the response metadata for the GetRecommendations request.
type PredictedItem ¶
type PredictedItem struct { // The recommended item ID. ItemId *string `locationName:"itemId" type:"string"` // contains filtered or unexported fields }
An object that identifies an item.
The and APIs return a list of PredictedItems.
func (PredictedItem) MarshalFields ¶
func (s PredictedItem) MarshalFields(e protocol.FieldEncoder) error
MarshalFields encodes the AWS API shape using the passed in protocol encoder.
func (PredictedItem) String ¶
func (s PredictedItem) String() string
String returns the string representation
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
Package personalizeruntimeiface provides an interface to enable mocking the Amazon Personalize Runtime service client for testing your code.
|
Package personalizeruntimeiface provides an interface to enable mocking the Amazon Personalize Runtime service client for testing your code. |