Documentation ¶
Overview ¶
Package personalizeevents provides the client and types for making API requests to Amazon Personalize Events.
See https://docs.aws.amazon.com/goto/WebAPI/personalize-events-2018-03-22 for more information on this service.
See personalizeevents package documentation for more information. https://docs.aws.amazon.com/sdk-for-go/api/service/personalizeevents/
Using the Client ¶
To contact Amazon Personalize Events 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 Events client PersonalizeEvents for more information on creating client for this service. https://docs.aws.amazon.com/sdk-for-go/api/service/personalizeevents/#New
Index ¶
- Constants
- type Event
- type PersonalizeEvents
- func (c *PersonalizeEvents) PutEvents(input *PutEventsInput) (*PutEventsOutput, error)
- func (c *PersonalizeEvents) PutEventsRequest(input *PutEventsInput) (req *request.Request, output *PutEventsOutput)
- func (c *PersonalizeEvents) PutEventsWithContext(ctx aws.Context, input *PutEventsInput, opts ...request.Option) (*PutEventsOutput, error)
- type PutEventsInput
- func (s PutEventsInput) GoString() string
- func (s *PutEventsInput) SetEventList(v []*Event) *PutEventsInput
- func (s *PutEventsInput) SetSessionId(v string) *PutEventsInput
- func (s *PutEventsInput) SetTrackingId(v string) *PutEventsInput
- func (s *PutEventsInput) SetUserId(v string) *PutEventsInput
- func (s PutEventsInput) String() string
- func (s *PutEventsInput) Validate() error
- type PutEventsOutput
Constants ¶
const ( ServiceName = "Personalize Events" // Name of service. EndpointsID = "personalize-events" // ID to lookup a service endpoint with. ServiceID = "Personalize Events" // ServiceID is a unique identifer of a specific service. )
Service information constants
const ( // ErrCodeInvalidInputException for service response error code // "InvalidInputException". // // Provide a valid value for the field or parameter. ErrCodeInvalidInputException = "InvalidInputException" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Event ¶
type Event struct { // An ID associated with the event. If an event ID is not provided, Amazon Personalize // generates a unique ID for the event. An event ID is not used as an input // to the model. Amazon Personalize uses the event ID to distinquish unique // events. Any subsequent events after the first with the same event ID are // not used in model training. EventId *string `locationName:"eventId" min:"1" type:"string"` // The type of event. This property corresponds to the EVENT_TYPE field of the // Interactions schema. // // EventType is a required field EventType *string `locationName:"eventType" min:"1" type:"string" required:"true"` // A string map of event-specific data that you might choose to record. For // example, if a user rates a movie on your site, you might send the movie ID // and rating, and the number of movie ratings made by the user. // // Each item in the map consists of a key-value pair. For example, // // {"itemId": "movie1"} // // {"itemId": "movie2", "eventValue": "4.5"} // // {"itemId": "movie3", "eventValue": "3", "numberOfRatings": "12"} // // The keys use camel case names that match the fields in the Interactions schema. // The itemId and eventValue keys correspond to the ITEM_ID and EVENT_VALUE // fields. In the above example, the eventType might be 'MovieRating' with eventValue // being the rating. The numberOfRatings would match the 'NUMBER_OF_RATINGS' // field defined in the Interactions schema. // // Properties is a required field Properties aws.JSONValue `locationName:"properties" type:"jsonvalue" required:"true"` // The timestamp on the client side when the event occurred. // // SentAt is a required field SentAt *time.Time `locationName:"sentAt" type:"timestamp" required:"true"` // contains filtered or unexported fields }
Represents user interaction event information sent using the PutEvents API.
func (*Event) SetEventId ¶
SetEventId sets the EventId field's value.
func (*Event) SetEventType ¶
SetEventType sets the EventType field's value.
func (*Event) SetProperties ¶
SetProperties sets the Properties field's value.
type PersonalizeEvents ¶
PersonalizeEvents provides the API operation methods for making requests to Amazon Personalize Events. See this package's package overview docs for details on the service.
PersonalizeEvents methods are safe to use concurrently. It is not safe to modify mutate any of the struct's properties though.
func New ¶
func New(p client.ConfigProvider, cfgs ...*aws.Config) *PersonalizeEvents
New creates a new instance of the PersonalizeEvents client with a session. If additional configuration is needed for the client instance use the optional aws.Config parameter to add your extra config.
Example:
// Create a PersonalizeEvents client from just a session. svc := personalizeevents.New(mySession) // Create a PersonalizeEvents client with additional configuration svc := personalizeevents.New(mySession, aws.NewConfig().WithRegion("us-west-2"))
func (*PersonalizeEvents) PutEvents ¶
func (c *PersonalizeEvents) PutEvents(input *PutEventsInput) (*PutEventsOutput, error)
PutEvents API operation for Amazon Personalize Events.
Records user interaction event data.
Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.
See the AWS API reference guide for Amazon Personalize Events's API operation PutEvents for usage and error information.
Returned Error Codes:
- ErrCodeInvalidInputException "InvalidInputException" Provide a valid value for the field or parameter.
See also, https://docs.aws.amazon.com/goto/WebAPI/personalize-events-2018-03-22/PutEvents
func (*PersonalizeEvents) PutEventsRequest ¶
func (c *PersonalizeEvents) PutEventsRequest(input *PutEventsInput) (req *request.Request, output *PutEventsOutput)
PutEventsRequest generates a "aws/request.Request" representing the client's request for the PutEvents operation. The "output" return value will be populated with the request's response once the request completes successfully.
Use "Send" method on the returned Request to send the API call to the service. the "output" return value is not valid until after Send returns without error.
See PutEvents for more information on using the PutEvents API call, and error handling.
This method is useful when you want to inject custom logic or configuration into the SDK's request lifecycle. Such as custom headers, or retry logic.
// Example sending a request using the PutEventsRequest method. req, resp := client.PutEventsRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }
See also, https://docs.aws.amazon.com/goto/WebAPI/personalize-events-2018-03-22/PutEvents
func (*PersonalizeEvents) PutEventsWithContext ¶
func (c *PersonalizeEvents) PutEventsWithContext(ctx aws.Context, input *PutEventsInput, opts ...request.Option) (*PutEventsOutput, error)
PutEventsWithContext is the same as PutEvents with the addition of the ability to pass a context and additional request options.
See PutEvents for details on how to use this API operation.
The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.
type PutEventsInput ¶
type PutEventsInput struct { // A list of event data from the session. // // EventList is a required field EventList []*Event `locationName:"eventList" min:"1" type:"list" required:"true"` // The session ID associated with the user's visit. // // SessionId is a required field SessionId *string `locationName:"sessionId" min:"1" type:"string" required:"true"` // The tracking ID for the event. The ID is generated by a call to the CreateEventTracker // (https://docs.aws.amazon.com/personalize/latest/dg/API_CreateEventTracker.html) // API. // // TrackingId is a required field TrackingId *string `locationName:"trackingId" min:"1" type:"string" required:"true"` // The user associated with the event. UserId *string `locationName:"userId" min:"1" type:"string"` // contains filtered or unexported fields }
func (PutEventsInput) GoString ¶
func (s PutEventsInput) GoString() string
GoString returns the string representation
func (*PutEventsInput) SetEventList ¶
func (s *PutEventsInput) SetEventList(v []*Event) *PutEventsInput
SetEventList sets the EventList field's value.
func (*PutEventsInput) SetSessionId ¶
func (s *PutEventsInput) SetSessionId(v string) *PutEventsInput
SetSessionId sets the SessionId field's value.
func (*PutEventsInput) SetTrackingId ¶
func (s *PutEventsInput) SetTrackingId(v string) *PutEventsInput
SetTrackingId sets the TrackingId field's value.
func (*PutEventsInput) SetUserId ¶
func (s *PutEventsInput) SetUserId(v string) *PutEventsInput
SetUserId sets the UserId field's value.
func (PutEventsInput) String ¶
func (s PutEventsInput) String() string
String returns the string representation
func (*PutEventsInput) Validate ¶
func (s *PutEventsInput) Validate() error
Validate inspects the fields of the type to determine if they are valid.
type PutEventsOutput ¶
type PutEventsOutput struct {
// contains filtered or unexported fields
}
func (PutEventsOutput) GoString ¶
func (s PutEventsOutput) GoString() string
GoString returns the string representation
func (PutEventsOutput) String ¶
func (s PutEventsOutput) String() string
String returns the string representation
Directories ¶
Path | Synopsis |
---|---|
Package personalizeeventsiface provides an interface to enable mocking the Amazon Personalize Events service client for testing your code.
|
Package personalizeeventsiface provides an interface to enable mocking the Amazon Personalize Events service client for testing your code. |