1// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. 2 3package lexruntimeservice 4 5import ( 6 "fmt" 7 "io" 8 9 "github.com/aws/aws-sdk-go/aws" 10 "github.com/aws/aws-sdk-go/aws/awsutil" 11 "github.com/aws/aws-sdk-go/aws/request" 12 "github.com/aws/aws-sdk-go/aws/signer/v4" 13 "github.com/aws/aws-sdk-go/private/protocol" 14) 15 16const opDeleteSession = "DeleteSession" 17 18// DeleteSessionRequest generates a "aws/request.Request" representing the 19// client's request for the DeleteSession 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 DeleteSession for more information on using the DeleteSession 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 DeleteSessionRequest method. 34// req, resp := client.DeleteSessionRequest(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/runtime.lex-2016-11-28/DeleteSession 42func (c *LexRuntimeService) DeleteSessionRequest(input *DeleteSessionInput) (req *request.Request, output *DeleteSessionOutput) { 43 op := &request.Operation{ 44 Name: opDeleteSession, 45 HTTPMethod: "DELETE", 46 HTTPPath: "/bot/{botName}/alias/{botAlias}/user/{userId}/session", 47 } 48 49 if input == nil { 50 input = &DeleteSessionInput{} 51 } 52 53 output = &DeleteSessionOutput{} 54 req = c.newRequest(op, input, output) 55 return 56} 57 58// DeleteSession API operation for Amazon Lex Runtime Service. 59// 60// Removes session information for a specified bot, alias, and user ID. 61// 62// Returns awserr.Error for service API and SDK errors. Use runtime type assertions 63// with awserr.Error's Code and Message methods to get detailed information about 64// the error. 65// 66// See the AWS API reference guide for Amazon Lex Runtime Service's 67// API operation DeleteSession for usage and error information. 68// 69// Returned Error Types: 70// * NotFoundException 71// The resource (such as the Amazon Lex bot or an alias) that is referred to 72// is not found. 73// 74// * BadRequestException 75// Request validation failed, there is no usable message in the context, or 76// the bot build failed, is still in progress, or contains unbuilt changes. 77// 78// * LimitExceededException 79// Exceeded a limit. 80// 81// * InternalFailureException 82// Internal service error. Retry the call. 83// 84// * ConflictException 85// Two clients are using the same AWS account, Amazon Lex bot, and user ID. 86// 87// See also, https://docs.aws.amazon.com/goto/WebAPI/runtime.lex-2016-11-28/DeleteSession 88func (c *LexRuntimeService) DeleteSession(input *DeleteSessionInput) (*DeleteSessionOutput, error) { 89 req, out := c.DeleteSessionRequest(input) 90 return out, req.Send() 91} 92 93// DeleteSessionWithContext is the same as DeleteSession with the addition of 94// the ability to pass a context and additional request options. 95// 96// See DeleteSession for details on how to use this API operation. 97// 98// The context must be non-nil and will be used for request cancellation. If 99// the context is nil a panic will occur. In the future the SDK may create 100// sub-contexts for http.Requests. See https://golang.org/pkg/context/ 101// for more information on using Contexts. 102func (c *LexRuntimeService) DeleteSessionWithContext(ctx aws.Context, input *DeleteSessionInput, opts ...request.Option) (*DeleteSessionOutput, error) { 103 req, out := c.DeleteSessionRequest(input) 104 req.SetContext(ctx) 105 req.ApplyOptions(opts...) 106 return out, req.Send() 107} 108 109const opGetSession = "GetSession" 110 111// GetSessionRequest generates a "aws/request.Request" representing the 112// client's request for the GetSession operation. The "output" return 113// value will be populated with the request's response once the request completes 114// successfully. 115// 116// Use "Send" method on the returned Request to send the API call to the service. 117// the "output" return value is not valid until after Send returns without error. 118// 119// See GetSession for more information on using the GetSession 120// API call, and error handling. 121// 122// This method is useful when you want to inject custom logic or configuration 123// into the SDK's request lifecycle. Such as custom headers, or retry logic. 124// 125// 126// // Example sending a request using the GetSessionRequest method. 127// req, resp := client.GetSessionRequest(params) 128// 129// err := req.Send() 130// if err == nil { // resp is now filled 131// fmt.Println(resp) 132// } 133// 134// See also, https://docs.aws.amazon.com/goto/WebAPI/runtime.lex-2016-11-28/GetSession 135func (c *LexRuntimeService) GetSessionRequest(input *GetSessionInput) (req *request.Request, output *GetSessionOutput) { 136 op := &request.Operation{ 137 Name: opGetSession, 138 HTTPMethod: "GET", 139 HTTPPath: "/bot/{botName}/alias/{botAlias}/user/{userId}/session/", 140 } 141 142 if input == nil { 143 input = &GetSessionInput{} 144 } 145 146 output = &GetSessionOutput{} 147 req = c.newRequest(op, input, output) 148 return 149} 150 151// GetSession API operation for Amazon Lex Runtime Service. 152// 153// Returns session information for a specified bot, alias, and user ID. 154// 155// Returns awserr.Error for service API and SDK errors. Use runtime type assertions 156// with awserr.Error's Code and Message methods to get detailed information about 157// the error. 158// 159// See the AWS API reference guide for Amazon Lex Runtime Service's 160// API operation GetSession for usage and error information. 161// 162// Returned Error Types: 163// * NotFoundException 164// The resource (such as the Amazon Lex bot or an alias) that is referred to 165// is not found. 166// 167// * BadRequestException 168// Request validation failed, there is no usable message in the context, or 169// the bot build failed, is still in progress, or contains unbuilt changes. 170// 171// * LimitExceededException 172// Exceeded a limit. 173// 174// * InternalFailureException 175// Internal service error. Retry the call. 176// 177// See also, https://docs.aws.amazon.com/goto/WebAPI/runtime.lex-2016-11-28/GetSession 178func (c *LexRuntimeService) GetSession(input *GetSessionInput) (*GetSessionOutput, error) { 179 req, out := c.GetSessionRequest(input) 180 return out, req.Send() 181} 182 183// GetSessionWithContext is the same as GetSession with the addition of 184// the ability to pass a context and additional request options. 185// 186// See GetSession for details on how to use this API operation. 187// 188// The context must be non-nil and will be used for request cancellation. If 189// the context is nil a panic will occur. In the future the SDK may create 190// sub-contexts for http.Requests. See https://golang.org/pkg/context/ 191// for more information on using Contexts. 192func (c *LexRuntimeService) GetSessionWithContext(ctx aws.Context, input *GetSessionInput, opts ...request.Option) (*GetSessionOutput, error) { 193 req, out := c.GetSessionRequest(input) 194 req.SetContext(ctx) 195 req.ApplyOptions(opts...) 196 return out, req.Send() 197} 198 199const opPostContent = "PostContent" 200 201// PostContentRequest generates a "aws/request.Request" representing the 202// client's request for the PostContent operation. The "output" return 203// value will be populated with the request's response once the request completes 204// successfully. 205// 206// Use "Send" method on the returned Request to send the API call to the service. 207// the "output" return value is not valid until after Send returns without error. 208// 209// See PostContent for more information on using the PostContent 210// API call, and error handling. 211// 212// This method is useful when you want to inject custom logic or configuration 213// into the SDK's request lifecycle. Such as custom headers, or retry logic. 214// 215// 216// // Example sending a request using the PostContentRequest method. 217// req, resp := client.PostContentRequest(params) 218// 219// err := req.Send() 220// if err == nil { // resp is now filled 221// fmt.Println(resp) 222// } 223// 224// See also, https://docs.aws.amazon.com/goto/WebAPI/runtime.lex-2016-11-28/PostContent 225func (c *LexRuntimeService) PostContentRequest(input *PostContentInput) (req *request.Request, output *PostContentOutput) { 226 op := &request.Operation{ 227 Name: opPostContent, 228 HTTPMethod: "POST", 229 HTTPPath: "/bot/{botName}/alias/{botAlias}/user/{userId}/content", 230 } 231 232 if input == nil { 233 input = &PostContentInput{} 234 } 235 236 output = &PostContentOutput{} 237 req = c.newRequest(op, input, output) 238 req.Handlers.Sign.Remove(v4.SignRequestHandler) 239 handler := v4.BuildNamedHandler("v4.CustomSignerHandler", v4.WithUnsignedPayload) 240 req.Handlers.Sign.PushFrontNamed(handler) 241 return 242} 243 244// PostContent API operation for Amazon Lex Runtime Service. 245// 246// Sends user input (text or speech) to Amazon Lex. Clients use this API to 247// send text and audio requests to Amazon Lex at runtime. Amazon Lex interprets 248// the user input using the machine learning model that it built for the bot. 249// 250// The PostContent operation supports audio input at 8kHz and 16kHz. You can 251// use 8kHz audio to achieve higher speech recognition accuracy in telephone 252// audio applications. 253// 254// In response, Amazon Lex returns the next message to convey to the user. Consider 255// the following example messages: 256// 257// * For a user input "I would like a pizza," Amazon Lex might return a response 258// with a message eliciting slot data (for example, PizzaSize): "What size 259// pizza would you like?". 260// 261// * After the user provides all of the pizza order information, Amazon Lex 262// might return a response with a message to get user confirmation: "Order 263// the pizza?". 264// 265// * After the user replies "Yes" to the confirmation prompt, Amazon Lex 266// might return a conclusion statement: "Thank you, your cheese pizza has 267// been ordered.". 268// 269// Not all Amazon Lex messages require a response from the user. For example, 270// conclusion statements do not require a response. Some messages require only 271// a yes or no response. In addition to the message, Amazon Lex provides additional 272// context about the message in the response that you can use to enhance client 273// behavior, such as displaying the appropriate client user interface. Consider 274// the following examples: 275// 276// * If the message is to elicit slot data, Amazon Lex returns the following 277// context information: x-amz-lex-dialog-state header set to ElicitSlot x-amz-lex-intent-name 278// header set to the intent name in the current context x-amz-lex-slot-to-elicit 279// header set to the slot name for which the message is eliciting information 280// x-amz-lex-slots header set to a map of slots configured for the intent 281// with their current values 282// 283// * If the message is a confirmation prompt, the x-amz-lex-dialog-state 284// header is set to Confirmation and the x-amz-lex-slot-to-elicit header 285// is omitted. 286// 287// * If the message is a clarification prompt configured for the intent, 288// indicating that the user intent is not understood, the x-amz-dialog-state 289// header is set to ElicitIntent and the x-amz-slot-to-elicit header is omitted. 290// 291// In addition, Amazon Lex also returns your application-specific sessionAttributes. 292// For more information, see Managing Conversation Context (https://docs.aws.amazon.com/lex/latest/dg/context-mgmt.html). 293// 294// Returns awserr.Error for service API and SDK errors. Use runtime type assertions 295// with awserr.Error's Code and Message methods to get detailed information about 296// the error. 297// 298// See the AWS API reference guide for Amazon Lex Runtime Service's 299// API operation PostContent for usage and error information. 300// 301// Returned Error Types: 302// * NotFoundException 303// The resource (such as the Amazon Lex bot or an alias) that is referred to 304// is not found. 305// 306// * BadRequestException 307// Request validation failed, there is no usable message in the context, or 308// the bot build failed, is still in progress, or contains unbuilt changes. 309// 310// * LimitExceededException 311// Exceeded a limit. 312// 313// * InternalFailureException 314// Internal service error. Retry the call. 315// 316// * ConflictException 317// Two clients are using the same AWS account, Amazon Lex bot, and user ID. 318// 319// * UnsupportedMediaTypeException 320// The Content-Type header (PostContent API) has an invalid value. 321// 322// * NotAcceptableException 323// The accept header in the request does not have a valid value. 324// 325// * RequestTimeoutException 326// The input speech is too long. 327// 328// * DependencyFailedException 329// One of the dependencies, such as AWS Lambda or Amazon Polly, threw an exception. 330// For example, 331// 332// * If Amazon Lex does not have sufficient permissions to call a Lambda 333// function. 334// 335// * If a Lambda function takes longer than 30 seconds to execute. 336// 337// * If a fulfillment Lambda function returns a Delegate dialog action without 338// removing any slot values. 339// 340// * BadGatewayException 341// Either the Amazon Lex bot is still building, or one of the dependent services 342// (Amazon Polly, AWS Lambda) failed with an internal service error. 343// 344// * LoopDetectedException 345// This exception is not used. 346// 347// See also, https://docs.aws.amazon.com/goto/WebAPI/runtime.lex-2016-11-28/PostContent 348func (c *LexRuntimeService) PostContent(input *PostContentInput) (*PostContentOutput, error) { 349 req, out := c.PostContentRequest(input) 350 return out, req.Send() 351} 352 353// PostContentWithContext is the same as PostContent with the addition of 354// the ability to pass a context and additional request options. 355// 356// See PostContent for details on how to use this API operation. 357// 358// The context must be non-nil and will be used for request cancellation. If 359// the context is nil a panic will occur. In the future the SDK may create 360// sub-contexts for http.Requests. See https://golang.org/pkg/context/ 361// for more information on using Contexts. 362func (c *LexRuntimeService) PostContentWithContext(ctx aws.Context, input *PostContentInput, opts ...request.Option) (*PostContentOutput, error) { 363 req, out := c.PostContentRequest(input) 364 req.SetContext(ctx) 365 req.ApplyOptions(opts...) 366 return out, req.Send() 367} 368 369const opPostText = "PostText" 370 371// PostTextRequest generates a "aws/request.Request" representing the 372// client's request for the PostText operation. The "output" return 373// value will be populated with the request's response once the request completes 374// successfully. 375// 376// Use "Send" method on the returned Request to send the API call to the service. 377// the "output" return value is not valid until after Send returns without error. 378// 379// See PostText for more information on using the PostText 380// API call, and error handling. 381// 382// This method is useful when you want to inject custom logic or configuration 383// into the SDK's request lifecycle. Such as custom headers, or retry logic. 384// 385// 386// // Example sending a request using the PostTextRequest method. 387// req, resp := client.PostTextRequest(params) 388// 389// err := req.Send() 390// if err == nil { // resp is now filled 391// fmt.Println(resp) 392// } 393// 394// See also, https://docs.aws.amazon.com/goto/WebAPI/runtime.lex-2016-11-28/PostText 395func (c *LexRuntimeService) PostTextRequest(input *PostTextInput) (req *request.Request, output *PostTextOutput) { 396 op := &request.Operation{ 397 Name: opPostText, 398 HTTPMethod: "POST", 399 HTTPPath: "/bot/{botName}/alias/{botAlias}/user/{userId}/text", 400 } 401 402 if input == nil { 403 input = &PostTextInput{} 404 } 405 406 output = &PostTextOutput{} 407 req = c.newRequest(op, input, output) 408 return 409} 410 411// PostText API operation for Amazon Lex Runtime Service. 412// 413// Sends user input to Amazon Lex. Client applications can use this API to send 414// requests to Amazon Lex at runtime. Amazon Lex then interprets the user input 415// using the machine learning model it built for the bot. 416// 417// In response, Amazon Lex returns the next message to convey to the user an 418// optional responseCard to display. Consider the following example messages: 419// 420// * For a user input "I would like a pizza", Amazon Lex might return a response 421// with a message eliciting slot data (for example, PizzaSize): "What size 422// pizza would you like?" 423// 424// * After the user provides all of the pizza order information, Amazon Lex 425// might return a response with a message to obtain user confirmation "Proceed 426// with the pizza order?". 427// 428// * After the user replies to a confirmation prompt with a "yes", Amazon 429// Lex might return a conclusion statement: "Thank you, your cheese pizza 430// has been ordered.". 431// 432// Not all Amazon Lex messages require a user response. For example, a conclusion 433// statement does not require a response. Some messages require only a "yes" 434// or "no" user response. In addition to the message, Amazon Lex provides additional 435// context about the message in the response that you might use to enhance client 436// behavior, for example, to display the appropriate client user interface. 437// These are the slotToElicit, dialogState, intentName, and slots fields in 438// the response. Consider the following examples: 439// 440// * If the message is to elicit slot data, Amazon Lex returns the following 441// context information: dialogState set to ElicitSlot intentName set to the 442// intent name in the current context slotToElicit set to the slot name for 443// which the message is eliciting information slots set to a map of slots, 444// configured for the intent, with currently known values 445// 446// * If the message is a confirmation prompt, the dialogState is set to ConfirmIntent 447// and SlotToElicit is set to null. 448// 449// * If the message is a clarification prompt (configured for the intent) 450// that indicates that user intent is not understood, the dialogState is 451// set to ElicitIntent and slotToElicit is set to null. 452// 453// In addition, Amazon Lex also returns your application-specific sessionAttributes. 454// For more information, see Managing Conversation Context (https://docs.aws.amazon.com/lex/latest/dg/context-mgmt.html). 455// 456// Returns awserr.Error for service API and SDK errors. Use runtime type assertions 457// with awserr.Error's Code and Message methods to get detailed information about 458// the error. 459// 460// See the AWS API reference guide for Amazon Lex Runtime Service's 461// API operation PostText for usage and error information. 462// 463// Returned Error Types: 464// * NotFoundException 465// The resource (such as the Amazon Lex bot or an alias) that is referred to 466// is not found. 467// 468// * BadRequestException 469// Request validation failed, there is no usable message in the context, or 470// the bot build failed, is still in progress, or contains unbuilt changes. 471// 472// * LimitExceededException 473// Exceeded a limit. 474// 475// * InternalFailureException 476// Internal service error. Retry the call. 477// 478// * ConflictException 479// Two clients are using the same AWS account, Amazon Lex bot, and user ID. 480// 481// * DependencyFailedException 482// One of the dependencies, such as AWS Lambda or Amazon Polly, threw an exception. 483// For example, 484// 485// * If Amazon Lex does not have sufficient permissions to call a Lambda 486// function. 487// 488// * If a Lambda function takes longer than 30 seconds to execute. 489// 490// * If a fulfillment Lambda function returns a Delegate dialog action without 491// removing any slot values. 492// 493// * BadGatewayException 494// Either the Amazon Lex bot is still building, or one of the dependent services 495// (Amazon Polly, AWS Lambda) failed with an internal service error. 496// 497// * LoopDetectedException 498// This exception is not used. 499// 500// See also, https://docs.aws.amazon.com/goto/WebAPI/runtime.lex-2016-11-28/PostText 501func (c *LexRuntimeService) PostText(input *PostTextInput) (*PostTextOutput, error) { 502 req, out := c.PostTextRequest(input) 503 return out, req.Send() 504} 505 506// PostTextWithContext is the same as PostText with the addition of 507// the ability to pass a context and additional request options. 508// 509// See PostText for details on how to use this API operation. 510// 511// The context must be non-nil and will be used for request cancellation. If 512// the context is nil a panic will occur. In the future the SDK may create 513// sub-contexts for http.Requests. See https://golang.org/pkg/context/ 514// for more information on using Contexts. 515func (c *LexRuntimeService) PostTextWithContext(ctx aws.Context, input *PostTextInput, opts ...request.Option) (*PostTextOutput, error) { 516 req, out := c.PostTextRequest(input) 517 req.SetContext(ctx) 518 req.ApplyOptions(opts...) 519 return out, req.Send() 520} 521 522const opPutSession = "PutSession" 523 524// PutSessionRequest generates a "aws/request.Request" representing the 525// client's request for the PutSession operation. The "output" return 526// value will be populated with the request's response once the request completes 527// successfully. 528// 529// Use "Send" method on the returned Request to send the API call to the service. 530// the "output" return value is not valid until after Send returns without error. 531// 532// See PutSession for more information on using the PutSession 533// API call, and error handling. 534// 535// This method is useful when you want to inject custom logic or configuration 536// into the SDK's request lifecycle. Such as custom headers, or retry logic. 537// 538// 539// // Example sending a request using the PutSessionRequest method. 540// req, resp := client.PutSessionRequest(params) 541// 542// err := req.Send() 543// if err == nil { // resp is now filled 544// fmt.Println(resp) 545// } 546// 547// See also, https://docs.aws.amazon.com/goto/WebAPI/runtime.lex-2016-11-28/PutSession 548func (c *LexRuntimeService) PutSessionRequest(input *PutSessionInput) (req *request.Request, output *PutSessionOutput) { 549 op := &request.Operation{ 550 Name: opPutSession, 551 HTTPMethod: "POST", 552 HTTPPath: "/bot/{botName}/alias/{botAlias}/user/{userId}/session", 553 } 554 555 if input == nil { 556 input = &PutSessionInput{} 557 } 558 559 output = &PutSessionOutput{} 560 req = c.newRequest(op, input, output) 561 return 562} 563 564// PutSession API operation for Amazon Lex Runtime Service. 565// 566// Creates a new session or modifies an existing session with an Amazon Lex 567// bot. Use this operation to enable your application to set the state of the 568// bot. 569// 570// For more information, see Managing Sessions (https://docs.aws.amazon.com/lex/latest/dg/how-session-api.html). 571// 572// Returns awserr.Error for service API and SDK errors. Use runtime type assertions 573// with awserr.Error's Code and Message methods to get detailed information about 574// the error. 575// 576// See the AWS API reference guide for Amazon Lex Runtime Service's 577// API operation PutSession for usage and error information. 578// 579// Returned Error Types: 580// * NotFoundException 581// The resource (such as the Amazon Lex bot or an alias) that is referred to 582// is not found. 583// 584// * BadRequestException 585// Request validation failed, there is no usable message in the context, or 586// the bot build failed, is still in progress, or contains unbuilt changes. 587// 588// * LimitExceededException 589// Exceeded a limit. 590// 591// * InternalFailureException 592// Internal service error. Retry the call. 593// 594// * ConflictException 595// Two clients are using the same AWS account, Amazon Lex bot, and user ID. 596// 597// * NotAcceptableException 598// The accept header in the request does not have a valid value. 599// 600// * DependencyFailedException 601// One of the dependencies, such as AWS Lambda or Amazon Polly, threw an exception. 602// For example, 603// 604// * If Amazon Lex does not have sufficient permissions to call a Lambda 605// function. 606// 607// * If a Lambda function takes longer than 30 seconds to execute. 608// 609// * If a fulfillment Lambda function returns a Delegate dialog action without 610// removing any slot values. 611// 612// * BadGatewayException 613// Either the Amazon Lex bot is still building, or one of the dependent services 614// (Amazon Polly, AWS Lambda) failed with an internal service error. 615// 616// See also, https://docs.aws.amazon.com/goto/WebAPI/runtime.lex-2016-11-28/PutSession 617func (c *LexRuntimeService) PutSession(input *PutSessionInput) (*PutSessionOutput, error) { 618 req, out := c.PutSessionRequest(input) 619 return out, req.Send() 620} 621 622// PutSessionWithContext is the same as PutSession with the addition of 623// the ability to pass a context and additional request options. 624// 625// See PutSession for details on how to use this API operation. 626// 627// The context must be non-nil and will be used for request cancellation. If 628// the context is nil a panic will occur. In the future the SDK may create 629// sub-contexts for http.Requests. See https://golang.org/pkg/context/ 630// for more information on using Contexts. 631func (c *LexRuntimeService) PutSessionWithContext(ctx aws.Context, input *PutSessionInput, opts ...request.Option) (*PutSessionOutput, error) { 632 req, out := c.PutSessionRequest(input) 633 req.SetContext(ctx) 634 req.ApplyOptions(opts...) 635 return out, req.Send() 636} 637 638// A context is a variable that contains information about the current state 639// of the conversation between a user and Amazon Lex. Context can be set automatically 640// by Amazon Lex when an intent is fulfilled, or it can be set at runtime using 641// the PutContent, PutText, or PutSession operation. 642type ActiveContext struct { 643 _ struct{} `type:"structure"` 644 645 // The name of the context. 646 // 647 // Name is a required field 648 Name *string `locationName:"name" min:"1" type:"string" required:"true"` 649 650 // State variables for the current context. You can use these values as default 651 // values for slots in subsequent events. 652 // 653 // Parameters is a required field 654 Parameters map[string]*string `locationName:"parameters" type:"map" required:"true"` 655 656 // The length of time or number of turns that a context remains active. 657 // 658 // TimeToLive is a required field 659 TimeToLive *ActiveContextTimeToLive `locationName:"timeToLive" type:"structure" required:"true"` 660} 661 662// String returns the string representation 663func (s ActiveContext) String() string { 664 return awsutil.Prettify(s) 665} 666 667// GoString returns the string representation 668func (s ActiveContext) GoString() string { 669 return s.String() 670} 671 672// Validate inspects the fields of the type to determine if they are valid. 673func (s *ActiveContext) Validate() error { 674 invalidParams := request.ErrInvalidParams{Context: "ActiveContext"} 675 if s.Name == nil { 676 invalidParams.Add(request.NewErrParamRequired("Name")) 677 } 678 if s.Name != nil && len(*s.Name) < 1 { 679 invalidParams.Add(request.NewErrParamMinLen("Name", 1)) 680 } 681 if s.Parameters == nil { 682 invalidParams.Add(request.NewErrParamRequired("Parameters")) 683 } 684 if s.TimeToLive == nil { 685 invalidParams.Add(request.NewErrParamRequired("TimeToLive")) 686 } 687 if s.TimeToLive != nil { 688 if err := s.TimeToLive.Validate(); err != nil { 689 invalidParams.AddNested("TimeToLive", err.(request.ErrInvalidParams)) 690 } 691 } 692 693 if invalidParams.Len() > 0 { 694 return invalidParams 695 } 696 return nil 697} 698 699// SetName sets the Name field's value. 700func (s *ActiveContext) SetName(v string) *ActiveContext { 701 s.Name = &v 702 return s 703} 704 705// SetParameters sets the Parameters field's value. 706func (s *ActiveContext) SetParameters(v map[string]*string) *ActiveContext { 707 s.Parameters = v 708 return s 709} 710 711// SetTimeToLive sets the TimeToLive field's value. 712func (s *ActiveContext) SetTimeToLive(v *ActiveContextTimeToLive) *ActiveContext { 713 s.TimeToLive = v 714 return s 715} 716 717// The length of time or number of turns that a context remains active. 718type ActiveContextTimeToLive struct { 719 _ struct{} `type:"structure"` 720 721 // The number of seconds that the context should be active after it is first 722 // sent in a PostContent or PostText response. You can set the value between 723 // 5 and 86,400 seconds (24 hours). 724 TimeToLiveInSeconds *int64 `locationName:"timeToLiveInSeconds" min:"5" type:"integer"` 725 726 // The number of conversation turns that the context should be active. A conversation 727 // turn is one PostContent or PostText request and the corresponding response 728 // from Amazon Lex. 729 TurnsToLive *int64 `locationName:"turnsToLive" min:"1" type:"integer"` 730} 731 732// String returns the string representation 733func (s ActiveContextTimeToLive) String() string { 734 return awsutil.Prettify(s) 735} 736 737// GoString returns the string representation 738func (s ActiveContextTimeToLive) GoString() string { 739 return s.String() 740} 741 742// Validate inspects the fields of the type to determine if they are valid. 743func (s *ActiveContextTimeToLive) Validate() error { 744 invalidParams := request.ErrInvalidParams{Context: "ActiveContextTimeToLive"} 745 if s.TimeToLiveInSeconds != nil && *s.TimeToLiveInSeconds < 5 { 746 invalidParams.Add(request.NewErrParamMinValue("TimeToLiveInSeconds", 5)) 747 } 748 if s.TurnsToLive != nil && *s.TurnsToLive < 1 { 749 invalidParams.Add(request.NewErrParamMinValue("TurnsToLive", 1)) 750 } 751 752 if invalidParams.Len() > 0 { 753 return invalidParams 754 } 755 return nil 756} 757 758// SetTimeToLiveInSeconds sets the TimeToLiveInSeconds field's value. 759func (s *ActiveContextTimeToLive) SetTimeToLiveInSeconds(v int64) *ActiveContextTimeToLive { 760 s.TimeToLiveInSeconds = &v 761 return s 762} 763 764// SetTurnsToLive sets the TurnsToLive field's value. 765func (s *ActiveContextTimeToLive) SetTurnsToLive(v int64) *ActiveContextTimeToLive { 766 s.TurnsToLive = &v 767 return s 768} 769 770// Either the Amazon Lex bot is still building, or one of the dependent services 771// (Amazon Polly, AWS Lambda) failed with an internal service error. 772type BadGatewayException struct { 773 _ struct{} `type:"structure"` 774 RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` 775 776 Message_ *string `locationName:"Message" type:"string"` 777} 778 779// String returns the string representation 780func (s BadGatewayException) String() string { 781 return awsutil.Prettify(s) 782} 783 784// GoString returns the string representation 785func (s BadGatewayException) GoString() string { 786 return s.String() 787} 788 789func newErrorBadGatewayException(v protocol.ResponseMetadata) error { 790 return &BadGatewayException{ 791 RespMetadata: v, 792 } 793} 794 795// Code returns the exception type name. 796func (s *BadGatewayException) Code() string { 797 return "BadGatewayException" 798} 799 800// Message returns the exception's message. 801func (s *BadGatewayException) Message() string { 802 if s.Message_ != nil { 803 return *s.Message_ 804 } 805 return "" 806} 807 808// OrigErr always returns nil, satisfies awserr.Error interface. 809func (s *BadGatewayException) OrigErr() error { 810 return nil 811} 812 813func (s *BadGatewayException) Error() string { 814 return fmt.Sprintf("%s: %s", s.Code(), s.Message()) 815} 816 817// Status code returns the HTTP status code for the request's response error. 818func (s *BadGatewayException) StatusCode() int { 819 return s.RespMetadata.StatusCode 820} 821 822// RequestID returns the service's response RequestID for request. 823func (s *BadGatewayException) RequestID() string { 824 return s.RespMetadata.RequestID 825} 826 827// Request validation failed, there is no usable message in the context, or 828// the bot build failed, is still in progress, or contains unbuilt changes. 829type BadRequestException struct { 830 _ struct{} `type:"structure"` 831 RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` 832 833 Message_ *string `locationName:"message" type:"string"` 834} 835 836// String returns the string representation 837func (s BadRequestException) String() string { 838 return awsutil.Prettify(s) 839} 840 841// GoString returns the string representation 842func (s BadRequestException) GoString() string { 843 return s.String() 844} 845 846func newErrorBadRequestException(v protocol.ResponseMetadata) error { 847 return &BadRequestException{ 848 RespMetadata: v, 849 } 850} 851 852// Code returns the exception type name. 853func (s *BadRequestException) Code() string { 854 return "BadRequestException" 855} 856 857// Message returns the exception's message. 858func (s *BadRequestException) Message() string { 859 if s.Message_ != nil { 860 return *s.Message_ 861 } 862 return "" 863} 864 865// OrigErr always returns nil, satisfies awserr.Error interface. 866func (s *BadRequestException) OrigErr() error { 867 return nil 868} 869 870func (s *BadRequestException) Error() string { 871 return fmt.Sprintf("%s: %s", s.Code(), s.Message()) 872} 873 874// Status code returns the HTTP status code for the request's response error. 875func (s *BadRequestException) StatusCode() int { 876 return s.RespMetadata.StatusCode 877} 878 879// RequestID returns the service's response RequestID for request. 880func (s *BadRequestException) RequestID() string { 881 return s.RespMetadata.RequestID 882} 883 884// Represents an option to be shown on the client platform (Facebook, Slack, 885// etc.) 886type Button struct { 887 _ struct{} `type:"structure"` 888 889 // Text that is visible to the user on the button. 890 // 891 // Text is a required field 892 Text *string `locationName:"text" min:"1" type:"string" required:"true"` 893 894 // The value sent to Amazon Lex when a user chooses the button. For example, 895 // consider button text "NYC." When the user chooses the button, the value sent 896 // can be "New York City." 897 // 898 // Value is a required field 899 Value *string `locationName:"value" min:"1" type:"string" required:"true"` 900} 901 902// String returns the string representation 903func (s Button) String() string { 904 return awsutil.Prettify(s) 905} 906 907// GoString returns the string representation 908func (s Button) GoString() string { 909 return s.String() 910} 911 912// SetText sets the Text field's value. 913func (s *Button) SetText(v string) *Button { 914 s.Text = &v 915 return s 916} 917 918// SetValue sets the Value field's value. 919func (s *Button) SetValue(v string) *Button { 920 s.Value = &v 921 return s 922} 923 924// Two clients are using the same AWS account, Amazon Lex bot, and user ID. 925type ConflictException struct { 926 _ struct{} `type:"structure"` 927 RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` 928 929 Message_ *string `locationName:"message" type:"string"` 930} 931 932// String returns the string representation 933func (s ConflictException) String() string { 934 return awsutil.Prettify(s) 935} 936 937// GoString returns the string representation 938func (s ConflictException) GoString() string { 939 return s.String() 940} 941 942func newErrorConflictException(v protocol.ResponseMetadata) error { 943 return &ConflictException{ 944 RespMetadata: v, 945 } 946} 947 948// Code returns the exception type name. 949func (s *ConflictException) Code() string { 950 return "ConflictException" 951} 952 953// Message returns the exception's message. 954func (s *ConflictException) Message() string { 955 if s.Message_ != nil { 956 return *s.Message_ 957 } 958 return "" 959} 960 961// OrigErr always returns nil, satisfies awserr.Error interface. 962func (s *ConflictException) OrigErr() error { 963 return nil 964} 965 966func (s *ConflictException) Error() string { 967 return fmt.Sprintf("%s: %s", s.Code(), s.Message()) 968} 969 970// Status code returns the HTTP status code for the request's response error. 971func (s *ConflictException) StatusCode() int { 972 return s.RespMetadata.StatusCode 973} 974 975// RequestID returns the service's response RequestID for request. 976func (s *ConflictException) RequestID() string { 977 return s.RespMetadata.RequestID 978} 979 980type DeleteSessionInput struct { 981 _ struct{} `type:"structure"` 982 983 // The alias in use for the bot that contains the session data. 984 // 985 // BotAlias is a required field 986 BotAlias *string `location:"uri" locationName:"botAlias" type:"string" required:"true"` 987 988 // The name of the bot that contains the session data. 989 // 990 // BotName is a required field 991 BotName *string `location:"uri" locationName:"botName" type:"string" required:"true"` 992 993 // The identifier of the user associated with the session data. 994 // 995 // UserId is a required field 996 UserId *string `location:"uri" locationName:"userId" min:"2" type:"string" required:"true"` 997} 998 999// String returns the string representation 1000func (s DeleteSessionInput) String() string { 1001 return awsutil.Prettify(s) 1002} 1003 1004// GoString returns the string representation 1005func (s DeleteSessionInput) GoString() string { 1006 return s.String() 1007} 1008 1009// Validate inspects the fields of the type to determine if they are valid. 1010func (s *DeleteSessionInput) Validate() error { 1011 invalidParams := request.ErrInvalidParams{Context: "DeleteSessionInput"} 1012 if s.BotAlias == nil { 1013 invalidParams.Add(request.NewErrParamRequired("BotAlias")) 1014 } 1015 if s.BotAlias != nil && len(*s.BotAlias) < 1 { 1016 invalidParams.Add(request.NewErrParamMinLen("BotAlias", 1)) 1017 } 1018 if s.BotName == nil { 1019 invalidParams.Add(request.NewErrParamRequired("BotName")) 1020 } 1021 if s.BotName != nil && len(*s.BotName) < 1 { 1022 invalidParams.Add(request.NewErrParamMinLen("BotName", 1)) 1023 } 1024 if s.UserId == nil { 1025 invalidParams.Add(request.NewErrParamRequired("UserId")) 1026 } 1027 if s.UserId != nil && len(*s.UserId) < 2 { 1028 invalidParams.Add(request.NewErrParamMinLen("UserId", 2)) 1029 } 1030 1031 if invalidParams.Len() > 0 { 1032 return invalidParams 1033 } 1034 return nil 1035} 1036 1037// SetBotAlias sets the BotAlias field's value. 1038func (s *DeleteSessionInput) SetBotAlias(v string) *DeleteSessionInput { 1039 s.BotAlias = &v 1040 return s 1041} 1042 1043// SetBotName sets the BotName field's value. 1044func (s *DeleteSessionInput) SetBotName(v string) *DeleteSessionInput { 1045 s.BotName = &v 1046 return s 1047} 1048 1049// SetUserId sets the UserId field's value. 1050func (s *DeleteSessionInput) SetUserId(v string) *DeleteSessionInput { 1051 s.UserId = &v 1052 return s 1053} 1054 1055type DeleteSessionOutput struct { 1056 _ struct{} `type:"structure"` 1057 1058 // The alias in use for the bot associated with the session data. 1059 BotAlias *string `locationName:"botAlias" type:"string"` 1060 1061 // The name of the bot associated with the session data. 1062 BotName *string `locationName:"botName" type:"string"` 1063 1064 // The unique identifier for the session. 1065 SessionId *string `locationName:"sessionId" type:"string"` 1066 1067 // The ID of the client application user. 1068 UserId *string `locationName:"userId" min:"2" type:"string"` 1069} 1070 1071// String returns the string representation 1072func (s DeleteSessionOutput) String() string { 1073 return awsutil.Prettify(s) 1074} 1075 1076// GoString returns the string representation 1077func (s DeleteSessionOutput) GoString() string { 1078 return s.String() 1079} 1080 1081// SetBotAlias sets the BotAlias field's value. 1082func (s *DeleteSessionOutput) SetBotAlias(v string) *DeleteSessionOutput { 1083 s.BotAlias = &v 1084 return s 1085} 1086 1087// SetBotName sets the BotName field's value. 1088func (s *DeleteSessionOutput) SetBotName(v string) *DeleteSessionOutput { 1089 s.BotName = &v 1090 return s 1091} 1092 1093// SetSessionId sets the SessionId field's value. 1094func (s *DeleteSessionOutput) SetSessionId(v string) *DeleteSessionOutput { 1095 s.SessionId = &v 1096 return s 1097} 1098 1099// SetUserId sets the UserId field's value. 1100func (s *DeleteSessionOutput) SetUserId(v string) *DeleteSessionOutput { 1101 s.UserId = &v 1102 return s 1103} 1104 1105// One of the dependencies, such as AWS Lambda or Amazon Polly, threw an exception. 1106// For example, 1107// 1108// * If Amazon Lex does not have sufficient permissions to call a Lambda 1109// function. 1110// 1111// * If a Lambda function takes longer than 30 seconds to execute. 1112// 1113// * If a fulfillment Lambda function returns a Delegate dialog action without 1114// removing any slot values. 1115type DependencyFailedException struct { 1116 _ struct{} `type:"structure"` 1117 RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` 1118 1119 Message_ *string `locationName:"Message" type:"string"` 1120} 1121 1122// String returns the string representation 1123func (s DependencyFailedException) String() string { 1124 return awsutil.Prettify(s) 1125} 1126 1127// GoString returns the string representation 1128func (s DependencyFailedException) GoString() string { 1129 return s.String() 1130} 1131 1132func newErrorDependencyFailedException(v protocol.ResponseMetadata) error { 1133 return &DependencyFailedException{ 1134 RespMetadata: v, 1135 } 1136} 1137 1138// Code returns the exception type name. 1139func (s *DependencyFailedException) Code() string { 1140 return "DependencyFailedException" 1141} 1142 1143// Message returns the exception's message. 1144func (s *DependencyFailedException) Message() string { 1145 if s.Message_ != nil { 1146 return *s.Message_ 1147 } 1148 return "" 1149} 1150 1151// OrigErr always returns nil, satisfies awserr.Error interface. 1152func (s *DependencyFailedException) OrigErr() error { 1153 return nil 1154} 1155 1156func (s *DependencyFailedException) Error() string { 1157 return fmt.Sprintf("%s: %s", s.Code(), s.Message()) 1158} 1159 1160// Status code returns the HTTP status code for the request's response error. 1161func (s *DependencyFailedException) StatusCode() int { 1162 return s.RespMetadata.StatusCode 1163} 1164 1165// RequestID returns the service's response RequestID for request. 1166func (s *DependencyFailedException) RequestID() string { 1167 return s.RespMetadata.RequestID 1168} 1169 1170// Describes the next action that the bot should take in its interaction with 1171// the user and provides information about the context in which the action takes 1172// place. Use the DialogAction data type to set the interaction to a specific 1173// state, or to return the interaction to a previous state. 1174type DialogAction struct { 1175 _ struct{} `type:"structure"` 1176 1177 // The fulfillment state of the intent. The possible values are: 1178 // 1179 // * Failed - The Lambda function associated with the intent failed to fulfill 1180 // the intent. 1181 // 1182 // * Fulfilled - The intent has fulfilled by the Lambda function associated 1183 // with the intent. 1184 // 1185 // * ReadyForFulfillment - All of the information necessary for the intent 1186 // is present and the intent ready to be fulfilled by the client application. 1187 FulfillmentState *string `locationName:"fulfillmentState" type:"string" enum:"FulfillmentState"` 1188 1189 // The name of the intent. 1190 IntentName *string `locationName:"intentName" type:"string"` 1191 1192 // The message that should be shown to the user. If you don't specify a message, 1193 // Amazon Lex will use the message configured for the intent. 1194 Message *string `locationName:"message" min:"1" type:"string" sensitive:"true"` 1195 1196 // * PlainText - The message contains plain UTF-8 text. 1197 // 1198 // * CustomPayload - The message is a custom format for the client. 1199 // 1200 // * SSML - The message contains text formatted for voice output. 1201 // 1202 // * Composite - The message contains an escaped JSON object containing one 1203 // or more messages. For more information, see Message Groups (https://docs.aws.amazon.com/lex/latest/dg/howitworks-manage-prompts.html). 1204 MessageFormat *string `locationName:"messageFormat" type:"string" enum:"MessageFormatType"` 1205 1206 // The name of the slot that should be elicited from the user. 1207 SlotToElicit *string `locationName:"slotToElicit" type:"string"` 1208 1209 // Map of the slots that have been gathered and their values. 1210 Slots map[string]*string `locationName:"slots" type:"map" sensitive:"true"` 1211 1212 // The next action that the bot should take in its interaction with the user. 1213 // The possible values are: 1214 // 1215 // * ConfirmIntent - The next action is asking the user if the intent is 1216 // complete and ready to be fulfilled. This is a yes/no question such as 1217 // "Place the order?" 1218 // 1219 // * Close - Indicates that the there will not be a response from the user. 1220 // For example, the statement "Your order has been placed" does not require 1221 // a response. 1222 // 1223 // * Delegate - The next action is determined by Amazon Lex. 1224 // 1225 // * ElicitIntent - The next action is to determine the intent that the user 1226 // wants to fulfill. 1227 // 1228 // * ElicitSlot - The next action is to elicit a slot value from the user. 1229 // 1230 // Type is a required field 1231 Type *string `locationName:"type" type:"string" required:"true" enum:"DialogActionType"` 1232} 1233 1234// String returns the string representation 1235func (s DialogAction) String() string { 1236 return awsutil.Prettify(s) 1237} 1238 1239// GoString returns the string representation 1240func (s DialogAction) GoString() string { 1241 return s.String() 1242} 1243 1244// Validate inspects the fields of the type to determine if they are valid. 1245func (s *DialogAction) Validate() error { 1246 invalidParams := request.ErrInvalidParams{Context: "DialogAction"} 1247 if s.Message != nil && len(*s.Message) < 1 { 1248 invalidParams.Add(request.NewErrParamMinLen("Message", 1)) 1249 } 1250 if s.Type == nil { 1251 invalidParams.Add(request.NewErrParamRequired("Type")) 1252 } 1253 1254 if invalidParams.Len() > 0 { 1255 return invalidParams 1256 } 1257 return nil 1258} 1259 1260// SetFulfillmentState sets the FulfillmentState field's value. 1261func (s *DialogAction) SetFulfillmentState(v string) *DialogAction { 1262 s.FulfillmentState = &v 1263 return s 1264} 1265 1266// SetIntentName sets the IntentName field's value. 1267func (s *DialogAction) SetIntentName(v string) *DialogAction { 1268 s.IntentName = &v 1269 return s 1270} 1271 1272// SetMessage sets the Message field's value. 1273func (s *DialogAction) SetMessage(v string) *DialogAction { 1274 s.Message = &v 1275 return s 1276} 1277 1278// SetMessageFormat sets the MessageFormat field's value. 1279func (s *DialogAction) SetMessageFormat(v string) *DialogAction { 1280 s.MessageFormat = &v 1281 return s 1282} 1283 1284// SetSlotToElicit sets the SlotToElicit field's value. 1285func (s *DialogAction) SetSlotToElicit(v string) *DialogAction { 1286 s.SlotToElicit = &v 1287 return s 1288} 1289 1290// SetSlots sets the Slots field's value. 1291func (s *DialogAction) SetSlots(v map[string]*string) *DialogAction { 1292 s.Slots = v 1293 return s 1294} 1295 1296// SetType sets the Type field's value. 1297func (s *DialogAction) SetType(v string) *DialogAction { 1298 s.Type = &v 1299 return s 1300} 1301 1302// Represents an option rendered to the user when a prompt is shown. It could 1303// be an image, a button, a link, or text. 1304type GenericAttachment struct { 1305 _ struct{} `type:"structure"` 1306 1307 // The URL of an attachment to the response card. 1308 AttachmentLinkUrl *string `locationName:"attachmentLinkUrl" min:"1" type:"string"` 1309 1310 // The list of options to show to the user. 1311 Buttons []*Button `locationName:"buttons" type:"list"` 1312 1313 // The URL of an image that is displayed to the user. 1314 ImageUrl *string `locationName:"imageUrl" min:"1" type:"string"` 1315 1316 // The subtitle shown below the title. 1317 SubTitle *string `locationName:"subTitle" min:"1" type:"string"` 1318 1319 // The title of the option. 1320 Title *string `locationName:"title" min:"1" type:"string"` 1321} 1322 1323// String returns the string representation 1324func (s GenericAttachment) String() string { 1325 return awsutil.Prettify(s) 1326} 1327 1328// GoString returns the string representation 1329func (s GenericAttachment) GoString() string { 1330 return s.String() 1331} 1332 1333// SetAttachmentLinkUrl sets the AttachmentLinkUrl field's value. 1334func (s *GenericAttachment) SetAttachmentLinkUrl(v string) *GenericAttachment { 1335 s.AttachmentLinkUrl = &v 1336 return s 1337} 1338 1339// SetButtons sets the Buttons field's value. 1340func (s *GenericAttachment) SetButtons(v []*Button) *GenericAttachment { 1341 s.Buttons = v 1342 return s 1343} 1344 1345// SetImageUrl sets the ImageUrl field's value. 1346func (s *GenericAttachment) SetImageUrl(v string) *GenericAttachment { 1347 s.ImageUrl = &v 1348 return s 1349} 1350 1351// SetSubTitle sets the SubTitle field's value. 1352func (s *GenericAttachment) SetSubTitle(v string) *GenericAttachment { 1353 s.SubTitle = &v 1354 return s 1355} 1356 1357// SetTitle sets the Title field's value. 1358func (s *GenericAttachment) SetTitle(v string) *GenericAttachment { 1359 s.Title = &v 1360 return s 1361} 1362 1363type GetSessionInput struct { 1364 _ struct{} `type:"structure"` 1365 1366 // The alias in use for the bot that contains the session data. 1367 // 1368 // BotAlias is a required field 1369 BotAlias *string `location:"uri" locationName:"botAlias" type:"string" required:"true"` 1370 1371 // The name of the bot that contains the session data. 1372 // 1373 // BotName is a required field 1374 BotName *string `location:"uri" locationName:"botName" type:"string" required:"true"` 1375 1376 // A string used to filter the intents returned in the recentIntentSummaryView 1377 // structure. 1378 // 1379 // When you specify a filter, only intents with their checkpointLabel field 1380 // set to that string are returned. 1381 CheckpointLabelFilter *string `location:"querystring" locationName:"checkpointLabelFilter" min:"1" type:"string"` 1382 1383 // The ID of the client application user. Amazon Lex uses this to identify a 1384 // user's conversation with your bot. 1385 // 1386 // UserId is a required field 1387 UserId *string `location:"uri" locationName:"userId" min:"2" type:"string" required:"true"` 1388} 1389 1390// String returns the string representation 1391func (s GetSessionInput) String() string { 1392 return awsutil.Prettify(s) 1393} 1394 1395// GoString returns the string representation 1396func (s GetSessionInput) GoString() string { 1397 return s.String() 1398} 1399 1400// Validate inspects the fields of the type to determine if they are valid. 1401func (s *GetSessionInput) Validate() error { 1402 invalidParams := request.ErrInvalidParams{Context: "GetSessionInput"} 1403 if s.BotAlias == nil { 1404 invalidParams.Add(request.NewErrParamRequired("BotAlias")) 1405 } 1406 if s.BotAlias != nil && len(*s.BotAlias) < 1 { 1407 invalidParams.Add(request.NewErrParamMinLen("BotAlias", 1)) 1408 } 1409 if s.BotName == nil { 1410 invalidParams.Add(request.NewErrParamRequired("BotName")) 1411 } 1412 if s.BotName != nil && len(*s.BotName) < 1 { 1413 invalidParams.Add(request.NewErrParamMinLen("BotName", 1)) 1414 } 1415 if s.CheckpointLabelFilter != nil && len(*s.CheckpointLabelFilter) < 1 { 1416 invalidParams.Add(request.NewErrParamMinLen("CheckpointLabelFilter", 1)) 1417 } 1418 if s.UserId == nil { 1419 invalidParams.Add(request.NewErrParamRequired("UserId")) 1420 } 1421 if s.UserId != nil && len(*s.UserId) < 2 { 1422 invalidParams.Add(request.NewErrParamMinLen("UserId", 2)) 1423 } 1424 1425 if invalidParams.Len() > 0 { 1426 return invalidParams 1427 } 1428 return nil 1429} 1430 1431// SetBotAlias sets the BotAlias field's value. 1432func (s *GetSessionInput) SetBotAlias(v string) *GetSessionInput { 1433 s.BotAlias = &v 1434 return s 1435} 1436 1437// SetBotName sets the BotName field's value. 1438func (s *GetSessionInput) SetBotName(v string) *GetSessionInput { 1439 s.BotName = &v 1440 return s 1441} 1442 1443// SetCheckpointLabelFilter sets the CheckpointLabelFilter field's value. 1444func (s *GetSessionInput) SetCheckpointLabelFilter(v string) *GetSessionInput { 1445 s.CheckpointLabelFilter = &v 1446 return s 1447} 1448 1449// SetUserId sets the UserId field's value. 1450func (s *GetSessionInput) SetUserId(v string) *GetSessionInput { 1451 s.UserId = &v 1452 return s 1453} 1454 1455type GetSessionOutput struct { 1456 _ struct{} `type:"structure"` 1457 1458 // A list of active contexts for the session. A context can be set when an intent 1459 // is fulfilled or by calling the PostContent, PostText, or PutSession operation. 1460 // 1461 // You can use a context to control the intents that can follow up an intent, 1462 // or to modify the operation of your application. 1463 ActiveContexts []*ActiveContext `locationName:"activeContexts" type:"list" sensitive:"true"` 1464 1465 // Describes the current state of the bot. 1466 DialogAction *DialogAction `locationName:"dialogAction" type:"structure"` 1467 1468 // An array of information about the intents used in the session. The array 1469 // can contain a maximum of three summaries. If more than three intents are 1470 // used in the session, the recentIntentSummaryView operation contains information 1471 // about the last three intents used. 1472 // 1473 // If you set the checkpointLabelFilter parameter in the request, the array 1474 // contains only the intents with the specified label. 1475 RecentIntentSummaryView []*IntentSummary `locationName:"recentIntentSummaryView" type:"list"` 1476 1477 // Map of key/value pairs representing the session-specific context information. 1478 // It contains application information passed between Amazon Lex and a client 1479 // application. 1480 SessionAttributes map[string]*string `locationName:"sessionAttributes" type:"map" sensitive:"true"` 1481 1482 // A unique identifier for the session. 1483 SessionId *string `locationName:"sessionId" type:"string"` 1484} 1485 1486// String returns the string representation 1487func (s GetSessionOutput) String() string { 1488 return awsutil.Prettify(s) 1489} 1490 1491// GoString returns the string representation 1492func (s GetSessionOutput) GoString() string { 1493 return s.String() 1494} 1495 1496// SetActiveContexts sets the ActiveContexts field's value. 1497func (s *GetSessionOutput) SetActiveContexts(v []*ActiveContext) *GetSessionOutput { 1498 s.ActiveContexts = v 1499 return s 1500} 1501 1502// SetDialogAction sets the DialogAction field's value. 1503func (s *GetSessionOutput) SetDialogAction(v *DialogAction) *GetSessionOutput { 1504 s.DialogAction = v 1505 return s 1506} 1507 1508// SetRecentIntentSummaryView sets the RecentIntentSummaryView field's value. 1509func (s *GetSessionOutput) SetRecentIntentSummaryView(v []*IntentSummary) *GetSessionOutput { 1510 s.RecentIntentSummaryView = v 1511 return s 1512} 1513 1514// SetSessionAttributes sets the SessionAttributes field's value. 1515func (s *GetSessionOutput) SetSessionAttributes(v map[string]*string) *GetSessionOutput { 1516 s.SessionAttributes = v 1517 return s 1518} 1519 1520// SetSessionId sets the SessionId field's value. 1521func (s *GetSessionOutput) SetSessionId(v string) *GetSessionOutput { 1522 s.SessionId = &v 1523 return s 1524} 1525 1526// Provides a score that indicates the confidence that Amazon Lex has that an 1527// intent is the one that satisfies the user's intent. 1528type IntentConfidence struct { 1529 _ struct{} `type:"structure"` 1530 1531 // A score that indicates how confident Amazon Lex is that an intent satisfies 1532 // the user's intent. Ranges between 0.00 and 1.00. Higher scores indicate higher 1533 // confidence. 1534 Score *float64 `locationName:"score" type:"double"` 1535} 1536 1537// String returns the string representation 1538func (s IntentConfidence) String() string { 1539 return awsutil.Prettify(s) 1540} 1541 1542// GoString returns the string representation 1543func (s IntentConfidence) GoString() string { 1544 return s.String() 1545} 1546 1547// SetScore sets the Score field's value. 1548func (s *IntentConfidence) SetScore(v float64) *IntentConfidence { 1549 s.Score = &v 1550 return s 1551} 1552 1553// Provides information about the state of an intent. You can use this information 1554// to get the current state of an intent so that you can process the intent, 1555// or so that you can return the intent to its previous state. 1556type IntentSummary struct { 1557 _ struct{} `type:"structure"` 1558 1559 // A user-defined label that identifies a particular intent. You can use this 1560 // label to return to a previous intent. 1561 // 1562 // Use the checkpointLabelFilter parameter of the GetSessionRequest operation 1563 // to filter the intents returned by the operation to those with only the specified 1564 // label. 1565 CheckpointLabel *string `locationName:"checkpointLabel" min:"1" type:"string"` 1566 1567 // The status of the intent after the user responds to the confirmation prompt. 1568 // If the user confirms the intent, Amazon Lex sets this field to Confirmed. 1569 // If the user denies the intent, Amazon Lex sets this value to Denied. The 1570 // possible values are: 1571 // 1572 // * Confirmed - The user has responded "Yes" to the confirmation prompt, 1573 // confirming that the intent is complete and that it is ready to be fulfilled. 1574 // 1575 // * Denied - The user has responded "No" to the confirmation prompt. 1576 // 1577 // * None - The user has never been prompted for confirmation; or, the user 1578 // was prompted but did not confirm or deny the prompt. 1579 ConfirmationStatus *string `locationName:"confirmationStatus" type:"string" enum:"ConfirmationStatus"` 1580 1581 // The next action that the bot should take in its interaction with the user. 1582 // The possible values are: 1583 // 1584 // * ConfirmIntent - The next action is asking the user if the intent is 1585 // complete and ready to be fulfilled. This is a yes/no question such as 1586 // "Place the order?" 1587 // 1588 // * Close - Indicates that the there will not be a response from the user. 1589 // For example, the statement "Your order has been placed" does not require 1590 // a response. 1591 // 1592 // * ElicitIntent - The next action is to determine the intent that the user 1593 // wants to fulfill. 1594 // 1595 // * ElicitSlot - The next action is to elicit a slot value from the user. 1596 // 1597 // DialogActionType is a required field 1598 DialogActionType *string `locationName:"dialogActionType" type:"string" required:"true" enum:"DialogActionType"` 1599 1600 // The fulfillment state of the intent. The possible values are: 1601 // 1602 // * Failed - The Lambda function associated with the intent failed to fulfill 1603 // the intent. 1604 // 1605 // * Fulfilled - The intent has fulfilled by the Lambda function associated 1606 // with the intent. 1607 // 1608 // * ReadyForFulfillment - All of the information necessary for the intent 1609 // is present and the intent ready to be fulfilled by the client application. 1610 FulfillmentState *string `locationName:"fulfillmentState" type:"string" enum:"FulfillmentState"` 1611 1612 // The name of the intent. 1613 IntentName *string `locationName:"intentName" type:"string"` 1614 1615 // The next slot to elicit from the user. If there is not slot to elicit, the 1616 // field is blank. 1617 SlotToElicit *string `locationName:"slotToElicit" type:"string"` 1618 1619 // Map of the slots that have been gathered and their values. 1620 Slots map[string]*string `locationName:"slots" type:"map" sensitive:"true"` 1621} 1622 1623// String returns the string representation 1624func (s IntentSummary) String() string { 1625 return awsutil.Prettify(s) 1626} 1627 1628// GoString returns the string representation 1629func (s IntentSummary) GoString() string { 1630 return s.String() 1631} 1632 1633// Validate inspects the fields of the type to determine if they are valid. 1634func (s *IntentSummary) Validate() error { 1635 invalidParams := request.ErrInvalidParams{Context: "IntentSummary"} 1636 if s.CheckpointLabel != nil && len(*s.CheckpointLabel) < 1 { 1637 invalidParams.Add(request.NewErrParamMinLen("CheckpointLabel", 1)) 1638 } 1639 if s.DialogActionType == nil { 1640 invalidParams.Add(request.NewErrParamRequired("DialogActionType")) 1641 } 1642 1643 if invalidParams.Len() > 0 { 1644 return invalidParams 1645 } 1646 return nil 1647} 1648 1649// SetCheckpointLabel sets the CheckpointLabel field's value. 1650func (s *IntentSummary) SetCheckpointLabel(v string) *IntentSummary { 1651 s.CheckpointLabel = &v 1652 return s 1653} 1654 1655// SetConfirmationStatus sets the ConfirmationStatus field's value. 1656func (s *IntentSummary) SetConfirmationStatus(v string) *IntentSummary { 1657 s.ConfirmationStatus = &v 1658 return s 1659} 1660 1661// SetDialogActionType sets the DialogActionType field's value. 1662func (s *IntentSummary) SetDialogActionType(v string) *IntentSummary { 1663 s.DialogActionType = &v 1664 return s 1665} 1666 1667// SetFulfillmentState sets the FulfillmentState field's value. 1668func (s *IntentSummary) SetFulfillmentState(v string) *IntentSummary { 1669 s.FulfillmentState = &v 1670 return s 1671} 1672 1673// SetIntentName sets the IntentName field's value. 1674func (s *IntentSummary) SetIntentName(v string) *IntentSummary { 1675 s.IntentName = &v 1676 return s 1677} 1678 1679// SetSlotToElicit sets the SlotToElicit field's value. 1680func (s *IntentSummary) SetSlotToElicit(v string) *IntentSummary { 1681 s.SlotToElicit = &v 1682 return s 1683} 1684 1685// SetSlots sets the Slots field's value. 1686func (s *IntentSummary) SetSlots(v map[string]*string) *IntentSummary { 1687 s.Slots = v 1688 return s 1689} 1690 1691// Internal service error. Retry the call. 1692type InternalFailureException struct { 1693 _ struct{} `type:"structure"` 1694 RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` 1695 1696 Message_ *string `locationName:"message" type:"string"` 1697} 1698 1699// String returns the string representation 1700func (s InternalFailureException) String() string { 1701 return awsutil.Prettify(s) 1702} 1703 1704// GoString returns the string representation 1705func (s InternalFailureException) GoString() string { 1706 return s.String() 1707} 1708 1709func newErrorInternalFailureException(v protocol.ResponseMetadata) error { 1710 return &InternalFailureException{ 1711 RespMetadata: v, 1712 } 1713} 1714 1715// Code returns the exception type name. 1716func (s *InternalFailureException) Code() string { 1717 return "InternalFailureException" 1718} 1719 1720// Message returns the exception's message. 1721func (s *InternalFailureException) Message() string { 1722 if s.Message_ != nil { 1723 return *s.Message_ 1724 } 1725 return "" 1726} 1727 1728// OrigErr always returns nil, satisfies awserr.Error interface. 1729func (s *InternalFailureException) OrigErr() error { 1730 return nil 1731} 1732 1733func (s *InternalFailureException) Error() string { 1734 return fmt.Sprintf("%s: %s", s.Code(), s.Message()) 1735} 1736 1737// Status code returns the HTTP status code for the request's response error. 1738func (s *InternalFailureException) StatusCode() int { 1739 return s.RespMetadata.StatusCode 1740} 1741 1742// RequestID returns the service's response RequestID for request. 1743func (s *InternalFailureException) RequestID() string { 1744 return s.RespMetadata.RequestID 1745} 1746 1747// Exceeded a limit. 1748type LimitExceededException struct { 1749 _ struct{} `type:"structure"` 1750 RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` 1751 1752 Message_ *string `locationName:"message" type:"string"` 1753 1754 RetryAfterSeconds *string `location:"header" locationName:"Retry-After" type:"string"` 1755} 1756 1757// String returns the string representation 1758func (s LimitExceededException) String() string { 1759 return awsutil.Prettify(s) 1760} 1761 1762// GoString returns the string representation 1763func (s LimitExceededException) GoString() string { 1764 return s.String() 1765} 1766 1767func newErrorLimitExceededException(v protocol.ResponseMetadata) error { 1768 return &LimitExceededException{ 1769 RespMetadata: v, 1770 } 1771} 1772 1773// Code returns the exception type name. 1774func (s *LimitExceededException) Code() string { 1775 return "LimitExceededException" 1776} 1777 1778// Message returns the exception's message. 1779func (s *LimitExceededException) Message() string { 1780 if s.Message_ != nil { 1781 return *s.Message_ 1782 } 1783 return "" 1784} 1785 1786// OrigErr always returns nil, satisfies awserr.Error interface. 1787func (s *LimitExceededException) OrigErr() error { 1788 return nil 1789} 1790 1791func (s *LimitExceededException) Error() string { 1792 return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) 1793} 1794 1795// Status code returns the HTTP status code for the request's response error. 1796func (s *LimitExceededException) StatusCode() int { 1797 return s.RespMetadata.StatusCode 1798} 1799 1800// RequestID returns the service's response RequestID for request. 1801func (s *LimitExceededException) RequestID() string { 1802 return s.RespMetadata.RequestID 1803} 1804 1805// This exception is not used. 1806type LoopDetectedException struct { 1807 _ struct{} `type:"structure"` 1808 RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` 1809 1810 Message_ *string `locationName:"Message" type:"string"` 1811} 1812 1813// String returns the string representation 1814func (s LoopDetectedException) String() string { 1815 return awsutil.Prettify(s) 1816} 1817 1818// GoString returns the string representation 1819func (s LoopDetectedException) GoString() string { 1820 return s.String() 1821} 1822 1823func newErrorLoopDetectedException(v protocol.ResponseMetadata) error { 1824 return &LoopDetectedException{ 1825 RespMetadata: v, 1826 } 1827} 1828 1829// Code returns the exception type name. 1830func (s *LoopDetectedException) Code() string { 1831 return "LoopDetectedException" 1832} 1833 1834// Message returns the exception's message. 1835func (s *LoopDetectedException) Message() string { 1836 if s.Message_ != nil { 1837 return *s.Message_ 1838 } 1839 return "" 1840} 1841 1842// OrigErr always returns nil, satisfies awserr.Error interface. 1843func (s *LoopDetectedException) OrigErr() error { 1844 return nil 1845} 1846 1847func (s *LoopDetectedException) Error() string { 1848 return fmt.Sprintf("%s: %s", s.Code(), s.Message()) 1849} 1850 1851// Status code returns the HTTP status code for the request's response error. 1852func (s *LoopDetectedException) StatusCode() int { 1853 return s.RespMetadata.StatusCode 1854} 1855 1856// RequestID returns the service's response RequestID for request. 1857func (s *LoopDetectedException) RequestID() string { 1858 return s.RespMetadata.RequestID 1859} 1860 1861// The accept header in the request does not have a valid value. 1862type NotAcceptableException struct { 1863 _ struct{} `type:"structure"` 1864 RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` 1865 1866 Message_ *string `locationName:"message" type:"string"` 1867} 1868 1869// String returns the string representation 1870func (s NotAcceptableException) String() string { 1871 return awsutil.Prettify(s) 1872} 1873 1874// GoString returns the string representation 1875func (s NotAcceptableException) GoString() string { 1876 return s.String() 1877} 1878 1879func newErrorNotAcceptableException(v protocol.ResponseMetadata) error { 1880 return &NotAcceptableException{ 1881 RespMetadata: v, 1882 } 1883} 1884 1885// Code returns the exception type name. 1886func (s *NotAcceptableException) Code() string { 1887 return "NotAcceptableException" 1888} 1889 1890// Message returns the exception's message. 1891func (s *NotAcceptableException) Message() string { 1892 if s.Message_ != nil { 1893 return *s.Message_ 1894 } 1895 return "" 1896} 1897 1898// OrigErr always returns nil, satisfies awserr.Error interface. 1899func (s *NotAcceptableException) OrigErr() error { 1900 return nil 1901} 1902 1903func (s *NotAcceptableException) Error() string { 1904 return fmt.Sprintf("%s: %s", s.Code(), s.Message()) 1905} 1906 1907// Status code returns the HTTP status code for the request's response error. 1908func (s *NotAcceptableException) StatusCode() int { 1909 return s.RespMetadata.StatusCode 1910} 1911 1912// RequestID returns the service's response RequestID for request. 1913func (s *NotAcceptableException) RequestID() string { 1914 return s.RespMetadata.RequestID 1915} 1916 1917// The resource (such as the Amazon Lex bot or an alias) that is referred to 1918// is not found. 1919type NotFoundException struct { 1920 _ struct{} `type:"structure"` 1921 RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` 1922 1923 Message_ *string `locationName:"message" type:"string"` 1924} 1925 1926// String returns the string representation 1927func (s NotFoundException) String() string { 1928 return awsutil.Prettify(s) 1929} 1930 1931// GoString returns the string representation 1932func (s NotFoundException) GoString() string { 1933 return s.String() 1934} 1935 1936func newErrorNotFoundException(v protocol.ResponseMetadata) error { 1937 return &NotFoundException{ 1938 RespMetadata: v, 1939 } 1940} 1941 1942// Code returns the exception type name. 1943func (s *NotFoundException) Code() string { 1944 return "NotFoundException" 1945} 1946 1947// Message returns the exception's message. 1948func (s *NotFoundException) Message() string { 1949 if s.Message_ != nil { 1950 return *s.Message_ 1951 } 1952 return "" 1953} 1954 1955// OrigErr always returns nil, satisfies awserr.Error interface. 1956func (s *NotFoundException) OrigErr() error { 1957 return nil 1958} 1959 1960func (s *NotFoundException) Error() string { 1961 return fmt.Sprintf("%s: %s", s.Code(), s.Message()) 1962} 1963 1964// Status code returns the HTTP status code for the request's response error. 1965func (s *NotFoundException) StatusCode() int { 1966 return s.RespMetadata.StatusCode 1967} 1968 1969// RequestID returns the service's response RequestID for request. 1970func (s *NotFoundException) RequestID() string { 1971 return s.RespMetadata.RequestID 1972} 1973 1974type PostContentInput struct { 1975 _ struct{} `type:"structure" payload:"InputStream"` 1976 1977 // You pass this value as the Accept HTTP header. 1978 // 1979 // The message Amazon Lex returns in the response can be either text or speech 1980 // based on the Accept HTTP header value in the request. 1981 // 1982 // * If the value is text/plain; charset=utf-8, Amazon Lex returns text in 1983 // the response. 1984 // 1985 // * If the value begins with audio/, Amazon Lex returns speech in the response. 1986 // Amazon Lex uses Amazon Polly to generate the speech (using the configuration 1987 // you specified in the Accept header). For example, if you specify audio/mpeg 1988 // as the value, Amazon Lex returns speech in the MPEG format. 1989 // 1990 // * If the value is audio/pcm, the speech returned is audio/pcm in 16-bit, 1991 // little endian format. 1992 // 1993 // * The following are the accepted values: audio/mpeg audio/ogg audio/pcm 1994 // text/plain; charset=utf-8 audio/* (defaults to mpeg) 1995 Accept *string `location:"header" locationName:"Accept" type:"string"` 1996 1997 // A list of contexts active for the request. A context can be activated when 1998 // a previous intent is fulfilled, or by including the context in the request, 1999 // 2000 // If you don't specify a list of contexts, Amazon Lex will use the current 2001 // list of contexts for the session. If you specify an empty list, all contexts 2002 // for the session are cleared. 2003 ActiveContexts aws.JSONValue `location:"header" locationName:"x-amz-lex-active-contexts" type:"jsonvalue"` 2004 2005 // Alias of the Amazon Lex bot. 2006 // 2007 // BotAlias is a required field 2008 BotAlias *string `location:"uri" locationName:"botAlias" type:"string" required:"true"` 2009 2010 // Name of the Amazon Lex bot. 2011 // 2012 // BotName is a required field 2013 BotName *string `location:"uri" locationName:"botName" type:"string" required:"true"` 2014 2015 // You pass this value as the Content-Type HTTP header. 2016 // 2017 // Indicates the audio format or text. The header value must start with one 2018 // of the following prefixes: 2019 // 2020 // * PCM format, audio data must be in little-endian byte order. audio/l16; 2021 // rate=16000; channels=1 audio/x-l16; sample-rate=16000; channel-count=1 2022 // audio/lpcm; sample-rate=8000; sample-size-bits=16; channel-count=1; is-big-endian=false 2023 // 2024 // * Opus format audio/x-cbr-opus-with-preamble; preamble-size=0; bit-rate=256000; 2025 // frame-size-milliseconds=4 2026 // 2027 // * Text format text/plain; charset=utf-8 2028 // 2029 // ContentType is a required field 2030 ContentType *string `location:"header" locationName:"Content-Type" type:"string" required:"true"` 2031 2032 // User input in PCM or Opus audio format or text format as described in the 2033 // Content-Type HTTP header. 2034 // 2035 // You can stream audio data to Amazon Lex or you can create a local buffer 2036 // that captures all of the audio data before sending. In general, you get better 2037 // performance if you stream audio data rather than buffering the data locally. 2038 // 2039 // To use an non-seekable io.Reader for this request wrap the io.Reader with 2040 // "aws.ReadSeekCloser". The SDK will not retry request errors for non-seekable 2041 // readers. This will allow the SDK to send the reader's payload as chunked 2042 // transfer encoding. 2043 // 2044 // InputStream is a required field 2045 InputStream io.ReadSeeker `locationName:"inputStream" type:"blob" required:"true"` 2046 2047 // You pass this value as the x-amz-lex-request-attributes HTTP header. 2048 // 2049 // Request-specific information passed between Amazon Lex and a client application. 2050 // The value must be a JSON serialized and base64 encoded map with string keys 2051 // and values. The total size of the requestAttributes and sessionAttributes 2052 // headers is limited to 12 KB. 2053 // 2054 // The namespace x-amz-lex: is reserved for special attributes. Don't create 2055 // any request attributes with the prefix x-amz-lex:. 2056 // 2057 // For more information, see Setting Request Attributes (https://docs.aws.amazon.com/lex/latest/dg/context-mgmt.html#context-mgmt-request-attribs). 2058 RequestAttributes aws.JSONValue `location:"header" locationName:"x-amz-lex-request-attributes" type:"jsonvalue"` 2059 2060 // You pass this value as the x-amz-lex-session-attributes HTTP header. 2061 // 2062 // Application-specific information passed between Amazon Lex and a client application. 2063 // The value must be a JSON serialized and base64 encoded map with string keys 2064 // and values. The total size of the sessionAttributes and requestAttributes 2065 // headers is limited to 12 KB. 2066 // 2067 // For more information, see Setting Session Attributes (https://docs.aws.amazon.com/lex/latest/dg/context-mgmt.html#context-mgmt-session-attribs). 2068 SessionAttributes aws.JSONValue `location:"header" locationName:"x-amz-lex-session-attributes" type:"jsonvalue"` 2069 2070 // The ID of the client application user. Amazon Lex uses this to identify a 2071 // user's conversation with your bot. At runtime, each request must contain 2072 // the userID field. 2073 // 2074 // To decide the user ID to use for your application, consider the following 2075 // factors. 2076 // 2077 // * The userID field must not contain any personally identifiable information 2078 // of the user, for example, name, personal identification numbers, or other 2079 // end user personal information. 2080 // 2081 // * If you want a user to start a conversation on one device and continue 2082 // on another device, use a user-specific identifier. 2083 // 2084 // * If you want the same user to be able to have two independent conversations 2085 // on two different devices, choose a device-specific identifier. 2086 // 2087 // * A user can't have two independent conversations with two different versions 2088 // of the same bot. For example, a user can't have a conversation with the 2089 // PROD and BETA versions of the same bot. If you anticipate that a user 2090 // will need to have conversation with two different versions, for example, 2091 // while testing, include the bot alias in the user ID to separate the two 2092 // conversations. 2093 // 2094 // UserId is a required field 2095 UserId *string `location:"uri" locationName:"userId" min:"2" type:"string" required:"true"` 2096} 2097 2098// String returns the string representation 2099func (s PostContentInput) String() string { 2100 return awsutil.Prettify(s) 2101} 2102 2103// GoString returns the string representation 2104func (s PostContentInput) GoString() string { 2105 return s.String() 2106} 2107 2108// Validate inspects the fields of the type to determine if they are valid. 2109func (s *PostContentInput) Validate() error { 2110 invalidParams := request.ErrInvalidParams{Context: "PostContentInput"} 2111 if s.BotAlias == nil { 2112 invalidParams.Add(request.NewErrParamRequired("BotAlias")) 2113 } 2114 if s.BotAlias != nil && len(*s.BotAlias) < 1 { 2115 invalidParams.Add(request.NewErrParamMinLen("BotAlias", 1)) 2116 } 2117 if s.BotName == nil { 2118 invalidParams.Add(request.NewErrParamRequired("BotName")) 2119 } 2120 if s.BotName != nil && len(*s.BotName) < 1 { 2121 invalidParams.Add(request.NewErrParamMinLen("BotName", 1)) 2122 } 2123 if s.ContentType == nil { 2124 invalidParams.Add(request.NewErrParamRequired("ContentType")) 2125 } 2126 if s.InputStream == nil { 2127 invalidParams.Add(request.NewErrParamRequired("InputStream")) 2128 } 2129 if s.UserId == nil { 2130 invalidParams.Add(request.NewErrParamRequired("UserId")) 2131 } 2132 if s.UserId != nil && len(*s.UserId) < 2 { 2133 invalidParams.Add(request.NewErrParamMinLen("UserId", 2)) 2134 } 2135 2136 if invalidParams.Len() > 0 { 2137 return invalidParams 2138 } 2139 return nil 2140} 2141 2142// SetAccept sets the Accept field's value. 2143func (s *PostContentInput) SetAccept(v string) *PostContentInput { 2144 s.Accept = &v 2145 return s 2146} 2147 2148// SetActiveContexts sets the ActiveContexts field's value. 2149func (s *PostContentInput) SetActiveContexts(v aws.JSONValue) *PostContentInput { 2150 s.ActiveContexts = v 2151 return s 2152} 2153 2154// SetBotAlias sets the BotAlias field's value. 2155func (s *PostContentInput) SetBotAlias(v string) *PostContentInput { 2156 s.BotAlias = &v 2157 return s 2158} 2159 2160// SetBotName sets the BotName field's value. 2161func (s *PostContentInput) SetBotName(v string) *PostContentInput { 2162 s.BotName = &v 2163 return s 2164} 2165 2166// SetContentType sets the ContentType field's value. 2167func (s *PostContentInput) SetContentType(v string) *PostContentInput { 2168 s.ContentType = &v 2169 return s 2170} 2171 2172// SetInputStream sets the InputStream field's value. 2173func (s *PostContentInput) SetInputStream(v io.ReadSeeker) *PostContentInput { 2174 s.InputStream = v 2175 return s 2176} 2177 2178// SetRequestAttributes sets the RequestAttributes field's value. 2179func (s *PostContentInput) SetRequestAttributes(v aws.JSONValue) *PostContentInput { 2180 s.RequestAttributes = v 2181 return s 2182} 2183 2184// SetSessionAttributes sets the SessionAttributes field's value. 2185func (s *PostContentInput) SetSessionAttributes(v aws.JSONValue) *PostContentInput { 2186 s.SessionAttributes = v 2187 return s 2188} 2189 2190// SetUserId sets the UserId field's value. 2191func (s *PostContentInput) SetUserId(v string) *PostContentInput { 2192 s.UserId = &v 2193 return s 2194} 2195 2196type PostContentOutput struct { 2197 _ struct{} `type:"structure" payload:"AudioStream"` 2198 2199 // A list of active contexts for the session. A context can be set when an intent 2200 // is fulfilled or by calling the PostContent, PostText, or PutSession operation. 2201 // 2202 // You can use a context to control the intents that can follow up an intent, 2203 // or to modify the operation of your application. 2204 ActiveContexts aws.JSONValue `location:"header" locationName:"x-amz-lex-active-contexts" type:"jsonvalue"` 2205 2206 // One to four alternative intents that may be applicable to the user's intent. 2207 // 2208 // Each alternative includes a score that indicates how confident Amazon Lex 2209 // is that the intent matches the user's intent. The intents are sorted by the 2210 // confidence score. 2211 AlternativeIntents aws.JSONValue `location:"header" locationName:"x-amz-lex-alternative-intents" type:"jsonvalue"` 2212 2213 // The prompt (or statement) to convey to the user. This is based on the bot 2214 // configuration and context. For example, if Amazon Lex did not understand 2215 // the user intent, it sends the clarificationPrompt configured for the bot. 2216 // If the intent requires confirmation before taking the fulfillment action, 2217 // it sends the confirmationPrompt. Another example: Suppose that the Lambda 2218 // function successfully fulfilled the intent, and sent a message to convey 2219 // to the user. Then Amazon Lex sends that message in the response. 2220 AudioStream io.ReadCloser `locationName:"audioStream" type:"blob"` 2221 2222 // The version of the bot that responded to the conversation. You can use this 2223 // information to help determine if one version of a bot is performing better 2224 // than another version. 2225 BotVersion *string `location:"header" locationName:"x-amz-lex-bot-version" min:"1" type:"string"` 2226 2227 // Content type as specified in the Accept HTTP header in the request. 2228 ContentType *string `location:"header" locationName:"Content-Type" type:"string"` 2229 2230 // Identifies the current state of the user interaction. Amazon Lex returns 2231 // one of the following values as dialogState. The client can optionally use 2232 // this information to customize the user interface. 2233 // 2234 // * ElicitIntent - Amazon Lex wants to elicit the user's intent. Consider 2235 // the following examples: For example, a user might utter an intent ("I 2236 // want to order a pizza"). If Amazon Lex cannot infer the user intent from 2237 // this utterance, it will return this dialog state. 2238 // 2239 // * ConfirmIntent - Amazon Lex is expecting a "yes" or "no" response. For 2240 // example, Amazon Lex wants user confirmation before fulfilling an intent. 2241 // Instead of a simple "yes" or "no" response, a user might respond with 2242 // additional information. For example, "yes, but make it a thick crust pizza" 2243 // or "no, I want to order a drink." Amazon Lex can process such additional 2244 // information (in these examples, update the crust type slot or change the 2245 // intent from OrderPizza to OrderDrink). 2246 // 2247 // * ElicitSlot - Amazon Lex is expecting the value of a slot for the current 2248 // intent. For example, suppose that in the response Amazon Lex sends this 2249 // message: "What size pizza would you like?". A user might reply with the 2250 // slot value (e.g., "medium"). The user might also provide additional information 2251 // in the response (e.g., "medium thick crust pizza"). Amazon Lex can process 2252 // such additional information appropriately. 2253 // 2254 // * Fulfilled - Conveys that the Lambda function has successfully fulfilled 2255 // the intent. 2256 // 2257 // * ReadyForFulfillment - Conveys that the client has to fulfill the request. 2258 // 2259 // * Failed - Conveys that the conversation with the user failed. This can 2260 // happen for various reasons, including that the user does not provide an 2261 // appropriate response to prompts from the service (you can configure how 2262 // many times Amazon Lex can prompt a user for specific information), or 2263 // if the Lambda function fails to fulfill the intent. 2264 DialogState *string `location:"header" locationName:"x-amz-lex-dialog-state" type:"string" enum:"DialogState"` 2265 2266 // The text used to process the request. 2267 // 2268 // If the input was an audio stream, the encodedInputTranscript field contains 2269 // the text extracted from the audio stream. This is the text that is actually 2270 // processed to recognize intents and slot values. You can use this information 2271 // to determine if Amazon Lex is correctly processing the audio that you send. 2272 // 2273 // The encodedInputTranscript field is base-64 encoded. You must decode the 2274 // field before you can use the value. 2275 EncodedInputTranscript *string `location:"header" locationName:"x-amz-lex-encoded-input-transcript" type:"string" sensitive:"true"` 2276 2277 // The message to convey to the user. The message can come from the bot's configuration 2278 // or from a Lambda function. 2279 // 2280 // If the intent is not configured with a Lambda function, or if the Lambda 2281 // function returned Delegate as the dialogAction.type in its response, Amazon 2282 // Lex decides on the next course of action and selects an appropriate message 2283 // from the bot's configuration based on the current interaction context. For 2284 // example, if Amazon Lex isn't able to understand user input, it uses a clarification 2285 // prompt message. 2286 // 2287 // When you create an intent you can assign messages to groups. When messages 2288 // are assigned to groups Amazon Lex returns one message from each group in 2289 // the response. The message field is an escaped JSON string containing the 2290 // messages. For more information about the structure of the JSON string returned, 2291 // see msg-prompts-formats. 2292 // 2293 // If the Lambda function returns a message, Amazon Lex passes it to the client 2294 // in its response. 2295 // 2296 // The encodedMessage field is base-64 encoded. You must decode the field before 2297 // you can use the value. 2298 EncodedMessage *string `location:"header" locationName:"x-amz-lex-encoded-message" min:"1" type:"string" sensitive:"true"` 2299 2300 // The text used to process the request. 2301 // 2302 // You can use this field only in the de-DE, en-AU, en-GB, en-US, es-419, es-ES, 2303 // es-US, fr-CA, fr-FR, and it-IT locales. In all other locales, the inputTranscript 2304 // field is null. You should use the encodedInputTranscript field instead. 2305 // 2306 // If the input was an audio stream, the inputTranscript field contains the 2307 // text extracted from the audio stream. This is the text that is actually processed 2308 // to recognize intents and slot values. You can use this information to determine 2309 // if Amazon Lex is correctly processing the audio that you send. 2310 // 2311 // Deprecated: The inputTranscript field is deprecated, use the encodedInputTranscript field instead. The inputTranscript field is available only in the de-DE, en-AU, en-GB, en-US, es-419, es-ES, es-US, fr-CA, fr-FR and it-IT locales. 2312 InputTranscript *string `location:"header" locationName:"x-amz-lex-input-transcript" deprecated:"true" type:"string"` 2313 2314 // Current user intent that Amazon Lex is aware of. 2315 IntentName *string `location:"header" locationName:"x-amz-lex-intent-name" type:"string"` 2316 2317 // You can only use this field in the de-DE, en-AU, en-GB, en-US, es-419, es-ES, 2318 // es-US, fr-CA, fr-FR, and it-IT locales. In all other locales, the message 2319 // field is null. You should use the encodedMessage field instead. 2320 // 2321 // The message to convey to the user. The message can come from the bot's configuration 2322 // or from a Lambda function. 2323 // 2324 // If the intent is not configured with a Lambda function, or if the Lambda 2325 // function returned Delegate as the dialogAction.type in its response, Amazon 2326 // Lex decides on the next course of action and selects an appropriate message 2327 // from the bot's configuration based on the current interaction context. For 2328 // example, if Amazon Lex isn't able to understand user input, it uses a clarification 2329 // prompt message. 2330 // 2331 // When you create an intent you can assign messages to groups. When messages 2332 // are assigned to groups Amazon Lex returns one message from each group in 2333 // the response. The message field is an escaped JSON string containing the 2334 // messages. For more information about the structure of the JSON string returned, 2335 // see msg-prompts-formats. 2336 // 2337 // If the Lambda function returns a message, Amazon Lex passes it to the client 2338 // in its response. 2339 // 2340 // Deprecated: The message field is deprecated, use the encodedMessage field instead. The message field is available only in the de-DE, en-AU, en-GB, en-US, es-419, es-ES, es-US, fr-CA, fr-FR and it-IT locales. 2341 Message *string `location:"header" locationName:"x-amz-lex-message" min:"1" deprecated:"true" type:"string" sensitive:"true"` 2342 2343 // The format of the response message. One of the following values: 2344 // 2345 // * PlainText - The message contains plain UTF-8 text. 2346 // 2347 // * CustomPayload - The message is a custom format for the client. 2348 // 2349 // * SSML - The message contains text formatted for voice output. 2350 // 2351 // * Composite - The message contains an escaped JSON object containing one 2352 // or more messages from the groups that messages were assigned to when the 2353 // intent was created. 2354 MessageFormat *string `location:"header" locationName:"x-amz-lex-message-format" type:"string" enum:"MessageFormatType"` 2355 2356 // Provides a score that indicates how confident Amazon Lex is that the returned 2357 // intent is the one that matches the user's intent. The score is between 0.0 2358 // and 1.0. 2359 // 2360 // The score is a relative score, not an absolute score. The score may change 2361 // based on improvements to Amazon Lex. 2362 NluIntentConfidence aws.JSONValue `location:"header" locationName:"x-amz-lex-nlu-intent-confidence" type:"jsonvalue"` 2363 2364 // The sentiment expressed in an utterance. 2365 // 2366 // When the bot is configured to send utterances to Amazon Comprehend for sentiment 2367 // analysis, this field contains the result of the analysis. 2368 SentimentResponse *string `location:"header" locationName:"x-amz-lex-sentiment" type:"string"` 2369 2370 // Map of key/value pairs representing the session-specific context information. 2371 SessionAttributes aws.JSONValue `location:"header" locationName:"x-amz-lex-session-attributes" type:"jsonvalue"` 2372 2373 // The unique identifier for the session. 2374 SessionId *string `location:"header" locationName:"x-amz-lex-session-id" type:"string"` 2375 2376 // If the dialogState value is ElicitSlot, returns the name of the slot for 2377 // which Amazon Lex is eliciting a value. 2378 SlotToElicit *string `location:"header" locationName:"x-amz-lex-slot-to-elicit" type:"string"` 2379 2380 // Map of zero or more intent slots (name/value pairs) Amazon Lex detected from 2381 // the user input during the conversation. The field is base-64 encoded. 2382 // 2383 // Amazon Lex creates a resolution list containing likely values for a slot. 2384 // The value that it returns is determined by the valueSelectionStrategy selected 2385 // when the slot type was created or updated. If valueSelectionStrategy is set 2386 // to ORIGINAL_VALUE, the value provided by the user is returned, if the user 2387 // value is similar to the slot values. If valueSelectionStrategy is set to 2388 // TOP_RESOLUTION Amazon Lex returns the first value in the resolution list 2389 // or, if there is no resolution list, null. If you don't specify a valueSelectionStrategy, 2390 // the default is ORIGINAL_VALUE. 2391 Slots aws.JSONValue `location:"header" locationName:"x-amz-lex-slots" type:"jsonvalue"` 2392} 2393 2394// String returns the string representation 2395func (s PostContentOutput) String() string { 2396 return awsutil.Prettify(s) 2397} 2398 2399// GoString returns the string representation 2400func (s PostContentOutput) GoString() string { 2401 return s.String() 2402} 2403 2404// SetActiveContexts sets the ActiveContexts field's value. 2405func (s *PostContentOutput) SetActiveContexts(v aws.JSONValue) *PostContentOutput { 2406 s.ActiveContexts = v 2407 return s 2408} 2409 2410// SetAlternativeIntents sets the AlternativeIntents field's value. 2411func (s *PostContentOutput) SetAlternativeIntents(v aws.JSONValue) *PostContentOutput { 2412 s.AlternativeIntents = v 2413 return s 2414} 2415 2416// SetAudioStream sets the AudioStream field's value. 2417func (s *PostContentOutput) SetAudioStream(v io.ReadCloser) *PostContentOutput { 2418 s.AudioStream = v 2419 return s 2420} 2421 2422// SetBotVersion sets the BotVersion field's value. 2423func (s *PostContentOutput) SetBotVersion(v string) *PostContentOutput { 2424 s.BotVersion = &v 2425 return s 2426} 2427 2428// SetContentType sets the ContentType field's value. 2429func (s *PostContentOutput) SetContentType(v string) *PostContentOutput { 2430 s.ContentType = &v 2431 return s 2432} 2433 2434// SetDialogState sets the DialogState field's value. 2435func (s *PostContentOutput) SetDialogState(v string) *PostContentOutput { 2436 s.DialogState = &v 2437 return s 2438} 2439 2440// SetEncodedInputTranscript sets the EncodedInputTranscript field's value. 2441func (s *PostContentOutput) SetEncodedInputTranscript(v string) *PostContentOutput { 2442 s.EncodedInputTranscript = &v 2443 return s 2444} 2445 2446// SetEncodedMessage sets the EncodedMessage field's value. 2447func (s *PostContentOutput) SetEncodedMessage(v string) *PostContentOutput { 2448 s.EncodedMessage = &v 2449 return s 2450} 2451 2452// SetInputTranscript sets the InputTranscript field's value. 2453func (s *PostContentOutput) SetInputTranscript(v string) *PostContentOutput { 2454 s.InputTranscript = &v 2455 return s 2456} 2457 2458// SetIntentName sets the IntentName field's value. 2459func (s *PostContentOutput) SetIntentName(v string) *PostContentOutput { 2460 s.IntentName = &v 2461 return s 2462} 2463 2464// SetMessage sets the Message field's value. 2465func (s *PostContentOutput) SetMessage(v string) *PostContentOutput { 2466 s.Message = &v 2467 return s 2468} 2469 2470// SetMessageFormat sets the MessageFormat field's value. 2471func (s *PostContentOutput) SetMessageFormat(v string) *PostContentOutput { 2472 s.MessageFormat = &v 2473 return s 2474} 2475 2476// SetNluIntentConfidence sets the NluIntentConfidence field's value. 2477func (s *PostContentOutput) SetNluIntentConfidence(v aws.JSONValue) *PostContentOutput { 2478 s.NluIntentConfidence = v 2479 return s 2480} 2481 2482// SetSentimentResponse sets the SentimentResponse field's value. 2483func (s *PostContentOutput) SetSentimentResponse(v string) *PostContentOutput { 2484 s.SentimentResponse = &v 2485 return s 2486} 2487 2488// SetSessionAttributes sets the SessionAttributes field's value. 2489func (s *PostContentOutput) SetSessionAttributes(v aws.JSONValue) *PostContentOutput { 2490 s.SessionAttributes = v 2491 return s 2492} 2493 2494// SetSessionId sets the SessionId field's value. 2495func (s *PostContentOutput) SetSessionId(v string) *PostContentOutput { 2496 s.SessionId = &v 2497 return s 2498} 2499 2500// SetSlotToElicit sets the SlotToElicit field's value. 2501func (s *PostContentOutput) SetSlotToElicit(v string) *PostContentOutput { 2502 s.SlotToElicit = &v 2503 return s 2504} 2505 2506// SetSlots sets the Slots field's value. 2507func (s *PostContentOutput) SetSlots(v aws.JSONValue) *PostContentOutput { 2508 s.Slots = v 2509 return s 2510} 2511 2512type PostTextInput struct { 2513 _ struct{} `type:"structure"` 2514 2515 // A list of contexts active for the request. A context can be activated when 2516 // a previous intent is fulfilled, or by including the context in the request, 2517 // 2518 // If you don't specify a list of contexts, Amazon Lex will use the current 2519 // list of contexts for the session. If you specify an empty list, all contexts 2520 // for the session are cleared. 2521 ActiveContexts []*ActiveContext `locationName:"activeContexts" type:"list" sensitive:"true"` 2522 2523 // The alias of the Amazon Lex bot. 2524 // 2525 // BotAlias is a required field 2526 BotAlias *string `location:"uri" locationName:"botAlias" type:"string" required:"true"` 2527 2528 // The name of the Amazon Lex bot. 2529 // 2530 // BotName is a required field 2531 BotName *string `location:"uri" locationName:"botName" type:"string" required:"true"` 2532 2533 // The text that the user entered (Amazon Lex interprets this text). 2534 // 2535 // InputText is a required field 2536 InputText *string `locationName:"inputText" min:"1" type:"string" required:"true" sensitive:"true"` 2537 2538 // Request-specific information passed between Amazon Lex and a client application. 2539 // 2540 // The namespace x-amz-lex: is reserved for special attributes. Don't create 2541 // any request attributes with the prefix x-amz-lex:. 2542 // 2543 // For more information, see Setting Request Attributes (https://docs.aws.amazon.com/lex/latest/dg/context-mgmt.html#context-mgmt-request-attribs). 2544 RequestAttributes map[string]*string `locationName:"requestAttributes" type:"map" sensitive:"true"` 2545 2546 // Application-specific information passed between Amazon Lex and a client application. 2547 // 2548 // For more information, see Setting Session Attributes (https://docs.aws.amazon.com/lex/latest/dg/context-mgmt.html#context-mgmt-session-attribs). 2549 SessionAttributes map[string]*string `locationName:"sessionAttributes" type:"map" sensitive:"true"` 2550 2551 // The ID of the client application user. Amazon Lex uses this to identify a 2552 // user's conversation with your bot. At runtime, each request must contain 2553 // the userID field. 2554 // 2555 // To decide the user ID to use for your application, consider the following 2556 // factors. 2557 // 2558 // * The userID field must not contain any personally identifiable information 2559 // of the user, for example, name, personal identification numbers, or other 2560 // end user personal information. 2561 // 2562 // * If you want a user to start a conversation on one device and continue 2563 // on another device, use a user-specific identifier. 2564 // 2565 // * If you want the same user to be able to have two independent conversations 2566 // on two different devices, choose a device-specific identifier. 2567 // 2568 // * A user can't have two independent conversations with two different versions 2569 // of the same bot. For example, a user can't have a conversation with the 2570 // PROD and BETA versions of the same bot. If you anticipate that a user 2571 // will need to have conversation with two different versions, for example, 2572 // while testing, include the bot alias in the user ID to separate the two 2573 // conversations. 2574 // 2575 // UserId is a required field 2576 UserId *string `location:"uri" locationName:"userId" min:"2" type:"string" required:"true"` 2577} 2578 2579// String returns the string representation 2580func (s PostTextInput) String() string { 2581 return awsutil.Prettify(s) 2582} 2583 2584// GoString returns the string representation 2585func (s PostTextInput) GoString() string { 2586 return s.String() 2587} 2588 2589// Validate inspects the fields of the type to determine if they are valid. 2590func (s *PostTextInput) Validate() error { 2591 invalidParams := request.ErrInvalidParams{Context: "PostTextInput"} 2592 if s.BotAlias == nil { 2593 invalidParams.Add(request.NewErrParamRequired("BotAlias")) 2594 } 2595 if s.BotAlias != nil && len(*s.BotAlias) < 1 { 2596 invalidParams.Add(request.NewErrParamMinLen("BotAlias", 1)) 2597 } 2598 if s.BotName == nil { 2599 invalidParams.Add(request.NewErrParamRequired("BotName")) 2600 } 2601 if s.BotName != nil && len(*s.BotName) < 1 { 2602 invalidParams.Add(request.NewErrParamMinLen("BotName", 1)) 2603 } 2604 if s.InputText == nil { 2605 invalidParams.Add(request.NewErrParamRequired("InputText")) 2606 } 2607 if s.InputText != nil && len(*s.InputText) < 1 { 2608 invalidParams.Add(request.NewErrParamMinLen("InputText", 1)) 2609 } 2610 if s.UserId == nil { 2611 invalidParams.Add(request.NewErrParamRequired("UserId")) 2612 } 2613 if s.UserId != nil && len(*s.UserId) < 2 { 2614 invalidParams.Add(request.NewErrParamMinLen("UserId", 2)) 2615 } 2616 if s.ActiveContexts != nil { 2617 for i, v := range s.ActiveContexts { 2618 if v == nil { 2619 continue 2620 } 2621 if err := v.Validate(); err != nil { 2622 invalidParams.AddNested(fmt.Sprintf("%s[%v]", "ActiveContexts", i), err.(request.ErrInvalidParams)) 2623 } 2624 } 2625 } 2626 2627 if invalidParams.Len() > 0 { 2628 return invalidParams 2629 } 2630 return nil 2631} 2632 2633// SetActiveContexts sets the ActiveContexts field's value. 2634func (s *PostTextInput) SetActiveContexts(v []*ActiveContext) *PostTextInput { 2635 s.ActiveContexts = v 2636 return s 2637} 2638 2639// SetBotAlias sets the BotAlias field's value. 2640func (s *PostTextInput) SetBotAlias(v string) *PostTextInput { 2641 s.BotAlias = &v 2642 return s 2643} 2644 2645// SetBotName sets the BotName field's value. 2646func (s *PostTextInput) SetBotName(v string) *PostTextInput { 2647 s.BotName = &v 2648 return s 2649} 2650 2651// SetInputText sets the InputText field's value. 2652func (s *PostTextInput) SetInputText(v string) *PostTextInput { 2653 s.InputText = &v 2654 return s 2655} 2656 2657// SetRequestAttributes sets the RequestAttributes field's value. 2658func (s *PostTextInput) SetRequestAttributes(v map[string]*string) *PostTextInput { 2659 s.RequestAttributes = v 2660 return s 2661} 2662 2663// SetSessionAttributes sets the SessionAttributes field's value. 2664func (s *PostTextInput) SetSessionAttributes(v map[string]*string) *PostTextInput { 2665 s.SessionAttributes = v 2666 return s 2667} 2668 2669// SetUserId sets the UserId field's value. 2670func (s *PostTextInput) SetUserId(v string) *PostTextInput { 2671 s.UserId = &v 2672 return s 2673} 2674 2675type PostTextOutput struct { 2676 _ struct{} `type:"structure"` 2677 2678 // A list of active contexts for the session. A context can be set when an intent 2679 // is fulfilled or by calling the PostContent, PostText, or PutSession operation. 2680 // 2681 // You can use a context to control the intents that can follow up an intent, 2682 // or to modify the operation of your application. 2683 ActiveContexts []*ActiveContext `locationName:"activeContexts" type:"list" sensitive:"true"` 2684 2685 // One to four alternative intents that may be applicable to the user's intent. 2686 // 2687 // Each alternative includes a score that indicates how confident Amazon Lex 2688 // is that the intent matches the user's intent. The intents are sorted by the 2689 // confidence score. 2690 AlternativeIntents []*PredictedIntent `locationName:"alternativeIntents" type:"list"` 2691 2692 // The version of the bot that responded to the conversation. You can use this 2693 // information to help determine if one version of a bot is performing better 2694 // than another version. 2695 BotVersion *string `locationName:"botVersion" min:"1" type:"string"` 2696 2697 // Identifies the current state of the user interaction. Amazon Lex returns 2698 // one of the following values as dialogState. The client can optionally use 2699 // this information to customize the user interface. 2700 // 2701 // * ElicitIntent - Amazon Lex wants to elicit user intent. For example, 2702 // a user might utter an intent ("I want to order a pizza"). If Amazon Lex 2703 // cannot infer the user intent from this utterance, it will return this 2704 // dialogState. 2705 // 2706 // * ConfirmIntent - Amazon Lex is expecting a "yes" or "no" response. For 2707 // example, Amazon Lex wants user confirmation before fulfilling an intent. 2708 // Instead of a simple "yes" or "no," a user might respond with additional 2709 // information. For example, "yes, but make it thick crust pizza" or "no, 2710 // I want to order a drink". Amazon Lex can process such additional information 2711 // (in these examples, update the crust type slot value, or change intent 2712 // from OrderPizza to OrderDrink). 2713 // 2714 // * ElicitSlot - Amazon Lex is expecting a slot value for the current intent. 2715 // For example, suppose that in the response Amazon Lex sends this message: 2716 // "What size pizza would you like?". A user might reply with the slot value 2717 // (e.g., "medium"). The user might also provide additional information in 2718 // the response (e.g., "medium thick crust pizza"). Amazon Lex can process 2719 // such additional information appropriately. 2720 // 2721 // * Fulfilled - Conveys that the Lambda function configured for the intent 2722 // has successfully fulfilled the intent. 2723 // 2724 // * ReadyForFulfillment - Conveys that the client has to fulfill the intent. 2725 // 2726 // * Failed - Conveys that the conversation with the user failed. This can 2727 // happen for various reasons including that the user did not provide an 2728 // appropriate response to prompts from the service (you can configure how 2729 // many times Amazon Lex can prompt a user for specific information), or 2730 // the Lambda function failed to fulfill the intent. 2731 DialogState *string `locationName:"dialogState" type:"string" enum:"DialogState"` 2732 2733 // The current user intent that Amazon Lex is aware of. 2734 IntentName *string `locationName:"intentName" type:"string"` 2735 2736 // The message to convey to the user. The message can come from the bot's configuration 2737 // or from a Lambda function. 2738 // 2739 // If the intent is not configured with a Lambda function, or if the Lambda 2740 // function returned Delegate as the dialogAction.type its response, Amazon 2741 // Lex decides on the next course of action and selects an appropriate message 2742 // from the bot's configuration based on the current interaction context. For 2743 // example, if Amazon Lex isn't able to understand user input, it uses a clarification 2744 // prompt message. 2745 // 2746 // When you create an intent you can assign messages to groups. When messages 2747 // are assigned to groups Amazon Lex returns one message from each group in 2748 // the response. The message field is an escaped JSON string containing the 2749 // messages. For more information about the structure of the JSON string returned, 2750 // see msg-prompts-formats. 2751 // 2752 // If the Lambda function returns a message, Amazon Lex passes it to the client 2753 // in its response. 2754 Message *string `locationName:"message" min:"1" type:"string" sensitive:"true"` 2755 2756 // The format of the response message. One of the following values: 2757 // 2758 // * PlainText - The message contains plain UTF-8 text. 2759 // 2760 // * CustomPayload - The message is a custom format defined by the Lambda 2761 // function. 2762 // 2763 // * SSML - The message contains text formatted for voice output. 2764 // 2765 // * Composite - The message contains an escaped JSON object containing one 2766 // or more messages from the groups that messages were assigned to when the 2767 // intent was created. 2768 MessageFormat *string `locationName:"messageFormat" type:"string" enum:"MessageFormatType"` 2769 2770 // Provides a score that indicates how confident Amazon Lex is that the returned 2771 // intent is the one that matches the user's intent. The score is between 0.0 2772 // and 1.0. For more information, see Confidence Scores (https://docs.aws.amazon.com/lex/latest/dg/confidence-scores.html). 2773 // 2774 // The score is a relative score, not an absolute score. The score may change 2775 // based on improvements to Amazon Lex. 2776 NluIntentConfidence *IntentConfidence `locationName:"nluIntentConfidence" type:"structure"` 2777 2778 // Represents the options that the user has to respond to the current prompt. 2779 // Response Card can come from the bot configuration (in the Amazon Lex console, 2780 // choose the settings button next to a slot) or from a code hook (Lambda function). 2781 ResponseCard *ResponseCard `locationName:"responseCard" type:"structure"` 2782 2783 // The sentiment expressed in and utterance. 2784 // 2785 // When the bot is configured to send utterances to Amazon Comprehend for sentiment 2786 // analysis, this field contains the result of the analysis. 2787 SentimentResponse *SentimentResponse `locationName:"sentimentResponse" type:"structure"` 2788 2789 // A map of key-value pairs representing the session-specific context information. 2790 SessionAttributes map[string]*string `locationName:"sessionAttributes" type:"map" sensitive:"true"` 2791 2792 // A unique identifier for the session. 2793 SessionId *string `locationName:"sessionId" type:"string"` 2794 2795 // If the dialogState value is ElicitSlot, returns the name of the slot for 2796 // which Amazon Lex is eliciting a value. 2797 SlotToElicit *string `locationName:"slotToElicit" type:"string"` 2798 2799 // The intent slots that Amazon Lex detected from the user input in the conversation. 2800 // 2801 // Amazon Lex creates a resolution list containing likely values for a slot. 2802 // The value that it returns is determined by the valueSelectionStrategy selected 2803 // when the slot type was created or updated. If valueSelectionStrategy is set 2804 // to ORIGINAL_VALUE, the value provided by the user is returned, if the user 2805 // value is similar to the slot values. If valueSelectionStrategy is set to 2806 // TOP_RESOLUTION Amazon Lex returns the first value in the resolution list 2807 // or, if there is no resolution list, null. If you don't specify a valueSelectionStrategy, 2808 // the default is ORIGINAL_VALUE. 2809 Slots map[string]*string `locationName:"slots" type:"map" sensitive:"true"` 2810} 2811 2812// String returns the string representation 2813func (s PostTextOutput) String() string { 2814 return awsutil.Prettify(s) 2815} 2816 2817// GoString returns the string representation 2818func (s PostTextOutput) GoString() string { 2819 return s.String() 2820} 2821 2822// SetActiveContexts sets the ActiveContexts field's value. 2823func (s *PostTextOutput) SetActiveContexts(v []*ActiveContext) *PostTextOutput { 2824 s.ActiveContexts = v 2825 return s 2826} 2827 2828// SetAlternativeIntents sets the AlternativeIntents field's value. 2829func (s *PostTextOutput) SetAlternativeIntents(v []*PredictedIntent) *PostTextOutput { 2830 s.AlternativeIntents = v 2831 return s 2832} 2833 2834// SetBotVersion sets the BotVersion field's value. 2835func (s *PostTextOutput) SetBotVersion(v string) *PostTextOutput { 2836 s.BotVersion = &v 2837 return s 2838} 2839 2840// SetDialogState sets the DialogState field's value. 2841func (s *PostTextOutput) SetDialogState(v string) *PostTextOutput { 2842 s.DialogState = &v 2843 return s 2844} 2845 2846// SetIntentName sets the IntentName field's value. 2847func (s *PostTextOutput) SetIntentName(v string) *PostTextOutput { 2848 s.IntentName = &v 2849 return s 2850} 2851 2852// SetMessage sets the Message field's value. 2853func (s *PostTextOutput) SetMessage(v string) *PostTextOutput { 2854 s.Message = &v 2855 return s 2856} 2857 2858// SetMessageFormat sets the MessageFormat field's value. 2859func (s *PostTextOutput) SetMessageFormat(v string) *PostTextOutput { 2860 s.MessageFormat = &v 2861 return s 2862} 2863 2864// SetNluIntentConfidence sets the NluIntentConfidence field's value. 2865func (s *PostTextOutput) SetNluIntentConfidence(v *IntentConfidence) *PostTextOutput { 2866 s.NluIntentConfidence = v 2867 return s 2868} 2869 2870// SetResponseCard sets the ResponseCard field's value. 2871func (s *PostTextOutput) SetResponseCard(v *ResponseCard) *PostTextOutput { 2872 s.ResponseCard = v 2873 return s 2874} 2875 2876// SetSentimentResponse sets the SentimentResponse field's value. 2877func (s *PostTextOutput) SetSentimentResponse(v *SentimentResponse) *PostTextOutput { 2878 s.SentimentResponse = v 2879 return s 2880} 2881 2882// SetSessionAttributes sets the SessionAttributes field's value. 2883func (s *PostTextOutput) SetSessionAttributes(v map[string]*string) *PostTextOutput { 2884 s.SessionAttributes = v 2885 return s 2886} 2887 2888// SetSessionId sets the SessionId field's value. 2889func (s *PostTextOutput) SetSessionId(v string) *PostTextOutput { 2890 s.SessionId = &v 2891 return s 2892} 2893 2894// SetSlotToElicit sets the SlotToElicit field's value. 2895func (s *PostTextOutput) SetSlotToElicit(v string) *PostTextOutput { 2896 s.SlotToElicit = &v 2897 return s 2898} 2899 2900// SetSlots sets the Slots field's value. 2901func (s *PostTextOutput) SetSlots(v map[string]*string) *PostTextOutput { 2902 s.Slots = v 2903 return s 2904} 2905 2906// An intent that Amazon Lex suggests satisfies the user's intent. Includes 2907// the name of the intent, the confidence that Amazon Lex has that the user's 2908// intent is satisfied, and the slots defined for the intent. 2909type PredictedIntent struct { 2910 _ struct{} `type:"structure"` 2911 2912 // The name of the intent that Amazon Lex suggests satisfies the user's intent. 2913 IntentName *string `locationName:"intentName" type:"string"` 2914 2915 // Indicates how confident Amazon Lex is that an intent satisfies the user's 2916 // intent. 2917 NluIntentConfidence *IntentConfidence `locationName:"nluIntentConfidence" type:"structure"` 2918 2919 // The slot and slot values associated with the predicted intent. 2920 Slots map[string]*string `locationName:"slots" type:"map" sensitive:"true"` 2921} 2922 2923// String returns the string representation 2924func (s PredictedIntent) String() string { 2925 return awsutil.Prettify(s) 2926} 2927 2928// GoString returns the string representation 2929func (s PredictedIntent) GoString() string { 2930 return s.String() 2931} 2932 2933// SetIntentName sets the IntentName field's value. 2934func (s *PredictedIntent) SetIntentName(v string) *PredictedIntent { 2935 s.IntentName = &v 2936 return s 2937} 2938 2939// SetNluIntentConfidence sets the NluIntentConfidence field's value. 2940func (s *PredictedIntent) SetNluIntentConfidence(v *IntentConfidence) *PredictedIntent { 2941 s.NluIntentConfidence = v 2942 return s 2943} 2944 2945// SetSlots sets the Slots field's value. 2946func (s *PredictedIntent) SetSlots(v map[string]*string) *PredictedIntent { 2947 s.Slots = v 2948 return s 2949} 2950 2951type PutSessionInput struct { 2952 _ struct{} `type:"structure"` 2953 2954 // The message that Amazon Lex returns in the response can be either text or 2955 // speech based depending on the value of this field. 2956 // 2957 // * If the value is text/plain; charset=utf-8, Amazon Lex returns text in 2958 // the response. 2959 // 2960 // * If the value begins with audio/, Amazon Lex returns speech in the response. 2961 // Amazon Lex uses Amazon Polly to generate the speech in the configuration 2962 // that you specify. For example, if you specify audio/mpeg as the value, 2963 // Amazon Lex returns speech in the MPEG format. 2964 // 2965 // * If the value is audio/pcm, the speech is returned as audio/pcm in 16-bit, 2966 // little endian format. 2967 // 2968 // * The following are the accepted values: audio/mpeg audio/ogg audio/pcm 2969 // audio/* (defaults to mpeg) text/plain; charset=utf-8 2970 Accept *string `location:"header" locationName:"Accept" type:"string"` 2971 2972 // A list of contexts active for the request. A context can be activated when 2973 // a previous intent is fulfilled, or by including the context in the request, 2974 // 2975 // If you don't specify a list of contexts, Amazon Lex will use the current 2976 // list of contexts for the session. If you specify an empty list, all contexts 2977 // for the session are cleared. 2978 ActiveContexts []*ActiveContext `locationName:"activeContexts" type:"list" sensitive:"true"` 2979 2980 // The alias in use for the bot that contains the session data. 2981 // 2982 // BotAlias is a required field 2983 BotAlias *string `location:"uri" locationName:"botAlias" type:"string" required:"true"` 2984 2985 // The name of the bot that contains the session data. 2986 // 2987 // BotName is a required field 2988 BotName *string `location:"uri" locationName:"botName" type:"string" required:"true"` 2989 2990 // Sets the next action that the bot should take to fulfill the conversation. 2991 DialogAction *DialogAction `locationName:"dialogAction" type:"structure"` 2992 2993 // A summary of the recent intents for the bot. You can use the intent summary 2994 // view to set a checkpoint label on an intent and modify attributes of intents. 2995 // You can also use it to remove or add intent summary objects to the list. 2996 // 2997 // An intent that you modify or add to the list must make sense for the bot. 2998 // For example, the intent name must be valid for the bot. You must provide 2999 // valid values for: 3000 // 3001 // * intentName 3002 // 3003 // * slot names 3004 // 3005 // * slotToElict 3006 // 3007 // If you send the recentIntentSummaryView parameter in a PutSession request, 3008 // the contents of the new summary view replaces the old summary view. For example, 3009 // if a GetSession request returns three intents in the summary view and you 3010 // call PutSession with one intent in the summary view, the next call to GetSession 3011 // will only return one intent. 3012 RecentIntentSummaryView []*IntentSummary `locationName:"recentIntentSummaryView" type:"list"` 3013 3014 // Map of key/value pairs representing the session-specific context information. 3015 // It contains application information passed between Amazon Lex and a client 3016 // application. 3017 SessionAttributes map[string]*string `locationName:"sessionAttributes" type:"map" sensitive:"true"` 3018 3019 // The ID of the client application user. Amazon Lex uses this to identify a 3020 // user's conversation with your bot. 3021 // 3022 // UserId is a required field 3023 UserId *string `location:"uri" locationName:"userId" min:"2" type:"string" required:"true"` 3024} 3025 3026// String returns the string representation 3027func (s PutSessionInput) String() string { 3028 return awsutil.Prettify(s) 3029} 3030 3031// GoString returns the string representation 3032func (s PutSessionInput) GoString() string { 3033 return s.String() 3034} 3035 3036// Validate inspects the fields of the type to determine if they are valid. 3037func (s *PutSessionInput) Validate() error { 3038 invalidParams := request.ErrInvalidParams{Context: "PutSessionInput"} 3039 if s.BotAlias == nil { 3040 invalidParams.Add(request.NewErrParamRequired("BotAlias")) 3041 } 3042 if s.BotAlias != nil && len(*s.BotAlias) < 1 { 3043 invalidParams.Add(request.NewErrParamMinLen("BotAlias", 1)) 3044 } 3045 if s.BotName == nil { 3046 invalidParams.Add(request.NewErrParamRequired("BotName")) 3047 } 3048 if s.BotName != nil && len(*s.BotName) < 1 { 3049 invalidParams.Add(request.NewErrParamMinLen("BotName", 1)) 3050 } 3051 if s.UserId == nil { 3052 invalidParams.Add(request.NewErrParamRequired("UserId")) 3053 } 3054 if s.UserId != nil && len(*s.UserId) < 2 { 3055 invalidParams.Add(request.NewErrParamMinLen("UserId", 2)) 3056 } 3057 if s.ActiveContexts != nil { 3058 for i, v := range s.ActiveContexts { 3059 if v == nil { 3060 continue 3061 } 3062 if err := v.Validate(); err != nil { 3063 invalidParams.AddNested(fmt.Sprintf("%s[%v]", "ActiveContexts", i), err.(request.ErrInvalidParams)) 3064 } 3065 } 3066 } 3067 if s.DialogAction != nil { 3068 if err := s.DialogAction.Validate(); err != nil { 3069 invalidParams.AddNested("DialogAction", err.(request.ErrInvalidParams)) 3070 } 3071 } 3072 if s.RecentIntentSummaryView != nil { 3073 for i, v := range s.RecentIntentSummaryView { 3074 if v == nil { 3075 continue 3076 } 3077 if err := v.Validate(); err != nil { 3078 invalidParams.AddNested(fmt.Sprintf("%s[%v]", "RecentIntentSummaryView", i), err.(request.ErrInvalidParams)) 3079 } 3080 } 3081 } 3082 3083 if invalidParams.Len() > 0 { 3084 return invalidParams 3085 } 3086 return nil 3087} 3088 3089// SetAccept sets the Accept field's value. 3090func (s *PutSessionInput) SetAccept(v string) *PutSessionInput { 3091 s.Accept = &v 3092 return s 3093} 3094 3095// SetActiveContexts sets the ActiveContexts field's value. 3096func (s *PutSessionInput) SetActiveContexts(v []*ActiveContext) *PutSessionInput { 3097 s.ActiveContexts = v 3098 return s 3099} 3100 3101// SetBotAlias sets the BotAlias field's value. 3102func (s *PutSessionInput) SetBotAlias(v string) *PutSessionInput { 3103 s.BotAlias = &v 3104 return s 3105} 3106 3107// SetBotName sets the BotName field's value. 3108func (s *PutSessionInput) SetBotName(v string) *PutSessionInput { 3109 s.BotName = &v 3110 return s 3111} 3112 3113// SetDialogAction sets the DialogAction field's value. 3114func (s *PutSessionInput) SetDialogAction(v *DialogAction) *PutSessionInput { 3115 s.DialogAction = v 3116 return s 3117} 3118 3119// SetRecentIntentSummaryView sets the RecentIntentSummaryView field's value. 3120func (s *PutSessionInput) SetRecentIntentSummaryView(v []*IntentSummary) *PutSessionInput { 3121 s.RecentIntentSummaryView = v 3122 return s 3123} 3124 3125// SetSessionAttributes sets the SessionAttributes field's value. 3126func (s *PutSessionInput) SetSessionAttributes(v map[string]*string) *PutSessionInput { 3127 s.SessionAttributes = v 3128 return s 3129} 3130 3131// SetUserId sets the UserId field's value. 3132func (s *PutSessionInput) SetUserId(v string) *PutSessionInput { 3133 s.UserId = &v 3134 return s 3135} 3136 3137type PutSessionOutput struct { 3138 _ struct{} `type:"structure" payload:"AudioStream"` 3139 3140 // A list of active contexts for the session. 3141 ActiveContexts aws.JSONValue `location:"header" locationName:"x-amz-lex-active-contexts" type:"jsonvalue"` 3142 3143 // The audio version of the message to convey to the user. 3144 AudioStream io.ReadCloser `locationName:"audioStream" type:"blob"` 3145 3146 // Content type as specified in the Accept HTTP header in the request. 3147 ContentType *string `location:"header" locationName:"Content-Type" type:"string"` 3148 3149 // * ConfirmIntent - Amazon Lex is expecting a "yes" or "no" response to 3150 // confirm the intent before fulfilling an intent. 3151 // 3152 // * ElicitIntent - Amazon Lex wants to elicit the user's intent. 3153 // 3154 // * ElicitSlot - Amazon Lex is expecting the value of a slot for the current 3155 // intent. 3156 // 3157 // * Failed - Conveys that the conversation with the user has failed. This 3158 // can happen for various reasons, including the user does not provide an 3159 // appropriate response to prompts from the service, or if the Lambda function 3160 // fails to fulfill the intent. 3161 // 3162 // * Fulfilled - Conveys that the Lambda function has sucessfully fulfilled 3163 // the intent. 3164 // 3165 // * ReadyForFulfillment - Conveys that the client has to fulfill the intent. 3166 DialogState *string `location:"header" locationName:"x-amz-lex-dialog-state" type:"string" enum:"DialogState"` 3167 3168 // The next message that should be presented to the user. 3169 // 3170 // The encodedMessage field is base-64 encoded. You must decode the field before 3171 // you can use the value. 3172 EncodedMessage *string `location:"header" locationName:"x-amz-lex-encoded-message" min:"1" type:"string" sensitive:"true"` 3173 3174 // The name of the current intent. 3175 IntentName *string `location:"header" locationName:"x-amz-lex-intent-name" type:"string"` 3176 3177 // The next message that should be presented to the user. 3178 // 3179 // You can only use this field in the de-DE, en-AU, en-GB, en-US, es-419, es-ES, 3180 // es-US, fr-CA, fr-FR, and it-IT locales. In all other locales, the message 3181 // field is null. You should use the encodedMessage field instead. 3182 // 3183 // Deprecated: The message field is deprecated, use the encodedMessage field instead. The message field is available only in the de-DE, en-AU, en-GB, en-US, es-419, es-ES, es-US, fr-CA, fr-FR and it-IT locales. 3184 Message *string `location:"header" locationName:"x-amz-lex-message" min:"1" deprecated:"true" type:"string" sensitive:"true"` 3185 3186 // The format of the response message. One of the following values: 3187 // 3188 // * PlainText - The message contains plain UTF-8 text. 3189 // 3190 // * CustomPayload - The message is a custom format for the client. 3191 // 3192 // * SSML - The message contains text formatted for voice output. 3193 // 3194 // * Composite - The message contains an escaped JSON object containing one 3195 // or more messages from the groups that messages were assigned to when the 3196 // intent was created. 3197 MessageFormat *string `location:"header" locationName:"x-amz-lex-message-format" type:"string" enum:"MessageFormatType"` 3198 3199 // Map of key/value pairs representing session-specific context information. 3200 SessionAttributes aws.JSONValue `location:"header" locationName:"x-amz-lex-session-attributes" type:"jsonvalue"` 3201 3202 // A unique identifier for the session. 3203 SessionId *string `location:"header" locationName:"x-amz-lex-session-id" type:"string"` 3204 3205 // If the dialogState is ElicitSlot, returns the name of the slot for which 3206 // Amazon Lex is eliciting a value. 3207 SlotToElicit *string `location:"header" locationName:"x-amz-lex-slot-to-elicit" type:"string"` 3208 3209 // Map of zero or more intent slots Amazon Lex detected from the user input 3210 // during the conversation. 3211 // 3212 // Amazon Lex creates a resolution list containing likely values for a slot. 3213 // The value that it returns is determined by the valueSelectionStrategy selected 3214 // when the slot type was created or updated. If valueSelectionStrategy is set 3215 // to ORIGINAL_VALUE, the value provided by the user is returned, if the user 3216 // value is similar to the slot values. If valueSelectionStrategy is set to 3217 // TOP_RESOLUTION Amazon Lex returns the first value in the resolution list 3218 // or, if there is no resolution list, null. If you don't specify a valueSelectionStrategy 3219 // the default is ORIGINAL_VALUE. 3220 Slots aws.JSONValue `location:"header" locationName:"x-amz-lex-slots" type:"jsonvalue"` 3221} 3222 3223// String returns the string representation 3224func (s PutSessionOutput) String() string { 3225 return awsutil.Prettify(s) 3226} 3227 3228// GoString returns the string representation 3229func (s PutSessionOutput) GoString() string { 3230 return s.String() 3231} 3232 3233// SetActiveContexts sets the ActiveContexts field's value. 3234func (s *PutSessionOutput) SetActiveContexts(v aws.JSONValue) *PutSessionOutput { 3235 s.ActiveContexts = v 3236 return s 3237} 3238 3239// SetAudioStream sets the AudioStream field's value. 3240func (s *PutSessionOutput) SetAudioStream(v io.ReadCloser) *PutSessionOutput { 3241 s.AudioStream = v 3242 return s 3243} 3244 3245// SetContentType sets the ContentType field's value. 3246func (s *PutSessionOutput) SetContentType(v string) *PutSessionOutput { 3247 s.ContentType = &v 3248 return s 3249} 3250 3251// SetDialogState sets the DialogState field's value. 3252func (s *PutSessionOutput) SetDialogState(v string) *PutSessionOutput { 3253 s.DialogState = &v 3254 return s 3255} 3256 3257// SetEncodedMessage sets the EncodedMessage field's value. 3258func (s *PutSessionOutput) SetEncodedMessage(v string) *PutSessionOutput { 3259 s.EncodedMessage = &v 3260 return s 3261} 3262 3263// SetIntentName sets the IntentName field's value. 3264func (s *PutSessionOutput) SetIntentName(v string) *PutSessionOutput { 3265 s.IntentName = &v 3266 return s 3267} 3268 3269// SetMessage sets the Message field's value. 3270func (s *PutSessionOutput) SetMessage(v string) *PutSessionOutput { 3271 s.Message = &v 3272 return s 3273} 3274 3275// SetMessageFormat sets the MessageFormat field's value. 3276func (s *PutSessionOutput) SetMessageFormat(v string) *PutSessionOutput { 3277 s.MessageFormat = &v 3278 return s 3279} 3280 3281// SetSessionAttributes sets the SessionAttributes field's value. 3282func (s *PutSessionOutput) SetSessionAttributes(v aws.JSONValue) *PutSessionOutput { 3283 s.SessionAttributes = v 3284 return s 3285} 3286 3287// SetSessionId sets the SessionId field's value. 3288func (s *PutSessionOutput) SetSessionId(v string) *PutSessionOutput { 3289 s.SessionId = &v 3290 return s 3291} 3292 3293// SetSlotToElicit sets the SlotToElicit field's value. 3294func (s *PutSessionOutput) SetSlotToElicit(v string) *PutSessionOutput { 3295 s.SlotToElicit = &v 3296 return s 3297} 3298 3299// SetSlots sets the Slots field's value. 3300func (s *PutSessionOutput) SetSlots(v aws.JSONValue) *PutSessionOutput { 3301 s.Slots = v 3302 return s 3303} 3304 3305// The input speech is too long. 3306type RequestTimeoutException struct { 3307 _ struct{} `type:"structure"` 3308 RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` 3309 3310 Message_ *string `locationName:"message" type:"string"` 3311} 3312 3313// String returns the string representation 3314func (s RequestTimeoutException) String() string { 3315 return awsutil.Prettify(s) 3316} 3317 3318// GoString returns the string representation 3319func (s RequestTimeoutException) GoString() string { 3320 return s.String() 3321} 3322 3323func newErrorRequestTimeoutException(v protocol.ResponseMetadata) error { 3324 return &RequestTimeoutException{ 3325 RespMetadata: v, 3326 } 3327} 3328 3329// Code returns the exception type name. 3330func (s *RequestTimeoutException) Code() string { 3331 return "RequestTimeoutException" 3332} 3333 3334// Message returns the exception's message. 3335func (s *RequestTimeoutException) Message() string { 3336 if s.Message_ != nil { 3337 return *s.Message_ 3338 } 3339 return "" 3340} 3341 3342// OrigErr always returns nil, satisfies awserr.Error interface. 3343func (s *RequestTimeoutException) OrigErr() error { 3344 return nil 3345} 3346 3347func (s *RequestTimeoutException) Error() string { 3348 return fmt.Sprintf("%s: %s", s.Code(), s.Message()) 3349} 3350 3351// Status code returns the HTTP status code for the request's response error. 3352func (s *RequestTimeoutException) StatusCode() int { 3353 return s.RespMetadata.StatusCode 3354} 3355 3356// RequestID returns the service's response RequestID for request. 3357func (s *RequestTimeoutException) RequestID() string { 3358 return s.RespMetadata.RequestID 3359} 3360 3361// If you configure a response card when creating your bots, Amazon Lex substitutes 3362// the session attributes and slot values that are available, and then returns 3363// it. The response card can also come from a Lambda function ( dialogCodeHook 3364// and fulfillmentActivity on an intent). 3365type ResponseCard struct { 3366 _ struct{} `type:"structure"` 3367 3368 // The content type of the response. 3369 ContentType *string `locationName:"contentType" type:"string" enum:"ContentType"` 3370 3371 // An array of attachment objects representing options. 3372 GenericAttachments []*GenericAttachment `locationName:"genericAttachments" type:"list"` 3373 3374 // The version of the response card format. 3375 Version *string `locationName:"version" type:"string"` 3376} 3377 3378// String returns the string representation 3379func (s ResponseCard) String() string { 3380 return awsutil.Prettify(s) 3381} 3382 3383// GoString returns the string representation 3384func (s ResponseCard) GoString() string { 3385 return s.String() 3386} 3387 3388// SetContentType sets the ContentType field's value. 3389func (s *ResponseCard) SetContentType(v string) *ResponseCard { 3390 s.ContentType = &v 3391 return s 3392} 3393 3394// SetGenericAttachments sets the GenericAttachments field's value. 3395func (s *ResponseCard) SetGenericAttachments(v []*GenericAttachment) *ResponseCard { 3396 s.GenericAttachments = v 3397 return s 3398} 3399 3400// SetVersion sets the Version field's value. 3401func (s *ResponseCard) SetVersion(v string) *ResponseCard { 3402 s.Version = &v 3403 return s 3404} 3405 3406// The sentiment expressed in an utterance. 3407// 3408// When the bot is configured to send utterances to Amazon Comprehend for sentiment 3409// analysis, this field structure contains the result of the analysis. 3410type SentimentResponse struct { 3411 _ struct{} `type:"structure"` 3412 3413 // The inferred sentiment that Amazon Comprehend has the highest confidence 3414 // in. 3415 SentimentLabel *string `locationName:"sentimentLabel" type:"string"` 3416 3417 // The likelihood that the sentiment was correctly inferred. 3418 SentimentScore *string `locationName:"sentimentScore" type:"string"` 3419} 3420 3421// String returns the string representation 3422func (s SentimentResponse) String() string { 3423 return awsutil.Prettify(s) 3424} 3425 3426// GoString returns the string representation 3427func (s SentimentResponse) GoString() string { 3428 return s.String() 3429} 3430 3431// SetSentimentLabel sets the SentimentLabel field's value. 3432func (s *SentimentResponse) SetSentimentLabel(v string) *SentimentResponse { 3433 s.SentimentLabel = &v 3434 return s 3435} 3436 3437// SetSentimentScore sets the SentimentScore field's value. 3438func (s *SentimentResponse) SetSentimentScore(v string) *SentimentResponse { 3439 s.SentimentScore = &v 3440 return s 3441} 3442 3443// The Content-Type header (PostContent API) has an invalid value. 3444type UnsupportedMediaTypeException struct { 3445 _ struct{} `type:"structure"` 3446 RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` 3447 3448 Message_ *string `locationName:"message" type:"string"` 3449} 3450 3451// String returns the string representation 3452func (s UnsupportedMediaTypeException) String() string { 3453 return awsutil.Prettify(s) 3454} 3455 3456// GoString returns the string representation 3457func (s UnsupportedMediaTypeException) GoString() string { 3458 return s.String() 3459} 3460 3461func newErrorUnsupportedMediaTypeException(v protocol.ResponseMetadata) error { 3462 return &UnsupportedMediaTypeException{ 3463 RespMetadata: v, 3464 } 3465} 3466 3467// Code returns the exception type name. 3468func (s *UnsupportedMediaTypeException) Code() string { 3469 return "UnsupportedMediaTypeException" 3470} 3471 3472// Message returns the exception's message. 3473func (s *UnsupportedMediaTypeException) Message() string { 3474 if s.Message_ != nil { 3475 return *s.Message_ 3476 } 3477 return "" 3478} 3479 3480// OrigErr always returns nil, satisfies awserr.Error interface. 3481func (s *UnsupportedMediaTypeException) OrigErr() error { 3482 return nil 3483} 3484 3485func (s *UnsupportedMediaTypeException) Error() string { 3486 return fmt.Sprintf("%s: %s", s.Code(), s.Message()) 3487} 3488 3489// Status code returns the HTTP status code for the request's response error. 3490func (s *UnsupportedMediaTypeException) StatusCode() int { 3491 return s.RespMetadata.StatusCode 3492} 3493 3494// RequestID returns the service's response RequestID for request. 3495func (s *UnsupportedMediaTypeException) RequestID() string { 3496 return s.RespMetadata.RequestID 3497} 3498 3499const ( 3500 // ConfirmationStatusNone is a ConfirmationStatus enum value 3501 ConfirmationStatusNone = "None" 3502 3503 // ConfirmationStatusConfirmed is a ConfirmationStatus enum value 3504 ConfirmationStatusConfirmed = "Confirmed" 3505 3506 // ConfirmationStatusDenied is a ConfirmationStatus enum value 3507 ConfirmationStatusDenied = "Denied" 3508) 3509 3510// ConfirmationStatus_Values returns all elements of the ConfirmationStatus enum 3511func ConfirmationStatus_Values() []string { 3512 return []string{ 3513 ConfirmationStatusNone, 3514 ConfirmationStatusConfirmed, 3515 ConfirmationStatusDenied, 3516 } 3517} 3518 3519const ( 3520 // ContentTypeApplicationVndAmazonawsCardGeneric is a ContentType enum value 3521 ContentTypeApplicationVndAmazonawsCardGeneric = "application/vnd.amazonaws.card.generic" 3522) 3523 3524// ContentType_Values returns all elements of the ContentType enum 3525func ContentType_Values() []string { 3526 return []string{ 3527 ContentTypeApplicationVndAmazonawsCardGeneric, 3528 } 3529} 3530 3531const ( 3532 // DialogActionTypeElicitIntent is a DialogActionType enum value 3533 DialogActionTypeElicitIntent = "ElicitIntent" 3534 3535 // DialogActionTypeConfirmIntent is a DialogActionType enum value 3536 DialogActionTypeConfirmIntent = "ConfirmIntent" 3537 3538 // DialogActionTypeElicitSlot is a DialogActionType enum value 3539 DialogActionTypeElicitSlot = "ElicitSlot" 3540 3541 // DialogActionTypeClose is a DialogActionType enum value 3542 DialogActionTypeClose = "Close" 3543 3544 // DialogActionTypeDelegate is a DialogActionType enum value 3545 DialogActionTypeDelegate = "Delegate" 3546) 3547 3548// DialogActionType_Values returns all elements of the DialogActionType enum 3549func DialogActionType_Values() []string { 3550 return []string{ 3551 DialogActionTypeElicitIntent, 3552 DialogActionTypeConfirmIntent, 3553 DialogActionTypeElicitSlot, 3554 DialogActionTypeClose, 3555 DialogActionTypeDelegate, 3556 } 3557} 3558 3559const ( 3560 // DialogStateElicitIntent is a DialogState enum value 3561 DialogStateElicitIntent = "ElicitIntent" 3562 3563 // DialogStateConfirmIntent is a DialogState enum value 3564 DialogStateConfirmIntent = "ConfirmIntent" 3565 3566 // DialogStateElicitSlot is a DialogState enum value 3567 DialogStateElicitSlot = "ElicitSlot" 3568 3569 // DialogStateFulfilled is a DialogState enum value 3570 DialogStateFulfilled = "Fulfilled" 3571 3572 // DialogStateReadyForFulfillment is a DialogState enum value 3573 DialogStateReadyForFulfillment = "ReadyForFulfillment" 3574 3575 // DialogStateFailed is a DialogState enum value 3576 DialogStateFailed = "Failed" 3577) 3578 3579// DialogState_Values returns all elements of the DialogState enum 3580func DialogState_Values() []string { 3581 return []string{ 3582 DialogStateElicitIntent, 3583 DialogStateConfirmIntent, 3584 DialogStateElicitSlot, 3585 DialogStateFulfilled, 3586 DialogStateReadyForFulfillment, 3587 DialogStateFailed, 3588 } 3589} 3590 3591const ( 3592 // FulfillmentStateFulfilled is a FulfillmentState enum value 3593 FulfillmentStateFulfilled = "Fulfilled" 3594 3595 // FulfillmentStateFailed is a FulfillmentState enum value 3596 FulfillmentStateFailed = "Failed" 3597 3598 // FulfillmentStateReadyForFulfillment is a FulfillmentState enum value 3599 FulfillmentStateReadyForFulfillment = "ReadyForFulfillment" 3600) 3601 3602// FulfillmentState_Values returns all elements of the FulfillmentState enum 3603func FulfillmentState_Values() []string { 3604 return []string{ 3605 FulfillmentStateFulfilled, 3606 FulfillmentStateFailed, 3607 FulfillmentStateReadyForFulfillment, 3608 } 3609} 3610 3611const ( 3612 // MessageFormatTypePlainText is a MessageFormatType enum value 3613 MessageFormatTypePlainText = "PlainText" 3614 3615 // MessageFormatTypeCustomPayload is a MessageFormatType enum value 3616 MessageFormatTypeCustomPayload = "CustomPayload" 3617 3618 // MessageFormatTypeSsml is a MessageFormatType enum value 3619 MessageFormatTypeSsml = "SSML" 3620 3621 // MessageFormatTypeComposite is a MessageFormatType enum value 3622 MessageFormatTypeComposite = "Composite" 3623) 3624 3625// MessageFormatType_Values returns all elements of the MessageFormatType enum 3626func MessageFormatType_Values() []string { 3627 return []string{ 3628 MessageFormatTypePlainText, 3629 MessageFormatTypeCustomPayload, 3630 MessageFormatTypeSsml, 3631 MessageFormatTypeComposite, 3632 } 3633} 3634