1// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. 2 3package translate 4 5import ( 6 "fmt" 7 "time" 8 9 "github.com/aws/aws-sdk-go/aws" 10 "github.com/aws/aws-sdk-go/aws/awsutil" 11 "github.com/aws/aws-sdk-go/aws/request" 12 "github.com/aws/aws-sdk-go/private/protocol" 13 "github.com/aws/aws-sdk-go/private/protocol/jsonrpc" 14) 15 16const opDeleteTerminology = "DeleteTerminology" 17 18// DeleteTerminologyRequest generates a "aws/request.Request" representing the 19// client's request for the DeleteTerminology operation. The "output" return 20// value will be populated with the request's response once the request completes 21// successfully. 22// 23// Use "Send" method on the returned Request to send the API call to the service. 24// the "output" return value is not valid until after Send returns without error. 25// 26// See DeleteTerminology for more information on using the DeleteTerminology 27// API call, and error handling. 28// 29// This method is useful when you want to inject custom logic or configuration 30// into the SDK's request lifecycle. Such as custom headers, or retry logic. 31// 32// 33// // Example sending a request using the DeleteTerminologyRequest method. 34// req, resp := client.DeleteTerminologyRequest(params) 35// 36// err := req.Send() 37// if err == nil { // resp is now filled 38// fmt.Println(resp) 39// } 40// 41// See also, https://docs.aws.amazon.com/goto/WebAPI/translate-2017-07-01/DeleteTerminology 42func (c *Translate) DeleteTerminologyRequest(input *DeleteTerminologyInput) (req *request.Request, output *DeleteTerminologyOutput) { 43 op := &request.Operation{ 44 Name: opDeleteTerminology, 45 HTTPMethod: "POST", 46 HTTPPath: "/", 47 } 48 49 if input == nil { 50 input = &DeleteTerminologyInput{} 51 } 52 53 output = &DeleteTerminologyOutput{} 54 req = c.newRequest(op, input, output) 55 req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) 56 return 57} 58 59// DeleteTerminology API operation for Amazon Translate. 60// 61// A synchronous action that deletes a custom terminology. 62// 63// Returns awserr.Error for service API and SDK errors. Use runtime type assertions 64// with awserr.Error's Code and Message methods to get detailed information about 65// the error. 66// 67// See the AWS API reference guide for Amazon Translate's 68// API operation DeleteTerminology for usage and error information. 69// 70// Returned Error Types: 71// * ResourceNotFoundException 72// The resource you are looking for has not been found. Review the resource 73// you're looking for and see if a different resource will accomplish your needs 74// before retrying the revised request. 75// 76// * TooManyRequestsException 77// You have made too many requests within a short period of time. Wait for a 78// short time and then try your request again. 79// 80// * InternalServerException 81// An internal server error occurred. Retry your request. 82// 83// See also, https://docs.aws.amazon.com/goto/WebAPI/translate-2017-07-01/DeleteTerminology 84func (c *Translate) DeleteTerminology(input *DeleteTerminologyInput) (*DeleteTerminologyOutput, error) { 85 req, out := c.DeleteTerminologyRequest(input) 86 return out, req.Send() 87} 88 89// DeleteTerminologyWithContext is the same as DeleteTerminology with the addition of 90// the ability to pass a context and additional request options. 91// 92// See DeleteTerminology for details on how to use this API operation. 93// 94// The context must be non-nil and will be used for request cancellation. If 95// the context is nil a panic will occur. In the future the SDK may create 96// sub-contexts for http.Requests. See https://golang.org/pkg/context/ 97// for more information on using Contexts. 98func (c *Translate) DeleteTerminologyWithContext(ctx aws.Context, input *DeleteTerminologyInput, opts ...request.Option) (*DeleteTerminologyOutput, error) { 99 req, out := c.DeleteTerminologyRequest(input) 100 req.SetContext(ctx) 101 req.ApplyOptions(opts...) 102 return out, req.Send() 103} 104 105const opDescribeTextTranslationJob = "DescribeTextTranslationJob" 106 107// DescribeTextTranslationJobRequest generates a "aws/request.Request" representing the 108// client's request for the DescribeTextTranslationJob operation. The "output" return 109// value will be populated with the request's response once the request completes 110// successfully. 111// 112// Use "Send" method on the returned Request to send the API call to the service. 113// the "output" return value is not valid until after Send returns without error. 114// 115// See DescribeTextTranslationJob for more information on using the DescribeTextTranslationJob 116// API call, and error handling. 117// 118// This method is useful when you want to inject custom logic or configuration 119// into the SDK's request lifecycle. Such as custom headers, or retry logic. 120// 121// 122// // Example sending a request using the DescribeTextTranslationJobRequest method. 123// req, resp := client.DescribeTextTranslationJobRequest(params) 124// 125// err := req.Send() 126// if err == nil { // resp is now filled 127// fmt.Println(resp) 128// } 129// 130// See also, https://docs.aws.amazon.com/goto/WebAPI/translate-2017-07-01/DescribeTextTranslationJob 131func (c *Translate) DescribeTextTranslationJobRequest(input *DescribeTextTranslationJobInput) (req *request.Request, output *DescribeTextTranslationJobOutput) { 132 op := &request.Operation{ 133 Name: opDescribeTextTranslationJob, 134 HTTPMethod: "POST", 135 HTTPPath: "/", 136 } 137 138 if input == nil { 139 input = &DescribeTextTranslationJobInput{} 140 } 141 142 output = &DescribeTextTranslationJobOutput{} 143 req = c.newRequest(op, input, output) 144 return 145} 146 147// DescribeTextTranslationJob API operation for Amazon Translate. 148// 149// Gets the properties associated with an asycnhronous batch translation job 150// including name, ID, status, source and target languages, input/output S3 151// buckets, and so on. 152// 153// Returns awserr.Error for service API and SDK errors. Use runtime type assertions 154// with awserr.Error's Code and Message methods to get detailed information about 155// the error. 156// 157// See the AWS API reference guide for Amazon Translate's 158// API operation DescribeTextTranslationJob for usage and error information. 159// 160// Returned Error Types: 161// * ResourceNotFoundException 162// The resource you are looking for has not been found. Review the resource 163// you're looking for and see if a different resource will accomplish your needs 164// before retrying the revised request. 165// 166// * TooManyRequestsException 167// You have made too many requests within a short period of time. Wait for a 168// short time and then try your request again. 169// 170// * InternalServerException 171// An internal server error occurred. Retry your request. 172// 173// See also, https://docs.aws.amazon.com/goto/WebAPI/translate-2017-07-01/DescribeTextTranslationJob 174func (c *Translate) DescribeTextTranslationJob(input *DescribeTextTranslationJobInput) (*DescribeTextTranslationJobOutput, error) { 175 req, out := c.DescribeTextTranslationJobRequest(input) 176 return out, req.Send() 177} 178 179// DescribeTextTranslationJobWithContext is the same as DescribeTextTranslationJob with the addition of 180// the ability to pass a context and additional request options. 181// 182// See DescribeTextTranslationJob for details on how to use this API operation. 183// 184// The context must be non-nil and will be used for request cancellation. If 185// the context is nil a panic will occur. In the future the SDK may create 186// sub-contexts for http.Requests. See https://golang.org/pkg/context/ 187// for more information on using Contexts. 188func (c *Translate) DescribeTextTranslationJobWithContext(ctx aws.Context, input *DescribeTextTranslationJobInput, opts ...request.Option) (*DescribeTextTranslationJobOutput, error) { 189 req, out := c.DescribeTextTranslationJobRequest(input) 190 req.SetContext(ctx) 191 req.ApplyOptions(opts...) 192 return out, req.Send() 193} 194 195const opGetTerminology = "GetTerminology" 196 197// GetTerminologyRequest generates a "aws/request.Request" representing the 198// client's request for the GetTerminology operation. The "output" return 199// value will be populated with the request's response once the request completes 200// successfully. 201// 202// Use "Send" method on the returned Request to send the API call to the service. 203// the "output" return value is not valid until after Send returns without error. 204// 205// See GetTerminology for more information on using the GetTerminology 206// API call, and error handling. 207// 208// This method is useful when you want to inject custom logic or configuration 209// into the SDK's request lifecycle. Such as custom headers, or retry logic. 210// 211// 212// // Example sending a request using the GetTerminologyRequest method. 213// req, resp := client.GetTerminologyRequest(params) 214// 215// err := req.Send() 216// if err == nil { // resp is now filled 217// fmt.Println(resp) 218// } 219// 220// See also, https://docs.aws.amazon.com/goto/WebAPI/translate-2017-07-01/GetTerminology 221func (c *Translate) GetTerminologyRequest(input *GetTerminologyInput) (req *request.Request, output *GetTerminologyOutput) { 222 op := &request.Operation{ 223 Name: opGetTerminology, 224 HTTPMethod: "POST", 225 HTTPPath: "/", 226 } 227 228 if input == nil { 229 input = &GetTerminologyInput{} 230 } 231 232 output = &GetTerminologyOutput{} 233 req = c.newRequest(op, input, output) 234 return 235} 236 237// GetTerminology API operation for Amazon Translate. 238// 239// Retrieves a custom terminology. 240// 241// Returns awserr.Error for service API and SDK errors. Use runtime type assertions 242// with awserr.Error's Code and Message methods to get detailed information about 243// the error. 244// 245// See the AWS API reference guide for Amazon Translate's 246// API operation GetTerminology for usage and error information. 247// 248// Returned Error Types: 249// * ResourceNotFoundException 250// The resource you are looking for has not been found. Review the resource 251// you're looking for and see if a different resource will accomplish your needs 252// before retrying the revised request. 253// 254// * InvalidParameterValueException 255// The value of the parameter is invalid. Review the value of the parameter 256// you are using to correct it, and then retry your operation. 257// 258// * TooManyRequestsException 259// You have made too many requests within a short period of time. Wait for a 260// short time and then try your request again. 261// 262// * InternalServerException 263// An internal server error occurred. Retry your request. 264// 265// See also, https://docs.aws.amazon.com/goto/WebAPI/translate-2017-07-01/GetTerminology 266func (c *Translate) GetTerminology(input *GetTerminologyInput) (*GetTerminologyOutput, error) { 267 req, out := c.GetTerminologyRequest(input) 268 return out, req.Send() 269} 270 271// GetTerminologyWithContext is the same as GetTerminology with the addition of 272// the ability to pass a context and additional request options. 273// 274// See GetTerminology for details on how to use this API operation. 275// 276// The context must be non-nil and will be used for request cancellation. If 277// the context is nil a panic will occur. In the future the SDK may create 278// sub-contexts for http.Requests. See https://golang.org/pkg/context/ 279// for more information on using Contexts. 280func (c *Translate) GetTerminologyWithContext(ctx aws.Context, input *GetTerminologyInput, opts ...request.Option) (*GetTerminologyOutput, error) { 281 req, out := c.GetTerminologyRequest(input) 282 req.SetContext(ctx) 283 req.ApplyOptions(opts...) 284 return out, req.Send() 285} 286 287const opImportTerminology = "ImportTerminology" 288 289// ImportTerminologyRequest generates a "aws/request.Request" representing the 290// client's request for the ImportTerminology operation. The "output" return 291// value will be populated with the request's response once the request completes 292// successfully. 293// 294// Use "Send" method on the returned Request to send the API call to the service. 295// the "output" return value is not valid until after Send returns without error. 296// 297// See ImportTerminology for more information on using the ImportTerminology 298// API call, and error handling. 299// 300// This method is useful when you want to inject custom logic or configuration 301// into the SDK's request lifecycle. Such as custom headers, or retry logic. 302// 303// 304// // Example sending a request using the ImportTerminologyRequest method. 305// req, resp := client.ImportTerminologyRequest(params) 306// 307// err := req.Send() 308// if err == nil { // resp is now filled 309// fmt.Println(resp) 310// } 311// 312// See also, https://docs.aws.amazon.com/goto/WebAPI/translate-2017-07-01/ImportTerminology 313func (c *Translate) ImportTerminologyRequest(input *ImportTerminologyInput) (req *request.Request, output *ImportTerminologyOutput) { 314 op := &request.Operation{ 315 Name: opImportTerminology, 316 HTTPMethod: "POST", 317 HTTPPath: "/", 318 } 319 320 if input == nil { 321 input = &ImportTerminologyInput{} 322 } 323 324 output = &ImportTerminologyOutput{} 325 req = c.newRequest(op, input, output) 326 return 327} 328 329// ImportTerminology API operation for Amazon Translate. 330// 331// Creates or updates a custom terminology, depending on whether or not one 332// already exists for the given terminology name. Importing a terminology with 333// the same name as an existing one will merge the terminologies based on the 334// chosen merge strategy. Currently, the only supported merge strategy is OVERWRITE, 335// and so the imported terminology will overwrite an existing terminology of 336// the same name. 337// 338// If you import a terminology that overwrites an existing one, the new terminology 339// take up to 10 minutes to fully propagate and be available for use in a translation 340// due to cache policies with the DataPlane service that performs the translations. 341// 342// Returns awserr.Error for service API and SDK errors. Use runtime type assertions 343// with awserr.Error's Code and Message methods to get detailed information about 344// the error. 345// 346// See the AWS API reference guide for Amazon Translate's 347// API operation ImportTerminology for usage and error information. 348// 349// Returned Error Types: 350// * InvalidParameterValueException 351// The value of the parameter is invalid. Review the value of the parameter 352// you are using to correct it, and then retry your operation. 353// 354// * LimitExceededException 355// The specified limit has been exceeded. Review your request and retry it with 356// a quantity below the stated limit. 357// 358// * TooManyRequestsException 359// You have made too many requests within a short period of time. Wait for a 360// short time and then try your request again. 361// 362// * InternalServerException 363// An internal server error occurred. Retry your request. 364// 365// See also, https://docs.aws.amazon.com/goto/WebAPI/translate-2017-07-01/ImportTerminology 366func (c *Translate) ImportTerminology(input *ImportTerminologyInput) (*ImportTerminologyOutput, error) { 367 req, out := c.ImportTerminologyRequest(input) 368 return out, req.Send() 369} 370 371// ImportTerminologyWithContext is the same as ImportTerminology with the addition of 372// the ability to pass a context and additional request options. 373// 374// See ImportTerminology for details on how to use this API operation. 375// 376// The context must be non-nil and will be used for request cancellation. If 377// the context is nil a panic will occur. In the future the SDK may create 378// sub-contexts for http.Requests. See https://golang.org/pkg/context/ 379// for more information on using Contexts. 380func (c *Translate) ImportTerminologyWithContext(ctx aws.Context, input *ImportTerminologyInput, opts ...request.Option) (*ImportTerminologyOutput, error) { 381 req, out := c.ImportTerminologyRequest(input) 382 req.SetContext(ctx) 383 req.ApplyOptions(opts...) 384 return out, req.Send() 385} 386 387const opListTerminologies = "ListTerminologies" 388 389// ListTerminologiesRequest generates a "aws/request.Request" representing the 390// client's request for the ListTerminologies operation. The "output" return 391// value will be populated with the request's response once the request completes 392// successfully. 393// 394// Use "Send" method on the returned Request to send the API call to the service. 395// the "output" return value is not valid until after Send returns without error. 396// 397// See ListTerminologies for more information on using the ListTerminologies 398// API call, and error handling. 399// 400// This method is useful when you want to inject custom logic or configuration 401// into the SDK's request lifecycle. Such as custom headers, or retry logic. 402// 403// 404// // Example sending a request using the ListTerminologiesRequest method. 405// req, resp := client.ListTerminologiesRequest(params) 406// 407// err := req.Send() 408// if err == nil { // resp is now filled 409// fmt.Println(resp) 410// } 411// 412// See also, https://docs.aws.amazon.com/goto/WebAPI/translate-2017-07-01/ListTerminologies 413func (c *Translate) ListTerminologiesRequest(input *ListTerminologiesInput) (req *request.Request, output *ListTerminologiesOutput) { 414 op := &request.Operation{ 415 Name: opListTerminologies, 416 HTTPMethod: "POST", 417 HTTPPath: "/", 418 Paginator: &request.Paginator{ 419 InputTokens: []string{"NextToken"}, 420 OutputTokens: []string{"NextToken"}, 421 LimitToken: "MaxResults", 422 TruncationToken: "", 423 }, 424 } 425 426 if input == nil { 427 input = &ListTerminologiesInput{} 428 } 429 430 output = &ListTerminologiesOutput{} 431 req = c.newRequest(op, input, output) 432 return 433} 434 435// ListTerminologies API operation for Amazon Translate. 436// 437// Provides a list of custom terminologies associated with your account. 438// 439// Returns awserr.Error for service API and SDK errors. Use runtime type assertions 440// with awserr.Error's Code and Message methods to get detailed information about 441// the error. 442// 443// See the AWS API reference guide for Amazon Translate's 444// API operation ListTerminologies for usage and error information. 445// 446// Returned Error Types: 447// * InvalidParameterValueException 448// The value of the parameter is invalid. Review the value of the parameter 449// you are using to correct it, and then retry your operation. 450// 451// * TooManyRequestsException 452// You have made too many requests within a short period of time. Wait for a 453// short time and then try your request again. 454// 455// * InternalServerException 456// An internal server error occurred. Retry your request. 457// 458// See also, https://docs.aws.amazon.com/goto/WebAPI/translate-2017-07-01/ListTerminologies 459func (c *Translate) ListTerminologies(input *ListTerminologiesInput) (*ListTerminologiesOutput, error) { 460 req, out := c.ListTerminologiesRequest(input) 461 return out, req.Send() 462} 463 464// ListTerminologiesWithContext is the same as ListTerminologies with the addition of 465// the ability to pass a context and additional request options. 466// 467// See ListTerminologies for details on how to use this API operation. 468// 469// The context must be non-nil and will be used for request cancellation. If 470// the context is nil a panic will occur. In the future the SDK may create 471// sub-contexts for http.Requests. See https://golang.org/pkg/context/ 472// for more information on using Contexts. 473func (c *Translate) ListTerminologiesWithContext(ctx aws.Context, input *ListTerminologiesInput, opts ...request.Option) (*ListTerminologiesOutput, error) { 474 req, out := c.ListTerminologiesRequest(input) 475 req.SetContext(ctx) 476 req.ApplyOptions(opts...) 477 return out, req.Send() 478} 479 480// ListTerminologiesPages iterates over the pages of a ListTerminologies operation, 481// calling the "fn" function with the response data for each page. To stop 482// iterating, return false from the fn function. 483// 484// See ListTerminologies method for more information on how to use this operation. 485// 486// Note: This operation can generate multiple requests to a service. 487// 488// // Example iterating over at most 3 pages of a ListTerminologies operation. 489// pageNum := 0 490// err := client.ListTerminologiesPages(params, 491// func(page *translate.ListTerminologiesOutput, lastPage bool) bool { 492// pageNum++ 493// fmt.Println(page) 494// return pageNum <= 3 495// }) 496// 497func (c *Translate) ListTerminologiesPages(input *ListTerminologiesInput, fn func(*ListTerminologiesOutput, bool) bool) error { 498 return c.ListTerminologiesPagesWithContext(aws.BackgroundContext(), input, fn) 499} 500 501// ListTerminologiesPagesWithContext same as ListTerminologiesPages except 502// it takes a Context and allows setting request options on the pages. 503// 504// The context must be non-nil and will be used for request cancellation. If 505// the context is nil a panic will occur. In the future the SDK may create 506// sub-contexts for http.Requests. See https://golang.org/pkg/context/ 507// for more information on using Contexts. 508func (c *Translate) ListTerminologiesPagesWithContext(ctx aws.Context, input *ListTerminologiesInput, fn func(*ListTerminologiesOutput, bool) bool, opts ...request.Option) error { 509 p := request.Pagination{ 510 NewRequest: func() (*request.Request, error) { 511 var inCpy *ListTerminologiesInput 512 if input != nil { 513 tmp := *input 514 inCpy = &tmp 515 } 516 req, _ := c.ListTerminologiesRequest(inCpy) 517 req.SetContext(ctx) 518 req.ApplyOptions(opts...) 519 return req, nil 520 }, 521 } 522 523 for p.Next() { 524 if !fn(p.Page().(*ListTerminologiesOutput), !p.HasNextPage()) { 525 break 526 } 527 } 528 529 return p.Err() 530} 531 532const opListTextTranslationJobs = "ListTextTranslationJobs" 533 534// ListTextTranslationJobsRequest generates a "aws/request.Request" representing the 535// client's request for the ListTextTranslationJobs operation. The "output" return 536// value will be populated with the request's response once the request completes 537// successfully. 538// 539// Use "Send" method on the returned Request to send the API call to the service. 540// the "output" return value is not valid until after Send returns without error. 541// 542// See ListTextTranslationJobs for more information on using the ListTextTranslationJobs 543// API call, and error handling. 544// 545// This method is useful when you want to inject custom logic or configuration 546// into the SDK's request lifecycle. Such as custom headers, or retry logic. 547// 548// 549// // Example sending a request using the ListTextTranslationJobsRequest method. 550// req, resp := client.ListTextTranslationJobsRequest(params) 551// 552// err := req.Send() 553// if err == nil { // resp is now filled 554// fmt.Println(resp) 555// } 556// 557// See also, https://docs.aws.amazon.com/goto/WebAPI/translate-2017-07-01/ListTextTranslationJobs 558func (c *Translate) ListTextTranslationJobsRequest(input *ListTextTranslationJobsInput) (req *request.Request, output *ListTextTranslationJobsOutput) { 559 op := &request.Operation{ 560 Name: opListTextTranslationJobs, 561 HTTPMethod: "POST", 562 HTTPPath: "/", 563 Paginator: &request.Paginator{ 564 InputTokens: []string{"NextToken"}, 565 OutputTokens: []string{"NextToken"}, 566 LimitToken: "MaxResults", 567 TruncationToken: "", 568 }, 569 } 570 571 if input == nil { 572 input = &ListTextTranslationJobsInput{} 573 } 574 575 output = &ListTextTranslationJobsOutput{} 576 req = c.newRequest(op, input, output) 577 return 578} 579 580// ListTextTranslationJobs API operation for Amazon Translate. 581// 582// Gets a list of the batch translation jobs that you have submitted. 583// 584// Returns awserr.Error for service API and SDK errors. Use runtime type assertions 585// with awserr.Error's Code and Message methods to get detailed information about 586// the error. 587// 588// See the AWS API reference guide for Amazon Translate's 589// API operation ListTextTranslationJobs for usage and error information. 590// 591// Returned Error Types: 592// * InvalidRequestException 593// The request that you made is invalid. Check your request to determine why 594// it's invalid and then retry the request. 595// 596// * TooManyRequestsException 597// You have made too many requests within a short period of time. Wait for a 598// short time and then try your request again. 599// 600// * InvalidFilterException 601// The filter specified for the operation is invalid. Specify a different filter. 602// 603// * InternalServerException 604// An internal server error occurred. Retry your request. 605// 606// See also, https://docs.aws.amazon.com/goto/WebAPI/translate-2017-07-01/ListTextTranslationJobs 607func (c *Translate) ListTextTranslationJobs(input *ListTextTranslationJobsInput) (*ListTextTranslationJobsOutput, error) { 608 req, out := c.ListTextTranslationJobsRequest(input) 609 return out, req.Send() 610} 611 612// ListTextTranslationJobsWithContext is the same as ListTextTranslationJobs with the addition of 613// the ability to pass a context and additional request options. 614// 615// See ListTextTranslationJobs for details on how to use this API operation. 616// 617// The context must be non-nil and will be used for request cancellation. If 618// the context is nil a panic will occur. In the future the SDK may create 619// sub-contexts for http.Requests. See https://golang.org/pkg/context/ 620// for more information on using Contexts. 621func (c *Translate) ListTextTranslationJobsWithContext(ctx aws.Context, input *ListTextTranslationJobsInput, opts ...request.Option) (*ListTextTranslationJobsOutput, error) { 622 req, out := c.ListTextTranslationJobsRequest(input) 623 req.SetContext(ctx) 624 req.ApplyOptions(opts...) 625 return out, req.Send() 626} 627 628// ListTextTranslationJobsPages iterates over the pages of a ListTextTranslationJobs operation, 629// calling the "fn" function with the response data for each page. To stop 630// iterating, return false from the fn function. 631// 632// See ListTextTranslationJobs method for more information on how to use this operation. 633// 634// Note: This operation can generate multiple requests to a service. 635// 636// // Example iterating over at most 3 pages of a ListTextTranslationJobs operation. 637// pageNum := 0 638// err := client.ListTextTranslationJobsPages(params, 639// func(page *translate.ListTextTranslationJobsOutput, lastPage bool) bool { 640// pageNum++ 641// fmt.Println(page) 642// return pageNum <= 3 643// }) 644// 645func (c *Translate) ListTextTranslationJobsPages(input *ListTextTranslationJobsInput, fn func(*ListTextTranslationJobsOutput, bool) bool) error { 646 return c.ListTextTranslationJobsPagesWithContext(aws.BackgroundContext(), input, fn) 647} 648 649// ListTextTranslationJobsPagesWithContext same as ListTextTranslationJobsPages except 650// it takes a Context and allows setting request options on the pages. 651// 652// The context must be non-nil and will be used for request cancellation. If 653// the context is nil a panic will occur. In the future the SDK may create 654// sub-contexts for http.Requests. See https://golang.org/pkg/context/ 655// for more information on using Contexts. 656func (c *Translate) ListTextTranslationJobsPagesWithContext(ctx aws.Context, input *ListTextTranslationJobsInput, fn func(*ListTextTranslationJobsOutput, bool) bool, opts ...request.Option) error { 657 p := request.Pagination{ 658 NewRequest: func() (*request.Request, error) { 659 var inCpy *ListTextTranslationJobsInput 660 if input != nil { 661 tmp := *input 662 inCpy = &tmp 663 } 664 req, _ := c.ListTextTranslationJobsRequest(inCpy) 665 req.SetContext(ctx) 666 req.ApplyOptions(opts...) 667 return req, nil 668 }, 669 } 670 671 for p.Next() { 672 if !fn(p.Page().(*ListTextTranslationJobsOutput), !p.HasNextPage()) { 673 break 674 } 675 } 676 677 return p.Err() 678} 679 680const opStartTextTranslationJob = "StartTextTranslationJob" 681 682// StartTextTranslationJobRequest generates a "aws/request.Request" representing the 683// client's request for the StartTextTranslationJob operation. The "output" return 684// value will be populated with the request's response once the request completes 685// successfully. 686// 687// Use "Send" method on the returned Request to send the API call to the service. 688// the "output" return value is not valid until after Send returns without error. 689// 690// See StartTextTranslationJob for more information on using the StartTextTranslationJob 691// API call, and error handling. 692// 693// This method is useful when you want to inject custom logic or configuration 694// into the SDK's request lifecycle. Such as custom headers, or retry logic. 695// 696// 697// // Example sending a request using the StartTextTranslationJobRequest method. 698// req, resp := client.StartTextTranslationJobRequest(params) 699// 700// err := req.Send() 701// if err == nil { // resp is now filled 702// fmt.Println(resp) 703// } 704// 705// See also, https://docs.aws.amazon.com/goto/WebAPI/translate-2017-07-01/StartTextTranslationJob 706func (c *Translate) StartTextTranslationJobRequest(input *StartTextTranslationJobInput) (req *request.Request, output *StartTextTranslationJobOutput) { 707 op := &request.Operation{ 708 Name: opStartTextTranslationJob, 709 HTTPMethod: "POST", 710 HTTPPath: "/", 711 } 712 713 if input == nil { 714 input = &StartTextTranslationJobInput{} 715 } 716 717 output = &StartTextTranslationJobOutput{} 718 req = c.newRequest(op, input, output) 719 return 720} 721 722// StartTextTranslationJob API operation for Amazon Translate. 723// 724// Starts an asynchronous batch translation job. Batch translation jobs can 725// be used to translate large volumes of text across multiple documents at once. 726// For more information, see async. 727// 728// Batch translation jobs can be described with the DescribeTextTranslationJob 729// operation, listed with the ListTextTranslationJobs operation, and stopped 730// with the StopTextTranslationJob operation. 731// 732// Amazon Translate does not support batch translation of multiple source languages 733// at once. 734// 735// Returns awserr.Error for service API and SDK errors. Use runtime type assertions 736// with awserr.Error's Code and Message methods to get detailed information about 737// the error. 738// 739// See the AWS API reference guide for Amazon Translate's 740// API operation StartTextTranslationJob for usage and error information. 741// 742// Returned Error Types: 743// * TooManyRequestsException 744// You have made too many requests within a short period of time. Wait for a 745// short time and then try your request again. 746// 747// * UnsupportedLanguagePairException 748// Amazon Translate does not support translation from the language of the source 749// text into the requested target language. For more information, see how-to-error-msg. 750// 751// * InvalidRequestException 752// The request that you made is invalid. Check your request to determine why 753// it's invalid and then retry the request. 754// 755// * ResourceNotFoundException 756// The resource you are looking for has not been found. Review the resource 757// you're looking for and see if a different resource will accomplish your needs 758// before retrying the revised request. 759// 760// * InternalServerException 761// An internal server error occurred. Retry your request. 762// 763// See also, https://docs.aws.amazon.com/goto/WebAPI/translate-2017-07-01/StartTextTranslationJob 764func (c *Translate) StartTextTranslationJob(input *StartTextTranslationJobInput) (*StartTextTranslationJobOutput, error) { 765 req, out := c.StartTextTranslationJobRequest(input) 766 return out, req.Send() 767} 768 769// StartTextTranslationJobWithContext is the same as StartTextTranslationJob with the addition of 770// the ability to pass a context and additional request options. 771// 772// See StartTextTranslationJob for details on how to use this API operation. 773// 774// The context must be non-nil and will be used for request cancellation. If 775// the context is nil a panic will occur. In the future the SDK may create 776// sub-contexts for http.Requests. See https://golang.org/pkg/context/ 777// for more information on using Contexts. 778func (c *Translate) StartTextTranslationJobWithContext(ctx aws.Context, input *StartTextTranslationJobInput, opts ...request.Option) (*StartTextTranslationJobOutput, error) { 779 req, out := c.StartTextTranslationJobRequest(input) 780 req.SetContext(ctx) 781 req.ApplyOptions(opts...) 782 return out, req.Send() 783} 784 785const opStopTextTranslationJob = "StopTextTranslationJob" 786 787// StopTextTranslationJobRequest generates a "aws/request.Request" representing the 788// client's request for the StopTextTranslationJob operation. The "output" return 789// value will be populated with the request's response once the request completes 790// successfully. 791// 792// Use "Send" method on the returned Request to send the API call to the service. 793// the "output" return value is not valid until after Send returns without error. 794// 795// See StopTextTranslationJob for more information on using the StopTextTranslationJob 796// API call, and error handling. 797// 798// This method is useful when you want to inject custom logic or configuration 799// into the SDK's request lifecycle. Such as custom headers, or retry logic. 800// 801// 802// // Example sending a request using the StopTextTranslationJobRequest method. 803// req, resp := client.StopTextTranslationJobRequest(params) 804// 805// err := req.Send() 806// if err == nil { // resp is now filled 807// fmt.Println(resp) 808// } 809// 810// See also, https://docs.aws.amazon.com/goto/WebAPI/translate-2017-07-01/StopTextTranslationJob 811func (c *Translate) StopTextTranslationJobRequest(input *StopTextTranslationJobInput) (req *request.Request, output *StopTextTranslationJobOutput) { 812 op := &request.Operation{ 813 Name: opStopTextTranslationJob, 814 HTTPMethod: "POST", 815 HTTPPath: "/", 816 } 817 818 if input == nil { 819 input = &StopTextTranslationJobInput{} 820 } 821 822 output = &StopTextTranslationJobOutput{} 823 req = c.newRequest(op, input, output) 824 return 825} 826 827// StopTextTranslationJob API operation for Amazon Translate. 828// 829// Stops an asynchronous batch translation job that is in progress. 830// 831// If the job's state is IN_PROGRESS, the job will be marked for termination 832// and put into the STOP_REQUESTED state. If the job completes before it can 833// be stopped, it is put into the COMPLETED state. Otherwise, the job is put 834// into the STOPPED state. 835// 836// Asynchronous batch translation jobs are started with the StartTextTranslationJob 837// operation. You can use the DescribeTextTranslationJob or ListTextTranslationJobs 838// operations to get a batch translation job's JobId. 839// 840// Returns awserr.Error for service API and SDK errors. Use runtime type assertions 841// with awserr.Error's Code and Message methods to get detailed information about 842// the error. 843// 844// See the AWS API reference guide for Amazon Translate's 845// API operation StopTextTranslationJob for usage and error information. 846// 847// Returned Error Types: 848// * ResourceNotFoundException 849// The resource you are looking for has not been found. Review the resource 850// you're looking for and see if a different resource will accomplish your needs 851// before retrying the revised request. 852// 853// * TooManyRequestsException 854// You have made too many requests within a short period of time. Wait for a 855// short time and then try your request again. 856// 857// * InternalServerException 858// An internal server error occurred. Retry your request. 859// 860// See also, https://docs.aws.amazon.com/goto/WebAPI/translate-2017-07-01/StopTextTranslationJob 861func (c *Translate) StopTextTranslationJob(input *StopTextTranslationJobInput) (*StopTextTranslationJobOutput, error) { 862 req, out := c.StopTextTranslationJobRequest(input) 863 return out, req.Send() 864} 865 866// StopTextTranslationJobWithContext is the same as StopTextTranslationJob with the addition of 867// the ability to pass a context and additional request options. 868// 869// See StopTextTranslationJob for details on how to use this API operation. 870// 871// The context must be non-nil and will be used for request cancellation. If 872// the context is nil a panic will occur. In the future the SDK may create 873// sub-contexts for http.Requests. See https://golang.org/pkg/context/ 874// for more information on using Contexts. 875func (c *Translate) StopTextTranslationJobWithContext(ctx aws.Context, input *StopTextTranslationJobInput, opts ...request.Option) (*StopTextTranslationJobOutput, error) { 876 req, out := c.StopTextTranslationJobRequest(input) 877 req.SetContext(ctx) 878 req.ApplyOptions(opts...) 879 return out, req.Send() 880} 881 882const opText = "TranslateText" 883 884// TextRequest generates a "aws/request.Request" representing the 885// client's request for the Text operation. The "output" return 886// value will be populated with the request's response once the request completes 887// successfully. 888// 889// Use "Send" method on the returned Request to send the API call to the service. 890// the "output" return value is not valid until after Send returns without error. 891// 892// See Text for more information on using the Text 893// API call, and error handling. 894// 895// This method is useful when you want to inject custom logic or configuration 896// into the SDK's request lifecycle. Such as custom headers, or retry logic. 897// 898// 899// // Example sending a request using the TextRequest method. 900// req, resp := client.TextRequest(params) 901// 902// err := req.Send() 903// if err == nil { // resp is now filled 904// fmt.Println(resp) 905// } 906// 907// See also, https://docs.aws.amazon.com/goto/WebAPI/translate-2017-07-01/Text 908func (c *Translate) TextRequest(input *TextInput) (req *request.Request, output *TextOutput) { 909 op := &request.Operation{ 910 Name: opText, 911 HTTPMethod: "POST", 912 HTTPPath: "/", 913 } 914 915 if input == nil { 916 input = &TextInput{} 917 } 918 919 output = &TextOutput{} 920 req = c.newRequest(op, input, output) 921 return 922} 923 924// Text API operation for Amazon Translate. 925// 926// Translates input text from the source language to the target language. For 927// a list of available languages and language codes, see what-is-languages. 928// 929// Returns awserr.Error for service API and SDK errors. Use runtime type assertions 930// with awserr.Error's Code and Message methods to get detailed information about 931// the error. 932// 933// See the AWS API reference guide for Amazon Translate's 934// API operation Text for usage and error information. 935// 936// Returned Error Types: 937// * InvalidRequestException 938// The request that you made is invalid. Check your request to determine why 939// it's invalid and then retry the request. 940// 941// * TextSizeLimitExceededException 942// The size of the text you submitted exceeds the size limit. Reduce the size 943// of the text or use a smaller document and then retry your request. 944// 945// * TooManyRequestsException 946// You have made too many requests within a short period of time. Wait for a 947// short time and then try your request again. 948// 949// * UnsupportedLanguagePairException 950// Amazon Translate does not support translation from the language of the source 951// text into the requested target language. For more information, see how-to-error-msg. 952// 953// * DetectedLanguageLowConfidenceException 954// The confidence that Amazon Comprehend accurately detected the source language 955// is low. If a low confidence level is acceptable for your application, you 956// can use the language in the exception to call Amazon Translate again. For 957// more information, see the DetectDominantLanguage (https://docs.aws.amazon.com/comprehend/latest/dg/API_DetectDominantLanguage.html) 958// operation in the Amazon Comprehend Developer Guide. 959// 960// * ResourceNotFoundException 961// The resource you are looking for has not been found. Review the resource 962// you're looking for and see if a different resource will accomplish your needs 963// before retrying the revised request. 964// 965// * InternalServerException 966// An internal server error occurred. Retry your request. 967// 968// * ServiceUnavailableException 969// The Amazon Translate service is temporarily unavailable. Please wait a bit 970// and then retry your request. 971// 972// See also, https://docs.aws.amazon.com/goto/WebAPI/translate-2017-07-01/Text 973func (c *Translate) Text(input *TextInput) (*TextOutput, error) { 974 req, out := c.TextRequest(input) 975 return out, req.Send() 976} 977 978// TextWithContext is the same as Text with the addition of 979// the ability to pass a context and additional request options. 980// 981// See Text for details on how to use this API operation. 982// 983// The context must be non-nil and will be used for request cancellation. If 984// the context is nil a panic will occur. In the future the SDK may create 985// sub-contexts for http.Requests. See https://golang.org/pkg/context/ 986// for more information on using Contexts. 987func (c *Translate) TextWithContext(ctx aws.Context, input *TextInput, opts ...request.Option) (*TextOutput, error) { 988 req, out := c.TextRequest(input) 989 req.SetContext(ctx) 990 req.ApplyOptions(opts...) 991 return out, req.Send() 992} 993 994// The custom terminology applied to the input text by Amazon Translate for 995// the translated text response. This is optional in the response and will only 996// be present if you specified terminology input in the request. Currently, 997// only one terminology can be applied per TranslateText request. 998type AppliedTerminology struct { 999 _ struct{} `type:"structure"` 1000 1001 // The name of the custom terminology applied to the input text by Amazon Translate 1002 // for the translated text response. 1003 Name *string `min:"1" type:"string"` 1004 1005 // The specific terms of the custom terminology applied to the input text by 1006 // Amazon Translate for the translated text response. A maximum of 250 terms 1007 // will be returned, and the specific terms applied will be the first 250 terms 1008 // in the source text. 1009 Terms []*Term `type:"list"` 1010} 1011 1012// String returns the string representation 1013func (s AppliedTerminology) String() string { 1014 return awsutil.Prettify(s) 1015} 1016 1017// GoString returns the string representation 1018func (s AppliedTerminology) GoString() string { 1019 return s.String() 1020} 1021 1022// SetName sets the Name field's value. 1023func (s *AppliedTerminology) SetName(v string) *AppliedTerminology { 1024 s.Name = &v 1025 return s 1026} 1027 1028// SetTerms sets the Terms field's value. 1029func (s *AppliedTerminology) SetTerms(v []*Term) *AppliedTerminology { 1030 s.Terms = v 1031 return s 1032} 1033 1034type DeleteTerminologyInput struct { 1035 _ struct{} `type:"structure"` 1036 1037 // The name of the custom terminology being deleted. 1038 // 1039 // Name is a required field 1040 Name *string `min:"1" type:"string" required:"true"` 1041} 1042 1043// String returns the string representation 1044func (s DeleteTerminologyInput) String() string { 1045 return awsutil.Prettify(s) 1046} 1047 1048// GoString returns the string representation 1049func (s DeleteTerminologyInput) GoString() string { 1050 return s.String() 1051} 1052 1053// Validate inspects the fields of the type to determine if they are valid. 1054func (s *DeleteTerminologyInput) Validate() error { 1055 invalidParams := request.ErrInvalidParams{Context: "DeleteTerminologyInput"} 1056 if s.Name == nil { 1057 invalidParams.Add(request.NewErrParamRequired("Name")) 1058 } 1059 if s.Name != nil && len(*s.Name) < 1 { 1060 invalidParams.Add(request.NewErrParamMinLen("Name", 1)) 1061 } 1062 1063 if invalidParams.Len() > 0 { 1064 return invalidParams 1065 } 1066 return nil 1067} 1068 1069// SetName sets the Name field's value. 1070func (s *DeleteTerminologyInput) SetName(v string) *DeleteTerminologyInput { 1071 s.Name = &v 1072 return s 1073} 1074 1075type DeleteTerminologyOutput struct { 1076 _ struct{} `type:"structure"` 1077} 1078 1079// String returns the string representation 1080func (s DeleteTerminologyOutput) String() string { 1081 return awsutil.Prettify(s) 1082} 1083 1084// GoString returns the string representation 1085func (s DeleteTerminologyOutput) GoString() string { 1086 return s.String() 1087} 1088 1089type DescribeTextTranslationJobInput struct { 1090 _ struct{} `type:"structure"` 1091 1092 // The identifier that Amazon Translate generated for the job. The StartTextTranslationJob 1093 // operation returns this identifier in its response. 1094 // 1095 // JobId is a required field 1096 JobId *string `min:"1" type:"string" required:"true"` 1097} 1098 1099// String returns the string representation 1100func (s DescribeTextTranslationJobInput) String() string { 1101 return awsutil.Prettify(s) 1102} 1103 1104// GoString returns the string representation 1105func (s DescribeTextTranslationJobInput) GoString() string { 1106 return s.String() 1107} 1108 1109// Validate inspects the fields of the type to determine if they are valid. 1110func (s *DescribeTextTranslationJobInput) Validate() error { 1111 invalidParams := request.ErrInvalidParams{Context: "DescribeTextTranslationJobInput"} 1112 if s.JobId == nil { 1113 invalidParams.Add(request.NewErrParamRequired("JobId")) 1114 } 1115 if s.JobId != nil && len(*s.JobId) < 1 { 1116 invalidParams.Add(request.NewErrParamMinLen("JobId", 1)) 1117 } 1118 1119 if invalidParams.Len() > 0 { 1120 return invalidParams 1121 } 1122 return nil 1123} 1124 1125// SetJobId sets the JobId field's value. 1126func (s *DescribeTextTranslationJobInput) SetJobId(v string) *DescribeTextTranslationJobInput { 1127 s.JobId = &v 1128 return s 1129} 1130 1131type DescribeTextTranslationJobOutput struct { 1132 _ struct{} `type:"structure"` 1133 1134 // An object that contains the properties associated with an asynchronous batch 1135 // translation job. 1136 TextTranslationJobProperties *TextTranslationJobProperties `type:"structure"` 1137} 1138 1139// String returns the string representation 1140func (s DescribeTextTranslationJobOutput) String() string { 1141 return awsutil.Prettify(s) 1142} 1143 1144// GoString returns the string representation 1145func (s DescribeTextTranslationJobOutput) GoString() string { 1146 return s.String() 1147} 1148 1149// SetTextTranslationJobProperties sets the TextTranslationJobProperties field's value. 1150func (s *DescribeTextTranslationJobOutput) SetTextTranslationJobProperties(v *TextTranslationJobProperties) *DescribeTextTranslationJobOutput { 1151 s.TextTranslationJobProperties = v 1152 return s 1153} 1154 1155// The confidence that Amazon Comprehend accurately detected the source language 1156// is low. If a low confidence level is acceptable for your application, you 1157// can use the language in the exception to call Amazon Translate again. For 1158// more information, see the DetectDominantLanguage (https://docs.aws.amazon.com/comprehend/latest/dg/API_DetectDominantLanguage.html) 1159// operation in the Amazon Comprehend Developer Guide. 1160type DetectedLanguageLowConfidenceException struct { 1161 _ struct{} `type:"structure"` 1162 RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` 1163 1164 // The language code of the auto-detected language from Amazon Comprehend. 1165 DetectedLanguageCode *string `min:"2" type:"string"` 1166 1167 Message_ *string `locationName:"Message" type:"string"` 1168} 1169 1170// String returns the string representation 1171func (s DetectedLanguageLowConfidenceException) String() string { 1172 return awsutil.Prettify(s) 1173} 1174 1175// GoString returns the string representation 1176func (s DetectedLanguageLowConfidenceException) GoString() string { 1177 return s.String() 1178} 1179 1180func newErrorDetectedLanguageLowConfidenceException(v protocol.ResponseMetadata) error { 1181 return &DetectedLanguageLowConfidenceException{ 1182 RespMetadata: v, 1183 } 1184} 1185 1186// Code returns the exception type name. 1187func (s *DetectedLanguageLowConfidenceException) Code() string { 1188 return "DetectedLanguageLowConfidenceException" 1189} 1190 1191// Message returns the exception's message. 1192func (s *DetectedLanguageLowConfidenceException) Message() string { 1193 if s.Message_ != nil { 1194 return *s.Message_ 1195 } 1196 return "" 1197} 1198 1199// OrigErr always returns nil, satisfies awserr.Error interface. 1200func (s *DetectedLanguageLowConfidenceException) OrigErr() error { 1201 return nil 1202} 1203 1204func (s *DetectedLanguageLowConfidenceException) Error() string { 1205 return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) 1206} 1207 1208// Status code returns the HTTP status code for the request's response error. 1209func (s *DetectedLanguageLowConfidenceException) StatusCode() int { 1210 return s.RespMetadata.StatusCode 1211} 1212 1213// RequestID returns the service's response RequestID for request. 1214func (s *DetectedLanguageLowConfidenceException) RequestID() string { 1215 return s.RespMetadata.RequestID 1216} 1217 1218// The encryption key used to encrypt the custom terminologies used by Amazon 1219// Translate. 1220type EncryptionKey struct { 1221 _ struct{} `type:"structure"` 1222 1223 // The Amazon Resource Name (ARN) of the encryption key being used to encrypt 1224 // the custom terminology. 1225 // 1226 // Id is a required field 1227 Id *string `min:"1" type:"string" required:"true"` 1228 1229 // The type of encryption key used by Amazon Translate to encrypt custom terminologies. 1230 // 1231 // Type is a required field 1232 Type *string `type:"string" required:"true" enum:"EncryptionKeyType"` 1233} 1234 1235// String returns the string representation 1236func (s EncryptionKey) String() string { 1237 return awsutil.Prettify(s) 1238} 1239 1240// GoString returns the string representation 1241func (s EncryptionKey) GoString() string { 1242 return s.String() 1243} 1244 1245// Validate inspects the fields of the type to determine if they are valid. 1246func (s *EncryptionKey) Validate() error { 1247 invalidParams := request.ErrInvalidParams{Context: "EncryptionKey"} 1248 if s.Id == nil { 1249 invalidParams.Add(request.NewErrParamRequired("Id")) 1250 } 1251 if s.Id != nil && len(*s.Id) < 1 { 1252 invalidParams.Add(request.NewErrParamMinLen("Id", 1)) 1253 } 1254 if s.Type == nil { 1255 invalidParams.Add(request.NewErrParamRequired("Type")) 1256 } 1257 1258 if invalidParams.Len() > 0 { 1259 return invalidParams 1260 } 1261 return nil 1262} 1263 1264// SetId sets the Id field's value. 1265func (s *EncryptionKey) SetId(v string) *EncryptionKey { 1266 s.Id = &v 1267 return s 1268} 1269 1270// SetType sets the Type field's value. 1271func (s *EncryptionKey) SetType(v string) *EncryptionKey { 1272 s.Type = &v 1273 return s 1274} 1275 1276type GetTerminologyInput struct { 1277 _ struct{} `type:"structure"` 1278 1279 // The name of the custom terminology being retrieved. 1280 // 1281 // Name is a required field 1282 Name *string `min:"1" type:"string" required:"true"` 1283 1284 // The data format of the custom terminology being retrieved, either CSV or 1285 // TMX. 1286 // 1287 // TerminologyDataFormat is a required field 1288 TerminologyDataFormat *string `type:"string" required:"true" enum:"TerminologyDataFormat"` 1289} 1290 1291// String returns the string representation 1292func (s GetTerminologyInput) String() string { 1293 return awsutil.Prettify(s) 1294} 1295 1296// GoString returns the string representation 1297func (s GetTerminologyInput) GoString() string { 1298 return s.String() 1299} 1300 1301// Validate inspects the fields of the type to determine if they are valid. 1302func (s *GetTerminologyInput) Validate() error { 1303 invalidParams := request.ErrInvalidParams{Context: "GetTerminologyInput"} 1304 if s.Name == nil { 1305 invalidParams.Add(request.NewErrParamRequired("Name")) 1306 } 1307 if s.Name != nil && len(*s.Name) < 1 { 1308 invalidParams.Add(request.NewErrParamMinLen("Name", 1)) 1309 } 1310 if s.TerminologyDataFormat == nil { 1311 invalidParams.Add(request.NewErrParamRequired("TerminologyDataFormat")) 1312 } 1313 1314 if invalidParams.Len() > 0 { 1315 return invalidParams 1316 } 1317 return nil 1318} 1319 1320// SetName sets the Name field's value. 1321func (s *GetTerminologyInput) SetName(v string) *GetTerminologyInput { 1322 s.Name = &v 1323 return s 1324} 1325 1326// SetTerminologyDataFormat sets the TerminologyDataFormat field's value. 1327func (s *GetTerminologyInput) SetTerminologyDataFormat(v string) *GetTerminologyInput { 1328 s.TerminologyDataFormat = &v 1329 return s 1330} 1331 1332type GetTerminologyOutput struct { 1333 _ struct{} `type:"structure"` 1334 1335 // The data location of the custom terminology being retrieved. The custom terminology 1336 // file is returned in a presigned url that has a 30 minute expiration. 1337 TerminologyDataLocation *TerminologyDataLocation `type:"structure"` 1338 1339 // The properties of the custom terminology being retrieved. 1340 TerminologyProperties *TerminologyProperties `type:"structure"` 1341} 1342 1343// String returns the string representation 1344func (s GetTerminologyOutput) String() string { 1345 return awsutil.Prettify(s) 1346} 1347 1348// GoString returns the string representation 1349func (s GetTerminologyOutput) GoString() string { 1350 return s.String() 1351} 1352 1353// SetTerminologyDataLocation sets the TerminologyDataLocation field's value. 1354func (s *GetTerminologyOutput) SetTerminologyDataLocation(v *TerminologyDataLocation) *GetTerminologyOutput { 1355 s.TerminologyDataLocation = v 1356 return s 1357} 1358 1359// SetTerminologyProperties sets the TerminologyProperties field's value. 1360func (s *GetTerminologyOutput) SetTerminologyProperties(v *TerminologyProperties) *GetTerminologyOutput { 1361 s.TerminologyProperties = v 1362 return s 1363} 1364 1365type ImportTerminologyInput struct { 1366 _ struct{} `type:"structure"` 1367 1368 // The description of the custom terminology being imported. 1369 Description *string `type:"string"` 1370 1371 // The encryption key for the custom terminology being imported. 1372 EncryptionKey *EncryptionKey `type:"structure"` 1373 1374 // The merge strategy of the custom terminology being imported. Currently, only 1375 // the OVERWRITE merge strategy is supported. In this case, the imported terminology 1376 // will overwrite an existing terminology of the same name. 1377 // 1378 // MergeStrategy is a required field 1379 MergeStrategy *string `type:"string" required:"true" enum:"MergeStrategy"` 1380 1381 // The name of the custom terminology being imported. 1382 // 1383 // Name is a required field 1384 Name *string `min:"1" type:"string" required:"true"` 1385 1386 // The terminology data for the custom terminology being imported. 1387 // 1388 // TerminologyData is a required field 1389 TerminologyData *TerminologyData `type:"structure" required:"true"` 1390} 1391 1392// String returns the string representation 1393func (s ImportTerminologyInput) String() string { 1394 return awsutil.Prettify(s) 1395} 1396 1397// GoString returns the string representation 1398func (s ImportTerminologyInput) GoString() string { 1399 return s.String() 1400} 1401 1402// Validate inspects the fields of the type to determine if they are valid. 1403func (s *ImportTerminologyInput) Validate() error { 1404 invalidParams := request.ErrInvalidParams{Context: "ImportTerminologyInput"} 1405 if s.MergeStrategy == nil { 1406 invalidParams.Add(request.NewErrParamRequired("MergeStrategy")) 1407 } 1408 if s.Name == nil { 1409 invalidParams.Add(request.NewErrParamRequired("Name")) 1410 } 1411 if s.Name != nil && len(*s.Name) < 1 { 1412 invalidParams.Add(request.NewErrParamMinLen("Name", 1)) 1413 } 1414 if s.TerminologyData == nil { 1415 invalidParams.Add(request.NewErrParamRequired("TerminologyData")) 1416 } 1417 if s.EncryptionKey != nil { 1418 if err := s.EncryptionKey.Validate(); err != nil { 1419 invalidParams.AddNested("EncryptionKey", err.(request.ErrInvalidParams)) 1420 } 1421 } 1422 if s.TerminologyData != nil { 1423 if err := s.TerminologyData.Validate(); err != nil { 1424 invalidParams.AddNested("TerminologyData", err.(request.ErrInvalidParams)) 1425 } 1426 } 1427 1428 if invalidParams.Len() > 0 { 1429 return invalidParams 1430 } 1431 return nil 1432} 1433 1434// SetDescription sets the Description field's value. 1435func (s *ImportTerminologyInput) SetDescription(v string) *ImportTerminologyInput { 1436 s.Description = &v 1437 return s 1438} 1439 1440// SetEncryptionKey sets the EncryptionKey field's value. 1441func (s *ImportTerminologyInput) SetEncryptionKey(v *EncryptionKey) *ImportTerminologyInput { 1442 s.EncryptionKey = v 1443 return s 1444} 1445 1446// SetMergeStrategy sets the MergeStrategy field's value. 1447func (s *ImportTerminologyInput) SetMergeStrategy(v string) *ImportTerminologyInput { 1448 s.MergeStrategy = &v 1449 return s 1450} 1451 1452// SetName sets the Name field's value. 1453func (s *ImportTerminologyInput) SetName(v string) *ImportTerminologyInput { 1454 s.Name = &v 1455 return s 1456} 1457 1458// SetTerminologyData sets the TerminologyData field's value. 1459func (s *ImportTerminologyInput) SetTerminologyData(v *TerminologyData) *ImportTerminologyInput { 1460 s.TerminologyData = v 1461 return s 1462} 1463 1464type ImportTerminologyOutput struct { 1465 _ struct{} `type:"structure"` 1466 1467 // The properties of the custom terminology being imported. 1468 TerminologyProperties *TerminologyProperties `type:"structure"` 1469} 1470 1471// String returns the string representation 1472func (s ImportTerminologyOutput) String() string { 1473 return awsutil.Prettify(s) 1474} 1475 1476// GoString returns the string representation 1477func (s ImportTerminologyOutput) GoString() string { 1478 return s.String() 1479} 1480 1481// SetTerminologyProperties sets the TerminologyProperties field's value. 1482func (s *ImportTerminologyOutput) SetTerminologyProperties(v *TerminologyProperties) *ImportTerminologyOutput { 1483 s.TerminologyProperties = v 1484 return s 1485} 1486 1487// The input configuration properties for requesting a batch translation job. 1488type InputDataConfig struct { 1489 _ struct{} `type:"structure"` 1490 1491 // The multipurpose internet mail extension (MIME) type of the input files. 1492 // Valid values are text/plain for plaintext files and text/html for HTML files. 1493 // 1494 // ContentType is a required field 1495 ContentType *string `type:"string" required:"true"` 1496 1497 // The URI of the AWS S3 folder that contains the input file. The folder must 1498 // be in the same Region as the API endpoint you are calling. 1499 // 1500 // S3Uri is a required field 1501 S3Uri *string `type:"string" required:"true"` 1502} 1503 1504// String returns the string representation 1505func (s InputDataConfig) String() string { 1506 return awsutil.Prettify(s) 1507} 1508 1509// GoString returns the string representation 1510func (s InputDataConfig) GoString() string { 1511 return s.String() 1512} 1513 1514// Validate inspects the fields of the type to determine if they are valid. 1515func (s *InputDataConfig) Validate() error { 1516 invalidParams := request.ErrInvalidParams{Context: "InputDataConfig"} 1517 if s.ContentType == nil { 1518 invalidParams.Add(request.NewErrParamRequired("ContentType")) 1519 } 1520 if s.S3Uri == nil { 1521 invalidParams.Add(request.NewErrParamRequired("S3Uri")) 1522 } 1523 1524 if invalidParams.Len() > 0 { 1525 return invalidParams 1526 } 1527 return nil 1528} 1529 1530// SetContentType sets the ContentType field's value. 1531func (s *InputDataConfig) SetContentType(v string) *InputDataConfig { 1532 s.ContentType = &v 1533 return s 1534} 1535 1536// SetS3Uri sets the S3Uri field's value. 1537func (s *InputDataConfig) SetS3Uri(v string) *InputDataConfig { 1538 s.S3Uri = &v 1539 return s 1540} 1541 1542// An internal server error occurred. Retry your request. 1543type InternalServerException struct { 1544 _ struct{} `type:"structure"` 1545 RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` 1546 1547 Message_ *string `locationName:"Message" type:"string"` 1548} 1549 1550// String returns the string representation 1551func (s InternalServerException) String() string { 1552 return awsutil.Prettify(s) 1553} 1554 1555// GoString returns the string representation 1556func (s InternalServerException) GoString() string { 1557 return s.String() 1558} 1559 1560func newErrorInternalServerException(v protocol.ResponseMetadata) error { 1561 return &InternalServerException{ 1562 RespMetadata: v, 1563 } 1564} 1565 1566// Code returns the exception type name. 1567func (s *InternalServerException) Code() string { 1568 return "InternalServerException" 1569} 1570 1571// Message returns the exception's message. 1572func (s *InternalServerException) Message() string { 1573 if s.Message_ != nil { 1574 return *s.Message_ 1575 } 1576 return "" 1577} 1578 1579// OrigErr always returns nil, satisfies awserr.Error interface. 1580func (s *InternalServerException) OrigErr() error { 1581 return nil 1582} 1583 1584func (s *InternalServerException) Error() string { 1585 return fmt.Sprintf("%s: %s", s.Code(), s.Message()) 1586} 1587 1588// Status code returns the HTTP status code for the request's response error. 1589func (s *InternalServerException) StatusCode() int { 1590 return s.RespMetadata.StatusCode 1591} 1592 1593// RequestID returns the service's response RequestID for request. 1594func (s *InternalServerException) RequestID() string { 1595 return s.RespMetadata.RequestID 1596} 1597 1598// The filter specified for the operation is invalid. Specify a different filter. 1599type InvalidFilterException struct { 1600 _ struct{} `type:"structure"` 1601 RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` 1602 1603 Message_ *string `locationName:"Message" type:"string"` 1604} 1605 1606// String returns the string representation 1607func (s InvalidFilterException) String() string { 1608 return awsutil.Prettify(s) 1609} 1610 1611// GoString returns the string representation 1612func (s InvalidFilterException) GoString() string { 1613 return s.String() 1614} 1615 1616func newErrorInvalidFilterException(v protocol.ResponseMetadata) error { 1617 return &InvalidFilterException{ 1618 RespMetadata: v, 1619 } 1620} 1621 1622// Code returns the exception type name. 1623func (s *InvalidFilterException) Code() string { 1624 return "InvalidFilterException" 1625} 1626 1627// Message returns the exception's message. 1628func (s *InvalidFilterException) Message() string { 1629 if s.Message_ != nil { 1630 return *s.Message_ 1631 } 1632 return "" 1633} 1634 1635// OrigErr always returns nil, satisfies awserr.Error interface. 1636func (s *InvalidFilterException) OrigErr() error { 1637 return nil 1638} 1639 1640func (s *InvalidFilterException) Error() string { 1641 return fmt.Sprintf("%s: %s", s.Code(), s.Message()) 1642} 1643 1644// Status code returns the HTTP status code for the request's response error. 1645func (s *InvalidFilterException) StatusCode() int { 1646 return s.RespMetadata.StatusCode 1647} 1648 1649// RequestID returns the service's response RequestID for request. 1650func (s *InvalidFilterException) RequestID() string { 1651 return s.RespMetadata.RequestID 1652} 1653 1654// The value of the parameter is invalid. Review the value of the parameter 1655// you are using to correct it, and then retry your operation. 1656type InvalidParameterValueException struct { 1657 _ struct{} `type:"structure"` 1658 RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` 1659 1660 Message_ *string `locationName:"Message" type:"string"` 1661} 1662 1663// String returns the string representation 1664func (s InvalidParameterValueException) String() string { 1665 return awsutil.Prettify(s) 1666} 1667 1668// GoString returns the string representation 1669func (s InvalidParameterValueException) GoString() string { 1670 return s.String() 1671} 1672 1673func newErrorInvalidParameterValueException(v protocol.ResponseMetadata) error { 1674 return &InvalidParameterValueException{ 1675 RespMetadata: v, 1676 } 1677} 1678 1679// Code returns the exception type name. 1680func (s *InvalidParameterValueException) Code() string { 1681 return "InvalidParameterValueException" 1682} 1683 1684// Message returns the exception's message. 1685func (s *InvalidParameterValueException) Message() string { 1686 if s.Message_ != nil { 1687 return *s.Message_ 1688 } 1689 return "" 1690} 1691 1692// OrigErr always returns nil, satisfies awserr.Error interface. 1693func (s *InvalidParameterValueException) OrigErr() error { 1694 return nil 1695} 1696 1697func (s *InvalidParameterValueException) Error() string { 1698 return fmt.Sprintf("%s: %s", s.Code(), s.Message()) 1699} 1700 1701// Status code returns the HTTP status code for the request's response error. 1702func (s *InvalidParameterValueException) StatusCode() int { 1703 return s.RespMetadata.StatusCode 1704} 1705 1706// RequestID returns the service's response RequestID for request. 1707func (s *InvalidParameterValueException) RequestID() string { 1708 return s.RespMetadata.RequestID 1709} 1710 1711// The request that you made is invalid. Check your request to determine why 1712// it's invalid and then retry the request. 1713type InvalidRequestException struct { 1714 _ struct{} `type:"structure"` 1715 RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` 1716 1717 Message_ *string `locationName:"Message" type:"string"` 1718} 1719 1720// String returns the string representation 1721func (s InvalidRequestException) String() string { 1722 return awsutil.Prettify(s) 1723} 1724 1725// GoString returns the string representation 1726func (s InvalidRequestException) GoString() string { 1727 return s.String() 1728} 1729 1730func newErrorInvalidRequestException(v protocol.ResponseMetadata) error { 1731 return &InvalidRequestException{ 1732 RespMetadata: v, 1733 } 1734} 1735 1736// Code returns the exception type name. 1737func (s *InvalidRequestException) Code() string { 1738 return "InvalidRequestException" 1739} 1740 1741// Message returns the exception's message. 1742func (s *InvalidRequestException) Message() string { 1743 if s.Message_ != nil { 1744 return *s.Message_ 1745 } 1746 return "" 1747} 1748 1749// OrigErr always returns nil, satisfies awserr.Error interface. 1750func (s *InvalidRequestException) OrigErr() error { 1751 return nil 1752} 1753 1754func (s *InvalidRequestException) Error() string { 1755 return fmt.Sprintf("%s: %s", s.Code(), s.Message()) 1756} 1757 1758// Status code returns the HTTP status code for the request's response error. 1759func (s *InvalidRequestException) StatusCode() int { 1760 return s.RespMetadata.StatusCode 1761} 1762 1763// RequestID returns the service's response RequestID for request. 1764func (s *InvalidRequestException) RequestID() string { 1765 return s.RespMetadata.RequestID 1766} 1767 1768// The number of documents successfully and unsuccessfully processed during 1769// a translation job. 1770type JobDetails struct { 1771 _ struct{} `type:"structure"` 1772 1773 // The number of documents that could not be processed during a translation 1774 // job. 1775 DocumentsWithErrorsCount *int64 `type:"integer"` 1776 1777 // The number of documents used as input in a translation job. 1778 InputDocumentsCount *int64 `type:"integer"` 1779 1780 // The number of documents successfully processed during a translation job. 1781 TranslatedDocumentsCount *int64 `type:"integer"` 1782} 1783 1784// String returns the string representation 1785func (s JobDetails) String() string { 1786 return awsutil.Prettify(s) 1787} 1788 1789// GoString returns the string representation 1790func (s JobDetails) GoString() string { 1791 return s.String() 1792} 1793 1794// SetDocumentsWithErrorsCount sets the DocumentsWithErrorsCount field's value. 1795func (s *JobDetails) SetDocumentsWithErrorsCount(v int64) *JobDetails { 1796 s.DocumentsWithErrorsCount = &v 1797 return s 1798} 1799 1800// SetInputDocumentsCount sets the InputDocumentsCount field's value. 1801func (s *JobDetails) SetInputDocumentsCount(v int64) *JobDetails { 1802 s.InputDocumentsCount = &v 1803 return s 1804} 1805 1806// SetTranslatedDocumentsCount sets the TranslatedDocumentsCount field's value. 1807func (s *JobDetails) SetTranslatedDocumentsCount(v int64) *JobDetails { 1808 s.TranslatedDocumentsCount = &v 1809 return s 1810} 1811 1812// The specified limit has been exceeded. Review your request and retry it with 1813// a quantity below the stated limit. 1814type LimitExceededException struct { 1815 _ struct{} `type:"structure"` 1816 RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` 1817 1818 Message_ *string `locationName:"Message" type:"string"` 1819} 1820 1821// String returns the string representation 1822func (s LimitExceededException) String() string { 1823 return awsutil.Prettify(s) 1824} 1825 1826// GoString returns the string representation 1827func (s LimitExceededException) GoString() string { 1828 return s.String() 1829} 1830 1831func newErrorLimitExceededException(v protocol.ResponseMetadata) error { 1832 return &LimitExceededException{ 1833 RespMetadata: v, 1834 } 1835} 1836 1837// Code returns the exception type name. 1838func (s *LimitExceededException) Code() string { 1839 return "LimitExceededException" 1840} 1841 1842// Message returns the exception's message. 1843func (s *LimitExceededException) Message() string { 1844 if s.Message_ != nil { 1845 return *s.Message_ 1846 } 1847 return "" 1848} 1849 1850// OrigErr always returns nil, satisfies awserr.Error interface. 1851func (s *LimitExceededException) OrigErr() error { 1852 return nil 1853} 1854 1855func (s *LimitExceededException) Error() string { 1856 return fmt.Sprintf("%s: %s", s.Code(), s.Message()) 1857} 1858 1859// Status code returns the HTTP status code for the request's response error. 1860func (s *LimitExceededException) StatusCode() int { 1861 return s.RespMetadata.StatusCode 1862} 1863 1864// RequestID returns the service's response RequestID for request. 1865func (s *LimitExceededException) RequestID() string { 1866 return s.RespMetadata.RequestID 1867} 1868 1869type ListTerminologiesInput struct { 1870 _ struct{} `type:"structure"` 1871 1872 // The maximum number of custom terminologies returned per list request. 1873 MaxResults *int64 `min:"1" type:"integer"` 1874 1875 // If the result of the request to ListTerminologies was truncated, include 1876 // the NextToken to fetch the next group of custom terminologies. 1877 NextToken *string `type:"string"` 1878} 1879 1880// String returns the string representation 1881func (s ListTerminologiesInput) String() string { 1882 return awsutil.Prettify(s) 1883} 1884 1885// GoString returns the string representation 1886func (s ListTerminologiesInput) GoString() string { 1887 return s.String() 1888} 1889 1890// Validate inspects the fields of the type to determine if they are valid. 1891func (s *ListTerminologiesInput) Validate() error { 1892 invalidParams := request.ErrInvalidParams{Context: "ListTerminologiesInput"} 1893 if s.MaxResults != nil && *s.MaxResults < 1 { 1894 invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) 1895 } 1896 1897 if invalidParams.Len() > 0 { 1898 return invalidParams 1899 } 1900 return nil 1901} 1902 1903// SetMaxResults sets the MaxResults field's value. 1904func (s *ListTerminologiesInput) SetMaxResults(v int64) *ListTerminologiesInput { 1905 s.MaxResults = &v 1906 return s 1907} 1908 1909// SetNextToken sets the NextToken field's value. 1910func (s *ListTerminologiesInput) SetNextToken(v string) *ListTerminologiesInput { 1911 s.NextToken = &v 1912 return s 1913} 1914 1915type ListTerminologiesOutput struct { 1916 _ struct{} `type:"structure"` 1917 1918 // If the response to the ListTerminologies was truncated, the NextToken fetches 1919 // the next group of custom terminologies. 1920 NextToken *string `type:"string"` 1921 1922 // The properties list of the custom terminologies returned on the list request. 1923 TerminologyPropertiesList []*TerminologyProperties `type:"list"` 1924} 1925 1926// String returns the string representation 1927func (s ListTerminologiesOutput) String() string { 1928 return awsutil.Prettify(s) 1929} 1930 1931// GoString returns the string representation 1932func (s ListTerminologiesOutput) GoString() string { 1933 return s.String() 1934} 1935 1936// SetNextToken sets the NextToken field's value. 1937func (s *ListTerminologiesOutput) SetNextToken(v string) *ListTerminologiesOutput { 1938 s.NextToken = &v 1939 return s 1940} 1941 1942// SetTerminologyPropertiesList sets the TerminologyPropertiesList field's value. 1943func (s *ListTerminologiesOutput) SetTerminologyPropertiesList(v []*TerminologyProperties) *ListTerminologiesOutput { 1944 s.TerminologyPropertiesList = v 1945 return s 1946} 1947 1948type ListTextTranslationJobsInput struct { 1949 _ struct{} `type:"structure"` 1950 1951 // The parameters that specify which batch translation jobs to retrieve. Filters 1952 // include job name, job status, and submission time. You can only set one filter 1953 // at a time. 1954 Filter *TextTranslationJobFilter `type:"structure"` 1955 1956 // The maximum number of results to return in each page. The default value is 1957 // 100. 1958 MaxResults *int64 `min:"1" type:"integer"` 1959 1960 // The token to request the next page of results. 1961 NextToken *string `type:"string"` 1962} 1963 1964// String returns the string representation 1965func (s ListTextTranslationJobsInput) String() string { 1966 return awsutil.Prettify(s) 1967} 1968 1969// GoString returns the string representation 1970func (s ListTextTranslationJobsInput) GoString() string { 1971 return s.String() 1972} 1973 1974// Validate inspects the fields of the type to determine if they are valid. 1975func (s *ListTextTranslationJobsInput) Validate() error { 1976 invalidParams := request.ErrInvalidParams{Context: "ListTextTranslationJobsInput"} 1977 if s.MaxResults != nil && *s.MaxResults < 1 { 1978 invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) 1979 } 1980 if s.Filter != nil { 1981 if err := s.Filter.Validate(); err != nil { 1982 invalidParams.AddNested("Filter", err.(request.ErrInvalidParams)) 1983 } 1984 } 1985 1986 if invalidParams.Len() > 0 { 1987 return invalidParams 1988 } 1989 return nil 1990} 1991 1992// SetFilter sets the Filter field's value. 1993func (s *ListTextTranslationJobsInput) SetFilter(v *TextTranslationJobFilter) *ListTextTranslationJobsInput { 1994 s.Filter = v 1995 return s 1996} 1997 1998// SetMaxResults sets the MaxResults field's value. 1999func (s *ListTextTranslationJobsInput) SetMaxResults(v int64) *ListTextTranslationJobsInput { 2000 s.MaxResults = &v 2001 return s 2002} 2003 2004// SetNextToken sets the NextToken field's value. 2005func (s *ListTextTranslationJobsInput) SetNextToken(v string) *ListTextTranslationJobsInput { 2006 s.NextToken = &v 2007 return s 2008} 2009 2010type ListTextTranslationJobsOutput struct { 2011 _ struct{} `type:"structure"` 2012 2013 // The token to use to retreive the next page of results. This value is null 2014 // when there are no more results to return. 2015 NextToken *string `type:"string"` 2016 2017 // A list containing the properties of each job that is returned. 2018 TextTranslationJobPropertiesList []*TextTranslationJobProperties `type:"list"` 2019} 2020 2021// String returns the string representation 2022func (s ListTextTranslationJobsOutput) String() string { 2023 return awsutil.Prettify(s) 2024} 2025 2026// GoString returns the string representation 2027func (s ListTextTranslationJobsOutput) GoString() string { 2028 return s.String() 2029} 2030 2031// SetNextToken sets the NextToken field's value. 2032func (s *ListTextTranslationJobsOutput) SetNextToken(v string) *ListTextTranslationJobsOutput { 2033 s.NextToken = &v 2034 return s 2035} 2036 2037// SetTextTranslationJobPropertiesList sets the TextTranslationJobPropertiesList field's value. 2038func (s *ListTextTranslationJobsOutput) SetTextTranslationJobPropertiesList(v []*TextTranslationJobProperties) *ListTextTranslationJobsOutput { 2039 s.TextTranslationJobPropertiesList = v 2040 return s 2041} 2042 2043// The output configuration properties for a batch translation job. 2044type OutputDataConfig struct { 2045 _ struct{} `type:"structure"` 2046 2047 // The URI of the S3 folder that contains a translation job's output file. The 2048 // folder must be in the same Region as the API endpoint that you are calling. 2049 // 2050 // S3Uri is a required field 2051 S3Uri *string `type:"string" required:"true"` 2052} 2053 2054// String returns the string representation 2055func (s OutputDataConfig) String() string { 2056 return awsutil.Prettify(s) 2057} 2058 2059// GoString returns the string representation 2060func (s OutputDataConfig) GoString() string { 2061 return s.String() 2062} 2063 2064// Validate inspects the fields of the type to determine if they are valid. 2065func (s *OutputDataConfig) Validate() error { 2066 invalidParams := request.ErrInvalidParams{Context: "OutputDataConfig"} 2067 if s.S3Uri == nil { 2068 invalidParams.Add(request.NewErrParamRequired("S3Uri")) 2069 } 2070 2071 if invalidParams.Len() > 0 { 2072 return invalidParams 2073 } 2074 return nil 2075} 2076 2077// SetS3Uri sets the S3Uri field's value. 2078func (s *OutputDataConfig) SetS3Uri(v string) *OutputDataConfig { 2079 s.S3Uri = &v 2080 return s 2081} 2082 2083// The resource you are looking for has not been found. Review the resource 2084// you're looking for and see if a different resource will accomplish your needs 2085// before retrying the revised request. 2086type ResourceNotFoundException struct { 2087 _ struct{} `type:"structure"` 2088 RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` 2089 2090 Message_ *string `locationName:"Message" type:"string"` 2091} 2092 2093// String returns the string representation 2094func (s ResourceNotFoundException) String() string { 2095 return awsutil.Prettify(s) 2096} 2097 2098// GoString returns the string representation 2099func (s ResourceNotFoundException) GoString() string { 2100 return s.String() 2101} 2102 2103func newErrorResourceNotFoundException(v protocol.ResponseMetadata) error { 2104 return &ResourceNotFoundException{ 2105 RespMetadata: v, 2106 } 2107} 2108 2109// Code returns the exception type name. 2110func (s *ResourceNotFoundException) Code() string { 2111 return "ResourceNotFoundException" 2112} 2113 2114// Message returns the exception's message. 2115func (s *ResourceNotFoundException) Message() string { 2116 if s.Message_ != nil { 2117 return *s.Message_ 2118 } 2119 return "" 2120} 2121 2122// OrigErr always returns nil, satisfies awserr.Error interface. 2123func (s *ResourceNotFoundException) OrigErr() error { 2124 return nil 2125} 2126 2127func (s *ResourceNotFoundException) Error() string { 2128 return fmt.Sprintf("%s: %s", s.Code(), s.Message()) 2129} 2130 2131// Status code returns the HTTP status code for the request's response error. 2132func (s *ResourceNotFoundException) StatusCode() int { 2133 return s.RespMetadata.StatusCode 2134} 2135 2136// RequestID returns the service's response RequestID for request. 2137func (s *ResourceNotFoundException) RequestID() string { 2138 return s.RespMetadata.RequestID 2139} 2140 2141// The Amazon Translate service is temporarily unavailable. Please wait a bit 2142// and then retry your request. 2143type ServiceUnavailableException struct { 2144 _ struct{} `type:"structure"` 2145 RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` 2146 2147 Message_ *string `locationName:"Message" type:"string"` 2148} 2149 2150// String returns the string representation 2151func (s ServiceUnavailableException) String() string { 2152 return awsutil.Prettify(s) 2153} 2154 2155// GoString returns the string representation 2156func (s ServiceUnavailableException) GoString() string { 2157 return s.String() 2158} 2159 2160func newErrorServiceUnavailableException(v protocol.ResponseMetadata) error { 2161 return &ServiceUnavailableException{ 2162 RespMetadata: v, 2163 } 2164} 2165 2166// Code returns the exception type name. 2167func (s *ServiceUnavailableException) Code() string { 2168 return "ServiceUnavailableException" 2169} 2170 2171// Message returns the exception's message. 2172func (s *ServiceUnavailableException) Message() string { 2173 if s.Message_ != nil { 2174 return *s.Message_ 2175 } 2176 return "" 2177} 2178 2179// OrigErr always returns nil, satisfies awserr.Error interface. 2180func (s *ServiceUnavailableException) OrigErr() error { 2181 return nil 2182} 2183 2184func (s *ServiceUnavailableException) Error() string { 2185 return fmt.Sprintf("%s: %s", s.Code(), s.Message()) 2186} 2187 2188// Status code returns the HTTP status code for the request's response error. 2189func (s *ServiceUnavailableException) StatusCode() int { 2190 return s.RespMetadata.StatusCode 2191} 2192 2193// RequestID returns the service's response RequestID for request. 2194func (s *ServiceUnavailableException) RequestID() string { 2195 return s.RespMetadata.RequestID 2196} 2197 2198type StartTextTranslationJobInput struct { 2199 _ struct{} `type:"structure"` 2200 2201 // The client token of the EC2 instance calling the request. This token is auto-generated 2202 // when using the Amazon Translate SDK. Otherwise, use the DescribeInstances 2203 // (docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeInstances.html) 2204 // EC2 operation to retreive an instance's client token. For more information, 2205 // see Client Tokens (docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html#client-tokens) 2206 // in the EC2 User Guide. 2207 ClientToken *string `min:"1" type:"string" idempotencyToken:"true"` 2208 2209 // The Amazon Resource Name (ARN) of an AWS Identity Access and Management (IAM) 2210 // role that grants Amazon Translate read access to your input data. For more 2211 // nformation, see identity-and-access-management. 2212 // 2213 // DataAccessRoleArn is a required field 2214 DataAccessRoleArn *string `min:"20" type:"string" required:"true"` 2215 2216 // Specifies the format and S3 location of the input documents for the translation 2217 // job. 2218 // 2219 // InputDataConfig is a required field 2220 InputDataConfig *InputDataConfig `type:"structure" required:"true"` 2221 2222 // The name of the batch translation job to be performed. 2223 JobName *string `min:"1" type:"string"` 2224 2225 // Specifies the S3 folder to which your job output will be saved. 2226 // 2227 // OutputDataConfig is a required field 2228 OutputDataConfig *OutputDataConfig `type:"structure" required:"true"` 2229 2230 // The language code of the input language. For a list of language codes, see 2231 // what-is-languages. 2232 // 2233 // Amazon Translate does not automatically detect a source language during batch 2234 // translation jobs. 2235 // 2236 // SourceLanguageCode is a required field 2237 SourceLanguageCode *string `min:"2" type:"string" required:"true"` 2238 2239 // The language code of the output language. 2240 // 2241 // TargetLanguageCodes is a required field 2242 TargetLanguageCodes []*string `min:"1" type:"list" required:"true"` 2243 2244 // The name of the terminology to use in the batch translation job. For a list 2245 // of available terminologies, use the ListTerminologies operation. 2246 TerminologyNames []*string `type:"list"` 2247} 2248 2249// String returns the string representation 2250func (s StartTextTranslationJobInput) String() string { 2251 return awsutil.Prettify(s) 2252} 2253 2254// GoString returns the string representation 2255func (s StartTextTranslationJobInput) GoString() string { 2256 return s.String() 2257} 2258 2259// Validate inspects the fields of the type to determine if they are valid. 2260func (s *StartTextTranslationJobInput) Validate() error { 2261 invalidParams := request.ErrInvalidParams{Context: "StartTextTranslationJobInput"} 2262 if s.ClientToken != nil && len(*s.ClientToken) < 1 { 2263 invalidParams.Add(request.NewErrParamMinLen("ClientToken", 1)) 2264 } 2265 if s.DataAccessRoleArn == nil { 2266 invalidParams.Add(request.NewErrParamRequired("DataAccessRoleArn")) 2267 } 2268 if s.DataAccessRoleArn != nil && len(*s.DataAccessRoleArn) < 20 { 2269 invalidParams.Add(request.NewErrParamMinLen("DataAccessRoleArn", 20)) 2270 } 2271 if s.InputDataConfig == nil { 2272 invalidParams.Add(request.NewErrParamRequired("InputDataConfig")) 2273 } 2274 if s.JobName != nil && len(*s.JobName) < 1 { 2275 invalidParams.Add(request.NewErrParamMinLen("JobName", 1)) 2276 } 2277 if s.OutputDataConfig == nil { 2278 invalidParams.Add(request.NewErrParamRequired("OutputDataConfig")) 2279 } 2280 if s.SourceLanguageCode == nil { 2281 invalidParams.Add(request.NewErrParamRequired("SourceLanguageCode")) 2282 } 2283 if s.SourceLanguageCode != nil && len(*s.SourceLanguageCode) < 2 { 2284 invalidParams.Add(request.NewErrParamMinLen("SourceLanguageCode", 2)) 2285 } 2286 if s.TargetLanguageCodes == nil { 2287 invalidParams.Add(request.NewErrParamRequired("TargetLanguageCodes")) 2288 } 2289 if s.TargetLanguageCodes != nil && len(s.TargetLanguageCodes) < 1 { 2290 invalidParams.Add(request.NewErrParamMinLen("TargetLanguageCodes", 1)) 2291 } 2292 if s.InputDataConfig != nil { 2293 if err := s.InputDataConfig.Validate(); err != nil { 2294 invalidParams.AddNested("InputDataConfig", err.(request.ErrInvalidParams)) 2295 } 2296 } 2297 if s.OutputDataConfig != nil { 2298 if err := s.OutputDataConfig.Validate(); err != nil { 2299 invalidParams.AddNested("OutputDataConfig", err.(request.ErrInvalidParams)) 2300 } 2301 } 2302 2303 if invalidParams.Len() > 0 { 2304 return invalidParams 2305 } 2306 return nil 2307} 2308 2309// SetClientToken sets the ClientToken field's value. 2310func (s *StartTextTranslationJobInput) SetClientToken(v string) *StartTextTranslationJobInput { 2311 s.ClientToken = &v 2312 return s 2313} 2314 2315// SetDataAccessRoleArn sets the DataAccessRoleArn field's value. 2316func (s *StartTextTranslationJobInput) SetDataAccessRoleArn(v string) *StartTextTranslationJobInput { 2317 s.DataAccessRoleArn = &v 2318 return s 2319} 2320 2321// SetInputDataConfig sets the InputDataConfig field's value. 2322func (s *StartTextTranslationJobInput) SetInputDataConfig(v *InputDataConfig) *StartTextTranslationJobInput { 2323 s.InputDataConfig = v 2324 return s 2325} 2326 2327// SetJobName sets the JobName field's value. 2328func (s *StartTextTranslationJobInput) SetJobName(v string) *StartTextTranslationJobInput { 2329 s.JobName = &v 2330 return s 2331} 2332 2333// SetOutputDataConfig sets the OutputDataConfig field's value. 2334func (s *StartTextTranslationJobInput) SetOutputDataConfig(v *OutputDataConfig) *StartTextTranslationJobInput { 2335 s.OutputDataConfig = v 2336 return s 2337} 2338 2339// SetSourceLanguageCode sets the SourceLanguageCode field's value. 2340func (s *StartTextTranslationJobInput) SetSourceLanguageCode(v string) *StartTextTranslationJobInput { 2341 s.SourceLanguageCode = &v 2342 return s 2343} 2344 2345// SetTargetLanguageCodes sets the TargetLanguageCodes field's value. 2346func (s *StartTextTranslationJobInput) SetTargetLanguageCodes(v []*string) *StartTextTranslationJobInput { 2347 s.TargetLanguageCodes = v 2348 return s 2349} 2350 2351// SetTerminologyNames sets the TerminologyNames field's value. 2352func (s *StartTextTranslationJobInput) SetTerminologyNames(v []*string) *StartTextTranslationJobInput { 2353 s.TerminologyNames = v 2354 return s 2355} 2356 2357type StartTextTranslationJobOutput struct { 2358 _ struct{} `type:"structure"` 2359 2360 // The identifier generated for the job. To get the status of a job, use this 2361 // ID with the DescribeTextTranslationJob operation. 2362 JobId *string `min:"1" type:"string"` 2363 2364 // The status of the job. Possible values include: 2365 // 2366 // * SUBMITTED - The job has been received and is queued for processing. 2367 // 2368 // * IN_PROGRESS - Amazon Translate is processing the job. 2369 // 2370 // * COMPLETED - The job was successfully completed and the output is available. 2371 // 2372 // * COMPLETED_WITH_ERRORS - The job was completed with errors. The errors 2373 // can be analyzed in the job's output. 2374 // 2375 // * FAILED - The job did not complete. To get details, use the DescribeTextTranslationJob 2376 // operation. 2377 // 2378 // * STOP_REQUESTED - The user who started the job has requested that it 2379 // be stopped. 2380 // 2381 // * STOPPED - The job has been stopped. 2382 JobStatus *string `type:"string" enum:"JobStatus"` 2383} 2384 2385// String returns the string representation 2386func (s StartTextTranslationJobOutput) String() string { 2387 return awsutil.Prettify(s) 2388} 2389 2390// GoString returns the string representation 2391func (s StartTextTranslationJobOutput) GoString() string { 2392 return s.String() 2393} 2394 2395// SetJobId sets the JobId field's value. 2396func (s *StartTextTranslationJobOutput) SetJobId(v string) *StartTextTranslationJobOutput { 2397 s.JobId = &v 2398 return s 2399} 2400 2401// SetJobStatus sets the JobStatus field's value. 2402func (s *StartTextTranslationJobOutput) SetJobStatus(v string) *StartTextTranslationJobOutput { 2403 s.JobStatus = &v 2404 return s 2405} 2406 2407type StopTextTranslationJobInput struct { 2408 _ struct{} `type:"structure"` 2409 2410 // The job ID of the job to be stopped. 2411 // 2412 // JobId is a required field 2413 JobId *string `min:"1" type:"string" required:"true"` 2414} 2415 2416// String returns the string representation 2417func (s StopTextTranslationJobInput) String() string { 2418 return awsutil.Prettify(s) 2419} 2420 2421// GoString returns the string representation 2422func (s StopTextTranslationJobInput) GoString() string { 2423 return s.String() 2424} 2425 2426// Validate inspects the fields of the type to determine if they are valid. 2427func (s *StopTextTranslationJobInput) Validate() error { 2428 invalidParams := request.ErrInvalidParams{Context: "StopTextTranslationJobInput"} 2429 if s.JobId == nil { 2430 invalidParams.Add(request.NewErrParamRequired("JobId")) 2431 } 2432 if s.JobId != nil && len(*s.JobId) < 1 { 2433 invalidParams.Add(request.NewErrParamMinLen("JobId", 1)) 2434 } 2435 2436 if invalidParams.Len() > 0 { 2437 return invalidParams 2438 } 2439 return nil 2440} 2441 2442// SetJobId sets the JobId field's value. 2443func (s *StopTextTranslationJobInput) SetJobId(v string) *StopTextTranslationJobInput { 2444 s.JobId = &v 2445 return s 2446} 2447 2448type StopTextTranslationJobOutput struct { 2449 _ struct{} `type:"structure"` 2450 2451 // The job ID of the stopped batch translation job. 2452 JobId *string `min:"1" type:"string"` 2453 2454 // The status of the designated job. Upon successful completion, the job's status 2455 // will be STOPPED. 2456 JobStatus *string `type:"string" enum:"JobStatus"` 2457} 2458 2459// String returns the string representation 2460func (s StopTextTranslationJobOutput) String() string { 2461 return awsutil.Prettify(s) 2462} 2463 2464// GoString returns the string representation 2465func (s StopTextTranslationJobOutput) GoString() string { 2466 return s.String() 2467} 2468 2469// SetJobId sets the JobId field's value. 2470func (s *StopTextTranslationJobOutput) SetJobId(v string) *StopTextTranslationJobOutput { 2471 s.JobId = &v 2472 return s 2473} 2474 2475// SetJobStatus sets the JobStatus field's value. 2476func (s *StopTextTranslationJobOutput) SetJobStatus(v string) *StopTextTranslationJobOutput { 2477 s.JobStatus = &v 2478 return s 2479} 2480 2481// The term being translated by the custom terminology. 2482type Term struct { 2483 _ struct{} `type:"structure"` 2484 2485 // The source text of the term being translated by the custom terminology. 2486 SourceText *string `type:"string"` 2487 2488 // The target text of the term being translated by the custom terminology. 2489 TargetText *string `type:"string"` 2490} 2491 2492// String returns the string representation 2493func (s Term) String() string { 2494 return awsutil.Prettify(s) 2495} 2496 2497// GoString returns the string representation 2498func (s Term) GoString() string { 2499 return s.String() 2500} 2501 2502// SetSourceText sets the SourceText field's value. 2503func (s *Term) SetSourceText(v string) *Term { 2504 s.SourceText = &v 2505 return s 2506} 2507 2508// SetTargetText sets the TargetText field's value. 2509func (s *Term) SetTargetText(v string) *Term { 2510 s.TargetText = &v 2511 return s 2512} 2513 2514// The data associated with the custom terminology. 2515type TerminologyData struct { 2516 _ struct{} `type:"structure"` 2517 2518 // The file containing the custom terminology data. Your version of the AWS 2519 // SDK performs a Base64-encoding on this field before sending a request to 2520 // the AWS service. Users of the SDK should not perform Base64-encoding themselves. 2521 // 2522 // File is automatically base64 encoded/decoded by the SDK. 2523 // 2524 // File is a required field 2525 File []byte `type:"blob" required:"true" sensitive:"true"` 2526 2527 // The data format of the custom terminology. Either CSV or TMX. 2528 // 2529 // Format is a required field 2530 Format *string `type:"string" required:"true" enum:"TerminologyDataFormat"` 2531} 2532 2533// String returns the string representation 2534func (s TerminologyData) String() string { 2535 return awsutil.Prettify(s) 2536} 2537 2538// GoString returns the string representation 2539func (s TerminologyData) GoString() string { 2540 return s.String() 2541} 2542 2543// Validate inspects the fields of the type to determine if they are valid. 2544func (s *TerminologyData) Validate() error { 2545 invalidParams := request.ErrInvalidParams{Context: "TerminologyData"} 2546 if s.File == nil { 2547 invalidParams.Add(request.NewErrParamRequired("File")) 2548 } 2549 if s.Format == nil { 2550 invalidParams.Add(request.NewErrParamRequired("Format")) 2551 } 2552 2553 if invalidParams.Len() > 0 { 2554 return invalidParams 2555 } 2556 return nil 2557} 2558 2559// SetFile sets the File field's value. 2560func (s *TerminologyData) SetFile(v []byte) *TerminologyData { 2561 s.File = v 2562 return s 2563} 2564 2565// SetFormat sets the Format field's value. 2566func (s *TerminologyData) SetFormat(v string) *TerminologyData { 2567 s.Format = &v 2568 return s 2569} 2570 2571// The location of the custom terminology data. 2572type TerminologyDataLocation struct { 2573 _ struct{} `type:"structure"` 2574 2575 // The location of the custom terminology data. 2576 // 2577 // Location is a required field 2578 Location *string `type:"string" required:"true"` 2579 2580 // The repository type for the custom terminology data. 2581 // 2582 // RepositoryType is a required field 2583 RepositoryType *string `type:"string" required:"true"` 2584} 2585 2586// String returns the string representation 2587func (s TerminologyDataLocation) String() string { 2588 return awsutil.Prettify(s) 2589} 2590 2591// GoString returns the string representation 2592func (s TerminologyDataLocation) GoString() string { 2593 return s.String() 2594} 2595 2596// SetLocation sets the Location field's value. 2597func (s *TerminologyDataLocation) SetLocation(v string) *TerminologyDataLocation { 2598 s.Location = &v 2599 return s 2600} 2601 2602// SetRepositoryType sets the RepositoryType field's value. 2603func (s *TerminologyDataLocation) SetRepositoryType(v string) *TerminologyDataLocation { 2604 s.RepositoryType = &v 2605 return s 2606} 2607 2608// The properties of the custom terminology. 2609type TerminologyProperties struct { 2610 _ struct{} `type:"structure"` 2611 2612 // The Amazon Resource Name (ARN) of the custom terminology. 2613 Arn *string `type:"string"` 2614 2615 // The time at which the custom terminology was created, based on the timestamp. 2616 CreatedAt *time.Time `type:"timestamp"` 2617 2618 // The description of the custom terminology properties. 2619 Description *string `type:"string"` 2620 2621 // The encryption key for the custom terminology. 2622 EncryptionKey *EncryptionKey `type:"structure"` 2623 2624 // The time at which the custom terminology was last update, based on the timestamp. 2625 LastUpdatedAt *time.Time `type:"timestamp"` 2626 2627 // The name of the custom terminology. 2628 Name *string `min:"1" type:"string"` 2629 2630 // The size of the file used when importing a custom terminology. 2631 SizeBytes *int64 `type:"integer"` 2632 2633 // The language code for the source text of the translation request for which 2634 // the custom terminology is being used. 2635 SourceLanguageCode *string `min:"2" type:"string"` 2636 2637 // The language codes for the target languages available with the custom terminology 2638 // file. All possible target languages are returned in array. 2639 TargetLanguageCodes []*string `type:"list"` 2640 2641 // The number of terms included in the custom terminology. 2642 TermCount *int64 `type:"integer"` 2643} 2644 2645// String returns the string representation 2646func (s TerminologyProperties) String() string { 2647 return awsutil.Prettify(s) 2648} 2649 2650// GoString returns the string representation 2651func (s TerminologyProperties) GoString() string { 2652 return s.String() 2653} 2654 2655// SetArn sets the Arn field's value. 2656func (s *TerminologyProperties) SetArn(v string) *TerminologyProperties { 2657 s.Arn = &v 2658 return s 2659} 2660 2661// SetCreatedAt sets the CreatedAt field's value. 2662func (s *TerminologyProperties) SetCreatedAt(v time.Time) *TerminologyProperties { 2663 s.CreatedAt = &v 2664 return s 2665} 2666 2667// SetDescription sets the Description field's value. 2668func (s *TerminologyProperties) SetDescription(v string) *TerminologyProperties { 2669 s.Description = &v 2670 return s 2671} 2672 2673// SetEncryptionKey sets the EncryptionKey field's value. 2674func (s *TerminologyProperties) SetEncryptionKey(v *EncryptionKey) *TerminologyProperties { 2675 s.EncryptionKey = v 2676 return s 2677} 2678 2679// SetLastUpdatedAt sets the LastUpdatedAt field's value. 2680func (s *TerminologyProperties) SetLastUpdatedAt(v time.Time) *TerminologyProperties { 2681 s.LastUpdatedAt = &v 2682 return s 2683} 2684 2685// SetName sets the Name field's value. 2686func (s *TerminologyProperties) SetName(v string) *TerminologyProperties { 2687 s.Name = &v 2688 return s 2689} 2690 2691// SetSizeBytes sets the SizeBytes field's value. 2692func (s *TerminologyProperties) SetSizeBytes(v int64) *TerminologyProperties { 2693 s.SizeBytes = &v 2694 return s 2695} 2696 2697// SetSourceLanguageCode sets the SourceLanguageCode field's value. 2698func (s *TerminologyProperties) SetSourceLanguageCode(v string) *TerminologyProperties { 2699 s.SourceLanguageCode = &v 2700 return s 2701} 2702 2703// SetTargetLanguageCodes sets the TargetLanguageCodes field's value. 2704func (s *TerminologyProperties) SetTargetLanguageCodes(v []*string) *TerminologyProperties { 2705 s.TargetLanguageCodes = v 2706 return s 2707} 2708 2709// SetTermCount sets the TermCount field's value. 2710func (s *TerminologyProperties) SetTermCount(v int64) *TerminologyProperties { 2711 s.TermCount = &v 2712 return s 2713} 2714 2715type TextInput struct { 2716 _ struct{} `type:"structure"` 2717 2718 // The language code for the language of the source text. The language must 2719 // be a language supported by Amazon Translate. For a list of language codes, 2720 // see what-is-languages. 2721 // 2722 // To have Amazon Translate determine the source language of your text, you 2723 // can specify auto in the SourceLanguageCode field. If you specify auto, Amazon 2724 // Translate will call Amazon Comprehend (https://docs.aws.amazon.com/comprehend/latest/dg/comprehend-general.html) 2725 // to determine the source language. 2726 // 2727 // SourceLanguageCode is a required field 2728 SourceLanguageCode *string `min:"2" type:"string" required:"true"` 2729 2730 // The language code requested for the language of the target text. The language 2731 // must be a language supported by Amazon Translate. 2732 // 2733 // TargetLanguageCode is a required field 2734 TargetLanguageCode *string `min:"2" type:"string" required:"true"` 2735 2736 // The name of the terminology list file to be used in the TranslateText request. 2737 // You can use 1 terminology list at most in a TranslateText request. Terminology 2738 // lists can contain a maximum of 256 terms. 2739 TerminologyNames []*string `type:"list"` 2740 2741 // The text to translate. The text string can be a maximum of 5,000 bytes long. 2742 // Depending on your character set, this may be fewer than 5,000 characters. 2743 // 2744 // Text is a required field 2745 Text *string `min:"1" type:"string" required:"true"` 2746} 2747 2748// String returns the string representation 2749func (s TextInput) String() string { 2750 return awsutil.Prettify(s) 2751} 2752 2753// GoString returns the string representation 2754func (s TextInput) GoString() string { 2755 return s.String() 2756} 2757 2758// Validate inspects the fields of the type to determine if they are valid. 2759func (s *TextInput) Validate() error { 2760 invalidParams := request.ErrInvalidParams{Context: "TextInput"} 2761 if s.SourceLanguageCode == nil { 2762 invalidParams.Add(request.NewErrParamRequired("SourceLanguageCode")) 2763 } 2764 if s.SourceLanguageCode != nil && len(*s.SourceLanguageCode) < 2 { 2765 invalidParams.Add(request.NewErrParamMinLen("SourceLanguageCode", 2)) 2766 } 2767 if s.TargetLanguageCode == nil { 2768 invalidParams.Add(request.NewErrParamRequired("TargetLanguageCode")) 2769 } 2770 if s.TargetLanguageCode != nil && len(*s.TargetLanguageCode) < 2 { 2771 invalidParams.Add(request.NewErrParamMinLen("TargetLanguageCode", 2)) 2772 } 2773 if s.Text == nil { 2774 invalidParams.Add(request.NewErrParamRequired("Text")) 2775 } 2776 if s.Text != nil && len(*s.Text) < 1 { 2777 invalidParams.Add(request.NewErrParamMinLen("Text", 1)) 2778 } 2779 2780 if invalidParams.Len() > 0 { 2781 return invalidParams 2782 } 2783 return nil 2784} 2785 2786// SetSourceLanguageCode sets the SourceLanguageCode field's value. 2787func (s *TextInput) SetSourceLanguageCode(v string) *TextInput { 2788 s.SourceLanguageCode = &v 2789 return s 2790} 2791 2792// SetTargetLanguageCode sets the TargetLanguageCode field's value. 2793func (s *TextInput) SetTargetLanguageCode(v string) *TextInput { 2794 s.TargetLanguageCode = &v 2795 return s 2796} 2797 2798// SetTerminologyNames sets the TerminologyNames field's value. 2799func (s *TextInput) SetTerminologyNames(v []*string) *TextInput { 2800 s.TerminologyNames = v 2801 return s 2802} 2803 2804// SetText sets the Text field's value. 2805func (s *TextInput) SetText(v string) *TextInput { 2806 s.Text = &v 2807 return s 2808} 2809 2810type TextOutput struct { 2811 _ struct{} `type:"structure"` 2812 2813 // The names of the custom terminologies applied to the input text by Amazon 2814 // Translate for the translated text response. 2815 AppliedTerminologies []*AppliedTerminology `type:"list"` 2816 2817 // The language code for the language of the source text. 2818 // 2819 // SourceLanguageCode is a required field 2820 SourceLanguageCode *string `min:"2" type:"string" required:"true"` 2821 2822 // The language code for the language of the target text. 2823 // 2824 // TargetLanguageCode is a required field 2825 TargetLanguageCode *string `min:"2" type:"string" required:"true"` 2826 2827 // The translated text. 2828 // 2829 // TranslatedText is a required field 2830 TranslatedText *string `type:"string" required:"true"` 2831} 2832 2833// String returns the string representation 2834func (s TextOutput) String() string { 2835 return awsutil.Prettify(s) 2836} 2837 2838// GoString returns the string representation 2839func (s TextOutput) GoString() string { 2840 return s.String() 2841} 2842 2843// SetAppliedTerminologies sets the AppliedTerminologies field's value. 2844func (s *TextOutput) SetAppliedTerminologies(v []*AppliedTerminology) *TextOutput { 2845 s.AppliedTerminologies = v 2846 return s 2847} 2848 2849// SetSourceLanguageCode sets the SourceLanguageCode field's value. 2850func (s *TextOutput) SetSourceLanguageCode(v string) *TextOutput { 2851 s.SourceLanguageCode = &v 2852 return s 2853} 2854 2855// SetTargetLanguageCode sets the TargetLanguageCode field's value. 2856func (s *TextOutput) SetTargetLanguageCode(v string) *TextOutput { 2857 s.TargetLanguageCode = &v 2858 return s 2859} 2860 2861// SetTranslatedText sets the TranslatedText field's value. 2862func (s *TextOutput) SetTranslatedText(v string) *TextOutput { 2863 s.TranslatedText = &v 2864 return s 2865} 2866 2867// The size of the text you submitted exceeds the size limit. Reduce the size 2868// of the text or use a smaller document and then retry your request. 2869type TextSizeLimitExceededException struct { 2870 _ struct{} `type:"structure"` 2871 RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` 2872 2873 Message_ *string `locationName:"Message" type:"string"` 2874} 2875 2876// String returns the string representation 2877func (s TextSizeLimitExceededException) String() string { 2878 return awsutil.Prettify(s) 2879} 2880 2881// GoString returns the string representation 2882func (s TextSizeLimitExceededException) GoString() string { 2883 return s.String() 2884} 2885 2886func newErrorTextSizeLimitExceededException(v protocol.ResponseMetadata) error { 2887 return &TextSizeLimitExceededException{ 2888 RespMetadata: v, 2889 } 2890} 2891 2892// Code returns the exception type name. 2893func (s *TextSizeLimitExceededException) Code() string { 2894 return "TextSizeLimitExceededException" 2895} 2896 2897// Message returns the exception's message. 2898func (s *TextSizeLimitExceededException) Message() string { 2899 if s.Message_ != nil { 2900 return *s.Message_ 2901 } 2902 return "" 2903} 2904 2905// OrigErr always returns nil, satisfies awserr.Error interface. 2906func (s *TextSizeLimitExceededException) OrigErr() error { 2907 return nil 2908} 2909 2910func (s *TextSizeLimitExceededException) Error() string { 2911 return fmt.Sprintf("%s: %s", s.Code(), s.Message()) 2912} 2913 2914// Status code returns the HTTP status code for the request's response error. 2915func (s *TextSizeLimitExceededException) StatusCode() int { 2916 return s.RespMetadata.StatusCode 2917} 2918 2919// RequestID returns the service's response RequestID for request. 2920func (s *TextSizeLimitExceededException) RequestID() string { 2921 return s.RespMetadata.RequestID 2922} 2923 2924// Provides information for filtering a list of translation jobs. For more information, 2925// see ListTextTranslationJobs. 2926type TextTranslationJobFilter struct { 2927 _ struct{} `type:"structure"` 2928 2929 // Filters the list of jobs by name. 2930 JobName *string `min:"1" type:"string"` 2931 2932 // Filters the list of jobs based by job status. 2933 JobStatus *string `type:"string" enum:"JobStatus"` 2934 2935 // Filters the list of jobs based on the time that the job was submitted for 2936 // processing and returns only the jobs submitted after the specified time. 2937 // Jobs are returned in descending order, newest to oldest. 2938 SubmittedAfterTime *time.Time `type:"timestamp"` 2939 2940 // Filters the list of jobs based on the time that the job was submitted for 2941 // processing and returns only the jobs submitted before the specified time. 2942 // Jobs are returned in ascending order, oldest to newest. 2943 SubmittedBeforeTime *time.Time `type:"timestamp"` 2944} 2945 2946// String returns the string representation 2947func (s TextTranslationJobFilter) String() string { 2948 return awsutil.Prettify(s) 2949} 2950 2951// GoString returns the string representation 2952func (s TextTranslationJobFilter) GoString() string { 2953 return s.String() 2954} 2955 2956// Validate inspects the fields of the type to determine if they are valid. 2957func (s *TextTranslationJobFilter) Validate() error { 2958 invalidParams := request.ErrInvalidParams{Context: "TextTranslationJobFilter"} 2959 if s.JobName != nil && len(*s.JobName) < 1 { 2960 invalidParams.Add(request.NewErrParamMinLen("JobName", 1)) 2961 } 2962 2963 if invalidParams.Len() > 0 { 2964 return invalidParams 2965 } 2966 return nil 2967} 2968 2969// SetJobName sets the JobName field's value. 2970func (s *TextTranslationJobFilter) SetJobName(v string) *TextTranslationJobFilter { 2971 s.JobName = &v 2972 return s 2973} 2974 2975// SetJobStatus sets the JobStatus field's value. 2976func (s *TextTranslationJobFilter) SetJobStatus(v string) *TextTranslationJobFilter { 2977 s.JobStatus = &v 2978 return s 2979} 2980 2981// SetSubmittedAfterTime sets the SubmittedAfterTime field's value. 2982func (s *TextTranslationJobFilter) SetSubmittedAfterTime(v time.Time) *TextTranslationJobFilter { 2983 s.SubmittedAfterTime = &v 2984 return s 2985} 2986 2987// SetSubmittedBeforeTime sets the SubmittedBeforeTime field's value. 2988func (s *TextTranslationJobFilter) SetSubmittedBeforeTime(v time.Time) *TextTranslationJobFilter { 2989 s.SubmittedBeforeTime = &v 2990 return s 2991} 2992 2993// Provides information about a translation job. 2994type TextTranslationJobProperties struct { 2995 _ struct{} `type:"structure"` 2996 2997 // The Amazon Resource Name (ARN) of an AWS Identity Access and Management (IAM) 2998 // role that granted Amazon Translate read access to the job's input data. 2999 DataAccessRoleArn *string `min:"20" type:"string"` 3000 3001 // The time at which the translation job ended. 3002 EndTime *time.Time `type:"timestamp"` 3003 3004 // The input configuration properties that were specified when the job was requested. 3005 InputDataConfig *InputDataConfig `type:"structure"` 3006 3007 // The number of documents successfully and unsuccessfully processed during 3008 // the translation job. 3009 JobDetails *JobDetails `type:"structure"` 3010 3011 // The ID of the translation job. 3012 JobId *string `min:"1" type:"string"` 3013 3014 // The user-defined name of the translation job. 3015 JobName *string `min:"1" type:"string"` 3016 3017 // The status of the translation job. 3018 JobStatus *string `type:"string" enum:"JobStatus"` 3019 3020 // An explanation of any errors that may have occured during the translation 3021 // job. 3022 Message *string `type:"string"` 3023 3024 // The output configuration properties that were specified when the job was 3025 // requested. 3026 OutputDataConfig *OutputDataConfig `type:"structure"` 3027 3028 // The language code of the language of the source text. The language must be 3029 // a language supported by Amazon Translate. 3030 SourceLanguageCode *string `min:"2" type:"string"` 3031 3032 // The time at which the translation job was submitted. 3033 SubmittedTime *time.Time `type:"timestamp"` 3034 3035 // The language code of the language of the target text. The language must be 3036 // a language supported by Amazon Translate. 3037 TargetLanguageCodes []*string `min:"1" type:"list"` 3038 3039 // A list containing the names of the terminologies applied to a translation 3040 // job. Only one terminology can be applied per StartTextTranslationJob request 3041 // at this time. 3042 TerminologyNames []*string `type:"list"` 3043} 3044 3045// String returns the string representation 3046func (s TextTranslationJobProperties) String() string { 3047 return awsutil.Prettify(s) 3048} 3049 3050// GoString returns the string representation 3051func (s TextTranslationJobProperties) GoString() string { 3052 return s.String() 3053} 3054 3055// SetDataAccessRoleArn sets the DataAccessRoleArn field's value. 3056func (s *TextTranslationJobProperties) SetDataAccessRoleArn(v string) *TextTranslationJobProperties { 3057 s.DataAccessRoleArn = &v 3058 return s 3059} 3060 3061// SetEndTime sets the EndTime field's value. 3062func (s *TextTranslationJobProperties) SetEndTime(v time.Time) *TextTranslationJobProperties { 3063 s.EndTime = &v 3064 return s 3065} 3066 3067// SetInputDataConfig sets the InputDataConfig field's value. 3068func (s *TextTranslationJobProperties) SetInputDataConfig(v *InputDataConfig) *TextTranslationJobProperties { 3069 s.InputDataConfig = v 3070 return s 3071} 3072 3073// SetJobDetails sets the JobDetails field's value. 3074func (s *TextTranslationJobProperties) SetJobDetails(v *JobDetails) *TextTranslationJobProperties { 3075 s.JobDetails = v 3076 return s 3077} 3078 3079// SetJobId sets the JobId field's value. 3080func (s *TextTranslationJobProperties) SetJobId(v string) *TextTranslationJobProperties { 3081 s.JobId = &v 3082 return s 3083} 3084 3085// SetJobName sets the JobName field's value. 3086func (s *TextTranslationJobProperties) SetJobName(v string) *TextTranslationJobProperties { 3087 s.JobName = &v 3088 return s 3089} 3090 3091// SetJobStatus sets the JobStatus field's value. 3092func (s *TextTranslationJobProperties) SetJobStatus(v string) *TextTranslationJobProperties { 3093 s.JobStatus = &v 3094 return s 3095} 3096 3097// SetMessage sets the Message field's value. 3098func (s *TextTranslationJobProperties) SetMessage(v string) *TextTranslationJobProperties { 3099 s.Message = &v 3100 return s 3101} 3102 3103// SetOutputDataConfig sets the OutputDataConfig field's value. 3104func (s *TextTranslationJobProperties) SetOutputDataConfig(v *OutputDataConfig) *TextTranslationJobProperties { 3105 s.OutputDataConfig = v 3106 return s 3107} 3108 3109// SetSourceLanguageCode sets the SourceLanguageCode field's value. 3110func (s *TextTranslationJobProperties) SetSourceLanguageCode(v string) *TextTranslationJobProperties { 3111 s.SourceLanguageCode = &v 3112 return s 3113} 3114 3115// SetSubmittedTime sets the SubmittedTime field's value. 3116func (s *TextTranslationJobProperties) SetSubmittedTime(v time.Time) *TextTranslationJobProperties { 3117 s.SubmittedTime = &v 3118 return s 3119} 3120 3121// SetTargetLanguageCodes sets the TargetLanguageCodes field's value. 3122func (s *TextTranslationJobProperties) SetTargetLanguageCodes(v []*string) *TextTranslationJobProperties { 3123 s.TargetLanguageCodes = v 3124 return s 3125} 3126 3127// SetTerminologyNames sets the TerminologyNames field's value. 3128func (s *TextTranslationJobProperties) SetTerminologyNames(v []*string) *TextTranslationJobProperties { 3129 s.TerminologyNames = v 3130 return s 3131} 3132 3133// You have made too many requests within a short period of time. Wait for a 3134// short time and then try your request again. 3135type TooManyRequestsException struct { 3136 _ struct{} `type:"structure"` 3137 RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` 3138 3139 Message_ *string `locationName:"Message" type:"string"` 3140} 3141 3142// String returns the string representation 3143func (s TooManyRequestsException) String() string { 3144 return awsutil.Prettify(s) 3145} 3146 3147// GoString returns the string representation 3148func (s TooManyRequestsException) GoString() string { 3149 return s.String() 3150} 3151 3152func newErrorTooManyRequestsException(v protocol.ResponseMetadata) error { 3153 return &TooManyRequestsException{ 3154 RespMetadata: v, 3155 } 3156} 3157 3158// Code returns the exception type name. 3159func (s *TooManyRequestsException) Code() string { 3160 return "TooManyRequestsException" 3161} 3162 3163// Message returns the exception's message. 3164func (s *TooManyRequestsException) Message() string { 3165 if s.Message_ != nil { 3166 return *s.Message_ 3167 } 3168 return "" 3169} 3170 3171// OrigErr always returns nil, satisfies awserr.Error interface. 3172func (s *TooManyRequestsException) OrigErr() error { 3173 return nil 3174} 3175 3176func (s *TooManyRequestsException) Error() string { 3177 return fmt.Sprintf("%s: %s", s.Code(), s.Message()) 3178} 3179 3180// Status code returns the HTTP status code for the request's response error. 3181func (s *TooManyRequestsException) StatusCode() int { 3182 return s.RespMetadata.StatusCode 3183} 3184 3185// RequestID returns the service's response RequestID for request. 3186func (s *TooManyRequestsException) RequestID() string { 3187 return s.RespMetadata.RequestID 3188} 3189 3190// Amazon Translate does not support translation from the language of the source 3191// text into the requested target language. For more information, see how-to-error-msg. 3192type UnsupportedLanguagePairException struct { 3193 _ struct{} `type:"structure"` 3194 RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` 3195 3196 Message_ *string `locationName:"Message" type:"string"` 3197 3198 // The language code for the language of the input text. 3199 SourceLanguageCode *string `min:"2" type:"string"` 3200 3201 // The language code for the language of the translated text. 3202 TargetLanguageCode *string `min:"2" type:"string"` 3203} 3204 3205// String returns the string representation 3206func (s UnsupportedLanguagePairException) String() string { 3207 return awsutil.Prettify(s) 3208} 3209 3210// GoString returns the string representation 3211func (s UnsupportedLanguagePairException) GoString() string { 3212 return s.String() 3213} 3214 3215func newErrorUnsupportedLanguagePairException(v protocol.ResponseMetadata) error { 3216 return &UnsupportedLanguagePairException{ 3217 RespMetadata: v, 3218 } 3219} 3220 3221// Code returns the exception type name. 3222func (s *UnsupportedLanguagePairException) Code() string { 3223 return "UnsupportedLanguagePairException" 3224} 3225 3226// Message returns the exception's message. 3227func (s *UnsupportedLanguagePairException) Message() string { 3228 if s.Message_ != nil { 3229 return *s.Message_ 3230 } 3231 return "" 3232} 3233 3234// OrigErr always returns nil, satisfies awserr.Error interface. 3235func (s *UnsupportedLanguagePairException) OrigErr() error { 3236 return nil 3237} 3238 3239func (s *UnsupportedLanguagePairException) Error() string { 3240 return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) 3241} 3242 3243// Status code returns the HTTP status code for the request's response error. 3244func (s *UnsupportedLanguagePairException) StatusCode() int { 3245 return s.RespMetadata.StatusCode 3246} 3247 3248// RequestID returns the service's response RequestID for request. 3249func (s *UnsupportedLanguagePairException) RequestID() string { 3250 return s.RespMetadata.RequestID 3251} 3252 3253const ( 3254 // EncryptionKeyTypeKms is a EncryptionKeyType enum value 3255 EncryptionKeyTypeKms = "KMS" 3256) 3257 3258const ( 3259 // JobStatusSubmitted is a JobStatus enum value 3260 JobStatusSubmitted = "SUBMITTED" 3261 3262 // JobStatusInProgress is a JobStatus enum value 3263 JobStatusInProgress = "IN_PROGRESS" 3264 3265 // JobStatusCompleted is a JobStatus enum value 3266 JobStatusCompleted = "COMPLETED" 3267 3268 // JobStatusCompletedWithError is a JobStatus enum value 3269 JobStatusCompletedWithError = "COMPLETED_WITH_ERROR" 3270 3271 // JobStatusFailed is a JobStatus enum value 3272 JobStatusFailed = "FAILED" 3273 3274 // JobStatusStopRequested is a JobStatus enum value 3275 JobStatusStopRequested = "STOP_REQUESTED" 3276 3277 // JobStatusStopped is a JobStatus enum value 3278 JobStatusStopped = "STOPPED" 3279) 3280 3281const ( 3282 // MergeStrategyOverwrite is a MergeStrategy enum value 3283 MergeStrategyOverwrite = "OVERWRITE" 3284) 3285 3286const ( 3287 // TerminologyDataFormatCsv is a TerminologyDataFormat enum value 3288 TerminologyDataFormatCsv = "CSV" 3289 3290 // TerminologyDataFormatTmx is a TerminologyDataFormat enum value 3291 TerminologyDataFormatTmx = "TMX" 3292) 3293