github.com/aavshr/aws-sdk-go@v1.41.3/service/personalizeevents/api.go (about) 1 // Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. 2 3 package personalizeevents 4 5 import ( 6 "fmt" 7 "time" 8 9 "github.com/aavshr/aws-sdk-go/aws" 10 "github.com/aavshr/aws-sdk-go/aws/awsutil" 11 "github.com/aavshr/aws-sdk-go/aws/request" 12 "github.com/aavshr/aws-sdk-go/private/protocol" 13 "github.com/aavshr/aws-sdk-go/private/protocol/restjson" 14 ) 15 16 const opPutEvents = "PutEvents" 17 18 // PutEventsRequest generates a "aws/request.Request" representing the 19 // client's request for the PutEvents operation. The "output" return 20 // value will be populated with the request's response once the request completes 21 // successfully. 22 // 23 // Use "Send" method on the returned Request to send the API call to the service. 24 // the "output" return value is not valid until after Send returns without error. 25 // 26 // See PutEvents for more information on using the PutEvents 27 // API call, and error handling. 28 // 29 // This method is useful when you want to inject custom logic or configuration 30 // into the SDK's request lifecycle. Such as custom headers, or retry logic. 31 // 32 // 33 // // Example sending a request using the PutEventsRequest method. 34 // req, resp := client.PutEventsRequest(params) 35 // 36 // err := req.Send() 37 // if err == nil { // resp is now filled 38 // fmt.Println(resp) 39 // } 40 // 41 // See also, https://docs.aws.amazon.com/goto/WebAPI/personalize-events-2018-03-22/PutEvents 42 func (c *PersonalizeEvents) PutEventsRequest(input *PutEventsInput) (req *request.Request, output *PutEventsOutput) { 43 op := &request.Operation{ 44 Name: opPutEvents, 45 HTTPMethod: "POST", 46 HTTPPath: "/events", 47 } 48 49 if input == nil { 50 input = &PutEventsInput{} 51 } 52 53 output = &PutEventsOutput{} 54 req = c.newRequest(op, input, output) 55 req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) 56 return 57 } 58 59 // PutEvents API operation for Amazon Personalize Events. 60 // 61 // Records user interaction event data. For more information see Recording Events 62 // (https://docs.aws.amazon.com/personalize/latest/dg/recording-events.html). 63 // 64 // Returns awserr.Error for service API and SDK errors. Use runtime type assertions 65 // with awserr.Error's Code and Message methods to get detailed information about 66 // the error. 67 // 68 // See the AWS API reference guide for Amazon Personalize Events's 69 // API operation PutEvents for usage and error information. 70 // 71 // Returned Error Types: 72 // * InvalidInputException 73 // Provide a valid value for the field or parameter. 74 // 75 // See also, https://docs.aws.amazon.com/goto/WebAPI/personalize-events-2018-03-22/PutEvents 76 func (c *PersonalizeEvents) PutEvents(input *PutEventsInput) (*PutEventsOutput, error) { 77 req, out := c.PutEventsRequest(input) 78 return out, req.Send() 79 } 80 81 // PutEventsWithContext is the same as PutEvents with the addition of 82 // the ability to pass a context and additional request options. 83 // 84 // See PutEvents for details on how to use this API operation. 85 // 86 // The context must be non-nil and will be used for request cancellation. If 87 // the context is nil a panic will occur. In the future the SDK may create 88 // sub-contexts for http.Requests. See https://golang.org/pkg/context/ 89 // for more information on using Contexts. 90 func (c *PersonalizeEvents) PutEventsWithContext(ctx aws.Context, input *PutEventsInput, opts ...request.Option) (*PutEventsOutput, error) { 91 req, out := c.PutEventsRequest(input) 92 req.SetContext(ctx) 93 req.ApplyOptions(opts...) 94 return out, req.Send() 95 } 96 97 const opPutItems = "PutItems" 98 99 // PutItemsRequest generates a "aws/request.Request" representing the 100 // client's request for the PutItems operation. The "output" return 101 // value will be populated with the request's response once the request completes 102 // successfully. 103 // 104 // Use "Send" method on the returned Request to send the API call to the service. 105 // the "output" return value is not valid until after Send returns without error. 106 // 107 // See PutItems for more information on using the PutItems 108 // API call, and error handling. 109 // 110 // This method is useful when you want to inject custom logic or configuration 111 // into the SDK's request lifecycle. Such as custom headers, or retry logic. 112 // 113 // 114 // // Example sending a request using the PutItemsRequest method. 115 // req, resp := client.PutItemsRequest(params) 116 // 117 // err := req.Send() 118 // if err == nil { // resp is now filled 119 // fmt.Println(resp) 120 // } 121 // 122 // See also, https://docs.aws.amazon.com/goto/WebAPI/personalize-events-2018-03-22/PutItems 123 func (c *PersonalizeEvents) PutItemsRequest(input *PutItemsInput) (req *request.Request, output *PutItemsOutput) { 124 op := &request.Operation{ 125 Name: opPutItems, 126 HTTPMethod: "POST", 127 HTTPPath: "/items", 128 } 129 130 if input == nil { 131 input = &PutItemsInput{} 132 } 133 134 output = &PutItemsOutput{} 135 req = c.newRequest(op, input, output) 136 req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) 137 return 138 } 139 140 // PutItems API operation for Amazon Personalize Events. 141 // 142 // Adds one or more items to an Items dataset. For more information see Importing 143 // Items Incrementally (https://docs.aws.amazon.com/personalize/latest/dg/importing-items.html). 144 // 145 // Returns awserr.Error for service API and SDK errors. Use runtime type assertions 146 // with awserr.Error's Code and Message methods to get detailed information about 147 // the error. 148 // 149 // See the AWS API reference guide for Amazon Personalize Events's 150 // API operation PutItems for usage and error information. 151 // 152 // Returned Error Types: 153 // * InvalidInputException 154 // Provide a valid value for the field or parameter. 155 // 156 // * ResourceNotFoundException 157 // Could not find the specified resource. 158 // 159 // * ResourceInUseException 160 // The specified resource is in use. 161 // 162 // See also, https://docs.aws.amazon.com/goto/WebAPI/personalize-events-2018-03-22/PutItems 163 func (c *PersonalizeEvents) PutItems(input *PutItemsInput) (*PutItemsOutput, error) { 164 req, out := c.PutItemsRequest(input) 165 return out, req.Send() 166 } 167 168 // PutItemsWithContext is the same as PutItems with the addition of 169 // the ability to pass a context and additional request options. 170 // 171 // See PutItems for details on how to use this API operation. 172 // 173 // The context must be non-nil and will be used for request cancellation. If 174 // the context is nil a panic will occur. In the future the SDK may create 175 // sub-contexts for http.Requests. See https://golang.org/pkg/context/ 176 // for more information on using Contexts. 177 func (c *PersonalizeEvents) PutItemsWithContext(ctx aws.Context, input *PutItemsInput, opts ...request.Option) (*PutItemsOutput, error) { 178 req, out := c.PutItemsRequest(input) 179 req.SetContext(ctx) 180 req.ApplyOptions(opts...) 181 return out, req.Send() 182 } 183 184 const opPutUsers = "PutUsers" 185 186 // PutUsersRequest generates a "aws/request.Request" representing the 187 // client's request for the PutUsers operation. The "output" return 188 // value will be populated with the request's response once the request completes 189 // successfully. 190 // 191 // Use "Send" method on the returned Request to send the API call to the service. 192 // the "output" return value is not valid until after Send returns without error. 193 // 194 // See PutUsers for more information on using the PutUsers 195 // API call, and error handling. 196 // 197 // This method is useful when you want to inject custom logic or configuration 198 // into the SDK's request lifecycle. Such as custom headers, or retry logic. 199 // 200 // 201 // // Example sending a request using the PutUsersRequest method. 202 // req, resp := client.PutUsersRequest(params) 203 // 204 // err := req.Send() 205 // if err == nil { // resp is now filled 206 // fmt.Println(resp) 207 // } 208 // 209 // See also, https://docs.aws.amazon.com/goto/WebAPI/personalize-events-2018-03-22/PutUsers 210 func (c *PersonalizeEvents) PutUsersRequest(input *PutUsersInput) (req *request.Request, output *PutUsersOutput) { 211 op := &request.Operation{ 212 Name: opPutUsers, 213 HTTPMethod: "POST", 214 HTTPPath: "/users", 215 } 216 217 if input == nil { 218 input = &PutUsersInput{} 219 } 220 221 output = &PutUsersOutput{} 222 req = c.newRequest(op, input, output) 223 req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) 224 return 225 } 226 227 // PutUsers API operation for Amazon Personalize Events. 228 // 229 // Adds one or more users to a Users dataset. For more information see Importing 230 // Users Incrementally (https://docs.aws.amazon.com/personalize/latest/dg/importing-users.html). 231 // 232 // Returns awserr.Error for service API and SDK errors. Use runtime type assertions 233 // with awserr.Error's Code and Message methods to get detailed information about 234 // the error. 235 // 236 // See the AWS API reference guide for Amazon Personalize Events's 237 // API operation PutUsers for usage and error information. 238 // 239 // Returned Error Types: 240 // * InvalidInputException 241 // Provide a valid value for the field or parameter. 242 // 243 // * ResourceNotFoundException 244 // Could not find the specified resource. 245 // 246 // * ResourceInUseException 247 // The specified resource is in use. 248 // 249 // See also, https://docs.aws.amazon.com/goto/WebAPI/personalize-events-2018-03-22/PutUsers 250 func (c *PersonalizeEvents) PutUsers(input *PutUsersInput) (*PutUsersOutput, error) { 251 req, out := c.PutUsersRequest(input) 252 return out, req.Send() 253 } 254 255 // PutUsersWithContext is the same as PutUsers with the addition of 256 // the ability to pass a context and additional request options. 257 // 258 // See PutUsers for details on how to use this API operation. 259 // 260 // The context must be non-nil and will be used for request cancellation. If 261 // the context is nil a panic will occur. In the future the SDK may create 262 // sub-contexts for http.Requests. See https://golang.org/pkg/context/ 263 // for more information on using Contexts. 264 func (c *PersonalizeEvents) PutUsersWithContext(ctx aws.Context, input *PutUsersInput, opts ...request.Option) (*PutUsersOutput, error) { 265 req, out := c.PutUsersRequest(input) 266 req.SetContext(ctx) 267 req.ApplyOptions(opts...) 268 return out, req.Send() 269 } 270 271 // Represents user interaction event information sent using the PutEvents API. 272 type Event struct { 273 _ struct{} `type:"structure"` 274 275 // An ID associated with the event. If an event ID is not provided, Amazon Personalize 276 // generates a unique ID for the event. An event ID is not used as an input 277 // to the model. Amazon Personalize uses the event ID to distinquish unique 278 // events. Any subsequent events after the first with the same event ID are 279 // not used in model training. 280 EventId *string `locationName:"eventId" min:"1" type:"string"` 281 282 // The type of event, such as click or download. This property corresponds to 283 // the EVENT_TYPE field of your Interactions schema and depends on the types 284 // of events you are tracking. 285 // 286 // EventType is a required field 287 EventType *string `locationName:"eventType" min:"1" type:"string" required:"true"` 288 289 // The event value that corresponds to the EVENT_VALUE field of the Interactions 290 // schema. 291 EventValue *float64 `locationName:"eventValue" type:"float"` 292 293 // A list of item IDs that represents the sequence of items you have shown the 294 // user. For example, ["itemId1", "itemId2", "itemId3"]. 295 Impression []*string `locationName:"impression" min:"1" type:"list"` 296 297 // The item ID key that corresponds to the ITEM_ID field of the Interactions 298 // schema. 299 ItemId *string `locationName:"itemId" min:"1" type:"string"` 300 301 // A string map of event-specific data that you might choose to record. For 302 // example, if a user rates a movie on your site, other than movie ID (itemId) 303 // and rating (eventValue) , you might also send the number of movie ratings 304 // made by the user. 305 // 306 // Each item in the map consists of a key-value pair. For example, 307 // 308 // {"numberOfRatings": "12"} 309 // 310 // The keys use camel case names that match the fields in the Interactions schema. 311 // In the above example, the numberOfRatings would match the 'NUMBER_OF_RATINGS' 312 // field defined in the Interactions schema. 313 Properties aws.JSONValue `locationName:"properties" type:"jsonvalue"` 314 315 // The ID of the recommendation. 316 RecommendationId *string `locationName:"recommendationId" min:"1" type:"string"` 317 318 // The timestamp (in Unix time) on the client side when the event occurred. 319 // 320 // SentAt is a required field 321 SentAt *time.Time `locationName:"sentAt" type:"timestamp" required:"true"` 322 } 323 324 // String returns the string representation. 325 // 326 // API parameter values that are decorated as "sensitive" in the API will not 327 // be included in the string output. The member name will be present, but the 328 // value will be replaced with "sensitive". 329 func (s Event) String() string { 330 return awsutil.Prettify(s) 331 } 332 333 // GoString returns the string representation. 334 // 335 // API parameter values that are decorated as "sensitive" in the API will not 336 // be included in the string output. The member name will be present, but the 337 // value will be replaced with "sensitive". 338 func (s Event) GoString() string { 339 return s.String() 340 } 341 342 // Validate inspects the fields of the type to determine if they are valid. 343 func (s *Event) Validate() error { 344 invalidParams := request.ErrInvalidParams{Context: "Event"} 345 if s.EventId != nil && len(*s.EventId) < 1 { 346 invalidParams.Add(request.NewErrParamMinLen("EventId", 1)) 347 } 348 if s.EventType == nil { 349 invalidParams.Add(request.NewErrParamRequired("EventType")) 350 } 351 if s.EventType != nil && len(*s.EventType) < 1 { 352 invalidParams.Add(request.NewErrParamMinLen("EventType", 1)) 353 } 354 if s.Impression != nil && len(s.Impression) < 1 { 355 invalidParams.Add(request.NewErrParamMinLen("Impression", 1)) 356 } 357 if s.ItemId != nil && len(*s.ItemId) < 1 { 358 invalidParams.Add(request.NewErrParamMinLen("ItemId", 1)) 359 } 360 if s.RecommendationId != nil && len(*s.RecommendationId) < 1 { 361 invalidParams.Add(request.NewErrParamMinLen("RecommendationId", 1)) 362 } 363 if s.SentAt == nil { 364 invalidParams.Add(request.NewErrParamRequired("SentAt")) 365 } 366 367 if invalidParams.Len() > 0 { 368 return invalidParams 369 } 370 return nil 371 } 372 373 // SetEventId sets the EventId field's value. 374 func (s *Event) SetEventId(v string) *Event { 375 s.EventId = &v 376 return s 377 } 378 379 // SetEventType sets the EventType field's value. 380 func (s *Event) SetEventType(v string) *Event { 381 s.EventType = &v 382 return s 383 } 384 385 // SetEventValue sets the EventValue field's value. 386 func (s *Event) SetEventValue(v float64) *Event { 387 s.EventValue = &v 388 return s 389 } 390 391 // SetImpression sets the Impression field's value. 392 func (s *Event) SetImpression(v []*string) *Event { 393 s.Impression = v 394 return s 395 } 396 397 // SetItemId sets the ItemId field's value. 398 func (s *Event) SetItemId(v string) *Event { 399 s.ItemId = &v 400 return s 401 } 402 403 // SetProperties sets the Properties field's value. 404 func (s *Event) SetProperties(v aws.JSONValue) *Event { 405 s.Properties = v 406 return s 407 } 408 409 // SetRecommendationId sets the RecommendationId field's value. 410 func (s *Event) SetRecommendationId(v string) *Event { 411 s.RecommendationId = &v 412 return s 413 } 414 415 // SetSentAt sets the SentAt field's value. 416 func (s *Event) SetSentAt(v time.Time) *Event { 417 s.SentAt = &v 418 return s 419 } 420 421 // Provide a valid value for the field or parameter. 422 type InvalidInputException struct { 423 _ struct{} `type:"structure"` 424 RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` 425 426 Message_ *string `locationName:"message" type:"string"` 427 } 428 429 // String returns the string representation. 430 // 431 // API parameter values that are decorated as "sensitive" in the API will not 432 // be included in the string output. The member name will be present, but the 433 // value will be replaced with "sensitive". 434 func (s InvalidInputException) String() string { 435 return awsutil.Prettify(s) 436 } 437 438 // GoString returns the string representation. 439 // 440 // API parameter values that are decorated as "sensitive" in the API will not 441 // be included in the string output. The member name will be present, but the 442 // value will be replaced with "sensitive". 443 func (s InvalidInputException) GoString() string { 444 return s.String() 445 } 446 447 func newErrorInvalidInputException(v protocol.ResponseMetadata) error { 448 return &InvalidInputException{ 449 RespMetadata: v, 450 } 451 } 452 453 // Code returns the exception type name. 454 func (s *InvalidInputException) Code() string { 455 return "InvalidInputException" 456 } 457 458 // Message returns the exception's message. 459 func (s *InvalidInputException) Message() string { 460 if s.Message_ != nil { 461 return *s.Message_ 462 } 463 return "" 464 } 465 466 // OrigErr always returns nil, satisfies awserr.Error interface. 467 func (s *InvalidInputException) OrigErr() error { 468 return nil 469 } 470 471 func (s *InvalidInputException) Error() string { 472 return fmt.Sprintf("%s: %s", s.Code(), s.Message()) 473 } 474 475 // Status code returns the HTTP status code for the request's response error. 476 func (s *InvalidInputException) StatusCode() int { 477 return s.RespMetadata.StatusCode 478 } 479 480 // RequestID returns the service's response RequestID for request. 481 func (s *InvalidInputException) RequestID() string { 482 return s.RespMetadata.RequestID 483 } 484 485 // Represents item metadata added to an Items dataset using the PutItems API. 486 // For more information see Importing Items Incrementally (https://docs.aws.amazon.com/personalize/latest/dg/importing-items.html). 487 type Item struct { 488 _ struct{} `type:"structure"` 489 490 // The ID associated with the item. 491 // 492 // ItemId is a required field 493 ItemId *string `locationName:"itemId" min:"1" type:"string" required:"true"` 494 495 // A string map of item-specific metadata. Each element in the map consists 496 // of a key-value pair. For example, {"numberOfRatings": "12"}. 497 // 498 // The keys use camel case names that match the fields in the schema for the 499 // Items dataset. In the previous example, the numberOfRatings matches the 'NUMBER_OF_RATINGS' 500 // field defined in the Items schema. For categorical string data, to include 501 // multiple categories for a single item, separate each category with a pipe 502 // separator (|). For example, \"Horror|Action\". 503 Properties aws.JSONValue `locationName:"properties" type:"jsonvalue"` 504 } 505 506 // String returns the string representation. 507 // 508 // API parameter values that are decorated as "sensitive" in the API will not 509 // be included in the string output. The member name will be present, but the 510 // value will be replaced with "sensitive". 511 func (s Item) String() string { 512 return awsutil.Prettify(s) 513 } 514 515 // GoString returns the string representation. 516 // 517 // API parameter values that are decorated as "sensitive" in the API will not 518 // be included in the string output. The member name will be present, but the 519 // value will be replaced with "sensitive". 520 func (s Item) GoString() string { 521 return s.String() 522 } 523 524 // Validate inspects the fields of the type to determine if they are valid. 525 func (s *Item) Validate() error { 526 invalidParams := request.ErrInvalidParams{Context: "Item"} 527 if s.ItemId == nil { 528 invalidParams.Add(request.NewErrParamRequired("ItemId")) 529 } 530 if s.ItemId != nil && len(*s.ItemId) < 1 { 531 invalidParams.Add(request.NewErrParamMinLen("ItemId", 1)) 532 } 533 534 if invalidParams.Len() > 0 { 535 return invalidParams 536 } 537 return nil 538 } 539 540 // SetItemId sets the ItemId field's value. 541 func (s *Item) SetItemId(v string) *Item { 542 s.ItemId = &v 543 return s 544 } 545 546 // SetProperties sets the Properties field's value. 547 func (s *Item) SetProperties(v aws.JSONValue) *Item { 548 s.Properties = v 549 return s 550 } 551 552 type PutEventsInput struct { 553 _ struct{} `type:"structure"` 554 555 // A list of event data from the session. 556 // 557 // EventList is a required field 558 EventList []*Event `locationName:"eventList" min:"1" type:"list" required:"true"` 559 560 // The session ID associated with the user's visit. Your application generates 561 // the sessionId when a user first visits your website or uses your application. 562 // Amazon Personalize uses the sessionId to associate events with the user before 563 // they log in. For more information, see Recording Events (https://docs.aws.amazon.com/personalize/latest/dg/recording-events.html). 564 // 565 // SessionId is a required field 566 SessionId *string `locationName:"sessionId" min:"1" type:"string" required:"true"` 567 568 // The tracking ID for the event. The ID is generated by a call to the CreateEventTracker 569 // (https://docs.aws.amazon.com/personalize/latest/dg/API_CreateEventTracker.html) 570 // API. 571 // 572 // TrackingId is a required field 573 TrackingId *string `locationName:"trackingId" min:"1" type:"string" required:"true"` 574 575 // The user associated with the event. 576 UserId *string `locationName:"userId" min:"1" type:"string"` 577 } 578 579 // String returns the string representation. 580 // 581 // API parameter values that are decorated as "sensitive" in the API will not 582 // be included in the string output. The member name will be present, but the 583 // value will be replaced with "sensitive". 584 func (s PutEventsInput) String() string { 585 return awsutil.Prettify(s) 586 } 587 588 // GoString returns the string representation. 589 // 590 // API parameter values that are decorated as "sensitive" in the API will not 591 // be included in the string output. The member name will be present, but the 592 // value will be replaced with "sensitive". 593 func (s PutEventsInput) GoString() string { 594 return s.String() 595 } 596 597 // Validate inspects the fields of the type to determine if they are valid. 598 func (s *PutEventsInput) Validate() error { 599 invalidParams := request.ErrInvalidParams{Context: "PutEventsInput"} 600 if s.EventList == nil { 601 invalidParams.Add(request.NewErrParamRequired("EventList")) 602 } 603 if s.EventList != nil && len(s.EventList) < 1 { 604 invalidParams.Add(request.NewErrParamMinLen("EventList", 1)) 605 } 606 if s.SessionId == nil { 607 invalidParams.Add(request.NewErrParamRequired("SessionId")) 608 } 609 if s.SessionId != nil && len(*s.SessionId) < 1 { 610 invalidParams.Add(request.NewErrParamMinLen("SessionId", 1)) 611 } 612 if s.TrackingId == nil { 613 invalidParams.Add(request.NewErrParamRequired("TrackingId")) 614 } 615 if s.TrackingId != nil && len(*s.TrackingId) < 1 { 616 invalidParams.Add(request.NewErrParamMinLen("TrackingId", 1)) 617 } 618 if s.UserId != nil && len(*s.UserId) < 1 { 619 invalidParams.Add(request.NewErrParamMinLen("UserId", 1)) 620 } 621 if s.EventList != nil { 622 for i, v := range s.EventList { 623 if v == nil { 624 continue 625 } 626 if err := v.Validate(); err != nil { 627 invalidParams.AddNested(fmt.Sprintf("%s[%v]", "EventList", i), err.(request.ErrInvalidParams)) 628 } 629 } 630 } 631 632 if invalidParams.Len() > 0 { 633 return invalidParams 634 } 635 return nil 636 } 637 638 // SetEventList sets the EventList field's value. 639 func (s *PutEventsInput) SetEventList(v []*Event) *PutEventsInput { 640 s.EventList = v 641 return s 642 } 643 644 // SetSessionId sets the SessionId field's value. 645 func (s *PutEventsInput) SetSessionId(v string) *PutEventsInput { 646 s.SessionId = &v 647 return s 648 } 649 650 // SetTrackingId sets the TrackingId field's value. 651 func (s *PutEventsInput) SetTrackingId(v string) *PutEventsInput { 652 s.TrackingId = &v 653 return s 654 } 655 656 // SetUserId sets the UserId field's value. 657 func (s *PutEventsInput) SetUserId(v string) *PutEventsInput { 658 s.UserId = &v 659 return s 660 } 661 662 type PutEventsOutput struct { 663 _ struct{} `type:"structure" nopayload:"true"` 664 } 665 666 // String returns the string representation. 667 // 668 // API parameter values that are decorated as "sensitive" in the API will not 669 // be included in the string output. The member name will be present, but the 670 // value will be replaced with "sensitive". 671 func (s PutEventsOutput) String() string { 672 return awsutil.Prettify(s) 673 } 674 675 // GoString returns the string representation. 676 // 677 // API parameter values that are decorated as "sensitive" in the API will not 678 // be included in the string output. The member name will be present, but the 679 // value will be replaced with "sensitive". 680 func (s PutEventsOutput) GoString() string { 681 return s.String() 682 } 683 684 type PutItemsInput struct { 685 _ struct{} `type:"structure"` 686 687 // The Amazon Resource Name (ARN) of the Items dataset you are adding the item 688 // or items to. 689 // 690 // DatasetArn is a required field 691 DatasetArn *string `locationName:"datasetArn" type:"string" required:"true"` 692 693 // A list of item data. 694 // 695 // Items is a required field 696 Items []*Item `locationName:"items" min:"1" type:"list" required:"true"` 697 } 698 699 // String returns the string representation. 700 // 701 // API parameter values that are decorated as "sensitive" in the API will not 702 // be included in the string output. The member name will be present, but the 703 // value will be replaced with "sensitive". 704 func (s PutItemsInput) String() string { 705 return awsutil.Prettify(s) 706 } 707 708 // GoString returns the string representation. 709 // 710 // API parameter values that are decorated as "sensitive" in the API will not 711 // be included in the string output. The member name will be present, but the 712 // value will be replaced with "sensitive". 713 func (s PutItemsInput) GoString() string { 714 return s.String() 715 } 716 717 // Validate inspects the fields of the type to determine if they are valid. 718 func (s *PutItemsInput) Validate() error { 719 invalidParams := request.ErrInvalidParams{Context: "PutItemsInput"} 720 if s.DatasetArn == nil { 721 invalidParams.Add(request.NewErrParamRequired("DatasetArn")) 722 } 723 if s.Items == nil { 724 invalidParams.Add(request.NewErrParamRequired("Items")) 725 } 726 if s.Items != nil && len(s.Items) < 1 { 727 invalidParams.Add(request.NewErrParamMinLen("Items", 1)) 728 } 729 if s.Items != nil { 730 for i, v := range s.Items { 731 if v == nil { 732 continue 733 } 734 if err := v.Validate(); err != nil { 735 invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Items", i), err.(request.ErrInvalidParams)) 736 } 737 } 738 } 739 740 if invalidParams.Len() > 0 { 741 return invalidParams 742 } 743 return nil 744 } 745 746 // SetDatasetArn sets the DatasetArn field's value. 747 func (s *PutItemsInput) SetDatasetArn(v string) *PutItemsInput { 748 s.DatasetArn = &v 749 return s 750 } 751 752 // SetItems sets the Items field's value. 753 func (s *PutItemsInput) SetItems(v []*Item) *PutItemsInput { 754 s.Items = v 755 return s 756 } 757 758 type PutItemsOutput struct { 759 _ struct{} `type:"structure" nopayload:"true"` 760 } 761 762 // String returns the string representation. 763 // 764 // API parameter values that are decorated as "sensitive" in the API will not 765 // be included in the string output. The member name will be present, but the 766 // value will be replaced with "sensitive". 767 func (s PutItemsOutput) String() string { 768 return awsutil.Prettify(s) 769 } 770 771 // GoString returns the string representation. 772 // 773 // API parameter values that are decorated as "sensitive" in the API will not 774 // be included in the string output. The member name will be present, but the 775 // value will be replaced with "sensitive". 776 func (s PutItemsOutput) GoString() string { 777 return s.String() 778 } 779 780 type PutUsersInput struct { 781 _ struct{} `type:"structure"` 782 783 // The Amazon Resource Name (ARN) of the Users dataset you are adding the user 784 // or users to. 785 // 786 // DatasetArn is a required field 787 DatasetArn *string `locationName:"datasetArn" type:"string" required:"true"` 788 789 // A list of user data. 790 // 791 // Users is a required field 792 Users []*User `locationName:"users" min:"1" type:"list" required:"true"` 793 } 794 795 // String returns the string representation. 796 // 797 // API parameter values that are decorated as "sensitive" in the API will not 798 // be included in the string output. The member name will be present, but the 799 // value will be replaced with "sensitive". 800 func (s PutUsersInput) String() string { 801 return awsutil.Prettify(s) 802 } 803 804 // GoString returns the string representation. 805 // 806 // API parameter values that are decorated as "sensitive" in the API will not 807 // be included in the string output. The member name will be present, but the 808 // value will be replaced with "sensitive". 809 func (s PutUsersInput) GoString() string { 810 return s.String() 811 } 812 813 // Validate inspects the fields of the type to determine if they are valid. 814 func (s *PutUsersInput) Validate() error { 815 invalidParams := request.ErrInvalidParams{Context: "PutUsersInput"} 816 if s.DatasetArn == nil { 817 invalidParams.Add(request.NewErrParamRequired("DatasetArn")) 818 } 819 if s.Users == nil { 820 invalidParams.Add(request.NewErrParamRequired("Users")) 821 } 822 if s.Users != nil && len(s.Users) < 1 { 823 invalidParams.Add(request.NewErrParamMinLen("Users", 1)) 824 } 825 if s.Users != nil { 826 for i, v := range s.Users { 827 if v == nil { 828 continue 829 } 830 if err := v.Validate(); err != nil { 831 invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Users", i), err.(request.ErrInvalidParams)) 832 } 833 } 834 } 835 836 if invalidParams.Len() > 0 { 837 return invalidParams 838 } 839 return nil 840 } 841 842 // SetDatasetArn sets the DatasetArn field's value. 843 func (s *PutUsersInput) SetDatasetArn(v string) *PutUsersInput { 844 s.DatasetArn = &v 845 return s 846 } 847 848 // SetUsers sets the Users field's value. 849 func (s *PutUsersInput) SetUsers(v []*User) *PutUsersInput { 850 s.Users = v 851 return s 852 } 853 854 type PutUsersOutput struct { 855 _ struct{} `type:"structure" nopayload:"true"` 856 } 857 858 // String returns the string representation. 859 // 860 // API parameter values that are decorated as "sensitive" in the API will not 861 // be included in the string output. The member name will be present, but the 862 // value will be replaced with "sensitive". 863 func (s PutUsersOutput) String() string { 864 return awsutil.Prettify(s) 865 } 866 867 // GoString returns the string representation. 868 // 869 // API parameter values that are decorated as "sensitive" in the API will not 870 // be included in the string output. The member name will be present, but the 871 // value will be replaced with "sensitive". 872 func (s PutUsersOutput) GoString() string { 873 return s.String() 874 } 875 876 // The specified resource is in use. 877 type ResourceInUseException struct { 878 _ struct{} `type:"structure"` 879 RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` 880 881 Message_ *string `locationName:"message" type:"string"` 882 } 883 884 // String returns the string representation. 885 // 886 // API parameter values that are decorated as "sensitive" in the API will not 887 // be included in the string output. The member name will be present, but the 888 // value will be replaced with "sensitive". 889 func (s ResourceInUseException) String() string { 890 return awsutil.Prettify(s) 891 } 892 893 // GoString returns the string representation. 894 // 895 // API parameter values that are decorated as "sensitive" in the API will not 896 // be included in the string output. The member name will be present, but the 897 // value will be replaced with "sensitive". 898 func (s ResourceInUseException) GoString() string { 899 return s.String() 900 } 901 902 func newErrorResourceInUseException(v protocol.ResponseMetadata) error { 903 return &ResourceInUseException{ 904 RespMetadata: v, 905 } 906 } 907 908 // Code returns the exception type name. 909 func (s *ResourceInUseException) Code() string { 910 return "ResourceInUseException" 911 } 912 913 // Message returns the exception's message. 914 func (s *ResourceInUseException) Message() string { 915 if s.Message_ != nil { 916 return *s.Message_ 917 } 918 return "" 919 } 920 921 // OrigErr always returns nil, satisfies awserr.Error interface. 922 func (s *ResourceInUseException) OrigErr() error { 923 return nil 924 } 925 926 func (s *ResourceInUseException) Error() string { 927 return fmt.Sprintf("%s: %s", s.Code(), s.Message()) 928 } 929 930 // Status code returns the HTTP status code for the request's response error. 931 func (s *ResourceInUseException) StatusCode() int { 932 return s.RespMetadata.StatusCode 933 } 934 935 // RequestID returns the service's response RequestID for request. 936 func (s *ResourceInUseException) RequestID() string { 937 return s.RespMetadata.RequestID 938 } 939 940 // Could not find the specified resource. 941 type ResourceNotFoundException struct { 942 _ struct{} `type:"structure"` 943 RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` 944 945 Message_ *string `locationName:"message" type:"string"` 946 } 947 948 // String returns the string representation. 949 // 950 // API parameter values that are decorated as "sensitive" in the API will not 951 // be included in the string output. The member name will be present, but the 952 // value will be replaced with "sensitive". 953 func (s ResourceNotFoundException) String() string { 954 return awsutil.Prettify(s) 955 } 956 957 // GoString returns the string representation. 958 // 959 // API parameter values that are decorated as "sensitive" in the API will not 960 // be included in the string output. The member name will be present, but the 961 // value will be replaced with "sensitive". 962 func (s ResourceNotFoundException) GoString() string { 963 return s.String() 964 } 965 966 func newErrorResourceNotFoundException(v protocol.ResponseMetadata) error { 967 return &ResourceNotFoundException{ 968 RespMetadata: v, 969 } 970 } 971 972 // Code returns the exception type name. 973 func (s *ResourceNotFoundException) Code() string { 974 return "ResourceNotFoundException" 975 } 976 977 // Message returns the exception's message. 978 func (s *ResourceNotFoundException) Message() string { 979 if s.Message_ != nil { 980 return *s.Message_ 981 } 982 return "" 983 } 984 985 // OrigErr always returns nil, satisfies awserr.Error interface. 986 func (s *ResourceNotFoundException) OrigErr() error { 987 return nil 988 } 989 990 func (s *ResourceNotFoundException) Error() string { 991 return fmt.Sprintf("%s: %s", s.Code(), s.Message()) 992 } 993 994 // Status code returns the HTTP status code for the request's response error. 995 func (s *ResourceNotFoundException) StatusCode() int { 996 return s.RespMetadata.StatusCode 997 } 998 999 // RequestID returns the service's response RequestID for request. 1000 func (s *ResourceNotFoundException) RequestID() string { 1001 return s.RespMetadata.RequestID 1002 } 1003 1004 // Represents user metadata added to a Users dataset using the PutUsers API. 1005 // For more information see Importing Users Incrementally (https://docs.aws.amazon.com/personalize/latest/dg/importing-users.html). 1006 type User struct { 1007 _ struct{} `type:"structure"` 1008 1009 // A string map of user-specific metadata. Each element in the map consists 1010 // of a key-value pair. For example, {"numberOfVideosWatched": "45"}. 1011 // 1012 // The keys use camel case names that match the fields in the schema for the 1013 // Users dataset. In the previous example, the numberOfVideosWatched matches 1014 // the 'NUMBER_OF_VIDEOS_WATCHED' field defined in the Users schema. For categorical 1015 // string data, to include multiple categories for a single user, separate each 1016 // category with a pipe separator (|). For example, \"Member|Frequent shopper\". 1017 Properties aws.JSONValue `locationName:"properties" type:"jsonvalue"` 1018 1019 // The ID associated with the user. 1020 // 1021 // UserId is a required field 1022 UserId *string `locationName:"userId" min:"1" type:"string" required:"true"` 1023 } 1024 1025 // String returns the string representation. 1026 // 1027 // API parameter values that are decorated as "sensitive" in the API will not 1028 // be included in the string output. The member name will be present, but the 1029 // value will be replaced with "sensitive". 1030 func (s User) String() string { 1031 return awsutil.Prettify(s) 1032 } 1033 1034 // GoString returns the string representation. 1035 // 1036 // API parameter values that are decorated as "sensitive" in the API will not 1037 // be included in the string output. The member name will be present, but the 1038 // value will be replaced with "sensitive". 1039 func (s User) GoString() string { 1040 return s.String() 1041 } 1042 1043 // Validate inspects the fields of the type to determine if they are valid. 1044 func (s *User) Validate() error { 1045 invalidParams := request.ErrInvalidParams{Context: "User"} 1046 if s.UserId == nil { 1047 invalidParams.Add(request.NewErrParamRequired("UserId")) 1048 } 1049 if s.UserId != nil && len(*s.UserId) < 1 { 1050 invalidParams.Add(request.NewErrParamMinLen("UserId", 1)) 1051 } 1052 1053 if invalidParams.Len() > 0 { 1054 return invalidParams 1055 } 1056 return nil 1057 } 1058 1059 // SetProperties sets the Properties field's value. 1060 func (s *User) SetProperties(v aws.JSONValue) *User { 1061 s.Properties = v 1062 return s 1063 } 1064 1065 // SetUserId sets the UserId field's value. 1066 func (s *User) SetUserId(v string) *User { 1067 s.UserId = &v 1068 return s 1069 }