1// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. 2 3package lexruntimev2 4 5import ( 6 "bytes" 7 "fmt" 8 "io" 9 "sync" 10 "time" 11 12 "github.com/aws/aws-sdk-go/aws" 13 "github.com/aws/aws-sdk-go/aws/awserr" 14 "github.com/aws/aws-sdk-go/aws/awsutil" 15 "github.com/aws/aws-sdk-go/aws/client" 16 "github.com/aws/aws-sdk-go/aws/request" 17 "github.com/aws/aws-sdk-go/aws/signer/v4" 18 "github.com/aws/aws-sdk-go/private/protocol" 19 "github.com/aws/aws-sdk-go/private/protocol/eventstream" 20 "github.com/aws/aws-sdk-go/private/protocol/eventstream/eventstreamapi" 21 "github.com/aws/aws-sdk-go/private/protocol/rest" 22 "github.com/aws/aws-sdk-go/private/protocol/restjson" 23) 24 25const opDeleteSession = "DeleteSession" 26 27// DeleteSessionRequest generates a "aws/request.Request" representing the 28// client's request for the DeleteSession operation. The "output" return 29// value will be populated with the request's response once the request completes 30// successfully. 31// 32// Use "Send" method on the returned Request to send the API call to the service. 33// the "output" return value is not valid until after Send returns without error. 34// 35// See DeleteSession for more information on using the DeleteSession 36// API call, and error handling. 37// 38// This method is useful when you want to inject custom logic or configuration 39// into the SDK's request lifecycle. Such as custom headers, or retry logic. 40// 41// 42// // Example sending a request using the DeleteSessionRequest method. 43// req, resp := client.DeleteSessionRequest(params) 44// 45// err := req.Send() 46// if err == nil { // resp is now filled 47// fmt.Println(resp) 48// } 49// 50// See also, https://docs.aws.amazon.com/goto/WebAPI/runtime.lex.v2-2020-08-07/DeleteSession 51func (c *LexRuntimeV2) DeleteSessionRequest(input *DeleteSessionInput) (req *request.Request, output *DeleteSessionOutput) { 52 op := &request.Operation{ 53 Name: opDeleteSession, 54 HTTPMethod: "DELETE", 55 HTTPPath: "/bots/{botId}/botAliases/{botAliasId}/botLocales/{localeId}/sessions/{sessionId}", 56 } 57 58 if input == nil { 59 input = &DeleteSessionInput{} 60 } 61 62 output = &DeleteSessionOutput{} 63 req = c.newRequest(op, input, output) 64 return 65} 66 67// DeleteSession API operation for Amazon Lex Runtime V2. 68// 69// Removes session information for a specified bot, alias, and user ID. 70// 71// You can use this operation to restart a conversation with a bot. When you 72// remove a session, the entire history of the session is removed so that you 73// can start again. 74// 75// You don't need to delete a session. Sessions have a time limit and will expire. 76// Set the session time limit when you create the bot. The default is 5 minutes, 77// but you can specify anything between 1 minute and 24 hours. 78// 79// If you specify a bot or alias ID that doesn't exist, you receive a BadRequestException. 80// 81// If the locale doesn't exist in the bot, or if the locale hasn't been enables 82// for the alias, you receive a BadRequestException. 83// 84// Returns awserr.Error for service API and SDK errors. Use runtime type assertions 85// with awserr.Error's Code and Message methods to get detailed information about 86// the error. 87// 88// See the AWS API reference guide for Amazon Lex Runtime V2's 89// API operation DeleteSession for usage and error information. 90// 91// Returned Error Types: 92// * AccessDeniedException 93// 94// * ResourceNotFoundException 95// 96// * ValidationException 97// 98// * ThrottlingException 99// 100// * InternalServerException 101// 102// * ConflictException 103// 104// See also, https://docs.aws.amazon.com/goto/WebAPI/runtime.lex.v2-2020-08-07/DeleteSession 105func (c *LexRuntimeV2) DeleteSession(input *DeleteSessionInput) (*DeleteSessionOutput, error) { 106 req, out := c.DeleteSessionRequest(input) 107 return out, req.Send() 108} 109 110// DeleteSessionWithContext is the same as DeleteSession with the addition of 111// the ability to pass a context and additional request options. 112// 113// See DeleteSession for details on how to use this API operation. 114// 115// The context must be non-nil and will be used for request cancellation. If 116// the context is nil a panic will occur. In the future the SDK may create 117// sub-contexts for http.Requests. See https://golang.org/pkg/context/ 118// for more information on using Contexts. 119func (c *LexRuntimeV2) DeleteSessionWithContext(ctx aws.Context, input *DeleteSessionInput, opts ...request.Option) (*DeleteSessionOutput, error) { 120 req, out := c.DeleteSessionRequest(input) 121 req.SetContext(ctx) 122 req.ApplyOptions(opts...) 123 return out, req.Send() 124} 125 126const opGetSession = "GetSession" 127 128// GetSessionRequest generates a "aws/request.Request" representing the 129// client's request for the GetSession operation. The "output" return 130// value will be populated with the request's response once the request completes 131// successfully. 132// 133// Use "Send" method on the returned Request to send the API call to the service. 134// the "output" return value is not valid until after Send returns without error. 135// 136// See GetSession for more information on using the GetSession 137// API call, and error handling. 138// 139// This method is useful when you want to inject custom logic or configuration 140// into the SDK's request lifecycle. Such as custom headers, or retry logic. 141// 142// 143// // Example sending a request using the GetSessionRequest method. 144// req, resp := client.GetSessionRequest(params) 145// 146// err := req.Send() 147// if err == nil { // resp is now filled 148// fmt.Println(resp) 149// } 150// 151// See also, https://docs.aws.amazon.com/goto/WebAPI/runtime.lex.v2-2020-08-07/GetSession 152func (c *LexRuntimeV2) GetSessionRequest(input *GetSessionInput) (req *request.Request, output *GetSessionOutput) { 153 op := &request.Operation{ 154 Name: opGetSession, 155 HTTPMethod: "GET", 156 HTTPPath: "/bots/{botId}/botAliases/{botAliasId}/botLocales/{localeId}/sessions/{sessionId}", 157 } 158 159 if input == nil { 160 input = &GetSessionInput{} 161 } 162 163 output = &GetSessionOutput{} 164 req = c.newRequest(op, input, output) 165 return 166} 167 168// GetSession API operation for Amazon Lex Runtime V2. 169// 170// Returns session information for a specified bot, alias, and user. 171// 172// For example, you can use this operation to retrieve session information for 173// a user that has left a long-running session in use. 174// 175// If the bot, alias, or session identifier doesn't exist, Amazon Lex V2 returns 176// a BadRequestException. If the locale doesn't exist or is not enabled for 177// the alias, you receive a BadRequestException. 178// 179// Returns awserr.Error for service API and SDK errors. Use runtime type assertions 180// with awserr.Error's Code and Message methods to get detailed information about 181// the error. 182// 183// See the AWS API reference guide for Amazon Lex Runtime V2's 184// API operation GetSession for usage and error information. 185// 186// Returned Error Types: 187// * AccessDeniedException 188// 189// * ResourceNotFoundException 190// 191// * ValidationException 192// 193// * ThrottlingException 194// 195// * InternalServerException 196// 197// See also, https://docs.aws.amazon.com/goto/WebAPI/runtime.lex.v2-2020-08-07/GetSession 198func (c *LexRuntimeV2) GetSession(input *GetSessionInput) (*GetSessionOutput, error) { 199 req, out := c.GetSessionRequest(input) 200 return out, req.Send() 201} 202 203// GetSessionWithContext is the same as GetSession with the addition of 204// the ability to pass a context and additional request options. 205// 206// See GetSession for details on how to use this API operation. 207// 208// The context must be non-nil and will be used for request cancellation. If 209// the context is nil a panic will occur. In the future the SDK may create 210// sub-contexts for http.Requests. See https://golang.org/pkg/context/ 211// for more information on using Contexts. 212func (c *LexRuntimeV2) GetSessionWithContext(ctx aws.Context, input *GetSessionInput, opts ...request.Option) (*GetSessionOutput, error) { 213 req, out := c.GetSessionRequest(input) 214 req.SetContext(ctx) 215 req.ApplyOptions(opts...) 216 return out, req.Send() 217} 218 219const opPutSession = "PutSession" 220 221// PutSessionRequest generates a "aws/request.Request" representing the 222// client's request for the PutSession operation. The "output" return 223// value will be populated with the request's response once the request completes 224// successfully. 225// 226// Use "Send" method on the returned Request to send the API call to the service. 227// the "output" return value is not valid until after Send returns without error. 228// 229// See PutSession for more information on using the PutSession 230// API call, and error handling. 231// 232// This method is useful when you want to inject custom logic or configuration 233// into the SDK's request lifecycle. Such as custom headers, or retry logic. 234// 235// 236// // Example sending a request using the PutSessionRequest method. 237// req, resp := client.PutSessionRequest(params) 238// 239// err := req.Send() 240// if err == nil { // resp is now filled 241// fmt.Println(resp) 242// } 243// 244// See also, https://docs.aws.amazon.com/goto/WebAPI/runtime.lex.v2-2020-08-07/PutSession 245func (c *LexRuntimeV2) PutSessionRequest(input *PutSessionInput) (req *request.Request, output *PutSessionOutput) { 246 op := &request.Operation{ 247 Name: opPutSession, 248 HTTPMethod: "POST", 249 HTTPPath: "/bots/{botId}/botAliases/{botAliasId}/botLocales/{localeId}/sessions/{sessionId}", 250 } 251 252 if input == nil { 253 input = &PutSessionInput{} 254 } 255 256 output = &PutSessionOutput{} 257 req = c.newRequest(op, input, output) 258 return 259} 260 261// PutSession API operation for Amazon Lex Runtime V2. 262// 263// Creates a new session or modifies an existing session with an Amazon Lex 264// V2 bot. Use this operation to enable your application to set the state of 265// the bot. 266// 267// Returns awserr.Error for service API and SDK errors. Use runtime type assertions 268// with awserr.Error's Code and Message methods to get detailed information about 269// the error. 270// 271// See the AWS API reference guide for Amazon Lex Runtime V2's 272// API operation PutSession for usage and error information. 273// 274// Returned Error Types: 275// * AccessDeniedException 276// 277// * ResourceNotFoundException 278// 279// * ValidationException 280// 281// * ThrottlingException 282// 283// * InternalServerException 284// 285// * ConflictException 286// 287// * DependencyFailedException 288// 289// * BadGatewayException 290// 291// See also, https://docs.aws.amazon.com/goto/WebAPI/runtime.lex.v2-2020-08-07/PutSession 292func (c *LexRuntimeV2) PutSession(input *PutSessionInput) (*PutSessionOutput, error) { 293 req, out := c.PutSessionRequest(input) 294 return out, req.Send() 295} 296 297// PutSessionWithContext is the same as PutSession with the addition of 298// the ability to pass a context and additional request options. 299// 300// See PutSession for details on how to use this API operation. 301// 302// The context must be non-nil and will be used for request cancellation. If 303// the context is nil a panic will occur. In the future the SDK may create 304// sub-contexts for http.Requests. See https://golang.org/pkg/context/ 305// for more information on using Contexts. 306func (c *LexRuntimeV2) PutSessionWithContext(ctx aws.Context, input *PutSessionInput, opts ...request.Option) (*PutSessionOutput, error) { 307 req, out := c.PutSessionRequest(input) 308 req.SetContext(ctx) 309 req.ApplyOptions(opts...) 310 return out, req.Send() 311} 312 313const opRecognizeText = "RecognizeText" 314 315// RecognizeTextRequest generates a "aws/request.Request" representing the 316// client's request for the RecognizeText operation. The "output" return 317// value will be populated with the request's response once the request completes 318// successfully. 319// 320// Use "Send" method on the returned Request to send the API call to the service. 321// the "output" return value is not valid until after Send returns without error. 322// 323// See RecognizeText for more information on using the RecognizeText 324// API call, and error handling. 325// 326// This method is useful when you want to inject custom logic or configuration 327// into the SDK's request lifecycle. Such as custom headers, or retry logic. 328// 329// 330// // Example sending a request using the RecognizeTextRequest method. 331// req, resp := client.RecognizeTextRequest(params) 332// 333// err := req.Send() 334// if err == nil { // resp is now filled 335// fmt.Println(resp) 336// } 337// 338// See also, https://docs.aws.amazon.com/goto/WebAPI/runtime.lex.v2-2020-08-07/RecognizeText 339func (c *LexRuntimeV2) RecognizeTextRequest(input *RecognizeTextInput) (req *request.Request, output *RecognizeTextOutput) { 340 op := &request.Operation{ 341 Name: opRecognizeText, 342 HTTPMethod: "POST", 343 HTTPPath: "/bots/{botId}/botAliases/{botAliasId}/botLocales/{localeId}/sessions/{sessionId}/text", 344 } 345 346 if input == nil { 347 input = &RecognizeTextInput{} 348 } 349 350 output = &RecognizeTextOutput{} 351 req = c.newRequest(op, input, output) 352 return 353} 354 355// RecognizeText API operation for Amazon Lex Runtime V2. 356// 357// Sends user input to Amazon Lex V2. Client applications use this API to send 358// requests to Amazon Lex V2 at runtime. Amazon Lex V2 then interprets the user 359// input using the machine learning model that it build for the bot. 360// 361// In response, Amazon Lex V2 returns the next message to convey to the user 362// and an optional response card to display. 363// 364// If the optional post-fulfillment response is specified, the messages are 365// returned as follows. For more information, see PostFulfillmentStatusSpecification 366// (https://docs.aws.amazon.com/lexv2/latest/dg/API_PostFulfillmentStatusSpecification.html). 367// 368// * Success message - Returned if the Lambda function completes successfully 369// and the intent state is fulfilled or ready fulfillment if the message 370// is present. 371// 372// * Failed message - The failed message is returned if the Lambda function 373// throws an exception or if the Lambda function returns a failed intent 374// state without a message. 375// 376// * Timeout message - If you don't configure a timeout message and a timeout, 377// and the Lambda function doesn't return within 30 seconds, the timeout 378// message is returned. If you configure a timeout, the timeout message is 379// returned when the period times out. 380// 381// For more information, see Completion message (https://docs.aws.amazon.com/lexv2/latest/dg/streaming-progress.html#progress-complete.html). 382// 383// Returns awserr.Error for service API and SDK errors. Use runtime type assertions 384// with awserr.Error's Code and Message methods to get detailed information about 385// the error. 386// 387// See the AWS API reference guide for Amazon Lex Runtime V2's 388// API operation RecognizeText for usage and error information. 389// 390// Returned Error Types: 391// * AccessDeniedException 392// 393// * ResourceNotFoundException 394// 395// * ValidationException 396// 397// * ThrottlingException 398// 399// * InternalServerException 400// 401// * ConflictException 402// 403// * DependencyFailedException 404// 405// * BadGatewayException 406// 407// See also, https://docs.aws.amazon.com/goto/WebAPI/runtime.lex.v2-2020-08-07/RecognizeText 408func (c *LexRuntimeV2) RecognizeText(input *RecognizeTextInput) (*RecognizeTextOutput, error) { 409 req, out := c.RecognizeTextRequest(input) 410 return out, req.Send() 411} 412 413// RecognizeTextWithContext is the same as RecognizeText with the addition of 414// the ability to pass a context and additional request options. 415// 416// See RecognizeText for details on how to use this API operation. 417// 418// The context must be non-nil and will be used for request cancellation. If 419// the context is nil a panic will occur. In the future the SDK may create 420// sub-contexts for http.Requests. See https://golang.org/pkg/context/ 421// for more information on using Contexts. 422func (c *LexRuntimeV2) RecognizeTextWithContext(ctx aws.Context, input *RecognizeTextInput, opts ...request.Option) (*RecognizeTextOutput, error) { 423 req, out := c.RecognizeTextRequest(input) 424 req.SetContext(ctx) 425 req.ApplyOptions(opts...) 426 return out, req.Send() 427} 428 429const opRecognizeUtterance = "RecognizeUtterance" 430 431// RecognizeUtteranceRequest generates a "aws/request.Request" representing the 432// client's request for the RecognizeUtterance operation. The "output" return 433// value will be populated with the request's response once the request completes 434// successfully. 435// 436// Use "Send" method on the returned Request to send the API call to the service. 437// the "output" return value is not valid until after Send returns without error. 438// 439// See RecognizeUtterance for more information on using the RecognizeUtterance 440// API call, and error handling. 441// 442// This method is useful when you want to inject custom logic or configuration 443// into the SDK's request lifecycle. Such as custom headers, or retry logic. 444// 445// 446// // Example sending a request using the RecognizeUtteranceRequest method. 447// req, resp := client.RecognizeUtteranceRequest(params) 448// 449// err := req.Send() 450// if err == nil { // resp is now filled 451// fmt.Println(resp) 452// } 453// 454// See also, https://docs.aws.amazon.com/goto/WebAPI/runtime.lex.v2-2020-08-07/RecognizeUtterance 455func (c *LexRuntimeV2) RecognizeUtteranceRequest(input *RecognizeUtteranceInput) (req *request.Request, output *RecognizeUtteranceOutput) { 456 op := &request.Operation{ 457 Name: opRecognizeUtterance, 458 HTTPMethod: "POST", 459 HTTPPath: "/bots/{botId}/botAliases/{botAliasId}/botLocales/{localeId}/sessions/{sessionId}/utterance", 460 } 461 462 if input == nil { 463 input = &RecognizeUtteranceInput{} 464 } 465 466 output = &RecognizeUtteranceOutput{} 467 req = c.newRequest(op, input, output) 468 req.Handlers.Sign.Remove(v4.SignRequestHandler) 469 handler := v4.BuildNamedHandler("v4.CustomSignerHandler", v4.WithUnsignedPayload) 470 req.Handlers.Sign.PushFrontNamed(handler) 471 return 472} 473 474// RecognizeUtterance API operation for Amazon Lex Runtime V2. 475// 476// Sends user input to Amazon Lex V2. You can send text or speech. Clients use 477// this API to send text and audio requests to Amazon Lex V2 at runtime. Amazon 478// Lex V2 interprets the user input using the machine learning model built for 479// the bot. 480// 481// The following request fields must be compressed with gzip and then base64 482// encoded before you send them to Amazon Lex V2. 483// 484// * requestAttributes 485// 486// * sessionState 487// 488// The following response fields are compressed using gzip and then base64 encoded 489// by Amazon Lex V2. Before you can use these fields, you must decode and decompress 490// them. 491// 492// * inputTranscript 493// 494// * interpretations 495// 496// * messages 497// 498// * requestAttributes 499// 500// * sessionState 501// 502// The example contains a Java application that compresses and encodes a Java 503// object to send to Amazon Lex V2, and a second that decodes and decompresses 504// a response from Amazon Lex V2. 505// 506// If the optional post-fulfillment response is specified, the messages are 507// returned as follows. For more information, see PostFulfillmentStatusSpecification 508// (https://docs.aws.amazon.com/lexv2/latest/dg/API_PostFulfillmentStatusSpecification.html). 509// 510// * Success message - Returned if the Lambda function completes successfully 511// and the intent state is fulfilled or ready fulfillment if the message 512// is present. 513// 514// * Failed message - The failed message is returned if the Lambda function 515// throws an exception or if the Lambda function returns a failed intent 516// state without a message. 517// 518// * Timeout message - If you don't configure a timeout message and a timeout, 519// and the Lambda function doesn't return within 30 seconds, the timeout 520// message is returned. If you configure a timeout, the timeout message is 521// returned when the period times out. 522// 523// For more information, see Completion message (https://docs.aws.amazon.com/lexv2/latest/dg/streaming-progress.html#progress-complete.html). 524// 525// Returns awserr.Error for service API and SDK errors. Use runtime type assertions 526// with awserr.Error's Code and Message methods to get detailed information about 527// the error. 528// 529// See the AWS API reference guide for Amazon Lex Runtime V2's 530// API operation RecognizeUtterance for usage and error information. 531// 532// Returned Error Types: 533// * AccessDeniedException 534// 535// * ResourceNotFoundException 536// 537// * ValidationException 538// 539// * ThrottlingException 540// 541// * InternalServerException 542// 543// * ConflictException 544// 545// * DependencyFailedException 546// 547// * BadGatewayException 548// 549// See also, https://docs.aws.amazon.com/goto/WebAPI/runtime.lex.v2-2020-08-07/RecognizeUtterance 550func (c *LexRuntimeV2) RecognizeUtterance(input *RecognizeUtteranceInput) (*RecognizeUtteranceOutput, error) { 551 req, out := c.RecognizeUtteranceRequest(input) 552 return out, req.Send() 553} 554 555// RecognizeUtteranceWithContext is the same as RecognizeUtterance with the addition of 556// the ability to pass a context and additional request options. 557// 558// See RecognizeUtterance for details on how to use this API operation. 559// 560// The context must be non-nil and will be used for request cancellation. If 561// the context is nil a panic will occur. In the future the SDK may create 562// sub-contexts for http.Requests. See https://golang.org/pkg/context/ 563// for more information on using Contexts. 564func (c *LexRuntimeV2) RecognizeUtteranceWithContext(ctx aws.Context, input *RecognizeUtteranceInput, opts ...request.Option) (*RecognizeUtteranceOutput, error) { 565 req, out := c.RecognizeUtteranceRequest(input) 566 req.SetContext(ctx) 567 req.ApplyOptions(opts...) 568 return out, req.Send() 569} 570 571const opStartConversation = "StartConversation" 572 573// StartConversationRequest generates a "aws/request.Request" representing the 574// client's request for the StartConversation operation. The "output" return 575// value will be populated with the request's response once the request completes 576// successfully. 577// 578// Use "Send" method on the returned Request to send the API call to the service. 579// the "output" return value is not valid until after Send returns without error. 580// 581// See StartConversation for more information on using the StartConversation 582// API call, and error handling. 583// 584// This method is useful when you want to inject custom logic or configuration 585// into the SDK's request lifecycle. Such as custom headers, or retry logic. 586// 587// 588// // Example sending a request using the StartConversationRequest method. 589// req, resp := client.StartConversationRequest(params) 590// 591// err := req.Send() 592// if err == nil { // resp is now filled 593// fmt.Println(resp) 594// } 595// 596// See also, https://docs.aws.amazon.com/goto/WebAPI/runtime.lex.v2-2020-08-07/StartConversation 597func (c *LexRuntimeV2) StartConversationRequest(input *StartConversationInput) (req *request.Request, output *StartConversationOutput) { 598 op := &request.Operation{ 599 Name: opStartConversation, 600 HTTPMethod: "POST", 601 HTTPPath: "/bots/{botId}/botAliases/{botAliasId}/botLocales/{localeId}/sessions/{sessionId}/conversation", 602 } 603 604 if input == nil { 605 input = &StartConversationInput{} 606 } 607 608 output = &StartConversationOutput{} 609 req = c.newRequest(op, input, output) 610 req.Handlers.UnmarshalMeta.PushBack( 611 protocol.RequireHTTPMinProtocol{Major: 2}.Handler, 612 ) 613 614 es := NewStartConversationEventStream() 615 output.eventStream = es 616 617 req.Handlers.Sign.PushFront(es.setupInputPipe) 618 req.Handlers.UnmarshalError.PushBackNamed(request.NamedHandler{ 619 Name: "InputPipeCloser", 620 Fn: func(r *request.Request) { 621 err := es.closeInputPipe() 622 if err != nil { 623 r.Error = awserr.New(eventstreamapi.InputWriterCloseErrorCode, err.Error(), r.Error) 624 } 625 }, 626 }) 627 req.Handlers.Build.PushBack(request.WithSetRequestHeaders(map[string]string{ 628 "Content-Type": "application/vnd.amazon.eventstream", 629 "X-Amz-Content-Sha256": "STREAMING-AWS4-HMAC-SHA256-EVENTS", 630 })) 631 req.Handlers.Build.Swap(restjson.BuildHandler.Name, rest.BuildHandler) 632 req.Handlers.Send.Swap(client.LogHTTPRequestHandler.Name, client.LogHTTPRequestHeaderHandler) 633 req.Handlers.Unmarshal.PushBack(es.runInputStream) 634 635 req.Handlers.Send.Swap(client.LogHTTPResponseHandler.Name, client.LogHTTPResponseHeaderHandler) 636 req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, rest.UnmarshalHandler) 637 req.Handlers.Unmarshal.PushBack(es.runOutputStream) 638 req.Handlers.Unmarshal.PushBack(es.runOnStreamPartClose) 639 return 640} 641 642// StartConversation API operation for Amazon Lex Runtime V2. 643// 644// Starts an HTTP/2 bidirectional event stream that enables you to send audio, 645// text, or DTMF input in real time. After your application starts a conversation, 646// users send input to Amazon Lex V2 as a stream of events. Amazon Lex V2 processes 647// the incoming events and responds with streaming text or audio events. 648// 649// Audio input must be in the following format: audio/lpcm sample-rate=8000 650// sample-size-bits=16 channel-count=1; is-big-endian=false. 651// 652// If the optional post-fulfillment response is specified, the messages are 653// returned as follows. For more information, see PostFulfillmentStatusSpecification 654// (https://docs.aws.amazon.com/lexv2/latest/dg/API_PostFulfillmentStatusSpecification.html). 655// 656// * Success message - Returned if the Lambda function completes successfully 657// and the intent state is fulfilled or ready fulfillment if the message 658// is present. 659// 660// * Failed message - The failed message is returned if the Lambda function 661// throws an exception or if the Lambda function returns a failed intent 662// state without a message. 663// 664// * Timeout message - If you don't configure a timeout message and a timeout, 665// and the Lambda function doesn't return within 30 seconds, the timeout 666// message is returned. If you configure a timeout, the timeout message is 667// returned when the period times out. 668// 669// For more information, see Completion message (https://docs.aws.amazon.com/lexv2/latest/dg/streaming-progress.html#progress-complete.html). 670// 671// If the optional update message is configured, it is played at the specified 672// frequency while the Lambda function is running and the update message state 673// is active. If the fulfillment update message is not active, the Lambda function 674// runs with a 30 second timeout. 675// 676// For more information, see Update message (https://docs.aws.amazon.com/lexv2/latest/dg/streaming-progress.html#progress-update.html) 677// 678// The StartConversation operation is supported only in the following SDKs: 679// 680// * AWS SDK for C++ (https://docs.aws.amazon.com/goto/SdkForCpp/runtime.lex.v2-2020-08-07/StartConversation) 681// 682// * AWS SDK for Java V2 (https://docs.aws.amazon.com/goto/SdkForJavaV2/runtime.lex.v2-2020-08-07/StartConversation) 683// 684// * AWS SDK for Ruby V3 (https://docs.aws.amazon.com/goto/SdkForRubyV3/runtime.lex.v2-2020-08-07/StartConversation) 685// 686// Returns awserr.Error for service API and SDK errors. Use runtime type assertions 687// with awserr.Error's Code and Message methods to get detailed information about 688// the error. 689// 690// See the AWS API reference guide for Amazon Lex Runtime V2's 691// API operation StartConversation for usage and error information. 692// 693// Returned Error Types: 694// * AccessDeniedException 695// 696// * ValidationException 697// 698// * ThrottlingException 699// 700// * InternalServerException 701// 702// See also, https://docs.aws.amazon.com/goto/WebAPI/runtime.lex.v2-2020-08-07/StartConversation 703func (c *LexRuntimeV2) StartConversation(input *StartConversationInput) (*StartConversationOutput, error) { 704 req, out := c.StartConversationRequest(input) 705 return out, req.Send() 706} 707 708// StartConversationWithContext is the same as StartConversation with the addition of 709// the ability to pass a context and additional request options. 710// 711// See StartConversation for details on how to use this API operation. 712// 713// The context must be non-nil and will be used for request cancellation. If 714// the context is nil a panic will occur. In the future the SDK may create 715// sub-contexts for http.Requests. See https://golang.org/pkg/context/ 716// for more information on using Contexts. 717func (c *LexRuntimeV2) StartConversationWithContext(ctx aws.Context, input *StartConversationInput, opts ...request.Option) (*StartConversationOutput, error) { 718 req, out := c.StartConversationRequest(input) 719 req.SetContext(ctx) 720 req.ApplyOptions(opts...) 721 return out, req.Send() 722} 723 724var _ awserr.Error 725 726// StartConversationEventStream provides the event stream handling for the StartConversation. 727// 728// For testing and mocking the event stream this type should be initialized via 729// the NewStartConversationEventStream constructor function. Using the functional options 730// to pass in nested mock behavior. 731type StartConversationEventStream struct { 732 733 // Writer is the EventStream writer for the StartConversationRequestEventStream 734 // events. This value is automatically set by the SDK when the API call is made 735 // Use this member when unit testing your code with the SDK to mock out the 736 // EventStream Writer. 737 // 738 // Must not be nil. 739 Writer StartConversationRequestEventStreamWriter 740 741 inputWriter io.WriteCloser 742 743 // Reader is the EventStream reader for the StartConversationResponseEventStream 744 // events. This value is automatically set by the SDK when the API call is made 745 // Use this member when unit testing your code with the SDK to mock out the 746 // EventStream Reader. 747 // 748 // Must not be nil. 749 Reader StartConversationResponseEventStreamReader 750 751 outputReader io.ReadCloser 752 753 done chan struct{} 754 closeOnce sync.Once 755 err *eventstreamapi.OnceError 756} 757 758// NewStartConversationEventStream initializes an StartConversationEventStream. 759// This function should only be used for testing and mocking the StartConversationEventStream 760// stream within your application. 761// 762// The Writer member must be set before writing events to the stream. 763// 764// The Reader member must be set before reading events from the stream. 765// 766// es := NewStartConversationEventStream(func(o *StartConversationEventStream{ 767// es.Writer = myMockStreamWriter 768// es.Reader = myMockStreamReader 769// }) 770func NewStartConversationEventStream(opts ...func(*StartConversationEventStream)) *StartConversationEventStream { 771 es := &StartConversationEventStream{ 772 done: make(chan struct{}), 773 err: eventstreamapi.NewOnceError(), 774 } 775 776 for _, fn := range opts { 777 fn(es) 778 } 779 780 return es 781} 782 783func (es *StartConversationEventStream) runOnStreamPartClose(r *request.Request) { 784 if es.done == nil { 785 return 786 } 787 go es.waitStreamPartClose() 788 789} 790 791func (es *StartConversationEventStream) waitStreamPartClose() { 792 var inputErrCh <-chan struct{} 793 if v, ok := es.Writer.(interface{ ErrorSet() <-chan struct{} }); ok { 794 inputErrCh = v.ErrorSet() 795 } 796 var outputErrCh <-chan struct{} 797 if v, ok := es.Reader.(interface{ ErrorSet() <-chan struct{} }); ok { 798 outputErrCh = v.ErrorSet() 799 } 800 var outputClosedCh <-chan struct{} 801 if v, ok := es.Reader.(interface{ Closed() <-chan struct{} }); ok { 802 outputClosedCh = v.Closed() 803 } 804 805 select { 806 case <-es.done: 807 case <-inputErrCh: 808 es.err.SetError(es.Writer.Err()) 809 es.Close() 810 case <-outputErrCh: 811 es.err.SetError(es.Reader.Err()) 812 es.Close() 813 case <-outputClosedCh: 814 if err := es.Reader.Err(); err != nil { 815 es.err.SetError(es.Reader.Err()) 816 } 817 es.Close() 818 } 819} 820 821func (es *StartConversationEventStream) setupInputPipe(r *request.Request) { 822 inputReader, inputWriter := io.Pipe() 823 r.SetStreamingBody(inputReader) 824 es.inputWriter = inputWriter 825} 826 827// Closes the input-pipe writer 828func (es *StartConversationEventStream) closeInputPipe() error { 829 if es.inputWriter != nil { 830 return es.inputWriter.Close() 831 } 832 return nil 833} 834 835// Send writes the event to the stream blocking until the event is written. 836// Returns an error if the event was not written. 837// 838// These events are: 839// 840// * AudioInputEvent 841// * ConfigurationEvent 842// * DTMFInputEvent 843// * DisconnectionEvent 844// * PlaybackCompletionEvent 845// * TextInputEvent 846func (es *StartConversationEventStream) Send(ctx aws.Context, event StartConversationRequestEventStreamEvent) error { 847 return es.Writer.Send(ctx, event) 848} 849 850func (es *StartConversationEventStream) runInputStream(r *request.Request) { 851 var opts []func(*eventstream.Encoder) 852 if r.Config.Logger != nil && r.Config.LogLevel.Matches(aws.LogDebugWithEventStreamBody) { 853 opts = append(opts, eventstream.EncodeWithLogger(r.Config.Logger)) 854 } 855 var encoder eventstreamapi.Encoder = eventstream.NewEncoder(es.inputWriter, opts...) 856 857 var closer aws.MultiCloser 858 sigSeed, err := v4.GetSignedRequestSignature(r.HTTPRequest) 859 if err != nil { 860 r.Error = awserr.New(request.ErrCodeSerialization, 861 "unable to get initial request's signature", err) 862 return 863 } 864 signer := eventstreamapi.NewSignEncoder( 865 v4.NewStreamSigner(r.ClientInfo.SigningRegion, r.ClientInfo.SigningName, 866 sigSeed, r.Config.Credentials), 867 encoder, 868 ) 869 encoder = signer 870 closer = append(closer, signer) 871 closer = append(closer, es.inputWriter) 872 873 eventWriter := eventstreamapi.NewEventWriter(encoder, 874 protocol.HandlerPayloadMarshal{ 875 Marshalers: r.Handlers.BuildStream, 876 }, 877 eventTypeForStartConversationRequestEventStreamEvent, 878 ) 879 880 es.Writer = &writeStartConversationRequestEventStream{ 881 StreamWriter: eventstreamapi.NewStreamWriter(eventWriter, closer), 882 } 883} 884 885// Events returns a channel to read events from. 886// 887// These events are: 888// 889// * AudioResponseEvent 890// * HeartbeatEvent 891// * IntentResultEvent 892// * PlaybackInterruptionEvent 893// * TextResponseEvent 894// * TranscriptEvent 895// * StartConversationResponseEventStreamUnknownEvent 896func (es *StartConversationEventStream) Events() <-chan StartConversationResponseEventStreamEvent { 897 return es.Reader.Events() 898} 899 900func (es *StartConversationEventStream) runOutputStream(r *request.Request) { 901 var opts []func(*eventstream.Decoder) 902 if r.Config.Logger != nil && r.Config.LogLevel.Matches(aws.LogDebugWithEventStreamBody) { 903 opts = append(opts, eventstream.DecodeWithLogger(r.Config.Logger)) 904 } 905 906 unmarshalerForEvent := unmarshalerForStartConversationResponseEventStreamEvent{ 907 metadata: protocol.ResponseMetadata{ 908 StatusCode: r.HTTPResponse.StatusCode, 909 RequestID: r.RequestID, 910 }, 911 }.UnmarshalerForEventName 912 913 decoder := eventstream.NewDecoder(r.HTTPResponse.Body, opts...) 914 eventReader := eventstreamapi.NewEventReader(decoder, 915 protocol.HandlerPayloadUnmarshal{ 916 Unmarshalers: r.Handlers.UnmarshalStream, 917 }, 918 unmarshalerForEvent, 919 ) 920 921 es.outputReader = r.HTTPResponse.Body 922 es.Reader = newReadStartConversationResponseEventStream(eventReader) 923} 924 925// Close closes the stream. This will also cause the stream to be closed. 926// Close must be called when done using the stream API. Not calling Close 927// may result in resource leaks. 928// 929// Will close the underlying EventStream writer, and no more events can be 930// sent. 931// 932// You can use the closing of the Reader's Events channel to terminate your 933// application's read from the API's stream. 934// 935func (es *StartConversationEventStream) Close() (err error) { 936 es.closeOnce.Do(es.safeClose) 937 return es.Err() 938} 939 940func (es *StartConversationEventStream) safeClose() { 941 if es.done != nil { 942 close(es.done) 943 } 944 945 t := time.NewTicker(time.Second) 946 defer t.Stop() 947 writeCloseDone := make(chan error) 948 go func() { 949 if err := es.Writer.Close(); err != nil { 950 es.err.SetError(err) 951 } 952 close(writeCloseDone) 953 }() 954 select { 955 case <-t.C: 956 case <-writeCloseDone: 957 } 958 if err := es.closeInputPipe(); err != nil { 959 es.err.SetError(err) 960 } 961 962 es.Reader.Close() 963 if es.outputReader != nil { 964 es.outputReader.Close() 965 } 966} 967 968// Err returns any error that occurred while reading or writing EventStream 969// Events from the service API's response. Returns nil if there were no errors. 970func (es *StartConversationEventStream) Err() error { 971 if err := es.err.Err(); err != nil { 972 return err 973 } 974 if err := es.Writer.Err(); err != nil { 975 return err 976 } 977 if err := es.Reader.Err(); err != nil { 978 return err 979 } 980 981 return nil 982} 983 984type AccessDeniedException struct { 985 _ struct{} `type:"structure"` 986 RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` 987 988 Message_ *string `locationName:"message" type:"string"` 989} 990 991// String returns the string representation. 992// 993// API parameter values that are decorated as "sensitive" in the API will not 994// be included in the string output. The member name will be present, but the 995// value will be replaced with "sensitive". 996func (s AccessDeniedException) String() string { 997 return awsutil.Prettify(s) 998} 999 1000// GoString returns the string representation. 1001// 1002// API parameter values that are decorated as "sensitive" in the API will not 1003// be included in the string output. The member name will be present, but the 1004// value will be replaced with "sensitive". 1005func (s AccessDeniedException) GoString() string { 1006 return s.String() 1007} 1008 1009// The AccessDeniedException is and event in the StartConversationResponseEventStream group of events. 1010func (s *AccessDeniedException) eventStartConversationResponseEventStream() {} 1011 1012// UnmarshalEvent unmarshals the EventStream Message into the AccessDeniedException value. 1013// This method is only used internally within the SDK's EventStream handling. 1014func (s *AccessDeniedException) UnmarshalEvent( 1015 payloadUnmarshaler protocol.PayloadUnmarshaler, 1016 msg eventstream.Message, 1017) error { 1018 if err := payloadUnmarshaler.UnmarshalPayload( 1019 bytes.NewReader(msg.Payload), s, 1020 ); err != nil { 1021 return err 1022 } 1023 return nil 1024} 1025 1026// MarshalEvent marshals the type into an stream event value. This method 1027// should only used internally within the SDK's EventStream handling. 1028func (s *AccessDeniedException) MarshalEvent(pm protocol.PayloadMarshaler) (msg eventstream.Message, err error) { 1029 msg.Headers.Set(eventstreamapi.MessageTypeHeader, eventstream.StringValue(eventstreamapi.ExceptionMessageType)) 1030 var buf bytes.Buffer 1031 if err = pm.MarshalPayload(&buf, s); err != nil { 1032 return eventstream.Message{}, err 1033 } 1034 msg.Payload = buf.Bytes() 1035 return msg, err 1036} 1037 1038func newErrorAccessDeniedException(v protocol.ResponseMetadata) error { 1039 return &AccessDeniedException{ 1040 RespMetadata: v, 1041 } 1042} 1043 1044// Code returns the exception type name. 1045func (s *AccessDeniedException) Code() string { 1046 return "AccessDeniedException" 1047} 1048 1049// Message returns the exception's message. 1050func (s *AccessDeniedException) Message() string { 1051 if s.Message_ != nil { 1052 return *s.Message_ 1053 } 1054 return "" 1055} 1056 1057// OrigErr always returns nil, satisfies awserr.Error interface. 1058func (s *AccessDeniedException) OrigErr() error { 1059 return nil 1060} 1061 1062func (s *AccessDeniedException) Error() string { 1063 return fmt.Sprintf("%s: %s", s.Code(), s.Message()) 1064} 1065 1066// Status code returns the HTTP status code for the request's response error. 1067func (s *AccessDeniedException) StatusCode() int { 1068 return s.RespMetadata.StatusCode 1069} 1070 1071// RequestID returns the service's response RequestID for request. 1072func (s *AccessDeniedException) RequestID() string { 1073 return s.RespMetadata.RequestID 1074} 1075 1076// Contains information about the contexts that a user is using in a session. 1077// You can configure Amazon Lex V2 to set a context when an intent is fulfilled, 1078// or you can set a context using the , , or operations. 1079// 1080// Use a context to indicate to Amazon Lex V2 intents that should be used as 1081// follow-up intents. For example, if the active context is order-fulfilled, 1082// only intents that have order-fulfilled configured as a trigger are considered 1083// for follow up. 1084type ActiveContext struct { 1085 _ struct{} `type:"structure"` 1086 1087 // A list of contexts active for the request. A context can be activated when 1088 // a previous intent is fulfilled, or by including the context in the request. 1089 // 1090 // If you don't specify a list of contexts, Amazon Lex V2 will use the current 1091 // list of contexts for the session. If you specify an empty list, all contexts 1092 // for the session are cleared. 1093 // 1094 // ContextAttributes is a required field 1095 ContextAttributes map[string]*string `locationName:"contextAttributes" type:"map" required:"true"` 1096 1097 // The name of the context. 1098 // 1099 // Name is a required field 1100 Name *string `locationName:"name" min:"1" type:"string" required:"true"` 1101 1102 // Indicates the number of turns or seconds that the context is active. Once 1103 // the time to live expires, the context is no longer returned in a response. 1104 // 1105 // TimeToLive is a required field 1106 TimeToLive *ActiveContextTimeToLive `locationName:"timeToLive" type:"structure" required:"true"` 1107} 1108 1109// String returns the string representation. 1110// 1111// API parameter values that are decorated as "sensitive" in the API will not 1112// be included in the string output. The member name will be present, but the 1113// value will be replaced with "sensitive". 1114func (s ActiveContext) String() string { 1115 return awsutil.Prettify(s) 1116} 1117 1118// GoString returns the string representation. 1119// 1120// API parameter values that are decorated as "sensitive" in the API will not 1121// be included in the string output. The member name will be present, but the 1122// value will be replaced with "sensitive". 1123func (s ActiveContext) GoString() string { 1124 return s.String() 1125} 1126 1127// Validate inspects the fields of the type to determine if they are valid. 1128func (s *ActiveContext) Validate() error { 1129 invalidParams := request.ErrInvalidParams{Context: "ActiveContext"} 1130 if s.ContextAttributes == nil { 1131 invalidParams.Add(request.NewErrParamRequired("ContextAttributes")) 1132 } 1133 if s.Name == nil { 1134 invalidParams.Add(request.NewErrParamRequired("Name")) 1135 } 1136 if s.Name != nil && len(*s.Name) < 1 { 1137 invalidParams.Add(request.NewErrParamMinLen("Name", 1)) 1138 } 1139 if s.TimeToLive == nil { 1140 invalidParams.Add(request.NewErrParamRequired("TimeToLive")) 1141 } 1142 if s.TimeToLive != nil { 1143 if err := s.TimeToLive.Validate(); err != nil { 1144 invalidParams.AddNested("TimeToLive", err.(request.ErrInvalidParams)) 1145 } 1146 } 1147 1148 if invalidParams.Len() > 0 { 1149 return invalidParams 1150 } 1151 return nil 1152} 1153 1154// SetContextAttributes sets the ContextAttributes field's value. 1155func (s *ActiveContext) SetContextAttributes(v map[string]*string) *ActiveContext { 1156 s.ContextAttributes = v 1157 return s 1158} 1159 1160// SetName sets the Name field's value. 1161func (s *ActiveContext) SetName(v string) *ActiveContext { 1162 s.Name = &v 1163 return s 1164} 1165 1166// SetTimeToLive sets the TimeToLive field's value. 1167func (s *ActiveContext) SetTimeToLive(v *ActiveContextTimeToLive) *ActiveContext { 1168 s.TimeToLive = v 1169 return s 1170} 1171 1172// The time that a context is active. You can specify the time to live in seconds 1173// or in conversation turns. 1174type ActiveContextTimeToLive struct { 1175 _ struct{} `type:"structure"` 1176 1177 // The number of seconds that the context is active. You can specify between 1178 // 5 and 86400 seconds (24 hours). 1179 // 1180 // TimeToLiveInSeconds is a required field 1181 TimeToLiveInSeconds *int64 `locationName:"timeToLiveInSeconds" min:"5" type:"integer" required:"true"` 1182 1183 // The number of turns that the context is active. You can specify up to 20 1184 // turns. Each request and response from the bot is a turn. 1185 // 1186 // TurnsToLive is a required field 1187 TurnsToLive *int64 `locationName:"turnsToLive" min:"1" type:"integer" required:"true"` 1188} 1189 1190// String returns the string representation. 1191// 1192// API parameter values that are decorated as "sensitive" in the API will not 1193// be included in the string output. The member name will be present, but the 1194// value will be replaced with "sensitive". 1195func (s ActiveContextTimeToLive) String() string { 1196 return awsutil.Prettify(s) 1197} 1198 1199// GoString returns the string representation. 1200// 1201// API parameter values that are decorated as "sensitive" in the API will not 1202// be included in the string output. The member name will be present, but the 1203// value will be replaced with "sensitive". 1204func (s ActiveContextTimeToLive) GoString() string { 1205 return s.String() 1206} 1207 1208// Validate inspects the fields of the type to determine if they are valid. 1209func (s *ActiveContextTimeToLive) Validate() error { 1210 invalidParams := request.ErrInvalidParams{Context: "ActiveContextTimeToLive"} 1211 if s.TimeToLiveInSeconds == nil { 1212 invalidParams.Add(request.NewErrParamRequired("TimeToLiveInSeconds")) 1213 } 1214 if s.TimeToLiveInSeconds != nil && *s.TimeToLiveInSeconds < 5 { 1215 invalidParams.Add(request.NewErrParamMinValue("TimeToLiveInSeconds", 5)) 1216 } 1217 if s.TurnsToLive == nil { 1218 invalidParams.Add(request.NewErrParamRequired("TurnsToLive")) 1219 } 1220 if s.TurnsToLive != nil && *s.TurnsToLive < 1 { 1221 invalidParams.Add(request.NewErrParamMinValue("TurnsToLive", 1)) 1222 } 1223 1224 if invalidParams.Len() > 0 { 1225 return invalidParams 1226 } 1227 return nil 1228} 1229 1230// SetTimeToLiveInSeconds sets the TimeToLiveInSeconds field's value. 1231func (s *ActiveContextTimeToLive) SetTimeToLiveInSeconds(v int64) *ActiveContextTimeToLive { 1232 s.TimeToLiveInSeconds = &v 1233 return s 1234} 1235 1236// SetTurnsToLive sets the TurnsToLive field's value. 1237func (s *ActiveContextTimeToLive) SetTurnsToLive(v int64) *ActiveContextTimeToLive { 1238 s.TurnsToLive = &v 1239 return s 1240} 1241 1242// Represents a chunk of audio sent from the client application to Amazon Lex 1243// V2. The audio is all or part of an utterance from the user. 1244// 1245// Amazon Lex V2 accumulates audio chunks until it recognizes a natural pause 1246// in speech before processing the input. 1247type AudioInputEvent struct { 1248 _ struct{} `type:"structure"` 1249 1250 // An encoded stream of audio. 1251 // AudioChunk is automatically base64 encoded/decoded by the SDK. 1252 AudioChunk []byte `locationName:"audioChunk" type:"blob"` 1253 1254 // A timestamp set by the client of the date and time that the event was sent 1255 // to Amazon Lex V2. 1256 ClientTimestampMillis *int64 `locationName:"clientTimestampMillis" type:"long"` 1257 1258 // The encoding used for the audio chunk. You must use 8 KHz PCM 16-bit mono-channel 1259 // little-endian format. The value of the field should be: 1260 // 1261 // audio/lpcm; sample-rate=8000; sample-size-bits=16; channel-count=1; is-big-endian=false 1262 // 1263 // ContentType is a required field 1264 ContentType *string `locationName:"contentType" min:"1" type:"string" required:"true"` 1265 1266 // A unique identifier that your application assigns to the event. You can use 1267 // this to identify events in logs. 1268 EventId *string `locationName:"eventId" min:"2" type:"string"` 1269} 1270 1271// String returns the string representation. 1272// 1273// API parameter values that are decorated as "sensitive" in the API will not 1274// be included in the string output. The member name will be present, but the 1275// value will be replaced with "sensitive". 1276func (s AudioInputEvent) String() string { 1277 return awsutil.Prettify(s) 1278} 1279 1280// GoString returns the string representation. 1281// 1282// API parameter values that are decorated as "sensitive" in the API will not 1283// be included in the string output. The member name will be present, but the 1284// value will be replaced with "sensitive". 1285func (s AudioInputEvent) GoString() string { 1286 return s.String() 1287} 1288 1289// SetAudioChunk sets the AudioChunk field's value. 1290func (s *AudioInputEvent) SetAudioChunk(v []byte) *AudioInputEvent { 1291 s.AudioChunk = v 1292 return s 1293} 1294 1295// SetClientTimestampMillis sets the ClientTimestampMillis field's value. 1296func (s *AudioInputEvent) SetClientTimestampMillis(v int64) *AudioInputEvent { 1297 s.ClientTimestampMillis = &v 1298 return s 1299} 1300 1301// SetContentType sets the ContentType field's value. 1302func (s *AudioInputEvent) SetContentType(v string) *AudioInputEvent { 1303 s.ContentType = &v 1304 return s 1305} 1306 1307// SetEventId sets the EventId field's value. 1308func (s *AudioInputEvent) SetEventId(v string) *AudioInputEvent { 1309 s.EventId = &v 1310 return s 1311} 1312 1313// The AudioInputEvent is and event in the StartConversationRequestEventStream group of events. 1314func (s *AudioInputEvent) eventStartConversationRequestEventStream() {} 1315 1316// UnmarshalEvent unmarshals the EventStream Message into the AudioInputEvent value. 1317// This method is only used internally within the SDK's EventStream handling. 1318func (s *AudioInputEvent) UnmarshalEvent( 1319 payloadUnmarshaler protocol.PayloadUnmarshaler, 1320 msg eventstream.Message, 1321) error { 1322 if err := payloadUnmarshaler.UnmarshalPayload( 1323 bytes.NewReader(msg.Payload), s, 1324 ); err != nil { 1325 return err 1326 } 1327 return nil 1328} 1329 1330// MarshalEvent marshals the type into an stream event value. This method 1331// should only used internally within the SDK's EventStream handling. 1332func (s *AudioInputEvent) MarshalEvent(pm protocol.PayloadMarshaler) (msg eventstream.Message, err error) { 1333 msg.Headers.Set(eventstreamapi.MessageTypeHeader, eventstream.StringValue(eventstreamapi.EventMessageType)) 1334 var buf bytes.Buffer 1335 if err = pm.MarshalPayload(&buf, s); err != nil { 1336 return eventstream.Message{}, err 1337 } 1338 msg.Payload = buf.Bytes() 1339 return msg, err 1340} 1341 1342// An event sent from Amazon Lex V2 to your client application containing audio 1343// to play to the user. 1344type AudioResponseEvent struct { 1345 _ struct{} `type:"structure"` 1346 1347 // A chunk of the audio to play. 1348 // AudioChunk is automatically base64 encoded/decoded by the SDK. 1349 AudioChunk []byte `locationName:"audioChunk" type:"blob"` 1350 1351 // The encoding of the audio chunk. This is the same as the encoding configure 1352 // in the contentType field of the ConfigurationEvent. 1353 ContentType *string `locationName:"contentType" min:"1" type:"string"` 1354 1355 // A unique identifier of the event sent by Amazon Lex V2. The identifier is 1356 // in the form RESPONSE-N, where N is a number starting with one and incremented 1357 // for each event sent by Amazon Lex V2 in the current session. 1358 EventId *string `locationName:"eventId" min:"2" type:"string"` 1359} 1360 1361// String returns the string representation. 1362// 1363// API parameter values that are decorated as "sensitive" in the API will not 1364// be included in the string output. The member name will be present, but the 1365// value will be replaced with "sensitive". 1366func (s AudioResponseEvent) String() string { 1367 return awsutil.Prettify(s) 1368} 1369 1370// GoString returns the string representation. 1371// 1372// API parameter values that are decorated as "sensitive" in the API will not 1373// be included in the string output. The member name will be present, but the 1374// value will be replaced with "sensitive". 1375func (s AudioResponseEvent) GoString() string { 1376 return s.String() 1377} 1378 1379// SetAudioChunk sets the AudioChunk field's value. 1380func (s *AudioResponseEvent) SetAudioChunk(v []byte) *AudioResponseEvent { 1381 s.AudioChunk = v 1382 return s 1383} 1384 1385// SetContentType sets the ContentType field's value. 1386func (s *AudioResponseEvent) SetContentType(v string) *AudioResponseEvent { 1387 s.ContentType = &v 1388 return s 1389} 1390 1391// SetEventId sets the EventId field's value. 1392func (s *AudioResponseEvent) SetEventId(v string) *AudioResponseEvent { 1393 s.EventId = &v 1394 return s 1395} 1396 1397// The AudioResponseEvent is and event in the StartConversationResponseEventStream group of events. 1398func (s *AudioResponseEvent) eventStartConversationResponseEventStream() {} 1399 1400// UnmarshalEvent unmarshals the EventStream Message into the AudioResponseEvent value. 1401// This method is only used internally within the SDK's EventStream handling. 1402func (s *AudioResponseEvent) UnmarshalEvent( 1403 payloadUnmarshaler protocol.PayloadUnmarshaler, 1404 msg eventstream.Message, 1405) error { 1406 if err := payloadUnmarshaler.UnmarshalPayload( 1407 bytes.NewReader(msg.Payload), s, 1408 ); err != nil { 1409 return err 1410 } 1411 return nil 1412} 1413 1414// MarshalEvent marshals the type into an stream event value. This method 1415// should only used internally within the SDK's EventStream handling. 1416func (s *AudioResponseEvent) MarshalEvent(pm protocol.PayloadMarshaler) (msg eventstream.Message, err error) { 1417 msg.Headers.Set(eventstreamapi.MessageTypeHeader, eventstream.StringValue(eventstreamapi.EventMessageType)) 1418 var buf bytes.Buffer 1419 if err = pm.MarshalPayload(&buf, s); err != nil { 1420 return eventstream.Message{}, err 1421 } 1422 msg.Payload = buf.Bytes() 1423 return msg, err 1424} 1425 1426type BadGatewayException struct { 1427 _ struct{} `type:"structure"` 1428 RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` 1429 1430 Message_ *string `locationName:"message" type:"string"` 1431} 1432 1433// String returns the string representation. 1434// 1435// API parameter values that are decorated as "sensitive" in the API will not 1436// be included in the string output. The member name will be present, but the 1437// value will be replaced with "sensitive". 1438func (s BadGatewayException) String() string { 1439 return awsutil.Prettify(s) 1440} 1441 1442// GoString returns the string representation. 1443// 1444// API parameter values that are decorated as "sensitive" in the API will not 1445// be included in the string output. The member name will be present, but the 1446// value will be replaced with "sensitive". 1447func (s BadGatewayException) GoString() string { 1448 return s.String() 1449} 1450 1451// The BadGatewayException is and event in the StartConversationResponseEventStream group of events. 1452func (s *BadGatewayException) eventStartConversationResponseEventStream() {} 1453 1454// UnmarshalEvent unmarshals the EventStream Message into the BadGatewayException value. 1455// This method is only used internally within the SDK's EventStream handling. 1456func (s *BadGatewayException) UnmarshalEvent( 1457 payloadUnmarshaler protocol.PayloadUnmarshaler, 1458 msg eventstream.Message, 1459) error { 1460 if err := payloadUnmarshaler.UnmarshalPayload( 1461 bytes.NewReader(msg.Payload), s, 1462 ); err != nil { 1463 return err 1464 } 1465 return nil 1466} 1467 1468// MarshalEvent marshals the type into an stream event value. This method 1469// should only used internally within the SDK's EventStream handling. 1470func (s *BadGatewayException) MarshalEvent(pm protocol.PayloadMarshaler) (msg eventstream.Message, err error) { 1471 msg.Headers.Set(eventstreamapi.MessageTypeHeader, eventstream.StringValue(eventstreamapi.ExceptionMessageType)) 1472 var buf bytes.Buffer 1473 if err = pm.MarshalPayload(&buf, s); err != nil { 1474 return eventstream.Message{}, err 1475 } 1476 msg.Payload = buf.Bytes() 1477 return msg, err 1478} 1479 1480func newErrorBadGatewayException(v protocol.ResponseMetadata) error { 1481 return &BadGatewayException{ 1482 RespMetadata: v, 1483 } 1484} 1485 1486// Code returns the exception type name. 1487func (s *BadGatewayException) Code() string { 1488 return "BadGatewayException" 1489} 1490 1491// Message returns the exception's message. 1492func (s *BadGatewayException) Message() string { 1493 if s.Message_ != nil { 1494 return *s.Message_ 1495 } 1496 return "" 1497} 1498 1499// OrigErr always returns nil, satisfies awserr.Error interface. 1500func (s *BadGatewayException) OrigErr() error { 1501 return nil 1502} 1503 1504func (s *BadGatewayException) Error() string { 1505 return fmt.Sprintf("%s: %s", s.Code(), s.Message()) 1506} 1507 1508// Status code returns the HTTP status code for the request's response error. 1509func (s *BadGatewayException) StatusCode() int { 1510 return s.RespMetadata.StatusCode 1511} 1512 1513// RequestID returns the service's response RequestID for request. 1514func (s *BadGatewayException) RequestID() string { 1515 return s.RespMetadata.RequestID 1516} 1517 1518// A button that appears on a response card show to the user. 1519type Button struct { 1520 _ struct{} `type:"structure"` 1521 1522 // The text that is displayed on the button. 1523 // 1524 // Text is a required field 1525 Text *string `locationName:"text" min:"1" type:"string" required:"true"` 1526 1527 // The value returned to Amazon Lex V2 when a user chooses the button. 1528 // 1529 // Value is a required field 1530 Value *string `locationName:"value" min:"1" type:"string" required:"true"` 1531} 1532 1533// String returns the string representation. 1534// 1535// API parameter values that are decorated as "sensitive" in the API will not 1536// be included in the string output. The member name will be present, but the 1537// value will be replaced with "sensitive". 1538func (s Button) String() string { 1539 return awsutil.Prettify(s) 1540} 1541 1542// GoString returns the string representation. 1543// 1544// API parameter values that are decorated as "sensitive" in the API will not 1545// be included in the string output. The member name will be present, but the 1546// value will be replaced with "sensitive". 1547func (s Button) GoString() string { 1548 return s.String() 1549} 1550 1551// Validate inspects the fields of the type to determine if they are valid. 1552func (s *Button) Validate() error { 1553 invalidParams := request.ErrInvalidParams{Context: "Button"} 1554 if s.Text == nil { 1555 invalidParams.Add(request.NewErrParamRequired("Text")) 1556 } 1557 if s.Text != nil && len(*s.Text) < 1 { 1558 invalidParams.Add(request.NewErrParamMinLen("Text", 1)) 1559 } 1560 if s.Value == nil { 1561 invalidParams.Add(request.NewErrParamRequired("Value")) 1562 } 1563 if s.Value != nil && len(*s.Value) < 1 { 1564 invalidParams.Add(request.NewErrParamMinLen("Value", 1)) 1565 } 1566 1567 if invalidParams.Len() > 0 { 1568 return invalidParams 1569 } 1570 return nil 1571} 1572 1573// SetText sets the Text field's value. 1574func (s *Button) SetText(v string) *Button { 1575 s.Text = &v 1576 return s 1577} 1578 1579// SetValue sets the Value field's value. 1580func (s *Button) SetValue(v string) *Button { 1581 s.Value = &v 1582 return s 1583} 1584 1585// Provides a score that indicates the confidence that Amazon Lex V2 has that 1586// an intent is the one that satisfies the user's intent. 1587type ConfidenceScore struct { 1588 _ struct{} `type:"structure"` 1589 1590 // A score that indicates how confident Amazon Lex V2 is that an intent satisfies 1591 // the user's intent. Ranges between 0.00 and 1.00. Higher scores indicate higher 1592 // confidence. 1593 Score *float64 `locationName:"score" type:"double"` 1594} 1595 1596// String returns the string representation. 1597// 1598// API parameter values that are decorated as "sensitive" in the API will not 1599// be included in the string output. The member name will be present, but the 1600// value will be replaced with "sensitive". 1601func (s ConfidenceScore) String() string { 1602 return awsutil.Prettify(s) 1603} 1604 1605// GoString returns the string representation. 1606// 1607// API parameter values that are decorated as "sensitive" in the API will not 1608// be included in the string output. The member name will be present, but the 1609// value will be replaced with "sensitive". 1610func (s ConfidenceScore) GoString() string { 1611 return s.String() 1612} 1613 1614// SetScore sets the Score field's value. 1615func (s *ConfidenceScore) SetScore(v float64) *ConfidenceScore { 1616 s.Score = &v 1617 return s 1618} 1619 1620// The initial event sent from the application to Amazon Lex V2 to configure 1621// the conversation, including session and request attributes and the response 1622// content type. 1623type ConfigurationEvent struct { 1624 _ struct{} `type:"structure"` 1625 1626 // A timestamp set by the client of the date and time that the event was sent 1627 // to Amazon Lex V2. 1628 ClientTimestampMillis *int64 `locationName:"clientTimestampMillis" type:"long"` 1629 1630 // Determines whether Amazon Lex V2 should send audio responses to the client 1631 // application. 1632 // 1633 // Set this field to false when the client is operating in a playback mode where 1634 // audio responses are played to the user. If the client isn't operating in 1635 // playback mode, such as a text chat application, set this to true so that 1636 // Amazon Lex V2 doesn't wait for the prompt to finish playing on the client. 1637 DisablePlayback *bool `locationName:"disablePlayback" type:"boolean"` 1638 1639 // A unique identifier that your application assigns to the event. You can use 1640 // this to identify events in logs. 1641 EventId *string `locationName:"eventId" min:"2" type:"string"` 1642 1643 // Request-specific information passed between the client application and Amazon 1644 // Lex V2. 1645 // 1646 // The namespace x-amz-lex: is reserved for special attributes. Don't create 1647 // any request attributes for prefix x-amz-lex:. 1648 RequestAttributes map[string]*string `locationName:"requestAttributes" type:"map"` 1649 1650 // The message that Amazon Lex V2 returns in the response can be either text 1651 // or speech based on the responseContentType value. 1652 // 1653 // * If the value is text/plain;charset=utf-8, Amazon Lex V2 returns text 1654 // in the response. 1655 // 1656 // * If the value begins with audio/, Amazon Lex V2 returns speech in the 1657 // response. Amazon Lex V2 uses Amazon Polly to generate the speech using 1658 // the configuration that you specified in the requestContentType parameter. 1659 // For example, if you specify audio/mpeg as the value, Amazon Lex V2 returns 1660 // speech in the MPEG format. 1661 // 1662 // * If the value is audio/pcm, the speech returned is audio/pcm in 16-bit, 1663 // little-endian format. 1664 // 1665 // * The following are the accepted values: audio/mpeg audio/ogg audio/pcm 1666 // audio/* (defaults to mpeg) text/plain; charset=utf-8 1667 // 1668 // ResponseContentType is a required field 1669 ResponseContentType *string `locationName:"responseContentType" min:"1" type:"string" required:"true"` 1670 1671 // The state of the user's session with Amazon Lex V2. 1672 SessionState *SessionState `locationName:"sessionState" type:"structure"` 1673 1674 // A list of messages to send to the user. 1675 WelcomeMessages []*Message `locationName:"welcomeMessages" type:"list"` 1676} 1677 1678// String returns the string representation. 1679// 1680// API parameter values that are decorated as "sensitive" in the API will not 1681// be included in the string output. The member name will be present, but the 1682// value will be replaced with "sensitive". 1683func (s ConfigurationEvent) String() string { 1684 return awsutil.Prettify(s) 1685} 1686 1687// GoString returns the string representation. 1688// 1689// API parameter values that are decorated as "sensitive" in the API will not 1690// be included in the string output. The member name will be present, but the 1691// value will be replaced with "sensitive". 1692func (s ConfigurationEvent) GoString() string { 1693 return s.String() 1694} 1695 1696// SetClientTimestampMillis sets the ClientTimestampMillis field's value. 1697func (s *ConfigurationEvent) SetClientTimestampMillis(v int64) *ConfigurationEvent { 1698 s.ClientTimestampMillis = &v 1699 return s 1700} 1701 1702// SetDisablePlayback sets the DisablePlayback field's value. 1703func (s *ConfigurationEvent) SetDisablePlayback(v bool) *ConfigurationEvent { 1704 s.DisablePlayback = &v 1705 return s 1706} 1707 1708// SetEventId sets the EventId field's value. 1709func (s *ConfigurationEvent) SetEventId(v string) *ConfigurationEvent { 1710 s.EventId = &v 1711 return s 1712} 1713 1714// SetRequestAttributes sets the RequestAttributes field's value. 1715func (s *ConfigurationEvent) SetRequestAttributes(v map[string]*string) *ConfigurationEvent { 1716 s.RequestAttributes = v 1717 return s 1718} 1719 1720// SetResponseContentType sets the ResponseContentType field's value. 1721func (s *ConfigurationEvent) SetResponseContentType(v string) *ConfigurationEvent { 1722 s.ResponseContentType = &v 1723 return s 1724} 1725 1726// SetSessionState sets the SessionState field's value. 1727func (s *ConfigurationEvent) SetSessionState(v *SessionState) *ConfigurationEvent { 1728 s.SessionState = v 1729 return s 1730} 1731 1732// SetWelcomeMessages sets the WelcomeMessages field's value. 1733func (s *ConfigurationEvent) SetWelcomeMessages(v []*Message) *ConfigurationEvent { 1734 s.WelcomeMessages = v 1735 return s 1736} 1737 1738// The ConfigurationEvent is and event in the StartConversationRequestEventStream group of events. 1739func (s *ConfigurationEvent) eventStartConversationRequestEventStream() {} 1740 1741// UnmarshalEvent unmarshals the EventStream Message into the ConfigurationEvent value. 1742// This method is only used internally within the SDK's EventStream handling. 1743func (s *ConfigurationEvent) UnmarshalEvent( 1744 payloadUnmarshaler protocol.PayloadUnmarshaler, 1745 msg eventstream.Message, 1746) error { 1747 if err := payloadUnmarshaler.UnmarshalPayload( 1748 bytes.NewReader(msg.Payload), s, 1749 ); err != nil { 1750 return err 1751 } 1752 return nil 1753} 1754 1755// MarshalEvent marshals the type into an stream event value. This method 1756// should only used internally within the SDK's EventStream handling. 1757func (s *ConfigurationEvent) MarshalEvent(pm protocol.PayloadMarshaler) (msg eventstream.Message, err error) { 1758 msg.Headers.Set(eventstreamapi.MessageTypeHeader, eventstream.StringValue(eventstreamapi.EventMessageType)) 1759 var buf bytes.Buffer 1760 if err = pm.MarshalPayload(&buf, s); err != nil { 1761 return eventstream.Message{}, err 1762 } 1763 msg.Payload = buf.Bytes() 1764 return msg, err 1765} 1766 1767type ConflictException struct { 1768 _ struct{} `type:"structure"` 1769 RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` 1770 1771 Message_ *string `locationName:"message" type:"string"` 1772} 1773 1774// String returns the string representation. 1775// 1776// API parameter values that are decorated as "sensitive" in the API will not 1777// be included in the string output. The member name will be present, but the 1778// value will be replaced with "sensitive". 1779func (s ConflictException) String() string { 1780 return awsutil.Prettify(s) 1781} 1782 1783// GoString returns the string representation. 1784// 1785// API parameter values that are decorated as "sensitive" in the API will not 1786// be included in the string output. The member name will be present, but the 1787// value will be replaced with "sensitive". 1788func (s ConflictException) GoString() string { 1789 return s.String() 1790} 1791 1792// The ConflictException is and event in the StartConversationResponseEventStream group of events. 1793func (s *ConflictException) eventStartConversationResponseEventStream() {} 1794 1795// UnmarshalEvent unmarshals the EventStream Message into the ConflictException value. 1796// This method is only used internally within the SDK's EventStream handling. 1797func (s *ConflictException) UnmarshalEvent( 1798 payloadUnmarshaler protocol.PayloadUnmarshaler, 1799 msg eventstream.Message, 1800) error { 1801 if err := payloadUnmarshaler.UnmarshalPayload( 1802 bytes.NewReader(msg.Payload), s, 1803 ); err != nil { 1804 return err 1805 } 1806 return nil 1807} 1808 1809// MarshalEvent marshals the type into an stream event value. This method 1810// should only used internally within the SDK's EventStream handling. 1811func (s *ConflictException) MarshalEvent(pm protocol.PayloadMarshaler) (msg eventstream.Message, err error) { 1812 msg.Headers.Set(eventstreamapi.MessageTypeHeader, eventstream.StringValue(eventstreamapi.ExceptionMessageType)) 1813 var buf bytes.Buffer 1814 if err = pm.MarshalPayload(&buf, s); err != nil { 1815 return eventstream.Message{}, err 1816 } 1817 msg.Payload = buf.Bytes() 1818 return msg, err 1819} 1820 1821func newErrorConflictException(v protocol.ResponseMetadata) error { 1822 return &ConflictException{ 1823 RespMetadata: v, 1824 } 1825} 1826 1827// Code returns the exception type name. 1828func (s *ConflictException) Code() string { 1829 return "ConflictException" 1830} 1831 1832// Message returns the exception's message. 1833func (s *ConflictException) Message() string { 1834 if s.Message_ != nil { 1835 return *s.Message_ 1836 } 1837 return "" 1838} 1839 1840// OrigErr always returns nil, satisfies awserr.Error interface. 1841func (s *ConflictException) OrigErr() error { 1842 return nil 1843} 1844 1845func (s *ConflictException) Error() string { 1846 return fmt.Sprintf("%s: %s", s.Code(), s.Message()) 1847} 1848 1849// Status code returns the HTTP status code for the request's response error. 1850func (s *ConflictException) StatusCode() int { 1851 return s.RespMetadata.StatusCode 1852} 1853 1854// RequestID returns the service's response RequestID for request. 1855func (s *ConflictException) RequestID() string { 1856 return s.RespMetadata.RequestID 1857} 1858 1859// A DTMF character sent from the client application. DTMF characters are typically 1860// sent from a phone keypad to represent numbers. For example, you can have 1861// Amazon Lex V2 process a credit card number input from a phone. 1862type DTMFInputEvent struct { 1863 _ struct{} `type:"structure"` 1864 1865 // A timestamp set by the client of the date and time that the event was sent 1866 // to Amazon Lex V2. 1867 ClientTimestampMillis *int64 `locationName:"clientTimestampMillis" type:"long"` 1868 1869 // A unique identifier that your application assigns to the event. You can use 1870 // this to identify events in logs. 1871 EventId *string `locationName:"eventId" min:"2" type:"string"` 1872 1873 // The DTMF character that the user pressed. The allowed characters are A - 1874 // D, 0 - 9, # and *. 1875 // 1876 // InputCharacter is a sensitive parameter and its value will be 1877 // replaced with "sensitive" in string returned by DTMFInputEvent's 1878 // String and GoString methods. 1879 // 1880 // InputCharacter is a required field 1881 InputCharacter *string `locationName:"inputCharacter" min:"1" type:"string" required:"true" sensitive:"true"` 1882} 1883 1884// String returns the string representation. 1885// 1886// API parameter values that are decorated as "sensitive" in the API will not 1887// be included in the string output. The member name will be present, but the 1888// value will be replaced with "sensitive". 1889func (s DTMFInputEvent) String() string { 1890 return awsutil.Prettify(s) 1891} 1892 1893// GoString returns the string representation. 1894// 1895// API parameter values that are decorated as "sensitive" in the API will not 1896// be included in the string output. The member name will be present, but the 1897// value will be replaced with "sensitive". 1898func (s DTMFInputEvent) GoString() string { 1899 return s.String() 1900} 1901 1902// SetClientTimestampMillis sets the ClientTimestampMillis field's value. 1903func (s *DTMFInputEvent) SetClientTimestampMillis(v int64) *DTMFInputEvent { 1904 s.ClientTimestampMillis = &v 1905 return s 1906} 1907 1908// SetEventId sets the EventId field's value. 1909func (s *DTMFInputEvent) SetEventId(v string) *DTMFInputEvent { 1910 s.EventId = &v 1911 return s 1912} 1913 1914// SetInputCharacter sets the InputCharacter field's value. 1915func (s *DTMFInputEvent) SetInputCharacter(v string) *DTMFInputEvent { 1916 s.InputCharacter = &v 1917 return s 1918} 1919 1920// The DTMFInputEvent is and event in the StartConversationRequestEventStream group of events. 1921func (s *DTMFInputEvent) eventStartConversationRequestEventStream() {} 1922 1923// UnmarshalEvent unmarshals the EventStream Message into the DTMFInputEvent value. 1924// This method is only used internally within the SDK's EventStream handling. 1925func (s *DTMFInputEvent) UnmarshalEvent( 1926 payloadUnmarshaler protocol.PayloadUnmarshaler, 1927 msg eventstream.Message, 1928) error { 1929 if err := payloadUnmarshaler.UnmarshalPayload( 1930 bytes.NewReader(msg.Payload), s, 1931 ); err != nil { 1932 return err 1933 } 1934 return nil 1935} 1936 1937// MarshalEvent marshals the type into an stream event value. This method 1938// should only used internally within the SDK's EventStream handling. 1939func (s *DTMFInputEvent) MarshalEvent(pm protocol.PayloadMarshaler) (msg eventstream.Message, err error) { 1940 msg.Headers.Set(eventstreamapi.MessageTypeHeader, eventstream.StringValue(eventstreamapi.EventMessageType)) 1941 var buf bytes.Buffer 1942 if err = pm.MarshalPayload(&buf, s); err != nil { 1943 return eventstream.Message{}, err 1944 } 1945 msg.Payload = buf.Bytes() 1946 return msg, err 1947} 1948 1949type DeleteSessionInput struct { 1950 _ struct{} `type:"structure" nopayload:"true"` 1951 1952 // The alias identifier in use for the bot that contains the session data. 1953 // 1954 // BotAliasId is a required field 1955 BotAliasId *string `location:"uri" locationName:"botAliasId" type:"string" required:"true"` 1956 1957 // The identifier of the bot that contains the session data. 1958 // 1959 // BotId is a required field 1960 BotId *string `location:"uri" locationName:"botId" min:"10" type:"string" required:"true"` 1961 1962 // The locale where the session is in use. 1963 // 1964 // LocaleId is a required field 1965 LocaleId *string `location:"uri" locationName:"localeId" min:"1" type:"string" required:"true"` 1966 1967 // The identifier of the session to delete. 1968 // 1969 // SessionId is a required field 1970 SessionId *string `location:"uri" locationName:"sessionId" min:"2" type:"string" required:"true"` 1971} 1972 1973// String returns the string representation. 1974// 1975// API parameter values that are decorated as "sensitive" in the API will not 1976// be included in the string output. The member name will be present, but the 1977// value will be replaced with "sensitive". 1978func (s DeleteSessionInput) String() string { 1979 return awsutil.Prettify(s) 1980} 1981 1982// GoString returns the string representation. 1983// 1984// API parameter values that are decorated as "sensitive" in the API will not 1985// be included in the string output. The member name will be present, but the 1986// value will be replaced with "sensitive". 1987func (s DeleteSessionInput) GoString() string { 1988 return s.String() 1989} 1990 1991// Validate inspects the fields of the type to determine if they are valid. 1992func (s *DeleteSessionInput) Validate() error { 1993 invalidParams := request.ErrInvalidParams{Context: "DeleteSessionInput"} 1994 if s.BotAliasId == nil { 1995 invalidParams.Add(request.NewErrParamRequired("BotAliasId")) 1996 } 1997 if s.BotAliasId != nil && len(*s.BotAliasId) < 1 { 1998 invalidParams.Add(request.NewErrParamMinLen("BotAliasId", 1)) 1999 } 2000 if s.BotId == nil { 2001 invalidParams.Add(request.NewErrParamRequired("BotId")) 2002 } 2003 if s.BotId != nil && len(*s.BotId) < 10 { 2004 invalidParams.Add(request.NewErrParamMinLen("BotId", 10)) 2005 } 2006 if s.LocaleId == nil { 2007 invalidParams.Add(request.NewErrParamRequired("LocaleId")) 2008 } 2009 if s.LocaleId != nil && len(*s.LocaleId) < 1 { 2010 invalidParams.Add(request.NewErrParamMinLen("LocaleId", 1)) 2011 } 2012 if s.SessionId == nil { 2013 invalidParams.Add(request.NewErrParamRequired("SessionId")) 2014 } 2015 if s.SessionId != nil && len(*s.SessionId) < 2 { 2016 invalidParams.Add(request.NewErrParamMinLen("SessionId", 2)) 2017 } 2018 2019 if invalidParams.Len() > 0 { 2020 return invalidParams 2021 } 2022 return nil 2023} 2024 2025// SetBotAliasId sets the BotAliasId field's value. 2026func (s *DeleteSessionInput) SetBotAliasId(v string) *DeleteSessionInput { 2027 s.BotAliasId = &v 2028 return s 2029} 2030 2031// SetBotId sets the BotId field's value. 2032func (s *DeleteSessionInput) SetBotId(v string) *DeleteSessionInput { 2033 s.BotId = &v 2034 return s 2035} 2036 2037// SetLocaleId sets the LocaleId field's value. 2038func (s *DeleteSessionInput) SetLocaleId(v string) *DeleteSessionInput { 2039 s.LocaleId = &v 2040 return s 2041} 2042 2043// SetSessionId sets the SessionId field's value. 2044func (s *DeleteSessionInput) SetSessionId(v string) *DeleteSessionInput { 2045 s.SessionId = &v 2046 return s 2047} 2048 2049type DeleteSessionOutput struct { 2050 _ struct{} `type:"structure"` 2051 2052 // The alias identifier in use for the bot that contained the session data. 2053 BotAliasId *string `locationName:"botAliasId" type:"string"` 2054 2055 // The identifier of the bot that contained the session data. 2056 BotId *string `locationName:"botId" min:"10" type:"string"` 2057 2058 // The locale where the session was used. 2059 LocaleId *string `locationName:"localeId" min:"1" type:"string"` 2060 2061 // The identifier of the deleted session. 2062 SessionId *string `locationName:"sessionId" min:"2" type:"string"` 2063} 2064 2065// String returns the string representation. 2066// 2067// API parameter values that are decorated as "sensitive" in the API will not 2068// be included in the string output. The member name will be present, but the 2069// value will be replaced with "sensitive". 2070func (s DeleteSessionOutput) String() string { 2071 return awsutil.Prettify(s) 2072} 2073 2074// GoString returns the string representation. 2075// 2076// API parameter values that are decorated as "sensitive" in the API will not 2077// be included in the string output. The member name will be present, but the 2078// value will be replaced with "sensitive". 2079func (s DeleteSessionOutput) GoString() string { 2080 return s.String() 2081} 2082 2083// SetBotAliasId sets the BotAliasId field's value. 2084func (s *DeleteSessionOutput) SetBotAliasId(v string) *DeleteSessionOutput { 2085 s.BotAliasId = &v 2086 return s 2087} 2088 2089// SetBotId sets the BotId field's value. 2090func (s *DeleteSessionOutput) SetBotId(v string) *DeleteSessionOutput { 2091 s.BotId = &v 2092 return s 2093} 2094 2095// SetLocaleId sets the LocaleId field's value. 2096func (s *DeleteSessionOutput) SetLocaleId(v string) *DeleteSessionOutput { 2097 s.LocaleId = &v 2098 return s 2099} 2100 2101// SetSessionId sets the SessionId field's value. 2102func (s *DeleteSessionOutput) SetSessionId(v string) *DeleteSessionOutput { 2103 s.SessionId = &v 2104 return s 2105} 2106 2107type DependencyFailedException struct { 2108 _ struct{} `type:"structure"` 2109 RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` 2110 2111 Message_ *string `locationName:"message" type:"string"` 2112} 2113 2114// String returns the string representation. 2115// 2116// API parameter values that are decorated as "sensitive" in the API will not 2117// be included in the string output. The member name will be present, but the 2118// value will be replaced with "sensitive". 2119func (s DependencyFailedException) String() string { 2120 return awsutil.Prettify(s) 2121} 2122 2123// GoString returns the string representation. 2124// 2125// API parameter values that are decorated as "sensitive" in the API will not 2126// be included in the string output. The member name will be present, but the 2127// value will be replaced with "sensitive". 2128func (s DependencyFailedException) GoString() string { 2129 return s.String() 2130} 2131 2132// The DependencyFailedException is and event in the StartConversationResponseEventStream group of events. 2133func (s *DependencyFailedException) eventStartConversationResponseEventStream() {} 2134 2135// UnmarshalEvent unmarshals the EventStream Message into the DependencyFailedException value. 2136// This method is only used internally within the SDK's EventStream handling. 2137func (s *DependencyFailedException) UnmarshalEvent( 2138 payloadUnmarshaler protocol.PayloadUnmarshaler, 2139 msg eventstream.Message, 2140) error { 2141 if err := payloadUnmarshaler.UnmarshalPayload( 2142 bytes.NewReader(msg.Payload), s, 2143 ); err != nil { 2144 return err 2145 } 2146 return nil 2147} 2148 2149// MarshalEvent marshals the type into an stream event value. This method 2150// should only used internally within the SDK's EventStream handling. 2151func (s *DependencyFailedException) MarshalEvent(pm protocol.PayloadMarshaler) (msg eventstream.Message, err error) { 2152 msg.Headers.Set(eventstreamapi.MessageTypeHeader, eventstream.StringValue(eventstreamapi.ExceptionMessageType)) 2153 var buf bytes.Buffer 2154 if err = pm.MarshalPayload(&buf, s); err != nil { 2155 return eventstream.Message{}, err 2156 } 2157 msg.Payload = buf.Bytes() 2158 return msg, err 2159} 2160 2161func newErrorDependencyFailedException(v protocol.ResponseMetadata) error { 2162 return &DependencyFailedException{ 2163 RespMetadata: v, 2164 } 2165} 2166 2167// Code returns the exception type name. 2168func (s *DependencyFailedException) Code() string { 2169 return "DependencyFailedException" 2170} 2171 2172// Message returns the exception's message. 2173func (s *DependencyFailedException) Message() string { 2174 if s.Message_ != nil { 2175 return *s.Message_ 2176 } 2177 return "" 2178} 2179 2180// OrigErr always returns nil, satisfies awserr.Error interface. 2181func (s *DependencyFailedException) OrigErr() error { 2182 return nil 2183} 2184 2185func (s *DependencyFailedException) Error() string { 2186 return fmt.Sprintf("%s: %s", s.Code(), s.Message()) 2187} 2188 2189// Status code returns the HTTP status code for the request's response error. 2190func (s *DependencyFailedException) StatusCode() int { 2191 return s.RespMetadata.StatusCode 2192} 2193 2194// RequestID returns the service's response RequestID for request. 2195func (s *DependencyFailedException) RequestID() string { 2196 return s.RespMetadata.RequestID 2197} 2198 2199// The next action that Amazon Lex V2 should take. 2200type DialogAction struct { 2201 _ struct{} `type:"structure"` 2202 2203 // The name of the slot that should be elicited from the user. 2204 SlotToElicit *string `locationName:"slotToElicit" min:"1" type:"string"` 2205 2206 // The next action that the bot should take in its interaction with the user. 2207 // The possible values are: 2208 // 2209 // * Close - Indicates that there will not be a response from the user. For 2210 // example, the statement "Your order has been placed" does not require a 2211 // response. 2212 // 2213 // * ConfirmIntent - The next action is asking the user if the intent is 2214 // complete and ready to be fulfilled. This is a yes/no question such as 2215 // "Place the order?" 2216 // 2217 // * Delegate - The next action is determined by Amazon Lex V2. 2218 // 2219 // * ElicitSlot - The next action is to elicit a slot value from the user. 2220 // 2221 // Type is a required field 2222 Type *string `locationName:"type" type:"string" required:"true" enum:"DialogActionType"` 2223} 2224 2225// String returns the string representation. 2226// 2227// API parameter values that are decorated as "sensitive" in the API will not 2228// be included in the string output. The member name will be present, but the 2229// value will be replaced with "sensitive". 2230func (s DialogAction) String() string { 2231 return awsutil.Prettify(s) 2232} 2233 2234// GoString returns the string representation. 2235// 2236// API parameter values that are decorated as "sensitive" in the API will not 2237// be included in the string output. The member name will be present, but the 2238// value will be replaced with "sensitive". 2239func (s DialogAction) GoString() string { 2240 return s.String() 2241} 2242 2243// Validate inspects the fields of the type to determine if they are valid. 2244func (s *DialogAction) Validate() error { 2245 invalidParams := request.ErrInvalidParams{Context: "DialogAction"} 2246 if s.SlotToElicit != nil && len(*s.SlotToElicit) < 1 { 2247 invalidParams.Add(request.NewErrParamMinLen("SlotToElicit", 1)) 2248 } 2249 if s.Type == nil { 2250 invalidParams.Add(request.NewErrParamRequired("Type")) 2251 } 2252 2253 if invalidParams.Len() > 0 { 2254 return invalidParams 2255 } 2256 return nil 2257} 2258 2259// SetSlotToElicit sets the SlotToElicit field's value. 2260func (s *DialogAction) SetSlotToElicit(v string) *DialogAction { 2261 s.SlotToElicit = &v 2262 return s 2263} 2264 2265// SetType sets the Type field's value. 2266func (s *DialogAction) SetType(v string) *DialogAction { 2267 s.Type = &v 2268 return s 2269} 2270 2271// A notification from the client that it is disconnecting from Amazon Lex V2. 2272// Sending a DisconnectionEvent event is optional, but can help identify a conversation 2273// in logs. 2274type DisconnectionEvent struct { 2275 _ struct{} `type:"structure"` 2276 2277 // A timestamp set by the client of the date and time that the event was sent 2278 // to Amazon Lex V2. 2279 ClientTimestampMillis *int64 `locationName:"clientTimestampMillis" type:"long"` 2280 2281 // A unique identifier that your application assigns to the event. You can use 2282 // this to identify events in logs. 2283 EventId *string `locationName:"eventId" min:"2" type:"string"` 2284} 2285 2286// String returns the string representation. 2287// 2288// API parameter values that are decorated as "sensitive" in the API will not 2289// be included in the string output. The member name will be present, but the 2290// value will be replaced with "sensitive". 2291func (s DisconnectionEvent) String() string { 2292 return awsutil.Prettify(s) 2293} 2294 2295// GoString returns the string representation. 2296// 2297// API parameter values that are decorated as "sensitive" in the API will not 2298// be included in the string output. The member name will be present, but the 2299// value will be replaced with "sensitive". 2300func (s DisconnectionEvent) GoString() string { 2301 return s.String() 2302} 2303 2304// SetClientTimestampMillis sets the ClientTimestampMillis field's value. 2305func (s *DisconnectionEvent) SetClientTimestampMillis(v int64) *DisconnectionEvent { 2306 s.ClientTimestampMillis = &v 2307 return s 2308} 2309 2310// SetEventId sets the EventId field's value. 2311func (s *DisconnectionEvent) SetEventId(v string) *DisconnectionEvent { 2312 s.EventId = &v 2313 return s 2314} 2315 2316// The DisconnectionEvent is and event in the StartConversationRequestEventStream group of events. 2317func (s *DisconnectionEvent) eventStartConversationRequestEventStream() {} 2318 2319// UnmarshalEvent unmarshals the EventStream Message into the DisconnectionEvent value. 2320// This method is only used internally within the SDK's EventStream handling. 2321func (s *DisconnectionEvent) UnmarshalEvent( 2322 payloadUnmarshaler protocol.PayloadUnmarshaler, 2323 msg eventstream.Message, 2324) error { 2325 if err := payloadUnmarshaler.UnmarshalPayload( 2326 bytes.NewReader(msg.Payload), s, 2327 ); err != nil { 2328 return err 2329 } 2330 return nil 2331} 2332 2333// MarshalEvent marshals the type into an stream event value. This method 2334// should only used internally within the SDK's EventStream handling. 2335func (s *DisconnectionEvent) MarshalEvent(pm protocol.PayloadMarshaler) (msg eventstream.Message, err error) { 2336 msg.Headers.Set(eventstreamapi.MessageTypeHeader, eventstream.StringValue(eventstreamapi.EventMessageType)) 2337 var buf bytes.Buffer 2338 if err = pm.MarshalPayload(&buf, s); err != nil { 2339 return eventstream.Message{}, err 2340 } 2341 msg.Payload = buf.Bytes() 2342 return msg, err 2343} 2344 2345type GetSessionInput struct { 2346 _ struct{} `type:"structure" nopayload:"true"` 2347 2348 // The alias identifier in use for the bot that contains the session data. 2349 // 2350 // BotAliasId is a required field 2351 BotAliasId *string `location:"uri" locationName:"botAliasId" type:"string" required:"true"` 2352 2353 // The identifier of the bot that contains the session data. 2354 // 2355 // BotId is a required field 2356 BotId *string `location:"uri" locationName:"botId" min:"10" type:"string" required:"true"` 2357 2358 // The locale where the session is in use. 2359 // 2360 // LocaleId is a required field 2361 LocaleId *string `location:"uri" locationName:"localeId" min:"1" type:"string" required:"true"` 2362 2363 // The identifier of the session to return. 2364 // 2365 // SessionId is a required field 2366 SessionId *string `location:"uri" locationName:"sessionId" min:"2" type:"string" required:"true"` 2367} 2368 2369// String returns the string representation. 2370// 2371// API parameter values that are decorated as "sensitive" in the API will not 2372// be included in the string output. The member name will be present, but the 2373// value will be replaced with "sensitive". 2374func (s GetSessionInput) String() string { 2375 return awsutil.Prettify(s) 2376} 2377 2378// GoString returns the string representation. 2379// 2380// API parameter values that are decorated as "sensitive" in the API will not 2381// be included in the string output. The member name will be present, but the 2382// value will be replaced with "sensitive". 2383func (s GetSessionInput) GoString() string { 2384 return s.String() 2385} 2386 2387// Validate inspects the fields of the type to determine if they are valid. 2388func (s *GetSessionInput) Validate() error { 2389 invalidParams := request.ErrInvalidParams{Context: "GetSessionInput"} 2390 if s.BotAliasId == nil { 2391 invalidParams.Add(request.NewErrParamRequired("BotAliasId")) 2392 } 2393 if s.BotAliasId != nil && len(*s.BotAliasId) < 1 { 2394 invalidParams.Add(request.NewErrParamMinLen("BotAliasId", 1)) 2395 } 2396 if s.BotId == nil { 2397 invalidParams.Add(request.NewErrParamRequired("BotId")) 2398 } 2399 if s.BotId != nil && len(*s.BotId) < 10 { 2400 invalidParams.Add(request.NewErrParamMinLen("BotId", 10)) 2401 } 2402 if s.LocaleId == nil { 2403 invalidParams.Add(request.NewErrParamRequired("LocaleId")) 2404 } 2405 if s.LocaleId != nil && len(*s.LocaleId) < 1 { 2406 invalidParams.Add(request.NewErrParamMinLen("LocaleId", 1)) 2407 } 2408 if s.SessionId == nil { 2409 invalidParams.Add(request.NewErrParamRequired("SessionId")) 2410 } 2411 if s.SessionId != nil && len(*s.SessionId) < 2 { 2412 invalidParams.Add(request.NewErrParamMinLen("SessionId", 2)) 2413 } 2414 2415 if invalidParams.Len() > 0 { 2416 return invalidParams 2417 } 2418 return nil 2419} 2420 2421// SetBotAliasId sets the BotAliasId field's value. 2422func (s *GetSessionInput) SetBotAliasId(v string) *GetSessionInput { 2423 s.BotAliasId = &v 2424 return s 2425} 2426 2427// SetBotId sets the BotId field's value. 2428func (s *GetSessionInput) SetBotId(v string) *GetSessionInput { 2429 s.BotId = &v 2430 return s 2431} 2432 2433// SetLocaleId sets the LocaleId field's value. 2434func (s *GetSessionInput) SetLocaleId(v string) *GetSessionInput { 2435 s.LocaleId = &v 2436 return s 2437} 2438 2439// SetSessionId sets the SessionId field's value. 2440func (s *GetSessionInput) SetSessionId(v string) *GetSessionInput { 2441 s.SessionId = &v 2442 return s 2443} 2444 2445type GetSessionOutput struct { 2446 _ struct{} `type:"structure"` 2447 2448 // A list of intents that Amazon Lex V2 determined might satisfy the user's 2449 // utterance. 2450 // 2451 // Each interpretation includes the intent, a score that indicates how confident 2452 // Amazon Lex V2 is that the interpretation is the correct one, and an optional 2453 // sentiment response that indicates the sentiment expressed in the utterance. 2454 Interpretations []*Interpretation `locationName:"interpretations" type:"list"` 2455 2456 // A list of messages that were last sent to the user. The messages are ordered 2457 // based on the order that your returned the messages from your Lambda function 2458 // or the order that messages are defined in the bot. 2459 Messages []*Message `locationName:"messages" type:"list"` 2460 2461 // The identifier of the returned session. 2462 SessionId *string `locationName:"sessionId" min:"1" type:"string"` 2463 2464 // Represents the current state of the dialog between the user and the bot. 2465 // 2466 // You can use this to determine the progress of the conversation and what the 2467 // next action might be. 2468 SessionState *SessionState `locationName:"sessionState" type:"structure"` 2469} 2470 2471// String returns the string representation. 2472// 2473// API parameter values that are decorated as "sensitive" in the API will not 2474// be included in the string output. The member name will be present, but the 2475// value will be replaced with "sensitive". 2476func (s GetSessionOutput) String() string { 2477 return awsutil.Prettify(s) 2478} 2479 2480// GoString returns the string representation. 2481// 2482// API parameter values that are decorated as "sensitive" in the API will not 2483// be included in the string output. The member name will be present, but the 2484// value will be replaced with "sensitive". 2485func (s GetSessionOutput) GoString() string { 2486 return s.String() 2487} 2488 2489// SetInterpretations sets the Interpretations field's value. 2490func (s *GetSessionOutput) SetInterpretations(v []*Interpretation) *GetSessionOutput { 2491 s.Interpretations = v 2492 return s 2493} 2494 2495// SetMessages sets the Messages field's value. 2496func (s *GetSessionOutput) SetMessages(v []*Message) *GetSessionOutput { 2497 s.Messages = v 2498 return s 2499} 2500 2501// SetSessionId sets the SessionId field's value. 2502func (s *GetSessionOutput) SetSessionId(v string) *GetSessionOutput { 2503 s.SessionId = &v 2504 return s 2505} 2506 2507// SetSessionState sets the SessionState field's value. 2508func (s *GetSessionOutput) SetSessionState(v *SessionState) *GetSessionOutput { 2509 s.SessionState = v 2510 return s 2511} 2512 2513// Event that Amazon Lex V2 sends to indicate that the stream is still open 2514// between the client application and Amazon Lex V2 2515type HeartbeatEvent struct { 2516 _ struct{} `type:"structure"` 2517 2518 // A unique identifier of the event sent by Amazon Lex V2. The identifier is 2519 // in the form RESPONSE-N, where N is a number starting with one and incremented 2520 // for each event sent by Amazon Lex V2 in the current session. 2521 EventId *string `locationName:"eventId" min:"2" type:"string"` 2522} 2523 2524// String returns the string representation. 2525// 2526// API parameter values that are decorated as "sensitive" in the API will not 2527// be included in the string output. The member name will be present, but the 2528// value will be replaced with "sensitive". 2529func (s HeartbeatEvent) String() string { 2530 return awsutil.Prettify(s) 2531} 2532 2533// GoString returns the string representation. 2534// 2535// API parameter values that are decorated as "sensitive" in the API will not 2536// be included in the string output. The member name will be present, but the 2537// value will be replaced with "sensitive". 2538func (s HeartbeatEvent) GoString() string { 2539 return s.String() 2540} 2541 2542// SetEventId sets the EventId field's value. 2543func (s *HeartbeatEvent) SetEventId(v string) *HeartbeatEvent { 2544 s.EventId = &v 2545 return s 2546} 2547 2548// The HeartbeatEvent is and event in the StartConversationResponseEventStream group of events. 2549func (s *HeartbeatEvent) eventStartConversationResponseEventStream() {} 2550 2551// UnmarshalEvent unmarshals the EventStream Message into the HeartbeatEvent value. 2552// This method is only used internally within the SDK's EventStream handling. 2553func (s *HeartbeatEvent) UnmarshalEvent( 2554 payloadUnmarshaler protocol.PayloadUnmarshaler, 2555 msg eventstream.Message, 2556) error { 2557 if err := payloadUnmarshaler.UnmarshalPayload( 2558 bytes.NewReader(msg.Payload), s, 2559 ); err != nil { 2560 return err 2561 } 2562 return nil 2563} 2564 2565// MarshalEvent marshals the type into an stream event value. This method 2566// should only used internally within the SDK's EventStream handling. 2567func (s *HeartbeatEvent) MarshalEvent(pm protocol.PayloadMarshaler) (msg eventstream.Message, err error) { 2568 msg.Headers.Set(eventstreamapi.MessageTypeHeader, eventstream.StringValue(eventstreamapi.EventMessageType)) 2569 var buf bytes.Buffer 2570 if err = pm.MarshalPayload(&buf, s); err != nil { 2571 return eventstream.Message{}, err 2572 } 2573 msg.Payload = buf.Bytes() 2574 return msg, err 2575} 2576 2577// A card that is shown to the user by a messaging platform. You define the 2578// contents of the card, the card is displayed by the platform. 2579// 2580// When you use a response card, the response from the user is constrained to 2581// the text associated with a button on the card. 2582type ImageResponseCard struct { 2583 _ struct{} `type:"structure"` 2584 2585 // A list of buttons that should be displayed on the response card. The arrangement 2586 // of the buttons is determined by the platform that displays the button. 2587 Buttons []*Button `locationName:"buttons" type:"list"` 2588 2589 // The URL of an image to display on the response card. The image URL must be 2590 // publicly available so that the platform displaying the response card has 2591 // access to the image. 2592 ImageUrl *string `locationName:"imageUrl" min:"1" type:"string"` 2593 2594 // The subtitle to display on the response card. The format of the subtitle 2595 // is determined by the platform displaying the response card. 2596 Subtitle *string `locationName:"subtitle" min:"1" type:"string"` 2597 2598 // The title to display on the response card. The format of the title is determined 2599 // by the platform displaying the response card. 2600 // 2601 // Title is a required field 2602 Title *string `locationName:"title" min:"1" type:"string" required:"true"` 2603} 2604 2605// String returns the string representation. 2606// 2607// API parameter values that are decorated as "sensitive" in the API will not 2608// be included in the string output. The member name will be present, but the 2609// value will be replaced with "sensitive". 2610func (s ImageResponseCard) String() string { 2611 return awsutil.Prettify(s) 2612} 2613 2614// GoString returns the string representation. 2615// 2616// API parameter values that are decorated as "sensitive" in the API will not 2617// be included in the string output. The member name will be present, but the 2618// value will be replaced with "sensitive". 2619func (s ImageResponseCard) GoString() string { 2620 return s.String() 2621} 2622 2623// Validate inspects the fields of the type to determine if they are valid. 2624func (s *ImageResponseCard) Validate() error { 2625 invalidParams := request.ErrInvalidParams{Context: "ImageResponseCard"} 2626 if s.ImageUrl != nil && len(*s.ImageUrl) < 1 { 2627 invalidParams.Add(request.NewErrParamMinLen("ImageUrl", 1)) 2628 } 2629 if s.Subtitle != nil && len(*s.Subtitle) < 1 { 2630 invalidParams.Add(request.NewErrParamMinLen("Subtitle", 1)) 2631 } 2632 if s.Title == nil { 2633 invalidParams.Add(request.NewErrParamRequired("Title")) 2634 } 2635 if s.Title != nil && len(*s.Title) < 1 { 2636 invalidParams.Add(request.NewErrParamMinLen("Title", 1)) 2637 } 2638 if s.Buttons != nil { 2639 for i, v := range s.Buttons { 2640 if v == nil { 2641 continue 2642 } 2643 if err := v.Validate(); err != nil { 2644 invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Buttons", i), err.(request.ErrInvalidParams)) 2645 } 2646 } 2647 } 2648 2649 if invalidParams.Len() > 0 { 2650 return invalidParams 2651 } 2652 return nil 2653} 2654 2655// SetButtons sets the Buttons field's value. 2656func (s *ImageResponseCard) SetButtons(v []*Button) *ImageResponseCard { 2657 s.Buttons = v 2658 return s 2659} 2660 2661// SetImageUrl sets the ImageUrl field's value. 2662func (s *ImageResponseCard) SetImageUrl(v string) *ImageResponseCard { 2663 s.ImageUrl = &v 2664 return s 2665} 2666 2667// SetSubtitle sets the Subtitle field's value. 2668func (s *ImageResponseCard) SetSubtitle(v string) *ImageResponseCard { 2669 s.Subtitle = &v 2670 return s 2671} 2672 2673// SetTitle sets the Title field's value. 2674func (s *ImageResponseCard) SetTitle(v string) *ImageResponseCard { 2675 s.Title = &v 2676 return s 2677} 2678 2679// The current intent that Amazon Lex V2 is attempting to fulfill. 2680type Intent struct { 2681 _ struct{} `type:"structure"` 2682 2683 // Contains information about whether fulfillment of the intent has been confirmed. 2684 ConfirmationState *string `locationName:"confirmationState" type:"string" enum:"ConfirmationState"` 2685 2686 // The name of the intent. 2687 // 2688 // Name is a required field 2689 Name *string `locationName:"name" min:"1" type:"string" required:"true"` 2690 2691 // A map of all of the slots for the intent. The name of the slot maps to the 2692 // value of the slot. If a slot has not been filled, the value is null. 2693 Slots map[string]*Slot `locationName:"slots" type:"map"` 2694 2695 // Contains fulfillment information for the intent. 2696 State *string `locationName:"state" type:"string" enum:"IntentState"` 2697} 2698 2699// String returns the string representation. 2700// 2701// API parameter values that are decorated as "sensitive" in the API will not 2702// be included in the string output. The member name will be present, but the 2703// value will be replaced with "sensitive". 2704func (s Intent) String() string { 2705 return awsutil.Prettify(s) 2706} 2707 2708// GoString returns the string representation. 2709// 2710// API parameter values that are decorated as "sensitive" in the API will not 2711// be included in the string output. The member name will be present, but the 2712// value will be replaced with "sensitive". 2713func (s Intent) GoString() string { 2714 return s.String() 2715} 2716 2717// Validate inspects the fields of the type to determine if they are valid. 2718func (s *Intent) Validate() error { 2719 invalidParams := request.ErrInvalidParams{Context: "Intent"} 2720 if s.Name == nil { 2721 invalidParams.Add(request.NewErrParamRequired("Name")) 2722 } 2723 if s.Name != nil && len(*s.Name) < 1 { 2724 invalidParams.Add(request.NewErrParamMinLen("Name", 1)) 2725 } 2726 if s.Slots != nil { 2727 for i, v := range s.Slots { 2728 if v == nil { 2729 continue 2730 } 2731 if err := v.Validate(); err != nil { 2732 invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Slots", i), err.(request.ErrInvalidParams)) 2733 } 2734 } 2735 } 2736 2737 if invalidParams.Len() > 0 { 2738 return invalidParams 2739 } 2740 return nil 2741} 2742 2743// SetConfirmationState sets the ConfirmationState field's value. 2744func (s *Intent) SetConfirmationState(v string) *Intent { 2745 s.ConfirmationState = &v 2746 return s 2747} 2748 2749// SetName sets the Name field's value. 2750func (s *Intent) SetName(v string) *Intent { 2751 s.Name = &v 2752 return s 2753} 2754 2755// SetSlots sets the Slots field's value. 2756func (s *Intent) SetSlots(v map[string]*Slot) *Intent { 2757 s.Slots = v 2758 return s 2759} 2760 2761// SetState sets the State field's value. 2762func (s *Intent) SetState(v string) *Intent { 2763 s.State = &v 2764 return s 2765} 2766 2767// Contains the current state of the conversation between the client application 2768// and Amazon Lex V2. 2769type IntentResultEvent struct { 2770 _ struct{} `type:"structure"` 2771 2772 // A unique identifier of the event sent by Amazon Lex V2. The identifier is 2773 // in the form RESPONSE-N, where N is a number starting with one and incremented 2774 // for each event sent by Amazon Lex V2 in the current session. 2775 EventId *string `locationName:"eventId" min:"2" type:"string"` 2776 2777 // Indicates whether the input to the operation was text or speech. 2778 InputMode *string `locationName:"inputMode" type:"string" enum:"InputMode"` 2779 2780 // A list of intents that Amazon Lex V2 determined might satisfy the user's 2781 // utterance. 2782 // 2783 // Each interpretation includes the intent, a score that indicates how confident 2784 // Amazon Lex V2 is that the interpretation is the correct one, and an optional 2785 // sentiment response that indicates the sentiment expressed in the utterance. 2786 Interpretations []*Interpretation `locationName:"interpretations" type:"list"` 2787 2788 // The attributes sent in the request. 2789 RequestAttributes map[string]*string `locationName:"requestAttributes" type:"map"` 2790 2791 // The identifier of the session in use. 2792 SessionId *string `locationName:"sessionId" min:"2" type:"string"` 2793 2794 // The state of the user's session with Amazon Lex V2. 2795 SessionState *SessionState `locationName:"sessionState" type:"structure"` 2796} 2797 2798// String returns the string representation. 2799// 2800// API parameter values that are decorated as "sensitive" in the API will not 2801// be included in the string output. The member name will be present, but the 2802// value will be replaced with "sensitive". 2803func (s IntentResultEvent) String() string { 2804 return awsutil.Prettify(s) 2805} 2806 2807// GoString returns the string representation. 2808// 2809// API parameter values that are decorated as "sensitive" in the API will not 2810// be included in the string output. The member name will be present, but the 2811// value will be replaced with "sensitive". 2812func (s IntentResultEvent) GoString() string { 2813 return s.String() 2814} 2815 2816// SetEventId sets the EventId field's value. 2817func (s *IntentResultEvent) SetEventId(v string) *IntentResultEvent { 2818 s.EventId = &v 2819 return s 2820} 2821 2822// SetInputMode sets the InputMode field's value. 2823func (s *IntentResultEvent) SetInputMode(v string) *IntentResultEvent { 2824 s.InputMode = &v 2825 return s 2826} 2827 2828// SetInterpretations sets the Interpretations field's value. 2829func (s *IntentResultEvent) SetInterpretations(v []*Interpretation) *IntentResultEvent { 2830 s.Interpretations = v 2831 return s 2832} 2833 2834// SetRequestAttributes sets the RequestAttributes field's value. 2835func (s *IntentResultEvent) SetRequestAttributes(v map[string]*string) *IntentResultEvent { 2836 s.RequestAttributes = v 2837 return s 2838} 2839 2840// SetSessionId sets the SessionId field's value. 2841func (s *IntentResultEvent) SetSessionId(v string) *IntentResultEvent { 2842 s.SessionId = &v 2843 return s 2844} 2845 2846// SetSessionState sets the SessionState field's value. 2847func (s *IntentResultEvent) SetSessionState(v *SessionState) *IntentResultEvent { 2848 s.SessionState = v 2849 return s 2850} 2851 2852// The IntentResultEvent is and event in the StartConversationResponseEventStream group of events. 2853func (s *IntentResultEvent) eventStartConversationResponseEventStream() {} 2854 2855// UnmarshalEvent unmarshals the EventStream Message into the IntentResultEvent value. 2856// This method is only used internally within the SDK's EventStream handling. 2857func (s *IntentResultEvent) UnmarshalEvent( 2858 payloadUnmarshaler protocol.PayloadUnmarshaler, 2859 msg eventstream.Message, 2860) error { 2861 if err := payloadUnmarshaler.UnmarshalPayload( 2862 bytes.NewReader(msg.Payload), s, 2863 ); err != nil { 2864 return err 2865 } 2866 return nil 2867} 2868 2869// MarshalEvent marshals the type into an stream event value. This method 2870// should only used internally within the SDK's EventStream handling. 2871func (s *IntentResultEvent) MarshalEvent(pm protocol.PayloadMarshaler) (msg eventstream.Message, err error) { 2872 msg.Headers.Set(eventstreamapi.MessageTypeHeader, eventstream.StringValue(eventstreamapi.EventMessageType)) 2873 var buf bytes.Buffer 2874 if err = pm.MarshalPayload(&buf, s); err != nil { 2875 return eventstream.Message{}, err 2876 } 2877 msg.Payload = buf.Bytes() 2878 return msg, err 2879} 2880 2881type InternalServerException struct { 2882 _ struct{} `type:"structure"` 2883 RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` 2884 2885 Message_ *string `locationName:"message" type:"string"` 2886} 2887 2888// String returns the string representation. 2889// 2890// API parameter values that are decorated as "sensitive" in the API will not 2891// be included in the string output. The member name will be present, but the 2892// value will be replaced with "sensitive". 2893func (s InternalServerException) String() string { 2894 return awsutil.Prettify(s) 2895} 2896 2897// GoString returns the string representation. 2898// 2899// API parameter values that are decorated as "sensitive" in the API will not 2900// be included in the string output. The member name will be present, but the 2901// value will be replaced with "sensitive". 2902func (s InternalServerException) GoString() string { 2903 return s.String() 2904} 2905 2906// The InternalServerException is and event in the StartConversationResponseEventStream group of events. 2907func (s *InternalServerException) eventStartConversationResponseEventStream() {} 2908 2909// UnmarshalEvent unmarshals the EventStream Message into the InternalServerException value. 2910// This method is only used internally within the SDK's EventStream handling. 2911func (s *InternalServerException) UnmarshalEvent( 2912 payloadUnmarshaler protocol.PayloadUnmarshaler, 2913 msg eventstream.Message, 2914) error { 2915 if err := payloadUnmarshaler.UnmarshalPayload( 2916 bytes.NewReader(msg.Payload), s, 2917 ); err != nil { 2918 return err 2919 } 2920 return nil 2921} 2922 2923// MarshalEvent marshals the type into an stream event value. This method 2924// should only used internally within the SDK's EventStream handling. 2925func (s *InternalServerException) MarshalEvent(pm protocol.PayloadMarshaler) (msg eventstream.Message, err error) { 2926 msg.Headers.Set(eventstreamapi.MessageTypeHeader, eventstream.StringValue(eventstreamapi.ExceptionMessageType)) 2927 var buf bytes.Buffer 2928 if err = pm.MarshalPayload(&buf, s); err != nil { 2929 return eventstream.Message{}, err 2930 } 2931 msg.Payload = buf.Bytes() 2932 return msg, err 2933} 2934 2935func newErrorInternalServerException(v protocol.ResponseMetadata) error { 2936 return &InternalServerException{ 2937 RespMetadata: v, 2938 } 2939} 2940 2941// Code returns the exception type name. 2942func (s *InternalServerException) Code() string { 2943 return "InternalServerException" 2944} 2945 2946// Message returns the exception's message. 2947func (s *InternalServerException) Message() string { 2948 if s.Message_ != nil { 2949 return *s.Message_ 2950 } 2951 return "" 2952} 2953 2954// OrigErr always returns nil, satisfies awserr.Error interface. 2955func (s *InternalServerException) OrigErr() error { 2956 return nil 2957} 2958 2959func (s *InternalServerException) Error() string { 2960 return fmt.Sprintf("%s: %s", s.Code(), s.Message()) 2961} 2962 2963// Status code returns the HTTP status code for the request's response error. 2964func (s *InternalServerException) StatusCode() int { 2965 return s.RespMetadata.StatusCode 2966} 2967 2968// RequestID returns the service's response RequestID for request. 2969func (s *InternalServerException) RequestID() string { 2970 return s.RespMetadata.RequestID 2971} 2972 2973// An intent that Amazon Lex V2 determined might satisfy the user's utterance. 2974// The intents are ordered by the confidence score. 2975type Interpretation struct { 2976 _ struct{} `type:"structure"` 2977 2978 // A list of intents that might satisfy the user's utterance. The intents are 2979 // ordered by the confidence score. 2980 Intent *Intent `locationName:"intent" type:"structure"` 2981 2982 // Determines the threshold where Amazon Lex V2 will insert the AMAZON.FallbackIntent, 2983 // AMAZON.KendraSearchIntent, or both when returning alternative intents in 2984 // a response. AMAZON.FallbackIntent and AMAZON.KendraSearchIntent are only 2985 // inserted if they are configured for the bot. 2986 NluConfidence *ConfidenceScore `locationName:"nluConfidence" type:"structure"` 2987 2988 // The sentiment expressed in an utterance. 2989 // 2990 // When the bot is configured to send utterances to Amazon Comprehend for sentiment 2991 // analysis, this field contains the result of the analysis. 2992 SentimentResponse *SentimentResponse `locationName:"sentimentResponse" type:"structure"` 2993} 2994 2995// String returns the string representation. 2996// 2997// API parameter values that are decorated as "sensitive" in the API will not 2998// be included in the string output. The member name will be present, but the 2999// value will be replaced with "sensitive". 3000func (s Interpretation) String() string { 3001 return awsutil.Prettify(s) 3002} 3003 3004// GoString returns the string representation. 3005// 3006// API parameter values that are decorated as "sensitive" in the API will not 3007// be included in the string output. The member name will be present, but the 3008// value will be replaced with "sensitive". 3009func (s Interpretation) GoString() string { 3010 return s.String() 3011} 3012 3013// SetIntent sets the Intent field's value. 3014func (s *Interpretation) SetIntent(v *Intent) *Interpretation { 3015 s.Intent = v 3016 return s 3017} 3018 3019// SetNluConfidence sets the NluConfidence field's value. 3020func (s *Interpretation) SetNluConfidence(v *ConfidenceScore) *Interpretation { 3021 s.NluConfidence = v 3022 return s 3023} 3024 3025// SetSentimentResponse sets the SentimentResponse field's value. 3026func (s *Interpretation) SetSentimentResponse(v *SentimentResponse) *Interpretation { 3027 s.SentimentResponse = v 3028 return s 3029} 3030 3031// Container for text that is returned to the customer.. 3032type Message struct { 3033 _ struct{} `type:"structure"` 3034 3035 // The text of the message. 3036 // 3037 // Content is a sensitive parameter and its value will be 3038 // replaced with "sensitive" in string returned by Message's 3039 // String and GoString methods. 3040 Content *string `locationName:"content" min:"1" type:"string" sensitive:"true"` 3041 3042 // Indicates the type of response. 3043 // 3044 // ContentType is a required field 3045 ContentType *string `locationName:"contentType" type:"string" required:"true" enum:"MessageContentType"` 3046 3047 // A card that is shown to the user by a messaging platform. You define the 3048 // contents of the card, the card is displayed by the platform. 3049 // 3050 // When you use a response card, the response from the user is constrained to 3051 // the text associated with a button on the card. 3052 ImageResponseCard *ImageResponseCard `locationName:"imageResponseCard" type:"structure"` 3053} 3054 3055// String returns the string representation. 3056// 3057// API parameter values that are decorated as "sensitive" in the API will not 3058// be included in the string output. The member name will be present, but the 3059// value will be replaced with "sensitive". 3060func (s Message) String() string { 3061 return awsutil.Prettify(s) 3062} 3063 3064// GoString returns the string representation. 3065// 3066// API parameter values that are decorated as "sensitive" in the API will not 3067// be included in the string output. The member name will be present, but the 3068// value will be replaced with "sensitive". 3069func (s Message) GoString() string { 3070 return s.String() 3071} 3072 3073// Validate inspects the fields of the type to determine if they are valid. 3074func (s *Message) Validate() error { 3075 invalidParams := request.ErrInvalidParams{Context: "Message"} 3076 if s.Content != nil && len(*s.Content) < 1 { 3077 invalidParams.Add(request.NewErrParamMinLen("Content", 1)) 3078 } 3079 if s.ContentType == nil { 3080 invalidParams.Add(request.NewErrParamRequired("ContentType")) 3081 } 3082 if s.ImageResponseCard != nil { 3083 if err := s.ImageResponseCard.Validate(); err != nil { 3084 invalidParams.AddNested("ImageResponseCard", err.(request.ErrInvalidParams)) 3085 } 3086 } 3087 3088 if invalidParams.Len() > 0 { 3089 return invalidParams 3090 } 3091 return nil 3092} 3093 3094// SetContent sets the Content field's value. 3095func (s *Message) SetContent(v string) *Message { 3096 s.Content = &v 3097 return s 3098} 3099 3100// SetContentType sets the ContentType field's value. 3101func (s *Message) SetContentType(v string) *Message { 3102 s.ContentType = &v 3103 return s 3104} 3105 3106// SetImageResponseCard sets the ImageResponseCard field's value. 3107func (s *Message) SetImageResponseCard(v *ImageResponseCard) *Message { 3108 s.ImageResponseCard = v 3109 return s 3110} 3111 3112// Event sent from the client application to Amazon Lex V2 to indicate that 3113// playback of audio is complete and that Amazon Lex V2 should start processing 3114// the user's input. 3115type PlaybackCompletionEvent struct { 3116 _ struct{} `type:"structure"` 3117 3118 // A timestamp set by the client of the date and time that the event was sent 3119 // to Amazon Lex V2. 3120 ClientTimestampMillis *int64 `locationName:"clientTimestampMillis" type:"long"` 3121 3122 // A unique identifier that your application assigns to the event. You can use 3123 // this to identify events in logs. 3124 EventId *string `locationName:"eventId" min:"2" type:"string"` 3125} 3126 3127// String returns the string representation. 3128// 3129// API parameter values that are decorated as "sensitive" in the API will not 3130// be included in the string output. The member name will be present, but the 3131// value will be replaced with "sensitive". 3132func (s PlaybackCompletionEvent) String() string { 3133 return awsutil.Prettify(s) 3134} 3135 3136// GoString returns the string representation. 3137// 3138// API parameter values that are decorated as "sensitive" in the API will not 3139// be included in the string output. The member name will be present, but the 3140// value will be replaced with "sensitive". 3141func (s PlaybackCompletionEvent) GoString() string { 3142 return s.String() 3143} 3144 3145// SetClientTimestampMillis sets the ClientTimestampMillis field's value. 3146func (s *PlaybackCompletionEvent) SetClientTimestampMillis(v int64) *PlaybackCompletionEvent { 3147 s.ClientTimestampMillis = &v 3148 return s 3149} 3150 3151// SetEventId sets the EventId field's value. 3152func (s *PlaybackCompletionEvent) SetEventId(v string) *PlaybackCompletionEvent { 3153 s.EventId = &v 3154 return s 3155} 3156 3157// The PlaybackCompletionEvent is and event in the StartConversationRequestEventStream group of events. 3158func (s *PlaybackCompletionEvent) eventStartConversationRequestEventStream() {} 3159 3160// UnmarshalEvent unmarshals the EventStream Message into the PlaybackCompletionEvent value. 3161// This method is only used internally within the SDK's EventStream handling. 3162func (s *PlaybackCompletionEvent) UnmarshalEvent( 3163 payloadUnmarshaler protocol.PayloadUnmarshaler, 3164 msg eventstream.Message, 3165) error { 3166 if err := payloadUnmarshaler.UnmarshalPayload( 3167 bytes.NewReader(msg.Payload), s, 3168 ); err != nil { 3169 return err 3170 } 3171 return nil 3172} 3173 3174// MarshalEvent marshals the type into an stream event value. This method 3175// should only used internally within the SDK's EventStream handling. 3176func (s *PlaybackCompletionEvent) MarshalEvent(pm protocol.PayloadMarshaler) (msg eventstream.Message, err error) { 3177 msg.Headers.Set(eventstreamapi.MessageTypeHeader, eventstream.StringValue(eventstreamapi.EventMessageType)) 3178 var buf bytes.Buffer 3179 if err = pm.MarshalPayload(&buf, s); err != nil { 3180 return eventstream.Message{}, err 3181 } 3182 msg.Payload = buf.Bytes() 3183 return msg, err 3184} 3185 3186// Event sent from Amazon Lex V2 to indicate to the client application should 3187// stop playback of audio. For example, if the client is playing a prompt that 3188// asks for the user's telephone number, the user might start to say the phone 3189// number before the prompt is complete. Amazon Lex V2 sends this event to the 3190// client application to indicate that the user is responding and that Amazon 3191// Lex V2 is processing their input. 3192type PlaybackInterruptionEvent struct { 3193 _ struct{} `type:"structure"` 3194 3195 // The identifier of the event that contained the audio, DTMF, or text that 3196 // caused the interruption. 3197 CausedByEventId *string `locationName:"causedByEventId" min:"2" type:"string"` 3198 3199 // A unique identifier of the event sent by Amazon Lex V2. The identifier is 3200 // in the form RESPONSE-N, where N is a number starting with one and incremented 3201 // for each event sent by Amazon Lex V2 in the current session. 3202 EventId *string `locationName:"eventId" min:"2" type:"string"` 3203 3204 // Indicates the type of user input that Amazon Lex V2 detected. 3205 EventReason *string `locationName:"eventReason" type:"string" enum:"PlaybackInterruptionReason"` 3206} 3207 3208// String returns the string representation. 3209// 3210// API parameter values that are decorated as "sensitive" in the API will not 3211// be included in the string output. The member name will be present, but the 3212// value will be replaced with "sensitive". 3213func (s PlaybackInterruptionEvent) String() string { 3214 return awsutil.Prettify(s) 3215} 3216 3217// GoString returns the string representation. 3218// 3219// API parameter values that are decorated as "sensitive" in the API will not 3220// be included in the string output. The member name will be present, but the 3221// value will be replaced with "sensitive". 3222func (s PlaybackInterruptionEvent) GoString() string { 3223 return s.String() 3224} 3225 3226// SetCausedByEventId sets the CausedByEventId field's value. 3227func (s *PlaybackInterruptionEvent) SetCausedByEventId(v string) *PlaybackInterruptionEvent { 3228 s.CausedByEventId = &v 3229 return s 3230} 3231 3232// SetEventId sets the EventId field's value. 3233func (s *PlaybackInterruptionEvent) SetEventId(v string) *PlaybackInterruptionEvent { 3234 s.EventId = &v 3235 return s 3236} 3237 3238// SetEventReason sets the EventReason field's value. 3239func (s *PlaybackInterruptionEvent) SetEventReason(v string) *PlaybackInterruptionEvent { 3240 s.EventReason = &v 3241 return s 3242} 3243 3244// The PlaybackInterruptionEvent is and event in the StartConversationResponseEventStream group of events. 3245func (s *PlaybackInterruptionEvent) eventStartConversationResponseEventStream() {} 3246 3247// UnmarshalEvent unmarshals the EventStream Message into the PlaybackInterruptionEvent value. 3248// This method is only used internally within the SDK's EventStream handling. 3249func (s *PlaybackInterruptionEvent) UnmarshalEvent( 3250 payloadUnmarshaler protocol.PayloadUnmarshaler, 3251 msg eventstream.Message, 3252) error { 3253 if err := payloadUnmarshaler.UnmarshalPayload( 3254 bytes.NewReader(msg.Payload), s, 3255 ); err != nil { 3256 return err 3257 } 3258 return nil 3259} 3260 3261// MarshalEvent marshals the type into an stream event value. This method 3262// should only used internally within the SDK's EventStream handling. 3263func (s *PlaybackInterruptionEvent) MarshalEvent(pm protocol.PayloadMarshaler) (msg eventstream.Message, err error) { 3264 msg.Headers.Set(eventstreamapi.MessageTypeHeader, eventstream.StringValue(eventstreamapi.EventMessageType)) 3265 var buf bytes.Buffer 3266 if err = pm.MarshalPayload(&buf, s); err != nil { 3267 return eventstream.Message{}, err 3268 } 3269 msg.Payload = buf.Bytes() 3270 return msg, err 3271} 3272 3273type PutSessionInput struct { 3274 _ struct{} `type:"structure"` 3275 3276 // The alias identifier of the bot that receives the session data. 3277 // 3278 // BotAliasId is a required field 3279 BotAliasId *string `location:"uri" locationName:"botAliasId" type:"string" required:"true"` 3280 3281 // The identifier of the bot that receives the session data. 3282 // 3283 // BotId is a required field 3284 BotId *string `location:"uri" locationName:"botId" min:"10" type:"string" required:"true"` 3285 3286 // The locale where the session is in use. 3287 // 3288 // LocaleId is a required field 3289 LocaleId *string `location:"uri" locationName:"localeId" min:"1" type:"string" required:"true"` 3290 3291 // A list of messages to send to the user. Messages are sent in the order that 3292 // they are defined in the list. 3293 Messages []*Message `locationName:"messages" type:"list"` 3294 3295 // Request-specific information passed between Amazon Lex V2 and the client 3296 // application. 3297 // 3298 // The namespace x-amz-lex: is reserved for special attributes. Don't create 3299 // any request attributes with the prefix x-amz-lex:. 3300 RequestAttributes map[string]*string `locationName:"requestAttributes" type:"map"` 3301 3302 // The message that Amazon Lex V2 returns in the response can be either text 3303 // or speech depending on the value of this parameter. 3304 // 3305 // * If the value is text/plain; charset=utf-8, Amazon Lex V2 returns text 3306 // in the response. 3307 ResponseContentType *string `location:"header" locationName:"ResponseContentType" min:"1" type:"string"` 3308 3309 // The identifier of the session that receives the session data. 3310 // 3311 // SessionId is a required field 3312 SessionId *string `location:"uri" locationName:"sessionId" min:"2" type:"string" required:"true"` 3313 3314 // Sets the state of the session with the user. You can use this to set the 3315 // current intent, attributes, context, and dialog action. Use the dialog action 3316 // to determine the next step that Amazon Lex V2 should use in the conversation 3317 // with the user. 3318 // 3319 // SessionState is a required field 3320 SessionState *SessionState `locationName:"sessionState" type:"structure" required:"true"` 3321} 3322 3323// String returns the string representation. 3324// 3325// API parameter values that are decorated as "sensitive" in the API will not 3326// be included in the string output. The member name will be present, but the 3327// value will be replaced with "sensitive". 3328func (s PutSessionInput) String() string { 3329 return awsutil.Prettify(s) 3330} 3331 3332// GoString returns the string representation. 3333// 3334// API parameter values that are decorated as "sensitive" in the API will not 3335// be included in the string output. The member name will be present, but the 3336// value will be replaced with "sensitive". 3337func (s PutSessionInput) GoString() string { 3338 return s.String() 3339} 3340 3341// Validate inspects the fields of the type to determine if they are valid. 3342func (s *PutSessionInput) Validate() error { 3343 invalidParams := request.ErrInvalidParams{Context: "PutSessionInput"} 3344 if s.BotAliasId == nil { 3345 invalidParams.Add(request.NewErrParamRequired("BotAliasId")) 3346 } 3347 if s.BotAliasId != nil && len(*s.BotAliasId) < 1 { 3348 invalidParams.Add(request.NewErrParamMinLen("BotAliasId", 1)) 3349 } 3350 if s.BotId == nil { 3351 invalidParams.Add(request.NewErrParamRequired("BotId")) 3352 } 3353 if s.BotId != nil && len(*s.BotId) < 10 { 3354 invalidParams.Add(request.NewErrParamMinLen("BotId", 10)) 3355 } 3356 if s.LocaleId == nil { 3357 invalidParams.Add(request.NewErrParamRequired("LocaleId")) 3358 } 3359 if s.LocaleId != nil && len(*s.LocaleId) < 1 { 3360 invalidParams.Add(request.NewErrParamMinLen("LocaleId", 1)) 3361 } 3362 if s.ResponseContentType != nil && len(*s.ResponseContentType) < 1 { 3363 invalidParams.Add(request.NewErrParamMinLen("ResponseContentType", 1)) 3364 } 3365 if s.SessionId == nil { 3366 invalidParams.Add(request.NewErrParamRequired("SessionId")) 3367 } 3368 if s.SessionId != nil && len(*s.SessionId) < 2 { 3369 invalidParams.Add(request.NewErrParamMinLen("SessionId", 2)) 3370 } 3371 if s.SessionState == nil { 3372 invalidParams.Add(request.NewErrParamRequired("SessionState")) 3373 } 3374 if s.Messages != nil { 3375 for i, v := range s.Messages { 3376 if v == nil { 3377 continue 3378 } 3379 if err := v.Validate(); err != nil { 3380 invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Messages", i), err.(request.ErrInvalidParams)) 3381 } 3382 } 3383 } 3384 if s.SessionState != nil { 3385 if err := s.SessionState.Validate(); err != nil { 3386 invalidParams.AddNested("SessionState", err.(request.ErrInvalidParams)) 3387 } 3388 } 3389 3390 if invalidParams.Len() > 0 { 3391 return invalidParams 3392 } 3393 return nil 3394} 3395 3396// SetBotAliasId sets the BotAliasId field's value. 3397func (s *PutSessionInput) SetBotAliasId(v string) *PutSessionInput { 3398 s.BotAliasId = &v 3399 return s 3400} 3401 3402// SetBotId sets the BotId field's value. 3403func (s *PutSessionInput) SetBotId(v string) *PutSessionInput { 3404 s.BotId = &v 3405 return s 3406} 3407 3408// SetLocaleId sets the LocaleId field's value. 3409func (s *PutSessionInput) SetLocaleId(v string) *PutSessionInput { 3410 s.LocaleId = &v 3411 return s 3412} 3413 3414// SetMessages sets the Messages field's value. 3415func (s *PutSessionInput) SetMessages(v []*Message) *PutSessionInput { 3416 s.Messages = v 3417 return s 3418} 3419 3420// SetRequestAttributes sets the RequestAttributes field's value. 3421func (s *PutSessionInput) SetRequestAttributes(v map[string]*string) *PutSessionInput { 3422 s.RequestAttributes = v 3423 return s 3424} 3425 3426// SetResponseContentType sets the ResponseContentType field's value. 3427func (s *PutSessionInput) SetResponseContentType(v string) *PutSessionInput { 3428 s.ResponseContentType = &v 3429 return s 3430} 3431 3432// SetSessionId sets the SessionId field's value. 3433func (s *PutSessionInput) SetSessionId(v string) *PutSessionInput { 3434 s.SessionId = &v 3435 return s 3436} 3437 3438// SetSessionState sets the SessionState field's value. 3439func (s *PutSessionInput) SetSessionState(v *SessionState) *PutSessionInput { 3440 s.SessionState = v 3441 return s 3442} 3443 3444type PutSessionOutput struct { 3445 _ struct{} `type:"structure" payload:"AudioStream"` 3446 3447 // If the requested content type was audio, the audio version of the message 3448 // to convey to the user. 3449 AudioStream io.ReadCloser `locationName:"audioStream" type:"blob"` 3450 3451 // The type of response. Same as the type specified in the responseContentType 3452 // field in the request. 3453 ContentType *string `location:"header" locationName:"Content-Type" min:"1" type:"string"` 3454 3455 // A list of messages that were last sent to the user. The messages are ordered 3456 // based on how you return the messages from you Lambda function or the order 3457 // that the messages are defined in the bot. 3458 Messages *string `location:"header" locationName:"x-amz-lex-messages" min:"1" type:"string"` 3459 3460 // Request-specific information passed between the client application and Amazon 3461 // Lex V2. These are the same as the requestAttribute parameter in the call 3462 // to the PutSession operation. 3463 RequestAttributes *string `location:"header" locationName:"x-amz-lex-request-attributes" min:"1" type:"string"` 3464 3465 // The identifier of the session that received the data. 3466 SessionId *string `location:"header" locationName:"x-amz-lex-session-id" min:"2" type:"string"` 3467 3468 // Represents the current state of the dialog between the user and the bot. 3469 // 3470 // Use this to determine the progress of the conversation and what the next 3471 // action may be. 3472 SessionState *string `location:"header" locationName:"x-amz-lex-session-state" min:"1" type:"string"` 3473} 3474 3475// String returns the string representation. 3476// 3477// API parameter values that are decorated as "sensitive" in the API will not 3478// be included in the string output. The member name will be present, but the 3479// value will be replaced with "sensitive". 3480func (s PutSessionOutput) String() string { 3481 return awsutil.Prettify(s) 3482} 3483 3484// GoString returns the string representation. 3485// 3486// API parameter values that are decorated as "sensitive" in the API will not 3487// be included in the string output. The member name will be present, but the 3488// value will be replaced with "sensitive". 3489func (s PutSessionOutput) GoString() string { 3490 return s.String() 3491} 3492 3493// SetAudioStream sets the AudioStream field's value. 3494func (s *PutSessionOutput) SetAudioStream(v io.ReadCloser) *PutSessionOutput { 3495 s.AudioStream = v 3496 return s 3497} 3498 3499// SetContentType sets the ContentType field's value. 3500func (s *PutSessionOutput) SetContentType(v string) *PutSessionOutput { 3501 s.ContentType = &v 3502 return s 3503} 3504 3505// SetMessages sets the Messages field's value. 3506func (s *PutSessionOutput) SetMessages(v string) *PutSessionOutput { 3507 s.Messages = &v 3508 return s 3509} 3510 3511// SetRequestAttributes sets the RequestAttributes field's value. 3512func (s *PutSessionOutput) SetRequestAttributes(v string) *PutSessionOutput { 3513 s.RequestAttributes = &v 3514 return s 3515} 3516 3517// SetSessionId sets the SessionId field's value. 3518func (s *PutSessionOutput) SetSessionId(v string) *PutSessionOutput { 3519 s.SessionId = &v 3520 return s 3521} 3522 3523// SetSessionState sets the SessionState field's value. 3524func (s *PutSessionOutput) SetSessionState(v string) *PutSessionOutput { 3525 s.SessionState = &v 3526 return s 3527} 3528 3529type RecognizeTextInput struct { 3530 _ struct{} `type:"structure"` 3531 3532 // The alias identifier in use for the bot that processes the request. 3533 // 3534 // BotAliasId is a required field 3535 BotAliasId *string `location:"uri" locationName:"botAliasId" type:"string" required:"true"` 3536 3537 // The identifier of the bot that processes the request. 3538 // 3539 // BotId is a required field 3540 BotId *string `location:"uri" locationName:"botId" min:"10" type:"string" required:"true"` 3541 3542 // The locale where the session is in use. 3543 // 3544 // LocaleId is a required field 3545 LocaleId *string `location:"uri" locationName:"localeId" min:"1" type:"string" required:"true"` 3546 3547 // Request-specific information passed between the client application and Amazon 3548 // Lex V2 3549 // 3550 // The namespace x-amz-lex: is reserved for special attributes. Don't create 3551 // any request attributes with the prefix x-amz-lex:. 3552 RequestAttributes map[string]*string `locationName:"requestAttributes" type:"map"` 3553 3554 // The identifier of the user session that is having the conversation. 3555 // 3556 // SessionId is a required field 3557 SessionId *string `location:"uri" locationName:"sessionId" min:"2" type:"string" required:"true"` 3558 3559 // The current state of the dialog between the user and the bot. 3560 SessionState *SessionState `locationName:"sessionState" type:"structure"` 3561 3562 // The text that the user entered. Amazon Lex V2 interprets this text. 3563 // 3564 // Text is a sensitive parameter and its value will be 3565 // replaced with "sensitive" in string returned by RecognizeTextInput's 3566 // String and GoString methods. 3567 // 3568 // Text is a required field 3569 Text *string `locationName:"text" min:"1" type:"string" required:"true" sensitive:"true"` 3570} 3571 3572// String returns the string representation. 3573// 3574// API parameter values that are decorated as "sensitive" in the API will not 3575// be included in the string output. The member name will be present, but the 3576// value will be replaced with "sensitive". 3577func (s RecognizeTextInput) String() string { 3578 return awsutil.Prettify(s) 3579} 3580 3581// GoString returns the string representation. 3582// 3583// API parameter values that are decorated as "sensitive" in the API will not 3584// be included in the string output. The member name will be present, but the 3585// value will be replaced with "sensitive". 3586func (s RecognizeTextInput) GoString() string { 3587 return s.String() 3588} 3589 3590// Validate inspects the fields of the type to determine if they are valid. 3591func (s *RecognizeTextInput) Validate() error { 3592 invalidParams := request.ErrInvalidParams{Context: "RecognizeTextInput"} 3593 if s.BotAliasId == nil { 3594 invalidParams.Add(request.NewErrParamRequired("BotAliasId")) 3595 } 3596 if s.BotAliasId != nil && len(*s.BotAliasId) < 1 { 3597 invalidParams.Add(request.NewErrParamMinLen("BotAliasId", 1)) 3598 } 3599 if s.BotId == nil { 3600 invalidParams.Add(request.NewErrParamRequired("BotId")) 3601 } 3602 if s.BotId != nil && len(*s.BotId) < 10 { 3603 invalidParams.Add(request.NewErrParamMinLen("BotId", 10)) 3604 } 3605 if s.LocaleId == nil { 3606 invalidParams.Add(request.NewErrParamRequired("LocaleId")) 3607 } 3608 if s.LocaleId != nil && len(*s.LocaleId) < 1 { 3609 invalidParams.Add(request.NewErrParamMinLen("LocaleId", 1)) 3610 } 3611 if s.SessionId == nil { 3612 invalidParams.Add(request.NewErrParamRequired("SessionId")) 3613 } 3614 if s.SessionId != nil && len(*s.SessionId) < 2 { 3615 invalidParams.Add(request.NewErrParamMinLen("SessionId", 2)) 3616 } 3617 if s.Text == nil { 3618 invalidParams.Add(request.NewErrParamRequired("Text")) 3619 } 3620 if s.Text != nil && len(*s.Text) < 1 { 3621 invalidParams.Add(request.NewErrParamMinLen("Text", 1)) 3622 } 3623 if s.SessionState != nil { 3624 if err := s.SessionState.Validate(); err != nil { 3625 invalidParams.AddNested("SessionState", err.(request.ErrInvalidParams)) 3626 } 3627 } 3628 3629 if invalidParams.Len() > 0 { 3630 return invalidParams 3631 } 3632 return nil 3633} 3634 3635// SetBotAliasId sets the BotAliasId field's value. 3636func (s *RecognizeTextInput) SetBotAliasId(v string) *RecognizeTextInput { 3637 s.BotAliasId = &v 3638 return s 3639} 3640 3641// SetBotId sets the BotId field's value. 3642func (s *RecognizeTextInput) SetBotId(v string) *RecognizeTextInput { 3643 s.BotId = &v 3644 return s 3645} 3646 3647// SetLocaleId sets the LocaleId field's value. 3648func (s *RecognizeTextInput) SetLocaleId(v string) *RecognizeTextInput { 3649 s.LocaleId = &v 3650 return s 3651} 3652 3653// SetRequestAttributes sets the RequestAttributes field's value. 3654func (s *RecognizeTextInput) SetRequestAttributes(v map[string]*string) *RecognizeTextInput { 3655 s.RequestAttributes = v 3656 return s 3657} 3658 3659// SetSessionId sets the SessionId field's value. 3660func (s *RecognizeTextInput) SetSessionId(v string) *RecognizeTextInput { 3661 s.SessionId = &v 3662 return s 3663} 3664 3665// SetSessionState sets the SessionState field's value. 3666func (s *RecognizeTextInput) SetSessionState(v *SessionState) *RecognizeTextInput { 3667 s.SessionState = v 3668 return s 3669} 3670 3671// SetText sets the Text field's value. 3672func (s *RecognizeTextInput) SetText(v string) *RecognizeTextInput { 3673 s.Text = &v 3674 return s 3675} 3676 3677type RecognizeTextOutput struct { 3678 _ struct{} `type:"structure"` 3679 3680 // A list of intents that Amazon Lex V2 determined might satisfy the user's 3681 // utterance. 3682 // 3683 // Each interpretation includes the intent, a score that indicates now confident 3684 // Amazon Lex V2 is that the interpretation is the correct one, and an optional 3685 // sentiment response that indicates the sentiment expressed in the utterance. 3686 Interpretations []*Interpretation `locationName:"interpretations" type:"list"` 3687 3688 // A list of messages last sent to the user. The messages are ordered based 3689 // on the order that you returned the messages from your Lambda function or 3690 // the order that the messages are defined in the bot. 3691 Messages []*Message `locationName:"messages" type:"list"` 3692 3693 // The attributes sent in the request. 3694 RequestAttributes map[string]*string `locationName:"requestAttributes" type:"map"` 3695 3696 // The identifier of the session in use. 3697 SessionId *string `locationName:"sessionId" min:"2" type:"string"` 3698 3699 // Represents the current state of the dialog between the user and the bot. 3700 // 3701 // Use this to determine the progress of the conversation and what the next 3702 // action may be. 3703 SessionState *SessionState `locationName:"sessionState" type:"structure"` 3704} 3705 3706// String returns the string representation. 3707// 3708// API parameter values that are decorated as "sensitive" in the API will not 3709// be included in the string output. The member name will be present, but the 3710// value will be replaced with "sensitive". 3711func (s RecognizeTextOutput) String() string { 3712 return awsutil.Prettify(s) 3713} 3714 3715// GoString returns the string representation. 3716// 3717// API parameter values that are decorated as "sensitive" in the API will not 3718// be included in the string output. The member name will be present, but the 3719// value will be replaced with "sensitive". 3720func (s RecognizeTextOutput) GoString() string { 3721 return s.String() 3722} 3723 3724// SetInterpretations sets the Interpretations field's value. 3725func (s *RecognizeTextOutput) SetInterpretations(v []*Interpretation) *RecognizeTextOutput { 3726 s.Interpretations = v 3727 return s 3728} 3729 3730// SetMessages sets the Messages field's value. 3731func (s *RecognizeTextOutput) SetMessages(v []*Message) *RecognizeTextOutput { 3732 s.Messages = v 3733 return s 3734} 3735 3736// SetRequestAttributes sets the RequestAttributes field's value. 3737func (s *RecognizeTextOutput) SetRequestAttributes(v map[string]*string) *RecognizeTextOutput { 3738 s.RequestAttributes = v 3739 return s 3740} 3741 3742// SetSessionId sets the SessionId field's value. 3743func (s *RecognizeTextOutput) SetSessionId(v string) *RecognizeTextOutput { 3744 s.SessionId = &v 3745 return s 3746} 3747 3748// SetSessionState sets the SessionState field's value. 3749func (s *RecognizeTextOutput) SetSessionState(v *SessionState) *RecognizeTextOutput { 3750 s.SessionState = v 3751 return s 3752} 3753 3754type RecognizeUtteranceInput struct { 3755 _ struct{} `type:"structure" payload:"InputStream"` 3756 3757 // The alias identifier in use for the bot that should receive the request. 3758 // 3759 // BotAliasId is a required field 3760 BotAliasId *string `location:"uri" locationName:"botAliasId" type:"string" required:"true"` 3761 3762 // The identifier of the bot that should receive the request. 3763 // 3764 // BotId is a required field 3765 BotId *string `location:"uri" locationName:"botId" min:"10" type:"string" required:"true"` 3766 3767 // User input in PCM or Opus audio format or text format as described in the 3768 // requestContentType parameter. 3769 // 3770 // To use an non-seekable io.Reader for this request wrap the io.Reader with 3771 // "aws.ReadSeekCloser". The SDK will not retry request errors for non-seekable 3772 // readers. This will allow the SDK to send the reader's payload as chunked 3773 // transfer encoding. 3774 InputStream io.ReadSeeker `locationName:"inputStream" type:"blob"` 3775 3776 // The locale where the session is in use. 3777 // 3778 // LocaleId is a required field 3779 LocaleId *string `location:"uri" locationName:"localeId" min:"1" type:"string" required:"true"` 3780 3781 // Request-specific information passed between the client application and Amazon 3782 // Lex V2 3783 // 3784 // The namespace x-amz-lex: is reserved for special attributes. Don't create 3785 // any request attributes for prefix x-amz-lex:. 3786 // 3787 // The requestAttributes field must be compressed using gzip and then base64 3788 // encoded before sending to Amazon Lex V2. 3789 // 3790 // RequestAttributes is a sensitive parameter and its value will be 3791 // replaced with "sensitive" in string returned by RecognizeUtteranceInput's 3792 // String and GoString methods. 3793 RequestAttributes *string `location:"header" locationName:"x-amz-lex-request-attributes" type:"string" sensitive:"true"` 3794 3795 // Indicates the format for audio input or that the content is text. The header 3796 // must start with one of the following prefixes: 3797 // 3798 // * PCM format, audio data must be in little-endian byte order. audio/l16; 3799 // rate=16000; channels=1 audio/x-l16; sample-rate=16000; channel-count=1 3800 // audio/lpcm; sample-rate=8000; sample-size-bits=16; channel-count=1; is-big-endian=false 3801 // 3802 // * Opus format audio/x-cbr-opus-with-preamble;preamble-size=0;bit-rate=256000;frame-size-milliseconds=4 3803 // 3804 // * Text format text/plain; charset=utf-8 3805 // 3806 // RequestContentType is a required field 3807 RequestContentType *string `location:"header" locationName:"Content-Type" min:"1" type:"string" required:"true"` 3808 3809 // The message that Amazon Lex V2 returns in the response can be either text 3810 // or speech based on the responseContentType value. 3811 // 3812 // * If the value is text/plain;charset=utf-8, Amazon Lex V2 returns text 3813 // in the response. 3814 // 3815 // * If the value begins with audio/, Amazon Lex V2 returns speech in the 3816 // response. Amazon Lex V2 uses Amazon Polly to generate the speech using 3817 // the configuration that you specified in the requestContentType parameter. 3818 // For example, if you specify audio/mpeg as the value, Amazon Lex V2 returns 3819 // speech in the MPEG format. 3820 // 3821 // * If the value is audio/pcm, the speech returned is audio/pcm at 16 KHz 3822 // in 16-bit, little-endian format. 3823 // 3824 // * The following are the accepted values: audio/mpeg audio/ogg audio/pcm 3825 // (16 KHz) audio/* (defaults to mpeg) text/plain; charset=utf-8 3826 ResponseContentType *string `location:"header" locationName:"Response-Content-Type" min:"1" type:"string"` 3827 3828 // The identifier of the session in use. 3829 // 3830 // SessionId is a required field 3831 SessionId *string `location:"uri" locationName:"sessionId" min:"2" type:"string" required:"true"` 3832 3833 // Sets the state of the session with the user. You can use this to set the 3834 // current intent, attributes, context, and dialog action. Use the dialog action 3835 // to determine the next step that Amazon Lex V2 should use in the conversation 3836 // with the user. 3837 // 3838 // The sessionState field must be compressed using gzip and then base64 encoded 3839 // before sending to Amazon Lex V2. 3840 // 3841 // SessionState is a sensitive parameter and its value will be 3842 // replaced with "sensitive" in string returned by RecognizeUtteranceInput's 3843 // String and GoString methods. 3844 SessionState *string `location:"header" locationName:"x-amz-lex-session-state" type:"string" sensitive:"true"` 3845} 3846 3847// String returns the string representation. 3848// 3849// API parameter values that are decorated as "sensitive" in the API will not 3850// be included in the string output. The member name will be present, but the 3851// value will be replaced with "sensitive". 3852func (s RecognizeUtteranceInput) String() string { 3853 return awsutil.Prettify(s) 3854} 3855 3856// GoString returns the string representation. 3857// 3858// API parameter values that are decorated as "sensitive" in the API will not 3859// be included in the string output. The member name will be present, but the 3860// value will be replaced with "sensitive". 3861func (s RecognizeUtteranceInput) GoString() string { 3862 return s.String() 3863} 3864 3865// Validate inspects the fields of the type to determine if they are valid. 3866func (s *RecognizeUtteranceInput) Validate() error { 3867 invalidParams := request.ErrInvalidParams{Context: "RecognizeUtteranceInput"} 3868 if s.BotAliasId == nil { 3869 invalidParams.Add(request.NewErrParamRequired("BotAliasId")) 3870 } 3871 if s.BotAliasId != nil && len(*s.BotAliasId) < 1 { 3872 invalidParams.Add(request.NewErrParamMinLen("BotAliasId", 1)) 3873 } 3874 if s.BotId == nil { 3875 invalidParams.Add(request.NewErrParamRequired("BotId")) 3876 } 3877 if s.BotId != nil && len(*s.BotId) < 10 { 3878 invalidParams.Add(request.NewErrParamMinLen("BotId", 10)) 3879 } 3880 if s.LocaleId == nil { 3881 invalidParams.Add(request.NewErrParamRequired("LocaleId")) 3882 } 3883 if s.LocaleId != nil && len(*s.LocaleId) < 1 { 3884 invalidParams.Add(request.NewErrParamMinLen("LocaleId", 1)) 3885 } 3886 if s.RequestContentType == nil { 3887 invalidParams.Add(request.NewErrParamRequired("RequestContentType")) 3888 } 3889 if s.RequestContentType != nil && len(*s.RequestContentType) < 1 { 3890 invalidParams.Add(request.NewErrParamMinLen("RequestContentType", 1)) 3891 } 3892 if s.ResponseContentType != nil && len(*s.ResponseContentType) < 1 { 3893 invalidParams.Add(request.NewErrParamMinLen("ResponseContentType", 1)) 3894 } 3895 if s.SessionId == nil { 3896 invalidParams.Add(request.NewErrParamRequired("SessionId")) 3897 } 3898 if s.SessionId != nil && len(*s.SessionId) < 2 { 3899 invalidParams.Add(request.NewErrParamMinLen("SessionId", 2)) 3900 } 3901 3902 if invalidParams.Len() > 0 { 3903 return invalidParams 3904 } 3905 return nil 3906} 3907 3908// SetBotAliasId sets the BotAliasId field's value. 3909func (s *RecognizeUtteranceInput) SetBotAliasId(v string) *RecognizeUtteranceInput { 3910 s.BotAliasId = &v 3911 return s 3912} 3913 3914// SetBotId sets the BotId field's value. 3915func (s *RecognizeUtteranceInput) SetBotId(v string) *RecognizeUtteranceInput { 3916 s.BotId = &v 3917 return s 3918} 3919 3920// SetInputStream sets the InputStream field's value. 3921func (s *RecognizeUtteranceInput) SetInputStream(v io.ReadSeeker) *RecognizeUtteranceInput { 3922 s.InputStream = v 3923 return s 3924} 3925 3926// SetLocaleId sets the LocaleId field's value. 3927func (s *RecognizeUtteranceInput) SetLocaleId(v string) *RecognizeUtteranceInput { 3928 s.LocaleId = &v 3929 return s 3930} 3931 3932// SetRequestAttributes sets the RequestAttributes field's value. 3933func (s *RecognizeUtteranceInput) SetRequestAttributes(v string) *RecognizeUtteranceInput { 3934 s.RequestAttributes = &v 3935 return s 3936} 3937 3938// SetRequestContentType sets the RequestContentType field's value. 3939func (s *RecognizeUtteranceInput) SetRequestContentType(v string) *RecognizeUtteranceInput { 3940 s.RequestContentType = &v 3941 return s 3942} 3943 3944// SetResponseContentType sets the ResponseContentType field's value. 3945func (s *RecognizeUtteranceInput) SetResponseContentType(v string) *RecognizeUtteranceInput { 3946 s.ResponseContentType = &v 3947 return s 3948} 3949 3950// SetSessionId sets the SessionId field's value. 3951func (s *RecognizeUtteranceInput) SetSessionId(v string) *RecognizeUtteranceInput { 3952 s.SessionId = &v 3953 return s 3954} 3955 3956// SetSessionState sets the SessionState field's value. 3957func (s *RecognizeUtteranceInput) SetSessionState(v string) *RecognizeUtteranceInput { 3958 s.SessionState = &v 3959 return s 3960} 3961 3962type RecognizeUtteranceOutput struct { 3963 _ struct{} `type:"structure" payload:"AudioStream"` 3964 3965 // The prompt or statement to send to the user. This is based on the bot configuration 3966 // and context. For example, if Amazon Lex V2 did not understand the user intent, 3967 // it sends the clarificationPrompt configured for the bot. If the intent requires 3968 // confirmation before taking the fulfillment action, it sends the confirmationPrompt. 3969 // Another example: Suppose that the Lambda function successfully fulfilled 3970 // the intent, and sent a message to convey to the user. Then Amazon Lex V2 3971 // sends that message in the response. 3972 AudioStream io.ReadCloser `locationName:"audioStream" type:"blob"` 3973 3974 // Content type as specified in the responseContentType in the request. 3975 ContentType *string `location:"header" locationName:"Content-Type" min:"1" type:"string"` 3976 3977 // Indicates whether the input mode to the operation was text or speech. 3978 InputMode *string `location:"header" locationName:"x-amz-lex-input-mode" min:"1" type:"string"` 3979 3980 // The text used to process the request. 3981 // 3982 // If the input was an audio stream, the inputTranscript field contains the 3983 // text extracted from the audio stream. This is the text that is actually processed 3984 // to recognize intents and slot values. You can use this information to determine 3985 // if Amazon Lex V2 is correctly processing the audio that you send. 3986 // 3987 // The inputTranscript field is compressed with gzip and then base64 encoded. 3988 // Before you can use the contents of the field, you must decode and decompress 3989 // the contents. See the example for a simple function to decode and decompress 3990 // the contents. 3991 InputTranscript *string `location:"header" locationName:"x-amz-lex-input-transcript" min:"1" type:"string"` 3992 3993 // A list of intents that Amazon Lex V2 determined might satisfy the user's 3994 // utterance. 3995 // 3996 // Each interpretation includes the intent, a score that indicates how confident 3997 // Amazon Lex V2 is that the interpretation is the correct one, and an optional 3998 // sentiment response that indicates the sentiment expressed in the utterance. 3999 // 4000 // The interpretations field is compressed with gzip and then base64 encoded. 4001 // Before you can use the contents of the field, you must decode and decompress 4002 // the contents. See the example for a simple function to decode and decompress 4003 // the contents. 4004 Interpretations *string `location:"header" locationName:"x-amz-lex-interpretations" min:"1" type:"string"` 4005 4006 // A list of messages that were last sent to the user. The messages are ordered 4007 // based on the order that you returned the messages from your Lambda function 4008 // or the order that the messages are defined in the bot. 4009 // 4010 // The messages field is compressed with gzip and then base64 encoded. Before 4011 // you can use the contents of the field, you must decode and decompress the 4012 // contents. See the example for a simple function to decode and decompress 4013 // the contents. 4014 Messages *string `location:"header" locationName:"x-amz-lex-messages" min:"1" type:"string"` 4015 4016 // The attributes sent in the request. 4017 // 4018 // The requestAttributes field is compressed with gzip and then base64 encoded. 4019 // Before you can use the contents of the field, you must decode and decompress 4020 // the contents. 4021 RequestAttributes *string `location:"header" locationName:"x-amz-lex-request-attributes" min:"1" type:"string"` 4022 4023 // The identifier of the session in use. 4024 SessionId *string `location:"header" locationName:"x-amz-lex-session-id" min:"2" type:"string"` 4025 4026 // Represents the current state of the dialog between the user and the bot. 4027 // 4028 // Use this to determine the progress of the conversation and what the next 4029 // action might be. 4030 // 4031 // The sessionState field is compressed with gzip and then base64 encoded. Before 4032 // you can use the contents of the field, you must decode and decompress the 4033 // contents. See the example for a simple function to decode and decompress 4034 // the contents. 4035 SessionState *string `location:"header" locationName:"x-amz-lex-session-state" min:"1" type:"string"` 4036} 4037 4038// String returns the string representation. 4039// 4040// API parameter values that are decorated as "sensitive" in the API will not 4041// be included in the string output. The member name will be present, but the 4042// value will be replaced with "sensitive". 4043func (s RecognizeUtteranceOutput) String() string { 4044 return awsutil.Prettify(s) 4045} 4046 4047// GoString returns the string representation. 4048// 4049// API parameter values that are decorated as "sensitive" in the API will not 4050// be included in the string output. The member name will be present, but the 4051// value will be replaced with "sensitive". 4052func (s RecognizeUtteranceOutput) GoString() string { 4053 return s.String() 4054} 4055 4056// SetAudioStream sets the AudioStream field's value. 4057func (s *RecognizeUtteranceOutput) SetAudioStream(v io.ReadCloser) *RecognizeUtteranceOutput { 4058 s.AudioStream = v 4059 return s 4060} 4061 4062// SetContentType sets the ContentType field's value. 4063func (s *RecognizeUtteranceOutput) SetContentType(v string) *RecognizeUtteranceOutput { 4064 s.ContentType = &v 4065 return s 4066} 4067 4068// SetInputMode sets the InputMode field's value. 4069func (s *RecognizeUtteranceOutput) SetInputMode(v string) *RecognizeUtteranceOutput { 4070 s.InputMode = &v 4071 return s 4072} 4073 4074// SetInputTranscript sets the InputTranscript field's value. 4075func (s *RecognizeUtteranceOutput) SetInputTranscript(v string) *RecognizeUtteranceOutput { 4076 s.InputTranscript = &v 4077 return s 4078} 4079 4080// SetInterpretations sets the Interpretations field's value. 4081func (s *RecognizeUtteranceOutput) SetInterpretations(v string) *RecognizeUtteranceOutput { 4082 s.Interpretations = &v 4083 return s 4084} 4085 4086// SetMessages sets the Messages field's value. 4087func (s *RecognizeUtteranceOutput) SetMessages(v string) *RecognizeUtteranceOutput { 4088 s.Messages = &v 4089 return s 4090} 4091 4092// SetRequestAttributes sets the RequestAttributes field's value. 4093func (s *RecognizeUtteranceOutput) SetRequestAttributes(v string) *RecognizeUtteranceOutput { 4094 s.RequestAttributes = &v 4095 return s 4096} 4097 4098// SetSessionId sets the SessionId field's value. 4099func (s *RecognizeUtteranceOutput) SetSessionId(v string) *RecognizeUtteranceOutput { 4100 s.SessionId = &v 4101 return s 4102} 4103 4104// SetSessionState sets the SessionState field's value. 4105func (s *RecognizeUtteranceOutput) SetSessionState(v string) *RecognizeUtteranceOutput { 4106 s.SessionState = &v 4107 return s 4108} 4109 4110type ResourceNotFoundException struct { 4111 _ struct{} `type:"structure"` 4112 RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` 4113 4114 Message_ *string `locationName:"message" type:"string"` 4115} 4116 4117// String returns the string representation. 4118// 4119// API parameter values that are decorated as "sensitive" in the API will not 4120// be included in the string output. The member name will be present, but the 4121// value will be replaced with "sensitive". 4122func (s ResourceNotFoundException) String() string { 4123 return awsutil.Prettify(s) 4124} 4125 4126// GoString returns the string representation. 4127// 4128// API parameter values that are decorated as "sensitive" in the API will not 4129// be included in the string output. The member name will be present, but the 4130// value will be replaced with "sensitive". 4131func (s ResourceNotFoundException) GoString() string { 4132 return s.String() 4133} 4134 4135// The ResourceNotFoundException is and event in the StartConversationResponseEventStream group of events. 4136func (s *ResourceNotFoundException) eventStartConversationResponseEventStream() {} 4137 4138// UnmarshalEvent unmarshals the EventStream Message into the ResourceNotFoundException value. 4139// This method is only used internally within the SDK's EventStream handling. 4140func (s *ResourceNotFoundException) UnmarshalEvent( 4141 payloadUnmarshaler protocol.PayloadUnmarshaler, 4142 msg eventstream.Message, 4143) error { 4144 if err := payloadUnmarshaler.UnmarshalPayload( 4145 bytes.NewReader(msg.Payload), s, 4146 ); err != nil { 4147 return err 4148 } 4149 return nil 4150} 4151 4152// MarshalEvent marshals the type into an stream event value. This method 4153// should only used internally within the SDK's EventStream handling. 4154func (s *ResourceNotFoundException) MarshalEvent(pm protocol.PayloadMarshaler) (msg eventstream.Message, err error) { 4155 msg.Headers.Set(eventstreamapi.MessageTypeHeader, eventstream.StringValue(eventstreamapi.ExceptionMessageType)) 4156 var buf bytes.Buffer 4157 if err = pm.MarshalPayload(&buf, s); err != nil { 4158 return eventstream.Message{}, err 4159 } 4160 msg.Payload = buf.Bytes() 4161 return msg, err 4162} 4163 4164func newErrorResourceNotFoundException(v protocol.ResponseMetadata) error { 4165 return &ResourceNotFoundException{ 4166 RespMetadata: v, 4167 } 4168} 4169 4170// Code returns the exception type name. 4171func (s *ResourceNotFoundException) Code() string { 4172 return "ResourceNotFoundException" 4173} 4174 4175// Message returns the exception's message. 4176func (s *ResourceNotFoundException) Message() string { 4177 if s.Message_ != nil { 4178 return *s.Message_ 4179 } 4180 return "" 4181} 4182 4183// OrigErr always returns nil, satisfies awserr.Error interface. 4184func (s *ResourceNotFoundException) OrigErr() error { 4185 return nil 4186} 4187 4188func (s *ResourceNotFoundException) Error() string { 4189 return fmt.Sprintf("%s: %s", s.Code(), s.Message()) 4190} 4191 4192// Status code returns the HTTP status code for the request's response error. 4193func (s *ResourceNotFoundException) StatusCode() int { 4194 return s.RespMetadata.StatusCode 4195} 4196 4197// RequestID returns the service's response RequestID for request. 4198func (s *ResourceNotFoundException) RequestID() string { 4199 return s.RespMetadata.RequestID 4200} 4201 4202// Provides information about the sentiment expressed in a user's response in 4203// a conversation. Sentiments are determined using Amazon Comprehend. Sentiments 4204// are only returned if they are enabled for the bot. 4205// 4206// For more information, see Determine Sentiment (https://docs.aws.amazon.com/comprehend/latest/dg/how-sentiment.html) 4207// in the Amazon Comprehend developer guide. 4208type SentimentResponse struct { 4209 _ struct{} `type:"structure"` 4210 4211 // The overall sentiment expressed in the user's response. This is the sentiment 4212 // most likely expressed by the user based on the analysis by Amazon Comprehend. 4213 Sentiment *string `locationName:"sentiment" type:"string" enum:"SentimentType"` 4214 4215 // The individual sentiment responses for the utterance. 4216 SentimentScore *SentimentScore `locationName:"sentimentScore" type:"structure"` 4217} 4218 4219// String returns the string representation. 4220// 4221// API parameter values that are decorated as "sensitive" in the API will not 4222// be included in the string output. The member name will be present, but the 4223// value will be replaced with "sensitive". 4224func (s SentimentResponse) String() string { 4225 return awsutil.Prettify(s) 4226} 4227 4228// GoString returns the string representation. 4229// 4230// API parameter values that are decorated as "sensitive" in the API will not 4231// be included in the string output. The member name will be present, but the 4232// value will be replaced with "sensitive". 4233func (s SentimentResponse) GoString() string { 4234 return s.String() 4235} 4236 4237// SetSentiment sets the Sentiment field's value. 4238func (s *SentimentResponse) SetSentiment(v string) *SentimentResponse { 4239 s.Sentiment = &v 4240 return s 4241} 4242 4243// SetSentimentScore sets the SentimentScore field's value. 4244func (s *SentimentResponse) SetSentimentScore(v *SentimentScore) *SentimentResponse { 4245 s.SentimentScore = v 4246 return s 4247} 4248 4249// The individual sentiment responses for the utterance. 4250type SentimentScore struct { 4251 _ struct{} `type:"structure"` 4252 4253 // The level of confidence that Amazon Comprehend has in the accuracy of its 4254 // detection of the MIXED sentiment. 4255 Mixed *float64 `locationName:"mixed" type:"double"` 4256 4257 // The level of confidence that Amazon Comprehend has in the accuracy of its 4258 // detection of the NEGATIVE sentiment. 4259 Negative *float64 `locationName:"negative" type:"double"` 4260 4261 // The level of confidence that Amazon Comprehend has in the accuracy of its 4262 // detection of the NEUTRAL sentiment. 4263 Neutral *float64 `locationName:"neutral" type:"double"` 4264 4265 // The level of confidence that Amazon Comprehend has in the accuracy of its 4266 // detection of the POSITIVE sentiment. 4267 Positive *float64 `locationName:"positive" type:"double"` 4268} 4269 4270// String returns the string representation. 4271// 4272// API parameter values that are decorated as "sensitive" in the API will not 4273// be included in the string output. The member name will be present, but the 4274// value will be replaced with "sensitive". 4275func (s SentimentScore) String() string { 4276 return awsutil.Prettify(s) 4277} 4278 4279// GoString returns the string representation. 4280// 4281// API parameter values that are decorated as "sensitive" in the API will not 4282// be included in the string output. The member name will be present, but the 4283// value will be replaced with "sensitive". 4284func (s SentimentScore) GoString() string { 4285 return s.String() 4286} 4287 4288// SetMixed sets the Mixed field's value. 4289func (s *SentimentScore) SetMixed(v float64) *SentimentScore { 4290 s.Mixed = &v 4291 return s 4292} 4293 4294// SetNegative sets the Negative field's value. 4295func (s *SentimentScore) SetNegative(v float64) *SentimentScore { 4296 s.Negative = &v 4297 return s 4298} 4299 4300// SetNeutral sets the Neutral field's value. 4301func (s *SentimentScore) SetNeutral(v float64) *SentimentScore { 4302 s.Neutral = &v 4303 return s 4304} 4305 4306// SetPositive sets the Positive field's value. 4307func (s *SentimentScore) SetPositive(v float64) *SentimentScore { 4308 s.Positive = &v 4309 return s 4310} 4311 4312// The state of the user's session with Amazon Lex V2. 4313type SessionState struct { 4314 _ struct{} `type:"structure"` 4315 4316 // One or more contexts that indicate to Amazon Lex V2 the context of a request. 4317 // When a context is active, Amazon Lex V2 considers intents with the matching 4318 // context as a trigger as the next intent in a session. 4319 ActiveContexts []*ActiveContext `locationName:"activeContexts" type:"list"` 4320 4321 // The next step that Amazon Lex V2 should take in the conversation with a user. 4322 DialogAction *DialogAction `locationName:"dialogAction" type:"structure"` 4323 4324 // The active intent that Amazon Lex V2 is processing. 4325 Intent *Intent `locationName:"intent" type:"structure"` 4326 4327 OriginatingRequestId *string `locationName:"originatingRequestId" min:"1" type:"string"` 4328 4329 // Map of key/value pairs representing session-specific context information. 4330 // It contains application information passed between Amazon Lex V2 and a client 4331 // application. 4332 SessionAttributes map[string]*string `locationName:"sessionAttributes" type:"map"` 4333} 4334 4335// String returns the string representation. 4336// 4337// API parameter values that are decorated as "sensitive" in the API will not 4338// be included in the string output. The member name will be present, but the 4339// value will be replaced with "sensitive". 4340func (s SessionState) String() string { 4341 return awsutil.Prettify(s) 4342} 4343 4344// GoString returns the string representation. 4345// 4346// API parameter values that are decorated as "sensitive" in the API will not 4347// be included in the string output. The member name will be present, but the 4348// value will be replaced with "sensitive". 4349func (s SessionState) GoString() string { 4350 return s.String() 4351} 4352 4353// Validate inspects the fields of the type to determine if they are valid. 4354func (s *SessionState) Validate() error { 4355 invalidParams := request.ErrInvalidParams{Context: "SessionState"} 4356 if s.OriginatingRequestId != nil && len(*s.OriginatingRequestId) < 1 { 4357 invalidParams.Add(request.NewErrParamMinLen("OriginatingRequestId", 1)) 4358 } 4359 if s.ActiveContexts != nil { 4360 for i, v := range s.ActiveContexts { 4361 if v == nil { 4362 continue 4363 } 4364 if err := v.Validate(); err != nil { 4365 invalidParams.AddNested(fmt.Sprintf("%s[%v]", "ActiveContexts", i), err.(request.ErrInvalidParams)) 4366 } 4367 } 4368 } 4369 if s.DialogAction != nil { 4370 if err := s.DialogAction.Validate(); err != nil { 4371 invalidParams.AddNested("DialogAction", err.(request.ErrInvalidParams)) 4372 } 4373 } 4374 if s.Intent != nil { 4375 if err := s.Intent.Validate(); err != nil { 4376 invalidParams.AddNested("Intent", err.(request.ErrInvalidParams)) 4377 } 4378 } 4379 4380 if invalidParams.Len() > 0 { 4381 return invalidParams 4382 } 4383 return nil 4384} 4385 4386// SetActiveContexts sets the ActiveContexts field's value. 4387func (s *SessionState) SetActiveContexts(v []*ActiveContext) *SessionState { 4388 s.ActiveContexts = v 4389 return s 4390} 4391 4392// SetDialogAction sets the DialogAction field's value. 4393func (s *SessionState) SetDialogAction(v *DialogAction) *SessionState { 4394 s.DialogAction = v 4395 return s 4396} 4397 4398// SetIntent sets the Intent field's value. 4399func (s *SessionState) SetIntent(v *Intent) *SessionState { 4400 s.Intent = v 4401 return s 4402} 4403 4404// SetOriginatingRequestId sets the OriginatingRequestId field's value. 4405func (s *SessionState) SetOriginatingRequestId(v string) *SessionState { 4406 s.OriginatingRequestId = &v 4407 return s 4408} 4409 4410// SetSessionAttributes sets the SessionAttributes field's value. 4411func (s *SessionState) SetSessionAttributes(v map[string]*string) *SessionState { 4412 s.SessionAttributes = v 4413 return s 4414} 4415 4416// A value that Amazon Lex V2 uses to fulfill an intent. 4417type Slot struct { 4418 _ struct{} `type:"structure"` 4419 4420 // When the shape value is List, it indicates that the values field contains 4421 // a list of slot values. When the value is Scalar, it indicates that the value 4422 // field contains a single value. 4423 Shape *string `locationName:"shape" type:"string" enum:"Shape"` 4424 4425 // The current value of the slot. 4426 Value *Value `locationName:"value" type:"structure"` 4427 4428 // A list of one or more values that the user provided for the slot. For example, 4429 // if a for a slot that elicits pizza toppings, the values might be "pepperoni" 4430 // and "pineapple." 4431 Values []*Slot `locationName:"values" type:"list"` 4432} 4433 4434// String returns the string representation. 4435// 4436// API parameter values that are decorated as "sensitive" in the API will not 4437// be included in the string output. The member name will be present, but the 4438// value will be replaced with "sensitive". 4439func (s Slot) String() string { 4440 return awsutil.Prettify(s) 4441} 4442 4443// GoString returns the string representation. 4444// 4445// API parameter values that are decorated as "sensitive" in the API will not 4446// be included in the string output. The member name will be present, but the 4447// value will be replaced with "sensitive". 4448func (s Slot) GoString() string { 4449 return s.String() 4450} 4451 4452// Validate inspects the fields of the type to determine if they are valid. 4453func (s *Slot) Validate() error { 4454 invalidParams := request.ErrInvalidParams{Context: "Slot"} 4455 if s.Value != nil { 4456 if err := s.Value.Validate(); err != nil { 4457 invalidParams.AddNested("Value", err.(request.ErrInvalidParams)) 4458 } 4459 } 4460 if s.Values != nil { 4461 for i, v := range s.Values { 4462 if v == nil { 4463 continue 4464 } 4465 if err := v.Validate(); err != nil { 4466 invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Values", i), err.(request.ErrInvalidParams)) 4467 } 4468 } 4469 } 4470 4471 if invalidParams.Len() > 0 { 4472 return invalidParams 4473 } 4474 return nil 4475} 4476 4477// SetShape sets the Shape field's value. 4478func (s *Slot) SetShape(v string) *Slot { 4479 s.Shape = &v 4480 return s 4481} 4482 4483// SetValue sets the Value field's value. 4484func (s *Slot) SetValue(v *Value) *Slot { 4485 s.Value = v 4486 return s 4487} 4488 4489// SetValues sets the Values field's value. 4490func (s *Slot) SetValues(v []*Slot) *Slot { 4491 s.Values = v 4492 return s 4493} 4494 4495type StartConversationInput struct { 4496 _ struct{} `type:"structure" payload:"RequestEventStream"` 4497 4498 // The alias identifier in use for the bot that processes the request. 4499 // 4500 // BotAliasId is a required field 4501 BotAliasId *string `location:"uri" locationName:"botAliasId" type:"string" required:"true"` 4502 4503 // The identifier of the bot to process the request. 4504 // 4505 // BotId is a required field 4506 BotId *string `location:"uri" locationName:"botId" min:"10" type:"string" required:"true"` 4507 4508 // The conversation type that you are using the Amazon Lex V2. If the conversation 4509 // mode is AUDIO you can send both audio and DTMF information. If the mode is 4510 // TEXT you can only send text. 4511 ConversationMode *string `location:"header" locationName:"x-amz-lex-conversation-mode" type:"string" enum:"ConversationMode"` 4512 4513 // The locale where the session is in use. 4514 // 4515 // LocaleId is a required field 4516 LocaleId *string `location:"uri" locationName:"localeId" min:"1" type:"string" required:"true"` 4517 4518 // The identifier of the user session that is having the conversation. 4519 // 4520 // SessionId is a required field 4521 SessionId *string `location:"uri" locationName:"sessionId" min:"2" type:"string" required:"true"` 4522} 4523 4524// String returns the string representation. 4525// 4526// API parameter values that are decorated as "sensitive" in the API will not 4527// be included in the string output. The member name will be present, but the 4528// value will be replaced with "sensitive". 4529func (s StartConversationInput) String() string { 4530 return awsutil.Prettify(s) 4531} 4532 4533// GoString returns the string representation. 4534// 4535// API parameter values that are decorated as "sensitive" in the API will not 4536// be included in the string output. The member name will be present, but the 4537// value will be replaced with "sensitive". 4538func (s StartConversationInput) GoString() string { 4539 return s.String() 4540} 4541 4542// Validate inspects the fields of the type to determine if they are valid. 4543func (s *StartConversationInput) Validate() error { 4544 invalidParams := request.ErrInvalidParams{Context: "StartConversationInput"} 4545 if s.BotAliasId == nil { 4546 invalidParams.Add(request.NewErrParamRequired("BotAliasId")) 4547 } 4548 if s.BotAliasId != nil && len(*s.BotAliasId) < 1 { 4549 invalidParams.Add(request.NewErrParamMinLen("BotAliasId", 1)) 4550 } 4551 if s.BotId == nil { 4552 invalidParams.Add(request.NewErrParamRequired("BotId")) 4553 } 4554 if s.BotId != nil && len(*s.BotId) < 10 { 4555 invalidParams.Add(request.NewErrParamMinLen("BotId", 10)) 4556 } 4557 if s.LocaleId == nil { 4558 invalidParams.Add(request.NewErrParamRequired("LocaleId")) 4559 } 4560 if s.LocaleId != nil && len(*s.LocaleId) < 1 { 4561 invalidParams.Add(request.NewErrParamMinLen("LocaleId", 1)) 4562 } 4563 if s.SessionId == nil { 4564 invalidParams.Add(request.NewErrParamRequired("SessionId")) 4565 } 4566 if s.SessionId != nil && len(*s.SessionId) < 2 { 4567 invalidParams.Add(request.NewErrParamMinLen("SessionId", 2)) 4568 } 4569 4570 if invalidParams.Len() > 0 { 4571 return invalidParams 4572 } 4573 return nil 4574} 4575 4576// SetBotAliasId sets the BotAliasId field's value. 4577func (s *StartConversationInput) SetBotAliasId(v string) *StartConversationInput { 4578 s.BotAliasId = &v 4579 return s 4580} 4581 4582// SetBotId sets the BotId field's value. 4583func (s *StartConversationInput) SetBotId(v string) *StartConversationInput { 4584 s.BotId = &v 4585 return s 4586} 4587 4588// SetConversationMode sets the ConversationMode field's value. 4589func (s *StartConversationInput) SetConversationMode(v string) *StartConversationInput { 4590 s.ConversationMode = &v 4591 return s 4592} 4593 4594// SetLocaleId sets the LocaleId field's value. 4595func (s *StartConversationInput) SetLocaleId(v string) *StartConversationInput { 4596 s.LocaleId = &v 4597 return s 4598} 4599 4600// SetSessionId sets the SessionId field's value. 4601func (s *StartConversationInput) SetSessionId(v string) *StartConversationInput { 4602 s.SessionId = &v 4603 return s 4604} 4605 4606type StartConversationOutput struct { 4607 _ struct{} `type:"structure" payload:"ResponseEventStream"` 4608 4609 eventStream *StartConversationEventStream 4610} 4611 4612// String returns the string representation. 4613// 4614// API parameter values that are decorated as "sensitive" in the API will not 4615// be included in the string output. The member name will be present, but the 4616// value will be replaced with "sensitive". 4617func (s StartConversationOutput) String() string { 4618 return awsutil.Prettify(s) 4619} 4620 4621// GoString returns the string representation. 4622// 4623// API parameter values that are decorated as "sensitive" in the API will not 4624// be included in the string output. The member name will be present, but the 4625// value will be replaced with "sensitive". 4626func (s StartConversationOutput) GoString() string { 4627 return s.String() 4628} 4629 4630// GetStream returns the type to interact with the event stream. 4631func (s *StartConversationOutput) GetStream() *StartConversationEventStream { 4632 return s.eventStream 4633} 4634 4635// StartConversationRequestEventStreamEvent groups together all EventStream 4636// events writes for StartConversationRequestEventStream. 4637// 4638// These events are: 4639// 4640// * AudioInputEvent 4641// * ConfigurationEvent 4642// * DTMFInputEvent 4643// * DisconnectionEvent 4644// * PlaybackCompletionEvent 4645// * TextInputEvent 4646type StartConversationRequestEventStreamEvent interface { 4647 eventStartConversationRequestEventStream() 4648 eventstreamapi.Marshaler 4649 eventstreamapi.Unmarshaler 4650} 4651 4652// StartConversationRequestEventStreamWriter provides the interface for writing events to the stream. 4653// The default implementation for this interface will be StartConversationRequestEventStream. 4654// 4655// The writer's Close method must allow multiple concurrent calls. 4656// 4657// These events are: 4658// 4659// * AudioInputEvent 4660// * ConfigurationEvent 4661// * DTMFInputEvent 4662// * DisconnectionEvent 4663// * PlaybackCompletionEvent 4664// * TextInputEvent 4665type StartConversationRequestEventStreamWriter interface { 4666 // Sends writes events to the stream blocking until the event has been 4667 // written. An error is returned if the write fails. 4668 Send(aws.Context, StartConversationRequestEventStreamEvent) error 4669 4670 // Close will stop the writer writing to the event stream. 4671 Close() error 4672 4673 // Returns any error that has occurred while writing to the event stream. 4674 Err() error 4675} 4676 4677type writeStartConversationRequestEventStream struct { 4678 *eventstreamapi.StreamWriter 4679} 4680 4681func (w *writeStartConversationRequestEventStream) Send(ctx aws.Context, event StartConversationRequestEventStreamEvent) error { 4682 return w.StreamWriter.Send(ctx, event) 4683} 4684 4685func eventTypeForStartConversationRequestEventStreamEvent(event eventstreamapi.Marshaler) (string, error) { 4686 switch event.(type) { 4687 case *AudioInputEvent: 4688 return "AudioInputEvent", nil 4689 case *ConfigurationEvent: 4690 return "ConfigurationEvent", nil 4691 case *DTMFInputEvent: 4692 return "DTMFInputEvent", nil 4693 case *DisconnectionEvent: 4694 return "DisconnectionEvent", nil 4695 case *PlaybackCompletionEvent: 4696 return "PlaybackCompletionEvent", nil 4697 case *TextInputEvent: 4698 return "TextInputEvent", nil 4699 default: 4700 return "", awserr.New( 4701 request.ErrCodeSerialization, 4702 fmt.Sprintf("unknown event type, %T, for StartConversationRequestEventStream", event), 4703 nil, 4704 ) 4705 } 4706} 4707 4708// StartConversationResponseEventStreamEvent groups together all EventStream 4709// events writes for StartConversationResponseEventStream. 4710// 4711// These events are: 4712// 4713// * AudioResponseEvent 4714// * HeartbeatEvent 4715// * IntentResultEvent 4716// * PlaybackInterruptionEvent 4717// * TextResponseEvent 4718// * TranscriptEvent 4719type StartConversationResponseEventStreamEvent interface { 4720 eventStartConversationResponseEventStream() 4721 eventstreamapi.Marshaler 4722 eventstreamapi.Unmarshaler 4723} 4724 4725// StartConversationResponseEventStreamReader provides the interface for reading to the stream. The 4726// default implementation for this interface will be StartConversationResponseEventStream. 4727// 4728// The reader's Close method must allow multiple concurrent calls. 4729// 4730// These events are: 4731// 4732// * AudioResponseEvent 4733// * HeartbeatEvent 4734// * IntentResultEvent 4735// * PlaybackInterruptionEvent 4736// * TextResponseEvent 4737// * TranscriptEvent 4738// * StartConversationResponseEventStreamUnknownEvent 4739type StartConversationResponseEventStreamReader interface { 4740 // Returns a channel of events as they are read from the event stream. 4741 Events() <-chan StartConversationResponseEventStreamEvent 4742 4743 // Close will stop the reader reading events from the stream. 4744 Close() error 4745 4746 // Returns any error that has occurred while reading from the event stream. 4747 Err() error 4748} 4749 4750type readStartConversationResponseEventStream struct { 4751 eventReader *eventstreamapi.EventReader 4752 stream chan StartConversationResponseEventStreamEvent 4753 err *eventstreamapi.OnceError 4754 4755 done chan struct{} 4756 closeOnce sync.Once 4757} 4758 4759func newReadStartConversationResponseEventStream(eventReader *eventstreamapi.EventReader) *readStartConversationResponseEventStream { 4760 r := &readStartConversationResponseEventStream{ 4761 eventReader: eventReader, 4762 stream: make(chan StartConversationResponseEventStreamEvent), 4763 done: make(chan struct{}), 4764 err: eventstreamapi.NewOnceError(), 4765 } 4766 go r.readEventStream() 4767 4768 return r 4769} 4770 4771// Close will close the underlying event stream reader. 4772func (r *readStartConversationResponseEventStream) Close() error { 4773 r.closeOnce.Do(r.safeClose) 4774 return r.Err() 4775} 4776 4777func (r *readStartConversationResponseEventStream) ErrorSet() <-chan struct{} { 4778 return r.err.ErrorSet() 4779} 4780 4781func (r *readStartConversationResponseEventStream) Closed() <-chan struct{} { 4782 return r.done 4783} 4784 4785func (r *readStartConversationResponseEventStream) safeClose() { 4786 close(r.done) 4787} 4788 4789func (r *readStartConversationResponseEventStream) Err() error { 4790 return r.err.Err() 4791} 4792 4793func (r *readStartConversationResponseEventStream) Events() <-chan StartConversationResponseEventStreamEvent { 4794 return r.stream 4795} 4796 4797func (r *readStartConversationResponseEventStream) readEventStream() { 4798 defer r.Close() 4799 defer close(r.stream) 4800 4801 for { 4802 event, err := r.eventReader.ReadEvent() 4803 if err != nil { 4804 if err == io.EOF { 4805 return 4806 } 4807 select { 4808 case <-r.done: 4809 // If closed already ignore the error 4810 return 4811 default: 4812 } 4813 if _, ok := err.(*eventstreamapi.UnknownMessageTypeError); ok { 4814 continue 4815 } 4816 r.err.SetError(err) 4817 return 4818 } 4819 4820 select { 4821 case r.stream <- event.(StartConversationResponseEventStreamEvent): 4822 case <-r.done: 4823 return 4824 } 4825 } 4826} 4827 4828type unmarshalerForStartConversationResponseEventStreamEvent struct { 4829 metadata protocol.ResponseMetadata 4830} 4831 4832func (u unmarshalerForStartConversationResponseEventStreamEvent) UnmarshalerForEventName(eventType string) (eventstreamapi.Unmarshaler, error) { 4833 switch eventType { 4834 case "AudioResponseEvent": 4835 return &AudioResponseEvent{}, nil 4836 case "HeartbeatEvent": 4837 return &HeartbeatEvent{}, nil 4838 case "IntentResultEvent": 4839 return &IntentResultEvent{}, nil 4840 case "PlaybackInterruptionEvent": 4841 return &PlaybackInterruptionEvent{}, nil 4842 case "TextResponseEvent": 4843 return &TextResponseEvent{}, nil 4844 case "TranscriptEvent": 4845 return &TranscriptEvent{}, nil 4846 case "AccessDeniedException": 4847 return newErrorAccessDeniedException(u.metadata).(eventstreamapi.Unmarshaler), nil 4848 case "BadGatewayException": 4849 return newErrorBadGatewayException(u.metadata).(eventstreamapi.Unmarshaler), nil 4850 case "ConflictException": 4851 return newErrorConflictException(u.metadata).(eventstreamapi.Unmarshaler), nil 4852 case "DependencyFailedException": 4853 return newErrorDependencyFailedException(u.metadata).(eventstreamapi.Unmarshaler), nil 4854 case "InternalServerException": 4855 return newErrorInternalServerException(u.metadata).(eventstreamapi.Unmarshaler), nil 4856 case "ResourceNotFoundException": 4857 return newErrorResourceNotFoundException(u.metadata).(eventstreamapi.Unmarshaler), nil 4858 case "ThrottlingException": 4859 return newErrorThrottlingException(u.metadata).(eventstreamapi.Unmarshaler), nil 4860 case "ValidationException": 4861 return newErrorValidationException(u.metadata).(eventstreamapi.Unmarshaler), nil 4862 default: 4863 return &StartConversationResponseEventStreamUnknownEvent{Type: eventType}, nil 4864 } 4865} 4866 4867// StartConversationResponseEventStreamUnknownEvent provides a failsafe event for the 4868// StartConversationResponseEventStream group of events when an unknown event is received. 4869type StartConversationResponseEventStreamUnknownEvent struct { 4870 Type string 4871 Message eventstream.Message 4872} 4873 4874// The StartConversationResponseEventStreamUnknownEvent is and event in the StartConversationResponseEventStream 4875// group of events. 4876func (s *StartConversationResponseEventStreamUnknownEvent) eventStartConversationResponseEventStream() { 4877} 4878 4879// MarshalEvent marshals the type into an stream event value. This method 4880// should only used internally within the SDK's EventStream handling. 4881func (e *StartConversationResponseEventStreamUnknownEvent) MarshalEvent(pm protocol.PayloadMarshaler) ( 4882 msg eventstream.Message, err error, 4883) { 4884 return e.Message.Clone(), nil 4885} 4886 4887// UnmarshalEvent unmarshals the EventStream Message into the StartConversationResponseEventStream value. 4888// This method is only used internally within the SDK's EventStream handling. 4889func (e *StartConversationResponseEventStreamUnknownEvent) UnmarshalEvent( 4890 payloadUnmarshaler protocol.PayloadUnmarshaler, 4891 msg eventstream.Message, 4892) error { 4893 e.Message = msg.Clone() 4894 return nil 4895} 4896 4897// The event sent from your client application to Amazon Lex V2 with text input 4898// from the user. 4899type TextInputEvent struct { 4900 _ struct{} `type:"structure"` 4901 4902 // A timestamp set by the client of the date and time that the event was sent 4903 // to Amazon Lex V2. 4904 ClientTimestampMillis *int64 `locationName:"clientTimestampMillis" type:"long"` 4905 4906 // A unique identifier that your application assigns to the event. You can use 4907 // this to identify events in logs. 4908 EventId *string `locationName:"eventId" min:"2" type:"string"` 4909 4910 // The text from the user. Amazon Lex V2 processes this as a complete statement. 4911 // 4912 // Text is a sensitive parameter and its value will be 4913 // replaced with "sensitive" in string returned by TextInputEvent's 4914 // String and GoString methods. 4915 // 4916 // Text is a required field 4917 Text *string `locationName:"text" min:"1" type:"string" required:"true" sensitive:"true"` 4918} 4919 4920// String returns the string representation. 4921// 4922// API parameter values that are decorated as "sensitive" in the API will not 4923// be included in the string output. The member name will be present, but the 4924// value will be replaced with "sensitive". 4925func (s TextInputEvent) String() string { 4926 return awsutil.Prettify(s) 4927} 4928 4929// GoString returns the string representation. 4930// 4931// API parameter values that are decorated as "sensitive" in the API will not 4932// be included in the string output. The member name will be present, but the 4933// value will be replaced with "sensitive". 4934func (s TextInputEvent) GoString() string { 4935 return s.String() 4936} 4937 4938// SetClientTimestampMillis sets the ClientTimestampMillis field's value. 4939func (s *TextInputEvent) SetClientTimestampMillis(v int64) *TextInputEvent { 4940 s.ClientTimestampMillis = &v 4941 return s 4942} 4943 4944// SetEventId sets the EventId field's value. 4945func (s *TextInputEvent) SetEventId(v string) *TextInputEvent { 4946 s.EventId = &v 4947 return s 4948} 4949 4950// SetText sets the Text field's value. 4951func (s *TextInputEvent) SetText(v string) *TextInputEvent { 4952 s.Text = &v 4953 return s 4954} 4955 4956// The TextInputEvent is and event in the StartConversationRequestEventStream group of events. 4957func (s *TextInputEvent) eventStartConversationRequestEventStream() {} 4958 4959// UnmarshalEvent unmarshals the EventStream Message into the TextInputEvent value. 4960// This method is only used internally within the SDK's EventStream handling. 4961func (s *TextInputEvent) UnmarshalEvent( 4962 payloadUnmarshaler protocol.PayloadUnmarshaler, 4963 msg eventstream.Message, 4964) error { 4965 if err := payloadUnmarshaler.UnmarshalPayload( 4966 bytes.NewReader(msg.Payload), s, 4967 ); err != nil { 4968 return err 4969 } 4970 return nil 4971} 4972 4973// MarshalEvent marshals the type into an stream event value. This method 4974// should only used internally within the SDK's EventStream handling. 4975func (s *TextInputEvent) MarshalEvent(pm protocol.PayloadMarshaler) (msg eventstream.Message, err error) { 4976 msg.Headers.Set(eventstreamapi.MessageTypeHeader, eventstream.StringValue(eventstreamapi.EventMessageType)) 4977 var buf bytes.Buffer 4978 if err = pm.MarshalPayload(&buf, s); err != nil { 4979 return eventstream.Message{}, err 4980 } 4981 msg.Payload = buf.Bytes() 4982 return msg, err 4983} 4984 4985// The event sent from Amazon Lex V2 to your application with text to present 4986// to the user. 4987type TextResponseEvent struct { 4988 _ struct{} `type:"structure"` 4989 4990 // A unique identifier of the event sent by Amazon Lex V2. The identifier is 4991 // in the form RESPONSE-N, where N is a number starting with one and incremented 4992 // for each event sent by Amazon Lex V2 in the current session. 4993 EventId *string `locationName:"eventId" min:"2" type:"string"` 4994 4995 // A list of messages to send to the user. Messages are ordered based on the 4996 // order that you returned the messages from your Lambda function or the order 4997 // that the messages are defined in the bot. 4998 Messages []*Message `locationName:"messages" type:"list"` 4999} 5000 5001// String returns the string representation. 5002// 5003// API parameter values that are decorated as "sensitive" in the API will not 5004// be included in the string output. The member name will be present, but the 5005// value will be replaced with "sensitive". 5006func (s TextResponseEvent) String() string { 5007 return awsutil.Prettify(s) 5008} 5009 5010// GoString returns the string representation. 5011// 5012// API parameter values that are decorated as "sensitive" in the API will not 5013// be included in the string output. The member name will be present, but the 5014// value will be replaced with "sensitive". 5015func (s TextResponseEvent) GoString() string { 5016 return s.String() 5017} 5018 5019// SetEventId sets the EventId field's value. 5020func (s *TextResponseEvent) SetEventId(v string) *TextResponseEvent { 5021 s.EventId = &v 5022 return s 5023} 5024 5025// SetMessages sets the Messages field's value. 5026func (s *TextResponseEvent) SetMessages(v []*Message) *TextResponseEvent { 5027 s.Messages = v 5028 return s 5029} 5030 5031// The TextResponseEvent is and event in the StartConversationResponseEventStream group of events. 5032func (s *TextResponseEvent) eventStartConversationResponseEventStream() {} 5033 5034// UnmarshalEvent unmarshals the EventStream Message into the TextResponseEvent value. 5035// This method is only used internally within the SDK's EventStream handling. 5036func (s *TextResponseEvent) UnmarshalEvent( 5037 payloadUnmarshaler protocol.PayloadUnmarshaler, 5038 msg eventstream.Message, 5039) error { 5040 if err := payloadUnmarshaler.UnmarshalPayload( 5041 bytes.NewReader(msg.Payload), s, 5042 ); err != nil { 5043 return err 5044 } 5045 return nil 5046} 5047 5048// MarshalEvent marshals the type into an stream event value. This method 5049// should only used internally within the SDK's EventStream handling. 5050func (s *TextResponseEvent) MarshalEvent(pm protocol.PayloadMarshaler) (msg eventstream.Message, err error) { 5051 msg.Headers.Set(eventstreamapi.MessageTypeHeader, eventstream.StringValue(eventstreamapi.EventMessageType)) 5052 var buf bytes.Buffer 5053 if err = pm.MarshalPayload(&buf, s); err != nil { 5054 return eventstream.Message{}, err 5055 } 5056 msg.Payload = buf.Bytes() 5057 return msg, err 5058} 5059 5060type ThrottlingException struct { 5061 _ struct{} `type:"structure"` 5062 RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` 5063 5064 Message_ *string `locationName:"message" type:"string"` 5065} 5066 5067// String returns the string representation. 5068// 5069// API parameter values that are decorated as "sensitive" in the API will not 5070// be included in the string output. The member name will be present, but the 5071// value will be replaced with "sensitive". 5072func (s ThrottlingException) String() string { 5073 return awsutil.Prettify(s) 5074} 5075 5076// GoString returns the string representation. 5077// 5078// API parameter values that are decorated as "sensitive" in the API will not 5079// be included in the string output. The member name will be present, but the 5080// value will be replaced with "sensitive". 5081func (s ThrottlingException) GoString() string { 5082 return s.String() 5083} 5084 5085// The ThrottlingException is and event in the StartConversationResponseEventStream group of events. 5086func (s *ThrottlingException) eventStartConversationResponseEventStream() {} 5087 5088// UnmarshalEvent unmarshals the EventStream Message into the ThrottlingException value. 5089// This method is only used internally within the SDK's EventStream handling. 5090func (s *ThrottlingException) UnmarshalEvent( 5091 payloadUnmarshaler protocol.PayloadUnmarshaler, 5092 msg eventstream.Message, 5093) error { 5094 if err := payloadUnmarshaler.UnmarshalPayload( 5095 bytes.NewReader(msg.Payload), s, 5096 ); err != nil { 5097 return err 5098 } 5099 return nil 5100} 5101 5102// MarshalEvent marshals the type into an stream event value. This method 5103// should only used internally within the SDK's EventStream handling. 5104func (s *ThrottlingException) MarshalEvent(pm protocol.PayloadMarshaler) (msg eventstream.Message, err error) { 5105 msg.Headers.Set(eventstreamapi.MessageTypeHeader, eventstream.StringValue(eventstreamapi.ExceptionMessageType)) 5106 var buf bytes.Buffer 5107 if err = pm.MarshalPayload(&buf, s); err != nil { 5108 return eventstream.Message{}, err 5109 } 5110 msg.Payload = buf.Bytes() 5111 return msg, err 5112} 5113 5114func newErrorThrottlingException(v protocol.ResponseMetadata) error { 5115 return &ThrottlingException{ 5116 RespMetadata: v, 5117 } 5118} 5119 5120// Code returns the exception type name. 5121func (s *ThrottlingException) Code() string { 5122 return "ThrottlingException" 5123} 5124 5125// Message returns the exception's message. 5126func (s *ThrottlingException) Message() string { 5127 if s.Message_ != nil { 5128 return *s.Message_ 5129 } 5130 return "" 5131} 5132 5133// OrigErr always returns nil, satisfies awserr.Error interface. 5134func (s *ThrottlingException) OrigErr() error { 5135 return nil 5136} 5137 5138func (s *ThrottlingException) Error() string { 5139 return fmt.Sprintf("%s: %s", s.Code(), s.Message()) 5140} 5141 5142// Status code returns the HTTP status code for the request's response error. 5143func (s *ThrottlingException) StatusCode() int { 5144 return s.RespMetadata.StatusCode 5145} 5146 5147// RequestID returns the service's response RequestID for request. 5148func (s *ThrottlingException) RequestID() string { 5149 return s.RespMetadata.RequestID 5150} 5151 5152// Event sent from Amazon Lex V2 to your client application that contains a 5153// transcript of voice audio. 5154type TranscriptEvent struct { 5155 _ struct{} `type:"structure"` 5156 5157 // A unique identifier of the event sent by Amazon Lex V2. The identifier is 5158 // in the form RESPONSE-N, where N is a number starting with one and incremented 5159 // for each event sent by Amazon Lex V2 in the current session. 5160 EventId *string `locationName:"eventId" min:"2" type:"string"` 5161 5162 // The transcript of the voice audio from the user. 5163 Transcript *string `locationName:"transcript" type:"string"` 5164} 5165 5166// String returns the string representation. 5167// 5168// API parameter values that are decorated as "sensitive" in the API will not 5169// be included in the string output. The member name will be present, but the 5170// value will be replaced with "sensitive". 5171func (s TranscriptEvent) String() string { 5172 return awsutil.Prettify(s) 5173} 5174 5175// GoString returns the string representation. 5176// 5177// API parameter values that are decorated as "sensitive" in the API will not 5178// be included in the string output. The member name will be present, but the 5179// value will be replaced with "sensitive". 5180func (s TranscriptEvent) GoString() string { 5181 return s.String() 5182} 5183 5184// SetEventId sets the EventId field's value. 5185func (s *TranscriptEvent) SetEventId(v string) *TranscriptEvent { 5186 s.EventId = &v 5187 return s 5188} 5189 5190// SetTranscript sets the Transcript field's value. 5191func (s *TranscriptEvent) SetTranscript(v string) *TranscriptEvent { 5192 s.Transcript = &v 5193 return s 5194} 5195 5196// The TranscriptEvent is and event in the StartConversationResponseEventStream group of events. 5197func (s *TranscriptEvent) eventStartConversationResponseEventStream() {} 5198 5199// UnmarshalEvent unmarshals the EventStream Message into the TranscriptEvent value. 5200// This method is only used internally within the SDK's EventStream handling. 5201func (s *TranscriptEvent) UnmarshalEvent( 5202 payloadUnmarshaler protocol.PayloadUnmarshaler, 5203 msg eventstream.Message, 5204) error { 5205 if err := payloadUnmarshaler.UnmarshalPayload( 5206 bytes.NewReader(msg.Payload), s, 5207 ); err != nil { 5208 return err 5209 } 5210 return nil 5211} 5212 5213// MarshalEvent marshals the type into an stream event value. This method 5214// should only used internally within the SDK's EventStream handling. 5215func (s *TranscriptEvent) MarshalEvent(pm protocol.PayloadMarshaler) (msg eventstream.Message, err error) { 5216 msg.Headers.Set(eventstreamapi.MessageTypeHeader, eventstream.StringValue(eventstreamapi.EventMessageType)) 5217 var buf bytes.Buffer 5218 if err = pm.MarshalPayload(&buf, s); err != nil { 5219 return eventstream.Message{}, err 5220 } 5221 msg.Payload = buf.Bytes() 5222 return msg, err 5223} 5224 5225type ValidationException struct { 5226 _ struct{} `type:"structure"` 5227 RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` 5228 5229 Message_ *string `locationName:"message" type:"string"` 5230} 5231 5232// String returns the string representation. 5233// 5234// API parameter values that are decorated as "sensitive" in the API will not 5235// be included in the string output. The member name will be present, but the 5236// value will be replaced with "sensitive". 5237func (s ValidationException) String() string { 5238 return awsutil.Prettify(s) 5239} 5240 5241// GoString returns the string representation. 5242// 5243// API parameter values that are decorated as "sensitive" in the API will not 5244// be included in the string output. The member name will be present, but the 5245// value will be replaced with "sensitive". 5246func (s ValidationException) GoString() string { 5247 return s.String() 5248} 5249 5250// The ValidationException is and event in the StartConversationResponseEventStream group of events. 5251func (s *ValidationException) eventStartConversationResponseEventStream() {} 5252 5253// UnmarshalEvent unmarshals the EventStream Message into the ValidationException value. 5254// This method is only used internally within the SDK's EventStream handling. 5255func (s *ValidationException) UnmarshalEvent( 5256 payloadUnmarshaler protocol.PayloadUnmarshaler, 5257 msg eventstream.Message, 5258) error { 5259 if err := payloadUnmarshaler.UnmarshalPayload( 5260 bytes.NewReader(msg.Payload), s, 5261 ); err != nil { 5262 return err 5263 } 5264 return nil 5265} 5266 5267// MarshalEvent marshals the type into an stream event value. This method 5268// should only used internally within the SDK's EventStream handling. 5269func (s *ValidationException) MarshalEvent(pm protocol.PayloadMarshaler) (msg eventstream.Message, err error) { 5270 msg.Headers.Set(eventstreamapi.MessageTypeHeader, eventstream.StringValue(eventstreamapi.ExceptionMessageType)) 5271 var buf bytes.Buffer 5272 if err = pm.MarshalPayload(&buf, s); err != nil { 5273 return eventstream.Message{}, err 5274 } 5275 msg.Payload = buf.Bytes() 5276 return msg, err 5277} 5278 5279func newErrorValidationException(v protocol.ResponseMetadata) error { 5280 return &ValidationException{ 5281 RespMetadata: v, 5282 } 5283} 5284 5285// Code returns the exception type name. 5286func (s *ValidationException) Code() string { 5287 return "ValidationException" 5288} 5289 5290// Message returns the exception's message. 5291func (s *ValidationException) Message() string { 5292 if s.Message_ != nil { 5293 return *s.Message_ 5294 } 5295 return "" 5296} 5297 5298// OrigErr always returns nil, satisfies awserr.Error interface. 5299func (s *ValidationException) OrigErr() error { 5300 return nil 5301} 5302 5303func (s *ValidationException) Error() string { 5304 return fmt.Sprintf("%s: %s", s.Code(), s.Message()) 5305} 5306 5307// Status code returns the HTTP status code for the request's response error. 5308func (s *ValidationException) StatusCode() int { 5309 return s.RespMetadata.StatusCode 5310} 5311 5312// RequestID returns the service's response RequestID for request. 5313func (s *ValidationException) RequestID() string { 5314 return s.RespMetadata.RequestID 5315} 5316 5317// The value of a slot. 5318type Value struct { 5319 _ struct{} `type:"structure"` 5320 5321 // The value that Amazon Lex V2 determines for the slot. The actual value depends 5322 // on the setting of the value selection strategy for the bot. You can choose 5323 // to use the value entered by the user, or you can have Amazon Lex V2 choose 5324 // the first value in the resolvedValues list. 5325 // 5326 // InterpretedValue is a required field 5327 InterpretedValue *string `locationName:"interpretedValue" min:"1" type:"string" required:"true"` 5328 5329 // The text of the utterance from the user that was entered for the slot. 5330 OriginalValue *string `locationName:"originalValue" min:"1" type:"string"` 5331 5332 // A list of additional values that have been recognized for the slot. 5333 ResolvedValues []*string `locationName:"resolvedValues" type:"list"` 5334} 5335 5336// String returns the string representation. 5337// 5338// API parameter values that are decorated as "sensitive" in the API will not 5339// be included in the string output. The member name will be present, but the 5340// value will be replaced with "sensitive". 5341func (s Value) String() string { 5342 return awsutil.Prettify(s) 5343} 5344 5345// GoString returns the string representation. 5346// 5347// API parameter values that are decorated as "sensitive" in the API will not 5348// be included in the string output. The member name will be present, but the 5349// value will be replaced with "sensitive". 5350func (s Value) GoString() string { 5351 return s.String() 5352} 5353 5354// Validate inspects the fields of the type to determine if they are valid. 5355func (s *Value) Validate() error { 5356 invalidParams := request.ErrInvalidParams{Context: "Value"} 5357 if s.InterpretedValue == nil { 5358 invalidParams.Add(request.NewErrParamRequired("InterpretedValue")) 5359 } 5360 if s.InterpretedValue != nil && len(*s.InterpretedValue) < 1 { 5361 invalidParams.Add(request.NewErrParamMinLen("InterpretedValue", 1)) 5362 } 5363 if s.OriginalValue != nil && len(*s.OriginalValue) < 1 { 5364 invalidParams.Add(request.NewErrParamMinLen("OriginalValue", 1)) 5365 } 5366 5367 if invalidParams.Len() > 0 { 5368 return invalidParams 5369 } 5370 return nil 5371} 5372 5373// SetInterpretedValue sets the InterpretedValue field's value. 5374func (s *Value) SetInterpretedValue(v string) *Value { 5375 s.InterpretedValue = &v 5376 return s 5377} 5378 5379// SetOriginalValue sets the OriginalValue field's value. 5380func (s *Value) SetOriginalValue(v string) *Value { 5381 s.OriginalValue = &v 5382 return s 5383} 5384 5385// SetResolvedValues sets the ResolvedValues field's value. 5386func (s *Value) SetResolvedValues(v []*string) *Value { 5387 s.ResolvedValues = v 5388 return s 5389} 5390 5391const ( 5392 // ConfirmationStateConfirmed is a ConfirmationState enum value 5393 ConfirmationStateConfirmed = "Confirmed" 5394 5395 // ConfirmationStateDenied is a ConfirmationState enum value 5396 ConfirmationStateDenied = "Denied" 5397 5398 // ConfirmationStateNone is a ConfirmationState enum value 5399 ConfirmationStateNone = "None" 5400) 5401 5402// ConfirmationState_Values returns all elements of the ConfirmationState enum 5403func ConfirmationState_Values() []string { 5404 return []string{ 5405 ConfirmationStateConfirmed, 5406 ConfirmationStateDenied, 5407 ConfirmationStateNone, 5408 } 5409} 5410 5411const ( 5412 // ConversationModeAudio is a ConversationMode enum value 5413 ConversationModeAudio = "AUDIO" 5414 5415 // ConversationModeText is a ConversationMode enum value 5416 ConversationModeText = "TEXT" 5417) 5418 5419// ConversationMode_Values returns all elements of the ConversationMode enum 5420func ConversationMode_Values() []string { 5421 return []string{ 5422 ConversationModeAudio, 5423 ConversationModeText, 5424 } 5425} 5426 5427const ( 5428 // DialogActionTypeClose is a DialogActionType enum value 5429 DialogActionTypeClose = "Close" 5430 5431 // DialogActionTypeConfirmIntent is a DialogActionType enum value 5432 DialogActionTypeConfirmIntent = "ConfirmIntent" 5433 5434 // DialogActionTypeDelegate is a DialogActionType enum value 5435 DialogActionTypeDelegate = "Delegate" 5436 5437 // DialogActionTypeElicitIntent is a DialogActionType enum value 5438 DialogActionTypeElicitIntent = "ElicitIntent" 5439 5440 // DialogActionTypeElicitSlot is a DialogActionType enum value 5441 DialogActionTypeElicitSlot = "ElicitSlot" 5442 5443 // DialogActionTypeNone is a DialogActionType enum value 5444 DialogActionTypeNone = "None" 5445) 5446 5447// DialogActionType_Values returns all elements of the DialogActionType enum 5448func DialogActionType_Values() []string { 5449 return []string{ 5450 DialogActionTypeClose, 5451 DialogActionTypeConfirmIntent, 5452 DialogActionTypeDelegate, 5453 DialogActionTypeElicitIntent, 5454 DialogActionTypeElicitSlot, 5455 DialogActionTypeNone, 5456 } 5457} 5458 5459const ( 5460 // InputModeText is a InputMode enum value 5461 InputModeText = "Text" 5462 5463 // InputModeSpeech is a InputMode enum value 5464 InputModeSpeech = "Speech" 5465 5466 // InputModeDtmf is a InputMode enum value 5467 InputModeDtmf = "DTMF" 5468) 5469 5470// InputMode_Values returns all elements of the InputMode enum 5471func InputMode_Values() []string { 5472 return []string{ 5473 InputModeText, 5474 InputModeSpeech, 5475 InputModeDtmf, 5476 } 5477} 5478 5479const ( 5480 // IntentStateFailed is a IntentState enum value 5481 IntentStateFailed = "Failed" 5482 5483 // IntentStateFulfilled is a IntentState enum value 5484 IntentStateFulfilled = "Fulfilled" 5485 5486 // IntentStateInProgress is a IntentState enum value 5487 IntentStateInProgress = "InProgress" 5488 5489 // IntentStateReadyForFulfillment is a IntentState enum value 5490 IntentStateReadyForFulfillment = "ReadyForFulfillment" 5491 5492 // IntentStateWaiting is a IntentState enum value 5493 IntentStateWaiting = "Waiting" 5494 5495 // IntentStateFulfillmentInProgress is a IntentState enum value 5496 IntentStateFulfillmentInProgress = "FulfillmentInProgress" 5497) 5498 5499// IntentState_Values returns all elements of the IntentState enum 5500func IntentState_Values() []string { 5501 return []string{ 5502 IntentStateFailed, 5503 IntentStateFulfilled, 5504 IntentStateInProgress, 5505 IntentStateReadyForFulfillment, 5506 IntentStateWaiting, 5507 IntentStateFulfillmentInProgress, 5508 } 5509} 5510 5511const ( 5512 // MessageContentTypeCustomPayload is a MessageContentType enum value 5513 MessageContentTypeCustomPayload = "CustomPayload" 5514 5515 // MessageContentTypeImageResponseCard is a MessageContentType enum value 5516 MessageContentTypeImageResponseCard = "ImageResponseCard" 5517 5518 // MessageContentTypePlainText is a MessageContentType enum value 5519 MessageContentTypePlainText = "PlainText" 5520 5521 // MessageContentTypeSsml is a MessageContentType enum value 5522 MessageContentTypeSsml = "SSML" 5523) 5524 5525// MessageContentType_Values returns all elements of the MessageContentType enum 5526func MessageContentType_Values() []string { 5527 return []string{ 5528 MessageContentTypeCustomPayload, 5529 MessageContentTypeImageResponseCard, 5530 MessageContentTypePlainText, 5531 MessageContentTypeSsml, 5532 } 5533} 5534 5535const ( 5536 // PlaybackInterruptionReasonDtmfStartDetected is a PlaybackInterruptionReason enum value 5537 PlaybackInterruptionReasonDtmfStartDetected = "DTMF_START_DETECTED" 5538 5539 // PlaybackInterruptionReasonTextDetected is a PlaybackInterruptionReason enum value 5540 PlaybackInterruptionReasonTextDetected = "TEXT_DETECTED" 5541 5542 // PlaybackInterruptionReasonVoiceStartDetected is a PlaybackInterruptionReason enum value 5543 PlaybackInterruptionReasonVoiceStartDetected = "VOICE_START_DETECTED" 5544) 5545 5546// PlaybackInterruptionReason_Values returns all elements of the PlaybackInterruptionReason enum 5547func PlaybackInterruptionReason_Values() []string { 5548 return []string{ 5549 PlaybackInterruptionReasonDtmfStartDetected, 5550 PlaybackInterruptionReasonTextDetected, 5551 PlaybackInterruptionReasonVoiceStartDetected, 5552 } 5553} 5554 5555const ( 5556 // SentimentTypeMixed is a SentimentType enum value 5557 SentimentTypeMixed = "MIXED" 5558 5559 // SentimentTypeNegative is a SentimentType enum value 5560 SentimentTypeNegative = "NEGATIVE" 5561 5562 // SentimentTypeNeutral is a SentimentType enum value 5563 SentimentTypeNeutral = "NEUTRAL" 5564 5565 // SentimentTypePositive is a SentimentType enum value 5566 SentimentTypePositive = "POSITIVE" 5567) 5568 5569// SentimentType_Values returns all elements of the SentimentType enum 5570func SentimentType_Values() []string { 5571 return []string{ 5572 SentimentTypeMixed, 5573 SentimentTypeNegative, 5574 SentimentTypeNeutral, 5575 SentimentTypePositive, 5576 } 5577} 5578 5579const ( 5580 // ShapeScalar is a Shape enum value 5581 ShapeScalar = "Scalar" 5582 5583 // ShapeList is a Shape enum value 5584 ShapeList = "List" 5585) 5586 5587// Shape_Values returns all elements of the Shape enum 5588func Shape_Values() []string { 5589 return []string{ 5590 ShapeScalar, 5591 ShapeList, 5592 } 5593} 5594