1// Code generated by smithy-go-codegen DO NOT EDIT. 2 3package comprehend 4 5import ( 6 "bytes" 7 "context" 8 "encoding/json" 9 "fmt" 10 "github.com/aws/aws-sdk-go-v2/aws/protocol/restjson" 11 "github.com/aws/aws-sdk-go-v2/service/comprehend/types" 12 smithy "github.com/aws/smithy-go" 13 smithyio "github.com/aws/smithy-go/io" 14 "github.com/aws/smithy-go/middleware" 15 "github.com/aws/smithy-go/ptr" 16 smithytime "github.com/aws/smithy-go/time" 17 smithyhttp "github.com/aws/smithy-go/transport/http" 18 "io" 19 "strings" 20) 21 22type awsAwsjson11_deserializeOpBatchDetectDominantLanguage struct { 23} 24 25func (*awsAwsjson11_deserializeOpBatchDetectDominantLanguage) ID() string { 26 return "OperationDeserializer" 27} 28 29func (m *awsAwsjson11_deserializeOpBatchDetectDominantLanguage) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 30 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 31) { 32 out, metadata, err = next.HandleDeserialize(ctx, in) 33 if err != nil { 34 return out, metadata, err 35 } 36 37 response, ok := out.RawResponse.(*smithyhttp.Response) 38 if !ok { 39 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 40 } 41 42 if response.StatusCode < 200 || response.StatusCode >= 300 { 43 return out, metadata, awsAwsjson11_deserializeOpErrorBatchDetectDominantLanguage(response, &metadata) 44 } 45 output := &BatchDetectDominantLanguageOutput{} 46 out.Result = output 47 48 var buff [1024]byte 49 ringBuffer := smithyio.NewRingBuffer(buff[:]) 50 51 body := io.TeeReader(response.Body, ringBuffer) 52 decoder := json.NewDecoder(body) 53 decoder.UseNumber() 54 var shape interface{} 55 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 56 var snapshot bytes.Buffer 57 io.Copy(&snapshot, ringBuffer) 58 err = &smithy.DeserializationError{ 59 Err: fmt.Errorf("failed to decode response body, %w", err), 60 Snapshot: snapshot.Bytes(), 61 } 62 return out, metadata, err 63 } 64 65 err = awsAwsjson11_deserializeOpDocumentBatchDetectDominantLanguageOutput(&output, shape) 66 if err != nil { 67 var snapshot bytes.Buffer 68 io.Copy(&snapshot, ringBuffer) 69 err = &smithy.DeserializationError{ 70 Err: fmt.Errorf("failed to decode response body, %w", err), 71 Snapshot: snapshot.Bytes(), 72 } 73 return out, metadata, err 74 } 75 76 return out, metadata, err 77} 78 79func awsAwsjson11_deserializeOpErrorBatchDetectDominantLanguage(response *smithyhttp.Response, metadata *middleware.Metadata) error { 80 var errorBuffer bytes.Buffer 81 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 82 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 83 } 84 errorBody := bytes.NewReader(errorBuffer.Bytes()) 85 86 errorCode := "UnknownError" 87 errorMessage := errorCode 88 89 code := response.Header.Get("X-Amzn-ErrorType") 90 if len(code) != 0 { 91 errorCode = restjson.SanitizeErrorCode(code) 92 } 93 94 var buff [1024]byte 95 ringBuffer := smithyio.NewRingBuffer(buff[:]) 96 97 body := io.TeeReader(errorBody, ringBuffer) 98 decoder := json.NewDecoder(body) 99 decoder.UseNumber() 100 code, message, err := restjson.GetErrorInfo(decoder) 101 if err != nil { 102 var snapshot bytes.Buffer 103 io.Copy(&snapshot, ringBuffer) 104 err = &smithy.DeserializationError{ 105 Err: fmt.Errorf("failed to decode response body, %w", err), 106 Snapshot: snapshot.Bytes(), 107 } 108 return err 109 } 110 111 errorBody.Seek(0, io.SeekStart) 112 if len(code) != 0 { 113 errorCode = restjson.SanitizeErrorCode(code) 114 } 115 if len(message) != 0 { 116 errorMessage = message 117 } 118 119 switch { 120 case strings.EqualFold("BatchSizeLimitExceededException", errorCode): 121 return awsAwsjson11_deserializeErrorBatchSizeLimitExceededException(response, errorBody) 122 123 case strings.EqualFold("InternalServerException", errorCode): 124 return awsAwsjson11_deserializeErrorInternalServerException(response, errorBody) 125 126 case strings.EqualFold("InvalidRequestException", errorCode): 127 return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody) 128 129 case strings.EqualFold("TextSizeLimitExceededException", errorCode): 130 return awsAwsjson11_deserializeErrorTextSizeLimitExceededException(response, errorBody) 131 132 default: 133 genericError := &smithy.GenericAPIError{ 134 Code: errorCode, 135 Message: errorMessage, 136 } 137 return genericError 138 139 } 140} 141 142type awsAwsjson11_deserializeOpBatchDetectEntities struct { 143} 144 145func (*awsAwsjson11_deserializeOpBatchDetectEntities) ID() string { 146 return "OperationDeserializer" 147} 148 149func (m *awsAwsjson11_deserializeOpBatchDetectEntities) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 150 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 151) { 152 out, metadata, err = next.HandleDeserialize(ctx, in) 153 if err != nil { 154 return out, metadata, err 155 } 156 157 response, ok := out.RawResponse.(*smithyhttp.Response) 158 if !ok { 159 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 160 } 161 162 if response.StatusCode < 200 || response.StatusCode >= 300 { 163 return out, metadata, awsAwsjson11_deserializeOpErrorBatchDetectEntities(response, &metadata) 164 } 165 output := &BatchDetectEntitiesOutput{} 166 out.Result = output 167 168 var buff [1024]byte 169 ringBuffer := smithyio.NewRingBuffer(buff[:]) 170 171 body := io.TeeReader(response.Body, ringBuffer) 172 decoder := json.NewDecoder(body) 173 decoder.UseNumber() 174 var shape interface{} 175 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 176 var snapshot bytes.Buffer 177 io.Copy(&snapshot, ringBuffer) 178 err = &smithy.DeserializationError{ 179 Err: fmt.Errorf("failed to decode response body, %w", err), 180 Snapshot: snapshot.Bytes(), 181 } 182 return out, metadata, err 183 } 184 185 err = awsAwsjson11_deserializeOpDocumentBatchDetectEntitiesOutput(&output, shape) 186 if err != nil { 187 var snapshot bytes.Buffer 188 io.Copy(&snapshot, ringBuffer) 189 err = &smithy.DeserializationError{ 190 Err: fmt.Errorf("failed to decode response body, %w", err), 191 Snapshot: snapshot.Bytes(), 192 } 193 return out, metadata, err 194 } 195 196 return out, metadata, err 197} 198 199func awsAwsjson11_deserializeOpErrorBatchDetectEntities(response *smithyhttp.Response, metadata *middleware.Metadata) error { 200 var errorBuffer bytes.Buffer 201 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 202 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 203 } 204 errorBody := bytes.NewReader(errorBuffer.Bytes()) 205 206 errorCode := "UnknownError" 207 errorMessage := errorCode 208 209 code := response.Header.Get("X-Amzn-ErrorType") 210 if len(code) != 0 { 211 errorCode = restjson.SanitizeErrorCode(code) 212 } 213 214 var buff [1024]byte 215 ringBuffer := smithyio.NewRingBuffer(buff[:]) 216 217 body := io.TeeReader(errorBody, ringBuffer) 218 decoder := json.NewDecoder(body) 219 decoder.UseNumber() 220 code, message, err := restjson.GetErrorInfo(decoder) 221 if err != nil { 222 var snapshot bytes.Buffer 223 io.Copy(&snapshot, ringBuffer) 224 err = &smithy.DeserializationError{ 225 Err: fmt.Errorf("failed to decode response body, %w", err), 226 Snapshot: snapshot.Bytes(), 227 } 228 return err 229 } 230 231 errorBody.Seek(0, io.SeekStart) 232 if len(code) != 0 { 233 errorCode = restjson.SanitizeErrorCode(code) 234 } 235 if len(message) != 0 { 236 errorMessage = message 237 } 238 239 switch { 240 case strings.EqualFold("BatchSizeLimitExceededException", errorCode): 241 return awsAwsjson11_deserializeErrorBatchSizeLimitExceededException(response, errorBody) 242 243 case strings.EqualFold("InternalServerException", errorCode): 244 return awsAwsjson11_deserializeErrorInternalServerException(response, errorBody) 245 246 case strings.EqualFold("InvalidRequestException", errorCode): 247 return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody) 248 249 case strings.EqualFold("TextSizeLimitExceededException", errorCode): 250 return awsAwsjson11_deserializeErrorTextSizeLimitExceededException(response, errorBody) 251 252 case strings.EqualFold("UnsupportedLanguageException", errorCode): 253 return awsAwsjson11_deserializeErrorUnsupportedLanguageException(response, errorBody) 254 255 default: 256 genericError := &smithy.GenericAPIError{ 257 Code: errorCode, 258 Message: errorMessage, 259 } 260 return genericError 261 262 } 263} 264 265type awsAwsjson11_deserializeOpBatchDetectKeyPhrases struct { 266} 267 268func (*awsAwsjson11_deserializeOpBatchDetectKeyPhrases) ID() string { 269 return "OperationDeserializer" 270} 271 272func (m *awsAwsjson11_deserializeOpBatchDetectKeyPhrases) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 273 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 274) { 275 out, metadata, err = next.HandleDeserialize(ctx, in) 276 if err != nil { 277 return out, metadata, err 278 } 279 280 response, ok := out.RawResponse.(*smithyhttp.Response) 281 if !ok { 282 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 283 } 284 285 if response.StatusCode < 200 || response.StatusCode >= 300 { 286 return out, metadata, awsAwsjson11_deserializeOpErrorBatchDetectKeyPhrases(response, &metadata) 287 } 288 output := &BatchDetectKeyPhrasesOutput{} 289 out.Result = output 290 291 var buff [1024]byte 292 ringBuffer := smithyio.NewRingBuffer(buff[:]) 293 294 body := io.TeeReader(response.Body, ringBuffer) 295 decoder := json.NewDecoder(body) 296 decoder.UseNumber() 297 var shape interface{} 298 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 299 var snapshot bytes.Buffer 300 io.Copy(&snapshot, ringBuffer) 301 err = &smithy.DeserializationError{ 302 Err: fmt.Errorf("failed to decode response body, %w", err), 303 Snapshot: snapshot.Bytes(), 304 } 305 return out, metadata, err 306 } 307 308 err = awsAwsjson11_deserializeOpDocumentBatchDetectKeyPhrasesOutput(&output, shape) 309 if err != nil { 310 var snapshot bytes.Buffer 311 io.Copy(&snapshot, ringBuffer) 312 err = &smithy.DeserializationError{ 313 Err: fmt.Errorf("failed to decode response body, %w", err), 314 Snapshot: snapshot.Bytes(), 315 } 316 return out, metadata, err 317 } 318 319 return out, metadata, err 320} 321 322func awsAwsjson11_deserializeOpErrorBatchDetectKeyPhrases(response *smithyhttp.Response, metadata *middleware.Metadata) error { 323 var errorBuffer bytes.Buffer 324 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 325 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 326 } 327 errorBody := bytes.NewReader(errorBuffer.Bytes()) 328 329 errorCode := "UnknownError" 330 errorMessage := errorCode 331 332 code := response.Header.Get("X-Amzn-ErrorType") 333 if len(code) != 0 { 334 errorCode = restjson.SanitizeErrorCode(code) 335 } 336 337 var buff [1024]byte 338 ringBuffer := smithyio.NewRingBuffer(buff[:]) 339 340 body := io.TeeReader(errorBody, ringBuffer) 341 decoder := json.NewDecoder(body) 342 decoder.UseNumber() 343 code, message, err := restjson.GetErrorInfo(decoder) 344 if err != nil { 345 var snapshot bytes.Buffer 346 io.Copy(&snapshot, ringBuffer) 347 err = &smithy.DeserializationError{ 348 Err: fmt.Errorf("failed to decode response body, %w", err), 349 Snapshot: snapshot.Bytes(), 350 } 351 return err 352 } 353 354 errorBody.Seek(0, io.SeekStart) 355 if len(code) != 0 { 356 errorCode = restjson.SanitizeErrorCode(code) 357 } 358 if len(message) != 0 { 359 errorMessage = message 360 } 361 362 switch { 363 case strings.EqualFold("BatchSizeLimitExceededException", errorCode): 364 return awsAwsjson11_deserializeErrorBatchSizeLimitExceededException(response, errorBody) 365 366 case strings.EqualFold("InternalServerException", errorCode): 367 return awsAwsjson11_deserializeErrorInternalServerException(response, errorBody) 368 369 case strings.EqualFold("InvalidRequestException", errorCode): 370 return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody) 371 372 case strings.EqualFold("TextSizeLimitExceededException", errorCode): 373 return awsAwsjson11_deserializeErrorTextSizeLimitExceededException(response, errorBody) 374 375 case strings.EqualFold("UnsupportedLanguageException", errorCode): 376 return awsAwsjson11_deserializeErrorUnsupportedLanguageException(response, errorBody) 377 378 default: 379 genericError := &smithy.GenericAPIError{ 380 Code: errorCode, 381 Message: errorMessage, 382 } 383 return genericError 384 385 } 386} 387 388type awsAwsjson11_deserializeOpBatchDetectSentiment struct { 389} 390 391func (*awsAwsjson11_deserializeOpBatchDetectSentiment) ID() string { 392 return "OperationDeserializer" 393} 394 395func (m *awsAwsjson11_deserializeOpBatchDetectSentiment) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 396 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 397) { 398 out, metadata, err = next.HandleDeserialize(ctx, in) 399 if err != nil { 400 return out, metadata, err 401 } 402 403 response, ok := out.RawResponse.(*smithyhttp.Response) 404 if !ok { 405 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 406 } 407 408 if response.StatusCode < 200 || response.StatusCode >= 300 { 409 return out, metadata, awsAwsjson11_deserializeOpErrorBatchDetectSentiment(response, &metadata) 410 } 411 output := &BatchDetectSentimentOutput{} 412 out.Result = output 413 414 var buff [1024]byte 415 ringBuffer := smithyio.NewRingBuffer(buff[:]) 416 417 body := io.TeeReader(response.Body, ringBuffer) 418 decoder := json.NewDecoder(body) 419 decoder.UseNumber() 420 var shape interface{} 421 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 422 var snapshot bytes.Buffer 423 io.Copy(&snapshot, ringBuffer) 424 err = &smithy.DeserializationError{ 425 Err: fmt.Errorf("failed to decode response body, %w", err), 426 Snapshot: snapshot.Bytes(), 427 } 428 return out, metadata, err 429 } 430 431 err = awsAwsjson11_deserializeOpDocumentBatchDetectSentimentOutput(&output, shape) 432 if err != nil { 433 var snapshot bytes.Buffer 434 io.Copy(&snapshot, ringBuffer) 435 err = &smithy.DeserializationError{ 436 Err: fmt.Errorf("failed to decode response body, %w", err), 437 Snapshot: snapshot.Bytes(), 438 } 439 return out, metadata, err 440 } 441 442 return out, metadata, err 443} 444 445func awsAwsjson11_deserializeOpErrorBatchDetectSentiment(response *smithyhttp.Response, metadata *middleware.Metadata) error { 446 var errorBuffer bytes.Buffer 447 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 448 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 449 } 450 errorBody := bytes.NewReader(errorBuffer.Bytes()) 451 452 errorCode := "UnknownError" 453 errorMessage := errorCode 454 455 code := response.Header.Get("X-Amzn-ErrorType") 456 if len(code) != 0 { 457 errorCode = restjson.SanitizeErrorCode(code) 458 } 459 460 var buff [1024]byte 461 ringBuffer := smithyio.NewRingBuffer(buff[:]) 462 463 body := io.TeeReader(errorBody, ringBuffer) 464 decoder := json.NewDecoder(body) 465 decoder.UseNumber() 466 code, message, err := restjson.GetErrorInfo(decoder) 467 if err != nil { 468 var snapshot bytes.Buffer 469 io.Copy(&snapshot, ringBuffer) 470 err = &smithy.DeserializationError{ 471 Err: fmt.Errorf("failed to decode response body, %w", err), 472 Snapshot: snapshot.Bytes(), 473 } 474 return err 475 } 476 477 errorBody.Seek(0, io.SeekStart) 478 if len(code) != 0 { 479 errorCode = restjson.SanitizeErrorCode(code) 480 } 481 if len(message) != 0 { 482 errorMessage = message 483 } 484 485 switch { 486 case strings.EqualFold("BatchSizeLimitExceededException", errorCode): 487 return awsAwsjson11_deserializeErrorBatchSizeLimitExceededException(response, errorBody) 488 489 case strings.EqualFold("InternalServerException", errorCode): 490 return awsAwsjson11_deserializeErrorInternalServerException(response, errorBody) 491 492 case strings.EqualFold("InvalidRequestException", errorCode): 493 return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody) 494 495 case strings.EqualFold("TextSizeLimitExceededException", errorCode): 496 return awsAwsjson11_deserializeErrorTextSizeLimitExceededException(response, errorBody) 497 498 case strings.EqualFold("UnsupportedLanguageException", errorCode): 499 return awsAwsjson11_deserializeErrorUnsupportedLanguageException(response, errorBody) 500 501 default: 502 genericError := &smithy.GenericAPIError{ 503 Code: errorCode, 504 Message: errorMessage, 505 } 506 return genericError 507 508 } 509} 510 511type awsAwsjson11_deserializeOpBatchDetectSyntax struct { 512} 513 514func (*awsAwsjson11_deserializeOpBatchDetectSyntax) ID() string { 515 return "OperationDeserializer" 516} 517 518func (m *awsAwsjson11_deserializeOpBatchDetectSyntax) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 519 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 520) { 521 out, metadata, err = next.HandleDeserialize(ctx, in) 522 if err != nil { 523 return out, metadata, err 524 } 525 526 response, ok := out.RawResponse.(*smithyhttp.Response) 527 if !ok { 528 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 529 } 530 531 if response.StatusCode < 200 || response.StatusCode >= 300 { 532 return out, metadata, awsAwsjson11_deserializeOpErrorBatchDetectSyntax(response, &metadata) 533 } 534 output := &BatchDetectSyntaxOutput{} 535 out.Result = output 536 537 var buff [1024]byte 538 ringBuffer := smithyio.NewRingBuffer(buff[:]) 539 540 body := io.TeeReader(response.Body, ringBuffer) 541 decoder := json.NewDecoder(body) 542 decoder.UseNumber() 543 var shape interface{} 544 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 545 var snapshot bytes.Buffer 546 io.Copy(&snapshot, ringBuffer) 547 err = &smithy.DeserializationError{ 548 Err: fmt.Errorf("failed to decode response body, %w", err), 549 Snapshot: snapshot.Bytes(), 550 } 551 return out, metadata, err 552 } 553 554 err = awsAwsjson11_deserializeOpDocumentBatchDetectSyntaxOutput(&output, shape) 555 if err != nil { 556 var snapshot bytes.Buffer 557 io.Copy(&snapshot, ringBuffer) 558 err = &smithy.DeserializationError{ 559 Err: fmt.Errorf("failed to decode response body, %w", err), 560 Snapshot: snapshot.Bytes(), 561 } 562 return out, metadata, err 563 } 564 565 return out, metadata, err 566} 567 568func awsAwsjson11_deserializeOpErrorBatchDetectSyntax(response *smithyhttp.Response, metadata *middleware.Metadata) error { 569 var errorBuffer bytes.Buffer 570 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 571 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 572 } 573 errorBody := bytes.NewReader(errorBuffer.Bytes()) 574 575 errorCode := "UnknownError" 576 errorMessage := errorCode 577 578 code := response.Header.Get("X-Amzn-ErrorType") 579 if len(code) != 0 { 580 errorCode = restjson.SanitizeErrorCode(code) 581 } 582 583 var buff [1024]byte 584 ringBuffer := smithyio.NewRingBuffer(buff[:]) 585 586 body := io.TeeReader(errorBody, ringBuffer) 587 decoder := json.NewDecoder(body) 588 decoder.UseNumber() 589 code, message, err := restjson.GetErrorInfo(decoder) 590 if err != nil { 591 var snapshot bytes.Buffer 592 io.Copy(&snapshot, ringBuffer) 593 err = &smithy.DeserializationError{ 594 Err: fmt.Errorf("failed to decode response body, %w", err), 595 Snapshot: snapshot.Bytes(), 596 } 597 return err 598 } 599 600 errorBody.Seek(0, io.SeekStart) 601 if len(code) != 0 { 602 errorCode = restjson.SanitizeErrorCode(code) 603 } 604 if len(message) != 0 { 605 errorMessage = message 606 } 607 608 switch { 609 case strings.EqualFold("BatchSizeLimitExceededException", errorCode): 610 return awsAwsjson11_deserializeErrorBatchSizeLimitExceededException(response, errorBody) 611 612 case strings.EqualFold("InternalServerException", errorCode): 613 return awsAwsjson11_deserializeErrorInternalServerException(response, errorBody) 614 615 case strings.EqualFold("InvalidRequestException", errorCode): 616 return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody) 617 618 case strings.EqualFold("TextSizeLimitExceededException", errorCode): 619 return awsAwsjson11_deserializeErrorTextSizeLimitExceededException(response, errorBody) 620 621 case strings.EqualFold("UnsupportedLanguageException", errorCode): 622 return awsAwsjson11_deserializeErrorUnsupportedLanguageException(response, errorBody) 623 624 default: 625 genericError := &smithy.GenericAPIError{ 626 Code: errorCode, 627 Message: errorMessage, 628 } 629 return genericError 630 631 } 632} 633 634type awsAwsjson11_deserializeOpClassifyDocument struct { 635} 636 637func (*awsAwsjson11_deserializeOpClassifyDocument) ID() string { 638 return "OperationDeserializer" 639} 640 641func (m *awsAwsjson11_deserializeOpClassifyDocument) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 642 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 643) { 644 out, metadata, err = next.HandleDeserialize(ctx, in) 645 if err != nil { 646 return out, metadata, err 647 } 648 649 response, ok := out.RawResponse.(*smithyhttp.Response) 650 if !ok { 651 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 652 } 653 654 if response.StatusCode < 200 || response.StatusCode >= 300 { 655 return out, metadata, awsAwsjson11_deserializeOpErrorClassifyDocument(response, &metadata) 656 } 657 output := &ClassifyDocumentOutput{} 658 out.Result = output 659 660 var buff [1024]byte 661 ringBuffer := smithyio.NewRingBuffer(buff[:]) 662 663 body := io.TeeReader(response.Body, ringBuffer) 664 decoder := json.NewDecoder(body) 665 decoder.UseNumber() 666 var shape interface{} 667 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 668 var snapshot bytes.Buffer 669 io.Copy(&snapshot, ringBuffer) 670 err = &smithy.DeserializationError{ 671 Err: fmt.Errorf("failed to decode response body, %w", err), 672 Snapshot: snapshot.Bytes(), 673 } 674 return out, metadata, err 675 } 676 677 err = awsAwsjson11_deserializeOpDocumentClassifyDocumentOutput(&output, shape) 678 if err != nil { 679 var snapshot bytes.Buffer 680 io.Copy(&snapshot, ringBuffer) 681 err = &smithy.DeserializationError{ 682 Err: fmt.Errorf("failed to decode response body, %w", err), 683 Snapshot: snapshot.Bytes(), 684 } 685 return out, metadata, err 686 } 687 688 return out, metadata, err 689} 690 691func awsAwsjson11_deserializeOpErrorClassifyDocument(response *smithyhttp.Response, metadata *middleware.Metadata) error { 692 var errorBuffer bytes.Buffer 693 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 694 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 695 } 696 errorBody := bytes.NewReader(errorBuffer.Bytes()) 697 698 errorCode := "UnknownError" 699 errorMessage := errorCode 700 701 code := response.Header.Get("X-Amzn-ErrorType") 702 if len(code) != 0 { 703 errorCode = restjson.SanitizeErrorCode(code) 704 } 705 706 var buff [1024]byte 707 ringBuffer := smithyio.NewRingBuffer(buff[:]) 708 709 body := io.TeeReader(errorBody, ringBuffer) 710 decoder := json.NewDecoder(body) 711 decoder.UseNumber() 712 code, message, err := restjson.GetErrorInfo(decoder) 713 if err != nil { 714 var snapshot bytes.Buffer 715 io.Copy(&snapshot, ringBuffer) 716 err = &smithy.DeserializationError{ 717 Err: fmt.Errorf("failed to decode response body, %w", err), 718 Snapshot: snapshot.Bytes(), 719 } 720 return err 721 } 722 723 errorBody.Seek(0, io.SeekStart) 724 if len(code) != 0 { 725 errorCode = restjson.SanitizeErrorCode(code) 726 } 727 if len(message) != 0 { 728 errorMessage = message 729 } 730 731 switch { 732 case strings.EqualFold("InternalServerException", errorCode): 733 return awsAwsjson11_deserializeErrorInternalServerException(response, errorBody) 734 735 case strings.EqualFold("InvalidRequestException", errorCode): 736 return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody) 737 738 case strings.EqualFold("ResourceUnavailableException", errorCode): 739 return awsAwsjson11_deserializeErrorResourceUnavailableException(response, errorBody) 740 741 case strings.EqualFold("TextSizeLimitExceededException", errorCode): 742 return awsAwsjson11_deserializeErrorTextSizeLimitExceededException(response, errorBody) 743 744 default: 745 genericError := &smithy.GenericAPIError{ 746 Code: errorCode, 747 Message: errorMessage, 748 } 749 return genericError 750 751 } 752} 753 754type awsAwsjson11_deserializeOpCreateDocumentClassifier struct { 755} 756 757func (*awsAwsjson11_deserializeOpCreateDocumentClassifier) ID() string { 758 return "OperationDeserializer" 759} 760 761func (m *awsAwsjson11_deserializeOpCreateDocumentClassifier) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 762 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 763) { 764 out, metadata, err = next.HandleDeserialize(ctx, in) 765 if err != nil { 766 return out, metadata, err 767 } 768 769 response, ok := out.RawResponse.(*smithyhttp.Response) 770 if !ok { 771 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 772 } 773 774 if response.StatusCode < 200 || response.StatusCode >= 300 { 775 return out, metadata, awsAwsjson11_deserializeOpErrorCreateDocumentClassifier(response, &metadata) 776 } 777 output := &CreateDocumentClassifierOutput{} 778 out.Result = output 779 780 var buff [1024]byte 781 ringBuffer := smithyio.NewRingBuffer(buff[:]) 782 783 body := io.TeeReader(response.Body, ringBuffer) 784 decoder := json.NewDecoder(body) 785 decoder.UseNumber() 786 var shape interface{} 787 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 788 var snapshot bytes.Buffer 789 io.Copy(&snapshot, ringBuffer) 790 err = &smithy.DeserializationError{ 791 Err: fmt.Errorf("failed to decode response body, %w", err), 792 Snapshot: snapshot.Bytes(), 793 } 794 return out, metadata, err 795 } 796 797 err = awsAwsjson11_deserializeOpDocumentCreateDocumentClassifierOutput(&output, shape) 798 if err != nil { 799 var snapshot bytes.Buffer 800 io.Copy(&snapshot, ringBuffer) 801 err = &smithy.DeserializationError{ 802 Err: fmt.Errorf("failed to decode response body, %w", err), 803 Snapshot: snapshot.Bytes(), 804 } 805 return out, metadata, err 806 } 807 808 return out, metadata, err 809} 810 811func awsAwsjson11_deserializeOpErrorCreateDocumentClassifier(response *smithyhttp.Response, metadata *middleware.Metadata) error { 812 var errorBuffer bytes.Buffer 813 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 814 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 815 } 816 errorBody := bytes.NewReader(errorBuffer.Bytes()) 817 818 errorCode := "UnknownError" 819 errorMessage := errorCode 820 821 code := response.Header.Get("X-Amzn-ErrorType") 822 if len(code) != 0 { 823 errorCode = restjson.SanitizeErrorCode(code) 824 } 825 826 var buff [1024]byte 827 ringBuffer := smithyio.NewRingBuffer(buff[:]) 828 829 body := io.TeeReader(errorBody, ringBuffer) 830 decoder := json.NewDecoder(body) 831 decoder.UseNumber() 832 code, message, err := restjson.GetErrorInfo(decoder) 833 if err != nil { 834 var snapshot bytes.Buffer 835 io.Copy(&snapshot, ringBuffer) 836 err = &smithy.DeserializationError{ 837 Err: fmt.Errorf("failed to decode response body, %w", err), 838 Snapshot: snapshot.Bytes(), 839 } 840 return err 841 } 842 843 errorBody.Seek(0, io.SeekStart) 844 if len(code) != 0 { 845 errorCode = restjson.SanitizeErrorCode(code) 846 } 847 if len(message) != 0 { 848 errorMessage = message 849 } 850 851 switch { 852 case strings.EqualFold("InternalServerException", errorCode): 853 return awsAwsjson11_deserializeErrorInternalServerException(response, errorBody) 854 855 case strings.EqualFold("InvalidRequestException", errorCode): 856 return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody) 857 858 case strings.EqualFold("KmsKeyValidationException", errorCode): 859 return awsAwsjson11_deserializeErrorKmsKeyValidationException(response, errorBody) 860 861 case strings.EqualFold("ResourceInUseException", errorCode): 862 return awsAwsjson11_deserializeErrorResourceInUseException(response, errorBody) 863 864 case strings.EqualFold("ResourceLimitExceededException", errorCode): 865 return awsAwsjson11_deserializeErrorResourceLimitExceededException(response, errorBody) 866 867 case strings.EqualFold("TooManyRequestsException", errorCode): 868 return awsAwsjson11_deserializeErrorTooManyRequestsException(response, errorBody) 869 870 case strings.EqualFold("TooManyTagsException", errorCode): 871 return awsAwsjson11_deserializeErrorTooManyTagsException(response, errorBody) 872 873 case strings.EqualFold("UnsupportedLanguageException", errorCode): 874 return awsAwsjson11_deserializeErrorUnsupportedLanguageException(response, errorBody) 875 876 default: 877 genericError := &smithy.GenericAPIError{ 878 Code: errorCode, 879 Message: errorMessage, 880 } 881 return genericError 882 883 } 884} 885 886type awsAwsjson11_deserializeOpCreateEndpoint struct { 887} 888 889func (*awsAwsjson11_deserializeOpCreateEndpoint) ID() string { 890 return "OperationDeserializer" 891} 892 893func (m *awsAwsjson11_deserializeOpCreateEndpoint) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 894 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 895) { 896 out, metadata, err = next.HandleDeserialize(ctx, in) 897 if err != nil { 898 return out, metadata, err 899 } 900 901 response, ok := out.RawResponse.(*smithyhttp.Response) 902 if !ok { 903 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 904 } 905 906 if response.StatusCode < 200 || response.StatusCode >= 300 { 907 return out, metadata, awsAwsjson11_deserializeOpErrorCreateEndpoint(response, &metadata) 908 } 909 output := &CreateEndpointOutput{} 910 out.Result = output 911 912 var buff [1024]byte 913 ringBuffer := smithyio.NewRingBuffer(buff[:]) 914 915 body := io.TeeReader(response.Body, ringBuffer) 916 decoder := json.NewDecoder(body) 917 decoder.UseNumber() 918 var shape interface{} 919 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 920 var snapshot bytes.Buffer 921 io.Copy(&snapshot, ringBuffer) 922 err = &smithy.DeserializationError{ 923 Err: fmt.Errorf("failed to decode response body, %w", err), 924 Snapshot: snapshot.Bytes(), 925 } 926 return out, metadata, err 927 } 928 929 err = awsAwsjson11_deserializeOpDocumentCreateEndpointOutput(&output, shape) 930 if err != nil { 931 var snapshot bytes.Buffer 932 io.Copy(&snapshot, ringBuffer) 933 err = &smithy.DeserializationError{ 934 Err: fmt.Errorf("failed to decode response body, %w", err), 935 Snapshot: snapshot.Bytes(), 936 } 937 return out, metadata, err 938 } 939 940 return out, metadata, err 941} 942 943func awsAwsjson11_deserializeOpErrorCreateEndpoint(response *smithyhttp.Response, metadata *middleware.Metadata) error { 944 var errorBuffer bytes.Buffer 945 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 946 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 947 } 948 errorBody := bytes.NewReader(errorBuffer.Bytes()) 949 950 errorCode := "UnknownError" 951 errorMessage := errorCode 952 953 code := response.Header.Get("X-Amzn-ErrorType") 954 if len(code) != 0 { 955 errorCode = restjson.SanitizeErrorCode(code) 956 } 957 958 var buff [1024]byte 959 ringBuffer := smithyio.NewRingBuffer(buff[:]) 960 961 body := io.TeeReader(errorBody, ringBuffer) 962 decoder := json.NewDecoder(body) 963 decoder.UseNumber() 964 code, message, err := restjson.GetErrorInfo(decoder) 965 if err != nil { 966 var snapshot bytes.Buffer 967 io.Copy(&snapshot, ringBuffer) 968 err = &smithy.DeserializationError{ 969 Err: fmt.Errorf("failed to decode response body, %w", err), 970 Snapshot: snapshot.Bytes(), 971 } 972 return err 973 } 974 975 errorBody.Seek(0, io.SeekStart) 976 if len(code) != 0 { 977 errorCode = restjson.SanitizeErrorCode(code) 978 } 979 if len(message) != 0 { 980 errorMessage = message 981 } 982 983 switch { 984 case strings.EqualFold("InternalServerException", errorCode): 985 return awsAwsjson11_deserializeErrorInternalServerException(response, errorBody) 986 987 case strings.EqualFold("InvalidRequestException", errorCode): 988 return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody) 989 990 case strings.EqualFold("ResourceInUseException", errorCode): 991 return awsAwsjson11_deserializeErrorResourceInUseException(response, errorBody) 992 993 case strings.EqualFold("ResourceLimitExceededException", errorCode): 994 return awsAwsjson11_deserializeErrorResourceLimitExceededException(response, errorBody) 995 996 case strings.EqualFold("ResourceNotFoundException", errorCode): 997 return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) 998 999 case strings.EqualFold("ResourceUnavailableException", errorCode): 1000 return awsAwsjson11_deserializeErrorResourceUnavailableException(response, errorBody) 1001 1002 case strings.EqualFold("TooManyRequestsException", errorCode): 1003 return awsAwsjson11_deserializeErrorTooManyRequestsException(response, errorBody) 1004 1005 case strings.EqualFold("TooManyTagsException", errorCode): 1006 return awsAwsjson11_deserializeErrorTooManyTagsException(response, errorBody) 1007 1008 default: 1009 genericError := &smithy.GenericAPIError{ 1010 Code: errorCode, 1011 Message: errorMessage, 1012 } 1013 return genericError 1014 1015 } 1016} 1017 1018type awsAwsjson11_deserializeOpCreateEntityRecognizer struct { 1019} 1020 1021func (*awsAwsjson11_deserializeOpCreateEntityRecognizer) ID() string { 1022 return "OperationDeserializer" 1023} 1024 1025func (m *awsAwsjson11_deserializeOpCreateEntityRecognizer) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 1026 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 1027) { 1028 out, metadata, err = next.HandleDeserialize(ctx, in) 1029 if err != nil { 1030 return out, metadata, err 1031 } 1032 1033 response, ok := out.RawResponse.(*smithyhttp.Response) 1034 if !ok { 1035 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 1036 } 1037 1038 if response.StatusCode < 200 || response.StatusCode >= 300 { 1039 return out, metadata, awsAwsjson11_deserializeOpErrorCreateEntityRecognizer(response, &metadata) 1040 } 1041 output := &CreateEntityRecognizerOutput{} 1042 out.Result = output 1043 1044 var buff [1024]byte 1045 ringBuffer := smithyio.NewRingBuffer(buff[:]) 1046 1047 body := io.TeeReader(response.Body, ringBuffer) 1048 decoder := json.NewDecoder(body) 1049 decoder.UseNumber() 1050 var shape interface{} 1051 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 1052 var snapshot bytes.Buffer 1053 io.Copy(&snapshot, ringBuffer) 1054 err = &smithy.DeserializationError{ 1055 Err: fmt.Errorf("failed to decode response body, %w", err), 1056 Snapshot: snapshot.Bytes(), 1057 } 1058 return out, metadata, err 1059 } 1060 1061 err = awsAwsjson11_deserializeOpDocumentCreateEntityRecognizerOutput(&output, shape) 1062 if err != nil { 1063 var snapshot bytes.Buffer 1064 io.Copy(&snapshot, ringBuffer) 1065 err = &smithy.DeserializationError{ 1066 Err: fmt.Errorf("failed to decode response body, %w", err), 1067 Snapshot: snapshot.Bytes(), 1068 } 1069 return out, metadata, err 1070 } 1071 1072 return out, metadata, err 1073} 1074 1075func awsAwsjson11_deserializeOpErrorCreateEntityRecognizer(response *smithyhttp.Response, metadata *middleware.Metadata) error { 1076 var errorBuffer bytes.Buffer 1077 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 1078 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 1079 } 1080 errorBody := bytes.NewReader(errorBuffer.Bytes()) 1081 1082 errorCode := "UnknownError" 1083 errorMessage := errorCode 1084 1085 code := response.Header.Get("X-Amzn-ErrorType") 1086 if len(code) != 0 { 1087 errorCode = restjson.SanitizeErrorCode(code) 1088 } 1089 1090 var buff [1024]byte 1091 ringBuffer := smithyio.NewRingBuffer(buff[:]) 1092 1093 body := io.TeeReader(errorBody, ringBuffer) 1094 decoder := json.NewDecoder(body) 1095 decoder.UseNumber() 1096 code, message, err := restjson.GetErrorInfo(decoder) 1097 if err != nil { 1098 var snapshot bytes.Buffer 1099 io.Copy(&snapshot, ringBuffer) 1100 err = &smithy.DeserializationError{ 1101 Err: fmt.Errorf("failed to decode response body, %w", err), 1102 Snapshot: snapshot.Bytes(), 1103 } 1104 return err 1105 } 1106 1107 errorBody.Seek(0, io.SeekStart) 1108 if len(code) != 0 { 1109 errorCode = restjson.SanitizeErrorCode(code) 1110 } 1111 if len(message) != 0 { 1112 errorMessage = message 1113 } 1114 1115 switch { 1116 case strings.EqualFold("InternalServerException", errorCode): 1117 return awsAwsjson11_deserializeErrorInternalServerException(response, errorBody) 1118 1119 case strings.EqualFold("InvalidRequestException", errorCode): 1120 return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody) 1121 1122 case strings.EqualFold("KmsKeyValidationException", errorCode): 1123 return awsAwsjson11_deserializeErrorKmsKeyValidationException(response, errorBody) 1124 1125 case strings.EqualFold("ResourceInUseException", errorCode): 1126 return awsAwsjson11_deserializeErrorResourceInUseException(response, errorBody) 1127 1128 case strings.EqualFold("ResourceLimitExceededException", errorCode): 1129 return awsAwsjson11_deserializeErrorResourceLimitExceededException(response, errorBody) 1130 1131 case strings.EqualFold("TooManyRequestsException", errorCode): 1132 return awsAwsjson11_deserializeErrorTooManyRequestsException(response, errorBody) 1133 1134 case strings.EqualFold("TooManyTagsException", errorCode): 1135 return awsAwsjson11_deserializeErrorTooManyTagsException(response, errorBody) 1136 1137 case strings.EqualFold("UnsupportedLanguageException", errorCode): 1138 return awsAwsjson11_deserializeErrorUnsupportedLanguageException(response, errorBody) 1139 1140 default: 1141 genericError := &smithy.GenericAPIError{ 1142 Code: errorCode, 1143 Message: errorMessage, 1144 } 1145 return genericError 1146 1147 } 1148} 1149 1150type awsAwsjson11_deserializeOpDeleteDocumentClassifier struct { 1151} 1152 1153func (*awsAwsjson11_deserializeOpDeleteDocumentClassifier) ID() string { 1154 return "OperationDeserializer" 1155} 1156 1157func (m *awsAwsjson11_deserializeOpDeleteDocumentClassifier) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 1158 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 1159) { 1160 out, metadata, err = next.HandleDeserialize(ctx, in) 1161 if err != nil { 1162 return out, metadata, err 1163 } 1164 1165 response, ok := out.RawResponse.(*smithyhttp.Response) 1166 if !ok { 1167 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 1168 } 1169 1170 if response.StatusCode < 200 || response.StatusCode >= 300 { 1171 return out, metadata, awsAwsjson11_deserializeOpErrorDeleteDocumentClassifier(response, &metadata) 1172 } 1173 output := &DeleteDocumentClassifierOutput{} 1174 out.Result = output 1175 1176 var buff [1024]byte 1177 ringBuffer := smithyio.NewRingBuffer(buff[:]) 1178 1179 body := io.TeeReader(response.Body, ringBuffer) 1180 decoder := json.NewDecoder(body) 1181 decoder.UseNumber() 1182 var shape interface{} 1183 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 1184 var snapshot bytes.Buffer 1185 io.Copy(&snapshot, ringBuffer) 1186 err = &smithy.DeserializationError{ 1187 Err: fmt.Errorf("failed to decode response body, %w", err), 1188 Snapshot: snapshot.Bytes(), 1189 } 1190 return out, metadata, err 1191 } 1192 1193 err = awsAwsjson11_deserializeOpDocumentDeleteDocumentClassifierOutput(&output, shape) 1194 if err != nil { 1195 var snapshot bytes.Buffer 1196 io.Copy(&snapshot, ringBuffer) 1197 err = &smithy.DeserializationError{ 1198 Err: fmt.Errorf("failed to decode response body, %w", err), 1199 Snapshot: snapshot.Bytes(), 1200 } 1201 return out, metadata, err 1202 } 1203 1204 return out, metadata, err 1205} 1206 1207func awsAwsjson11_deserializeOpErrorDeleteDocumentClassifier(response *smithyhttp.Response, metadata *middleware.Metadata) error { 1208 var errorBuffer bytes.Buffer 1209 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 1210 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 1211 } 1212 errorBody := bytes.NewReader(errorBuffer.Bytes()) 1213 1214 errorCode := "UnknownError" 1215 errorMessage := errorCode 1216 1217 code := response.Header.Get("X-Amzn-ErrorType") 1218 if len(code) != 0 { 1219 errorCode = restjson.SanitizeErrorCode(code) 1220 } 1221 1222 var buff [1024]byte 1223 ringBuffer := smithyio.NewRingBuffer(buff[:]) 1224 1225 body := io.TeeReader(errorBody, ringBuffer) 1226 decoder := json.NewDecoder(body) 1227 decoder.UseNumber() 1228 code, message, err := restjson.GetErrorInfo(decoder) 1229 if err != nil { 1230 var snapshot bytes.Buffer 1231 io.Copy(&snapshot, ringBuffer) 1232 err = &smithy.DeserializationError{ 1233 Err: fmt.Errorf("failed to decode response body, %w", err), 1234 Snapshot: snapshot.Bytes(), 1235 } 1236 return err 1237 } 1238 1239 errorBody.Seek(0, io.SeekStart) 1240 if len(code) != 0 { 1241 errorCode = restjson.SanitizeErrorCode(code) 1242 } 1243 if len(message) != 0 { 1244 errorMessage = message 1245 } 1246 1247 switch { 1248 case strings.EqualFold("InternalServerException", errorCode): 1249 return awsAwsjson11_deserializeErrorInternalServerException(response, errorBody) 1250 1251 case strings.EqualFold("InvalidRequestException", errorCode): 1252 return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody) 1253 1254 case strings.EqualFold("ResourceInUseException", errorCode): 1255 return awsAwsjson11_deserializeErrorResourceInUseException(response, errorBody) 1256 1257 case strings.EqualFold("ResourceNotFoundException", errorCode): 1258 return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) 1259 1260 case strings.EqualFold("ResourceUnavailableException", errorCode): 1261 return awsAwsjson11_deserializeErrorResourceUnavailableException(response, errorBody) 1262 1263 case strings.EqualFold("TooManyRequestsException", errorCode): 1264 return awsAwsjson11_deserializeErrorTooManyRequestsException(response, errorBody) 1265 1266 default: 1267 genericError := &smithy.GenericAPIError{ 1268 Code: errorCode, 1269 Message: errorMessage, 1270 } 1271 return genericError 1272 1273 } 1274} 1275 1276type awsAwsjson11_deserializeOpDeleteEndpoint struct { 1277} 1278 1279func (*awsAwsjson11_deserializeOpDeleteEndpoint) ID() string { 1280 return "OperationDeserializer" 1281} 1282 1283func (m *awsAwsjson11_deserializeOpDeleteEndpoint) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 1284 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 1285) { 1286 out, metadata, err = next.HandleDeserialize(ctx, in) 1287 if err != nil { 1288 return out, metadata, err 1289 } 1290 1291 response, ok := out.RawResponse.(*smithyhttp.Response) 1292 if !ok { 1293 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 1294 } 1295 1296 if response.StatusCode < 200 || response.StatusCode >= 300 { 1297 return out, metadata, awsAwsjson11_deserializeOpErrorDeleteEndpoint(response, &metadata) 1298 } 1299 output := &DeleteEndpointOutput{} 1300 out.Result = output 1301 1302 var buff [1024]byte 1303 ringBuffer := smithyio.NewRingBuffer(buff[:]) 1304 1305 body := io.TeeReader(response.Body, ringBuffer) 1306 decoder := json.NewDecoder(body) 1307 decoder.UseNumber() 1308 var shape interface{} 1309 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 1310 var snapshot bytes.Buffer 1311 io.Copy(&snapshot, ringBuffer) 1312 err = &smithy.DeserializationError{ 1313 Err: fmt.Errorf("failed to decode response body, %w", err), 1314 Snapshot: snapshot.Bytes(), 1315 } 1316 return out, metadata, err 1317 } 1318 1319 err = awsAwsjson11_deserializeOpDocumentDeleteEndpointOutput(&output, shape) 1320 if err != nil { 1321 var snapshot bytes.Buffer 1322 io.Copy(&snapshot, ringBuffer) 1323 err = &smithy.DeserializationError{ 1324 Err: fmt.Errorf("failed to decode response body, %w", err), 1325 Snapshot: snapshot.Bytes(), 1326 } 1327 return out, metadata, err 1328 } 1329 1330 return out, metadata, err 1331} 1332 1333func awsAwsjson11_deserializeOpErrorDeleteEndpoint(response *smithyhttp.Response, metadata *middleware.Metadata) error { 1334 var errorBuffer bytes.Buffer 1335 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 1336 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 1337 } 1338 errorBody := bytes.NewReader(errorBuffer.Bytes()) 1339 1340 errorCode := "UnknownError" 1341 errorMessage := errorCode 1342 1343 code := response.Header.Get("X-Amzn-ErrorType") 1344 if len(code) != 0 { 1345 errorCode = restjson.SanitizeErrorCode(code) 1346 } 1347 1348 var buff [1024]byte 1349 ringBuffer := smithyio.NewRingBuffer(buff[:]) 1350 1351 body := io.TeeReader(errorBody, ringBuffer) 1352 decoder := json.NewDecoder(body) 1353 decoder.UseNumber() 1354 code, message, err := restjson.GetErrorInfo(decoder) 1355 if err != nil { 1356 var snapshot bytes.Buffer 1357 io.Copy(&snapshot, ringBuffer) 1358 err = &smithy.DeserializationError{ 1359 Err: fmt.Errorf("failed to decode response body, %w", err), 1360 Snapshot: snapshot.Bytes(), 1361 } 1362 return err 1363 } 1364 1365 errorBody.Seek(0, io.SeekStart) 1366 if len(code) != 0 { 1367 errorCode = restjson.SanitizeErrorCode(code) 1368 } 1369 if len(message) != 0 { 1370 errorMessage = message 1371 } 1372 1373 switch { 1374 case strings.EqualFold("InternalServerException", errorCode): 1375 return awsAwsjson11_deserializeErrorInternalServerException(response, errorBody) 1376 1377 case strings.EqualFold("InvalidRequestException", errorCode): 1378 return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody) 1379 1380 case strings.EqualFold("ResourceInUseException", errorCode): 1381 return awsAwsjson11_deserializeErrorResourceInUseException(response, errorBody) 1382 1383 case strings.EqualFold("ResourceNotFoundException", errorCode): 1384 return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) 1385 1386 case strings.EqualFold("TooManyRequestsException", errorCode): 1387 return awsAwsjson11_deserializeErrorTooManyRequestsException(response, errorBody) 1388 1389 default: 1390 genericError := &smithy.GenericAPIError{ 1391 Code: errorCode, 1392 Message: errorMessage, 1393 } 1394 return genericError 1395 1396 } 1397} 1398 1399type awsAwsjson11_deserializeOpDeleteEntityRecognizer struct { 1400} 1401 1402func (*awsAwsjson11_deserializeOpDeleteEntityRecognizer) ID() string { 1403 return "OperationDeserializer" 1404} 1405 1406func (m *awsAwsjson11_deserializeOpDeleteEntityRecognizer) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 1407 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 1408) { 1409 out, metadata, err = next.HandleDeserialize(ctx, in) 1410 if err != nil { 1411 return out, metadata, err 1412 } 1413 1414 response, ok := out.RawResponse.(*smithyhttp.Response) 1415 if !ok { 1416 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 1417 } 1418 1419 if response.StatusCode < 200 || response.StatusCode >= 300 { 1420 return out, metadata, awsAwsjson11_deserializeOpErrorDeleteEntityRecognizer(response, &metadata) 1421 } 1422 output := &DeleteEntityRecognizerOutput{} 1423 out.Result = output 1424 1425 var buff [1024]byte 1426 ringBuffer := smithyio.NewRingBuffer(buff[:]) 1427 1428 body := io.TeeReader(response.Body, ringBuffer) 1429 decoder := json.NewDecoder(body) 1430 decoder.UseNumber() 1431 var shape interface{} 1432 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 1433 var snapshot bytes.Buffer 1434 io.Copy(&snapshot, ringBuffer) 1435 err = &smithy.DeserializationError{ 1436 Err: fmt.Errorf("failed to decode response body, %w", err), 1437 Snapshot: snapshot.Bytes(), 1438 } 1439 return out, metadata, err 1440 } 1441 1442 err = awsAwsjson11_deserializeOpDocumentDeleteEntityRecognizerOutput(&output, shape) 1443 if err != nil { 1444 var snapshot bytes.Buffer 1445 io.Copy(&snapshot, ringBuffer) 1446 err = &smithy.DeserializationError{ 1447 Err: fmt.Errorf("failed to decode response body, %w", err), 1448 Snapshot: snapshot.Bytes(), 1449 } 1450 return out, metadata, err 1451 } 1452 1453 return out, metadata, err 1454} 1455 1456func awsAwsjson11_deserializeOpErrorDeleteEntityRecognizer(response *smithyhttp.Response, metadata *middleware.Metadata) error { 1457 var errorBuffer bytes.Buffer 1458 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 1459 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 1460 } 1461 errorBody := bytes.NewReader(errorBuffer.Bytes()) 1462 1463 errorCode := "UnknownError" 1464 errorMessage := errorCode 1465 1466 code := response.Header.Get("X-Amzn-ErrorType") 1467 if len(code) != 0 { 1468 errorCode = restjson.SanitizeErrorCode(code) 1469 } 1470 1471 var buff [1024]byte 1472 ringBuffer := smithyio.NewRingBuffer(buff[:]) 1473 1474 body := io.TeeReader(errorBody, ringBuffer) 1475 decoder := json.NewDecoder(body) 1476 decoder.UseNumber() 1477 code, message, err := restjson.GetErrorInfo(decoder) 1478 if err != nil { 1479 var snapshot bytes.Buffer 1480 io.Copy(&snapshot, ringBuffer) 1481 err = &smithy.DeserializationError{ 1482 Err: fmt.Errorf("failed to decode response body, %w", err), 1483 Snapshot: snapshot.Bytes(), 1484 } 1485 return err 1486 } 1487 1488 errorBody.Seek(0, io.SeekStart) 1489 if len(code) != 0 { 1490 errorCode = restjson.SanitizeErrorCode(code) 1491 } 1492 if len(message) != 0 { 1493 errorMessage = message 1494 } 1495 1496 switch { 1497 case strings.EqualFold("InternalServerException", errorCode): 1498 return awsAwsjson11_deserializeErrorInternalServerException(response, errorBody) 1499 1500 case strings.EqualFold("InvalidRequestException", errorCode): 1501 return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody) 1502 1503 case strings.EqualFold("ResourceInUseException", errorCode): 1504 return awsAwsjson11_deserializeErrorResourceInUseException(response, errorBody) 1505 1506 case strings.EqualFold("ResourceNotFoundException", errorCode): 1507 return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) 1508 1509 case strings.EqualFold("ResourceUnavailableException", errorCode): 1510 return awsAwsjson11_deserializeErrorResourceUnavailableException(response, errorBody) 1511 1512 case strings.EqualFold("TooManyRequestsException", errorCode): 1513 return awsAwsjson11_deserializeErrorTooManyRequestsException(response, errorBody) 1514 1515 default: 1516 genericError := &smithy.GenericAPIError{ 1517 Code: errorCode, 1518 Message: errorMessage, 1519 } 1520 return genericError 1521 1522 } 1523} 1524 1525type awsAwsjson11_deserializeOpDescribeDocumentClassificationJob struct { 1526} 1527 1528func (*awsAwsjson11_deserializeOpDescribeDocumentClassificationJob) ID() string { 1529 return "OperationDeserializer" 1530} 1531 1532func (m *awsAwsjson11_deserializeOpDescribeDocumentClassificationJob) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 1533 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 1534) { 1535 out, metadata, err = next.HandleDeserialize(ctx, in) 1536 if err != nil { 1537 return out, metadata, err 1538 } 1539 1540 response, ok := out.RawResponse.(*smithyhttp.Response) 1541 if !ok { 1542 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 1543 } 1544 1545 if response.StatusCode < 200 || response.StatusCode >= 300 { 1546 return out, metadata, awsAwsjson11_deserializeOpErrorDescribeDocumentClassificationJob(response, &metadata) 1547 } 1548 output := &DescribeDocumentClassificationJobOutput{} 1549 out.Result = output 1550 1551 var buff [1024]byte 1552 ringBuffer := smithyio.NewRingBuffer(buff[:]) 1553 1554 body := io.TeeReader(response.Body, ringBuffer) 1555 decoder := json.NewDecoder(body) 1556 decoder.UseNumber() 1557 var shape interface{} 1558 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 1559 var snapshot bytes.Buffer 1560 io.Copy(&snapshot, ringBuffer) 1561 err = &smithy.DeserializationError{ 1562 Err: fmt.Errorf("failed to decode response body, %w", err), 1563 Snapshot: snapshot.Bytes(), 1564 } 1565 return out, metadata, err 1566 } 1567 1568 err = awsAwsjson11_deserializeOpDocumentDescribeDocumentClassificationJobOutput(&output, shape) 1569 if err != nil { 1570 var snapshot bytes.Buffer 1571 io.Copy(&snapshot, ringBuffer) 1572 err = &smithy.DeserializationError{ 1573 Err: fmt.Errorf("failed to decode response body, %w", err), 1574 Snapshot: snapshot.Bytes(), 1575 } 1576 return out, metadata, err 1577 } 1578 1579 return out, metadata, err 1580} 1581 1582func awsAwsjson11_deserializeOpErrorDescribeDocumentClassificationJob(response *smithyhttp.Response, metadata *middleware.Metadata) error { 1583 var errorBuffer bytes.Buffer 1584 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 1585 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 1586 } 1587 errorBody := bytes.NewReader(errorBuffer.Bytes()) 1588 1589 errorCode := "UnknownError" 1590 errorMessage := errorCode 1591 1592 code := response.Header.Get("X-Amzn-ErrorType") 1593 if len(code) != 0 { 1594 errorCode = restjson.SanitizeErrorCode(code) 1595 } 1596 1597 var buff [1024]byte 1598 ringBuffer := smithyio.NewRingBuffer(buff[:]) 1599 1600 body := io.TeeReader(errorBody, ringBuffer) 1601 decoder := json.NewDecoder(body) 1602 decoder.UseNumber() 1603 code, message, err := restjson.GetErrorInfo(decoder) 1604 if err != nil { 1605 var snapshot bytes.Buffer 1606 io.Copy(&snapshot, ringBuffer) 1607 err = &smithy.DeserializationError{ 1608 Err: fmt.Errorf("failed to decode response body, %w", err), 1609 Snapshot: snapshot.Bytes(), 1610 } 1611 return err 1612 } 1613 1614 errorBody.Seek(0, io.SeekStart) 1615 if len(code) != 0 { 1616 errorCode = restjson.SanitizeErrorCode(code) 1617 } 1618 if len(message) != 0 { 1619 errorMessage = message 1620 } 1621 1622 switch { 1623 case strings.EqualFold("InternalServerException", errorCode): 1624 return awsAwsjson11_deserializeErrorInternalServerException(response, errorBody) 1625 1626 case strings.EqualFold("InvalidRequestException", errorCode): 1627 return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody) 1628 1629 case strings.EqualFold("JobNotFoundException", errorCode): 1630 return awsAwsjson11_deserializeErrorJobNotFoundException(response, errorBody) 1631 1632 case strings.EqualFold("TooManyRequestsException", errorCode): 1633 return awsAwsjson11_deserializeErrorTooManyRequestsException(response, errorBody) 1634 1635 default: 1636 genericError := &smithy.GenericAPIError{ 1637 Code: errorCode, 1638 Message: errorMessage, 1639 } 1640 return genericError 1641 1642 } 1643} 1644 1645type awsAwsjson11_deserializeOpDescribeDocumentClassifier struct { 1646} 1647 1648func (*awsAwsjson11_deserializeOpDescribeDocumentClassifier) ID() string { 1649 return "OperationDeserializer" 1650} 1651 1652func (m *awsAwsjson11_deserializeOpDescribeDocumentClassifier) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 1653 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 1654) { 1655 out, metadata, err = next.HandleDeserialize(ctx, in) 1656 if err != nil { 1657 return out, metadata, err 1658 } 1659 1660 response, ok := out.RawResponse.(*smithyhttp.Response) 1661 if !ok { 1662 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 1663 } 1664 1665 if response.StatusCode < 200 || response.StatusCode >= 300 { 1666 return out, metadata, awsAwsjson11_deserializeOpErrorDescribeDocumentClassifier(response, &metadata) 1667 } 1668 output := &DescribeDocumentClassifierOutput{} 1669 out.Result = output 1670 1671 var buff [1024]byte 1672 ringBuffer := smithyio.NewRingBuffer(buff[:]) 1673 1674 body := io.TeeReader(response.Body, ringBuffer) 1675 decoder := json.NewDecoder(body) 1676 decoder.UseNumber() 1677 var shape interface{} 1678 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 1679 var snapshot bytes.Buffer 1680 io.Copy(&snapshot, ringBuffer) 1681 err = &smithy.DeserializationError{ 1682 Err: fmt.Errorf("failed to decode response body, %w", err), 1683 Snapshot: snapshot.Bytes(), 1684 } 1685 return out, metadata, err 1686 } 1687 1688 err = awsAwsjson11_deserializeOpDocumentDescribeDocumentClassifierOutput(&output, shape) 1689 if err != nil { 1690 var snapshot bytes.Buffer 1691 io.Copy(&snapshot, ringBuffer) 1692 err = &smithy.DeserializationError{ 1693 Err: fmt.Errorf("failed to decode response body, %w", err), 1694 Snapshot: snapshot.Bytes(), 1695 } 1696 return out, metadata, err 1697 } 1698 1699 return out, metadata, err 1700} 1701 1702func awsAwsjson11_deserializeOpErrorDescribeDocumentClassifier(response *smithyhttp.Response, metadata *middleware.Metadata) error { 1703 var errorBuffer bytes.Buffer 1704 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 1705 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 1706 } 1707 errorBody := bytes.NewReader(errorBuffer.Bytes()) 1708 1709 errorCode := "UnknownError" 1710 errorMessage := errorCode 1711 1712 code := response.Header.Get("X-Amzn-ErrorType") 1713 if len(code) != 0 { 1714 errorCode = restjson.SanitizeErrorCode(code) 1715 } 1716 1717 var buff [1024]byte 1718 ringBuffer := smithyio.NewRingBuffer(buff[:]) 1719 1720 body := io.TeeReader(errorBody, ringBuffer) 1721 decoder := json.NewDecoder(body) 1722 decoder.UseNumber() 1723 code, message, err := restjson.GetErrorInfo(decoder) 1724 if err != nil { 1725 var snapshot bytes.Buffer 1726 io.Copy(&snapshot, ringBuffer) 1727 err = &smithy.DeserializationError{ 1728 Err: fmt.Errorf("failed to decode response body, %w", err), 1729 Snapshot: snapshot.Bytes(), 1730 } 1731 return err 1732 } 1733 1734 errorBody.Seek(0, io.SeekStart) 1735 if len(code) != 0 { 1736 errorCode = restjson.SanitizeErrorCode(code) 1737 } 1738 if len(message) != 0 { 1739 errorMessage = message 1740 } 1741 1742 switch { 1743 case strings.EqualFold("InternalServerException", errorCode): 1744 return awsAwsjson11_deserializeErrorInternalServerException(response, errorBody) 1745 1746 case strings.EqualFold("InvalidRequestException", errorCode): 1747 return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody) 1748 1749 case strings.EqualFold("ResourceNotFoundException", errorCode): 1750 return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) 1751 1752 case strings.EqualFold("TooManyRequestsException", errorCode): 1753 return awsAwsjson11_deserializeErrorTooManyRequestsException(response, errorBody) 1754 1755 default: 1756 genericError := &smithy.GenericAPIError{ 1757 Code: errorCode, 1758 Message: errorMessage, 1759 } 1760 return genericError 1761 1762 } 1763} 1764 1765type awsAwsjson11_deserializeOpDescribeDominantLanguageDetectionJob struct { 1766} 1767 1768func (*awsAwsjson11_deserializeOpDescribeDominantLanguageDetectionJob) ID() string { 1769 return "OperationDeserializer" 1770} 1771 1772func (m *awsAwsjson11_deserializeOpDescribeDominantLanguageDetectionJob) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 1773 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 1774) { 1775 out, metadata, err = next.HandleDeserialize(ctx, in) 1776 if err != nil { 1777 return out, metadata, err 1778 } 1779 1780 response, ok := out.RawResponse.(*smithyhttp.Response) 1781 if !ok { 1782 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 1783 } 1784 1785 if response.StatusCode < 200 || response.StatusCode >= 300 { 1786 return out, metadata, awsAwsjson11_deserializeOpErrorDescribeDominantLanguageDetectionJob(response, &metadata) 1787 } 1788 output := &DescribeDominantLanguageDetectionJobOutput{} 1789 out.Result = output 1790 1791 var buff [1024]byte 1792 ringBuffer := smithyio.NewRingBuffer(buff[:]) 1793 1794 body := io.TeeReader(response.Body, ringBuffer) 1795 decoder := json.NewDecoder(body) 1796 decoder.UseNumber() 1797 var shape interface{} 1798 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 1799 var snapshot bytes.Buffer 1800 io.Copy(&snapshot, ringBuffer) 1801 err = &smithy.DeserializationError{ 1802 Err: fmt.Errorf("failed to decode response body, %w", err), 1803 Snapshot: snapshot.Bytes(), 1804 } 1805 return out, metadata, err 1806 } 1807 1808 err = awsAwsjson11_deserializeOpDocumentDescribeDominantLanguageDetectionJobOutput(&output, shape) 1809 if err != nil { 1810 var snapshot bytes.Buffer 1811 io.Copy(&snapshot, ringBuffer) 1812 err = &smithy.DeserializationError{ 1813 Err: fmt.Errorf("failed to decode response body, %w", err), 1814 Snapshot: snapshot.Bytes(), 1815 } 1816 return out, metadata, err 1817 } 1818 1819 return out, metadata, err 1820} 1821 1822func awsAwsjson11_deserializeOpErrorDescribeDominantLanguageDetectionJob(response *smithyhttp.Response, metadata *middleware.Metadata) error { 1823 var errorBuffer bytes.Buffer 1824 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 1825 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 1826 } 1827 errorBody := bytes.NewReader(errorBuffer.Bytes()) 1828 1829 errorCode := "UnknownError" 1830 errorMessage := errorCode 1831 1832 code := response.Header.Get("X-Amzn-ErrorType") 1833 if len(code) != 0 { 1834 errorCode = restjson.SanitizeErrorCode(code) 1835 } 1836 1837 var buff [1024]byte 1838 ringBuffer := smithyio.NewRingBuffer(buff[:]) 1839 1840 body := io.TeeReader(errorBody, ringBuffer) 1841 decoder := json.NewDecoder(body) 1842 decoder.UseNumber() 1843 code, message, err := restjson.GetErrorInfo(decoder) 1844 if err != nil { 1845 var snapshot bytes.Buffer 1846 io.Copy(&snapshot, ringBuffer) 1847 err = &smithy.DeserializationError{ 1848 Err: fmt.Errorf("failed to decode response body, %w", err), 1849 Snapshot: snapshot.Bytes(), 1850 } 1851 return err 1852 } 1853 1854 errorBody.Seek(0, io.SeekStart) 1855 if len(code) != 0 { 1856 errorCode = restjson.SanitizeErrorCode(code) 1857 } 1858 if len(message) != 0 { 1859 errorMessage = message 1860 } 1861 1862 switch { 1863 case strings.EqualFold("InternalServerException", errorCode): 1864 return awsAwsjson11_deserializeErrorInternalServerException(response, errorBody) 1865 1866 case strings.EqualFold("InvalidRequestException", errorCode): 1867 return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody) 1868 1869 case strings.EqualFold("JobNotFoundException", errorCode): 1870 return awsAwsjson11_deserializeErrorJobNotFoundException(response, errorBody) 1871 1872 case strings.EqualFold("TooManyRequestsException", errorCode): 1873 return awsAwsjson11_deserializeErrorTooManyRequestsException(response, errorBody) 1874 1875 default: 1876 genericError := &smithy.GenericAPIError{ 1877 Code: errorCode, 1878 Message: errorMessage, 1879 } 1880 return genericError 1881 1882 } 1883} 1884 1885type awsAwsjson11_deserializeOpDescribeEndpoint struct { 1886} 1887 1888func (*awsAwsjson11_deserializeOpDescribeEndpoint) ID() string { 1889 return "OperationDeserializer" 1890} 1891 1892func (m *awsAwsjson11_deserializeOpDescribeEndpoint) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 1893 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 1894) { 1895 out, metadata, err = next.HandleDeserialize(ctx, in) 1896 if err != nil { 1897 return out, metadata, err 1898 } 1899 1900 response, ok := out.RawResponse.(*smithyhttp.Response) 1901 if !ok { 1902 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 1903 } 1904 1905 if response.StatusCode < 200 || response.StatusCode >= 300 { 1906 return out, metadata, awsAwsjson11_deserializeOpErrorDescribeEndpoint(response, &metadata) 1907 } 1908 output := &DescribeEndpointOutput{} 1909 out.Result = output 1910 1911 var buff [1024]byte 1912 ringBuffer := smithyio.NewRingBuffer(buff[:]) 1913 1914 body := io.TeeReader(response.Body, ringBuffer) 1915 decoder := json.NewDecoder(body) 1916 decoder.UseNumber() 1917 var shape interface{} 1918 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 1919 var snapshot bytes.Buffer 1920 io.Copy(&snapshot, ringBuffer) 1921 err = &smithy.DeserializationError{ 1922 Err: fmt.Errorf("failed to decode response body, %w", err), 1923 Snapshot: snapshot.Bytes(), 1924 } 1925 return out, metadata, err 1926 } 1927 1928 err = awsAwsjson11_deserializeOpDocumentDescribeEndpointOutput(&output, shape) 1929 if err != nil { 1930 var snapshot bytes.Buffer 1931 io.Copy(&snapshot, ringBuffer) 1932 err = &smithy.DeserializationError{ 1933 Err: fmt.Errorf("failed to decode response body, %w", err), 1934 Snapshot: snapshot.Bytes(), 1935 } 1936 return out, metadata, err 1937 } 1938 1939 return out, metadata, err 1940} 1941 1942func awsAwsjson11_deserializeOpErrorDescribeEndpoint(response *smithyhttp.Response, metadata *middleware.Metadata) error { 1943 var errorBuffer bytes.Buffer 1944 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 1945 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 1946 } 1947 errorBody := bytes.NewReader(errorBuffer.Bytes()) 1948 1949 errorCode := "UnknownError" 1950 errorMessage := errorCode 1951 1952 code := response.Header.Get("X-Amzn-ErrorType") 1953 if len(code) != 0 { 1954 errorCode = restjson.SanitizeErrorCode(code) 1955 } 1956 1957 var buff [1024]byte 1958 ringBuffer := smithyio.NewRingBuffer(buff[:]) 1959 1960 body := io.TeeReader(errorBody, ringBuffer) 1961 decoder := json.NewDecoder(body) 1962 decoder.UseNumber() 1963 code, message, err := restjson.GetErrorInfo(decoder) 1964 if err != nil { 1965 var snapshot bytes.Buffer 1966 io.Copy(&snapshot, ringBuffer) 1967 err = &smithy.DeserializationError{ 1968 Err: fmt.Errorf("failed to decode response body, %w", err), 1969 Snapshot: snapshot.Bytes(), 1970 } 1971 return err 1972 } 1973 1974 errorBody.Seek(0, io.SeekStart) 1975 if len(code) != 0 { 1976 errorCode = restjson.SanitizeErrorCode(code) 1977 } 1978 if len(message) != 0 { 1979 errorMessage = message 1980 } 1981 1982 switch { 1983 case strings.EqualFold("InternalServerException", errorCode): 1984 return awsAwsjson11_deserializeErrorInternalServerException(response, errorBody) 1985 1986 case strings.EqualFold("InvalidRequestException", errorCode): 1987 return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody) 1988 1989 case strings.EqualFold("ResourceNotFoundException", errorCode): 1990 return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) 1991 1992 case strings.EqualFold("TooManyRequestsException", errorCode): 1993 return awsAwsjson11_deserializeErrorTooManyRequestsException(response, errorBody) 1994 1995 default: 1996 genericError := &smithy.GenericAPIError{ 1997 Code: errorCode, 1998 Message: errorMessage, 1999 } 2000 return genericError 2001 2002 } 2003} 2004 2005type awsAwsjson11_deserializeOpDescribeEntitiesDetectionJob struct { 2006} 2007 2008func (*awsAwsjson11_deserializeOpDescribeEntitiesDetectionJob) ID() string { 2009 return "OperationDeserializer" 2010} 2011 2012func (m *awsAwsjson11_deserializeOpDescribeEntitiesDetectionJob) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 2013 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 2014) { 2015 out, metadata, err = next.HandleDeserialize(ctx, in) 2016 if err != nil { 2017 return out, metadata, err 2018 } 2019 2020 response, ok := out.RawResponse.(*smithyhttp.Response) 2021 if !ok { 2022 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 2023 } 2024 2025 if response.StatusCode < 200 || response.StatusCode >= 300 { 2026 return out, metadata, awsAwsjson11_deserializeOpErrorDescribeEntitiesDetectionJob(response, &metadata) 2027 } 2028 output := &DescribeEntitiesDetectionJobOutput{} 2029 out.Result = output 2030 2031 var buff [1024]byte 2032 ringBuffer := smithyio.NewRingBuffer(buff[:]) 2033 2034 body := io.TeeReader(response.Body, ringBuffer) 2035 decoder := json.NewDecoder(body) 2036 decoder.UseNumber() 2037 var shape interface{} 2038 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 2039 var snapshot bytes.Buffer 2040 io.Copy(&snapshot, ringBuffer) 2041 err = &smithy.DeserializationError{ 2042 Err: fmt.Errorf("failed to decode response body, %w", err), 2043 Snapshot: snapshot.Bytes(), 2044 } 2045 return out, metadata, err 2046 } 2047 2048 err = awsAwsjson11_deserializeOpDocumentDescribeEntitiesDetectionJobOutput(&output, shape) 2049 if err != nil { 2050 var snapshot bytes.Buffer 2051 io.Copy(&snapshot, ringBuffer) 2052 err = &smithy.DeserializationError{ 2053 Err: fmt.Errorf("failed to decode response body, %w", err), 2054 Snapshot: snapshot.Bytes(), 2055 } 2056 return out, metadata, err 2057 } 2058 2059 return out, metadata, err 2060} 2061 2062func awsAwsjson11_deserializeOpErrorDescribeEntitiesDetectionJob(response *smithyhttp.Response, metadata *middleware.Metadata) error { 2063 var errorBuffer bytes.Buffer 2064 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 2065 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 2066 } 2067 errorBody := bytes.NewReader(errorBuffer.Bytes()) 2068 2069 errorCode := "UnknownError" 2070 errorMessage := errorCode 2071 2072 code := response.Header.Get("X-Amzn-ErrorType") 2073 if len(code) != 0 { 2074 errorCode = restjson.SanitizeErrorCode(code) 2075 } 2076 2077 var buff [1024]byte 2078 ringBuffer := smithyio.NewRingBuffer(buff[:]) 2079 2080 body := io.TeeReader(errorBody, ringBuffer) 2081 decoder := json.NewDecoder(body) 2082 decoder.UseNumber() 2083 code, message, err := restjson.GetErrorInfo(decoder) 2084 if err != nil { 2085 var snapshot bytes.Buffer 2086 io.Copy(&snapshot, ringBuffer) 2087 err = &smithy.DeserializationError{ 2088 Err: fmt.Errorf("failed to decode response body, %w", err), 2089 Snapshot: snapshot.Bytes(), 2090 } 2091 return err 2092 } 2093 2094 errorBody.Seek(0, io.SeekStart) 2095 if len(code) != 0 { 2096 errorCode = restjson.SanitizeErrorCode(code) 2097 } 2098 if len(message) != 0 { 2099 errorMessage = message 2100 } 2101 2102 switch { 2103 case strings.EqualFold("InternalServerException", errorCode): 2104 return awsAwsjson11_deserializeErrorInternalServerException(response, errorBody) 2105 2106 case strings.EqualFold("InvalidRequestException", errorCode): 2107 return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody) 2108 2109 case strings.EqualFold("JobNotFoundException", errorCode): 2110 return awsAwsjson11_deserializeErrorJobNotFoundException(response, errorBody) 2111 2112 case strings.EqualFold("TooManyRequestsException", errorCode): 2113 return awsAwsjson11_deserializeErrorTooManyRequestsException(response, errorBody) 2114 2115 default: 2116 genericError := &smithy.GenericAPIError{ 2117 Code: errorCode, 2118 Message: errorMessage, 2119 } 2120 return genericError 2121 2122 } 2123} 2124 2125type awsAwsjson11_deserializeOpDescribeEntityRecognizer struct { 2126} 2127 2128func (*awsAwsjson11_deserializeOpDescribeEntityRecognizer) ID() string { 2129 return "OperationDeserializer" 2130} 2131 2132func (m *awsAwsjson11_deserializeOpDescribeEntityRecognizer) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 2133 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 2134) { 2135 out, metadata, err = next.HandleDeserialize(ctx, in) 2136 if err != nil { 2137 return out, metadata, err 2138 } 2139 2140 response, ok := out.RawResponse.(*smithyhttp.Response) 2141 if !ok { 2142 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 2143 } 2144 2145 if response.StatusCode < 200 || response.StatusCode >= 300 { 2146 return out, metadata, awsAwsjson11_deserializeOpErrorDescribeEntityRecognizer(response, &metadata) 2147 } 2148 output := &DescribeEntityRecognizerOutput{} 2149 out.Result = output 2150 2151 var buff [1024]byte 2152 ringBuffer := smithyio.NewRingBuffer(buff[:]) 2153 2154 body := io.TeeReader(response.Body, ringBuffer) 2155 decoder := json.NewDecoder(body) 2156 decoder.UseNumber() 2157 var shape interface{} 2158 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 2159 var snapshot bytes.Buffer 2160 io.Copy(&snapshot, ringBuffer) 2161 err = &smithy.DeserializationError{ 2162 Err: fmt.Errorf("failed to decode response body, %w", err), 2163 Snapshot: snapshot.Bytes(), 2164 } 2165 return out, metadata, err 2166 } 2167 2168 err = awsAwsjson11_deserializeOpDocumentDescribeEntityRecognizerOutput(&output, shape) 2169 if err != nil { 2170 var snapshot bytes.Buffer 2171 io.Copy(&snapshot, ringBuffer) 2172 err = &smithy.DeserializationError{ 2173 Err: fmt.Errorf("failed to decode response body, %w", err), 2174 Snapshot: snapshot.Bytes(), 2175 } 2176 return out, metadata, err 2177 } 2178 2179 return out, metadata, err 2180} 2181 2182func awsAwsjson11_deserializeOpErrorDescribeEntityRecognizer(response *smithyhttp.Response, metadata *middleware.Metadata) error { 2183 var errorBuffer bytes.Buffer 2184 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 2185 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 2186 } 2187 errorBody := bytes.NewReader(errorBuffer.Bytes()) 2188 2189 errorCode := "UnknownError" 2190 errorMessage := errorCode 2191 2192 code := response.Header.Get("X-Amzn-ErrorType") 2193 if len(code) != 0 { 2194 errorCode = restjson.SanitizeErrorCode(code) 2195 } 2196 2197 var buff [1024]byte 2198 ringBuffer := smithyio.NewRingBuffer(buff[:]) 2199 2200 body := io.TeeReader(errorBody, ringBuffer) 2201 decoder := json.NewDecoder(body) 2202 decoder.UseNumber() 2203 code, message, err := restjson.GetErrorInfo(decoder) 2204 if err != nil { 2205 var snapshot bytes.Buffer 2206 io.Copy(&snapshot, ringBuffer) 2207 err = &smithy.DeserializationError{ 2208 Err: fmt.Errorf("failed to decode response body, %w", err), 2209 Snapshot: snapshot.Bytes(), 2210 } 2211 return err 2212 } 2213 2214 errorBody.Seek(0, io.SeekStart) 2215 if len(code) != 0 { 2216 errorCode = restjson.SanitizeErrorCode(code) 2217 } 2218 if len(message) != 0 { 2219 errorMessage = message 2220 } 2221 2222 switch { 2223 case strings.EqualFold("InternalServerException", errorCode): 2224 return awsAwsjson11_deserializeErrorInternalServerException(response, errorBody) 2225 2226 case strings.EqualFold("InvalidRequestException", errorCode): 2227 return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody) 2228 2229 case strings.EqualFold("ResourceNotFoundException", errorCode): 2230 return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) 2231 2232 case strings.EqualFold("TooManyRequestsException", errorCode): 2233 return awsAwsjson11_deserializeErrorTooManyRequestsException(response, errorBody) 2234 2235 default: 2236 genericError := &smithy.GenericAPIError{ 2237 Code: errorCode, 2238 Message: errorMessage, 2239 } 2240 return genericError 2241 2242 } 2243} 2244 2245type awsAwsjson11_deserializeOpDescribeEventsDetectionJob struct { 2246} 2247 2248func (*awsAwsjson11_deserializeOpDescribeEventsDetectionJob) ID() string { 2249 return "OperationDeserializer" 2250} 2251 2252func (m *awsAwsjson11_deserializeOpDescribeEventsDetectionJob) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 2253 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 2254) { 2255 out, metadata, err = next.HandleDeserialize(ctx, in) 2256 if err != nil { 2257 return out, metadata, err 2258 } 2259 2260 response, ok := out.RawResponse.(*smithyhttp.Response) 2261 if !ok { 2262 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 2263 } 2264 2265 if response.StatusCode < 200 || response.StatusCode >= 300 { 2266 return out, metadata, awsAwsjson11_deserializeOpErrorDescribeEventsDetectionJob(response, &metadata) 2267 } 2268 output := &DescribeEventsDetectionJobOutput{} 2269 out.Result = output 2270 2271 var buff [1024]byte 2272 ringBuffer := smithyio.NewRingBuffer(buff[:]) 2273 2274 body := io.TeeReader(response.Body, ringBuffer) 2275 decoder := json.NewDecoder(body) 2276 decoder.UseNumber() 2277 var shape interface{} 2278 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 2279 var snapshot bytes.Buffer 2280 io.Copy(&snapshot, ringBuffer) 2281 err = &smithy.DeserializationError{ 2282 Err: fmt.Errorf("failed to decode response body, %w", err), 2283 Snapshot: snapshot.Bytes(), 2284 } 2285 return out, metadata, err 2286 } 2287 2288 err = awsAwsjson11_deserializeOpDocumentDescribeEventsDetectionJobOutput(&output, shape) 2289 if err != nil { 2290 var snapshot bytes.Buffer 2291 io.Copy(&snapshot, ringBuffer) 2292 err = &smithy.DeserializationError{ 2293 Err: fmt.Errorf("failed to decode response body, %w", err), 2294 Snapshot: snapshot.Bytes(), 2295 } 2296 return out, metadata, err 2297 } 2298 2299 return out, metadata, err 2300} 2301 2302func awsAwsjson11_deserializeOpErrorDescribeEventsDetectionJob(response *smithyhttp.Response, metadata *middleware.Metadata) error { 2303 var errorBuffer bytes.Buffer 2304 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 2305 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 2306 } 2307 errorBody := bytes.NewReader(errorBuffer.Bytes()) 2308 2309 errorCode := "UnknownError" 2310 errorMessage := errorCode 2311 2312 code := response.Header.Get("X-Amzn-ErrorType") 2313 if len(code) != 0 { 2314 errorCode = restjson.SanitizeErrorCode(code) 2315 } 2316 2317 var buff [1024]byte 2318 ringBuffer := smithyio.NewRingBuffer(buff[:]) 2319 2320 body := io.TeeReader(errorBody, ringBuffer) 2321 decoder := json.NewDecoder(body) 2322 decoder.UseNumber() 2323 code, message, err := restjson.GetErrorInfo(decoder) 2324 if err != nil { 2325 var snapshot bytes.Buffer 2326 io.Copy(&snapshot, ringBuffer) 2327 err = &smithy.DeserializationError{ 2328 Err: fmt.Errorf("failed to decode response body, %w", err), 2329 Snapshot: snapshot.Bytes(), 2330 } 2331 return err 2332 } 2333 2334 errorBody.Seek(0, io.SeekStart) 2335 if len(code) != 0 { 2336 errorCode = restjson.SanitizeErrorCode(code) 2337 } 2338 if len(message) != 0 { 2339 errorMessage = message 2340 } 2341 2342 switch { 2343 case strings.EqualFold("InternalServerException", errorCode): 2344 return awsAwsjson11_deserializeErrorInternalServerException(response, errorBody) 2345 2346 case strings.EqualFold("InvalidRequestException", errorCode): 2347 return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody) 2348 2349 case strings.EqualFold("JobNotFoundException", errorCode): 2350 return awsAwsjson11_deserializeErrorJobNotFoundException(response, errorBody) 2351 2352 case strings.EqualFold("TooManyRequestsException", errorCode): 2353 return awsAwsjson11_deserializeErrorTooManyRequestsException(response, errorBody) 2354 2355 default: 2356 genericError := &smithy.GenericAPIError{ 2357 Code: errorCode, 2358 Message: errorMessage, 2359 } 2360 return genericError 2361 2362 } 2363} 2364 2365type awsAwsjson11_deserializeOpDescribeKeyPhrasesDetectionJob struct { 2366} 2367 2368func (*awsAwsjson11_deserializeOpDescribeKeyPhrasesDetectionJob) ID() string { 2369 return "OperationDeserializer" 2370} 2371 2372func (m *awsAwsjson11_deserializeOpDescribeKeyPhrasesDetectionJob) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 2373 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 2374) { 2375 out, metadata, err = next.HandleDeserialize(ctx, in) 2376 if err != nil { 2377 return out, metadata, err 2378 } 2379 2380 response, ok := out.RawResponse.(*smithyhttp.Response) 2381 if !ok { 2382 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 2383 } 2384 2385 if response.StatusCode < 200 || response.StatusCode >= 300 { 2386 return out, metadata, awsAwsjson11_deserializeOpErrorDescribeKeyPhrasesDetectionJob(response, &metadata) 2387 } 2388 output := &DescribeKeyPhrasesDetectionJobOutput{} 2389 out.Result = output 2390 2391 var buff [1024]byte 2392 ringBuffer := smithyio.NewRingBuffer(buff[:]) 2393 2394 body := io.TeeReader(response.Body, ringBuffer) 2395 decoder := json.NewDecoder(body) 2396 decoder.UseNumber() 2397 var shape interface{} 2398 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 2399 var snapshot bytes.Buffer 2400 io.Copy(&snapshot, ringBuffer) 2401 err = &smithy.DeserializationError{ 2402 Err: fmt.Errorf("failed to decode response body, %w", err), 2403 Snapshot: snapshot.Bytes(), 2404 } 2405 return out, metadata, err 2406 } 2407 2408 err = awsAwsjson11_deserializeOpDocumentDescribeKeyPhrasesDetectionJobOutput(&output, shape) 2409 if err != nil { 2410 var snapshot bytes.Buffer 2411 io.Copy(&snapshot, ringBuffer) 2412 err = &smithy.DeserializationError{ 2413 Err: fmt.Errorf("failed to decode response body, %w", err), 2414 Snapshot: snapshot.Bytes(), 2415 } 2416 return out, metadata, err 2417 } 2418 2419 return out, metadata, err 2420} 2421 2422func awsAwsjson11_deserializeOpErrorDescribeKeyPhrasesDetectionJob(response *smithyhttp.Response, metadata *middleware.Metadata) error { 2423 var errorBuffer bytes.Buffer 2424 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 2425 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 2426 } 2427 errorBody := bytes.NewReader(errorBuffer.Bytes()) 2428 2429 errorCode := "UnknownError" 2430 errorMessage := errorCode 2431 2432 code := response.Header.Get("X-Amzn-ErrorType") 2433 if len(code) != 0 { 2434 errorCode = restjson.SanitizeErrorCode(code) 2435 } 2436 2437 var buff [1024]byte 2438 ringBuffer := smithyio.NewRingBuffer(buff[:]) 2439 2440 body := io.TeeReader(errorBody, ringBuffer) 2441 decoder := json.NewDecoder(body) 2442 decoder.UseNumber() 2443 code, message, err := restjson.GetErrorInfo(decoder) 2444 if err != nil { 2445 var snapshot bytes.Buffer 2446 io.Copy(&snapshot, ringBuffer) 2447 err = &smithy.DeserializationError{ 2448 Err: fmt.Errorf("failed to decode response body, %w", err), 2449 Snapshot: snapshot.Bytes(), 2450 } 2451 return err 2452 } 2453 2454 errorBody.Seek(0, io.SeekStart) 2455 if len(code) != 0 { 2456 errorCode = restjson.SanitizeErrorCode(code) 2457 } 2458 if len(message) != 0 { 2459 errorMessage = message 2460 } 2461 2462 switch { 2463 case strings.EqualFold("InternalServerException", errorCode): 2464 return awsAwsjson11_deserializeErrorInternalServerException(response, errorBody) 2465 2466 case strings.EqualFold("InvalidRequestException", errorCode): 2467 return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody) 2468 2469 case strings.EqualFold("JobNotFoundException", errorCode): 2470 return awsAwsjson11_deserializeErrorJobNotFoundException(response, errorBody) 2471 2472 case strings.EqualFold("TooManyRequestsException", errorCode): 2473 return awsAwsjson11_deserializeErrorTooManyRequestsException(response, errorBody) 2474 2475 default: 2476 genericError := &smithy.GenericAPIError{ 2477 Code: errorCode, 2478 Message: errorMessage, 2479 } 2480 return genericError 2481 2482 } 2483} 2484 2485type awsAwsjson11_deserializeOpDescribePiiEntitiesDetectionJob struct { 2486} 2487 2488func (*awsAwsjson11_deserializeOpDescribePiiEntitiesDetectionJob) ID() string { 2489 return "OperationDeserializer" 2490} 2491 2492func (m *awsAwsjson11_deserializeOpDescribePiiEntitiesDetectionJob) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 2493 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 2494) { 2495 out, metadata, err = next.HandleDeserialize(ctx, in) 2496 if err != nil { 2497 return out, metadata, err 2498 } 2499 2500 response, ok := out.RawResponse.(*smithyhttp.Response) 2501 if !ok { 2502 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 2503 } 2504 2505 if response.StatusCode < 200 || response.StatusCode >= 300 { 2506 return out, metadata, awsAwsjson11_deserializeOpErrorDescribePiiEntitiesDetectionJob(response, &metadata) 2507 } 2508 output := &DescribePiiEntitiesDetectionJobOutput{} 2509 out.Result = output 2510 2511 var buff [1024]byte 2512 ringBuffer := smithyio.NewRingBuffer(buff[:]) 2513 2514 body := io.TeeReader(response.Body, ringBuffer) 2515 decoder := json.NewDecoder(body) 2516 decoder.UseNumber() 2517 var shape interface{} 2518 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 2519 var snapshot bytes.Buffer 2520 io.Copy(&snapshot, ringBuffer) 2521 err = &smithy.DeserializationError{ 2522 Err: fmt.Errorf("failed to decode response body, %w", err), 2523 Snapshot: snapshot.Bytes(), 2524 } 2525 return out, metadata, err 2526 } 2527 2528 err = awsAwsjson11_deserializeOpDocumentDescribePiiEntitiesDetectionJobOutput(&output, shape) 2529 if err != nil { 2530 var snapshot bytes.Buffer 2531 io.Copy(&snapshot, ringBuffer) 2532 err = &smithy.DeserializationError{ 2533 Err: fmt.Errorf("failed to decode response body, %w", err), 2534 Snapshot: snapshot.Bytes(), 2535 } 2536 return out, metadata, err 2537 } 2538 2539 return out, metadata, err 2540} 2541 2542func awsAwsjson11_deserializeOpErrorDescribePiiEntitiesDetectionJob(response *smithyhttp.Response, metadata *middleware.Metadata) error { 2543 var errorBuffer bytes.Buffer 2544 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 2545 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 2546 } 2547 errorBody := bytes.NewReader(errorBuffer.Bytes()) 2548 2549 errorCode := "UnknownError" 2550 errorMessage := errorCode 2551 2552 code := response.Header.Get("X-Amzn-ErrorType") 2553 if len(code) != 0 { 2554 errorCode = restjson.SanitizeErrorCode(code) 2555 } 2556 2557 var buff [1024]byte 2558 ringBuffer := smithyio.NewRingBuffer(buff[:]) 2559 2560 body := io.TeeReader(errorBody, ringBuffer) 2561 decoder := json.NewDecoder(body) 2562 decoder.UseNumber() 2563 code, message, err := restjson.GetErrorInfo(decoder) 2564 if err != nil { 2565 var snapshot bytes.Buffer 2566 io.Copy(&snapshot, ringBuffer) 2567 err = &smithy.DeserializationError{ 2568 Err: fmt.Errorf("failed to decode response body, %w", err), 2569 Snapshot: snapshot.Bytes(), 2570 } 2571 return err 2572 } 2573 2574 errorBody.Seek(0, io.SeekStart) 2575 if len(code) != 0 { 2576 errorCode = restjson.SanitizeErrorCode(code) 2577 } 2578 if len(message) != 0 { 2579 errorMessage = message 2580 } 2581 2582 switch { 2583 case strings.EqualFold("InternalServerException", errorCode): 2584 return awsAwsjson11_deserializeErrorInternalServerException(response, errorBody) 2585 2586 case strings.EqualFold("InvalidRequestException", errorCode): 2587 return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody) 2588 2589 case strings.EqualFold("JobNotFoundException", errorCode): 2590 return awsAwsjson11_deserializeErrorJobNotFoundException(response, errorBody) 2591 2592 case strings.EqualFold("TooManyRequestsException", errorCode): 2593 return awsAwsjson11_deserializeErrorTooManyRequestsException(response, errorBody) 2594 2595 default: 2596 genericError := &smithy.GenericAPIError{ 2597 Code: errorCode, 2598 Message: errorMessage, 2599 } 2600 return genericError 2601 2602 } 2603} 2604 2605type awsAwsjson11_deserializeOpDescribeSentimentDetectionJob struct { 2606} 2607 2608func (*awsAwsjson11_deserializeOpDescribeSentimentDetectionJob) ID() string { 2609 return "OperationDeserializer" 2610} 2611 2612func (m *awsAwsjson11_deserializeOpDescribeSentimentDetectionJob) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 2613 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 2614) { 2615 out, metadata, err = next.HandleDeserialize(ctx, in) 2616 if err != nil { 2617 return out, metadata, err 2618 } 2619 2620 response, ok := out.RawResponse.(*smithyhttp.Response) 2621 if !ok { 2622 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 2623 } 2624 2625 if response.StatusCode < 200 || response.StatusCode >= 300 { 2626 return out, metadata, awsAwsjson11_deserializeOpErrorDescribeSentimentDetectionJob(response, &metadata) 2627 } 2628 output := &DescribeSentimentDetectionJobOutput{} 2629 out.Result = output 2630 2631 var buff [1024]byte 2632 ringBuffer := smithyio.NewRingBuffer(buff[:]) 2633 2634 body := io.TeeReader(response.Body, ringBuffer) 2635 decoder := json.NewDecoder(body) 2636 decoder.UseNumber() 2637 var shape interface{} 2638 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 2639 var snapshot bytes.Buffer 2640 io.Copy(&snapshot, ringBuffer) 2641 err = &smithy.DeserializationError{ 2642 Err: fmt.Errorf("failed to decode response body, %w", err), 2643 Snapshot: snapshot.Bytes(), 2644 } 2645 return out, metadata, err 2646 } 2647 2648 err = awsAwsjson11_deserializeOpDocumentDescribeSentimentDetectionJobOutput(&output, shape) 2649 if err != nil { 2650 var snapshot bytes.Buffer 2651 io.Copy(&snapshot, ringBuffer) 2652 err = &smithy.DeserializationError{ 2653 Err: fmt.Errorf("failed to decode response body, %w", err), 2654 Snapshot: snapshot.Bytes(), 2655 } 2656 return out, metadata, err 2657 } 2658 2659 return out, metadata, err 2660} 2661 2662func awsAwsjson11_deserializeOpErrorDescribeSentimentDetectionJob(response *smithyhttp.Response, metadata *middleware.Metadata) error { 2663 var errorBuffer bytes.Buffer 2664 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 2665 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 2666 } 2667 errorBody := bytes.NewReader(errorBuffer.Bytes()) 2668 2669 errorCode := "UnknownError" 2670 errorMessage := errorCode 2671 2672 code := response.Header.Get("X-Amzn-ErrorType") 2673 if len(code) != 0 { 2674 errorCode = restjson.SanitizeErrorCode(code) 2675 } 2676 2677 var buff [1024]byte 2678 ringBuffer := smithyio.NewRingBuffer(buff[:]) 2679 2680 body := io.TeeReader(errorBody, ringBuffer) 2681 decoder := json.NewDecoder(body) 2682 decoder.UseNumber() 2683 code, message, err := restjson.GetErrorInfo(decoder) 2684 if err != nil { 2685 var snapshot bytes.Buffer 2686 io.Copy(&snapshot, ringBuffer) 2687 err = &smithy.DeserializationError{ 2688 Err: fmt.Errorf("failed to decode response body, %w", err), 2689 Snapshot: snapshot.Bytes(), 2690 } 2691 return err 2692 } 2693 2694 errorBody.Seek(0, io.SeekStart) 2695 if len(code) != 0 { 2696 errorCode = restjson.SanitizeErrorCode(code) 2697 } 2698 if len(message) != 0 { 2699 errorMessage = message 2700 } 2701 2702 switch { 2703 case strings.EqualFold("InternalServerException", errorCode): 2704 return awsAwsjson11_deserializeErrorInternalServerException(response, errorBody) 2705 2706 case strings.EqualFold("InvalidRequestException", errorCode): 2707 return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody) 2708 2709 case strings.EqualFold("JobNotFoundException", errorCode): 2710 return awsAwsjson11_deserializeErrorJobNotFoundException(response, errorBody) 2711 2712 case strings.EqualFold("TooManyRequestsException", errorCode): 2713 return awsAwsjson11_deserializeErrorTooManyRequestsException(response, errorBody) 2714 2715 default: 2716 genericError := &smithy.GenericAPIError{ 2717 Code: errorCode, 2718 Message: errorMessage, 2719 } 2720 return genericError 2721 2722 } 2723} 2724 2725type awsAwsjson11_deserializeOpDescribeTopicsDetectionJob struct { 2726} 2727 2728func (*awsAwsjson11_deserializeOpDescribeTopicsDetectionJob) ID() string { 2729 return "OperationDeserializer" 2730} 2731 2732func (m *awsAwsjson11_deserializeOpDescribeTopicsDetectionJob) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 2733 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 2734) { 2735 out, metadata, err = next.HandleDeserialize(ctx, in) 2736 if err != nil { 2737 return out, metadata, err 2738 } 2739 2740 response, ok := out.RawResponse.(*smithyhttp.Response) 2741 if !ok { 2742 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 2743 } 2744 2745 if response.StatusCode < 200 || response.StatusCode >= 300 { 2746 return out, metadata, awsAwsjson11_deserializeOpErrorDescribeTopicsDetectionJob(response, &metadata) 2747 } 2748 output := &DescribeTopicsDetectionJobOutput{} 2749 out.Result = output 2750 2751 var buff [1024]byte 2752 ringBuffer := smithyio.NewRingBuffer(buff[:]) 2753 2754 body := io.TeeReader(response.Body, ringBuffer) 2755 decoder := json.NewDecoder(body) 2756 decoder.UseNumber() 2757 var shape interface{} 2758 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 2759 var snapshot bytes.Buffer 2760 io.Copy(&snapshot, ringBuffer) 2761 err = &smithy.DeserializationError{ 2762 Err: fmt.Errorf("failed to decode response body, %w", err), 2763 Snapshot: snapshot.Bytes(), 2764 } 2765 return out, metadata, err 2766 } 2767 2768 err = awsAwsjson11_deserializeOpDocumentDescribeTopicsDetectionJobOutput(&output, shape) 2769 if err != nil { 2770 var snapshot bytes.Buffer 2771 io.Copy(&snapshot, ringBuffer) 2772 err = &smithy.DeserializationError{ 2773 Err: fmt.Errorf("failed to decode response body, %w", err), 2774 Snapshot: snapshot.Bytes(), 2775 } 2776 return out, metadata, err 2777 } 2778 2779 return out, metadata, err 2780} 2781 2782func awsAwsjson11_deserializeOpErrorDescribeTopicsDetectionJob(response *smithyhttp.Response, metadata *middleware.Metadata) error { 2783 var errorBuffer bytes.Buffer 2784 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 2785 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 2786 } 2787 errorBody := bytes.NewReader(errorBuffer.Bytes()) 2788 2789 errorCode := "UnknownError" 2790 errorMessage := errorCode 2791 2792 code := response.Header.Get("X-Amzn-ErrorType") 2793 if len(code) != 0 { 2794 errorCode = restjson.SanitizeErrorCode(code) 2795 } 2796 2797 var buff [1024]byte 2798 ringBuffer := smithyio.NewRingBuffer(buff[:]) 2799 2800 body := io.TeeReader(errorBody, ringBuffer) 2801 decoder := json.NewDecoder(body) 2802 decoder.UseNumber() 2803 code, message, err := restjson.GetErrorInfo(decoder) 2804 if err != nil { 2805 var snapshot bytes.Buffer 2806 io.Copy(&snapshot, ringBuffer) 2807 err = &smithy.DeserializationError{ 2808 Err: fmt.Errorf("failed to decode response body, %w", err), 2809 Snapshot: snapshot.Bytes(), 2810 } 2811 return err 2812 } 2813 2814 errorBody.Seek(0, io.SeekStart) 2815 if len(code) != 0 { 2816 errorCode = restjson.SanitizeErrorCode(code) 2817 } 2818 if len(message) != 0 { 2819 errorMessage = message 2820 } 2821 2822 switch { 2823 case strings.EqualFold("InternalServerException", errorCode): 2824 return awsAwsjson11_deserializeErrorInternalServerException(response, errorBody) 2825 2826 case strings.EqualFold("InvalidRequestException", errorCode): 2827 return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody) 2828 2829 case strings.EqualFold("JobNotFoundException", errorCode): 2830 return awsAwsjson11_deserializeErrorJobNotFoundException(response, errorBody) 2831 2832 case strings.EqualFold("TooManyRequestsException", errorCode): 2833 return awsAwsjson11_deserializeErrorTooManyRequestsException(response, errorBody) 2834 2835 default: 2836 genericError := &smithy.GenericAPIError{ 2837 Code: errorCode, 2838 Message: errorMessage, 2839 } 2840 return genericError 2841 2842 } 2843} 2844 2845type awsAwsjson11_deserializeOpDetectDominantLanguage struct { 2846} 2847 2848func (*awsAwsjson11_deserializeOpDetectDominantLanguage) ID() string { 2849 return "OperationDeserializer" 2850} 2851 2852func (m *awsAwsjson11_deserializeOpDetectDominantLanguage) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 2853 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 2854) { 2855 out, metadata, err = next.HandleDeserialize(ctx, in) 2856 if err != nil { 2857 return out, metadata, err 2858 } 2859 2860 response, ok := out.RawResponse.(*smithyhttp.Response) 2861 if !ok { 2862 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 2863 } 2864 2865 if response.StatusCode < 200 || response.StatusCode >= 300 { 2866 return out, metadata, awsAwsjson11_deserializeOpErrorDetectDominantLanguage(response, &metadata) 2867 } 2868 output := &DetectDominantLanguageOutput{} 2869 out.Result = output 2870 2871 var buff [1024]byte 2872 ringBuffer := smithyio.NewRingBuffer(buff[:]) 2873 2874 body := io.TeeReader(response.Body, ringBuffer) 2875 decoder := json.NewDecoder(body) 2876 decoder.UseNumber() 2877 var shape interface{} 2878 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 2879 var snapshot bytes.Buffer 2880 io.Copy(&snapshot, ringBuffer) 2881 err = &smithy.DeserializationError{ 2882 Err: fmt.Errorf("failed to decode response body, %w", err), 2883 Snapshot: snapshot.Bytes(), 2884 } 2885 return out, metadata, err 2886 } 2887 2888 err = awsAwsjson11_deserializeOpDocumentDetectDominantLanguageOutput(&output, shape) 2889 if err != nil { 2890 var snapshot bytes.Buffer 2891 io.Copy(&snapshot, ringBuffer) 2892 err = &smithy.DeserializationError{ 2893 Err: fmt.Errorf("failed to decode response body, %w", err), 2894 Snapshot: snapshot.Bytes(), 2895 } 2896 return out, metadata, err 2897 } 2898 2899 return out, metadata, err 2900} 2901 2902func awsAwsjson11_deserializeOpErrorDetectDominantLanguage(response *smithyhttp.Response, metadata *middleware.Metadata) error { 2903 var errorBuffer bytes.Buffer 2904 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 2905 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 2906 } 2907 errorBody := bytes.NewReader(errorBuffer.Bytes()) 2908 2909 errorCode := "UnknownError" 2910 errorMessage := errorCode 2911 2912 code := response.Header.Get("X-Amzn-ErrorType") 2913 if len(code) != 0 { 2914 errorCode = restjson.SanitizeErrorCode(code) 2915 } 2916 2917 var buff [1024]byte 2918 ringBuffer := smithyio.NewRingBuffer(buff[:]) 2919 2920 body := io.TeeReader(errorBody, ringBuffer) 2921 decoder := json.NewDecoder(body) 2922 decoder.UseNumber() 2923 code, message, err := restjson.GetErrorInfo(decoder) 2924 if err != nil { 2925 var snapshot bytes.Buffer 2926 io.Copy(&snapshot, ringBuffer) 2927 err = &smithy.DeserializationError{ 2928 Err: fmt.Errorf("failed to decode response body, %w", err), 2929 Snapshot: snapshot.Bytes(), 2930 } 2931 return err 2932 } 2933 2934 errorBody.Seek(0, io.SeekStart) 2935 if len(code) != 0 { 2936 errorCode = restjson.SanitizeErrorCode(code) 2937 } 2938 if len(message) != 0 { 2939 errorMessage = message 2940 } 2941 2942 switch { 2943 case strings.EqualFold("InternalServerException", errorCode): 2944 return awsAwsjson11_deserializeErrorInternalServerException(response, errorBody) 2945 2946 case strings.EqualFold("InvalidRequestException", errorCode): 2947 return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody) 2948 2949 case strings.EqualFold("TextSizeLimitExceededException", errorCode): 2950 return awsAwsjson11_deserializeErrorTextSizeLimitExceededException(response, errorBody) 2951 2952 default: 2953 genericError := &smithy.GenericAPIError{ 2954 Code: errorCode, 2955 Message: errorMessage, 2956 } 2957 return genericError 2958 2959 } 2960} 2961 2962type awsAwsjson11_deserializeOpDetectEntities struct { 2963} 2964 2965func (*awsAwsjson11_deserializeOpDetectEntities) ID() string { 2966 return "OperationDeserializer" 2967} 2968 2969func (m *awsAwsjson11_deserializeOpDetectEntities) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 2970 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 2971) { 2972 out, metadata, err = next.HandleDeserialize(ctx, in) 2973 if err != nil { 2974 return out, metadata, err 2975 } 2976 2977 response, ok := out.RawResponse.(*smithyhttp.Response) 2978 if !ok { 2979 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 2980 } 2981 2982 if response.StatusCode < 200 || response.StatusCode >= 300 { 2983 return out, metadata, awsAwsjson11_deserializeOpErrorDetectEntities(response, &metadata) 2984 } 2985 output := &DetectEntitiesOutput{} 2986 out.Result = output 2987 2988 var buff [1024]byte 2989 ringBuffer := smithyio.NewRingBuffer(buff[:]) 2990 2991 body := io.TeeReader(response.Body, ringBuffer) 2992 decoder := json.NewDecoder(body) 2993 decoder.UseNumber() 2994 var shape interface{} 2995 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 2996 var snapshot bytes.Buffer 2997 io.Copy(&snapshot, ringBuffer) 2998 err = &smithy.DeserializationError{ 2999 Err: fmt.Errorf("failed to decode response body, %w", err), 3000 Snapshot: snapshot.Bytes(), 3001 } 3002 return out, metadata, err 3003 } 3004 3005 err = awsAwsjson11_deserializeOpDocumentDetectEntitiesOutput(&output, shape) 3006 if err != nil { 3007 var snapshot bytes.Buffer 3008 io.Copy(&snapshot, ringBuffer) 3009 err = &smithy.DeserializationError{ 3010 Err: fmt.Errorf("failed to decode response body, %w", err), 3011 Snapshot: snapshot.Bytes(), 3012 } 3013 return out, metadata, err 3014 } 3015 3016 return out, metadata, err 3017} 3018 3019func awsAwsjson11_deserializeOpErrorDetectEntities(response *smithyhttp.Response, metadata *middleware.Metadata) error { 3020 var errorBuffer bytes.Buffer 3021 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 3022 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 3023 } 3024 errorBody := bytes.NewReader(errorBuffer.Bytes()) 3025 3026 errorCode := "UnknownError" 3027 errorMessage := errorCode 3028 3029 code := response.Header.Get("X-Amzn-ErrorType") 3030 if len(code) != 0 { 3031 errorCode = restjson.SanitizeErrorCode(code) 3032 } 3033 3034 var buff [1024]byte 3035 ringBuffer := smithyio.NewRingBuffer(buff[:]) 3036 3037 body := io.TeeReader(errorBody, ringBuffer) 3038 decoder := json.NewDecoder(body) 3039 decoder.UseNumber() 3040 code, message, err := restjson.GetErrorInfo(decoder) 3041 if err != nil { 3042 var snapshot bytes.Buffer 3043 io.Copy(&snapshot, ringBuffer) 3044 err = &smithy.DeserializationError{ 3045 Err: fmt.Errorf("failed to decode response body, %w", err), 3046 Snapshot: snapshot.Bytes(), 3047 } 3048 return err 3049 } 3050 3051 errorBody.Seek(0, io.SeekStart) 3052 if len(code) != 0 { 3053 errorCode = restjson.SanitizeErrorCode(code) 3054 } 3055 if len(message) != 0 { 3056 errorMessage = message 3057 } 3058 3059 switch { 3060 case strings.EqualFold("InternalServerException", errorCode): 3061 return awsAwsjson11_deserializeErrorInternalServerException(response, errorBody) 3062 3063 case strings.EqualFold("InvalidRequestException", errorCode): 3064 return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody) 3065 3066 case strings.EqualFold("ResourceUnavailableException", errorCode): 3067 return awsAwsjson11_deserializeErrorResourceUnavailableException(response, errorBody) 3068 3069 case strings.EqualFold("TextSizeLimitExceededException", errorCode): 3070 return awsAwsjson11_deserializeErrorTextSizeLimitExceededException(response, errorBody) 3071 3072 case strings.EqualFold("UnsupportedLanguageException", errorCode): 3073 return awsAwsjson11_deserializeErrorUnsupportedLanguageException(response, errorBody) 3074 3075 default: 3076 genericError := &smithy.GenericAPIError{ 3077 Code: errorCode, 3078 Message: errorMessage, 3079 } 3080 return genericError 3081 3082 } 3083} 3084 3085type awsAwsjson11_deserializeOpDetectKeyPhrases struct { 3086} 3087 3088func (*awsAwsjson11_deserializeOpDetectKeyPhrases) ID() string { 3089 return "OperationDeserializer" 3090} 3091 3092func (m *awsAwsjson11_deserializeOpDetectKeyPhrases) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 3093 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 3094) { 3095 out, metadata, err = next.HandleDeserialize(ctx, in) 3096 if err != nil { 3097 return out, metadata, err 3098 } 3099 3100 response, ok := out.RawResponse.(*smithyhttp.Response) 3101 if !ok { 3102 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 3103 } 3104 3105 if response.StatusCode < 200 || response.StatusCode >= 300 { 3106 return out, metadata, awsAwsjson11_deserializeOpErrorDetectKeyPhrases(response, &metadata) 3107 } 3108 output := &DetectKeyPhrasesOutput{} 3109 out.Result = output 3110 3111 var buff [1024]byte 3112 ringBuffer := smithyio.NewRingBuffer(buff[:]) 3113 3114 body := io.TeeReader(response.Body, ringBuffer) 3115 decoder := json.NewDecoder(body) 3116 decoder.UseNumber() 3117 var shape interface{} 3118 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 3119 var snapshot bytes.Buffer 3120 io.Copy(&snapshot, ringBuffer) 3121 err = &smithy.DeserializationError{ 3122 Err: fmt.Errorf("failed to decode response body, %w", err), 3123 Snapshot: snapshot.Bytes(), 3124 } 3125 return out, metadata, err 3126 } 3127 3128 err = awsAwsjson11_deserializeOpDocumentDetectKeyPhrasesOutput(&output, shape) 3129 if err != nil { 3130 var snapshot bytes.Buffer 3131 io.Copy(&snapshot, ringBuffer) 3132 err = &smithy.DeserializationError{ 3133 Err: fmt.Errorf("failed to decode response body, %w", err), 3134 Snapshot: snapshot.Bytes(), 3135 } 3136 return out, metadata, err 3137 } 3138 3139 return out, metadata, err 3140} 3141 3142func awsAwsjson11_deserializeOpErrorDetectKeyPhrases(response *smithyhttp.Response, metadata *middleware.Metadata) error { 3143 var errorBuffer bytes.Buffer 3144 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 3145 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 3146 } 3147 errorBody := bytes.NewReader(errorBuffer.Bytes()) 3148 3149 errorCode := "UnknownError" 3150 errorMessage := errorCode 3151 3152 code := response.Header.Get("X-Amzn-ErrorType") 3153 if len(code) != 0 { 3154 errorCode = restjson.SanitizeErrorCode(code) 3155 } 3156 3157 var buff [1024]byte 3158 ringBuffer := smithyio.NewRingBuffer(buff[:]) 3159 3160 body := io.TeeReader(errorBody, ringBuffer) 3161 decoder := json.NewDecoder(body) 3162 decoder.UseNumber() 3163 code, message, err := restjson.GetErrorInfo(decoder) 3164 if err != nil { 3165 var snapshot bytes.Buffer 3166 io.Copy(&snapshot, ringBuffer) 3167 err = &smithy.DeserializationError{ 3168 Err: fmt.Errorf("failed to decode response body, %w", err), 3169 Snapshot: snapshot.Bytes(), 3170 } 3171 return err 3172 } 3173 3174 errorBody.Seek(0, io.SeekStart) 3175 if len(code) != 0 { 3176 errorCode = restjson.SanitizeErrorCode(code) 3177 } 3178 if len(message) != 0 { 3179 errorMessage = message 3180 } 3181 3182 switch { 3183 case strings.EqualFold("InternalServerException", errorCode): 3184 return awsAwsjson11_deserializeErrorInternalServerException(response, errorBody) 3185 3186 case strings.EqualFold("InvalidRequestException", errorCode): 3187 return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody) 3188 3189 case strings.EqualFold("TextSizeLimitExceededException", errorCode): 3190 return awsAwsjson11_deserializeErrorTextSizeLimitExceededException(response, errorBody) 3191 3192 case strings.EqualFold("UnsupportedLanguageException", errorCode): 3193 return awsAwsjson11_deserializeErrorUnsupportedLanguageException(response, errorBody) 3194 3195 default: 3196 genericError := &smithy.GenericAPIError{ 3197 Code: errorCode, 3198 Message: errorMessage, 3199 } 3200 return genericError 3201 3202 } 3203} 3204 3205type awsAwsjson11_deserializeOpDetectPiiEntities struct { 3206} 3207 3208func (*awsAwsjson11_deserializeOpDetectPiiEntities) ID() string { 3209 return "OperationDeserializer" 3210} 3211 3212func (m *awsAwsjson11_deserializeOpDetectPiiEntities) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 3213 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 3214) { 3215 out, metadata, err = next.HandleDeserialize(ctx, in) 3216 if err != nil { 3217 return out, metadata, err 3218 } 3219 3220 response, ok := out.RawResponse.(*smithyhttp.Response) 3221 if !ok { 3222 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 3223 } 3224 3225 if response.StatusCode < 200 || response.StatusCode >= 300 { 3226 return out, metadata, awsAwsjson11_deserializeOpErrorDetectPiiEntities(response, &metadata) 3227 } 3228 output := &DetectPiiEntitiesOutput{} 3229 out.Result = output 3230 3231 var buff [1024]byte 3232 ringBuffer := smithyio.NewRingBuffer(buff[:]) 3233 3234 body := io.TeeReader(response.Body, ringBuffer) 3235 decoder := json.NewDecoder(body) 3236 decoder.UseNumber() 3237 var shape interface{} 3238 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 3239 var snapshot bytes.Buffer 3240 io.Copy(&snapshot, ringBuffer) 3241 err = &smithy.DeserializationError{ 3242 Err: fmt.Errorf("failed to decode response body, %w", err), 3243 Snapshot: snapshot.Bytes(), 3244 } 3245 return out, metadata, err 3246 } 3247 3248 err = awsAwsjson11_deserializeOpDocumentDetectPiiEntitiesOutput(&output, shape) 3249 if err != nil { 3250 var snapshot bytes.Buffer 3251 io.Copy(&snapshot, ringBuffer) 3252 err = &smithy.DeserializationError{ 3253 Err: fmt.Errorf("failed to decode response body, %w", err), 3254 Snapshot: snapshot.Bytes(), 3255 } 3256 return out, metadata, err 3257 } 3258 3259 return out, metadata, err 3260} 3261 3262func awsAwsjson11_deserializeOpErrorDetectPiiEntities(response *smithyhttp.Response, metadata *middleware.Metadata) error { 3263 var errorBuffer bytes.Buffer 3264 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 3265 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 3266 } 3267 errorBody := bytes.NewReader(errorBuffer.Bytes()) 3268 3269 errorCode := "UnknownError" 3270 errorMessage := errorCode 3271 3272 code := response.Header.Get("X-Amzn-ErrorType") 3273 if len(code) != 0 { 3274 errorCode = restjson.SanitizeErrorCode(code) 3275 } 3276 3277 var buff [1024]byte 3278 ringBuffer := smithyio.NewRingBuffer(buff[:]) 3279 3280 body := io.TeeReader(errorBody, ringBuffer) 3281 decoder := json.NewDecoder(body) 3282 decoder.UseNumber() 3283 code, message, err := restjson.GetErrorInfo(decoder) 3284 if err != nil { 3285 var snapshot bytes.Buffer 3286 io.Copy(&snapshot, ringBuffer) 3287 err = &smithy.DeserializationError{ 3288 Err: fmt.Errorf("failed to decode response body, %w", err), 3289 Snapshot: snapshot.Bytes(), 3290 } 3291 return err 3292 } 3293 3294 errorBody.Seek(0, io.SeekStart) 3295 if len(code) != 0 { 3296 errorCode = restjson.SanitizeErrorCode(code) 3297 } 3298 if len(message) != 0 { 3299 errorMessage = message 3300 } 3301 3302 switch { 3303 case strings.EqualFold("InternalServerException", errorCode): 3304 return awsAwsjson11_deserializeErrorInternalServerException(response, errorBody) 3305 3306 case strings.EqualFold("InvalidRequestException", errorCode): 3307 return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody) 3308 3309 case strings.EqualFold("TextSizeLimitExceededException", errorCode): 3310 return awsAwsjson11_deserializeErrorTextSizeLimitExceededException(response, errorBody) 3311 3312 case strings.EqualFold("UnsupportedLanguageException", errorCode): 3313 return awsAwsjson11_deserializeErrorUnsupportedLanguageException(response, errorBody) 3314 3315 default: 3316 genericError := &smithy.GenericAPIError{ 3317 Code: errorCode, 3318 Message: errorMessage, 3319 } 3320 return genericError 3321 3322 } 3323} 3324 3325type awsAwsjson11_deserializeOpDetectSentiment struct { 3326} 3327 3328func (*awsAwsjson11_deserializeOpDetectSentiment) ID() string { 3329 return "OperationDeserializer" 3330} 3331 3332func (m *awsAwsjson11_deserializeOpDetectSentiment) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 3333 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 3334) { 3335 out, metadata, err = next.HandleDeserialize(ctx, in) 3336 if err != nil { 3337 return out, metadata, err 3338 } 3339 3340 response, ok := out.RawResponse.(*smithyhttp.Response) 3341 if !ok { 3342 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 3343 } 3344 3345 if response.StatusCode < 200 || response.StatusCode >= 300 { 3346 return out, metadata, awsAwsjson11_deserializeOpErrorDetectSentiment(response, &metadata) 3347 } 3348 output := &DetectSentimentOutput{} 3349 out.Result = output 3350 3351 var buff [1024]byte 3352 ringBuffer := smithyio.NewRingBuffer(buff[:]) 3353 3354 body := io.TeeReader(response.Body, ringBuffer) 3355 decoder := json.NewDecoder(body) 3356 decoder.UseNumber() 3357 var shape interface{} 3358 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 3359 var snapshot bytes.Buffer 3360 io.Copy(&snapshot, ringBuffer) 3361 err = &smithy.DeserializationError{ 3362 Err: fmt.Errorf("failed to decode response body, %w", err), 3363 Snapshot: snapshot.Bytes(), 3364 } 3365 return out, metadata, err 3366 } 3367 3368 err = awsAwsjson11_deserializeOpDocumentDetectSentimentOutput(&output, shape) 3369 if err != nil { 3370 var snapshot bytes.Buffer 3371 io.Copy(&snapshot, ringBuffer) 3372 err = &smithy.DeserializationError{ 3373 Err: fmt.Errorf("failed to decode response body, %w", err), 3374 Snapshot: snapshot.Bytes(), 3375 } 3376 return out, metadata, err 3377 } 3378 3379 return out, metadata, err 3380} 3381 3382func awsAwsjson11_deserializeOpErrorDetectSentiment(response *smithyhttp.Response, metadata *middleware.Metadata) error { 3383 var errorBuffer bytes.Buffer 3384 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 3385 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 3386 } 3387 errorBody := bytes.NewReader(errorBuffer.Bytes()) 3388 3389 errorCode := "UnknownError" 3390 errorMessage := errorCode 3391 3392 code := response.Header.Get("X-Amzn-ErrorType") 3393 if len(code) != 0 { 3394 errorCode = restjson.SanitizeErrorCode(code) 3395 } 3396 3397 var buff [1024]byte 3398 ringBuffer := smithyio.NewRingBuffer(buff[:]) 3399 3400 body := io.TeeReader(errorBody, ringBuffer) 3401 decoder := json.NewDecoder(body) 3402 decoder.UseNumber() 3403 code, message, err := restjson.GetErrorInfo(decoder) 3404 if err != nil { 3405 var snapshot bytes.Buffer 3406 io.Copy(&snapshot, ringBuffer) 3407 err = &smithy.DeserializationError{ 3408 Err: fmt.Errorf("failed to decode response body, %w", err), 3409 Snapshot: snapshot.Bytes(), 3410 } 3411 return err 3412 } 3413 3414 errorBody.Seek(0, io.SeekStart) 3415 if len(code) != 0 { 3416 errorCode = restjson.SanitizeErrorCode(code) 3417 } 3418 if len(message) != 0 { 3419 errorMessage = message 3420 } 3421 3422 switch { 3423 case strings.EqualFold("InternalServerException", errorCode): 3424 return awsAwsjson11_deserializeErrorInternalServerException(response, errorBody) 3425 3426 case strings.EqualFold("InvalidRequestException", errorCode): 3427 return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody) 3428 3429 case strings.EqualFold("TextSizeLimitExceededException", errorCode): 3430 return awsAwsjson11_deserializeErrorTextSizeLimitExceededException(response, errorBody) 3431 3432 case strings.EqualFold("UnsupportedLanguageException", errorCode): 3433 return awsAwsjson11_deserializeErrorUnsupportedLanguageException(response, errorBody) 3434 3435 default: 3436 genericError := &smithy.GenericAPIError{ 3437 Code: errorCode, 3438 Message: errorMessage, 3439 } 3440 return genericError 3441 3442 } 3443} 3444 3445type awsAwsjson11_deserializeOpDetectSyntax struct { 3446} 3447 3448func (*awsAwsjson11_deserializeOpDetectSyntax) ID() string { 3449 return "OperationDeserializer" 3450} 3451 3452func (m *awsAwsjson11_deserializeOpDetectSyntax) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 3453 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 3454) { 3455 out, metadata, err = next.HandleDeserialize(ctx, in) 3456 if err != nil { 3457 return out, metadata, err 3458 } 3459 3460 response, ok := out.RawResponse.(*smithyhttp.Response) 3461 if !ok { 3462 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 3463 } 3464 3465 if response.StatusCode < 200 || response.StatusCode >= 300 { 3466 return out, metadata, awsAwsjson11_deserializeOpErrorDetectSyntax(response, &metadata) 3467 } 3468 output := &DetectSyntaxOutput{} 3469 out.Result = output 3470 3471 var buff [1024]byte 3472 ringBuffer := smithyio.NewRingBuffer(buff[:]) 3473 3474 body := io.TeeReader(response.Body, ringBuffer) 3475 decoder := json.NewDecoder(body) 3476 decoder.UseNumber() 3477 var shape interface{} 3478 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 3479 var snapshot bytes.Buffer 3480 io.Copy(&snapshot, ringBuffer) 3481 err = &smithy.DeserializationError{ 3482 Err: fmt.Errorf("failed to decode response body, %w", err), 3483 Snapshot: snapshot.Bytes(), 3484 } 3485 return out, metadata, err 3486 } 3487 3488 err = awsAwsjson11_deserializeOpDocumentDetectSyntaxOutput(&output, shape) 3489 if err != nil { 3490 var snapshot bytes.Buffer 3491 io.Copy(&snapshot, ringBuffer) 3492 err = &smithy.DeserializationError{ 3493 Err: fmt.Errorf("failed to decode response body, %w", err), 3494 Snapshot: snapshot.Bytes(), 3495 } 3496 return out, metadata, err 3497 } 3498 3499 return out, metadata, err 3500} 3501 3502func awsAwsjson11_deserializeOpErrorDetectSyntax(response *smithyhttp.Response, metadata *middleware.Metadata) error { 3503 var errorBuffer bytes.Buffer 3504 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 3505 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 3506 } 3507 errorBody := bytes.NewReader(errorBuffer.Bytes()) 3508 3509 errorCode := "UnknownError" 3510 errorMessage := errorCode 3511 3512 code := response.Header.Get("X-Amzn-ErrorType") 3513 if len(code) != 0 { 3514 errorCode = restjson.SanitizeErrorCode(code) 3515 } 3516 3517 var buff [1024]byte 3518 ringBuffer := smithyio.NewRingBuffer(buff[:]) 3519 3520 body := io.TeeReader(errorBody, ringBuffer) 3521 decoder := json.NewDecoder(body) 3522 decoder.UseNumber() 3523 code, message, err := restjson.GetErrorInfo(decoder) 3524 if err != nil { 3525 var snapshot bytes.Buffer 3526 io.Copy(&snapshot, ringBuffer) 3527 err = &smithy.DeserializationError{ 3528 Err: fmt.Errorf("failed to decode response body, %w", err), 3529 Snapshot: snapshot.Bytes(), 3530 } 3531 return err 3532 } 3533 3534 errorBody.Seek(0, io.SeekStart) 3535 if len(code) != 0 { 3536 errorCode = restjson.SanitizeErrorCode(code) 3537 } 3538 if len(message) != 0 { 3539 errorMessage = message 3540 } 3541 3542 switch { 3543 case strings.EqualFold("InternalServerException", errorCode): 3544 return awsAwsjson11_deserializeErrorInternalServerException(response, errorBody) 3545 3546 case strings.EqualFold("InvalidRequestException", errorCode): 3547 return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody) 3548 3549 case strings.EqualFold("TextSizeLimitExceededException", errorCode): 3550 return awsAwsjson11_deserializeErrorTextSizeLimitExceededException(response, errorBody) 3551 3552 case strings.EqualFold("UnsupportedLanguageException", errorCode): 3553 return awsAwsjson11_deserializeErrorUnsupportedLanguageException(response, errorBody) 3554 3555 default: 3556 genericError := &smithy.GenericAPIError{ 3557 Code: errorCode, 3558 Message: errorMessage, 3559 } 3560 return genericError 3561 3562 } 3563} 3564 3565type awsAwsjson11_deserializeOpListDocumentClassificationJobs struct { 3566} 3567 3568func (*awsAwsjson11_deserializeOpListDocumentClassificationJobs) ID() string { 3569 return "OperationDeserializer" 3570} 3571 3572func (m *awsAwsjson11_deserializeOpListDocumentClassificationJobs) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 3573 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 3574) { 3575 out, metadata, err = next.HandleDeserialize(ctx, in) 3576 if err != nil { 3577 return out, metadata, err 3578 } 3579 3580 response, ok := out.RawResponse.(*smithyhttp.Response) 3581 if !ok { 3582 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 3583 } 3584 3585 if response.StatusCode < 200 || response.StatusCode >= 300 { 3586 return out, metadata, awsAwsjson11_deserializeOpErrorListDocumentClassificationJobs(response, &metadata) 3587 } 3588 output := &ListDocumentClassificationJobsOutput{} 3589 out.Result = output 3590 3591 var buff [1024]byte 3592 ringBuffer := smithyio.NewRingBuffer(buff[:]) 3593 3594 body := io.TeeReader(response.Body, ringBuffer) 3595 decoder := json.NewDecoder(body) 3596 decoder.UseNumber() 3597 var shape interface{} 3598 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 3599 var snapshot bytes.Buffer 3600 io.Copy(&snapshot, ringBuffer) 3601 err = &smithy.DeserializationError{ 3602 Err: fmt.Errorf("failed to decode response body, %w", err), 3603 Snapshot: snapshot.Bytes(), 3604 } 3605 return out, metadata, err 3606 } 3607 3608 err = awsAwsjson11_deserializeOpDocumentListDocumentClassificationJobsOutput(&output, shape) 3609 if err != nil { 3610 var snapshot bytes.Buffer 3611 io.Copy(&snapshot, ringBuffer) 3612 err = &smithy.DeserializationError{ 3613 Err: fmt.Errorf("failed to decode response body, %w", err), 3614 Snapshot: snapshot.Bytes(), 3615 } 3616 return out, metadata, err 3617 } 3618 3619 return out, metadata, err 3620} 3621 3622func awsAwsjson11_deserializeOpErrorListDocumentClassificationJobs(response *smithyhttp.Response, metadata *middleware.Metadata) error { 3623 var errorBuffer bytes.Buffer 3624 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 3625 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 3626 } 3627 errorBody := bytes.NewReader(errorBuffer.Bytes()) 3628 3629 errorCode := "UnknownError" 3630 errorMessage := errorCode 3631 3632 code := response.Header.Get("X-Amzn-ErrorType") 3633 if len(code) != 0 { 3634 errorCode = restjson.SanitizeErrorCode(code) 3635 } 3636 3637 var buff [1024]byte 3638 ringBuffer := smithyio.NewRingBuffer(buff[:]) 3639 3640 body := io.TeeReader(errorBody, ringBuffer) 3641 decoder := json.NewDecoder(body) 3642 decoder.UseNumber() 3643 code, message, err := restjson.GetErrorInfo(decoder) 3644 if err != nil { 3645 var snapshot bytes.Buffer 3646 io.Copy(&snapshot, ringBuffer) 3647 err = &smithy.DeserializationError{ 3648 Err: fmt.Errorf("failed to decode response body, %w", err), 3649 Snapshot: snapshot.Bytes(), 3650 } 3651 return err 3652 } 3653 3654 errorBody.Seek(0, io.SeekStart) 3655 if len(code) != 0 { 3656 errorCode = restjson.SanitizeErrorCode(code) 3657 } 3658 if len(message) != 0 { 3659 errorMessage = message 3660 } 3661 3662 switch { 3663 case strings.EqualFold("InternalServerException", errorCode): 3664 return awsAwsjson11_deserializeErrorInternalServerException(response, errorBody) 3665 3666 case strings.EqualFold("InvalidFilterException", errorCode): 3667 return awsAwsjson11_deserializeErrorInvalidFilterException(response, errorBody) 3668 3669 case strings.EqualFold("InvalidRequestException", errorCode): 3670 return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody) 3671 3672 case strings.EqualFold("TooManyRequestsException", errorCode): 3673 return awsAwsjson11_deserializeErrorTooManyRequestsException(response, errorBody) 3674 3675 default: 3676 genericError := &smithy.GenericAPIError{ 3677 Code: errorCode, 3678 Message: errorMessage, 3679 } 3680 return genericError 3681 3682 } 3683} 3684 3685type awsAwsjson11_deserializeOpListDocumentClassifiers struct { 3686} 3687 3688func (*awsAwsjson11_deserializeOpListDocumentClassifiers) ID() string { 3689 return "OperationDeserializer" 3690} 3691 3692func (m *awsAwsjson11_deserializeOpListDocumentClassifiers) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 3693 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 3694) { 3695 out, metadata, err = next.HandleDeserialize(ctx, in) 3696 if err != nil { 3697 return out, metadata, err 3698 } 3699 3700 response, ok := out.RawResponse.(*smithyhttp.Response) 3701 if !ok { 3702 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 3703 } 3704 3705 if response.StatusCode < 200 || response.StatusCode >= 300 { 3706 return out, metadata, awsAwsjson11_deserializeOpErrorListDocumentClassifiers(response, &metadata) 3707 } 3708 output := &ListDocumentClassifiersOutput{} 3709 out.Result = output 3710 3711 var buff [1024]byte 3712 ringBuffer := smithyio.NewRingBuffer(buff[:]) 3713 3714 body := io.TeeReader(response.Body, ringBuffer) 3715 decoder := json.NewDecoder(body) 3716 decoder.UseNumber() 3717 var shape interface{} 3718 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 3719 var snapshot bytes.Buffer 3720 io.Copy(&snapshot, ringBuffer) 3721 err = &smithy.DeserializationError{ 3722 Err: fmt.Errorf("failed to decode response body, %w", err), 3723 Snapshot: snapshot.Bytes(), 3724 } 3725 return out, metadata, err 3726 } 3727 3728 err = awsAwsjson11_deserializeOpDocumentListDocumentClassifiersOutput(&output, shape) 3729 if err != nil { 3730 var snapshot bytes.Buffer 3731 io.Copy(&snapshot, ringBuffer) 3732 err = &smithy.DeserializationError{ 3733 Err: fmt.Errorf("failed to decode response body, %w", err), 3734 Snapshot: snapshot.Bytes(), 3735 } 3736 return out, metadata, err 3737 } 3738 3739 return out, metadata, err 3740} 3741 3742func awsAwsjson11_deserializeOpErrorListDocumentClassifiers(response *smithyhttp.Response, metadata *middleware.Metadata) error { 3743 var errorBuffer bytes.Buffer 3744 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 3745 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 3746 } 3747 errorBody := bytes.NewReader(errorBuffer.Bytes()) 3748 3749 errorCode := "UnknownError" 3750 errorMessage := errorCode 3751 3752 code := response.Header.Get("X-Amzn-ErrorType") 3753 if len(code) != 0 { 3754 errorCode = restjson.SanitizeErrorCode(code) 3755 } 3756 3757 var buff [1024]byte 3758 ringBuffer := smithyio.NewRingBuffer(buff[:]) 3759 3760 body := io.TeeReader(errorBody, ringBuffer) 3761 decoder := json.NewDecoder(body) 3762 decoder.UseNumber() 3763 code, message, err := restjson.GetErrorInfo(decoder) 3764 if err != nil { 3765 var snapshot bytes.Buffer 3766 io.Copy(&snapshot, ringBuffer) 3767 err = &smithy.DeserializationError{ 3768 Err: fmt.Errorf("failed to decode response body, %w", err), 3769 Snapshot: snapshot.Bytes(), 3770 } 3771 return err 3772 } 3773 3774 errorBody.Seek(0, io.SeekStart) 3775 if len(code) != 0 { 3776 errorCode = restjson.SanitizeErrorCode(code) 3777 } 3778 if len(message) != 0 { 3779 errorMessage = message 3780 } 3781 3782 switch { 3783 case strings.EqualFold("InternalServerException", errorCode): 3784 return awsAwsjson11_deserializeErrorInternalServerException(response, errorBody) 3785 3786 case strings.EqualFold("InvalidFilterException", errorCode): 3787 return awsAwsjson11_deserializeErrorInvalidFilterException(response, errorBody) 3788 3789 case strings.EqualFold("InvalidRequestException", errorCode): 3790 return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody) 3791 3792 case strings.EqualFold("TooManyRequestsException", errorCode): 3793 return awsAwsjson11_deserializeErrorTooManyRequestsException(response, errorBody) 3794 3795 default: 3796 genericError := &smithy.GenericAPIError{ 3797 Code: errorCode, 3798 Message: errorMessage, 3799 } 3800 return genericError 3801 3802 } 3803} 3804 3805type awsAwsjson11_deserializeOpListDominantLanguageDetectionJobs struct { 3806} 3807 3808func (*awsAwsjson11_deserializeOpListDominantLanguageDetectionJobs) ID() string { 3809 return "OperationDeserializer" 3810} 3811 3812func (m *awsAwsjson11_deserializeOpListDominantLanguageDetectionJobs) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 3813 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 3814) { 3815 out, metadata, err = next.HandleDeserialize(ctx, in) 3816 if err != nil { 3817 return out, metadata, err 3818 } 3819 3820 response, ok := out.RawResponse.(*smithyhttp.Response) 3821 if !ok { 3822 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 3823 } 3824 3825 if response.StatusCode < 200 || response.StatusCode >= 300 { 3826 return out, metadata, awsAwsjson11_deserializeOpErrorListDominantLanguageDetectionJobs(response, &metadata) 3827 } 3828 output := &ListDominantLanguageDetectionJobsOutput{} 3829 out.Result = output 3830 3831 var buff [1024]byte 3832 ringBuffer := smithyio.NewRingBuffer(buff[:]) 3833 3834 body := io.TeeReader(response.Body, ringBuffer) 3835 decoder := json.NewDecoder(body) 3836 decoder.UseNumber() 3837 var shape interface{} 3838 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 3839 var snapshot bytes.Buffer 3840 io.Copy(&snapshot, ringBuffer) 3841 err = &smithy.DeserializationError{ 3842 Err: fmt.Errorf("failed to decode response body, %w", err), 3843 Snapshot: snapshot.Bytes(), 3844 } 3845 return out, metadata, err 3846 } 3847 3848 err = awsAwsjson11_deserializeOpDocumentListDominantLanguageDetectionJobsOutput(&output, shape) 3849 if err != nil { 3850 var snapshot bytes.Buffer 3851 io.Copy(&snapshot, ringBuffer) 3852 err = &smithy.DeserializationError{ 3853 Err: fmt.Errorf("failed to decode response body, %w", err), 3854 Snapshot: snapshot.Bytes(), 3855 } 3856 return out, metadata, err 3857 } 3858 3859 return out, metadata, err 3860} 3861 3862func awsAwsjson11_deserializeOpErrorListDominantLanguageDetectionJobs(response *smithyhttp.Response, metadata *middleware.Metadata) error { 3863 var errorBuffer bytes.Buffer 3864 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 3865 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 3866 } 3867 errorBody := bytes.NewReader(errorBuffer.Bytes()) 3868 3869 errorCode := "UnknownError" 3870 errorMessage := errorCode 3871 3872 code := response.Header.Get("X-Amzn-ErrorType") 3873 if len(code) != 0 { 3874 errorCode = restjson.SanitizeErrorCode(code) 3875 } 3876 3877 var buff [1024]byte 3878 ringBuffer := smithyio.NewRingBuffer(buff[:]) 3879 3880 body := io.TeeReader(errorBody, ringBuffer) 3881 decoder := json.NewDecoder(body) 3882 decoder.UseNumber() 3883 code, message, err := restjson.GetErrorInfo(decoder) 3884 if err != nil { 3885 var snapshot bytes.Buffer 3886 io.Copy(&snapshot, ringBuffer) 3887 err = &smithy.DeserializationError{ 3888 Err: fmt.Errorf("failed to decode response body, %w", err), 3889 Snapshot: snapshot.Bytes(), 3890 } 3891 return err 3892 } 3893 3894 errorBody.Seek(0, io.SeekStart) 3895 if len(code) != 0 { 3896 errorCode = restjson.SanitizeErrorCode(code) 3897 } 3898 if len(message) != 0 { 3899 errorMessage = message 3900 } 3901 3902 switch { 3903 case strings.EqualFold("InternalServerException", errorCode): 3904 return awsAwsjson11_deserializeErrorInternalServerException(response, errorBody) 3905 3906 case strings.EqualFold("InvalidFilterException", errorCode): 3907 return awsAwsjson11_deserializeErrorInvalidFilterException(response, errorBody) 3908 3909 case strings.EqualFold("InvalidRequestException", errorCode): 3910 return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody) 3911 3912 case strings.EqualFold("TooManyRequestsException", errorCode): 3913 return awsAwsjson11_deserializeErrorTooManyRequestsException(response, errorBody) 3914 3915 default: 3916 genericError := &smithy.GenericAPIError{ 3917 Code: errorCode, 3918 Message: errorMessage, 3919 } 3920 return genericError 3921 3922 } 3923} 3924 3925type awsAwsjson11_deserializeOpListEndpoints struct { 3926} 3927 3928func (*awsAwsjson11_deserializeOpListEndpoints) ID() string { 3929 return "OperationDeserializer" 3930} 3931 3932func (m *awsAwsjson11_deserializeOpListEndpoints) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 3933 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 3934) { 3935 out, metadata, err = next.HandleDeserialize(ctx, in) 3936 if err != nil { 3937 return out, metadata, err 3938 } 3939 3940 response, ok := out.RawResponse.(*smithyhttp.Response) 3941 if !ok { 3942 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 3943 } 3944 3945 if response.StatusCode < 200 || response.StatusCode >= 300 { 3946 return out, metadata, awsAwsjson11_deserializeOpErrorListEndpoints(response, &metadata) 3947 } 3948 output := &ListEndpointsOutput{} 3949 out.Result = output 3950 3951 var buff [1024]byte 3952 ringBuffer := smithyio.NewRingBuffer(buff[:]) 3953 3954 body := io.TeeReader(response.Body, ringBuffer) 3955 decoder := json.NewDecoder(body) 3956 decoder.UseNumber() 3957 var shape interface{} 3958 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 3959 var snapshot bytes.Buffer 3960 io.Copy(&snapshot, ringBuffer) 3961 err = &smithy.DeserializationError{ 3962 Err: fmt.Errorf("failed to decode response body, %w", err), 3963 Snapshot: snapshot.Bytes(), 3964 } 3965 return out, metadata, err 3966 } 3967 3968 err = awsAwsjson11_deserializeOpDocumentListEndpointsOutput(&output, shape) 3969 if err != nil { 3970 var snapshot bytes.Buffer 3971 io.Copy(&snapshot, ringBuffer) 3972 err = &smithy.DeserializationError{ 3973 Err: fmt.Errorf("failed to decode response body, %w", err), 3974 Snapshot: snapshot.Bytes(), 3975 } 3976 return out, metadata, err 3977 } 3978 3979 return out, metadata, err 3980} 3981 3982func awsAwsjson11_deserializeOpErrorListEndpoints(response *smithyhttp.Response, metadata *middleware.Metadata) error { 3983 var errorBuffer bytes.Buffer 3984 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 3985 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 3986 } 3987 errorBody := bytes.NewReader(errorBuffer.Bytes()) 3988 3989 errorCode := "UnknownError" 3990 errorMessage := errorCode 3991 3992 code := response.Header.Get("X-Amzn-ErrorType") 3993 if len(code) != 0 { 3994 errorCode = restjson.SanitizeErrorCode(code) 3995 } 3996 3997 var buff [1024]byte 3998 ringBuffer := smithyio.NewRingBuffer(buff[:]) 3999 4000 body := io.TeeReader(errorBody, ringBuffer) 4001 decoder := json.NewDecoder(body) 4002 decoder.UseNumber() 4003 code, message, err := restjson.GetErrorInfo(decoder) 4004 if err != nil { 4005 var snapshot bytes.Buffer 4006 io.Copy(&snapshot, ringBuffer) 4007 err = &smithy.DeserializationError{ 4008 Err: fmt.Errorf("failed to decode response body, %w", err), 4009 Snapshot: snapshot.Bytes(), 4010 } 4011 return err 4012 } 4013 4014 errorBody.Seek(0, io.SeekStart) 4015 if len(code) != 0 { 4016 errorCode = restjson.SanitizeErrorCode(code) 4017 } 4018 if len(message) != 0 { 4019 errorMessage = message 4020 } 4021 4022 switch { 4023 case strings.EqualFold("InternalServerException", errorCode): 4024 return awsAwsjson11_deserializeErrorInternalServerException(response, errorBody) 4025 4026 case strings.EqualFold("InvalidRequestException", errorCode): 4027 return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody) 4028 4029 case strings.EqualFold("TooManyRequestsException", errorCode): 4030 return awsAwsjson11_deserializeErrorTooManyRequestsException(response, errorBody) 4031 4032 default: 4033 genericError := &smithy.GenericAPIError{ 4034 Code: errorCode, 4035 Message: errorMessage, 4036 } 4037 return genericError 4038 4039 } 4040} 4041 4042type awsAwsjson11_deserializeOpListEntitiesDetectionJobs struct { 4043} 4044 4045func (*awsAwsjson11_deserializeOpListEntitiesDetectionJobs) ID() string { 4046 return "OperationDeserializer" 4047} 4048 4049func (m *awsAwsjson11_deserializeOpListEntitiesDetectionJobs) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 4050 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 4051) { 4052 out, metadata, err = next.HandleDeserialize(ctx, in) 4053 if err != nil { 4054 return out, metadata, err 4055 } 4056 4057 response, ok := out.RawResponse.(*smithyhttp.Response) 4058 if !ok { 4059 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 4060 } 4061 4062 if response.StatusCode < 200 || response.StatusCode >= 300 { 4063 return out, metadata, awsAwsjson11_deserializeOpErrorListEntitiesDetectionJobs(response, &metadata) 4064 } 4065 output := &ListEntitiesDetectionJobsOutput{} 4066 out.Result = output 4067 4068 var buff [1024]byte 4069 ringBuffer := smithyio.NewRingBuffer(buff[:]) 4070 4071 body := io.TeeReader(response.Body, ringBuffer) 4072 decoder := json.NewDecoder(body) 4073 decoder.UseNumber() 4074 var shape interface{} 4075 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 4076 var snapshot bytes.Buffer 4077 io.Copy(&snapshot, ringBuffer) 4078 err = &smithy.DeserializationError{ 4079 Err: fmt.Errorf("failed to decode response body, %w", err), 4080 Snapshot: snapshot.Bytes(), 4081 } 4082 return out, metadata, err 4083 } 4084 4085 err = awsAwsjson11_deserializeOpDocumentListEntitiesDetectionJobsOutput(&output, shape) 4086 if err != nil { 4087 var snapshot bytes.Buffer 4088 io.Copy(&snapshot, ringBuffer) 4089 err = &smithy.DeserializationError{ 4090 Err: fmt.Errorf("failed to decode response body, %w", err), 4091 Snapshot: snapshot.Bytes(), 4092 } 4093 return out, metadata, err 4094 } 4095 4096 return out, metadata, err 4097} 4098 4099func awsAwsjson11_deserializeOpErrorListEntitiesDetectionJobs(response *smithyhttp.Response, metadata *middleware.Metadata) error { 4100 var errorBuffer bytes.Buffer 4101 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 4102 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 4103 } 4104 errorBody := bytes.NewReader(errorBuffer.Bytes()) 4105 4106 errorCode := "UnknownError" 4107 errorMessage := errorCode 4108 4109 code := response.Header.Get("X-Amzn-ErrorType") 4110 if len(code) != 0 { 4111 errorCode = restjson.SanitizeErrorCode(code) 4112 } 4113 4114 var buff [1024]byte 4115 ringBuffer := smithyio.NewRingBuffer(buff[:]) 4116 4117 body := io.TeeReader(errorBody, ringBuffer) 4118 decoder := json.NewDecoder(body) 4119 decoder.UseNumber() 4120 code, message, err := restjson.GetErrorInfo(decoder) 4121 if err != nil { 4122 var snapshot bytes.Buffer 4123 io.Copy(&snapshot, ringBuffer) 4124 err = &smithy.DeserializationError{ 4125 Err: fmt.Errorf("failed to decode response body, %w", err), 4126 Snapshot: snapshot.Bytes(), 4127 } 4128 return err 4129 } 4130 4131 errorBody.Seek(0, io.SeekStart) 4132 if len(code) != 0 { 4133 errorCode = restjson.SanitizeErrorCode(code) 4134 } 4135 if len(message) != 0 { 4136 errorMessage = message 4137 } 4138 4139 switch { 4140 case strings.EqualFold("InternalServerException", errorCode): 4141 return awsAwsjson11_deserializeErrorInternalServerException(response, errorBody) 4142 4143 case strings.EqualFold("InvalidFilterException", errorCode): 4144 return awsAwsjson11_deserializeErrorInvalidFilterException(response, errorBody) 4145 4146 case strings.EqualFold("InvalidRequestException", errorCode): 4147 return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody) 4148 4149 case strings.EqualFold("TooManyRequestsException", errorCode): 4150 return awsAwsjson11_deserializeErrorTooManyRequestsException(response, errorBody) 4151 4152 default: 4153 genericError := &smithy.GenericAPIError{ 4154 Code: errorCode, 4155 Message: errorMessage, 4156 } 4157 return genericError 4158 4159 } 4160} 4161 4162type awsAwsjson11_deserializeOpListEntityRecognizers struct { 4163} 4164 4165func (*awsAwsjson11_deserializeOpListEntityRecognizers) ID() string { 4166 return "OperationDeserializer" 4167} 4168 4169func (m *awsAwsjson11_deserializeOpListEntityRecognizers) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 4170 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 4171) { 4172 out, metadata, err = next.HandleDeserialize(ctx, in) 4173 if err != nil { 4174 return out, metadata, err 4175 } 4176 4177 response, ok := out.RawResponse.(*smithyhttp.Response) 4178 if !ok { 4179 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 4180 } 4181 4182 if response.StatusCode < 200 || response.StatusCode >= 300 { 4183 return out, metadata, awsAwsjson11_deserializeOpErrorListEntityRecognizers(response, &metadata) 4184 } 4185 output := &ListEntityRecognizersOutput{} 4186 out.Result = output 4187 4188 var buff [1024]byte 4189 ringBuffer := smithyio.NewRingBuffer(buff[:]) 4190 4191 body := io.TeeReader(response.Body, ringBuffer) 4192 decoder := json.NewDecoder(body) 4193 decoder.UseNumber() 4194 var shape interface{} 4195 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 4196 var snapshot bytes.Buffer 4197 io.Copy(&snapshot, ringBuffer) 4198 err = &smithy.DeserializationError{ 4199 Err: fmt.Errorf("failed to decode response body, %w", err), 4200 Snapshot: snapshot.Bytes(), 4201 } 4202 return out, metadata, err 4203 } 4204 4205 err = awsAwsjson11_deserializeOpDocumentListEntityRecognizersOutput(&output, shape) 4206 if err != nil { 4207 var snapshot bytes.Buffer 4208 io.Copy(&snapshot, ringBuffer) 4209 err = &smithy.DeserializationError{ 4210 Err: fmt.Errorf("failed to decode response body, %w", err), 4211 Snapshot: snapshot.Bytes(), 4212 } 4213 return out, metadata, err 4214 } 4215 4216 return out, metadata, err 4217} 4218 4219func awsAwsjson11_deserializeOpErrorListEntityRecognizers(response *smithyhttp.Response, metadata *middleware.Metadata) error { 4220 var errorBuffer bytes.Buffer 4221 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 4222 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 4223 } 4224 errorBody := bytes.NewReader(errorBuffer.Bytes()) 4225 4226 errorCode := "UnknownError" 4227 errorMessage := errorCode 4228 4229 code := response.Header.Get("X-Amzn-ErrorType") 4230 if len(code) != 0 { 4231 errorCode = restjson.SanitizeErrorCode(code) 4232 } 4233 4234 var buff [1024]byte 4235 ringBuffer := smithyio.NewRingBuffer(buff[:]) 4236 4237 body := io.TeeReader(errorBody, ringBuffer) 4238 decoder := json.NewDecoder(body) 4239 decoder.UseNumber() 4240 code, message, err := restjson.GetErrorInfo(decoder) 4241 if err != nil { 4242 var snapshot bytes.Buffer 4243 io.Copy(&snapshot, ringBuffer) 4244 err = &smithy.DeserializationError{ 4245 Err: fmt.Errorf("failed to decode response body, %w", err), 4246 Snapshot: snapshot.Bytes(), 4247 } 4248 return err 4249 } 4250 4251 errorBody.Seek(0, io.SeekStart) 4252 if len(code) != 0 { 4253 errorCode = restjson.SanitizeErrorCode(code) 4254 } 4255 if len(message) != 0 { 4256 errorMessage = message 4257 } 4258 4259 switch { 4260 case strings.EqualFold("InternalServerException", errorCode): 4261 return awsAwsjson11_deserializeErrorInternalServerException(response, errorBody) 4262 4263 case strings.EqualFold("InvalidFilterException", errorCode): 4264 return awsAwsjson11_deserializeErrorInvalidFilterException(response, errorBody) 4265 4266 case strings.EqualFold("InvalidRequestException", errorCode): 4267 return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody) 4268 4269 case strings.EqualFold("TooManyRequestsException", errorCode): 4270 return awsAwsjson11_deserializeErrorTooManyRequestsException(response, errorBody) 4271 4272 default: 4273 genericError := &smithy.GenericAPIError{ 4274 Code: errorCode, 4275 Message: errorMessage, 4276 } 4277 return genericError 4278 4279 } 4280} 4281 4282type awsAwsjson11_deserializeOpListEventsDetectionJobs struct { 4283} 4284 4285func (*awsAwsjson11_deserializeOpListEventsDetectionJobs) ID() string { 4286 return "OperationDeserializer" 4287} 4288 4289func (m *awsAwsjson11_deserializeOpListEventsDetectionJobs) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 4290 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 4291) { 4292 out, metadata, err = next.HandleDeserialize(ctx, in) 4293 if err != nil { 4294 return out, metadata, err 4295 } 4296 4297 response, ok := out.RawResponse.(*smithyhttp.Response) 4298 if !ok { 4299 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 4300 } 4301 4302 if response.StatusCode < 200 || response.StatusCode >= 300 { 4303 return out, metadata, awsAwsjson11_deserializeOpErrorListEventsDetectionJobs(response, &metadata) 4304 } 4305 output := &ListEventsDetectionJobsOutput{} 4306 out.Result = output 4307 4308 var buff [1024]byte 4309 ringBuffer := smithyio.NewRingBuffer(buff[:]) 4310 4311 body := io.TeeReader(response.Body, ringBuffer) 4312 decoder := json.NewDecoder(body) 4313 decoder.UseNumber() 4314 var shape interface{} 4315 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 4316 var snapshot bytes.Buffer 4317 io.Copy(&snapshot, ringBuffer) 4318 err = &smithy.DeserializationError{ 4319 Err: fmt.Errorf("failed to decode response body, %w", err), 4320 Snapshot: snapshot.Bytes(), 4321 } 4322 return out, metadata, err 4323 } 4324 4325 err = awsAwsjson11_deserializeOpDocumentListEventsDetectionJobsOutput(&output, shape) 4326 if err != nil { 4327 var snapshot bytes.Buffer 4328 io.Copy(&snapshot, ringBuffer) 4329 err = &smithy.DeserializationError{ 4330 Err: fmt.Errorf("failed to decode response body, %w", err), 4331 Snapshot: snapshot.Bytes(), 4332 } 4333 return out, metadata, err 4334 } 4335 4336 return out, metadata, err 4337} 4338 4339func awsAwsjson11_deserializeOpErrorListEventsDetectionJobs(response *smithyhttp.Response, metadata *middleware.Metadata) error { 4340 var errorBuffer bytes.Buffer 4341 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 4342 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 4343 } 4344 errorBody := bytes.NewReader(errorBuffer.Bytes()) 4345 4346 errorCode := "UnknownError" 4347 errorMessage := errorCode 4348 4349 code := response.Header.Get("X-Amzn-ErrorType") 4350 if len(code) != 0 { 4351 errorCode = restjson.SanitizeErrorCode(code) 4352 } 4353 4354 var buff [1024]byte 4355 ringBuffer := smithyio.NewRingBuffer(buff[:]) 4356 4357 body := io.TeeReader(errorBody, ringBuffer) 4358 decoder := json.NewDecoder(body) 4359 decoder.UseNumber() 4360 code, message, err := restjson.GetErrorInfo(decoder) 4361 if err != nil { 4362 var snapshot bytes.Buffer 4363 io.Copy(&snapshot, ringBuffer) 4364 err = &smithy.DeserializationError{ 4365 Err: fmt.Errorf("failed to decode response body, %w", err), 4366 Snapshot: snapshot.Bytes(), 4367 } 4368 return err 4369 } 4370 4371 errorBody.Seek(0, io.SeekStart) 4372 if len(code) != 0 { 4373 errorCode = restjson.SanitizeErrorCode(code) 4374 } 4375 if len(message) != 0 { 4376 errorMessage = message 4377 } 4378 4379 switch { 4380 case strings.EqualFold("InternalServerException", errorCode): 4381 return awsAwsjson11_deserializeErrorInternalServerException(response, errorBody) 4382 4383 case strings.EqualFold("InvalidFilterException", errorCode): 4384 return awsAwsjson11_deserializeErrorInvalidFilterException(response, errorBody) 4385 4386 case strings.EqualFold("InvalidRequestException", errorCode): 4387 return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody) 4388 4389 case strings.EqualFold("TooManyRequestsException", errorCode): 4390 return awsAwsjson11_deserializeErrorTooManyRequestsException(response, errorBody) 4391 4392 default: 4393 genericError := &smithy.GenericAPIError{ 4394 Code: errorCode, 4395 Message: errorMessage, 4396 } 4397 return genericError 4398 4399 } 4400} 4401 4402type awsAwsjson11_deserializeOpListKeyPhrasesDetectionJobs struct { 4403} 4404 4405func (*awsAwsjson11_deserializeOpListKeyPhrasesDetectionJobs) ID() string { 4406 return "OperationDeserializer" 4407} 4408 4409func (m *awsAwsjson11_deserializeOpListKeyPhrasesDetectionJobs) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 4410 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 4411) { 4412 out, metadata, err = next.HandleDeserialize(ctx, in) 4413 if err != nil { 4414 return out, metadata, err 4415 } 4416 4417 response, ok := out.RawResponse.(*smithyhttp.Response) 4418 if !ok { 4419 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 4420 } 4421 4422 if response.StatusCode < 200 || response.StatusCode >= 300 { 4423 return out, metadata, awsAwsjson11_deserializeOpErrorListKeyPhrasesDetectionJobs(response, &metadata) 4424 } 4425 output := &ListKeyPhrasesDetectionJobsOutput{} 4426 out.Result = output 4427 4428 var buff [1024]byte 4429 ringBuffer := smithyio.NewRingBuffer(buff[:]) 4430 4431 body := io.TeeReader(response.Body, ringBuffer) 4432 decoder := json.NewDecoder(body) 4433 decoder.UseNumber() 4434 var shape interface{} 4435 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 4436 var snapshot bytes.Buffer 4437 io.Copy(&snapshot, ringBuffer) 4438 err = &smithy.DeserializationError{ 4439 Err: fmt.Errorf("failed to decode response body, %w", err), 4440 Snapshot: snapshot.Bytes(), 4441 } 4442 return out, metadata, err 4443 } 4444 4445 err = awsAwsjson11_deserializeOpDocumentListKeyPhrasesDetectionJobsOutput(&output, shape) 4446 if err != nil { 4447 var snapshot bytes.Buffer 4448 io.Copy(&snapshot, ringBuffer) 4449 err = &smithy.DeserializationError{ 4450 Err: fmt.Errorf("failed to decode response body, %w", err), 4451 Snapshot: snapshot.Bytes(), 4452 } 4453 return out, metadata, err 4454 } 4455 4456 return out, metadata, err 4457} 4458 4459func awsAwsjson11_deserializeOpErrorListKeyPhrasesDetectionJobs(response *smithyhttp.Response, metadata *middleware.Metadata) error { 4460 var errorBuffer bytes.Buffer 4461 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 4462 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 4463 } 4464 errorBody := bytes.NewReader(errorBuffer.Bytes()) 4465 4466 errorCode := "UnknownError" 4467 errorMessage := errorCode 4468 4469 code := response.Header.Get("X-Amzn-ErrorType") 4470 if len(code) != 0 { 4471 errorCode = restjson.SanitizeErrorCode(code) 4472 } 4473 4474 var buff [1024]byte 4475 ringBuffer := smithyio.NewRingBuffer(buff[:]) 4476 4477 body := io.TeeReader(errorBody, ringBuffer) 4478 decoder := json.NewDecoder(body) 4479 decoder.UseNumber() 4480 code, message, err := restjson.GetErrorInfo(decoder) 4481 if err != nil { 4482 var snapshot bytes.Buffer 4483 io.Copy(&snapshot, ringBuffer) 4484 err = &smithy.DeserializationError{ 4485 Err: fmt.Errorf("failed to decode response body, %w", err), 4486 Snapshot: snapshot.Bytes(), 4487 } 4488 return err 4489 } 4490 4491 errorBody.Seek(0, io.SeekStart) 4492 if len(code) != 0 { 4493 errorCode = restjson.SanitizeErrorCode(code) 4494 } 4495 if len(message) != 0 { 4496 errorMessage = message 4497 } 4498 4499 switch { 4500 case strings.EqualFold("InternalServerException", errorCode): 4501 return awsAwsjson11_deserializeErrorInternalServerException(response, errorBody) 4502 4503 case strings.EqualFold("InvalidFilterException", errorCode): 4504 return awsAwsjson11_deserializeErrorInvalidFilterException(response, errorBody) 4505 4506 case strings.EqualFold("InvalidRequestException", errorCode): 4507 return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody) 4508 4509 case strings.EqualFold("TooManyRequestsException", errorCode): 4510 return awsAwsjson11_deserializeErrorTooManyRequestsException(response, errorBody) 4511 4512 default: 4513 genericError := &smithy.GenericAPIError{ 4514 Code: errorCode, 4515 Message: errorMessage, 4516 } 4517 return genericError 4518 4519 } 4520} 4521 4522type awsAwsjson11_deserializeOpListPiiEntitiesDetectionJobs struct { 4523} 4524 4525func (*awsAwsjson11_deserializeOpListPiiEntitiesDetectionJobs) ID() string { 4526 return "OperationDeserializer" 4527} 4528 4529func (m *awsAwsjson11_deserializeOpListPiiEntitiesDetectionJobs) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 4530 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 4531) { 4532 out, metadata, err = next.HandleDeserialize(ctx, in) 4533 if err != nil { 4534 return out, metadata, err 4535 } 4536 4537 response, ok := out.RawResponse.(*smithyhttp.Response) 4538 if !ok { 4539 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 4540 } 4541 4542 if response.StatusCode < 200 || response.StatusCode >= 300 { 4543 return out, metadata, awsAwsjson11_deserializeOpErrorListPiiEntitiesDetectionJobs(response, &metadata) 4544 } 4545 output := &ListPiiEntitiesDetectionJobsOutput{} 4546 out.Result = output 4547 4548 var buff [1024]byte 4549 ringBuffer := smithyio.NewRingBuffer(buff[:]) 4550 4551 body := io.TeeReader(response.Body, ringBuffer) 4552 decoder := json.NewDecoder(body) 4553 decoder.UseNumber() 4554 var shape interface{} 4555 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 4556 var snapshot bytes.Buffer 4557 io.Copy(&snapshot, ringBuffer) 4558 err = &smithy.DeserializationError{ 4559 Err: fmt.Errorf("failed to decode response body, %w", err), 4560 Snapshot: snapshot.Bytes(), 4561 } 4562 return out, metadata, err 4563 } 4564 4565 err = awsAwsjson11_deserializeOpDocumentListPiiEntitiesDetectionJobsOutput(&output, shape) 4566 if err != nil { 4567 var snapshot bytes.Buffer 4568 io.Copy(&snapshot, ringBuffer) 4569 err = &smithy.DeserializationError{ 4570 Err: fmt.Errorf("failed to decode response body, %w", err), 4571 Snapshot: snapshot.Bytes(), 4572 } 4573 return out, metadata, err 4574 } 4575 4576 return out, metadata, err 4577} 4578 4579func awsAwsjson11_deserializeOpErrorListPiiEntitiesDetectionJobs(response *smithyhttp.Response, metadata *middleware.Metadata) error { 4580 var errorBuffer bytes.Buffer 4581 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 4582 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 4583 } 4584 errorBody := bytes.NewReader(errorBuffer.Bytes()) 4585 4586 errorCode := "UnknownError" 4587 errorMessage := errorCode 4588 4589 code := response.Header.Get("X-Amzn-ErrorType") 4590 if len(code) != 0 { 4591 errorCode = restjson.SanitizeErrorCode(code) 4592 } 4593 4594 var buff [1024]byte 4595 ringBuffer := smithyio.NewRingBuffer(buff[:]) 4596 4597 body := io.TeeReader(errorBody, ringBuffer) 4598 decoder := json.NewDecoder(body) 4599 decoder.UseNumber() 4600 code, message, err := restjson.GetErrorInfo(decoder) 4601 if err != nil { 4602 var snapshot bytes.Buffer 4603 io.Copy(&snapshot, ringBuffer) 4604 err = &smithy.DeserializationError{ 4605 Err: fmt.Errorf("failed to decode response body, %w", err), 4606 Snapshot: snapshot.Bytes(), 4607 } 4608 return err 4609 } 4610 4611 errorBody.Seek(0, io.SeekStart) 4612 if len(code) != 0 { 4613 errorCode = restjson.SanitizeErrorCode(code) 4614 } 4615 if len(message) != 0 { 4616 errorMessage = message 4617 } 4618 4619 switch { 4620 case strings.EqualFold("InternalServerException", errorCode): 4621 return awsAwsjson11_deserializeErrorInternalServerException(response, errorBody) 4622 4623 case strings.EqualFold("InvalidFilterException", errorCode): 4624 return awsAwsjson11_deserializeErrorInvalidFilterException(response, errorBody) 4625 4626 case strings.EqualFold("InvalidRequestException", errorCode): 4627 return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody) 4628 4629 case strings.EqualFold("TooManyRequestsException", errorCode): 4630 return awsAwsjson11_deserializeErrorTooManyRequestsException(response, errorBody) 4631 4632 default: 4633 genericError := &smithy.GenericAPIError{ 4634 Code: errorCode, 4635 Message: errorMessage, 4636 } 4637 return genericError 4638 4639 } 4640} 4641 4642type awsAwsjson11_deserializeOpListSentimentDetectionJobs struct { 4643} 4644 4645func (*awsAwsjson11_deserializeOpListSentimentDetectionJobs) ID() string { 4646 return "OperationDeserializer" 4647} 4648 4649func (m *awsAwsjson11_deserializeOpListSentimentDetectionJobs) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 4650 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 4651) { 4652 out, metadata, err = next.HandleDeserialize(ctx, in) 4653 if err != nil { 4654 return out, metadata, err 4655 } 4656 4657 response, ok := out.RawResponse.(*smithyhttp.Response) 4658 if !ok { 4659 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 4660 } 4661 4662 if response.StatusCode < 200 || response.StatusCode >= 300 { 4663 return out, metadata, awsAwsjson11_deserializeOpErrorListSentimentDetectionJobs(response, &metadata) 4664 } 4665 output := &ListSentimentDetectionJobsOutput{} 4666 out.Result = output 4667 4668 var buff [1024]byte 4669 ringBuffer := smithyio.NewRingBuffer(buff[:]) 4670 4671 body := io.TeeReader(response.Body, ringBuffer) 4672 decoder := json.NewDecoder(body) 4673 decoder.UseNumber() 4674 var shape interface{} 4675 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 4676 var snapshot bytes.Buffer 4677 io.Copy(&snapshot, ringBuffer) 4678 err = &smithy.DeserializationError{ 4679 Err: fmt.Errorf("failed to decode response body, %w", err), 4680 Snapshot: snapshot.Bytes(), 4681 } 4682 return out, metadata, err 4683 } 4684 4685 err = awsAwsjson11_deserializeOpDocumentListSentimentDetectionJobsOutput(&output, shape) 4686 if err != nil { 4687 var snapshot bytes.Buffer 4688 io.Copy(&snapshot, ringBuffer) 4689 err = &smithy.DeserializationError{ 4690 Err: fmt.Errorf("failed to decode response body, %w", err), 4691 Snapshot: snapshot.Bytes(), 4692 } 4693 return out, metadata, err 4694 } 4695 4696 return out, metadata, err 4697} 4698 4699func awsAwsjson11_deserializeOpErrorListSentimentDetectionJobs(response *smithyhttp.Response, metadata *middleware.Metadata) error { 4700 var errorBuffer bytes.Buffer 4701 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 4702 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 4703 } 4704 errorBody := bytes.NewReader(errorBuffer.Bytes()) 4705 4706 errorCode := "UnknownError" 4707 errorMessage := errorCode 4708 4709 code := response.Header.Get("X-Amzn-ErrorType") 4710 if len(code) != 0 { 4711 errorCode = restjson.SanitizeErrorCode(code) 4712 } 4713 4714 var buff [1024]byte 4715 ringBuffer := smithyio.NewRingBuffer(buff[:]) 4716 4717 body := io.TeeReader(errorBody, ringBuffer) 4718 decoder := json.NewDecoder(body) 4719 decoder.UseNumber() 4720 code, message, err := restjson.GetErrorInfo(decoder) 4721 if err != nil { 4722 var snapshot bytes.Buffer 4723 io.Copy(&snapshot, ringBuffer) 4724 err = &smithy.DeserializationError{ 4725 Err: fmt.Errorf("failed to decode response body, %w", err), 4726 Snapshot: snapshot.Bytes(), 4727 } 4728 return err 4729 } 4730 4731 errorBody.Seek(0, io.SeekStart) 4732 if len(code) != 0 { 4733 errorCode = restjson.SanitizeErrorCode(code) 4734 } 4735 if len(message) != 0 { 4736 errorMessage = message 4737 } 4738 4739 switch { 4740 case strings.EqualFold("InternalServerException", errorCode): 4741 return awsAwsjson11_deserializeErrorInternalServerException(response, errorBody) 4742 4743 case strings.EqualFold("InvalidFilterException", errorCode): 4744 return awsAwsjson11_deserializeErrorInvalidFilterException(response, errorBody) 4745 4746 case strings.EqualFold("InvalidRequestException", errorCode): 4747 return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody) 4748 4749 case strings.EqualFold("TooManyRequestsException", errorCode): 4750 return awsAwsjson11_deserializeErrorTooManyRequestsException(response, errorBody) 4751 4752 default: 4753 genericError := &smithy.GenericAPIError{ 4754 Code: errorCode, 4755 Message: errorMessage, 4756 } 4757 return genericError 4758 4759 } 4760} 4761 4762type awsAwsjson11_deserializeOpListTagsForResource struct { 4763} 4764 4765func (*awsAwsjson11_deserializeOpListTagsForResource) ID() string { 4766 return "OperationDeserializer" 4767} 4768 4769func (m *awsAwsjson11_deserializeOpListTagsForResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 4770 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 4771) { 4772 out, metadata, err = next.HandleDeserialize(ctx, in) 4773 if err != nil { 4774 return out, metadata, err 4775 } 4776 4777 response, ok := out.RawResponse.(*smithyhttp.Response) 4778 if !ok { 4779 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 4780 } 4781 4782 if response.StatusCode < 200 || response.StatusCode >= 300 { 4783 return out, metadata, awsAwsjson11_deserializeOpErrorListTagsForResource(response, &metadata) 4784 } 4785 output := &ListTagsForResourceOutput{} 4786 out.Result = output 4787 4788 var buff [1024]byte 4789 ringBuffer := smithyio.NewRingBuffer(buff[:]) 4790 4791 body := io.TeeReader(response.Body, ringBuffer) 4792 decoder := json.NewDecoder(body) 4793 decoder.UseNumber() 4794 var shape interface{} 4795 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 4796 var snapshot bytes.Buffer 4797 io.Copy(&snapshot, ringBuffer) 4798 err = &smithy.DeserializationError{ 4799 Err: fmt.Errorf("failed to decode response body, %w", err), 4800 Snapshot: snapshot.Bytes(), 4801 } 4802 return out, metadata, err 4803 } 4804 4805 err = awsAwsjson11_deserializeOpDocumentListTagsForResourceOutput(&output, shape) 4806 if err != nil { 4807 var snapshot bytes.Buffer 4808 io.Copy(&snapshot, ringBuffer) 4809 err = &smithy.DeserializationError{ 4810 Err: fmt.Errorf("failed to decode response body, %w", err), 4811 Snapshot: snapshot.Bytes(), 4812 } 4813 return out, metadata, err 4814 } 4815 4816 return out, metadata, err 4817} 4818 4819func awsAwsjson11_deserializeOpErrorListTagsForResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { 4820 var errorBuffer bytes.Buffer 4821 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 4822 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 4823 } 4824 errorBody := bytes.NewReader(errorBuffer.Bytes()) 4825 4826 errorCode := "UnknownError" 4827 errorMessage := errorCode 4828 4829 code := response.Header.Get("X-Amzn-ErrorType") 4830 if len(code) != 0 { 4831 errorCode = restjson.SanitizeErrorCode(code) 4832 } 4833 4834 var buff [1024]byte 4835 ringBuffer := smithyio.NewRingBuffer(buff[:]) 4836 4837 body := io.TeeReader(errorBody, ringBuffer) 4838 decoder := json.NewDecoder(body) 4839 decoder.UseNumber() 4840 code, message, err := restjson.GetErrorInfo(decoder) 4841 if err != nil { 4842 var snapshot bytes.Buffer 4843 io.Copy(&snapshot, ringBuffer) 4844 err = &smithy.DeserializationError{ 4845 Err: fmt.Errorf("failed to decode response body, %w", err), 4846 Snapshot: snapshot.Bytes(), 4847 } 4848 return err 4849 } 4850 4851 errorBody.Seek(0, io.SeekStart) 4852 if len(code) != 0 { 4853 errorCode = restjson.SanitizeErrorCode(code) 4854 } 4855 if len(message) != 0 { 4856 errorMessage = message 4857 } 4858 4859 switch { 4860 case strings.EqualFold("InternalServerException", errorCode): 4861 return awsAwsjson11_deserializeErrorInternalServerException(response, errorBody) 4862 4863 case strings.EqualFold("InvalidRequestException", errorCode): 4864 return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody) 4865 4866 case strings.EqualFold("ResourceNotFoundException", errorCode): 4867 return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) 4868 4869 default: 4870 genericError := &smithy.GenericAPIError{ 4871 Code: errorCode, 4872 Message: errorMessage, 4873 } 4874 return genericError 4875 4876 } 4877} 4878 4879type awsAwsjson11_deserializeOpListTopicsDetectionJobs struct { 4880} 4881 4882func (*awsAwsjson11_deserializeOpListTopicsDetectionJobs) ID() string { 4883 return "OperationDeserializer" 4884} 4885 4886func (m *awsAwsjson11_deserializeOpListTopicsDetectionJobs) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 4887 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 4888) { 4889 out, metadata, err = next.HandleDeserialize(ctx, in) 4890 if err != nil { 4891 return out, metadata, err 4892 } 4893 4894 response, ok := out.RawResponse.(*smithyhttp.Response) 4895 if !ok { 4896 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 4897 } 4898 4899 if response.StatusCode < 200 || response.StatusCode >= 300 { 4900 return out, metadata, awsAwsjson11_deserializeOpErrorListTopicsDetectionJobs(response, &metadata) 4901 } 4902 output := &ListTopicsDetectionJobsOutput{} 4903 out.Result = output 4904 4905 var buff [1024]byte 4906 ringBuffer := smithyio.NewRingBuffer(buff[:]) 4907 4908 body := io.TeeReader(response.Body, ringBuffer) 4909 decoder := json.NewDecoder(body) 4910 decoder.UseNumber() 4911 var shape interface{} 4912 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 4913 var snapshot bytes.Buffer 4914 io.Copy(&snapshot, ringBuffer) 4915 err = &smithy.DeserializationError{ 4916 Err: fmt.Errorf("failed to decode response body, %w", err), 4917 Snapshot: snapshot.Bytes(), 4918 } 4919 return out, metadata, err 4920 } 4921 4922 err = awsAwsjson11_deserializeOpDocumentListTopicsDetectionJobsOutput(&output, shape) 4923 if err != nil { 4924 var snapshot bytes.Buffer 4925 io.Copy(&snapshot, ringBuffer) 4926 err = &smithy.DeserializationError{ 4927 Err: fmt.Errorf("failed to decode response body, %w", err), 4928 Snapshot: snapshot.Bytes(), 4929 } 4930 return out, metadata, err 4931 } 4932 4933 return out, metadata, err 4934} 4935 4936func awsAwsjson11_deserializeOpErrorListTopicsDetectionJobs(response *smithyhttp.Response, metadata *middleware.Metadata) error { 4937 var errorBuffer bytes.Buffer 4938 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 4939 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 4940 } 4941 errorBody := bytes.NewReader(errorBuffer.Bytes()) 4942 4943 errorCode := "UnknownError" 4944 errorMessage := errorCode 4945 4946 code := response.Header.Get("X-Amzn-ErrorType") 4947 if len(code) != 0 { 4948 errorCode = restjson.SanitizeErrorCode(code) 4949 } 4950 4951 var buff [1024]byte 4952 ringBuffer := smithyio.NewRingBuffer(buff[:]) 4953 4954 body := io.TeeReader(errorBody, ringBuffer) 4955 decoder := json.NewDecoder(body) 4956 decoder.UseNumber() 4957 code, message, err := restjson.GetErrorInfo(decoder) 4958 if err != nil { 4959 var snapshot bytes.Buffer 4960 io.Copy(&snapshot, ringBuffer) 4961 err = &smithy.DeserializationError{ 4962 Err: fmt.Errorf("failed to decode response body, %w", err), 4963 Snapshot: snapshot.Bytes(), 4964 } 4965 return err 4966 } 4967 4968 errorBody.Seek(0, io.SeekStart) 4969 if len(code) != 0 { 4970 errorCode = restjson.SanitizeErrorCode(code) 4971 } 4972 if len(message) != 0 { 4973 errorMessage = message 4974 } 4975 4976 switch { 4977 case strings.EqualFold("InternalServerException", errorCode): 4978 return awsAwsjson11_deserializeErrorInternalServerException(response, errorBody) 4979 4980 case strings.EqualFold("InvalidFilterException", errorCode): 4981 return awsAwsjson11_deserializeErrorInvalidFilterException(response, errorBody) 4982 4983 case strings.EqualFold("InvalidRequestException", errorCode): 4984 return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody) 4985 4986 case strings.EqualFold("TooManyRequestsException", errorCode): 4987 return awsAwsjson11_deserializeErrorTooManyRequestsException(response, errorBody) 4988 4989 default: 4990 genericError := &smithy.GenericAPIError{ 4991 Code: errorCode, 4992 Message: errorMessage, 4993 } 4994 return genericError 4995 4996 } 4997} 4998 4999type awsAwsjson11_deserializeOpStartDocumentClassificationJob struct { 5000} 5001 5002func (*awsAwsjson11_deserializeOpStartDocumentClassificationJob) ID() string { 5003 return "OperationDeserializer" 5004} 5005 5006func (m *awsAwsjson11_deserializeOpStartDocumentClassificationJob) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 5007 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 5008) { 5009 out, metadata, err = next.HandleDeserialize(ctx, in) 5010 if err != nil { 5011 return out, metadata, err 5012 } 5013 5014 response, ok := out.RawResponse.(*smithyhttp.Response) 5015 if !ok { 5016 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 5017 } 5018 5019 if response.StatusCode < 200 || response.StatusCode >= 300 { 5020 return out, metadata, awsAwsjson11_deserializeOpErrorStartDocumentClassificationJob(response, &metadata) 5021 } 5022 output := &StartDocumentClassificationJobOutput{} 5023 out.Result = output 5024 5025 var buff [1024]byte 5026 ringBuffer := smithyio.NewRingBuffer(buff[:]) 5027 5028 body := io.TeeReader(response.Body, ringBuffer) 5029 decoder := json.NewDecoder(body) 5030 decoder.UseNumber() 5031 var shape interface{} 5032 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 5033 var snapshot bytes.Buffer 5034 io.Copy(&snapshot, ringBuffer) 5035 err = &smithy.DeserializationError{ 5036 Err: fmt.Errorf("failed to decode response body, %w", err), 5037 Snapshot: snapshot.Bytes(), 5038 } 5039 return out, metadata, err 5040 } 5041 5042 err = awsAwsjson11_deserializeOpDocumentStartDocumentClassificationJobOutput(&output, shape) 5043 if err != nil { 5044 var snapshot bytes.Buffer 5045 io.Copy(&snapshot, ringBuffer) 5046 err = &smithy.DeserializationError{ 5047 Err: fmt.Errorf("failed to decode response body, %w", err), 5048 Snapshot: snapshot.Bytes(), 5049 } 5050 return out, metadata, err 5051 } 5052 5053 return out, metadata, err 5054} 5055 5056func awsAwsjson11_deserializeOpErrorStartDocumentClassificationJob(response *smithyhttp.Response, metadata *middleware.Metadata) error { 5057 var errorBuffer bytes.Buffer 5058 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 5059 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 5060 } 5061 errorBody := bytes.NewReader(errorBuffer.Bytes()) 5062 5063 errorCode := "UnknownError" 5064 errorMessage := errorCode 5065 5066 code := response.Header.Get("X-Amzn-ErrorType") 5067 if len(code) != 0 { 5068 errorCode = restjson.SanitizeErrorCode(code) 5069 } 5070 5071 var buff [1024]byte 5072 ringBuffer := smithyio.NewRingBuffer(buff[:]) 5073 5074 body := io.TeeReader(errorBody, ringBuffer) 5075 decoder := json.NewDecoder(body) 5076 decoder.UseNumber() 5077 code, message, err := restjson.GetErrorInfo(decoder) 5078 if err != nil { 5079 var snapshot bytes.Buffer 5080 io.Copy(&snapshot, ringBuffer) 5081 err = &smithy.DeserializationError{ 5082 Err: fmt.Errorf("failed to decode response body, %w", err), 5083 Snapshot: snapshot.Bytes(), 5084 } 5085 return err 5086 } 5087 5088 errorBody.Seek(0, io.SeekStart) 5089 if len(code) != 0 { 5090 errorCode = restjson.SanitizeErrorCode(code) 5091 } 5092 if len(message) != 0 { 5093 errorMessage = message 5094 } 5095 5096 switch { 5097 case strings.EqualFold("InternalServerException", errorCode): 5098 return awsAwsjson11_deserializeErrorInternalServerException(response, errorBody) 5099 5100 case strings.EqualFold("InvalidRequestException", errorCode): 5101 return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody) 5102 5103 case strings.EqualFold("KmsKeyValidationException", errorCode): 5104 return awsAwsjson11_deserializeErrorKmsKeyValidationException(response, errorBody) 5105 5106 case strings.EqualFold("ResourceNotFoundException", errorCode): 5107 return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) 5108 5109 case strings.EqualFold("ResourceUnavailableException", errorCode): 5110 return awsAwsjson11_deserializeErrorResourceUnavailableException(response, errorBody) 5111 5112 case strings.EqualFold("TooManyRequestsException", errorCode): 5113 return awsAwsjson11_deserializeErrorTooManyRequestsException(response, errorBody) 5114 5115 default: 5116 genericError := &smithy.GenericAPIError{ 5117 Code: errorCode, 5118 Message: errorMessage, 5119 } 5120 return genericError 5121 5122 } 5123} 5124 5125type awsAwsjson11_deserializeOpStartDominantLanguageDetectionJob struct { 5126} 5127 5128func (*awsAwsjson11_deserializeOpStartDominantLanguageDetectionJob) ID() string { 5129 return "OperationDeserializer" 5130} 5131 5132func (m *awsAwsjson11_deserializeOpStartDominantLanguageDetectionJob) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 5133 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 5134) { 5135 out, metadata, err = next.HandleDeserialize(ctx, in) 5136 if err != nil { 5137 return out, metadata, err 5138 } 5139 5140 response, ok := out.RawResponse.(*smithyhttp.Response) 5141 if !ok { 5142 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 5143 } 5144 5145 if response.StatusCode < 200 || response.StatusCode >= 300 { 5146 return out, metadata, awsAwsjson11_deserializeOpErrorStartDominantLanguageDetectionJob(response, &metadata) 5147 } 5148 output := &StartDominantLanguageDetectionJobOutput{} 5149 out.Result = output 5150 5151 var buff [1024]byte 5152 ringBuffer := smithyio.NewRingBuffer(buff[:]) 5153 5154 body := io.TeeReader(response.Body, ringBuffer) 5155 decoder := json.NewDecoder(body) 5156 decoder.UseNumber() 5157 var shape interface{} 5158 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 5159 var snapshot bytes.Buffer 5160 io.Copy(&snapshot, ringBuffer) 5161 err = &smithy.DeserializationError{ 5162 Err: fmt.Errorf("failed to decode response body, %w", err), 5163 Snapshot: snapshot.Bytes(), 5164 } 5165 return out, metadata, err 5166 } 5167 5168 err = awsAwsjson11_deserializeOpDocumentStartDominantLanguageDetectionJobOutput(&output, shape) 5169 if err != nil { 5170 var snapshot bytes.Buffer 5171 io.Copy(&snapshot, ringBuffer) 5172 err = &smithy.DeserializationError{ 5173 Err: fmt.Errorf("failed to decode response body, %w", err), 5174 Snapshot: snapshot.Bytes(), 5175 } 5176 return out, metadata, err 5177 } 5178 5179 return out, metadata, err 5180} 5181 5182func awsAwsjson11_deserializeOpErrorStartDominantLanguageDetectionJob(response *smithyhttp.Response, metadata *middleware.Metadata) error { 5183 var errorBuffer bytes.Buffer 5184 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 5185 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 5186 } 5187 errorBody := bytes.NewReader(errorBuffer.Bytes()) 5188 5189 errorCode := "UnknownError" 5190 errorMessage := errorCode 5191 5192 code := response.Header.Get("X-Amzn-ErrorType") 5193 if len(code) != 0 { 5194 errorCode = restjson.SanitizeErrorCode(code) 5195 } 5196 5197 var buff [1024]byte 5198 ringBuffer := smithyio.NewRingBuffer(buff[:]) 5199 5200 body := io.TeeReader(errorBody, ringBuffer) 5201 decoder := json.NewDecoder(body) 5202 decoder.UseNumber() 5203 code, message, err := restjson.GetErrorInfo(decoder) 5204 if err != nil { 5205 var snapshot bytes.Buffer 5206 io.Copy(&snapshot, ringBuffer) 5207 err = &smithy.DeserializationError{ 5208 Err: fmt.Errorf("failed to decode response body, %w", err), 5209 Snapshot: snapshot.Bytes(), 5210 } 5211 return err 5212 } 5213 5214 errorBody.Seek(0, io.SeekStart) 5215 if len(code) != 0 { 5216 errorCode = restjson.SanitizeErrorCode(code) 5217 } 5218 if len(message) != 0 { 5219 errorMessage = message 5220 } 5221 5222 switch { 5223 case strings.EqualFold("InternalServerException", errorCode): 5224 return awsAwsjson11_deserializeErrorInternalServerException(response, errorBody) 5225 5226 case strings.EqualFold("InvalidRequestException", errorCode): 5227 return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody) 5228 5229 case strings.EqualFold("KmsKeyValidationException", errorCode): 5230 return awsAwsjson11_deserializeErrorKmsKeyValidationException(response, errorBody) 5231 5232 case strings.EqualFold("TooManyRequestsException", errorCode): 5233 return awsAwsjson11_deserializeErrorTooManyRequestsException(response, errorBody) 5234 5235 default: 5236 genericError := &smithy.GenericAPIError{ 5237 Code: errorCode, 5238 Message: errorMessage, 5239 } 5240 return genericError 5241 5242 } 5243} 5244 5245type awsAwsjson11_deserializeOpStartEntitiesDetectionJob struct { 5246} 5247 5248func (*awsAwsjson11_deserializeOpStartEntitiesDetectionJob) ID() string { 5249 return "OperationDeserializer" 5250} 5251 5252func (m *awsAwsjson11_deserializeOpStartEntitiesDetectionJob) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 5253 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 5254) { 5255 out, metadata, err = next.HandleDeserialize(ctx, in) 5256 if err != nil { 5257 return out, metadata, err 5258 } 5259 5260 response, ok := out.RawResponse.(*smithyhttp.Response) 5261 if !ok { 5262 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 5263 } 5264 5265 if response.StatusCode < 200 || response.StatusCode >= 300 { 5266 return out, metadata, awsAwsjson11_deserializeOpErrorStartEntitiesDetectionJob(response, &metadata) 5267 } 5268 output := &StartEntitiesDetectionJobOutput{} 5269 out.Result = output 5270 5271 var buff [1024]byte 5272 ringBuffer := smithyio.NewRingBuffer(buff[:]) 5273 5274 body := io.TeeReader(response.Body, ringBuffer) 5275 decoder := json.NewDecoder(body) 5276 decoder.UseNumber() 5277 var shape interface{} 5278 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 5279 var snapshot bytes.Buffer 5280 io.Copy(&snapshot, ringBuffer) 5281 err = &smithy.DeserializationError{ 5282 Err: fmt.Errorf("failed to decode response body, %w", err), 5283 Snapshot: snapshot.Bytes(), 5284 } 5285 return out, metadata, err 5286 } 5287 5288 err = awsAwsjson11_deserializeOpDocumentStartEntitiesDetectionJobOutput(&output, shape) 5289 if err != nil { 5290 var snapshot bytes.Buffer 5291 io.Copy(&snapshot, ringBuffer) 5292 err = &smithy.DeserializationError{ 5293 Err: fmt.Errorf("failed to decode response body, %w", err), 5294 Snapshot: snapshot.Bytes(), 5295 } 5296 return out, metadata, err 5297 } 5298 5299 return out, metadata, err 5300} 5301 5302func awsAwsjson11_deserializeOpErrorStartEntitiesDetectionJob(response *smithyhttp.Response, metadata *middleware.Metadata) error { 5303 var errorBuffer bytes.Buffer 5304 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 5305 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 5306 } 5307 errorBody := bytes.NewReader(errorBuffer.Bytes()) 5308 5309 errorCode := "UnknownError" 5310 errorMessage := errorCode 5311 5312 code := response.Header.Get("X-Amzn-ErrorType") 5313 if len(code) != 0 { 5314 errorCode = restjson.SanitizeErrorCode(code) 5315 } 5316 5317 var buff [1024]byte 5318 ringBuffer := smithyio.NewRingBuffer(buff[:]) 5319 5320 body := io.TeeReader(errorBody, ringBuffer) 5321 decoder := json.NewDecoder(body) 5322 decoder.UseNumber() 5323 code, message, err := restjson.GetErrorInfo(decoder) 5324 if err != nil { 5325 var snapshot bytes.Buffer 5326 io.Copy(&snapshot, ringBuffer) 5327 err = &smithy.DeserializationError{ 5328 Err: fmt.Errorf("failed to decode response body, %w", err), 5329 Snapshot: snapshot.Bytes(), 5330 } 5331 return err 5332 } 5333 5334 errorBody.Seek(0, io.SeekStart) 5335 if len(code) != 0 { 5336 errorCode = restjson.SanitizeErrorCode(code) 5337 } 5338 if len(message) != 0 { 5339 errorMessage = message 5340 } 5341 5342 switch { 5343 case strings.EqualFold("InternalServerException", errorCode): 5344 return awsAwsjson11_deserializeErrorInternalServerException(response, errorBody) 5345 5346 case strings.EqualFold("InvalidRequestException", errorCode): 5347 return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody) 5348 5349 case strings.EqualFold("KmsKeyValidationException", errorCode): 5350 return awsAwsjson11_deserializeErrorKmsKeyValidationException(response, errorBody) 5351 5352 case strings.EqualFold("ResourceNotFoundException", errorCode): 5353 return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) 5354 5355 case strings.EqualFold("ResourceUnavailableException", errorCode): 5356 return awsAwsjson11_deserializeErrorResourceUnavailableException(response, errorBody) 5357 5358 case strings.EqualFold("TooManyRequestsException", errorCode): 5359 return awsAwsjson11_deserializeErrorTooManyRequestsException(response, errorBody) 5360 5361 default: 5362 genericError := &smithy.GenericAPIError{ 5363 Code: errorCode, 5364 Message: errorMessage, 5365 } 5366 return genericError 5367 5368 } 5369} 5370 5371type awsAwsjson11_deserializeOpStartEventsDetectionJob struct { 5372} 5373 5374func (*awsAwsjson11_deserializeOpStartEventsDetectionJob) ID() string { 5375 return "OperationDeserializer" 5376} 5377 5378func (m *awsAwsjson11_deserializeOpStartEventsDetectionJob) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 5379 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 5380) { 5381 out, metadata, err = next.HandleDeserialize(ctx, in) 5382 if err != nil { 5383 return out, metadata, err 5384 } 5385 5386 response, ok := out.RawResponse.(*smithyhttp.Response) 5387 if !ok { 5388 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 5389 } 5390 5391 if response.StatusCode < 200 || response.StatusCode >= 300 { 5392 return out, metadata, awsAwsjson11_deserializeOpErrorStartEventsDetectionJob(response, &metadata) 5393 } 5394 output := &StartEventsDetectionJobOutput{} 5395 out.Result = output 5396 5397 var buff [1024]byte 5398 ringBuffer := smithyio.NewRingBuffer(buff[:]) 5399 5400 body := io.TeeReader(response.Body, ringBuffer) 5401 decoder := json.NewDecoder(body) 5402 decoder.UseNumber() 5403 var shape interface{} 5404 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 5405 var snapshot bytes.Buffer 5406 io.Copy(&snapshot, ringBuffer) 5407 err = &smithy.DeserializationError{ 5408 Err: fmt.Errorf("failed to decode response body, %w", err), 5409 Snapshot: snapshot.Bytes(), 5410 } 5411 return out, metadata, err 5412 } 5413 5414 err = awsAwsjson11_deserializeOpDocumentStartEventsDetectionJobOutput(&output, shape) 5415 if err != nil { 5416 var snapshot bytes.Buffer 5417 io.Copy(&snapshot, ringBuffer) 5418 err = &smithy.DeserializationError{ 5419 Err: fmt.Errorf("failed to decode response body, %w", err), 5420 Snapshot: snapshot.Bytes(), 5421 } 5422 return out, metadata, err 5423 } 5424 5425 return out, metadata, err 5426} 5427 5428func awsAwsjson11_deserializeOpErrorStartEventsDetectionJob(response *smithyhttp.Response, metadata *middleware.Metadata) error { 5429 var errorBuffer bytes.Buffer 5430 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 5431 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 5432 } 5433 errorBody := bytes.NewReader(errorBuffer.Bytes()) 5434 5435 errorCode := "UnknownError" 5436 errorMessage := errorCode 5437 5438 code := response.Header.Get("X-Amzn-ErrorType") 5439 if len(code) != 0 { 5440 errorCode = restjson.SanitizeErrorCode(code) 5441 } 5442 5443 var buff [1024]byte 5444 ringBuffer := smithyio.NewRingBuffer(buff[:]) 5445 5446 body := io.TeeReader(errorBody, ringBuffer) 5447 decoder := json.NewDecoder(body) 5448 decoder.UseNumber() 5449 code, message, err := restjson.GetErrorInfo(decoder) 5450 if err != nil { 5451 var snapshot bytes.Buffer 5452 io.Copy(&snapshot, ringBuffer) 5453 err = &smithy.DeserializationError{ 5454 Err: fmt.Errorf("failed to decode response body, %w", err), 5455 Snapshot: snapshot.Bytes(), 5456 } 5457 return err 5458 } 5459 5460 errorBody.Seek(0, io.SeekStart) 5461 if len(code) != 0 { 5462 errorCode = restjson.SanitizeErrorCode(code) 5463 } 5464 if len(message) != 0 { 5465 errorMessage = message 5466 } 5467 5468 switch { 5469 case strings.EqualFold("InternalServerException", errorCode): 5470 return awsAwsjson11_deserializeErrorInternalServerException(response, errorBody) 5471 5472 case strings.EqualFold("InvalidRequestException", errorCode): 5473 return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody) 5474 5475 case strings.EqualFold("KmsKeyValidationException", errorCode): 5476 return awsAwsjson11_deserializeErrorKmsKeyValidationException(response, errorBody) 5477 5478 case strings.EqualFold("TooManyRequestsException", errorCode): 5479 return awsAwsjson11_deserializeErrorTooManyRequestsException(response, errorBody) 5480 5481 default: 5482 genericError := &smithy.GenericAPIError{ 5483 Code: errorCode, 5484 Message: errorMessage, 5485 } 5486 return genericError 5487 5488 } 5489} 5490 5491type awsAwsjson11_deserializeOpStartKeyPhrasesDetectionJob struct { 5492} 5493 5494func (*awsAwsjson11_deserializeOpStartKeyPhrasesDetectionJob) ID() string { 5495 return "OperationDeserializer" 5496} 5497 5498func (m *awsAwsjson11_deserializeOpStartKeyPhrasesDetectionJob) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 5499 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 5500) { 5501 out, metadata, err = next.HandleDeserialize(ctx, in) 5502 if err != nil { 5503 return out, metadata, err 5504 } 5505 5506 response, ok := out.RawResponse.(*smithyhttp.Response) 5507 if !ok { 5508 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 5509 } 5510 5511 if response.StatusCode < 200 || response.StatusCode >= 300 { 5512 return out, metadata, awsAwsjson11_deserializeOpErrorStartKeyPhrasesDetectionJob(response, &metadata) 5513 } 5514 output := &StartKeyPhrasesDetectionJobOutput{} 5515 out.Result = output 5516 5517 var buff [1024]byte 5518 ringBuffer := smithyio.NewRingBuffer(buff[:]) 5519 5520 body := io.TeeReader(response.Body, ringBuffer) 5521 decoder := json.NewDecoder(body) 5522 decoder.UseNumber() 5523 var shape interface{} 5524 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 5525 var snapshot bytes.Buffer 5526 io.Copy(&snapshot, ringBuffer) 5527 err = &smithy.DeserializationError{ 5528 Err: fmt.Errorf("failed to decode response body, %w", err), 5529 Snapshot: snapshot.Bytes(), 5530 } 5531 return out, metadata, err 5532 } 5533 5534 err = awsAwsjson11_deserializeOpDocumentStartKeyPhrasesDetectionJobOutput(&output, shape) 5535 if err != nil { 5536 var snapshot bytes.Buffer 5537 io.Copy(&snapshot, ringBuffer) 5538 err = &smithy.DeserializationError{ 5539 Err: fmt.Errorf("failed to decode response body, %w", err), 5540 Snapshot: snapshot.Bytes(), 5541 } 5542 return out, metadata, err 5543 } 5544 5545 return out, metadata, err 5546} 5547 5548func awsAwsjson11_deserializeOpErrorStartKeyPhrasesDetectionJob(response *smithyhttp.Response, metadata *middleware.Metadata) error { 5549 var errorBuffer bytes.Buffer 5550 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 5551 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 5552 } 5553 errorBody := bytes.NewReader(errorBuffer.Bytes()) 5554 5555 errorCode := "UnknownError" 5556 errorMessage := errorCode 5557 5558 code := response.Header.Get("X-Amzn-ErrorType") 5559 if len(code) != 0 { 5560 errorCode = restjson.SanitizeErrorCode(code) 5561 } 5562 5563 var buff [1024]byte 5564 ringBuffer := smithyio.NewRingBuffer(buff[:]) 5565 5566 body := io.TeeReader(errorBody, ringBuffer) 5567 decoder := json.NewDecoder(body) 5568 decoder.UseNumber() 5569 code, message, err := restjson.GetErrorInfo(decoder) 5570 if err != nil { 5571 var snapshot bytes.Buffer 5572 io.Copy(&snapshot, ringBuffer) 5573 err = &smithy.DeserializationError{ 5574 Err: fmt.Errorf("failed to decode response body, %w", err), 5575 Snapshot: snapshot.Bytes(), 5576 } 5577 return err 5578 } 5579 5580 errorBody.Seek(0, io.SeekStart) 5581 if len(code) != 0 { 5582 errorCode = restjson.SanitizeErrorCode(code) 5583 } 5584 if len(message) != 0 { 5585 errorMessage = message 5586 } 5587 5588 switch { 5589 case strings.EqualFold("InternalServerException", errorCode): 5590 return awsAwsjson11_deserializeErrorInternalServerException(response, errorBody) 5591 5592 case strings.EqualFold("InvalidRequestException", errorCode): 5593 return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody) 5594 5595 case strings.EqualFold("KmsKeyValidationException", errorCode): 5596 return awsAwsjson11_deserializeErrorKmsKeyValidationException(response, errorBody) 5597 5598 case strings.EqualFold("TooManyRequestsException", errorCode): 5599 return awsAwsjson11_deserializeErrorTooManyRequestsException(response, errorBody) 5600 5601 default: 5602 genericError := &smithy.GenericAPIError{ 5603 Code: errorCode, 5604 Message: errorMessage, 5605 } 5606 return genericError 5607 5608 } 5609} 5610 5611type awsAwsjson11_deserializeOpStartPiiEntitiesDetectionJob struct { 5612} 5613 5614func (*awsAwsjson11_deserializeOpStartPiiEntitiesDetectionJob) ID() string { 5615 return "OperationDeserializer" 5616} 5617 5618func (m *awsAwsjson11_deserializeOpStartPiiEntitiesDetectionJob) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 5619 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 5620) { 5621 out, metadata, err = next.HandleDeserialize(ctx, in) 5622 if err != nil { 5623 return out, metadata, err 5624 } 5625 5626 response, ok := out.RawResponse.(*smithyhttp.Response) 5627 if !ok { 5628 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 5629 } 5630 5631 if response.StatusCode < 200 || response.StatusCode >= 300 { 5632 return out, metadata, awsAwsjson11_deserializeOpErrorStartPiiEntitiesDetectionJob(response, &metadata) 5633 } 5634 output := &StartPiiEntitiesDetectionJobOutput{} 5635 out.Result = output 5636 5637 var buff [1024]byte 5638 ringBuffer := smithyio.NewRingBuffer(buff[:]) 5639 5640 body := io.TeeReader(response.Body, ringBuffer) 5641 decoder := json.NewDecoder(body) 5642 decoder.UseNumber() 5643 var shape interface{} 5644 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 5645 var snapshot bytes.Buffer 5646 io.Copy(&snapshot, ringBuffer) 5647 err = &smithy.DeserializationError{ 5648 Err: fmt.Errorf("failed to decode response body, %w", err), 5649 Snapshot: snapshot.Bytes(), 5650 } 5651 return out, metadata, err 5652 } 5653 5654 err = awsAwsjson11_deserializeOpDocumentStartPiiEntitiesDetectionJobOutput(&output, shape) 5655 if err != nil { 5656 var snapshot bytes.Buffer 5657 io.Copy(&snapshot, ringBuffer) 5658 err = &smithy.DeserializationError{ 5659 Err: fmt.Errorf("failed to decode response body, %w", err), 5660 Snapshot: snapshot.Bytes(), 5661 } 5662 return out, metadata, err 5663 } 5664 5665 return out, metadata, err 5666} 5667 5668func awsAwsjson11_deserializeOpErrorStartPiiEntitiesDetectionJob(response *smithyhttp.Response, metadata *middleware.Metadata) error { 5669 var errorBuffer bytes.Buffer 5670 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 5671 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 5672 } 5673 errorBody := bytes.NewReader(errorBuffer.Bytes()) 5674 5675 errorCode := "UnknownError" 5676 errorMessage := errorCode 5677 5678 code := response.Header.Get("X-Amzn-ErrorType") 5679 if len(code) != 0 { 5680 errorCode = restjson.SanitizeErrorCode(code) 5681 } 5682 5683 var buff [1024]byte 5684 ringBuffer := smithyio.NewRingBuffer(buff[:]) 5685 5686 body := io.TeeReader(errorBody, ringBuffer) 5687 decoder := json.NewDecoder(body) 5688 decoder.UseNumber() 5689 code, message, err := restjson.GetErrorInfo(decoder) 5690 if err != nil { 5691 var snapshot bytes.Buffer 5692 io.Copy(&snapshot, ringBuffer) 5693 err = &smithy.DeserializationError{ 5694 Err: fmt.Errorf("failed to decode response body, %w", err), 5695 Snapshot: snapshot.Bytes(), 5696 } 5697 return err 5698 } 5699 5700 errorBody.Seek(0, io.SeekStart) 5701 if len(code) != 0 { 5702 errorCode = restjson.SanitizeErrorCode(code) 5703 } 5704 if len(message) != 0 { 5705 errorMessage = message 5706 } 5707 5708 switch { 5709 case strings.EqualFold("InternalServerException", errorCode): 5710 return awsAwsjson11_deserializeErrorInternalServerException(response, errorBody) 5711 5712 case strings.EqualFold("InvalidRequestException", errorCode): 5713 return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody) 5714 5715 case strings.EqualFold("KmsKeyValidationException", errorCode): 5716 return awsAwsjson11_deserializeErrorKmsKeyValidationException(response, errorBody) 5717 5718 case strings.EqualFold("TooManyRequestsException", errorCode): 5719 return awsAwsjson11_deserializeErrorTooManyRequestsException(response, errorBody) 5720 5721 default: 5722 genericError := &smithy.GenericAPIError{ 5723 Code: errorCode, 5724 Message: errorMessage, 5725 } 5726 return genericError 5727 5728 } 5729} 5730 5731type awsAwsjson11_deserializeOpStartSentimentDetectionJob struct { 5732} 5733 5734func (*awsAwsjson11_deserializeOpStartSentimentDetectionJob) ID() string { 5735 return "OperationDeserializer" 5736} 5737 5738func (m *awsAwsjson11_deserializeOpStartSentimentDetectionJob) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 5739 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 5740) { 5741 out, metadata, err = next.HandleDeserialize(ctx, in) 5742 if err != nil { 5743 return out, metadata, err 5744 } 5745 5746 response, ok := out.RawResponse.(*smithyhttp.Response) 5747 if !ok { 5748 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 5749 } 5750 5751 if response.StatusCode < 200 || response.StatusCode >= 300 { 5752 return out, metadata, awsAwsjson11_deserializeOpErrorStartSentimentDetectionJob(response, &metadata) 5753 } 5754 output := &StartSentimentDetectionJobOutput{} 5755 out.Result = output 5756 5757 var buff [1024]byte 5758 ringBuffer := smithyio.NewRingBuffer(buff[:]) 5759 5760 body := io.TeeReader(response.Body, ringBuffer) 5761 decoder := json.NewDecoder(body) 5762 decoder.UseNumber() 5763 var shape interface{} 5764 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 5765 var snapshot bytes.Buffer 5766 io.Copy(&snapshot, ringBuffer) 5767 err = &smithy.DeserializationError{ 5768 Err: fmt.Errorf("failed to decode response body, %w", err), 5769 Snapshot: snapshot.Bytes(), 5770 } 5771 return out, metadata, err 5772 } 5773 5774 err = awsAwsjson11_deserializeOpDocumentStartSentimentDetectionJobOutput(&output, shape) 5775 if err != nil { 5776 var snapshot bytes.Buffer 5777 io.Copy(&snapshot, ringBuffer) 5778 err = &smithy.DeserializationError{ 5779 Err: fmt.Errorf("failed to decode response body, %w", err), 5780 Snapshot: snapshot.Bytes(), 5781 } 5782 return out, metadata, err 5783 } 5784 5785 return out, metadata, err 5786} 5787 5788func awsAwsjson11_deserializeOpErrorStartSentimentDetectionJob(response *smithyhttp.Response, metadata *middleware.Metadata) error { 5789 var errorBuffer bytes.Buffer 5790 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 5791 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 5792 } 5793 errorBody := bytes.NewReader(errorBuffer.Bytes()) 5794 5795 errorCode := "UnknownError" 5796 errorMessage := errorCode 5797 5798 code := response.Header.Get("X-Amzn-ErrorType") 5799 if len(code) != 0 { 5800 errorCode = restjson.SanitizeErrorCode(code) 5801 } 5802 5803 var buff [1024]byte 5804 ringBuffer := smithyio.NewRingBuffer(buff[:]) 5805 5806 body := io.TeeReader(errorBody, ringBuffer) 5807 decoder := json.NewDecoder(body) 5808 decoder.UseNumber() 5809 code, message, err := restjson.GetErrorInfo(decoder) 5810 if err != nil { 5811 var snapshot bytes.Buffer 5812 io.Copy(&snapshot, ringBuffer) 5813 err = &smithy.DeserializationError{ 5814 Err: fmt.Errorf("failed to decode response body, %w", err), 5815 Snapshot: snapshot.Bytes(), 5816 } 5817 return err 5818 } 5819 5820 errorBody.Seek(0, io.SeekStart) 5821 if len(code) != 0 { 5822 errorCode = restjson.SanitizeErrorCode(code) 5823 } 5824 if len(message) != 0 { 5825 errorMessage = message 5826 } 5827 5828 switch { 5829 case strings.EqualFold("InternalServerException", errorCode): 5830 return awsAwsjson11_deserializeErrorInternalServerException(response, errorBody) 5831 5832 case strings.EqualFold("InvalidRequestException", errorCode): 5833 return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody) 5834 5835 case strings.EqualFold("KmsKeyValidationException", errorCode): 5836 return awsAwsjson11_deserializeErrorKmsKeyValidationException(response, errorBody) 5837 5838 case strings.EqualFold("TooManyRequestsException", errorCode): 5839 return awsAwsjson11_deserializeErrorTooManyRequestsException(response, errorBody) 5840 5841 default: 5842 genericError := &smithy.GenericAPIError{ 5843 Code: errorCode, 5844 Message: errorMessage, 5845 } 5846 return genericError 5847 5848 } 5849} 5850 5851type awsAwsjson11_deserializeOpStartTopicsDetectionJob struct { 5852} 5853 5854func (*awsAwsjson11_deserializeOpStartTopicsDetectionJob) ID() string { 5855 return "OperationDeserializer" 5856} 5857 5858func (m *awsAwsjson11_deserializeOpStartTopicsDetectionJob) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 5859 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 5860) { 5861 out, metadata, err = next.HandleDeserialize(ctx, in) 5862 if err != nil { 5863 return out, metadata, err 5864 } 5865 5866 response, ok := out.RawResponse.(*smithyhttp.Response) 5867 if !ok { 5868 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 5869 } 5870 5871 if response.StatusCode < 200 || response.StatusCode >= 300 { 5872 return out, metadata, awsAwsjson11_deserializeOpErrorStartTopicsDetectionJob(response, &metadata) 5873 } 5874 output := &StartTopicsDetectionJobOutput{} 5875 out.Result = output 5876 5877 var buff [1024]byte 5878 ringBuffer := smithyio.NewRingBuffer(buff[:]) 5879 5880 body := io.TeeReader(response.Body, ringBuffer) 5881 decoder := json.NewDecoder(body) 5882 decoder.UseNumber() 5883 var shape interface{} 5884 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 5885 var snapshot bytes.Buffer 5886 io.Copy(&snapshot, ringBuffer) 5887 err = &smithy.DeserializationError{ 5888 Err: fmt.Errorf("failed to decode response body, %w", err), 5889 Snapshot: snapshot.Bytes(), 5890 } 5891 return out, metadata, err 5892 } 5893 5894 err = awsAwsjson11_deserializeOpDocumentStartTopicsDetectionJobOutput(&output, shape) 5895 if err != nil { 5896 var snapshot bytes.Buffer 5897 io.Copy(&snapshot, ringBuffer) 5898 err = &smithy.DeserializationError{ 5899 Err: fmt.Errorf("failed to decode response body, %w", err), 5900 Snapshot: snapshot.Bytes(), 5901 } 5902 return out, metadata, err 5903 } 5904 5905 return out, metadata, err 5906} 5907 5908func awsAwsjson11_deserializeOpErrorStartTopicsDetectionJob(response *smithyhttp.Response, metadata *middleware.Metadata) error { 5909 var errorBuffer bytes.Buffer 5910 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 5911 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 5912 } 5913 errorBody := bytes.NewReader(errorBuffer.Bytes()) 5914 5915 errorCode := "UnknownError" 5916 errorMessage := errorCode 5917 5918 code := response.Header.Get("X-Amzn-ErrorType") 5919 if len(code) != 0 { 5920 errorCode = restjson.SanitizeErrorCode(code) 5921 } 5922 5923 var buff [1024]byte 5924 ringBuffer := smithyio.NewRingBuffer(buff[:]) 5925 5926 body := io.TeeReader(errorBody, ringBuffer) 5927 decoder := json.NewDecoder(body) 5928 decoder.UseNumber() 5929 code, message, err := restjson.GetErrorInfo(decoder) 5930 if err != nil { 5931 var snapshot bytes.Buffer 5932 io.Copy(&snapshot, ringBuffer) 5933 err = &smithy.DeserializationError{ 5934 Err: fmt.Errorf("failed to decode response body, %w", err), 5935 Snapshot: snapshot.Bytes(), 5936 } 5937 return err 5938 } 5939 5940 errorBody.Seek(0, io.SeekStart) 5941 if len(code) != 0 { 5942 errorCode = restjson.SanitizeErrorCode(code) 5943 } 5944 if len(message) != 0 { 5945 errorMessage = message 5946 } 5947 5948 switch { 5949 case strings.EqualFold("InternalServerException", errorCode): 5950 return awsAwsjson11_deserializeErrorInternalServerException(response, errorBody) 5951 5952 case strings.EqualFold("InvalidRequestException", errorCode): 5953 return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody) 5954 5955 case strings.EqualFold("KmsKeyValidationException", errorCode): 5956 return awsAwsjson11_deserializeErrorKmsKeyValidationException(response, errorBody) 5957 5958 case strings.EqualFold("TooManyRequestsException", errorCode): 5959 return awsAwsjson11_deserializeErrorTooManyRequestsException(response, errorBody) 5960 5961 default: 5962 genericError := &smithy.GenericAPIError{ 5963 Code: errorCode, 5964 Message: errorMessage, 5965 } 5966 return genericError 5967 5968 } 5969} 5970 5971type awsAwsjson11_deserializeOpStopDominantLanguageDetectionJob struct { 5972} 5973 5974func (*awsAwsjson11_deserializeOpStopDominantLanguageDetectionJob) ID() string { 5975 return "OperationDeserializer" 5976} 5977 5978func (m *awsAwsjson11_deserializeOpStopDominantLanguageDetectionJob) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 5979 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 5980) { 5981 out, metadata, err = next.HandleDeserialize(ctx, in) 5982 if err != nil { 5983 return out, metadata, err 5984 } 5985 5986 response, ok := out.RawResponse.(*smithyhttp.Response) 5987 if !ok { 5988 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 5989 } 5990 5991 if response.StatusCode < 200 || response.StatusCode >= 300 { 5992 return out, metadata, awsAwsjson11_deserializeOpErrorStopDominantLanguageDetectionJob(response, &metadata) 5993 } 5994 output := &StopDominantLanguageDetectionJobOutput{} 5995 out.Result = output 5996 5997 var buff [1024]byte 5998 ringBuffer := smithyio.NewRingBuffer(buff[:]) 5999 6000 body := io.TeeReader(response.Body, ringBuffer) 6001 decoder := json.NewDecoder(body) 6002 decoder.UseNumber() 6003 var shape interface{} 6004 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 6005 var snapshot bytes.Buffer 6006 io.Copy(&snapshot, ringBuffer) 6007 err = &smithy.DeserializationError{ 6008 Err: fmt.Errorf("failed to decode response body, %w", err), 6009 Snapshot: snapshot.Bytes(), 6010 } 6011 return out, metadata, err 6012 } 6013 6014 err = awsAwsjson11_deserializeOpDocumentStopDominantLanguageDetectionJobOutput(&output, shape) 6015 if err != nil { 6016 var snapshot bytes.Buffer 6017 io.Copy(&snapshot, ringBuffer) 6018 err = &smithy.DeserializationError{ 6019 Err: fmt.Errorf("failed to decode response body, %w", err), 6020 Snapshot: snapshot.Bytes(), 6021 } 6022 return out, metadata, err 6023 } 6024 6025 return out, metadata, err 6026} 6027 6028func awsAwsjson11_deserializeOpErrorStopDominantLanguageDetectionJob(response *smithyhttp.Response, metadata *middleware.Metadata) error { 6029 var errorBuffer bytes.Buffer 6030 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 6031 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 6032 } 6033 errorBody := bytes.NewReader(errorBuffer.Bytes()) 6034 6035 errorCode := "UnknownError" 6036 errorMessage := errorCode 6037 6038 code := response.Header.Get("X-Amzn-ErrorType") 6039 if len(code) != 0 { 6040 errorCode = restjson.SanitizeErrorCode(code) 6041 } 6042 6043 var buff [1024]byte 6044 ringBuffer := smithyio.NewRingBuffer(buff[:]) 6045 6046 body := io.TeeReader(errorBody, ringBuffer) 6047 decoder := json.NewDecoder(body) 6048 decoder.UseNumber() 6049 code, message, err := restjson.GetErrorInfo(decoder) 6050 if err != nil { 6051 var snapshot bytes.Buffer 6052 io.Copy(&snapshot, ringBuffer) 6053 err = &smithy.DeserializationError{ 6054 Err: fmt.Errorf("failed to decode response body, %w", err), 6055 Snapshot: snapshot.Bytes(), 6056 } 6057 return err 6058 } 6059 6060 errorBody.Seek(0, io.SeekStart) 6061 if len(code) != 0 { 6062 errorCode = restjson.SanitizeErrorCode(code) 6063 } 6064 if len(message) != 0 { 6065 errorMessage = message 6066 } 6067 6068 switch { 6069 case strings.EqualFold("InternalServerException", errorCode): 6070 return awsAwsjson11_deserializeErrorInternalServerException(response, errorBody) 6071 6072 case strings.EqualFold("InvalidRequestException", errorCode): 6073 return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody) 6074 6075 case strings.EqualFold("JobNotFoundException", errorCode): 6076 return awsAwsjson11_deserializeErrorJobNotFoundException(response, errorBody) 6077 6078 default: 6079 genericError := &smithy.GenericAPIError{ 6080 Code: errorCode, 6081 Message: errorMessage, 6082 } 6083 return genericError 6084 6085 } 6086} 6087 6088type awsAwsjson11_deserializeOpStopEntitiesDetectionJob struct { 6089} 6090 6091func (*awsAwsjson11_deserializeOpStopEntitiesDetectionJob) ID() string { 6092 return "OperationDeserializer" 6093} 6094 6095func (m *awsAwsjson11_deserializeOpStopEntitiesDetectionJob) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 6096 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 6097) { 6098 out, metadata, err = next.HandleDeserialize(ctx, in) 6099 if err != nil { 6100 return out, metadata, err 6101 } 6102 6103 response, ok := out.RawResponse.(*smithyhttp.Response) 6104 if !ok { 6105 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 6106 } 6107 6108 if response.StatusCode < 200 || response.StatusCode >= 300 { 6109 return out, metadata, awsAwsjson11_deserializeOpErrorStopEntitiesDetectionJob(response, &metadata) 6110 } 6111 output := &StopEntitiesDetectionJobOutput{} 6112 out.Result = output 6113 6114 var buff [1024]byte 6115 ringBuffer := smithyio.NewRingBuffer(buff[:]) 6116 6117 body := io.TeeReader(response.Body, ringBuffer) 6118 decoder := json.NewDecoder(body) 6119 decoder.UseNumber() 6120 var shape interface{} 6121 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 6122 var snapshot bytes.Buffer 6123 io.Copy(&snapshot, ringBuffer) 6124 err = &smithy.DeserializationError{ 6125 Err: fmt.Errorf("failed to decode response body, %w", err), 6126 Snapshot: snapshot.Bytes(), 6127 } 6128 return out, metadata, err 6129 } 6130 6131 err = awsAwsjson11_deserializeOpDocumentStopEntitiesDetectionJobOutput(&output, shape) 6132 if err != nil { 6133 var snapshot bytes.Buffer 6134 io.Copy(&snapshot, ringBuffer) 6135 err = &smithy.DeserializationError{ 6136 Err: fmt.Errorf("failed to decode response body, %w", err), 6137 Snapshot: snapshot.Bytes(), 6138 } 6139 return out, metadata, err 6140 } 6141 6142 return out, metadata, err 6143} 6144 6145func awsAwsjson11_deserializeOpErrorStopEntitiesDetectionJob(response *smithyhttp.Response, metadata *middleware.Metadata) error { 6146 var errorBuffer bytes.Buffer 6147 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 6148 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 6149 } 6150 errorBody := bytes.NewReader(errorBuffer.Bytes()) 6151 6152 errorCode := "UnknownError" 6153 errorMessage := errorCode 6154 6155 code := response.Header.Get("X-Amzn-ErrorType") 6156 if len(code) != 0 { 6157 errorCode = restjson.SanitizeErrorCode(code) 6158 } 6159 6160 var buff [1024]byte 6161 ringBuffer := smithyio.NewRingBuffer(buff[:]) 6162 6163 body := io.TeeReader(errorBody, ringBuffer) 6164 decoder := json.NewDecoder(body) 6165 decoder.UseNumber() 6166 code, message, err := restjson.GetErrorInfo(decoder) 6167 if err != nil { 6168 var snapshot bytes.Buffer 6169 io.Copy(&snapshot, ringBuffer) 6170 err = &smithy.DeserializationError{ 6171 Err: fmt.Errorf("failed to decode response body, %w", err), 6172 Snapshot: snapshot.Bytes(), 6173 } 6174 return err 6175 } 6176 6177 errorBody.Seek(0, io.SeekStart) 6178 if len(code) != 0 { 6179 errorCode = restjson.SanitizeErrorCode(code) 6180 } 6181 if len(message) != 0 { 6182 errorMessage = message 6183 } 6184 6185 switch { 6186 case strings.EqualFold("InternalServerException", errorCode): 6187 return awsAwsjson11_deserializeErrorInternalServerException(response, errorBody) 6188 6189 case strings.EqualFold("InvalidRequestException", errorCode): 6190 return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody) 6191 6192 case strings.EqualFold("JobNotFoundException", errorCode): 6193 return awsAwsjson11_deserializeErrorJobNotFoundException(response, errorBody) 6194 6195 default: 6196 genericError := &smithy.GenericAPIError{ 6197 Code: errorCode, 6198 Message: errorMessage, 6199 } 6200 return genericError 6201 6202 } 6203} 6204 6205type awsAwsjson11_deserializeOpStopEventsDetectionJob struct { 6206} 6207 6208func (*awsAwsjson11_deserializeOpStopEventsDetectionJob) ID() string { 6209 return "OperationDeserializer" 6210} 6211 6212func (m *awsAwsjson11_deserializeOpStopEventsDetectionJob) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 6213 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 6214) { 6215 out, metadata, err = next.HandleDeserialize(ctx, in) 6216 if err != nil { 6217 return out, metadata, err 6218 } 6219 6220 response, ok := out.RawResponse.(*smithyhttp.Response) 6221 if !ok { 6222 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 6223 } 6224 6225 if response.StatusCode < 200 || response.StatusCode >= 300 { 6226 return out, metadata, awsAwsjson11_deserializeOpErrorStopEventsDetectionJob(response, &metadata) 6227 } 6228 output := &StopEventsDetectionJobOutput{} 6229 out.Result = output 6230 6231 var buff [1024]byte 6232 ringBuffer := smithyio.NewRingBuffer(buff[:]) 6233 6234 body := io.TeeReader(response.Body, ringBuffer) 6235 decoder := json.NewDecoder(body) 6236 decoder.UseNumber() 6237 var shape interface{} 6238 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 6239 var snapshot bytes.Buffer 6240 io.Copy(&snapshot, ringBuffer) 6241 err = &smithy.DeserializationError{ 6242 Err: fmt.Errorf("failed to decode response body, %w", err), 6243 Snapshot: snapshot.Bytes(), 6244 } 6245 return out, metadata, err 6246 } 6247 6248 err = awsAwsjson11_deserializeOpDocumentStopEventsDetectionJobOutput(&output, shape) 6249 if err != nil { 6250 var snapshot bytes.Buffer 6251 io.Copy(&snapshot, ringBuffer) 6252 err = &smithy.DeserializationError{ 6253 Err: fmt.Errorf("failed to decode response body, %w", err), 6254 Snapshot: snapshot.Bytes(), 6255 } 6256 return out, metadata, err 6257 } 6258 6259 return out, metadata, err 6260} 6261 6262func awsAwsjson11_deserializeOpErrorStopEventsDetectionJob(response *smithyhttp.Response, metadata *middleware.Metadata) error { 6263 var errorBuffer bytes.Buffer 6264 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 6265 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 6266 } 6267 errorBody := bytes.NewReader(errorBuffer.Bytes()) 6268 6269 errorCode := "UnknownError" 6270 errorMessage := errorCode 6271 6272 code := response.Header.Get("X-Amzn-ErrorType") 6273 if len(code) != 0 { 6274 errorCode = restjson.SanitizeErrorCode(code) 6275 } 6276 6277 var buff [1024]byte 6278 ringBuffer := smithyio.NewRingBuffer(buff[:]) 6279 6280 body := io.TeeReader(errorBody, ringBuffer) 6281 decoder := json.NewDecoder(body) 6282 decoder.UseNumber() 6283 code, message, err := restjson.GetErrorInfo(decoder) 6284 if err != nil { 6285 var snapshot bytes.Buffer 6286 io.Copy(&snapshot, ringBuffer) 6287 err = &smithy.DeserializationError{ 6288 Err: fmt.Errorf("failed to decode response body, %w", err), 6289 Snapshot: snapshot.Bytes(), 6290 } 6291 return err 6292 } 6293 6294 errorBody.Seek(0, io.SeekStart) 6295 if len(code) != 0 { 6296 errorCode = restjson.SanitizeErrorCode(code) 6297 } 6298 if len(message) != 0 { 6299 errorMessage = message 6300 } 6301 6302 switch { 6303 case strings.EqualFold("InternalServerException", errorCode): 6304 return awsAwsjson11_deserializeErrorInternalServerException(response, errorBody) 6305 6306 case strings.EqualFold("InvalidRequestException", errorCode): 6307 return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody) 6308 6309 case strings.EqualFold("JobNotFoundException", errorCode): 6310 return awsAwsjson11_deserializeErrorJobNotFoundException(response, errorBody) 6311 6312 default: 6313 genericError := &smithy.GenericAPIError{ 6314 Code: errorCode, 6315 Message: errorMessage, 6316 } 6317 return genericError 6318 6319 } 6320} 6321 6322type awsAwsjson11_deserializeOpStopKeyPhrasesDetectionJob struct { 6323} 6324 6325func (*awsAwsjson11_deserializeOpStopKeyPhrasesDetectionJob) ID() string { 6326 return "OperationDeserializer" 6327} 6328 6329func (m *awsAwsjson11_deserializeOpStopKeyPhrasesDetectionJob) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 6330 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 6331) { 6332 out, metadata, err = next.HandleDeserialize(ctx, in) 6333 if err != nil { 6334 return out, metadata, err 6335 } 6336 6337 response, ok := out.RawResponse.(*smithyhttp.Response) 6338 if !ok { 6339 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 6340 } 6341 6342 if response.StatusCode < 200 || response.StatusCode >= 300 { 6343 return out, metadata, awsAwsjson11_deserializeOpErrorStopKeyPhrasesDetectionJob(response, &metadata) 6344 } 6345 output := &StopKeyPhrasesDetectionJobOutput{} 6346 out.Result = output 6347 6348 var buff [1024]byte 6349 ringBuffer := smithyio.NewRingBuffer(buff[:]) 6350 6351 body := io.TeeReader(response.Body, ringBuffer) 6352 decoder := json.NewDecoder(body) 6353 decoder.UseNumber() 6354 var shape interface{} 6355 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 6356 var snapshot bytes.Buffer 6357 io.Copy(&snapshot, ringBuffer) 6358 err = &smithy.DeserializationError{ 6359 Err: fmt.Errorf("failed to decode response body, %w", err), 6360 Snapshot: snapshot.Bytes(), 6361 } 6362 return out, metadata, err 6363 } 6364 6365 err = awsAwsjson11_deserializeOpDocumentStopKeyPhrasesDetectionJobOutput(&output, shape) 6366 if err != nil { 6367 var snapshot bytes.Buffer 6368 io.Copy(&snapshot, ringBuffer) 6369 err = &smithy.DeserializationError{ 6370 Err: fmt.Errorf("failed to decode response body, %w", err), 6371 Snapshot: snapshot.Bytes(), 6372 } 6373 return out, metadata, err 6374 } 6375 6376 return out, metadata, err 6377} 6378 6379func awsAwsjson11_deserializeOpErrorStopKeyPhrasesDetectionJob(response *smithyhttp.Response, metadata *middleware.Metadata) error { 6380 var errorBuffer bytes.Buffer 6381 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 6382 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 6383 } 6384 errorBody := bytes.NewReader(errorBuffer.Bytes()) 6385 6386 errorCode := "UnknownError" 6387 errorMessage := errorCode 6388 6389 code := response.Header.Get("X-Amzn-ErrorType") 6390 if len(code) != 0 { 6391 errorCode = restjson.SanitizeErrorCode(code) 6392 } 6393 6394 var buff [1024]byte 6395 ringBuffer := smithyio.NewRingBuffer(buff[:]) 6396 6397 body := io.TeeReader(errorBody, ringBuffer) 6398 decoder := json.NewDecoder(body) 6399 decoder.UseNumber() 6400 code, message, err := restjson.GetErrorInfo(decoder) 6401 if err != nil { 6402 var snapshot bytes.Buffer 6403 io.Copy(&snapshot, ringBuffer) 6404 err = &smithy.DeserializationError{ 6405 Err: fmt.Errorf("failed to decode response body, %w", err), 6406 Snapshot: snapshot.Bytes(), 6407 } 6408 return err 6409 } 6410 6411 errorBody.Seek(0, io.SeekStart) 6412 if len(code) != 0 { 6413 errorCode = restjson.SanitizeErrorCode(code) 6414 } 6415 if len(message) != 0 { 6416 errorMessage = message 6417 } 6418 6419 switch { 6420 case strings.EqualFold("InternalServerException", errorCode): 6421 return awsAwsjson11_deserializeErrorInternalServerException(response, errorBody) 6422 6423 case strings.EqualFold("InvalidRequestException", errorCode): 6424 return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody) 6425 6426 case strings.EqualFold("JobNotFoundException", errorCode): 6427 return awsAwsjson11_deserializeErrorJobNotFoundException(response, errorBody) 6428 6429 default: 6430 genericError := &smithy.GenericAPIError{ 6431 Code: errorCode, 6432 Message: errorMessage, 6433 } 6434 return genericError 6435 6436 } 6437} 6438 6439type awsAwsjson11_deserializeOpStopPiiEntitiesDetectionJob struct { 6440} 6441 6442func (*awsAwsjson11_deserializeOpStopPiiEntitiesDetectionJob) ID() string { 6443 return "OperationDeserializer" 6444} 6445 6446func (m *awsAwsjson11_deserializeOpStopPiiEntitiesDetectionJob) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 6447 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 6448) { 6449 out, metadata, err = next.HandleDeserialize(ctx, in) 6450 if err != nil { 6451 return out, metadata, err 6452 } 6453 6454 response, ok := out.RawResponse.(*smithyhttp.Response) 6455 if !ok { 6456 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 6457 } 6458 6459 if response.StatusCode < 200 || response.StatusCode >= 300 { 6460 return out, metadata, awsAwsjson11_deserializeOpErrorStopPiiEntitiesDetectionJob(response, &metadata) 6461 } 6462 output := &StopPiiEntitiesDetectionJobOutput{} 6463 out.Result = output 6464 6465 var buff [1024]byte 6466 ringBuffer := smithyio.NewRingBuffer(buff[:]) 6467 6468 body := io.TeeReader(response.Body, ringBuffer) 6469 decoder := json.NewDecoder(body) 6470 decoder.UseNumber() 6471 var shape interface{} 6472 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 6473 var snapshot bytes.Buffer 6474 io.Copy(&snapshot, ringBuffer) 6475 err = &smithy.DeserializationError{ 6476 Err: fmt.Errorf("failed to decode response body, %w", err), 6477 Snapshot: snapshot.Bytes(), 6478 } 6479 return out, metadata, err 6480 } 6481 6482 err = awsAwsjson11_deserializeOpDocumentStopPiiEntitiesDetectionJobOutput(&output, shape) 6483 if err != nil { 6484 var snapshot bytes.Buffer 6485 io.Copy(&snapshot, ringBuffer) 6486 err = &smithy.DeserializationError{ 6487 Err: fmt.Errorf("failed to decode response body, %w", err), 6488 Snapshot: snapshot.Bytes(), 6489 } 6490 return out, metadata, err 6491 } 6492 6493 return out, metadata, err 6494} 6495 6496func awsAwsjson11_deserializeOpErrorStopPiiEntitiesDetectionJob(response *smithyhttp.Response, metadata *middleware.Metadata) error { 6497 var errorBuffer bytes.Buffer 6498 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 6499 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 6500 } 6501 errorBody := bytes.NewReader(errorBuffer.Bytes()) 6502 6503 errorCode := "UnknownError" 6504 errorMessage := errorCode 6505 6506 code := response.Header.Get("X-Amzn-ErrorType") 6507 if len(code) != 0 { 6508 errorCode = restjson.SanitizeErrorCode(code) 6509 } 6510 6511 var buff [1024]byte 6512 ringBuffer := smithyio.NewRingBuffer(buff[:]) 6513 6514 body := io.TeeReader(errorBody, ringBuffer) 6515 decoder := json.NewDecoder(body) 6516 decoder.UseNumber() 6517 code, message, err := restjson.GetErrorInfo(decoder) 6518 if err != nil { 6519 var snapshot bytes.Buffer 6520 io.Copy(&snapshot, ringBuffer) 6521 err = &smithy.DeserializationError{ 6522 Err: fmt.Errorf("failed to decode response body, %w", err), 6523 Snapshot: snapshot.Bytes(), 6524 } 6525 return err 6526 } 6527 6528 errorBody.Seek(0, io.SeekStart) 6529 if len(code) != 0 { 6530 errorCode = restjson.SanitizeErrorCode(code) 6531 } 6532 if len(message) != 0 { 6533 errorMessage = message 6534 } 6535 6536 switch { 6537 case strings.EqualFold("InternalServerException", errorCode): 6538 return awsAwsjson11_deserializeErrorInternalServerException(response, errorBody) 6539 6540 case strings.EqualFold("InvalidRequestException", errorCode): 6541 return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody) 6542 6543 case strings.EqualFold("JobNotFoundException", errorCode): 6544 return awsAwsjson11_deserializeErrorJobNotFoundException(response, errorBody) 6545 6546 default: 6547 genericError := &smithy.GenericAPIError{ 6548 Code: errorCode, 6549 Message: errorMessage, 6550 } 6551 return genericError 6552 6553 } 6554} 6555 6556type awsAwsjson11_deserializeOpStopSentimentDetectionJob struct { 6557} 6558 6559func (*awsAwsjson11_deserializeOpStopSentimentDetectionJob) ID() string { 6560 return "OperationDeserializer" 6561} 6562 6563func (m *awsAwsjson11_deserializeOpStopSentimentDetectionJob) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 6564 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 6565) { 6566 out, metadata, err = next.HandleDeserialize(ctx, in) 6567 if err != nil { 6568 return out, metadata, err 6569 } 6570 6571 response, ok := out.RawResponse.(*smithyhttp.Response) 6572 if !ok { 6573 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 6574 } 6575 6576 if response.StatusCode < 200 || response.StatusCode >= 300 { 6577 return out, metadata, awsAwsjson11_deserializeOpErrorStopSentimentDetectionJob(response, &metadata) 6578 } 6579 output := &StopSentimentDetectionJobOutput{} 6580 out.Result = output 6581 6582 var buff [1024]byte 6583 ringBuffer := smithyio.NewRingBuffer(buff[:]) 6584 6585 body := io.TeeReader(response.Body, ringBuffer) 6586 decoder := json.NewDecoder(body) 6587 decoder.UseNumber() 6588 var shape interface{} 6589 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 6590 var snapshot bytes.Buffer 6591 io.Copy(&snapshot, ringBuffer) 6592 err = &smithy.DeserializationError{ 6593 Err: fmt.Errorf("failed to decode response body, %w", err), 6594 Snapshot: snapshot.Bytes(), 6595 } 6596 return out, metadata, err 6597 } 6598 6599 err = awsAwsjson11_deserializeOpDocumentStopSentimentDetectionJobOutput(&output, shape) 6600 if err != nil { 6601 var snapshot bytes.Buffer 6602 io.Copy(&snapshot, ringBuffer) 6603 err = &smithy.DeserializationError{ 6604 Err: fmt.Errorf("failed to decode response body, %w", err), 6605 Snapshot: snapshot.Bytes(), 6606 } 6607 return out, metadata, err 6608 } 6609 6610 return out, metadata, err 6611} 6612 6613func awsAwsjson11_deserializeOpErrorStopSentimentDetectionJob(response *smithyhttp.Response, metadata *middleware.Metadata) error { 6614 var errorBuffer bytes.Buffer 6615 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 6616 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 6617 } 6618 errorBody := bytes.NewReader(errorBuffer.Bytes()) 6619 6620 errorCode := "UnknownError" 6621 errorMessage := errorCode 6622 6623 code := response.Header.Get("X-Amzn-ErrorType") 6624 if len(code) != 0 { 6625 errorCode = restjson.SanitizeErrorCode(code) 6626 } 6627 6628 var buff [1024]byte 6629 ringBuffer := smithyio.NewRingBuffer(buff[:]) 6630 6631 body := io.TeeReader(errorBody, ringBuffer) 6632 decoder := json.NewDecoder(body) 6633 decoder.UseNumber() 6634 code, message, err := restjson.GetErrorInfo(decoder) 6635 if err != nil { 6636 var snapshot bytes.Buffer 6637 io.Copy(&snapshot, ringBuffer) 6638 err = &smithy.DeserializationError{ 6639 Err: fmt.Errorf("failed to decode response body, %w", err), 6640 Snapshot: snapshot.Bytes(), 6641 } 6642 return err 6643 } 6644 6645 errorBody.Seek(0, io.SeekStart) 6646 if len(code) != 0 { 6647 errorCode = restjson.SanitizeErrorCode(code) 6648 } 6649 if len(message) != 0 { 6650 errorMessage = message 6651 } 6652 6653 switch { 6654 case strings.EqualFold("InternalServerException", errorCode): 6655 return awsAwsjson11_deserializeErrorInternalServerException(response, errorBody) 6656 6657 case strings.EqualFold("InvalidRequestException", errorCode): 6658 return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody) 6659 6660 case strings.EqualFold("JobNotFoundException", errorCode): 6661 return awsAwsjson11_deserializeErrorJobNotFoundException(response, errorBody) 6662 6663 default: 6664 genericError := &smithy.GenericAPIError{ 6665 Code: errorCode, 6666 Message: errorMessage, 6667 } 6668 return genericError 6669 6670 } 6671} 6672 6673type awsAwsjson11_deserializeOpStopTrainingDocumentClassifier struct { 6674} 6675 6676func (*awsAwsjson11_deserializeOpStopTrainingDocumentClassifier) ID() string { 6677 return "OperationDeserializer" 6678} 6679 6680func (m *awsAwsjson11_deserializeOpStopTrainingDocumentClassifier) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 6681 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 6682) { 6683 out, metadata, err = next.HandleDeserialize(ctx, in) 6684 if err != nil { 6685 return out, metadata, err 6686 } 6687 6688 response, ok := out.RawResponse.(*smithyhttp.Response) 6689 if !ok { 6690 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 6691 } 6692 6693 if response.StatusCode < 200 || response.StatusCode >= 300 { 6694 return out, metadata, awsAwsjson11_deserializeOpErrorStopTrainingDocumentClassifier(response, &metadata) 6695 } 6696 output := &StopTrainingDocumentClassifierOutput{} 6697 out.Result = output 6698 6699 var buff [1024]byte 6700 ringBuffer := smithyio.NewRingBuffer(buff[:]) 6701 6702 body := io.TeeReader(response.Body, ringBuffer) 6703 decoder := json.NewDecoder(body) 6704 decoder.UseNumber() 6705 var shape interface{} 6706 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 6707 var snapshot bytes.Buffer 6708 io.Copy(&snapshot, ringBuffer) 6709 err = &smithy.DeserializationError{ 6710 Err: fmt.Errorf("failed to decode response body, %w", err), 6711 Snapshot: snapshot.Bytes(), 6712 } 6713 return out, metadata, err 6714 } 6715 6716 err = awsAwsjson11_deserializeOpDocumentStopTrainingDocumentClassifierOutput(&output, shape) 6717 if err != nil { 6718 var snapshot bytes.Buffer 6719 io.Copy(&snapshot, ringBuffer) 6720 err = &smithy.DeserializationError{ 6721 Err: fmt.Errorf("failed to decode response body, %w", err), 6722 Snapshot: snapshot.Bytes(), 6723 } 6724 return out, metadata, err 6725 } 6726 6727 return out, metadata, err 6728} 6729 6730func awsAwsjson11_deserializeOpErrorStopTrainingDocumentClassifier(response *smithyhttp.Response, metadata *middleware.Metadata) error { 6731 var errorBuffer bytes.Buffer 6732 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 6733 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 6734 } 6735 errorBody := bytes.NewReader(errorBuffer.Bytes()) 6736 6737 errorCode := "UnknownError" 6738 errorMessage := errorCode 6739 6740 code := response.Header.Get("X-Amzn-ErrorType") 6741 if len(code) != 0 { 6742 errorCode = restjson.SanitizeErrorCode(code) 6743 } 6744 6745 var buff [1024]byte 6746 ringBuffer := smithyio.NewRingBuffer(buff[:]) 6747 6748 body := io.TeeReader(errorBody, ringBuffer) 6749 decoder := json.NewDecoder(body) 6750 decoder.UseNumber() 6751 code, message, err := restjson.GetErrorInfo(decoder) 6752 if err != nil { 6753 var snapshot bytes.Buffer 6754 io.Copy(&snapshot, ringBuffer) 6755 err = &smithy.DeserializationError{ 6756 Err: fmt.Errorf("failed to decode response body, %w", err), 6757 Snapshot: snapshot.Bytes(), 6758 } 6759 return err 6760 } 6761 6762 errorBody.Seek(0, io.SeekStart) 6763 if len(code) != 0 { 6764 errorCode = restjson.SanitizeErrorCode(code) 6765 } 6766 if len(message) != 0 { 6767 errorMessage = message 6768 } 6769 6770 switch { 6771 case strings.EqualFold("InternalServerException", errorCode): 6772 return awsAwsjson11_deserializeErrorInternalServerException(response, errorBody) 6773 6774 case strings.EqualFold("InvalidRequestException", errorCode): 6775 return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody) 6776 6777 case strings.EqualFold("ResourceNotFoundException", errorCode): 6778 return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) 6779 6780 case strings.EqualFold("TooManyRequestsException", errorCode): 6781 return awsAwsjson11_deserializeErrorTooManyRequestsException(response, errorBody) 6782 6783 default: 6784 genericError := &smithy.GenericAPIError{ 6785 Code: errorCode, 6786 Message: errorMessage, 6787 } 6788 return genericError 6789 6790 } 6791} 6792 6793type awsAwsjson11_deserializeOpStopTrainingEntityRecognizer struct { 6794} 6795 6796func (*awsAwsjson11_deserializeOpStopTrainingEntityRecognizer) ID() string { 6797 return "OperationDeserializer" 6798} 6799 6800func (m *awsAwsjson11_deserializeOpStopTrainingEntityRecognizer) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 6801 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 6802) { 6803 out, metadata, err = next.HandleDeserialize(ctx, in) 6804 if err != nil { 6805 return out, metadata, err 6806 } 6807 6808 response, ok := out.RawResponse.(*smithyhttp.Response) 6809 if !ok { 6810 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 6811 } 6812 6813 if response.StatusCode < 200 || response.StatusCode >= 300 { 6814 return out, metadata, awsAwsjson11_deserializeOpErrorStopTrainingEntityRecognizer(response, &metadata) 6815 } 6816 output := &StopTrainingEntityRecognizerOutput{} 6817 out.Result = output 6818 6819 var buff [1024]byte 6820 ringBuffer := smithyio.NewRingBuffer(buff[:]) 6821 6822 body := io.TeeReader(response.Body, ringBuffer) 6823 decoder := json.NewDecoder(body) 6824 decoder.UseNumber() 6825 var shape interface{} 6826 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 6827 var snapshot bytes.Buffer 6828 io.Copy(&snapshot, ringBuffer) 6829 err = &smithy.DeserializationError{ 6830 Err: fmt.Errorf("failed to decode response body, %w", err), 6831 Snapshot: snapshot.Bytes(), 6832 } 6833 return out, metadata, err 6834 } 6835 6836 err = awsAwsjson11_deserializeOpDocumentStopTrainingEntityRecognizerOutput(&output, shape) 6837 if err != nil { 6838 var snapshot bytes.Buffer 6839 io.Copy(&snapshot, ringBuffer) 6840 err = &smithy.DeserializationError{ 6841 Err: fmt.Errorf("failed to decode response body, %w", err), 6842 Snapshot: snapshot.Bytes(), 6843 } 6844 return out, metadata, err 6845 } 6846 6847 return out, metadata, err 6848} 6849 6850func awsAwsjson11_deserializeOpErrorStopTrainingEntityRecognizer(response *smithyhttp.Response, metadata *middleware.Metadata) error { 6851 var errorBuffer bytes.Buffer 6852 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 6853 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 6854 } 6855 errorBody := bytes.NewReader(errorBuffer.Bytes()) 6856 6857 errorCode := "UnknownError" 6858 errorMessage := errorCode 6859 6860 code := response.Header.Get("X-Amzn-ErrorType") 6861 if len(code) != 0 { 6862 errorCode = restjson.SanitizeErrorCode(code) 6863 } 6864 6865 var buff [1024]byte 6866 ringBuffer := smithyio.NewRingBuffer(buff[:]) 6867 6868 body := io.TeeReader(errorBody, ringBuffer) 6869 decoder := json.NewDecoder(body) 6870 decoder.UseNumber() 6871 code, message, err := restjson.GetErrorInfo(decoder) 6872 if err != nil { 6873 var snapshot bytes.Buffer 6874 io.Copy(&snapshot, ringBuffer) 6875 err = &smithy.DeserializationError{ 6876 Err: fmt.Errorf("failed to decode response body, %w", err), 6877 Snapshot: snapshot.Bytes(), 6878 } 6879 return err 6880 } 6881 6882 errorBody.Seek(0, io.SeekStart) 6883 if len(code) != 0 { 6884 errorCode = restjson.SanitizeErrorCode(code) 6885 } 6886 if len(message) != 0 { 6887 errorMessage = message 6888 } 6889 6890 switch { 6891 case strings.EqualFold("InternalServerException", errorCode): 6892 return awsAwsjson11_deserializeErrorInternalServerException(response, errorBody) 6893 6894 case strings.EqualFold("InvalidRequestException", errorCode): 6895 return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody) 6896 6897 case strings.EqualFold("ResourceNotFoundException", errorCode): 6898 return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) 6899 6900 case strings.EqualFold("TooManyRequestsException", errorCode): 6901 return awsAwsjson11_deserializeErrorTooManyRequestsException(response, errorBody) 6902 6903 default: 6904 genericError := &smithy.GenericAPIError{ 6905 Code: errorCode, 6906 Message: errorMessage, 6907 } 6908 return genericError 6909 6910 } 6911} 6912 6913type awsAwsjson11_deserializeOpTagResource struct { 6914} 6915 6916func (*awsAwsjson11_deserializeOpTagResource) ID() string { 6917 return "OperationDeserializer" 6918} 6919 6920func (m *awsAwsjson11_deserializeOpTagResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 6921 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 6922) { 6923 out, metadata, err = next.HandleDeserialize(ctx, in) 6924 if err != nil { 6925 return out, metadata, err 6926 } 6927 6928 response, ok := out.RawResponse.(*smithyhttp.Response) 6929 if !ok { 6930 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 6931 } 6932 6933 if response.StatusCode < 200 || response.StatusCode >= 300 { 6934 return out, metadata, awsAwsjson11_deserializeOpErrorTagResource(response, &metadata) 6935 } 6936 output := &TagResourceOutput{} 6937 out.Result = output 6938 6939 var buff [1024]byte 6940 ringBuffer := smithyio.NewRingBuffer(buff[:]) 6941 6942 body := io.TeeReader(response.Body, ringBuffer) 6943 decoder := json.NewDecoder(body) 6944 decoder.UseNumber() 6945 var shape interface{} 6946 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 6947 var snapshot bytes.Buffer 6948 io.Copy(&snapshot, ringBuffer) 6949 err = &smithy.DeserializationError{ 6950 Err: fmt.Errorf("failed to decode response body, %w", err), 6951 Snapshot: snapshot.Bytes(), 6952 } 6953 return out, metadata, err 6954 } 6955 6956 err = awsAwsjson11_deserializeOpDocumentTagResourceOutput(&output, shape) 6957 if err != nil { 6958 var snapshot bytes.Buffer 6959 io.Copy(&snapshot, ringBuffer) 6960 err = &smithy.DeserializationError{ 6961 Err: fmt.Errorf("failed to decode response body, %w", err), 6962 Snapshot: snapshot.Bytes(), 6963 } 6964 return out, metadata, err 6965 } 6966 6967 return out, metadata, err 6968} 6969 6970func awsAwsjson11_deserializeOpErrorTagResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { 6971 var errorBuffer bytes.Buffer 6972 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 6973 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 6974 } 6975 errorBody := bytes.NewReader(errorBuffer.Bytes()) 6976 6977 errorCode := "UnknownError" 6978 errorMessage := errorCode 6979 6980 code := response.Header.Get("X-Amzn-ErrorType") 6981 if len(code) != 0 { 6982 errorCode = restjson.SanitizeErrorCode(code) 6983 } 6984 6985 var buff [1024]byte 6986 ringBuffer := smithyio.NewRingBuffer(buff[:]) 6987 6988 body := io.TeeReader(errorBody, ringBuffer) 6989 decoder := json.NewDecoder(body) 6990 decoder.UseNumber() 6991 code, message, err := restjson.GetErrorInfo(decoder) 6992 if err != nil { 6993 var snapshot bytes.Buffer 6994 io.Copy(&snapshot, ringBuffer) 6995 err = &smithy.DeserializationError{ 6996 Err: fmt.Errorf("failed to decode response body, %w", err), 6997 Snapshot: snapshot.Bytes(), 6998 } 6999 return err 7000 } 7001 7002 errorBody.Seek(0, io.SeekStart) 7003 if len(code) != 0 { 7004 errorCode = restjson.SanitizeErrorCode(code) 7005 } 7006 if len(message) != 0 { 7007 errorMessage = message 7008 } 7009 7010 switch { 7011 case strings.EqualFold("ConcurrentModificationException", errorCode): 7012 return awsAwsjson11_deserializeErrorConcurrentModificationException(response, errorBody) 7013 7014 case strings.EqualFold("InternalServerException", errorCode): 7015 return awsAwsjson11_deserializeErrorInternalServerException(response, errorBody) 7016 7017 case strings.EqualFold("InvalidRequestException", errorCode): 7018 return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody) 7019 7020 case strings.EqualFold("ResourceNotFoundException", errorCode): 7021 return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) 7022 7023 case strings.EqualFold("TooManyTagsException", errorCode): 7024 return awsAwsjson11_deserializeErrorTooManyTagsException(response, errorBody) 7025 7026 default: 7027 genericError := &smithy.GenericAPIError{ 7028 Code: errorCode, 7029 Message: errorMessage, 7030 } 7031 return genericError 7032 7033 } 7034} 7035 7036type awsAwsjson11_deserializeOpUntagResource struct { 7037} 7038 7039func (*awsAwsjson11_deserializeOpUntagResource) ID() string { 7040 return "OperationDeserializer" 7041} 7042 7043func (m *awsAwsjson11_deserializeOpUntagResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 7044 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 7045) { 7046 out, metadata, err = next.HandleDeserialize(ctx, in) 7047 if err != nil { 7048 return out, metadata, err 7049 } 7050 7051 response, ok := out.RawResponse.(*smithyhttp.Response) 7052 if !ok { 7053 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 7054 } 7055 7056 if response.StatusCode < 200 || response.StatusCode >= 300 { 7057 return out, metadata, awsAwsjson11_deserializeOpErrorUntagResource(response, &metadata) 7058 } 7059 output := &UntagResourceOutput{} 7060 out.Result = output 7061 7062 var buff [1024]byte 7063 ringBuffer := smithyio.NewRingBuffer(buff[:]) 7064 7065 body := io.TeeReader(response.Body, ringBuffer) 7066 decoder := json.NewDecoder(body) 7067 decoder.UseNumber() 7068 var shape interface{} 7069 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 7070 var snapshot bytes.Buffer 7071 io.Copy(&snapshot, ringBuffer) 7072 err = &smithy.DeserializationError{ 7073 Err: fmt.Errorf("failed to decode response body, %w", err), 7074 Snapshot: snapshot.Bytes(), 7075 } 7076 return out, metadata, err 7077 } 7078 7079 err = awsAwsjson11_deserializeOpDocumentUntagResourceOutput(&output, shape) 7080 if err != nil { 7081 var snapshot bytes.Buffer 7082 io.Copy(&snapshot, ringBuffer) 7083 err = &smithy.DeserializationError{ 7084 Err: fmt.Errorf("failed to decode response body, %w", err), 7085 Snapshot: snapshot.Bytes(), 7086 } 7087 return out, metadata, err 7088 } 7089 7090 return out, metadata, err 7091} 7092 7093func awsAwsjson11_deserializeOpErrorUntagResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { 7094 var errorBuffer bytes.Buffer 7095 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 7096 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 7097 } 7098 errorBody := bytes.NewReader(errorBuffer.Bytes()) 7099 7100 errorCode := "UnknownError" 7101 errorMessage := errorCode 7102 7103 code := response.Header.Get("X-Amzn-ErrorType") 7104 if len(code) != 0 { 7105 errorCode = restjson.SanitizeErrorCode(code) 7106 } 7107 7108 var buff [1024]byte 7109 ringBuffer := smithyio.NewRingBuffer(buff[:]) 7110 7111 body := io.TeeReader(errorBody, ringBuffer) 7112 decoder := json.NewDecoder(body) 7113 decoder.UseNumber() 7114 code, message, err := restjson.GetErrorInfo(decoder) 7115 if err != nil { 7116 var snapshot bytes.Buffer 7117 io.Copy(&snapshot, ringBuffer) 7118 err = &smithy.DeserializationError{ 7119 Err: fmt.Errorf("failed to decode response body, %w", err), 7120 Snapshot: snapshot.Bytes(), 7121 } 7122 return err 7123 } 7124 7125 errorBody.Seek(0, io.SeekStart) 7126 if len(code) != 0 { 7127 errorCode = restjson.SanitizeErrorCode(code) 7128 } 7129 if len(message) != 0 { 7130 errorMessage = message 7131 } 7132 7133 switch { 7134 case strings.EqualFold("ConcurrentModificationException", errorCode): 7135 return awsAwsjson11_deserializeErrorConcurrentModificationException(response, errorBody) 7136 7137 case strings.EqualFold("InternalServerException", errorCode): 7138 return awsAwsjson11_deserializeErrorInternalServerException(response, errorBody) 7139 7140 case strings.EqualFold("InvalidRequestException", errorCode): 7141 return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody) 7142 7143 case strings.EqualFold("ResourceNotFoundException", errorCode): 7144 return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) 7145 7146 case strings.EqualFold("TooManyTagKeysException", errorCode): 7147 return awsAwsjson11_deserializeErrorTooManyTagKeysException(response, errorBody) 7148 7149 default: 7150 genericError := &smithy.GenericAPIError{ 7151 Code: errorCode, 7152 Message: errorMessage, 7153 } 7154 return genericError 7155 7156 } 7157} 7158 7159type awsAwsjson11_deserializeOpUpdateEndpoint struct { 7160} 7161 7162func (*awsAwsjson11_deserializeOpUpdateEndpoint) ID() string { 7163 return "OperationDeserializer" 7164} 7165 7166func (m *awsAwsjson11_deserializeOpUpdateEndpoint) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 7167 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 7168) { 7169 out, metadata, err = next.HandleDeserialize(ctx, in) 7170 if err != nil { 7171 return out, metadata, err 7172 } 7173 7174 response, ok := out.RawResponse.(*smithyhttp.Response) 7175 if !ok { 7176 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 7177 } 7178 7179 if response.StatusCode < 200 || response.StatusCode >= 300 { 7180 return out, metadata, awsAwsjson11_deserializeOpErrorUpdateEndpoint(response, &metadata) 7181 } 7182 output := &UpdateEndpointOutput{} 7183 out.Result = output 7184 7185 var buff [1024]byte 7186 ringBuffer := smithyio.NewRingBuffer(buff[:]) 7187 7188 body := io.TeeReader(response.Body, ringBuffer) 7189 decoder := json.NewDecoder(body) 7190 decoder.UseNumber() 7191 var shape interface{} 7192 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 7193 var snapshot bytes.Buffer 7194 io.Copy(&snapshot, ringBuffer) 7195 err = &smithy.DeserializationError{ 7196 Err: fmt.Errorf("failed to decode response body, %w", err), 7197 Snapshot: snapshot.Bytes(), 7198 } 7199 return out, metadata, err 7200 } 7201 7202 err = awsAwsjson11_deserializeOpDocumentUpdateEndpointOutput(&output, shape) 7203 if err != nil { 7204 var snapshot bytes.Buffer 7205 io.Copy(&snapshot, ringBuffer) 7206 err = &smithy.DeserializationError{ 7207 Err: fmt.Errorf("failed to decode response body, %w", err), 7208 Snapshot: snapshot.Bytes(), 7209 } 7210 return out, metadata, err 7211 } 7212 7213 return out, metadata, err 7214} 7215 7216func awsAwsjson11_deserializeOpErrorUpdateEndpoint(response *smithyhttp.Response, metadata *middleware.Metadata) error { 7217 var errorBuffer bytes.Buffer 7218 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 7219 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 7220 } 7221 errorBody := bytes.NewReader(errorBuffer.Bytes()) 7222 7223 errorCode := "UnknownError" 7224 errorMessage := errorCode 7225 7226 code := response.Header.Get("X-Amzn-ErrorType") 7227 if len(code) != 0 { 7228 errorCode = restjson.SanitizeErrorCode(code) 7229 } 7230 7231 var buff [1024]byte 7232 ringBuffer := smithyio.NewRingBuffer(buff[:]) 7233 7234 body := io.TeeReader(errorBody, ringBuffer) 7235 decoder := json.NewDecoder(body) 7236 decoder.UseNumber() 7237 code, message, err := restjson.GetErrorInfo(decoder) 7238 if err != nil { 7239 var snapshot bytes.Buffer 7240 io.Copy(&snapshot, ringBuffer) 7241 err = &smithy.DeserializationError{ 7242 Err: fmt.Errorf("failed to decode response body, %w", err), 7243 Snapshot: snapshot.Bytes(), 7244 } 7245 return err 7246 } 7247 7248 errorBody.Seek(0, io.SeekStart) 7249 if len(code) != 0 { 7250 errorCode = restjson.SanitizeErrorCode(code) 7251 } 7252 if len(message) != 0 { 7253 errorMessage = message 7254 } 7255 7256 switch { 7257 case strings.EqualFold("InternalServerException", errorCode): 7258 return awsAwsjson11_deserializeErrorInternalServerException(response, errorBody) 7259 7260 case strings.EqualFold("InvalidRequestException", errorCode): 7261 return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody) 7262 7263 case strings.EqualFold("ResourceInUseException", errorCode): 7264 return awsAwsjson11_deserializeErrorResourceInUseException(response, errorBody) 7265 7266 case strings.EqualFold("ResourceLimitExceededException", errorCode): 7267 return awsAwsjson11_deserializeErrorResourceLimitExceededException(response, errorBody) 7268 7269 case strings.EqualFold("ResourceNotFoundException", errorCode): 7270 return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) 7271 7272 case strings.EqualFold("ResourceUnavailableException", errorCode): 7273 return awsAwsjson11_deserializeErrorResourceUnavailableException(response, errorBody) 7274 7275 case strings.EqualFold("TooManyRequestsException", errorCode): 7276 return awsAwsjson11_deserializeErrorTooManyRequestsException(response, errorBody) 7277 7278 default: 7279 genericError := &smithy.GenericAPIError{ 7280 Code: errorCode, 7281 Message: errorMessage, 7282 } 7283 return genericError 7284 7285 } 7286} 7287 7288func awsAwsjson11_deserializeErrorBatchSizeLimitExceededException(response *smithyhttp.Response, errorBody *bytes.Reader) error { 7289 var buff [1024]byte 7290 ringBuffer := smithyio.NewRingBuffer(buff[:]) 7291 7292 body := io.TeeReader(errorBody, ringBuffer) 7293 decoder := json.NewDecoder(body) 7294 decoder.UseNumber() 7295 var shape interface{} 7296 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 7297 var snapshot bytes.Buffer 7298 io.Copy(&snapshot, ringBuffer) 7299 err = &smithy.DeserializationError{ 7300 Err: fmt.Errorf("failed to decode response body, %w", err), 7301 Snapshot: snapshot.Bytes(), 7302 } 7303 return err 7304 } 7305 7306 output := &types.BatchSizeLimitExceededException{} 7307 err := awsAwsjson11_deserializeDocumentBatchSizeLimitExceededException(&output, shape) 7308 7309 if err != nil { 7310 var snapshot bytes.Buffer 7311 io.Copy(&snapshot, ringBuffer) 7312 err = &smithy.DeserializationError{ 7313 Err: fmt.Errorf("failed to decode response body, %w", err), 7314 Snapshot: snapshot.Bytes(), 7315 } 7316 return err 7317 } 7318 7319 errorBody.Seek(0, io.SeekStart) 7320 return output 7321} 7322 7323func awsAwsjson11_deserializeErrorConcurrentModificationException(response *smithyhttp.Response, errorBody *bytes.Reader) error { 7324 var buff [1024]byte 7325 ringBuffer := smithyio.NewRingBuffer(buff[:]) 7326 7327 body := io.TeeReader(errorBody, ringBuffer) 7328 decoder := json.NewDecoder(body) 7329 decoder.UseNumber() 7330 var shape interface{} 7331 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 7332 var snapshot bytes.Buffer 7333 io.Copy(&snapshot, ringBuffer) 7334 err = &smithy.DeserializationError{ 7335 Err: fmt.Errorf("failed to decode response body, %w", err), 7336 Snapshot: snapshot.Bytes(), 7337 } 7338 return err 7339 } 7340 7341 output := &types.ConcurrentModificationException{} 7342 err := awsAwsjson11_deserializeDocumentConcurrentModificationException(&output, shape) 7343 7344 if err != nil { 7345 var snapshot bytes.Buffer 7346 io.Copy(&snapshot, ringBuffer) 7347 err = &smithy.DeserializationError{ 7348 Err: fmt.Errorf("failed to decode response body, %w", err), 7349 Snapshot: snapshot.Bytes(), 7350 } 7351 return err 7352 } 7353 7354 errorBody.Seek(0, io.SeekStart) 7355 return output 7356} 7357 7358func awsAwsjson11_deserializeErrorInternalServerException(response *smithyhttp.Response, errorBody *bytes.Reader) error { 7359 var buff [1024]byte 7360 ringBuffer := smithyio.NewRingBuffer(buff[:]) 7361 7362 body := io.TeeReader(errorBody, ringBuffer) 7363 decoder := json.NewDecoder(body) 7364 decoder.UseNumber() 7365 var shape interface{} 7366 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 7367 var snapshot bytes.Buffer 7368 io.Copy(&snapshot, ringBuffer) 7369 err = &smithy.DeserializationError{ 7370 Err: fmt.Errorf("failed to decode response body, %w", err), 7371 Snapshot: snapshot.Bytes(), 7372 } 7373 return err 7374 } 7375 7376 output := &types.InternalServerException{} 7377 err := awsAwsjson11_deserializeDocumentInternalServerException(&output, shape) 7378 7379 if err != nil { 7380 var snapshot bytes.Buffer 7381 io.Copy(&snapshot, ringBuffer) 7382 err = &smithy.DeserializationError{ 7383 Err: fmt.Errorf("failed to decode response body, %w", err), 7384 Snapshot: snapshot.Bytes(), 7385 } 7386 return err 7387 } 7388 7389 errorBody.Seek(0, io.SeekStart) 7390 return output 7391} 7392 7393func awsAwsjson11_deserializeErrorInvalidFilterException(response *smithyhttp.Response, errorBody *bytes.Reader) error { 7394 var buff [1024]byte 7395 ringBuffer := smithyio.NewRingBuffer(buff[:]) 7396 7397 body := io.TeeReader(errorBody, ringBuffer) 7398 decoder := json.NewDecoder(body) 7399 decoder.UseNumber() 7400 var shape interface{} 7401 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 7402 var snapshot bytes.Buffer 7403 io.Copy(&snapshot, ringBuffer) 7404 err = &smithy.DeserializationError{ 7405 Err: fmt.Errorf("failed to decode response body, %w", err), 7406 Snapshot: snapshot.Bytes(), 7407 } 7408 return err 7409 } 7410 7411 output := &types.InvalidFilterException{} 7412 err := awsAwsjson11_deserializeDocumentInvalidFilterException(&output, shape) 7413 7414 if err != nil { 7415 var snapshot bytes.Buffer 7416 io.Copy(&snapshot, ringBuffer) 7417 err = &smithy.DeserializationError{ 7418 Err: fmt.Errorf("failed to decode response body, %w", err), 7419 Snapshot: snapshot.Bytes(), 7420 } 7421 return err 7422 } 7423 7424 errorBody.Seek(0, io.SeekStart) 7425 return output 7426} 7427 7428func awsAwsjson11_deserializeErrorInvalidRequestException(response *smithyhttp.Response, errorBody *bytes.Reader) error { 7429 var buff [1024]byte 7430 ringBuffer := smithyio.NewRingBuffer(buff[:]) 7431 7432 body := io.TeeReader(errorBody, ringBuffer) 7433 decoder := json.NewDecoder(body) 7434 decoder.UseNumber() 7435 var shape interface{} 7436 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 7437 var snapshot bytes.Buffer 7438 io.Copy(&snapshot, ringBuffer) 7439 err = &smithy.DeserializationError{ 7440 Err: fmt.Errorf("failed to decode response body, %w", err), 7441 Snapshot: snapshot.Bytes(), 7442 } 7443 return err 7444 } 7445 7446 output := &types.InvalidRequestException{} 7447 err := awsAwsjson11_deserializeDocumentInvalidRequestException(&output, shape) 7448 7449 if err != nil { 7450 var snapshot bytes.Buffer 7451 io.Copy(&snapshot, ringBuffer) 7452 err = &smithy.DeserializationError{ 7453 Err: fmt.Errorf("failed to decode response body, %w", err), 7454 Snapshot: snapshot.Bytes(), 7455 } 7456 return err 7457 } 7458 7459 errorBody.Seek(0, io.SeekStart) 7460 return output 7461} 7462 7463func awsAwsjson11_deserializeErrorJobNotFoundException(response *smithyhttp.Response, errorBody *bytes.Reader) error { 7464 var buff [1024]byte 7465 ringBuffer := smithyio.NewRingBuffer(buff[:]) 7466 7467 body := io.TeeReader(errorBody, ringBuffer) 7468 decoder := json.NewDecoder(body) 7469 decoder.UseNumber() 7470 var shape interface{} 7471 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 7472 var snapshot bytes.Buffer 7473 io.Copy(&snapshot, ringBuffer) 7474 err = &smithy.DeserializationError{ 7475 Err: fmt.Errorf("failed to decode response body, %w", err), 7476 Snapshot: snapshot.Bytes(), 7477 } 7478 return err 7479 } 7480 7481 output := &types.JobNotFoundException{} 7482 err := awsAwsjson11_deserializeDocumentJobNotFoundException(&output, shape) 7483 7484 if err != nil { 7485 var snapshot bytes.Buffer 7486 io.Copy(&snapshot, ringBuffer) 7487 err = &smithy.DeserializationError{ 7488 Err: fmt.Errorf("failed to decode response body, %w", err), 7489 Snapshot: snapshot.Bytes(), 7490 } 7491 return err 7492 } 7493 7494 errorBody.Seek(0, io.SeekStart) 7495 return output 7496} 7497 7498func awsAwsjson11_deserializeErrorKmsKeyValidationException(response *smithyhttp.Response, errorBody *bytes.Reader) error { 7499 var buff [1024]byte 7500 ringBuffer := smithyio.NewRingBuffer(buff[:]) 7501 7502 body := io.TeeReader(errorBody, ringBuffer) 7503 decoder := json.NewDecoder(body) 7504 decoder.UseNumber() 7505 var shape interface{} 7506 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 7507 var snapshot bytes.Buffer 7508 io.Copy(&snapshot, ringBuffer) 7509 err = &smithy.DeserializationError{ 7510 Err: fmt.Errorf("failed to decode response body, %w", err), 7511 Snapshot: snapshot.Bytes(), 7512 } 7513 return err 7514 } 7515 7516 output := &types.KmsKeyValidationException{} 7517 err := awsAwsjson11_deserializeDocumentKmsKeyValidationException(&output, shape) 7518 7519 if err != nil { 7520 var snapshot bytes.Buffer 7521 io.Copy(&snapshot, ringBuffer) 7522 err = &smithy.DeserializationError{ 7523 Err: fmt.Errorf("failed to decode response body, %w", err), 7524 Snapshot: snapshot.Bytes(), 7525 } 7526 return err 7527 } 7528 7529 errorBody.Seek(0, io.SeekStart) 7530 return output 7531} 7532 7533func awsAwsjson11_deserializeErrorResourceInUseException(response *smithyhttp.Response, errorBody *bytes.Reader) error { 7534 var buff [1024]byte 7535 ringBuffer := smithyio.NewRingBuffer(buff[:]) 7536 7537 body := io.TeeReader(errorBody, ringBuffer) 7538 decoder := json.NewDecoder(body) 7539 decoder.UseNumber() 7540 var shape interface{} 7541 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 7542 var snapshot bytes.Buffer 7543 io.Copy(&snapshot, ringBuffer) 7544 err = &smithy.DeserializationError{ 7545 Err: fmt.Errorf("failed to decode response body, %w", err), 7546 Snapshot: snapshot.Bytes(), 7547 } 7548 return err 7549 } 7550 7551 output := &types.ResourceInUseException{} 7552 err := awsAwsjson11_deserializeDocumentResourceInUseException(&output, shape) 7553 7554 if err != nil { 7555 var snapshot bytes.Buffer 7556 io.Copy(&snapshot, ringBuffer) 7557 err = &smithy.DeserializationError{ 7558 Err: fmt.Errorf("failed to decode response body, %w", err), 7559 Snapshot: snapshot.Bytes(), 7560 } 7561 return err 7562 } 7563 7564 errorBody.Seek(0, io.SeekStart) 7565 return output 7566} 7567 7568func awsAwsjson11_deserializeErrorResourceLimitExceededException(response *smithyhttp.Response, errorBody *bytes.Reader) error { 7569 var buff [1024]byte 7570 ringBuffer := smithyio.NewRingBuffer(buff[:]) 7571 7572 body := io.TeeReader(errorBody, ringBuffer) 7573 decoder := json.NewDecoder(body) 7574 decoder.UseNumber() 7575 var shape interface{} 7576 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 7577 var snapshot bytes.Buffer 7578 io.Copy(&snapshot, ringBuffer) 7579 err = &smithy.DeserializationError{ 7580 Err: fmt.Errorf("failed to decode response body, %w", err), 7581 Snapshot: snapshot.Bytes(), 7582 } 7583 return err 7584 } 7585 7586 output := &types.ResourceLimitExceededException{} 7587 err := awsAwsjson11_deserializeDocumentResourceLimitExceededException(&output, shape) 7588 7589 if err != nil { 7590 var snapshot bytes.Buffer 7591 io.Copy(&snapshot, ringBuffer) 7592 err = &smithy.DeserializationError{ 7593 Err: fmt.Errorf("failed to decode response body, %w", err), 7594 Snapshot: snapshot.Bytes(), 7595 } 7596 return err 7597 } 7598 7599 errorBody.Seek(0, io.SeekStart) 7600 return output 7601} 7602 7603func awsAwsjson11_deserializeErrorResourceNotFoundException(response *smithyhttp.Response, errorBody *bytes.Reader) error { 7604 var buff [1024]byte 7605 ringBuffer := smithyio.NewRingBuffer(buff[:]) 7606 7607 body := io.TeeReader(errorBody, ringBuffer) 7608 decoder := json.NewDecoder(body) 7609 decoder.UseNumber() 7610 var shape interface{} 7611 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 7612 var snapshot bytes.Buffer 7613 io.Copy(&snapshot, ringBuffer) 7614 err = &smithy.DeserializationError{ 7615 Err: fmt.Errorf("failed to decode response body, %w", err), 7616 Snapshot: snapshot.Bytes(), 7617 } 7618 return err 7619 } 7620 7621 output := &types.ResourceNotFoundException{} 7622 err := awsAwsjson11_deserializeDocumentResourceNotFoundException(&output, shape) 7623 7624 if err != nil { 7625 var snapshot bytes.Buffer 7626 io.Copy(&snapshot, ringBuffer) 7627 err = &smithy.DeserializationError{ 7628 Err: fmt.Errorf("failed to decode response body, %w", err), 7629 Snapshot: snapshot.Bytes(), 7630 } 7631 return err 7632 } 7633 7634 errorBody.Seek(0, io.SeekStart) 7635 return output 7636} 7637 7638func awsAwsjson11_deserializeErrorResourceUnavailableException(response *smithyhttp.Response, errorBody *bytes.Reader) error { 7639 var buff [1024]byte 7640 ringBuffer := smithyio.NewRingBuffer(buff[:]) 7641 7642 body := io.TeeReader(errorBody, ringBuffer) 7643 decoder := json.NewDecoder(body) 7644 decoder.UseNumber() 7645 var shape interface{} 7646 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 7647 var snapshot bytes.Buffer 7648 io.Copy(&snapshot, ringBuffer) 7649 err = &smithy.DeserializationError{ 7650 Err: fmt.Errorf("failed to decode response body, %w", err), 7651 Snapshot: snapshot.Bytes(), 7652 } 7653 return err 7654 } 7655 7656 output := &types.ResourceUnavailableException{} 7657 err := awsAwsjson11_deserializeDocumentResourceUnavailableException(&output, shape) 7658 7659 if err != nil { 7660 var snapshot bytes.Buffer 7661 io.Copy(&snapshot, ringBuffer) 7662 err = &smithy.DeserializationError{ 7663 Err: fmt.Errorf("failed to decode response body, %w", err), 7664 Snapshot: snapshot.Bytes(), 7665 } 7666 return err 7667 } 7668 7669 errorBody.Seek(0, io.SeekStart) 7670 return output 7671} 7672 7673func awsAwsjson11_deserializeErrorTextSizeLimitExceededException(response *smithyhttp.Response, errorBody *bytes.Reader) error { 7674 var buff [1024]byte 7675 ringBuffer := smithyio.NewRingBuffer(buff[:]) 7676 7677 body := io.TeeReader(errorBody, ringBuffer) 7678 decoder := json.NewDecoder(body) 7679 decoder.UseNumber() 7680 var shape interface{} 7681 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 7682 var snapshot bytes.Buffer 7683 io.Copy(&snapshot, ringBuffer) 7684 err = &smithy.DeserializationError{ 7685 Err: fmt.Errorf("failed to decode response body, %w", err), 7686 Snapshot: snapshot.Bytes(), 7687 } 7688 return err 7689 } 7690 7691 output := &types.TextSizeLimitExceededException{} 7692 err := awsAwsjson11_deserializeDocumentTextSizeLimitExceededException(&output, shape) 7693 7694 if err != nil { 7695 var snapshot bytes.Buffer 7696 io.Copy(&snapshot, ringBuffer) 7697 err = &smithy.DeserializationError{ 7698 Err: fmt.Errorf("failed to decode response body, %w", err), 7699 Snapshot: snapshot.Bytes(), 7700 } 7701 return err 7702 } 7703 7704 errorBody.Seek(0, io.SeekStart) 7705 return output 7706} 7707 7708func awsAwsjson11_deserializeErrorTooManyRequestsException(response *smithyhttp.Response, errorBody *bytes.Reader) error { 7709 var buff [1024]byte 7710 ringBuffer := smithyio.NewRingBuffer(buff[:]) 7711 7712 body := io.TeeReader(errorBody, ringBuffer) 7713 decoder := json.NewDecoder(body) 7714 decoder.UseNumber() 7715 var shape interface{} 7716 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 7717 var snapshot bytes.Buffer 7718 io.Copy(&snapshot, ringBuffer) 7719 err = &smithy.DeserializationError{ 7720 Err: fmt.Errorf("failed to decode response body, %w", err), 7721 Snapshot: snapshot.Bytes(), 7722 } 7723 return err 7724 } 7725 7726 output := &types.TooManyRequestsException{} 7727 err := awsAwsjson11_deserializeDocumentTooManyRequestsException(&output, shape) 7728 7729 if err != nil { 7730 var snapshot bytes.Buffer 7731 io.Copy(&snapshot, ringBuffer) 7732 err = &smithy.DeserializationError{ 7733 Err: fmt.Errorf("failed to decode response body, %w", err), 7734 Snapshot: snapshot.Bytes(), 7735 } 7736 return err 7737 } 7738 7739 errorBody.Seek(0, io.SeekStart) 7740 return output 7741} 7742 7743func awsAwsjson11_deserializeErrorTooManyTagKeysException(response *smithyhttp.Response, errorBody *bytes.Reader) error { 7744 var buff [1024]byte 7745 ringBuffer := smithyio.NewRingBuffer(buff[:]) 7746 7747 body := io.TeeReader(errorBody, ringBuffer) 7748 decoder := json.NewDecoder(body) 7749 decoder.UseNumber() 7750 var shape interface{} 7751 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 7752 var snapshot bytes.Buffer 7753 io.Copy(&snapshot, ringBuffer) 7754 err = &smithy.DeserializationError{ 7755 Err: fmt.Errorf("failed to decode response body, %w", err), 7756 Snapshot: snapshot.Bytes(), 7757 } 7758 return err 7759 } 7760 7761 output := &types.TooManyTagKeysException{} 7762 err := awsAwsjson11_deserializeDocumentTooManyTagKeysException(&output, shape) 7763 7764 if err != nil { 7765 var snapshot bytes.Buffer 7766 io.Copy(&snapshot, ringBuffer) 7767 err = &smithy.DeserializationError{ 7768 Err: fmt.Errorf("failed to decode response body, %w", err), 7769 Snapshot: snapshot.Bytes(), 7770 } 7771 return err 7772 } 7773 7774 errorBody.Seek(0, io.SeekStart) 7775 return output 7776} 7777 7778func awsAwsjson11_deserializeErrorTooManyTagsException(response *smithyhttp.Response, errorBody *bytes.Reader) error { 7779 var buff [1024]byte 7780 ringBuffer := smithyio.NewRingBuffer(buff[:]) 7781 7782 body := io.TeeReader(errorBody, ringBuffer) 7783 decoder := json.NewDecoder(body) 7784 decoder.UseNumber() 7785 var shape interface{} 7786 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 7787 var snapshot bytes.Buffer 7788 io.Copy(&snapshot, ringBuffer) 7789 err = &smithy.DeserializationError{ 7790 Err: fmt.Errorf("failed to decode response body, %w", err), 7791 Snapshot: snapshot.Bytes(), 7792 } 7793 return err 7794 } 7795 7796 output := &types.TooManyTagsException{} 7797 err := awsAwsjson11_deserializeDocumentTooManyTagsException(&output, shape) 7798 7799 if err != nil { 7800 var snapshot bytes.Buffer 7801 io.Copy(&snapshot, ringBuffer) 7802 err = &smithy.DeserializationError{ 7803 Err: fmt.Errorf("failed to decode response body, %w", err), 7804 Snapshot: snapshot.Bytes(), 7805 } 7806 return err 7807 } 7808 7809 errorBody.Seek(0, io.SeekStart) 7810 return output 7811} 7812 7813func awsAwsjson11_deserializeErrorUnsupportedLanguageException(response *smithyhttp.Response, errorBody *bytes.Reader) error { 7814 var buff [1024]byte 7815 ringBuffer := smithyio.NewRingBuffer(buff[:]) 7816 7817 body := io.TeeReader(errorBody, ringBuffer) 7818 decoder := json.NewDecoder(body) 7819 decoder.UseNumber() 7820 var shape interface{} 7821 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 7822 var snapshot bytes.Buffer 7823 io.Copy(&snapshot, ringBuffer) 7824 err = &smithy.DeserializationError{ 7825 Err: fmt.Errorf("failed to decode response body, %w", err), 7826 Snapshot: snapshot.Bytes(), 7827 } 7828 return err 7829 } 7830 7831 output := &types.UnsupportedLanguageException{} 7832 err := awsAwsjson11_deserializeDocumentUnsupportedLanguageException(&output, shape) 7833 7834 if err != nil { 7835 var snapshot bytes.Buffer 7836 io.Copy(&snapshot, ringBuffer) 7837 err = &smithy.DeserializationError{ 7838 Err: fmt.Errorf("failed to decode response body, %w", err), 7839 Snapshot: snapshot.Bytes(), 7840 } 7841 return err 7842 } 7843 7844 errorBody.Seek(0, io.SeekStart) 7845 return output 7846} 7847 7848func awsAwsjson11_deserializeDocumentAttributeNamesList(v *[]string, value interface{}) error { 7849 if v == nil { 7850 return fmt.Errorf("unexpected nil of type %T", v) 7851 } 7852 if value == nil { 7853 return nil 7854 } 7855 7856 shape, ok := value.([]interface{}) 7857 if !ok { 7858 return fmt.Errorf("unexpected JSON type %v", value) 7859 } 7860 7861 var cv []string 7862 if *v == nil { 7863 cv = []string{} 7864 } else { 7865 cv = *v 7866 } 7867 7868 for _, value := range shape { 7869 var col string 7870 if value != nil { 7871 jtv, ok := value.(string) 7872 if !ok { 7873 return fmt.Errorf("expected AttributeNamesListItem to be of type string, got %T instead", value) 7874 } 7875 col = jtv 7876 } 7877 cv = append(cv, col) 7878 7879 } 7880 *v = cv 7881 return nil 7882} 7883 7884func awsAwsjson11_deserializeDocumentAugmentedManifestsListItem(v **types.AugmentedManifestsListItem, value interface{}) error { 7885 if v == nil { 7886 return fmt.Errorf("unexpected nil of type %T", v) 7887 } 7888 if value == nil { 7889 return nil 7890 } 7891 7892 shape, ok := value.(map[string]interface{}) 7893 if !ok { 7894 return fmt.Errorf("unexpected JSON type %v", value) 7895 } 7896 7897 var sv *types.AugmentedManifestsListItem 7898 if *v == nil { 7899 sv = &types.AugmentedManifestsListItem{} 7900 } else { 7901 sv = *v 7902 } 7903 7904 for key, value := range shape { 7905 switch key { 7906 case "AttributeNames": 7907 if err := awsAwsjson11_deserializeDocumentAttributeNamesList(&sv.AttributeNames, value); err != nil { 7908 return err 7909 } 7910 7911 case "S3Uri": 7912 if value != nil { 7913 jtv, ok := value.(string) 7914 if !ok { 7915 return fmt.Errorf("expected S3Uri to be of type string, got %T instead", value) 7916 } 7917 sv.S3Uri = ptr.String(jtv) 7918 } 7919 7920 default: 7921 _, _ = key, value 7922 7923 } 7924 } 7925 *v = sv 7926 return nil 7927} 7928 7929func awsAwsjson11_deserializeDocumentBatchDetectDominantLanguageItemResult(v **types.BatchDetectDominantLanguageItemResult, value interface{}) error { 7930 if v == nil { 7931 return fmt.Errorf("unexpected nil of type %T", v) 7932 } 7933 if value == nil { 7934 return nil 7935 } 7936 7937 shape, ok := value.(map[string]interface{}) 7938 if !ok { 7939 return fmt.Errorf("unexpected JSON type %v", value) 7940 } 7941 7942 var sv *types.BatchDetectDominantLanguageItemResult 7943 if *v == nil { 7944 sv = &types.BatchDetectDominantLanguageItemResult{} 7945 } else { 7946 sv = *v 7947 } 7948 7949 for key, value := range shape { 7950 switch key { 7951 case "Index": 7952 if value != nil { 7953 jtv, ok := value.(json.Number) 7954 if !ok { 7955 return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) 7956 } 7957 i64, err := jtv.Int64() 7958 if err != nil { 7959 return err 7960 } 7961 sv.Index = ptr.Int32(int32(i64)) 7962 } 7963 7964 case "Languages": 7965 if err := awsAwsjson11_deserializeDocumentListOfDominantLanguages(&sv.Languages, value); err != nil { 7966 return err 7967 } 7968 7969 default: 7970 _, _ = key, value 7971 7972 } 7973 } 7974 *v = sv 7975 return nil 7976} 7977 7978func awsAwsjson11_deserializeDocumentBatchDetectEntitiesItemResult(v **types.BatchDetectEntitiesItemResult, value interface{}) error { 7979 if v == nil { 7980 return fmt.Errorf("unexpected nil of type %T", v) 7981 } 7982 if value == nil { 7983 return nil 7984 } 7985 7986 shape, ok := value.(map[string]interface{}) 7987 if !ok { 7988 return fmt.Errorf("unexpected JSON type %v", value) 7989 } 7990 7991 var sv *types.BatchDetectEntitiesItemResult 7992 if *v == nil { 7993 sv = &types.BatchDetectEntitiesItemResult{} 7994 } else { 7995 sv = *v 7996 } 7997 7998 for key, value := range shape { 7999 switch key { 8000 case "Entities": 8001 if err := awsAwsjson11_deserializeDocumentListOfEntities(&sv.Entities, value); err != nil { 8002 return err 8003 } 8004 8005 case "Index": 8006 if value != nil { 8007 jtv, ok := value.(json.Number) 8008 if !ok { 8009 return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) 8010 } 8011 i64, err := jtv.Int64() 8012 if err != nil { 8013 return err 8014 } 8015 sv.Index = ptr.Int32(int32(i64)) 8016 } 8017 8018 default: 8019 _, _ = key, value 8020 8021 } 8022 } 8023 *v = sv 8024 return nil 8025} 8026 8027func awsAwsjson11_deserializeDocumentBatchDetectKeyPhrasesItemResult(v **types.BatchDetectKeyPhrasesItemResult, value interface{}) error { 8028 if v == nil { 8029 return fmt.Errorf("unexpected nil of type %T", v) 8030 } 8031 if value == nil { 8032 return nil 8033 } 8034 8035 shape, ok := value.(map[string]interface{}) 8036 if !ok { 8037 return fmt.Errorf("unexpected JSON type %v", value) 8038 } 8039 8040 var sv *types.BatchDetectKeyPhrasesItemResult 8041 if *v == nil { 8042 sv = &types.BatchDetectKeyPhrasesItemResult{} 8043 } else { 8044 sv = *v 8045 } 8046 8047 for key, value := range shape { 8048 switch key { 8049 case "Index": 8050 if value != nil { 8051 jtv, ok := value.(json.Number) 8052 if !ok { 8053 return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) 8054 } 8055 i64, err := jtv.Int64() 8056 if err != nil { 8057 return err 8058 } 8059 sv.Index = ptr.Int32(int32(i64)) 8060 } 8061 8062 case "KeyPhrases": 8063 if err := awsAwsjson11_deserializeDocumentListOfKeyPhrases(&sv.KeyPhrases, value); err != nil { 8064 return err 8065 } 8066 8067 default: 8068 _, _ = key, value 8069 8070 } 8071 } 8072 *v = sv 8073 return nil 8074} 8075 8076func awsAwsjson11_deserializeDocumentBatchDetectSentimentItemResult(v **types.BatchDetectSentimentItemResult, value interface{}) error { 8077 if v == nil { 8078 return fmt.Errorf("unexpected nil of type %T", v) 8079 } 8080 if value == nil { 8081 return nil 8082 } 8083 8084 shape, ok := value.(map[string]interface{}) 8085 if !ok { 8086 return fmt.Errorf("unexpected JSON type %v", value) 8087 } 8088 8089 var sv *types.BatchDetectSentimentItemResult 8090 if *v == nil { 8091 sv = &types.BatchDetectSentimentItemResult{} 8092 } else { 8093 sv = *v 8094 } 8095 8096 for key, value := range shape { 8097 switch key { 8098 case "Index": 8099 if value != nil { 8100 jtv, ok := value.(json.Number) 8101 if !ok { 8102 return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) 8103 } 8104 i64, err := jtv.Int64() 8105 if err != nil { 8106 return err 8107 } 8108 sv.Index = ptr.Int32(int32(i64)) 8109 } 8110 8111 case "Sentiment": 8112 if value != nil { 8113 jtv, ok := value.(string) 8114 if !ok { 8115 return fmt.Errorf("expected SentimentType to be of type string, got %T instead", value) 8116 } 8117 sv.Sentiment = types.SentimentType(jtv) 8118 } 8119 8120 case "SentimentScore": 8121 if err := awsAwsjson11_deserializeDocumentSentimentScore(&sv.SentimentScore, value); err != nil { 8122 return err 8123 } 8124 8125 default: 8126 _, _ = key, value 8127 8128 } 8129 } 8130 *v = sv 8131 return nil 8132} 8133 8134func awsAwsjson11_deserializeDocumentBatchDetectSyntaxItemResult(v **types.BatchDetectSyntaxItemResult, value interface{}) error { 8135 if v == nil { 8136 return fmt.Errorf("unexpected nil of type %T", v) 8137 } 8138 if value == nil { 8139 return nil 8140 } 8141 8142 shape, ok := value.(map[string]interface{}) 8143 if !ok { 8144 return fmt.Errorf("unexpected JSON type %v", value) 8145 } 8146 8147 var sv *types.BatchDetectSyntaxItemResult 8148 if *v == nil { 8149 sv = &types.BatchDetectSyntaxItemResult{} 8150 } else { 8151 sv = *v 8152 } 8153 8154 for key, value := range shape { 8155 switch key { 8156 case "Index": 8157 if value != nil { 8158 jtv, ok := value.(json.Number) 8159 if !ok { 8160 return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) 8161 } 8162 i64, err := jtv.Int64() 8163 if err != nil { 8164 return err 8165 } 8166 sv.Index = ptr.Int32(int32(i64)) 8167 } 8168 8169 case "SyntaxTokens": 8170 if err := awsAwsjson11_deserializeDocumentListOfSyntaxTokens(&sv.SyntaxTokens, value); err != nil { 8171 return err 8172 } 8173 8174 default: 8175 _, _ = key, value 8176 8177 } 8178 } 8179 *v = sv 8180 return nil 8181} 8182 8183func awsAwsjson11_deserializeDocumentBatchItemError(v **types.BatchItemError, value interface{}) error { 8184 if v == nil { 8185 return fmt.Errorf("unexpected nil of type %T", v) 8186 } 8187 if value == nil { 8188 return nil 8189 } 8190 8191 shape, ok := value.(map[string]interface{}) 8192 if !ok { 8193 return fmt.Errorf("unexpected JSON type %v", value) 8194 } 8195 8196 var sv *types.BatchItemError 8197 if *v == nil { 8198 sv = &types.BatchItemError{} 8199 } else { 8200 sv = *v 8201 } 8202 8203 for key, value := range shape { 8204 switch key { 8205 case "ErrorCode": 8206 if value != nil { 8207 jtv, ok := value.(string) 8208 if !ok { 8209 return fmt.Errorf("expected String to be of type string, got %T instead", value) 8210 } 8211 sv.ErrorCode = ptr.String(jtv) 8212 } 8213 8214 case "ErrorMessage": 8215 if value != nil { 8216 jtv, ok := value.(string) 8217 if !ok { 8218 return fmt.Errorf("expected String to be of type string, got %T instead", value) 8219 } 8220 sv.ErrorMessage = ptr.String(jtv) 8221 } 8222 8223 case "Index": 8224 if value != nil { 8225 jtv, ok := value.(json.Number) 8226 if !ok { 8227 return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) 8228 } 8229 i64, err := jtv.Int64() 8230 if err != nil { 8231 return err 8232 } 8233 sv.Index = ptr.Int32(int32(i64)) 8234 } 8235 8236 default: 8237 _, _ = key, value 8238 8239 } 8240 } 8241 *v = sv 8242 return nil 8243} 8244 8245func awsAwsjson11_deserializeDocumentBatchItemErrorList(v *[]types.BatchItemError, value interface{}) error { 8246 if v == nil { 8247 return fmt.Errorf("unexpected nil of type %T", v) 8248 } 8249 if value == nil { 8250 return nil 8251 } 8252 8253 shape, ok := value.([]interface{}) 8254 if !ok { 8255 return fmt.Errorf("unexpected JSON type %v", value) 8256 } 8257 8258 var cv []types.BatchItemError 8259 if *v == nil { 8260 cv = []types.BatchItemError{} 8261 } else { 8262 cv = *v 8263 } 8264 8265 for _, value := range shape { 8266 var col types.BatchItemError 8267 destAddr := &col 8268 if err := awsAwsjson11_deserializeDocumentBatchItemError(&destAddr, value); err != nil { 8269 return err 8270 } 8271 col = *destAddr 8272 cv = append(cv, col) 8273 8274 } 8275 *v = cv 8276 return nil 8277} 8278 8279func awsAwsjson11_deserializeDocumentBatchSizeLimitExceededException(v **types.BatchSizeLimitExceededException, value interface{}) error { 8280 if v == nil { 8281 return fmt.Errorf("unexpected nil of type %T", v) 8282 } 8283 if value == nil { 8284 return nil 8285 } 8286 8287 shape, ok := value.(map[string]interface{}) 8288 if !ok { 8289 return fmt.Errorf("unexpected JSON type %v", value) 8290 } 8291 8292 var sv *types.BatchSizeLimitExceededException 8293 if *v == nil { 8294 sv = &types.BatchSizeLimitExceededException{} 8295 } else { 8296 sv = *v 8297 } 8298 8299 for key, value := range shape { 8300 switch key { 8301 case "Message": 8302 if value != nil { 8303 jtv, ok := value.(string) 8304 if !ok { 8305 return fmt.Errorf("expected String to be of type string, got %T instead", value) 8306 } 8307 sv.Message = ptr.String(jtv) 8308 } 8309 8310 default: 8311 _, _ = key, value 8312 8313 } 8314 } 8315 *v = sv 8316 return nil 8317} 8318 8319func awsAwsjson11_deserializeDocumentClassifierEvaluationMetrics(v **types.ClassifierEvaluationMetrics, value interface{}) error { 8320 if v == nil { 8321 return fmt.Errorf("unexpected nil of type %T", v) 8322 } 8323 if value == nil { 8324 return nil 8325 } 8326 8327 shape, ok := value.(map[string]interface{}) 8328 if !ok { 8329 return fmt.Errorf("unexpected JSON type %v", value) 8330 } 8331 8332 var sv *types.ClassifierEvaluationMetrics 8333 if *v == nil { 8334 sv = &types.ClassifierEvaluationMetrics{} 8335 } else { 8336 sv = *v 8337 } 8338 8339 for key, value := range shape { 8340 switch key { 8341 case "Accuracy": 8342 if value != nil { 8343 jtv, ok := value.(json.Number) 8344 if !ok { 8345 return fmt.Errorf("expected Double to be json.Number, got %T instead", value) 8346 } 8347 f64, err := jtv.Float64() 8348 if err != nil { 8349 return err 8350 } 8351 sv.Accuracy = ptr.Float64(f64) 8352 } 8353 8354 case "F1Score": 8355 if value != nil { 8356 jtv, ok := value.(json.Number) 8357 if !ok { 8358 return fmt.Errorf("expected Double to be json.Number, got %T instead", value) 8359 } 8360 f64, err := jtv.Float64() 8361 if err != nil { 8362 return err 8363 } 8364 sv.F1Score = ptr.Float64(f64) 8365 } 8366 8367 case "HammingLoss": 8368 if value != nil { 8369 jtv, ok := value.(json.Number) 8370 if !ok { 8371 return fmt.Errorf("expected Double to be json.Number, got %T instead", value) 8372 } 8373 f64, err := jtv.Float64() 8374 if err != nil { 8375 return err 8376 } 8377 sv.HammingLoss = ptr.Float64(f64) 8378 } 8379 8380 case "MicroF1Score": 8381 if value != nil { 8382 jtv, ok := value.(json.Number) 8383 if !ok { 8384 return fmt.Errorf("expected Double to be json.Number, got %T instead", value) 8385 } 8386 f64, err := jtv.Float64() 8387 if err != nil { 8388 return err 8389 } 8390 sv.MicroF1Score = ptr.Float64(f64) 8391 } 8392 8393 case "MicroPrecision": 8394 if value != nil { 8395 jtv, ok := value.(json.Number) 8396 if !ok { 8397 return fmt.Errorf("expected Double to be json.Number, got %T instead", value) 8398 } 8399 f64, err := jtv.Float64() 8400 if err != nil { 8401 return err 8402 } 8403 sv.MicroPrecision = ptr.Float64(f64) 8404 } 8405 8406 case "MicroRecall": 8407 if value != nil { 8408 jtv, ok := value.(json.Number) 8409 if !ok { 8410 return fmt.Errorf("expected Double to be json.Number, got %T instead", value) 8411 } 8412 f64, err := jtv.Float64() 8413 if err != nil { 8414 return err 8415 } 8416 sv.MicroRecall = ptr.Float64(f64) 8417 } 8418 8419 case "Precision": 8420 if value != nil { 8421 jtv, ok := value.(json.Number) 8422 if !ok { 8423 return fmt.Errorf("expected Double to be json.Number, got %T instead", value) 8424 } 8425 f64, err := jtv.Float64() 8426 if err != nil { 8427 return err 8428 } 8429 sv.Precision = ptr.Float64(f64) 8430 } 8431 8432 case "Recall": 8433 if value != nil { 8434 jtv, ok := value.(json.Number) 8435 if !ok { 8436 return fmt.Errorf("expected Double to be json.Number, got %T instead", value) 8437 } 8438 f64, err := jtv.Float64() 8439 if err != nil { 8440 return err 8441 } 8442 sv.Recall = ptr.Float64(f64) 8443 } 8444 8445 default: 8446 _, _ = key, value 8447 8448 } 8449 } 8450 *v = sv 8451 return nil 8452} 8453 8454func awsAwsjson11_deserializeDocumentClassifierMetadata(v **types.ClassifierMetadata, value interface{}) error { 8455 if v == nil { 8456 return fmt.Errorf("unexpected nil of type %T", v) 8457 } 8458 if value == nil { 8459 return nil 8460 } 8461 8462 shape, ok := value.(map[string]interface{}) 8463 if !ok { 8464 return fmt.Errorf("unexpected JSON type %v", value) 8465 } 8466 8467 var sv *types.ClassifierMetadata 8468 if *v == nil { 8469 sv = &types.ClassifierMetadata{} 8470 } else { 8471 sv = *v 8472 } 8473 8474 for key, value := range shape { 8475 switch key { 8476 case "EvaluationMetrics": 8477 if err := awsAwsjson11_deserializeDocumentClassifierEvaluationMetrics(&sv.EvaluationMetrics, value); err != nil { 8478 return err 8479 } 8480 8481 case "NumberOfLabels": 8482 if value != nil { 8483 jtv, ok := value.(json.Number) 8484 if !ok { 8485 return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) 8486 } 8487 i64, err := jtv.Int64() 8488 if err != nil { 8489 return err 8490 } 8491 sv.NumberOfLabels = ptr.Int32(int32(i64)) 8492 } 8493 8494 case "NumberOfTestDocuments": 8495 if value != nil { 8496 jtv, ok := value.(json.Number) 8497 if !ok { 8498 return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) 8499 } 8500 i64, err := jtv.Int64() 8501 if err != nil { 8502 return err 8503 } 8504 sv.NumberOfTestDocuments = ptr.Int32(int32(i64)) 8505 } 8506 8507 case "NumberOfTrainedDocuments": 8508 if value != nil { 8509 jtv, ok := value.(json.Number) 8510 if !ok { 8511 return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) 8512 } 8513 i64, err := jtv.Int64() 8514 if err != nil { 8515 return err 8516 } 8517 sv.NumberOfTrainedDocuments = ptr.Int32(int32(i64)) 8518 } 8519 8520 default: 8521 _, _ = key, value 8522 8523 } 8524 } 8525 *v = sv 8526 return nil 8527} 8528 8529func awsAwsjson11_deserializeDocumentConcurrentModificationException(v **types.ConcurrentModificationException, value interface{}) error { 8530 if v == nil { 8531 return fmt.Errorf("unexpected nil of type %T", v) 8532 } 8533 if value == nil { 8534 return nil 8535 } 8536 8537 shape, ok := value.(map[string]interface{}) 8538 if !ok { 8539 return fmt.Errorf("unexpected JSON type %v", value) 8540 } 8541 8542 var sv *types.ConcurrentModificationException 8543 if *v == nil { 8544 sv = &types.ConcurrentModificationException{} 8545 } else { 8546 sv = *v 8547 } 8548 8549 for key, value := range shape { 8550 switch key { 8551 case "Message": 8552 if value != nil { 8553 jtv, ok := value.(string) 8554 if !ok { 8555 return fmt.Errorf("expected String to be of type string, got %T instead", value) 8556 } 8557 sv.Message = ptr.String(jtv) 8558 } 8559 8560 default: 8561 _, _ = key, value 8562 8563 } 8564 } 8565 *v = sv 8566 return nil 8567} 8568 8569func awsAwsjson11_deserializeDocumentDocumentClass(v **types.DocumentClass, value interface{}) error { 8570 if v == nil { 8571 return fmt.Errorf("unexpected nil of type %T", v) 8572 } 8573 if value == nil { 8574 return nil 8575 } 8576 8577 shape, ok := value.(map[string]interface{}) 8578 if !ok { 8579 return fmt.Errorf("unexpected JSON type %v", value) 8580 } 8581 8582 var sv *types.DocumentClass 8583 if *v == nil { 8584 sv = &types.DocumentClass{} 8585 } else { 8586 sv = *v 8587 } 8588 8589 for key, value := range shape { 8590 switch key { 8591 case "Name": 8592 if value != nil { 8593 jtv, ok := value.(string) 8594 if !ok { 8595 return fmt.Errorf("expected String to be of type string, got %T instead", value) 8596 } 8597 sv.Name = ptr.String(jtv) 8598 } 8599 8600 case "Score": 8601 if value != nil { 8602 jtv, ok := value.(json.Number) 8603 if !ok { 8604 return fmt.Errorf("expected Float to be json.Number, got %T instead", value) 8605 } 8606 f64, err := jtv.Float64() 8607 if err != nil { 8608 return err 8609 } 8610 sv.Score = ptr.Float32(float32(f64)) 8611 } 8612 8613 default: 8614 _, _ = key, value 8615 8616 } 8617 } 8618 *v = sv 8619 return nil 8620} 8621 8622func awsAwsjson11_deserializeDocumentDocumentClassificationJobProperties(v **types.DocumentClassificationJobProperties, value interface{}) error { 8623 if v == nil { 8624 return fmt.Errorf("unexpected nil of type %T", v) 8625 } 8626 if value == nil { 8627 return nil 8628 } 8629 8630 shape, ok := value.(map[string]interface{}) 8631 if !ok { 8632 return fmt.Errorf("unexpected JSON type %v", value) 8633 } 8634 8635 var sv *types.DocumentClassificationJobProperties 8636 if *v == nil { 8637 sv = &types.DocumentClassificationJobProperties{} 8638 } else { 8639 sv = *v 8640 } 8641 8642 for key, value := range shape { 8643 switch key { 8644 case "DataAccessRoleArn": 8645 if value != nil { 8646 jtv, ok := value.(string) 8647 if !ok { 8648 return fmt.Errorf("expected IamRoleArn to be of type string, got %T instead", value) 8649 } 8650 sv.DataAccessRoleArn = ptr.String(jtv) 8651 } 8652 8653 case "DocumentClassifierArn": 8654 if value != nil { 8655 jtv, ok := value.(string) 8656 if !ok { 8657 return fmt.Errorf("expected DocumentClassifierArn to be of type string, got %T instead", value) 8658 } 8659 sv.DocumentClassifierArn = ptr.String(jtv) 8660 } 8661 8662 case "EndTime": 8663 if value != nil { 8664 jtv, ok := value.(json.Number) 8665 if !ok { 8666 return fmt.Errorf("expected Timestamp to be json.Number, got %T instead", value) 8667 } 8668 f64, err := jtv.Float64() 8669 if err != nil { 8670 return err 8671 } 8672 sv.EndTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) 8673 } 8674 8675 case "InputDataConfig": 8676 if err := awsAwsjson11_deserializeDocumentInputDataConfig(&sv.InputDataConfig, value); err != nil { 8677 return err 8678 } 8679 8680 case "JobId": 8681 if value != nil { 8682 jtv, ok := value.(string) 8683 if !ok { 8684 return fmt.Errorf("expected JobId to be of type string, got %T instead", value) 8685 } 8686 sv.JobId = ptr.String(jtv) 8687 } 8688 8689 case "JobName": 8690 if value != nil { 8691 jtv, ok := value.(string) 8692 if !ok { 8693 return fmt.Errorf("expected JobName to be of type string, got %T instead", value) 8694 } 8695 sv.JobName = ptr.String(jtv) 8696 } 8697 8698 case "JobStatus": 8699 if value != nil { 8700 jtv, ok := value.(string) 8701 if !ok { 8702 return fmt.Errorf("expected JobStatus to be of type string, got %T instead", value) 8703 } 8704 sv.JobStatus = types.JobStatus(jtv) 8705 } 8706 8707 case "Message": 8708 if value != nil { 8709 jtv, ok := value.(string) 8710 if !ok { 8711 return fmt.Errorf("expected AnyLengthString to be of type string, got %T instead", value) 8712 } 8713 sv.Message = ptr.String(jtv) 8714 } 8715 8716 case "OutputDataConfig": 8717 if err := awsAwsjson11_deserializeDocumentOutputDataConfig(&sv.OutputDataConfig, value); err != nil { 8718 return err 8719 } 8720 8721 case "SubmitTime": 8722 if value != nil { 8723 jtv, ok := value.(json.Number) 8724 if !ok { 8725 return fmt.Errorf("expected Timestamp to be json.Number, got %T instead", value) 8726 } 8727 f64, err := jtv.Float64() 8728 if err != nil { 8729 return err 8730 } 8731 sv.SubmitTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) 8732 } 8733 8734 case "VolumeKmsKeyId": 8735 if value != nil { 8736 jtv, ok := value.(string) 8737 if !ok { 8738 return fmt.Errorf("expected KmsKeyId to be of type string, got %T instead", value) 8739 } 8740 sv.VolumeKmsKeyId = ptr.String(jtv) 8741 } 8742 8743 case "VpcConfig": 8744 if err := awsAwsjson11_deserializeDocumentVpcConfig(&sv.VpcConfig, value); err != nil { 8745 return err 8746 } 8747 8748 default: 8749 _, _ = key, value 8750 8751 } 8752 } 8753 *v = sv 8754 return nil 8755} 8756 8757func awsAwsjson11_deserializeDocumentDocumentClassificationJobPropertiesList(v *[]types.DocumentClassificationJobProperties, value interface{}) error { 8758 if v == nil { 8759 return fmt.Errorf("unexpected nil of type %T", v) 8760 } 8761 if value == nil { 8762 return nil 8763 } 8764 8765 shape, ok := value.([]interface{}) 8766 if !ok { 8767 return fmt.Errorf("unexpected JSON type %v", value) 8768 } 8769 8770 var cv []types.DocumentClassificationJobProperties 8771 if *v == nil { 8772 cv = []types.DocumentClassificationJobProperties{} 8773 } else { 8774 cv = *v 8775 } 8776 8777 for _, value := range shape { 8778 var col types.DocumentClassificationJobProperties 8779 destAddr := &col 8780 if err := awsAwsjson11_deserializeDocumentDocumentClassificationJobProperties(&destAddr, value); err != nil { 8781 return err 8782 } 8783 col = *destAddr 8784 cv = append(cv, col) 8785 8786 } 8787 *v = cv 8788 return nil 8789} 8790 8791func awsAwsjson11_deserializeDocumentDocumentClassifierAugmentedManifestsList(v *[]types.AugmentedManifestsListItem, value interface{}) error { 8792 if v == nil { 8793 return fmt.Errorf("unexpected nil of type %T", v) 8794 } 8795 if value == nil { 8796 return nil 8797 } 8798 8799 shape, ok := value.([]interface{}) 8800 if !ok { 8801 return fmt.Errorf("unexpected JSON type %v", value) 8802 } 8803 8804 var cv []types.AugmentedManifestsListItem 8805 if *v == nil { 8806 cv = []types.AugmentedManifestsListItem{} 8807 } else { 8808 cv = *v 8809 } 8810 8811 for _, value := range shape { 8812 var col types.AugmentedManifestsListItem 8813 destAddr := &col 8814 if err := awsAwsjson11_deserializeDocumentAugmentedManifestsListItem(&destAddr, value); err != nil { 8815 return err 8816 } 8817 col = *destAddr 8818 cv = append(cv, col) 8819 8820 } 8821 *v = cv 8822 return nil 8823} 8824 8825func awsAwsjson11_deserializeDocumentDocumentClassifierInputDataConfig(v **types.DocumentClassifierInputDataConfig, value interface{}) error { 8826 if v == nil { 8827 return fmt.Errorf("unexpected nil of type %T", v) 8828 } 8829 if value == nil { 8830 return nil 8831 } 8832 8833 shape, ok := value.(map[string]interface{}) 8834 if !ok { 8835 return fmt.Errorf("unexpected JSON type %v", value) 8836 } 8837 8838 var sv *types.DocumentClassifierInputDataConfig 8839 if *v == nil { 8840 sv = &types.DocumentClassifierInputDataConfig{} 8841 } else { 8842 sv = *v 8843 } 8844 8845 for key, value := range shape { 8846 switch key { 8847 case "AugmentedManifests": 8848 if err := awsAwsjson11_deserializeDocumentDocumentClassifierAugmentedManifestsList(&sv.AugmentedManifests, value); err != nil { 8849 return err 8850 } 8851 8852 case "DataFormat": 8853 if value != nil { 8854 jtv, ok := value.(string) 8855 if !ok { 8856 return fmt.Errorf("expected DocumentClassifierDataFormat to be of type string, got %T instead", value) 8857 } 8858 sv.DataFormat = types.DocumentClassifierDataFormat(jtv) 8859 } 8860 8861 case "LabelDelimiter": 8862 if value != nil { 8863 jtv, ok := value.(string) 8864 if !ok { 8865 return fmt.Errorf("expected LabelDelimiter to be of type string, got %T instead", value) 8866 } 8867 sv.LabelDelimiter = ptr.String(jtv) 8868 } 8869 8870 case "S3Uri": 8871 if value != nil { 8872 jtv, ok := value.(string) 8873 if !ok { 8874 return fmt.Errorf("expected S3Uri to be of type string, got %T instead", value) 8875 } 8876 sv.S3Uri = ptr.String(jtv) 8877 } 8878 8879 default: 8880 _, _ = key, value 8881 8882 } 8883 } 8884 *v = sv 8885 return nil 8886} 8887 8888func awsAwsjson11_deserializeDocumentDocumentClassifierOutputDataConfig(v **types.DocumentClassifierOutputDataConfig, value interface{}) error { 8889 if v == nil { 8890 return fmt.Errorf("unexpected nil of type %T", v) 8891 } 8892 if value == nil { 8893 return nil 8894 } 8895 8896 shape, ok := value.(map[string]interface{}) 8897 if !ok { 8898 return fmt.Errorf("unexpected JSON type %v", value) 8899 } 8900 8901 var sv *types.DocumentClassifierOutputDataConfig 8902 if *v == nil { 8903 sv = &types.DocumentClassifierOutputDataConfig{} 8904 } else { 8905 sv = *v 8906 } 8907 8908 for key, value := range shape { 8909 switch key { 8910 case "KmsKeyId": 8911 if value != nil { 8912 jtv, ok := value.(string) 8913 if !ok { 8914 return fmt.Errorf("expected KmsKeyId to be of type string, got %T instead", value) 8915 } 8916 sv.KmsKeyId = ptr.String(jtv) 8917 } 8918 8919 case "S3Uri": 8920 if value != nil { 8921 jtv, ok := value.(string) 8922 if !ok { 8923 return fmt.Errorf("expected S3Uri to be of type string, got %T instead", value) 8924 } 8925 sv.S3Uri = ptr.String(jtv) 8926 } 8927 8928 default: 8929 _, _ = key, value 8930 8931 } 8932 } 8933 *v = sv 8934 return nil 8935} 8936 8937func awsAwsjson11_deserializeDocumentDocumentClassifierProperties(v **types.DocumentClassifierProperties, value interface{}) error { 8938 if v == nil { 8939 return fmt.Errorf("unexpected nil of type %T", v) 8940 } 8941 if value == nil { 8942 return nil 8943 } 8944 8945 shape, ok := value.(map[string]interface{}) 8946 if !ok { 8947 return fmt.Errorf("unexpected JSON type %v", value) 8948 } 8949 8950 var sv *types.DocumentClassifierProperties 8951 if *v == nil { 8952 sv = &types.DocumentClassifierProperties{} 8953 } else { 8954 sv = *v 8955 } 8956 8957 for key, value := range shape { 8958 switch key { 8959 case "ClassifierMetadata": 8960 if err := awsAwsjson11_deserializeDocumentClassifierMetadata(&sv.ClassifierMetadata, value); err != nil { 8961 return err 8962 } 8963 8964 case "DataAccessRoleArn": 8965 if value != nil { 8966 jtv, ok := value.(string) 8967 if !ok { 8968 return fmt.Errorf("expected IamRoleArn to be of type string, got %T instead", value) 8969 } 8970 sv.DataAccessRoleArn = ptr.String(jtv) 8971 } 8972 8973 case "DocumentClassifierArn": 8974 if value != nil { 8975 jtv, ok := value.(string) 8976 if !ok { 8977 return fmt.Errorf("expected DocumentClassifierArn to be of type string, got %T instead", value) 8978 } 8979 sv.DocumentClassifierArn = ptr.String(jtv) 8980 } 8981 8982 case "EndTime": 8983 if value != nil { 8984 jtv, ok := value.(json.Number) 8985 if !ok { 8986 return fmt.Errorf("expected Timestamp to be json.Number, got %T instead", value) 8987 } 8988 f64, err := jtv.Float64() 8989 if err != nil { 8990 return err 8991 } 8992 sv.EndTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) 8993 } 8994 8995 case "InputDataConfig": 8996 if err := awsAwsjson11_deserializeDocumentDocumentClassifierInputDataConfig(&sv.InputDataConfig, value); err != nil { 8997 return err 8998 } 8999 9000 case "LanguageCode": 9001 if value != nil { 9002 jtv, ok := value.(string) 9003 if !ok { 9004 return fmt.Errorf("expected LanguageCode to be of type string, got %T instead", value) 9005 } 9006 sv.LanguageCode = types.LanguageCode(jtv) 9007 } 9008 9009 case "Message": 9010 if value != nil { 9011 jtv, ok := value.(string) 9012 if !ok { 9013 return fmt.Errorf("expected AnyLengthString to be of type string, got %T instead", value) 9014 } 9015 sv.Message = ptr.String(jtv) 9016 } 9017 9018 case "Mode": 9019 if value != nil { 9020 jtv, ok := value.(string) 9021 if !ok { 9022 return fmt.Errorf("expected DocumentClassifierMode to be of type string, got %T instead", value) 9023 } 9024 sv.Mode = types.DocumentClassifierMode(jtv) 9025 } 9026 9027 case "OutputDataConfig": 9028 if err := awsAwsjson11_deserializeDocumentDocumentClassifierOutputDataConfig(&sv.OutputDataConfig, value); err != nil { 9029 return err 9030 } 9031 9032 case "Status": 9033 if value != nil { 9034 jtv, ok := value.(string) 9035 if !ok { 9036 return fmt.Errorf("expected ModelStatus to be of type string, got %T instead", value) 9037 } 9038 sv.Status = types.ModelStatus(jtv) 9039 } 9040 9041 case "SubmitTime": 9042 if value != nil { 9043 jtv, ok := value.(json.Number) 9044 if !ok { 9045 return fmt.Errorf("expected Timestamp to be json.Number, got %T instead", value) 9046 } 9047 f64, err := jtv.Float64() 9048 if err != nil { 9049 return err 9050 } 9051 sv.SubmitTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) 9052 } 9053 9054 case "TrainingEndTime": 9055 if value != nil { 9056 jtv, ok := value.(json.Number) 9057 if !ok { 9058 return fmt.Errorf("expected Timestamp to be json.Number, got %T instead", value) 9059 } 9060 f64, err := jtv.Float64() 9061 if err != nil { 9062 return err 9063 } 9064 sv.TrainingEndTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) 9065 } 9066 9067 case "TrainingStartTime": 9068 if value != nil { 9069 jtv, ok := value.(json.Number) 9070 if !ok { 9071 return fmt.Errorf("expected Timestamp to be json.Number, got %T instead", value) 9072 } 9073 f64, err := jtv.Float64() 9074 if err != nil { 9075 return err 9076 } 9077 sv.TrainingStartTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) 9078 } 9079 9080 case "VolumeKmsKeyId": 9081 if value != nil { 9082 jtv, ok := value.(string) 9083 if !ok { 9084 return fmt.Errorf("expected KmsKeyId to be of type string, got %T instead", value) 9085 } 9086 sv.VolumeKmsKeyId = ptr.String(jtv) 9087 } 9088 9089 case "VpcConfig": 9090 if err := awsAwsjson11_deserializeDocumentVpcConfig(&sv.VpcConfig, value); err != nil { 9091 return err 9092 } 9093 9094 default: 9095 _, _ = key, value 9096 9097 } 9098 } 9099 *v = sv 9100 return nil 9101} 9102 9103func awsAwsjson11_deserializeDocumentDocumentClassifierPropertiesList(v *[]types.DocumentClassifierProperties, value interface{}) error { 9104 if v == nil { 9105 return fmt.Errorf("unexpected nil of type %T", v) 9106 } 9107 if value == nil { 9108 return nil 9109 } 9110 9111 shape, ok := value.([]interface{}) 9112 if !ok { 9113 return fmt.Errorf("unexpected JSON type %v", value) 9114 } 9115 9116 var cv []types.DocumentClassifierProperties 9117 if *v == nil { 9118 cv = []types.DocumentClassifierProperties{} 9119 } else { 9120 cv = *v 9121 } 9122 9123 for _, value := range shape { 9124 var col types.DocumentClassifierProperties 9125 destAddr := &col 9126 if err := awsAwsjson11_deserializeDocumentDocumentClassifierProperties(&destAddr, value); err != nil { 9127 return err 9128 } 9129 col = *destAddr 9130 cv = append(cv, col) 9131 9132 } 9133 *v = cv 9134 return nil 9135} 9136 9137func awsAwsjson11_deserializeDocumentDocumentLabel(v **types.DocumentLabel, value interface{}) error { 9138 if v == nil { 9139 return fmt.Errorf("unexpected nil of type %T", v) 9140 } 9141 if value == nil { 9142 return nil 9143 } 9144 9145 shape, ok := value.(map[string]interface{}) 9146 if !ok { 9147 return fmt.Errorf("unexpected JSON type %v", value) 9148 } 9149 9150 var sv *types.DocumentLabel 9151 if *v == nil { 9152 sv = &types.DocumentLabel{} 9153 } else { 9154 sv = *v 9155 } 9156 9157 for key, value := range shape { 9158 switch key { 9159 case "Name": 9160 if value != nil { 9161 jtv, ok := value.(string) 9162 if !ok { 9163 return fmt.Errorf("expected String to be of type string, got %T instead", value) 9164 } 9165 sv.Name = ptr.String(jtv) 9166 } 9167 9168 case "Score": 9169 if value != nil { 9170 jtv, ok := value.(json.Number) 9171 if !ok { 9172 return fmt.Errorf("expected Float to be json.Number, got %T instead", value) 9173 } 9174 f64, err := jtv.Float64() 9175 if err != nil { 9176 return err 9177 } 9178 sv.Score = ptr.Float32(float32(f64)) 9179 } 9180 9181 default: 9182 _, _ = key, value 9183 9184 } 9185 } 9186 *v = sv 9187 return nil 9188} 9189 9190func awsAwsjson11_deserializeDocumentDominantLanguage(v **types.DominantLanguage, value interface{}) error { 9191 if v == nil { 9192 return fmt.Errorf("unexpected nil of type %T", v) 9193 } 9194 if value == nil { 9195 return nil 9196 } 9197 9198 shape, ok := value.(map[string]interface{}) 9199 if !ok { 9200 return fmt.Errorf("unexpected JSON type %v", value) 9201 } 9202 9203 var sv *types.DominantLanguage 9204 if *v == nil { 9205 sv = &types.DominantLanguage{} 9206 } else { 9207 sv = *v 9208 } 9209 9210 for key, value := range shape { 9211 switch key { 9212 case "LanguageCode": 9213 if value != nil { 9214 jtv, ok := value.(string) 9215 if !ok { 9216 return fmt.Errorf("expected String to be of type string, got %T instead", value) 9217 } 9218 sv.LanguageCode = ptr.String(jtv) 9219 } 9220 9221 case "Score": 9222 if value != nil { 9223 jtv, ok := value.(json.Number) 9224 if !ok { 9225 return fmt.Errorf("expected Float to be json.Number, got %T instead", value) 9226 } 9227 f64, err := jtv.Float64() 9228 if err != nil { 9229 return err 9230 } 9231 sv.Score = ptr.Float32(float32(f64)) 9232 } 9233 9234 default: 9235 _, _ = key, value 9236 9237 } 9238 } 9239 *v = sv 9240 return nil 9241} 9242 9243func awsAwsjson11_deserializeDocumentDominantLanguageDetectionJobProperties(v **types.DominantLanguageDetectionJobProperties, value interface{}) error { 9244 if v == nil { 9245 return fmt.Errorf("unexpected nil of type %T", v) 9246 } 9247 if value == nil { 9248 return nil 9249 } 9250 9251 shape, ok := value.(map[string]interface{}) 9252 if !ok { 9253 return fmt.Errorf("unexpected JSON type %v", value) 9254 } 9255 9256 var sv *types.DominantLanguageDetectionJobProperties 9257 if *v == nil { 9258 sv = &types.DominantLanguageDetectionJobProperties{} 9259 } else { 9260 sv = *v 9261 } 9262 9263 for key, value := range shape { 9264 switch key { 9265 case "DataAccessRoleArn": 9266 if value != nil { 9267 jtv, ok := value.(string) 9268 if !ok { 9269 return fmt.Errorf("expected IamRoleArn to be of type string, got %T instead", value) 9270 } 9271 sv.DataAccessRoleArn = ptr.String(jtv) 9272 } 9273 9274 case "EndTime": 9275 if value != nil { 9276 jtv, ok := value.(json.Number) 9277 if !ok { 9278 return fmt.Errorf("expected Timestamp to be json.Number, got %T instead", value) 9279 } 9280 f64, err := jtv.Float64() 9281 if err != nil { 9282 return err 9283 } 9284 sv.EndTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) 9285 } 9286 9287 case "InputDataConfig": 9288 if err := awsAwsjson11_deserializeDocumentInputDataConfig(&sv.InputDataConfig, value); err != nil { 9289 return err 9290 } 9291 9292 case "JobId": 9293 if value != nil { 9294 jtv, ok := value.(string) 9295 if !ok { 9296 return fmt.Errorf("expected JobId to be of type string, got %T instead", value) 9297 } 9298 sv.JobId = ptr.String(jtv) 9299 } 9300 9301 case "JobName": 9302 if value != nil { 9303 jtv, ok := value.(string) 9304 if !ok { 9305 return fmt.Errorf("expected JobName to be of type string, got %T instead", value) 9306 } 9307 sv.JobName = ptr.String(jtv) 9308 } 9309 9310 case "JobStatus": 9311 if value != nil { 9312 jtv, ok := value.(string) 9313 if !ok { 9314 return fmt.Errorf("expected JobStatus to be of type string, got %T instead", value) 9315 } 9316 sv.JobStatus = types.JobStatus(jtv) 9317 } 9318 9319 case "Message": 9320 if value != nil { 9321 jtv, ok := value.(string) 9322 if !ok { 9323 return fmt.Errorf("expected AnyLengthString to be of type string, got %T instead", value) 9324 } 9325 sv.Message = ptr.String(jtv) 9326 } 9327 9328 case "OutputDataConfig": 9329 if err := awsAwsjson11_deserializeDocumentOutputDataConfig(&sv.OutputDataConfig, value); err != nil { 9330 return err 9331 } 9332 9333 case "SubmitTime": 9334 if value != nil { 9335 jtv, ok := value.(json.Number) 9336 if !ok { 9337 return fmt.Errorf("expected Timestamp to be json.Number, got %T instead", value) 9338 } 9339 f64, err := jtv.Float64() 9340 if err != nil { 9341 return err 9342 } 9343 sv.SubmitTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) 9344 } 9345 9346 case "VolumeKmsKeyId": 9347 if value != nil { 9348 jtv, ok := value.(string) 9349 if !ok { 9350 return fmt.Errorf("expected KmsKeyId to be of type string, got %T instead", value) 9351 } 9352 sv.VolumeKmsKeyId = ptr.String(jtv) 9353 } 9354 9355 case "VpcConfig": 9356 if err := awsAwsjson11_deserializeDocumentVpcConfig(&sv.VpcConfig, value); err != nil { 9357 return err 9358 } 9359 9360 default: 9361 _, _ = key, value 9362 9363 } 9364 } 9365 *v = sv 9366 return nil 9367} 9368 9369func awsAwsjson11_deserializeDocumentDominantLanguageDetectionJobPropertiesList(v *[]types.DominantLanguageDetectionJobProperties, value interface{}) error { 9370 if v == nil { 9371 return fmt.Errorf("unexpected nil of type %T", v) 9372 } 9373 if value == nil { 9374 return nil 9375 } 9376 9377 shape, ok := value.([]interface{}) 9378 if !ok { 9379 return fmt.Errorf("unexpected JSON type %v", value) 9380 } 9381 9382 var cv []types.DominantLanguageDetectionJobProperties 9383 if *v == nil { 9384 cv = []types.DominantLanguageDetectionJobProperties{} 9385 } else { 9386 cv = *v 9387 } 9388 9389 for _, value := range shape { 9390 var col types.DominantLanguageDetectionJobProperties 9391 destAddr := &col 9392 if err := awsAwsjson11_deserializeDocumentDominantLanguageDetectionJobProperties(&destAddr, value); err != nil { 9393 return err 9394 } 9395 col = *destAddr 9396 cv = append(cv, col) 9397 9398 } 9399 *v = cv 9400 return nil 9401} 9402 9403func awsAwsjson11_deserializeDocumentEndpointProperties(v **types.EndpointProperties, value interface{}) error { 9404 if v == nil { 9405 return fmt.Errorf("unexpected nil of type %T", v) 9406 } 9407 if value == nil { 9408 return nil 9409 } 9410 9411 shape, ok := value.(map[string]interface{}) 9412 if !ok { 9413 return fmt.Errorf("unexpected JSON type %v", value) 9414 } 9415 9416 var sv *types.EndpointProperties 9417 if *v == nil { 9418 sv = &types.EndpointProperties{} 9419 } else { 9420 sv = *v 9421 } 9422 9423 for key, value := range shape { 9424 switch key { 9425 case "CreationTime": 9426 if value != nil { 9427 jtv, ok := value.(json.Number) 9428 if !ok { 9429 return fmt.Errorf("expected Timestamp to be json.Number, got %T instead", value) 9430 } 9431 f64, err := jtv.Float64() 9432 if err != nil { 9433 return err 9434 } 9435 sv.CreationTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) 9436 } 9437 9438 case "CurrentInferenceUnits": 9439 if value != nil { 9440 jtv, ok := value.(json.Number) 9441 if !ok { 9442 return fmt.Errorf("expected InferenceUnitsInteger to be json.Number, got %T instead", value) 9443 } 9444 i64, err := jtv.Int64() 9445 if err != nil { 9446 return err 9447 } 9448 sv.CurrentInferenceUnits = ptr.Int32(int32(i64)) 9449 } 9450 9451 case "DesiredInferenceUnits": 9452 if value != nil { 9453 jtv, ok := value.(json.Number) 9454 if !ok { 9455 return fmt.Errorf("expected InferenceUnitsInteger to be json.Number, got %T instead", value) 9456 } 9457 i64, err := jtv.Int64() 9458 if err != nil { 9459 return err 9460 } 9461 sv.DesiredInferenceUnits = ptr.Int32(int32(i64)) 9462 } 9463 9464 case "EndpointArn": 9465 if value != nil { 9466 jtv, ok := value.(string) 9467 if !ok { 9468 return fmt.Errorf("expected ComprehendEndpointArn to be of type string, got %T instead", value) 9469 } 9470 sv.EndpointArn = ptr.String(jtv) 9471 } 9472 9473 case "LastModifiedTime": 9474 if value != nil { 9475 jtv, ok := value.(json.Number) 9476 if !ok { 9477 return fmt.Errorf("expected Timestamp to be json.Number, got %T instead", value) 9478 } 9479 f64, err := jtv.Float64() 9480 if err != nil { 9481 return err 9482 } 9483 sv.LastModifiedTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) 9484 } 9485 9486 case "Message": 9487 if value != nil { 9488 jtv, ok := value.(string) 9489 if !ok { 9490 return fmt.Errorf("expected AnyLengthString to be of type string, got %T instead", value) 9491 } 9492 sv.Message = ptr.String(jtv) 9493 } 9494 9495 case "ModelArn": 9496 if value != nil { 9497 jtv, ok := value.(string) 9498 if !ok { 9499 return fmt.Errorf("expected ComprehendModelArn to be of type string, got %T instead", value) 9500 } 9501 sv.ModelArn = ptr.String(jtv) 9502 } 9503 9504 case "Status": 9505 if value != nil { 9506 jtv, ok := value.(string) 9507 if !ok { 9508 return fmt.Errorf("expected EndpointStatus to be of type string, got %T instead", value) 9509 } 9510 sv.Status = types.EndpointStatus(jtv) 9511 } 9512 9513 default: 9514 _, _ = key, value 9515 9516 } 9517 } 9518 *v = sv 9519 return nil 9520} 9521 9522func awsAwsjson11_deserializeDocumentEndpointPropertiesList(v *[]types.EndpointProperties, value interface{}) error { 9523 if v == nil { 9524 return fmt.Errorf("unexpected nil of type %T", v) 9525 } 9526 if value == nil { 9527 return nil 9528 } 9529 9530 shape, ok := value.([]interface{}) 9531 if !ok { 9532 return fmt.Errorf("unexpected JSON type %v", value) 9533 } 9534 9535 var cv []types.EndpointProperties 9536 if *v == nil { 9537 cv = []types.EndpointProperties{} 9538 } else { 9539 cv = *v 9540 } 9541 9542 for _, value := range shape { 9543 var col types.EndpointProperties 9544 destAddr := &col 9545 if err := awsAwsjson11_deserializeDocumentEndpointProperties(&destAddr, value); err != nil { 9546 return err 9547 } 9548 col = *destAddr 9549 cv = append(cv, col) 9550 9551 } 9552 *v = cv 9553 return nil 9554} 9555 9556func awsAwsjson11_deserializeDocumentEntitiesDetectionJobProperties(v **types.EntitiesDetectionJobProperties, value interface{}) error { 9557 if v == nil { 9558 return fmt.Errorf("unexpected nil of type %T", v) 9559 } 9560 if value == nil { 9561 return nil 9562 } 9563 9564 shape, ok := value.(map[string]interface{}) 9565 if !ok { 9566 return fmt.Errorf("unexpected JSON type %v", value) 9567 } 9568 9569 var sv *types.EntitiesDetectionJobProperties 9570 if *v == nil { 9571 sv = &types.EntitiesDetectionJobProperties{} 9572 } else { 9573 sv = *v 9574 } 9575 9576 for key, value := range shape { 9577 switch key { 9578 case "DataAccessRoleArn": 9579 if value != nil { 9580 jtv, ok := value.(string) 9581 if !ok { 9582 return fmt.Errorf("expected IamRoleArn to be of type string, got %T instead", value) 9583 } 9584 sv.DataAccessRoleArn = ptr.String(jtv) 9585 } 9586 9587 case "EndTime": 9588 if value != nil { 9589 jtv, ok := value.(json.Number) 9590 if !ok { 9591 return fmt.Errorf("expected Timestamp to be json.Number, got %T instead", value) 9592 } 9593 f64, err := jtv.Float64() 9594 if err != nil { 9595 return err 9596 } 9597 sv.EndTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) 9598 } 9599 9600 case "EntityRecognizerArn": 9601 if value != nil { 9602 jtv, ok := value.(string) 9603 if !ok { 9604 return fmt.Errorf("expected EntityRecognizerArn to be of type string, got %T instead", value) 9605 } 9606 sv.EntityRecognizerArn = ptr.String(jtv) 9607 } 9608 9609 case "InputDataConfig": 9610 if err := awsAwsjson11_deserializeDocumentInputDataConfig(&sv.InputDataConfig, value); err != nil { 9611 return err 9612 } 9613 9614 case "JobId": 9615 if value != nil { 9616 jtv, ok := value.(string) 9617 if !ok { 9618 return fmt.Errorf("expected JobId to be of type string, got %T instead", value) 9619 } 9620 sv.JobId = ptr.String(jtv) 9621 } 9622 9623 case "JobName": 9624 if value != nil { 9625 jtv, ok := value.(string) 9626 if !ok { 9627 return fmt.Errorf("expected JobName to be of type string, got %T instead", value) 9628 } 9629 sv.JobName = ptr.String(jtv) 9630 } 9631 9632 case "JobStatus": 9633 if value != nil { 9634 jtv, ok := value.(string) 9635 if !ok { 9636 return fmt.Errorf("expected JobStatus to be of type string, got %T instead", value) 9637 } 9638 sv.JobStatus = types.JobStatus(jtv) 9639 } 9640 9641 case "LanguageCode": 9642 if value != nil { 9643 jtv, ok := value.(string) 9644 if !ok { 9645 return fmt.Errorf("expected LanguageCode to be of type string, got %T instead", value) 9646 } 9647 sv.LanguageCode = types.LanguageCode(jtv) 9648 } 9649 9650 case "Message": 9651 if value != nil { 9652 jtv, ok := value.(string) 9653 if !ok { 9654 return fmt.Errorf("expected AnyLengthString to be of type string, got %T instead", value) 9655 } 9656 sv.Message = ptr.String(jtv) 9657 } 9658 9659 case "OutputDataConfig": 9660 if err := awsAwsjson11_deserializeDocumentOutputDataConfig(&sv.OutputDataConfig, value); err != nil { 9661 return err 9662 } 9663 9664 case "SubmitTime": 9665 if value != nil { 9666 jtv, ok := value.(json.Number) 9667 if !ok { 9668 return fmt.Errorf("expected Timestamp to be json.Number, got %T instead", value) 9669 } 9670 f64, err := jtv.Float64() 9671 if err != nil { 9672 return err 9673 } 9674 sv.SubmitTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) 9675 } 9676 9677 case "VolumeKmsKeyId": 9678 if value != nil { 9679 jtv, ok := value.(string) 9680 if !ok { 9681 return fmt.Errorf("expected KmsKeyId to be of type string, got %T instead", value) 9682 } 9683 sv.VolumeKmsKeyId = ptr.String(jtv) 9684 } 9685 9686 case "VpcConfig": 9687 if err := awsAwsjson11_deserializeDocumentVpcConfig(&sv.VpcConfig, value); err != nil { 9688 return err 9689 } 9690 9691 default: 9692 _, _ = key, value 9693 9694 } 9695 } 9696 *v = sv 9697 return nil 9698} 9699 9700func awsAwsjson11_deserializeDocumentEntitiesDetectionJobPropertiesList(v *[]types.EntitiesDetectionJobProperties, value interface{}) error { 9701 if v == nil { 9702 return fmt.Errorf("unexpected nil of type %T", v) 9703 } 9704 if value == nil { 9705 return nil 9706 } 9707 9708 shape, ok := value.([]interface{}) 9709 if !ok { 9710 return fmt.Errorf("unexpected JSON type %v", value) 9711 } 9712 9713 var cv []types.EntitiesDetectionJobProperties 9714 if *v == nil { 9715 cv = []types.EntitiesDetectionJobProperties{} 9716 } else { 9717 cv = *v 9718 } 9719 9720 for _, value := range shape { 9721 var col types.EntitiesDetectionJobProperties 9722 destAddr := &col 9723 if err := awsAwsjson11_deserializeDocumentEntitiesDetectionJobProperties(&destAddr, value); err != nil { 9724 return err 9725 } 9726 col = *destAddr 9727 cv = append(cv, col) 9728 9729 } 9730 *v = cv 9731 return nil 9732} 9733 9734func awsAwsjson11_deserializeDocumentEntity(v **types.Entity, value interface{}) error { 9735 if v == nil { 9736 return fmt.Errorf("unexpected nil of type %T", v) 9737 } 9738 if value == nil { 9739 return nil 9740 } 9741 9742 shape, ok := value.(map[string]interface{}) 9743 if !ok { 9744 return fmt.Errorf("unexpected JSON type %v", value) 9745 } 9746 9747 var sv *types.Entity 9748 if *v == nil { 9749 sv = &types.Entity{} 9750 } else { 9751 sv = *v 9752 } 9753 9754 for key, value := range shape { 9755 switch key { 9756 case "BeginOffset": 9757 if value != nil { 9758 jtv, ok := value.(json.Number) 9759 if !ok { 9760 return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) 9761 } 9762 i64, err := jtv.Int64() 9763 if err != nil { 9764 return err 9765 } 9766 sv.BeginOffset = ptr.Int32(int32(i64)) 9767 } 9768 9769 case "EndOffset": 9770 if value != nil { 9771 jtv, ok := value.(json.Number) 9772 if !ok { 9773 return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) 9774 } 9775 i64, err := jtv.Int64() 9776 if err != nil { 9777 return err 9778 } 9779 sv.EndOffset = ptr.Int32(int32(i64)) 9780 } 9781 9782 case "Score": 9783 if value != nil { 9784 jtv, ok := value.(json.Number) 9785 if !ok { 9786 return fmt.Errorf("expected Float to be json.Number, got %T instead", value) 9787 } 9788 f64, err := jtv.Float64() 9789 if err != nil { 9790 return err 9791 } 9792 sv.Score = ptr.Float32(float32(f64)) 9793 } 9794 9795 case "Text": 9796 if value != nil { 9797 jtv, ok := value.(string) 9798 if !ok { 9799 return fmt.Errorf("expected String to be of type string, got %T instead", value) 9800 } 9801 sv.Text = ptr.String(jtv) 9802 } 9803 9804 case "Type": 9805 if value != nil { 9806 jtv, ok := value.(string) 9807 if !ok { 9808 return fmt.Errorf("expected EntityType to be of type string, got %T instead", value) 9809 } 9810 sv.Type = types.EntityType(jtv) 9811 } 9812 9813 default: 9814 _, _ = key, value 9815 9816 } 9817 } 9818 *v = sv 9819 return nil 9820} 9821 9822func awsAwsjson11_deserializeDocumentEntityRecognizerAnnotations(v **types.EntityRecognizerAnnotations, value interface{}) error { 9823 if v == nil { 9824 return fmt.Errorf("unexpected nil of type %T", v) 9825 } 9826 if value == nil { 9827 return nil 9828 } 9829 9830 shape, ok := value.(map[string]interface{}) 9831 if !ok { 9832 return fmt.Errorf("unexpected JSON type %v", value) 9833 } 9834 9835 var sv *types.EntityRecognizerAnnotations 9836 if *v == nil { 9837 sv = &types.EntityRecognizerAnnotations{} 9838 } else { 9839 sv = *v 9840 } 9841 9842 for key, value := range shape { 9843 switch key { 9844 case "S3Uri": 9845 if value != nil { 9846 jtv, ok := value.(string) 9847 if !ok { 9848 return fmt.Errorf("expected S3Uri to be of type string, got %T instead", value) 9849 } 9850 sv.S3Uri = ptr.String(jtv) 9851 } 9852 9853 default: 9854 _, _ = key, value 9855 9856 } 9857 } 9858 *v = sv 9859 return nil 9860} 9861 9862func awsAwsjson11_deserializeDocumentEntityRecognizerAugmentedManifestsList(v *[]types.AugmentedManifestsListItem, value interface{}) error { 9863 if v == nil { 9864 return fmt.Errorf("unexpected nil of type %T", v) 9865 } 9866 if value == nil { 9867 return nil 9868 } 9869 9870 shape, ok := value.([]interface{}) 9871 if !ok { 9872 return fmt.Errorf("unexpected JSON type %v", value) 9873 } 9874 9875 var cv []types.AugmentedManifestsListItem 9876 if *v == nil { 9877 cv = []types.AugmentedManifestsListItem{} 9878 } else { 9879 cv = *v 9880 } 9881 9882 for _, value := range shape { 9883 var col types.AugmentedManifestsListItem 9884 destAddr := &col 9885 if err := awsAwsjson11_deserializeDocumentAugmentedManifestsListItem(&destAddr, value); err != nil { 9886 return err 9887 } 9888 col = *destAddr 9889 cv = append(cv, col) 9890 9891 } 9892 *v = cv 9893 return nil 9894} 9895 9896func awsAwsjson11_deserializeDocumentEntityRecognizerDocuments(v **types.EntityRecognizerDocuments, value interface{}) error { 9897 if v == nil { 9898 return fmt.Errorf("unexpected nil of type %T", v) 9899 } 9900 if value == nil { 9901 return nil 9902 } 9903 9904 shape, ok := value.(map[string]interface{}) 9905 if !ok { 9906 return fmt.Errorf("unexpected JSON type %v", value) 9907 } 9908 9909 var sv *types.EntityRecognizerDocuments 9910 if *v == nil { 9911 sv = &types.EntityRecognizerDocuments{} 9912 } else { 9913 sv = *v 9914 } 9915 9916 for key, value := range shape { 9917 switch key { 9918 case "S3Uri": 9919 if value != nil { 9920 jtv, ok := value.(string) 9921 if !ok { 9922 return fmt.Errorf("expected S3Uri to be of type string, got %T instead", value) 9923 } 9924 sv.S3Uri = ptr.String(jtv) 9925 } 9926 9927 default: 9928 _, _ = key, value 9929 9930 } 9931 } 9932 *v = sv 9933 return nil 9934} 9935 9936func awsAwsjson11_deserializeDocumentEntityRecognizerEntityList(v **types.EntityRecognizerEntityList, value interface{}) error { 9937 if v == nil { 9938 return fmt.Errorf("unexpected nil of type %T", v) 9939 } 9940 if value == nil { 9941 return nil 9942 } 9943 9944 shape, ok := value.(map[string]interface{}) 9945 if !ok { 9946 return fmt.Errorf("unexpected JSON type %v", value) 9947 } 9948 9949 var sv *types.EntityRecognizerEntityList 9950 if *v == nil { 9951 sv = &types.EntityRecognizerEntityList{} 9952 } else { 9953 sv = *v 9954 } 9955 9956 for key, value := range shape { 9957 switch key { 9958 case "S3Uri": 9959 if value != nil { 9960 jtv, ok := value.(string) 9961 if !ok { 9962 return fmt.Errorf("expected S3Uri to be of type string, got %T instead", value) 9963 } 9964 sv.S3Uri = ptr.String(jtv) 9965 } 9966 9967 default: 9968 _, _ = key, value 9969 9970 } 9971 } 9972 *v = sv 9973 return nil 9974} 9975 9976func awsAwsjson11_deserializeDocumentEntityRecognizerEvaluationMetrics(v **types.EntityRecognizerEvaluationMetrics, value interface{}) error { 9977 if v == nil { 9978 return fmt.Errorf("unexpected nil of type %T", v) 9979 } 9980 if value == nil { 9981 return nil 9982 } 9983 9984 shape, ok := value.(map[string]interface{}) 9985 if !ok { 9986 return fmt.Errorf("unexpected JSON type %v", value) 9987 } 9988 9989 var sv *types.EntityRecognizerEvaluationMetrics 9990 if *v == nil { 9991 sv = &types.EntityRecognizerEvaluationMetrics{} 9992 } else { 9993 sv = *v 9994 } 9995 9996 for key, value := range shape { 9997 switch key { 9998 case "F1Score": 9999 if value != nil { 10000 jtv, ok := value.(json.Number) 10001 if !ok { 10002 return fmt.Errorf("expected Double to be json.Number, got %T instead", value) 10003 } 10004 f64, err := jtv.Float64() 10005 if err != nil { 10006 return err 10007 } 10008 sv.F1Score = ptr.Float64(f64) 10009 } 10010 10011 case "Precision": 10012 if value != nil { 10013 jtv, ok := value.(json.Number) 10014 if !ok { 10015 return fmt.Errorf("expected Double to be json.Number, got %T instead", value) 10016 } 10017 f64, err := jtv.Float64() 10018 if err != nil { 10019 return err 10020 } 10021 sv.Precision = ptr.Float64(f64) 10022 } 10023 10024 case "Recall": 10025 if value != nil { 10026 jtv, ok := value.(json.Number) 10027 if !ok { 10028 return fmt.Errorf("expected Double to be json.Number, got %T instead", value) 10029 } 10030 f64, err := jtv.Float64() 10031 if err != nil { 10032 return err 10033 } 10034 sv.Recall = ptr.Float64(f64) 10035 } 10036 10037 default: 10038 _, _ = key, value 10039 10040 } 10041 } 10042 *v = sv 10043 return nil 10044} 10045 10046func awsAwsjson11_deserializeDocumentEntityRecognizerInputDataConfig(v **types.EntityRecognizerInputDataConfig, value interface{}) error { 10047 if v == nil { 10048 return fmt.Errorf("unexpected nil of type %T", v) 10049 } 10050 if value == nil { 10051 return nil 10052 } 10053 10054 shape, ok := value.(map[string]interface{}) 10055 if !ok { 10056 return fmt.Errorf("unexpected JSON type %v", value) 10057 } 10058 10059 var sv *types.EntityRecognizerInputDataConfig 10060 if *v == nil { 10061 sv = &types.EntityRecognizerInputDataConfig{} 10062 } else { 10063 sv = *v 10064 } 10065 10066 for key, value := range shape { 10067 switch key { 10068 case "Annotations": 10069 if err := awsAwsjson11_deserializeDocumentEntityRecognizerAnnotations(&sv.Annotations, value); err != nil { 10070 return err 10071 } 10072 10073 case "AugmentedManifests": 10074 if err := awsAwsjson11_deserializeDocumentEntityRecognizerAugmentedManifestsList(&sv.AugmentedManifests, value); err != nil { 10075 return err 10076 } 10077 10078 case "DataFormat": 10079 if value != nil { 10080 jtv, ok := value.(string) 10081 if !ok { 10082 return fmt.Errorf("expected EntityRecognizerDataFormat to be of type string, got %T instead", value) 10083 } 10084 sv.DataFormat = types.EntityRecognizerDataFormat(jtv) 10085 } 10086 10087 case "Documents": 10088 if err := awsAwsjson11_deserializeDocumentEntityRecognizerDocuments(&sv.Documents, value); err != nil { 10089 return err 10090 } 10091 10092 case "EntityList": 10093 if err := awsAwsjson11_deserializeDocumentEntityRecognizerEntityList(&sv.EntityList, value); err != nil { 10094 return err 10095 } 10096 10097 case "EntityTypes": 10098 if err := awsAwsjson11_deserializeDocumentEntityTypesList(&sv.EntityTypes, value); err != nil { 10099 return err 10100 } 10101 10102 default: 10103 _, _ = key, value 10104 10105 } 10106 } 10107 *v = sv 10108 return nil 10109} 10110 10111func awsAwsjson11_deserializeDocumentEntityRecognizerMetadata(v **types.EntityRecognizerMetadata, value interface{}) error { 10112 if v == nil { 10113 return fmt.Errorf("unexpected nil of type %T", v) 10114 } 10115 if value == nil { 10116 return nil 10117 } 10118 10119 shape, ok := value.(map[string]interface{}) 10120 if !ok { 10121 return fmt.Errorf("unexpected JSON type %v", value) 10122 } 10123 10124 var sv *types.EntityRecognizerMetadata 10125 if *v == nil { 10126 sv = &types.EntityRecognizerMetadata{} 10127 } else { 10128 sv = *v 10129 } 10130 10131 for key, value := range shape { 10132 switch key { 10133 case "EntityTypes": 10134 if err := awsAwsjson11_deserializeDocumentEntityRecognizerMetadataEntityTypesList(&sv.EntityTypes, value); err != nil { 10135 return err 10136 } 10137 10138 case "EvaluationMetrics": 10139 if err := awsAwsjson11_deserializeDocumentEntityRecognizerEvaluationMetrics(&sv.EvaluationMetrics, value); err != nil { 10140 return err 10141 } 10142 10143 case "NumberOfTestDocuments": 10144 if value != nil { 10145 jtv, ok := value.(json.Number) 10146 if !ok { 10147 return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) 10148 } 10149 i64, err := jtv.Int64() 10150 if err != nil { 10151 return err 10152 } 10153 sv.NumberOfTestDocuments = ptr.Int32(int32(i64)) 10154 } 10155 10156 case "NumberOfTrainedDocuments": 10157 if value != nil { 10158 jtv, ok := value.(json.Number) 10159 if !ok { 10160 return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) 10161 } 10162 i64, err := jtv.Int64() 10163 if err != nil { 10164 return err 10165 } 10166 sv.NumberOfTrainedDocuments = ptr.Int32(int32(i64)) 10167 } 10168 10169 default: 10170 _, _ = key, value 10171 10172 } 10173 } 10174 *v = sv 10175 return nil 10176} 10177 10178func awsAwsjson11_deserializeDocumentEntityRecognizerMetadataEntityTypesList(v *[]types.EntityRecognizerMetadataEntityTypesListItem, value interface{}) error { 10179 if v == nil { 10180 return fmt.Errorf("unexpected nil of type %T", v) 10181 } 10182 if value == nil { 10183 return nil 10184 } 10185 10186 shape, ok := value.([]interface{}) 10187 if !ok { 10188 return fmt.Errorf("unexpected JSON type %v", value) 10189 } 10190 10191 var cv []types.EntityRecognizerMetadataEntityTypesListItem 10192 if *v == nil { 10193 cv = []types.EntityRecognizerMetadataEntityTypesListItem{} 10194 } else { 10195 cv = *v 10196 } 10197 10198 for _, value := range shape { 10199 var col types.EntityRecognizerMetadataEntityTypesListItem 10200 destAddr := &col 10201 if err := awsAwsjson11_deserializeDocumentEntityRecognizerMetadataEntityTypesListItem(&destAddr, value); err != nil { 10202 return err 10203 } 10204 col = *destAddr 10205 cv = append(cv, col) 10206 10207 } 10208 *v = cv 10209 return nil 10210} 10211 10212func awsAwsjson11_deserializeDocumentEntityRecognizerMetadataEntityTypesListItem(v **types.EntityRecognizerMetadataEntityTypesListItem, value interface{}) error { 10213 if v == nil { 10214 return fmt.Errorf("unexpected nil of type %T", v) 10215 } 10216 if value == nil { 10217 return nil 10218 } 10219 10220 shape, ok := value.(map[string]interface{}) 10221 if !ok { 10222 return fmt.Errorf("unexpected JSON type %v", value) 10223 } 10224 10225 var sv *types.EntityRecognizerMetadataEntityTypesListItem 10226 if *v == nil { 10227 sv = &types.EntityRecognizerMetadataEntityTypesListItem{} 10228 } else { 10229 sv = *v 10230 } 10231 10232 for key, value := range shape { 10233 switch key { 10234 case "EvaluationMetrics": 10235 if err := awsAwsjson11_deserializeDocumentEntityTypesEvaluationMetrics(&sv.EvaluationMetrics, value); err != nil { 10236 return err 10237 } 10238 10239 case "NumberOfTrainMentions": 10240 if value != nil { 10241 jtv, ok := value.(json.Number) 10242 if !ok { 10243 return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) 10244 } 10245 i64, err := jtv.Int64() 10246 if err != nil { 10247 return err 10248 } 10249 sv.NumberOfTrainMentions = ptr.Int32(int32(i64)) 10250 } 10251 10252 case "Type": 10253 if value != nil { 10254 jtv, ok := value.(string) 10255 if !ok { 10256 return fmt.Errorf("expected AnyLengthString to be of type string, got %T instead", value) 10257 } 10258 sv.Type = ptr.String(jtv) 10259 } 10260 10261 default: 10262 _, _ = key, value 10263 10264 } 10265 } 10266 *v = sv 10267 return nil 10268} 10269 10270func awsAwsjson11_deserializeDocumentEntityRecognizerProperties(v **types.EntityRecognizerProperties, value interface{}) error { 10271 if v == nil { 10272 return fmt.Errorf("unexpected nil of type %T", v) 10273 } 10274 if value == nil { 10275 return nil 10276 } 10277 10278 shape, ok := value.(map[string]interface{}) 10279 if !ok { 10280 return fmt.Errorf("unexpected JSON type %v", value) 10281 } 10282 10283 var sv *types.EntityRecognizerProperties 10284 if *v == nil { 10285 sv = &types.EntityRecognizerProperties{} 10286 } else { 10287 sv = *v 10288 } 10289 10290 for key, value := range shape { 10291 switch key { 10292 case "DataAccessRoleArn": 10293 if value != nil { 10294 jtv, ok := value.(string) 10295 if !ok { 10296 return fmt.Errorf("expected IamRoleArn to be of type string, got %T instead", value) 10297 } 10298 sv.DataAccessRoleArn = ptr.String(jtv) 10299 } 10300 10301 case "EndTime": 10302 if value != nil { 10303 jtv, ok := value.(json.Number) 10304 if !ok { 10305 return fmt.Errorf("expected Timestamp to be json.Number, got %T instead", value) 10306 } 10307 f64, err := jtv.Float64() 10308 if err != nil { 10309 return err 10310 } 10311 sv.EndTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) 10312 } 10313 10314 case "EntityRecognizerArn": 10315 if value != nil { 10316 jtv, ok := value.(string) 10317 if !ok { 10318 return fmt.Errorf("expected EntityRecognizerArn to be of type string, got %T instead", value) 10319 } 10320 sv.EntityRecognizerArn = ptr.String(jtv) 10321 } 10322 10323 case "InputDataConfig": 10324 if err := awsAwsjson11_deserializeDocumentEntityRecognizerInputDataConfig(&sv.InputDataConfig, value); err != nil { 10325 return err 10326 } 10327 10328 case "LanguageCode": 10329 if value != nil { 10330 jtv, ok := value.(string) 10331 if !ok { 10332 return fmt.Errorf("expected LanguageCode to be of type string, got %T instead", value) 10333 } 10334 sv.LanguageCode = types.LanguageCode(jtv) 10335 } 10336 10337 case "Message": 10338 if value != nil { 10339 jtv, ok := value.(string) 10340 if !ok { 10341 return fmt.Errorf("expected AnyLengthString to be of type string, got %T instead", value) 10342 } 10343 sv.Message = ptr.String(jtv) 10344 } 10345 10346 case "RecognizerMetadata": 10347 if err := awsAwsjson11_deserializeDocumentEntityRecognizerMetadata(&sv.RecognizerMetadata, value); err != nil { 10348 return err 10349 } 10350 10351 case "Status": 10352 if value != nil { 10353 jtv, ok := value.(string) 10354 if !ok { 10355 return fmt.Errorf("expected ModelStatus to be of type string, got %T instead", value) 10356 } 10357 sv.Status = types.ModelStatus(jtv) 10358 } 10359 10360 case "SubmitTime": 10361 if value != nil { 10362 jtv, ok := value.(json.Number) 10363 if !ok { 10364 return fmt.Errorf("expected Timestamp to be json.Number, got %T instead", value) 10365 } 10366 f64, err := jtv.Float64() 10367 if err != nil { 10368 return err 10369 } 10370 sv.SubmitTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) 10371 } 10372 10373 case "TrainingEndTime": 10374 if value != nil { 10375 jtv, ok := value.(json.Number) 10376 if !ok { 10377 return fmt.Errorf("expected Timestamp to be json.Number, got %T instead", value) 10378 } 10379 f64, err := jtv.Float64() 10380 if err != nil { 10381 return err 10382 } 10383 sv.TrainingEndTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) 10384 } 10385 10386 case "TrainingStartTime": 10387 if value != nil { 10388 jtv, ok := value.(json.Number) 10389 if !ok { 10390 return fmt.Errorf("expected Timestamp to be json.Number, got %T instead", value) 10391 } 10392 f64, err := jtv.Float64() 10393 if err != nil { 10394 return err 10395 } 10396 sv.TrainingStartTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) 10397 } 10398 10399 case "VolumeKmsKeyId": 10400 if value != nil { 10401 jtv, ok := value.(string) 10402 if !ok { 10403 return fmt.Errorf("expected KmsKeyId to be of type string, got %T instead", value) 10404 } 10405 sv.VolumeKmsKeyId = ptr.String(jtv) 10406 } 10407 10408 case "VpcConfig": 10409 if err := awsAwsjson11_deserializeDocumentVpcConfig(&sv.VpcConfig, value); err != nil { 10410 return err 10411 } 10412 10413 default: 10414 _, _ = key, value 10415 10416 } 10417 } 10418 *v = sv 10419 return nil 10420} 10421 10422func awsAwsjson11_deserializeDocumentEntityRecognizerPropertiesList(v *[]types.EntityRecognizerProperties, value interface{}) error { 10423 if v == nil { 10424 return fmt.Errorf("unexpected nil of type %T", v) 10425 } 10426 if value == nil { 10427 return nil 10428 } 10429 10430 shape, ok := value.([]interface{}) 10431 if !ok { 10432 return fmt.Errorf("unexpected JSON type %v", value) 10433 } 10434 10435 var cv []types.EntityRecognizerProperties 10436 if *v == nil { 10437 cv = []types.EntityRecognizerProperties{} 10438 } else { 10439 cv = *v 10440 } 10441 10442 for _, value := range shape { 10443 var col types.EntityRecognizerProperties 10444 destAddr := &col 10445 if err := awsAwsjson11_deserializeDocumentEntityRecognizerProperties(&destAddr, value); err != nil { 10446 return err 10447 } 10448 col = *destAddr 10449 cv = append(cv, col) 10450 10451 } 10452 *v = cv 10453 return nil 10454} 10455 10456func awsAwsjson11_deserializeDocumentEntityTypesEvaluationMetrics(v **types.EntityTypesEvaluationMetrics, value interface{}) error { 10457 if v == nil { 10458 return fmt.Errorf("unexpected nil of type %T", v) 10459 } 10460 if value == nil { 10461 return nil 10462 } 10463 10464 shape, ok := value.(map[string]interface{}) 10465 if !ok { 10466 return fmt.Errorf("unexpected JSON type %v", value) 10467 } 10468 10469 var sv *types.EntityTypesEvaluationMetrics 10470 if *v == nil { 10471 sv = &types.EntityTypesEvaluationMetrics{} 10472 } else { 10473 sv = *v 10474 } 10475 10476 for key, value := range shape { 10477 switch key { 10478 case "F1Score": 10479 if value != nil { 10480 jtv, ok := value.(json.Number) 10481 if !ok { 10482 return fmt.Errorf("expected Double to be json.Number, got %T instead", value) 10483 } 10484 f64, err := jtv.Float64() 10485 if err != nil { 10486 return err 10487 } 10488 sv.F1Score = ptr.Float64(f64) 10489 } 10490 10491 case "Precision": 10492 if value != nil { 10493 jtv, ok := value.(json.Number) 10494 if !ok { 10495 return fmt.Errorf("expected Double to be json.Number, got %T instead", value) 10496 } 10497 f64, err := jtv.Float64() 10498 if err != nil { 10499 return err 10500 } 10501 sv.Precision = ptr.Float64(f64) 10502 } 10503 10504 case "Recall": 10505 if value != nil { 10506 jtv, ok := value.(json.Number) 10507 if !ok { 10508 return fmt.Errorf("expected Double to be json.Number, got %T instead", value) 10509 } 10510 f64, err := jtv.Float64() 10511 if err != nil { 10512 return err 10513 } 10514 sv.Recall = ptr.Float64(f64) 10515 } 10516 10517 default: 10518 _, _ = key, value 10519 10520 } 10521 } 10522 *v = sv 10523 return nil 10524} 10525 10526func awsAwsjson11_deserializeDocumentEntityTypesList(v *[]types.EntityTypesListItem, value interface{}) error { 10527 if v == nil { 10528 return fmt.Errorf("unexpected nil of type %T", v) 10529 } 10530 if value == nil { 10531 return nil 10532 } 10533 10534 shape, ok := value.([]interface{}) 10535 if !ok { 10536 return fmt.Errorf("unexpected JSON type %v", value) 10537 } 10538 10539 var cv []types.EntityTypesListItem 10540 if *v == nil { 10541 cv = []types.EntityTypesListItem{} 10542 } else { 10543 cv = *v 10544 } 10545 10546 for _, value := range shape { 10547 var col types.EntityTypesListItem 10548 destAddr := &col 10549 if err := awsAwsjson11_deserializeDocumentEntityTypesListItem(&destAddr, value); err != nil { 10550 return err 10551 } 10552 col = *destAddr 10553 cv = append(cv, col) 10554 10555 } 10556 *v = cv 10557 return nil 10558} 10559 10560func awsAwsjson11_deserializeDocumentEntityTypesListItem(v **types.EntityTypesListItem, value interface{}) error { 10561 if v == nil { 10562 return fmt.Errorf("unexpected nil of type %T", v) 10563 } 10564 if value == nil { 10565 return nil 10566 } 10567 10568 shape, ok := value.(map[string]interface{}) 10569 if !ok { 10570 return fmt.Errorf("unexpected JSON type %v", value) 10571 } 10572 10573 var sv *types.EntityTypesListItem 10574 if *v == nil { 10575 sv = &types.EntityTypesListItem{} 10576 } else { 10577 sv = *v 10578 } 10579 10580 for key, value := range shape { 10581 switch key { 10582 case "Type": 10583 if value != nil { 10584 jtv, ok := value.(string) 10585 if !ok { 10586 return fmt.Errorf("expected EntityTypeName to be of type string, got %T instead", value) 10587 } 10588 sv.Type = ptr.String(jtv) 10589 } 10590 10591 default: 10592 _, _ = key, value 10593 10594 } 10595 } 10596 *v = sv 10597 return nil 10598} 10599 10600func awsAwsjson11_deserializeDocumentEventsDetectionJobProperties(v **types.EventsDetectionJobProperties, value interface{}) error { 10601 if v == nil { 10602 return fmt.Errorf("unexpected nil of type %T", v) 10603 } 10604 if value == nil { 10605 return nil 10606 } 10607 10608 shape, ok := value.(map[string]interface{}) 10609 if !ok { 10610 return fmt.Errorf("unexpected JSON type %v", value) 10611 } 10612 10613 var sv *types.EventsDetectionJobProperties 10614 if *v == nil { 10615 sv = &types.EventsDetectionJobProperties{} 10616 } else { 10617 sv = *v 10618 } 10619 10620 for key, value := range shape { 10621 switch key { 10622 case "DataAccessRoleArn": 10623 if value != nil { 10624 jtv, ok := value.(string) 10625 if !ok { 10626 return fmt.Errorf("expected IamRoleArn to be of type string, got %T instead", value) 10627 } 10628 sv.DataAccessRoleArn = ptr.String(jtv) 10629 } 10630 10631 case "EndTime": 10632 if value != nil { 10633 jtv, ok := value.(json.Number) 10634 if !ok { 10635 return fmt.Errorf("expected Timestamp to be json.Number, got %T instead", value) 10636 } 10637 f64, err := jtv.Float64() 10638 if err != nil { 10639 return err 10640 } 10641 sv.EndTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) 10642 } 10643 10644 case "InputDataConfig": 10645 if err := awsAwsjson11_deserializeDocumentInputDataConfig(&sv.InputDataConfig, value); err != nil { 10646 return err 10647 } 10648 10649 case "JobId": 10650 if value != nil { 10651 jtv, ok := value.(string) 10652 if !ok { 10653 return fmt.Errorf("expected JobId to be of type string, got %T instead", value) 10654 } 10655 sv.JobId = ptr.String(jtv) 10656 } 10657 10658 case "JobName": 10659 if value != nil { 10660 jtv, ok := value.(string) 10661 if !ok { 10662 return fmt.Errorf("expected JobName to be of type string, got %T instead", value) 10663 } 10664 sv.JobName = ptr.String(jtv) 10665 } 10666 10667 case "JobStatus": 10668 if value != nil { 10669 jtv, ok := value.(string) 10670 if !ok { 10671 return fmt.Errorf("expected JobStatus to be of type string, got %T instead", value) 10672 } 10673 sv.JobStatus = types.JobStatus(jtv) 10674 } 10675 10676 case "LanguageCode": 10677 if value != nil { 10678 jtv, ok := value.(string) 10679 if !ok { 10680 return fmt.Errorf("expected LanguageCode to be of type string, got %T instead", value) 10681 } 10682 sv.LanguageCode = types.LanguageCode(jtv) 10683 } 10684 10685 case "Message": 10686 if value != nil { 10687 jtv, ok := value.(string) 10688 if !ok { 10689 return fmt.Errorf("expected AnyLengthString to be of type string, got %T instead", value) 10690 } 10691 sv.Message = ptr.String(jtv) 10692 } 10693 10694 case "OutputDataConfig": 10695 if err := awsAwsjson11_deserializeDocumentOutputDataConfig(&sv.OutputDataConfig, value); err != nil { 10696 return err 10697 } 10698 10699 case "SubmitTime": 10700 if value != nil { 10701 jtv, ok := value.(json.Number) 10702 if !ok { 10703 return fmt.Errorf("expected Timestamp to be json.Number, got %T instead", value) 10704 } 10705 f64, err := jtv.Float64() 10706 if err != nil { 10707 return err 10708 } 10709 sv.SubmitTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) 10710 } 10711 10712 case "TargetEventTypes": 10713 if err := awsAwsjson11_deserializeDocumentTargetEventTypes(&sv.TargetEventTypes, value); err != nil { 10714 return err 10715 } 10716 10717 default: 10718 _, _ = key, value 10719 10720 } 10721 } 10722 *v = sv 10723 return nil 10724} 10725 10726func awsAwsjson11_deserializeDocumentEventsDetectionJobPropertiesList(v *[]types.EventsDetectionJobProperties, value interface{}) error { 10727 if v == nil { 10728 return fmt.Errorf("unexpected nil of type %T", v) 10729 } 10730 if value == nil { 10731 return nil 10732 } 10733 10734 shape, ok := value.([]interface{}) 10735 if !ok { 10736 return fmt.Errorf("unexpected JSON type %v", value) 10737 } 10738 10739 var cv []types.EventsDetectionJobProperties 10740 if *v == nil { 10741 cv = []types.EventsDetectionJobProperties{} 10742 } else { 10743 cv = *v 10744 } 10745 10746 for _, value := range shape { 10747 var col types.EventsDetectionJobProperties 10748 destAddr := &col 10749 if err := awsAwsjson11_deserializeDocumentEventsDetectionJobProperties(&destAddr, value); err != nil { 10750 return err 10751 } 10752 col = *destAddr 10753 cv = append(cv, col) 10754 10755 } 10756 *v = cv 10757 return nil 10758} 10759 10760func awsAwsjson11_deserializeDocumentInputDataConfig(v **types.InputDataConfig, value interface{}) error { 10761 if v == nil { 10762 return fmt.Errorf("unexpected nil of type %T", v) 10763 } 10764 if value == nil { 10765 return nil 10766 } 10767 10768 shape, ok := value.(map[string]interface{}) 10769 if !ok { 10770 return fmt.Errorf("unexpected JSON type %v", value) 10771 } 10772 10773 var sv *types.InputDataConfig 10774 if *v == nil { 10775 sv = &types.InputDataConfig{} 10776 } else { 10777 sv = *v 10778 } 10779 10780 for key, value := range shape { 10781 switch key { 10782 case "InputFormat": 10783 if value != nil { 10784 jtv, ok := value.(string) 10785 if !ok { 10786 return fmt.Errorf("expected InputFormat to be of type string, got %T instead", value) 10787 } 10788 sv.InputFormat = types.InputFormat(jtv) 10789 } 10790 10791 case "S3Uri": 10792 if value != nil { 10793 jtv, ok := value.(string) 10794 if !ok { 10795 return fmt.Errorf("expected S3Uri to be of type string, got %T instead", value) 10796 } 10797 sv.S3Uri = ptr.String(jtv) 10798 } 10799 10800 default: 10801 _, _ = key, value 10802 10803 } 10804 } 10805 *v = sv 10806 return nil 10807} 10808 10809func awsAwsjson11_deserializeDocumentInternalServerException(v **types.InternalServerException, value interface{}) error { 10810 if v == nil { 10811 return fmt.Errorf("unexpected nil of type %T", v) 10812 } 10813 if value == nil { 10814 return nil 10815 } 10816 10817 shape, ok := value.(map[string]interface{}) 10818 if !ok { 10819 return fmt.Errorf("unexpected JSON type %v", value) 10820 } 10821 10822 var sv *types.InternalServerException 10823 if *v == nil { 10824 sv = &types.InternalServerException{} 10825 } else { 10826 sv = *v 10827 } 10828 10829 for key, value := range shape { 10830 switch key { 10831 case "Message": 10832 if value != nil { 10833 jtv, ok := value.(string) 10834 if !ok { 10835 return fmt.Errorf("expected String to be of type string, got %T instead", value) 10836 } 10837 sv.Message = ptr.String(jtv) 10838 } 10839 10840 default: 10841 _, _ = key, value 10842 10843 } 10844 } 10845 *v = sv 10846 return nil 10847} 10848 10849func awsAwsjson11_deserializeDocumentInvalidFilterException(v **types.InvalidFilterException, value interface{}) error { 10850 if v == nil { 10851 return fmt.Errorf("unexpected nil of type %T", v) 10852 } 10853 if value == nil { 10854 return nil 10855 } 10856 10857 shape, ok := value.(map[string]interface{}) 10858 if !ok { 10859 return fmt.Errorf("unexpected JSON type %v", value) 10860 } 10861 10862 var sv *types.InvalidFilterException 10863 if *v == nil { 10864 sv = &types.InvalidFilterException{} 10865 } else { 10866 sv = *v 10867 } 10868 10869 for key, value := range shape { 10870 switch key { 10871 case "Message": 10872 if value != nil { 10873 jtv, ok := value.(string) 10874 if !ok { 10875 return fmt.Errorf("expected String to be of type string, got %T instead", value) 10876 } 10877 sv.Message = ptr.String(jtv) 10878 } 10879 10880 default: 10881 _, _ = key, value 10882 10883 } 10884 } 10885 *v = sv 10886 return nil 10887} 10888 10889func awsAwsjson11_deserializeDocumentInvalidRequestException(v **types.InvalidRequestException, value interface{}) error { 10890 if v == nil { 10891 return fmt.Errorf("unexpected nil of type %T", v) 10892 } 10893 if value == nil { 10894 return nil 10895 } 10896 10897 shape, ok := value.(map[string]interface{}) 10898 if !ok { 10899 return fmt.Errorf("unexpected JSON type %v", value) 10900 } 10901 10902 var sv *types.InvalidRequestException 10903 if *v == nil { 10904 sv = &types.InvalidRequestException{} 10905 } else { 10906 sv = *v 10907 } 10908 10909 for key, value := range shape { 10910 switch key { 10911 case "Message": 10912 if value != nil { 10913 jtv, ok := value.(string) 10914 if !ok { 10915 return fmt.Errorf("expected String to be of type string, got %T instead", value) 10916 } 10917 sv.Message = ptr.String(jtv) 10918 } 10919 10920 default: 10921 _, _ = key, value 10922 10923 } 10924 } 10925 *v = sv 10926 return nil 10927} 10928 10929func awsAwsjson11_deserializeDocumentJobNotFoundException(v **types.JobNotFoundException, value interface{}) error { 10930 if v == nil { 10931 return fmt.Errorf("unexpected nil of type %T", v) 10932 } 10933 if value == nil { 10934 return nil 10935 } 10936 10937 shape, ok := value.(map[string]interface{}) 10938 if !ok { 10939 return fmt.Errorf("unexpected JSON type %v", value) 10940 } 10941 10942 var sv *types.JobNotFoundException 10943 if *v == nil { 10944 sv = &types.JobNotFoundException{} 10945 } else { 10946 sv = *v 10947 } 10948 10949 for key, value := range shape { 10950 switch key { 10951 case "Message": 10952 if value != nil { 10953 jtv, ok := value.(string) 10954 if !ok { 10955 return fmt.Errorf("expected String to be of type string, got %T instead", value) 10956 } 10957 sv.Message = ptr.String(jtv) 10958 } 10959 10960 default: 10961 _, _ = key, value 10962 10963 } 10964 } 10965 *v = sv 10966 return nil 10967} 10968 10969func awsAwsjson11_deserializeDocumentKeyPhrase(v **types.KeyPhrase, value interface{}) error { 10970 if v == nil { 10971 return fmt.Errorf("unexpected nil of type %T", v) 10972 } 10973 if value == nil { 10974 return nil 10975 } 10976 10977 shape, ok := value.(map[string]interface{}) 10978 if !ok { 10979 return fmt.Errorf("unexpected JSON type %v", value) 10980 } 10981 10982 var sv *types.KeyPhrase 10983 if *v == nil { 10984 sv = &types.KeyPhrase{} 10985 } else { 10986 sv = *v 10987 } 10988 10989 for key, value := range shape { 10990 switch key { 10991 case "BeginOffset": 10992 if value != nil { 10993 jtv, ok := value.(json.Number) 10994 if !ok { 10995 return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) 10996 } 10997 i64, err := jtv.Int64() 10998 if err != nil { 10999 return err 11000 } 11001 sv.BeginOffset = ptr.Int32(int32(i64)) 11002 } 11003 11004 case "EndOffset": 11005 if value != nil { 11006 jtv, ok := value.(json.Number) 11007 if !ok { 11008 return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) 11009 } 11010 i64, err := jtv.Int64() 11011 if err != nil { 11012 return err 11013 } 11014 sv.EndOffset = ptr.Int32(int32(i64)) 11015 } 11016 11017 case "Score": 11018 if value != nil { 11019 jtv, ok := value.(json.Number) 11020 if !ok { 11021 return fmt.Errorf("expected Float to be json.Number, got %T instead", value) 11022 } 11023 f64, err := jtv.Float64() 11024 if err != nil { 11025 return err 11026 } 11027 sv.Score = ptr.Float32(float32(f64)) 11028 } 11029 11030 case "Text": 11031 if value != nil { 11032 jtv, ok := value.(string) 11033 if !ok { 11034 return fmt.Errorf("expected String to be of type string, got %T instead", value) 11035 } 11036 sv.Text = ptr.String(jtv) 11037 } 11038 11039 default: 11040 _, _ = key, value 11041 11042 } 11043 } 11044 *v = sv 11045 return nil 11046} 11047 11048func awsAwsjson11_deserializeDocumentKeyPhrasesDetectionJobProperties(v **types.KeyPhrasesDetectionJobProperties, value interface{}) error { 11049 if v == nil { 11050 return fmt.Errorf("unexpected nil of type %T", v) 11051 } 11052 if value == nil { 11053 return nil 11054 } 11055 11056 shape, ok := value.(map[string]interface{}) 11057 if !ok { 11058 return fmt.Errorf("unexpected JSON type %v", value) 11059 } 11060 11061 var sv *types.KeyPhrasesDetectionJobProperties 11062 if *v == nil { 11063 sv = &types.KeyPhrasesDetectionJobProperties{} 11064 } else { 11065 sv = *v 11066 } 11067 11068 for key, value := range shape { 11069 switch key { 11070 case "DataAccessRoleArn": 11071 if value != nil { 11072 jtv, ok := value.(string) 11073 if !ok { 11074 return fmt.Errorf("expected IamRoleArn to be of type string, got %T instead", value) 11075 } 11076 sv.DataAccessRoleArn = ptr.String(jtv) 11077 } 11078 11079 case "EndTime": 11080 if value != nil { 11081 jtv, ok := value.(json.Number) 11082 if !ok { 11083 return fmt.Errorf("expected Timestamp to be json.Number, got %T instead", value) 11084 } 11085 f64, err := jtv.Float64() 11086 if err != nil { 11087 return err 11088 } 11089 sv.EndTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) 11090 } 11091 11092 case "InputDataConfig": 11093 if err := awsAwsjson11_deserializeDocumentInputDataConfig(&sv.InputDataConfig, value); err != nil { 11094 return err 11095 } 11096 11097 case "JobId": 11098 if value != nil { 11099 jtv, ok := value.(string) 11100 if !ok { 11101 return fmt.Errorf("expected JobId to be of type string, got %T instead", value) 11102 } 11103 sv.JobId = ptr.String(jtv) 11104 } 11105 11106 case "JobName": 11107 if value != nil { 11108 jtv, ok := value.(string) 11109 if !ok { 11110 return fmt.Errorf("expected JobName to be of type string, got %T instead", value) 11111 } 11112 sv.JobName = ptr.String(jtv) 11113 } 11114 11115 case "JobStatus": 11116 if value != nil { 11117 jtv, ok := value.(string) 11118 if !ok { 11119 return fmt.Errorf("expected JobStatus to be of type string, got %T instead", value) 11120 } 11121 sv.JobStatus = types.JobStatus(jtv) 11122 } 11123 11124 case "LanguageCode": 11125 if value != nil { 11126 jtv, ok := value.(string) 11127 if !ok { 11128 return fmt.Errorf("expected LanguageCode to be of type string, got %T instead", value) 11129 } 11130 sv.LanguageCode = types.LanguageCode(jtv) 11131 } 11132 11133 case "Message": 11134 if value != nil { 11135 jtv, ok := value.(string) 11136 if !ok { 11137 return fmt.Errorf("expected AnyLengthString to be of type string, got %T instead", value) 11138 } 11139 sv.Message = ptr.String(jtv) 11140 } 11141 11142 case "OutputDataConfig": 11143 if err := awsAwsjson11_deserializeDocumentOutputDataConfig(&sv.OutputDataConfig, value); err != nil { 11144 return err 11145 } 11146 11147 case "SubmitTime": 11148 if value != nil { 11149 jtv, ok := value.(json.Number) 11150 if !ok { 11151 return fmt.Errorf("expected Timestamp to be json.Number, got %T instead", value) 11152 } 11153 f64, err := jtv.Float64() 11154 if err != nil { 11155 return err 11156 } 11157 sv.SubmitTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) 11158 } 11159 11160 case "VolumeKmsKeyId": 11161 if value != nil { 11162 jtv, ok := value.(string) 11163 if !ok { 11164 return fmt.Errorf("expected KmsKeyId to be of type string, got %T instead", value) 11165 } 11166 sv.VolumeKmsKeyId = ptr.String(jtv) 11167 } 11168 11169 case "VpcConfig": 11170 if err := awsAwsjson11_deserializeDocumentVpcConfig(&sv.VpcConfig, value); err != nil { 11171 return err 11172 } 11173 11174 default: 11175 _, _ = key, value 11176 11177 } 11178 } 11179 *v = sv 11180 return nil 11181} 11182 11183func awsAwsjson11_deserializeDocumentKeyPhrasesDetectionJobPropertiesList(v *[]types.KeyPhrasesDetectionJobProperties, value interface{}) error { 11184 if v == nil { 11185 return fmt.Errorf("unexpected nil of type %T", v) 11186 } 11187 if value == nil { 11188 return nil 11189 } 11190 11191 shape, ok := value.([]interface{}) 11192 if !ok { 11193 return fmt.Errorf("unexpected JSON type %v", value) 11194 } 11195 11196 var cv []types.KeyPhrasesDetectionJobProperties 11197 if *v == nil { 11198 cv = []types.KeyPhrasesDetectionJobProperties{} 11199 } else { 11200 cv = *v 11201 } 11202 11203 for _, value := range shape { 11204 var col types.KeyPhrasesDetectionJobProperties 11205 destAddr := &col 11206 if err := awsAwsjson11_deserializeDocumentKeyPhrasesDetectionJobProperties(&destAddr, value); err != nil { 11207 return err 11208 } 11209 col = *destAddr 11210 cv = append(cv, col) 11211 11212 } 11213 *v = cv 11214 return nil 11215} 11216 11217func awsAwsjson11_deserializeDocumentKmsKeyValidationException(v **types.KmsKeyValidationException, value interface{}) error { 11218 if v == nil { 11219 return fmt.Errorf("unexpected nil of type %T", v) 11220 } 11221 if value == nil { 11222 return nil 11223 } 11224 11225 shape, ok := value.(map[string]interface{}) 11226 if !ok { 11227 return fmt.Errorf("unexpected JSON type %v", value) 11228 } 11229 11230 var sv *types.KmsKeyValidationException 11231 if *v == nil { 11232 sv = &types.KmsKeyValidationException{} 11233 } else { 11234 sv = *v 11235 } 11236 11237 for key, value := range shape { 11238 switch key { 11239 case "Message": 11240 if value != nil { 11241 jtv, ok := value.(string) 11242 if !ok { 11243 return fmt.Errorf("expected String to be of type string, got %T instead", value) 11244 } 11245 sv.Message = ptr.String(jtv) 11246 } 11247 11248 default: 11249 _, _ = key, value 11250 11251 } 11252 } 11253 *v = sv 11254 return nil 11255} 11256 11257func awsAwsjson11_deserializeDocumentListOfClasses(v *[]types.DocumentClass, value interface{}) error { 11258 if v == nil { 11259 return fmt.Errorf("unexpected nil of type %T", v) 11260 } 11261 if value == nil { 11262 return nil 11263 } 11264 11265 shape, ok := value.([]interface{}) 11266 if !ok { 11267 return fmt.Errorf("unexpected JSON type %v", value) 11268 } 11269 11270 var cv []types.DocumentClass 11271 if *v == nil { 11272 cv = []types.DocumentClass{} 11273 } else { 11274 cv = *v 11275 } 11276 11277 for _, value := range shape { 11278 var col types.DocumentClass 11279 destAddr := &col 11280 if err := awsAwsjson11_deserializeDocumentDocumentClass(&destAddr, value); err != nil { 11281 return err 11282 } 11283 col = *destAddr 11284 cv = append(cv, col) 11285 11286 } 11287 *v = cv 11288 return nil 11289} 11290 11291func awsAwsjson11_deserializeDocumentListOfDetectDominantLanguageResult(v *[]types.BatchDetectDominantLanguageItemResult, value interface{}) error { 11292 if v == nil { 11293 return fmt.Errorf("unexpected nil of type %T", v) 11294 } 11295 if value == nil { 11296 return nil 11297 } 11298 11299 shape, ok := value.([]interface{}) 11300 if !ok { 11301 return fmt.Errorf("unexpected JSON type %v", value) 11302 } 11303 11304 var cv []types.BatchDetectDominantLanguageItemResult 11305 if *v == nil { 11306 cv = []types.BatchDetectDominantLanguageItemResult{} 11307 } else { 11308 cv = *v 11309 } 11310 11311 for _, value := range shape { 11312 var col types.BatchDetectDominantLanguageItemResult 11313 destAddr := &col 11314 if err := awsAwsjson11_deserializeDocumentBatchDetectDominantLanguageItemResult(&destAddr, value); err != nil { 11315 return err 11316 } 11317 col = *destAddr 11318 cv = append(cv, col) 11319 11320 } 11321 *v = cv 11322 return nil 11323} 11324 11325func awsAwsjson11_deserializeDocumentListOfDetectEntitiesResult(v *[]types.BatchDetectEntitiesItemResult, value interface{}) error { 11326 if v == nil { 11327 return fmt.Errorf("unexpected nil of type %T", v) 11328 } 11329 if value == nil { 11330 return nil 11331 } 11332 11333 shape, ok := value.([]interface{}) 11334 if !ok { 11335 return fmt.Errorf("unexpected JSON type %v", value) 11336 } 11337 11338 var cv []types.BatchDetectEntitiesItemResult 11339 if *v == nil { 11340 cv = []types.BatchDetectEntitiesItemResult{} 11341 } else { 11342 cv = *v 11343 } 11344 11345 for _, value := range shape { 11346 var col types.BatchDetectEntitiesItemResult 11347 destAddr := &col 11348 if err := awsAwsjson11_deserializeDocumentBatchDetectEntitiesItemResult(&destAddr, value); err != nil { 11349 return err 11350 } 11351 col = *destAddr 11352 cv = append(cv, col) 11353 11354 } 11355 *v = cv 11356 return nil 11357} 11358 11359func awsAwsjson11_deserializeDocumentListOfDetectKeyPhrasesResult(v *[]types.BatchDetectKeyPhrasesItemResult, value interface{}) error { 11360 if v == nil { 11361 return fmt.Errorf("unexpected nil of type %T", v) 11362 } 11363 if value == nil { 11364 return nil 11365 } 11366 11367 shape, ok := value.([]interface{}) 11368 if !ok { 11369 return fmt.Errorf("unexpected JSON type %v", value) 11370 } 11371 11372 var cv []types.BatchDetectKeyPhrasesItemResult 11373 if *v == nil { 11374 cv = []types.BatchDetectKeyPhrasesItemResult{} 11375 } else { 11376 cv = *v 11377 } 11378 11379 for _, value := range shape { 11380 var col types.BatchDetectKeyPhrasesItemResult 11381 destAddr := &col 11382 if err := awsAwsjson11_deserializeDocumentBatchDetectKeyPhrasesItemResult(&destAddr, value); err != nil { 11383 return err 11384 } 11385 col = *destAddr 11386 cv = append(cv, col) 11387 11388 } 11389 *v = cv 11390 return nil 11391} 11392 11393func awsAwsjson11_deserializeDocumentListOfDetectSentimentResult(v *[]types.BatchDetectSentimentItemResult, value interface{}) error { 11394 if v == nil { 11395 return fmt.Errorf("unexpected nil of type %T", v) 11396 } 11397 if value == nil { 11398 return nil 11399 } 11400 11401 shape, ok := value.([]interface{}) 11402 if !ok { 11403 return fmt.Errorf("unexpected JSON type %v", value) 11404 } 11405 11406 var cv []types.BatchDetectSentimentItemResult 11407 if *v == nil { 11408 cv = []types.BatchDetectSentimentItemResult{} 11409 } else { 11410 cv = *v 11411 } 11412 11413 for _, value := range shape { 11414 var col types.BatchDetectSentimentItemResult 11415 destAddr := &col 11416 if err := awsAwsjson11_deserializeDocumentBatchDetectSentimentItemResult(&destAddr, value); err != nil { 11417 return err 11418 } 11419 col = *destAddr 11420 cv = append(cv, col) 11421 11422 } 11423 *v = cv 11424 return nil 11425} 11426 11427func awsAwsjson11_deserializeDocumentListOfDetectSyntaxResult(v *[]types.BatchDetectSyntaxItemResult, value interface{}) error { 11428 if v == nil { 11429 return fmt.Errorf("unexpected nil of type %T", v) 11430 } 11431 if value == nil { 11432 return nil 11433 } 11434 11435 shape, ok := value.([]interface{}) 11436 if !ok { 11437 return fmt.Errorf("unexpected JSON type %v", value) 11438 } 11439 11440 var cv []types.BatchDetectSyntaxItemResult 11441 if *v == nil { 11442 cv = []types.BatchDetectSyntaxItemResult{} 11443 } else { 11444 cv = *v 11445 } 11446 11447 for _, value := range shape { 11448 var col types.BatchDetectSyntaxItemResult 11449 destAddr := &col 11450 if err := awsAwsjson11_deserializeDocumentBatchDetectSyntaxItemResult(&destAddr, value); err != nil { 11451 return err 11452 } 11453 col = *destAddr 11454 cv = append(cv, col) 11455 11456 } 11457 *v = cv 11458 return nil 11459} 11460 11461func awsAwsjson11_deserializeDocumentListOfDominantLanguages(v *[]types.DominantLanguage, value interface{}) error { 11462 if v == nil { 11463 return fmt.Errorf("unexpected nil of type %T", v) 11464 } 11465 if value == nil { 11466 return nil 11467 } 11468 11469 shape, ok := value.([]interface{}) 11470 if !ok { 11471 return fmt.Errorf("unexpected JSON type %v", value) 11472 } 11473 11474 var cv []types.DominantLanguage 11475 if *v == nil { 11476 cv = []types.DominantLanguage{} 11477 } else { 11478 cv = *v 11479 } 11480 11481 for _, value := range shape { 11482 var col types.DominantLanguage 11483 destAddr := &col 11484 if err := awsAwsjson11_deserializeDocumentDominantLanguage(&destAddr, value); err != nil { 11485 return err 11486 } 11487 col = *destAddr 11488 cv = append(cv, col) 11489 11490 } 11491 *v = cv 11492 return nil 11493} 11494 11495func awsAwsjson11_deserializeDocumentListOfEntities(v *[]types.Entity, value interface{}) error { 11496 if v == nil { 11497 return fmt.Errorf("unexpected nil of type %T", v) 11498 } 11499 if value == nil { 11500 return nil 11501 } 11502 11503 shape, ok := value.([]interface{}) 11504 if !ok { 11505 return fmt.Errorf("unexpected JSON type %v", value) 11506 } 11507 11508 var cv []types.Entity 11509 if *v == nil { 11510 cv = []types.Entity{} 11511 } else { 11512 cv = *v 11513 } 11514 11515 for _, value := range shape { 11516 var col types.Entity 11517 destAddr := &col 11518 if err := awsAwsjson11_deserializeDocumentEntity(&destAddr, value); err != nil { 11519 return err 11520 } 11521 col = *destAddr 11522 cv = append(cv, col) 11523 11524 } 11525 *v = cv 11526 return nil 11527} 11528 11529func awsAwsjson11_deserializeDocumentListOfKeyPhrases(v *[]types.KeyPhrase, value interface{}) error { 11530 if v == nil { 11531 return fmt.Errorf("unexpected nil of type %T", v) 11532 } 11533 if value == nil { 11534 return nil 11535 } 11536 11537 shape, ok := value.([]interface{}) 11538 if !ok { 11539 return fmt.Errorf("unexpected JSON type %v", value) 11540 } 11541 11542 var cv []types.KeyPhrase 11543 if *v == nil { 11544 cv = []types.KeyPhrase{} 11545 } else { 11546 cv = *v 11547 } 11548 11549 for _, value := range shape { 11550 var col types.KeyPhrase 11551 destAddr := &col 11552 if err := awsAwsjson11_deserializeDocumentKeyPhrase(&destAddr, value); err != nil { 11553 return err 11554 } 11555 col = *destAddr 11556 cv = append(cv, col) 11557 11558 } 11559 *v = cv 11560 return nil 11561} 11562 11563func awsAwsjson11_deserializeDocumentListOfLabels(v *[]types.DocumentLabel, value interface{}) error { 11564 if v == nil { 11565 return fmt.Errorf("unexpected nil of type %T", v) 11566 } 11567 if value == nil { 11568 return nil 11569 } 11570 11571 shape, ok := value.([]interface{}) 11572 if !ok { 11573 return fmt.Errorf("unexpected JSON type %v", value) 11574 } 11575 11576 var cv []types.DocumentLabel 11577 if *v == nil { 11578 cv = []types.DocumentLabel{} 11579 } else { 11580 cv = *v 11581 } 11582 11583 for _, value := range shape { 11584 var col types.DocumentLabel 11585 destAddr := &col 11586 if err := awsAwsjson11_deserializeDocumentDocumentLabel(&destAddr, value); err != nil { 11587 return err 11588 } 11589 col = *destAddr 11590 cv = append(cv, col) 11591 11592 } 11593 *v = cv 11594 return nil 11595} 11596 11597func awsAwsjson11_deserializeDocumentListOfPiiEntities(v *[]types.PiiEntity, value interface{}) error { 11598 if v == nil { 11599 return fmt.Errorf("unexpected nil of type %T", v) 11600 } 11601 if value == nil { 11602 return nil 11603 } 11604 11605 shape, ok := value.([]interface{}) 11606 if !ok { 11607 return fmt.Errorf("unexpected JSON type %v", value) 11608 } 11609 11610 var cv []types.PiiEntity 11611 if *v == nil { 11612 cv = []types.PiiEntity{} 11613 } else { 11614 cv = *v 11615 } 11616 11617 for _, value := range shape { 11618 var col types.PiiEntity 11619 destAddr := &col 11620 if err := awsAwsjson11_deserializeDocumentPiiEntity(&destAddr, value); err != nil { 11621 return err 11622 } 11623 col = *destAddr 11624 cv = append(cv, col) 11625 11626 } 11627 *v = cv 11628 return nil 11629} 11630 11631func awsAwsjson11_deserializeDocumentListOfPiiEntityTypes(v *[]types.PiiEntityType, value interface{}) error { 11632 if v == nil { 11633 return fmt.Errorf("unexpected nil of type %T", v) 11634 } 11635 if value == nil { 11636 return nil 11637 } 11638 11639 shape, ok := value.([]interface{}) 11640 if !ok { 11641 return fmt.Errorf("unexpected JSON type %v", value) 11642 } 11643 11644 var cv []types.PiiEntityType 11645 if *v == nil { 11646 cv = []types.PiiEntityType{} 11647 } else { 11648 cv = *v 11649 } 11650 11651 for _, value := range shape { 11652 var col types.PiiEntityType 11653 if value != nil { 11654 jtv, ok := value.(string) 11655 if !ok { 11656 return fmt.Errorf("expected PiiEntityType to be of type string, got %T instead", value) 11657 } 11658 col = types.PiiEntityType(jtv) 11659 } 11660 cv = append(cv, col) 11661 11662 } 11663 *v = cv 11664 return nil 11665} 11666 11667func awsAwsjson11_deserializeDocumentListOfSyntaxTokens(v *[]types.SyntaxToken, value interface{}) error { 11668 if v == nil { 11669 return fmt.Errorf("unexpected nil of type %T", v) 11670 } 11671 if value == nil { 11672 return nil 11673 } 11674 11675 shape, ok := value.([]interface{}) 11676 if !ok { 11677 return fmt.Errorf("unexpected JSON type %v", value) 11678 } 11679 11680 var cv []types.SyntaxToken 11681 if *v == nil { 11682 cv = []types.SyntaxToken{} 11683 } else { 11684 cv = *v 11685 } 11686 11687 for _, value := range shape { 11688 var col types.SyntaxToken 11689 destAddr := &col 11690 if err := awsAwsjson11_deserializeDocumentSyntaxToken(&destAddr, value); err != nil { 11691 return err 11692 } 11693 col = *destAddr 11694 cv = append(cv, col) 11695 11696 } 11697 *v = cv 11698 return nil 11699} 11700 11701func awsAwsjson11_deserializeDocumentOutputDataConfig(v **types.OutputDataConfig, value interface{}) error { 11702 if v == nil { 11703 return fmt.Errorf("unexpected nil of type %T", v) 11704 } 11705 if value == nil { 11706 return nil 11707 } 11708 11709 shape, ok := value.(map[string]interface{}) 11710 if !ok { 11711 return fmt.Errorf("unexpected JSON type %v", value) 11712 } 11713 11714 var sv *types.OutputDataConfig 11715 if *v == nil { 11716 sv = &types.OutputDataConfig{} 11717 } else { 11718 sv = *v 11719 } 11720 11721 for key, value := range shape { 11722 switch key { 11723 case "KmsKeyId": 11724 if value != nil { 11725 jtv, ok := value.(string) 11726 if !ok { 11727 return fmt.Errorf("expected KmsKeyId to be of type string, got %T instead", value) 11728 } 11729 sv.KmsKeyId = ptr.String(jtv) 11730 } 11731 11732 case "S3Uri": 11733 if value != nil { 11734 jtv, ok := value.(string) 11735 if !ok { 11736 return fmt.Errorf("expected S3Uri to be of type string, got %T instead", value) 11737 } 11738 sv.S3Uri = ptr.String(jtv) 11739 } 11740 11741 default: 11742 _, _ = key, value 11743 11744 } 11745 } 11746 *v = sv 11747 return nil 11748} 11749 11750func awsAwsjson11_deserializeDocumentPartOfSpeechTag(v **types.PartOfSpeechTag, value interface{}) error { 11751 if v == nil { 11752 return fmt.Errorf("unexpected nil of type %T", v) 11753 } 11754 if value == nil { 11755 return nil 11756 } 11757 11758 shape, ok := value.(map[string]interface{}) 11759 if !ok { 11760 return fmt.Errorf("unexpected JSON type %v", value) 11761 } 11762 11763 var sv *types.PartOfSpeechTag 11764 if *v == nil { 11765 sv = &types.PartOfSpeechTag{} 11766 } else { 11767 sv = *v 11768 } 11769 11770 for key, value := range shape { 11771 switch key { 11772 case "Score": 11773 if value != nil { 11774 jtv, ok := value.(json.Number) 11775 if !ok { 11776 return fmt.Errorf("expected Float to be json.Number, got %T instead", value) 11777 } 11778 f64, err := jtv.Float64() 11779 if err != nil { 11780 return err 11781 } 11782 sv.Score = ptr.Float32(float32(f64)) 11783 } 11784 11785 case "Tag": 11786 if value != nil { 11787 jtv, ok := value.(string) 11788 if !ok { 11789 return fmt.Errorf("expected PartOfSpeechTagType to be of type string, got %T instead", value) 11790 } 11791 sv.Tag = types.PartOfSpeechTagType(jtv) 11792 } 11793 11794 default: 11795 _, _ = key, value 11796 11797 } 11798 } 11799 *v = sv 11800 return nil 11801} 11802 11803func awsAwsjson11_deserializeDocumentPiiEntitiesDetectionJobProperties(v **types.PiiEntitiesDetectionJobProperties, value interface{}) error { 11804 if v == nil { 11805 return fmt.Errorf("unexpected nil of type %T", v) 11806 } 11807 if value == nil { 11808 return nil 11809 } 11810 11811 shape, ok := value.(map[string]interface{}) 11812 if !ok { 11813 return fmt.Errorf("unexpected JSON type %v", value) 11814 } 11815 11816 var sv *types.PiiEntitiesDetectionJobProperties 11817 if *v == nil { 11818 sv = &types.PiiEntitiesDetectionJobProperties{} 11819 } else { 11820 sv = *v 11821 } 11822 11823 for key, value := range shape { 11824 switch key { 11825 case "DataAccessRoleArn": 11826 if value != nil { 11827 jtv, ok := value.(string) 11828 if !ok { 11829 return fmt.Errorf("expected IamRoleArn to be of type string, got %T instead", value) 11830 } 11831 sv.DataAccessRoleArn = ptr.String(jtv) 11832 } 11833 11834 case "EndTime": 11835 if value != nil { 11836 jtv, ok := value.(json.Number) 11837 if !ok { 11838 return fmt.Errorf("expected Timestamp to be json.Number, got %T instead", value) 11839 } 11840 f64, err := jtv.Float64() 11841 if err != nil { 11842 return err 11843 } 11844 sv.EndTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) 11845 } 11846 11847 case "InputDataConfig": 11848 if err := awsAwsjson11_deserializeDocumentInputDataConfig(&sv.InputDataConfig, value); err != nil { 11849 return err 11850 } 11851 11852 case "JobId": 11853 if value != nil { 11854 jtv, ok := value.(string) 11855 if !ok { 11856 return fmt.Errorf("expected JobId to be of type string, got %T instead", value) 11857 } 11858 sv.JobId = ptr.String(jtv) 11859 } 11860 11861 case "JobName": 11862 if value != nil { 11863 jtv, ok := value.(string) 11864 if !ok { 11865 return fmt.Errorf("expected JobName to be of type string, got %T instead", value) 11866 } 11867 sv.JobName = ptr.String(jtv) 11868 } 11869 11870 case "JobStatus": 11871 if value != nil { 11872 jtv, ok := value.(string) 11873 if !ok { 11874 return fmt.Errorf("expected JobStatus to be of type string, got %T instead", value) 11875 } 11876 sv.JobStatus = types.JobStatus(jtv) 11877 } 11878 11879 case "LanguageCode": 11880 if value != nil { 11881 jtv, ok := value.(string) 11882 if !ok { 11883 return fmt.Errorf("expected LanguageCode to be of type string, got %T instead", value) 11884 } 11885 sv.LanguageCode = types.LanguageCode(jtv) 11886 } 11887 11888 case "Message": 11889 if value != nil { 11890 jtv, ok := value.(string) 11891 if !ok { 11892 return fmt.Errorf("expected AnyLengthString to be of type string, got %T instead", value) 11893 } 11894 sv.Message = ptr.String(jtv) 11895 } 11896 11897 case "Mode": 11898 if value != nil { 11899 jtv, ok := value.(string) 11900 if !ok { 11901 return fmt.Errorf("expected PiiEntitiesDetectionMode to be of type string, got %T instead", value) 11902 } 11903 sv.Mode = types.PiiEntitiesDetectionMode(jtv) 11904 } 11905 11906 case "OutputDataConfig": 11907 if err := awsAwsjson11_deserializeDocumentPiiOutputDataConfig(&sv.OutputDataConfig, value); err != nil { 11908 return err 11909 } 11910 11911 case "RedactionConfig": 11912 if err := awsAwsjson11_deserializeDocumentRedactionConfig(&sv.RedactionConfig, value); err != nil { 11913 return err 11914 } 11915 11916 case "SubmitTime": 11917 if value != nil { 11918 jtv, ok := value.(json.Number) 11919 if !ok { 11920 return fmt.Errorf("expected Timestamp to be json.Number, got %T instead", value) 11921 } 11922 f64, err := jtv.Float64() 11923 if err != nil { 11924 return err 11925 } 11926 sv.SubmitTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) 11927 } 11928 11929 default: 11930 _, _ = key, value 11931 11932 } 11933 } 11934 *v = sv 11935 return nil 11936} 11937 11938func awsAwsjson11_deserializeDocumentPiiEntitiesDetectionJobPropertiesList(v *[]types.PiiEntitiesDetectionJobProperties, value interface{}) error { 11939 if v == nil { 11940 return fmt.Errorf("unexpected nil of type %T", v) 11941 } 11942 if value == nil { 11943 return nil 11944 } 11945 11946 shape, ok := value.([]interface{}) 11947 if !ok { 11948 return fmt.Errorf("unexpected JSON type %v", value) 11949 } 11950 11951 var cv []types.PiiEntitiesDetectionJobProperties 11952 if *v == nil { 11953 cv = []types.PiiEntitiesDetectionJobProperties{} 11954 } else { 11955 cv = *v 11956 } 11957 11958 for _, value := range shape { 11959 var col types.PiiEntitiesDetectionJobProperties 11960 destAddr := &col 11961 if err := awsAwsjson11_deserializeDocumentPiiEntitiesDetectionJobProperties(&destAddr, value); err != nil { 11962 return err 11963 } 11964 col = *destAddr 11965 cv = append(cv, col) 11966 11967 } 11968 *v = cv 11969 return nil 11970} 11971 11972func awsAwsjson11_deserializeDocumentPiiEntity(v **types.PiiEntity, value interface{}) error { 11973 if v == nil { 11974 return fmt.Errorf("unexpected nil of type %T", v) 11975 } 11976 if value == nil { 11977 return nil 11978 } 11979 11980 shape, ok := value.(map[string]interface{}) 11981 if !ok { 11982 return fmt.Errorf("unexpected JSON type %v", value) 11983 } 11984 11985 var sv *types.PiiEntity 11986 if *v == nil { 11987 sv = &types.PiiEntity{} 11988 } else { 11989 sv = *v 11990 } 11991 11992 for key, value := range shape { 11993 switch key { 11994 case "BeginOffset": 11995 if value != nil { 11996 jtv, ok := value.(json.Number) 11997 if !ok { 11998 return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) 11999 } 12000 i64, err := jtv.Int64() 12001 if err != nil { 12002 return err 12003 } 12004 sv.BeginOffset = ptr.Int32(int32(i64)) 12005 } 12006 12007 case "EndOffset": 12008 if value != nil { 12009 jtv, ok := value.(json.Number) 12010 if !ok { 12011 return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) 12012 } 12013 i64, err := jtv.Int64() 12014 if err != nil { 12015 return err 12016 } 12017 sv.EndOffset = ptr.Int32(int32(i64)) 12018 } 12019 12020 case "Score": 12021 if value != nil { 12022 jtv, ok := value.(json.Number) 12023 if !ok { 12024 return fmt.Errorf("expected Float to be json.Number, got %T instead", value) 12025 } 12026 f64, err := jtv.Float64() 12027 if err != nil { 12028 return err 12029 } 12030 sv.Score = ptr.Float32(float32(f64)) 12031 } 12032 12033 case "Type": 12034 if value != nil { 12035 jtv, ok := value.(string) 12036 if !ok { 12037 return fmt.Errorf("expected PiiEntityType to be of type string, got %T instead", value) 12038 } 12039 sv.Type = types.PiiEntityType(jtv) 12040 } 12041 12042 default: 12043 _, _ = key, value 12044 12045 } 12046 } 12047 *v = sv 12048 return nil 12049} 12050 12051func awsAwsjson11_deserializeDocumentPiiOutputDataConfig(v **types.PiiOutputDataConfig, value interface{}) error { 12052 if v == nil { 12053 return fmt.Errorf("unexpected nil of type %T", v) 12054 } 12055 if value == nil { 12056 return nil 12057 } 12058 12059 shape, ok := value.(map[string]interface{}) 12060 if !ok { 12061 return fmt.Errorf("unexpected JSON type %v", value) 12062 } 12063 12064 var sv *types.PiiOutputDataConfig 12065 if *v == nil { 12066 sv = &types.PiiOutputDataConfig{} 12067 } else { 12068 sv = *v 12069 } 12070 12071 for key, value := range shape { 12072 switch key { 12073 case "KmsKeyId": 12074 if value != nil { 12075 jtv, ok := value.(string) 12076 if !ok { 12077 return fmt.Errorf("expected KmsKeyId to be of type string, got %T instead", value) 12078 } 12079 sv.KmsKeyId = ptr.String(jtv) 12080 } 12081 12082 case "S3Uri": 12083 if value != nil { 12084 jtv, ok := value.(string) 12085 if !ok { 12086 return fmt.Errorf("expected S3Uri to be of type string, got %T instead", value) 12087 } 12088 sv.S3Uri = ptr.String(jtv) 12089 } 12090 12091 default: 12092 _, _ = key, value 12093 12094 } 12095 } 12096 *v = sv 12097 return nil 12098} 12099 12100func awsAwsjson11_deserializeDocumentRedactionConfig(v **types.RedactionConfig, value interface{}) error { 12101 if v == nil { 12102 return fmt.Errorf("unexpected nil of type %T", v) 12103 } 12104 if value == nil { 12105 return nil 12106 } 12107 12108 shape, ok := value.(map[string]interface{}) 12109 if !ok { 12110 return fmt.Errorf("unexpected JSON type %v", value) 12111 } 12112 12113 var sv *types.RedactionConfig 12114 if *v == nil { 12115 sv = &types.RedactionConfig{} 12116 } else { 12117 sv = *v 12118 } 12119 12120 for key, value := range shape { 12121 switch key { 12122 case "MaskCharacter": 12123 if value != nil { 12124 jtv, ok := value.(string) 12125 if !ok { 12126 return fmt.Errorf("expected MaskCharacter to be of type string, got %T instead", value) 12127 } 12128 sv.MaskCharacter = ptr.String(jtv) 12129 } 12130 12131 case "MaskMode": 12132 if value != nil { 12133 jtv, ok := value.(string) 12134 if !ok { 12135 return fmt.Errorf("expected PiiEntitiesDetectionMaskMode to be of type string, got %T instead", value) 12136 } 12137 sv.MaskMode = types.PiiEntitiesDetectionMaskMode(jtv) 12138 } 12139 12140 case "PiiEntityTypes": 12141 if err := awsAwsjson11_deserializeDocumentListOfPiiEntityTypes(&sv.PiiEntityTypes, value); err != nil { 12142 return err 12143 } 12144 12145 default: 12146 _, _ = key, value 12147 12148 } 12149 } 12150 *v = sv 12151 return nil 12152} 12153 12154func awsAwsjson11_deserializeDocumentResourceInUseException(v **types.ResourceInUseException, value interface{}) error { 12155 if v == nil { 12156 return fmt.Errorf("unexpected nil of type %T", v) 12157 } 12158 if value == nil { 12159 return nil 12160 } 12161 12162 shape, ok := value.(map[string]interface{}) 12163 if !ok { 12164 return fmt.Errorf("unexpected JSON type %v", value) 12165 } 12166 12167 var sv *types.ResourceInUseException 12168 if *v == nil { 12169 sv = &types.ResourceInUseException{} 12170 } else { 12171 sv = *v 12172 } 12173 12174 for key, value := range shape { 12175 switch key { 12176 case "Message": 12177 if value != nil { 12178 jtv, ok := value.(string) 12179 if !ok { 12180 return fmt.Errorf("expected String to be of type string, got %T instead", value) 12181 } 12182 sv.Message = ptr.String(jtv) 12183 } 12184 12185 default: 12186 _, _ = key, value 12187 12188 } 12189 } 12190 *v = sv 12191 return nil 12192} 12193 12194func awsAwsjson11_deserializeDocumentResourceLimitExceededException(v **types.ResourceLimitExceededException, value interface{}) error { 12195 if v == nil { 12196 return fmt.Errorf("unexpected nil of type %T", v) 12197 } 12198 if value == nil { 12199 return nil 12200 } 12201 12202 shape, ok := value.(map[string]interface{}) 12203 if !ok { 12204 return fmt.Errorf("unexpected JSON type %v", value) 12205 } 12206 12207 var sv *types.ResourceLimitExceededException 12208 if *v == nil { 12209 sv = &types.ResourceLimitExceededException{} 12210 } else { 12211 sv = *v 12212 } 12213 12214 for key, value := range shape { 12215 switch key { 12216 case "Message": 12217 if value != nil { 12218 jtv, ok := value.(string) 12219 if !ok { 12220 return fmt.Errorf("expected String to be of type string, got %T instead", value) 12221 } 12222 sv.Message = ptr.String(jtv) 12223 } 12224 12225 default: 12226 _, _ = key, value 12227 12228 } 12229 } 12230 *v = sv 12231 return nil 12232} 12233 12234func awsAwsjson11_deserializeDocumentResourceNotFoundException(v **types.ResourceNotFoundException, value interface{}) error { 12235 if v == nil { 12236 return fmt.Errorf("unexpected nil of type %T", v) 12237 } 12238 if value == nil { 12239 return nil 12240 } 12241 12242 shape, ok := value.(map[string]interface{}) 12243 if !ok { 12244 return fmt.Errorf("unexpected JSON type %v", value) 12245 } 12246 12247 var sv *types.ResourceNotFoundException 12248 if *v == nil { 12249 sv = &types.ResourceNotFoundException{} 12250 } else { 12251 sv = *v 12252 } 12253 12254 for key, value := range shape { 12255 switch key { 12256 case "Message": 12257 if value != nil { 12258 jtv, ok := value.(string) 12259 if !ok { 12260 return fmt.Errorf("expected String to be of type string, got %T instead", value) 12261 } 12262 sv.Message = ptr.String(jtv) 12263 } 12264 12265 default: 12266 _, _ = key, value 12267 12268 } 12269 } 12270 *v = sv 12271 return nil 12272} 12273 12274func awsAwsjson11_deserializeDocumentResourceUnavailableException(v **types.ResourceUnavailableException, value interface{}) error { 12275 if v == nil { 12276 return fmt.Errorf("unexpected nil of type %T", v) 12277 } 12278 if value == nil { 12279 return nil 12280 } 12281 12282 shape, ok := value.(map[string]interface{}) 12283 if !ok { 12284 return fmt.Errorf("unexpected JSON type %v", value) 12285 } 12286 12287 var sv *types.ResourceUnavailableException 12288 if *v == nil { 12289 sv = &types.ResourceUnavailableException{} 12290 } else { 12291 sv = *v 12292 } 12293 12294 for key, value := range shape { 12295 switch key { 12296 case "Message": 12297 if value != nil { 12298 jtv, ok := value.(string) 12299 if !ok { 12300 return fmt.Errorf("expected String to be of type string, got %T instead", value) 12301 } 12302 sv.Message = ptr.String(jtv) 12303 } 12304 12305 default: 12306 _, _ = key, value 12307 12308 } 12309 } 12310 *v = sv 12311 return nil 12312} 12313 12314func awsAwsjson11_deserializeDocumentSecurityGroupIds(v *[]string, value interface{}) error { 12315 if v == nil { 12316 return fmt.Errorf("unexpected nil of type %T", v) 12317 } 12318 if value == nil { 12319 return nil 12320 } 12321 12322 shape, ok := value.([]interface{}) 12323 if !ok { 12324 return fmt.Errorf("unexpected JSON type %v", value) 12325 } 12326 12327 var cv []string 12328 if *v == nil { 12329 cv = []string{} 12330 } else { 12331 cv = *v 12332 } 12333 12334 for _, value := range shape { 12335 var col string 12336 if value != nil { 12337 jtv, ok := value.(string) 12338 if !ok { 12339 return fmt.Errorf("expected SecurityGroupId to be of type string, got %T instead", value) 12340 } 12341 col = jtv 12342 } 12343 cv = append(cv, col) 12344 12345 } 12346 *v = cv 12347 return nil 12348} 12349 12350func awsAwsjson11_deserializeDocumentSentimentDetectionJobProperties(v **types.SentimentDetectionJobProperties, value interface{}) error { 12351 if v == nil { 12352 return fmt.Errorf("unexpected nil of type %T", v) 12353 } 12354 if value == nil { 12355 return nil 12356 } 12357 12358 shape, ok := value.(map[string]interface{}) 12359 if !ok { 12360 return fmt.Errorf("unexpected JSON type %v", value) 12361 } 12362 12363 var sv *types.SentimentDetectionJobProperties 12364 if *v == nil { 12365 sv = &types.SentimentDetectionJobProperties{} 12366 } else { 12367 sv = *v 12368 } 12369 12370 for key, value := range shape { 12371 switch key { 12372 case "DataAccessRoleArn": 12373 if value != nil { 12374 jtv, ok := value.(string) 12375 if !ok { 12376 return fmt.Errorf("expected IamRoleArn to be of type string, got %T instead", value) 12377 } 12378 sv.DataAccessRoleArn = ptr.String(jtv) 12379 } 12380 12381 case "EndTime": 12382 if value != nil { 12383 jtv, ok := value.(json.Number) 12384 if !ok { 12385 return fmt.Errorf("expected Timestamp to be json.Number, got %T instead", value) 12386 } 12387 f64, err := jtv.Float64() 12388 if err != nil { 12389 return err 12390 } 12391 sv.EndTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) 12392 } 12393 12394 case "InputDataConfig": 12395 if err := awsAwsjson11_deserializeDocumentInputDataConfig(&sv.InputDataConfig, value); err != nil { 12396 return err 12397 } 12398 12399 case "JobId": 12400 if value != nil { 12401 jtv, ok := value.(string) 12402 if !ok { 12403 return fmt.Errorf("expected JobId to be of type string, got %T instead", value) 12404 } 12405 sv.JobId = ptr.String(jtv) 12406 } 12407 12408 case "JobName": 12409 if value != nil { 12410 jtv, ok := value.(string) 12411 if !ok { 12412 return fmt.Errorf("expected JobName to be of type string, got %T instead", value) 12413 } 12414 sv.JobName = ptr.String(jtv) 12415 } 12416 12417 case "JobStatus": 12418 if value != nil { 12419 jtv, ok := value.(string) 12420 if !ok { 12421 return fmt.Errorf("expected JobStatus to be of type string, got %T instead", value) 12422 } 12423 sv.JobStatus = types.JobStatus(jtv) 12424 } 12425 12426 case "LanguageCode": 12427 if value != nil { 12428 jtv, ok := value.(string) 12429 if !ok { 12430 return fmt.Errorf("expected LanguageCode to be of type string, got %T instead", value) 12431 } 12432 sv.LanguageCode = types.LanguageCode(jtv) 12433 } 12434 12435 case "Message": 12436 if value != nil { 12437 jtv, ok := value.(string) 12438 if !ok { 12439 return fmt.Errorf("expected AnyLengthString to be of type string, got %T instead", value) 12440 } 12441 sv.Message = ptr.String(jtv) 12442 } 12443 12444 case "OutputDataConfig": 12445 if err := awsAwsjson11_deserializeDocumentOutputDataConfig(&sv.OutputDataConfig, value); err != nil { 12446 return err 12447 } 12448 12449 case "SubmitTime": 12450 if value != nil { 12451 jtv, ok := value.(json.Number) 12452 if !ok { 12453 return fmt.Errorf("expected Timestamp to be json.Number, got %T instead", value) 12454 } 12455 f64, err := jtv.Float64() 12456 if err != nil { 12457 return err 12458 } 12459 sv.SubmitTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) 12460 } 12461 12462 case "VolumeKmsKeyId": 12463 if value != nil { 12464 jtv, ok := value.(string) 12465 if !ok { 12466 return fmt.Errorf("expected KmsKeyId to be of type string, got %T instead", value) 12467 } 12468 sv.VolumeKmsKeyId = ptr.String(jtv) 12469 } 12470 12471 case "VpcConfig": 12472 if err := awsAwsjson11_deserializeDocumentVpcConfig(&sv.VpcConfig, value); err != nil { 12473 return err 12474 } 12475 12476 default: 12477 _, _ = key, value 12478 12479 } 12480 } 12481 *v = sv 12482 return nil 12483} 12484 12485func awsAwsjson11_deserializeDocumentSentimentDetectionJobPropertiesList(v *[]types.SentimentDetectionJobProperties, value interface{}) error { 12486 if v == nil { 12487 return fmt.Errorf("unexpected nil of type %T", v) 12488 } 12489 if value == nil { 12490 return nil 12491 } 12492 12493 shape, ok := value.([]interface{}) 12494 if !ok { 12495 return fmt.Errorf("unexpected JSON type %v", value) 12496 } 12497 12498 var cv []types.SentimentDetectionJobProperties 12499 if *v == nil { 12500 cv = []types.SentimentDetectionJobProperties{} 12501 } else { 12502 cv = *v 12503 } 12504 12505 for _, value := range shape { 12506 var col types.SentimentDetectionJobProperties 12507 destAddr := &col 12508 if err := awsAwsjson11_deserializeDocumentSentimentDetectionJobProperties(&destAddr, value); err != nil { 12509 return err 12510 } 12511 col = *destAddr 12512 cv = append(cv, col) 12513 12514 } 12515 *v = cv 12516 return nil 12517} 12518 12519func awsAwsjson11_deserializeDocumentSentimentScore(v **types.SentimentScore, value interface{}) error { 12520 if v == nil { 12521 return fmt.Errorf("unexpected nil of type %T", v) 12522 } 12523 if value == nil { 12524 return nil 12525 } 12526 12527 shape, ok := value.(map[string]interface{}) 12528 if !ok { 12529 return fmt.Errorf("unexpected JSON type %v", value) 12530 } 12531 12532 var sv *types.SentimentScore 12533 if *v == nil { 12534 sv = &types.SentimentScore{} 12535 } else { 12536 sv = *v 12537 } 12538 12539 for key, value := range shape { 12540 switch key { 12541 case "Mixed": 12542 if value != nil { 12543 jtv, ok := value.(json.Number) 12544 if !ok { 12545 return fmt.Errorf("expected Float to be json.Number, got %T instead", value) 12546 } 12547 f64, err := jtv.Float64() 12548 if err != nil { 12549 return err 12550 } 12551 sv.Mixed = ptr.Float32(float32(f64)) 12552 } 12553 12554 case "Negative": 12555 if value != nil { 12556 jtv, ok := value.(json.Number) 12557 if !ok { 12558 return fmt.Errorf("expected Float to be json.Number, got %T instead", value) 12559 } 12560 f64, err := jtv.Float64() 12561 if err != nil { 12562 return err 12563 } 12564 sv.Negative = ptr.Float32(float32(f64)) 12565 } 12566 12567 case "Neutral": 12568 if value != nil { 12569 jtv, ok := value.(json.Number) 12570 if !ok { 12571 return fmt.Errorf("expected Float to be json.Number, got %T instead", value) 12572 } 12573 f64, err := jtv.Float64() 12574 if err != nil { 12575 return err 12576 } 12577 sv.Neutral = ptr.Float32(float32(f64)) 12578 } 12579 12580 case "Positive": 12581 if value != nil { 12582 jtv, ok := value.(json.Number) 12583 if !ok { 12584 return fmt.Errorf("expected Float to be json.Number, got %T instead", value) 12585 } 12586 f64, err := jtv.Float64() 12587 if err != nil { 12588 return err 12589 } 12590 sv.Positive = ptr.Float32(float32(f64)) 12591 } 12592 12593 default: 12594 _, _ = key, value 12595 12596 } 12597 } 12598 *v = sv 12599 return nil 12600} 12601 12602func awsAwsjson11_deserializeDocumentSubnets(v *[]string, value interface{}) error { 12603 if v == nil { 12604 return fmt.Errorf("unexpected nil of type %T", v) 12605 } 12606 if value == nil { 12607 return nil 12608 } 12609 12610 shape, ok := value.([]interface{}) 12611 if !ok { 12612 return fmt.Errorf("unexpected JSON type %v", value) 12613 } 12614 12615 var cv []string 12616 if *v == nil { 12617 cv = []string{} 12618 } else { 12619 cv = *v 12620 } 12621 12622 for _, value := range shape { 12623 var col string 12624 if value != nil { 12625 jtv, ok := value.(string) 12626 if !ok { 12627 return fmt.Errorf("expected SubnetId to be of type string, got %T instead", value) 12628 } 12629 col = jtv 12630 } 12631 cv = append(cv, col) 12632 12633 } 12634 *v = cv 12635 return nil 12636} 12637 12638func awsAwsjson11_deserializeDocumentSyntaxToken(v **types.SyntaxToken, value interface{}) error { 12639 if v == nil { 12640 return fmt.Errorf("unexpected nil of type %T", v) 12641 } 12642 if value == nil { 12643 return nil 12644 } 12645 12646 shape, ok := value.(map[string]interface{}) 12647 if !ok { 12648 return fmt.Errorf("unexpected JSON type %v", value) 12649 } 12650 12651 var sv *types.SyntaxToken 12652 if *v == nil { 12653 sv = &types.SyntaxToken{} 12654 } else { 12655 sv = *v 12656 } 12657 12658 for key, value := range shape { 12659 switch key { 12660 case "BeginOffset": 12661 if value != nil { 12662 jtv, ok := value.(json.Number) 12663 if !ok { 12664 return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) 12665 } 12666 i64, err := jtv.Int64() 12667 if err != nil { 12668 return err 12669 } 12670 sv.BeginOffset = ptr.Int32(int32(i64)) 12671 } 12672 12673 case "EndOffset": 12674 if value != nil { 12675 jtv, ok := value.(json.Number) 12676 if !ok { 12677 return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) 12678 } 12679 i64, err := jtv.Int64() 12680 if err != nil { 12681 return err 12682 } 12683 sv.EndOffset = ptr.Int32(int32(i64)) 12684 } 12685 12686 case "PartOfSpeech": 12687 if err := awsAwsjson11_deserializeDocumentPartOfSpeechTag(&sv.PartOfSpeech, value); err != nil { 12688 return err 12689 } 12690 12691 case "Text": 12692 if value != nil { 12693 jtv, ok := value.(string) 12694 if !ok { 12695 return fmt.Errorf("expected String to be of type string, got %T instead", value) 12696 } 12697 sv.Text = ptr.String(jtv) 12698 } 12699 12700 case "TokenId": 12701 if value != nil { 12702 jtv, ok := value.(json.Number) 12703 if !ok { 12704 return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) 12705 } 12706 i64, err := jtv.Int64() 12707 if err != nil { 12708 return err 12709 } 12710 sv.TokenId = ptr.Int32(int32(i64)) 12711 } 12712 12713 default: 12714 _, _ = key, value 12715 12716 } 12717 } 12718 *v = sv 12719 return nil 12720} 12721 12722func awsAwsjson11_deserializeDocumentTag(v **types.Tag, value interface{}) error { 12723 if v == nil { 12724 return fmt.Errorf("unexpected nil of type %T", v) 12725 } 12726 if value == nil { 12727 return nil 12728 } 12729 12730 shape, ok := value.(map[string]interface{}) 12731 if !ok { 12732 return fmt.Errorf("unexpected JSON type %v", value) 12733 } 12734 12735 var sv *types.Tag 12736 if *v == nil { 12737 sv = &types.Tag{} 12738 } else { 12739 sv = *v 12740 } 12741 12742 for key, value := range shape { 12743 switch key { 12744 case "Key": 12745 if value != nil { 12746 jtv, ok := value.(string) 12747 if !ok { 12748 return fmt.Errorf("expected TagKey to be of type string, got %T instead", value) 12749 } 12750 sv.Key = ptr.String(jtv) 12751 } 12752 12753 case "Value": 12754 if value != nil { 12755 jtv, ok := value.(string) 12756 if !ok { 12757 return fmt.Errorf("expected TagValue to be of type string, got %T instead", value) 12758 } 12759 sv.Value = ptr.String(jtv) 12760 } 12761 12762 default: 12763 _, _ = key, value 12764 12765 } 12766 } 12767 *v = sv 12768 return nil 12769} 12770 12771func awsAwsjson11_deserializeDocumentTagList(v *[]types.Tag, value interface{}) error { 12772 if v == nil { 12773 return fmt.Errorf("unexpected nil of type %T", v) 12774 } 12775 if value == nil { 12776 return nil 12777 } 12778 12779 shape, ok := value.([]interface{}) 12780 if !ok { 12781 return fmt.Errorf("unexpected JSON type %v", value) 12782 } 12783 12784 var cv []types.Tag 12785 if *v == nil { 12786 cv = []types.Tag{} 12787 } else { 12788 cv = *v 12789 } 12790 12791 for _, value := range shape { 12792 var col types.Tag 12793 destAddr := &col 12794 if err := awsAwsjson11_deserializeDocumentTag(&destAddr, value); err != nil { 12795 return err 12796 } 12797 col = *destAddr 12798 cv = append(cv, col) 12799 12800 } 12801 *v = cv 12802 return nil 12803} 12804 12805func awsAwsjson11_deserializeDocumentTargetEventTypes(v *[]string, value interface{}) error { 12806 if v == nil { 12807 return fmt.Errorf("unexpected nil of type %T", v) 12808 } 12809 if value == nil { 12810 return nil 12811 } 12812 12813 shape, ok := value.([]interface{}) 12814 if !ok { 12815 return fmt.Errorf("unexpected JSON type %v", value) 12816 } 12817 12818 var cv []string 12819 if *v == nil { 12820 cv = []string{} 12821 } else { 12822 cv = *v 12823 } 12824 12825 for _, value := range shape { 12826 var col string 12827 if value != nil { 12828 jtv, ok := value.(string) 12829 if !ok { 12830 return fmt.Errorf("expected EventTypeString to be of type string, got %T instead", value) 12831 } 12832 col = jtv 12833 } 12834 cv = append(cv, col) 12835 12836 } 12837 *v = cv 12838 return nil 12839} 12840 12841func awsAwsjson11_deserializeDocumentTextSizeLimitExceededException(v **types.TextSizeLimitExceededException, value interface{}) error { 12842 if v == nil { 12843 return fmt.Errorf("unexpected nil of type %T", v) 12844 } 12845 if value == nil { 12846 return nil 12847 } 12848 12849 shape, ok := value.(map[string]interface{}) 12850 if !ok { 12851 return fmt.Errorf("unexpected JSON type %v", value) 12852 } 12853 12854 var sv *types.TextSizeLimitExceededException 12855 if *v == nil { 12856 sv = &types.TextSizeLimitExceededException{} 12857 } else { 12858 sv = *v 12859 } 12860 12861 for key, value := range shape { 12862 switch key { 12863 case "Message": 12864 if value != nil { 12865 jtv, ok := value.(string) 12866 if !ok { 12867 return fmt.Errorf("expected String to be of type string, got %T instead", value) 12868 } 12869 sv.Message = ptr.String(jtv) 12870 } 12871 12872 default: 12873 _, _ = key, value 12874 12875 } 12876 } 12877 *v = sv 12878 return nil 12879} 12880 12881func awsAwsjson11_deserializeDocumentTooManyRequestsException(v **types.TooManyRequestsException, value interface{}) error { 12882 if v == nil { 12883 return fmt.Errorf("unexpected nil of type %T", v) 12884 } 12885 if value == nil { 12886 return nil 12887 } 12888 12889 shape, ok := value.(map[string]interface{}) 12890 if !ok { 12891 return fmt.Errorf("unexpected JSON type %v", value) 12892 } 12893 12894 var sv *types.TooManyRequestsException 12895 if *v == nil { 12896 sv = &types.TooManyRequestsException{} 12897 } else { 12898 sv = *v 12899 } 12900 12901 for key, value := range shape { 12902 switch key { 12903 case "Message": 12904 if value != nil { 12905 jtv, ok := value.(string) 12906 if !ok { 12907 return fmt.Errorf("expected String to be of type string, got %T instead", value) 12908 } 12909 sv.Message = ptr.String(jtv) 12910 } 12911 12912 default: 12913 _, _ = key, value 12914 12915 } 12916 } 12917 *v = sv 12918 return nil 12919} 12920 12921func awsAwsjson11_deserializeDocumentTooManyTagKeysException(v **types.TooManyTagKeysException, value interface{}) error { 12922 if v == nil { 12923 return fmt.Errorf("unexpected nil of type %T", v) 12924 } 12925 if value == nil { 12926 return nil 12927 } 12928 12929 shape, ok := value.(map[string]interface{}) 12930 if !ok { 12931 return fmt.Errorf("unexpected JSON type %v", value) 12932 } 12933 12934 var sv *types.TooManyTagKeysException 12935 if *v == nil { 12936 sv = &types.TooManyTagKeysException{} 12937 } else { 12938 sv = *v 12939 } 12940 12941 for key, value := range shape { 12942 switch key { 12943 case "Message": 12944 if value != nil { 12945 jtv, ok := value.(string) 12946 if !ok { 12947 return fmt.Errorf("expected String to be of type string, got %T instead", value) 12948 } 12949 sv.Message = ptr.String(jtv) 12950 } 12951 12952 default: 12953 _, _ = key, value 12954 12955 } 12956 } 12957 *v = sv 12958 return nil 12959} 12960 12961func awsAwsjson11_deserializeDocumentTooManyTagsException(v **types.TooManyTagsException, value interface{}) error { 12962 if v == nil { 12963 return fmt.Errorf("unexpected nil of type %T", v) 12964 } 12965 if value == nil { 12966 return nil 12967 } 12968 12969 shape, ok := value.(map[string]interface{}) 12970 if !ok { 12971 return fmt.Errorf("unexpected JSON type %v", value) 12972 } 12973 12974 var sv *types.TooManyTagsException 12975 if *v == nil { 12976 sv = &types.TooManyTagsException{} 12977 } else { 12978 sv = *v 12979 } 12980 12981 for key, value := range shape { 12982 switch key { 12983 case "Message": 12984 if value != nil { 12985 jtv, ok := value.(string) 12986 if !ok { 12987 return fmt.Errorf("expected String to be of type string, got %T instead", value) 12988 } 12989 sv.Message = ptr.String(jtv) 12990 } 12991 12992 default: 12993 _, _ = key, value 12994 12995 } 12996 } 12997 *v = sv 12998 return nil 12999} 13000 13001func awsAwsjson11_deserializeDocumentTopicsDetectionJobProperties(v **types.TopicsDetectionJobProperties, value interface{}) error { 13002 if v == nil { 13003 return fmt.Errorf("unexpected nil of type %T", v) 13004 } 13005 if value == nil { 13006 return nil 13007 } 13008 13009 shape, ok := value.(map[string]interface{}) 13010 if !ok { 13011 return fmt.Errorf("unexpected JSON type %v", value) 13012 } 13013 13014 var sv *types.TopicsDetectionJobProperties 13015 if *v == nil { 13016 sv = &types.TopicsDetectionJobProperties{} 13017 } else { 13018 sv = *v 13019 } 13020 13021 for key, value := range shape { 13022 switch key { 13023 case "DataAccessRoleArn": 13024 if value != nil { 13025 jtv, ok := value.(string) 13026 if !ok { 13027 return fmt.Errorf("expected IamRoleArn to be of type string, got %T instead", value) 13028 } 13029 sv.DataAccessRoleArn = ptr.String(jtv) 13030 } 13031 13032 case "EndTime": 13033 if value != nil { 13034 jtv, ok := value.(json.Number) 13035 if !ok { 13036 return fmt.Errorf("expected Timestamp to be json.Number, got %T instead", value) 13037 } 13038 f64, err := jtv.Float64() 13039 if err != nil { 13040 return err 13041 } 13042 sv.EndTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) 13043 } 13044 13045 case "InputDataConfig": 13046 if err := awsAwsjson11_deserializeDocumentInputDataConfig(&sv.InputDataConfig, value); err != nil { 13047 return err 13048 } 13049 13050 case "JobId": 13051 if value != nil { 13052 jtv, ok := value.(string) 13053 if !ok { 13054 return fmt.Errorf("expected JobId to be of type string, got %T instead", value) 13055 } 13056 sv.JobId = ptr.String(jtv) 13057 } 13058 13059 case "JobName": 13060 if value != nil { 13061 jtv, ok := value.(string) 13062 if !ok { 13063 return fmt.Errorf("expected JobName to be of type string, got %T instead", value) 13064 } 13065 sv.JobName = ptr.String(jtv) 13066 } 13067 13068 case "JobStatus": 13069 if value != nil { 13070 jtv, ok := value.(string) 13071 if !ok { 13072 return fmt.Errorf("expected JobStatus to be of type string, got %T instead", value) 13073 } 13074 sv.JobStatus = types.JobStatus(jtv) 13075 } 13076 13077 case "Message": 13078 if value != nil { 13079 jtv, ok := value.(string) 13080 if !ok { 13081 return fmt.Errorf("expected AnyLengthString to be of type string, got %T instead", value) 13082 } 13083 sv.Message = ptr.String(jtv) 13084 } 13085 13086 case "NumberOfTopics": 13087 if value != nil { 13088 jtv, ok := value.(json.Number) 13089 if !ok { 13090 return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) 13091 } 13092 i64, err := jtv.Int64() 13093 if err != nil { 13094 return err 13095 } 13096 sv.NumberOfTopics = ptr.Int32(int32(i64)) 13097 } 13098 13099 case "OutputDataConfig": 13100 if err := awsAwsjson11_deserializeDocumentOutputDataConfig(&sv.OutputDataConfig, value); err != nil { 13101 return err 13102 } 13103 13104 case "SubmitTime": 13105 if value != nil { 13106 jtv, ok := value.(json.Number) 13107 if !ok { 13108 return fmt.Errorf("expected Timestamp to be json.Number, got %T instead", value) 13109 } 13110 f64, err := jtv.Float64() 13111 if err != nil { 13112 return err 13113 } 13114 sv.SubmitTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) 13115 } 13116 13117 case "VolumeKmsKeyId": 13118 if value != nil { 13119 jtv, ok := value.(string) 13120 if !ok { 13121 return fmt.Errorf("expected KmsKeyId to be of type string, got %T instead", value) 13122 } 13123 sv.VolumeKmsKeyId = ptr.String(jtv) 13124 } 13125 13126 case "VpcConfig": 13127 if err := awsAwsjson11_deserializeDocumentVpcConfig(&sv.VpcConfig, value); err != nil { 13128 return err 13129 } 13130 13131 default: 13132 _, _ = key, value 13133 13134 } 13135 } 13136 *v = sv 13137 return nil 13138} 13139 13140func awsAwsjson11_deserializeDocumentTopicsDetectionJobPropertiesList(v *[]types.TopicsDetectionJobProperties, value interface{}) error { 13141 if v == nil { 13142 return fmt.Errorf("unexpected nil of type %T", v) 13143 } 13144 if value == nil { 13145 return nil 13146 } 13147 13148 shape, ok := value.([]interface{}) 13149 if !ok { 13150 return fmt.Errorf("unexpected JSON type %v", value) 13151 } 13152 13153 var cv []types.TopicsDetectionJobProperties 13154 if *v == nil { 13155 cv = []types.TopicsDetectionJobProperties{} 13156 } else { 13157 cv = *v 13158 } 13159 13160 for _, value := range shape { 13161 var col types.TopicsDetectionJobProperties 13162 destAddr := &col 13163 if err := awsAwsjson11_deserializeDocumentTopicsDetectionJobProperties(&destAddr, value); err != nil { 13164 return err 13165 } 13166 col = *destAddr 13167 cv = append(cv, col) 13168 13169 } 13170 *v = cv 13171 return nil 13172} 13173 13174func awsAwsjson11_deserializeDocumentUnsupportedLanguageException(v **types.UnsupportedLanguageException, value interface{}) error { 13175 if v == nil { 13176 return fmt.Errorf("unexpected nil of type %T", v) 13177 } 13178 if value == nil { 13179 return nil 13180 } 13181 13182 shape, ok := value.(map[string]interface{}) 13183 if !ok { 13184 return fmt.Errorf("unexpected JSON type %v", value) 13185 } 13186 13187 var sv *types.UnsupportedLanguageException 13188 if *v == nil { 13189 sv = &types.UnsupportedLanguageException{} 13190 } else { 13191 sv = *v 13192 } 13193 13194 for key, value := range shape { 13195 switch key { 13196 case "Message": 13197 if value != nil { 13198 jtv, ok := value.(string) 13199 if !ok { 13200 return fmt.Errorf("expected String to be of type string, got %T instead", value) 13201 } 13202 sv.Message = ptr.String(jtv) 13203 } 13204 13205 default: 13206 _, _ = key, value 13207 13208 } 13209 } 13210 *v = sv 13211 return nil 13212} 13213 13214func awsAwsjson11_deserializeDocumentVpcConfig(v **types.VpcConfig, value interface{}) error { 13215 if v == nil { 13216 return fmt.Errorf("unexpected nil of type %T", v) 13217 } 13218 if value == nil { 13219 return nil 13220 } 13221 13222 shape, ok := value.(map[string]interface{}) 13223 if !ok { 13224 return fmt.Errorf("unexpected JSON type %v", value) 13225 } 13226 13227 var sv *types.VpcConfig 13228 if *v == nil { 13229 sv = &types.VpcConfig{} 13230 } else { 13231 sv = *v 13232 } 13233 13234 for key, value := range shape { 13235 switch key { 13236 case "SecurityGroupIds": 13237 if err := awsAwsjson11_deserializeDocumentSecurityGroupIds(&sv.SecurityGroupIds, value); err != nil { 13238 return err 13239 } 13240 13241 case "Subnets": 13242 if err := awsAwsjson11_deserializeDocumentSubnets(&sv.Subnets, value); err != nil { 13243 return err 13244 } 13245 13246 default: 13247 _, _ = key, value 13248 13249 } 13250 } 13251 *v = sv 13252 return nil 13253} 13254 13255func awsAwsjson11_deserializeOpDocumentBatchDetectDominantLanguageOutput(v **BatchDetectDominantLanguageOutput, value interface{}) error { 13256 if v == nil { 13257 return fmt.Errorf("unexpected nil of type %T", v) 13258 } 13259 if value == nil { 13260 return nil 13261 } 13262 13263 shape, ok := value.(map[string]interface{}) 13264 if !ok { 13265 return fmt.Errorf("unexpected JSON type %v", value) 13266 } 13267 13268 var sv *BatchDetectDominantLanguageOutput 13269 if *v == nil { 13270 sv = &BatchDetectDominantLanguageOutput{} 13271 } else { 13272 sv = *v 13273 } 13274 13275 for key, value := range shape { 13276 switch key { 13277 case "ErrorList": 13278 if err := awsAwsjson11_deserializeDocumentBatchItemErrorList(&sv.ErrorList, value); err != nil { 13279 return err 13280 } 13281 13282 case "ResultList": 13283 if err := awsAwsjson11_deserializeDocumentListOfDetectDominantLanguageResult(&sv.ResultList, value); err != nil { 13284 return err 13285 } 13286 13287 default: 13288 _, _ = key, value 13289 13290 } 13291 } 13292 *v = sv 13293 return nil 13294} 13295 13296func awsAwsjson11_deserializeOpDocumentBatchDetectEntitiesOutput(v **BatchDetectEntitiesOutput, value interface{}) error { 13297 if v == nil { 13298 return fmt.Errorf("unexpected nil of type %T", v) 13299 } 13300 if value == nil { 13301 return nil 13302 } 13303 13304 shape, ok := value.(map[string]interface{}) 13305 if !ok { 13306 return fmt.Errorf("unexpected JSON type %v", value) 13307 } 13308 13309 var sv *BatchDetectEntitiesOutput 13310 if *v == nil { 13311 sv = &BatchDetectEntitiesOutput{} 13312 } else { 13313 sv = *v 13314 } 13315 13316 for key, value := range shape { 13317 switch key { 13318 case "ErrorList": 13319 if err := awsAwsjson11_deserializeDocumentBatchItemErrorList(&sv.ErrorList, value); err != nil { 13320 return err 13321 } 13322 13323 case "ResultList": 13324 if err := awsAwsjson11_deserializeDocumentListOfDetectEntitiesResult(&sv.ResultList, value); err != nil { 13325 return err 13326 } 13327 13328 default: 13329 _, _ = key, value 13330 13331 } 13332 } 13333 *v = sv 13334 return nil 13335} 13336 13337func awsAwsjson11_deserializeOpDocumentBatchDetectKeyPhrasesOutput(v **BatchDetectKeyPhrasesOutput, value interface{}) error { 13338 if v == nil { 13339 return fmt.Errorf("unexpected nil of type %T", v) 13340 } 13341 if value == nil { 13342 return nil 13343 } 13344 13345 shape, ok := value.(map[string]interface{}) 13346 if !ok { 13347 return fmt.Errorf("unexpected JSON type %v", value) 13348 } 13349 13350 var sv *BatchDetectKeyPhrasesOutput 13351 if *v == nil { 13352 sv = &BatchDetectKeyPhrasesOutput{} 13353 } else { 13354 sv = *v 13355 } 13356 13357 for key, value := range shape { 13358 switch key { 13359 case "ErrorList": 13360 if err := awsAwsjson11_deserializeDocumentBatchItemErrorList(&sv.ErrorList, value); err != nil { 13361 return err 13362 } 13363 13364 case "ResultList": 13365 if err := awsAwsjson11_deserializeDocumentListOfDetectKeyPhrasesResult(&sv.ResultList, value); err != nil { 13366 return err 13367 } 13368 13369 default: 13370 _, _ = key, value 13371 13372 } 13373 } 13374 *v = sv 13375 return nil 13376} 13377 13378func awsAwsjson11_deserializeOpDocumentBatchDetectSentimentOutput(v **BatchDetectSentimentOutput, value interface{}) error { 13379 if v == nil { 13380 return fmt.Errorf("unexpected nil of type %T", v) 13381 } 13382 if value == nil { 13383 return nil 13384 } 13385 13386 shape, ok := value.(map[string]interface{}) 13387 if !ok { 13388 return fmt.Errorf("unexpected JSON type %v", value) 13389 } 13390 13391 var sv *BatchDetectSentimentOutput 13392 if *v == nil { 13393 sv = &BatchDetectSentimentOutput{} 13394 } else { 13395 sv = *v 13396 } 13397 13398 for key, value := range shape { 13399 switch key { 13400 case "ErrorList": 13401 if err := awsAwsjson11_deserializeDocumentBatchItemErrorList(&sv.ErrorList, value); err != nil { 13402 return err 13403 } 13404 13405 case "ResultList": 13406 if err := awsAwsjson11_deserializeDocumentListOfDetectSentimentResult(&sv.ResultList, value); err != nil { 13407 return err 13408 } 13409 13410 default: 13411 _, _ = key, value 13412 13413 } 13414 } 13415 *v = sv 13416 return nil 13417} 13418 13419func awsAwsjson11_deserializeOpDocumentBatchDetectSyntaxOutput(v **BatchDetectSyntaxOutput, value interface{}) error { 13420 if v == nil { 13421 return fmt.Errorf("unexpected nil of type %T", v) 13422 } 13423 if value == nil { 13424 return nil 13425 } 13426 13427 shape, ok := value.(map[string]interface{}) 13428 if !ok { 13429 return fmt.Errorf("unexpected JSON type %v", value) 13430 } 13431 13432 var sv *BatchDetectSyntaxOutput 13433 if *v == nil { 13434 sv = &BatchDetectSyntaxOutput{} 13435 } else { 13436 sv = *v 13437 } 13438 13439 for key, value := range shape { 13440 switch key { 13441 case "ErrorList": 13442 if err := awsAwsjson11_deserializeDocumentBatchItemErrorList(&sv.ErrorList, value); err != nil { 13443 return err 13444 } 13445 13446 case "ResultList": 13447 if err := awsAwsjson11_deserializeDocumentListOfDetectSyntaxResult(&sv.ResultList, value); err != nil { 13448 return err 13449 } 13450 13451 default: 13452 _, _ = key, value 13453 13454 } 13455 } 13456 *v = sv 13457 return nil 13458} 13459 13460func awsAwsjson11_deserializeOpDocumentClassifyDocumentOutput(v **ClassifyDocumentOutput, value interface{}) error { 13461 if v == nil { 13462 return fmt.Errorf("unexpected nil of type %T", v) 13463 } 13464 if value == nil { 13465 return nil 13466 } 13467 13468 shape, ok := value.(map[string]interface{}) 13469 if !ok { 13470 return fmt.Errorf("unexpected JSON type %v", value) 13471 } 13472 13473 var sv *ClassifyDocumentOutput 13474 if *v == nil { 13475 sv = &ClassifyDocumentOutput{} 13476 } else { 13477 sv = *v 13478 } 13479 13480 for key, value := range shape { 13481 switch key { 13482 case "Classes": 13483 if err := awsAwsjson11_deserializeDocumentListOfClasses(&sv.Classes, value); err != nil { 13484 return err 13485 } 13486 13487 case "Labels": 13488 if err := awsAwsjson11_deserializeDocumentListOfLabels(&sv.Labels, value); err != nil { 13489 return err 13490 } 13491 13492 default: 13493 _, _ = key, value 13494 13495 } 13496 } 13497 *v = sv 13498 return nil 13499} 13500 13501func awsAwsjson11_deserializeOpDocumentCreateDocumentClassifierOutput(v **CreateDocumentClassifierOutput, value interface{}) error { 13502 if v == nil { 13503 return fmt.Errorf("unexpected nil of type %T", v) 13504 } 13505 if value == nil { 13506 return nil 13507 } 13508 13509 shape, ok := value.(map[string]interface{}) 13510 if !ok { 13511 return fmt.Errorf("unexpected JSON type %v", value) 13512 } 13513 13514 var sv *CreateDocumentClassifierOutput 13515 if *v == nil { 13516 sv = &CreateDocumentClassifierOutput{} 13517 } else { 13518 sv = *v 13519 } 13520 13521 for key, value := range shape { 13522 switch key { 13523 case "DocumentClassifierArn": 13524 if value != nil { 13525 jtv, ok := value.(string) 13526 if !ok { 13527 return fmt.Errorf("expected DocumentClassifierArn to be of type string, got %T instead", value) 13528 } 13529 sv.DocumentClassifierArn = ptr.String(jtv) 13530 } 13531 13532 default: 13533 _, _ = key, value 13534 13535 } 13536 } 13537 *v = sv 13538 return nil 13539} 13540 13541func awsAwsjson11_deserializeOpDocumentCreateEndpointOutput(v **CreateEndpointOutput, value interface{}) error { 13542 if v == nil { 13543 return fmt.Errorf("unexpected nil of type %T", v) 13544 } 13545 if value == nil { 13546 return nil 13547 } 13548 13549 shape, ok := value.(map[string]interface{}) 13550 if !ok { 13551 return fmt.Errorf("unexpected JSON type %v", value) 13552 } 13553 13554 var sv *CreateEndpointOutput 13555 if *v == nil { 13556 sv = &CreateEndpointOutput{} 13557 } else { 13558 sv = *v 13559 } 13560 13561 for key, value := range shape { 13562 switch key { 13563 case "EndpointArn": 13564 if value != nil { 13565 jtv, ok := value.(string) 13566 if !ok { 13567 return fmt.Errorf("expected ComprehendEndpointArn to be of type string, got %T instead", value) 13568 } 13569 sv.EndpointArn = ptr.String(jtv) 13570 } 13571 13572 default: 13573 _, _ = key, value 13574 13575 } 13576 } 13577 *v = sv 13578 return nil 13579} 13580 13581func awsAwsjson11_deserializeOpDocumentCreateEntityRecognizerOutput(v **CreateEntityRecognizerOutput, value interface{}) error { 13582 if v == nil { 13583 return fmt.Errorf("unexpected nil of type %T", v) 13584 } 13585 if value == nil { 13586 return nil 13587 } 13588 13589 shape, ok := value.(map[string]interface{}) 13590 if !ok { 13591 return fmt.Errorf("unexpected JSON type %v", value) 13592 } 13593 13594 var sv *CreateEntityRecognizerOutput 13595 if *v == nil { 13596 sv = &CreateEntityRecognizerOutput{} 13597 } else { 13598 sv = *v 13599 } 13600 13601 for key, value := range shape { 13602 switch key { 13603 case "EntityRecognizerArn": 13604 if value != nil { 13605 jtv, ok := value.(string) 13606 if !ok { 13607 return fmt.Errorf("expected EntityRecognizerArn to be of type string, got %T instead", value) 13608 } 13609 sv.EntityRecognizerArn = ptr.String(jtv) 13610 } 13611 13612 default: 13613 _, _ = key, value 13614 13615 } 13616 } 13617 *v = sv 13618 return nil 13619} 13620 13621func awsAwsjson11_deserializeOpDocumentDeleteDocumentClassifierOutput(v **DeleteDocumentClassifierOutput, value interface{}) error { 13622 if v == nil { 13623 return fmt.Errorf("unexpected nil of type %T", v) 13624 } 13625 if value == nil { 13626 return nil 13627 } 13628 13629 shape, ok := value.(map[string]interface{}) 13630 if !ok { 13631 return fmt.Errorf("unexpected JSON type %v", value) 13632 } 13633 13634 var sv *DeleteDocumentClassifierOutput 13635 if *v == nil { 13636 sv = &DeleteDocumentClassifierOutput{} 13637 } else { 13638 sv = *v 13639 } 13640 13641 for key, value := range shape { 13642 switch key { 13643 default: 13644 _, _ = key, value 13645 13646 } 13647 } 13648 *v = sv 13649 return nil 13650} 13651 13652func awsAwsjson11_deserializeOpDocumentDeleteEndpointOutput(v **DeleteEndpointOutput, value interface{}) error { 13653 if v == nil { 13654 return fmt.Errorf("unexpected nil of type %T", v) 13655 } 13656 if value == nil { 13657 return nil 13658 } 13659 13660 shape, ok := value.(map[string]interface{}) 13661 if !ok { 13662 return fmt.Errorf("unexpected JSON type %v", value) 13663 } 13664 13665 var sv *DeleteEndpointOutput 13666 if *v == nil { 13667 sv = &DeleteEndpointOutput{} 13668 } else { 13669 sv = *v 13670 } 13671 13672 for key, value := range shape { 13673 switch key { 13674 default: 13675 _, _ = key, value 13676 13677 } 13678 } 13679 *v = sv 13680 return nil 13681} 13682 13683func awsAwsjson11_deserializeOpDocumentDeleteEntityRecognizerOutput(v **DeleteEntityRecognizerOutput, value interface{}) error { 13684 if v == nil { 13685 return fmt.Errorf("unexpected nil of type %T", v) 13686 } 13687 if value == nil { 13688 return nil 13689 } 13690 13691 shape, ok := value.(map[string]interface{}) 13692 if !ok { 13693 return fmt.Errorf("unexpected JSON type %v", value) 13694 } 13695 13696 var sv *DeleteEntityRecognizerOutput 13697 if *v == nil { 13698 sv = &DeleteEntityRecognizerOutput{} 13699 } else { 13700 sv = *v 13701 } 13702 13703 for key, value := range shape { 13704 switch key { 13705 default: 13706 _, _ = key, value 13707 13708 } 13709 } 13710 *v = sv 13711 return nil 13712} 13713 13714func awsAwsjson11_deserializeOpDocumentDescribeDocumentClassificationJobOutput(v **DescribeDocumentClassificationJobOutput, value interface{}) error { 13715 if v == nil { 13716 return fmt.Errorf("unexpected nil of type %T", v) 13717 } 13718 if value == nil { 13719 return nil 13720 } 13721 13722 shape, ok := value.(map[string]interface{}) 13723 if !ok { 13724 return fmt.Errorf("unexpected JSON type %v", value) 13725 } 13726 13727 var sv *DescribeDocumentClassificationJobOutput 13728 if *v == nil { 13729 sv = &DescribeDocumentClassificationJobOutput{} 13730 } else { 13731 sv = *v 13732 } 13733 13734 for key, value := range shape { 13735 switch key { 13736 case "DocumentClassificationJobProperties": 13737 if err := awsAwsjson11_deserializeDocumentDocumentClassificationJobProperties(&sv.DocumentClassificationJobProperties, value); err != nil { 13738 return err 13739 } 13740 13741 default: 13742 _, _ = key, value 13743 13744 } 13745 } 13746 *v = sv 13747 return nil 13748} 13749 13750func awsAwsjson11_deserializeOpDocumentDescribeDocumentClassifierOutput(v **DescribeDocumentClassifierOutput, value interface{}) error { 13751 if v == nil { 13752 return fmt.Errorf("unexpected nil of type %T", v) 13753 } 13754 if value == nil { 13755 return nil 13756 } 13757 13758 shape, ok := value.(map[string]interface{}) 13759 if !ok { 13760 return fmt.Errorf("unexpected JSON type %v", value) 13761 } 13762 13763 var sv *DescribeDocumentClassifierOutput 13764 if *v == nil { 13765 sv = &DescribeDocumentClassifierOutput{} 13766 } else { 13767 sv = *v 13768 } 13769 13770 for key, value := range shape { 13771 switch key { 13772 case "DocumentClassifierProperties": 13773 if err := awsAwsjson11_deserializeDocumentDocumentClassifierProperties(&sv.DocumentClassifierProperties, value); err != nil { 13774 return err 13775 } 13776 13777 default: 13778 _, _ = key, value 13779 13780 } 13781 } 13782 *v = sv 13783 return nil 13784} 13785 13786func awsAwsjson11_deserializeOpDocumentDescribeDominantLanguageDetectionJobOutput(v **DescribeDominantLanguageDetectionJobOutput, value interface{}) error { 13787 if v == nil { 13788 return fmt.Errorf("unexpected nil of type %T", v) 13789 } 13790 if value == nil { 13791 return nil 13792 } 13793 13794 shape, ok := value.(map[string]interface{}) 13795 if !ok { 13796 return fmt.Errorf("unexpected JSON type %v", value) 13797 } 13798 13799 var sv *DescribeDominantLanguageDetectionJobOutput 13800 if *v == nil { 13801 sv = &DescribeDominantLanguageDetectionJobOutput{} 13802 } else { 13803 sv = *v 13804 } 13805 13806 for key, value := range shape { 13807 switch key { 13808 case "DominantLanguageDetectionJobProperties": 13809 if err := awsAwsjson11_deserializeDocumentDominantLanguageDetectionJobProperties(&sv.DominantLanguageDetectionJobProperties, value); err != nil { 13810 return err 13811 } 13812 13813 default: 13814 _, _ = key, value 13815 13816 } 13817 } 13818 *v = sv 13819 return nil 13820} 13821 13822func awsAwsjson11_deserializeOpDocumentDescribeEndpointOutput(v **DescribeEndpointOutput, value interface{}) error { 13823 if v == nil { 13824 return fmt.Errorf("unexpected nil of type %T", v) 13825 } 13826 if value == nil { 13827 return nil 13828 } 13829 13830 shape, ok := value.(map[string]interface{}) 13831 if !ok { 13832 return fmt.Errorf("unexpected JSON type %v", value) 13833 } 13834 13835 var sv *DescribeEndpointOutput 13836 if *v == nil { 13837 sv = &DescribeEndpointOutput{} 13838 } else { 13839 sv = *v 13840 } 13841 13842 for key, value := range shape { 13843 switch key { 13844 case "EndpointProperties": 13845 if err := awsAwsjson11_deserializeDocumentEndpointProperties(&sv.EndpointProperties, value); err != nil { 13846 return err 13847 } 13848 13849 default: 13850 _, _ = key, value 13851 13852 } 13853 } 13854 *v = sv 13855 return nil 13856} 13857 13858func awsAwsjson11_deserializeOpDocumentDescribeEntitiesDetectionJobOutput(v **DescribeEntitiesDetectionJobOutput, value interface{}) error { 13859 if v == nil { 13860 return fmt.Errorf("unexpected nil of type %T", v) 13861 } 13862 if value == nil { 13863 return nil 13864 } 13865 13866 shape, ok := value.(map[string]interface{}) 13867 if !ok { 13868 return fmt.Errorf("unexpected JSON type %v", value) 13869 } 13870 13871 var sv *DescribeEntitiesDetectionJobOutput 13872 if *v == nil { 13873 sv = &DescribeEntitiesDetectionJobOutput{} 13874 } else { 13875 sv = *v 13876 } 13877 13878 for key, value := range shape { 13879 switch key { 13880 case "EntitiesDetectionJobProperties": 13881 if err := awsAwsjson11_deserializeDocumentEntitiesDetectionJobProperties(&sv.EntitiesDetectionJobProperties, value); err != nil { 13882 return err 13883 } 13884 13885 default: 13886 _, _ = key, value 13887 13888 } 13889 } 13890 *v = sv 13891 return nil 13892} 13893 13894func awsAwsjson11_deserializeOpDocumentDescribeEntityRecognizerOutput(v **DescribeEntityRecognizerOutput, value interface{}) error { 13895 if v == nil { 13896 return fmt.Errorf("unexpected nil of type %T", v) 13897 } 13898 if value == nil { 13899 return nil 13900 } 13901 13902 shape, ok := value.(map[string]interface{}) 13903 if !ok { 13904 return fmt.Errorf("unexpected JSON type %v", value) 13905 } 13906 13907 var sv *DescribeEntityRecognizerOutput 13908 if *v == nil { 13909 sv = &DescribeEntityRecognizerOutput{} 13910 } else { 13911 sv = *v 13912 } 13913 13914 for key, value := range shape { 13915 switch key { 13916 case "EntityRecognizerProperties": 13917 if err := awsAwsjson11_deserializeDocumentEntityRecognizerProperties(&sv.EntityRecognizerProperties, value); err != nil { 13918 return err 13919 } 13920 13921 default: 13922 _, _ = key, value 13923 13924 } 13925 } 13926 *v = sv 13927 return nil 13928} 13929 13930func awsAwsjson11_deserializeOpDocumentDescribeEventsDetectionJobOutput(v **DescribeEventsDetectionJobOutput, value interface{}) error { 13931 if v == nil { 13932 return fmt.Errorf("unexpected nil of type %T", v) 13933 } 13934 if value == nil { 13935 return nil 13936 } 13937 13938 shape, ok := value.(map[string]interface{}) 13939 if !ok { 13940 return fmt.Errorf("unexpected JSON type %v", value) 13941 } 13942 13943 var sv *DescribeEventsDetectionJobOutput 13944 if *v == nil { 13945 sv = &DescribeEventsDetectionJobOutput{} 13946 } else { 13947 sv = *v 13948 } 13949 13950 for key, value := range shape { 13951 switch key { 13952 case "EventsDetectionJobProperties": 13953 if err := awsAwsjson11_deserializeDocumentEventsDetectionJobProperties(&sv.EventsDetectionJobProperties, value); err != nil { 13954 return err 13955 } 13956 13957 default: 13958 _, _ = key, value 13959 13960 } 13961 } 13962 *v = sv 13963 return nil 13964} 13965 13966func awsAwsjson11_deserializeOpDocumentDescribeKeyPhrasesDetectionJobOutput(v **DescribeKeyPhrasesDetectionJobOutput, value interface{}) error { 13967 if v == nil { 13968 return fmt.Errorf("unexpected nil of type %T", v) 13969 } 13970 if value == nil { 13971 return nil 13972 } 13973 13974 shape, ok := value.(map[string]interface{}) 13975 if !ok { 13976 return fmt.Errorf("unexpected JSON type %v", value) 13977 } 13978 13979 var sv *DescribeKeyPhrasesDetectionJobOutput 13980 if *v == nil { 13981 sv = &DescribeKeyPhrasesDetectionJobOutput{} 13982 } else { 13983 sv = *v 13984 } 13985 13986 for key, value := range shape { 13987 switch key { 13988 case "KeyPhrasesDetectionJobProperties": 13989 if err := awsAwsjson11_deserializeDocumentKeyPhrasesDetectionJobProperties(&sv.KeyPhrasesDetectionJobProperties, value); err != nil { 13990 return err 13991 } 13992 13993 default: 13994 _, _ = key, value 13995 13996 } 13997 } 13998 *v = sv 13999 return nil 14000} 14001 14002func awsAwsjson11_deserializeOpDocumentDescribePiiEntitiesDetectionJobOutput(v **DescribePiiEntitiesDetectionJobOutput, value interface{}) error { 14003 if v == nil { 14004 return fmt.Errorf("unexpected nil of type %T", v) 14005 } 14006 if value == nil { 14007 return nil 14008 } 14009 14010 shape, ok := value.(map[string]interface{}) 14011 if !ok { 14012 return fmt.Errorf("unexpected JSON type %v", value) 14013 } 14014 14015 var sv *DescribePiiEntitiesDetectionJobOutput 14016 if *v == nil { 14017 sv = &DescribePiiEntitiesDetectionJobOutput{} 14018 } else { 14019 sv = *v 14020 } 14021 14022 for key, value := range shape { 14023 switch key { 14024 case "PiiEntitiesDetectionJobProperties": 14025 if err := awsAwsjson11_deserializeDocumentPiiEntitiesDetectionJobProperties(&sv.PiiEntitiesDetectionJobProperties, value); err != nil { 14026 return err 14027 } 14028 14029 default: 14030 _, _ = key, value 14031 14032 } 14033 } 14034 *v = sv 14035 return nil 14036} 14037 14038func awsAwsjson11_deserializeOpDocumentDescribeSentimentDetectionJobOutput(v **DescribeSentimentDetectionJobOutput, value interface{}) error { 14039 if v == nil { 14040 return fmt.Errorf("unexpected nil of type %T", v) 14041 } 14042 if value == nil { 14043 return nil 14044 } 14045 14046 shape, ok := value.(map[string]interface{}) 14047 if !ok { 14048 return fmt.Errorf("unexpected JSON type %v", value) 14049 } 14050 14051 var sv *DescribeSentimentDetectionJobOutput 14052 if *v == nil { 14053 sv = &DescribeSentimentDetectionJobOutput{} 14054 } else { 14055 sv = *v 14056 } 14057 14058 for key, value := range shape { 14059 switch key { 14060 case "SentimentDetectionJobProperties": 14061 if err := awsAwsjson11_deserializeDocumentSentimentDetectionJobProperties(&sv.SentimentDetectionJobProperties, value); err != nil { 14062 return err 14063 } 14064 14065 default: 14066 _, _ = key, value 14067 14068 } 14069 } 14070 *v = sv 14071 return nil 14072} 14073 14074func awsAwsjson11_deserializeOpDocumentDescribeTopicsDetectionJobOutput(v **DescribeTopicsDetectionJobOutput, value interface{}) error { 14075 if v == nil { 14076 return fmt.Errorf("unexpected nil of type %T", v) 14077 } 14078 if value == nil { 14079 return nil 14080 } 14081 14082 shape, ok := value.(map[string]interface{}) 14083 if !ok { 14084 return fmt.Errorf("unexpected JSON type %v", value) 14085 } 14086 14087 var sv *DescribeTopicsDetectionJobOutput 14088 if *v == nil { 14089 sv = &DescribeTopicsDetectionJobOutput{} 14090 } else { 14091 sv = *v 14092 } 14093 14094 for key, value := range shape { 14095 switch key { 14096 case "TopicsDetectionJobProperties": 14097 if err := awsAwsjson11_deserializeDocumentTopicsDetectionJobProperties(&sv.TopicsDetectionJobProperties, value); err != nil { 14098 return err 14099 } 14100 14101 default: 14102 _, _ = key, value 14103 14104 } 14105 } 14106 *v = sv 14107 return nil 14108} 14109 14110func awsAwsjson11_deserializeOpDocumentDetectDominantLanguageOutput(v **DetectDominantLanguageOutput, value interface{}) error { 14111 if v == nil { 14112 return fmt.Errorf("unexpected nil of type %T", v) 14113 } 14114 if value == nil { 14115 return nil 14116 } 14117 14118 shape, ok := value.(map[string]interface{}) 14119 if !ok { 14120 return fmt.Errorf("unexpected JSON type %v", value) 14121 } 14122 14123 var sv *DetectDominantLanguageOutput 14124 if *v == nil { 14125 sv = &DetectDominantLanguageOutput{} 14126 } else { 14127 sv = *v 14128 } 14129 14130 for key, value := range shape { 14131 switch key { 14132 case "Languages": 14133 if err := awsAwsjson11_deserializeDocumentListOfDominantLanguages(&sv.Languages, value); err != nil { 14134 return err 14135 } 14136 14137 default: 14138 _, _ = key, value 14139 14140 } 14141 } 14142 *v = sv 14143 return nil 14144} 14145 14146func awsAwsjson11_deserializeOpDocumentDetectEntitiesOutput(v **DetectEntitiesOutput, value interface{}) error { 14147 if v == nil { 14148 return fmt.Errorf("unexpected nil of type %T", v) 14149 } 14150 if value == nil { 14151 return nil 14152 } 14153 14154 shape, ok := value.(map[string]interface{}) 14155 if !ok { 14156 return fmt.Errorf("unexpected JSON type %v", value) 14157 } 14158 14159 var sv *DetectEntitiesOutput 14160 if *v == nil { 14161 sv = &DetectEntitiesOutput{} 14162 } else { 14163 sv = *v 14164 } 14165 14166 for key, value := range shape { 14167 switch key { 14168 case "Entities": 14169 if err := awsAwsjson11_deserializeDocumentListOfEntities(&sv.Entities, value); err != nil { 14170 return err 14171 } 14172 14173 default: 14174 _, _ = key, value 14175 14176 } 14177 } 14178 *v = sv 14179 return nil 14180} 14181 14182func awsAwsjson11_deserializeOpDocumentDetectKeyPhrasesOutput(v **DetectKeyPhrasesOutput, value interface{}) error { 14183 if v == nil { 14184 return fmt.Errorf("unexpected nil of type %T", v) 14185 } 14186 if value == nil { 14187 return nil 14188 } 14189 14190 shape, ok := value.(map[string]interface{}) 14191 if !ok { 14192 return fmt.Errorf("unexpected JSON type %v", value) 14193 } 14194 14195 var sv *DetectKeyPhrasesOutput 14196 if *v == nil { 14197 sv = &DetectKeyPhrasesOutput{} 14198 } else { 14199 sv = *v 14200 } 14201 14202 for key, value := range shape { 14203 switch key { 14204 case "KeyPhrases": 14205 if err := awsAwsjson11_deserializeDocumentListOfKeyPhrases(&sv.KeyPhrases, value); err != nil { 14206 return err 14207 } 14208 14209 default: 14210 _, _ = key, value 14211 14212 } 14213 } 14214 *v = sv 14215 return nil 14216} 14217 14218func awsAwsjson11_deserializeOpDocumentDetectPiiEntitiesOutput(v **DetectPiiEntitiesOutput, value interface{}) error { 14219 if v == nil { 14220 return fmt.Errorf("unexpected nil of type %T", v) 14221 } 14222 if value == nil { 14223 return nil 14224 } 14225 14226 shape, ok := value.(map[string]interface{}) 14227 if !ok { 14228 return fmt.Errorf("unexpected JSON type %v", value) 14229 } 14230 14231 var sv *DetectPiiEntitiesOutput 14232 if *v == nil { 14233 sv = &DetectPiiEntitiesOutput{} 14234 } else { 14235 sv = *v 14236 } 14237 14238 for key, value := range shape { 14239 switch key { 14240 case "Entities": 14241 if err := awsAwsjson11_deserializeDocumentListOfPiiEntities(&sv.Entities, value); err != nil { 14242 return err 14243 } 14244 14245 default: 14246 _, _ = key, value 14247 14248 } 14249 } 14250 *v = sv 14251 return nil 14252} 14253 14254func awsAwsjson11_deserializeOpDocumentDetectSentimentOutput(v **DetectSentimentOutput, value interface{}) error { 14255 if v == nil { 14256 return fmt.Errorf("unexpected nil of type %T", v) 14257 } 14258 if value == nil { 14259 return nil 14260 } 14261 14262 shape, ok := value.(map[string]interface{}) 14263 if !ok { 14264 return fmt.Errorf("unexpected JSON type %v", value) 14265 } 14266 14267 var sv *DetectSentimentOutput 14268 if *v == nil { 14269 sv = &DetectSentimentOutput{} 14270 } else { 14271 sv = *v 14272 } 14273 14274 for key, value := range shape { 14275 switch key { 14276 case "Sentiment": 14277 if value != nil { 14278 jtv, ok := value.(string) 14279 if !ok { 14280 return fmt.Errorf("expected SentimentType to be of type string, got %T instead", value) 14281 } 14282 sv.Sentiment = types.SentimentType(jtv) 14283 } 14284 14285 case "SentimentScore": 14286 if err := awsAwsjson11_deserializeDocumentSentimentScore(&sv.SentimentScore, value); err != nil { 14287 return err 14288 } 14289 14290 default: 14291 _, _ = key, value 14292 14293 } 14294 } 14295 *v = sv 14296 return nil 14297} 14298 14299func awsAwsjson11_deserializeOpDocumentDetectSyntaxOutput(v **DetectSyntaxOutput, value interface{}) error { 14300 if v == nil { 14301 return fmt.Errorf("unexpected nil of type %T", v) 14302 } 14303 if value == nil { 14304 return nil 14305 } 14306 14307 shape, ok := value.(map[string]interface{}) 14308 if !ok { 14309 return fmt.Errorf("unexpected JSON type %v", value) 14310 } 14311 14312 var sv *DetectSyntaxOutput 14313 if *v == nil { 14314 sv = &DetectSyntaxOutput{} 14315 } else { 14316 sv = *v 14317 } 14318 14319 for key, value := range shape { 14320 switch key { 14321 case "SyntaxTokens": 14322 if err := awsAwsjson11_deserializeDocumentListOfSyntaxTokens(&sv.SyntaxTokens, value); err != nil { 14323 return err 14324 } 14325 14326 default: 14327 _, _ = key, value 14328 14329 } 14330 } 14331 *v = sv 14332 return nil 14333} 14334 14335func awsAwsjson11_deserializeOpDocumentListDocumentClassificationJobsOutput(v **ListDocumentClassificationJobsOutput, value interface{}) error { 14336 if v == nil { 14337 return fmt.Errorf("unexpected nil of type %T", v) 14338 } 14339 if value == nil { 14340 return nil 14341 } 14342 14343 shape, ok := value.(map[string]interface{}) 14344 if !ok { 14345 return fmt.Errorf("unexpected JSON type %v", value) 14346 } 14347 14348 var sv *ListDocumentClassificationJobsOutput 14349 if *v == nil { 14350 sv = &ListDocumentClassificationJobsOutput{} 14351 } else { 14352 sv = *v 14353 } 14354 14355 for key, value := range shape { 14356 switch key { 14357 case "DocumentClassificationJobPropertiesList": 14358 if err := awsAwsjson11_deserializeDocumentDocumentClassificationJobPropertiesList(&sv.DocumentClassificationJobPropertiesList, value); err != nil { 14359 return err 14360 } 14361 14362 case "NextToken": 14363 if value != nil { 14364 jtv, ok := value.(string) 14365 if !ok { 14366 return fmt.Errorf("expected String to be of type string, got %T instead", value) 14367 } 14368 sv.NextToken = ptr.String(jtv) 14369 } 14370 14371 default: 14372 _, _ = key, value 14373 14374 } 14375 } 14376 *v = sv 14377 return nil 14378} 14379 14380func awsAwsjson11_deserializeOpDocumentListDocumentClassifiersOutput(v **ListDocumentClassifiersOutput, value interface{}) error { 14381 if v == nil { 14382 return fmt.Errorf("unexpected nil of type %T", v) 14383 } 14384 if value == nil { 14385 return nil 14386 } 14387 14388 shape, ok := value.(map[string]interface{}) 14389 if !ok { 14390 return fmt.Errorf("unexpected JSON type %v", value) 14391 } 14392 14393 var sv *ListDocumentClassifiersOutput 14394 if *v == nil { 14395 sv = &ListDocumentClassifiersOutput{} 14396 } else { 14397 sv = *v 14398 } 14399 14400 for key, value := range shape { 14401 switch key { 14402 case "DocumentClassifierPropertiesList": 14403 if err := awsAwsjson11_deserializeDocumentDocumentClassifierPropertiesList(&sv.DocumentClassifierPropertiesList, value); err != nil { 14404 return err 14405 } 14406 14407 case "NextToken": 14408 if value != nil { 14409 jtv, ok := value.(string) 14410 if !ok { 14411 return fmt.Errorf("expected String to be of type string, got %T instead", value) 14412 } 14413 sv.NextToken = ptr.String(jtv) 14414 } 14415 14416 default: 14417 _, _ = key, value 14418 14419 } 14420 } 14421 *v = sv 14422 return nil 14423} 14424 14425func awsAwsjson11_deserializeOpDocumentListDominantLanguageDetectionJobsOutput(v **ListDominantLanguageDetectionJobsOutput, value interface{}) error { 14426 if v == nil { 14427 return fmt.Errorf("unexpected nil of type %T", v) 14428 } 14429 if value == nil { 14430 return nil 14431 } 14432 14433 shape, ok := value.(map[string]interface{}) 14434 if !ok { 14435 return fmt.Errorf("unexpected JSON type %v", value) 14436 } 14437 14438 var sv *ListDominantLanguageDetectionJobsOutput 14439 if *v == nil { 14440 sv = &ListDominantLanguageDetectionJobsOutput{} 14441 } else { 14442 sv = *v 14443 } 14444 14445 for key, value := range shape { 14446 switch key { 14447 case "DominantLanguageDetectionJobPropertiesList": 14448 if err := awsAwsjson11_deserializeDocumentDominantLanguageDetectionJobPropertiesList(&sv.DominantLanguageDetectionJobPropertiesList, value); err != nil { 14449 return err 14450 } 14451 14452 case "NextToken": 14453 if value != nil { 14454 jtv, ok := value.(string) 14455 if !ok { 14456 return fmt.Errorf("expected String to be of type string, got %T instead", value) 14457 } 14458 sv.NextToken = ptr.String(jtv) 14459 } 14460 14461 default: 14462 _, _ = key, value 14463 14464 } 14465 } 14466 *v = sv 14467 return nil 14468} 14469 14470func awsAwsjson11_deserializeOpDocumentListEndpointsOutput(v **ListEndpointsOutput, value interface{}) error { 14471 if v == nil { 14472 return fmt.Errorf("unexpected nil of type %T", v) 14473 } 14474 if value == nil { 14475 return nil 14476 } 14477 14478 shape, ok := value.(map[string]interface{}) 14479 if !ok { 14480 return fmt.Errorf("unexpected JSON type %v", value) 14481 } 14482 14483 var sv *ListEndpointsOutput 14484 if *v == nil { 14485 sv = &ListEndpointsOutput{} 14486 } else { 14487 sv = *v 14488 } 14489 14490 for key, value := range shape { 14491 switch key { 14492 case "EndpointPropertiesList": 14493 if err := awsAwsjson11_deserializeDocumentEndpointPropertiesList(&sv.EndpointPropertiesList, value); err != nil { 14494 return err 14495 } 14496 14497 case "NextToken": 14498 if value != nil { 14499 jtv, ok := value.(string) 14500 if !ok { 14501 return fmt.Errorf("expected String to be of type string, got %T instead", value) 14502 } 14503 sv.NextToken = ptr.String(jtv) 14504 } 14505 14506 default: 14507 _, _ = key, value 14508 14509 } 14510 } 14511 *v = sv 14512 return nil 14513} 14514 14515func awsAwsjson11_deserializeOpDocumentListEntitiesDetectionJobsOutput(v **ListEntitiesDetectionJobsOutput, value interface{}) error { 14516 if v == nil { 14517 return fmt.Errorf("unexpected nil of type %T", v) 14518 } 14519 if value == nil { 14520 return nil 14521 } 14522 14523 shape, ok := value.(map[string]interface{}) 14524 if !ok { 14525 return fmt.Errorf("unexpected JSON type %v", value) 14526 } 14527 14528 var sv *ListEntitiesDetectionJobsOutput 14529 if *v == nil { 14530 sv = &ListEntitiesDetectionJobsOutput{} 14531 } else { 14532 sv = *v 14533 } 14534 14535 for key, value := range shape { 14536 switch key { 14537 case "EntitiesDetectionJobPropertiesList": 14538 if err := awsAwsjson11_deserializeDocumentEntitiesDetectionJobPropertiesList(&sv.EntitiesDetectionJobPropertiesList, value); err != nil { 14539 return err 14540 } 14541 14542 case "NextToken": 14543 if value != nil { 14544 jtv, ok := value.(string) 14545 if !ok { 14546 return fmt.Errorf("expected String to be of type string, got %T instead", value) 14547 } 14548 sv.NextToken = ptr.String(jtv) 14549 } 14550 14551 default: 14552 _, _ = key, value 14553 14554 } 14555 } 14556 *v = sv 14557 return nil 14558} 14559 14560func awsAwsjson11_deserializeOpDocumentListEntityRecognizersOutput(v **ListEntityRecognizersOutput, value interface{}) error { 14561 if v == nil { 14562 return fmt.Errorf("unexpected nil of type %T", v) 14563 } 14564 if value == nil { 14565 return nil 14566 } 14567 14568 shape, ok := value.(map[string]interface{}) 14569 if !ok { 14570 return fmt.Errorf("unexpected JSON type %v", value) 14571 } 14572 14573 var sv *ListEntityRecognizersOutput 14574 if *v == nil { 14575 sv = &ListEntityRecognizersOutput{} 14576 } else { 14577 sv = *v 14578 } 14579 14580 for key, value := range shape { 14581 switch key { 14582 case "EntityRecognizerPropertiesList": 14583 if err := awsAwsjson11_deserializeDocumentEntityRecognizerPropertiesList(&sv.EntityRecognizerPropertiesList, value); err != nil { 14584 return err 14585 } 14586 14587 case "NextToken": 14588 if value != nil { 14589 jtv, ok := value.(string) 14590 if !ok { 14591 return fmt.Errorf("expected String to be of type string, got %T instead", value) 14592 } 14593 sv.NextToken = ptr.String(jtv) 14594 } 14595 14596 default: 14597 _, _ = key, value 14598 14599 } 14600 } 14601 *v = sv 14602 return nil 14603} 14604 14605func awsAwsjson11_deserializeOpDocumentListEventsDetectionJobsOutput(v **ListEventsDetectionJobsOutput, value interface{}) error { 14606 if v == nil { 14607 return fmt.Errorf("unexpected nil of type %T", v) 14608 } 14609 if value == nil { 14610 return nil 14611 } 14612 14613 shape, ok := value.(map[string]interface{}) 14614 if !ok { 14615 return fmt.Errorf("unexpected JSON type %v", value) 14616 } 14617 14618 var sv *ListEventsDetectionJobsOutput 14619 if *v == nil { 14620 sv = &ListEventsDetectionJobsOutput{} 14621 } else { 14622 sv = *v 14623 } 14624 14625 for key, value := range shape { 14626 switch key { 14627 case "EventsDetectionJobPropertiesList": 14628 if err := awsAwsjson11_deserializeDocumentEventsDetectionJobPropertiesList(&sv.EventsDetectionJobPropertiesList, value); err != nil { 14629 return err 14630 } 14631 14632 case "NextToken": 14633 if value != nil { 14634 jtv, ok := value.(string) 14635 if !ok { 14636 return fmt.Errorf("expected String to be of type string, got %T instead", value) 14637 } 14638 sv.NextToken = ptr.String(jtv) 14639 } 14640 14641 default: 14642 _, _ = key, value 14643 14644 } 14645 } 14646 *v = sv 14647 return nil 14648} 14649 14650func awsAwsjson11_deserializeOpDocumentListKeyPhrasesDetectionJobsOutput(v **ListKeyPhrasesDetectionJobsOutput, value interface{}) error { 14651 if v == nil { 14652 return fmt.Errorf("unexpected nil of type %T", v) 14653 } 14654 if value == nil { 14655 return nil 14656 } 14657 14658 shape, ok := value.(map[string]interface{}) 14659 if !ok { 14660 return fmt.Errorf("unexpected JSON type %v", value) 14661 } 14662 14663 var sv *ListKeyPhrasesDetectionJobsOutput 14664 if *v == nil { 14665 sv = &ListKeyPhrasesDetectionJobsOutput{} 14666 } else { 14667 sv = *v 14668 } 14669 14670 for key, value := range shape { 14671 switch key { 14672 case "KeyPhrasesDetectionJobPropertiesList": 14673 if err := awsAwsjson11_deserializeDocumentKeyPhrasesDetectionJobPropertiesList(&sv.KeyPhrasesDetectionJobPropertiesList, value); err != nil { 14674 return err 14675 } 14676 14677 case "NextToken": 14678 if value != nil { 14679 jtv, ok := value.(string) 14680 if !ok { 14681 return fmt.Errorf("expected String to be of type string, got %T instead", value) 14682 } 14683 sv.NextToken = ptr.String(jtv) 14684 } 14685 14686 default: 14687 _, _ = key, value 14688 14689 } 14690 } 14691 *v = sv 14692 return nil 14693} 14694 14695func awsAwsjson11_deserializeOpDocumentListPiiEntitiesDetectionJobsOutput(v **ListPiiEntitiesDetectionJobsOutput, value interface{}) error { 14696 if v == nil { 14697 return fmt.Errorf("unexpected nil of type %T", v) 14698 } 14699 if value == nil { 14700 return nil 14701 } 14702 14703 shape, ok := value.(map[string]interface{}) 14704 if !ok { 14705 return fmt.Errorf("unexpected JSON type %v", value) 14706 } 14707 14708 var sv *ListPiiEntitiesDetectionJobsOutput 14709 if *v == nil { 14710 sv = &ListPiiEntitiesDetectionJobsOutput{} 14711 } else { 14712 sv = *v 14713 } 14714 14715 for key, value := range shape { 14716 switch key { 14717 case "NextToken": 14718 if value != nil { 14719 jtv, ok := value.(string) 14720 if !ok { 14721 return fmt.Errorf("expected String to be of type string, got %T instead", value) 14722 } 14723 sv.NextToken = ptr.String(jtv) 14724 } 14725 14726 case "PiiEntitiesDetectionJobPropertiesList": 14727 if err := awsAwsjson11_deserializeDocumentPiiEntitiesDetectionJobPropertiesList(&sv.PiiEntitiesDetectionJobPropertiesList, value); err != nil { 14728 return err 14729 } 14730 14731 default: 14732 _, _ = key, value 14733 14734 } 14735 } 14736 *v = sv 14737 return nil 14738} 14739 14740func awsAwsjson11_deserializeOpDocumentListSentimentDetectionJobsOutput(v **ListSentimentDetectionJobsOutput, value interface{}) error { 14741 if v == nil { 14742 return fmt.Errorf("unexpected nil of type %T", v) 14743 } 14744 if value == nil { 14745 return nil 14746 } 14747 14748 shape, ok := value.(map[string]interface{}) 14749 if !ok { 14750 return fmt.Errorf("unexpected JSON type %v", value) 14751 } 14752 14753 var sv *ListSentimentDetectionJobsOutput 14754 if *v == nil { 14755 sv = &ListSentimentDetectionJobsOutput{} 14756 } else { 14757 sv = *v 14758 } 14759 14760 for key, value := range shape { 14761 switch key { 14762 case "NextToken": 14763 if value != nil { 14764 jtv, ok := value.(string) 14765 if !ok { 14766 return fmt.Errorf("expected String to be of type string, got %T instead", value) 14767 } 14768 sv.NextToken = ptr.String(jtv) 14769 } 14770 14771 case "SentimentDetectionJobPropertiesList": 14772 if err := awsAwsjson11_deserializeDocumentSentimentDetectionJobPropertiesList(&sv.SentimentDetectionJobPropertiesList, value); err != nil { 14773 return err 14774 } 14775 14776 default: 14777 _, _ = key, value 14778 14779 } 14780 } 14781 *v = sv 14782 return nil 14783} 14784 14785func awsAwsjson11_deserializeOpDocumentListTagsForResourceOutput(v **ListTagsForResourceOutput, value interface{}) error { 14786 if v == nil { 14787 return fmt.Errorf("unexpected nil of type %T", v) 14788 } 14789 if value == nil { 14790 return nil 14791 } 14792 14793 shape, ok := value.(map[string]interface{}) 14794 if !ok { 14795 return fmt.Errorf("unexpected JSON type %v", value) 14796 } 14797 14798 var sv *ListTagsForResourceOutput 14799 if *v == nil { 14800 sv = &ListTagsForResourceOutput{} 14801 } else { 14802 sv = *v 14803 } 14804 14805 for key, value := range shape { 14806 switch key { 14807 case "ResourceArn": 14808 if value != nil { 14809 jtv, ok := value.(string) 14810 if !ok { 14811 return fmt.Errorf("expected ComprehendArn to be of type string, got %T instead", value) 14812 } 14813 sv.ResourceArn = ptr.String(jtv) 14814 } 14815 14816 case "Tags": 14817 if err := awsAwsjson11_deserializeDocumentTagList(&sv.Tags, value); err != nil { 14818 return err 14819 } 14820 14821 default: 14822 _, _ = key, value 14823 14824 } 14825 } 14826 *v = sv 14827 return nil 14828} 14829 14830func awsAwsjson11_deserializeOpDocumentListTopicsDetectionJobsOutput(v **ListTopicsDetectionJobsOutput, value interface{}) error { 14831 if v == nil { 14832 return fmt.Errorf("unexpected nil of type %T", v) 14833 } 14834 if value == nil { 14835 return nil 14836 } 14837 14838 shape, ok := value.(map[string]interface{}) 14839 if !ok { 14840 return fmt.Errorf("unexpected JSON type %v", value) 14841 } 14842 14843 var sv *ListTopicsDetectionJobsOutput 14844 if *v == nil { 14845 sv = &ListTopicsDetectionJobsOutput{} 14846 } else { 14847 sv = *v 14848 } 14849 14850 for key, value := range shape { 14851 switch key { 14852 case "NextToken": 14853 if value != nil { 14854 jtv, ok := value.(string) 14855 if !ok { 14856 return fmt.Errorf("expected String to be of type string, got %T instead", value) 14857 } 14858 sv.NextToken = ptr.String(jtv) 14859 } 14860 14861 case "TopicsDetectionJobPropertiesList": 14862 if err := awsAwsjson11_deserializeDocumentTopicsDetectionJobPropertiesList(&sv.TopicsDetectionJobPropertiesList, value); err != nil { 14863 return err 14864 } 14865 14866 default: 14867 _, _ = key, value 14868 14869 } 14870 } 14871 *v = sv 14872 return nil 14873} 14874 14875func awsAwsjson11_deserializeOpDocumentStartDocumentClassificationJobOutput(v **StartDocumentClassificationJobOutput, value interface{}) error { 14876 if v == nil { 14877 return fmt.Errorf("unexpected nil of type %T", v) 14878 } 14879 if value == nil { 14880 return nil 14881 } 14882 14883 shape, ok := value.(map[string]interface{}) 14884 if !ok { 14885 return fmt.Errorf("unexpected JSON type %v", value) 14886 } 14887 14888 var sv *StartDocumentClassificationJobOutput 14889 if *v == nil { 14890 sv = &StartDocumentClassificationJobOutput{} 14891 } else { 14892 sv = *v 14893 } 14894 14895 for key, value := range shape { 14896 switch key { 14897 case "JobId": 14898 if value != nil { 14899 jtv, ok := value.(string) 14900 if !ok { 14901 return fmt.Errorf("expected JobId to be of type string, got %T instead", value) 14902 } 14903 sv.JobId = ptr.String(jtv) 14904 } 14905 14906 case "JobStatus": 14907 if value != nil { 14908 jtv, ok := value.(string) 14909 if !ok { 14910 return fmt.Errorf("expected JobStatus to be of type string, got %T instead", value) 14911 } 14912 sv.JobStatus = types.JobStatus(jtv) 14913 } 14914 14915 default: 14916 _, _ = key, value 14917 14918 } 14919 } 14920 *v = sv 14921 return nil 14922} 14923 14924func awsAwsjson11_deserializeOpDocumentStartDominantLanguageDetectionJobOutput(v **StartDominantLanguageDetectionJobOutput, value interface{}) error { 14925 if v == nil { 14926 return fmt.Errorf("unexpected nil of type %T", v) 14927 } 14928 if value == nil { 14929 return nil 14930 } 14931 14932 shape, ok := value.(map[string]interface{}) 14933 if !ok { 14934 return fmt.Errorf("unexpected JSON type %v", value) 14935 } 14936 14937 var sv *StartDominantLanguageDetectionJobOutput 14938 if *v == nil { 14939 sv = &StartDominantLanguageDetectionJobOutput{} 14940 } else { 14941 sv = *v 14942 } 14943 14944 for key, value := range shape { 14945 switch key { 14946 case "JobId": 14947 if value != nil { 14948 jtv, ok := value.(string) 14949 if !ok { 14950 return fmt.Errorf("expected JobId to be of type string, got %T instead", value) 14951 } 14952 sv.JobId = ptr.String(jtv) 14953 } 14954 14955 case "JobStatus": 14956 if value != nil { 14957 jtv, ok := value.(string) 14958 if !ok { 14959 return fmt.Errorf("expected JobStatus to be of type string, got %T instead", value) 14960 } 14961 sv.JobStatus = types.JobStatus(jtv) 14962 } 14963 14964 default: 14965 _, _ = key, value 14966 14967 } 14968 } 14969 *v = sv 14970 return nil 14971} 14972 14973func awsAwsjson11_deserializeOpDocumentStartEntitiesDetectionJobOutput(v **StartEntitiesDetectionJobOutput, value interface{}) error { 14974 if v == nil { 14975 return fmt.Errorf("unexpected nil of type %T", v) 14976 } 14977 if value == nil { 14978 return nil 14979 } 14980 14981 shape, ok := value.(map[string]interface{}) 14982 if !ok { 14983 return fmt.Errorf("unexpected JSON type %v", value) 14984 } 14985 14986 var sv *StartEntitiesDetectionJobOutput 14987 if *v == nil { 14988 sv = &StartEntitiesDetectionJobOutput{} 14989 } else { 14990 sv = *v 14991 } 14992 14993 for key, value := range shape { 14994 switch key { 14995 case "JobId": 14996 if value != nil { 14997 jtv, ok := value.(string) 14998 if !ok { 14999 return fmt.Errorf("expected JobId to be of type string, got %T instead", value) 15000 } 15001 sv.JobId = ptr.String(jtv) 15002 } 15003 15004 case "JobStatus": 15005 if value != nil { 15006 jtv, ok := value.(string) 15007 if !ok { 15008 return fmt.Errorf("expected JobStatus to be of type string, got %T instead", value) 15009 } 15010 sv.JobStatus = types.JobStatus(jtv) 15011 } 15012 15013 default: 15014 _, _ = key, value 15015 15016 } 15017 } 15018 *v = sv 15019 return nil 15020} 15021 15022func awsAwsjson11_deserializeOpDocumentStartEventsDetectionJobOutput(v **StartEventsDetectionJobOutput, value interface{}) error { 15023 if v == nil { 15024 return fmt.Errorf("unexpected nil of type %T", v) 15025 } 15026 if value == nil { 15027 return nil 15028 } 15029 15030 shape, ok := value.(map[string]interface{}) 15031 if !ok { 15032 return fmt.Errorf("unexpected JSON type %v", value) 15033 } 15034 15035 var sv *StartEventsDetectionJobOutput 15036 if *v == nil { 15037 sv = &StartEventsDetectionJobOutput{} 15038 } else { 15039 sv = *v 15040 } 15041 15042 for key, value := range shape { 15043 switch key { 15044 case "JobId": 15045 if value != nil { 15046 jtv, ok := value.(string) 15047 if !ok { 15048 return fmt.Errorf("expected JobId to be of type string, got %T instead", value) 15049 } 15050 sv.JobId = ptr.String(jtv) 15051 } 15052 15053 case "JobStatus": 15054 if value != nil { 15055 jtv, ok := value.(string) 15056 if !ok { 15057 return fmt.Errorf("expected JobStatus to be of type string, got %T instead", value) 15058 } 15059 sv.JobStatus = types.JobStatus(jtv) 15060 } 15061 15062 default: 15063 _, _ = key, value 15064 15065 } 15066 } 15067 *v = sv 15068 return nil 15069} 15070 15071func awsAwsjson11_deserializeOpDocumentStartKeyPhrasesDetectionJobOutput(v **StartKeyPhrasesDetectionJobOutput, value interface{}) error { 15072 if v == nil { 15073 return fmt.Errorf("unexpected nil of type %T", v) 15074 } 15075 if value == nil { 15076 return nil 15077 } 15078 15079 shape, ok := value.(map[string]interface{}) 15080 if !ok { 15081 return fmt.Errorf("unexpected JSON type %v", value) 15082 } 15083 15084 var sv *StartKeyPhrasesDetectionJobOutput 15085 if *v == nil { 15086 sv = &StartKeyPhrasesDetectionJobOutput{} 15087 } else { 15088 sv = *v 15089 } 15090 15091 for key, value := range shape { 15092 switch key { 15093 case "JobId": 15094 if value != nil { 15095 jtv, ok := value.(string) 15096 if !ok { 15097 return fmt.Errorf("expected JobId to be of type string, got %T instead", value) 15098 } 15099 sv.JobId = ptr.String(jtv) 15100 } 15101 15102 case "JobStatus": 15103 if value != nil { 15104 jtv, ok := value.(string) 15105 if !ok { 15106 return fmt.Errorf("expected JobStatus to be of type string, got %T instead", value) 15107 } 15108 sv.JobStatus = types.JobStatus(jtv) 15109 } 15110 15111 default: 15112 _, _ = key, value 15113 15114 } 15115 } 15116 *v = sv 15117 return nil 15118} 15119 15120func awsAwsjson11_deserializeOpDocumentStartPiiEntitiesDetectionJobOutput(v **StartPiiEntitiesDetectionJobOutput, value interface{}) error { 15121 if v == nil { 15122 return fmt.Errorf("unexpected nil of type %T", v) 15123 } 15124 if value == nil { 15125 return nil 15126 } 15127 15128 shape, ok := value.(map[string]interface{}) 15129 if !ok { 15130 return fmt.Errorf("unexpected JSON type %v", value) 15131 } 15132 15133 var sv *StartPiiEntitiesDetectionJobOutput 15134 if *v == nil { 15135 sv = &StartPiiEntitiesDetectionJobOutput{} 15136 } else { 15137 sv = *v 15138 } 15139 15140 for key, value := range shape { 15141 switch key { 15142 case "JobId": 15143 if value != nil { 15144 jtv, ok := value.(string) 15145 if !ok { 15146 return fmt.Errorf("expected JobId to be of type string, got %T instead", value) 15147 } 15148 sv.JobId = ptr.String(jtv) 15149 } 15150 15151 case "JobStatus": 15152 if value != nil { 15153 jtv, ok := value.(string) 15154 if !ok { 15155 return fmt.Errorf("expected JobStatus to be of type string, got %T instead", value) 15156 } 15157 sv.JobStatus = types.JobStatus(jtv) 15158 } 15159 15160 default: 15161 _, _ = key, value 15162 15163 } 15164 } 15165 *v = sv 15166 return nil 15167} 15168 15169func awsAwsjson11_deserializeOpDocumentStartSentimentDetectionJobOutput(v **StartSentimentDetectionJobOutput, value interface{}) error { 15170 if v == nil { 15171 return fmt.Errorf("unexpected nil of type %T", v) 15172 } 15173 if value == nil { 15174 return nil 15175 } 15176 15177 shape, ok := value.(map[string]interface{}) 15178 if !ok { 15179 return fmt.Errorf("unexpected JSON type %v", value) 15180 } 15181 15182 var sv *StartSentimentDetectionJobOutput 15183 if *v == nil { 15184 sv = &StartSentimentDetectionJobOutput{} 15185 } else { 15186 sv = *v 15187 } 15188 15189 for key, value := range shape { 15190 switch key { 15191 case "JobId": 15192 if value != nil { 15193 jtv, ok := value.(string) 15194 if !ok { 15195 return fmt.Errorf("expected JobId to be of type string, got %T instead", value) 15196 } 15197 sv.JobId = ptr.String(jtv) 15198 } 15199 15200 case "JobStatus": 15201 if value != nil { 15202 jtv, ok := value.(string) 15203 if !ok { 15204 return fmt.Errorf("expected JobStatus to be of type string, got %T instead", value) 15205 } 15206 sv.JobStatus = types.JobStatus(jtv) 15207 } 15208 15209 default: 15210 _, _ = key, value 15211 15212 } 15213 } 15214 *v = sv 15215 return nil 15216} 15217 15218func awsAwsjson11_deserializeOpDocumentStartTopicsDetectionJobOutput(v **StartTopicsDetectionJobOutput, value interface{}) error { 15219 if v == nil { 15220 return fmt.Errorf("unexpected nil of type %T", v) 15221 } 15222 if value == nil { 15223 return nil 15224 } 15225 15226 shape, ok := value.(map[string]interface{}) 15227 if !ok { 15228 return fmt.Errorf("unexpected JSON type %v", value) 15229 } 15230 15231 var sv *StartTopicsDetectionJobOutput 15232 if *v == nil { 15233 sv = &StartTopicsDetectionJobOutput{} 15234 } else { 15235 sv = *v 15236 } 15237 15238 for key, value := range shape { 15239 switch key { 15240 case "JobId": 15241 if value != nil { 15242 jtv, ok := value.(string) 15243 if !ok { 15244 return fmt.Errorf("expected JobId to be of type string, got %T instead", value) 15245 } 15246 sv.JobId = ptr.String(jtv) 15247 } 15248 15249 case "JobStatus": 15250 if value != nil { 15251 jtv, ok := value.(string) 15252 if !ok { 15253 return fmt.Errorf("expected JobStatus to be of type string, got %T instead", value) 15254 } 15255 sv.JobStatus = types.JobStatus(jtv) 15256 } 15257 15258 default: 15259 _, _ = key, value 15260 15261 } 15262 } 15263 *v = sv 15264 return nil 15265} 15266 15267func awsAwsjson11_deserializeOpDocumentStopDominantLanguageDetectionJobOutput(v **StopDominantLanguageDetectionJobOutput, value interface{}) error { 15268 if v == nil { 15269 return fmt.Errorf("unexpected nil of type %T", v) 15270 } 15271 if value == nil { 15272 return nil 15273 } 15274 15275 shape, ok := value.(map[string]interface{}) 15276 if !ok { 15277 return fmt.Errorf("unexpected JSON type %v", value) 15278 } 15279 15280 var sv *StopDominantLanguageDetectionJobOutput 15281 if *v == nil { 15282 sv = &StopDominantLanguageDetectionJobOutput{} 15283 } else { 15284 sv = *v 15285 } 15286 15287 for key, value := range shape { 15288 switch key { 15289 case "JobId": 15290 if value != nil { 15291 jtv, ok := value.(string) 15292 if !ok { 15293 return fmt.Errorf("expected JobId to be of type string, got %T instead", value) 15294 } 15295 sv.JobId = ptr.String(jtv) 15296 } 15297 15298 case "JobStatus": 15299 if value != nil { 15300 jtv, ok := value.(string) 15301 if !ok { 15302 return fmt.Errorf("expected JobStatus to be of type string, got %T instead", value) 15303 } 15304 sv.JobStatus = types.JobStatus(jtv) 15305 } 15306 15307 default: 15308 _, _ = key, value 15309 15310 } 15311 } 15312 *v = sv 15313 return nil 15314} 15315 15316func awsAwsjson11_deserializeOpDocumentStopEntitiesDetectionJobOutput(v **StopEntitiesDetectionJobOutput, value interface{}) error { 15317 if v == nil { 15318 return fmt.Errorf("unexpected nil of type %T", v) 15319 } 15320 if value == nil { 15321 return nil 15322 } 15323 15324 shape, ok := value.(map[string]interface{}) 15325 if !ok { 15326 return fmt.Errorf("unexpected JSON type %v", value) 15327 } 15328 15329 var sv *StopEntitiesDetectionJobOutput 15330 if *v == nil { 15331 sv = &StopEntitiesDetectionJobOutput{} 15332 } else { 15333 sv = *v 15334 } 15335 15336 for key, value := range shape { 15337 switch key { 15338 case "JobId": 15339 if value != nil { 15340 jtv, ok := value.(string) 15341 if !ok { 15342 return fmt.Errorf("expected JobId to be of type string, got %T instead", value) 15343 } 15344 sv.JobId = ptr.String(jtv) 15345 } 15346 15347 case "JobStatus": 15348 if value != nil { 15349 jtv, ok := value.(string) 15350 if !ok { 15351 return fmt.Errorf("expected JobStatus to be of type string, got %T instead", value) 15352 } 15353 sv.JobStatus = types.JobStatus(jtv) 15354 } 15355 15356 default: 15357 _, _ = key, value 15358 15359 } 15360 } 15361 *v = sv 15362 return nil 15363} 15364 15365func awsAwsjson11_deserializeOpDocumentStopEventsDetectionJobOutput(v **StopEventsDetectionJobOutput, value interface{}) error { 15366 if v == nil { 15367 return fmt.Errorf("unexpected nil of type %T", v) 15368 } 15369 if value == nil { 15370 return nil 15371 } 15372 15373 shape, ok := value.(map[string]interface{}) 15374 if !ok { 15375 return fmt.Errorf("unexpected JSON type %v", value) 15376 } 15377 15378 var sv *StopEventsDetectionJobOutput 15379 if *v == nil { 15380 sv = &StopEventsDetectionJobOutput{} 15381 } else { 15382 sv = *v 15383 } 15384 15385 for key, value := range shape { 15386 switch key { 15387 case "JobId": 15388 if value != nil { 15389 jtv, ok := value.(string) 15390 if !ok { 15391 return fmt.Errorf("expected JobId to be of type string, got %T instead", value) 15392 } 15393 sv.JobId = ptr.String(jtv) 15394 } 15395 15396 case "JobStatus": 15397 if value != nil { 15398 jtv, ok := value.(string) 15399 if !ok { 15400 return fmt.Errorf("expected JobStatus to be of type string, got %T instead", value) 15401 } 15402 sv.JobStatus = types.JobStatus(jtv) 15403 } 15404 15405 default: 15406 _, _ = key, value 15407 15408 } 15409 } 15410 *v = sv 15411 return nil 15412} 15413 15414func awsAwsjson11_deserializeOpDocumentStopKeyPhrasesDetectionJobOutput(v **StopKeyPhrasesDetectionJobOutput, value interface{}) error { 15415 if v == nil { 15416 return fmt.Errorf("unexpected nil of type %T", v) 15417 } 15418 if value == nil { 15419 return nil 15420 } 15421 15422 shape, ok := value.(map[string]interface{}) 15423 if !ok { 15424 return fmt.Errorf("unexpected JSON type %v", value) 15425 } 15426 15427 var sv *StopKeyPhrasesDetectionJobOutput 15428 if *v == nil { 15429 sv = &StopKeyPhrasesDetectionJobOutput{} 15430 } else { 15431 sv = *v 15432 } 15433 15434 for key, value := range shape { 15435 switch key { 15436 case "JobId": 15437 if value != nil { 15438 jtv, ok := value.(string) 15439 if !ok { 15440 return fmt.Errorf("expected JobId to be of type string, got %T instead", value) 15441 } 15442 sv.JobId = ptr.String(jtv) 15443 } 15444 15445 case "JobStatus": 15446 if value != nil { 15447 jtv, ok := value.(string) 15448 if !ok { 15449 return fmt.Errorf("expected JobStatus to be of type string, got %T instead", value) 15450 } 15451 sv.JobStatus = types.JobStatus(jtv) 15452 } 15453 15454 default: 15455 _, _ = key, value 15456 15457 } 15458 } 15459 *v = sv 15460 return nil 15461} 15462 15463func awsAwsjson11_deserializeOpDocumentStopPiiEntitiesDetectionJobOutput(v **StopPiiEntitiesDetectionJobOutput, value interface{}) error { 15464 if v == nil { 15465 return fmt.Errorf("unexpected nil of type %T", v) 15466 } 15467 if value == nil { 15468 return nil 15469 } 15470 15471 shape, ok := value.(map[string]interface{}) 15472 if !ok { 15473 return fmt.Errorf("unexpected JSON type %v", value) 15474 } 15475 15476 var sv *StopPiiEntitiesDetectionJobOutput 15477 if *v == nil { 15478 sv = &StopPiiEntitiesDetectionJobOutput{} 15479 } else { 15480 sv = *v 15481 } 15482 15483 for key, value := range shape { 15484 switch key { 15485 case "JobId": 15486 if value != nil { 15487 jtv, ok := value.(string) 15488 if !ok { 15489 return fmt.Errorf("expected JobId to be of type string, got %T instead", value) 15490 } 15491 sv.JobId = ptr.String(jtv) 15492 } 15493 15494 case "JobStatus": 15495 if value != nil { 15496 jtv, ok := value.(string) 15497 if !ok { 15498 return fmt.Errorf("expected JobStatus to be of type string, got %T instead", value) 15499 } 15500 sv.JobStatus = types.JobStatus(jtv) 15501 } 15502 15503 default: 15504 _, _ = key, value 15505 15506 } 15507 } 15508 *v = sv 15509 return nil 15510} 15511 15512func awsAwsjson11_deserializeOpDocumentStopSentimentDetectionJobOutput(v **StopSentimentDetectionJobOutput, value interface{}) error { 15513 if v == nil { 15514 return fmt.Errorf("unexpected nil of type %T", v) 15515 } 15516 if value == nil { 15517 return nil 15518 } 15519 15520 shape, ok := value.(map[string]interface{}) 15521 if !ok { 15522 return fmt.Errorf("unexpected JSON type %v", value) 15523 } 15524 15525 var sv *StopSentimentDetectionJobOutput 15526 if *v == nil { 15527 sv = &StopSentimentDetectionJobOutput{} 15528 } else { 15529 sv = *v 15530 } 15531 15532 for key, value := range shape { 15533 switch key { 15534 case "JobId": 15535 if value != nil { 15536 jtv, ok := value.(string) 15537 if !ok { 15538 return fmt.Errorf("expected JobId to be of type string, got %T instead", value) 15539 } 15540 sv.JobId = ptr.String(jtv) 15541 } 15542 15543 case "JobStatus": 15544 if value != nil { 15545 jtv, ok := value.(string) 15546 if !ok { 15547 return fmt.Errorf("expected JobStatus to be of type string, got %T instead", value) 15548 } 15549 sv.JobStatus = types.JobStatus(jtv) 15550 } 15551 15552 default: 15553 _, _ = key, value 15554 15555 } 15556 } 15557 *v = sv 15558 return nil 15559} 15560 15561func awsAwsjson11_deserializeOpDocumentStopTrainingDocumentClassifierOutput(v **StopTrainingDocumentClassifierOutput, value interface{}) error { 15562 if v == nil { 15563 return fmt.Errorf("unexpected nil of type %T", v) 15564 } 15565 if value == nil { 15566 return nil 15567 } 15568 15569 shape, ok := value.(map[string]interface{}) 15570 if !ok { 15571 return fmt.Errorf("unexpected JSON type %v", value) 15572 } 15573 15574 var sv *StopTrainingDocumentClassifierOutput 15575 if *v == nil { 15576 sv = &StopTrainingDocumentClassifierOutput{} 15577 } else { 15578 sv = *v 15579 } 15580 15581 for key, value := range shape { 15582 switch key { 15583 default: 15584 _, _ = key, value 15585 15586 } 15587 } 15588 *v = sv 15589 return nil 15590} 15591 15592func awsAwsjson11_deserializeOpDocumentStopTrainingEntityRecognizerOutput(v **StopTrainingEntityRecognizerOutput, value interface{}) error { 15593 if v == nil { 15594 return fmt.Errorf("unexpected nil of type %T", v) 15595 } 15596 if value == nil { 15597 return nil 15598 } 15599 15600 shape, ok := value.(map[string]interface{}) 15601 if !ok { 15602 return fmt.Errorf("unexpected JSON type %v", value) 15603 } 15604 15605 var sv *StopTrainingEntityRecognizerOutput 15606 if *v == nil { 15607 sv = &StopTrainingEntityRecognizerOutput{} 15608 } else { 15609 sv = *v 15610 } 15611 15612 for key, value := range shape { 15613 switch key { 15614 default: 15615 _, _ = key, value 15616 15617 } 15618 } 15619 *v = sv 15620 return nil 15621} 15622 15623func awsAwsjson11_deserializeOpDocumentTagResourceOutput(v **TagResourceOutput, value interface{}) error { 15624 if v == nil { 15625 return fmt.Errorf("unexpected nil of type %T", v) 15626 } 15627 if value == nil { 15628 return nil 15629 } 15630 15631 shape, ok := value.(map[string]interface{}) 15632 if !ok { 15633 return fmt.Errorf("unexpected JSON type %v", value) 15634 } 15635 15636 var sv *TagResourceOutput 15637 if *v == nil { 15638 sv = &TagResourceOutput{} 15639 } else { 15640 sv = *v 15641 } 15642 15643 for key, value := range shape { 15644 switch key { 15645 default: 15646 _, _ = key, value 15647 15648 } 15649 } 15650 *v = sv 15651 return nil 15652} 15653 15654func awsAwsjson11_deserializeOpDocumentUntagResourceOutput(v **UntagResourceOutput, value interface{}) error { 15655 if v == nil { 15656 return fmt.Errorf("unexpected nil of type %T", v) 15657 } 15658 if value == nil { 15659 return nil 15660 } 15661 15662 shape, ok := value.(map[string]interface{}) 15663 if !ok { 15664 return fmt.Errorf("unexpected JSON type %v", value) 15665 } 15666 15667 var sv *UntagResourceOutput 15668 if *v == nil { 15669 sv = &UntagResourceOutput{} 15670 } else { 15671 sv = *v 15672 } 15673 15674 for key, value := range shape { 15675 switch key { 15676 default: 15677 _, _ = key, value 15678 15679 } 15680 } 15681 *v = sv 15682 return nil 15683} 15684 15685func awsAwsjson11_deserializeOpDocumentUpdateEndpointOutput(v **UpdateEndpointOutput, value interface{}) error { 15686 if v == nil { 15687 return fmt.Errorf("unexpected nil of type %T", v) 15688 } 15689 if value == nil { 15690 return nil 15691 } 15692 15693 shape, ok := value.(map[string]interface{}) 15694 if !ok { 15695 return fmt.Errorf("unexpected JSON type %v", value) 15696 } 15697 15698 var sv *UpdateEndpointOutput 15699 if *v == nil { 15700 sv = &UpdateEndpointOutput{} 15701 } else { 15702 sv = *v 15703 } 15704 15705 for key, value := range shape { 15706 switch key { 15707 default: 15708 _, _ = key, value 15709 15710 } 15711 } 15712 *v = sv 15713 return nil 15714} 15715