1// Code generated by smithy-go-codegen DO NOT EDIT. 2 3package securityhub 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/securityhub/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 awsRestjson1_deserializeOpAcceptInvitation struct { 23} 24 25func (*awsRestjson1_deserializeOpAcceptInvitation) ID() string { 26 return "OperationDeserializer" 27} 28 29func (m *awsRestjson1_deserializeOpAcceptInvitation) 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, awsRestjson1_deserializeOpErrorAcceptInvitation(response, &metadata) 44 } 45 output := &AcceptInvitationOutput{} 46 out.Result = output 47 48 return out, metadata, err 49} 50 51func awsRestjson1_deserializeOpErrorAcceptInvitation(response *smithyhttp.Response, metadata *middleware.Metadata) error { 52 var errorBuffer bytes.Buffer 53 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 54 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 55 } 56 errorBody := bytes.NewReader(errorBuffer.Bytes()) 57 58 errorCode := "UnknownError" 59 errorMessage := errorCode 60 61 code := response.Header.Get("X-Amzn-ErrorType") 62 if len(code) != 0 { 63 errorCode = restjson.SanitizeErrorCode(code) 64 } 65 66 var buff [1024]byte 67 ringBuffer := smithyio.NewRingBuffer(buff[:]) 68 69 body := io.TeeReader(errorBody, ringBuffer) 70 decoder := json.NewDecoder(body) 71 decoder.UseNumber() 72 code, message, err := restjson.GetErrorInfo(decoder) 73 if err != nil { 74 var snapshot bytes.Buffer 75 io.Copy(&snapshot, ringBuffer) 76 err = &smithy.DeserializationError{ 77 Err: fmt.Errorf("failed to decode response body, %w", err), 78 Snapshot: snapshot.Bytes(), 79 } 80 return err 81 } 82 83 errorBody.Seek(0, io.SeekStart) 84 if len(code) != 0 { 85 errorCode = restjson.SanitizeErrorCode(code) 86 } 87 if len(message) != 0 { 88 errorMessage = message 89 } 90 91 switch { 92 case strings.EqualFold("InternalException", errorCode): 93 return awsRestjson1_deserializeErrorInternalException(response, errorBody) 94 95 case strings.EqualFold("InvalidAccessException", errorCode): 96 return awsRestjson1_deserializeErrorInvalidAccessException(response, errorBody) 97 98 case strings.EqualFold("InvalidInputException", errorCode): 99 return awsRestjson1_deserializeErrorInvalidInputException(response, errorBody) 100 101 case strings.EqualFold("LimitExceededException", errorCode): 102 return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) 103 104 case strings.EqualFold("ResourceNotFoundException", errorCode): 105 return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) 106 107 default: 108 genericError := &smithy.GenericAPIError{ 109 Code: errorCode, 110 Message: errorMessage, 111 } 112 return genericError 113 114 } 115} 116 117type awsRestjson1_deserializeOpBatchDisableStandards struct { 118} 119 120func (*awsRestjson1_deserializeOpBatchDisableStandards) ID() string { 121 return "OperationDeserializer" 122} 123 124func (m *awsRestjson1_deserializeOpBatchDisableStandards) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 125 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 126) { 127 out, metadata, err = next.HandleDeserialize(ctx, in) 128 if err != nil { 129 return out, metadata, err 130 } 131 132 response, ok := out.RawResponse.(*smithyhttp.Response) 133 if !ok { 134 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 135 } 136 137 if response.StatusCode < 200 || response.StatusCode >= 300 { 138 return out, metadata, awsRestjson1_deserializeOpErrorBatchDisableStandards(response, &metadata) 139 } 140 output := &BatchDisableStandardsOutput{} 141 out.Result = output 142 143 var buff [1024]byte 144 ringBuffer := smithyio.NewRingBuffer(buff[:]) 145 146 body := io.TeeReader(response.Body, ringBuffer) 147 148 decoder := json.NewDecoder(body) 149 decoder.UseNumber() 150 var shape interface{} 151 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 152 var snapshot bytes.Buffer 153 io.Copy(&snapshot, ringBuffer) 154 err = &smithy.DeserializationError{ 155 Err: fmt.Errorf("failed to decode response body, %w", err), 156 Snapshot: snapshot.Bytes(), 157 } 158 return out, metadata, err 159 } 160 161 err = awsRestjson1_deserializeOpDocumentBatchDisableStandardsOutput(&output, shape) 162 if err != nil { 163 var snapshot bytes.Buffer 164 io.Copy(&snapshot, ringBuffer) 165 return out, metadata, &smithy.DeserializationError{ 166 Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), 167 Snapshot: snapshot.Bytes(), 168 } 169 } 170 171 return out, metadata, err 172} 173 174func awsRestjson1_deserializeOpErrorBatchDisableStandards(response *smithyhttp.Response, metadata *middleware.Metadata) error { 175 var errorBuffer bytes.Buffer 176 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 177 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 178 } 179 errorBody := bytes.NewReader(errorBuffer.Bytes()) 180 181 errorCode := "UnknownError" 182 errorMessage := errorCode 183 184 code := response.Header.Get("X-Amzn-ErrorType") 185 if len(code) != 0 { 186 errorCode = restjson.SanitizeErrorCode(code) 187 } 188 189 var buff [1024]byte 190 ringBuffer := smithyio.NewRingBuffer(buff[:]) 191 192 body := io.TeeReader(errorBody, ringBuffer) 193 decoder := json.NewDecoder(body) 194 decoder.UseNumber() 195 code, message, err := restjson.GetErrorInfo(decoder) 196 if err != nil { 197 var snapshot bytes.Buffer 198 io.Copy(&snapshot, ringBuffer) 199 err = &smithy.DeserializationError{ 200 Err: fmt.Errorf("failed to decode response body, %w", err), 201 Snapshot: snapshot.Bytes(), 202 } 203 return err 204 } 205 206 errorBody.Seek(0, io.SeekStart) 207 if len(code) != 0 { 208 errorCode = restjson.SanitizeErrorCode(code) 209 } 210 if len(message) != 0 { 211 errorMessage = message 212 } 213 214 switch { 215 case strings.EqualFold("InternalException", errorCode): 216 return awsRestjson1_deserializeErrorInternalException(response, errorBody) 217 218 case strings.EqualFold("InvalidAccessException", errorCode): 219 return awsRestjson1_deserializeErrorInvalidAccessException(response, errorBody) 220 221 case strings.EqualFold("InvalidInputException", errorCode): 222 return awsRestjson1_deserializeErrorInvalidInputException(response, errorBody) 223 224 case strings.EqualFold("LimitExceededException", errorCode): 225 return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) 226 227 default: 228 genericError := &smithy.GenericAPIError{ 229 Code: errorCode, 230 Message: errorMessage, 231 } 232 return genericError 233 234 } 235} 236 237func awsRestjson1_deserializeOpDocumentBatchDisableStandardsOutput(v **BatchDisableStandardsOutput, value interface{}) error { 238 if v == nil { 239 return fmt.Errorf("unexpected nil of type %T", v) 240 } 241 if value == nil { 242 return nil 243 } 244 245 shape, ok := value.(map[string]interface{}) 246 if !ok { 247 return fmt.Errorf("unexpected JSON type %v", value) 248 } 249 250 var sv *BatchDisableStandardsOutput 251 if *v == nil { 252 sv = &BatchDisableStandardsOutput{} 253 } else { 254 sv = *v 255 } 256 257 for key, value := range shape { 258 switch key { 259 case "StandardsSubscriptions": 260 if err := awsRestjson1_deserializeDocumentStandardsSubscriptions(&sv.StandardsSubscriptions, value); err != nil { 261 return err 262 } 263 264 default: 265 _, _ = key, value 266 267 } 268 } 269 *v = sv 270 return nil 271} 272 273type awsRestjson1_deserializeOpBatchEnableStandards struct { 274} 275 276func (*awsRestjson1_deserializeOpBatchEnableStandards) ID() string { 277 return "OperationDeserializer" 278} 279 280func (m *awsRestjson1_deserializeOpBatchEnableStandards) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 281 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 282) { 283 out, metadata, err = next.HandleDeserialize(ctx, in) 284 if err != nil { 285 return out, metadata, err 286 } 287 288 response, ok := out.RawResponse.(*smithyhttp.Response) 289 if !ok { 290 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 291 } 292 293 if response.StatusCode < 200 || response.StatusCode >= 300 { 294 return out, metadata, awsRestjson1_deserializeOpErrorBatchEnableStandards(response, &metadata) 295 } 296 output := &BatchEnableStandardsOutput{} 297 out.Result = output 298 299 var buff [1024]byte 300 ringBuffer := smithyio.NewRingBuffer(buff[:]) 301 302 body := io.TeeReader(response.Body, ringBuffer) 303 304 decoder := json.NewDecoder(body) 305 decoder.UseNumber() 306 var shape interface{} 307 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 308 var snapshot bytes.Buffer 309 io.Copy(&snapshot, ringBuffer) 310 err = &smithy.DeserializationError{ 311 Err: fmt.Errorf("failed to decode response body, %w", err), 312 Snapshot: snapshot.Bytes(), 313 } 314 return out, metadata, err 315 } 316 317 err = awsRestjson1_deserializeOpDocumentBatchEnableStandardsOutput(&output, shape) 318 if err != nil { 319 var snapshot bytes.Buffer 320 io.Copy(&snapshot, ringBuffer) 321 return out, metadata, &smithy.DeserializationError{ 322 Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), 323 Snapshot: snapshot.Bytes(), 324 } 325 } 326 327 return out, metadata, err 328} 329 330func awsRestjson1_deserializeOpErrorBatchEnableStandards(response *smithyhttp.Response, metadata *middleware.Metadata) error { 331 var errorBuffer bytes.Buffer 332 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 333 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 334 } 335 errorBody := bytes.NewReader(errorBuffer.Bytes()) 336 337 errorCode := "UnknownError" 338 errorMessage := errorCode 339 340 code := response.Header.Get("X-Amzn-ErrorType") 341 if len(code) != 0 { 342 errorCode = restjson.SanitizeErrorCode(code) 343 } 344 345 var buff [1024]byte 346 ringBuffer := smithyio.NewRingBuffer(buff[:]) 347 348 body := io.TeeReader(errorBody, ringBuffer) 349 decoder := json.NewDecoder(body) 350 decoder.UseNumber() 351 code, message, err := restjson.GetErrorInfo(decoder) 352 if err != nil { 353 var snapshot bytes.Buffer 354 io.Copy(&snapshot, ringBuffer) 355 err = &smithy.DeserializationError{ 356 Err: fmt.Errorf("failed to decode response body, %w", err), 357 Snapshot: snapshot.Bytes(), 358 } 359 return err 360 } 361 362 errorBody.Seek(0, io.SeekStart) 363 if len(code) != 0 { 364 errorCode = restjson.SanitizeErrorCode(code) 365 } 366 if len(message) != 0 { 367 errorMessage = message 368 } 369 370 switch { 371 case strings.EqualFold("InternalException", errorCode): 372 return awsRestjson1_deserializeErrorInternalException(response, errorBody) 373 374 case strings.EqualFold("InvalidAccessException", errorCode): 375 return awsRestjson1_deserializeErrorInvalidAccessException(response, errorBody) 376 377 case strings.EqualFold("InvalidInputException", errorCode): 378 return awsRestjson1_deserializeErrorInvalidInputException(response, errorBody) 379 380 case strings.EqualFold("LimitExceededException", errorCode): 381 return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) 382 383 default: 384 genericError := &smithy.GenericAPIError{ 385 Code: errorCode, 386 Message: errorMessage, 387 } 388 return genericError 389 390 } 391} 392 393func awsRestjson1_deserializeOpDocumentBatchEnableStandardsOutput(v **BatchEnableStandardsOutput, value interface{}) error { 394 if v == nil { 395 return fmt.Errorf("unexpected nil of type %T", v) 396 } 397 if value == nil { 398 return nil 399 } 400 401 shape, ok := value.(map[string]interface{}) 402 if !ok { 403 return fmt.Errorf("unexpected JSON type %v", value) 404 } 405 406 var sv *BatchEnableStandardsOutput 407 if *v == nil { 408 sv = &BatchEnableStandardsOutput{} 409 } else { 410 sv = *v 411 } 412 413 for key, value := range shape { 414 switch key { 415 case "StandardsSubscriptions": 416 if err := awsRestjson1_deserializeDocumentStandardsSubscriptions(&sv.StandardsSubscriptions, value); err != nil { 417 return err 418 } 419 420 default: 421 _, _ = key, value 422 423 } 424 } 425 *v = sv 426 return nil 427} 428 429type awsRestjson1_deserializeOpBatchImportFindings struct { 430} 431 432func (*awsRestjson1_deserializeOpBatchImportFindings) ID() string { 433 return "OperationDeserializer" 434} 435 436func (m *awsRestjson1_deserializeOpBatchImportFindings) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 437 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 438) { 439 out, metadata, err = next.HandleDeserialize(ctx, in) 440 if err != nil { 441 return out, metadata, err 442 } 443 444 response, ok := out.RawResponse.(*smithyhttp.Response) 445 if !ok { 446 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 447 } 448 449 if response.StatusCode < 200 || response.StatusCode >= 300 { 450 return out, metadata, awsRestjson1_deserializeOpErrorBatchImportFindings(response, &metadata) 451 } 452 output := &BatchImportFindingsOutput{} 453 out.Result = output 454 455 var buff [1024]byte 456 ringBuffer := smithyio.NewRingBuffer(buff[:]) 457 458 body := io.TeeReader(response.Body, ringBuffer) 459 460 decoder := json.NewDecoder(body) 461 decoder.UseNumber() 462 var shape interface{} 463 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 464 var snapshot bytes.Buffer 465 io.Copy(&snapshot, ringBuffer) 466 err = &smithy.DeserializationError{ 467 Err: fmt.Errorf("failed to decode response body, %w", err), 468 Snapshot: snapshot.Bytes(), 469 } 470 return out, metadata, err 471 } 472 473 err = awsRestjson1_deserializeOpDocumentBatchImportFindingsOutput(&output, shape) 474 if err != nil { 475 var snapshot bytes.Buffer 476 io.Copy(&snapshot, ringBuffer) 477 return out, metadata, &smithy.DeserializationError{ 478 Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), 479 Snapshot: snapshot.Bytes(), 480 } 481 } 482 483 return out, metadata, err 484} 485 486func awsRestjson1_deserializeOpErrorBatchImportFindings(response *smithyhttp.Response, metadata *middleware.Metadata) error { 487 var errorBuffer bytes.Buffer 488 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 489 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 490 } 491 errorBody := bytes.NewReader(errorBuffer.Bytes()) 492 493 errorCode := "UnknownError" 494 errorMessage := errorCode 495 496 code := response.Header.Get("X-Amzn-ErrorType") 497 if len(code) != 0 { 498 errorCode = restjson.SanitizeErrorCode(code) 499 } 500 501 var buff [1024]byte 502 ringBuffer := smithyio.NewRingBuffer(buff[:]) 503 504 body := io.TeeReader(errorBody, ringBuffer) 505 decoder := json.NewDecoder(body) 506 decoder.UseNumber() 507 code, message, err := restjson.GetErrorInfo(decoder) 508 if err != nil { 509 var snapshot bytes.Buffer 510 io.Copy(&snapshot, ringBuffer) 511 err = &smithy.DeserializationError{ 512 Err: fmt.Errorf("failed to decode response body, %w", err), 513 Snapshot: snapshot.Bytes(), 514 } 515 return err 516 } 517 518 errorBody.Seek(0, io.SeekStart) 519 if len(code) != 0 { 520 errorCode = restjson.SanitizeErrorCode(code) 521 } 522 if len(message) != 0 { 523 errorMessage = message 524 } 525 526 switch { 527 case strings.EqualFold("InternalException", errorCode): 528 return awsRestjson1_deserializeErrorInternalException(response, errorBody) 529 530 case strings.EqualFold("InvalidAccessException", errorCode): 531 return awsRestjson1_deserializeErrorInvalidAccessException(response, errorBody) 532 533 case strings.EqualFold("InvalidInputException", errorCode): 534 return awsRestjson1_deserializeErrorInvalidInputException(response, errorBody) 535 536 case strings.EqualFold("LimitExceededException", errorCode): 537 return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) 538 539 default: 540 genericError := &smithy.GenericAPIError{ 541 Code: errorCode, 542 Message: errorMessage, 543 } 544 return genericError 545 546 } 547} 548 549func awsRestjson1_deserializeOpDocumentBatchImportFindingsOutput(v **BatchImportFindingsOutput, value interface{}) error { 550 if v == nil { 551 return fmt.Errorf("unexpected nil of type %T", v) 552 } 553 if value == nil { 554 return nil 555 } 556 557 shape, ok := value.(map[string]interface{}) 558 if !ok { 559 return fmt.Errorf("unexpected JSON type %v", value) 560 } 561 562 var sv *BatchImportFindingsOutput 563 if *v == nil { 564 sv = &BatchImportFindingsOutput{} 565 } else { 566 sv = *v 567 } 568 569 for key, value := range shape { 570 switch key { 571 case "FailedCount": 572 if value != nil { 573 jtv, ok := value.(json.Number) 574 if !ok { 575 return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) 576 } 577 i64, err := jtv.Int64() 578 if err != nil { 579 return err 580 } 581 sv.FailedCount = int32(i64) 582 } 583 584 case "FailedFindings": 585 if err := awsRestjson1_deserializeDocumentImportFindingsErrorList(&sv.FailedFindings, value); err != nil { 586 return err 587 } 588 589 case "SuccessCount": 590 if value != nil { 591 jtv, ok := value.(json.Number) 592 if !ok { 593 return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) 594 } 595 i64, err := jtv.Int64() 596 if err != nil { 597 return err 598 } 599 sv.SuccessCount = int32(i64) 600 } 601 602 default: 603 _, _ = key, value 604 605 } 606 } 607 *v = sv 608 return nil 609} 610 611type awsRestjson1_deserializeOpBatchUpdateFindings struct { 612} 613 614func (*awsRestjson1_deserializeOpBatchUpdateFindings) ID() string { 615 return "OperationDeserializer" 616} 617 618func (m *awsRestjson1_deserializeOpBatchUpdateFindings) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 619 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 620) { 621 out, metadata, err = next.HandleDeserialize(ctx, in) 622 if err != nil { 623 return out, metadata, err 624 } 625 626 response, ok := out.RawResponse.(*smithyhttp.Response) 627 if !ok { 628 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 629 } 630 631 if response.StatusCode < 200 || response.StatusCode >= 300 { 632 return out, metadata, awsRestjson1_deserializeOpErrorBatchUpdateFindings(response, &metadata) 633 } 634 output := &BatchUpdateFindingsOutput{} 635 out.Result = output 636 637 var buff [1024]byte 638 ringBuffer := smithyio.NewRingBuffer(buff[:]) 639 640 body := io.TeeReader(response.Body, ringBuffer) 641 642 decoder := json.NewDecoder(body) 643 decoder.UseNumber() 644 var shape interface{} 645 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 646 var snapshot bytes.Buffer 647 io.Copy(&snapshot, ringBuffer) 648 err = &smithy.DeserializationError{ 649 Err: fmt.Errorf("failed to decode response body, %w", err), 650 Snapshot: snapshot.Bytes(), 651 } 652 return out, metadata, err 653 } 654 655 err = awsRestjson1_deserializeOpDocumentBatchUpdateFindingsOutput(&output, shape) 656 if err != nil { 657 var snapshot bytes.Buffer 658 io.Copy(&snapshot, ringBuffer) 659 return out, metadata, &smithy.DeserializationError{ 660 Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), 661 Snapshot: snapshot.Bytes(), 662 } 663 } 664 665 return out, metadata, err 666} 667 668func awsRestjson1_deserializeOpErrorBatchUpdateFindings(response *smithyhttp.Response, metadata *middleware.Metadata) error { 669 var errorBuffer bytes.Buffer 670 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 671 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 672 } 673 errorBody := bytes.NewReader(errorBuffer.Bytes()) 674 675 errorCode := "UnknownError" 676 errorMessage := errorCode 677 678 code := response.Header.Get("X-Amzn-ErrorType") 679 if len(code) != 0 { 680 errorCode = restjson.SanitizeErrorCode(code) 681 } 682 683 var buff [1024]byte 684 ringBuffer := smithyio.NewRingBuffer(buff[:]) 685 686 body := io.TeeReader(errorBody, ringBuffer) 687 decoder := json.NewDecoder(body) 688 decoder.UseNumber() 689 code, message, err := restjson.GetErrorInfo(decoder) 690 if err != nil { 691 var snapshot bytes.Buffer 692 io.Copy(&snapshot, ringBuffer) 693 err = &smithy.DeserializationError{ 694 Err: fmt.Errorf("failed to decode response body, %w", err), 695 Snapshot: snapshot.Bytes(), 696 } 697 return err 698 } 699 700 errorBody.Seek(0, io.SeekStart) 701 if len(code) != 0 { 702 errorCode = restjson.SanitizeErrorCode(code) 703 } 704 if len(message) != 0 { 705 errorMessage = message 706 } 707 708 switch { 709 case strings.EqualFold("InternalException", errorCode): 710 return awsRestjson1_deserializeErrorInternalException(response, errorBody) 711 712 case strings.EqualFold("InvalidAccessException", errorCode): 713 return awsRestjson1_deserializeErrorInvalidAccessException(response, errorBody) 714 715 case strings.EqualFold("InvalidInputException", errorCode): 716 return awsRestjson1_deserializeErrorInvalidInputException(response, errorBody) 717 718 case strings.EqualFold("LimitExceededException", errorCode): 719 return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) 720 721 default: 722 genericError := &smithy.GenericAPIError{ 723 Code: errorCode, 724 Message: errorMessage, 725 } 726 return genericError 727 728 } 729} 730 731func awsRestjson1_deserializeOpDocumentBatchUpdateFindingsOutput(v **BatchUpdateFindingsOutput, value interface{}) error { 732 if v == nil { 733 return fmt.Errorf("unexpected nil of type %T", v) 734 } 735 if value == nil { 736 return nil 737 } 738 739 shape, ok := value.(map[string]interface{}) 740 if !ok { 741 return fmt.Errorf("unexpected JSON type %v", value) 742 } 743 744 var sv *BatchUpdateFindingsOutput 745 if *v == nil { 746 sv = &BatchUpdateFindingsOutput{} 747 } else { 748 sv = *v 749 } 750 751 for key, value := range shape { 752 switch key { 753 case "ProcessedFindings": 754 if err := awsRestjson1_deserializeDocumentAwsSecurityFindingIdentifierList(&sv.ProcessedFindings, value); err != nil { 755 return err 756 } 757 758 case "UnprocessedFindings": 759 if err := awsRestjson1_deserializeDocumentBatchUpdateFindingsUnprocessedFindingsList(&sv.UnprocessedFindings, value); err != nil { 760 return err 761 } 762 763 default: 764 _, _ = key, value 765 766 } 767 } 768 *v = sv 769 return nil 770} 771 772type awsRestjson1_deserializeOpCreateActionTarget struct { 773} 774 775func (*awsRestjson1_deserializeOpCreateActionTarget) ID() string { 776 return "OperationDeserializer" 777} 778 779func (m *awsRestjson1_deserializeOpCreateActionTarget) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 780 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 781) { 782 out, metadata, err = next.HandleDeserialize(ctx, in) 783 if err != nil { 784 return out, metadata, err 785 } 786 787 response, ok := out.RawResponse.(*smithyhttp.Response) 788 if !ok { 789 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 790 } 791 792 if response.StatusCode < 200 || response.StatusCode >= 300 { 793 return out, metadata, awsRestjson1_deserializeOpErrorCreateActionTarget(response, &metadata) 794 } 795 output := &CreateActionTargetOutput{} 796 out.Result = output 797 798 var buff [1024]byte 799 ringBuffer := smithyio.NewRingBuffer(buff[:]) 800 801 body := io.TeeReader(response.Body, ringBuffer) 802 803 decoder := json.NewDecoder(body) 804 decoder.UseNumber() 805 var shape interface{} 806 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 807 var snapshot bytes.Buffer 808 io.Copy(&snapshot, ringBuffer) 809 err = &smithy.DeserializationError{ 810 Err: fmt.Errorf("failed to decode response body, %w", err), 811 Snapshot: snapshot.Bytes(), 812 } 813 return out, metadata, err 814 } 815 816 err = awsRestjson1_deserializeOpDocumentCreateActionTargetOutput(&output, shape) 817 if err != nil { 818 var snapshot bytes.Buffer 819 io.Copy(&snapshot, ringBuffer) 820 return out, metadata, &smithy.DeserializationError{ 821 Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), 822 Snapshot: snapshot.Bytes(), 823 } 824 } 825 826 return out, metadata, err 827} 828 829func awsRestjson1_deserializeOpErrorCreateActionTarget(response *smithyhttp.Response, metadata *middleware.Metadata) error { 830 var errorBuffer bytes.Buffer 831 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 832 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 833 } 834 errorBody := bytes.NewReader(errorBuffer.Bytes()) 835 836 errorCode := "UnknownError" 837 errorMessage := errorCode 838 839 code := response.Header.Get("X-Amzn-ErrorType") 840 if len(code) != 0 { 841 errorCode = restjson.SanitizeErrorCode(code) 842 } 843 844 var buff [1024]byte 845 ringBuffer := smithyio.NewRingBuffer(buff[:]) 846 847 body := io.TeeReader(errorBody, ringBuffer) 848 decoder := json.NewDecoder(body) 849 decoder.UseNumber() 850 code, message, err := restjson.GetErrorInfo(decoder) 851 if err != nil { 852 var snapshot bytes.Buffer 853 io.Copy(&snapshot, ringBuffer) 854 err = &smithy.DeserializationError{ 855 Err: fmt.Errorf("failed to decode response body, %w", err), 856 Snapshot: snapshot.Bytes(), 857 } 858 return err 859 } 860 861 errorBody.Seek(0, io.SeekStart) 862 if len(code) != 0 { 863 errorCode = restjson.SanitizeErrorCode(code) 864 } 865 if len(message) != 0 { 866 errorMessage = message 867 } 868 869 switch { 870 case strings.EqualFold("InternalException", errorCode): 871 return awsRestjson1_deserializeErrorInternalException(response, errorBody) 872 873 case strings.EqualFold("InvalidAccessException", errorCode): 874 return awsRestjson1_deserializeErrorInvalidAccessException(response, errorBody) 875 876 case strings.EqualFold("InvalidInputException", errorCode): 877 return awsRestjson1_deserializeErrorInvalidInputException(response, errorBody) 878 879 case strings.EqualFold("LimitExceededException", errorCode): 880 return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) 881 882 case strings.EqualFold("ResourceConflictException", errorCode): 883 return awsRestjson1_deserializeErrorResourceConflictException(response, errorBody) 884 885 default: 886 genericError := &smithy.GenericAPIError{ 887 Code: errorCode, 888 Message: errorMessage, 889 } 890 return genericError 891 892 } 893} 894 895func awsRestjson1_deserializeOpDocumentCreateActionTargetOutput(v **CreateActionTargetOutput, value interface{}) error { 896 if v == nil { 897 return fmt.Errorf("unexpected nil of type %T", v) 898 } 899 if value == nil { 900 return nil 901 } 902 903 shape, ok := value.(map[string]interface{}) 904 if !ok { 905 return fmt.Errorf("unexpected JSON type %v", value) 906 } 907 908 var sv *CreateActionTargetOutput 909 if *v == nil { 910 sv = &CreateActionTargetOutput{} 911 } else { 912 sv = *v 913 } 914 915 for key, value := range shape { 916 switch key { 917 case "ActionTargetArn": 918 if value != nil { 919 jtv, ok := value.(string) 920 if !ok { 921 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 922 } 923 sv.ActionTargetArn = ptr.String(jtv) 924 } 925 926 default: 927 _, _ = key, value 928 929 } 930 } 931 *v = sv 932 return nil 933} 934 935type awsRestjson1_deserializeOpCreateInsight struct { 936} 937 938func (*awsRestjson1_deserializeOpCreateInsight) ID() string { 939 return "OperationDeserializer" 940} 941 942func (m *awsRestjson1_deserializeOpCreateInsight) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 943 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 944) { 945 out, metadata, err = next.HandleDeserialize(ctx, in) 946 if err != nil { 947 return out, metadata, err 948 } 949 950 response, ok := out.RawResponse.(*smithyhttp.Response) 951 if !ok { 952 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 953 } 954 955 if response.StatusCode < 200 || response.StatusCode >= 300 { 956 return out, metadata, awsRestjson1_deserializeOpErrorCreateInsight(response, &metadata) 957 } 958 output := &CreateInsightOutput{} 959 out.Result = output 960 961 var buff [1024]byte 962 ringBuffer := smithyio.NewRingBuffer(buff[:]) 963 964 body := io.TeeReader(response.Body, ringBuffer) 965 966 decoder := json.NewDecoder(body) 967 decoder.UseNumber() 968 var shape interface{} 969 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 970 var snapshot bytes.Buffer 971 io.Copy(&snapshot, ringBuffer) 972 err = &smithy.DeserializationError{ 973 Err: fmt.Errorf("failed to decode response body, %w", err), 974 Snapshot: snapshot.Bytes(), 975 } 976 return out, metadata, err 977 } 978 979 err = awsRestjson1_deserializeOpDocumentCreateInsightOutput(&output, shape) 980 if err != nil { 981 var snapshot bytes.Buffer 982 io.Copy(&snapshot, ringBuffer) 983 return out, metadata, &smithy.DeserializationError{ 984 Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), 985 Snapshot: snapshot.Bytes(), 986 } 987 } 988 989 return out, metadata, err 990} 991 992func awsRestjson1_deserializeOpErrorCreateInsight(response *smithyhttp.Response, metadata *middleware.Metadata) error { 993 var errorBuffer bytes.Buffer 994 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 995 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 996 } 997 errorBody := bytes.NewReader(errorBuffer.Bytes()) 998 999 errorCode := "UnknownError" 1000 errorMessage := errorCode 1001 1002 code := response.Header.Get("X-Amzn-ErrorType") 1003 if len(code) != 0 { 1004 errorCode = restjson.SanitizeErrorCode(code) 1005 } 1006 1007 var buff [1024]byte 1008 ringBuffer := smithyio.NewRingBuffer(buff[:]) 1009 1010 body := io.TeeReader(errorBody, ringBuffer) 1011 decoder := json.NewDecoder(body) 1012 decoder.UseNumber() 1013 code, message, err := restjson.GetErrorInfo(decoder) 1014 if err != nil { 1015 var snapshot bytes.Buffer 1016 io.Copy(&snapshot, ringBuffer) 1017 err = &smithy.DeserializationError{ 1018 Err: fmt.Errorf("failed to decode response body, %w", err), 1019 Snapshot: snapshot.Bytes(), 1020 } 1021 return err 1022 } 1023 1024 errorBody.Seek(0, io.SeekStart) 1025 if len(code) != 0 { 1026 errorCode = restjson.SanitizeErrorCode(code) 1027 } 1028 if len(message) != 0 { 1029 errorMessage = message 1030 } 1031 1032 switch { 1033 case strings.EqualFold("InternalException", errorCode): 1034 return awsRestjson1_deserializeErrorInternalException(response, errorBody) 1035 1036 case strings.EqualFold("InvalidAccessException", errorCode): 1037 return awsRestjson1_deserializeErrorInvalidAccessException(response, errorBody) 1038 1039 case strings.EqualFold("InvalidInputException", errorCode): 1040 return awsRestjson1_deserializeErrorInvalidInputException(response, errorBody) 1041 1042 case strings.EqualFold("LimitExceededException", errorCode): 1043 return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) 1044 1045 case strings.EqualFold("ResourceConflictException", errorCode): 1046 return awsRestjson1_deserializeErrorResourceConflictException(response, errorBody) 1047 1048 default: 1049 genericError := &smithy.GenericAPIError{ 1050 Code: errorCode, 1051 Message: errorMessage, 1052 } 1053 return genericError 1054 1055 } 1056} 1057 1058func awsRestjson1_deserializeOpDocumentCreateInsightOutput(v **CreateInsightOutput, value interface{}) error { 1059 if v == nil { 1060 return fmt.Errorf("unexpected nil of type %T", v) 1061 } 1062 if value == nil { 1063 return nil 1064 } 1065 1066 shape, ok := value.(map[string]interface{}) 1067 if !ok { 1068 return fmt.Errorf("unexpected JSON type %v", value) 1069 } 1070 1071 var sv *CreateInsightOutput 1072 if *v == nil { 1073 sv = &CreateInsightOutput{} 1074 } else { 1075 sv = *v 1076 } 1077 1078 for key, value := range shape { 1079 switch key { 1080 case "InsightArn": 1081 if value != nil { 1082 jtv, ok := value.(string) 1083 if !ok { 1084 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 1085 } 1086 sv.InsightArn = ptr.String(jtv) 1087 } 1088 1089 default: 1090 _, _ = key, value 1091 1092 } 1093 } 1094 *v = sv 1095 return nil 1096} 1097 1098type awsRestjson1_deserializeOpCreateMembers struct { 1099} 1100 1101func (*awsRestjson1_deserializeOpCreateMembers) ID() string { 1102 return "OperationDeserializer" 1103} 1104 1105func (m *awsRestjson1_deserializeOpCreateMembers) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 1106 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 1107) { 1108 out, metadata, err = next.HandleDeserialize(ctx, in) 1109 if err != nil { 1110 return out, metadata, err 1111 } 1112 1113 response, ok := out.RawResponse.(*smithyhttp.Response) 1114 if !ok { 1115 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 1116 } 1117 1118 if response.StatusCode < 200 || response.StatusCode >= 300 { 1119 return out, metadata, awsRestjson1_deserializeOpErrorCreateMembers(response, &metadata) 1120 } 1121 output := &CreateMembersOutput{} 1122 out.Result = output 1123 1124 var buff [1024]byte 1125 ringBuffer := smithyio.NewRingBuffer(buff[:]) 1126 1127 body := io.TeeReader(response.Body, ringBuffer) 1128 1129 decoder := json.NewDecoder(body) 1130 decoder.UseNumber() 1131 var shape interface{} 1132 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 1133 var snapshot bytes.Buffer 1134 io.Copy(&snapshot, ringBuffer) 1135 err = &smithy.DeserializationError{ 1136 Err: fmt.Errorf("failed to decode response body, %w", err), 1137 Snapshot: snapshot.Bytes(), 1138 } 1139 return out, metadata, err 1140 } 1141 1142 err = awsRestjson1_deserializeOpDocumentCreateMembersOutput(&output, shape) 1143 if err != nil { 1144 var snapshot bytes.Buffer 1145 io.Copy(&snapshot, ringBuffer) 1146 return out, metadata, &smithy.DeserializationError{ 1147 Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), 1148 Snapshot: snapshot.Bytes(), 1149 } 1150 } 1151 1152 return out, metadata, err 1153} 1154 1155func awsRestjson1_deserializeOpErrorCreateMembers(response *smithyhttp.Response, metadata *middleware.Metadata) error { 1156 var errorBuffer bytes.Buffer 1157 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 1158 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 1159 } 1160 errorBody := bytes.NewReader(errorBuffer.Bytes()) 1161 1162 errorCode := "UnknownError" 1163 errorMessage := errorCode 1164 1165 code := response.Header.Get("X-Amzn-ErrorType") 1166 if len(code) != 0 { 1167 errorCode = restjson.SanitizeErrorCode(code) 1168 } 1169 1170 var buff [1024]byte 1171 ringBuffer := smithyio.NewRingBuffer(buff[:]) 1172 1173 body := io.TeeReader(errorBody, ringBuffer) 1174 decoder := json.NewDecoder(body) 1175 decoder.UseNumber() 1176 code, message, err := restjson.GetErrorInfo(decoder) 1177 if err != nil { 1178 var snapshot bytes.Buffer 1179 io.Copy(&snapshot, ringBuffer) 1180 err = &smithy.DeserializationError{ 1181 Err: fmt.Errorf("failed to decode response body, %w", err), 1182 Snapshot: snapshot.Bytes(), 1183 } 1184 return err 1185 } 1186 1187 errorBody.Seek(0, io.SeekStart) 1188 if len(code) != 0 { 1189 errorCode = restjson.SanitizeErrorCode(code) 1190 } 1191 if len(message) != 0 { 1192 errorMessage = message 1193 } 1194 1195 switch { 1196 case strings.EqualFold("InternalException", errorCode): 1197 return awsRestjson1_deserializeErrorInternalException(response, errorBody) 1198 1199 case strings.EqualFold("InvalidAccessException", errorCode): 1200 return awsRestjson1_deserializeErrorInvalidAccessException(response, errorBody) 1201 1202 case strings.EqualFold("InvalidInputException", errorCode): 1203 return awsRestjson1_deserializeErrorInvalidInputException(response, errorBody) 1204 1205 case strings.EqualFold("LimitExceededException", errorCode): 1206 return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) 1207 1208 case strings.EqualFold("ResourceConflictException", errorCode): 1209 return awsRestjson1_deserializeErrorResourceConflictException(response, errorBody) 1210 1211 default: 1212 genericError := &smithy.GenericAPIError{ 1213 Code: errorCode, 1214 Message: errorMessage, 1215 } 1216 return genericError 1217 1218 } 1219} 1220 1221func awsRestjson1_deserializeOpDocumentCreateMembersOutput(v **CreateMembersOutput, value interface{}) error { 1222 if v == nil { 1223 return fmt.Errorf("unexpected nil of type %T", v) 1224 } 1225 if value == nil { 1226 return nil 1227 } 1228 1229 shape, ok := value.(map[string]interface{}) 1230 if !ok { 1231 return fmt.Errorf("unexpected JSON type %v", value) 1232 } 1233 1234 var sv *CreateMembersOutput 1235 if *v == nil { 1236 sv = &CreateMembersOutput{} 1237 } else { 1238 sv = *v 1239 } 1240 1241 for key, value := range shape { 1242 switch key { 1243 case "UnprocessedAccounts": 1244 if err := awsRestjson1_deserializeDocumentResultList(&sv.UnprocessedAccounts, value); err != nil { 1245 return err 1246 } 1247 1248 default: 1249 _, _ = key, value 1250 1251 } 1252 } 1253 *v = sv 1254 return nil 1255} 1256 1257type awsRestjson1_deserializeOpDeclineInvitations struct { 1258} 1259 1260func (*awsRestjson1_deserializeOpDeclineInvitations) ID() string { 1261 return "OperationDeserializer" 1262} 1263 1264func (m *awsRestjson1_deserializeOpDeclineInvitations) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 1265 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 1266) { 1267 out, metadata, err = next.HandleDeserialize(ctx, in) 1268 if err != nil { 1269 return out, metadata, err 1270 } 1271 1272 response, ok := out.RawResponse.(*smithyhttp.Response) 1273 if !ok { 1274 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 1275 } 1276 1277 if response.StatusCode < 200 || response.StatusCode >= 300 { 1278 return out, metadata, awsRestjson1_deserializeOpErrorDeclineInvitations(response, &metadata) 1279 } 1280 output := &DeclineInvitationsOutput{} 1281 out.Result = output 1282 1283 var buff [1024]byte 1284 ringBuffer := smithyio.NewRingBuffer(buff[:]) 1285 1286 body := io.TeeReader(response.Body, ringBuffer) 1287 1288 decoder := json.NewDecoder(body) 1289 decoder.UseNumber() 1290 var shape interface{} 1291 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 1292 var snapshot bytes.Buffer 1293 io.Copy(&snapshot, ringBuffer) 1294 err = &smithy.DeserializationError{ 1295 Err: fmt.Errorf("failed to decode response body, %w", err), 1296 Snapshot: snapshot.Bytes(), 1297 } 1298 return out, metadata, err 1299 } 1300 1301 err = awsRestjson1_deserializeOpDocumentDeclineInvitationsOutput(&output, shape) 1302 if err != nil { 1303 var snapshot bytes.Buffer 1304 io.Copy(&snapshot, ringBuffer) 1305 return out, metadata, &smithy.DeserializationError{ 1306 Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), 1307 Snapshot: snapshot.Bytes(), 1308 } 1309 } 1310 1311 return out, metadata, err 1312} 1313 1314func awsRestjson1_deserializeOpErrorDeclineInvitations(response *smithyhttp.Response, metadata *middleware.Metadata) error { 1315 var errorBuffer bytes.Buffer 1316 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 1317 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 1318 } 1319 errorBody := bytes.NewReader(errorBuffer.Bytes()) 1320 1321 errorCode := "UnknownError" 1322 errorMessage := errorCode 1323 1324 code := response.Header.Get("X-Amzn-ErrorType") 1325 if len(code) != 0 { 1326 errorCode = restjson.SanitizeErrorCode(code) 1327 } 1328 1329 var buff [1024]byte 1330 ringBuffer := smithyio.NewRingBuffer(buff[:]) 1331 1332 body := io.TeeReader(errorBody, ringBuffer) 1333 decoder := json.NewDecoder(body) 1334 decoder.UseNumber() 1335 code, message, err := restjson.GetErrorInfo(decoder) 1336 if err != nil { 1337 var snapshot bytes.Buffer 1338 io.Copy(&snapshot, ringBuffer) 1339 err = &smithy.DeserializationError{ 1340 Err: fmt.Errorf("failed to decode response body, %w", err), 1341 Snapshot: snapshot.Bytes(), 1342 } 1343 return err 1344 } 1345 1346 errorBody.Seek(0, io.SeekStart) 1347 if len(code) != 0 { 1348 errorCode = restjson.SanitizeErrorCode(code) 1349 } 1350 if len(message) != 0 { 1351 errorMessage = message 1352 } 1353 1354 switch { 1355 case strings.EqualFold("InternalException", errorCode): 1356 return awsRestjson1_deserializeErrorInternalException(response, errorBody) 1357 1358 case strings.EqualFold("InvalidAccessException", errorCode): 1359 return awsRestjson1_deserializeErrorInvalidAccessException(response, errorBody) 1360 1361 case strings.EqualFold("InvalidInputException", errorCode): 1362 return awsRestjson1_deserializeErrorInvalidInputException(response, errorBody) 1363 1364 case strings.EqualFold("ResourceNotFoundException", errorCode): 1365 return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) 1366 1367 default: 1368 genericError := &smithy.GenericAPIError{ 1369 Code: errorCode, 1370 Message: errorMessage, 1371 } 1372 return genericError 1373 1374 } 1375} 1376 1377func awsRestjson1_deserializeOpDocumentDeclineInvitationsOutput(v **DeclineInvitationsOutput, value interface{}) error { 1378 if v == nil { 1379 return fmt.Errorf("unexpected nil of type %T", v) 1380 } 1381 if value == nil { 1382 return nil 1383 } 1384 1385 shape, ok := value.(map[string]interface{}) 1386 if !ok { 1387 return fmt.Errorf("unexpected JSON type %v", value) 1388 } 1389 1390 var sv *DeclineInvitationsOutput 1391 if *v == nil { 1392 sv = &DeclineInvitationsOutput{} 1393 } else { 1394 sv = *v 1395 } 1396 1397 for key, value := range shape { 1398 switch key { 1399 case "UnprocessedAccounts": 1400 if err := awsRestjson1_deserializeDocumentResultList(&sv.UnprocessedAccounts, value); err != nil { 1401 return err 1402 } 1403 1404 default: 1405 _, _ = key, value 1406 1407 } 1408 } 1409 *v = sv 1410 return nil 1411} 1412 1413type awsRestjson1_deserializeOpDeleteActionTarget struct { 1414} 1415 1416func (*awsRestjson1_deserializeOpDeleteActionTarget) ID() string { 1417 return "OperationDeserializer" 1418} 1419 1420func (m *awsRestjson1_deserializeOpDeleteActionTarget) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 1421 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 1422) { 1423 out, metadata, err = next.HandleDeserialize(ctx, in) 1424 if err != nil { 1425 return out, metadata, err 1426 } 1427 1428 response, ok := out.RawResponse.(*smithyhttp.Response) 1429 if !ok { 1430 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 1431 } 1432 1433 if response.StatusCode < 200 || response.StatusCode >= 300 { 1434 return out, metadata, awsRestjson1_deserializeOpErrorDeleteActionTarget(response, &metadata) 1435 } 1436 output := &DeleteActionTargetOutput{} 1437 out.Result = output 1438 1439 var buff [1024]byte 1440 ringBuffer := smithyio.NewRingBuffer(buff[:]) 1441 1442 body := io.TeeReader(response.Body, ringBuffer) 1443 1444 decoder := json.NewDecoder(body) 1445 decoder.UseNumber() 1446 var shape interface{} 1447 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 1448 var snapshot bytes.Buffer 1449 io.Copy(&snapshot, ringBuffer) 1450 err = &smithy.DeserializationError{ 1451 Err: fmt.Errorf("failed to decode response body, %w", err), 1452 Snapshot: snapshot.Bytes(), 1453 } 1454 return out, metadata, err 1455 } 1456 1457 err = awsRestjson1_deserializeOpDocumentDeleteActionTargetOutput(&output, shape) 1458 if err != nil { 1459 var snapshot bytes.Buffer 1460 io.Copy(&snapshot, ringBuffer) 1461 return out, metadata, &smithy.DeserializationError{ 1462 Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), 1463 Snapshot: snapshot.Bytes(), 1464 } 1465 } 1466 1467 return out, metadata, err 1468} 1469 1470func awsRestjson1_deserializeOpErrorDeleteActionTarget(response *smithyhttp.Response, metadata *middleware.Metadata) error { 1471 var errorBuffer bytes.Buffer 1472 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 1473 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 1474 } 1475 errorBody := bytes.NewReader(errorBuffer.Bytes()) 1476 1477 errorCode := "UnknownError" 1478 errorMessage := errorCode 1479 1480 code := response.Header.Get("X-Amzn-ErrorType") 1481 if len(code) != 0 { 1482 errorCode = restjson.SanitizeErrorCode(code) 1483 } 1484 1485 var buff [1024]byte 1486 ringBuffer := smithyio.NewRingBuffer(buff[:]) 1487 1488 body := io.TeeReader(errorBody, ringBuffer) 1489 decoder := json.NewDecoder(body) 1490 decoder.UseNumber() 1491 code, message, err := restjson.GetErrorInfo(decoder) 1492 if err != nil { 1493 var snapshot bytes.Buffer 1494 io.Copy(&snapshot, ringBuffer) 1495 err = &smithy.DeserializationError{ 1496 Err: fmt.Errorf("failed to decode response body, %w", err), 1497 Snapshot: snapshot.Bytes(), 1498 } 1499 return err 1500 } 1501 1502 errorBody.Seek(0, io.SeekStart) 1503 if len(code) != 0 { 1504 errorCode = restjson.SanitizeErrorCode(code) 1505 } 1506 if len(message) != 0 { 1507 errorMessage = message 1508 } 1509 1510 switch { 1511 case strings.EqualFold("InternalException", errorCode): 1512 return awsRestjson1_deserializeErrorInternalException(response, errorBody) 1513 1514 case strings.EqualFold("InvalidAccessException", errorCode): 1515 return awsRestjson1_deserializeErrorInvalidAccessException(response, errorBody) 1516 1517 case strings.EqualFold("InvalidInputException", errorCode): 1518 return awsRestjson1_deserializeErrorInvalidInputException(response, errorBody) 1519 1520 case strings.EqualFold("ResourceNotFoundException", errorCode): 1521 return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) 1522 1523 default: 1524 genericError := &smithy.GenericAPIError{ 1525 Code: errorCode, 1526 Message: errorMessage, 1527 } 1528 return genericError 1529 1530 } 1531} 1532 1533func awsRestjson1_deserializeOpDocumentDeleteActionTargetOutput(v **DeleteActionTargetOutput, value interface{}) error { 1534 if v == nil { 1535 return fmt.Errorf("unexpected nil of type %T", v) 1536 } 1537 if value == nil { 1538 return nil 1539 } 1540 1541 shape, ok := value.(map[string]interface{}) 1542 if !ok { 1543 return fmt.Errorf("unexpected JSON type %v", value) 1544 } 1545 1546 var sv *DeleteActionTargetOutput 1547 if *v == nil { 1548 sv = &DeleteActionTargetOutput{} 1549 } else { 1550 sv = *v 1551 } 1552 1553 for key, value := range shape { 1554 switch key { 1555 case "ActionTargetArn": 1556 if value != nil { 1557 jtv, ok := value.(string) 1558 if !ok { 1559 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 1560 } 1561 sv.ActionTargetArn = ptr.String(jtv) 1562 } 1563 1564 default: 1565 _, _ = key, value 1566 1567 } 1568 } 1569 *v = sv 1570 return nil 1571} 1572 1573type awsRestjson1_deserializeOpDeleteInsight struct { 1574} 1575 1576func (*awsRestjson1_deserializeOpDeleteInsight) ID() string { 1577 return "OperationDeserializer" 1578} 1579 1580func (m *awsRestjson1_deserializeOpDeleteInsight) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 1581 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 1582) { 1583 out, metadata, err = next.HandleDeserialize(ctx, in) 1584 if err != nil { 1585 return out, metadata, err 1586 } 1587 1588 response, ok := out.RawResponse.(*smithyhttp.Response) 1589 if !ok { 1590 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 1591 } 1592 1593 if response.StatusCode < 200 || response.StatusCode >= 300 { 1594 return out, metadata, awsRestjson1_deserializeOpErrorDeleteInsight(response, &metadata) 1595 } 1596 output := &DeleteInsightOutput{} 1597 out.Result = output 1598 1599 var buff [1024]byte 1600 ringBuffer := smithyio.NewRingBuffer(buff[:]) 1601 1602 body := io.TeeReader(response.Body, ringBuffer) 1603 1604 decoder := json.NewDecoder(body) 1605 decoder.UseNumber() 1606 var shape interface{} 1607 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 1608 var snapshot bytes.Buffer 1609 io.Copy(&snapshot, ringBuffer) 1610 err = &smithy.DeserializationError{ 1611 Err: fmt.Errorf("failed to decode response body, %w", err), 1612 Snapshot: snapshot.Bytes(), 1613 } 1614 return out, metadata, err 1615 } 1616 1617 err = awsRestjson1_deserializeOpDocumentDeleteInsightOutput(&output, shape) 1618 if err != nil { 1619 var snapshot bytes.Buffer 1620 io.Copy(&snapshot, ringBuffer) 1621 return out, metadata, &smithy.DeserializationError{ 1622 Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), 1623 Snapshot: snapshot.Bytes(), 1624 } 1625 } 1626 1627 return out, metadata, err 1628} 1629 1630func awsRestjson1_deserializeOpErrorDeleteInsight(response *smithyhttp.Response, metadata *middleware.Metadata) error { 1631 var errorBuffer bytes.Buffer 1632 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 1633 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 1634 } 1635 errorBody := bytes.NewReader(errorBuffer.Bytes()) 1636 1637 errorCode := "UnknownError" 1638 errorMessage := errorCode 1639 1640 code := response.Header.Get("X-Amzn-ErrorType") 1641 if len(code) != 0 { 1642 errorCode = restjson.SanitizeErrorCode(code) 1643 } 1644 1645 var buff [1024]byte 1646 ringBuffer := smithyio.NewRingBuffer(buff[:]) 1647 1648 body := io.TeeReader(errorBody, ringBuffer) 1649 decoder := json.NewDecoder(body) 1650 decoder.UseNumber() 1651 code, message, err := restjson.GetErrorInfo(decoder) 1652 if err != nil { 1653 var snapshot bytes.Buffer 1654 io.Copy(&snapshot, ringBuffer) 1655 err = &smithy.DeserializationError{ 1656 Err: fmt.Errorf("failed to decode response body, %w", err), 1657 Snapshot: snapshot.Bytes(), 1658 } 1659 return err 1660 } 1661 1662 errorBody.Seek(0, io.SeekStart) 1663 if len(code) != 0 { 1664 errorCode = restjson.SanitizeErrorCode(code) 1665 } 1666 if len(message) != 0 { 1667 errorMessage = message 1668 } 1669 1670 switch { 1671 case strings.EqualFold("InternalException", errorCode): 1672 return awsRestjson1_deserializeErrorInternalException(response, errorBody) 1673 1674 case strings.EqualFold("InvalidAccessException", errorCode): 1675 return awsRestjson1_deserializeErrorInvalidAccessException(response, errorBody) 1676 1677 case strings.EqualFold("InvalidInputException", errorCode): 1678 return awsRestjson1_deserializeErrorInvalidInputException(response, errorBody) 1679 1680 case strings.EqualFold("LimitExceededException", errorCode): 1681 return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) 1682 1683 case strings.EqualFold("ResourceNotFoundException", errorCode): 1684 return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) 1685 1686 default: 1687 genericError := &smithy.GenericAPIError{ 1688 Code: errorCode, 1689 Message: errorMessage, 1690 } 1691 return genericError 1692 1693 } 1694} 1695 1696func awsRestjson1_deserializeOpDocumentDeleteInsightOutput(v **DeleteInsightOutput, value interface{}) error { 1697 if v == nil { 1698 return fmt.Errorf("unexpected nil of type %T", v) 1699 } 1700 if value == nil { 1701 return nil 1702 } 1703 1704 shape, ok := value.(map[string]interface{}) 1705 if !ok { 1706 return fmt.Errorf("unexpected JSON type %v", value) 1707 } 1708 1709 var sv *DeleteInsightOutput 1710 if *v == nil { 1711 sv = &DeleteInsightOutput{} 1712 } else { 1713 sv = *v 1714 } 1715 1716 for key, value := range shape { 1717 switch key { 1718 case "InsightArn": 1719 if value != nil { 1720 jtv, ok := value.(string) 1721 if !ok { 1722 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 1723 } 1724 sv.InsightArn = ptr.String(jtv) 1725 } 1726 1727 default: 1728 _, _ = key, value 1729 1730 } 1731 } 1732 *v = sv 1733 return nil 1734} 1735 1736type awsRestjson1_deserializeOpDeleteInvitations struct { 1737} 1738 1739func (*awsRestjson1_deserializeOpDeleteInvitations) ID() string { 1740 return "OperationDeserializer" 1741} 1742 1743func (m *awsRestjson1_deserializeOpDeleteInvitations) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 1744 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 1745) { 1746 out, metadata, err = next.HandleDeserialize(ctx, in) 1747 if err != nil { 1748 return out, metadata, err 1749 } 1750 1751 response, ok := out.RawResponse.(*smithyhttp.Response) 1752 if !ok { 1753 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 1754 } 1755 1756 if response.StatusCode < 200 || response.StatusCode >= 300 { 1757 return out, metadata, awsRestjson1_deserializeOpErrorDeleteInvitations(response, &metadata) 1758 } 1759 output := &DeleteInvitationsOutput{} 1760 out.Result = output 1761 1762 var buff [1024]byte 1763 ringBuffer := smithyio.NewRingBuffer(buff[:]) 1764 1765 body := io.TeeReader(response.Body, ringBuffer) 1766 1767 decoder := json.NewDecoder(body) 1768 decoder.UseNumber() 1769 var shape interface{} 1770 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 1771 var snapshot bytes.Buffer 1772 io.Copy(&snapshot, ringBuffer) 1773 err = &smithy.DeserializationError{ 1774 Err: fmt.Errorf("failed to decode response body, %w", err), 1775 Snapshot: snapshot.Bytes(), 1776 } 1777 return out, metadata, err 1778 } 1779 1780 err = awsRestjson1_deserializeOpDocumentDeleteInvitationsOutput(&output, shape) 1781 if err != nil { 1782 var snapshot bytes.Buffer 1783 io.Copy(&snapshot, ringBuffer) 1784 return out, metadata, &smithy.DeserializationError{ 1785 Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), 1786 Snapshot: snapshot.Bytes(), 1787 } 1788 } 1789 1790 return out, metadata, err 1791} 1792 1793func awsRestjson1_deserializeOpErrorDeleteInvitations(response *smithyhttp.Response, metadata *middleware.Metadata) error { 1794 var errorBuffer bytes.Buffer 1795 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 1796 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 1797 } 1798 errorBody := bytes.NewReader(errorBuffer.Bytes()) 1799 1800 errorCode := "UnknownError" 1801 errorMessage := errorCode 1802 1803 code := response.Header.Get("X-Amzn-ErrorType") 1804 if len(code) != 0 { 1805 errorCode = restjson.SanitizeErrorCode(code) 1806 } 1807 1808 var buff [1024]byte 1809 ringBuffer := smithyio.NewRingBuffer(buff[:]) 1810 1811 body := io.TeeReader(errorBody, ringBuffer) 1812 decoder := json.NewDecoder(body) 1813 decoder.UseNumber() 1814 code, message, err := restjson.GetErrorInfo(decoder) 1815 if err != nil { 1816 var snapshot bytes.Buffer 1817 io.Copy(&snapshot, ringBuffer) 1818 err = &smithy.DeserializationError{ 1819 Err: fmt.Errorf("failed to decode response body, %w", err), 1820 Snapshot: snapshot.Bytes(), 1821 } 1822 return err 1823 } 1824 1825 errorBody.Seek(0, io.SeekStart) 1826 if len(code) != 0 { 1827 errorCode = restjson.SanitizeErrorCode(code) 1828 } 1829 if len(message) != 0 { 1830 errorMessage = message 1831 } 1832 1833 switch { 1834 case strings.EqualFold("InternalException", errorCode): 1835 return awsRestjson1_deserializeErrorInternalException(response, errorBody) 1836 1837 case strings.EqualFold("InvalidAccessException", errorCode): 1838 return awsRestjson1_deserializeErrorInvalidAccessException(response, errorBody) 1839 1840 case strings.EqualFold("InvalidInputException", errorCode): 1841 return awsRestjson1_deserializeErrorInvalidInputException(response, errorBody) 1842 1843 case strings.EqualFold("LimitExceededException", errorCode): 1844 return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) 1845 1846 case strings.EqualFold("ResourceNotFoundException", errorCode): 1847 return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) 1848 1849 default: 1850 genericError := &smithy.GenericAPIError{ 1851 Code: errorCode, 1852 Message: errorMessage, 1853 } 1854 return genericError 1855 1856 } 1857} 1858 1859func awsRestjson1_deserializeOpDocumentDeleteInvitationsOutput(v **DeleteInvitationsOutput, value interface{}) error { 1860 if v == nil { 1861 return fmt.Errorf("unexpected nil of type %T", v) 1862 } 1863 if value == nil { 1864 return nil 1865 } 1866 1867 shape, ok := value.(map[string]interface{}) 1868 if !ok { 1869 return fmt.Errorf("unexpected JSON type %v", value) 1870 } 1871 1872 var sv *DeleteInvitationsOutput 1873 if *v == nil { 1874 sv = &DeleteInvitationsOutput{} 1875 } else { 1876 sv = *v 1877 } 1878 1879 for key, value := range shape { 1880 switch key { 1881 case "UnprocessedAccounts": 1882 if err := awsRestjson1_deserializeDocumentResultList(&sv.UnprocessedAccounts, value); err != nil { 1883 return err 1884 } 1885 1886 default: 1887 _, _ = key, value 1888 1889 } 1890 } 1891 *v = sv 1892 return nil 1893} 1894 1895type awsRestjson1_deserializeOpDeleteMembers struct { 1896} 1897 1898func (*awsRestjson1_deserializeOpDeleteMembers) ID() string { 1899 return "OperationDeserializer" 1900} 1901 1902func (m *awsRestjson1_deserializeOpDeleteMembers) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 1903 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 1904) { 1905 out, metadata, err = next.HandleDeserialize(ctx, in) 1906 if err != nil { 1907 return out, metadata, err 1908 } 1909 1910 response, ok := out.RawResponse.(*smithyhttp.Response) 1911 if !ok { 1912 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 1913 } 1914 1915 if response.StatusCode < 200 || response.StatusCode >= 300 { 1916 return out, metadata, awsRestjson1_deserializeOpErrorDeleteMembers(response, &metadata) 1917 } 1918 output := &DeleteMembersOutput{} 1919 out.Result = output 1920 1921 var buff [1024]byte 1922 ringBuffer := smithyio.NewRingBuffer(buff[:]) 1923 1924 body := io.TeeReader(response.Body, ringBuffer) 1925 1926 decoder := json.NewDecoder(body) 1927 decoder.UseNumber() 1928 var shape interface{} 1929 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 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 err = awsRestjson1_deserializeOpDocumentDeleteMembersOutput(&output, shape) 1940 if err != nil { 1941 var snapshot bytes.Buffer 1942 io.Copy(&snapshot, ringBuffer) 1943 return out, metadata, &smithy.DeserializationError{ 1944 Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), 1945 Snapshot: snapshot.Bytes(), 1946 } 1947 } 1948 1949 return out, metadata, err 1950} 1951 1952func awsRestjson1_deserializeOpErrorDeleteMembers(response *smithyhttp.Response, metadata *middleware.Metadata) error { 1953 var errorBuffer bytes.Buffer 1954 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 1955 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 1956 } 1957 errorBody := bytes.NewReader(errorBuffer.Bytes()) 1958 1959 errorCode := "UnknownError" 1960 errorMessage := errorCode 1961 1962 code := response.Header.Get("X-Amzn-ErrorType") 1963 if len(code) != 0 { 1964 errorCode = restjson.SanitizeErrorCode(code) 1965 } 1966 1967 var buff [1024]byte 1968 ringBuffer := smithyio.NewRingBuffer(buff[:]) 1969 1970 body := io.TeeReader(errorBody, ringBuffer) 1971 decoder := json.NewDecoder(body) 1972 decoder.UseNumber() 1973 code, message, err := restjson.GetErrorInfo(decoder) 1974 if err != nil { 1975 var snapshot bytes.Buffer 1976 io.Copy(&snapshot, ringBuffer) 1977 err = &smithy.DeserializationError{ 1978 Err: fmt.Errorf("failed to decode response body, %w", err), 1979 Snapshot: snapshot.Bytes(), 1980 } 1981 return err 1982 } 1983 1984 errorBody.Seek(0, io.SeekStart) 1985 if len(code) != 0 { 1986 errorCode = restjson.SanitizeErrorCode(code) 1987 } 1988 if len(message) != 0 { 1989 errorMessage = message 1990 } 1991 1992 switch { 1993 case strings.EqualFold("InternalException", errorCode): 1994 return awsRestjson1_deserializeErrorInternalException(response, errorBody) 1995 1996 case strings.EqualFold("InvalidAccessException", errorCode): 1997 return awsRestjson1_deserializeErrorInvalidAccessException(response, errorBody) 1998 1999 case strings.EqualFold("InvalidInputException", errorCode): 2000 return awsRestjson1_deserializeErrorInvalidInputException(response, errorBody) 2001 2002 case strings.EqualFold("LimitExceededException", errorCode): 2003 return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) 2004 2005 case strings.EqualFold("ResourceNotFoundException", errorCode): 2006 return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) 2007 2008 default: 2009 genericError := &smithy.GenericAPIError{ 2010 Code: errorCode, 2011 Message: errorMessage, 2012 } 2013 return genericError 2014 2015 } 2016} 2017 2018func awsRestjson1_deserializeOpDocumentDeleteMembersOutput(v **DeleteMembersOutput, value interface{}) error { 2019 if v == nil { 2020 return fmt.Errorf("unexpected nil of type %T", v) 2021 } 2022 if value == nil { 2023 return nil 2024 } 2025 2026 shape, ok := value.(map[string]interface{}) 2027 if !ok { 2028 return fmt.Errorf("unexpected JSON type %v", value) 2029 } 2030 2031 var sv *DeleteMembersOutput 2032 if *v == nil { 2033 sv = &DeleteMembersOutput{} 2034 } else { 2035 sv = *v 2036 } 2037 2038 for key, value := range shape { 2039 switch key { 2040 case "UnprocessedAccounts": 2041 if err := awsRestjson1_deserializeDocumentResultList(&sv.UnprocessedAccounts, value); err != nil { 2042 return err 2043 } 2044 2045 default: 2046 _, _ = key, value 2047 2048 } 2049 } 2050 *v = sv 2051 return nil 2052} 2053 2054type awsRestjson1_deserializeOpDescribeActionTargets struct { 2055} 2056 2057func (*awsRestjson1_deserializeOpDescribeActionTargets) ID() string { 2058 return "OperationDeserializer" 2059} 2060 2061func (m *awsRestjson1_deserializeOpDescribeActionTargets) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 2062 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 2063) { 2064 out, metadata, err = next.HandleDeserialize(ctx, in) 2065 if err != nil { 2066 return out, metadata, err 2067 } 2068 2069 response, ok := out.RawResponse.(*smithyhttp.Response) 2070 if !ok { 2071 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 2072 } 2073 2074 if response.StatusCode < 200 || response.StatusCode >= 300 { 2075 return out, metadata, awsRestjson1_deserializeOpErrorDescribeActionTargets(response, &metadata) 2076 } 2077 output := &DescribeActionTargetsOutput{} 2078 out.Result = output 2079 2080 var buff [1024]byte 2081 ringBuffer := smithyio.NewRingBuffer(buff[:]) 2082 2083 body := io.TeeReader(response.Body, ringBuffer) 2084 2085 decoder := json.NewDecoder(body) 2086 decoder.UseNumber() 2087 var shape interface{} 2088 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 2089 var snapshot bytes.Buffer 2090 io.Copy(&snapshot, ringBuffer) 2091 err = &smithy.DeserializationError{ 2092 Err: fmt.Errorf("failed to decode response body, %w", err), 2093 Snapshot: snapshot.Bytes(), 2094 } 2095 return out, metadata, err 2096 } 2097 2098 err = awsRestjson1_deserializeOpDocumentDescribeActionTargetsOutput(&output, shape) 2099 if err != nil { 2100 var snapshot bytes.Buffer 2101 io.Copy(&snapshot, ringBuffer) 2102 return out, metadata, &smithy.DeserializationError{ 2103 Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), 2104 Snapshot: snapshot.Bytes(), 2105 } 2106 } 2107 2108 return out, metadata, err 2109} 2110 2111func awsRestjson1_deserializeOpErrorDescribeActionTargets(response *smithyhttp.Response, metadata *middleware.Metadata) error { 2112 var errorBuffer bytes.Buffer 2113 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 2114 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 2115 } 2116 errorBody := bytes.NewReader(errorBuffer.Bytes()) 2117 2118 errorCode := "UnknownError" 2119 errorMessage := errorCode 2120 2121 code := response.Header.Get("X-Amzn-ErrorType") 2122 if len(code) != 0 { 2123 errorCode = restjson.SanitizeErrorCode(code) 2124 } 2125 2126 var buff [1024]byte 2127 ringBuffer := smithyio.NewRingBuffer(buff[:]) 2128 2129 body := io.TeeReader(errorBody, ringBuffer) 2130 decoder := json.NewDecoder(body) 2131 decoder.UseNumber() 2132 code, message, err := restjson.GetErrorInfo(decoder) 2133 if err != nil { 2134 var snapshot bytes.Buffer 2135 io.Copy(&snapshot, ringBuffer) 2136 err = &smithy.DeserializationError{ 2137 Err: fmt.Errorf("failed to decode response body, %w", err), 2138 Snapshot: snapshot.Bytes(), 2139 } 2140 return err 2141 } 2142 2143 errorBody.Seek(0, io.SeekStart) 2144 if len(code) != 0 { 2145 errorCode = restjson.SanitizeErrorCode(code) 2146 } 2147 if len(message) != 0 { 2148 errorMessage = message 2149 } 2150 2151 switch { 2152 case strings.EqualFold("InternalException", errorCode): 2153 return awsRestjson1_deserializeErrorInternalException(response, errorBody) 2154 2155 case strings.EqualFold("InvalidAccessException", errorCode): 2156 return awsRestjson1_deserializeErrorInvalidAccessException(response, errorBody) 2157 2158 case strings.EqualFold("InvalidInputException", errorCode): 2159 return awsRestjson1_deserializeErrorInvalidInputException(response, errorBody) 2160 2161 case strings.EqualFold("ResourceNotFoundException", errorCode): 2162 return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) 2163 2164 default: 2165 genericError := &smithy.GenericAPIError{ 2166 Code: errorCode, 2167 Message: errorMessage, 2168 } 2169 return genericError 2170 2171 } 2172} 2173 2174func awsRestjson1_deserializeOpDocumentDescribeActionTargetsOutput(v **DescribeActionTargetsOutput, value interface{}) error { 2175 if v == nil { 2176 return fmt.Errorf("unexpected nil of type %T", v) 2177 } 2178 if value == nil { 2179 return nil 2180 } 2181 2182 shape, ok := value.(map[string]interface{}) 2183 if !ok { 2184 return fmt.Errorf("unexpected JSON type %v", value) 2185 } 2186 2187 var sv *DescribeActionTargetsOutput 2188 if *v == nil { 2189 sv = &DescribeActionTargetsOutput{} 2190 } else { 2191 sv = *v 2192 } 2193 2194 for key, value := range shape { 2195 switch key { 2196 case "ActionTargets": 2197 if err := awsRestjson1_deserializeDocumentActionTargetList(&sv.ActionTargets, value); err != nil { 2198 return err 2199 } 2200 2201 case "NextToken": 2202 if value != nil { 2203 jtv, ok := value.(string) 2204 if !ok { 2205 return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) 2206 } 2207 sv.NextToken = ptr.String(jtv) 2208 } 2209 2210 default: 2211 _, _ = key, value 2212 2213 } 2214 } 2215 *v = sv 2216 return nil 2217} 2218 2219type awsRestjson1_deserializeOpDescribeHub struct { 2220} 2221 2222func (*awsRestjson1_deserializeOpDescribeHub) ID() string { 2223 return "OperationDeserializer" 2224} 2225 2226func (m *awsRestjson1_deserializeOpDescribeHub) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 2227 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 2228) { 2229 out, metadata, err = next.HandleDeserialize(ctx, in) 2230 if err != nil { 2231 return out, metadata, err 2232 } 2233 2234 response, ok := out.RawResponse.(*smithyhttp.Response) 2235 if !ok { 2236 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 2237 } 2238 2239 if response.StatusCode < 200 || response.StatusCode >= 300 { 2240 return out, metadata, awsRestjson1_deserializeOpErrorDescribeHub(response, &metadata) 2241 } 2242 output := &DescribeHubOutput{} 2243 out.Result = output 2244 2245 var buff [1024]byte 2246 ringBuffer := smithyio.NewRingBuffer(buff[:]) 2247 2248 body := io.TeeReader(response.Body, ringBuffer) 2249 2250 decoder := json.NewDecoder(body) 2251 decoder.UseNumber() 2252 var shape interface{} 2253 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 2254 var snapshot bytes.Buffer 2255 io.Copy(&snapshot, ringBuffer) 2256 err = &smithy.DeserializationError{ 2257 Err: fmt.Errorf("failed to decode response body, %w", err), 2258 Snapshot: snapshot.Bytes(), 2259 } 2260 return out, metadata, err 2261 } 2262 2263 err = awsRestjson1_deserializeOpDocumentDescribeHubOutput(&output, shape) 2264 if err != nil { 2265 var snapshot bytes.Buffer 2266 io.Copy(&snapshot, ringBuffer) 2267 return out, metadata, &smithy.DeserializationError{ 2268 Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), 2269 Snapshot: snapshot.Bytes(), 2270 } 2271 } 2272 2273 return out, metadata, err 2274} 2275 2276func awsRestjson1_deserializeOpErrorDescribeHub(response *smithyhttp.Response, metadata *middleware.Metadata) error { 2277 var errorBuffer bytes.Buffer 2278 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 2279 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 2280 } 2281 errorBody := bytes.NewReader(errorBuffer.Bytes()) 2282 2283 errorCode := "UnknownError" 2284 errorMessage := errorCode 2285 2286 code := response.Header.Get("X-Amzn-ErrorType") 2287 if len(code) != 0 { 2288 errorCode = restjson.SanitizeErrorCode(code) 2289 } 2290 2291 var buff [1024]byte 2292 ringBuffer := smithyio.NewRingBuffer(buff[:]) 2293 2294 body := io.TeeReader(errorBody, ringBuffer) 2295 decoder := json.NewDecoder(body) 2296 decoder.UseNumber() 2297 code, message, err := restjson.GetErrorInfo(decoder) 2298 if err != nil { 2299 var snapshot bytes.Buffer 2300 io.Copy(&snapshot, ringBuffer) 2301 err = &smithy.DeserializationError{ 2302 Err: fmt.Errorf("failed to decode response body, %w", err), 2303 Snapshot: snapshot.Bytes(), 2304 } 2305 return err 2306 } 2307 2308 errorBody.Seek(0, io.SeekStart) 2309 if len(code) != 0 { 2310 errorCode = restjson.SanitizeErrorCode(code) 2311 } 2312 if len(message) != 0 { 2313 errorMessage = message 2314 } 2315 2316 switch { 2317 case strings.EqualFold("InternalException", errorCode): 2318 return awsRestjson1_deserializeErrorInternalException(response, errorBody) 2319 2320 case strings.EqualFold("InvalidAccessException", errorCode): 2321 return awsRestjson1_deserializeErrorInvalidAccessException(response, errorBody) 2322 2323 case strings.EqualFold("InvalidInputException", errorCode): 2324 return awsRestjson1_deserializeErrorInvalidInputException(response, errorBody) 2325 2326 case strings.EqualFold("LimitExceededException", errorCode): 2327 return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) 2328 2329 case strings.EqualFold("ResourceNotFoundException", errorCode): 2330 return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) 2331 2332 default: 2333 genericError := &smithy.GenericAPIError{ 2334 Code: errorCode, 2335 Message: errorMessage, 2336 } 2337 return genericError 2338 2339 } 2340} 2341 2342func awsRestjson1_deserializeOpDocumentDescribeHubOutput(v **DescribeHubOutput, value interface{}) error { 2343 if v == nil { 2344 return fmt.Errorf("unexpected nil of type %T", v) 2345 } 2346 if value == nil { 2347 return nil 2348 } 2349 2350 shape, ok := value.(map[string]interface{}) 2351 if !ok { 2352 return fmt.Errorf("unexpected JSON type %v", value) 2353 } 2354 2355 var sv *DescribeHubOutput 2356 if *v == nil { 2357 sv = &DescribeHubOutput{} 2358 } else { 2359 sv = *v 2360 } 2361 2362 for key, value := range shape { 2363 switch key { 2364 case "AutoEnableControls": 2365 if value != nil { 2366 jtv, ok := value.(bool) 2367 if !ok { 2368 return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) 2369 } 2370 sv.AutoEnableControls = jtv 2371 } 2372 2373 case "HubArn": 2374 if value != nil { 2375 jtv, ok := value.(string) 2376 if !ok { 2377 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 2378 } 2379 sv.HubArn = ptr.String(jtv) 2380 } 2381 2382 case "SubscribedAt": 2383 if value != nil { 2384 jtv, ok := value.(string) 2385 if !ok { 2386 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 2387 } 2388 sv.SubscribedAt = ptr.String(jtv) 2389 } 2390 2391 default: 2392 _, _ = key, value 2393 2394 } 2395 } 2396 *v = sv 2397 return nil 2398} 2399 2400type awsRestjson1_deserializeOpDescribeOrganizationConfiguration struct { 2401} 2402 2403func (*awsRestjson1_deserializeOpDescribeOrganizationConfiguration) ID() string { 2404 return "OperationDeserializer" 2405} 2406 2407func (m *awsRestjson1_deserializeOpDescribeOrganizationConfiguration) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 2408 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 2409) { 2410 out, metadata, err = next.HandleDeserialize(ctx, in) 2411 if err != nil { 2412 return out, metadata, err 2413 } 2414 2415 response, ok := out.RawResponse.(*smithyhttp.Response) 2416 if !ok { 2417 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 2418 } 2419 2420 if response.StatusCode < 200 || response.StatusCode >= 300 { 2421 return out, metadata, awsRestjson1_deserializeOpErrorDescribeOrganizationConfiguration(response, &metadata) 2422 } 2423 output := &DescribeOrganizationConfigurationOutput{} 2424 out.Result = output 2425 2426 var buff [1024]byte 2427 ringBuffer := smithyio.NewRingBuffer(buff[:]) 2428 2429 body := io.TeeReader(response.Body, ringBuffer) 2430 2431 decoder := json.NewDecoder(body) 2432 decoder.UseNumber() 2433 var shape interface{} 2434 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 2435 var snapshot bytes.Buffer 2436 io.Copy(&snapshot, ringBuffer) 2437 err = &smithy.DeserializationError{ 2438 Err: fmt.Errorf("failed to decode response body, %w", err), 2439 Snapshot: snapshot.Bytes(), 2440 } 2441 return out, metadata, err 2442 } 2443 2444 err = awsRestjson1_deserializeOpDocumentDescribeOrganizationConfigurationOutput(&output, shape) 2445 if err != nil { 2446 var snapshot bytes.Buffer 2447 io.Copy(&snapshot, ringBuffer) 2448 return out, metadata, &smithy.DeserializationError{ 2449 Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), 2450 Snapshot: snapshot.Bytes(), 2451 } 2452 } 2453 2454 return out, metadata, err 2455} 2456 2457func awsRestjson1_deserializeOpErrorDescribeOrganizationConfiguration(response *smithyhttp.Response, metadata *middleware.Metadata) error { 2458 var errorBuffer bytes.Buffer 2459 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 2460 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 2461 } 2462 errorBody := bytes.NewReader(errorBuffer.Bytes()) 2463 2464 errorCode := "UnknownError" 2465 errorMessage := errorCode 2466 2467 code := response.Header.Get("X-Amzn-ErrorType") 2468 if len(code) != 0 { 2469 errorCode = restjson.SanitizeErrorCode(code) 2470 } 2471 2472 var buff [1024]byte 2473 ringBuffer := smithyio.NewRingBuffer(buff[:]) 2474 2475 body := io.TeeReader(errorBody, ringBuffer) 2476 decoder := json.NewDecoder(body) 2477 decoder.UseNumber() 2478 code, message, err := restjson.GetErrorInfo(decoder) 2479 if err != nil { 2480 var snapshot bytes.Buffer 2481 io.Copy(&snapshot, ringBuffer) 2482 err = &smithy.DeserializationError{ 2483 Err: fmt.Errorf("failed to decode response body, %w", err), 2484 Snapshot: snapshot.Bytes(), 2485 } 2486 return err 2487 } 2488 2489 errorBody.Seek(0, io.SeekStart) 2490 if len(code) != 0 { 2491 errorCode = restjson.SanitizeErrorCode(code) 2492 } 2493 if len(message) != 0 { 2494 errorMessage = message 2495 } 2496 2497 switch { 2498 case strings.EqualFold("InternalException", errorCode): 2499 return awsRestjson1_deserializeErrorInternalException(response, errorBody) 2500 2501 case strings.EqualFold("InvalidAccessException", errorCode): 2502 return awsRestjson1_deserializeErrorInvalidAccessException(response, errorBody) 2503 2504 case strings.EqualFold("InvalidInputException", errorCode): 2505 return awsRestjson1_deserializeErrorInvalidInputException(response, errorBody) 2506 2507 case strings.EqualFold("LimitExceededException", errorCode): 2508 return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) 2509 2510 default: 2511 genericError := &smithy.GenericAPIError{ 2512 Code: errorCode, 2513 Message: errorMessage, 2514 } 2515 return genericError 2516 2517 } 2518} 2519 2520func awsRestjson1_deserializeOpDocumentDescribeOrganizationConfigurationOutput(v **DescribeOrganizationConfigurationOutput, value interface{}) error { 2521 if v == nil { 2522 return fmt.Errorf("unexpected nil of type %T", v) 2523 } 2524 if value == nil { 2525 return nil 2526 } 2527 2528 shape, ok := value.(map[string]interface{}) 2529 if !ok { 2530 return fmt.Errorf("unexpected JSON type %v", value) 2531 } 2532 2533 var sv *DescribeOrganizationConfigurationOutput 2534 if *v == nil { 2535 sv = &DescribeOrganizationConfigurationOutput{} 2536 } else { 2537 sv = *v 2538 } 2539 2540 for key, value := range shape { 2541 switch key { 2542 case "AutoEnable": 2543 if value != nil { 2544 jtv, ok := value.(bool) 2545 if !ok { 2546 return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) 2547 } 2548 sv.AutoEnable = jtv 2549 } 2550 2551 case "MemberAccountLimitReached": 2552 if value != nil { 2553 jtv, ok := value.(bool) 2554 if !ok { 2555 return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) 2556 } 2557 sv.MemberAccountLimitReached = jtv 2558 } 2559 2560 default: 2561 _, _ = key, value 2562 2563 } 2564 } 2565 *v = sv 2566 return nil 2567} 2568 2569type awsRestjson1_deserializeOpDescribeProducts struct { 2570} 2571 2572func (*awsRestjson1_deserializeOpDescribeProducts) ID() string { 2573 return "OperationDeserializer" 2574} 2575 2576func (m *awsRestjson1_deserializeOpDescribeProducts) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 2577 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 2578) { 2579 out, metadata, err = next.HandleDeserialize(ctx, in) 2580 if err != nil { 2581 return out, metadata, err 2582 } 2583 2584 response, ok := out.RawResponse.(*smithyhttp.Response) 2585 if !ok { 2586 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 2587 } 2588 2589 if response.StatusCode < 200 || response.StatusCode >= 300 { 2590 return out, metadata, awsRestjson1_deserializeOpErrorDescribeProducts(response, &metadata) 2591 } 2592 output := &DescribeProductsOutput{} 2593 out.Result = output 2594 2595 var buff [1024]byte 2596 ringBuffer := smithyio.NewRingBuffer(buff[:]) 2597 2598 body := io.TeeReader(response.Body, ringBuffer) 2599 2600 decoder := json.NewDecoder(body) 2601 decoder.UseNumber() 2602 var shape interface{} 2603 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 2604 var snapshot bytes.Buffer 2605 io.Copy(&snapshot, ringBuffer) 2606 err = &smithy.DeserializationError{ 2607 Err: fmt.Errorf("failed to decode response body, %w", err), 2608 Snapshot: snapshot.Bytes(), 2609 } 2610 return out, metadata, err 2611 } 2612 2613 err = awsRestjson1_deserializeOpDocumentDescribeProductsOutput(&output, shape) 2614 if err != nil { 2615 var snapshot bytes.Buffer 2616 io.Copy(&snapshot, ringBuffer) 2617 return out, metadata, &smithy.DeserializationError{ 2618 Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), 2619 Snapshot: snapshot.Bytes(), 2620 } 2621 } 2622 2623 return out, metadata, err 2624} 2625 2626func awsRestjson1_deserializeOpErrorDescribeProducts(response *smithyhttp.Response, metadata *middleware.Metadata) error { 2627 var errorBuffer bytes.Buffer 2628 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 2629 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 2630 } 2631 errorBody := bytes.NewReader(errorBuffer.Bytes()) 2632 2633 errorCode := "UnknownError" 2634 errorMessage := errorCode 2635 2636 code := response.Header.Get("X-Amzn-ErrorType") 2637 if len(code) != 0 { 2638 errorCode = restjson.SanitizeErrorCode(code) 2639 } 2640 2641 var buff [1024]byte 2642 ringBuffer := smithyio.NewRingBuffer(buff[:]) 2643 2644 body := io.TeeReader(errorBody, ringBuffer) 2645 decoder := json.NewDecoder(body) 2646 decoder.UseNumber() 2647 code, message, err := restjson.GetErrorInfo(decoder) 2648 if err != nil { 2649 var snapshot bytes.Buffer 2650 io.Copy(&snapshot, ringBuffer) 2651 err = &smithy.DeserializationError{ 2652 Err: fmt.Errorf("failed to decode response body, %w", err), 2653 Snapshot: snapshot.Bytes(), 2654 } 2655 return err 2656 } 2657 2658 errorBody.Seek(0, io.SeekStart) 2659 if len(code) != 0 { 2660 errorCode = restjson.SanitizeErrorCode(code) 2661 } 2662 if len(message) != 0 { 2663 errorMessage = message 2664 } 2665 2666 switch { 2667 case strings.EqualFold("InternalException", errorCode): 2668 return awsRestjson1_deserializeErrorInternalException(response, errorBody) 2669 2670 case strings.EqualFold("InvalidAccessException", errorCode): 2671 return awsRestjson1_deserializeErrorInvalidAccessException(response, errorBody) 2672 2673 case strings.EqualFold("InvalidInputException", errorCode): 2674 return awsRestjson1_deserializeErrorInvalidInputException(response, errorBody) 2675 2676 case strings.EqualFold("LimitExceededException", errorCode): 2677 return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) 2678 2679 default: 2680 genericError := &smithy.GenericAPIError{ 2681 Code: errorCode, 2682 Message: errorMessage, 2683 } 2684 return genericError 2685 2686 } 2687} 2688 2689func awsRestjson1_deserializeOpDocumentDescribeProductsOutput(v **DescribeProductsOutput, value interface{}) error { 2690 if v == nil { 2691 return fmt.Errorf("unexpected nil of type %T", v) 2692 } 2693 if value == nil { 2694 return nil 2695 } 2696 2697 shape, ok := value.(map[string]interface{}) 2698 if !ok { 2699 return fmt.Errorf("unexpected JSON type %v", value) 2700 } 2701 2702 var sv *DescribeProductsOutput 2703 if *v == nil { 2704 sv = &DescribeProductsOutput{} 2705 } else { 2706 sv = *v 2707 } 2708 2709 for key, value := range shape { 2710 switch key { 2711 case "NextToken": 2712 if value != nil { 2713 jtv, ok := value.(string) 2714 if !ok { 2715 return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) 2716 } 2717 sv.NextToken = ptr.String(jtv) 2718 } 2719 2720 case "Products": 2721 if err := awsRestjson1_deserializeDocumentProductsList(&sv.Products, value); err != nil { 2722 return err 2723 } 2724 2725 default: 2726 _, _ = key, value 2727 2728 } 2729 } 2730 *v = sv 2731 return nil 2732} 2733 2734type awsRestjson1_deserializeOpDescribeStandards struct { 2735} 2736 2737func (*awsRestjson1_deserializeOpDescribeStandards) ID() string { 2738 return "OperationDeserializer" 2739} 2740 2741func (m *awsRestjson1_deserializeOpDescribeStandards) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 2742 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 2743) { 2744 out, metadata, err = next.HandleDeserialize(ctx, in) 2745 if err != nil { 2746 return out, metadata, err 2747 } 2748 2749 response, ok := out.RawResponse.(*smithyhttp.Response) 2750 if !ok { 2751 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 2752 } 2753 2754 if response.StatusCode < 200 || response.StatusCode >= 300 { 2755 return out, metadata, awsRestjson1_deserializeOpErrorDescribeStandards(response, &metadata) 2756 } 2757 output := &DescribeStandardsOutput{} 2758 out.Result = output 2759 2760 var buff [1024]byte 2761 ringBuffer := smithyio.NewRingBuffer(buff[:]) 2762 2763 body := io.TeeReader(response.Body, ringBuffer) 2764 2765 decoder := json.NewDecoder(body) 2766 decoder.UseNumber() 2767 var shape interface{} 2768 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 2769 var snapshot bytes.Buffer 2770 io.Copy(&snapshot, ringBuffer) 2771 err = &smithy.DeserializationError{ 2772 Err: fmt.Errorf("failed to decode response body, %w", err), 2773 Snapshot: snapshot.Bytes(), 2774 } 2775 return out, metadata, err 2776 } 2777 2778 err = awsRestjson1_deserializeOpDocumentDescribeStandardsOutput(&output, shape) 2779 if err != nil { 2780 var snapshot bytes.Buffer 2781 io.Copy(&snapshot, ringBuffer) 2782 return out, metadata, &smithy.DeserializationError{ 2783 Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), 2784 Snapshot: snapshot.Bytes(), 2785 } 2786 } 2787 2788 return out, metadata, err 2789} 2790 2791func awsRestjson1_deserializeOpErrorDescribeStandards(response *smithyhttp.Response, metadata *middleware.Metadata) error { 2792 var errorBuffer bytes.Buffer 2793 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 2794 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 2795 } 2796 errorBody := bytes.NewReader(errorBuffer.Bytes()) 2797 2798 errorCode := "UnknownError" 2799 errorMessage := errorCode 2800 2801 code := response.Header.Get("X-Amzn-ErrorType") 2802 if len(code) != 0 { 2803 errorCode = restjson.SanitizeErrorCode(code) 2804 } 2805 2806 var buff [1024]byte 2807 ringBuffer := smithyio.NewRingBuffer(buff[:]) 2808 2809 body := io.TeeReader(errorBody, ringBuffer) 2810 decoder := json.NewDecoder(body) 2811 decoder.UseNumber() 2812 code, message, err := restjson.GetErrorInfo(decoder) 2813 if err != nil { 2814 var snapshot bytes.Buffer 2815 io.Copy(&snapshot, ringBuffer) 2816 err = &smithy.DeserializationError{ 2817 Err: fmt.Errorf("failed to decode response body, %w", err), 2818 Snapshot: snapshot.Bytes(), 2819 } 2820 return err 2821 } 2822 2823 errorBody.Seek(0, io.SeekStart) 2824 if len(code) != 0 { 2825 errorCode = restjson.SanitizeErrorCode(code) 2826 } 2827 if len(message) != 0 { 2828 errorMessage = message 2829 } 2830 2831 switch { 2832 case strings.EqualFold("InternalException", errorCode): 2833 return awsRestjson1_deserializeErrorInternalException(response, errorBody) 2834 2835 case strings.EqualFold("InvalidAccessException", errorCode): 2836 return awsRestjson1_deserializeErrorInvalidAccessException(response, errorBody) 2837 2838 case strings.EqualFold("InvalidInputException", errorCode): 2839 return awsRestjson1_deserializeErrorInvalidInputException(response, errorBody) 2840 2841 default: 2842 genericError := &smithy.GenericAPIError{ 2843 Code: errorCode, 2844 Message: errorMessage, 2845 } 2846 return genericError 2847 2848 } 2849} 2850 2851func awsRestjson1_deserializeOpDocumentDescribeStandardsOutput(v **DescribeStandardsOutput, value interface{}) error { 2852 if v == nil { 2853 return fmt.Errorf("unexpected nil of type %T", v) 2854 } 2855 if value == nil { 2856 return nil 2857 } 2858 2859 shape, ok := value.(map[string]interface{}) 2860 if !ok { 2861 return fmt.Errorf("unexpected JSON type %v", value) 2862 } 2863 2864 var sv *DescribeStandardsOutput 2865 if *v == nil { 2866 sv = &DescribeStandardsOutput{} 2867 } else { 2868 sv = *v 2869 } 2870 2871 for key, value := range shape { 2872 switch key { 2873 case "NextToken": 2874 if value != nil { 2875 jtv, ok := value.(string) 2876 if !ok { 2877 return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) 2878 } 2879 sv.NextToken = ptr.String(jtv) 2880 } 2881 2882 case "Standards": 2883 if err := awsRestjson1_deserializeDocumentStandards(&sv.Standards, value); err != nil { 2884 return err 2885 } 2886 2887 default: 2888 _, _ = key, value 2889 2890 } 2891 } 2892 *v = sv 2893 return nil 2894} 2895 2896type awsRestjson1_deserializeOpDescribeStandardsControls struct { 2897} 2898 2899func (*awsRestjson1_deserializeOpDescribeStandardsControls) ID() string { 2900 return "OperationDeserializer" 2901} 2902 2903func (m *awsRestjson1_deserializeOpDescribeStandardsControls) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 2904 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 2905) { 2906 out, metadata, err = next.HandleDeserialize(ctx, in) 2907 if err != nil { 2908 return out, metadata, err 2909 } 2910 2911 response, ok := out.RawResponse.(*smithyhttp.Response) 2912 if !ok { 2913 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 2914 } 2915 2916 if response.StatusCode < 200 || response.StatusCode >= 300 { 2917 return out, metadata, awsRestjson1_deserializeOpErrorDescribeStandardsControls(response, &metadata) 2918 } 2919 output := &DescribeStandardsControlsOutput{} 2920 out.Result = output 2921 2922 var buff [1024]byte 2923 ringBuffer := smithyio.NewRingBuffer(buff[:]) 2924 2925 body := io.TeeReader(response.Body, ringBuffer) 2926 2927 decoder := json.NewDecoder(body) 2928 decoder.UseNumber() 2929 var shape interface{} 2930 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 2931 var snapshot bytes.Buffer 2932 io.Copy(&snapshot, ringBuffer) 2933 err = &smithy.DeserializationError{ 2934 Err: fmt.Errorf("failed to decode response body, %w", err), 2935 Snapshot: snapshot.Bytes(), 2936 } 2937 return out, metadata, err 2938 } 2939 2940 err = awsRestjson1_deserializeOpDocumentDescribeStandardsControlsOutput(&output, shape) 2941 if err != nil { 2942 var snapshot bytes.Buffer 2943 io.Copy(&snapshot, ringBuffer) 2944 return out, metadata, &smithy.DeserializationError{ 2945 Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), 2946 Snapshot: snapshot.Bytes(), 2947 } 2948 } 2949 2950 return out, metadata, err 2951} 2952 2953func awsRestjson1_deserializeOpErrorDescribeStandardsControls(response *smithyhttp.Response, metadata *middleware.Metadata) error { 2954 var errorBuffer bytes.Buffer 2955 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 2956 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 2957 } 2958 errorBody := bytes.NewReader(errorBuffer.Bytes()) 2959 2960 errorCode := "UnknownError" 2961 errorMessage := errorCode 2962 2963 code := response.Header.Get("X-Amzn-ErrorType") 2964 if len(code) != 0 { 2965 errorCode = restjson.SanitizeErrorCode(code) 2966 } 2967 2968 var buff [1024]byte 2969 ringBuffer := smithyio.NewRingBuffer(buff[:]) 2970 2971 body := io.TeeReader(errorBody, ringBuffer) 2972 decoder := json.NewDecoder(body) 2973 decoder.UseNumber() 2974 code, message, err := restjson.GetErrorInfo(decoder) 2975 if err != nil { 2976 var snapshot bytes.Buffer 2977 io.Copy(&snapshot, ringBuffer) 2978 err = &smithy.DeserializationError{ 2979 Err: fmt.Errorf("failed to decode response body, %w", err), 2980 Snapshot: snapshot.Bytes(), 2981 } 2982 return err 2983 } 2984 2985 errorBody.Seek(0, io.SeekStart) 2986 if len(code) != 0 { 2987 errorCode = restjson.SanitizeErrorCode(code) 2988 } 2989 if len(message) != 0 { 2990 errorMessage = message 2991 } 2992 2993 switch { 2994 case strings.EqualFold("InternalException", errorCode): 2995 return awsRestjson1_deserializeErrorInternalException(response, errorBody) 2996 2997 case strings.EqualFold("InvalidAccessException", errorCode): 2998 return awsRestjson1_deserializeErrorInvalidAccessException(response, errorBody) 2999 3000 case strings.EqualFold("InvalidInputException", errorCode): 3001 return awsRestjson1_deserializeErrorInvalidInputException(response, errorBody) 3002 3003 case strings.EqualFold("ResourceNotFoundException", errorCode): 3004 return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) 3005 3006 default: 3007 genericError := &smithy.GenericAPIError{ 3008 Code: errorCode, 3009 Message: errorMessage, 3010 } 3011 return genericError 3012 3013 } 3014} 3015 3016func awsRestjson1_deserializeOpDocumentDescribeStandardsControlsOutput(v **DescribeStandardsControlsOutput, value interface{}) error { 3017 if v == nil { 3018 return fmt.Errorf("unexpected nil of type %T", v) 3019 } 3020 if value == nil { 3021 return nil 3022 } 3023 3024 shape, ok := value.(map[string]interface{}) 3025 if !ok { 3026 return fmt.Errorf("unexpected JSON type %v", value) 3027 } 3028 3029 var sv *DescribeStandardsControlsOutput 3030 if *v == nil { 3031 sv = &DescribeStandardsControlsOutput{} 3032 } else { 3033 sv = *v 3034 } 3035 3036 for key, value := range shape { 3037 switch key { 3038 case "Controls": 3039 if err := awsRestjson1_deserializeDocumentStandardsControls(&sv.Controls, value); err != nil { 3040 return err 3041 } 3042 3043 case "NextToken": 3044 if value != nil { 3045 jtv, ok := value.(string) 3046 if !ok { 3047 return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) 3048 } 3049 sv.NextToken = ptr.String(jtv) 3050 } 3051 3052 default: 3053 _, _ = key, value 3054 3055 } 3056 } 3057 *v = sv 3058 return nil 3059} 3060 3061type awsRestjson1_deserializeOpDisableImportFindingsForProduct struct { 3062} 3063 3064func (*awsRestjson1_deserializeOpDisableImportFindingsForProduct) ID() string { 3065 return "OperationDeserializer" 3066} 3067 3068func (m *awsRestjson1_deserializeOpDisableImportFindingsForProduct) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 3069 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 3070) { 3071 out, metadata, err = next.HandleDeserialize(ctx, in) 3072 if err != nil { 3073 return out, metadata, err 3074 } 3075 3076 response, ok := out.RawResponse.(*smithyhttp.Response) 3077 if !ok { 3078 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 3079 } 3080 3081 if response.StatusCode < 200 || response.StatusCode >= 300 { 3082 return out, metadata, awsRestjson1_deserializeOpErrorDisableImportFindingsForProduct(response, &metadata) 3083 } 3084 output := &DisableImportFindingsForProductOutput{} 3085 out.Result = output 3086 3087 return out, metadata, err 3088} 3089 3090func awsRestjson1_deserializeOpErrorDisableImportFindingsForProduct(response *smithyhttp.Response, metadata *middleware.Metadata) error { 3091 var errorBuffer bytes.Buffer 3092 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 3093 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 3094 } 3095 errorBody := bytes.NewReader(errorBuffer.Bytes()) 3096 3097 errorCode := "UnknownError" 3098 errorMessage := errorCode 3099 3100 code := response.Header.Get("X-Amzn-ErrorType") 3101 if len(code) != 0 { 3102 errorCode = restjson.SanitizeErrorCode(code) 3103 } 3104 3105 var buff [1024]byte 3106 ringBuffer := smithyio.NewRingBuffer(buff[:]) 3107 3108 body := io.TeeReader(errorBody, ringBuffer) 3109 decoder := json.NewDecoder(body) 3110 decoder.UseNumber() 3111 code, message, err := restjson.GetErrorInfo(decoder) 3112 if err != nil { 3113 var snapshot bytes.Buffer 3114 io.Copy(&snapshot, ringBuffer) 3115 err = &smithy.DeserializationError{ 3116 Err: fmt.Errorf("failed to decode response body, %w", err), 3117 Snapshot: snapshot.Bytes(), 3118 } 3119 return err 3120 } 3121 3122 errorBody.Seek(0, io.SeekStart) 3123 if len(code) != 0 { 3124 errorCode = restjson.SanitizeErrorCode(code) 3125 } 3126 if len(message) != 0 { 3127 errorMessage = message 3128 } 3129 3130 switch { 3131 case strings.EqualFold("InternalException", errorCode): 3132 return awsRestjson1_deserializeErrorInternalException(response, errorBody) 3133 3134 case strings.EqualFold("InvalidAccessException", errorCode): 3135 return awsRestjson1_deserializeErrorInvalidAccessException(response, errorBody) 3136 3137 case strings.EqualFold("InvalidInputException", errorCode): 3138 return awsRestjson1_deserializeErrorInvalidInputException(response, errorBody) 3139 3140 case strings.EqualFold("LimitExceededException", errorCode): 3141 return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) 3142 3143 case strings.EqualFold("ResourceNotFoundException", errorCode): 3144 return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) 3145 3146 default: 3147 genericError := &smithy.GenericAPIError{ 3148 Code: errorCode, 3149 Message: errorMessage, 3150 } 3151 return genericError 3152 3153 } 3154} 3155 3156type awsRestjson1_deserializeOpDisableOrganizationAdminAccount struct { 3157} 3158 3159func (*awsRestjson1_deserializeOpDisableOrganizationAdminAccount) ID() string { 3160 return "OperationDeserializer" 3161} 3162 3163func (m *awsRestjson1_deserializeOpDisableOrganizationAdminAccount) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 3164 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 3165) { 3166 out, metadata, err = next.HandleDeserialize(ctx, in) 3167 if err != nil { 3168 return out, metadata, err 3169 } 3170 3171 response, ok := out.RawResponse.(*smithyhttp.Response) 3172 if !ok { 3173 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 3174 } 3175 3176 if response.StatusCode < 200 || response.StatusCode >= 300 { 3177 return out, metadata, awsRestjson1_deserializeOpErrorDisableOrganizationAdminAccount(response, &metadata) 3178 } 3179 output := &DisableOrganizationAdminAccountOutput{} 3180 out.Result = output 3181 3182 return out, metadata, err 3183} 3184 3185func awsRestjson1_deserializeOpErrorDisableOrganizationAdminAccount(response *smithyhttp.Response, metadata *middleware.Metadata) error { 3186 var errorBuffer bytes.Buffer 3187 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 3188 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 3189 } 3190 errorBody := bytes.NewReader(errorBuffer.Bytes()) 3191 3192 errorCode := "UnknownError" 3193 errorMessage := errorCode 3194 3195 code := response.Header.Get("X-Amzn-ErrorType") 3196 if len(code) != 0 { 3197 errorCode = restjson.SanitizeErrorCode(code) 3198 } 3199 3200 var buff [1024]byte 3201 ringBuffer := smithyio.NewRingBuffer(buff[:]) 3202 3203 body := io.TeeReader(errorBody, ringBuffer) 3204 decoder := json.NewDecoder(body) 3205 decoder.UseNumber() 3206 code, message, err := restjson.GetErrorInfo(decoder) 3207 if err != nil { 3208 var snapshot bytes.Buffer 3209 io.Copy(&snapshot, ringBuffer) 3210 err = &smithy.DeserializationError{ 3211 Err: fmt.Errorf("failed to decode response body, %w", err), 3212 Snapshot: snapshot.Bytes(), 3213 } 3214 return err 3215 } 3216 3217 errorBody.Seek(0, io.SeekStart) 3218 if len(code) != 0 { 3219 errorCode = restjson.SanitizeErrorCode(code) 3220 } 3221 if len(message) != 0 { 3222 errorMessage = message 3223 } 3224 3225 switch { 3226 case strings.EqualFold("InternalException", errorCode): 3227 return awsRestjson1_deserializeErrorInternalException(response, errorBody) 3228 3229 case strings.EqualFold("InvalidAccessException", errorCode): 3230 return awsRestjson1_deserializeErrorInvalidAccessException(response, errorBody) 3231 3232 case strings.EqualFold("InvalidInputException", errorCode): 3233 return awsRestjson1_deserializeErrorInvalidInputException(response, errorBody) 3234 3235 case strings.EqualFold("LimitExceededException", errorCode): 3236 return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) 3237 3238 default: 3239 genericError := &smithy.GenericAPIError{ 3240 Code: errorCode, 3241 Message: errorMessage, 3242 } 3243 return genericError 3244 3245 } 3246} 3247 3248type awsRestjson1_deserializeOpDisableSecurityHub struct { 3249} 3250 3251func (*awsRestjson1_deserializeOpDisableSecurityHub) ID() string { 3252 return "OperationDeserializer" 3253} 3254 3255func (m *awsRestjson1_deserializeOpDisableSecurityHub) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 3256 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 3257) { 3258 out, metadata, err = next.HandleDeserialize(ctx, in) 3259 if err != nil { 3260 return out, metadata, err 3261 } 3262 3263 response, ok := out.RawResponse.(*smithyhttp.Response) 3264 if !ok { 3265 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 3266 } 3267 3268 if response.StatusCode < 200 || response.StatusCode >= 300 { 3269 return out, metadata, awsRestjson1_deserializeOpErrorDisableSecurityHub(response, &metadata) 3270 } 3271 output := &DisableSecurityHubOutput{} 3272 out.Result = output 3273 3274 return out, metadata, err 3275} 3276 3277func awsRestjson1_deserializeOpErrorDisableSecurityHub(response *smithyhttp.Response, metadata *middleware.Metadata) error { 3278 var errorBuffer bytes.Buffer 3279 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 3280 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 3281 } 3282 errorBody := bytes.NewReader(errorBuffer.Bytes()) 3283 3284 errorCode := "UnknownError" 3285 errorMessage := errorCode 3286 3287 code := response.Header.Get("X-Amzn-ErrorType") 3288 if len(code) != 0 { 3289 errorCode = restjson.SanitizeErrorCode(code) 3290 } 3291 3292 var buff [1024]byte 3293 ringBuffer := smithyio.NewRingBuffer(buff[:]) 3294 3295 body := io.TeeReader(errorBody, ringBuffer) 3296 decoder := json.NewDecoder(body) 3297 decoder.UseNumber() 3298 code, message, err := restjson.GetErrorInfo(decoder) 3299 if err != nil { 3300 var snapshot bytes.Buffer 3301 io.Copy(&snapshot, ringBuffer) 3302 err = &smithy.DeserializationError{ 3303 Err: fmt.Errorf("failed to decode response body, %w", err), 3304 Snapshot: snapshot.Bytes(), 3305 } 3306 return err 3307 } 3308 3309 errorBody.Seek(0, io.SeekStart) 3310 if len(code) != 0 { 3311 errorCode = restjson.SanitizeErrorCode(code) 3312 } 3313 if len(message) != 0 { 3314 errorMessage = message 3315 } 3316 3317 switch { 3318 case strings.EqualFold("InternalException", errorCode): 3319 return awsRestjson1_deserializeErrorInternalException(response, errorBody) 3320 3321 case strings.EqualFold("InvalidAccessException", errorCode): 3322 return awsRestjson1_deserializeErrorInvalidAccessException(response, errorBody) 3323 3324 case strings.EqualFold("LimitExceededException", errorCode): 3325 return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) 3326 3327 case strings.EqualFold("ResourceNotFoundException", errorCode): 3328 return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) 3329 3330 default: 3331 genericError := &smithy.GenericAPIError{ 3332 Code: errorCode, 3333 Message: errorMessage, 3334 } 3335 return genericError 3336 3337 } 3338} 3339 3340type awsRestjson1_deserializeOpDisassociateFromMasterAccount struct { 3341} 3342 3343func (*awsRestjson1_deserializeOpDisassociateFromMasterAccount) ID() string { 3344 return "OperationDeserializer" 3345} 3346 3347func (m *awsRestjson1_deserializeOpDisassociateFromMasterAccount) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 3348 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 3349) { 3350 out, metadata, err = next.HandleDeserialize(ctx, in) 3351 if err != nil { 3352 return out, metadata, err 3353 } 3354 3355 response, ok := out.RawResponse.(*smithyhttp.Response) 3356 if !ok { 3357 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 3358 } 3359 3360 if response.StatusCode < 200 || response.StatusCode >= 300 { 3361 return out, metadata, awsRestjson1_deserializeOpErrorDisassociateFromMasterAccount(response, &metadata) 3362 } 3363 output := &DisassociateFromMasterAccountOutput{} 3364 out.Result = output 3365 3366 return out, metadata, err 3367} 3368 3369func awsRestjson1_deserializeOpErrorDisassociateFromMasterAccount(response *smithyhttp.Response, metadata *middleware.Metadata) error { 3370 var errorBuffer bytes.Buffer 3371 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 3372 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 3373 } 3374 errorBody := bytes.NewReader(errorBuffer.Bytes()) 3375 3376 errorCode := "UnknownError" 3377 errorMessage := errorCode 3378 3379 code := response.Header.Get("X-Amzn-ErrorType") 3380 if len(code) != 0 { 3381 errorCode = restjson.SanitizeErrorCode(code) 3382 } 3383 3384 var buff [1024]byte 3385 ringBuffer := smithyio.NewRingBuffer(buff[:]) 3386 3387 body := io.TeeReader(errorBody, ringBuffer) 3388 decoder := json.NewDecoder(body) 3389 decoder.UseNumber() 3390 code, message, err := restjson.GetErrorInfo(decoder) 3391 if err != nil { 3392 var snapshot bytes.Buffer 3393 io.Copy(&snapshot, ringBuffer) 3394 err = &smithy.DeserializationError{ 3395 Err: fmt.Errorf("failed to decode response body, %w", err), 3396 Snapshot: snapshot.Bytes(), 3397 } 3398 return err 3399 } 3400 3401 errorBody.Seek(0, io.SeekStart) 3402 if len(code) != 0 { 3403 errorCode = restjson.SanitizeErrorCode(code) 3404 } 3405 if len(message) != 0 { 3406 errorMessage = message 3407 } 3408 3409 switch { 3410 case strings.EqualFold("InternalException", errorCode): 3411 return awsRestjson1_deserializeErrorInternalException(response, errorBody) 3412 3413 case strings.EqualFold("InvalidAccessException", errorCode): 3414 return awsRestjson1_deserializeErrorInvalidAccessException(response, errorBody) 3415 3416 case strings.EqualFold("InvalidInputException", errorCode): 3417 return awsRestjson1_deserializeErrorInvalidInputException(response, errorBody) 3418 3419 case strings.EqualFold("LimitExceededException", errorCode): 3420 return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) 3421 3422 case strings.EqualFold("ResourceNotFoundException", errorCode): 3423 return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) 3424 3425 default: 3426 genericError := &smithy.GenericAPIError{ 3427 Code: errorCode, 3428 Message: errorMessage, 3429 } 3430 return genericError 3431 3432 } 3433} 3434 3435type awsRestjson1_deserializeOpDisassociateMembers struct { 3436} 3437 3438func (*awsRestjson1_deserializeOpDisassociateMembers) ID() string { 3439 return "OperationDeserializer" 3440} 3441 3442func (m *awsRestjson1_deserializeOpDisassociateMembers) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 3443 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 3444) { 3445 out, metadata, err = next.HandleDeserialize(ctx, in) 3446 if err != nil { 3447 return out, metadata, err 3448 } 3449 3450 response, ok := out.RawResponse.(*smithyhttp.Response) 3451 if !ok { 3452 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 3453 } 3454 3455 if response.StatusCode < 200 || response.StatusCode >= 300 { 3456 return out, metadata, awsRestjson1_deserializeOpErrorDisassociateMembers(response, &metadata) 3457 } 3458 output := &DisassociateMembersOutput{} 3459 out.Result = output 3460 3461 return out, metadata, err 3462} 3463 3464func awsRestjson1_deserializeOpErrorDisassociateMembers(response *smithyhttp.Response, metadata *middleware.Metadata) error { 3465 var errorBuffer bytes.Buffer 3466 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 3467 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 3468 } 3469 errorBody := bytes.NewReader(errorBuffer.Bytes()) 3470 3471 errorCode := "UnknownError" 3472 errorMessage := errorCode 3473 3474 code := response.Header.Get("X-Amzn-ErrorType") 3475 if len(code) != 0 { 3476 errorCode = restjson.SanitizeErrorCode(code) 3477 } 3478 3479 var buff [1024]byte 3480 ringBuffer := smithyio.NewRingBuffer(buff[:]) 3481 3482 body := io.TeeReader(errorBody, ringBuffer) 3483 decoder := json.NewDecoder(body) 3484 decoder.UseNumber() 3485 code, message, err := restjson.GetErrorInfo(decoder) 3486 if err != nil { 3487 var snapshot bytes.Buffer 3488 io.Copy(&snapshot, ringBuffer) 3489 err = &smithy.DeserializationError{ 3490 Err: fmt.Errorf("failed to decode response body, %w", err), 3491 Snapshot: snapshot.Bytes(), 3492 } 3493 return err 3494 } 3495 3496 errorBody.Seek(0, io.SeekStart) 3497 if len(code) != 0 { 3498 errorCode = restjson.SanitizeErrorCode(code) 3499 } 3500 if len(message) != 0 { 3501 errorMessage = message 3502 } 3503 3504 switch { 3505 case strings.EqualFold("InternalException", errorCode): 3506 return awsRestjson1_deserializeErrorInternalException(response, errorBody) 3507 3508 case strings.EqualFold("InvalidAccessException", errorCode): 3509 return awsRestjson1_deserializeErrorInvalidAccessException(response, errorBody) 3510 3511 case strings.EqualFold("InvalidInputException", errorCode): 3512 return awsRestjson1_deserializeErrorInvalidInputException(response, errorBody) 3513 3514 case strings.EqualFold("LimitExceededException", errorCode): 3515 return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) 3516 3517 case strings.EqualFold("ResourceNotFoundException", errorCode): 3518 return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) 3519 3520 default: 3521 genericError := &smithy.GenericAPIError{ 3522 Code: errorCode, 3523 Message: errorMessage, 3524 } 3525 return genericError 3526 3527 } 3528} 3529 3530type awsRestjson1_deserializeOpEnableImportFindingsForProduct struct { 3531} 3532 3533func (*awsRestjson1_deserializeOpEnableImportFindingsForProduct) ID() string { 3534 return "OperationDeserializer" 3535} 3536 3537func (m *awsRestjson1_deserializeOpEnableImportFindingsForProduct) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 3538 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 3539) { 3540 out, metadata, err = next.HandleDeserialize(ctx, in) 3541 if err != nil { 3542 return out, metadata, err 3543 } 3544 3545 response, ok := out.RawResponse.(*smithyhttp.Response) 3546 if !ok { 3547 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 3548 } 3549 3550 if response.StatusCode < 200 || response.StatusCode >= 300 { 3551 return out, metadata, awsRestjson1_deserializeOpErrorEnableImportFindingsForProduct(response, &metadata) 3552 } 3553 output := &EnableImportFindingsForProductOutput{} 3554 out.Result = output 3555 3556 var buff [1024]byte 3557 ringBuffer := smithyio.NewRingBuffer(buff[:]) 3558 3559 body := io.TeeReader(response.Body, ringBuffer) 3560 3561 decoder := json.NewDecoder(body) 3562 decoder.UseNumber() 3563 var shape interface{} 3564 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 3565 var snapshot bytes.Buffer 3566 io.Copy(&snapshot, ringBuffer) 3567 err = &smithy.DeserializationError{ 3568 Err: fmt.Errorf("failed to decode response body, %w", err), 3569 Snapshot: snapshot.Bytes(), 3570 } 3571 return out, metadata, err 3572 } 3573 3574 err = awsRestjson1_deserializeOpDocumentEnableImportFindingsForProductOutput(&output, shape) 3575 if err != nil { 3576 var snapshot bytes.Buffer 3577 io.Copy(&snapshot, ringBuffer) 3578 return out, metadata, &smithy.DeserializationError{ 3579 Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), 3580 Snapshot: snapshot.Bytes(), 3581 } 3582 } 3583 3584 return out, metadata, err 3585} 3586 3587func awsRestjson1_deserializeOpErrorEnableImportFindingsForProduct(response *smithyhttp.Response, metadata *middleware.Metadata) error { 3588 var errorBuffer bytes.Buffer 3589 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 3590 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 3591 } 3592 errorBody := bytes.NewReader(errorBuffer.Bytes()) 3593 3594 errorCode := "UnknownError" 3595 errorMessage := errorCode 3596 3597 code := response.Header.Get("X-Amzn-ErrorType") 3598 if len(code) != 0 { 3599 errorCode = restjson.SanitizeErrorCode(code) 3600 } 3601 3602 var buff [1024]byte 3603 ringBuffer := smithyio.NewRingBuffer(buff[:]) 3604 3605 body := io.TeeReader(errorBody, ringBuffer) 3606 decoder := json.NewDecoder(body) 3607 decoder.UseNumber() 3608 code, message, err := restjson.GetErrorInfo(decoder) 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 err 3617 } 3618 3619 errorBody.Seek(0, io.SeekStart) 3620 if len(code) != 0 { 3621 errorCode = restjson.SanitizeErrorCode(code) 3622 } 3623 if len(message) != 0 { 3624 errorMessage = message 3625 } 3626 3627 switch { 3628 case strings.EqualFold("InternalException", errorCode): 3629 return awsRestjson1_deserializeErrorInternalException(response, errorBody) 3630 3631 case strings.EqualFold("InvalidAccessException", errorCode): 3632 return awsRestjson1_deserializeErrorInvalidAccessException(response, errorBody) 3633 3634 case strings.EqualFold("InvalidInputException", errorCode): 3635 return awsRestjson1_deserializeErrorInvalidInputException(response, errorBody) 3636 3637 case strings.EqualFold("LimitExceededException", errorCode): 3638 return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) 3639 3640 case strings.EqualFold("ResourceConflictException", errorCode): 3641 return awsRestjson1_deserializeErrorResourceConflictException(response, errorBody) 3642 3643 default: 3644 genericError := &smithy.GenericAPIError{ 3645 Code: errorCode, 3646 Message: errorMessage, 3647 } 3648 return genericError 3649 3650 } 3651} 3652 3653func awsRestjson1_deserializeOpDocumentEnableImportFindingsForProductOutput(v **EnableImportFindingsForProductOutput, value interface{}) error { 3654 if v == nil { 3655 return fmt.Errorf("unexpected nil of type %T", v) 3656 } 3657 if value == nil { 3658 return nil 3659 } 3660 3661 shape, ok := value.(map[string]interface{}) 3662 if !ok { 3663 return fmt.Errorf("unexpected JSON type %v", value) 3664 } 3665 3666 var sv *EnableImportFindingsForProductOutput 3667 if *v == nil { 3668 sv = &EnableImportFindingsForProductOutput{} 3669 } else { 3670 sv = *v 3671 } 3672 3673 for key, value := range shape { 3674 switch key { 3675 case "ProductSubscriptionArn": 3676 if value != nil { 3677 jtv, ok := value.(string) 3678 if !ok { 3679 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 3680 } 3681 sv.ProductSubscriptionArn = ptr.String(jtv) 3682 } 3683 3684 default: 3685 _, _ = key, value 3686 3687 } 3688 } 3689 *v = sv 3690 return nil 3691} 3692 3693type awsRestjson1_deserializeOpEnableOrganizationAdminAccount struct { 3694} 3695 3696func (*awsRestjson1_deserializeOpEnableOrganizationAdminAccount) ID() string { 3697 return "OperationDeserializer" 3698} 3699 3700func (m *awsRestjson1_deserializeOpEnableOrganizationAdminAccount) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 3701 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 3702) { 3703 out, metadata, err = next.HandleDeserialize(ctx, in) 3704 if err != nil { 3705 return out, metadata, err 3706 } 3707 3708 response, ok := out.RawResponse.(*smithyhttp.Response) 3709 if !ok { 3710 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 3711 } 3712 3713 if response.StatusCode < 200 || response.StatusCode >= 300 { 3714 return out, metadata, awsRestjson1_deserializeOpErrorEnableOrganizationAdminAccount(response, &metadata) 3715 } 3716 output := &EnableOrganizationAdminAccountOutput{} 3717 out.Result = output 3718 3719 return out, metadata, err 3720} 3721 3722func awsRestjson1_deserializeOpErrorEnableOrganizationAdminAccount(response *smithyhttp.Response, metadata *middleware.Metadata) error { 3723 var errorBuffer bytes.Buffer 3724 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 3725 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 3726 } 3727 errorBody := bytes.NewReader(errorBuffer.Bytes()) 3728 3729 errorCode := "UnknownError" 3730 errorMessage := errorCode 3731 3732 code := response.Header.Get("X-Amzn-ErrorType") 3733 if len(code) != 0 { 3734 errorCode = restjson.SanitizeErrorCode(code) 3735 } 3736 3737 var buff [1024]byte 3738 ringBuffer := smithyio.NewRingBuffer(buff[:]) 3739 3740 body := io.TeeReader(errorBody, ringBuffer) 3741 decoder := json.NewDecoder(body) 3742 decoder.UseNumber() 3743 code, message, err := restjson.GetErrorInfo(decoder) 3744 if err != nil { 3745 var snapshot bytes.Buffer 3746 io.Copy(&snapshot, ringBuffer) 3747 err = &smithy.DeserializationError{ 3748 Err: fmt.Errorf("failed to decode response body, %w", err), 3749 Snapshot: snapshot.Bytes(), 3750 } 3751 return err 3752 } 3753 3754 errorBody.Seek(0, io.SeekStart) 3755 if len(code) != 0 { 3756 errorCode = restjson.SanitizeErrorCode(code) 3757 } 3758 if len(message) != 0 { 3759 errorMessage = message 3760 } 3761 3762 switch { 3763 case strings.EqualFold("InternalException", errorCode): 3764 return awsRestjson1_deserializeErrorInternalException(response, errorBody) 3765 3766 case strings.EqualFold("InvalidAccessException", errorCode): 3767 return awsRestjson1_deserializeErrorInvalidAccessException(response, errorBody) 3768 3769 case strings.EqualFold("InvalidInputException", errorCode): 3770 return awsRestjson1_deserializeErrorInvalidInputException(response, errorBody) 3771 3772 case strings.EqualFold("LimitExceededException", errorCode): 3773 return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) 3774 3775 default: 3776 genericError := &smithy.GenericAPIError{ 3777 Code: errorCode, 3778 Message: errorMessage, 3779 } 3780 return genericError 3781 3782 } 3783} 3784 3785type awsRestjson1_deserializeOpEnableSecurityHub struct { 3786} 3787 3788func (*awsRestjson1_deserializeOpEnableSecurityHub) ID() string { 3789 return "OperationDeserializer" 3790} 3791 3792func (m *awsRestjson1_deserializeOpEnableSecurityHub) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 3793 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 3794) { 3795 out, metadata, err = next.HandleDeserialize(ctx, in) 3796 if err != nil { 3797 return out, metadata, err 3798 } 3799 3800 response, ok := out.RawResponse.(*smithyhttp.Response) 3801 if !ok { 3802 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 3803 } 3804 3805 if response.StatusCode < 200 || response.StatusCode >= 300 { 3806 return out, metadata, awsRestjson1_deserializeOpErrorEnableSecurityHub(response, &metadata) 3807 } 3808 output := &EnableSecurityHubOutput{} 3809 out.Result = output 3810 3811 return out, metadata, err 3812} 3813 3814func awsRestjson1_deserializeOpErrorEnableSecurityHub(response *smithyhttp.Response, metadata *middleware.Metadata) error { 3815 var errorBuffer bytes.Buffer 3816 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 3817 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 3818 } 3819 errorBody := bytes.NewReader(errorBuffer.Bytes()) 3820 3821 errorCode := "UnknownError" 3822 errorMessage := errorCode 3823 3824 code := response.Header.Get("X-Amzn-ErrorType") 3825 if len(code) != 0 { 3826 errorCode = restjson.SanitizeErrorCode(code) 3827 } 3828 3829 var buff [1024]byte 3830 ringBuffer := smithyio.NewRingBuffer(buff[:]) 3831 3832 body := io.TeeReader(errorBody, ringBuffer) 3833 decoder := json.NewDecoder(body) 3834 decoder.UseNumber() 3835 code, message, err := restjson.GetErrorInfo(decoder) 3836 if err != nil { 3837 var snapshot bytes.Buffer 3838 io.Copy(&snapshot, ringBuffer) 3839 err = &smithy.DeserializationError{ 3840 Err: fmt.Errorf("failed to decode response body, %w", err), 3841 Snapshot: snapshot.Bytes(), 3842 } 3843 return err 3844 } 3845 3846 errorBody.Seek(0, io.SeekStart) 3847 if len(code) != 0 { 3848 errorCode = restjson.SanitizeErrorCode(code) 3849 } 3850 if len(message) != 0 { 3851 errorMessage = message 3852 } 3853 3854 switch { 3855 case strings.EqualFold("AccessDeniedException", errorCode): 3856 return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) 3857 3858 case strings.EqualFold("InternalException", errorCode): 3859 return awsRestjson1_deserializeErrorInternalException(response, errorBody) 3860 3861 case strings.EqualFold("InvalidAccessException", errorCode): 3862 return awsRestjson1_deserializeErrorInvalidAccessException(response, errorBody) 3863 3864 case strings.EqualFold("LimitExceededException", errorCode): 3865 return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) 3866 3867 case strings.EqualFold("ResourceConflictException", errorCode): 3868 return awsRestjson1_deserializeErrorResourceConflictException(response, errorBody) 3869 3870 default: 3871 genericError := &smithy.GenericAPIError{ 3872 Code: errorCode, 3873 Message: errorMessage, 3874 } 3875 return genericError 3876 3877 } 3878} 3879 3880type awsRestjson1_deserializeOpGetEnabledStandards struct { 3881} 3882 3883func (*awsRestjson1_deserializeOpGetEnabledStandards) ID() string { 3884 return "OperationDeserializer" 3885} 3886 3887func (m *awsRestjson1_deserializeOpGetEnabledStandards) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 3888 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 3889) { 3890 out, metadata, err = next.HandleDeserialize(ctx, in) 3891 if err != nil { 3892 return out, metadata, err 3893 } 3894 3895 response, ok := out.RawResponse.(*smithyhttp.Response) 3896 if !ok { 3897 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 3898 } 3899 3900 if response.StatusCode < 200 || response.StatusCode >= 300 { 3901 return out, metadata, awsRestjson1_deserializeOpErrorGetEnabledStandards(response, &metadata) 3902 } 3903 output := &GetEnabledStandardsOutput{} 3904 out.Result = output 3905 3906 var buff [1024]byte 3907 ringBuffer := smithyio.NewRingBuffer(buff[:]) 3908 3909 body := io.TeeReader(response.Body, ringBuffer) 3910 3911 decoder := json.NewDecoder(body) 3912 decoder.UseNumber() 3913 var shape interface{} 3914 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 3915 var snapshot bytes.Buffer 3916 io.Copy(&snapshot, ringBuffer) 3917 err = &smithy.DeserializationError{ 3918 Err: fmt.Errorf("failed to decode response body, %w", err), 3919 Snapshot: snapshot.Bytes(), 3920 } 3921 return out, metadata, err 3922 } 3923 3924 err = awsRestjson1_deserializeOpDocumentGetEnabledStandardsOutput(&output, shape) 3925 if err != nil { 3926 var snapshot bytes.Buffer 3927 io.Copy(&snapshot, ringBuffer) 3928 return out, metadata, &smithy.DeserializationError{ 3929 Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), 3930 Snapshot: snapshot.Bytes(), 3931 } 3932 } 3933 3934 return out, metadata, err 3935} 3936 3937func awsRestjson1_deserializeOpErrorGetEnabledStandards(response *smithyhttp.Response, metadata *middleware.Metadata) error { 3938 var errorBuffer bytes.Buffer 3939 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 3940 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 3941 } 3942 errorBody := bytes.NewReader(errorBuffer.Bytes()) 3943 3944 errorCode := "UnknownError" 3945 errorMessage := errorCode 3946 3947 code := response.Header.Get("X-Amzn-ErrorType") 3948 if len(code) != 0 { 3949 errorCode = restjson.SanitizeErrorCode(code) 3950 } 3951 3952 var buff [1024]byte 3953 ringBuffer := smithyio.NewRingBuffer(buff[:]) 3954 3955 body := io.TeeReader(errorBody, ringBuffer) 3956 decoder := json.NewDecoder(body) 3957 decoder.UseNumber() 3958 code, message, err := restjson.GetErrorInfo(decoder) 3959 if err != nil { 3960 var snapshot bytes.Buffer 3961 io.Copy(&snapshot, ringBuffer) 3962 err = &smithy.DeserializationError{ 3963 Err: fmt.Errorf("failed to decode response body, %w", err), 3964 Snapshot: snapshot.Bytes(), 3965 } 3966 return err 3967 } 3968 3969 errorBody.Seek(0, io.SeekStart) 3970 if len(code) != 0 { 3971 errorCode = restjson.SanitizeErrorCode(code) 3972 } 3973 if len(message) != 0 { 3974 errorMessage = message 3975 } 3976 3977 switch { 3978 case strings.EqualFold("InternalException", errorCode): 3979 return awsRestjson1_deserializeErrorInternalException(response, errorBody) 3980 3981 case strings.EqualFold("InvalidAccessException", errorCode): 3982 return awsRestjson1_deserializeErrorInvalidAccessException(response, errorBody) 3983 3984 case strings.EqualFold("InvalidInputException", errorCode): 3985 return awsRestjson1_deserializeErrorInvalidInputException(response, errorBody) 3986 3987 case strings.EqualFold("LimitExceededException", errorCode): 3988 return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) 3989 3990 default: 3991 genericError := &smithy.GenericAPIError{ 3992 Code: errorCode, 3993 Message: errorMessage, 3994 } 3995 return genericError 3996 3997 } 3998} 3999 4000func awsRestjson1_deserializeOpDocumentGetEnabledStandardsOutput(v **GetEnabledStandardsOutput, value interface{}) error { 4001 if v == nil { 4002 return fmt.Errorf("unexpected nil of type %T", v) 4003 } 4004 if value == nil { 4005 return nil 4006 } 4007 4008 shape, ok := value.(map[string]interface{}) 4009 if !ok { 4010 return fmt.Errorf("unexpected JSON type %v", value) 4011 } 4012 4013 var sv *GetEnabledStandardsOutput 4014 if *v == nil { 4015 sv = &GetEnabledStandardsOutput{} 4016 } else { 4017 sv = *v 4018 } 4019 4020 for key, value := range shape { 4021 switch key { 4022 case "NextToken": 4023 if value != nil { 4024 jtv, ok := value.(string) 4025 if !ok { 4026 return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) 4027 } 4028 sv.NextToken = ptr.String(jtv) 4029 } 4030 4031 case "StandardsSubscriptions": 4032 if err := awsRestjson1_deserializeDocumentStandardsSubscriptions(&sv.StandardsSubscriptions, value); err != nil { 4033 return err 4034 } 4035 4036 default: 4037 _, _ = key, value 4038 4039 } 4040 } 4041 *v = sv 4042 return nil 4043} 4044 4045type awsRestjson1_deserializeOpGetFindings struct { 4046} 4047 4048func (*awsRestjson1_deserializeOpGetFindings) ID() string { 4049 return "OperationDeserializer" 4050} 4051 4052func (m *awsRestjson1_deserializeOpGetFindings) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 4053 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 4054) { 4055 out, metadata, err = next.HandleDeserialize(ctx, in) 4056 if err != nil { 4057 return out, metadata, err 4058 } 4059 4060 response, ok := out.RawResponse.(*smithyhttp.Response) 4061 if !ok { 4062 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 4063 } 4064 4065 if response.StatusCode < 200 || response.StatusCode >= 300 { 4066 return out, metadata, awsRestjson1_deserializeOpErrorGetFindings(response, &metadata) 4067 } 4068 output := &GetFindingsOutput{} 4069 out.Result = output 4070 4071 var buff [1024]byte 4072 ringBuffer := smithyio.NewRingBuffer(buff[:]) 4073 4074 body := io.TeeReader(response.Body, ringBuffer) 4075 4076 decoder := json.NewDecoder(body) 4077 decoder.UseNumber() 4078 var shape interface{} 4079 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 4080 var snapshot bytes.Buffer 4081 io.Copy(&snapshot, ringBuffer) 4082 err = &smithy.DeserializationError{ 4083 Err: fmt.Errorf("failed to decode response body, %w", err), 4084 Snapshot: snapshot.Bytes(), 4085 } 4086 return out, metadata, err 4087 } 4088 4089 err = awsRestjson1_deserializeOpDocumentGetFindingsOutput(&output, shape) 4090 if err != nil { 4091 var snapshot bytes.Buffer 4092 io.Copy(&snapshot, ringBuffer) 4093 return out, metadata, &smithy.DeserializationError{ 4094 Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), 4095 Snapshot: snapshot.Bytes(), 4096 } 4097 } 4098 4099 return out, metadata, err 4100} 4101 4102func awsRestjson1_deserializeOpErrorGetFindings(response *smithyhttp.Response, metadata *middleware.Metadata) error { 4103 var errorBuffer bytes.Buffer 4104 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 4105 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 4106 } 4107 errorBody := bytes.NewReader(errorBuffer.Bytes()) 4108 4109 errorCode := "UnknownError" 4110 errorMessage := errorCode 4111 4112 code := response.Header.Get("X-Amzn-ErrorType") 4113 if len(code) != 0 { 4114 errorCode = restjson.SanitizeErrorCode(code) 4115 } 4116 4117 var buff [1024]byte 4118 ringBuffer := smithyio.NewRingBuffer(buff[:]) 4119 4120 body := io.TeeReader(errorBody, ringBuffer) 4121 decoder := json.NewDecoder(body) 4122 decoder.UseNumber() 4123 code, message, err := restjson.GetErrorInfo(decoder) 4124 if err != nil { 4125 var snapshot bytes.Buffer 4126 io.Copy(&snapshot, ringBuffer) 4127 err = &smithy.DeserializationError{ 4128 Err: fmt.Errorf("failed to decode response body, %w", err), 4129 Snapshot: snapshot.Bytes(), 4130 } 4131 return err 4132 } 4133 4134 errorBody.Seek(0, io.SeekStart) 4135 if len(code) != 0 { 4136 errorCode = restjson.SanitizeErrorCode(code) 4137 } 4138 if len(message) != 0 { 4139 errorMessage = message 4140 } 4141 4142 switch { 4143 case strings.EqualFold("InternalException", errorCode): 4144 return awsRestjson1_deserializeErrorInternalException(response, errorBody) 4145 4146 case strings.EqualFold("InvalidAccessException", errorCode): 4147 return awsRestjson1_deserializeErrorInvalidAccessException(response, errorBody) 4148 4149 case strings.EqualFold("InvalidInputException", errorCode): 4150 return awsRestjson1_deserializeErrorInvalidInputException(response, errorBody) 4151 4152 case strings.EqualFold("LimitExceededException", errorCode): 4153 return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) 4154 4155 default: 4156 genericError := &smithy.GenericAPIError{ 4157 Code: errorCode, 4158 Message: errorMessage, 4159 } 4160 return genericError 4161 4162 } 4163} 4164 4165func awsRestjson1_deserializeOpDocumentGetFindingsOutput(v **GetFindingsOutput, value interface{}) error { 4166 if v == nil { 4167 return fmt.Errorf("unexpected nil of type %T", v) 4168 } 4169 if value == nil { 4170 return nil 4171 } 4172 4173 shape, ok := value.(map[string]interface{}) 4174 if !ok { 4175 return fmt.Errorf("unexpected JSON type %v", value) 4176 } 4177 4178 var sv *GetFindingsOutput 4179 if *v == nil { 4180 sv = &GetFindingsOutput{} 4181 } else { 4182 sv = *v 4183 } 4184 4185 for key, value := range shape { 4186 switch key { 4187 case "Findings": 4188 if err := awsRestjson1_deserializeDocumentAwsSecurityFindingList(&sv.Findings, value); err != nil { 4189 return err 4190 } 4191 4192 case "NextToken": 4193 if value != nil { 4194 jtv, ok := value.(string) 4195 if !ok { 4196 return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) 4197 } 4198 sv.NextToken = ptr.String(jtv) 4199 } 4200 4201 default: 4202 _, _ = key, value 4203 4204 } 4205 } 4206 *v = sv 4207 return nil 4208} 4209 4210type awsRestjson1_deserializeOpGetInsightResults struct { 4211} 4212 4213func (*awsRestjson1_deserializeOpGetInsightResults) ID() string { 4214 return "OperationDeserializer" 4215} 4216 4217func (m *awsRestjson1_deserializeOpGetInsightResults) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 4218 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 4219) { 4220 out, metadata, err = next.HandleDeserialize(ctx, in) 4221 if err != nil { 4222 return out, metadata, err 4223 } 4224 4225 response, ok := out.RawResponse.(*smithyhttp.Response) 4226 if !ok { 4227 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 4228 } 4229 4230 if response.StatusCode < 200 || response.StatusCode >= 300 { 4231 return out, metadata, awsRestjson1_deserializeOpErrorGetInsightResults(response, &metadata) 4232 } 4233 output := &GetInsightResultsOutput{} 4234 out.Result = output 4235 4236 var buff [1024]byte 4237 ringBuffer := smithyio.NewRingBuffer(buff[:]) 4238 4239 body := io.TeeReader(response.Body, ringBuffer) 4240 4241 decoder := json.NewDecoder(body) 4242 decoder.UseNumber() 4243 var shape interface{} 4244 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 4245 var snapshot bytes.Buffer 4246 io.Copy(&snapshot, ringBuffer) 4247 err = &smithy.DeserializationError{ 4248 Err: fmt.Errorf("failed to decode response body, %w", err), 4249 Snapshot: snapshot.Bytes(), 4250 } 4251 return out, metadata, err 4252 } 4253 4254 err = awsRestjson1_deserializeOpDocumentGetInsightResultsOutput(&output, shape) 4255 if err != nil { 4256 var snapshot bytes.Buffer 4257 io.Copy(&snapshot, ringBuffer) 4258 return out, metadata, &smithy.DeserializationError{ 4259 Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), 4260 Snapshot: snapshot.Bytes(), 4261 } 4262 } 4263 4264 return out, metadata, err 4265} 4266 4267func awsRestjson1_deserializeOpErrorGetInsightResults(response *smithyhttp.Response, metadata *middleware.Metadata) error { 4268 var errorBuffer bytes.Buffer 4269 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 4270 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 4271 } 4272 errorBody := bytes.NewReader(errorBuffer.Bytes()) 4273 4274 errorCode := "UnknownError" 4275 errorMessage := errorCode 4276 4277 code := response.Header.Get("X-Amzn-ErrorType") 4278 if len(code) != 0 { 4279 errorCode = restjson.SanitizeErrorCode(code) 4280 } 4281 4282 var buff [1024]byte 4283 ringBuffer := smithyio.NewRingBuffer(buff[:]) 4284 4285 body := io.TeeReader(errorBody, ringBuffer) 4286 decoder := json.NewDecoder(body) 4287 decoder.UseNumber() 4288 code, message, err := restjson.GetErrorInfo(decoder) 4289 if err != nil { 4290 var snapshot bytes.Buffer 4291 io.Copy(&snapshot, ringBuffer) 4292 err = &smithy.DeserializationError{ 4293 Err: fmt.Errorf("failed to decode response body, %w", err), 4294 Snapshot: snapshot.Bytes(), 4295 } 4296 return err 4297 } 4298 4299 errorBody.Seek(0, io.SeekStart) 4300 if len(code) != 0 { 4301 errorCode = restjson.SanitizeErrorCode(code) 4302 } 4303 if len(message) != 0 { 4304 errorMessage = message 4305 } 4306 4307 switch { 4308 case strings.EqualFold("InternalException", errorCode): 4309 return awsRestjson1_deserializeErrorInternalException(response, errorBody) 4310 4311 case strings.EqualFold("InvalidAccessException", errorCode): 4312 return awsRestjson1_deserializeErrorInvalidAccessException(response, errorBody) 4313 4314 case strings.EqualFold("InvalidInputException", errorCode): 4315 return awsRestjson1_deserializeErrorInvalidInputException(response, errorBody) 4316 4317 case strings.EqualFold("LimitExceededException", errorCode): 4318 return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) 4319 4320 case strings.EqualFold("ResourceNotFoundException", errorCode): 4321 return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) 4322 4323 default: 4324 genericError := &smithy.GenericAPIError{ 4325 Code: errorCode, 4326 Message: errorMessage, 4327 } 4328 return genericError 4329 4330 } 4331} 4332 4333func awsRestjson1_deserializeOpDocumentGetInsightResultsOutput(v **GetInsightResultsOutput, value interface{}) error { 4334 if v == nil { 4335 return fmt.Errorf("unexpected nil of type %T", v) 4336 } 4337 if value == nil { 4338 return nil 4339 } 4340 4341 shape, ok := value.(map[string]interface{}) 4342 if !ok { 4343 return fmt.Errorf("unexpected JSON type %v", value) 4344 } 4345 4346 var sv *GetInsightResultsOutput 4347 if *v == nil { 4348 sv = &GetInsightResultsOutput{} 4349 } else { 4350 sv = *v 4351 } 4352 4353 for key, value := range shape { 4354 switch key { 4355 case "InsightResults": 4356 if err := awsRestjson1_deserializeDocumentInsightResults(&sv.InsightResults, value); err != nil { 4357 return err 4358 } 4359 4360 default: 4361 _, _ = key, value 4362 4363 } 4364 } 4365 *v = sv 4366 return nil 4367} 4368 4369type awsRestjson1_deserializeOpGetInsights struct { 4370} 4371 4372func (*awsRestjson1_deserializeOpGetInsights) ID() string { 4373 return "OperationDeserializer" 4374} 4375 4376func (m *awsRestjson1_deserializeOpGetInsights) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 4377 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 4378) { 4379 out, metadata, err = next.HandleDeserialize(ctx, in) 4380 if err != nil { 4381 return out, metadata, err 4382 } 4383 4384 response, ok := out.RawResponse.(*smithyhttp.Response) 4385 if !ok { 4386 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 4387 } 4388 4389 if response.StatusCode < 200 || response.StatusCode >= 300 { 4390 return out, metadata, awsRestjson1_deserializeOpErrorGetInsights(response, &metadata) 4391 } 4392 output := &GetInsightsOutput{} 4393 out.Result = output 4394 4395 var buff [1024]byte 4396 ringBuffer := smithyio.NewRingBuffer(buff[:]) 4397 4398 body := io.TeeReader(response.Body, ringBuffer) 4399 4400 decoder := json.NewDecoder(body) 4401 decoder.UseNumber() 4402 var shape interface{} 4403 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 4404 var snapshot bytes.Buffer 4405 io.Copy(&snapshot, ringBuffer) 4406 err = &smithy.DeserializationError{ 4407 Err: fmt.Errorf("failed to decode response body, %w", err), 4408 Snapshot: snapshot.Bytes(), 4409 } 4410 return out, metadata, err 4411 } 4412 4413 err = awsRestjson1_deserializeOpDocumentGetInsightsOutput(&output, shape) 4414 if err != nil { 4415 var snapshot bytes.Buffer 4416 io.Copy(&snapshot, ringBuffer) 4417 return out, metadata, &smithy.DeserializationError{ 4418 Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), 4419 Snapshot: snapshot.Bytes(), 4420 } 4421 } 4422 4423 return out, metadata, err 4424} 4425 4426func awsRestjson1_deserializeOpErrorGetInsights(response *smithyhttp.Response, metadata *middleware.Metadata) error { 4427 var errorBuffer bytes.Buffer 4428 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 4429 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 4430 } 4431 errorBody := bytes.NewReader(errorBuffer.Bytes()) 4432 4433 errorCode := "UnknownError" 4434 errorMessage := errorCode 4435 4436 code := response.Header.Get("X-Amzn-ErrorType") 4437 if len(code) != 0 { 4438 errorCode = restjson.SanitizeErrorCode(code) 4439 } 4440 4441 var buff [1024]byte 4442 ringBuffer := smithyio.NewRingBuffer(buff[:]) 4443 4444 body := io.TeeReader(errorBody, ringBuffer) 4445 decoder := json.NewDecoder(body) 4446 decoder.UseNumber() 4447 code, message, err := restjson.GetErrorInfo(decoder) 4448 if err != nil { 4449 var snapshot bytes.Buffer 4450 io.Copy(&snapshot, ringBuffer) 4451 err = &smithy.DeserializationError{ 4452 Err: fmt.Errorf("failed to decode response body, %w", err), 4453 Snapshot: snapshot.Bytes(), 4454 } 4455 return err 4456 } 4457 4458 errorBody.Seek(0, io.SeekStart) 4459 if len(code) != 0 { 4460 errorCode = restjson.SanitizeErrorCode(code) 4461 } 4462 if len(message) != 0 { 4463 errorMessage = message 4464 } 4465 4466 switch { 4467 case strings.EqualFold("InternalException", errorCode): 4468 return awsRestjson1_deserializeErrorInternalException(response, errorBody) 4469 4470 case strings.EqualFold("InvalidAccessException", errorCode): 4471 return awsRestjson1_deserializeErrorInvalidAccessException(response, errorBody) 4472 4473 case strings.EqualFold("InvalidInputException", errorCode): 4474 return awsRestjson1_deserializeErrorInvalidInputException(response, errorBody) 4475 4476 case strings.EqualFold("LimitExceededException", errorCode): 4477 return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) 4478 4479 case strings.EqualFold("ResourceNotFoundException", errorCode): 4480 return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) 4481 4482 default: 4483 genericError := &smithy.GenericAPIError{ 4484 Code: errorCode, 4485 Message: errorMessage, 4486 } 4487 return genericError 4488 4489 } 4490} 4491 4492func awsRestjson1_deserializeOpDocumentGetInsightsOutput(v **GetInsightsOutput, value interface{}) error { 4493 if v == nil { 4494 return fmt.Errorf("unexpected nil of type %T", v) 4495 } 4496 if value == nil { 4497 return nil 4498 } 4499 4500 shape, ok := value.(map[string]interface{}) 4501 if !ok { 4502 return fmt.Errorf("unexpected JSON type %v", value) 4503 } 4504 4505 var sv *GetInsightsOutput 4506 if *v == nil { 4507 sv = &GetInsightsOutput{} 4508 } else { 4509 sv = *v 4510 } 4511 4512 for key, value := range shape { 4513 switch key { 4514 case "Insights": 4515 if err := awsRestjson1_deserializeDocumentInsightList(&sv.Insights, value); err != nil { 4516 return err 4517 } 4518 4519 case "NextToken": 4520 if value != nil { 4521 jtv, ok := value.(string) 4522 if !ok { 4523 return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) 4524 } 4525 sv.NextToken = ptr.String(jtv) 4526 } 4527 4528 default: 4529 _, _ = key, value 4530 4531 } 4532 } 4533 *v = sv 4534 return nil 4535} 4536 4537type awsRestjson1_deserializeOpGetInvitationsCount struct { 4538} 4539 4540func (*awsRestjson1_deserializeOpGetInvitationsCount) ID() string { 4541 return "OperationDeserializer" 4542} 4543 4544func (m *awsRestjson1_deserializeOpGetInvitationsCount) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 4545 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 4546) { 4547 out, metadata, err = next.HandleDeserialize(ctx, in) 4548 if err != nil { 4549 return out, metadata, err 4550 } 4551 4552 response, ok := out.RawResponse.(*smithyhttp.Response) 4553 if !ok { 4554 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 4555 } 4556 4557 if response.StatusCode < 200 || response.StatusCode >= 300 { 4558 return out, metadata, awsRestjson1_deserializeOpErrorGetInvitationsCount(response, &metadata) 4559 } 4560 output := &GetInvitationsCountOutput{} 4561 out.Result = output 4562 4563 var buff [1024]byte 4564 ringBuffer := smithyio.NewRingBuffer(buff[:]) 4565 4566 body := io.TeeReader(response.Body, ringBuffer) 4567 4568 decoder := json.NewDecoder(body) 4569 decoder.UseNumber() 4570 var shape interface{} 4571 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 4572 var snapshot bytes.Buffer 4573 io.Copy(&snapshot, ringBuffer) 4574 err = &smithy.DeserializationError{ 4575 Err: fmt.Errorf("failed to decode response body, %w", err), 4576 Snapshot: snapshot.Bytes(), 4577 } 4578 return out, metadata, err 4579 } 4580 4581 err = awsRestjson1_deserializeOpDocumentGetInvitationsCountOutput(&output, shape) 4582 if err != nil { 4583 var snapshot bytes.Buffer 4584 io.Copy(&snapshot, ringBuffer) 4585 return out, metadata, &smithy.DeserializationError{ 4586 Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), 4587 Snapshot: snapshot.Bytes(), 4588 } 4589 } 4590 4591 return out, metadata, err 4592} 4593 4594func awsRestjson1_deserializeOpErrorGetInvitationsCount(response *smithyhttp.Response, metadata *middleware.Metadata) error { 4595 var errorBuffer bytes.Buffer 4596 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 4597 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 4598 } 4599 errorBody := bytes.NewReader(errorBuffer.Bytes()) 4600 4601 errorCode := "UnknownError" 4602 errorMessage := errorCode 4603 4604 code := response.Header.Get("X-Amzn-ErrorType") 4605 if len(code) != 0 { 4606 errorCode = restjson.SanitizeErrorCode(code) 4607 } 4608 4609 var buff [1024]byte 4610 ringBuffer := smithyio.NewRingBuffer(buff[:]) 4611 4612 body := io.TeeReader(errorBody, ringBuffer) 4613 decoder := json.NewDecoder(body) 4614 decoder.UseNumber() 4615 code, message, err := restjson.GetErrorInfo(decoder) 4616 if err != nil { 4617 var snapshot bytes.Buffer 4618 io.Copy(&snapshot, ringBuffer) 4619 err = &smithy.DeserializationError{ 4620 Err: fmt.Errorf("failed to decode response body, %w", err), 4621 Snapshot: snapshot.Bytes(), 4622 } 4623 return err 4624 } 4625 4626 errorBody.Seek(0, io.SeekStart) 4627 if len(code) != 0 { 4628 errorCode = restjson.SanitizeErrorCode(code) 4629 } 4630 if len(message) != 0 { 4631 errorMessage = message 4632 } 4633 4634 switch { 4635 case strings.EqualFold("InternalException", errorCode): 4636 return awsRestjson1_deserializeErrorInternalException(response, errorBody) 4637 4638 case strings.EqualFold("InvalidAccessException", errorCode): 4639 return awsRestjson1_deserializeErrorInvalidAccessException(response, errorBody) 4640 4641 case strings.EqualFold("InvalidInputException", errorCode): 4642 return awsRestjson1_deserializeErrorInvalidInputException(response, errorBody) 4643 4644 case strings.EqualFold("LimitExceededException", errorCode): 4645 return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) 4646 4647 default: 4648 genericError := &smithy.GenericAPIError{ 4649 Code: errorCode, 4650 Message: errorMessage, 4651 } 4652 return genericError 4653 4654 } 4655} 4656 4657func awsRestjson1_deserializeOpDocumentGetInvitationsCountOutput(v **GetInvitationsCountOutput, value interface{}) error { 4658 if v == nil { 4659 return fmt.Errorf("unexpected nil of type %T", v) 4660 } 4661 if value == nil { 4662 return nil 4663 } 4664 4665 shape, ok := value.(map[string]interface{}) 4666 if !ok { 4667 return fmt.Errorf("unexpected JSON type %v", value) 4668 } 4669 4670 var sv *GetInvitationsCountOutput 4671 if *v == nil { 4672 sv = &GetInvitationsCountOutput{} 4673 } else { 4674 sv = *v 4675 } 4676 4677 for key, value := range shape { 4678 switch key { 4679 case "InvitationsCount": 4680 if value != nil { 4681 jtv, ok := value.(json.Number) 4682 if !ok { 4683 return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) 4684 } 4685 i64, err := jtv.Int64() 4686 if err != nil { 4687 return err 4688 } 4689 sv.InvitationsCount = int32(i64) 4690 } 4691 4692 default: 4693 _, _ = key, value 4694 4695 } 4696 } 4697 *v = sv 4698 return nil 4699} 4700 4701type awsRestjson1_deserializeOpGetMasterAccount struct { 4702} 4703 4704func (*awsRestjson1_deserializeOpGetMasterAccount) ID() string { 4705 return "OperationDeserializer" 4706} 4707 4708func (m *awsRestjson1_deserializeOpGetMasterAccount) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 4709 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 4710) { 4711 out, metadata, err = next.HandleDeserialize(ctx, in) 4712 if err != nil { 4713 return out, metadata, err 4714 } 4715 4716 response, ok := out.RawResponse.(*smithyhttp.Response) 4717 if !ok { 4718 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 4719 } 4720 4721 if response.StatusCode < 200 || response.StatusCode >= 300 { 4722 return out, metadata, awsRestjson1_deserializeOpErrorGetMasterAccount(response, &metadata) 4723 } 4724 output := &GetMasterAccountOutput{} 4725 out.Result = output 4726 4727 var buff [1024]byte 4728 ringBuffer := smithyio.NewRingBuffer(buff[:]) 4729 4730 body := io.TeeReader(response.Body, ringBuffer) 4731 4732 decoder := json.NewDecoder(body) 4733 decoder.UseNumber() 4734 var shape interface{} 4735 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 4736 var snapshot bytes.Buffer 4737 io.Copy(&snapshot, ringBuffer) 4738 err = &smithy.DeserializationError{ 4739 Err: fmt.Errorf("failed to decode response body, %w", err), 4740 Snapshot: snapshot.Bytes(), 4741 } 4742 return out, metadata, err 4743 } 4744 4745 err = awsRestjson1_deserializeOpDocumentGetMasterAccountOutput(&output, shape) 4746 if err != nil { 4747 var snapshot bytes.Buffer 4748 io.Copy(&snapshot, ringBuffer) 4749 return out, metadata, &smithy.DeserializationError{ 4750 Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), 4751 Snapshot: snapshot.Bytes(), 4752 } 4753 } 4754 4755 return out, metadata, err 4756} 4757 4758func awsRestjson1_deserializeOpErrorGetMasterAccount(response *smithyhttp.Response, metadata *middleware.Metadata) error { 4759 var errorBuffer bytes.Buffer 4760 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 4761 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 4762 } 4763 errorBody := bytes.NewReader(errorBuffer.Bytes()) 4764 4765 errorCode := "UnknownError" 4766 errorMessage := errorCode 4767 4768 code := response.Header.Get("X-Amzn-ErrorType") 4769 if len(code) != 0 { 4770 errorCode = restjson.SanitizeErrorCode(code) 4771 } 4772 4773 var buff [1024]byte 4774 ringBuffer := smithyio.NewRingBuffer(buff[:]) 4775 4776 body := io.TeeReader(errorBody, ringBuffer) 4777 decoder := json.NewDecoder(body) 4778 decoder.UseNumber() 4779 code, message, err := restjson.GetErrorInfo(decoder) 4780 if err != nil { 4781 var snapshot bytes.Buffer 4782 io.Copy(&snapshot, ringBuffer) 4783 err = &smithy.DeserializationError{ 4784 Err: fmt.Errorf("failed to decode response body, %w", err), 4785 Snapshot: snapshot.Bytes(), 4786 } 4787 return err 4788 } 4789 4790 errorBody.Seek(0, io.SeekStart) 4791 if len(code) != 0 { 4792 errorCode = restjson.SanitizeErrorCode(code) 4793 } 4794 if len(message) != 0 { 4795 errorMessage = message 4796 } 4797 4798 switch { 4799 case strings.EqualFold("InternalException", errorCode): 4800 return awsRestjson1_deserializeErrorInternalException(response, errorBody) 4801 4802 case strings.EqualFold("InvalidAccessException", errorCode): 4803 return awsRestjson1_deserializeErrorInvalidAccessException(response, errorBody) 4804 4805 case strings.EqualFold("InvalidInputException", errorCode): 4806 return awsRestjson1_deserializeErrorInvalidInputException(response, errorBody) 4807 4808 case strings.EqualFold("LimitExceededException", errorCode): 4809 return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) 4810 4811 case strings.EqualFold("ResourceNotFoundException", errorCode): 4812 return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) 4813 4814 default: 4815 genericError := &smithy.GenericAPIError{ 4816 Code: errorCode, 4817 Message: errorMessage, 4818 } 4819 return genericError 4820 4821 } 4822} 4823 4824func awsRestjson1_deserializeOpDocumentGetMasterAccountOutput(v **GetMasterAccountOutput, value interface{}) error { 4825 if v == nil { 4826 return fmt.Errorf("unexpected nil of type %T", v) 4827 } 4828 if value == nil { 4829 return nil 4830 } 4831 4832 shape, ok := value.(map[string]interface{}) 4833 if !ok { 4834 return fmt.Errorf("unexpected JSON type %v", value) 4835 } 4836 4837 var sv *GetMasterAccountOutput 4838 if *v == nil { 4839 sv = &GetMasterAccountOutput{} 4840 } else { 4841 sv = *v 4842 } 4843 4844 for key, value := range shape { 4845 switch key { 4846 case "Master": 4847 if err := awsRestjson1_deserializeDocumentInvitation(&sv.Master, value); err != nil { 4848 return err 4849 } 4850 4851 default: 4852 _, _ = key, value 4853 4854 } 4855 } 4856 *v = sv 4857 return nil 4858} 4859 4860type awsRestjson1_deserializeOpGetMembers struct { 4861} 4862 4863func (*awsRestjson1_deserializeOpGetMembers) ID() string { 4864 return "OperationDeserializer" 4865} 4866 4867func (m *awsRestjson1_deserializeOpGetMembers) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 4868 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 4869) { 4870 out, metadata, err = next.HandleDeserialize(ctx, in) 4871 if err != nil { 4872 return out, metadata, err 4873 } 4874 4875 response, ok := out.RawResponse.(*smithyhttp.Response) 4876 if !ok { 4877 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 4878 } 4879 4880 if response.StatusCode < 200 || response.StatusCode >= 300 { 4881 return out, metadata, awsRestjson1_deserializeOpErrorGetMembers(response, &metadata) 4882 } 4883 output := &GetMembersOutput{} 4884 out.Result = output 4885 4886 var buff [1024]byte 4887 ringBuffer := smithyio.NewRingBuffer(buff[:]) 4888 4889 body := io.TeeReader(response.Body, ringBuffer) 4890 4891 decoder := json.NewDecoder(body) 4892 decoder.UseNumber() 4893 var shape interface{} 4894 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 4895 var snapshot bytes.Buffer 4896 io.Copy(&snapshot, ringBuffer) 4897 err = &smithy.DeserializationError{ 4898 Err: fmt.Errorf("failed to decode response body, %w", err), 4899 Snapshot: snapshot.Bytes(), 4900 } 4901 return out, metadata, err 4902 } 4903 4904 err = awsRestjson1_deserializeOpDocumentGetMembersOutput(&output, shape) 4905 if err != nil { 4906 var snapshot bytes.Buffer 4907 io.Copy(&snapshot, ringBuffer) 4908 return out, metadata, &smithy.DeserializationError{ 4909 Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), 4910 Snapshot: snapshot.Bytes(), 4911 } 4912 } 4913 4914 return out, metadata, err 4915} 4916 4917func awsRestjson1_deserializeOpErrorGetMembers(response *smithyhttp.Response, metadata *middleware.Metadata) error { 4918 var errorBuffer bytes.Buffer 4919 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 4920 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 4921 } 4922 errorBody := bytes.NewReader(errorBuffer.Bytes()) 4923 4924 errorCode := "UnknownError" 4925 errorMessage := errorCode 4926 4927 code := response.Header.Get("X-Amzn-ErrorType") 4928 if len(code) != 0 { 4929 errorCode = restjson.SanitizeErrorCode(code) 4930 } 4931 4932 var buff [1024]byte 4933 ringBuffer := smithyio.NewRingBuffer(buff[:]) 4934 4935 body := io.TeeReader(errorBody, ringBuffer) 4936 decoder := json.NewDecoder(body) 4937 decoder.UseNumber() 4938 code, message, err := restjson.GetErrorInfo(decoder) 4939 if err != nil { 4940 var snapshot bytes.Buffer 4941 io.Copy(&snapshot, ringBuffer) 4942 err = &smithy.DeserializationError{ 4943 Err: fmt.Errorf("failed to decode response body, %w", err), 4944 Snapshot: snapshot.Bytes(), 4945 } 4946 return err 4947 } 4948 4949 errorBody.Seek(0, io.SeekStart) 4950 if len(code) != 0 { 4951 errorCode = restjson.SanitizeErrorCode(code) 4952 } 4953 if len(message) != 0 { 4954 errorMessage = message 4955 } 4956 4957 switch { 4958 case strings.EqualFold("InternalException", errorCode): 4959 return awsRestjson1_deserializeErrorInternalException(response, errorBody) 4960 4961 case strings.EqualFold("InvalidAccessException", errorCode): 4962 return awsRestjson1_deserializeErrorInvalidAccessException(response, errorBody) 4963 4964 case strings.EqualFold("InvalidInputException", errorCode): 4965 return awsRestjson1_deserializeErrorInvalidInputException(response, errorBody) 4966 4967 case strings.EqualFold("LimitExceededException", errorCode): 4968 return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) 4969 4970 case strings.EqualFold("ResourceNotFoundException", errorCode): 4971 return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) 4972 4973 default: 4974 genericError := &smithy.GenericAPIError{ 4975 Code: errorCode, 4976 Message: errorMessage, 4977 } 4978 return genericError 4979 4980 } 4981} 4982 4983func awsRestjson1_deserializeOpDocumentGetMembersOutput(v **GetMembersOutput, value interface{}) error { 4984 if v == nil { 4985 return fmt.Errorf("unexpected nil of type %T", v) 4986 } 4987 if value == nil { 4988 return nil 4989 } 4990 4991 shape, ok := value.(map[string]interface{}) 4992 if !ok { 4993 return fmt.Errorf("unexpected JSON type %v", value) 4994 } 4995 4996 var sv *GetMembersOutput 4997 if *v == nil { 4998 sv = &GetMembersOutput{} 4999 } else { 5000 sv = *v 5001 } 5002 5003 for key, value := range shape { 5004 switch key { 5005 case "Members": 5006 if err := awsRestjson1_deserializeDocumentMemberList(&sv.Members, value); err != nil { 5007 return err 5008 } 5009 5010 case "UnprocessedAccounts": 5011 if err := awsRestjson1_deserializeDocumentResultList(&sv.UnprocessedAccounts, value); err != nil { 5012 return err 5013 } 5014 5015 default: 5016 _, _ = key, value 5017 5018 } 5019 } 5020 *v = sv 5021 return nil 5022} 5023 5024type awsRestjson1_deserializeOpInviteMembers struct { 5025} 5026 5027func (*awsRestjson1_deserializeOpInviteMembers) ID() string { 5028 return "OperationDeserializer" 5029} 5030 5031func (m *awsRestjson1_deserializeOpInviteMembers) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 5032 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 5033) { 5034 out, metadata, err = next.HandleDeserialize(ctx, in) 5035 if err != nil { 5036 return out, metadata, err 5037 } 5038 5039 response, ok := out.RawResponse.(*smithyhttp.Response) 5040 if !ok { 5041 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 5042 } 5043 5044 if response.StatusCode < 200 || response.StatusCode >= 300 { 5045 return out, metadata, awsRestjson1_deserializeOpErrorInviteMembers(response, &metadata) 5046 } 5047 output := &InviteMembersOutput{} 5048 out.Result = output 5049 5050 var buff [1024]byte 5051 ringBuffer := smithyio.NewRingBuffer(buff[:]) 5052 5053 body := io.TeeReader(response.Body, ringBuffer) 5054 5055 decoder := json.NewDecoder(body) 5056 decoder.UseNumber() 5057 var shape interface{} 5058 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 5059 var snapshot bytes.Buffer 5060 io.Copy(&snapshot, ringBuffer) 5061 err = &smithy.DeserializationError{ 5062 Err: fmt.Errorf("failed to decode response body, %w", err), 5063 Snapshot: snapshot.Bytes(), 5064 } 5065 return out, metadata, err 5066 } 5067 5068 err = awsRestjson1_deserializeOpDocumentInviteMembersOutput(&output, shape) 5069 if err != nil { 5070 var snapshot bytes.Buffer 5071 io.Copy(&snapshot, ringBuffer) 5072 return out, metadata, &smithy.DeserializationError{ 5073 Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), 5074 Snapshot: snapshot.Bytes(), 5075 } 5076 } 5077 5078 return out, metadata, err 5079} 5080 5081func awsRestjson1_deserializeOpErrorInviteMembers(response *smithyhttp.Response, metadata *middleware.Metadata) error { 5082 var errorBuffer bytes.Buffer 5083 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 5084 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 5085 } 5086 errorBody := bytes.NewReader(errorBuffer.Bytes()) 5087 5088 errorCode := "UnknownError" 5089 errorMessage := errorCode 5090 5091 code := response.Header.Get("X-Amzn-ErrorType") 5092 if len(code) != 0 { 5093 errorCode = restjson.SanitizeErrorCode(code) 5094 } 5095 5096 var buff [1024]byte 5097 ringBuffer := smithyio.NewRingBuffer(buff[:]) 5098 5099 body := io.TeeReader(errorBody, ringBuffer) 5100 decoder := json.NewDecoder(body) 5101 decoder.UseNumber() 5102 code, message, err := restjson.GetErrorInfo(decoder) 5103 if err != nil { 5104 var snapshot bytes.Buffer 5105 io.Copy(&snapshot, ringBuffer) 5106 err = &smithy.DeserializationError{ 5107 Err: fmt.Errorf("failed to decode response body, %w", err), 5108 Snapshot: snapshot.Bytes(), 5109 } 5110 return err 5111 } 5112 5113 errorBody.Seek(0, io.SeekStart) 5114 if len(code) != 0 { 5115 errorCode = restjson.SanitizeErrorCode(code) 5116 } 5117 if len(message) != 0 { 5118 errorMessage = message 5119 } 5120 5121 switch { 5122 case strings.EqualFold("InternalException", errorCode): 5123 return awsRestjson1_deserializeErrorInternalException(response, errorBody) 5124 5125 case strings.EqualFold("InvalidAccessException", errorCode): 5126 return awsRestjson1_deserializeErrorInvalidAccessException(response, errorBody) 5127 5128 case strings.EqualFold("InvalidInputException", errorCode): 5129 return awsRestjson1_deserializeErrorInvalidInputException(response, errorBody) 5130 5131 case strings.EqualFold("LimitExceededException", errorCode): 5132 return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) 5133 5134 case strings.EqualFold("ResourceNotFoundException", errorCode): 5135 return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) 5136 5137 default: 5138 genericError := &smithy.GenericAPIError{ 5139 Code: errorCode, 5140 Message: errorMessage, 5141 } 5142 return genericError 5143 5144 } 5145} 5146 5147func awsRestjson1_deserializeOpDocumentInviteMembersOutput(v **InviteMembersOutput, value interface{}) error { 5148 if v == nil { 5149 return fmt.Errorf("unexpected nil of type %T", v) 5150 } 5151 if value == nil { 5152 return nil 5153 } 5154 5155 shape, ok := value.(map[string]interface{}) 5156 if !ok { 5157 return fmt.Errorf("unexpected JSON type %v", value) 5158 } 5159 5160 var sv *InviteMembersOutput 5161 if *v == nil { 5162 sv = &InviteMembersOutput{} 5163 } else { 5164 sv = *v 5165 } 5166 5167 for key, value := range shape { 5168 switch key { 5169 case "UnprocessedAccounts": 5170 if err := awsRestjson1_deserializeDocumentResultList(&sv.UnprocessedAccounts, value); err != nil { 5171 return err 5172 } 5173 5174 default: 5175 _, _ = key, value 5176 5177 } 5178 } 5179 *v = sv 5180 return nil 5181} 5182 5183type awsRestjson1_deserializeOpListEnabledProductsForImport struct { 5184} 5185 5186func (*awsRestjson1_deserializeOpListEnabledProductsForImport) ID() string { 5187 return "OperationDeserializer" 5188} 5189 5190func (m *awsRestjson1_deserializeOpListEnabledProductsForImport) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 5191 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 5192) { 5193 out, metadata, err = next.HandleDeserialize(ctx, in) 5194 if err != nil { 5195 return out, metadata, err 5196 } 5197 5198 response, ok := out.RawResponse.(*smithyhttp.Response) 5199 if !ok { 5200 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 5201 } 5202 5203 if response.StatusCode < 200 || response.StatusCode >= 300 { 5204 return out, metadata, awsRestjson1_deserializeOpErrorListEnabledProductsForImport(response, &metadata) 5205 } 5206 output := &ListEnabledProductsForImportOutput{} 5207 out.Result = output 5208 5209 var buff [1024]byte 5210 ringBuffer := smithyio.NewRingBuffer(buff[:]) 5211 5212 body := io.TeeReader(response.Body, ringBuffer) 5213 5214 decoder := json.NewDecoder(body) 5215 decoder.UseNumber() 5216 var shape interface{} 5217 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 5218 var snapshot bytes.Buffer 5219 io.Copy(&snapshot, ringBuffer) 5220 err = &smithy.DeserializationError{ 5221 Err: fmt.Errorf("failed to decode response body, %w", err), 5222 Snapshot: snapshot.Bytes(), 5223 } 5224 return out, metadata, err 5225 } 5226 5227 err = awsRestjson1_deserializeOpDocumentListEnabledProductsForImportOutput(&output, shape) 5228 if err != nil { 5229 var snapshot bytes.Buffer 5230 io.Copy(&snapshot, ringBuffer) 5231 return out, metadata, &smithy.DeserializationError{ 5232 Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), 5233 Snapshot: snapshot.Bytes(), 5234 } 5235 } 5236 5237 return out, metadata, err 5238} 5239 5240func awsRestjson1_deserializeOpErrorListEnabledProductsForImport(response *smithyhttp.Response, metadata *middleware.Metadata) error { 5241 var errorBuffer bytes.Buffer 5242 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 5243 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 5244 } 5245 errorBody := bytes.NewReader(errorBuffer.Bytes()) 5246 5247 errorCode := "UnknownError" 5248 errorMessage := errorCode 5249 5250 code := response.Header.Get("X-Amzn-ErrorType") 5251 if len(code) != 0 { 5252 errorCode = restjson.SanitizeErrorCode(code) 5253 } 5254 5255 var buff [1024]byte 5256 ringBuffer := smithyio.NewRingBuffer(buff[:]) 5257 5258 body := io.TeeReader(errorBody, ringBuffer) 5259 decoder := json.NewDecoder(body) 5260 decoder.UseNumber() 5261 code, message, err := restjson.GetErrorInfo(decoder) 5262 if err != nil { 5263 var snapshot bytes.Buffer 5264 io.Copy(&snapshot, ringBuffer) 5265 err = &smithy.DeserializationError{ 5266 Err: fmt.Errorf("failed to decode response body, %w", err), 5267 Snapshot: snapshot.Bytes(), 5268 } 5269 return err 5270 } 5271 5272 errorBody.Seek(0, io.SeekStart) 5273 if len(code) != 0 { 5274 errorCode = restjson.SanitizeErrorCode(code) 5275 } 5276 if len(message) != 0 { 5277 errorMessage = message 5278 } 5279 5280 switch { 5281 case strings.EqualFold("InternalException", errorCode): 5282 return awsRestjson1_deserializeErrorInternalException(response, errorBody) 5283 5284 case strings.EqualFold("InvalidAccessException", errorCode): 5285 return awsRestjson1_deserializeErrorInvalidAccessException(response, errorBody) 5286 5287 case strings.EqualFold("LimitExceededException", errorCode): 5288 return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) 5289 5290 default: 5291 genericError := &smithy.GenericAPIError{ 5292 Code: errorCode, 5293 Message: errorMessage, 5294 } 5295 return genericError 5296 5297 } 5298} 5299 5300func awsRestjson1_deserializeOpDocumentListEnabledProductsForImportOutput(v **ListEnabledProductsForImportOutput, value interface{}) error { 5301 if v == nil { 5302 return fmt.Errorf("unexpected nil of type %T", v) 5303 } 5304 if value == nil { 5305 return nil 5306 } 5307 5308 shape, ok := value.(map[string]interface{}) 5309 if !ok { 5310 return fmt.Errorf("unexpected JSON type %v", value) 5311 } 5312 5313 var sv *ListEnabledProductsForImportOutput 5314 if *v == nil { 5315 sv = &ListEnabledProductsForImportOutput{} 5316 } else { 5317 sv = *v 5318 } 5319 5320 for key, value := range shape { 5321 switch key { 5322 case "NextToken": 5323 if value != nil { 5324 jtv, ok := value.(string) 5325 if !ok { 5326 return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) 5327 } 5328 sv.NextToken = ptr.String(jtv) 5329 } 5330 5331 case "ProductSubscriptions": 5332 if err := awsRestjson1_deserializeDocumentProductSubscriptionArnList(&sv.ProductSubscriptions, value); err != nil { 5333 return err 5334 } 5335 5336 default: 5337 _, _ = key, value 5338 5339 } 5340 } 5341 *v = sv 5342 return nil 5343} 5344 5345type awsRestjson1_deserializeOpListInvitations struct { 5346} 5347 5348func (*awsRestjson1_deserializeOpListInvitations) ID() string { 5349 return "OperationDeserializer" 5350} 5351 5352func (m *awsRestjson1_deserializeOpListInvitations) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 5353 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 5354) { 5355 out, metadata, err = next.HandleDeserialize(ctx, in) 5356 if err != nil { 5357 return out, metadata, err 5358 } 5359 5360 response, ok := out.RawResponse.(*smithyhttp.Response) 5361 if !ok { 5362 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 5363 } 5364 5365 if response.StatusCode < 200 || response.StatusCode >= 300 { 5366 return out, metadata, awsRestjson1_deserializeOpErrorListInvitations(response, &metadata) 5367 } 5368 output := &ListInvitationsOutput{} 5369 out.Result = output 5370 5371 var buff [1024]byte 5372 ringBuffer := smithyio.NewRingBuffer(buff[:]) 5373 5374 body := io.TeeReader(response.Body, ringBuffer) 5375 5376 decoder := json.NewDecoder(body) 5377 decoder.UseNumber() 5378 var shape interface{} 5379 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 5380 var snapshot bytes.Buffer 5381 io.Copy(&snapshot, ringBuffer) 5382 err = &smithy.DeserializationError{ 5383 Err: fmt.Errorf("failed to decode response body, %w", err), 5384 Snapshot: snapshot.Bytes(), 5385 } 5386 return out, metadata, err 5387 } 5388 5389 err = awsRestjson1_deserializeOpDocumentListInvitationsOutput(&output, shape) 5390 if err != nil { 5391 var snapshot bytes.Buffer 5392 io.Copy(&snapshot, ringBuffer) 5393 return out, metadata, &smithy.DeserializationError{ 5394 Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), 5395 Snapshot: snapshot.Bytes(), 5396 } 5397 } 5398 5399 return out, metadata, err 5400} 5401 5402func awsRestjson1_deserializeOpErrorListInvitations(response *smithyhttp.Response, metadata *middleware.Metadata) error { 5403 var errorBuffer bytes.Buffer 5404 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 5405 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 5406 } 5407 errorBody := bytes.NewReader(errorBuffer.Bytes()) 5408 5409 errorCode := "UnknownError" 5410 errorMessage := errorCode 5411 5412 code := response.Header.Get("X-Amzn-ErrorType") 5413 if len(code) != 0 { 5414 errorCode = restjson.SanitizeErrorCode(code) 5415 } 5416 5417 var buff [1024]byte 5418 ringBuffer := smithyio.NewRingBuffer(buff[:]) 5419 5420 body := io.TeeReader(errorBody, ringBuffer) 5421 decoder := json.NewDecoder(body) 5422 decoder.UseNumber() 5423 code, message, err := restjson.GetErrorInfo(decoder) 5424 if err != nil { 5425 var snapshot bytes.Buffer 5426 io.Copy(&snapshot, ringBuffer) 5427 err = &smithy.DeserializationError{ 5428 Err: fmt.Errorf("failed to decode response body, %w", err), 5429 Snapshot: snapshot.Bytes(), 5430 } 5431 return err 5432 } 5433 5434 errorBody.Seek(0, io.SeekStart) 5435 if len(code) != 0 { 5436 errorCode = restjson.SanitizeErrorCode(code) 5437 } 5438 if len(message) != 0 { 5439 errorMessage = message 5440 } 5441 5442 switch { 5443 case strings.EqualFold("InternalException", errorCode): 5444 return awsRestjson1_deserializeErrorInternalException(response, errorBody) 5445 5446 case strings.EqualFold("InvalidAccessException", errorCode): 5447 return awsRestjson1_deserializeErrorInvalidAccessException(response, errorBody) 5448 5449 case strings.EqualFold("InvalidInputException", errorCode): 5450 return awsRestjson1_deserializeErrorInvalidInputException(response, errorBody) 5451 5452 case strings.EqualFold("LimitExceededException", errorCode): 5453 return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) 5454 5455 default: 5456 genericError := &smithy.GenericAPIError{ 5457 Code: errorCode, 5458 Message: errorMessage, 5459 } 5460 return genericError 5461 5462 } 5463} 5464 5465func awsRestjson1_deserializeOpDocumentListInvitationsOutput(v **ListInvitationsOutput, value interface{}) error { 5466 if v == nil { 5467 return fmt.Errorf("unexpected nil of type %T", v) 5468 } 5469 if value == nil { 5470 return nil 5471 } 5472 5473 shape, ok := value.(map[string]interface{}) 5474 if !ok { 5475 return fmt.Errorf("unexpected JSON type %v", value) 5476 } 5477 5478 var sv *ListInvitationsOutput 5479 if *v == nil { 5480 sv = &ListInvitationsOutput{} 5481 } else { 5482 sv = *v 5483 } 5484 5485 for key, value := range shape { 5486 switch key { 5487 case "Invitations": 5488 if err := awsRestjson1_deserializeDocumentInvitationList(&sv.Invitations, value); err != nil { 5489 return err 5490 } 5491 5492 case "NextToken": 5493 if value != nil { 5494 jtv, ok := value.(string) 5495 if !ok { 5496 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 5497 } 5498 sv.NextToken = ptr.String(jtv) 5499 } 5500 5501 default: 5502 _, _ = key, value 5503 5504 } 5505 } 5506 *v = sv 5507 return nil 5508} 5509 5510type awsRestjson1_deserializeOpListMembers struct { 5511} 5512 5513func (*awsRestjson1_deserializeOpListMembers) ID() string { 5514 return "OperationDeserializer" 5515} 5516 5517func (m *awsRestjson1_deserializeOpListMembers) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 5518 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 5519) { 5520 out, metadata, err = next.HandleDeserialize(ctx, in) 5521 if err != nil { 5522 return out, metadata, err 5523 } 5524 5525 response, ok := out.RawResponse.(*smithyhttp.Response) 5526 if !ok { 5527 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 5528 } 5529 5530 if response.StatusCode < 200 || response.StatusCode >= 300 { 5531 return out, metadata, awsRestjson1_deserializeOpErrorListMembers(response, &metadata) 5532 } 5533 output := &ListMembersOutput{} 5534 out.Result = output 5535 5536 var buff [1024]byte 5537 ringBuffer := smithyio.NewRingBuffer(buff[:]) 5538 5539 body := io.TeeReader(response.Body, ringBuffer) 5540 5541 decoder := json.NewDecoder(body) 5542 decoder.UseNumber() 5543 var shape interface{} 5544 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 5545 var snapshot bytes.Buffer 5546 io.Copy(&snapshot, ringBuffer) 5547 err = &smithy.DeserializationError{ 5548 Err: fmt.Errorf("failed to decode response body, %w", err), 5549 Snapshot: snapshot.Bytes(), 5550 } 5551 return out, metadata, err 5552 } 5553 5554 err = awsRestjson1_deserializeOpDocumentListMembersOutput(&output, shape) 5555 if err != nil { 5556 var snapshot bytes.Buffer 5557 io.Copy(&snapshot, ringBuffer) 5558 return out, metadata, &smithy.DeserializationError{ 5559 Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), 5560 Snapshot: snapshot.Bytes(), 5561 } 5562 } 5563 5564 return out, metadata, err 5565} 5566 5567func awsRestjson1_deserializeOpErrorListMembers(response *smithyhttp.Response, metadata *middleware.Metadata) error { 5568 var errorBuffer bytes.Buffer 5569 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 5570 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 5571 } 5572 errorBody := bytes.NewReader(errorBuffer.Bytes()) 5573 5574 errorCode := "UnknownError" 5575 errorMessage := errorCode 5576 5577 code := response.Header.Get("X-Amzn-ErrorType") 5578 if len(code) != 0 { 5579 errorCode = restjson.SanitizeErrorCode(code) 5580 } 5581 5582 var buff [1024]byte 5583 ringBuffer := smithyio.NewRingBuffer(buff[:]) 5584 5585 body := io.TeeReader(errorBody, ringBuffer) 5586 decoder := json.NewDecoder(body) 5587 decoder.UseNumber() 5588 code, message, err := restjson.GetErrorInfo(decoder) 5589 if err != nil { 5590 var snapshot bytes.Buffer 5591 io.Copy(&snapshot, ringBuffer) 5592 err = &smithy.DeserializationError{ 5593 Err: fmt.Errorf("failed to decode response body, %w", err), 5594 Snapshot: snapshot.Bytes(), 5595 } 5596 return err 5597 } 5598 5599 errorBody.Seek(0, io.SeekStart) 5600 if len(code) != 0 { 5601 errorCode = restjson.SanitizeErrorCode(code) 5602 } 5603 if len(message) != 0 { 5604 errorMessage = message 5605 } 5606 5607 switch { 5608 case strings.EqualFold("InternalException", errorCode): 5609 return awsRestjson1_deserializeErrorInternalException(response, errorBody) 5610 5611 case strings.EqualFold("InvalidAccessException", errorCode): 5612 return awsRestjson1_deserializeErrorInvalidAccessException(response, errorBody) 5613 5614 case strings.EqualFold("InvalidInputException", errorCode): 5615 return awsRestjson1_deserializeErrorInvalidInputException(response, errorBody) 5616 5617 case strings.EqualFold("LimitExceededException", errorCode): 5618 return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) 5619 5620 default: 5621 genericError := &smithy.GenericAPIError{ 5622 Code: errorCode, 5623 Message: errorMessage, 5624 } 5625 return genericError 5626 5627 } 5628} 5629 5630func awsRestjson1_deserializeOpDocumentListMembersOutput(v **ListMembersOutput, value interface{}) error { 5631 if v == nil { 5632 return fmt.Errorf("unexpected nil of type %T", v) 5633 } 5634 if value == nil { 5635 return nil 5636 } 5637 5638 shape, ok := value.(map[string]interface{}) 5639 if !ok { 5640 return fmt.Errorf("unexpected JSON type %v", value) 5641 } 5642 5643 var sv *ListMembersOutput 5644 if *v == nil { 5645 sv = &ListMembersOutput{} 5646 } else { 5647 sv = *v 5648 } 5649 5650 for key, value := range shape { 5651 switch key { 5652 case "Members": 5653 if err := awsRestjson1_deserializeDocumentMemberList(&sv.Members, value); err != nil { 5654 return err 5655 } 5656 5657 case "NextToken": 5658 if value != nil { 5659 jtv, ok := value.(string) 5660 if !ok { 5661 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 5662 } 5663 sv.NextToken = ptr.String(jtv) 5664 } 5665 5666 default: 5667 _, _ = key, value 5668 5669 } 5670 } 5671 *v = sv 5672 return nil 5673} 5674 5675type awsRestjson1_deserializeOpListOrganizationAdminAccounts struct { 5676} 5677 5678func (*awsRestjson1_deserializeOpListOrganizationAdminAccounts) ID() string { 5679 return "OperationDeserializer" 5680} 5681 5682func (m *awsRestjson1_deserializeOpListOrganizationAdminAccounts) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 5683 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 5684) { 5685 out, metadata, err = next.HandleDeserialize(ctx, in) 5686 if err != nil { 5687 return out, metadata, err 5688 } 5689 5690 response, ok := out.RawResponse.(*smithyhttp.Response) 5691 if !ok { 5692 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 5693 } 5694 5695 if response.StatusCode < 200 || response.StatusCode >= 300 { 5696 return out, metadata, awsRestjson1_deserializeOpErrorListOrganizationAdminAccounts(response, &metadata) 5697 } 5698 output := &ListOrganizationAdminAccountsOutput{} 5699 out.Result = output 5700 5701 var buff [1024]byte 5702 ringBuffer := smithyio.NewRingBuffer(buff[:]) 5703 5704 body := io.TeeReader(response.Body, ringBuffer) 5705 5706 decoder := json.NewDecoder(body) 5707 decoder.UseNumber() 5708 var shape interface{} 5709 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 5710 var snapshot bytes.Buffer 5711 io.Copy(&snapshot, ringBuffer) 5712 err = &smithy.DeserializationError{ 5713 Err: fmt.Errorf("failed to decode response body, %w", err), 5714 Snapshot: snapshot.Bytes(), 5715 } 5716 return out, metadata, err 5717 } 5718 5719 err = awsRestjson1_deserializeOpDocumentListOrganizationAdminAccountsOutput(&output, shape) 5720 if err != nil { 5721 var snapshot bytes.Buffer 5722 io.Copy(&snapshot, ringBuffer) 5723 return out, metadata, &smithy.DeserializationError{ 5724 Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), 5725 Snapshot: snapshot.Bytes(), 5726 } 5727 } 5728 5729 return out, metadata, err 5730} 5731 5732func awsRestjson1_deserializeOpErrorListOrganizationAdminAccounts(response *smithyhttp.Response, metadata *middleware.Metadata) error { 5733 var errorBuffer bytes.Buffer 5734 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 5735 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 5736 } 5737 errorBody := bytes.NewReader(errorBuffer.Bytes()) 5738 5739 errorCode := "UnknownError" 5740 errorMessage := errorCode 5741 5742 code := response.Header.Get("X-Amzn-ErrorType") 5743 if len(code) != 0 { 5744 errorCode = restjson.SanitizeErrorCode(code) 5745 } 5746 5747 var buff [1024]byte 5748 ringBuffer := smithyio.NewRingBuffer(buff[:]) 5749 5750 body := io.TeeReader(errorBody, ringBuffer) 5751 decoder := json.NewDecoder(body) 5752 decoder.UseNumber() 5753 code, message, err := restjson.GetErrorInfo(decoder) 5754 if err != nil { 5755 var snapshot bytes.Buffer 5756 io.Copy(&snapshot, ringBuffer) 5757 err = &smithy.DeserializationError{ 5758 Err: fmt.Errorf("failed to decode response body, %w", err), 5759 Snapshot: snapshot.Bytes(), 5760 } 5761 return err 5762 } 5763 5764 errorBody.Seek(0, io.SeekStart) 5765 if len(code) != 0 { 5766 errorCode = restjson.SanitizeErrorCode(code) 5767 } 5768 if len(message) != 0 { 5769 errorMessage = message 5770 } 5771 5772 switch { 5773 case strings.EqualFold("InternalException", errorCode): 5774 return awsRestjson1_deserializeErrorInternalException(response, errorBody) 5775 5776 case strings.EqualFold("InvalidAccessException", errorCode): 5777 return awsRestjson1_deserializeErrorInvalidAccessException(response, errorBody) 5778 5779 case strings.EqualFold("InvalidInputException", errorCode): 5780 return awsRestjson1_deserializeErrorInvalidInputException(response, errorBody) 5781 5782 case strings.EqualFold("LimitExceededException", errorCode): 5783 return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) 5784 5785 default: 5786 genericError := &smithy.GenericAPIError{ 5787 Code: errorCode, 5788 Message: errorMessage, 5789 } 5790 return genericError 5791 5792 } 5793} 5794 5795func awsRestjson1_deserializeOpDocumentListOrganizationAdminAccountsOutput(v **ListOrganizationAdminAccountsOutput, value interface{}) error { 5796 if v == nil { 5797 return fmt.Errorf("unexpected nil of type %T", v) 5798 } 5799 if value == nil { 5800 return nil 5801 } 5802 5803 shape, ok := value.(map[string]interface{}) 5804 if !ok { 5805 return fmt.Errorf("unexpected JSON type %v", value) 5806 } 5807 5808 var sv *ListOrganizationAdminAccountsOutput 5809 if *v == nil { 5810 sv = &ListOrganizationAdminAccountsOutput{} 5811 } else { 5812 sv = *v 5813 } 5814 5815 for key, value := range shape { 5816 switch key { 5817 case "AdminAccounts": 5818 if err := awsRestjson1_deserializeDocumentAdminAccounts(&sv.AdminAccounts, value); err != nil { 5819 return err 5820 } 5821 5822 case "NextToken": 5823 if value != nil { 5824 jtv, ok := value.(string) 5825 if !ok { 5826 return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) 5827 } 5828 sv.NextToken = ptr.String(jtv) 5829 } 5830 5831 default: 5832 _, _ = key, value 5833 5834 } 5835 } 5836 *v = sv 5837 return nil 5838} 5839 5840type awsRestjson1_deserializeOpListTagsForResource struct { 5841} 5842 5843func (*awsRestjson1_deserializeOpListTagsForResource) ID() string { 5844 return "OperationDeserializer" 5845} 5846 5847func (m *awsRestjson1_deserializeOpListTagsForResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 5848 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 5849) { 5850 out, metadata, err = next.HandleDeserialize(ctx, in) 5851 if err != nil { 5852 return out, metadata, err 5853 } 5854 5855 response, ok := out.RawResponse.(*smithyhttp.Response) 5856 if !ok { 5857 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 5858 } 5859 5860 if response.StatusCode < 200 || response.StatusCode >= 300 { 5861 return out, metadata, awsRestjson1_deserializeOpErrorListTagsForResource(response, &metadata) 5862 } 5863 output := &ListTagsForResourceOutput{} 5864 out.Result = output 5865 5866 var buff [1024]byte 5867 ringBuffer := smithyio.NewRingBuffer(buff[:]) 5868 5869 body := io.TeeReader(response.Body, ringBuffer) 5870 5871 decoder := json.NewDecoder(body) 5872 decoder.UseNumber() 5873 var shape interface{} 5874 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 5875 var snapshot bytes.Buffer 5876 io.Copy(&snapshot, ringBuffer) 5877 err = &smithy.DeserializationError{ 5878 Err: fmt.Errorf("failed to decode response body, %w", err), 5879 Snapshot: snapshot.Bytes(), 5880 } 5881 return out, metadata, err 5882 } 5883 5884 err = awsRestjson1_deserializeOpDocumentListTagsForResourceOutput(&output, shape) 5885 if err != nil { 5886 var snapshot bytes.Buffer 5887 io.Copy(&snapshot, ringBuffer) 5888 return out, metadata, &smithy.DeserializationError{ 5889 Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), 5890 Snapshot: snapshot.Bytes(), 5891 } 5892 } 5893 5894 return out, metadata, err 5895} 5896 5897func awsRestjson1_deserializeOpErrorListTagsForResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { 5898 var errorBuffer bytes.Buffer 5899 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 5900 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 5901 } 5902 errorBody := bytes.NewReader(errorBuffer.Bytes()) 5903 5904 errorCode := "UnknownError" 5905 errorMessage := errorCode 5906 5907 code := response.Header.Get("X-Amzn-ErrorType") 5908 if len(code) != 0 { 5909 errorCode = restjson.SanitizeErrorCode(code) 5910 } 5911 5912 var buff [1024]byte 5913 ringBuffer := smithyio.NewRingBuffer(buff[:]) 5914 5915 body := io.TeeReader(errorBody, ringBuffer) 5916 decoder := json.NewDecoder(body) 5917 decoder.UseNumber() 5918 code, message, err := restjson.GetErrorInfo(decoder) 5919 if err != nil { 5920 var snapshot bytes.Buffer 5921 io.Copy(&snapshot, ringBuffer) 5922 err = &smithy.DeserializationError{ 5923 Err: fmt.Errorf("failed to decode response body, %w", err), 5924 Snapshot: snapshot.Bytes(), 5925 } 5926 return err 5927 } 5928 5929 errorBody.Seek(0, io.SeekStart) 5930 if len(code) != 0 { 5931 errorCode = restjson.SanitizeErrorCode(code) 5932 } 5933 if len(message) != 0 { 5934 errorMessage = message 5935 } 5936 5937 switch { 5938 case strings.EqualFold("InternalException", errorCode): 5939 return awsRestjson1_deserializeErrorInternalException(response, errorBody) 5940 5941 case strings.EqualFold("InvalidInputException", errorCode): 5942 return awsRestjson1_deserializeErrorInvalidInputException(response, errorBody) 5943 5944 case strings.EqualFold("ResourceNotFoundException", errorCode): 5945 return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) 5946 5947 default: 5948 genericError := &smithy.GenericAPIError{ 5949 Code: errorCode, 5950 Message: errorMessage, 5951 } 5952 return genericError 5953 5954 } 5955} 5956 5957func awsRestjson1_deserializeOpDocumentListTagsForResourceOutput(v **ListTagsForResourceOutput, value interface{}) error { 5958 if v == nil { 5959 return fmt.Errorf("unexpected nil of type %T", v) 5960 } 5961 if value == nil { 5962 return nil 5963 } 5964 5965 shape, ok := value.(map[string]interface{}) 5966 if !ok { 5967 return fmt.Errorf("unexpected JSON type %v", value) 5968 } 5969 5970 var sv *ListTagsForResourceOutput 5971 if *v == nil { 5972 sv = &ListTagsForResourceOutput{} 5973 } else { 5974 sv = *v 5975 } 5976 5977 for key, value := range shape { 5978 switch key { 5979 case "Tags": 5980 if err := awsRestjson1_deserializeDocumentTagMap(&sv.Tags, value); err != nil { 5981 return err 5982 } 5983 5984 default: 5985 _, _ = key, value 5986 5987 } 5988 } 5989 *v = sv 5990 return nil 5991} 5992 5993type awsRestjson1_deserializeOpTagResource struct { 5994} 5995 5996func (*awsRestjson1_deserializeOpTagResource) ID() string { 5997 return "OperationDeserializer" 5998} 5999 6000func (m *awsRestjson1_deserializeOpTagResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 6001 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 6002) { 6003 out, metadata, err = next.HandleDeserialize(ctx, in) 6004 if err != nil { 6005 return out, metadata, err 6006 } 6007 6008 response, ok := out.RawResponse.(*smithyhttp.Response) 6009 if !ok { 6010 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 6011 } 6012 6013 if response.StatusCode < 200 || response.StatusCode >= 300 { 6014 return out, metadata, awsRestjson1_deserializeOpErrorTagResource(response, &metadata) 6015 } 6016 output := &TagResourceOutput{} 6017 out.Result = output 6018 6019 return out, metadata, err 6020} 6021 6022func awsRestjson1_deserializeOpErrorTagResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { 6023 var errorBuffer bytes.Buffer 6024 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 6025 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 6026 } 6027 errorBody := bytes.NewReader(errorBuffer.Bytes()) 6028 6029 errorCode := "UnknownError" 6030 errorMessage := errorCode 6031 6032 code := response.Header.Get("X-Amzn-ErrorType") 6033 if len(code) != 0 { 6034 errorCode = restjson.SanitizeErrorCode(code) 6035 } 6036 6037 var buff [1024]byte 6038 ringBuffer := smithyio.NewRingBuffer(buff[:]) 6039 6040 body := io.TeeReader(errorBody, ringBuffer) 6041 decoder := json.NewDecoder(body) 6042 decoder.UseNumber() 6043 code, message, err := restjson.GetErrorInfo(decoder) 6044 if err != nil { 6045 var snapshot bytes.Buffer 6046 io.Copy(&snapshot, ringBuffer) 6047 err = &smithy.DeserializationError{ 6048 Err: fmt.Errorf("failed to decode response body, %w", err), 6049 Snapshot: snapshot.Bytes(), 6050 } 6051 return err 6052 } 6053 6054 errorBody.Seek(0, io.SeekStart) 6055 if len(code) != 0 { 6056 errorCode = restjson.SanitizeErrorCode(code) 6057 } 6058 if len(message) != 0 { 6059 errorMessage = message 6060 } 6061 6062 switch { 6063 case strings.EqualFold("InternalException", errorCode): 6064 return awsRestjson1_deserializeErrorInternalException(response, errorBody) 6065 6066 case strings.EqualFold("InvalidInputException", errorCode): 6067 return awsRestjson1_deserializeErrorInvalidInputException(response, errorBody) 6068 6069 case strings.EqualFold("ResourceNotFoundException", errorCode): 6070 return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) 6071 6072 default: 6073 genericError := &smithy.GenericAPIError{ 6074 Code: errorCode, 6075 Message: errorMessage, 6076 } 6077 return genericError 6078 6079 } 6080} 6081 6082type awsRestjson1_deserializeOpUntagResource struct { 6083} 6084 6085func (*awsRestjson1_deserializeOpUntagResource) ID() string { 6086 return "OperationDeserializer" 6087} 6088 6089func (m *awsRestjson1_deserializeOpUntagResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 6090 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 6091) { 6092 out, metadata, err = next.HandleDeserialize(ctx, in) 6093 if err != nil { 6094 return out, metadata, err 6095 } 6096 6097 response, ok := out.RawResponse.(*smithyhttp.Response) 6098 if !ok { 6099 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 6100 } 6101 6102 if response.StatusCode < 200 || response.StatusCode >= 300 { 6103 return out, metadata, awsRestjson1_deserializeOpErrorUntagResource(response, &metadata) 6104 } 6105 output := &UntagResourceOutput{} 6106 out.Result = output 6107 6108 return out, metadata, err 6109} 6110 6111func awsRestjson1_deserializeOpErrorUntagResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { 6112 var errorBuffer bytes.Buffer 6113 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 6114 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 6115 } 6116 errorBody := bytes.NewReader(errorBuffer.Bytes()) 6117 6118 errorCode := "UnknownError" 6119 errorMessage := errorCode 6120 6121 code := response.Header.Get("X-Amzn-ErrorType") 6122 if len(code) != 0 { 6123 errorCode = restjson.SanitizeErrorCode(code) 6124 } 6125 6126 var buff [1024]byte 6127 ringBuffer := smithyio.NewRingBuffer(buff[:]) 6128 6129 body := io.TeeReader(errorBody, ringBuffer) 6130 decoder := json.NewDecoder(body) 6131 decoder.UseNumber() 6132 code, message, err := restjson.GetErrorInfo(decoder) 6133 if err != nil { 6134 var snapshot bytes.Buffer 6135 io.Copy(&snapshot, ringBuffer) 6136 err = &smithy.DeserializationError{ 6137 Err: fmt.Errorf("failed to decode response body, %w", err), 6138 Snapshot: snapshot.Bytes(), 6139 } 6140 return err 6141 } 6142 6143 errorBody.Seek(0, io.SeekStart) 6144 if len(code) != 0 { 6145 errorCode = restjson.SanitizeErrorCode(code) 6146 } 6147 if len(message) != 0 { 6148 errorMessage = message 6149 } 6150 6151 switch { 6152 case strings.EqualFold("InternalException", errorCode): 6153 return awsRestjson1_deserializeErrorInternalException(response, errorBody) 6154 6155 case strings.EqualFold("InvalidInputException", errorCode): 6156 return awsRestjson1_deserializeErrorInvalidInputException(response, errorBody) 6157 6158 case strings.EqualFold("ResourceNotFoundException", errorCode): 6159 return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) 6160 6161 default: 6162 genericError := &smithy.GenericAPIError{ 6163 Code: errorCode, 6164 Message: errorMessage, 6165 } 6166 return genericError 6167 6168 } 6169} 6170 6171type awsRestjson1_deserializeOpUpdateActionTarget struct { 6172} 6173 6174func (*awsRestjson1_deserializeOpUpdateActionTarget) ID() string { 6175 return "OperationDeserializer" 6176} 6177 6178func (m *awsRestjson1_deserializeOpUpdateActionTarget) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 6179 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 6180) { 6181 out, metadata, err = next.HandleDeserialize(ctx, in) 6182 if err != nil { 6183 return out, metadata, err 6184 } 6185 6186 response, ok := out.RawResponse.(*smithyhttp.Response) 6187 if !ok { 6188 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 6189 } 6190 6191 if response.StatusCode < 200 || response.StatusCode >= 300 { 6192 return out, metadata, awsRestjson1_deserializeOpErrorUpdateActionTarget(response, &metadata) 6193 } 6194 output := &UpdateActionTargetOutput{} 6195 out.Result = output 6196 6197 return out, metadata, err 6198} 6199 6200func awsRestjson1_deserializeOpErrorUpdateActionTarget(response *smithyhttp.Response, metadata *middleware.Metadata) error { 6201 var errorBuffer bytes.Buffer 6202 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 6203 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 6204 } 6205 errorBody := bytes.NewReader(errorBuffer.Bytes()) 6206 6207 errorCode := "UnknownError" 6208 errorMessage := errorCode 6209 6210 code := response.Header.Get("X-Amzn-ErrorType") 6211 if len(code) != 0 { 6212 errorCode = restjson.SanitizeErrorCode(code) 6213 } 6214 6215 var buff [1024]byte 6216 ringBuffer := smithyio.NewRingBuffer(buff[:]) 6217 6218 body := io.TeeReader(errorBody, ringBuffer) 6219 decoder := json.NewDecoder(body) 6220 decoder.UseNumber() 6221 code, message, err := restjson.GetErrorInfo(decoder) 6222 if err != nil { 6223 var snapshot bytes.Buffer 6224 io.Copy(&snapshot, ringBuffer) 6225 err = &smithy.DeserializationError{ 6226 Err: fmt.Errorf("failed to decode response body, %w", err), 6227 Snapshot: snapshot.Bytes(), 6228 } 6229 return err 6230 } 6231 6232 errorBody.Seek(0, io.SeekStart) 6233 if len(code) != 0 { 6234 errorCode = restjson.SanitizeErrorCode(code) 6235 } 6236 if len(message) != 0 { 6237 errorMessage = message 6238 } 6239 6240 switch { 6241 case strings.EqualFold("InternalException", errorCode): 6242 return awsRestjson1_deserializeErrorInternalException(response, errorBody) 6243 6244 case strings.EqualFold("InvalidAccessException", errorCode): 6245 return awsRestjson1_deserializeErrorInvalidAccessException(response, errorBody) 6246 6247 case strings.EqualFold("InvalidInputException", errorCode): 6248 return awsRestjson1_deserializeErrorInvalidInputException(response, errorBody) 6249 6250 case strings.EqualFold("ResourceNotFoundException", errorCode): 6251 return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) 6252 6253 default: 6254 genericError := &smithy.GenericAPIError{ 6255 Code: errorCode, 6256 Message: errorMessage, 6257 } 6258 return genericError 6259 6260 } 6261} 6262 6263type awsRestjson1_deserializeOpUpdateFindings struct { 6264} 6265 6266func (*awsRestjson1_deserializeOpUpdateFindings) ID() string { 6267 return "OperationDeserializer" 6268} 6269 6270func (m *awsRestjson1_deserializeOpUpdateFindings) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 6271 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 6272) { 6273 out, metadata, err = next.HandleDeserialize(ctx, in) 6274 if err != nil { 6275 return out, metadata, err 6276 } 6277 6278 response, ok := out.RawResponse.(*smithyhttp.Response) 6279 if !ok { 6280 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 6281 } 6282 6283 if response.StatusCode < 200 || response.StatusCode >= 300 { 6284 return out, metadata, awsRestjson1_deserializeOpErrorUpdateFindings(response, &metadata) 6285 } 6286 output := &UpdateFindingsOutput{} 6287 out.Result = output 6288 6289 return out, metadata, err 6290} 6291 6292func awsRestjson1_deserializeOpErrorUpdateFindings(response *smithyhttp.Response, metadata *middleware.Metadata) error { 6293 var errorBuffer bytes.Buffer 6294 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 6295 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 6296 } 6297 errorBody := bytes.NewReader(errorBuffer.Bytes()) 6298 6299 errorCode := "UnknownError" 6300 errorMessage := errorCode 6301 6302 code := response.Header.Get("X-Amzn-ErrorType") 6303 if len(code) != 0 { 6304 errorCode = restjson.SanitizeErrorCode(code) 6305 } 6306 6307 var buff [1024]byte 6308 ringBuffer := smithyio.NewRingBuffer(buff[:]) 6309 6310 body := io.TeeReader(errorBody, ringBuffer) 6311 decoder := json.NewDecoder(body) 6312 decoder.UseNumber() 6313 code, message, err := restjson.GetErrorInfo(decoder) 6314 if err != nil { 6315 var snapshot bytes.Buffer 6316 io.Copy(&snapshot, ringBuffer) 6317 err = &smithy.DeserializationError{ 6318 Err: fmt.Errorf("failed to decode response body, %w", err), 6319 Snapshot: snapshot.Bytes(), 6320 } 6321 return err 6322 } 6323 6324 errorBody.Seek(0, io.SeekStart) 6325 if len(code) != 0 { 6326 errorCode = restjson.SanitizeErrorCode(code) 6327 } 6328 if len(message) != 0 { 6329 errorMessage = message 6330 } 6331 6332 switch { 6333 case strings.EqualFold("InternalException", errorCode): 6334 return awsRestjson1_deserializeErrorInternalException(response, errorBody) 6335 6336 case strings.EqualFold("InvalidAccessException", errorCode): 6337 return awsRestjson1_deserializeErrorInvalidAccessException(response, errorBody) 6338 6339 case strings.EqualFold("InvalidInputException", errorCode): 6340 return awsRestjson1_deserializeErrorInvalidInputException(response, errorBody) 6341 6342 case strings.EqualFold("LimitExceededException", errorCode): 6343 return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) 6344 6345 case strings.EqualFold("ResourceNotFoundException", errorCode): 6346 return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) 6347 6348 default: 6349 genericError := &smithy.GenericAPIError{ 6350 Code: errorCode, 6351 Message: errorMessage, 6352 } 6353 return genericError 6354 6355 } 6356} 6357 6358type awsRestjson1_deserializeOpUpdateInsight struct { 6359} 6360 6361func (*awsRestjson1_deserializeOpUpdateInsight) ID() string { 6362 return "OperationDeserializer" 6363} 6364 6365func (m *awsRestjson1_deserializeOpUpdateInsight) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 6366 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 6367) { 6368 out, metadata, err = next.HandleDeserialize(ctx, in) 6369 if err != nil { 6370 return out, metadata, err 6371 } 6372 6373 response, ok := out.RawResponse.(*smithyhttp.Response) 6374 if !ok { 6375 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 6376 } 6377 6378 if response.StatusCode < 200 || response.StatusCode >= 300 { 6379 return out, metadata, awsRestjson1_deserializeOpErrorUpdateInsight(response, &metadata) 6380 } 6381 output := &UpdateInsightOutput{} 6382 out.Result = output 6383 6384 return out, metadata, err 6385} 6386 6387func awsRestjson1_deserializeOpErrorUpdateInsight(response *smithyhttp.Response, metadata *middleware.Metadata) error { 6388 var errorBuffer bytes.Buffer 6389 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 6390 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 6391 } 6392 errorBody := bytes.NewReader(errorBuffer.Bytes()) 6393 6394 errorCode := "UnknownError" 6395 errorMessage := errorCode 6396 6397 code := response.Header.Get("X-Amzn-ErrorType") 6398 if len(code) != 0 { 6399 errorCode = restjson.SanitizeErrorCode(code) 6400 } 6401 6402 var buff [1024]byte 6403 ringBuffer := smithyio.NewRingBuffer(buff[:]) 6404 6405 body := io.TeeReader(errorBody, ringBuffer) 6406 decoder := json.NewDecoder(body) 6407 decoder.UseNumber() 6408 code, message, err := restjson.GetErrorInfo(decoder) 6409 if err != nil { 6410 var snapshot bytes.Buffer 6411 io.Copy(&snapshot, ringBuffer) 6412 err = &smithy.DeserializationError{ 6413 Err: fmt.Errorf("failed to decode response body, %w", err), 6414 Snapshot: snapshot.Bytes(), 6415 } 6416 return err 6417 } 6418 6419 errorBody.Seek(0, io.SeekStart) 6420 if len(code) != 0 { 6421 errorCode = restjson.SanitizeErrorCode(code) 6422 } 6423 if len(message) != 0 { 6424 errorMessage = message 6425 } 6426 6427 switch { 6428 case strings.EqualFold("InternalException", errorCode): 6429 return awsRestjson1_deserializeErrorInternalException(response, errorBody) 6430 6431 case strings.EqualFold("InvalidAccessException", errorCode): 6432 return awsRestjson1_deserializeErrorInvalidAccessException(response, errorBody) 6433 6434 case strings.EqualFold("InvalidInputException", errorCode): 6435 return awsRestjson1_deserializeErrorInvalidInputException(response, errorBody) 6436 6437 case strings.EqualFold("LimitExceededException", errorCode): 6438 return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) 6439 6440 case strings.EqualFold("ResourceNotFoundException", errorCode): 6441 return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) 6442 6443 default: 6444 genericError := &smithy.GenericAPIError{ 6445 Code: errorCode, 6446 Message: errorMessage, 6447 } 6448 return genericError 6449 6450 } 6451} 6452 6453type awsRestjson1_deserializeOpUpdateOrganizationConfiguration struct { 6454} 6455 6456func (*awsRestjson1_deserializeOpUpdateOrganizationConfiguration) ID() string { 6457 return "OperationDeserializer" 6458} 6459 6460func (m *awsRestjson1_deserializeOpUpdateOrganizationConfiguration) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 6461 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 6462) { 6463 out, metadata, err = next.HandleDeserialize(ctx, in) 6464 if err != nil { 6465 return out, metadata, err 6466 } 6467 6468 response, ok := out.RawResponse.(*smithyhttp.Response) 6469 if !ok { 6470 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 6471 } 6472 6473 if response.StatusCode < 200 || response.StatusCode >= 300 { 6474 return out, metadata, awsRestjson1_deserializeOpErrorUpdateOrganizationConfiguration(response, &metadata) 6475 } 6476 output := &UpdateOrganizationConfigurationOutput{} 6477 out.Result = output 6478 6479 return out, metadata, err 6480} 6481 6482func awsRestjson1_deserializeOpErrorUpdateOrganizationConfiguration(response *smithyhttp.Response, metadata *middleware.Metadata) error { 6483 var errorBuffer bytes.Buffer 6484 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 6485 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 6486 } 6487 errorBody := bytes.NewReader(errorBuffer.Bytes()) 6488 6489 errorCode := "UnknownError" 6490 errorMessage := errorCode 6491 6492 code := response.Header.Get("X-Amzn-ErrorType") 6493 if len(code) != 0 { 6494 errorCode = restjson.SanitizeErrorCode(code) 6495 } 6496 6497 var buff [1024]byte 6498 ringBuffer := smithyio.NewRingBuffer(buff[:]) 6499 6500 body := io.TeeReader(errorBody, ringBuffer) 6501 decoder := json.NewDecoder(body) 6502 decoder.UseNumber() 6503 code, message, err := restjson.GetErrorInfo(decoder) 6504 if err != nil { 6505 var snapshot bytes.Buffer 6506 io.Copy(&snapshot, ringBuffer) 6507 err = &smithy.DeserializationError{ 6508 Err: fmt.Errorf("failed to decode response body, %w", err), 6509 Snapshot: snapshot.Bytes(), 6510 } 6511 return err 6512 } 6513 6514 errorBody.Seek(0, io.SeekStart) 6515 if len(code) != 0 { 6516 errorCode = restjson.SanitizeErrorCode(code) 6517 } 6518 if len(message) != 0 { 6519 errorMessage = message 6520 } 6521 6522 switch { 6523 case strings.EqualFold("InternalException", errorCode): 6524 return awsRestjson1_deserializeErrorInternalException(response, errorBody) 6525 6526 case strings.EqualFold("InvalidAccessException", errorCode): 6527 return awsRestjson1_deserializeErrorInvalidAccessException(response, errorBody) 6528 6529 case strings.EqualFold("InvalidInputException", errorCode): 6530 return awsRestjson1_deserializeErrorInvalidInputException(response, errorBody) 6531 6532 case strings.EqualFold("LimitExceededException", errorCode): 6533 return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) 6534 6535 default: 6536 genericError := &smithy.GenericAPIError{ 6537 Code: errorCode, 6538 Message: errorMessage, 6539 } 6540 return genericError 6541 6542 } 6543} 6544 6545type awsRestjson1_deserializeOpUpdateSecurityHubConfiguration struct { 6546} 6547 6548func (*awsRestjson1_deserializeOpUpdateSecurityHubConfiguration) ID() string { 6549 return "OperationDeserializer" 6550} 6551 6552func (m *awsRestjson1_deserializeOpUpdateSecurityHubConfiguration) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 6553 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 6554) { 6555 out, metadata, err = next.HandleDeserialize(ctx, in) 6556 if err != nil { 6557 return out, metadata, err 6558 } 6559 6560 response, ok := out.RawResponse.(*smithyhttp.Response) 6561 if !ok { 6562 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 6563 } 6564 6565 if response.StatusCode < 200 || response.StatusCode >= 300 { 6566 return out, metadata, awsRestjson1_deserializeOpErrorUpdateSecurityHubConfiguration(response, &metadata) 6567 } 6568 output := &UpdateSecurityHubConfigurationOutput{} 6569 out.Result = output 6570 6571 return out, metadata, err 6572} 6573 6574func awsRestjson1_deserializeOpErrorUpdateSecurityHubConfiguration(response *smithyhttp.Response, metadata *middleware.Metadata) error { 6575 var errorBuffer bytes.Buffer 6576 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 6577 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 6578 } 6579 errorBody := bytes.NewReader(errorBuffer.Bytes()) 6580 6581 errorCode := "UnknownError" 6582 errorMessage := errorCode 6583 6584 code := response.Header.Get("X-Amzn-ErrorType") 6585 if len(code) != 0 { 6586 errorCode = restjson.SanitizeErrorCode(code) 6587 } 6588 6589 var buff [1024]byte 6590 ringBuffer := smithyio.NewRingBuffer(buff[:]) 6591 6592 body := io.TeeReader(errorBody, ringBuffer) 6593 decoder := json.NewDecoder(body) 6594 decoder.UseNumber() 6595 code, message, err := restjson.GetErrorInfo(decoder) 6596 if err != nil { 6597 var snapshot bytes.Buffer 6598 io.Copy(&snapshot, ringBuffer) 6599 err = &smithy.DeserializationError{ 6600 Err: fmt.Errorf("failed to decode response body, %w", err), 6601 Snapshot: snapshot.Bytes(), 6602 } 6603 return err 6604 } 6605 6606 errorBody.Seek(0, io.SeekStart) 6607 if len(code) != 0 { 6608 errorCode = restjson.SanitizeErrorCode(code) 6609 } 6610 if len(message) != 0 { 6611 errorMessage = message 6612 } 6613 6614 switch { 6615 case strings.EqualFold("InternalException", errorCode): 6616 return awsRestjson1_deserializeErrorInternalException(response, errorBody) 6617 6618 case strings.EqualFold("InvalidAccessException", errorCode): 6619 return awsRestjson1_deserializeErrorInvalidAccessException(response, errorBody) 6620 6621 case strings.EqualFold("InvalidInputException", errorCode): 6622 return awsRestjson1_deserializeErrorInvalidInputException(response, errorBody) 6623 6624 case strings.EqualFold("LimitExceededException", errorCode): 6625 return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) 6626 6627 case strings.EqualFold("ResourceNotFoundException", errorCode): 6628 return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) 6629 6630 default: 6631 genericError := &smithy.GenericAPIError{ 6632 Code: errorCode, 6633 Message: errorMessage, 6634 } 6635 return genericError 6636 6637 } 6638} 6639 6640type awsRestjson1_deserializeOpUpdateStandardsControl struct { 6641} 6642 6643func (*awsRestjson1_deserializeOpUpdateStandardsControl) ID() string { 6644 return "OperationDeserializer" 6645} 6646 6647func (m *awsRestjson1_deserializeOpUpdateStandardsControl) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 6648 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 6649) { 6650 out, metadata, err = next.HandleDeserialize(ctx, in) 6651 if err != nil { 6652 return out, metadata, err 6653 } 6654 6655 response, ok := out.RawResponse.(*smithyhttp.Response) 6656 if !ok { 6657 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 6658 } 6659 6660 if response.StatusCode < 200 || response.StatusCode >= 300 { 6661 return out, metadata, awsRestjson1_deserializeOpErrorUpdateStandardsControl(response, &metadata) 6662 } 6663 output := &UpdateStandardsControlOutput{} 6664 out.Result = output 6665 6666 return out, metadata, err 6667} 6668 6669func awsRestjson1_deserializeOpErrorUpdateStandardsControl(response *smithyhttp.Response, metadata *middleware.Metadata) error { 6670 var errorBuffer bytes.Buffer 6671 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 6672 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 6673 } 6674 errorBody := bytes.NewReader(errorBuffer.Bytes()) 6675 6676 errorCode := "UnknownError" 6677 errorMessage := errorCode 6678 6679 code := response.Header.Get("X-Amzn-ErrorType") 6680 if len(code) != 0 { 6681 errorCode = restjson.SanitizeErrorCode(code) 6682 } 6683 6684 var buff [1024]byte 6685 ringBuffer := smithyio.NewRingBuffer(buff[:]) 6686 6687 body := io.TeeReader(errorBody, ringBuffer) 6688 decoder := json.NewDecoder(body) 6689 decoder.UseNumber() 6690 code, message, err := restjson.GetErrorInfo(decoder) 6691 if err != nil { 6692 var snapshot bytes.Buffer 6693 io.Copy(&snapshot, ringBuffer) 6694 err = &smithy.DeserializationError{ 6695 Err: fmt.Errorf("failed to decode response body, %w", err), 6696 Snapshot: snapshot.Bytes(), 6697 } 6698 return err 6699 } 6700 6701 errorBody.Seek(0, io.SeekStart) 6702 if len(code) != 0 { 6703 errorCode = restjson.SanitizeErrorCode(code) 6704 } 6705 if len(message) != 0 { 6706 errorMessage = message 6707 } 6708 6709 switch { 6710 case strings.EqualFold("InternalException", errorCode): 6711 return awsRestjson1_deserializeErrorInternalException(response, errorBody) 6712 6713 case strings.EqualFold("InvalidAccessException", errorCode): 6714 return awsRestjson1_deserializeErrorInvalidAccessException(response, errorBody) 6715 6716 case strings.EqualFold("InvalidInputException", errorCode): 6717 return awsRestjson1_deserializeErrorInvalidInputException(response, errorBody) 6718 6719 case strings.EqualFold("ResourceNotFoundException", errorCode): 6720 return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) 6721 6722 default: 6723 genericError := &smithy.GenericAPIError{ 6724 Code: errorCode, 6725 Message: errorMessage, 6726 } 6727 return genericError 6728 6729 } 6730} 6731 6732func awsRestjson1_deserializeErrorAccessDeniedException(response *smithyhttp.Response, errorBody *bytes.Reader) error { 6733 output := &types.AccessDeniedException{} 6734 var buff [1024]byte 6735 ringBuffer := smithyio.NewRingBuffer(buff[:]) 6736 6737 body := io.TeeReader(errorBody, ringBuffer) 6738 decoder := json.NewDecoder(body) 6739 decoder.UseNumber() 6740 var shape interface{} 6741 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 6742 var snapshot bytes.Buffer 6743 io.Copy(&snapshot, ringBuffer) 6744 err = &smithy.DeserializationError{ 6745 Err: fmt.Errorf("failed to decode response body, %w", err), 6746 Snapshot: snapshot.Bytes(), 6747 } 6748 return err 6749 } 6750 6751 err := awsRestjson1_deserializeDocumentAccessDeniedException(&output, shape) 6752 6753 if err != nil { 6754 var snapshot bytes.Buffer 6755 io.Copy(&snapshot, ringBuffer) 6756 err = &smithy.DeserializationError{ 6757 Err: fmt.Errorf("failed to decode response body, %w", err), 6758 Snapshot: snapshot.Bytes(), 6759 } 6760 return err 6761 } 6762 6763 errorBody.Seek(0, io.SeekStart) 6764 6765 return output 6766} 6767 6768func awsRestjson1_deserializeErrorInternalException(response *smithyhttp.Response, errorBody *bytes.Reader) error { 6769 output := &types.InternalException{} 6770 var buff [1024]byte 6771 ringBuffer := smithyio.NewRingBuffer(buff[:]) 6772 6773 body := io.TeeReader(errorBody, ringBuffer) 6774 decoder := json.NewDecoder(body) 6775 decoder.UseNumber() 6776 var shape interface{} 6777 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 6778 var snapshot bytes.Buffer 6779 io.Copy(&snapshot, ringBuffer) 6780 err = &smithy.DeserializationError{ 6781 Err: fmt.Errorf("failed to decode response body, %w", err), 6782 Snapshot: snapshot.Bytes(), 6783 } 6784 return err 6785 } 6786 6787 err := awsRestjson1_deserializeDocumentInternalException(&output, shape) 6788 6789 if err != nil { 6790 var snapshot bytes.Buffer 6791 io.Copy(&snapshot, ringBuffer) 6792 err = &smithy.DeserializationError{ 6793 Err: fmt.Errorf("failed to decode response body, %w", err), 6794 Snapshot: snapshot.Bytes(), 6795 } 6796 return err 6797 } 6798 6799 errorBody.Seek(0, io.SeekStart) 6800 6801 return output 6802} 6803 6804func awsRestjson1_deserializeErrorInvalidAccessException(response *smithyhttp.Response, errorBody *bytes.Reader) error { 6805 output := &types.InvalidAccessException{} 6806 var buff [1024]byte 6807 ringBuffer := smithyio.NewRingBuffer(buff[:]) 6808 6809 body := io.TeeReader(errorBody, ringBuffer) 6810 decoder := json.NewDecoder(body) 6811 decoder.UseNumber() 6812 var shape interface{} 6813 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 6814 var snapshot bytes.Buffer 6815 io.Copy(&snapshot, ringBuffer) 6816 err = &smithy.DeserializationError{ 6817 Err: fmt.Errorf("failed to decode response body, %w", err), 6818 Snapshot: snapshot.Bytes(), 6819 } 6820 return err 6821 } 6822 6823 err := awsRestjson1_deserializeDocumentInvalidAccessException(&output, shape) 6824 6825 if err != nil { 6826 var snapshot bytes.Buffer 6827 io.Copy(&snapshot, ringBuffer) 6828 err = &smithy.DeserializationError{ 6829 Err: fmt.Errorf("failed to decode response body, %w", err), 6830 Snapshot: snapshot.Bytes(), 6831 } 6832 return err 6833 } 6834 6835 errorBody.Seek(0, io.SeekStart) 6836 6837 return output 6838} 6839 6840func awsRestjson1_deserializeErrorInvalidInputException(response *smithyhttp.Response, errorBody *bytes.Reader) error { 6841 output := &types.InvalidInputException{} 6842 var buff [1024]byte 6843 ringBuffer := smithyio.NewRingBuffer(buff[:]) 6844 6845 body := io.TeeReader(errorBody, ringBuffer) 6846 decoder := json.NewDecoder(body) 6847 decoder.UseNumber() 6848 var shape interface{} 6849 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 6850 var snapshot bytes.Buffer 6851 io.Copy(&snapshot, ringBuffer) 6852 err = &smithy.DeserializationError{ 6853 Err: fmt.Errorf("failed to decode response body, %w", err), 6854 Snapshot: snapshot.Bytes(), 6855 } 6856 return err 6857 } 6858 6859 err := awsRestjson1_deserializeDocumentInvalidInputException(&output, shape) 6860 6861 if err != nil { 6862 var snapshot bytes.Buffer 6863 io.Copy(&snapshot, ringBuffer) 6864 err = &smithy.DeserializationError{ 6865 Err: fmt.Errorf("failed to decode response body, %w", err), 6866 Snapshot: snapshot.Bytes(), 6867 } 6868 return err 6869 } 6870 6871 errorBody.Seek(0, io.SeekStart) 6872 6873 return output 6874} 6875 6876func awsRestjson1_deserializeErrorLimitExceededException(response *smithyhttp.Response, errorBody *bytes.Reader) error { 6877 output := &types.LimitExceededException{} 6878 var buff [1024]byte 6879 ringBuffer := smithyio.NewRingBuffer(buff[:]) 6880 6881 body := io.TeeReader(errorBody, ringBuffer) 6882 decoder := json.NewDecoder(body) 6883 decoder.UseNumber() 6884 var shape interface{} 6885 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 6886 var snapshot bytes.Buffer 6887 io.Copy(&snapshot, ringBuffer) 6888 err = &smithy.DeserializationError{ 6889 Err: fmt.Errorf("failed to decode response body, %w", err), 6890 Snapshot: snapshot.Bytes(), 6891 } 6892 return err 6893 } 6894 6895 err := awsRestjson1_deserializeDocumentLimitExceededException(&output, shape) 6896 6897 if err != nil { 6898 var snapshot bytes.Buffer 6899 io.Copy(&snapshot, ringBuffer) 6900 err = &smithy.DeserializationError{ 6901 Err: fmt.Errorf("failed to decode response body, %w", err), 6902 Snapshot: snapshot.Bytes(), 6903 } 6904 return err 6905 } 6906 6907 errorBody.Seek(0, io.SeekStart) 6908 6909 return output 6910} 6911 6912func awsRestjson1_deserializeErrorResourceConflictException(response *smithyhttp.Response, errorBody *bytes.Reader) error { 6913 output := &types.ResourceConflictException{} 6914 var buff [1024]byte 6915 ringBuffer := smithyio.NewRingBuffer(buff[:]) 6916 6917 body := io.TeeReader(errorBody, ringBuffer) 6918 decoder := json.NewDecoder(body) 6919 decoder.UseNumber() 6920 var shape interface{} 6921 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 6922 var snapshot bytes.Buffer 6923 io.Copy(&snapshot, ringBuffer) 6924 err = &smithy.DeserializationError{ 6925 Err: fmt.Errorf("failed to decode response body, %w", err), 6926 Snapshot: snapshot.Bytes(), 6927 } 6928 return err 6929 } 6930 6931 err := awsRestjson1_deserializeDocumentResourceConflictException(&output, shape) 6932 6933 if err != nil { 6934 var snapshot bytes.Buffer 6935 io.Copy(&snapshot, ringBuffer) 6936 err = &smithy.DeserializationError{ 6937 Err: fmt.Errorf("failed to decode response body, %w", err), 6938 Snapshot: snapshot.Bytes(), 6939 } 6940 return err 6941 } 6942 6943 errorBody.Seek(0, io.SeekStart) 6944 6945 return output 6946} 6947 6948func awsRestjson1_deserializeErrorResourceNotFoundException(response *smithyhttp.Response, errorBody *bytes.Reader) error { 6949 output := &types.ResourceNotFoundException{} 6950 var buff [1024]byte 6951 ringBuffer := smithyio.NewRingBuffer(buff[:]) 6952 6953 body := io.TeeReader(errorBody, ringBuffer) 6954 decoder := json.NewDecoder(body) 6955 decoder.UseNumber() 6956 var shape interface{} 6957 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 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 err 6965 } 6966 6967 err := awsRestjson1_deserializeDocumentResourceNotFoundException(&output, shape) 6968 6969 if err != nil { 6970 var snapshot bytes.Buffer 6971 io.Copy(&snapshot, ringBuffer) 6972 err = &smithy.DeserializationError{ 6973 Err: fmt.Errorf("failed to decode response body, %w", err), 6974 Snapshot: snapshot.Bytes(), 6975 } 6976 return err 6977 } 6978 6979 errorBody.Seek(0, io.SeekStart) 6980 6981 return output 6982} 6983 6984func awsRestjson1_deserializeDocumentAccessDeniedException(v **types.AccessDeniedException, value interface{}) error { 6985 if v == nil { 6986 return fmt.Errorf("unexpected nil of type %T", v) 6987 } 6988 if value == nil { 6989 return nil 6990 } 6991 6992 shape, ok := value.(map[string]interface{}) 6993 if !ok { 6994 return fmt.Errorf("unexpected JSON type %v", value) 6995 } 6996 6997 var sv *types.AccessDeniedException 6998 if *v == nil { 6999 sv = &types.AccessDeniedException{} 7000 } else { 7001 sv = *v 7002 } 7003 7004 for key, value := range shape { 7005 switch key { 7006 case "Code": 7007 if value != nil { 7008 jtv, ok := value.(string) 7009 if !ok { 7010 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 7011 } 7012 sv.Code = ptr.String(jtv) 7013 } 7014 7015 case "Message": 7016 if value != nil { 7017 jtv, ok := value.(string) 7018 if !ok { 7019 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 7020 } 7021 sv.Message = ptr.String(jtv) 7022 } 7023 7024 default: 7025 _, _ = key, value 7026 7027 } 7028 } 7029 *v = sv 7030 return nil 7031} 7032 7033func awsRestjson1_deserializeDocumentActionTarget(v **types.ActionTarget, value interface{}) error { 7034 if v == nil { 7035 return fmt.Errorf("unexpected nil of type %T", v) 7036 } 7037 if value == nil { 7038 return nil 7039 } 7040 7041 shape, ok := value.(map[string]interface{}) 7042 if !ok { 7043 return fmt.Errorf("unexpected JSON type %v", value) 7044 } 7045 7046 var sv *types.ActionTarget 7047 if *v == nil { 7048 sv = &types.ActionTarget{} 7049 } else { 7050 sv = *v 7051 } 7052 7053 for key, value := range shape { 7054 switch key { 7055 case "ActionTargetArn": 7056 if value != nil { 7057 jtv, ok := value.(string) 7058 if !ok { 7059 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 7060 } 7061 sv.ActionTargetArn = ptr.String(jtv) 7062 } 7063 7064 case "Description": 7065 if value != nil { 7066 jtv, ok := value.(string) 7067 if !ok { 7068 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 7069 } 7070 sv.Description = ptr.String(jtv) 7071 } 7072 7073 case "Name": 7074 if value != nil { 7075 jtv, ok := value.(string) 7076 if !ok { 7077 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 7078 } 7079 sv.Name = ptr.String(jtv) 7080 } 7081 7082 default: 7083 _, _ = key, value 7084 7085 } 7086 } 7087 *v = sv 7088 return nil 7089} 7090 7091func awsRestjson1_deserializeDocumentActionTargetList(v *[]types.ActionTarget, value interface{}) error { 7092 if v == nil { 7093 return fmt.Errorf("unexpected nil of type %T", v) 7094 } 7095 if value == nil { 7096 return nil 7097 } 7098 7099 shape, ok := value.([]interface{}) 7100 if !ok { 7101 return fmt.Errorf("unexpected JSON type %v", value) 7102 } 7103 7104 var cv []types.ActionTarget 7105 if *v == nil { 7106 cv = []types.ActionTarget{} 7107 } else { 7108 cv = *v 7109 } 7110 7111 for _, value := range shape { 7112 var col types.ActionTarget 7113 destAddr := &col 7114 if err := awsRestjson1_deserializeDocumentActionTarget(&destAddr, value); err != nil { 7115 return err 7116 } 7117 col = *destAddr 7118 cv = append(cv, col) 7119 7120 } 7121 *v = cv 7122 return nil 7123} 7124 7125func awsRestjson1_deserializeDocumentAdminAccount(v **types.AdminAccount, value interface{}) error { 7126 if v == nil { 7127 return fmt.Errorf("unexpected nil of type %T", v) 7128 } 7129 if value == nil { 7130 return nil 7131 } 7132 7133 shape, ok := value.(map[string]interface{}) 7134 if !ok { 7135 return fmt.Errorf("unexpected JSON type %v", value) 7136 } 7137 7138 var sv *types.AdminAccount 7139 if *v == nil { 7140 sv = &types.AdminAccount{} 7141 } else { 7142 sv = *v 7143 } 7144 7145 for key, value := range shape { 7146 switch key { 7147 case "AccountId": 7148 if value != nil { 7149 jtv, ok := value.(string) 7150 if !ok { 7151 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 7152 } 7153 sv.AccountId = ptr.String(jtv) 7154 } 7155 7156 case "Status": 7157 if value != nil { 7158 jtv, ok := value.(string) 7159 if !ok { 7160 return fmt.Errorf("expected AdminStatus to be of type string, got %T instead", value) 7161 } 7162 sv.Status = types.AdminStatus(jtv) 7163 } 7164 7165 default: 7166 _, _ = key, value 7167 7168 } 7169 } 7170 *v = sv 7171 return nil 7172} 7173 7174func awsRestjson1_deserializeDocumentAdminAccounts(v *[]types.AdminAccount, value interface{}) error { 7175 if v == nil { 7176 return fmt.Errorf("unexpected nil of type %T", v) 7177 } 7178 if value == nil { 7179 return nil 7180 } 7181 7182 shape, ok := value.([]interface{}) 7183 if !ok { 7184 return fmt.Errorf("unexpected JSON type %v", value) 7185 } 7186 7187 var cv []types.AdminAccount 7188 if *v == nil { 7189 cv = []types.AdminAccount{} 7190 } else { 7191 cv = *v 7192 } 7193 7194 for _, value := range shape { 7195 var col types.AdminAccount 7196 destAddr := &col 7197 if err := awsRestjson1_deserializeDocumentAdminAccount(&destAddr, value); err != nil { 7198 return err 7199 } 7200 col = *destAddr 7201 cv = append(cv, col) 7202 7203 } 7204 *v = cv 7205 return nil 7206} 7207 7208func awsRestjson1_deserializeDocumentAvailabilityZone(v **types.AvailabilityZone, value interface{}) error { 7209 if v == nil { 7210 return fmt.Errorf("unexpected nil of type %T", v) 7211 } 7212 if value == nil { 7213 return nil 7214 } 7215 7216 shape, ok := value.(map[string]interface{}) 7217 if !ok { 7218 return fmt.Errorf("unexpected JSON type %v", value) 7219 } 7220 7221 var sv *types.AvailabilityZone 7222 if *v == nil { 7223 sv = &types.AvailabilityZone{} 7224 } else { 7225 sv = *v 7226 } 7227 7228 for key, value := range shape { 7229 switch key { 7230 case "SubnetId": 7231 if value != nil { 7232 jtv, ok := value.(string) 7233 if !ok { 7234 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 7235 } 7236 sv.SubnetId = ptr.String(jtv) 7237 } 7238 7239 case "ZoneName": 7240 if value != nil { 7241 jtv, ok := value.(string) 7242 if !ok { 7243 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 7244 } 7245 sv.ZoneName = ptr.String(jtv) 7246 } 7247 7248 default: 7249 _, _ = key, value 7250 7251 } 7252 } 7253 *v = sv 7254 return nil 7255} 7256 7257func awsRestjson1_deserializeDocumentAvailabilityZones(v *[]types.AvailabilityZone, value interface{}) error { 7258 if v == nil { 7259 return fmt.Errorf("unexpected nil of type %T", v) 7260 } 7261 if value == nil { 7262 return nil 7263 } 7264 7265 shape, ok := value.([]interface{}) 7266 if !ok { 7267 return fmt.Errorf("unexpected JSON type %v", value) 7268 } 7269 7270 var cv []types.AvailabilityZone 7271 if *v == nil { 7272 cv = []types.AvailabilityZone{} 7273 } else { 7274 cv = *v 7275 } 7276 7277 for _, value := range shape { 7278 var col types.AvailabilityZone 7279 destAddr := &col 7280 if err := awsRestjson1_deserializeDocumentAvailabilityZone(&destAddr, value); err != nil { 7281 return err 7282 } 7283 col = *destAddr 7284 cv = append(cv, col) 7285 7286 } 7287 *v = cv 7288 return nil 7289} 7290 7291func awsRestjson1_deserializeDocumentAwsApiGatewayAccessLogSettings(v **types.AwsApiGatewayAccessLogSettings, value interface{}) error { 7292 if v == nil { 7293 return fmt.Errorf("unexpected nil of type %T", v) 7294 } 7295 if value == nil { 7296 return nil 7297 } 7298 7299 shape, ok := value.(map[string]interface{}) 7300 if !ok { 7301 return fmt.Errorf("unexpected JSON type %v", value) 7302 } 7303 7304 var sv *types.AwsApiGatewayAccessLogSettings 7305 if *v == nil { 7306 sv = &types.AwsApiGatewayAccessLogSettings{} 7307 } else { 7308 sv = *v 7309 } 7310 7311 for key, value := range shape { 7312 switch key { 7313 case "DestinationArn": 7314 if value != nil { 7315 jtv, ok := value.(string) 7316 if !ok { 7317 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 7318 } 7319 sv.DestinationArn = ptr.String(jtv) 7320 } 7321 7322 case "Format": 7323 if value != nil { 7324 jtv, ok := value.(string) 7325 if !ok { 7326 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 7327 } 7328 sv.Format = ptr.String(jtv) 7329 } 7330 7331 default: 7332 _, _ = key, value 7333 7334 } 7335 } 7336 *v = sv 7337 return nil 7338} 7339 7340func awsRestjson1_deserializeDocumentAwsApiGatewayCanarySettings(v **types.AwsApiGatewayCanarySettings, value interface{}) error { 7341 if v == nil { 7342 return fmt.Errorf("unexpected nil of type %T", v) 7343 } 7344 if value == nil { 7345 return nil 7346 } 7347 7348 shape, ok := value.(map[string]interface{}) 7349 if !ok { 7350 return fmt.Errorf("unexpected JSON type %v", value) 7351 } 7352 7353 var sv *types.AwsApiGatewayCanarySettings 7354 if *v == nil { 7355 sv = &types.AwsApiGatewayCanarySettings{} 7356 } else { 7357 sv = *v 7358 } 7359 7360 for key, value := range shape { 7361 switch key { 7362 case "DeploymentId": 7363 if value != nil { 7364 jtv, ok := value.(string) 7365 if !ok { 7366 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 7367 } 7368 sv.DeploymentId = ptr.String(jtv) 7369 } 7370 7371 case "PercentTraffic": 7372 if value != nil { 7373 jtv, ok := value.(json.Number) 7374 if !ok { 7375 return fmt.Errorf("expected Double to be json.Number, got %T instead", value) 7376 } 7377 f64, err := jtv.Float64() 7378 if err != nil { 7379 return err 7380 } 7381 sv.PercentTraffic = f64 7382 } 7383 7384 case "StageVariableOverrides": 7385 if err := awsRestjson1_deserializeDocumentFieldMap(&sv.StageVariableOverrides, value); err != nil { 7386 return err 7387 } 7388 7389 case "UseStageCache": 7390 if value != nil { 7391 jtv, ok := value.(bool) 7392 if !ok { 7393 return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) 7394 } 7395 sv.UseStageCache = jtv 7396 } 7397 7398 default: 7399 _, _ = key, value 7400 7401 } 7402 } 7403 *v = sv 7404 return nil 7405} 7406 7407func awsRestjson1_deserializeDocumentAwsApiGatewayEndpointConfiguration(v **types.AwsApiGatewayEndpointConfiguration, value interface{}) error { 7408 if v == nil { 7409 return fmt.Errorf("unexpected nil of type %T", v) 7410 } 7411 if value == nil { 7412 return nil 7413 } 7414 7415 shape, ok := value.(map[string]interface{}) 7416 if !ok { 7417 return fmt.Errorf("unexpected JSON type %v", value) 7418 } 7419 7420 var sv *types.AwsApiGatewayEndpointConfiguration 7421 if *v == nil { 7422 sv = &types.AwsApiGatewayEndpointConfiguration{} 7423 } else { 7424 sv = *v 7425 } 7426 7427 for key, value := range shape { 7428 switch key { 7429 case "Types": 7430 if err := awsRestjson1_deserializeDocumentNonEmptyStringList(&sv.Types, value); err != nil { 7431 return err 7432 } 7433 7434 default: 7435 _, _ = key, value 7436 7437 } 7438 } 7439 *v = sv 7440 return nil 7441} 7442 7443func awsRestjson1_deserializeDocumentAwsApiGatewayMethodSettings(v **types.AwsApiGatewayMethodSettings, value interface{}) error { 7444 if v == nil { 7445 return fmt.Errorf("unexpected nil of type %T", v) 7446 } 7447 if value == nil { 7448 return nil 7449 } 7450 7451 shape, ok := value.(map[string]interface{}) 7452 if !ok { 7453 return fmt.Errorf("unexpected JSON type %v", value) 7454 } 7455 7456 var sv *types.AwsApiGatewayMethodSettings 7457 if *v == nil { 7458 sv = &types.AwsApiGatewayMethodSettings{} 7459 } else { 7460 sv = *v 7461 } 7462 7463 for key, value := range shape { 7464 switch key { 7465 case "CacheDataEncrypted": 7466 if value != nil { 7467 jtv, ok := value.(bool) 7468 if !ok { 7469 return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) 7470 } 7471 sv.CacheDataEncrypted = jtv 7472 } 7473 7474 case "CacheTtlInSeconds": 7475 if value != nil { 7476 jtv, ok := value.(json.Number) 7477 if !ok { 7478 return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) 7479 } 7480 i64, err := jtv.Int64() 7481 if err != nil { 7482 return err 7483 } 7484 sv.CacheTtlInSeconds = int32(i64) 7485 } 7486 7487 case "CachingEnabled": 7488 if value != nil { 7489 jtv, ok := value.(bool) 7490 if !ok { 7491 return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) 7492 } 7493 sv.CachingEnabled = jtv 7494 } 7495 7496 case "DataTraceEnabled": 7497 if value != nil { 7498 jtv, ok := value.(bool) 7499 if !ok { 7500 return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) 7501 } 7502 sv.DataTraceEnabled = jtv 7503 } 7504 7505 case "HttpMethod": 7506 if value != nil { 7507 jtv, ok := value.(string) 7508 if !ok { 7509 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 7510 } 7511 sv.HttpMethod = ptr.String(jtv) 7512 } 7513 7514 case "LoggingLevel": 7515 if value != nil { 7516 jtv, ok := value.(string) 7517 if !ok { 7518 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 7519 } 7520 sv.LoggingLevel = ptr.String(jtv) 7521 } 7522 7523 case "MetricsEnabled": 7524 if value != nil { 7525 jtv, ok := value.(bool) 7526 if !ok { 7527 return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) 7528 } 7529 sv.MetricsEnabled = jtv 7530 } 7531 7532 case "RequireAuthorizationForCacheControl": 7533 if value != nil { 7534 jtv, ok := value.(bool) 7535 if !ok { 7536 return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) 7537 } 7538 sv.RequireAuthorizationForCacheControl = jtv 7539 } 7540 7541 case "ResourcePath": 7542 if value != nil { 7543 jtv, ok := value.(string) 7544 if !ok { 7545 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 7546 } 7547 sv.ResourcePath = ptr.String(jtv) 7548 } 7549 7550 case "ThrottlingBurstLimit": 7551 if value != nil { 7552 jtv, ok := value.(json.Number) 7553 if !ok { 7554 return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) 7555 } 7556 i64, err := jtv.Int64() 7557 if err != nil { 7558 return err 7559 } 7560 sv.ThrottlingBurstLimit = int32(i64) 7561 } 7562 7563 case "ThrottlingRateLimit": 7564 if value != nil { 7565 jtv, ok := value.(json.Number) 7566 if !ok { 7567 return fmt.Errorf("expected Double to be json.Number, got %T instead", value) 7568 } 7569 f64, err := jtv.Float64() 7570 if err != nil { 7571 return err 7572 } 7573 sv.ThrottlingRateLimit = f64 7574 } 7575 7576 case "UnauthorizedCacheControlHeaderStrategy": 7577 if value != nil { 7578 jtv, ok := value.(string) 7579 if !ok { 7580 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 7581 } 7582 sv.UnauthorizedCacheControlHeaderStrategy = ptr.String(jtv) 7583 } 7584 7585 default: 7586 _, _ = key, value 7587 7588 } 7589 } 7590 *v = sv 7591 return nil 7592} 7593 7594func awsRestjson1_deserializeDocumentAwsApiGatewayMethodSettingsList(v *[]types.AwsApiGatewayMethodSettings, value interface{}) error { 7595 if v == nil { 7596 return fmt.Errorf("unexpected nil of type %T", v) 7597 } 7598 if value == nil { 7599 return nil 7600 } 7601 7602 shape, ok := value.([]interface{}) 7603 if !ok { 7604 return fmt.Errorf("unexpected JSON type %v", value) 7605 } 7606 7607 var cv []types.AwsApiGatewayMethodSettings 7608 if *v == nil { 7609 cv = []types.AwsApiGatewayMethodSettings{} 7610 } else { 7611 cv = *v 7612 } 7613 7614 for _, value := range shape { 7615 var col types.AwsApiGatewayMethodSettings 7616 destAddr := &col 7617 if err := awsRestjson1_deserializeDocumentAwsApiGatewayMethodSettings(&destAddr, value); err != nil { 7618 return err 7619 } 7620 col = *destAddr 7621 cv = append(cv, col) 7622 7623 } 7624 *v = cv 7625 return nil 7626} 7627 7628func awsRestjson1_deserializeDocumentAwsApiGatewayRestApiDetails(v **types.AwsApiGatewayRestApiDetails, value interface{}) error { 7629 if v == nil { 7630 return fmt.Errorf("unexpected nil of type %T", v) 7631 } 7632 if value == nil { 7633 return nil 7634 } 7635 7636 shape, ok := value.(map[string]interface{}) 7637 if !ok { 7638 return fmt.Errorf("unexpected JSON type %v", value) 7639 } 7640 7641 var sv *types.AwsApiGatewayRestApiDetails 7642 if *v == nil { 7643 sv = &types.AwsApiGatewayRestApiDetails{} 7644 } else { 7645 sv = *v 7646 } 7647 7648 for key, value := range shape { 7649 switch key { 7650 case "ApiKeySource": 7651 if value != nil { 7652 jtv, ok := value.(string) 7653 if !ok { 7654 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 7655 } 7656 sv.ApiKeySource = ptr.String(jtv) 7657 } 7658 7659 case "BinaryMediaTypes": 7660 if err := awsRestjson1_deserializeDocumentNonEmptyStringList(&sv.BinaryMediaTypes, value); err != nil { 7661 return err 7662 } 7663 7664 case "CreatedDate": 7665 if value != nil { 7666 jtv, ok := value.(string) 7667 if !ok { 7668 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 7669 } 7670 sv.CreatedDate = ptr.String(jtv) 7671 } 7672 7673 case "Description": 7674 if value != nil { 7675 jtv, ok := value.(string) 7676 if !ok { 7677 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 7678 } 7679 sv.Description = ptr.String(jtv) 7680 } 7681 7682 case "EndpointConfiguration": 7683 if err := awsRestjson1_deserializeDocumentAwsApiGatewayEndpointConfiguration(&sv.EndpointConfiguration, value); err != nil { 7684 return err 7685 } 7686 7687 case "Id": 7688 if value != nil { 7689 jtv, ok := value.(string) 7690 if !ok { 7691 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 7692 } 7693 sv.Id = ptr.String(jtv) 7694 } 7695 7696 case "MinimumCompressionSize": 7697 if value != nil { 7698 jtv, ok := value.(json.Number) 7699 if !ok { 7700 return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) 7701 } 7702 i64, err := jtv.Int64() 7703 if err != nil { 7704 return err 7705 } 7706 sv.MinimumCompressionSize = int32(i64) 7707 } 7708 7709 case "Name": 7710 if value != nil { 7711 jtv, ok := value.(string) 7712 if !ok { 7713 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 7714 } 7715 sv.Name = ptr.String(jtv) 7716 } 7717 7718 case "Version": 7719 if value != nil { 7720 jtv, ok := value.(string) 7721 if !ok { 7722 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 7723 } 7724 sv.Version = ptr.String(jtv) 7725 } 7726 7727 default: 7728 _, _ = key, value 7729 7730 } 7731 } 7732 *v = sv 7733 return nil 7734} 7735 7736func awsRestjson1_deserializeDocumentAwsApiGatewayStageDetails(v **types.AwsApiGatewayStageDetails, value interface{}) error { 7737 if v == nil { 7738 return fmt.Errorf("unexpected nil of type %T", v) 7739 } 7740 if value == nil { 7741 return nil 7742 } 7743 7744 shape, ok := value.(map[string]interface{}) 7745 if !ok { 7746 return fmt.Errorf("unexpected JSON type %v", value) 7747 } 7748 7749 var sv *types.AwsApiGatewayStageDetails 7750 if *v == nil { 7751 sv = &types.AwsApiGatewayStageDetails{} 7752 } else { 7753 sv = *v 7754 } 7755 7756 for key, value := range shape { 7757 switch key { 7758 case "AccessLogSettings": 7759 if err := awsRestjson1_deserializeDocumentAwsApiGatewayAccessLogSettings(&sv.AccessLogSettings, value); err != nil { 7760 return err 7761 } 7762 7763 case "CacheClusterEnabled": 7764 if value != nil { 7765 jtv, ok := value.(bool) 7766 if !ok { 7767 return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) 7768 } 7769 sv.CacheClusterEnabled = jtv 7770 } 7771 7772 case "CacheClusterSize": 7773 if value != nil { 7774 jtv, ok := value.(string) 7775 if !ok { 7776 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 7777 } 7778 sv.CacheClusterSize = ptr.String(jtv) 7779 } 7780 7781 case "CacheClusterStatus": 7782 if value != nil { 7783 jtv, ok := value.(string) 7784 if !ok { 7785 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 7786 } 7787 sv.CacheClusterStatus = ptr.String(jtv) 7788 } 7789 7790 case "CanarySettings": 7791 if err := awsRestjson1_deserializeDocumentAwsApiGatewayCanarySettings(&sv.CanarySettings, value); err != nil { 7792 return err 7793 } 7794 7795 case "ClientCertificateId": 7796 if value != nil { 7797 jtv, ok := value.(string) 7798 if !ok { 7799 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 7800 } 7801 sv.ClientCertificateId = ptr.String(jtv) 7802 } 7803 7804 case "CreatedDate": 7805 if value != nil { 7806 jtv, ok := value.(string) 7807 if !ok { 7808 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 7809 } 7810 sv.CreatedDate = ptr.String(jtv) 7811 } 7812 7813 case "DeploymentId": 7814 if value != nil { 7815 jtv, ok := value.(string) 7816 if !ok { 7817 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 7818 } 7819 sv.DeploymentId = ptr.String(jtv) 7820 } 7821 7822 case "Description": 7823 if value != nil { 7824 jtv, ok := value.(string) 7825 if !ok { 7826 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 7827 } 7828 sv.Description = ptr.String(jtv) 7829 } 7830 7831 case "DocumentationVersion": 7832 if value != nil { 7833 jtv, ok := value.(string) 7834 if !ok { 7835 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 7836 } 7837 sv.DocumentationVersion = ptr.String(jtv) 7838 } 7839 7840 case "LastUpdatedDate": 7841 if value != nil { 7842 jtv, ok := value.(string) 7843 if !ok { 7844 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 7845 } 7846 sv.LastUpdatedDate = ptr.String(jtv) 7847 } 7848 7849 case "MethodSettings": 7850 if err := awsRestjson1_deserializeDocumentAwsApiGatewayMethodSettingsList(&sv.MethodSettings, value); err != nil { 7851 return err 7852 } 7853 7854 case "StageName": 7855 if value != nil { 7856 jtv, ok := value.(string) 7857 if !ok { 7858 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 7859 } 7860 sv.StageName = ptr.String(jtv) 7861 } 7862 7863 case "TracingEnabled": 7864 if value != nil { 7865 jtv, ok := value.(bool) 7866 if !ok { 7867 return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) 7868 } 7869 sv.TracingEnabled = jtv 7870 } 7871 7872 case "Variables": 7873 if err := awsRestjson1_deserializeDocumentFieldMap(&sv.Variables, value); err != nil { 7874 return err 7875 } 7876 7877 case "WebAclArn": 7878 if value != nil { 7879 jtv, ok := value.(string) 7880 if !ok { 7881 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 7882 } 7883 sv.WebAclArn = ptr.String(jtv) 7884 } 7885 7886 default: 7887 _, _ = key, value 7888 7889 } 7890 } 7891 *v = sv 7892 return nil 7893} 7894 7895func awsRestjson1_deserializeDocumentAwsApiGatewayV2ApiDetails(v **types.AwsApiGatewayV2ApiDetails, value interface{}) error { 7896 if v == nil { 7897 return fmt.Errorf("unexpected nil of type %T", v) 7898 } 7899 if value == nil { 7900 return nil 7901 } 7902 7903 shape, ok := value.(map[string]interface{}) 7904 if !ok { 7905 return fmt.Errorf("unexpected JSON type %v", value) 7906 } 7907 7908 var sv *types.AwsApiGatewayV2ApiDetails 7909 if *v == nil { 7910 sv = &types.AwsApiGatewayV2ApiDetails{} 7911 } else { 7912 sv = *v 7913 } 7914 7915 for key, value := range shape { 7916 switch key { 7917 case "ApiEndpoint": 7918 if value != nil { 7919 jtv, ok := value.(string) 7920 if !ok { 7921 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 7922 } 7923 sv.ApiEndpoint = ptr.String(jtv) 7924 } 7925 7926 case "ApiId": 7927 if value != nil { 7928 jtv, ok := value.(string) 7929 if !ok { 7930 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 7931 } 7932 sv.ApiId = ptr.String(jtv) 7933 } 7934 7935 case "ApiKeySelectionExpression": 7936 if value != nil { 7937 jtv, ok := value.(string) 7938 if !ok { 7939 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 7940 } 7941 sv.ApiKeySelectionExpression = ptr.String(jtv) 7942 } 7943 7944 case "CorsConfiguration": 7945 if err := awsRestjson1_deserializeDocumentAwsCorsConfiguration(&sv.CorsConfiguration, value); err != nil { 7946 return err 7947 } 7948 7949 case "CreatedDate": 7950 if value != nil { 7951 jtv, ok := value.(string) 7952 if !ok { 7953 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 7954 } 7955 sv.CreatedDate = ptr.String(jtv) 7956 } 7957 7958 case "Description": 7959 if value != nil { 7960 jtv, ok := value.(string) 7961 if !ok { 7962 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 7963 } 7964 sv.Description = ptr.String(jtv) 7965 } 7966 7967 case "Name": 7968 if value != nil { 7969 jtv, ok := value.(string) 7970 if !ok { 7971 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 7972 } 7973 sv.Name = ptr.String(jtv) 7974 } 7975 7976 case "ProtocolType": 7977 if value != nil { 7978 jtv, ok := value.(string) 7979 if !ok { 7980 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 7981 } 7982 sv.ProtocolType = ptr.String(jtv) 7983 } 7984 7985 case "RouteSelectionExpression": 7986 if value != nil { 7987 jtv, ok := value.(string) 7988 if !ok { 7989 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 7990 } 7991 sv.RouteSelectionExpression = ptr.String(jtv) 7992 } 7993 7994 case "Version": 7995 if value != nil { 7996 jtv, ok := value.(string) 7997 if !ok { 7998 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 7999 } 8000 sv.Version = ptr.String(jtv) 8001 } 8002 8003 default: 8004 _, _ = key, value 8005 8006 } 8007 } 8008 *v = sv 8009 return nil 8010} 8011 8012func awsRestjson1_deserializeDocumentAwsApiGatewayV2RouteSettings(v **types.AwsApiGatewayV2RouteSettings, value interface{}) error { 8013 if v == nil { 8014 return fmt.Errorf("unexpected nil of type %T", v) 8015 } 8016 if value == nil { 8017 return nil 8018 } 8019 8020 shape, ok := value.(map[string]interface{}) 8021 if !ok { 8022 return fmt.Errorf("unexpected JSON type %v", value) 8023 } 8024 8025 var sv *types.AwsApiGatewayV2RouteSettings 8026 if *v == nil { 8027 sv = &types.AwsApiGatewayV2RouteSettings{} 8028 } else { 8029 sv = *v 8030 } 8031 8032 for key, value := range shape { 8033 switch key { 8034 case "DataTraceEnabled": 8035 if value != nil { 8036 jtv, ok := value.(bool) 8037 if !ok { 8038 return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) 8039 } 8040 sv.DataTraceEnabled = jtv 8041 } 8042 8043 case "DetailedMetricsEnabled": 8044 if value != nil { 8045 jtv, ok := value.(bool) 8046 if !ok { 8047 return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) 8048 } 8049 sv.DetailedMetricsEnabled = jtv 8050 } 8051 8052 case "LoggingLevel": 8053 if value != nil { 8054 jtv, ok := value.(string) 8055 if !ok { 8056 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 8057 } 8058 sv.LoggingLevel = ptr.String(jtv) 8059 } 8060 8061 case "ThrottlingBurstLimit": 8062 if value != nil { 8063 jtv, ok := value.(json.Number) 8064 if !ok { 8065 return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) 8066 } 8067 i64, err := jtv.Int64() 8068 if err != nil { 8069 return err 8070 } 8071 sv.ThrottlingBurstLimit = int32(i64) 8072 } 8073 8074 case "ThrottlingRateLimit": 8075 if value != nil { 8076 jtv, ok := value.(json.Number) 8077 if !ok { 8078 return fmt.Errorf("expected Double to be json.Number, got %T instead", value) 8079 } 8080 f64, err := jtv.Float64() 8081 if err != nil { 8082 return err 8083 } 8084 sv.ThrottlingRateLimit = f64 8085 } 8086 8087 default: 8088 _, _ = key, value 8089 8090 } 8091 } 8092 *v = sv 8093 return nil 8094} 8095 8096func awsRestjson1_deserializeDocumentAwsApiGatewayV2StageDetails(v **types.AwsApiGatewayV2StageDetails, value interface{}) error { 8097 if v == nil { 8098 return fmt.Errorf("unexpected nil of type %T", v) 8099 } 8100 if value == nil { 8101 return nil 8102 } 8103 8104 shape, ok := value.(map[string]interface{}) 8105 if !ok { 8106 return fmt.Errorf("unexpected JSON type %v", value) 8107 } 8108 8109 var sv *types.AwsApiGatewayV2StageDetails 8110 if *v == nil { 8111 sv = &types.AwsApiGatewayV2StageDetails{} 8112 } else { 8113 sv = *v 8114 } 8115 8116 for key, value := range shape { 8117 switch key { 8118 case "AccessLogSettings": 8119 if err := awsRestjson1_deserializeDocumentAwsApiGatewayAccessLogSettings(&sv.AccessLogSettings, value); err != nil { 8120 return err 8121 } 8122 8123 case "ApiGatewayManaged": 8124 if value != nil { 8125 jtv, ok := value.(bool) 8126 if !ok { 8127 return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) 8128 } 8129 sv.ApiGatewayManaged = jtv 8130 } 8131 8132 case "AutoDeploy": 8133 if value != nil { 8134 jtv, ok := value.(bool) 8135 if !ok { 8136 return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) 8137 } 8138 sv.AutoDeploy = jtv 8139 } 8140 8141 case "CreatedDate": 8142 if value != nil { 8143 jtv, ok := value.(string) 8144 if !ok { 8145 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 8146 } 8147 sv.CreatedDate = ptr.String(jtv) 8148 } 8149 8150 case "DefaultRouteSettings": 8151 if err := awsRestjson1_deserializeDocumentAwsApiGatewayV2RouteSettings(&sv.DefaultRouteSettings, value); err != nil { 8152 return err 8153 } 8154 8155 case "DeploymentId": 8156 if value != nil { 8157 jtv, ok := value.(string) 8158 if !ok { 8159 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 8160 } 8161 sv.DeploymentId = ptr.String(jtv) 8162 } 8163 8164 case "Description": 8165 if value != nil { 8166 jtv, ok := value.(string) 8167 if !ok { 8168 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 8169 } 8170 sv.Description = ptr.String(jtv) 8171 } 8172 8173 case "LastDeploymentStatusMessage": 8174 if value != nil { 8175 jtv, ok := value.(string) 8176 if !ok { 8177 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 8178 } 8179 sv.LastDeploymentStatusMessage = ptr.String(jtv) 8180 } 8181 8182 case "LastUpdatedDate": 8183 if value != nil { 8184 jtv, ok := value.(string) 8185 if !ok { 8186 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 8187 } 8188 sv.LastUpdatedDate = ptr.String(jtv) 8189 } 8190 8191 case "RouteSettings": 8192 if err := awsRestjson1_deserializeDocumentAwsApiGatewayV2RouteSettings(&sv.RouteSettings, value); err != nil { 8193 return err 8194 } 8195 8196 case "StageName": 8197 if value != nil { 8198 jtv, ok := value.(string) 8199 if !ok { 8200 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 8201 } 8202 sv.StageName = ptr.String(jtv) 8203 } 8204 8205 case "StageVariables": 8206 if err := awsRestjson1_deserializeDocumentFieldMap(&sv.StageVariables, value); err != nil { 8207 return err 8208 } 8209 8210 default: 8211 _, _ = key, value 8212 8213 } 8214 } 8215 *v = sv 8216 return nil 8217} 8218 8219func awsRestjson1_deserializeDocumentAwsAutoScalingAutoScalingGroupDetails(v **types.AwsAutoScalingAutoScalingGroupDetails, value interface{}) error { 8220 if v == nil { 8221 return fmt.Errorf("unexpected nil of type %T", v) 8222 } 8223 if value == nil { 8224 return nil 8225 } 8226 8227 shape, ok := value.(map[string]interface{}) 8228 if !ok { 8229 return fmt.Errorf("unexpected JSON type %v", value) 8230 } 8231 8232 var sv *types.AwsAutoScalingAutoScalingGroupDetails 8233 if *v == nil { 8234 sv = &types.AwsAutoScalingAutoScalingGroupDetails{} 8235 } else { 8236 sv = *v 8237 } 8238 8239 for key, value := range shape { 8240 switch key { 8241 case "CreatedTime": 8242 if value != nil { 8243 jtv, ok := value.(string) 8244 if !ok { 8245 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 8246 } 8247 sv.CreatedTime = ptr.String(jtv) 8248 } 8249 8250 case "HealthCheckGracePeriod": 8251 if value != nil { 8252 jtv, ok := value.(json.Number) 8253 if !ok { 8254 return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) 8255 } 8256 i64, err := jtv.Int64() 8257 if err != nil { 8258 return err 8259 } 8260 sv.HealthCheckGracePeriod = int32(i64) 8261 } 8262 8263 case "HealthCheckType": 8264 if value != nil { 8265 jtv, ok := value.(string) 8266 if !ok { 8267 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 8268 } 8269 sv.HealthCheckType = ptr.String(jtv) 8270 } 8271 8272 case "LaunchConfigurationName": 8273 if value != nil { 8274 jtv, ok := value.(string) 8275 if !ok { 8276 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 8277 } 8278 sv.LaunchConfigurationName = ptr.String(jtv) 8279 } 8280 8281 case "LoadBalancerNames": 8282 if err := awsRestjson1_deserializeDocumentStringList(&sv.LoadBalancerNames, value); err != nil { 8283 return err 8284 } 8285 8286 default: 8287 _, _ = key, value 8288 8289 } 8290 } 8291 *v = sv 8292 return nil 8293} 8294 8295func awsRestjson1_deserializeDocumentAwsCertificateManagerCertificateDetails(v **types.AwsCertificateManagerCertificateDetails, value interface{}) error { 8296 if v == nil { 8297 return fmt.Errorf("unexpected nil of type %T", v) 8298 } 8299 if value == nil { 8300 return nil 8301 } 8302 8303 shape, ok := value.(map[string]interface{}) 8304 if !ok { 8305 return fmt.Errorf("unexpected JSON type %v", value) 8306 } 8307 8308 var sv *types.AwsCertificateManagerCertificateDetails 8309 if *v == nil { 8310 sv = &types.AwsCertificateManagerCertificateDetails{} 8311 } else { 8312 sv = *v 8313 } 8314 8315 for key, value := range shape { 8316 switch key { 8317 case "CertificateAuthorityArn": 8318 if value != nil { 8319 jtv, ok := value.(string) 8320 if !ok { 8321 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 8322 } 8323 sv.CertificateAuthorityArn = ptr.String(jtv) 8324 } 8325 8326 case "CreatedAt": 8327 if value != nil { 8328 jtv, ok := value.(string) 8329 if !ok { 8330 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 8331 } 8332 sv.CreatedAt = ptr.String(jtv) 8333 } 8334 8335 case "DomainName": 8336 if value != nil { 8337 jtv, ok := value.(string) 8338 if !ok { 8339 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 8340 } 8341 sv.DomainName = ptr.String(jtv) 8342 } 8343 8344 case "DomainValidationOptions": 8345 if err := awsRestjson1_deserializeDocumentAwsCertificateManagerCertificateDomainValidationOptions(&sv.DomainValidationOptions, value); err != nil { 8346 return err 8347 } 8348 8349 case "ExtendedKeyUsages": 8350 if err := awsRestjson1_deserializeDocumentAwsCertificateManagerCertificateExtendedKeyUsages(&sv.ExtendedKeyUsages, value); err != nil { 8351 return err 8352 } 8353 8354 case "FailureReason": 8355 if value != nil { 8356 jtv, ok := value.(string) 8357 if !ok { 8358 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 8359 } 8360 sv.FailureReason = ptr.String(jtv) 8361 } 8362 8363 case "ImportedAt": 8364 if value != nil { 8365 jtv, ok := value.(string) 8366 if !ok { 8367 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 8368 } 8369 sv.ImportedAt = ptr.String(jtv) 8370 } 8371 8372 case "InUseBy": 8373 if err := awsRestjson1_deserializeDocumentStringList(&sv.InUseBy, value); err != nil { 8374 return err 8375 } 8376 8377 case "IssuedAt": 8378 if value != nil { 8379 jtv, ok := value.(string) 8380 if !ok { 8381 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 8382 } 8383 sv.IssuedAt = ptr.String(jtv) 8384 } 8385 8386 case "Issuer": 8387 if value != nil { 8388 jtv, ok := value.(string) 8389 if !ok { 8390 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 8391 } 8392 sv.Issuer = ptr.String(jtv) 8393 } 8394 8395 case "KeyAlgorithm": 8396 if value != nil { 8397 jtv, ok := value.(string) 8398 if !ok { 8399 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 8400 } 8401 sv.KeyAlgorithm = ptr.String(jtv) 8402 } 8403 8404 case "KeyUsages": 8405 if err := awsRestjson1_deserializeDocumentAwsCertificateManagerCertificateKeyUsages(&sv.KeyUsages, value); err != nil { 8406 return err 8407 } 8408 8409 case "NotAfter": 8410 if value != nil { 8411 jtv, ok := value.(string) 8412 if !ok { 8413 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 8414 } 8415 sv.NotAfter = ptr.String(jtv) 8416 } 8417 8418 case "NotBefore": 8419 if value != nil { 8420 jtv, ok := value.(string) 8421 if !ok { 8422 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 8423 } 8424 sv.NotBefore = ptr.String(jtv) 8425 } 8426 8427 case "Options": 8428 if err := awsRestjson1_deserializeDocumentAwsCertificateManagerCertificateOptions(&sv.Options, value); err != nil { 8429 return err 8430 } 8431 8432 case "RenewalEligibility": 8433 if value != nil { 8434 jtv, ok := value.(string) 8435 if !ok { 8436 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 8437 } 8438 sv.RenewalEligibility = ptr.String(jtv) 8439 } 8440 8441 case "RenewalSummary": 8442 if err := awsRestjson1_deserializeDocumentAwsCertificateManagerCertificateRenewalSummary(&sv.RenewalSummary, value); err != nil { 8443 return err 8444 } 8445 8446 case "Serial": 8447 if value != nil { 8448 jtv, ok := value.(string) 8449 if !ok { 8450 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 8451 } 8452 sv.Serial = ptr.String(jtv) 8453 } 8454 8455 case "SignatureAlgorithm": 8456 if value != nil { 8457 jtv, ok := value.(string) 8458 if !ok { 8459 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 8460 } 8461 sv.SignatureAlgorithm = ptr.String(jtv) 8462 } 8463 8464 case "Status": 8465 if value != nil { 8466 jtv, ok := value.(string) 8467 if !ok { 8468 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 8469 } 8470 sv.Status = ptr.String(jtv) 8471 } 8472 8473 case "Subject": 8474 if value != nil { 8475 jtv, ok := value.(string) 8476 if !ok { 8477 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 8478 } 8479 sv.Subject = ptr.String(jtv) 8480 } 8481 8482 case "SubjectAlternativeNames": 8483 if err := awsRestjson1_deserializeDocumentStringList(&sv.SubjectAlternativeNames, value); err != nil { 8484 return err 8485 } 8486 8487 case "Type": 8488 if value != nil { 8489 jtv, ok := value.(string) 8490 if !ok { 8491 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 8492 } 8493 sv.Type = ptr.String(jtv) 8494 } 8495 8496 default: 8497 _, _ = key, value 8498 8499 } 8500 } 8501 *v = sv 8502 return nil 8503} 8504 8505func awsRestjson1_deserializeDocumentAwsCertificateManagerCertificateDomainValidationOption(v **types.AwsCertificateManagerCertificateDomainValidationOption, value interface{}) error { 8506 if v == nil { 8507 return fmt.Errorf("unexpected nil of type %T", v) 8508 } 8509 if value == nil { 8510 return nil 8511 } 8512 8513 shape, ok := value.(map[string]interface{}) 8514 if !ok { 8515 return fmt.Errorf("unexpected JSON type %v", value) 8516 } 8517 8518 var sv *types.AwsCertificateManagerCertificateDomainValidationOption 8519 if *v == nil { 8520 sv = &types.AwsCertificateManagerCertificateDomainValidationOption{} 8521 } else { 8522 sv = *v 8523 } 8524 8525 for key, value := range shape { 8526 switch key { 8527 case "DomainName": 8528 if value != nil { 8529 jtv, ok := value.(string) 8530 if !ok { 8531 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 8532 } 8533 sv.DomainName = ptr.String(jtv) 8534 } 8535 8536 case "ResourceRecord": 8537 if err := awsRestjson1_deserializeDocumentAwsCertificateManagerCertificateResourceRecord(&sv.ResourceRecord, value); err != nil { 8538 return err 8539 } 8540 8541 case "ValidationDomain": 8542 if value != nil { 8543 jtv, ok := value.(string) 8544 if !ok { 8545 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 8546 } 8547 sv.ValidationDomain = ptr.String(jtv) 8548 } 8549 8550 case "ValidationEmails": 8551 if err := awsRestjson1_deserializeDocumentStringList(&sv.ValidationEmails, value); err != nil { 8552 return err 8553 } 8554 8555 case "ValidationMethod": 8556 if value != nil { 8557 jtv, ok := value.(string) 8558 if !ok { 8559 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 8560 } 8561 sv.ValidationMethod = ptr.String(jtv) 8562 } 8563 8564 case "ValidationStatus": 8565 if value != nil { 8566 jtv, ok := value.(string) 8567 if !ok { 8568 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 8569 } 8570 sv.ValidationStatus = ptr.String(jtv) 8571 } 8572 8573 default: 8574 _, _ = key, value 8575 8576 } 8577 } 8578 *v = sv 8579 return nil 8580} 8581 8582func awsRestjson1_deserializeDocumentAwsCertificateManagerCertificateDomainValidationOptions(v *[]types.AwsCertificateManagerCertificateDomainValidationOption, value interface{}) error { 8583 if v == nil { 8584 return fmt.Errorf("unexpected nil of type %T", v) 8585 } 8586 if value == nil { 8587 return nil 8588 } 8589 8590 shape, ok := value.([]interface{}) 8591 if !ok { 8592 return fmt.Errorf("unexpected JSON type %v", value) 8593 } 8594 8595 var cv []types.AwsCertificateManagerCertificateDomainValidationOption 8596 if *v == nil { 8597 cv = []types.AwsCertificateManagerCertificateDomainValidationOption{} 8598 } else { 8599 cv = *v 8600 } 8601 8602 for _, value := range shape { 8603 var col types.AwsCertificateManagerCertificateDomainValidationOption 8604 destAddr := &col 8605 if err := awsRestjson1_deserializeDocumentAwsCertificateManagerCertificateDomainValidationOption(&destAddr, value); err != nil { 8606 return err 8607 } 8608 col = *destAddr 8609 cv = append(cv, col) 8610 8611 } 8612 *v = cv 8613 return nil 8614} 8615 8616func awsRestjson1_deserializeDocumentAwsCertificateManagerCertificateExtendedKeyUsage(v **types.AwsCertificateManagerCertificateExtendedKeyUsage, value interface{}) error { 8617 if v == nil { 8618 return fmt.Errorf("unexpected nil of type %T", v) 8619 } 8620 if value == nil { 8621 return nil 8622 } 8623 8624 shape, ok := value.(map[string]interface{}) 8625 if !ok { 8626 return fmt.Errorf("unexpected JSON type %v", value) 8627 } 8628 8629 var sv *types.AwsCertificateManagerCertificateExtendedKeyUsage 8630 if *v == nil { 8631 sv = &types.AwsCertificateManagerCertificateExtendedKeyUsage{} 8632 } else { 8633 sv = *v 8634 } 8635 8636 for key, value := range shape { 8637 switch key { 8638 case "Name": 8639 if value != nil { 8640 jtv, ok := value.(string) 8641 if !ok { 8642 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 8643 } 8644 sv.Name = ptr.String(jtv) 8645 } 8646 8647 case "OId": 8648 if value != nil { 8649 jtv, ok := value.(string) 8650 if !ok { 8651 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 8652 } 8653 sv.OId = ptr.String(jtv) 8654 } 8655 8656 default: 8657 _, _ = key, value 8658 8659 } 8660 } 8661 *v = sv 8662 return nil 8663} 8664 8665func awsRestjson1_deserializeDocumentAwsCertificateManagerCertificateExtendedKeyUsages(v *[]types.AwsCertificateManagerCertificateExtendedKeyUsage, value interface{}) error { 8666 if v == nil { 8667 return fmt.Errorf("unexpected nil of type %T", v) 8668 } 8669 if value == nil { 8670 return nil 8671 } 8672 8673 shape, ok := value.([]interface{}) 8674 if !ok { 8675 return fmt.Errorf("unexpected JSON type %v", value) 8676 } 8677 8678 var cv []types.AwsCertificateManagerCertificateExtendedKeyUsage 8679 if *v == nil { 8680 cv = []types.AwsCertificateManagerCertificateExtendedKeyUsage{} 8681 } else { 8682 cv = *v 8683 } 8684 8685 for _, value := range shape { 8686 var col types.AwsCertificateManagerCertificateExtendedKeyUsage 8687 destAddr := &col 8688 if err := awsRestjson1_deserializeDocumentAwsCertificateManagerCertificateExtendedKeyUsage(&destAddr, value); err != nil { 8689 return err 8690 } 8691 col = *destAddr 8692 cv = append(cv, col) 8693 8694 } 8695 *v = cv 8696 return nil 8697} 8698 8699func awsRestjson1_deserializeDocumentAwsCertificateManagerCertificateKeyUsage(v **types.AwsCertificateManagerCertificateKeyUsage, value interface{}) error { 8700 if v == nil { 8701 return fmt.Errorf("unexpected nil of type %T", v) 8702 } 8703 if value == nil { 8704 return nil 8705 } 8706 8707 shape, ok := value.(map[string]interface{}) 8708 if !ok { 8709 return fmt.Errorf("unexpected JSON type %v", value) 8710 } 8711 8712 var sv *types.AwsCertificateManagerCertificateKeyUsage 8713 if *v == nil { 8714 sv = &types.AwsCertificateManagerCertificateKeyUsage{} 8715 } else { 8716 sv = *v 8717 } 8718 8719 for key, value := range shape { 8720 switch key { 8721 case "Name": 8722 if value != nil { 8723 jtv, ok := value.(string) 8724 if !ok { 8725 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 8726 } 8727 sv.Name = ptr.String(jtv) 8728 } 8729 8730 default: 8731 _, _ = key, value 8732 8733 } 8734 } 8735 *v = sv 8736 return nil 8737} 8738 8739func awsRestjson1_deserializeDocumentAwsCertificateManagerCertificateKeyUsages(v *[]types.AwsCertificateManagerCertificateKeyUsage, value interface{}) error { 8740 if v == nil { 8741 return fmt.Errorf("unexpected nil of type %T", v) 8742 } 8743 if value == nil { 8744 return nil 8745 } 8746 8747 shape, ok := value.([]interface{}) 8748 if !ok { 8749 return fmt.Errorf("unexpected JSON type %v", value) 8750 } 8751 8752 var cv []types.AwsCertificateManagerCertificateKeyUsage 8753 if *v == nil { 8754 cv = []types.AwsCertificateManagerCertificateKeyUsage{} 8755 } else { 8756 cv = *v 8757 } 8758 8759 for _, value := range shape { 8760 var col types.AwsCertificateManagerCertificateKeyUsage 8761 destAddr := &col 8762 if err := awsRestjson1_deserializeDocumentAwsCertificateManagerCertificateKeyUsage(&destAddr, value); err != nil { 8763 return err 8764 } 8765 col = *destAddr 8766 cv = append(cv, col) 8767 8768 } 8769 *v = cv 8770 return nil 8771} 8772 8773func awsRestjson1_deserializeDocumentAwsCertificateManagerCertificateOptions(v **types.AwsCertificateManagerCertificateOptions, value interface{}) error { 8774 if v == nil { 8775 return fmt.Errorf("unexpected nil of type %T", v) 8776 } 8777 if value == nil { 8778 return nil 8779 } 8780 8781 shape, ok := value.(map[string]interface{}) 8782 if !ok { 8783 return fmt.Errorf("unexpected JSON type %v", value) 8784 } 8785 8786 var sv *types.AwsCertificateManagerCertificateOptions 8787 if *v == nil { 8788 sv = &types.AwsCertificateManagerCertificateOptions{} 8789 } else { 8790 sv = *v 8791 } 8792 8793 for key, value := range shape { 8794 switch key { 8795 case "CertificateTransparencyLoggingPreference": 8796 if value != nil { 8797 jtv, ok := value.(string) 8798 if !ok { 8799 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 8800 } 8801 sv.CertificateTransparencyLoggingPreference = ptr.String(jtv) 8802 } 8803 8804 default: 8805 _, _ = key, value 8806 8807 } 8808 } 8809 *v = sv 8810 return nil 8811} 8812 8813func awsRestjson1_deserializeDocumentAwsCertificateManagerCertificateRenewalSummary(v **types.AwsCertificateManagerCertificateRenewalSummary, value interface{}) error { 8814 if v == nil { 8815 return fmt.Errorf("unexpected nil of type %T", v) 8816 } 8817 if value == nil { 8818 return nil 8819 } 8820 8821 shape, ok := value.(map[string]interface{}) 8822 if !ok { 8823 return fmt.Errorf("unexpected JSON type %v", value) 8824 } 8825 8826 var sv *types.AwsCertificateManagerCertificateRenewalSummary 8827 if *v == nil { 8828 sv = &types.AwsCertificateManagerCertificateRenewalSummary{} 8829 } else { 8830 sv = *v 8831 } 8832 8833 for key, value := range shape { 8834 switch key { 8835 case "DomainValidationOptions": 8836 if err := awsRestjson1_deserializeDocumentAwsCertificateManagerCertificateDomainValidationOptions(&sv.DomainValidationOptions, value); err != nil { 8837 return err 8838 } 8839 8840 case "RenewalStatus": 8841 if value != nil { 8842 jtv, ok := value.(string) 8843 if !ok { 8844 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 8845 } 8846 sv.RenewalStatus = ptr.String(jtv) 8847 } 8848 8849 case "RenewalStatusReason": 8850 if value != nil { 8851 jtv, ok := value.(string) 8852 if !ok { 8853 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 8854 } 8855 sv.RenewalStatusReason = ptr.String(jtv) 8856 } 8857 8858 case "UpdatedAt": 8859 if value != nil { 8860 jtv, ok := value.(string) 8861 if !ok { 8862 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 8863 } 8864 sv.UpdatedAt = ptr.String(jtv) 8865 } 8866 8867 default: 8868 _, _ = key, value 8869 8870 } 8871 } 8872 *v = sv 8873 return nil 8874} 8875 8876func awsRestjson1_deserializeDocumentAwsCertificateManagerCertificateResourceRecord(v **types.AwsCertificateManagerCertificateResourceRecord, value interface{}) error { 8877 if v == nil { 8878 return fmt.Errorf("unexpected nil of type %T", v) 8879 } 8880 if value == nil { 8881 return nil 8882 } 8883 8884 shape, ok := value.(map[string]interface{}) 8885 if !ok { 8886 return fmt.Errorf("unexpected JSON type %v", value) 8887 } 8888 8889 var sv *types.AwsCertificateManagerCertificateResourceRecord 8890 if *v == nil { 8891 sv = &types.AwsCertificateManagerCertificateResourceRecord{} 8892 } else { 8893 sv = *v 8894 } 8895 8896 for key, value := range shape { 8897 switch key { 8898 case "Name": 8899 if value != nil { 8900 jtv, ok := value.(string) 8901 if !ok { 8902 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 8903 } 8904 sv.Name = ptr.String(jtv) 8905 } 8906 8907 case "Type": 8908 if value != nil { 8909 jtv, ok := value.(string) 8910 if !ok { 8911 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 8912 } 8913 sv.Type = ptr.String(jtv) 8914 } 8915 8916 case "Value": 8917 if value != nil { 8918 jtv, ok := value.(string) 8919 if !ok { 8920 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 8921 } 8922 sv.Value = ptr.String(jtv) 8923 } 8924 8925 default: 8926 _, _ = key, value 8927 8928 } 8929 } 8930 *v = sv 8931 return nil 8932} 8933 8934func awsRestjson1_deserializeDocumentAwsCloudFrontDistributionCacheBehavior(v **types.AwsCloudFrontDistributionCacheBehavior, value interface{}) error { 8935 if v == nil { 8936 return fmt.Errorf("unexpected nil of type %T", v) 8937 } 8938 if value == nil { 8939 return nil 8940 } 8941 8942 shape, ok := value.(map[string]interface{}) 8943 if !ok { 8944 return fmt.Errorf("unexpected JSON type %v", value) 8945 } 8946 8947 var sv *types.AwsCloudFrontDistributionCacheBehavior 8948 if *v == nil { 8949 sv = &types.AwsCloudFrontDistributionCacheBehavior{} 8950 } else { 8951 sv = *v 8952 } 8953 8954 for key, value := range shape { 8955 switch key { 8956 case "ViewerProtocolPolicy": 8957 if value != nil { 8958 jtv, ok := value.(string) 8959 if !ok { 8960 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 8961 } 8962 sv.ViewerProtocolPolicy = ptr.String(jtv) 8963 } 8964 8965 default: 8966 _, _ = key, value 8967 8968 } 8969 } 8970 *v = sv 8971 return nil 8972} 8973 8974func awsRestjson1_deserializeDocumentAwsCloudFrontDistributionCacheBehaviors(v **types.AwsCloudFrontDistributionCacheBehaviors, value interface{}) error { 8975 if v == nil { 8976 return fmt.Errorf("unexpected nil of type %T", v) 8977 } 8978 if value == nil { 8979 return nil 8980 } 8981 8982 shape, ok := value.(map[string]interface{}) 8983 if !ok { 8984 return fmt.Errorf("unexpected JSON type %v", value) 8985 } 8986 8987 var sv *types.AwsCloudFrontDistributionCacheBehaviors 8988 if *v == nil { 8989 sv = &types.AwsCloudFrontDistributionCacheBehaviors{} 8990 } else { 8991 sv = *v 8992 } 8993 8994 for key, value := range shape { 8995 switch key { 8996 case "Items": 8997 if err := awsRestjson1_deserializeDocumentAwsCloudFrontDistributionCacheBehaviorsItemList(&sv.Items, value); err != nil { 8998 return err 8999 } 9000 9001 default: 9002 _, _ = key, value 9003 9004 } 9005 } 9006 *v = sv 9007 return nil 9008} 9009 9010func awsRestjson1_deserializeDocumentAwsCloudFrontDistributionCacheBehaviorsItemList(v *[]types.AwsCloudFrontDistributionCacheBehavior, value interface{}) error { 9011 if v == nil { 9012 return fmt.Errorf("unexpected nil of type %T", v) 9013 } 9014 if value == nil { 9015 return nil 9016 } 9017 9018 shape, ok := value.([]interface{}) 9019 if !ok { 9020 return fmt.Errorf("unexpected JSON type %v", value) 9021 } 9022 9023 var cv []types.AwsCloudFrontDistributionCacheBehavior 9024 if *v == nil { 9025 cv = []types.AwsCloudFrontDistributionCacheBehavior{} 9026 } else { 9027 cv = *v 9028 } 9029 9030 for _, value := range shape { 9031 var col types.AwsCloudFrontDistributionCacheBehavior 9032 destAddr := &col 9033 if err := awsRestjson1_deserializeDocumentAwsCloudFrontDistributionCacheBehavior(&destAddr, value); err != nil { 9034 return err 9035 } 9036 col = *destAddr 9037 cv = append(cv, col) 9038 9039 } 9040 *v = cv 9041 return nil 9042} 9043 9044func awsRestjson1_deserializeDocumentAwsCloudFrontDistributionDefaultCacheBehavior(v **types.AwsCloudFrontDistributionDefaultCacheBehavior, value interface{}) error { 9045 if v == nil { 9046 return fmt.Errorf("unexpected nil of type %T", v) 9047 } 9048 if value == nil { 9049 return nil 9050 } 9051 9052 shape, ok := value.(map[string]interface{}) 9053 if !ok { 9054 return fmt.Errorf("unexpected JSON type %v", value) 9055 } 9056 9057 var sv *types.AwsCloudFrontDistributionDefaultCacheBehavior 9058 if *v == nil { 9059 sv = &types.AwsCloudFrontDistributionDefaultCacheBehavior{} 9060 } else { 9061 sv = *v 9062 } 9063 9064 for key, value := range shape { 9065 switch key { 9066 case "ViewerProtocolPolicy": 9067 if value != nil { 9068 jtv, ok := value.(string) 9069 if !ok { 9070 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 9071 } 9072 sv.ViewerProtocolPolicy = ptr.String(jtv) 9073 } 9074 9075 default: 9076 _, _ = key, value 9077 9078 } 9079 } 9080 *v = sv 9081 return nil 9082} 9083 9084func awsRestjson1_deserializeDocumentAwsCloudFrontDistributionDetails(v **types.AwsCloudFrontDistributionDetails, value interface{}) error { 9085 if v == nil { 9086 return fmt.Errorf("unexpected nil of type %T", v) 9087 } 9088 if value == nil { 9089 return nil 9090 } 9091 9092 shape, ok := value.(map[string]interface{}) 9093 if !ok { 9094 return fmt.Errorf("unexpected JSON type %v", value) 9095 } 9096 9097 var sv *types.AwsCloudFrontDistributionDetails 9098 if *v == nil { 9099 sv = &types.AwsCloudFrontDistributionDetails{} 9100 } else { 9101 sv = *v 9102 } 9103 9104 for key, value := range shape { 9105 switch key { 9106 case "CacheBehaviors": 9107 if err := awsRestjson1_deserializeDocumentAwsCloudFrontDistributionCacheBehaviors(&sv.CacheBehaviors, value); err != nil { 9108 return err 9109 } 9110 9111 case "DefaultCacheBehavior": 9112 if err := awsRestjson1_deserializeDocumentAwsCloudFrontDistributionDefaultCacheBehavior(&sv.DefaultCacheBehavior, value); err != nil { 9113 return err 9114 } 9115 9116 case "DefaultRootObject": 9117 if value != nil { 9118 jtv, ok := value.(string) 9119 if !ok { 9120 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 9121 } 9122 sv.DefaultRootObject = ptr.String(jtv) 9123 } 9124 9125 case "DomainName": 9126 if value != nil { 9127 jtv, ok := value.(string) 9128 if !ok { 9129 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 9130 } 9131 sv.DomainName = ptr.String(jtv) 9132 } 9133 9134 case "ETag": 9135 if value != nil { 9136 jtv, ok := value.(string) 9137 if !ok { 9138 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 9139 } 9140 sv.ETag = ptr.String(jtv) 9141 } 9142 9143 case "LastModifiedTime": 9144 if value != nil { 9145 jtv, ok := value.(string) 9146 if !ok { 9147 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 9148 } 9149 sv.LastModifiedTime = ptr.String(jtv) 9150 } 9151 9152 case "Logging": 9153 if err := awsRestjson1_deserializeDocumentAwsCloudFrontDistributionLogging(&sv.Logging, value); err != nil { 9154 return err 9155 } 9156 9157 case "OriginGroups": 9158 if err := awsRestjson1_deserializeDocumentAwsCloudFrontDistributionOriginGroups(&sv.OriginGroups, value); err != nil { 9159 return err 9160 } 9161 9162 case "Origins": 9163 if err := awsRestjson1_deserializeDocumentAwsCloudFrontDistributionOrigins(&sv.Origins, value); err != nil { 9164 return err 9165 } 9166 9167 case "Status": 9168 if value != nil { 9169 jtv, ok := value.(string) 9170 if !ok { 9171 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 9172 } 9173 sv.Status = ptr.String(jtv) 9174 } 9175 9176 case "WebAclId": 9177 if value != nil { 9178 jtv, ok := value.(string) 9179 if !ok { 9180 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 9181 } 9182 sv.WebAclId = ptr.String(jtv) 9183 } 9184 9185 default: 9186 _, _ = key, value 9187 9188 } 9189 } 9190 *v = sv 9191 return nil 9192} 9193 9194func awsRestjson1_deserializeDocumentAwsCloudFrontDistributionLogging(v **types.AwsCloudFrontDistributionLogging, value interface{}) error { 9195 if v == nil { 9196 return fmt.Errorf("unexpected nil of type %T", v) 9197 } 9198 if value == nil { 9199 return nil 9200 } 9201 9202 shape, ok := value.(map[string]interface{}) 9203 if !ok { 9204 return fmt.Errorf("unexpected JSON type %v", value) 9205 } 9206 9207 var sv *types.AwsCloudFrontDistributionLogging 9208 if *v == nil { 9209 sv = &types.AwsCloudFrontDistributionLogging{} 9210 } else { 9211 sv = *v 9212 } 9213 9214 for key, value := range shape { 9215 switch key { 9216 case "Bucket": 9217 if value != nil { 9218 jtv, ok := value.(string) 9219 if !ok { 9220 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 9221 } 9222 sv.Bucket = ptr.String(jtv) 9223 } 9224 9225 case "Enabled": 9226 if value != nil { 9227 jtv, ok := value.(bool) 9228 if !ok { 9229 return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) 9230 } 9231 sv.Enabled = jtv 9232 } 9233 9234 case "IncludeCookies": 9235 if value != nil { 9236 jtv, ok := value.(bool) 9237 if !ok { 9238 return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) 9239 } 9240 sv.IncludeCookies = jtv 9241 } 9242 9243 case "Prefix": 9244 if value != nil { 9245 jtv, ok := value.(string) 9246 if !ok { 9247 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 9248 } 9249 sv.Prefix = ptr.String(jtv) 9250 } 9251 9252 default: 9253 _, _ = key, value 9254 9255 } 9256 } 9257 *v = sv 9258 return nil 9259} 9260 9261func awsRestjson1_deserializeDocumentAwsCloudFrontDistributionOriginGroup(v **types.AwsCloudFrontDistributionOriginGroup, value interface{}) error { 9262 if v == nil { 9263 return fmt.Errorf("unexpected nil of type %T", v) 9264 } 9265 if value == nil { 9266 return nil 9267 } 9268 9269 shape, ok := value.(map[string]interface{}) 9270 if !ok { 9271 return fmt.Errorf("unexpected JSON type %v", value) 9272 } 9273 9274 var sv *types.AwsCloudFrontDistributionOriginGroup 9275 if *v == nil { 9276 sv = &types.AwsCloudFrontDistributionOriginGroup{} 9277 } else { 9278 sv = *v 9279 } 9280 9281 for key, value := range shape { 9282 switch key { 9283 case "FailoverCriteria": 9284 if err := awsRestjson1_deserializeDocumentAwsCloudFrontDistributionOriginGroupFailover(&sv.FailoverCriteria, value); err != nil { 9285 return err 9286 } 9287 9288 default: 9289 _, _ = key, value 9290 9291 } 9292 } 9293 *v = sv 9294 return nil 9295} 9296 9297func awsRestjson1_deserializeDocumentAwsCloudFrontDistributionOriginGroupFailover(v **types.AwsCloudFrontDistributionOriginGroupFailover, value interface{}) error { 9298 if v == nil { 9299 return fmt.Errorf("unexpected nil of type %T", v) 9300 } 9301 if value == nil { 9302 return nil 9303 } 9304 9305 shape, ok := value.(map[string]interface{}) 9306 if !ok { 9307 return fmt.Errorf("unexpected JSON type %v", value) 9308 } 9309 9310 var sv *types.AwsCloudFrontDistributionOriginGroupFailover 9311 if *v == nil { 9312 sv = &types.AwsCloudFrontDistributionOriginGroupFailover{} 9313 } else { 9314 sv = *v 9315 } 9316 9317 for key, value := range shape { 9318 switch key { 9319 case "StatusCodes": 9320 if err := awsRestjson1_deserializeDocumentAwsCloudFrontDistributionOriginGroupFailoverStatusCodes(&sv.StatusCodes, value); err != nil { 9321 return err 9322 } 9323 9324 default: 9325 _, _ = key, value 9326 9327 } 9328 } 9329 *v = sv 9330 return nil 9331} 9332 9333func awsRestjson1_deserializeDocumentAwsCloudFrontDistributionOriginGroupFailoverStatusCodes(v **types.AwsCloudFrontDistributionOriginGroupFailoverStatusCodes, value interface{}) error { 9334 if v == nil { 9335 return fmt.Errorf("unexpected nil of type %T", v) 9336 } 9337 if value == nil { 9338 return nil 9339 } 9340 9341 shape, ok := value.(map[string]interface{}) 9342 if !ok { 9343 return fmt.Errorf("unexpected JSON type %v", value) 9344 } 9345 9346 var sv *types.AwsCloudFrontDistributionOriginGroupFailoverStatusCodes 9347 if *v == nil { 9348 sv = &types.AwsCloudFrontDistributionOriginGroupFailoverStatusCodes{} 9349 } else { 9350 sv = *v 9351 } 9352 9353 for key, value := range shape { 9354 switch key { 9355 case "Items": 9356 if err := awsRestjson1_deserializeDocumentAwsCloudFrontDistributionOriginGroupFailoverStatusCodesItemList(&sv.Items, value); err != nil { 9357 return err 9358 } 9359 9360 case "Quantity": 9361 if value != nil { 9362 jtv, ok := value.(json.Number) 9363 if !ok { 9364 return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) 9365 } 9366 i64, err := jtv.Int64() 9367 if err != nil { 9368 return err 9369 } 9370 sv.Quantity = int32(i64) 9371 } 9372 9373 default: 9374 _, _ = key, value 9375 9376 } 9377 } 9378 *v = sv 9379 return nil 9380} 9381 9382func awsRestjson1_deserializeDocumentAwsCloudFrontDistributionOriginGroupFailoverStatusCodesItemList(v *[]int32, value interface{}) error { 9383 if v == nil { 9384 return fmt.Errorf("unexpected nil of type %T", v) 9385 } 9386 if value == nil { 9387 return nil 9388 } 9389 9390 shape, ok := value.([]interface{}) 9391 if !ok { 9392 return fmt.Errorf("unexpected JSON type %v", value) 9393 } 9394 9395 var cv []int32 9396 if *v == nil { 9397 cv = []int32{} 9398 } else { 9399 cv = *v 9400 } 9401 9402 for _, value := range shape { 9403 var col int32 9404 if value != nil { 9405 jtv, ok := value.(json.Number) 9406 if !ok { 9407 return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) 9408 } 9409 i64, err := jtv.Int64() 9410 if err != nil { 9411 return err 9412 } 9413 col = int32(i64) 9414 } 9415 cv = append(cv, col) 9416 9417 } 9418 *v = cv 9419 return nil 9420} 9421 9422func awsRestjson1_deserializeDocumentAwsCloudFrontDistributionOriginGroups(v **types.AwsCloudFrontDistributionOriginGroups, value interface{}) error { 9423 if v == nil { 9424 return fmt.Errorf("unexpected nil of type %T", v) 9425 } 9426 if value == nil { 9427 return nil 9428 } 9429 9430 shape, ok := value.(map[string]interface{}) 9431 if !ok { 9432 return fmt.Errorf("unexpected JSON type %v", value) 9433 } 9434 9435 var sv *types.AwsCloudFrontDistributionOriginGroups 9436 if *v == nil { 9437 sv = &types.AwsCloudFrontDistributionOriginGroups{} 9438 } else { 9439 sv = *v 9440 } 9441 9442 for key, value := range shape { 9443 switch key { 9444 case "Items": 9445 if err := awsRestjson1_deserializeDocumentAwsCloudFrontDistributionOriginGroupsItemList(&sv.Items, value); err != nil { 9446 return err 9447 } 9448 9449 default: 9450 _, _ = key, value 9451 9452 } 9453 } 9454 *v = sv 9455 return nil 9456} 9457 9458func awsRestjson1_deserializeDocumentAwsCloudFrontDistributionOriginGroupsItemList(v *[]types.AwsCloudFrontDistributionOriginGroup, value interface{}) error { 9459 if v == nil { 9460 return fmt.Errorf("unexpected nil of type %T", v) 9461 } 9462 if value == nil { 9463 return nil 9464 } 9465 9466 shape, ok := value.([]interface{}) 9467 if !ok { 9468 return fmt.Errorf("unexpected JSON type %v", value) 9469 } 9470 9471 var cv []types.AwsCloudFrontDistributionOriginGroup 9472 if *v == nil { 9473 cv = []types.AwsCloudFrontDistributionOriginGroup{} 9474 } else { 9475 cv = *v 9476 } 9477 9478 for _, value := range shape { 9479 var col types.AwsCloudFrontDistributionOriginGroup 9480 destAddr := &col 9481 if err := awsRestjson1_deserializeDocumentAwsCloudFrontDistributionOriginGroup(&destAddr, value); err != nil { 9482 return err 9483 } 9484 col = *destAddr 9485 cv = append(cv, col) 9486 9487 } 9488 *v = cv 9489 return nil 9490} 9491 9492func awsRestjson1_deserializeDocumentAwsCloudFrontDistributionOriginItem(v **types.AwsCloudFrontDistributionOriginItem, value interface{}) error { 9493 if v == nil { 9494 return fmt.Errorf("unexpected nil of type %T", v) 9495 } 9496 if value == nil { 9497 return nil 9498 } 9499 9500 shape, ok := value.(map[string]interface{}) 9501 if !ok { 9502 return fmt.Errorf("unexpected JSON type %v", value) 9503 } 9504 9505 var sv *types.AwsCloudFrontDistributionOriginItem 9506 if *v == nil { 9507 sv = &types.AwsCloudFrontDistributionOriginItem{} 9508 } else { 9509 sv = *v 9510 } 9511 9512 for key, value := range shape { 9513 switch key { 9514 case "DomainName": 9515 if value != nil { 9516 jtv, ok := value.(string) 9517 if !ok { 9518 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 9519 } 9520 sv.DomainName = ptr.String(jtv) 9521 } 9522 9523 case "Id": 9524 if value != nil { 9525 jtv, ok := value.(string) 9526 if !ok { 9527 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 9528 } 9529 sv.Id = ptr.String(jtv) 9530 } 9531 9532 case "OriginPath": 9533 if value != nil { 9534 jtv, ok := value.(string) 9535 if !ok { 9536 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 9537 } 9538 sv.OriginPath = ptr.String(jtv) 9539 } 9540 9541 case "S3OriginConfig": 9542 if err := awsRestjson1_deserializeDocumentAwsCloudFrontDistributionOriginS3OriginConfig(&sv.S3OriginConfig, value); err != nil { 9543 return err 9544 } 9545 9546 default: 9547 _, _ = key, value 9548 9549 } 9550 } 9551 *v = sv 9552 return nil 9553} 9554 9555func awsRestjson1_deserializeDocumentAwsCloudFrontDistributionOriginItemList(v *[]types.AwsCloudFrontDistributionOriginItem, value interface{}) error { 9556 if v == nil { 9557 return fmt.Errorf("unexpected nil of type %T", v) 9558 } 9559 if value == nil { 9560 return nil 9561 } 9562 9563 shape, ok := value.([]interface{}) 9564 if !ok { 9565 return fmt.Errorf("unexpected JSON type %v", value) 9566 } 9567 9568 var cv []types.AwsCloudFrontDistributionOriginItem 9569 if *v == nil { 9570 cv = []types.AwsCloudFrontDistributionOriginItem{} 9571 } else { 9572 cv = *v 9573 } 9574 9575 for _, value := range shape { 9576 var col types.AwsCloudFrontDistributionOriginItem 9577 destAddr := &col 9578 if err := awsRestjson1_deserializeDocumentAwsCloudFrontDistributionOriginItem(&destAddr, value); err != nil { 9579 return err 9580 } 9581 col = *destAddr 9582 cv = append(cv, col) 9583 9584 } 9585 *v = cv 9586 return nil 9587} 9588 9589func awsRestjson1_deserializeDocumentAwsCloudFrontDistributionOrigins(v **types.AwsCloudFrontDistributionOrigins, value interface{}) error { 9590 if v == nil { 9591 return fmt.Errorf("unexpected nil of type %T", v) 9592 } 9593 if value == nil { 9594 return nil 9595 } 9596 9597 shape, ok := value.(map[string]interface{}) 9598 if !ok { 9599 return fmt.Errorf("unexpected JSON type %v", value) 9600 } 9601 9602 var sv *types.AwsCloudFrontDistributionOrigins 9603 if *v == nil { 9604 sv = &types.AwsCloudFrontDistributionOrigins{} 9605 } else { 9606 sv = *v 9607 } 9608 9609 for key, value := range shape { 9610 switch key { 9611 case "Items": 9612 if err := awsRestjson1_deserializeDocumentAwsCloudFrontDistributionOriginItemList(&sv.Items, value); err != nil { 9613 return err 9614 } 9615 9616 default: 9617 _, _ = key, value 9618 9619 } 9620 } 9621 *v = sv 9622 return nil 9623} 9624 9625func awsRestjson1_deserializeDocumentAwsCloudFrontDistributionOriginS3OriginConfig(v **types.AwsCloudFrontDistributionOriginS3OriginConfig, value interface{}) error { 9626 if v == nil { 9627 return fmt.Errorf("unexpected nil of type %T", v) 9628 } 9629 if value == nil { 9630 return nil 9631 } 9632 9633 shape, ok := value.(map[string]interface{}) 9634 if !ok { 9635 return fmt.Errorf("unexpected JSON type %v", value) 9636 } 9637 9638 var sv *types.AwsCloudFrontDistributionOriginS3OriginConfig 9639 if *v == nil { 9640 sv = &types.AwsCloudFrontDistributionOriginS3OriginConfig{} 9641 } else { 9642 sv = *v 9643 } 9644 9645 for key, value := range shape { 9646 switch key { 9647 case "OriginAccessIdentity": 9648 if value != nil { 9649 jtv, ok := value.(string) 9650 if !ok { 9651 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 9652 } 9653 sv.OriginAccessIdentity = ptr.String(jtv) 9654 } 9655 9656 default: 9657 _, _ = key, value 9658 9659 } 9660 } 9661 *v = sv 9662 return nil 9663} 9664 9665func awsRestjson1_deserializeDocumentAwsCloudTrailTrailDetails(v **types.AwsCloudTrailTrailDetails, value interface{}) error { 9666 if v == nil { 9667 return fmt.Errorf("unexpected nil of type %T", v) 9668 } 9669 if value == nil { 9670 return nil 9671 } 9672 9673 shape, ok := value.(map[string]interface{}) 9674 if !ok { 9675 return fmt.Errorf("unexpected JSON type %v", value) 9676 } 9677 9678 var sv *types.AwsCloudTrailTrailDetails 9679 if *v == nil { 9680 sv = &types.AwsCloudTrailTrailDetails{} 9681 } else { 9682 sv = *v 9683 } 9684 9685 for key, value := range shape { 9686 switch key { 9687 case "CloudWatchLogsLogGroupArn": 9688 if value != nil { 9689 jtv, ok := value.(string) 9690 if !ok { 9691 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 9692 } 9693 sv.CloudWatchLogsLogGroupArn = ptr.String(jtv) 9694 } 9695 9696 case "CloudWatchLogsRoleArn": 9697 if value != nil { 9698 jtv, ok := value.(string) 9699 if !ok { 9700 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 9701 } 9702 sv.CloudWatchLogsRoleArn = ptr.String(jtv) 9703 } 9704 9705 case "HasCustomEventSelectors": 9706 if value != nil { 9707 jtv, ok := value.(bool) 9708 if !ok { 9709 return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) 9710 } 9711 sv.HasCustomEventSelectors = jtv 9712 } 9713 9714 case "HomeRegion": 9715 if value != nil { 9716 jtv, ok := value.(string) 9717 if !ok { 9718 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 9719 } 9720 sv.HomeRegion = ptr.String(jtv) 9721 } 9722 9723 case "IncludeGlobalServiceEvents": 9724 if value != nil { 9725 jtv, ok := value.(bool) 9726 if !ok { 9727 return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) 9728 } 9729 sv.IncludeGlobalServiceEvents = jtv 9730 } 9731 9732 case "IsMultiRegionTrail": 9733 if value != nil { 9734 jtv, ok := value.(bool) 9735 if !ok { 9736 return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) 9737 } 9738 sv.IsMultiRegionTrail = jtv 9739 } 9740 9741 case "IsOrganizationTrail": 9742 if value != nil { 9743 jtv, ok := value.(bool) 9744 if !ok { 9745 return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) 9746 } 9747 sv.IsOrganizationTrail = jtv 9748 } 9749 9750 case "KmsKeyId": 9751 if value != nil { 9752 jtv, ok := value.(string) 9753 if !ok { 9754 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 9755 } 9756 sv.KmsKeyId = ptr.String(jtv) 9757 } 9758 9759 case "LogFileValidationEnabled": 9760 if value != nil { 9761 jtv, ok := value.(bool) 9762 if !ok { 9763 return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) 9764 } 9765 sv.LogFileValidationEnabled = jtv 9766 } 9767 9768 case "Name": 9769 if value != nil { 9770 jtv, ok := value.(string) 9771 if !ok { 9772 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 9773 } 9774 sv.Name = ptr.String(jtv) 9775 } 9776 9777 case "S3BucketName": 9778 if value != nil { 9779 jtv, ok := value.(string) 9780 if !ok { 9781 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 9782 } 9783 sv.S3BucketName = ptr.String(jtv) 9784 } 9785 9786 case "S3KeyPrefix": 9787 if value != nil { 9788 jtv, ok := value.(string) 9789 if !ok { 9790 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 9791 } 9792 sv.S3KeyPrefix = ptr.String(jtv) 9793 } 9794 9795 case "SnsTopicArn": 9796 if value != nil { 9797 jtv, ok := value.(string) 9798 if !ok { 9799 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 9800 } 9801 sv.SnsTopicArn = ptr.String(jtv) 9802 } 9803 9804 case "SnsTopicName": 9805 if value != nil { 9806 jtv, ok := value.(string) 9807 if !ok { 9808 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 9809 } 9810 sv.SnsTopicName = ptr.String(jtv) 9811 } 9812 9813 case "TrailArn": 9814 if value != nil { 9815 jtv, ok := value.(string) 9816 if !ok { 9817 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 9818 } 9819 sv.TrailArn = ptr.String(jtv) 9820 } 9821 9822 default: 9823 _, _ = key, value 9824 9825 } 9826 } 9827 *v = sv 9828 return nil 9829} 9830 9831func awsRestjson1_deserializeDocumentAwsCodeBuildProjectDetails(v **types.AwsCodeBuildProjectDetails, value interface{}) error { 9832 if v == nil { 9833 return fmt.Errorf("unexpected nil of type %T", v) 9834 } 9835 if value == nil { 9836 return nil 9837 } 9838 9839 shape, ok := value.(map[string]interface{}) 9840 if !ok { 9841 return fmt.Errorf("unexpected JSON type %v", value) 9842 } 9843 9844 var sv *types.AwsCodeBuildProjectDetails 9845 if *v == nil { 9846 sv = &types.AwsCodeBuildProjectDetails{} 9847 } else { 9848 sv = *v 9849 } 9850 9851 for key, value := range shape { 9852 switch key { 9853 case "EncryptionKey": 9854 if value != nil { 9855 jtv, ok := value.(string) 9856 if !ok { 9857 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 9858 } 9859 sv.EncryptionKey = ptr.String(jtv) 9860 } 9861 9862 case "Environment": 9863 if err := awsRestjson1_deserializeDocumentAwsCodeBuildProjectEnvironment(&sv.Environment, value); err != nil { 9864 return err 9865 } 9866 9867 case "Name": 9868 if value != nil { 9869 jtv, ok := value.(string) 9870 if !ok { 9871 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 9872 } 9873 sv.Name = ptr.String(jtv) 9874 } 9875 9876 case "ServiceRole": 9877 if value != nil { 9878 jtv, ok := value.(string) 9879 if !ok { 9880 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 9881 } 9882 sv.ServiceRole = ptr.String(jtv) 9883 } 9884 9885 case "Source": 9886 if err := awsRestjson1_deserializeDocumentAwsCodeBuildProjectSource(&sv.Source, value); err != nil { 9887 return err 9888 } 9889 9890 case "VpcConfig": 9891 if err := awsRestjson1_deserializeDocumentAwsCodeBuildProjectVpcConfig(&sv.VpcConfig, value); err != nil { 9892 return err 9893 } 9894 9895 default: 9896 _, _ = key, value 9897 9898 } 9899 } 9900 *v = sv 9901 return nil 9902} 9903 9904func awsRestjson1_deserializeDocumentAwsCodeBuildProjectEnvironment(v **types.AwsCodeBuildProjectEnvironment, value interface{}) error { 9905 if v == nil { 9906 return fmt.Errorf("unexpected nil of type %T", v) 9907 } 9908 if value == nil { 9909 return nil 9910 } 9911 9912 shape, ok := value.(map[string]interface{}) 9913 if !ok { 9914 return fmt.Errorf("unexpected JSON type %v", value) 9915 } 9916 9917 var sv *types.AwsCodeBuildProjectEnvironment 9918 if *v == nil { 9919 sv = &types.AwsCodeBuildProjectEnvironment{} 9920 } else { 9921 sv = *v 9922 } 9923 9924 for key, value := range shape { 9925 switch key { 9926 case "Certificate": 9927 if value != nil { 9928 jtv, ok := value.(string) 9929 if !ok { 9930 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 9931 } 9932 sv.Certificate = ptr.String(jtv) 9933 } 9934 9935 case "ImagePullCredentialsType": 9936 if value != nil { 9937 jtv, ok := value.(string) 9938 if !ok { 9939 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 9940 } 9941 sv.ImagePullCredentialsType = ptr.String(jtv) 9942 } 9943 9944 case "RegistryCredential": 9945 if err := awsRestjson1_deserializeDocumentAwsCodeBuildProjectEnvironmentRegistryCredential(&sv.RegistryCredential, value); err != nil { 9946 return err 9947 } 9948 9949 case "Type": 9950 if value != nil { 9951 jtv, ok := value.(string) 9952 if !ok { 9953 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 9954 } 9955 sv.Type = ptr.String(jtv) 9956 } 9957 9958 default: 9959 _, _ = key, value 9960 9961 } 9962 } 9963 *v = sv 9964 return nil 9965} 9966 9967func awsRestjson1_deserializeDocumentAwsCodeBuildProjectEnvironmentRegistryCredential(v **types.AwsCodeBuildProjectEnvironmentRegistryCredential, value interface{}) error { 9968 if v == nil { 9969 return fmt.Errorf("unexpected nil of type %T", v) 9970 } 9971 if value == nil { 9972 return nil 9973 } 9974 9975 shape, ok := value.(map[string]interface{}) 9976 if !ok { 9977 return fmt.Errorf("unexpected JSON type %v", value) 9978 } 9979 9980 var sv *types.AwsCodeBuildProjectEnvironmentRegistryCredential 9981 if *v == nil { 9982 sv = &types.AwsCodeBuildProjectEnvironmentRegistryCredential{} 9983 } else { 9984 sv = *v 9985 } 9986 9987 for key, value := range shape { 9988 switch key { 9989 case "Credential": 9990 if value != nil { 9991 jtv, ok := value.(string) 9992 if !ok { 9993 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 9994 } 9995 sv.Credential = ptr.String(jtv) 9996 } 9997 9998 case "CredentialProvider": 9999 if value != nil { 10000 jtv, ok := value.(string) 10001 if !ok { 10002 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 10003 } 10004 sv.CredentialProvider = ptr.String(jtv) 10005 } 10006 10007 default: 10008 _, _ = key, value 10009 10010 } 10011 } 10012 *v = sv 10013 return nil 10014} 10015 10016func awsRestjson1_deserializeDocumentAwsCodeBuildProjectSource(v **types.AwsCodeBuildProjectSource, value interface{}) error { 10017 if v == nil { 10018 return fmt.Errorf("unexpected nil of type %T", v) 10019 } 10020 if value == nil { 10021 return nil 10022 } 10023 10024 shape, ok := value.(map[string]interface{}) 10025 if !ok { 10026 return fmt.Errorf("unexpected JSON type %v", value) 10027 } 10028 10029 var sv *types.AwsCodeBuildProjectSource 10030 if *v == nil { 10031 sv = &types.AwsCodeBuildProjectSource{} 10032 } else { 10033 sv = *v 10034 } 10035 10036 for key, value := range shape { 10037 switch key { 10038 case "GitCloneDepth": 10039 if value != nil { 10040 jtv, ok := value.(json.Number) 10041 if !ok { 10042 return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) 10043 } 10044 i64, err := jtv.Int64() 10045 if err != nil { 10046 return err 10047 } 10048 sv.GitCloneDepth = int32(i64) 10049 } 10050 10051 case "InsecureSsl": 10052 if value != nil { 10053 jtv, ok := value.(bool) 10054 if !ok { 10055 return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) 10056 } 10057 sv.InsecureSsl = jtv 10058 } 10059 10060 case "Location": 10061 if value != nil { 10062 jtv, ok := value.(string) 10063 if !ok { 10064 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 10065 } 10066 sv.Location = ptr.String(jtv) 10067 } 10068 10069 case "Type": 10070 if value != nil { 10071 jtv, ok := value.(string) 10072 if !ok { 10073 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 10074 } 10075 sv.Type = ptr.String(jtv) 10076 } 10077 10078 default: 10079 _, _ = key, value 10080 10081 } 10082 } 10083 *v = sv 10084 return nil 10085} 10086 10087func awsRestjson1_deserializeDocumentAwsCodeBuildProjectVpcConfig(v **types.AwsCodeBuildProjectVpcConfig, value interface{}) error { 10088 if v == nil { 10089 return fmt.Errorf("unexpected nil of type %T", v) 10090 } 10091 if value == nil { 10092 return nil 10093 } 10094 10095 shape, ok := value.(map[string]interface{}) 10096 if !ok { 10097 return fmt.Errorf("unexpected JSON type %v", value) 10098 } 10099 10100 var sv *types.AwsCodeBuildProjectVpcConfig 10101 if *v == nil { 10102 sv = &types.AwsCodeBuildProjectVpcConfig{} 10103 } else { 10104 sv = *v 10105 } 10106 10107 for key, value := range shape { 10108 switch key { 10109 case "SecurityGroupIds": 10110 if err := awsRestjson1_deserializeDocumentNonEmptyStringList(&sv.SecurityGroupIds, value); err != nil { 10111 return err 10112 } 10113 10114 case "Subnets": 10115 if err := awsRestjson1_deserializeDocumentNonEmptyStringList(&sv.Subnets, value); err != nil { 10116 return err 10117 } 10118 10119 case "VpcId": 10120 if value != nil { 10121 jtv, ok := value.(string) 10122 if !ok { 10123 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 10124 } 10125 sv.VpcId = ptr.String(jtv) 10126 } 10127 10128 default: 10129 _, _ = key, value 10130 10131 } 10132 } 10133 *v = sv 10134 return nil 10135} 10136 10137func awsRestjson1_deserializeDocumentAwsCorsConfiguration(v **types.AwsCorsConfiguration, value interface{}) error { 10138 if v == nil { 10139 return fmt.Errorf("unexpected nil of type %T", v) 10140 } 10141 if value == nil { 10142 return nil 10143 } 10144 10145 shape, ok := value.(map[string]interface{}) 10146 if !ok { 10147 return fmt.Errorf("unexpected JSON type %v", value) 10148 } 10149 10150 var sv *types.AwsCorsConfiguration 10151 if *v == nil { 10152 sv = &types.AwsCorsConfiguration{} 10153 } else { 10154 sv = *v 10155 } 10156 10157 for key, value := range shape { 10158 switch key { 10159 case "AllowCredentials": 10160 if value != nil { 10161 jtv, ok := value.(bool) 10162 if !ok { 10163 return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) 10164 } 10165 sv.AllowCredentials = jtv 10166 } 10167 10168 case "AllowHeaders": 10169 if err := awsRestjson1_deserializeDocumentNonEmptyStringList(&sv.AllowHeaders, value); err != nil { 10170 return err 10171 } 10172 10173 case "AllowMethods": 10174 if err := awsRestjson1_deserializeDocumentNonEmptyStringList(&sv.AllowMethods, value); err != nil { 10175 return err 10176 } 10177 10178 case "AllowOrigins": 10179 if err := awsRestjson1_deserializeDocumentNonEmptyStringList(&sv.AllowOrigins, value); err != nil { 10180 return err 10181 } 10182 10183 case "ExposeHeaders": 10184 if err := awsRestjson1_deserializeDocumentNonEmptyStringList(&sv.ExposeHeaders, value); err != nil { 10185 return err 10186 } 10187 10188 case "MaxAge": 10189 if value != nil { 10190 jtv, ok := value.(json.Number) 10191 if !ok { 10192 return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) 10193 } 10194 i64, err := jtv.Int64() 10195 if err != nil { 10196 return err 10197 } 10198 sv.MaxAge = int32(i64) 10199 } 10200 10201 default: 10202 _, _ = key, value 10203 10204 } 10205 } 10206 *v = sv 10207 return nil 10208} 10209 10210func awsRestjson1_deserializeDocumentAwsDynamoDbTableAttributeDefinition(v **types.AwsDynamoDbTableAttributeDefinition, value interface{}) error { 10211 if v == nil { 10212 return fmt.Errorf("unexpected nil of type %T", v) 10213 } 10214 if value == nil { 10215 return nil 10216 } 10217 10218 shape, ok := value.(map[string]interface{}) 10219 if !ok { 10220 return fmt.Errorf("unexpected JSON type %v", value) 10221 } 10222 10223 var sv *types.AwsDynamoDbTableAttributeDefinition 10224 if *v == nil { 10225 sv = &types.AwsDynamoDbTableAttributeDefinition{} 10226 } else { 10227 sv = *v 10228 } 10229 10230 for key, value := range shape { 10231 switch key { 10232 case "AttributeName": 10233 if value != nil { 10234 jtv, ok := value.(string) 10235 if !ok { 10236 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 10237 } 10238 sv.AttributeName = ptr.String(jtv) 10239 } 10240 10241 case "AttributeType": 10242 if value != nil { 10243 jtv, ok := value.(string) 10244 if !ok { 10245 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 10246 } 10247 sv.AttributeType = ptr.String(jtv) 10248 } 10249 10250 default: 10251 _, _ = key, value 10252 10253 } 10254 } 10255 *v = sv 10256 return nil 10257} 10258 10259func awsRestjson1_deserializeDocumentAwsDynamoDbTableAttributeDefinitionList(v *[]types.AwsDynamoDbTableAttributeDefinition, value interface{}) error { 10260 if v == nil { 10261 return fmt.Errorf("unexpected nil of type %T", v) 10262 } 10263 if value == nil { 10264 return nil 10265 } 10266 10267 shape, ok := value.([]interface{}) 10268 if !ok { 10269 return fmt.Errorf("unexpected JSON type %v", value) 10270 } 10271 10272 var cv []types.AwsDynamoDbTableAttributeDefinition 10273 if *v == nil { 10274 cv = []types.AwsDynamoDbTableAttributeDefinition{} 10275 } else { 10276 cv = *v 10277 } 10278 10279 for _, value := range shape { 10280 var col types.AwsDynamoDbTableAttributeDefinition 10281 destAddr := &col 10282 if err := awsRestjson1_deserializeDocumentAwsDynamoDbTableAttributeDefinition(&destAddr, value); err != nil { 10283 return err 10284 } 10285 col = *destAddr 10286 cv = append(cv, col) 10287 10288 } 10289 *v = cv 10290 return nil 10291} 10292 10293func awsRestjson1_deserializeDocumentAwsDynamoDbTableBillingModeSummary(v **types.AwsDynamoDbTableBillingModeSummary, value interface{}) error { 10294 if v == nil { 10295 return fmt.Errorf("unexpected nil of type %T", v) 10296 } 10297 if value == nil { 10298 return nil 10299 } 10300 10301 shape, ok := value.(map[string]interface{}) 10302 if !ok { 10303 return fmt.Errorf("unexpected JSON type %v", value) 10304 } 10305 10306 var sv *types.AwsDynamoDbTableBillingModeSummary 10307 if *v == nil { 10308 sv = &types.AwsDynamoDbTableBillingModeSummary{} 10309 } else { 10310 sv = *v 10311 } 10312 10313 for key, value := range shape { 10314 switch key { 10315 case "BillingMode": 10316 if value != nil { 10317 jtv, ok := value.(string) 10318 if !ok { 10319 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 10320 } 10321 sv.BillingMode = ptr.String(jtv) 10322 } 10323 10324 case "LastUpdateToPayPerRequestDateTime": 10325 if value != nil { 10326 jtv, ok := value.(string) 10327 if !ok { 10328 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 10329 } 10330 sv.LastUpdateToPayPerRequestDateTime = ptr.String(jtv) 10331 } 10332 10333 default: 10334 _, _ = key, value 10335 10336 } 10337 } 10338 *v = sv 10339 return nil 10340} 10341 10342func awsRestjson1_deserializeDocumentAwsDynamoDbTableDetails(v **types.AwsDynamoDbTableDetails, value interface{}) error { 10343 if v == nil { 10344 return fmt.Errorf("unexpected nil of type %T", v) 10345 } 10346 if value == nil { 10347 return nil 10348 } 10349 10350 shape, ok := value.(map[string]interface{}) 10351 if !ok { 10352 return fmt.Errorf("unexpected JSON type %v", value) 10353 } 10354 10355 var sv *types.AwsDynamoDbTableDetails 10356 if *v == nil { 10357 sv = &types.AwsDynamoDbTableDetails{} 10358 } else { 10359 sv = *v 10360 } 10361 10362 for key, value := range shape { 10363 switch key { 10364 case "AttributeDefinitions": 10365 if err := awsRestjson1_deserializeDocumentAwsDynamoDbTableAttributeDefinitionList(&sv.AttributeDefinitions, value); err != nil { 10366 return err 10367 } 10368 10369 case "BillingModeSummary": 10370 if err := awsRestjson1_deserializeDocumentAwsDynamoDbTableBillingModeSummary(&sv.BillingModeSummary, value); err != nil { 10371 return err 10372 } 10373 10374 case "CreationDateTime": 10375 if value != nil { 10376 jtv, ok := value.(string) 10377 if !ok { 10378 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 10379 } 10380 sv.CreationDateTime = ptr.String(jtv) 10381 } 10382 10383 case "GlobalSecondaryIndexes": 10384 if err := awsRestjson1_deserializeDocumentAwsDynamoDbTableGlobalSecondaryIndexList(&sv.GlobalSecondaryIndexes, value); err != nil { 10385 return err 10386 } 10387 10388 case "GlobalTableVersion": 10389 if value != nil { 10390 jtv, ok := value.(string) 10391 if !ok { 10392 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 10393 } 10394 sv.GlobalTableVersion = ptr.String(jtv) 10395 } 10396 10397 case "ItemCount": 10398 if value != nil { 10399 jtv, ok := value.(json.Number) 10400 if !ok { 10401 return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) 10402 } 10403 i64, err := jtv.Int64() 10404 if err != nil { 10405 return err 10406 } 10407 sv.ItemCount = int32(i64) 10408 } 10409 10410 case "KeySchema": 10411 if err := awsRestjson1_deserializeDocumentAwsDynamoDbTableKeySchemaList(&sv.KeySchema, value); err != nil { 10412 return err 10413 } 10414 10415 case "LatestStreamArn": 10416 if value != nil { 10417 jtv, ok := value.(string) 10418 if !ok { 10419 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 10420 } 10421 sv.LatestStreamArn = ptr.String(jtv) 10422 } 10423 10424 case "LatestStreamLabel": 10425 if value != nil { 10426 jtv, ok := value.(string) 10427 if !ok { 10428 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 10429 } 10430 sv.LatestStreamLabel = ptr.String(jtv) 10431 } 10432 10433 case "LocalSecondaryIndexes": 10434 if err := awsRestjson1_deserializeDocumentAwsDynamoDbTableLocalSecondaryIndexList(&sv.LocalSecondaryIndexes, value); err != nil { 10435 return err 10436 } 10437 10438 case "ProvisionedThroughput": 10439 if err := awsRestjson1_deserializeDocumentAwsDynamoDbTableProvisionedThroughput(&sv.ProvisionedThroughput, value); err != nil { 10440 return err 10441 } 10442 10443 case "Replicas": 10444 if err := awsRestjson1_deserializeDocumentAwsDynamoDbTableReplicaList(&sv.Replicas, value); err != nil { 10445 return err 10446 } 10447 10448 case "RestoreSummary": 10449 if err := awsRestjson1_deserializeDocumentAwsDynamoDbTableRestoreSummary(&sv.RestoreSummary, value); err != nil { 10450 return err 10451 } 10452 10453 case "SseDescription": 10454 if err := awsRestjson1_deserializeDocumentAwsDynamoDbTableSseDescription(&sv.SseDescription, value); err != nil { 10455 return err 10456 } 10457 10458 case "StreamSpecification": 10459 if err := awsRestjson1_deserializeDocumentAwsDynamoDbTableStreamSpecification(&sv.StreamSpecification, value); err != nil { 10460 return err 10461 } 10462 10463 case "TableId": 10464 if value != nil { 10465 jtv, ok := value.(string) 10466 if !ok { 10467 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 10468 } 10469 sv.TableId = ptr.String(jtv) 10470 } 10471 10472 case "TableName": 10473 if value != nil { 10474 jtv, ok := value.(string) 10475 if !ok { 10476 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 10477 } 10478 sv.TableName = ptr.String(jtv) 10479 } 10480 10481 case "TableSizeBytes": 10482 if value != nil { 10483 jtv, ok := value.(json.Number) 10484 if !ok { 10485 return fmt.Errorf("expected SizeBytes to be json.Number, got %T instead", value) 10486 } 10487 i64, err := jtv.Int64() 10488 if err != nil { 10489 return err 10490 } 10491 sv.TableSizeBytes = i64 10492 } 10493 10494 case "TableStatus": 10495 if value != nil { 10496 jtv, ok := value.(string) 10497 if !ok { 10498 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 10499 } 10500 sv.TableStatus = ptr.String(jtv) 10501 } 10502 10503 default: 10504 _, _ = key, value 10505 10506 } 10507 } 10508 *v = sv 10509 return nil 10510} 10511 10512func awsRestjson1_deserializeDocumentAwsDynamoDbTableGlobalSecondaryIndex(v **types.AwsDynamoDbTableGlobalSecondaryIndex, value interface{}) error { 10513 if v == nil { 10514 return fmt.Errorf("unexpected nil of type %T", v) 10515 } 10516 if value == nil { 10517 return nil 10518 } 10519 10520 shape, ok := value.(map[string]interface{}) 10521 if !ok { 10522 return fmt.Errorf("unexpected JSON type %v", value) 10523 } 10524 10525 var sv *types.AwsDynamoDbTableGlobalSecondaryIndex 10526 if *v == nil { 10527 sv = &types.AwsDynamoDbTableGlobalSecondaryIndex{} 10528 } else { 10529 sv = *v 10530 } 10531 10532 for key, value := range shape { 10533 switch key { 10534 case "Backfilling": 10535 if value != nil { 10536 jtv, ok := value.(bool) 10537 if !ok { 10538 return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) 10539 } 10540 sv.Backfilling = jtv 10541 } 10542 10543 case "IndexArn": 10544 if value != nil { 10545 jtv, ok := value.(string) 10546 if !ok { 10547 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 10548 } 10549 sv.IndexArn = ptr.String(jtv) 10550 } 10551 10552 case "IndexName": 10553 if value != nil { 10554 jtv, ok := value.(string) 10555 if !ok { 10556 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 10557 } 10558 sv.IndexName = ptr.String(jtv) 10559 } 10560 10561 case "IndexSizeBytes": 10562 if value != nil { 10563 jtv, ok := value.(json.Number) 10564 if !ok { 10565 return fmt.Errorf("expected SizeBytes to be json.Number, got %T instead", value) 10566 } 10567 i64, err := jtv.Int64() 10568 if err != nil { 10569 return err 10570 } 10571 sv.IndexSizeBytes = i64 10572 } 10573 10574 case "IndexStatus": 10575 if value != nil { 10576 jtv, ok := value.(string) 10577 if !ok { 10578 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 10579 } 10580 sv.IndexStatus = ptr.String(jtv) 10581 } 10582 10583 case "ItemCount": 10584 if value != nil { 10585 jtv, ok := value.(json.Number) 10586 if !ok { 10587 return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) 10588 } 10589 i64, err := jtv.Int64() 10590 if err != nil { 10591 return err 10592 } 10593 sv.ItemCount = int32(i64) 10594 } 10595 10596 case "KeySchema": 10597 if err := awsRestjson1_deserializeDocumentAwsDynamoDbTableKeySchemaList(&sv.KeySchema, value); err != nil { 10598 return err 10599 } 10600 10601 case "Projection": 10602 if err := awsRestjson1_deserializeDocumentAwsDynamoDbTableProjection(&sv.Projection, value); err != nil { 10603 return err 10604 } 10605 10606 case "ProvisionedThroughput": 10607 if err := awsRestjson1_deserializeDocumentAwsDynamoDbTableProvisionedThroughput(&sv.ProvisionedThroughput, value); err != nil { 10608 return err 10609 } 10610 10611 default: 10612 _, _ = key, value 10613 10614 } 10615 } 10616 *v = sv 10617 return nil 10618} 10619 10620func awsRestjson1_deserializeDocumentAwsDynamoDbTableGlobalSecondaryIndexList(v *[]types.AwsDynamoDbTableGlobalSecondaryIndex, value interface{}) error { 10621 if v == nil { 10622 return fmt.Errorf("unexpected nil of type %T", v) 10623 } 10624 if value == nil { 10625 return nil 10626 } 10627 10628 shape, ok := value.([]interface{}) 10629 if !ok { 10630 return fmt.Errorf("unexpected JSON type %v", value) 10631 } 10632 10633 var cv []types.AwsDynamoDbTableGlobalSecondaryIndex 10634 if *v == nil { 10635 cv = []types.AwsDynamoDbTableGlobalSecondaryIndex{} 10636 } else { 10637 cv = *v 10638 } 10639 10640 for _, value := range shape { 10641 var col types.AwsDynamoDbTableGlobalSecondaryIndex 10642 destAddr := &col 10643 if err := awsRestjson1_deserializeDocumentAwsDynamoDbTableGlobalSecondaryIndex(&destAddr, value); err != nil { 10644 return err 10645 } 10646 col = *destAddr 10647 cv = append(cv, col) 10648 10649 } 10650 *v = cv 10651 return nil 10652} 10653 10654func awsRestjson1_deserializeDocumentAwsDynamoDbTableKeySchema(v **types.AwsDynamoDbTableKeySchema, value interface{}) error { 10655 if v == nil { 10656 return fmt.Errorf("unexpected nil of type %T", v) 10657 } 10658 if value == nil { 10659 return nil 10660 } 10661 10662 shape, ok := value.(map[string]interface{}) 10663 if !ok { 10664 return fmt.Errorf("unexpected JSON type %v", value) 10665 } 10666 10667 var sv *types.AwsDynamoDbTableKeySchema 10668 if *v == nil { 10669 sv = &types.AwsDynamoDbTableKeySchema{} 10670 } else { 10671 sv = *v 10672 } 10673 10674 for key, value := range shape { 10675 switch key { 10676 case "AttributeName": 10677 if value != nil { 10678 jtv, ok := value.(string) 10679 if !ok { 10680 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 10681 } 10682 sv.AttributeName = ptr.String(jtv) 10683 } 10684 10685 case "KeyType": 10686 if value != nil { 10687 jtv, ok := value.(string) 10688 if !ok { 10689 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 10690 } 10691 sv.KeyType = ptr.String(jtv) 10692 } 10693 10694 default: 10695 _, _ = key, value 10696 10697 } 10698 } 10699 *v = sv 10700 return nil 10701} 10702 10703func awsRestjson1_deserializeDocumentAwsDynamoDbTableKeySchemaList(v *[]types.AwsDynamoDbTableKeySchema, value interface{}) error { 10704 if v == nil { 10705 return fmt.Errorf("unexpected nil of type %T", v) 10706 } 10707 if value == nil { 10708 return nil 10709 } 10710 10711 shape, ok := value.([]interface{}) 10712 if !ok { 10713 return fmt.Errorf("unexpected JSON type %v", value) 10714 } 10715 10716 var cv []types.AwsDynamoDbTableKeySchema 10717 if *v == nil { 10718 cv = []types.AwsDynamoDbTableKeySchema{} 10719 } else { 10720 cv = *v 10721 } 10722 10723 for _, value := range shape { 10724 var col types.AwsDynamoDbTableKeySchema 10725 destAddr := &col 10726 if err := awsRestjson1_deserializeDocumentAwsDynamoDbTableKeySchema(&destAddr, value); err != nil { 10727 return err 10728 } 10729 col = *destAddr 10730 cv = append(cv, col) 10731 10732 } 10733 *v = cv 10734 return nil 10735} 10736 10737func awsRestjson1_deserializeDocumentAwsDynamoDbTableLocalSecondaryIndex(v **types.AwsDynamoDbTableLocalSecondaryIndex, value interface{}) error { 10738 if v == nil { 10739 return fmt.Errorf("unexpected nil of type %T", v) 10740 } 10741 if value == nil { 10742 return nil 10743 } 10744 10745 shape, ok := value.(map[string]interface{}) 10746 if !ok { 10747 return fmt.Errorf("unexpected JSON type %v", value) 10748 } 10749 10750 var sv *types.AwsDynamoDbTableLocalSecondaryIndex 10751 if *v == nil { 10752 sv = &types.AwsDynamoDbTableLocalSecondaryIndex{} 10753 } else { 10754 sv = *v 10755 } 10756 10757 for key, value := range shape { 10758 switch key { 10759 case "IndexArn": 10760 if value != nil { 10761 jtv, ok := value.(string) 10762 if !ok { 10763 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 10764 } 10765 sv.IndexArn = ptr.String(jtv) 10766 } 10767 10768 case "IndexName": 10769 if value != nil { 10770 jtv, ok := value.(string) 10771 if !ok { 10772 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 10773 } 10774 sv.IndexName = ptr.String(jtv) 10775 } 10776 10777 case "KeySchema": 10778 if err := awsRestjson1_deserializeDocumentAwsDynamoDbTableKeySchemaList(&sv.KeySchema, value); err != nil { 10779 return err 10780 } 10781 10782 case "Projection": 10783 if err := awsRestjson1_deserializeDocumentAwsDynamoDbTableProjection(&sv.Projection, value); err != nil { 10784 return err 10785 } 10786 10787 default: 10788 _, _ = key, value 10789 10790 } 10791 } 10792 *v = sv 10793 return nil 10794} 10795 10796func awsRestjson1_deserializeDocumentAwsDynamoDbTableLocalSecondaryIndexList(v *[]types.AwsDynamoDbTableLocalSecondaryIndex, value interface{}) error { 10797 if v == nil { 10798 return fmt.Errorf("unexpected nil of type %T", v) 10799 } 10800 if value == nil { 10801 return nil 10802 } 10803 10804 shape, ok := value.([]interface{}) 10805 if !ok { 10806 return fmt.Errorf("unexpected JSON type %v", value) 10807 } 10808 10809 var cv []types.AwsDynamoDbTableLocalSecondaryIndex 10810 if *v == nil { 10811 cv = []types.AwsDynamoDbTableLocalSecondaryIndex{} 10812 } else { 10813 cv = *v 10814 } 10815 10816 for _, value := range shape { 10817 var col types.AwsDynamoDbTableLocalSecondaryIndex 10818 destAddr := &col 10819 if err := awsRestjson1_deserializeDocumentAwsDynamoDbTableLocalSecondaryIndex(&destAddr, value); err != nil { 10820 return err 10821 } 10822 col = *destAddr 10823 cv = append(cv, col) 10824 10825 } 10826 *v = cv 10827 return nil 10828} 10829 10830func awsRestjson1_deserializeDocumentAwsDynamoDbTableProjection(v **types.AwsDynamoDbTableProjection, value interface{}) error { 10831 if v == nil { 10832 return fmt.Errorf("unexpected nil of type %T", v) 10833 } 10834 if value == nil { 10835 return nil 10836 } 10837 10838 shape, ok := value.(map[string]interface{}) 10839 if !ok { 10840 return fmt.Errorf("unexpected JSON type %v", value) 10841 } 10842 10843 var sv *types.AwsDynamoDbTableProjection 10844 if *v == nil { 10845 sv = &types.AwsDynamoDbTableProjection{} 10846 } else { 10847 sv = *v 10848 } 10849 10850 for key, value := range shape { 10851 switch key { 10852 case "NonKeyAttributes": 10853 if err := awsRestjson1_deserializeDocumentStringList(&sv.NonKeyAttributes, value); err != nil { 10854 return err 10855 } 10856 10857 case "ProjectionType": 10858 if value != nil { 10859 jtv, ok := value.(string) 10860 if !ok { 10861 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 10862 } 10863 sv.ProjectionType = ptr.String(jtv) 10864 } 10865 10866 default: 10867 _, _ = key, value 10868 10869 } 10870 } 10871 *v = sv 10872 return nil 10873} 10874 10875func awsRestjson1_deserializeDocumentAwsDynamoDbTableProvisionedThroughput(v **types.AwsDynamoDbTableProvisionedThroughput, value interface{}) error { 10876 if v == nil { 10877 return fmt.Errorf("unexpected nil of type %T", v) 10878 } 10879 if value == nil { 10880 return nil 10881 } 10882 10883 shape, ok := value.(map[string]interface{}) 10884 if !ok { 10885 return fmt.Errorf("unexpected JSON type %v", value) 10886 } 10887 10888 var sv *types.AwsDynamoDbTableProvisionedThroughput 10889 if *v == nil { 10890 sv = &types.AwsDynamoDbTableProvisionedThroughput{} 10891 } else { 10892 sv = *v 10893 } 10894 10895 for key, value := range shape { 10896 switch key { 10897 case "LastDecreaseDateTime": 10898 if value != nil { 10899 jtv, ok := value.(string) 10900 if !ok { 10901 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 10902 } 10903 sv.LastDecreaseDateTime = ptr.String(jtv) 10904 } 10905 10906 case "LastIncreaseDateTime": 10907 if value != nil { 10908 jtv, ok := value.(string) 10909 if !ok { 10910 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 10911 } 10912 sv.LastIncreaseDateTime = ptr.String(jtv) 10913 } 10914 10915 case "NumberOfDecreasesToday": 10916 if value != nil { 10917 jtv, ok := value.(json.Number) 10918 if !ok { 10919 return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) 10920 } 10921 i64, err := jtv.Int64() 10922 if err != nil { 10923 return err 10924 } 10925 sv.NumberOfDecreasesToday = int32(i64) 10926 } 10927 10928 case "ReadCapacityUnits": 10929 if value != nil { 10930 jtv, ok := value.(json.Number) 10931 if !ok { 10932 return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) 10933 } 10934 i64, err := jtv.Int64() 10935 if err != nil { 10936 return err 10937 } 10938 sv.ReadCapacityUnits = int32(i64) 10939 } 10940 10941 case "WriteCapacityUnits": 10942 if value != nil { 10943 jtv, ok := value.(json.Number) 10944 if !ok { 10945 return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) 10946 } 10947 i64, err := jtv.Int64() 10948 if err != nil { 10949 return err 10950 } 10951 sv.WriteCapacityUnits = int32(i64) 10952 } 10953 10954 default: 10955 _, _ = key, value 10956 10957 } 10958 } 10959 *v = sv 10960 return nil 10961} 10962 10963func awsRestjson1_deserializeDocumentAwsDynamoDbTableProvisionedThroughputOverride(v **types.AwsDynamoDbTableProvisionedThroughputOverride, value interface{}) error { 10964 if v == nil { 10965 return fmt.Errorf("unexpected nil of type %T", v) 10966 } 10967 if value == nil { 10968 return nil 10969 } 10970 10971 shape, ok := value.(map[string]interface{}) 10972 if !ok { 10973 return fmt.Errorf("unexpected JSON type %v", value) 10974 } 10975 10976 var sv *types.AwsDynamoDbTableProvisionedThroughputOverride 10977 if *v == nil { 10978 sv = &types.AwsDynamoDbTableProvisionedThroughputOverride{} 10979 } else { 10980 sv = *v 10981 } 10982 10983 for key, value := range shape { 10984 switch key { 10985 case "ReadCapacityUnits": 10986 if value != nil { 10987 jtv, ok := value.(json.Number) 10988 if !ok { 10989 return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) 10990 } 10991 i64, err := jtv.Int64() 10992 if err != nil { 10993 return err 10994 } 10995 sv.ReadCapacityUnits = int32(i64) 10996 } 10997 10998 default: 10999 _, _ = key, value 11000 11001 } 11002 } 11003 *v = sv 11004 return nil 11005} 11006 11007func awsRestjson1_deserializeDocumentAwsDynamoDbTableReplica(v **types.AwsDynamoDbTableReplica, value interface{}) error { 11008 if v == nil { 11009 return fmt.Errorf("unexpected nil of type %T", v) 11010 } 11011 if value == nil { 11012 return nil 11013 } 11014 11015 shape, ok := value.(map[string]interface{}) 11016 if !ok { 11017 return fmt.Errorf("unexpected JSON type %v", value) 11018 } 11019 11020 var sv *types.AwsDynamoDbTableReplica 11021 if *v == nil { 11022 sv = &types.AwsDynamoDbTableReplica{} 11023 } else { 11024 sv = *v 11025 } 11026 11027 for key, value := range shape { 11028 switch key { 11029 case "GlobalSecondaryIndexes": 11030 if err := awsRestjson1_deserializeDocumentAwsDynamoDbTableReplicaGlobalSecondaryIndexList(&sv.GlobalSecondaryIndexes, value); err != nil { 11031 return err 11032 } 11033 11034 case "KmsMasterKeyId": 11035 if value != nil { 11036 jtv, ok := value.(string) 11037 if !ok { 11038 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 11039 } 11040 sv.KmsMasterKeyId = ptr.String(jtv) 11041 } 11042 11043 case "ProvisionedThroughputOverride": 11044 if err := awsRestjson1_deserializeDocumentAwsDynamoDbTableProvisionedThroughputOverride(&sv.ProvisionedThroughputOverride, value); err != nil { 11045 return err 11046 } 11047 11048 case "RegionName": 11049 if value != nil { 11050 jtv, ok := value.(string) 11051 if !ok { 11052 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 11053 } 11054 sv.RegionName = ptr.String(jtv) 11055 } 11056 11057 case "ReplicaStatus": 11058 if value != nil { 11059 jtv, ok := value.(string) 11060 if !ok { 11061 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 11062 } 11063 sv.ReplicaStatus = ptr.String(jtv) 11064 } 11065 11066 case "ReplicaStatusDescription": 11067 if value != nil { 11068 jtv, ok := value.(string) 11069 if !ok { 11070 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 11071 } 11072 sv.ReplicaStatusDescription = ptr.String(jtv) 11073 } 11074 11075 default: 11076 _, _ = key, value 11077 11078 } 11079 } 11080 *v = sv 11081 return nil 11082} 11083 11084func awsRestjson1_deserializeDocumentAwsDynamoDbTableReplicaGlobalSecondaryIndex(v **types.AwsDynamoDbTableReplicaGlobalSecondaryIndex, value interface{}) error { 11085 if v == nil { 11086 return fmt.Errorf("unexpected nil of type %T", v) 11087 } 11088 if value == nil { 11089 return nil 11090 } 11091 11092 shape, ok := value.(map[string]interface{}) 11093 if !ok { 11094 return fmt.Errorf("unexpected JSON type %v", value) 11095 } 11096 11097 var sv *types.AwsDynamoDbTableReplicaGlobalSecondaryIndex 11098 if *v == nil { 11099 sv = &types.AwsDynamoDbTableReplicaGlobalSecondaryIndex{} 11100 } else { 11101 sv = *v 11102 } 11103 11104 for key, value := range shape { 11105 switch key { 11106 case "IndexName": 11107 if value != nil { 11108 jtv, ok := value.(string) 11109 if !ok { 11110 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 11111 } 11112 sv.IndexName = ptr.String(jtv) 11113 } 11114 11115 case "ProvisionedThroughputOverride": 11116 if err := awsRestjson1_deserializeDocumentAwsDynamoDbTableProvisionedThroughputOverride(&sv.ProvisionedThroughputOverride, value); err != nil { 11117 return err 11118 } 11119 11120 default: 11121 _, _ = key, value 11122 11123 } 11124 } 11125 *v = sv 11126 return nil 11127} 11128 11129func awsRestjson1_deserializeDocumentAwsDynamoDbTableReplicaGlobalSecondaryIndexList(v *[]types.AwsDynamoDbTableReplicaGlobalSecondaryIndex, value interface{}) error { 11130 if v == nil { 11131 return fmt.Errorf("unexpected nil of type %T", v) 11132 } 11133 if value == nil { 11134 return nil 11135 } 11136 11137 shape, ok := value.([]interface{}) 11138 if !ok { 11139 return fmt.Errorf("unexpected JSON type %v", value) 11140 } 11141 11142 var cv []types.AwsDynamoDbTableReplicaGlobalSecondaryIndex 11143 if *v == nil { 11144 cv = []types.AwsDynamoDbTableReplicaGlobalSecondaryIndex{} 11145 } else { 11146 cv = *v 11147 } 11148 11149 for _, value := range shape { 11150 var col types.AwsDynamoDbTableReplicaGlobalSecondaryIndex 11151 destAddr := &col 11152 if err := awsRestjson1_deserializeDocumentAwsDynamoDbTableReplicaGlobalSecondaryIndex(&destAddr, value); err != nil { 11153 return err 11154 } 11155 col = *destAddr 11156 cv = append(cv, col) 11157 11158 } 11159 *v = cv 11160 return nil 11161} 11162 11163func awsRestjson1_deserializeDocumentAwsDynamoDbTableReplicaList(v *[]types.AwsDynamoDbTableReplica, value interface{}) error { 11164 if v == nil { 11165 return fmt.Errorf("unexpected nil of type %T", v) 11166 } 11167 if value == nil { 11168 return nil 11169 } 11170 11171 shape, ok := value.([]interface{}) 11172 if !ok { 11173 return fmt.Errorf("unexpected JSON type %v", value) 11174 } 11175 11176 var cv []types.AwsDynamoDbTableReplica 11177 if *v == nil { 11178 cv = []types.AwsDynamoDbTableReplica{} 11179 } else { 11180 cv = *v 11181 } 11182 11183 for _, value := range shape { 11184 var col types.AwsDynamoDbTableReplica 11185 destAddr := &col 11186 if err := awsRestjson1_deserializeDocumentAwsDynamoDbTableReplica(&destAddr, value); err != nil { 11187 return err 11188 } 11189 col = *destAddr 11190 cv = append(cv, col) 11191 11192 } 11193 *v = cv 11194 return nil 11195} 11196 11197func awsRestjson1_deserializeDocumentAwsDynamoDbTableRestoreSummary(v **types.AwsDynamoDbTableRestoreSummary, value interface{}) error { 11198 if v == nil { 11199 return fmt.Errorf("unexpected nil of type %T", v) 11200 } 11201 if value == nil { 11202 return nil 11203 } 11204 11205 shape, ok := value.(map[string]interface{}) 11206 if !ok { 11207 return fmt.Errorf("unexpected JSON type %v", value) 11208 } 11209 11210 var sv *types.AwsDynamoDbTableRestoreSummary 11211 if *v == nil { 11212 sv = &types.AwsDynamoDbTableRestoreSummary{} 11213 } else { 11214 sv = *v 11215 } 11216 11217 for key, value := range shape { 11218 switch key { 11219 case "RestoreDateTime": 11220 if value != nil { 11221 jtv, ok := value.(string) 11222 if !ok { 11223 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 11224 } 11225 sv.RestoreDateTime = ptr.String(jtv) 11226 } 11227 11228 case "RestoreInProgress": 11229 if value != nil { 11230 jtv, ok := value.(bool) 11231 if !ok { 11232 return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) 11233 } 11234 sv.RestoreInProgress = jtv 11235 } 11236 11237 case "SourceBackupArn": 11238 if value != nil { 11239 jtv, ok := value.(string) 11240 if !ok { 11241 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 11242 } 11243 sv.SourceBackupArn = ptr.String(jtv) 11244 } 11245 11246 case "SourceTableArn": 11247 if value != nil { 11248 jtv, ok := value.(string) 11249 if !ok { 11250 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 11251 } 11252 sv.SourceTableArn = ptr.String(jtv) 11253 } 11254 11255 default: 11256 _, _ = key, value 11257 11258 } 11259 } 11260 *v = sv 11261 return nil 11262} 11263 11264func awsRestjson1_deserializeDocumentAwsDynamoDbTableSseDescription(v **types.AwsDynamoDbTableSseDescription, value interface{}) error { 11265 if v == nil { 11266 return fmt.Errorf("unexpected nil of type %T", v) 11267 } 11268 if value == nil { 11269 return nil 11270 } 11271 11272 shape, ok := value.(map[string]interface{}) 11273 if !ok { 11274 return fmt.Errorf("unexpected JSON type %v", value) 11275 } 11276 11277 var sv *types.AwsDynamoDbTableSseDescription 11278 if *v == nil { 11279 sv = &types.AwsDynamoDbTableSseDescription{} 11280 } else { 11281 sv = *v 11282 } 11283 11284 for key, value := range shape { 11285 switch key { 11286 case "InaccessibleEncryptionDateTime": 11287 if value != nil { 11288 jtv, ok := value.(string) 11289 if !ok { 11290 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 11291 } 11292 sv.InaccessibleEncryptionDateTime = ptr.String(jtv) 11293 } 11294 11295 case "KmsMasterKeyArn": 11296 if value != nil { 11297 jtv, ok := value.(string) 11298 if !ok { 11299 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 11300 } 11301 sv.KmsMasterKeyArn = ptr.String(jtv) 11302 } 11303 11304 case "SseType": 11305 if value != nil { 11306 jtv, ok := value.(string) 11307 if !ok { 11308 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 11309 } 11310 sv.SseType = ptr.String(jtv) 11311 } 11312 11313 case "Status": 11314 if value != nil { 11315 jtv, ok := value.(string) 11316 if !ok { 11317 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 11318 } 11319 sv.Status = ptr.String(jtv) 11320 } 11321 11322 default: 11323 _, _ = key, value 11324 11325 } 11326 } 11327 *v = sv 11328 return nil 11329} 11330 11331func awsRestjson1_deserializeDocumentAwsDynamoDbTableStreamSpecification(v **types.AwsDynamoDbTableStreamSpecification, value interface{}) error { 11332 if v == nil { 11333 return fmt.Errorf("unexpected nil of type %T", v) 11334 } 11335 if value == nil { 11336 return nil 11337 } 11338 11339 shape, ok := value.(map[string]interface{}) 11340 if !ok { 11341 return fmt.Errorf("unexpected JSON type %v", value) 11342 } 11343 11344 var sv *types.AwsDynamoDbTableStreamSpecification 11345 if *v == nil { 11346 sv = &types.AwsDynamoDbTableStreamSpecification{} 11347 } else { 11348 sv = *v 11349 } 11350 11351 for key, value := range shape { 11352 switch key { 11353 case "StreamEnabled": 11354 if value != nil { 11355 jtv, ok := value.(bool) 11356 if !ok { 11357 return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) 11358 } 11359 sv.StreamEnabled = jtv 11360 } 11361 11362 case "StreamViewType": 11363 if value != nil { 11364 jtv, ok := value.(string) 11365 if !ok { 11366 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 11367 } 11368 sv.StreamViewType = ptr.String(jtv) 11369 } 11370 11371 default: 11372 _, _ = key, value 11373 11374 } 11375 } 11376 *v = sv 11377 return nil 11378} 11379 11380func awsRestjson1_deserializeDocumentAwsEc2EipDetails(v **types.AwsEc2EipDetails, value interface{}) error { 11381 if v == nil { 11382 return fmt.Errorf("unexpected nil of type %T", v) 11383 } 11384 if value == nil { 11385 return nil 11386 } 11387 11388 shape, ok := value.(map[string]interface{}) 11389 if !ok { 11390 return fmt.Errorf("unexpected JSON type %v", value) 11391 } 11392 11393 var sv *types.AwsEc2EipDetails 11394 if *v == nil { 11395 sv = &types.AwsEc2EipDetails{} 11396 } else { 11397 sv = *v 11398 } 11399 11400 for key, value := range shape { 11401 switch key { 11402 case "AllocationId": 11403 if value != nil { 11404 jtv, ok := value.(string) 11405 if !ok { 11406 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 11407 } 11408 sv.AllocationId = ptr.String(jtv) 11409 } 11410 11411 case "AssociationId": 11412 if value != nil { 11413 jtv, ok := value.(string) 11414 if !ok { 11415 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 11416 } 11417 sv.AssociationId = ptr.String(jtv) 11418 } 11419 11420 case "Domain": 11421 if value != nil { 11422 jtv, ok := value.(string) 11423 if !ok { 11424 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 11425 } 11426 sv.Domain = ptr.String(jtv) 11427 } 11428 11429 case "InstanceId": 11430 if value != nil { 11431 jtv, ok := value.(string) 11432 if !ok { 11433 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 11434 } 11435 sv.InstanceId = ptr.String(jtv) 11436 } 11437 11438 case "NetworkBorderGroup": 11439 if value != nil { 11440 jtv, ok := value.(string) 11441 if !ok { 11442 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 11443 } 11444 sv.NetworkBorderGroup = ptr.String(jtv) 11445 } 11446 11447 case "NetworkInterfaceId": 11448 if value != nil { 11449 jtv, ok := value.(string) 11450 if !ok { 11451 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 11452 } 11453 sv.NetworkInterfaceId = ptr.String(jtv) 11454 } 11455 11456 case "NetworkInterfaceOwnerId": 11457 if value != nil { 11458 jtv, ok := value.(string) 11459 if !ok { 11460 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 11461 } 11462 sv.NetworkInterfaceOwnerId = ptr.String(jtv) 11463 } 11464 11465 case "PrivateIpAddress": 11466 if value != nil { 11467 jtv, ok := value.(string) 11468 if !ok { 11469 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 11470 } 11471 sv.PrivateIpAddress = ptr.String(jtv) 11472 } 11473 11474 case "PublicIp": 11475 if value != nil { 11476 jtv, ok := value.(string) 11477 if !ok { 11478 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 11479 } 11480 sv.PublicIp = ptr.String(jtv) 11481 } 11482 11483 case "PublicIpv4Pool": 11484 if value != nil { 11485 jtv, ok := value.(string) 11486 if !ok { 11487 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 11488 } 11489 sv.PublicIpv4Pool = ptr.String(jtv) 11490 } 11491 11492 default: 11493 _, _ = key, value 11494 11495 } 11496 } 11497 *v = sv 11498 return nil 11499} 11500 11501func awsRestjson1_deserializeDocumentAwsEc2InstanceDetails(v **types.AwsEc2InstanceDetails, value interface{}) error { 11502 if v == nil { 11503 return fmt.Errorf("unexpected nil of type %T", v) 11504 } 11505 if value == nil { 11506 return nil 11507 } 11508 11509 shape, ok := value.(map[string]interface{}) 11510 if !ok { 11511 return fmt.Errorf("unexpected JSON type %v", value) 11512 } 11513 11514 var sv *types.AwsEc2InstanceDetails 11515 if *v == nil { 11516 sv = &types.AwsEc2InstanceDetails{} 11517 } else { 11518 sv = *v 11519 } 11520 11521 for key, value := range shape { 11522 switch key { 11523 case "IamInstanceProfileArn": 11524 if value != nil { 11525 jtv, ok := value.(string) 11526 if !ok { 11527 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 11528 } 11529 sv.IamInstanceProfileArn = ptr.String(jtv) 11530 } 11531 11532 case "ImageId": 11533 if value != nil { 11534 jtv, ok := value.(string) 11535 if !ok { 11536 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 11537 } 11538 sv.ImageId = ptr.String(jtv) 11539 } 11540 11541 case "IpV4Addresses": 11542 if err := awsRestjson1_deserializeDocumentStringList(&sv.IpV4Addresses, value); err != nil { 11543 return err 11544 } 11545 11546 case "IpV6Addresses": 11547 if err := awsRestjson1_deserializeDocumentStringList(&sv.IpV6Addresses, value); err != nil { 11548 return err 11549 } 11550 11551 case "KeyName": 11552 if value != nil { 11553 jtv, ok := value.(string) 11554 if !ok { 11555 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 11556 } 11557 sv.KeyName = ptr.String(jtv) 11558 } 11559 11560 case "LaunchedAt": 11561 if value != nil { 11562 jtv, ok := value.(string) 11563 if !ok { 11564 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 11565 } 11566 sv.LaunchedAt = ptr.String(jtv) 11567 } 11568 11569 case "SubnetId": 11570 if value != nil { 11571 jtv, ok := value.(string) 11572 if !ok { 11573 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 11574 } 11575 sv.SubnetId = ptr.String(jtv) 11576 } 11577 11578 case "Type": 11579 if value != nil { 11580 jtv, ok := value.(string) 11581 if !ok { 11582 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 11583 } 11584 sv.Type = ptr.String(jtv) 11585 } 11586 11587 case "VpcId": 11588 if value != nil { 11589 jtv, ok := value.(string) 11590 if !ok { 11591 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 11592 } 11593 sv.VpcId = ptr.String(jtv) 11594 } 11595 11596 default: 11597 _, _ = key, value 11598 11599 } 11600 } 11601 *v = sv 11602 return nil 11603} 11604 11605func awsRestjson1_deserializeDocumentAwsEc2NetworkInterfaceAttachment(v **types.AwsEc2NetworkInterfaceAttachment, value interface{}) error { 11606 if v == nil { 11607 return fmt.Errorf("unexpected nil of type %T", v) 11608 } 11609 if value == nil { 11610 return nil 11611 } 11612 11613 shape, ok := value.(map[string]interface{}) 11614 if !ok { 11615 return fmt.Errorf("unexpected JSON type %v", value) 11616 } 11617 11618 var sv *types.AwsEc2NetworkInterfaceAttachment 11619 if *v == nil { 11620 sv = &types.AwsEc2NetworkInterfaceAttachment{} 11621 } else { 11622 sv = *v 11623 } 11624 11625 for key, value := range shape { 11626 switch key { 11627 case "AttachmentId": 11628 if value != nil { 11629 jtv, ok := value.(string) 11630 if !ok { 11631 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 11632 } 11633 sv.AttachmentId = ptr.String(jtv) 11634 } 11635 11636 case "AttachTime": 11637 if value != nil { 11638 jtv, ok := value.(string) 11639 if !ok { 11640 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 11641 } 11642 sv.AttachTime = ptr.String(jtv) 11643 } 11644 11645 case "DeleteOnTermination": 11646 if value != nil { 11647 jtv, ok := value.(bool) 11648 if !ok { 11649 return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) 11650 } 11651 sv.DeleteOnTermination = jtv 11652 } 11653 11654 case "DeviceIndex": 11655 if value != nil { 11656 jtv, ok := value.(json.Number) 11657 if !ok { 11658 return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) 11659 } 11660 i64, err := jtv.Int64() 11661 if err != nil { 11662 return err 11663 } 11664 sv.DeviceIndex = int32(i64) 11665 } 11666 11667 case "InstanceId": 11668 if value != nil { 11669 jtv, ok := value.(string) 11670 if !ok { 11671 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 11672 } 11673 sv.InstanceId = ptr.String(jtv) 11674 } 11675 11676 case "InstanceOwnerId": 11677 if value != nil { 11678 jtv, ok := value.(string) 11679 if !ok { 11680 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 11681 } 11682 sv.InstanceOwnerId = ptr.String(jtv) 11683 } 11684 11685 case "Status": 11686 if value != nil { 11687 jtv, ok := value.(string) 11688 if !ok { 11689 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 11690 } 11691 sv.Status = ptr.String(jtv) 11692 } 11693 11694 default: 11695 _, _ = key, value 11696 11697 } 11698 } 11699 *v = sv 11700 return nil 11701} 11702 11703func awsRestjson1_deserializeDocumentAwsEc2NetworkInterfaceDetails(v **types.AwsEc2NetworkInterfaceDetails, value interface{}) error { 11704 if v == nil { 11705 return fmt.Errorf("unexpected nil of type %T", v) 11706 } 11707 if value == nil { 11708 return nil 11709 } 11710 11711 shape, ok := value.(map[string]interface{}) 11712 if !ok { 11713 return fmt.Errorf("unexpected JSON type %v", value) 11714 } 11715 11716 var sv *types.AwsEc2NetworkInterfaceDetails 11717 if *v == nil { 11718 sv = &types.AwsEc2NetworkInterfaceDetails{} 11719 } else { 11720 sv = *v 11721 } 11722 11723 for key, value := range shape { 11724 switch key { 11725 case "Attachment": 11726 if err := awsRestjson1_deserializeDocumentAwsEc2NetworkInterfaceAttachment(&sv.Attachment, value); err != nil { 11727 return err 11728 } 11729 11730 case "NetworkInterfaceId": 11731 if value != nil { 11732 jtv, ok := value.(string) 11733 if !ok { 11734 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 11735 } 11736 sv.NetworkInterfaceId = ptr.String(jtv) 11737 } 11738 11739 case "SecurityGroups": 11740 if err := awsRestjson1_deserializeDocumentAwsEc2NetworkInterfaceSecurityGroupList(&sv.SecurityGroups, value); err != nil { 11741 return err 11742 } 11743 11744 case "SourceDestCheck": 11745 if value != nil { 11746 jtv, ok := value.(bool) 11747 if !ok { 11748 return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) 11749 } 11750 sv.SourceDestCheck = jtv 11751 } 11752 11753 default: 11754 _, _ = key, value 11755 11756 } 11757 } 11758 *v = sv 11759 return nil 11760} 11761 11762func awsRestjson1_deserializeDocumentAwsEc2NetworkInterfaceSecurityGroup(v **types.AwsEc2NetworkInterfaceSecurityGroup, value interface{}) error { 11763 if v == nil { 11764 return fmt.Errorf("unexpected nil of type %T", v) 11765 } 11766 if value == nil { 11767 return nil 11768 } 11769 11770 shape, ok := value.(map[string]interface{}) 11771 if !ok { 11772 return fmt.Errorf("unexpected JSON type %v", value) 11773 } 11774 11775 var sv *types.AwsEc2NetworkInterfaceSecurityGroup 11776 if *v == nil { 11777 sv = &types.AwsEc2NetworkInterfaceSecurityGroup{} 11778 } else { 11779 sv = *v 11780 } 11781 11782 for key, value := range shape { 11783 switch key { 11784 case "GroupId": 11785 if value != nil { 11786 jtv, ok := value.(string) 11787 if !ok { 11788 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 11789 } 11790 sv.GroupId = ptr.String(jtv) 11791 } 11792 11793 case "GroupName": 11794 if value != nil { 11795 jtv, ok := value.(string) 11796 if !ok { 11797 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 11798 } 11799 sv.GroupName = ptr.String(jtv) 11800 } 11801 11802 default: 11803 _, _ = key, value 11804 11805 } 11806 } 11807 *v = sv 11808 return nil 11809} 11810 11811func awsRestjson1_deserializeDocumentAwsEc2NetworkInterfaceSecurityGroupList(v *[]types.AwsEc2NetworkInterfaceSecurityGroup, value interface{}) error { 11812 if v == nil { 11813 return fmt.Errorf("unexpected nil of type %T", v) 11814 } 11815 if value == nil { 11816 return nil 11817 } 11818 11819 shape, ok := value.([]interface{}) 11820 if !ok { 11821 return fmt.Errorf("unexpected JSON type %v", value) 11822 } 11823 11824 var cv []types.AwsEc2NetworkInterfaceSecurityGroup 11825 if *v == nil { 11826 cv = []types.AwsEc2NetworkInterfaceSecurityGroup{} 11827 } else { 11828 cv = *v 11829 } 11830 11831 for _, value := range shape { 11832 var col types.AwsEc2NetworkInterfaceSecurityGroup 11833 destAddr := &col 11834 if err := awsRestjson1_deserializeDocumentAwsEc2NetworkInterfaceSecurityGroup(&destAddr, value); err != nil { 11835 return err 11836 } 11837 col = *destAddr 11838 cv = append(cv, col) 11839 11840 } 11841 *v = cv 11842 return nil 11843} 11844 11845func awsRestjson1_deserializeDocumentAwsEc2SecurityGroupDetails(v **types.AwsEc2SecurityGroupDetails, value interface{}) error { 11846 if v == nil { 11847 return fmt.Errorf("unexpected nil of type %T", v) 11848 } 11849 if value == nil { 11850 return nil 11851 } 11852 11853 shape, ok := value.(map[string]interface{}) 11854 if !ok { 11855 return fmt.Errorf("unexpected JSON type %v", value) 11856 } 11857 11858 var sv *types.AwsEc2SecurityGroupDetails 11859 if *v == nil { 11860 sv = &types.AwsEc2SecurityGroupDetails{} 11861 } else { 11862 sv = *v 11863 } 11864 11865 for key, value := range shape { 11866 switch key { 11867 case "GroupId": 11868 if value != nil { 11869 jtv, ok := value.(string) 11870 if !ok { 11871 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 11872 } 11873 sv.GroupId = ptr.String(jtv) 11874 } 11875 11876 case "GroupName": 11877 if value != nil { 11878 jtv, ok := value.(string) 11879 if !ok { 11880 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 11881 } 11882 sv.GroupName = ptr.String(jtv) 11883 } 11884 11885 case "IpPermissions": 11886 if err := awsRestjson1_deserializeDocumentAwsEc2SecurityGroupIpPermissionList(&sv.IpPermissions, value); err != nil { 11887 return err 11888 } 11889 11890 case "IpPermissionsEgress": 11891 if err := awsRestjson1_deserializeDocumentAwsEc2SecurityGroupIpPermissionList(&sv.IpPermissionsEgress, value); err != nil { 11892 return err 11893 } 11894 11895 case "OwnerId": 11896 if value != nil { 11897 jtv, ok := value.(string) 11898 if !ok { 11899 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 11900 } 11901 sv.OwnerId = ptr.String(jtv) 11902 } 11903 11904 case "VpcId": 11905 if value != nil { 11906 jtv, ok := value.(string) 11907 if !ok { 11908 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 11909 } 11910 sv.VpcId = ptr.String(jtv) 11911 } 11912 11913 default: 11914 _, _ = key, value 11915 11916 } 11917 } 11918 *v = sv 11919 return nil 11920} 11921 11922func awsRestjson1_deserializeDocumentAwsEc2SecurityGroupIpPermission(v **types.AwsEc2SecurityGroupIpPermission, value interface{}) error { 11923 if v == nil { 11924 return fmt.Errorf("unexpected nil of type %T", v) 11925 } 11926 if value == nil { 11927 return nil 11928 } 11929 11930 shape, ok := value.(map[string]interface{}) 11931 if !ok { 11932 return fmt.Errorf("unexpected JSON type %v", value) 11933 } 11934 11935 var sv *types.AwsEc2SecurityGroupIpPermission 11936 if *v == nil { 11937 sv = &types.AwsEc2SecurityGroupIpPermission{} 11938 } else { 11939 sv = *v 11940 } 11941 11942 for key, value := range shape { 11943 switch key { 11944 case "FromPort": 11945 if value != nil { 11946 jtv, ok := value.(json.Number) 11947 if !ok { 11948 return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) 11949 } 11950 i64, err := jtv.Int64() 11951 if err != nil { 11952 return err 11953 } 11954 sv.FromPort = int32(i64) 11955 } 11956 11957 case "IpProtocol": 11958 if value != nil { 11959 jtv, ok := value.(string) 11960 if !ok { 11961 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 11962 } 11963 sv.IpProtocol = ptr.String(jtv) 11964 } 11965 11966 case "IpRanges": 11967 if err := awsRestjson1_deserializeDocumentAwsEc2SecurityGroupIpRangeList(&sv.IpRanges, value); err != nil { 11968 return err 11969 } 11970 11971 case "Ipv6Ranges": 11972 if err := awsRestjson1_deserializeDocumentAwsEc2SecurityGroupIpv6RangeList(&sv.Ipv6Ranges, value); err != nil { 11973 return err 11974 } 11975 11976 case "PrefixListIds": 11977 if err := awsRestjson1_deserializeDocumentAwsEc2SecurityGroupPrefixListIdList(&sv.PrefixListIds, value); err != nil { 11978 return err 11979 } 11980 11981 case "ToPort": 11982 if value != nil { 11983 jtv, ok := value.(json.Number) 11984 if !ok { 11985 return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) 11986 } 11987 i64, err := jtv.Int64() 11988 if err != nil { 11989 return err 11990 } 11991 sv.ToPort = int32(i64) 11992 } 11993 11994 case "UserIdGroupPairs": 11995 if err := awsRestjson1_deserializeDocumentAwsEc2SecurityGroupUserIdGroupPairList(&sv.UserIdGroupPairs, value); err != nil { 11996 return err 11997 } 11998 11999 default: 12000 _, _ = key, value 12001 12002 } 12003 } 12004 *v = sv 12005 return nil 12006} 12007 12008func awsRestjson1_deserializeDocumentAwsEc2SecurityGroupIpPermissionList(v *[]types.AwsEc2SecurityGroupIpPermission, value interface{}) error { 12009 if v == nil { 12010 return fmt.Errorf("unexpected nil of type %T", v) 12011 } 12012 if value == nil { 12013 return nil 12014 } 12015 12016 shape, ok := value.([]interface{}) 12017 if !ok { 12018 return fmt.Errorf("unexpected JSON type %v", value) 12019 } 12020 12021 var cv []types.AwsEc2SecurityGroupIpPermission 12022 if *v == nil { 12023 cv = []types.AwsEc2SecurityGroupIpPermission{} 12024 } else { 12025 cv = *v 12026 } 12027 12028 for _, value := range shape { 12029 var col types.AwsEc2SecurityGroupIpPermission 12030 destAddr := &col 12031 if err := awsRestjson1_deserializeDocumentAwsEc2SecurityGroupIpPermission(&destAddr, value); err != nil { 12032 return err 12033 } 12034 col = *destAddr 12035 cv = append(cv, col) 12036 12037 } 12038 *v = cv 12039 return nil 12040} 12041 12042func awsRestjson1_deserializeDocumentAwsEc2SecurityGroupIpRange(v **types.AwsEc2SecurityGroupIpRange, value interface{}) error { 12043 if v == nil { 12044 return fmt.Errorf("unexpected nil of type %T", v) 12045 } 12046 if value == nil { 12047 return nil 12048 } 12049 12050 shape, ok := value.(map[string]interface{}) 12051 if !ok { 12052 return fmt.Errorf("unexpected JSON type %v", value) 12053 } 12054 12055 var sv *types.AwsEc2SecurityGroupIpRange 12056 if *v == nil { 12057 sv = &types.AwsEc2SecurityGroupIpRange{} 12058 } else { 12059 sv = *v 12060 } 12061 12062 for key, value := range shape { 12063 switch key { 12064 case "CidrIp": 12065 if value != nil { 12066 jtv, ok := value.(string) 12067 if !ok { 12068 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 12069 } 12070 sv.CidrIp = ptr.String(jtv) 12071 } 12072 12073 default: 12074 _, _ = key, value 12075 12076 } 12077 } 12078 *v = sv 12079 return nil 12080} 12081 12082func awsRestjson1_deserializeDocumentAwsEc2SecurityGroupIpRangeList(v *[]types.AwsEc2SecurityGroupIpRange, value interface{}) error { 12083 if v == nil { 12084 return fmt.Errorf("unexpected nil of type %T", v) 12085 } 12086 if value == nil { 12087 return nil 12088 } 12089 12090 shape, ok := value.([]interface{}) 12091 if !ok { 12092 return fmt.Errorf("unexpected JSON type %v", value) 12093 } 12094 12095 var cv []types.AwsEc2SecurityGroupIpRange 12096 if *v == nil { 12097 cv = []types.AwsEc2SecurityGroupIpRange{} 12098 } else { 12099 cv = *v 12100 } 12101 12102 for _, value := range shape { 12103 var col types.AwsEc2SecurityGroupIpRange 12104 destAddr := &col 12105 if err := awsRestjson1_deserializeDocumentAwsEc2SecurityGroupIpRange(&destAddr, value); err != nil { 12106 return err 12107 } 12108 col = *destAddr 12109 cv = append(cv, col) 12110 12111 } 12112 *v = cv 12113 return nil 12114} 12115 12116func awsRestjson1_deserializeDocumentAwsEc2SecurityGroupIpv6Range(v **types.AwsEc2SecurityGroupIpv6Range, value interface{}) error { 12117 if v == nil { 12118 return fmt.Errorf("unexpected nil of type %T", v) 12119 } 12120 if value == nil { 12121 return nil 12122 } 12123 12124 shape, ok := value.(map[string]interface{}) 12125 if !ok { 12126 return fmt.Errorf("unexpected JSON type %v", value) 12127 } 12128 12129 var sv *types.AwsEc2SecurityGroupIpv6Range 12130 if *v == nil { 12131 sv = &types.AwsEc2SecurityGroupIpv6Range{} 12132 } else { 12133 sv = *v 12134 } 12135 12136 for key, value := range shape { 12137 switch key { 12138 case "CidrIpv6": 12139 if value != nil { 12140 jtv, ok := value.(string) 12141 if !ok { 12142 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 12143 } 12144 sv.CidrIpv6 = ptr.String(jtv) 12145 } 12146 12147 default: 12148 _, _ = key, value 12149 12150 } 12151 } 12152 *v = sv 12153 return nil 12154} 12155 12156func awsRestjson1_deserializeDocumentAwsEc2SecurityGroupIpv6RangeList(v *[]types.AwsEc2SecurityGroupIpv6Range, value interface{}) error { 12157 if v == nil { 12158 return fmt.Errorf("unexpected nil of type %T", v) 12159 } 12160 if value == nil { 12161 return nil 12162 } 12163 12164 shape, ok := value.([]interface{}) 12165 if !ok { 12166 return fmt.Errorf("unexpected JSON type %v", value) 12167 } 12168 12169 var cv []types.AwsEc2SecurityGroupIpv6Range 12170 if *v == nil { 12171 cv = []types.AwsEc2SecurityGroupIpv6Range{} 12172 } else { 12173 cv = *v 12174 } 12175 12176 for _, value := range shape { 12177 var col types.AwsEc2SecurityGroupIpv6Range 12178 destAddr := &col 12179 if err := awsRestjson1_deserializeDocumentAwsEc2SecurityGroupIpv6Range(&destAddr, value); err != nil { 12180 return err 12181 } 12182 col = *destAddr 12183 cv = append(cv, col) 12184 12185 } 12186 *v = cv 12187 return nil 12188} 12189 12190func awsRestjson1_deserializeDocumentAwsEc2SecurityGroupPrefixListId(v **types.AwsEc2SecurityGroupPrefixListId, value interface{}) error { 12191 if v == nil { 12192 return fmt.Errorf("unexpected nil of type %T", v) 12193 } 12194 if value == nil { 12195 return nil 12196 } 12197 12198 shape, ok := value.(map[string]interface{}) 12199 if !ok { 12200 return fmt.Errorf("unexpected JSON type %v", value) 12201 } 12202 12203 var sv *types.AwsEc2SecurityGroupPrefixListId 12204 if *v == nil { 12205 sv = &types.AwsEc2SecurityGroupPrefixListId{} 12206 } else { 12207 sv = *v 12208 } 12209 12210 for key, value := range shape { 12211 switch key { 12212 case "PrefixListId": 12213 if value != nil { 12214 jtv, ok := value.(string) 12215 if !ok { 12216 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 12217 } 12218 sv.PrefixListId = ptr.String(jtv) 12219 } 12220 12221 default: 12222 _, _ = key, value 12223 12224 } 12225 } 12226 *v = sv 12227 return nil 12228} 12229 12230func awsRestjson1_deserializeDocumentAwsEc2SecurityGroupPrefixListIdList(v *[]types.AwsEc2SecurityGroupPrefixListId, value interface{}) error { 12231 if v == nil { 12232 return fmt.Errorf("unexpected nil of type %T", v) 12233 } 12234 if value == nil { 12235 return nil 12236 } 12237 12238 shape, ok := value.([]interface{}) 12239 if !ok { 12240 return fmt.Errorf("unexpected JSON type %v", value) 12241 } 12242 12243 var cv []types.AwsEc2SecurityGroupPrefixListId 12244 if *v == nil { 12245 cv = []types.AwsEc2SecurityGroupPrefixListId{} 12246 } else { 12247 cv = *v 12248 } 12249 12250 for _, value := range shape { 12251 var col types.AwsEc2SecurityGroupPrefixListId 12252 destAddr := &col 12253 if err := awsRestjson1_deserializeDocumentAwsEc2SecurityGroupPrefixListId(&destAddr, value); err != nil { 12254 return err 12255 } 12256 col = *destAddr 12257 cv = append(cv, col) 12258 12259 } 12260 *v = cv 12261 return nil 12262} 12263 12264func awsRestjson1_deserializeDocumentAwsEc2SecurityGroupUserIdGroupPair(v **types.AwsEc2SecurityGroupUserIdGroupPair, value interface{}) error { 12265 if v == nil { 12266 return fmt.Errorf("unexpected nil of type %T", v) 12267 } 12268 if value == nil { 12269 return nil 12270 } 12271 12272 shape, ok := value.(map[string]interface{}) 12273 if !ok { 12274 return fmt.Errorf("unexpected JSON type %v", value) 12275 } 12276 12277 var sv *types.AwsEc2SecurityGroupUserIdGroupPair 12278 if *v == nil { 12279 sv = &types.AwsEc2SecurityGroupUserIdGroupPair{} 12280 } else { 12281 sv = *v 12282 } 12283 12284 for key, value := range shape { 12285 switch key { 12286 case "GroupId": 12287 if value != nil { 12288 jtv, ok := value.(string) 12289 if !ok { 12290 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 12291 } 12292 sv.GroupId = ptr.String(jtv) 12293 } 12294 12295 case "GroupName": 12296 if value != nil { 12297 jtv, ok := value.(string) 12298 if !ok { 12299 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 12300 } 12301 sv.GroupName = ptr.String(jtv) 12302 } 12303 12304 case "PeeringStatus": 12305 if value != nil { 12306 jtv, ok := value.(string) 12307 if !ok { 12308 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 12309 } 12310 sv.PeeringStatus = ptr.String(jtv) 12311 } 12312 12313 case "UserId": 12314 if value != nil { 12315 jtv, ok := value.(string) 12316 if !ok { 12317 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 12318 } 12319 sv.UserId = ptr.String(jtv) 12320 } 12321 12322 case "VpcId": 12323 if value != nil { 12324 jtv, ok := value.(string) 12325 if !ok { 12326 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 12327 } 12328 sv.VpcId = ptr.String(jtv) 12329 } 12330 12331 case "VpcPeeringConnectionId": 12332 if value != nil { 12333 jtv, ok := value.(string) 12334 if !ok { 12335 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 12336 } 12337 sv.VpcPeeringConnectionId = ptr.String(jtv) 12338 } 12339 12340 default: 12341 _, _ = key, value 12342 12343 } 12344 } 12345 *v = sv 12346 return nil 12347} 12348 12349func awsRestjson1_deserializeDocumentAwsEc2SecurityGroupUserIdGroupPairList(v *[]types.AwsEc2SecurityGroupUserIdGroupPair, value interface{}) error { 12350 if v == nil { 12351 return fmt.Errorf("unexpected nil of type %T", v) 12352 } 12353 if value == nil { 12354 return nil 12355 } 12356 12357 shape, ok := value.([]interface{}) 12358 if !ok { 12359 return fmt.Errorf("unexpected JSON type %v", value) 12360 } 12361 12362 var cv []types.AwsEc2SecurityGroupUserIdGroupPair 12363 if *v == nil { 12364 cv = []types.AwsEc2SecurityGroupUserIdGroupPair{} 12365 } else { 12366 cv = *v 12367 } 12368 12369 for _, value := range shape { 12370 var col types.AwsEc2SecurityGroupUserIdGroupPair 12371 destAddr := &col 12372 if err := awsRestjson1_deserializeDocumentAwsEc2SecurityGroupUserIdGroupPair(&destAddr, value); err != nil { 12373 return err 12374 } 12375 col = *destAddr 12376 cv = append(cv, col) 12377 12378 } 12379 *v = cv 12380 return nil 12381} 12382 12383func awsRestjson1_deserializeDocumentAwsEc2VolumeAttachment(v **types.AwsEc2VolumeAttachment, value interface{}) error { 12384 if v == nil { 12385 return fmt.Errorf("unexpected nil of type %T", v) 12386 } 12387 if value == nil { 12388 return nil 12389 } 12390 12391 shape, ok := value.(map[string]interface{}) 12392 if !ok { 12393 return fmt.Errorf("unexpected JSON type %v", value) 12394 } 12395 12396 var sv *types.AwsEc2VolumeAttachment 12397 if *v == nil { 12398 sv = &types.AwsEc2VolumeAttachment{} 12399 } else { 12400 sv = *v 12401 } 12402 12403 for key, value := range shape { 12404 switch key { 12405 case "AttachTime": 12406 if value != nil { 12407 jtv, ok := value.(string) 12408 if !ok { 12409 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 12410 } 12411 sv.AttachTime = ptr.String(jtv) 12412 } 12413 12414 case "DeleteOnTermination": 12415 if value != nil { 12416 jtv, ok := value.(bool) 12417 if !ok { 12418 return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) 12419 } 12420 sv.DeleteOnTermination = jtv 12421 } 12422 12423 case "InstanceId": 12424 if value != nil { 12425 jtv, ok := value.(string) 12426 if !ok { 12427 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 12428 } 12429 sv.InstanceId = ptr.String(jtv) 12430 } 12431 12432 case "Status": 12433 if value != nil { 12434 jtv, ok := value.(string) 12435 if !ok { 12436 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 12437 } 12438 sv.Status = ptr.String(jtv) 12439 } 12440 12441 default: 12442 _, _ = key, value 12443 12444 } 12445 } 12446 *v = sv 12447 return nil 12448} 12449 12450func awsRestjson1_deserializeDocumentAwsEc2VolumeAttachmentList(v *[]types.AwsEc2VolumeAttachment, value interface{}) error { 12451 if v == nil { 12452 return fmt.Errorf("unexpected nil of type %T", v) 12453 } 12454 if value == nil { 12455 return nil 12456 } 12457 12458 shape, ok := value.([]interface{}) 12459 if !ok { 12460 return fmt.Errorf("unexpected JSON type %v", value) 12461 } 12462 12463 var cv []types.AwsEc2VolumeAttachment 12464 if *v == nil { 12465 cv = []types.AwsEc2VolumeAttachment{} 12466 } else { 12467 cv = *v 12468 } 12469 12470 for _, value := range shape { 12471 var col types.AwsEc2VolumeAttachment 12472 destAddr := &col 12473 if err := awsRestjson1_deserializeDocumentAwsEc2VolumeAttachment(&destAddr, value); err != nil { 12474 return err 12475 } 12476 col = *destAddr 12477 cv = append(cv, col) 12478 12479 } 12480 *v = cv 12481 return nil 12482} 12483 12484func awsRestjson1_deserializeDocumentAwsEc2VolumeDetails(v **types.AwsEc2VolumeDetails, value interface{}) error { 12485 if v == nil { 12486 return fmt.Errorf("unexpected nil of type %T", v) 12487 } 12488 if value == nil { 12489 return nil 12490 } 12491 12492 shape, ok := value.(map[string]interface{}) 12493 if !ok { 12494 return fmt.Errorf("unexpected JSON type %v", value) 12495 } 12496 12497 var sv *types.AwsEc2VolumeDetails 12498 if *v == nil { 12499 sv = &types.AwsEc2VolumeDetails{} 12500 } else { 12501 sv = *v 12502 } 12503 12504 for key, value := range shape { 12505 switch key { 12506 case "Attachments": 12507 if err := awsRestjson1_deserializeDocumentAwsEc2VolumeAttachmentList(&sv.Attachments, value); err != nil { 12508 return err 12509 } 12510 12511 case "CreateTime": 12512 if value != nil { 12513 jtv, ok := value.(string) 12514 if !ok { 12515 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 12516 } 12517 sv.CreateTime = ptr.String(jtv) 12518 } 12519 12520 case "Encrypted": 12521 if value != nil { 12522 jtv, ok := value.(bool) 12523 if !ok { 12524 return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) 12525 } 12526 sv.Encrypted = jtv 12527 } 12528 12529 case "KmsKeyId": 12530 if value != nil { 12531 jtv, ok := value.(string) 12532 if !ok { 12533 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 12534 } 12535 sv.KmsKeyId = ptr.String(jtv) 12536 } 12537 12538 case "Size": 12539 if value != nil { 12540 jtv, ok := value.(json.Number) 12541 if !ok { 12542 return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) 12543 } 12544 i64, err := jtv.Int64() 12545 if err != nil { 12546 return err 12547 } 12548 sv.Size = int32(i64) 12549 } 12550 12551 case "SnapshotId": 12552 if value != nil { 12553 jtv, ok := value.(string) 12554 if !ok { 12555 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 12556 } 12557 sv.SnapshotId = ptr.String(jtv) 12558 } 12559 12560 case "Status": 12561 if value != nil { 12562 jtv, ok := value.(string) 12563 if !ok { 12564 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 12565 } 12566 sv.Status = ptr.String(jtv) 12567 } 12568 12569 default: 12570 _, _ = key, value 12571 12572 } 12573 } 12574 *v = sv 12575 return nil 12576} 12577 12578func awsRestjson1_deserializeDocumentAwsEc2VpcDetails(v **types.AwsEc2VpcDetails, value interface{}) error { 12579 if v == nil { 12580 return fmt.Errorf("unexpected nil of type %T", v) 12581 } 12582 if value == nil { 12583 return nil 12584 } 12585 12586 shape, ok := value.(map[string]interface{}) 12587 if !ok { 12588 return fmt.Errorf("unexpected JSON type %v", value) 12589 } 12590 12591 var sv *types.AwsEc2VpcDetails 12592 if *v == nil { 12593 sv = &types.AwsEc2VpcDetails{} 12594 } else { 12595 sv = *v 12596 } 12597 12598 for key, value := range shape { 12599 switch key { 12600 case "CidrBlockAssociationSet": 12601 if err := awsRestjson1_deserializeDocumentCidrBlockAssociationList(&sv.CidrBlockAssociationSet, value); err != nil { 12602 return err 12603 } 12604 12605 case "DhcpOptionsId": 12606 if value != nil { 12607 jtv, ok := value.(string) 12608 if !ok { 12609 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 12610 } 12611 sv.DhcpOptionsId = ptr.String(jtv) 12612 } 12613 12614 case "Ipv6CidrBlockAssociationSet": 12615 if err := awsRestjson1_deserializeDocumentIpv6CidrBlockAssociationList(&sv.Ipv6CidrBlockAssociationSet, value); err != nil { 12616 return err 12617 } 12618 12619 case "State": 12620 if value != nil { 12621 jtv, ok := value.(string) 12622 if !ok { 12623 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 12624 } 12625 sv.State = ptr.String(jtv) 12626 } 12627 12628 default: 12629 _, _ = key, value 12630 12631 } 12632 } 12633 *v = sv 12634 return nil 12635} 12636 12637func awsRestjson1_deserializeDocumentAwsElasticsearchDomainDetails(v **types.AwsElasticsearchDomainDetails, value interface{}) error { 12638 if v == nil { 12639 return fmt.Errorf("unexpected nil of type %T", v) 12640 } 12641 if value == nil { 12642 return nil 12643 } 12644 12645 shape, ok := value.(map[string]interface{}) 12646 if !ok { 12647 return fmt.Errorf("unexpected JSON type %v", value) 12648 } 12649 12650 var sv *types.AwsElasticsearchDomainDetails 12651 if *v == nil { 12652 sv = &types.AwsElasticsearchDomainDetails{} 12653 } else { 12654 sv = *v 12655 } 12656 12657 for key, value := range shape { 12658 switch key { 12659 case "AccessPolicies": 12660 if value != nil { 12661 jtv, ok := value.(string) 12662 if !ok { 12663 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 12664 } 12665 sv.AccessPolicies = ptr.String(jtv) 12666 } 12667 12668 case "DomainEndpointOptions": 12669 if err := awsRestjson1_deserializeDocumentAwsElasticsearchDomainDomainEndpointOptions(&sv.DomainEndpointOptions, value); err != nil { 12670 return err 12671 } 12672 12673 case "DomainId": 12674 if value != nil { 12675 jtv, ok := value.(string) 12676 if !ok { 12677 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 12678 } 12679 sv.DomainId = ptr.String(jtv) 12680 } 12681 12682 case "DomainName": 12683 if value != nil { 12684 jtv, ok := value.(string) 12685 if !ok { 12686 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 12687 } 12688 sv.DomainName = ptr.String(jtv) 12689 } 12690 12691 case "ElasticsearchVersion": 12692 if value != nil { 12693 jtv, ok := value.(string) 12694 if !ok { 12695 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 12696 } 12697 sv.ElasticsearchVersion = ptr.String(jtv) 12698 } 12699 12700 case "EncryptionAtRestOptions": 12701 if err := awsRestjson1_deserializeDocumentAwsElasticsearchDomainEncryptionAtRestOptions(&sv.EncryptionAtRestOptions, value); err != nil { 12702 return err 12703 } 12704 12705 case "Endpoint": 12706 if value != nil { 12707 jtv, ok := value.(string) 12708 if !ok { 12709 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 12710 } 12711 sv.Endpoint = ptr.String(jtv) 12712 } 12713 12714 case "Endpoints": 12715 if err := awsRestjson1_deserializeDocumentFieldMap(&sv.Endpoints, value); err != nil { 12716 return err 12717 } 12718 12719 case "NodeToNodeEncryptionOptions": 12720 if err := awsRestjson1_deserializeDocumentAwsElasticsearchDomainNodeToNodeEncryptionOptions(&sv.NodeToNodeEncryptionOptions, value); err != nil { 12721 return err 12722 } 12723 12724 case "VPCOptions": 12725 if err := awsRestjson1_deserializeDocumentAwsElasticsearchDomainVPCOptions(&sv.VPCOptions, value); err != nil { 12726 return err 12727 } 12728 12729 default: 12730 _, _ = key, value 12731 12732 } 12733 } 12734 *v = sv 12735 return nil 12736} 12737 12738func awsRestjson1_deserializeDocumentAwsElasticsearchDomainDomainEndpointOptions(v **types.AwsElasticsearchDomainDomainEndpointOptions, value interface{}) error { 12739 if v == nil { 12740 return fmt.Errorf("unexpected nil of type %T", v) 12741 } 12742 if value == nil { 12743 return nil 12744 } 12745 12746 shape, ok := value.(map[string]interface{}) 12747 if !ok { 12748 return fmt.Errorf("unexpected JSON type %v", value) 12749 } 12750 12751 var sv *types.AwsElasticsearchDomainDomainEndpointOptions 12752 if *v == nil { 12753 sv = &types.AwsElasticsearchDomainDomainEndpointOptions{} 12754 } else { 12755 sv = *v 12756 } 12757 12758 for key, value := range shape { 12759 switch key { 12760 case "EnforceHTTPS": 12761 if value != nil { 12762 jtv, ok := value.(bool) 12763 if !ok { 12764 return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) 12765 } 12766 sv.EnforceHTTPS = jtv 12767 } 12768 12769 case "TLSSecurityPolicy": 12770 if value != nil { 12771 jtv, ok := value.(string) 12772 if !ok { 12773 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 12774 } 12775 sv.TLSSecurityPolicy = ptr.String(jtv) 12776 } 12777 12778 default: 12779 _, _ = key, value 12780 12781 } 12782 } 12783 *v = sv 12784 return nil 12785} 12786 12787func awsRestjson1_deserializeDocumentAwsElasticsearchDomainEncryptionAtRestOptions(v **types.AwsElasticsearchDomainEncryptionAtRestOptions, value interface{}) error { 12788 if v == nil { 12789 return fmt.Errorf("unexpected nil of type %T", v) 12790 } 12791 if value == nil { 12792 return nil 12793 } 12794 12795 shape, ok := value.(map[string]interface{}) 12796 if !ok { 12797 return fmt.Errorf("unexpected JSON type %v", value) 12798 } 12799 12800 var sv *types.AwsElasticsearchDomainEncryptionAtRestOptions 12801 if *v == nil { 12802 sv = &types.AwsElasticsearchDomainEncryptionAtRestOptions{} 12803 } else { 12804 sv = *v 12805 } 12806 12807 for key, value := range shape { 12808 switch key { 12809 case "Enabled": 12810 if value != nil { 12811 jtv, ok := value.(bool) 12812 if !ok { 12813 return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) 12814 } 12815 sv.Enabled = jtv 12816 } 12817 12818 case "KmsKeyId": 12819 if value != nil { 12820 jtv, ok := value.(string) 12821 if !ok { 12822 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 12823 } 12824 sv.KmsKeyId = ptr.String(jtv) 12825 } 12826 12827 default: 12828 _, _ = key, value 12829 12830 } 12831 } 12832 *v = sv 12833 return nil 12834} 12835 12836func awsRestjson1_deserializeDocumentAwsElasticsearchDomainNodeToNodeEncryptionOptions(v **types.AwsElasticsearchDomainNodeToNodeEncryptionOptions, value interface{}) error { 12837 if v == nil { 12838 return fmt.Errorf("unexpected nil of type %T", v) 12839 } 12840 if value == nil { 12841 return nil 12842 } 12843 12844 shape, ok := value.(map[string]interface{}) 12845 if !ok { 12846 return fmt.Errorf("unexpected JSON type %v", value) 12847 } 12848 12849 var sv *types.AwsElasticsearchDomainNodeToNodeEncryptionOptions 12850 if *v == nil { 12851 sv = &types.AwsElasticsearchDomainNodeToNodeEncryptionOptions{} 12852 } else { 12853 sv = *v 12854 } 12855 12856 for key, value := range shape { 12857 switch key { 12858 case "Enabled": 12859 if value != nil { 12860 jtv, ok := value.(bool) 12861 if !ok { 12862 return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) 12863 } 12864 sv.Enabled = jtv 12865 } 12866 12867 default: 12868 _, _ = key, value 12869 12870 } 12871 } 12872 *v = sv 12873 return nil 12874} 12875 12876func awsRestjson1_deserializeDocumentAwsElasticsearchDomainVPCOptions(v **types.AwsElasticsearchDomainVPCOptions, value interface{}) error { 12877 if v == nil { 12878 return fmt.Errorf("unexpected nil of type %T", v) 12879 } 12880 if value == nil { 12881 return nil 12882 } 12883 12884 shape, ok := value.(map[string]interface{}) 12885 if !ok { 12886 return fmt.Errorf("unexpected JSON type %v", value) 12887 } 12888 12889 var sv *types.AwsElasticsearchDomainVPCOptions 12890 if *v == nil { 12891 sv = &types.AwsElasticsearchDomainVPCOptions{} 12892 } else { 12893 sv = *v 12894 } 12895 12896 for key, value := range shape { 12897 switch key { 12898 case "AvailabilityZones": 12899 if err := awsRestjson1_deserializeDocumentNonEmptyStringList(&sv.AvailabilityZones, value); err != nil { 12900 return err 12901 } 12902 12903 case "SecurityGroupIds": 12904 if err := awsRestjson1_deserializeDocumentNonEmptyStringList(&sv.SecurityGroupIds, value); err != nil { 12905 return err 12906 } 12907 12908 case "SubnetIds": 12909 if err := awsRestjson1_deserializeDocumentNonEmptyStringList(&sv.SubnetIds, value); err != nil { 12910 return err 12911 } 12912 12913 case "VPCId": 12914 if value != nil { 12915 jtv, ok := value.(string) 12916 if !ok { 12917 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 12918 } 12919 sv.VPCId = ptr.String(jtv) 12920 } 12921 12922 default: 12923 _, _ = key, value 12924 12925 } 12926 } 12927 *v = sv 12928 return nil 12929} 12930 12931func awsRestjson1_deserializeDocumentAwsElbAppCookieStickinessPolicies(v *[]types.AwsElbAppCookieStickinessPolicy, value interface{}) error { 12932 if v == nil { 12933 return fmt.Errorf("unexpected nil of type %T", v) 12934 } 12935 if value == nil { 12936 return nil 12937 } 12938 12939 shape, ok := value.([]interface{}) 12940 if !ok { 12941 return fmt.Errorf("unexpected JSON type %v", value) 12942 } 12943 12944 var cv []types.AwsElbAppCookieStickinessPolicy 12945 if *v == nil { 12946 cv = []types.AwsElbAppCookieStickinessPolicy{} 12947 } else { 12948 cv = *v 12949 } 12950 12951 for _, value := range shape { 12952 var col types.AwsElbAppCookieStickinessPolicy 12953 destAddr := &col 12954 if err := awsRestjson1_deserializeDocumentAwsElbAppCookieStickinessPolicy(&destAddr, value); err != nil { 12955 return err 12956 } 12957 col = *destAddr 12958 cv = append(cv, col) 12959 12960 } 12961 *v = cv 12962 return nil 12963} 12964 12965func awsRestjson1_deserializeDocumentAwsElbAppCookieStickinessPolicy(v **types.AwsElbAppCookieStickinessPolicy, value interface{}) error { 12966 if v == nil { 12967 return fmt.Errorf("unexpected nil of type %T", v) 12968 } 12969 if value == nil { 12970 return nil 12971 } 12972 12973 shape, ok := value.(map[string]interface{}) 12974 if !ok { 12975 return fmt.Errorf("unexpected JSON type %v", value) 12976 } 12977 12978 var sv *types.AwsElbAppCookieStickinessPolicy 12979 if *v == nil { 12980 sv = &types.AwsElbAppCookieStickinessPolicy{} 12981 } else { 12982 sv = *v 12983 } 12984 12985 for key, value := range shape { 12986 switch key { 12987 case "CookieName": 12988 if value != nil { 12989 jtv, ok := value.(string) 12990 if !ok { 12991 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 12992 } 12993 sv.CookieName = ptr.String(jtv) 12994 } 12995 12996 case "PolicyName": 12997 if value != nil { 12998 jtv, ok := value.(string) 12999 if !ok { 13000 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 13001 } 13002 sv.PolicyName = ptr.String(jtv) 13003 } 13004 13005 default: 13006 _, _ = key, value 13007 13008 } 13009 } 13010 *v = sv 13011 return nil 13012} 13013 13014func awsRestjson1_deserializeDocumentAwsElbLbCookieStickinessPolicies(v *[]types.AwsElbLbCookieStickinessPolicy, value interface{}) error { 13015 if v == nil { 13016 return fmt.Errorf("unexpected nil of type %T", v) 13017 } 13018 if value == nil { 13019 return nil 13020 } 13021 13022 shape, ok := value.([]interface{}) 13023 if !ok { 13024 return fmt.Errorf("unexpected JSON type %v", value) 13025 } 13026 13027 var cv []types.AwsElbLbCookieStickinessPolicy 13028 if *v == nil { 13029 cv = []types.AwsElbLbCookieStickinessPolicy{} 13030 } else { 13031 cv = *v 13032 } 13033 13034 for _, value := range shape { 13035 var col types.AwsElbLbCookieStickinessPolicy 13036 destAddr := &col 13037 if err := awsRestjson1_deserializeDocumentAwsElbLbCookieStickinessPolicy(&destAddr, value); err != nil { 13038 return err 13039 } 13040 col = *destAddr 13041 cv = append(cv, col) 13042 13043 } 13044 *v = cv 13045 return nil 13046} 13047 13048func awsRestjson1_deserializeDocumentAwsElbLbCookieStickinessPolicy(v **types.AwsElbLbCookieStickinessPolicy, value interface{}) error { 13049 if v == nil { 13050 return fmt.Errorf("unexpected nil of type %T", v) 13051 } 13052 if value == nil { 13053 return nil 13054 } 13055 13056 shape, ok := value.(map[string]interface{}) 13057 if !ok { 13058 return fmt.Errorf("unexpected JSON type %v", value) 13059 } 13060 13061 var sv *types.AwsElbLbCookieStickinessPolicy 13062 if *v == nil { 13063 sv = &types.AwsElbLbCookieStickinessPolicy{} 13064 } else { 13065 sv = *v 13066 } 13067 13068 for key, value := range shape { 13069 switch key { 13070 case "CookieExpirationPeriod": 13071 if value != nil { 13072 jtv, ok := value.(json.Number) 13073 if !ok { 13074 return fmt.Errorf("expected Long to be json.Number, got %T instead", value) 13075 } 13076 i64, err := jtv.Int64() 13077 if err != nil { 13078 return err 13079 } 13080 sv.CookieExpirationPeriod = i64 13081 } 13082 13083 case "PolicyName": 13084 if value != nil { 13085 jtv, ok := value.(string) 13086 if !ok { 13087 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 13088 } 13089 sv.PolicyName = ptr.String(jtv) 13090 } 13091 13092 default: 13093 _, _ = key, value 13094 13095 } 13096 } 13097 *v = sv 13098 return nil 13099} 13100 13101func awsRestjson1_deserializeDocumentAwsElbLoadBalancerAccessLog(v **types.AwsElbLoadBalancerAccessLog, value interface{}) error { 13102 if v == nil { 13103 return fmt.Errorf("unexpected nil of type %T", v) 13104 } 13105 if value == nil { 13106 return nil 13107 } 13108 13109 shape, ok := value.(map[string]interface{}) 13110 if !ok { 13111 return fmt.Errorf("unexpected JSON type %v", value) 13112 } 13113 13114 var sv *types.AwsElbLoadBalancerAccessLog 13115 if *v == nil { 13116 sv = &types.AwsElbLoadBalancerAccessLog{} 13117 } else { 13118 sv = *v 13119 } 13120 13121 for key, value := range shape { 13122 switch key { 13123 case "EmitInterval": 13124 if value != nil { 13125 jtv, ok := value.(json.Number) 13126 if !ok { 13127 return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) 13128 } 13129 i64, err := jtv.Int64() 13130 if err != nil { 13131 return err 13132 } 13133 sv.EmitInterval = int32(i64) 13134 } 13135 13136 case "Enabled": 13137 if value != nil { 13138 jtv, ok := value.(bool) 13139 if !ok { 13140 return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) 13141 } 13142 sv.Enabled = jtv 13143 } 13144 13145 case "S3BucketName": 13146 if value != nil { 13147 jtv, ok := value.(string) 13148 if !ok { 13149 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 13150 } 13151 sv.S3BucketName = ptr.String(jtv) 13152 } 13153 13154 case "S3BucketPrefix": 13155 if value != nil { 13156 jtv, ok := value.(string) 13157 if !ok { 13158 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 13159 } 13160 sv.S3BucketPrefix = ptr.String(jtv) 13161 } 13162 13163 default: 13164 _, _ = key, value 13165 13166 } 13167 } 13168 *v = sv 13169 return nil 13170} 13171 13172func awsRestjson1_deserializeDocumentAwsElbLoadBalancerAttributes(v **types.AwsElbLoadBalancerAttributes, value interface{}) error { 13173 if v == nil { 13174 return fmt.Errorf("unexpected nil of type %T", v) 13175 } 13176 if value == nil { 13177 return nil 13178 } 13179 13180 shape, ok := value.(map[string]interface{}) 13181 if !ok { 13182 return fmt.Errorf("unexpected JSON type %v", value) 13183 } 13184 13185 var sv *types.AwsElbLoadBalancerAttributes 13186 if *v == nil { 13187 sv = &types.AwsElbLoadBalancerAttributes{} 13188 } else { 13189 sv = *v 13190 } 13191 13192 for key, value := range shape { 13193 switch key { 13194 case "AccessLog": 13195 if err := awsRestjson1_deserializeDocumentAwsElbLoadBalancerAccessLog(&sv.AccessLog, value); err != nil { 13196 return err 13197 } 13198 13199 case "ConnectionDraining": 13200 if err := awsRestjson1_deserializeDocumentAwsElbLoadBalancerConnectionDraining(&sv.ConnectionDraining, value); err != nil { 13201 return err 13202 } 13203 13204 case "ConnectionSettings": 13205 if err := awsRestjson1_deserializeDocumentAwsElbLoadBalancerConnectionSettings(&sv.ConnectionSettings, value); err != nil { 13206 return err 13207 } 13208 13209 case "CrossZoneLoadBalancing": 13210 if err := awsRestjson1_deserializeDocumentAwsElbLoadBalancerCrossZoneLoadBalancing(&sv.CrossZoneLoadBalancing, value); err != nil { 13211 return err 13212 } 13213 13214 default: 13215 _, _ = key, value 13216 13217 } 13218 } 13219 *v = sv 13220 return nil 13221} 13222 13223func awsRestjson1_deserializeDocumentAwsElbLoadBalancerBackendServerDescription(v **types.AwsElbLoadBalancerBackendServerDescription, value interface{}) error { 13224 if v == nil { 13225 return fmt.Errorf("unexpected nil of type %T", v) 13226 } 13227 if value == nil { 13228 return nil 13229 } 13230 13231 shape, ok := value.(map[string]interface{}) 13232 if !ok { 13233 return fmt.Errorf("unexpected JSON type %v", value) 13234 } 13235 13236 var sv *types.AwsElbLoadBalancerBackendServerDescription 13237 if *v == nil { 13238 sv = &types.AwsElbLoadBalancerBackendServerDescription{} 13239 } else { 13240 sv = *v 13241 } 13242 13243 for key, value := range shape { 13244 switch key { 13245 case "InstancePort": 13246 if value != nil { 13247 jtv, ok := value.(json.Number) 13248 if !ok { 13249 return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) 13250 } 13251 i64, err := jtv.Int64() 13252 if err != nil { 13253 return err 13254 } 13255 sv.InstancePort = int32(i64) 13256 } 13257 13258 case "PolicyNames": 13259 if err := awsRestjson1_deserializeDocumentStringList(&sv.PolicyNames, value); err != nil { 13260 return err 13261 } 13262 13263 default: 13264 _, _ = key, value 13265 13266 } 13267 } 13268 *v = sv 13269 return nil 13270} 13271 13272func awsRestjson1_deserializeDocumentAwsElbLoadBalancerBackendServerDescriptions(v *[]types.AwsElbLoadBalancerBackendServerDescription, value interface{}) error { 13273 if v == nil { 13274 return fmt.Errorf("unexpected nil of type %T", v) 13275 } 13276 if value == nil { 13277 return nil 13278 } 13279 13280 shape, ok := value.([]interface{}) 13281 if !ok { 13282 return fmt.Errorf("unexpected JSON type %v", value) 13283 } 13284 13285 var cv []types.AwsElbLoadBalancerBackendServerDescription 13286 if *v == nil { 13287 cv = []types.AwsElbLoadBalancerBackendServerDescription{} 13288 } else { 13289 cv = *v 13290 } 13291 13292 for _, value := range shape { 13293 var col types.AwsElbLoadBalancerBackendServerDescription 13294 destAddr := &col 13295 if err := awsRestjson1_deserializeDocumentAwsElbLoadBalancerBackendServerDescription(&destAddr, value); err != nil { 13296 return err 13297 } 13298 col = *destAddr 13299 cv = append(cv, col) 13300 13301 } 13302 *v = cv 13303 return nil 13304} 13305 13306func awsRestjson1_deserializeDocumentAwsElbLoadBalancerConnectionDraining(v **types.AwsElbLoadBalancerConnectionDraining, value interface{}) error { 13307 if v == nil { 13308 return fmt.Errorf("unexpected nil of type %T", v) 13309 } 13310 if value == nil { 13311 return nil 13312 } 13313 13314 shape, ok := value.(map[string]interface{}) 13315 if !ok { 13316 return fmt.Errorf("unexpected JSON type %v", value) 13317 } 13318 13319 var sv *types.AwsElbLoadBalancerConnectionDraining 13320 if *v == nil { 13321 sv = &types.AwsElbLoadBalancerConnectionDraining{} 13322 } else { 13323 sv = *v 13324 } 13325 13326 for key, value := range shape { 13327 switch key { 13328 case "Enabled": 13329 if value != nil { 13330 jtv, ok := value.(bool) 13331 if !ok { 13332 return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) 13333 } 13334 sv.Enabled = jtv 13335 } 13336 13337 case "Timeout": 13338 if value != nil { 13339 jtv, ok := value.(json.Number) 13340 if !ok { 13341 return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) 13342 } 13343 i64, err := jtv.Int64() 13344 if err != nil { 13345 return err 13346 } 13347 sv.Timeout = int32(i64) 13348 } 13349 13350 default: 13351 _, _ = key, value 13352 13353 } 13354 } 13355 *v = sv 13356 return nil 13357} 13358 13359func awsRestjson1_deserializeDocumentAwsElbLoadBalancerConnectionSettings(v **types.AwsElbLoadBalancerConnectionSettings, value interface{}) error { 13360 if v == nil { 13361 return fmt.Errorf("unexpected nil of type %T", v) 13362 } 13363 if value == nil { 13364 return nil 13365 } 13366 13367 shape, ok := value.(map[string]interface{}) 13368 if !ok { 13369 return fmt.Errorf("unexpected JSON type %v", value) 13370 } 13371 13372 var sv *types.AwsElbLoadBalancerConnectionSettings 13373 if *v == nil { 13374 sv = &types.AwsElbLoadBalancerConnectionSettings{} 13375 } else { 13376 sv = *v 13377 } 13378 13379 for key, value := range shape { 13380 switch key { 13381 case "IdleTimeout": 13382 if value != nil { 13383 jtv, ok := value.(json.Number) 13384 if !ok { 13385 return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) 13386 } 13387 i64, err := jtv.Int64() 13388 if err != nil { 13389 return err 13390 } 13391 sv.IdleTimeout = int32(i64) 13392 } 13393 13394 default: 13395 _, _ = key, value 13396 13397 } 13398 } 13399 *v = sv 13400 return nil 13401} 13402 13403func awsRestjson1_deserializeDocumentAwsElbLoadBalancerCrossZoneLoadBalancing(v **types.AwsElbLoadBalancerCrossZoneLoadBalancing, value interface{}) error { 13404 if v == nil { 13405 return fmt.Errorf("unexpected nil of type %T", v) 13406 } 13407 if value == nil { 13408 return nil 13409 } 13410 13411 shape, ok := value.(map[string]interface{}) 13412 if !ok { 13413 return fmt.Errorf("unexpected JSON type %v", value) 13414 } 13415 13416 var sv *types.AwsElbLoadBalancerCrossZoneLoadBalancing 13417 if *v == nil { 13418 sv = &types.AwsElbLoadBalancerCrossZoneLoadBalancing{} 13419 } else { 13420 sv = *v 13421 } 13422 13423 for key, value := range shape { 13424 switch key { 13425 case "Enabled": 13426 if value != nil { 13427 jtv, ok := value.(bool) 13428 if !ok { 13429 return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) 13430 } 13431 sv.Enabled = jtv 13432 } 13433 13434 default: 13435 _, _ = key, value 13436 13437 } 13438 } 13439 *v = sv 13440 return nil 13441} 13442 13443func awsRestjson1_deserializeDocumentAwsElbLoadBalancerDetails(v **types.AwsElbLoadBalancerDetails, value interface{}) error { 13444 if v == nil { 13445 return fmt.Errorf("unexpected nil of type %T", v) 13446 } 13447 if value == nil { 13448 return nil 13449 } 13450 13451 shape, ok := value.(map[string]interface{}) 13452 if !ok { 13453 return fmt.Errorf("unexpected JSON type %v", value) 13454 } 13455 13456 var sv *types.AwsElbLoadBalancerDetails 13457 if *v == nil { 13458 sv = &types.AwsElbLoadBalancerDetails{} 13459 } else { 13460 sv = *v 13461 } 13462 13463 for key, value := range shape { 13464 switch key { 13465 case "AvailabilityZones": 13466 if err := awsRestjson1_deserializeDocumentStringList(&sv.AvailabilityZones, value); err != nil { 13467 return err 13468 } 13469 13470 case "BackendServerDescriptions": 13471 if err := awsRestjson1_deserializeDocumentAwsElbLoadBalancerBackendServerDescriptions(&sv.BackendServerDescriptions, value); err != nil { 13472 return err 13473 } 13474 13475 case "CanonicalHostedZoneName": 13476 if value != nil { 13477 jtv, ok := value.(string) 13478 if !ok { 13479 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 13480 } 13481 sv.CanonicalHostedZoneName = ptr.String(jtv) 13482 } 13483 13484 case "CanonicalHostedZoneNameID": 13485 if value != nil { 13486 jtv, ok := value.(string) 13487 if !ok { 13488 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 13489 } 13490 sv.CanonicalHostedZoneNameID = ptr.String(jtv) 13491 } 13492 13493 case "CreatedTime": 13494 if value != nil { 13495 jtv, ok := value.(string) 13496 if !ok { 13497 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 13498 } 13499 sv.CreatedTime = ptr.String(jtv) 13500 } 13501 13502 case "DnsName": 13503 if value != nil { 13504 jtv, ok := value.(string) 13505 if !ok { 13506 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 13507 } 13508 sv.DnsName = ptr.String(jtv) 13509 } 13510 13511 case "HealthCheck": 13512 if err := awsRestjson1_deserializeDocumentAwsElbLoadBalancerHealthCheck(&sv.HealthCheck, value); err != nil { 13513 return err 13514 } 13515 13516 case "Instances": 13517 if err := awsRestjson1_deserializeDocumentAwsElbLoadBalancerInstances(&sv.Instances, value); err != nil { 13518 return err 13519 } 13520 13521 case "ListenerDescriptions": 13522 if err := awsRestjson1_deserializeDocumentAwsElbLoadBalancerListenerDescriptions(&sv.ListenerDescriptions, value); err != nil { 13523 return err 13524 } 13525 13526 case "LoadBalancerAttributes": 13527 if err := awsRestjson1_deserializeDocumentAwsElbLoadBalancerAttributes(&sv.LoadBalancerAttributes, value); err != nil { 13528 return err 13529 } 13530 13531 case "LoadBalancerName": 13532 if value != nil { 13533 jtv, ok := value.(string) 13534 if !ok { 13535 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 13536 } 13537 sv.LoadBalancerName = ptr.String(jtv) 13538 } 13539 13540 case "Policies": 13541 if err := awsRestjson1_deserializeDocumentAwsElbLoadBalancerPolicies(&sv.Policies, value); err != nil { 13542 return err 13543 } 13544 13545 case "Scheme": 13546 if value != nil { 13547 jtv, ok := value.(string) 13548 if !ok { 13549 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 13550 } 13551 sv.Scheme = ptr.String(jtv) 13552 } 13553 13554 case "SecurityGroups": 13555 if err := awsRestjson1_deserializeDocumentStringList(&sv.SecurityGroups, value); err != nil { 13556 return err 13557 } 13558 13559 case "SourceSecurityGroup": 13560 if err := awsRestjson1_deserializeDocumentAwsElbLoadBalancerSourceSecurityGroup(&sv.SourceSecurityGroup, value); err != nil { 13561 return err 13562 } 13563 13564 case "Subnets": 13565 if err := awsRestjson1_deserializeDocumentStringList(&sv.Subnets, value); err != nil { 13566 return err 13567 } 13568 13569 case "VpcId": 13570 if value != nil { 13571 jtv, ok := value.(string) 13572 if !ok { 13573 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 13574 } 13575 sv.VpcId = ptr.String(jtv) 13576 } 13577 13578 default: 13579 _, _ = key, value 13580 13581 } 13582 } 13583 *v = sv 13584 return nil 13585} 13586 13587func awsRestjson1_deserializeDocumentAwsElbLoadBalancerHealthCheck(v **types.AwsElbLoadBalancerHealthCheck, value interface{}) error { 13588 if v == nil { 13589 return fmt.Errorf("unexpected nil of type %T", v) 13590 } 13591 if value == nil { 13592 return nil 13593 } 13594 13595 shape, ok := value.(map[string]interface{}) 13596 if !ok { 13597 return fmt.Errorf("unexpected JSON type %v", value) 13598 } 13599 13600 var sv *types.AwsElbLoadBalancerHealthCheck 13601 if *v == nil { 13602 sv = &types.AwsElbLoadBalancerHealthCheck{} 13603 } else { 13604 sv = *v 13605 } 13606 13607 for key, value := range shape { 13608 switch key { 13609 case "HealthyThreshold": 13610 if value != nil { 13611 jtv, ok := value.(json.Number) 13612 if !ok { 13613 return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) 13614 } 13615 i64, err := jtv.Int64() 13616 if err != nil { 13617 return err 13618 } 13619 sv.HealthyThreshold = int32(i64) 13620 } 13621 13622 case "Interval": 13623 if value != nil { 13624 jtv, ok := value.(json.Number) 13625 if !ok { 13626 return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) 13627 } 13628 i64, err := jtv.Int64() 13629 if err != nil { 13630 return err 13631 } 13632 sv.Interval = int32(i64) 13633 } 13634 13635 case "Target": 13636 if value != nil { 13637 jtv, ok := value.(string) 13638 if !ok { 13639 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 13640 } 13641 sv.Target = ptr.String(jtv) 13642 } 13643 13644 case "Timeout": 13645 if value != nil { 13646 jtv, ok := value.(json.Number) 13647 if !ok { 13648 return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) 13649 } 13650 i64, err := jtv.Int64() 13651 if err != nil { 13652 return err 13653 } 13654 sv.Timeout = int32(i64) 13655 } 13656 13657 case "UnhealthyThreshold": 13658 if value != nil { 13659 jtv, ok := value.(json.Number) 13660 if !ok { 13661 return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) 13662 } 13663 i64, err := jtv.Int64() 13664 if err != nil { 13665 return err 13666 } 13667 sv.UnhealthyThreshold = int32(i64) 13668 } 13669 13670 default: 13671 _, _ = key, value 13672 13673 } 13674 } 13675 *v = sv 13676 return nil 13677} 13678 13679func awsRestjson1_deserializeDocumentAwsElbLoadBalancerInstance(v **types.AwsElbLoadBalancerInstance, value interface{}) error { 13680 if v == nil { 13681 return fmt.Errorf("unexpected nil of type %T", v) 13682 } 13683 if value == nil { 13684 return nil 13685 } 13686 13687 shape, ok := value.(map[string]interface{}) 13688 if !ok { 13689 return fmt.Errorf("unexpected JSON type %v", value) 13690 } 13691 13692 var sv *types.AwsElbLoadBalancerInstance 13693 if *v == nil { 13694 sv = &types.AwsElbLoadBalancerInstance{} 13695 } else { 13696 sv = *v 13697 } 13698 13699 for key, value := range shape { 13700 switch key { 13701 case "InstanceId": 13702 if value != nil { 13703 jtv, ok := value.(string) 13704 if !ok { 13705 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 13706 } 13707 sv.InstanceId = ptr.String(jtv) 13708 } 13709 13710 default: 13711 _, _ = key, value 13712 13713 } 13714 } 13715 *v = sv 13716 return nil 13717} 13718 13719func awsRestjson1_deserializeDocumentAwsElbLoadBalancerInstances(v *[]types.AwsElbLoadBalancerInstance, value interface{}) error { 13720 if v == nil { 13721 return fmt.Errorf("unexpected nil of type %T", v) 13722 } 13723 if value == nil { 13724 return nil 13725 } 13726 13727 shape, ok := value.([]interface{}) 13728 if !ok { 13729 return fmt.Errorf("unexpected JSON type %v", value) 13730 } 13731 13732 var cv []types.AwsElbLoadBalancerInstance 13733 if *v == nil { 13734 cv = []types.AwsElbLoadBalancerInstance{} 13735 } else { 13736 cv = *v 13737 } 13738 13739 for _, value := range shape { 13740 var col types.AwsElbLoadBalancerInstance 13741 destAddr := &col 13742 if err := awsRestjson1_deserializeDocumentAwsElbLoadBalancerInstance(&destAddr, value); err != nil { 13743 return err 13744 } 13745 col = *destAddr 13746 cv = append(cv, col) 13747 13748 } 13749 *v = cv 13750 return nil 13751} 13752 13753func awsRestjson1_deserializeDocumentAwsElbLoadBalancerListener(v **types.AwsElbLoadBalancerListener, value interface{}) error { 13754 if v == nil { 13755 return fmt.Errorf("unexpected nil of type %T", v) 13756 } 13757 if value == nil { 13758 return nil 13759 } 13760 13761 shape, ok := value.(map[string]interface{}) 13762 if !ok { 13763 return fmt.Errorf("unexpected JSON type %v", value) 13764 } 13765 13766 var sv *types.AwsElbLoadBalancerListener 13767 if *v == nil { 13768 sv = &types.AwsElbLoadBalancerListener{} 13769 } else { 13770 sv = *v 13771 } 13772 13773 for key, value := range shape { 13774 switch key { 13775 case "InstancePort": 13776 if value != nil { 13777 jtv, ok := value.(json.Number) 13778 if !ok { 13779 return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) 13780 } 13781 i64, err := jtv.Int64() 13782 if err != nil { 13783 return err 13784 } 13785 sv.InstancePort = int32(i64) 13786 } 13787 13788 case "InstanceProtocol": 13789 if value != nil { 13790 jtv, ok := value.(string) 13791 if !ok { 13792 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 13793 } 13794 sv.InstanceProtocol = ptr.String(jtv) 13795 } 13796 13797 case "LoadBalancerPort": 13798 if value != nil { 13799 jtv, ok := value.(json.Number) 13800 if !ok { 13801 return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) 13802 } 13803 i64, err := jtv.Int64() 13804 if err != nil { 13805 return err 13806 } 13807 sv.LoadBalancerPort = int32(i64) 13808 } 13809 13810 case "Protocol": 13811 if value != nil { 13812 jtv, ok := value.(string) 13813 if !ok { 13814 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 13815 } 13816 sv.Protocol = ptr.String(jtv) 13817 } 13818 13819 case "SslCertificateId": 13820 if value != nil { 13821 jtv, ok := value.(string) 13822 if !ok { 13823 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 13824 } 13825 sv.SslCertificateId = ptr.String(jtv) 13826 } 13827 13828 default: 13829 _, _ = key, value 13830 13831 } 13832 } 13833 *v = sv 13834 return nil 13835} 13836 13837func awsRestjson1_deserializeDocumentAwsElbLoadBalancerListenerDescription(v **types.AwsElbLoadBalancerListenerDescription, value interface{}) error { 13838 if v == nil { 13839 return fmt.Errorf("unexpected nil of type %T", v) 13840 } 13841 if value == nil { 13842 return nil 13843 } 13844 13845 shape, ok := value.(map[string]interface{}) 13846 if !ok { 13847 return fmt.Errorf("unexpected JSON type %v", value) 13848 } 13849 13850 var sv *types.AwsElbLoadBalancerListenerDescription 13851 if *v == nil { 13852 sv = &types.AwsElbLoadBalancerListenerDescription{} 13853 } else { 13854 sv = *v 13855 } 13856 13857 for key, value := range shape { 13858 switch key { 13859 case "Listener": 13860 if err := awsRestjson1_deserializeDocumentAwsElbLoadBalancerListener(&sv.Listener, value); err != nil { 13861 return err 13862 } 13863 13864 case "PolicyNames": 13865 if err := awsRestjson1_deserializeDocumentStringList(&sv.PolicyNames, value); err != nil { 13866 return err 13867 } 13868 13869 default: 13870 _, _ = key, value 13871 13872 } 13873 } 13874 *v = sv 13875 return nil 13876} 13877 13878func awsRestjson1_deserializeDocumentAwsElbLoadBalancerListenerDescriptions(v *[]types.AwsElbLoadBalancerListenerDescription, value interface{}) error { 13879 if v == nil { 13880 return fmt.Errorf("unexpected nil of type %T", v) 13881 } 13882 if value == nil { 13883 return nil 13884 } 13885 13886 shape, ok := value.([]interface{}) 13887 if !ok { 13888 return fmt.Errorf("unexpected JSON type %v", value) 13889 } 13890 13891 var cv []types.AwsElbLoadBalancerListenerDescription 13892 if *v == nil { 13893 cv = []types.AwsElbLoadBalancerListenerDescription{} 13894 } else { 13895 cv = *v 13896 } 13897 13898 for _, value := range shape { 13899 var col types.AwsElbLoadBalancerListenerDescription 13900 destAddr := &col 13901 if err := awsRestjson1_deserializeDocumentAwsElbLoadBalancerListenerDescription(&destAddr, value); err != nil { 13902 return err 13903 } 13904 col = *destAddr 13905 cv = append(cv, col) 13906 13907 } 13908 *v = cv 13909 return nil 13910} 13911 13912func awsRestjson1_deserializeDocumentAwsElbLoadBalancerPolicies(v **types.AwsElbLoadBalancerPolicies, value interface{}) error { 13913 if v == nil { 13914 return fmt.Errorf("unexpected nil of type %T", v) 13915 } 13916 if value == nil { 13917 return nil 13918 } 13919 13920 shape, ok := value.(map[string]interface{}) 13921 if !ok { 13922 return fmt.Errorf("unexpected JSON type %v", value) 13923 } 13924 13925 var sv *types.AwsElbLoadBalancerPolicies 13926 if *v == nil { 13927 sv = &types.AwsElbLoadBalancerPolicies{} 13928 } else { 13929 sv = *v 13930 } 13931 13932 for key, value := range shape { 13933 switch key { 13934 case "AppCookieStickinessPolicies": 13935 if err := awsRestjson1_deserializeDocumentAwsElbAppCookieStickinessPolicies(&sv.AppCookieStickinessPolicies, value); err != nil { 13936 return err 13937 } 13938 13939 case "LbCookieStickinessPolicies": 13940 if err := awsRestjson1_deserializeDocumentAwsElbLbCookieStickinessPolicies(&sv.LbCookieStickinessPolicies, value); err != nil { 13941 return err 13942 } 13943 13944 case "OtherPolicies": 13945 if err := awsRestjson1_deserializeDocumentStringList(&sv.OtherPolicies, value); err != nil { 13946 return err 13947 } 13948 13949 default: 13950 _, _ = key, value 13951 13952 } 13953 } 13954 *v = sv 13955 return nil 13956} 13957 13958func awsRestjson1_deserializeDocumentAwsElbLoadBalancerSourceSecurityGroup(v **types.AwsElbLoadBalancerSourceSecurityGroup, value interface{}) error { 13959 if v == nil { 13960 return fmt.Errorf("unexpected nil of type %T", v) 13961 } 13962 if value == nil { 13963 return nil 13964 } 13965 13966 shape, ok := value.(map[string]interface{}) 13967 if !ok { 13968 return fmt.Errorf("unexpected JSON type %v", value) 13969 } 13970 13971 var sv *types.AwsElbLoadBalancerSourceSecurityGroup 13972 if *v == nil { 13973 sv = &types.AwsElbLoadBalancerSourceSecurityGroup{} 13974 } else { 13975 sv = *v 13976 } 13977 13978 for key, value := range shape { 13979 switch key { 13980 case "GroupName": 13981 if value != nil { 13982 jtv, ok := value.(string) 13983 if !ok { 13984 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 13985 } 13986 sv.GroupName = ptr.String(jtv) 13987 } 13988 13989 case "OwnerAlias": 13990 if value != nil { 13991 jtv, ok := value.(string) 13992 if !ok { 13993 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 13994 } 13995 sv.OwnerAlias = ptr.String(jtv) 13996 } 13997 13998 default: 13999 _, _ = key, value 14000 14001 } 14002 } 14003 *v = sv 14004 return nil 14005} 14006 14007func awsRestjson1_deserializeDocumentAwsElbv2LoadBalancerDetails(v **types.AwsElbv2LoadBalancerDetails, value interface{}) error { 14008 if v == nil { 14009 return fmt.Errorf("unexpected nil of type %T", v) 14010 } 14011 if value == nil { 14012 return nil 14013 } 14014 14015 shape, ok := value.(map[string]interface{}) 14016 if !ok { 14017 return fmt.Errorf("unexpected JSON type %v", value) 14018 } 14019 14020 var sv *types.AwsElbv2LoadBalancerDetails 14021 if *v == nil { 14022 sv = &types.AwsElbv2LoadBalancerDetails{} 14023 } else { 14024 sv = *v 14025 } 14026 14027 for key, value := range shape { 14028 switch key { 14029 case "AvailabilityZones": 14030 if err := awsRestjson1_deserializeDocumentAvailabilityZones(&sv.AvailabilityZones, value); err != nil { 14031 return err 14032 } 14033 14034 case "CanonicalHostedZoneId": 14035 if value != nil { 14036 jtv, ok := value.(string) 14037 if !ok { 14038 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 14039 } 14040 sv.CanonicalHostedZoneId = ptr.String(jtv) 14041 } 14042 14043 case "CreatedTime": 14044 if value != nil { 14045 jtv, ok := value.(string) 14046 if !ok { 14047 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 14048 } 14049 sv.CreatedTime = ptr.String(jtv) 14050 } 14051 14052 case "DNSName": 14053 if value != nil { 14054 jtv, ok := value.(string) 14055 if !ok { 14056 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 14057 } 14058 sv.DNSName = ptr.String(jtv) 14059 } 14060 14061 case "IpAddressType": 14062 if value != nil { 14063 jtv, ok := value.(string) 14064 if !ok { 14065 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 14066 } 14067 sv.IpAddressType = ptr.String(jtv) 14068 } 14069 14070 case "Scheme": 14071 if value != nil { 14072 jtv, ok := value.(string) 14073 if !ok { 14074 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 14075 } 14076 sv.Scheme = ptr.String(jtv) 14077 } 14078 14079 case "SecurityGroups": 14080 if err := awsRestjson1_deserializeDocumentSecurityGroups(&sv.SecurityGroups, value); err != nil { 14081 return err 14082 } 14083 14084 case "State": 14085 if err := awsRestjson1_deserializeDocumentLoadBalancerState(&sv.State, value); err != nil { 14086 return err 14087 } 14088 14089 case "Type": 14090 if value != nil { 14091 jtv, ok := value.(string) 14092 if !ok { 14093 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 14094 } 14095 sv.Type = ptr.String(jtv) 14096 } 14097 14098 case "VpcId": 14099 if value != nil { 14100 jtv, ok := value.(string) 14101 if !ok { 14102 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 14103 } 14104 sv.VpcId = ptr.String(jtv) 14105 } 14106 14107 default: 14108 _, _ = key, value 14109 14110 } 14111 } 14112 *v = sv 14113 return nil 14114} 14115 14116func awsRestjson1_deserializeDocumentAwsIamAccessKeyDetails(v **types.AwsIamAccessKeyDetails, value interface{}) error { 14117 if v == nil { 14118 return fmt.Errorf("unexpected nil of type %T", v) 14119 } 14120 if value == nil { 14121 return nil 14122 } 14123 14124 shape, ok := value.(map[string]interface{}) 14125 if !ok { 14126 return fmt.Errorf("unexpected JSON type %v", value) 14127 } 14128 14129 var sv *types.AwsIamAccessKeyDetails 14130 if *v == nil { 14131 sv = &types.AwsIamAccessKeyDetails{} 14132 } else { 14133 sv = *v 14134 } 14135 14136 for key, value := range shape { 14137 switch key { 14138 case "AccessKeyId": 14139 if value != nil { 14140 jtv, ok := value.(string) 14141 if !ok { 14142 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 14143 } 14144 sv.AccessKeyId = ptr.String(jtv) 14145 } 14146 14147 case "AccountId": 14148 if value != nil { 14149 jtv, ok := value.(string) 14150 if !ok { 14151 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 14152 } 14153 sv.AccountId = ptr.String(jtv) 14154 } 14155 14156 case "CreatedAt": 14157 if value != nil { 14158 jtv, ok := value.(string) 14159 if !ok { 14160 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 14161 } 14162 sv.CreatedAt = ptr.String(jtv) 14163 } 14164 14165 case "PrincipalId": 14166 if value != nil { 14167 jtv, ok := value.(string) 14168 if !ok { 14169 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 14170 } 14171 sv.PrincipalId = ptr.String(jtv) 14172 } 14173 14174 case "PrincipalName": 14175 if value != nil { 14176 jtv, ok := value.(string) 14177 if !ok { 14178 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 14179 } 14180 sv.PrincipalName = ptr.String(jtv) 14181 } 14182 14183 case "PrincipalType": 14184 if value != nil { 14185 jtv, ok := value.(string) 14186 if !ok { 14187 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 14188 } 14189 sv.PrincipalType = ptr.String(jtv) 14190 } 14191 14192 case "SessionContext": 14193 if err := awsRestjson1_deserializeDocumentAwsIamAccessKeySessionContext(&sv.SessionContext, value); err != nil { 14194 return err 14195 } 14196 14197 case "Status": 14198 if value != nil { 14199 jtv, ok := value.(string) 14200 if !ok { 14201 return fmt.Errorf("expected AwsIamAccessKeyStatus to be of type string, got %T instead", value) 14202 } 14203 sv.Status = types.AwsIamAccessKeyStatus(jtv) 14204 } 14205 14206 case "UserName": 14207 if value != nil { 14208 jtv, ok := value.(string) 14209 if !ok { 14210 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 14211 } 14212 sv.UserName = ptr.String(jtv) 14213 } 14214 14215 default: 14216 _, _ = key, value 14217 14218 } 14219 } 14220 *v = sv 14221 return nil 14222} 14223 14224func awsRestjson1_deserializeDocumentAwsIamAccessKeySessionContext(v **types.AwsIamAccessKeySessionContext, value interface{}) error { 14225 if v == nil { 14226 return fmt.Errorf("unexpected nil of type %T", v) 14227 } 14228 if value == nil { 14229 return nil 14230 } 14231 14232 shape, ok := value.(map[string]interface{}) 14233 if !ok { 14234 return fmt.Errorf("unexpected JSON type %v", value) 14235 } 14236 14237 var sv *types.AwsIamAccessKeySessionContext 14238 if *v == nil { 14239 sv = &types.AwsIamAccessKeySessionContext{} 14240 } else { 14241 sv = *v 14242 } 14243 14244 for key, value := range shape { 14245 switch key { 14246 case "Attributes": 14247 if err := awsRestjson1_deserializeDocumentAwsIamAccessKeySessionContextAttributes(&sv.Attributes, value); err != nil { 14248 return err 14249 } 14250 14251 case "SessionIssuer": 14252 if err := awsRestjson1_deserializeDocumentAwsIamAccessKeySessionContextSessionIssuer(&sv.SessionIssuer, value); err != nil { 14253 return err 14254 } 14255 14256 default: 14257 _, _ = key, value 14258 14259 } 14260 } 14261 *v = sv 14262 return nil 14263} 14264 14265func awsRestjson1_deserializeDocumentAwsIamAccessKeySessionContextAttributes(v **types.AwsIamAccessKeySessionContextAttributes, value interface{}) error { 14266 if v == nil { 14267 return fmt.Errorf("unexpected nil of type %T", v) 14268 } 14269 if value == nil { 14270 return nil 14271 } 14272 14273 shape, ok := value.(map[string]interface{}) 14274 if !ok { 14275 return fmt.Errorf("unexpected JSON type %v", value) 14276 } 14277 14278 var sv *types.AwsIamAccessKeySessionContextAttributes 14279 if *v == nil { 14280 sv = &types.AwsIamAccessKeySessionContextAttributes{} 14281 } else { 14282 sv = *v 14283 } 14284 14285 for key, value := range shape { 14286 switch key { 14287 case "CreationDate": 14288 if value != nil { 14289 jtv, ok := value.(string) 14290 if !ok { 14291 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 14292 } 14293 sv.CreationDate = ptr.String(jtv) 14294 } 14295 14296 case "MfaAuthenticated": 14297 if value != nil { 14298 jtv, ok := value.(bool) 14299 if !ok { 14300 return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) 14301 } 14302 sv.MfaAuthenticated = jtv 14303 } 14304 14305 default: 14306 _, _ = key, value 14307 14308 } 14309 } 14310 *v = sv 14311 return nil 14312} 14313 14314func awsRestjson1_deserializeDocumentAwsIamAccessKeySessionContextSessionIssuer(v **types.AwsIamAccessKeySessionContextSessionIssuer, value interface{}) error { 14315 if v == nil { 14316 return fmt.Errorf("unexpected nil of type %T", v) 14317 } 14318 if value == nil { 14319 return nil 14320 } 14321 14322 shape, ok := value.(map[string]interface{}) 14323 if !ok { 14324 return fmt.Errorf("unexpected JSON type %v", value) 14325 } 14326 14327 var sv *types.AwsIamAccessKeySessionContextSessionIssuer 14328 if *v == nil { 14329 sv = &types.AwsIamAccessKeySessionContextSessionIssuer{} 14330 } else { 14331 sv = *v 14332 } 14333 14334 for key, value := range shape { 14335 switch key { 14336 case "AccountId": 14337 if value != nil { 14338 jtv, ok := value.(string) 14339 if !ok { 14340 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 14341 } 14342 sv.AccountId = ptr.String(jtv) 14343 } 14344 14345 case "Arn": 14346 if value != nil { 14347 jtv, ok := value.(string) 14348 if !ok { 14349 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 14350 } 14351 sv.Arn = ptr.String(jtv) 14352 } 14353 14354 case "PrincipalId": 14355 if value != nil { 14356 jtv, ok := value.(string) 14357 if !ok { 14358 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 14359 } 14360 sv.PrincipalId = ptr.String(jtv) 14361 } 14362 14363 case "Type": 14364 if value != nil { 14365 jtv, ok := value.(string) 14366 if !ok { 14367 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 14368 } 14369 sv.Type = ptr.String(jtv) 14370 } 14371 14372 case "UserName": 14373 if value != nil { 14374 jtv, ok := value.(string) 14375 if !ok { 14376 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 14377 } 14378 sv.UserName = ptr.String(jtv) 14379 } 14380 14381 default: 14382 _, _ = key, value 14383 14384 } 14385 } 14386 *v = sv 14387 return nil 14388} 14389 14390func awsRestjson1_deserializeDocumentAwsIamAttachedManagedPolicy(v **types.AwsIamAttachedManagedPolicy, value interface{}) error { 14391 if v == nil { 14392 return fmt.Errorf("unexpected nil of type %T", v) 14393 } 14394 if value == nil { 14395 return nil 14396 } 14397 14398 shape, ok := value.(map[string]interface{}) 14399 if !ok { 14400 return fmt.Errorf("unexpected JSON type %v", value) 14401 } 14402 14403 var sv *types.AwsIamAttachedManagedPolicy 14404 if *v == nil { 14405 sv = &types.AwsIamAttachedManagedPolicy{} 14406 } else { 14407 sv = *v 14408 } 14409 14410 for key, value := range shape { 14411 switch key { 14412 case "PolicyArn": 14413 if value != nil { 14414 jtv, ok := value.(string) 14415 if !ok { 14416 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 14417 } 14418 sv.PolicyArn = ptr.String(jtv) 14419 } 14420 14421 case "PolicyName": 14422 if value != nil { 14423 jtv, ok := value.(string) 14424 if !ok { 14425 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 14426 } 14427 sv.PolicyName = ptr.String(jtv) 14428 } 14429 14430 default: 14431 _, _ = key, value 14432 14433 } 14434 } 14435 *v = sv 14436 return nil 14437} 14438 14439func awsRestjson1_deserializeDocumentAwsIamAttachedManagedPolicyList(v *[]types.AwsIamAttachedManagedPolicy, value interface{}) error { 14440 if v == nil { 14441 return fmt.Errorf("unexpected nil of type %T", v) 14442 } 14443 if value == nil { 14444 return nil 14445 } 14446 14447 shape, ok := value.([]interface{}) 14448 if !ok { 14449 return fmt.Errorf("unexpected JSON type %v", value) 14450 } 14451 14452 var cv []types.AwsIamAttachedManagedPolicy 14453 if *v == nil { 14454 cv = []types.AwsIamAttachedManagedPolicy{} 14455 } else { 14456 cv = *v 14457 } 14458 14459 for _, value := range shape { 14460 var col types.AwsIamAttachedManagedPolicy 14461 destAddr := &col 14462 if err := awsRestjson1_deserializeDocumentAwsIamAttachedManagedPolicy(&destAddr, value); err != nil { 14463 return err 14464 } 14465 col = *destAddr 14466 cv = append(cv, col) 14467 14468 } 14469 *v = cv 14470 return nil 14471} 14472 14473func awsRestjson1_deserializeDocumentAwsIamGroupDetails(v **types.AwsIamGroupDetails, value interface{}) error { 14474 if v == nil { 14475 return fmt.Errorf("unexpected nil of type %T", v) 14476 } 14477 if value == nil { 14478 return nil 14479 } 14480 14481 shape, ok := value.(map[string]interface{}) 14482 if !ok { 14483 return fmt.Errorf("unexpected JSON type %v", value) 14484 } 14485 14486 var sv *types.AwsIamGroupDetails 14487 if *v == nil { 14488 sv = &types.AwsIamGroupDetails{} 14489 } else { 14490 sv = *v 14491 } 14492 14493 for key, value := range shape { 14494 switch key { 14495 case "AttachedManagedPolicies": 14496 if err := awsRestjson1_deserializeDocumentAwsIamAttachedManagedPolicyList(&sv.AttachedManagedPolicies, value); err != nil { 14497 return err 14498 } 14499 14500 case "CreateDate": 14501 if value != nil { 14502 jtv, ok := value.(string) 14503 if !ok { 14504 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 14505 } 14506 sv.CreateDate = ptr.String(jtv) 14507 } 14508 14509 case "GroupId": 14510 if value != nil { 14511 jtv, ok := value.(string) 14512 if !ok { 14513 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 14514 } 14515 sv.GroupId = ptr.String(jtv) 14516 } 14517 14518 case "GroupName": 14519 if value != nil { 14520 jtv, ok := value.(string) 14521 if !ok { 14522 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 14523 } 14524 sv.GroupName = ptr.String(jtv) 14525 } 14526 14527 case "GroupPolicyList": 14528 if err := awsRestjson1_deserializeDocumentAwsIamGroupPolicyList(&sv.GroupPolicyList, value); err != nil { 14529 return err 14530 } 14531 14532 case "Path": 14533 if value != nil { 14534 jtv, ok := value.(string) 14535 if !ok { 14536 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 14537 } 14538 sv.Path = ptr.String(jtv) 14539 } 14540 14541 default: 14542 _, _ = key, value 14543 14544 } 14545 } 14546 *v = sv 14547 return nil 14548} 14549 14550func awsRestjson1_deserializeDocumentAwsIamGroupPolicy(v **types.AwsIamGroupPolicy, value interface{}) error { 14551 if v == nil { 14552 return fmt.Errorf("unexpected nil of type %T", v) 14553 } 14554 if value == nil { 14555 return nil 14556 } 14557 14558 shape, ok := value.(map[string]interface{}) 14559 if !ok { 14560 return fmt.Errorf("unexpected JSON type %v", value) 14561 } 14562 14563 var sv *types.AwsIamGroupPolicy 14564 if *v == nil { 14565 sv = &types.AwsIamGroupPolicy{} 14566 } else { 14567 sv = *v 14568 } 14569 14570 for key, value := range shape { 14571 switch key { 14572 case "PolicyName": 14573 if value != nil { 14574 jtv, ok := value.(string) 14575 if !ok { 14576 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 14577 } 14578 sv.PolicyName = ptr.String(jtv) 14579 } 14580 14581 default: 14582 _, _ = key, value 14583 14584 } 14585 } 14586 *v = sv 14587 return nil 14588} 14589 14590func awsRestjson1_deserializeDocumentAwsIamGroupPolicyList(v *[]types.AwsIamGroupPolicy, value interface{}) error { 14591 if v == nil { 14592 return fmt.Errorf("unexpected nil of type %T", v) 14593 } 14594 if value == nil { 14595 return nil 14596 } 14597 14598 shape, ok := value.([]interface{}) 14599 if !ok { 14600 return fmt.Errorf("unexpected JSON type %v", value) 14601 } 14602 14603 var cv []types.AwsIamGroupPolicy 14604 if *v == nil { 14605 cv = []types.AwsIamGroupPolicy{} 14606 } else { 14607 cv = *v 14608 } 14609 14610 for _, value := range shape { 14611 var col types.AwsIamGroupPolicy 14612 destAddr := &col 14613 if err := awsRestjson1_deserializeDocumentAwsIamGroupPolicy(&destAddr, value); err != nil { 14614 return err 14615 } 14616 col = *destAddr 14617 cv = append(cv, col) 14618 14619 } 14620 *v = cv 14621 return nil 14622} 14623 14624func awsRestjson1_deserializeDocumentAwsIamInstanceProfile(v **types.AwsIamInstanceProfile, value interface{}) error { 14625 if v == nil { 14626 return fmt.Errorf("unexpected nil of type %T", v) 14627 } 14628 if value == nil { 14629 return nil 14630 } 14631 14632 shape, ok := value.(map[string]interface{}) 14633 if !ok { 14634 return fmt.Errorf("unexpected JSON type %v", value) 14635 } 14636 14637 var sv *types.AwsIamInstanceProfile 14638 if *v == nil { 14639 sv = &types.AwsIamInstanceProfile{} 14640 } else { 14641 sv = *v 14642 } 14643 14644 for key, value := range shape { 14645 switch key { 14646 case "Arn": 14647 if value != nil { 14648 jtv, ok := value.(string) 14649 if !ok { 14650 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 14651 } 14652 sv.Arn = ptr.String(jtv) 14653 } 14654 14655 case "CreateDate": 14656 if value != nil { 14657 jtv, ok := value.(string) 14658 if !ok { 14659 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 14660 } 14661 sv.CreateDate = ptr.String(jtv) 14662 } 14663 14664 case "InstanceProfileId": 14665 if value != nil { 14666 jtv, ok := value.(string) 14667 if !ok { 14668 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 14669 } 14670 sv.InstanceProfileId = ptr.String(jtv) 14671 } 14672 14673 case "InstanceProfileName": 14674 if value != nil { 14675 jtv, ok := value.(string) 14676 if !ok { 14677 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 14678 } 14679 sv.InstanceProfileName = ptr.String(jtv) 14680 } 14681 14682 case "Path": 14683 if value != nil { 14684 jtv, ok := value.(string) 14685 if !ok { 14686 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 14687 } 14688 sv.Path = ptr.String(jtv) 14689 } 14690 14691 case "Roles": 14692 if err := awsRestjson1_deserializeDocumentAwsIamInstanceProfileRoles(&sv.Roles, value); err != nil { 14693 return err 14694 } 14695 14696 default: 14697 _, _ = key, value 14698 14699 } 14700 } 14701 *v = sv 14702 return nil 14703} 14704 14705func awsRestjson1_deserializeDocumentAwsIamInstanceProfileList(v *[]types.AwsIamInstanceProfile, value interface{}) error { 14706 if v == nil { 14707 return fmt.Errorf("unexpected nil of type %T", v) 14708 } 14709 if value == nil { 14710 return nil 14711 } 14712 14713 shape, ok := value.([]interface{}) 14714 if !ok { 14715 return fmt.Errorf("unexpected JSON type %v", value) 14716 } 14717 14718 var cv []types.AwsIamInstanceProfile 14719 if *v == nil { 14720 cv = []types.AwsIamInstanceProfile{} 14721 } else { 14722 cv = *v 14723 } 14724 14725 for _, value := range shape { 14726 var col types.AwsIamInstanceProfile 14727 destAddr := &col 14728 if err := awsRestjson1_deserializeDocumentAwsIamInstanceProfile(&destAddr, value); err != nil { 14729 return err 14730 } 14731 col = *destAddr 14732 cv = append(cv, col) 14733 14734 } 14735 *v = cv 14736 return nil 14737} 14738 14739func awsRestjson1_deserializeDocumentAwsIamInstanceProfileRole(v **types.AwsIamInstanceProfileRole, value interface{}) error { 14740 if v == nil { 14741 return fmt.Errorf("unexpected nil of type %T", v) 14742 } 14743 if value == nil { 14744 return nil 14745 } 14746 14747 shape, ok := value.(map[string]interface{}) 14748 if !ok { 14749 return fmt.Errorf("unexpected JSON type %v", value) 14750 } 14751 14752 var sv *types.AwsIamInstanceProfileRole 14753 if *v == nil { 14754 sv = &types.AwsIamInstanceProfileRole{} 14755 } else { 14756 sv = *v 14757 } 14758 14759 for key, value := range shape { 14760 switch key { 14761 case "Arn": 14762 if value != nil { 14763 jtv, ok := value.(string) 14764 if !ok { 14765 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 14766 } 14767 sv.Arn = ptr.String(jtv) 14768 } 14769 14770 case "AssumeRolePolicyDocument": 14771 if value != nil { 14772 jtv, ok := value.(string) 14773 if !ok { 14774 return fmt.Errorf("expected AwsIamRoleAssumeRolePolicyDocument to be of type string, got %T instead", value) 14775 } 14776 sv.AssumeRolePolicyDocument = ptr.String(jtv) 14777 } 14778 14779 case "CreateDate": 14780 if value != nil { 14781 jtv, ok := value.(string) 14782 if !ok { 14783 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 14784 } 14785 sv.CreateDate = ptr.String(jtv) 14786 } 14787 14788 case "Path": 14789 if value != nil { 14790 jtv, ok := value.(string) 14791 if !ok { 14792 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 14793 } 14794 sv.Path = ptr.String(jtv) 14795 } 14796 14797 case "RoleId": 14798 if value != nil { 14799 jtv, ok := value.(string) 14800 if !ok { 14801 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 14802 } 14803 sv.RoleId = ptr.String(jtv) 14804 } 14805 14806 case "RoleName": 14807 if value != nil { 14808 jtv, ok := value.(string) 14809 if !ok { 14810 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 14811 } 14812 sv.RoleName = ptr.String(jtv) 14813 } 14814 14815 default: 14816 _, _ = key, value 14817 14818 } 14819 } 14820 *v = sv 14821 return nil 14822} 14823 14824func awsRestjson1_deserializeDocumentAwsIamInstanceProfileRoles(v *[]types.AwsIamInstanceProfileRole, value interface{}) error { 14825 if v == nil { 14826 return fmt.Errorf("unexpected nil of type %T", v) 14827 } 14828 if value == nil { 14829 return nil 14830 } 14831 14832 shape, ok := value.([]interface{}) 14833 if !ok { 14834 return fmt.Errorf("unexpected JSON type %v", value) 14835 } 14836 14837 var cv []types.AwsIamInstanceProfileRole 14838 if *v == nil { 14839 cv = []types.AwsIamInstanceProfileRole{} 14840 } else { 14841 cv = *v 14842 } 14843 14844 for _, value := range shape { 14845 var col types.AwsIamInstanceProfileRole 14846 destAddr := &col 14847 if err := awsRestjson1_deserializeDocumentAwsIamInstanceProfileRole(&destAddr, value); err != nil { 14848 return err 14849 } 14850 col = *destAddr 14851 cv = append(cv, col) 14852 14853 } 14854 *v = cv 14855 return nil 14856} 14857 14858func awsRestjson1_deserializeDocumentAwsIamPermissionsBoundary(v **types.AwsIamPermissionsBoundary, value interface{}) error { 14859 if v == nil { 14860 return fmt.Errorf("unexpected nil of type %T", v) 14861 } 14862 if value == nil { 14863 return nil 14864 } 14865 14866 shape, ok := value.(map[string]interface{}) 14867 if !ok { 14868 return fmt.Errorf("unexpected JSON type %v", value) 14869 } 14870 14871 var sv *types.AwsIamPermissionsBoundary 14872 if *v == nil { 14873 sv = &types.AwsIamPermissionsBoundary{} 14874 } else { 14875 sv = *v 14876 } 14877 14878 for key, value := range shape { 14879 switch key { 14880 case "PermissionsBoundaryArn": 14881 if value != nil { 14882 jtv, ok := value.(string) 14883 if !ok { 14884 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 14885 } 14886 sv.PermissionsBoundaryArn = ptr.String(jtv) 14887 } 14888 14889 case "PermissionsBoundaryType": 14890 if value != nil { 14891 jtv, ok := value.(string) 14892 if !ok { 14893 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 14894 } 14895 sv.PermissionsBoundaryType = ptr.String(jtv) 14896 } 14897 14898 default: 14899 _, _ = key, value 14900 14901 } 14902 } 14903 *v = sv 14904 return nil 14905} 14906 14907func awsRestjson1_deserializeDocumentAwsIamPolicyDetails(v **types.AwsIamPolicyDetails, value interface{}) error { 14908 if v == nil { 14909 return fmt.Errorf("unexpected nil of type %T", v) 14910 } 14911 if value == nil { 14912 return nil 14913 } 14914 14915 shape, ok := value.(map[string]interface{}) 14916 if !ok { 14917 return fmt.Errorf("unexpected JSON type %v", value) 14918 } 14919 14920 var sv *types.AwsIamPolicyDetails 14921 if *v == nil { 14922 sv = &types.AwsIamPolicyDetails{} 14923 } else { 14924 sv = *v 14925 } 14926 14927 for key, value := range shape { 14928 switch key { 14929 case "AttachmentCount": 14930 if value != nil { 14931 jtv, ok := value.(json.Number) 14932 if !ok { 14933 return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) 14934 } 14935 i64, err := jtv.Int64() 14936 if err != nil { 14937 return err 14938 } 14939 sv.AttachmentCount = int32(i64) 14940 } 14941 14942 case "CreateDate": 14943 if value != nil { 14944 jtv, ok := value.(string) 14945 if !ok { 14946 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 14947 } 14948 sv.CreateDate = ptr.String(jtv) 14949 } 14950 14951 case "DefaultVersionId": 14952 if value != nil { 14953 jtv, ok := value.(string) 14954 if !ok { 14955 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 14956 } 14957 sv.DefaultVersionId = ptr.String(jtv) 14958 } 14959 14960 case "Description": 14961 if value != nil { 14962 jtv, ok := value.(string) 14963 if !ok { 14964 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 14965 } 14966 sv.Description = ptr.String(jtv) 14967 } 14968 14969 case "IsAttachable": 14970 if value != nil { 14971 jtv, ok := value.(bool) 14972 if !ok { 14973 return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) 14974 } 14975 sv.IsAttachable = jtv 14976 } 14977 14978 case "Path": 14979 if value != nil { 14980 jtv, ok := value.(string) 14981 if !ok { 14982 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 14983 } 14984 sv.Path = ptr.String(jtv) 14985 } 14986 14987 case "PermissionsBoundaryUsageCount": 14988 if value != nil { 14989 jtv, ok := value.(json.Number) 14990 if !ok { 14991 return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) 14992 } 14993 i64, err := jtv.Int64() 14994 if err != nil { 14995 return err 14996 } 14997 sv.PermissionsBoundaryUsageCount = int32(i64) 14998 } 14999 15000 case "PolicyId": 15001 if value != nil { 15002 jtv, ok := value.(string) 15003 if !ok { 15004 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 15005 } 15006 sv.PolicyId = ptr.String(jtv) 15007 } 15008 15009 case "PolicyName": 15010 if value != nil { 15011 jtv, ok := value.(string) 15012 if !ok { 15013 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 15014 } 15015 sv.PolicyName = ptr.String(jtv) 15016 } 15017 15018 case "PolicyVersionList": 15019 if err := awsRestjson1_deserializeDocumentAwsIamPolicyVersionList(&sv.PolicyVersionList, value); err != nil { 15020 return err 15021 } 15022 15023 case "UpdateDate": 15024 if value != nil { 15025 jtv, ok := value.(string) 15026 if !ok { 15027 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 15028 } 15029 sv.UpdateDate = ptr.String(jtv) 15030 } 15031 15032 default: 15033 _, _ = key, value 15034 15035 } 15036 } 15037 *v = sv 15038 return nil 15039} 15040 15041func awsRestjson1_deserializeDocumentAwsIamPolicyVersion(v **types.AwsIamPolicyVersion, value interface{}) error { 15042 if v == nil { 15043 return fmt.Errorf("unexpected nil of type %T", v) 15044 } 15045 if value == nil { 15046 return nil 15047 } 15048 15049 shape, ok := value.(map[string]interface{}) 15050 if !ok { 15051 return fmt.Errorf("unexpected JSON type %v", value) 15052 } 15053 15054 var sv *types.AwsIamPolicyVersion 15055 if *v == nil { 15056 sv = &types.AwsIamPolicyVersion{} 15057 } else { 15058 sv = *v 15059 } 15060 15061 for key, value := range shape { 15062 switch key { 15063 case "CreateDate": 15064 if value != nil { 15065 jtv, ok := value.(string) 15066 if !ok { 15067 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 15068 } 15069 sv.CreateDate = ptr.String(jtv) 15070 } 15071 15072 case "IsDefaultVersion": 15073 if value != nil { 15074 jtv, ok := value.(bool) 15075 if !ok { 15076 return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) 15077 } 15078 sv.IsDefaultVersion = jtv 15079 } 15080 15081 case "VersionId": 15082 if value != nil { 15083 jtv, ok := value.(string) 15084 if !ok { 15085 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 15086 } 15087 sv.VersionId = ptr.String(jtv) 15088 } 15089 15090 default: 15091 _, _ = key, value 15092 15093 } 15094 } 15095 *v = sv 15096 return nil 15097} 15098 15099func awsRestjson1_deserializeDocumentAwsIamPolicyVersionList(v *[]types.AwsIamPolicyVersion, value interface{}) error { 15100 if v == nil { 15101 return fmt.Errorf("unexpected nil of type %T", v) 15102 } 15103 if value == nil { 15104 return nil 15105 } 15106 15107 shape, ok := value.([]interface{}) 15108 if !ok { 15109 return fmt.Errorf("unexpected JSON type %v", value) 15110 } 15111 15112 var cv []types.AwsIamPolicyVersion 15113 if *v == nil { 15114 cv = []types.AwsIamPolicyVersion{} 15115 } else { 15116 cv = *v 15117 } 15118 15119 for _, value := range shape { 15120 var col types.AwsIamPolicyVersion 15121 destAddr := &col 15122 if err := awsRestjson1_deserializeDocumentAwsIamPolicyVersion(&destAddr, value); err != nil { 15123 return err 15124 } 15125 col = *destAddr 15126 cv = append(cv, col) 15127 15128 } 15129 *v = cv 15130 return nil 15131} 15132 15133func awsRestjson1_deserializeDocumentAwsIamRoleDetails(v **types.AwsIamRoleDetails, value interface{}) error { 15134 if v == nil { 15135 return fmt.Errorf("unexpected nil of type %T", v) 15136 } 15137 if value == nil { 15138 return nil 15139 } 15140 15141 shape, ok := value.(map[string]interface{}) 15142 if !ok { 15143 return fmt.Errorf("unexpected JSON type %v", value) 15144 } 15145 15146 var sv *types.AwsIamRoleDetails 15147 if *v == nil { 15148 sv = &types.AwsIamRoleDetails{} 15149 } else { 15150 sv = *v 15151 } 15152 15153 for key, value := range shape { 15154 switch key { 15155 case "AssumeRolePolicyDocument": 15156 if value != nil { 15157 jtv, ok := value.(string) 15158 if !ok { 15159 return fmt.Errorf("expected AwsIamRoleAssumeRolePolicyDocument to be of type string, got %T instead", value) 15160 } 15161 sv.AssumeRolePolicyDocument = ptr.String(jtv) 15162 } 15163 15164 case "AttachedManagedPolicies": 15165 if err := awsRestjson1_deserializeDocumentAwsIamAttachedManagedPolicyList(&sv.AttachedManagedPolicies, value); err != nil { 15166 return err 15167 } 15168 15169 case "CreateDate": 15170 if value != nil { 15171 jtv, ok := value.(string) 15172 if !ok { 15173 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 15174 } 15175 sv.CreateDate = ptr.String(jtv) 15176 } 15177 15178 case "InstanceProfileList": 15179 if err := awsRestjson1_deserializeDocumentAwsIamInstanceProfileList(&sv.InstanceProfileList, value); err != nil { 15180 return err 15181 } 15182 15183 case "MaxSessionDuration": 15184 if value != nil { 15185 jtv, ok := value.(json.Number) 15186 if !ok { 15187 return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) 15188 } 15189 i64, err := jtv.Int64() 15190 if err != nil { 15191 return err 15192 } 15193 sv.MaxSessionDuration = int32(i64) 15194 } 15195 15196 case "Path": 15197 if value != nil { 15198 jtv, ok := value.(string) 15199 if !ok { 15200 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 15201 } 15202 sv.Path = ptr.String(jtv) 15203 } 15204 15205 case "PermissionsBoundary": 15206 if err := awsRestjson1_deserializeDocumentAwsIamPermissionsBoundary(&sv.PermissionsBoundary, value); err != nil { 15207 return err 15208 } 15209 15210 case "RoleId": 15211 if value != nil { 15212 jtv, ok := value.(string) 15213 if !ok { 15214 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 15215 } 15216 sv.RoleId = ptr.String(jtv) 15217 } 15218 15219 case "RoleName": 15220 if value != nil { 15221 jtv, ok := value.(string) 15222 if !ok { 15223 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 15224 } 15225 sv.RoleName = ptr.String(jtv) 15226 } 15227 15228 case "RolePolicyList": 15229 if err := awsRestjson1_deserializeDocumentAwsIamRolePolicyList(&sv.RolePolicyList, value); err != nil { 15230 return err 15231 } 15232 15233 default: 15234 _, _ = key, value 15235 15236 } 15237 } 15238 *v = sv 15239 return nil 15240} 15241 15242func awsRestjson1_deserializeDocumentAwsIamRolePolicy(v **types.AwsIamRolePolicy, value interface{}) error { 15243 if v == nil { 15244 return fmt.Errorf("unexpected nil of type %T", v) 15245 } 15246 if value == nil { 15247 return nil 15248 } 15249 15250 shape, ok := value.(map[string]interface{}) 15251 if !ok { 15252 return fmt.Errorf("unexpected JSON type %v", value) 15253 } 15254 15255 var sv *types.AwsIamRolePolicy 15256 if *v == nil { 15257 sv = &types.AwsIamRolePolicy{} 15258 } else { 15259 sv = *v 15260 } 15261 15262 for key, value := range shape { 15263 switch key { 15264 case "PolicyName": 15265 if value != nil { 15266 jtv, ok := value.(string) 15267 if !ok { 15268 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 15269 } 15270 sv.PolicyName = ptr.String(jtv) 15271 } 15272 15273 default: 15274 _, _ = key, value 15275 15276 } 15277 } 15278 *v = sv 15279 return nil 15280} 15281 15282func awsRestjson1_deserializeDocumentAwsIamRolePolicyList(v *[]types.AwsIamRolePolicy, value interface{}) error { 15283 if v == nil { 15284 return fmt.Errorf("unexpected nil of type %T", v) 15285 } 15286 if value == nil { 15287 return nil 15288 } 15289 15290 shape, ok := value.([]interface{}) 15291 if !ok { 15292 return fmt.Errorf("unexpected JSON type %v", value) 15293 } 15294 15295 var cv []types.AwsIamRolePolicy 15296 if *v == nil { 15297 cv = []types.AwsIamRolePolicy{} 15298 } else { 15299 cv = *v 15300 } 15301 15302 for _, value := range shape { 15303 var col types.AwsIamRolePolicy 15304 destAddr := &col 15305 if err := awsRestjson1_deserializeDocumentAwsIamRolePolicy(&destAddr, value); err != nil { 15306 return err 15307 } 15308 col = *destAddr 15309 cv = append(cv, col) 15310 15311 } 15312 *v = cv 15313 return nil 15314} 15315 15316func awsRestjson1_deserializeDocumentAwsIamUserDetails(v **types.AwsIamUserDetails, 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 *types.AwsIamUserDetails 15330 if *v == nil { 15331 sv = &types.AwsIamUserDetails{} 15332 } else { 15333 sv = *v 15334 } 15335 15336 for key, value := range shape { 15337 switch key { 15338 case "AttachedManagedPolicies": 15339 if err := awsRestjson1_deserializeDocumentAwsIamAttachedManagedPolicyList(&sv.AttachedManagedPolicies, value); err != nil { 15340 return err 15341 } 15342 15343 case "CreateDate": 15344 if value != nil { 15345 jtv, ok := value.(string) 15346 if !ok { 15347 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 15348 } 15349 sv.CreateDate = ptr.String(jtv) 15350 } 15351 15352 case "GroupList": 15353 if err := awsRestjson1_deserializeDocumentStringList(&sv.GroupList, value); err != nil { 15354 return err 15355 } 15356 15357 case "Path": 15358 if value != nil { 15359 jtv, ok := value.(string) 15360 if !ok { 15361 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 15362 } 15363 sv.Path = ptr.String(jtv) 15364 } 15365 15366 case "PermissionsBoundary": 15367 if err := awsRestjson1_deserializeDocumentAwsIamPermissionsBoundary(&sv.PermissionsBoundary, value); err != nil { 15368 return err 15369 } 15370 15371 case "UserId": 15372 if value != nil { 15373 jtv, ok := value.(string) 15374 if !ok { 15375 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 15376 } 15377 sv.UserId = ptr.String(jtv) 15378 } 15379 15380 case "UserName": 15381 if value != nil { 15382 jtv, ok := value.(string) 15383 if !ok { 15384 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 15385 } 15386 sv.UserName = ptr.String(jtv) 15387 } 15388 15389 case "UserPolicyList": 15390 if err := awsRestjson1_deserializeDocumentAwsIamUserPolicyList(&sv.UserPolicyList, value); err != nil { 15391 return err 15392 } 15393 15394 default: 15395 _, _ = key, value 15396 15397 } 15398 } 15399 *v = sv 15400 return nil 15401} 15402 15403func awsRestjson1_deserializeDocumentAwsIamUserPolicy(v **types.AwsIamUserPolicy, value interface{}) error { 15404 if v == nil { 15405 return fmt.Errorf("unexpected nil of type %T", v) 15406 } 15407 if value == nil { 15408 return nil 15409 } 15410 15411 shape, ok := value.(map[string]interface{}) 15412 if !ok { 15413 return fmt.Errorf("unexpected JSON type %v", value) 15414 } 15415 15416 var sv *types.AwsIamUserPolicy 15417 if *v == nil { 15418 sv = &types.AwsIamUserPolicy{} 15419 } else { 15420 sv = *v 15421 } 15422 15423 for key, value := range shape { 15424 switch key { 15425 case "PolicyName": 15426 if value != nil { 15427 jtv, ok := value.(string) 15428 if !ok { 15429 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 15430 } 15431 sv.PolicyName = ptr.String(jtv) 15432 } 15433 15434 default: 15435 _, _ = key, value 15436 15437 } 15438 } 15439 *v = sv 15440 return nil 15441} 15442 15443func awsRestjson1_deserializeDocumentAwsIamUserPolicyList(v *[]types.AwsIamUserPolicy, value interface{}) error { 15444 if v == nil { 15445 return fmt.Errorf("unexpected nil of type %T", v) 15446 } 15447 if value == nil { 15448 return nil 15449 } 15450 15451 shape, ok := value.([]interface{}) 15452 if !ok { 15453 return fmt.Errorf("unexpected JSON type %v", value) 15454 } 15455 15456 var cv []types.AwsIamUserPolicy 15457 if *v == nil { 15458 cv = []types.AwsIamUserPolicy{} 15459 } else { 15460 cv = *v 15461 } 15462 15463 for _, value := range shape { 15464 var col types.AwsIamUserPolicy 15465 destAddr := &col 15466 if err := awsRestjson1_deserializeDocumentAwsIamUserPolicy(&destAddr, value); err != nil { 15467 return err 15468 } 15469 col = *destAddr 15470 cv = append(cv, col) 15471 15472 } 15473 *v = cv 15474 return nil 15475} 15476 15477func awsRestjson1_deserializeDocumentAwsKmsKeyDetails(v **types.AwsKmsKeyDetails, value interface{}) error { 15478 if v == nil { 15479 return fmt.Errorf("unexpected nil of type %T", v) 15480 } 15481 if value == nil { 15482 return nil 15483 } 15484 15485 shape, ok := value.(map[string]interface{}) 15486 if !ok { 15487 return fmt.Errorf("unexpected JSON type %v", value) 15488 } 15489 15490 var sv *types.AwsKmsKeyDetails 15491 if *v == nil { 15492 sv = &types.AwsKmsKeyDetails{} 15493 } else { 15494 sv = *v 15495 } 15496 15497 for key, value := range shape { 15498 switch key { 15499 case "AWSAccountId": 15500 if value != nil { 15501 jtv, ok := value.(string) 15502 if !ok { 15503 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 15504 } 15505 sv.AWSAccountId = ptr.String(jtv) 15506 } 15507 15508 case "CreationDate": 15509 if value != nil { 15510 jtv, ok := value.(json.Number) 15511 if !ok { 15512 return fmt.Errorf("expected Double to be json.Number, got %T instead", value) 15513 } 15514 f64, err := jtv.Float64() 15515 if err != nil { 15516 return err 15517 } 15518 sv.CreationDate = f64 15519 } 15520 15521 case "Description": 15522 if value != nil { 15523 jtv, ok := value.(string) 15524 if !ok { 15525 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 15526 } 15527 sv.Description = ptr.String(jtv) 15528 } 15529 15530 case "KeyId": 15531 if value != nil { 15532 jtv, ok := value.(string) 15533 if !ok { 15534 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 15535 } 15536 sv.KeyId = ptr.String(jtv) 15537 } 15538 15539 case "KeyManager": 15540 if value != nil { 15541 jtv, ok := value.(string) 15542 if !ok { 15543 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 15544 } 15545 sv.KeyManager = ptr.String(jtv) 15546 } 15547 15548 case "KeyState": 15549 if value != nil { 15550 jtv, ok := value.(string) 15551 if !ok { 15552 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 15553 } 15554 sv.KeyState = ptr.String(jtv) 15555 } 15556 15557 case "Origin": 15558 if value != nil { 15559 jtv, ok := value.(string) 15560 if !ok { 15561 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 15562 } 15563 sv.Origin = ptr.String(jtv) 15564 } 15565 15566 default: 15567 _, _ = key, value 15568 15569 } 15570 } 15571 *v = sv 15572 return nil 15573} 15574 15575func awsRestjson1_deserializeDocumentAwsLambdaFunctionCode(v **types.AwsLambdaFunctionCode, value interface{}) error { 15576 if v == nil { 15577 return fmt.Errorf("unexpected nil of type %T", v) 15578 } 15579 if value == nil { 15580 return nil 15581 } 15582 15583 shape, ok := value.(map[string]interface{}) 15584 if !ok { 15585 return fmt.Errorf("unexpected JSON type %v", value) 15586 } 15587 15588 var sv *types.AwsLambdaFunctionCode 15589 if *v == nil { 15590 sv = &types.AwsLambdaFunctionCode{} 15591 } else { 15592 sv = *v 15593 } 15594 15595 for key, value := range shape { 15596 switch key { 15597 case "S3Bucket": 15598 if value != nil { 15599 jtv, ok := value.(string) 15600 if !ok { 15601 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 15602 } 15603 sv.S3Bucket = ptr.String(jtv) 15604 } 15605 15606 case "S3Key": 15607 if value != nil { 15608 jtv, ok := value.(string) 15609 if !ok { 15610 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 15611 } 15612 sv.S3Key = ptr.String(jtv) 15613 } 15614 15615 case "S3ObjectVersion": 15616 if value != nil { 15617 jtv, ok := value.(string) 15618 if !ok { 15619 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 15620 } 15621 sv.S3ObjectVersion = ptr.String(jtv) 15622 } 15623 15624 case "ZipFile": 15625 if value != nil { 15626 jtv, ok := value.(string) 15627 if !ok { 15628 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 15629 } 15630 sv.ZipFile = ptr.String(jtv) 15631 } 15632 15633 default: 15634 _, _ = key, value 15635 15636 } 15637 } 15638 *v = sv 15639 return nil 15640} 15641 15642func awsRestjson1_deserializeDocumentAwsLambdaFunctionDeadLetterConfig(v **types.AwsLambdaFunctionDeadLetterConfig, value interface{}) error { 15643 if v == nil { 15644 return fmt.Errorf("unexpected nil of type %T", v) 15645 } 15646 if value == nil { 15647 return nil 15648 } 15649 15650 shape, ok := value.(map[string]interface{}) 15651 if !ok { 15652 return fmt.Errorf("unexpected JSON type %v", value) 15653 } 15654 15655 var sv *types.AwsLambdaFunctionDeadLetterConfig 15656 if *v == nil { 15657 sv = &types.AwsLambdaFunctionDeadLetterConfig{} 15658 } else { 15659 sv = *v 15660 } 15661 15662 for key, value := range shape { 15663 switch key { 15664 case "TargetArn": 15665 if value != nil { 15666 jtv, ok := value.(string) 15667 if !ok { 15668 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 15669 } 15670 sv.TargetArn = ptr.String(jtv) 15671 } 15672 15673 default: 15674 _, _ = key, value 15675 15676 } 15677 } 15678 *v = sv 15679 return nil 15680} 15681 15682func awsRestjson1_deserializeDocumentAwsLambdaFunctionDetails(v **types.AwsLambdaFunctionDetails, value interface{}) error { 15683 if v == nil { 15684 return fmt.Errorf("unexpected nil of type %T", v) 15685 } 15686 if value == nil { 15687 return nil 15688 } 15689 15690 shape, ok := value.(map[string]interface{}) 15691 if !ok { 15692 return fmt.Errorf("unexpected JSON type %v", value) 15693 } 15694 15695 var sv *types.AwsLambdaFunctionDetails 15696 if *v == nil { 15697 sv = &types.AwsLambdaFunctionDetails{} 15698 } else { 15699 sv = *v 15700 } 15701 15702 for key, value := range shape { 15703 switch key { 15704 case "Code": 15705 if err := awsRestjson1_deserializeDocumentAwsLambdaFunctionCode(&sv.Code, value); err != nil { 15706 return err 15707 } 15708 15709 case "CodeSha256": 15710 if value != nil { 15711 jtv, ok := value.(string) 15712 if !ok { 15713 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 15714 } 15715 sv.CodeSha256 = ptr.String(jtv) 15716 } 15717 15718 case "DeadLetterConfig": 15719 if err := awsRestjson1_deserializeDocumentAwsLambdaFunctionDeadLetterConfig(&sv.DeadLetterConfig, value); err != nil { 15720 return err 15721 } 15722 15723 case "Environment": 15724 if err := awsRestjson1_deserializeDocumentAwsLambdaFunctionEnvironment(&sv.Environment, value); err != nil { 15725 return err 15726 } 15727 15728 case "FunctionName": 15729 if value != nil { 15730 jtv, ok := value.(string) 15731 if !ok { 15732 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 15733 } 15734 sv.FunctionName = ptr.String(jtv) 15735 } 15736 15737 case "Handler": 15738 if value != nil { 15739 jtv, ok := value.(string) 15740 if !ok { 15741 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 15742 } 15743 sv.Handler = ptr.String(jtv) 15744 } 15745 15746 case "KmsKeyArn": 15747 if value != nil { 15748 jtv, ok := value.(string) 15749 if !ok { 15750 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 15751 } 15752 sv.KmsKeyArn = ptr.String(jtv) 15753 } 15754 15755 case "LastModified": 15756 if value != nil { 15757 jtv, ok := value.(string) 15758 if !ok { 15759 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 15760 } 15761 sv.LastModified = ptr.String(jtv) 15762 } 15763 15764 case "Layers": 15765 if err := awsRestjson1_deserializeDocumentAwsLambdaFunctionLayerList(&sv.Layers, value); err != nil { 15766 return err 15767 } 15768 15769 case "MasterArn": 15770 if value != nil { 15771 jtv, ok := value.(string) 15772 if !ok { 15773 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 15774 } 15775 sv.MasterArn = ptr.String(jtv) 15776 } 15777 15778 case "MemorySize": 15779 if value != nil { 15780 jtv, ok := value.(json.Number) 15781 if !ok { 15782 return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) 15783 } 15784 i64, err := jtv.Int64() 15785 if err != nil { 15786 return err 15787 } 15788 sv.MemorySize = int32(i64) 15789 } 15790 15791 case "RevisionId": 15792 if value != nil { 15793 jtv, ok := value.(string) 15794 if !ok { 15795 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 15796 } 15797 sv.RevisionId = ptr.String(jtv) 15798 } 15799 15800 case "Role": 15801 if value != nil { 15802 jtv, ok := value.(string) 15803 if !ok { 15804 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 15805 } 15806 sv.Role = ptr.String(jtv) 15807 } 15808 15809 case "Runtime": 15810 if value != nil { 15811 jtv, ok := value.(string) 15812 if !ok { 15813 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 15814 } 15815 sv.Runtime = ptr.String(jtv) 15816 } 15817 15818 case "Timeout": 15819 if value != nil { 15820 jtv, ok := value.(json.Number) 15821 if !ok { 15822 return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) 15823 } 15824 i64, err := jtv.Int64() 15825 if err != nil { 15826 return err 15827 } 15828 sv.Timeout = int32(i64) 15829 } 15830 15831 case "TracingConfig": 15832 if err := awsRestjson1_deserializeDocumentAwsLambdaFunctionTracingConfig(&sv.TracingConfig, value); err != nil { 15833 return err 15834 } 15835 15836 case "Version": 15837 if value != nil { 15838 jtv, ok := value.(string) 15839 if !ok { 15840 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 15841 } 15842 sv.Version = ptr.String(jtv) 15843 } 15844 15845 case "VpcConfig": 15846 if err := awsRestjson1_deserializeDocumentAwsLambdaFunctionVpcConfig(&sv.VpcConfig, value); err != nil { 15847 return err 15848 } 15849 15850 default: 15851 _, _ = key, value 15852 15853 } 15854 } 15855 *v = sv 15856 return nil 15857} 15858 15859func awsRestjson1_deserializeDocumentAwsLambdaFunctionEnvironment(v **types.AwsLambdaFunctionEnvironment, value interface{}) error { 15860 if v == nil { 15861 return fmt.Errorf("unexpected nil of type %T", v) 15862 } 15863 if value == nil { 15864 return nil 15865 } 15866 15867 shape, ok := value.(map[string]interface{}) 15868 if !ok { 15869 return fmt.Errorf("unexpected JSON type %v", value) 15870 } 15871 15872 var sv *types.AwsLambdaFunctionEnvironment 15873 if *v == nil { 15874 sv = &types.AwsLambdaFunctionEnvironment{} 15875 } else { 15876 sv = *v 15877 } 15878 15879 for key, value := range shape { 15880 switch key { 15881 case "Error": 15882 if err := awsRestjson1_deserializeDocumentAwsLambdaFunctionEnvironmentError(&sv.Error, value); err != nil { 15883 return err 15884 } 15885 15886 case "Variables": 15887 if err := awsRestjson1_deserializeDocumentFieldMap(&sv.Variables, value); err != nil { 15888 return err 15889 } 15890 15891 default: 15892 _, _ = key, value 15893 15894 } 15895 } 15896 *v = sv 15897 return nil 15898} 15899 15900func awsRestjson1_deserializeDocumentAwsLambdaFunctionEnvironmentError(v **types.AwsLambdaFunctionEnvironmentError, value interface{}) error { 15901 if v == nil { 15902 return fmt.Errorf("unexpected nil of type %T", v) 15903 } 15904 if value == nil { 15905 return nil 15906 } 15907 15908 shape, ok := value.(map[string]interface{}) 15909 if !ok { 15910 return fmt.Errorf("unexpected JSON type %v", value) 15911 } 15912 15913 var sv *types.AwsLambdaFunctionEnvironmentError 15914 if *v == nil { 15915 sv = &types.AwsLambdaFunctionEnvironmentError{} 15916 } else { 15917 sv = *v 15918 } 15919 15920 for key, value := range shape { 15921 switch key { 15922 case "ErrorCode": 15923 if value != nil { 15924 jtv, ok := value.(string) 15925 if !ok { 15926 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 15927 } 15928 sv.ErrorCode = ptr.String(jtv) 15929 } 15930 15931 case "Message": 15932 if value != nil { 15933 jtv, ok := value.(string) 15934 if !ok { 15935 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 15936 } 15937 sv.Message = ptr.String(jtv) 15938 } 15939 15940 default: 15941 _, _ = key, value 15942 15943 } 15944 } 15945 *v = sv 15946 return nil 15947} 15948 15949func awsRestjson1_deserializeDocumentAwsLambdaFunctionLayer(v **types.AwsLambdaFunctionLayer, value interface{}) error { 15950 if v == nil { 15951 return fmt.Errorf("unexpected nil of type %T", v) 15952 } 15953 if value == nil { 15954 return nil 15955 } 15956 15957 shape, ok := value.(map[string]interface{}) 15958 if !ok { 15959 return fmt.Errorf("unexpected JSON type %v", value) 15960 } 15961 15962 var sv *types.AwsLambdaFunctionLayer 15963 if *v == nil { 15964 sv = &types.AwsLambdaFunctionLayer{} 15965 } else { 15966 sv = *v 15967 } 15968 15969 for key, value := range shape { 15970 switch key { 15971 case "Arn": 15972 if value != nil { 15973 jtv, ok := value.(string) 15974 if !ok { 15975 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 15976 } 15977 sv.Arn = ptr.String(jtv) 15978 } 15979 15980 case "CodeSize": 15981 if value != nil { 15982 jtv, ok := value.(json.Number) 15983 if !ok { 15984 return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) 15985 } 15986 i64, err := jtv.Int64() 15987 if err != nil { 15988 return err 15989 } 15990 sv.CodeSize = int32(i64) 15991 } 15992 15993 default: 15994 _, _ = key, value 15995 15996 } 15997 } 15998 *v = sv 15999 return nil 16000} 16001 16002func awsRestjson1_deserializeDocumentAwsLambdaFunctionLayerList(v *[]types.AwsLambdaFunctionLayer, value interface{}) error { 16003 if v == nil { 16004 return fmt.Errorf("unexpected nil of type %T", v) 16005 } 16006 if value == nil { 16007 return nil 16008 } 16009 16010 shape, ok := value.([]interface{}) 16011 if !ok { 16012 return fmt.Errorf("unexpected JSON type %v", value) 16013 } 16014 16015 var cv []types.AwsLambdaFunctionLayer 16016 if *v == nil { 16017 cv = []types.AwsLambdaFunctionLayer{} 16018 } else { 16019 cv = *v 16020 } 16021 16022 for _, value := range shape { 16023 var col types.AwsLambdaFunctionLayer 16024 destAddr := &col 16025 if err := awsRestjson1_deserializeDocumentAwsLambdaFunctionLayer(&destAddr, value); err != nil { 16026 return err 16027 } 16028 col = *destAddr 16029 cv = append(cv, col) 16030 16031 } 16032 *v = cv 16033 return nil 16034} 16035 16036func awsRestjson1_deserializeDocumentAwsLambdaFunctionTracingConfig(v **types.AwsLambdaFunctionTracingConfig, value interface{}) error { 16037 if v == nil { 16038 return fmt.Errorf("unexpected nil of type %T", v) 16039 } 16040 if value == nil { 16041 return nil 16042 } 16043 16044 shape, ok := value.(map[string]interface{}) 16045 if !ok { 16046 return fmt.Errorf("unexpected JSON type %v", value) 16047 } 16048 16049 var sv *types.AwsLambdaFunctionTracingConfig 16050 if *v == nil { 16051 sv = &types.AwsLambdaFunctionTracingConfig{} 16052 } else { 16053 sv = *v 16054 } 16055 16056 for key, value := range shape { 16057 switch key { 16058 case "Mode": 16059 if value != nil { 16060 jtv, ok := value.(string) 16061 if !ok { 16062 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 16063 } 16064 sv.Mode = ptr.String(jtv) 16065 } 16066 16067 default: 16068 _, _ = key, value 16069 16070 } 16071 } 16072 *v = sv 16073 return nil 16074} 16075 16076func awsRestjson1_deserializeDocumentAwsLambdaFunctionVpcConfig(v **types.AwsLambdaFunctionVpcConfig, value interface{}) error { 16077 if v == nil { 16078 return fmt.Errorf("unexpected nil of type %T", v) 16079 } 16080 if value == nil { 16081 return nil 16082 } 16083 16084 shape, ok := value.(map[string]interface{}) 16085 if !ok { 16086 return fmt.Errorf("unexpected JSON type %v", value) 16087 } 16088 16089 var sv *types.AwsLambdaFunctionVpcConfig 16090 if *v == nil { 16091 sv = &types.AwsLambdaFunctionVpcConfig{} 16092 } else { 16093 sv = *v 16094 } 16095 16096 for key, value := range shape { 16097 switch key { 16098 case "SecurityGroupIds": 16099 if err := awsRestjson1_deserializeDocumentNonEmptyStringList(&sv.SecurityGroupIds, value); err != nil { 16100 return err 16101 } 16102 16103 case "SubnetIds": 16104 if err := awsRestjson1_deserializeDocumentNonEmptyStringList(&sv.SubnetIds, value); err != nil { 16105 return err 16106 } 16107 16108 case "VpcId": 16109 if value != nil { 16110 jtv, ok := value.(string) 16111 if !ok { 16112 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 16113 } 16114 sv.VpcId = ptr.String(jtv) 16115 } 16116 16117 default: 16118 _, _ = key, value 16119 16120 } 16121 } 16122 *v = sv 16123 return nil 16124} 16125 16126func awsRestjson1_deserializeDocumentAwsLambdaLayerVersionDetails(v **types.AwsLambdaLayerVersionDetails, value interface{}) error { 16127 if v == nil { 16128 return fmt.Errorf("unexpected nil of type %T", v) 16129 } 16130 if value == nil { 16131 return nil 16132 } 16133 16134 shape, ok := value.(map[string]interface{}) 16135 if !ok { 16136 return fmt.Errorf("unexpected JSON type %v", value) 16137 } 16138 16139 var sv *types.AwsLambdaLayerVersionDetails 16140 if *v == nil { 16141 sv = &types.AwsLambdaLayerVersionDetails{} 16142 } else { 16143 sv = *v 16144 } 16145 16146 for key, value := range shape { 16147 switch key { 16148 case "CompatibleRuntimes": 16149 if err := awsRestjson1_deserializeDocumentNonEmptyStringList(&sv.CompatibleRuntimes, value); err != nil { 16150 return err 16151 } 16152 16153 case "CreatedDate": 16154 if value != nil { 16155 jtv, ok := value.(string) 16156 if !ok { 16157 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 16158 } 16159 sv.CreatedDate = ptr.String(jtv) 16160 } 16161 16162 case "Version": 16163 if value != nil { 16164 jtv, ok := value.(json.Number) 16165 if !ok { 16166 return fmt.Errorf("expected AwsLambdaLayerVersionNumber to be json.Number, got %T instead", value) 16167 } 16168 i64, err := jtv.Int64() 16169 if err != nil { 16170 return err 16171 } 16172 sv.Version = i64 16173 } 16174 16175 default: 16176 _, _ = key, value 16177 16178 } 16179 } 16180 *v = sv 16181 return nil 16182} 16183 16184func awsRestjson1_deserializeDocumentAwsRdsDbClusterAssociatedRole(v **types.AwsRdsDbClusterAssociatedRole, value interface{}) error { 16185 if v == nil { 16186 return fmt.Errorf("unexpected nil of type %T", v) 16187 } 16188 if value == nil { 16189 return nil 16190 } 16191 16192 shape, ok := value.(map[string]interface{}) 16193 if !ok { 16194 return fmt.Errorf("unexpected JSON type %v", value) 16195 } 16196 16197 var sv *types.AwsRdsDbClusterAssociatedRole 16198 if *v == nil { 16199 sv = &types.AwsRdsDbClusterAssociatedRole{} 16200 } else { 16201 sv = *v 16202 } 16203 16204 for key, value := range shape { 16205 switch key { 16206 case "RoleArn": 16207 if value != nil { 16208 jtv, ok := value.(string) 16209 if !ok { 16210 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 16211 } 16212 sv.RoleArn = ptr.String(jtv) 16213 } 16214 16215 case "Status": 16216 if value != nil { 16217 jtv, ok := value.(string) 16218 if !ok { 16219 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 16220 } 16221 sv.Status = ptr.String(jtv) 16222 } 16223 16224 default: 16225 _, _ = key, value 16226 16227 } 16228 } 16229 *v = sv 16230 return nil 16231} 16232 16233func awsRestjson1_deserializeDocumentAwsRdsDbClusterAssociatedRoles(v *[]types.AwsRdsDbClusterAssociatedRole, value interface{}) error { 16234 if v == nil { 16235 return fmt.Errorf("unexpected nil of type %T", v) 16236 } 16237 if value == nil { 16238 return nil 16239 } 16240 16241 shape, ok := value.([]interface{}) 16242 if !ok { 16243 return fmt.Errorf("unexpected JSON type %v", value) 16244 } 16245 16246 var cv []types.AwsRdsDbClusterAssociatedRole 16247 if *v == nil { 16248 cv = []types.AwsRdsDbClusterAssociatedRole{} 16249 } else { 16250 cv = *v 16251 } 16252 16253 for _, value := range shape { 16254 var col types.AwsRdsDbClusterAssociatedRole 16255 destAddr := &col 16256 if err := awsRestjson1_deserializeDocumentAwsRdsDbClusterAssociatedRole(&destAddr, value); err != nil { 16257 return err 16258 } 16259 col = *destAddr 16260 cv = append(cv, col) 16261 16262 } 16263 *v = cv 16264 return nil 16265} 16266 16267func awsRestjson1_deserializeDocumentAwsRdsDbClusterDetails(v **types.AwsRdsDbClusterDetails, value interface{}) error { 16268 if v == nil { 16269 return fmt.Errorf("unexpected nil of type %T", v) 16270 } 16271 if value == nil { 16272 return nil 16273 } 16274 16275 shape, ok := value.(map[string]interface{}) 16276 if !ok { 16277 return fmt.Errorf("unexpected JSON type %v", value) 16278 } 16279 16280 var sv *types.AwsRdsDbClusterDetails 16281 if *v == nil { 16282 sv = &types.AwsRdsDbClusterDetails{} 16283 } else { 16284 sv = *v 16285 } 16286 16287 for key, value := range shape { 16288 switch key { 16289 case "ActivityStreamStatus": 16290 if value != nil { 16291 jtv, ok := value.(string) 16292 if !ok { 16293 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 16294 } 16295 sv.ActivityStreamStatus = ptr.String(jtv) 16296 } 16297 16298 case "AllocatedStorage": 16299 if value != nil { 16300 jtv, ok := value.(json.Number) 16301 if !ok { 16302 return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) 16303 } 16304 i64, err := jtv.Int64() 16305 if err != nil { 16306 return err 16307 } 16308 sv.AllocatedStorage = int32(i64) 16309 } 16310 16311 case "AssociatedRoles": 16312 if err := awsRestjson1_deserializeDocumentAwsRdsDbClusterAssociatedRoles(&sv.AssociatedRoles, value); err != nil { 16313 return err 16314 } 16315 16316 case "AvailabilityZones": 16317 if err := awsRestjson1_deserializeDocumentStringList(&sv.AvailabilityZones, value); err != nil { 16318 return err 16319 } 16320 16321 case "BackupRetentionPeriod": 16322 if value != nil { 16323 jtv, ok := value.(json.Number) 16324 if !ok { 16325 return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) 16326 } 16327 i64, err := jtv.Int64() 16328 if err != nil { 16329 return err 16330 } 16331 sv.BackupRetentionPeriod = int32(i64) 16332 } 16333 16334 case "ClusterCreateTime": 16335 if value != nil { 16336 jtv, ok := value.(string) 16337 if !ok { 16338 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 16339 } 16340 sv.ClusterCreateTime = ptr.String(jtv) 16341 } 16342 16343 case "CopyTagsToSnapshot": 16344 if value != nil { 16345 jtv, ok := value.(bool) 16346 if !ok { 16347 return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) 16348 } 16349 sv.CopyTagsToSnapshot = jtv 16350 } 16351 16352 case "CrossAccountClone": 16353 if value != nil { 16354 jtv, ok := value.(bool) 16355 if !ok { 16356 return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) 16357 } 16358 sv.CrossAccountClone = jtv 16359 } 16360 16361 case "CustomEndpoints": 16362 if err := awsRestjson1_deserializeDocumentStringList(&sv.CustomEndpoints, value); err != nil { 16363 return err 16364 } 16365 16366 case "DatabaseName": 16367 if value != nil { 16368 jtv, ok := value.(string) 16369 if !ok { 16370 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 16371 } 16372 sv.DatabaseName = ptr.String(jtv) 16373 } 16374 16375 case "DbClusterIdentifier": 16376 if value != nil { 16377 jtv, ok := value.(string) 16378 if !ok { 16379 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 16380 } 16381 sv.DbClusterIdentifier = ptr.String(jtv) 16382 } 16383 16384 case "DbClusterMembers": 16385 if err := awsRestjson1_deserializeDocumentAwsRdsDbClusterMembers(&sv.DbClusterMembers, value); err != nil { 16386 return err 16387 } 16388 16389 case "DbClusterOptionGroupMemberships": 16390 if err := awsRestjson1_deserializeDocumentAwsRdsDbClusterOptionGroupMemberships(&sv.DbClusterOptionGroupMemberships, value); err != nil { 16391 return err 16392 } 16393 16394 case "DbClusterParameterGroup": 16395 if value != nil { 16396 jtv, ok := value.(string) 16397 if !ok { 16398 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 16399 } 16400 sv.DbClusterParameterGroup = ptr.String(jtv) 16401 } 16402 16403 case "DbClusterResourceId": 16404 if value != nil { 16405 jtv, ok := value.(string) 16406 if !ok { 16407 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 16408 } 16409 sv.DbClusterResourceId = ptr.String(jtv) 16410 } 16411 16412 case "DbSubnetGroup": 16413 if value != nil { 16414 jtv, ok := value.(string) 16415 if !ok { 16416 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 16417 } 16418 sv.DbSubnetGroup = ptr.String(jtv) 16419 } 16420 16421 case "DeletionProtection": 16422 if value != nil { 16423 jtv, ok := value.(bool) 16424 if !ok { 16425 return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) 16426 } 16427 sv.DeletionProtection = jtv 16428 } 16429 16430 case "DomainMemberships": 16431 if err := awsRestjson1_deserializeDocumentAwsRdsDbDomainMemberships(&sv.DomainMemberships, value); err != nil { 16432 return err 16433 } 16434 16435 case "EnabledCloudWatchLogsExports": 16436 if err := awsRestjson1_deserializeDocumentStringList(&sv.EnabledCloudWatchLogsExports, value); err != nil { 16437 return err 16438 } 16439 16440 case "Endpoint": 16441 if value != nil { 16442 jtv, ok := value.(string) 16443 if !ok { 16444 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 16445 } 16446 sv.Endpoint = ptr.String(jtv) 16447 } 16448 16449 case "Engine": 16450 if value != nil { 16451 jtv, ok := value.(string) 16452 if !ok { 16453 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 16454 } 16455 sv.Engine = ptr.String(jtv) 16456 } 16457 16458 case "EngineMode": 16459 if value != nil { 16460 jtv, ok := value.(string) 16461 if !ok { 16462 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 16463 } 16464 sv.EngineMode = ptr.String(jtv) 16465 } 16466 16467 case "EngineVersion": 16468 if value != nil { 16469 jtv, ok := value.(string) 16470 if !ok { 16471 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 16472 } 16473 sv.EngineVersion = ptr.String(jtv) 16474 } 16475 16476 case "HostedZoneId": 16477 if value != nil { 16478 jtv, ok := value.(string) 16479 if !ok { 16480 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 16481 } 16482 sv.HostedZoneId = ptr.String(jtv) 16483 } 16484 16485 case "HttpEndpointEnabled": 16486 if value != nil { 16487 jtv, ok := value.(bool) 16488 if !ok { 16489 return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) 16490 } 16491 sv.HttpEndpointEnabled = jtv 16492 } 16493 16494 case "IamDatabaseAuthenticationEnabled": 16495 if value != nil { 16496 jtv, ok := value.(bool) 16497 if !ok { 16498 return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) 16499 } 16500 sv.IamDatabaseAuthenticationEnabled = jtv 16501 } 16502 16503 case "KmsKeyId": 16504 if value != nil { 16505 jtv, ok := value.(string) 16506 if !ok { 16507 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 16508 } 16509 sv.KmsKeyId = ptr.String(jtv) 16510 } 16511 16512 case "MasterUsername": 16513 if value != nil { 16514 jtv, ok := value.(string) 16515 if !ok { 16516 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 16517 } 16518 sv.MasterUsername = ptr.String(jtv) 16519 } 16520 16521 case "MultiAz": 16522 if value != nil { 16523 jtv, ok := value.(bool) 16524 if !ok { 16525 return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) 16526 } 16527 sv.MultiAz = jtv 16528 } 16529 16530 case "Port": 16531 if value != nil { 16532 jtv, ok := value.(json.Number) 16533 if !ok { 16534 return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) 16535 } 16536 i64, err := jtv.Int64() 16537 if err != nil { 16538 return err 16539 } 16540 sv.Port = int32(i64) 16541 } 16542 16543 case "PreferredBackupWindow": 16544 if value != nil { 16545 jtv, ok := value.(string) 16546 if !ok { 16547 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 16548 } 16549 sv.PreferredBackupWindow = ptr.String(jtv) 16550 } 16551 16552 case "PreferredMaintenanceWindow": 16553 if value != nil { 16554 jtv, ok := value.(string) 16555 if !ok { 16556 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 16557 } 16558 sv.PreferredMaintenanceWindow = ptr.String(jtv) 16559 } 16560 16561 case "ReaderEndpoint": 16562 if value != nil { 16563 jtv, ok := value.(string) 16564 if !ok { 16565 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 16566 } 16567 sv.ReaderEndpoint = ptr.String(jtv) 16568 } 16569 16570 case "ReadReplicaIdentifiers": 16571 if err := awsRestjson1_deserializeDocumentStringList(&sv.ReadReplicaIdentifiers, value); err != nil { 16572 return err 16573 } 16574 16575 case "Status": 16576 if value != nil { 16577 jtv, ok := value.(string) 16578 if !ok { 16579 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 16580 } 16581 sv.Status = ptr.String(jtv) 16582 } 16583 16584 case "StorageEncrypted": 16585 if value != nil { 16586 jtv, ok := value.(bool) 16587 if !ok { 16588 return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) 16589 } 16590 sv.StorageEncrypted = jtv 16591 } 16592 16593 case "VpcSecurityGroups": 16594 if err := awsRestjson1_deserializeDocumentAwsRdsDbInstanceVpcSecurityGroups(&sv.VpcSecurityGroups, value); err != nil { 16595 return err 16596 } 16597 16598 default: 16599 _, _ = key, value 16600 16601 } 16602 } 16603 *v = sv 16604 return nil 16605} 16606 16607func awsRestjson1_deserializeDocumentAwsRdsDbClusterMember(v **types.AwsRdsDbClusterMember, value interface{}) error { 16608 if v == nil { 16609 return fmt.Errorf("unexpected nil of type %T", v) 16610 } 16611 if value == nil { 16612 return nil 16613 } 16614 16615 shape, ok := value.(map[string]interface{}) 16616 if !ok { 16617 return fmt.Errorf("unexpected JSON type %v", value) 16618 } 16619 16620 var sv *types.AwsRdsDbClusterMember 16621 if *v == nil { 16622 sv = &types.AwsRdsDbClusterMember{} 16623 } else { 16624 sv = *v 16625 } 16626 16627 for key, value := range shape { 16628 switch key { 16629 case "DbClusterParameterGroupStatus": 16630 if value != nil { 16631 jtv, ok := value.(string) 16632 if !ok { 16633 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 16634 } 16635 sv.DbClusterParameterGroupStatus = ptr.String(jtv) 16636 } 16637 16638 case "DbInstanceIdentifier": 16639 if value != nil { 16640 jtv, ok := value.(string) 16641 if !ok { 16642 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 16643 } 16644 sv.DbInstanceIdentifier = ptr.String(jtv) 16645 } 16646 16647 case "IsClusterWriter": 16648 if value != nil { 16649 jtv, ok := value.(bool) 16650 if !ok { 16651 return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) 16652 } 16653 sv.IsClusterWriter = jtv 16654 } 16655 16656 case "PromotionTier": 16657 if value != nil { 16658 jtv, ok := value.(json.Number) 16659 if !ok { 16660 return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) 16661 } 16662 i64, err := jtv.Int64() 16663 if err != nil { 16664 return err 16665 } 16666 sv.PromotionTier = int32(i64) 16667 } 16668 16669 default: 16670 _, _ = key, value 16671 16672 } 16673 } 16674 *v = sv 16675 return nil 16676} 16677 16678func awsRestjson1_deserializeDocumentAwsRdsDbClusterMembers(v *[]types.AwsRdsDbClusterMember, value interface{}) error { 16679 if v == nil { 16680 return fmt.Errorf("unexpected nil of type %T", v) 16681 } 16682 if value == nil { 16683 return nil 16684 } 16685 16686 shape, ok := value.([]interface{}) 16687 if !ok { 16688 return fmt.Errorf("unexpected JSON type %v", value) 16689 } 16690 16691 var cv []types.AwsRdsDbClusterMember 16692 if *v == nil { 16693 cv = []types.AwsRdsDbClusterMember{} 16694 } else { 16695 cv = *v 16696 } 16697 16698 for _, value := range shape { 16699 var col types.AwsRdsDbClusterMember 16700 destAddr := &col 16701 if err := awsRestjson1_deserializeDocumentAwsRdsDbClusterMember(&destAddr, value); err != nil { 16702 return err 16703 } 16704 col = *destAddr 16705 cv = append(cv, col) 16706 16707 } 16708 *v = cv 16709 return nil 16710} 16711 16712func awsRestjson1_deserializeDocumentAwsRdsDbClusterOptionGroupMembership(v **types.AwsRdsDbClusterOptionGroupMembership, value interface{}) error { 16713 if v == nil { 16714 return fmt.Errorf("unexpected nil of type %T", v) 16715 } 16716 if value == nil { 16717 return nil 16718 } 16719 16720 shape, ok := value.(map[string]interface{}) 16721 if !ok { 16722 return fmt.Errorf("unexpected JSON type %v", value) 16723 } 16724 16725 var sv *types.AwsRdsDbClusterOptionGroupMembership 16726 if *v == nil { 16727 sv = &types.AwsRdsDbClusterOptionGroupMembership{} 16728 } else { 16729 sv = *v 16730 } 16731 16732 for key, value := range shape { 16733 switch key { 16734 case "DbClusterOptionGroupName": 16735 if value != nil { 16736 jtv, ok := value.(string) 16737 if !ok { 16738 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 16739 } 16740 sv.DbClusterOptionGroupName = ptr.String(jtv) 16741 } 16742 16743 case "Status": 16744 if value != nil { 16745 jtv, ok := value.(string) 16746 if !ok { 16747 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 16748 } 16749 sv.Status = ptr.String(jtv) 16750 } 16751 16752 default: 16753 _, _ = key, value 16754 16755 } 16756 } 16757 *v = sv 16758 return nil 16759} 16760 16761func awsRestjson1_deserializeDocumentAwsRdsDbClusterOptionGroupMemberships(v *[]types.AwsRdsDbClusterOptionGroupMembership, value interface{}) error { 16762 if v == nil { 16763 return fmt.Errorf("unexpected nil of type %T", v) 16764 } 16765 if value == nil { 16766 return nil 16767 } 16768 16769 shape, ok := value.([]interface{}) 16770 if !ok { 16771 return fmt.Errorf("unexpected JSON type %v", value) 16772 } 16773 16774 var cv []types.AwsRdsDbClusterOptionGroupMembership 16775 if *v == nil { 16776 cv = []types.AwsRdsDbClusterOptionGroupMembership{} 16777 } else { 16778 cv = *v 16779 } 16780 16781 for _, value := range shape { 16782 var col types.AwsRdsDbClusterOptionGroupMembership 16783 destAddr := &col 16784 if err := awsRestjson1_deserializeDocumentAwsRdsDbClusterOptionGroupMembership(&destAddr, value); err != nil { 16785 return err 16786 } 16787 col = *destAddr 16788 cv = append(cv, col) 16789 16790 } 16791 *v = cv 16792 return nil 16793} 16794 16795func awsRestjson1_deserializeDocumentAwsRdsDbClusterSnapshotDetails(v **types.AwsRdsDbClusterSnapshotDetails, value interface{}) error { 16796 if v == nil { 16797 return fmt.Errorf("unexpected nil of type %T", v) 16798 } 16799 if value == nil { 16800 return nil 16801 } 16802 16803 shape, ok := value.(map[string]interface{}) 16804 if !ok { 16805 return fmt.Errorf("unexpected JSON type %v", value) 16806 } 16807 16808 var sv *types.AwsRdsDbClusterSnapshotDetails 16809 if *v == nil { 16810 sv = &types.AwsRdsDbClusterSnapshotDetails{} 16811 } else { 16812 sv = *v 16813 } 16814 16815 for key, value := range shape { 16816 switch key { 16817 case "AllocatedStorage": 16818 if value != nil { 16819 jtv, ok := value.(json.Number) 16820 if !ok { 16821 return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) 16822 } 16823 i64, err := jtv.Int64() 16824 if err != nil { 16825 return err 16826 } 16827 sv.AllocatedStorage = int32(i64) 16828 } 16829 16830 case "AvailabilityZones": 16831 if err := awsRestjson1_deserializeDocumentStringList(&sv.AvailabilityZones, value); err != nil { 16832 return err 16833 } 16834 16835 case "ClusterCreateTime": 16836 if value != nil { 16837 jtv, ok := value.(string) 16838 if !ok { 16839 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 16840 } 16841 sv.ClusterCreateTime = ptr.String(jtv) 16842 } 16843 16844 case "DbClusterIdentifier": 16845 if value != nil { 16846 jtv, ok := value.(string) 16847 if !ok { 16848 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 16849 } 16850 sv.DbClusterIdentifier = ptr.String(jtv) 16851 } 16852 16853 case "DbClusterSnapshotIdentifier": 16854 if value != nil { 16855 jtv, ok := value.(string) 16856 if !ok { 16857 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 16858 } 16859 sv.DbClusterSnapshotIdentifier = ptr.String(jtv) 16860 } 16861 16862 case "Engine": 16863 if value != nil { 16864 jtv, ok := value.(string) 16865 if !ok { 16866 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 16867 } 16868 sv.Engine = ptr.String(jtv) 16869 } 16870 16871 case "EngineVersion": 16872 if value != nil { 16873 jtv, ok := value.(string) 16874 if !ok { 16875 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 16876 } 16877 sv.EngineVersion = ptr.String(jtv) 16878 } 16879 16880 case "IamDatabaseAuthenticationEnabled": 16881 if value != nil { 16882 jtv, ok := value.(bool) 16883 if !ok { 16884 return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) 16885 } 16886 sv.IamDatabaseAuthenticationEnabled = jtv 16887 } 16888 16889 case "KmsKeyId": 16890 if value != nil { 16891 jtv, ok := value.(string) 16892 if !ok { 16893 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 16894 } 16895 sv.KmsKeyId = ptr.String(jtv) 16896 } 16897 16898 case "LicenseModel": 16899 if value != nil { 16900 jtv, ok := value.(string) 16901 if !ok { 16902 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 16903 } 16904 sv.LicenseModel = ptr.String(jtv) 16905 } 16906 16907 case "MasterUsername": 16908 if value != nil { 16909 jtv, ok := value.(string) 16910 if !ok { 16911 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 16912 } 16913 sv.MasterUsername = ptr.String(jtv) 16914 } 16915 16916 case "PercentProgress": 16917 if value != nil { 16918 jtv, ok := value.(json.Number) 16919 if !ok { 16920 return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) 16921 } 16922 i64, err := jtv.Int64() 16923 if err != nil { 16924 return err 16925 } 16926 sv.PercentProgress = int32(i64) 16927 } 16928 16929 case "Port": 16930 if value != nil { 16931 jtv, ok := value.(json.Number) 16932 if !ok { 16933 return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) 16934 } 16935 i64, err := jtv.Int64() 16936 if err != nil { 16937 return err 16938 } 16939 sv.Port = int32(i64) 16940 } 16941 16942 case "SnapshotCreateTime": 16943 if value != nil { 16944 jtv, ok := value.(string) 16945 if !ok { 16946 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 16947 } 16948 sv.SnapshotCreateTime = ptr.String(jtv) 16949 } 16950 16951 case "SnapshotType": 16952 if value != nil { 16953 jtv, ok := value.(string) 16954 if !ok { 16955 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 16956 } 16957 sv.SnapshotType = ptr.String(jtv) 16958 } 16959 16960 case "Status": 16961 if value != nil { 16962 jtv, ok := value.(string) 16963 if !ok { 16964 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 16965 } 16966 sv.Status = ptr.String(jtv) 16967 } 16968 16969 case "StorageEncrypted": 16970 if value != nil { 16971 jtv, ok := value.(bool) 16972 if !ok { 16973 return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) 16974 } 16975 sv.StorageEncrypted = jtv 16976 } 16977 16978 case "VpcId": 16979 if value != nil { 16980 jtv, ok := value.(string) 16981 if !ok { 16982 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 16983 } 16984 sv.VpcId = ptr.String(jtv) 16985 } 16986 16987 default: 16988 _, _ = key, value 16989 16990 } 16991 } 16992 *v = sv 16993 return nil 16994} 16995 16996func awsRestjson1_deserializeDocumentAwsRdsDbDomainMembership(v **types.AwsRdsDbDomainMembership, value interface{}) error { 16997 if v == nil { 16998 return fmt.Errorf("unexpected nil of type %T", v) 16999 } 17000 if value == nil { 17001 return nil 17002 } 17003 17004 shape, ok := value.(map[string]interface{}) 17005 if !ok { 17006 return fmt.Errorf("unexpected JSON type %v", value) 17007 } 17008 17009 var sv *types.AwsRdsDbDomainMembership 17010 if *v == nil { 17011 sv = &types.AwsRdsDbDomainMembership{} 17012 } else { 17013 sv = *v 17014 } 17015 17016 for key, value := range shape { 17017 switch key { 17018 case "Domain": 17019 if value != nil { 17020 jtv, ok := value.(string) 17021 if !ok { 17022 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 17023 } 17024 sv.Domain = ptr.String(jtv) 17025 } 17026 17027 case "Fqdn": 17028 if value != nil { 17029 jtv, ok := value.(string) 17030 if !ok { 17031 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 17032 } 17033 sv.Fqdn = ptr.String(jtv) 17034 } 17035 17036 case "IamRoleName": 17037 if value != nil { 17038 jtv, ok := value.(string) 17039 if !ok { 17040 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 17041 } 17042 sv.IamRoleName = ptr.String(jtv) 17043 } 17044 17045 case "Status": 17046 if value != nil { 17047 jtv, ok := value.(string) 17048 if !ok { 17049 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 17050 } 17051 sv.Status = ptr.String(jtv) 17052 } 17053 17054 default: 17055 _, _ = key, value 17056 17057 } 17058 } 17059 *v = sv 17060 return nil 17061} 17062 17063func awsRestjson1_deserializeDocumentAwsRdsDbDomainMemberships(v *[]types.AwsRdsDbDomainMembership, value interface{}) error { 17064 if v == nil { 17065 return fmt.Errorf("unexpected nil of type %T", v) 17066 } 17067 if value == nil { 17068 return nil 17069 } 17070 17071 shape, ok := value.([]interface{}) 17072 if !ok { 17073 return fmt.Errorf("unexpected JSON type %v", value) 17074 } 17075 17076 var cv []types.AwsRdsDbDomainMembership 17077 if *v == nil { 17078 cv = []types.AwsRdsDbDomainMembership{} 17079 } else { 17080 cv = *v 17081 } 17082 17083 for _, value := range shape { 17084 var col types.AwsRdsDbDomainMembership 17085 destAddr := &col 17086 if err := awsRestjson1_deserializeDocumentAwsRdsDbDomainMembership(&destAddr, value); err != nil { 17087 return err 17088 } 17089 col = *destAddr 17090 cv = append(cv, col) 17091 17092 } 17093 *v = cv 17094 return nil 17095} 17096 17097func awsRestjson1_deserializeDocumentAwsRdsDbInstanceAssociatedRole(v **types.AwsRdsDbInstanceAssociatedRole, value interface{}) error { 17098 if v == nil { 17099 return fmt.Errorf("unexpected nil of type %T", v) 17100 } 17101 if value == nil { 17102 return nil 17103 } 17104 17105 shape, ok := value.(map[string]interface{}) 17106 if !ok { 17107 return fmt.Errorf("unexpected JSON type %v", value) 17108 } 17109 17110 var sv *types.AwsRdsDbInstanceAssociatedRole 17111 if *v == nil { 17112 sv = &types.AwsRdsDbInstanceAssociatedRole{} 17113 } else { 17114 sv = *v 17115 } 17116 17117 for key, value := range shape { 17118 switch key { 17119 case "FeatureName": 17120 if value != nil { 17121 jtv, ok := value.(string) 17122 if !ok { 17123 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 17124 } 17125 sv.FeatureName = ptr.String(jtv) 17126 } 17127 17128 case "RoleArn": 17129 if value != nil { 17130 jtv, ok := value.(string) 17131 if !ok { 17132 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 17133 } 17134 sv.RoleArn = ptr.String(jtv) 17135 } 17136 17137 case "Status": 17138 if value != nil { 17139 jtv, ok := value.(string) 17140 if !ok { 17141 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 17142 } 17143 sv.Status = ptr.String(jtv) 17144 } 17145 17146 default: 17147 _, _ = key, value 17148 17149 } 17150 } 17151 *v = sv 17152 return nil 17153} 17154 17155func awsRestjson1_deserializeDocumentAwsRdsDbInstanceAssociatedRoles(v *[]types.AwsRdsDbInstanceAssociatedRole, value interface{}) error { 17156 if v == nil { 17157 return fmt.Errorf("unexpected nil of type %T", v) 17158 } 17159 if value == nil { 17160 return nil 17161 } 17162 17163 shape, ok := value.([]interface{}) 17164 if !ok { 17165 return fmt.Errorf("unexpected JSON type %v", value) 17166 } 17167 17168 var cv []types.AwsRdsDbInstanceAssociatedRole 17169 if *v == nil { 17170 cv = []types.AwsRdsDbInstanceAssociatedRole{} 17171 } else { 17172 cv = *v 17173 } 17174 17175 for _, value := range shape { 17176 var col types.AwsRdsDbInstanceAssociatedRole 17177 destAddr := &col 17178 if err := awsRestjson1_deserializeDocumentAwsRdsDbInstanceAssociatedRole(&destAddr, value); err != nil { 17179 return err 17180 } 17181 col = *destAddr 17182 cv = append(cv, col) 17183 17184 } 17185 *v = cv 17186 return nil 17187} 17188 17189func awsRestjson1_deserializeDocumentAwsRdsDbInstanceDetails(v **types.AwsRdsDbInstanceDetails, value interface{}) error { 17190 if v == nil { 17191 return fmt.Errorf("unexpected nil of type %T", v) 17192 } 17193 if value == nil { 17194 return nil 17195 } 17196 17197 shape, ok := value.(map[string]interface{}) 17198 if !ok { 17199 return fmt.Errorf("unexpected JSON type %v", value) 17200 } 17201 17202 var sv *types.AwsRdsDbInstanceDetails 17203 if *v == nil { 17204 sv = &types.AwsRdsDbInstanceDetails{} 17205 } else { 17206 sv = *v 17207 } 17208 17209 for key, value := range shape { 17210 switch key { 17211 case "AllocatedStorage": 17212 if value != nil { 17213 jtv, ok := value.(json.Number) 17214 if !ok { 17215 return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) 17216 } 17217 i64, err := jtv.Int64() 17218 if err != nil { 17219 return err 17220 } 17221 sv.AllocatedStorage = int32(i64) 17222 } 17223 17224 case "AssociatedRoles": 17225 if err := awsRestjson1_deserializeDocumentAwsRdsDbInstanceAssociatedRoles(&sv.AssociatedRoles, value); err != nil { 17226 return err 17227 } 17228 17229 case "AutoMinorVersionUpgrade": 17230 if value != nil { 17231 jtv, ok := value.(bool) 17232 if !ok { 17233 return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) 17234 } 17235 sv.AutoMinorVersionUpgrade = jtv 17236 } 17237 17238 case "AvailabilityZone": 17239 if value != nil { 17240 jtv, ok := value.(string) 17241 if !ok { 17242 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 17243 } 17244 sv.AvailabilityZone = ptr.String(jtv) 17245 } 17246 17247 case "BackupRetentionPeriod": 17248 if value != nil { 17249 jtv, ok := value.(json.Number) 17250 if !ok { 17251 return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) 17252 } 17253 i64, err := jtv.Int64() 17254 if err != nil { 17255 return err 17256 } 17257 sv.BackupRetentionPeriod = int32(i64) 17258 } 17259 17260 case "CACertificateIdentifier": 17261 if value != nil { 17262 jtv, ok := value.(string) 17263 if !ok { 17264 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 17265 } 17266 sv.CACertificateIdentifier = ptr.String(jtv) 17267 } 17268 17269 case "CharacterSetName": 17270 if value != nil { 17271 jtv, ok := value.(string) 17272 if !ok { 17273 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 17274 } 17275 sv.CharacterSetName = ptr.String(jtv) 17276 } 17277 17278 case "CopyTagsToSnapshot": 17279 if value != nil { 17280 jtv, ok := value.(bool) 17281 if !ok { 17282 return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) 17283 } 17284 sv.CopyTagsToSnapshot = jtv 17285 } 17286 17287 case "DBClusterIdentifier": 17288 if value != nil { 17289 jtv, ok := value.(string) 17290 if !ok { 17291 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 17292 } 17293 sv.DBClusterIdentifier = ptr.String(jtv) 17294 } 17295 17296 case "DBInstanceClass": 17297 if value != nil { 17298 jtv, ok := value.(string) 17299 if !ok { 17300 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 17301 } 17302 sv.DBInstanceClass = ptr.String(jtv) 17303 } 17304 17305 case "DBInstanceIdentifier": 17306 if value != nil { 17307 jtv, ok := value.(string) 17308 if !ok { 17309 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 17310 } 17311 sv.DBInstanceIdentifier = ptr.String(jtv) 17312 } 17313 17314 case "DbInstancePort": 17315 if value != nil { 17316 jtv, ok := value.(json.Number) 17317 if !ok { 17318 return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) 17319 } 17320 i64, err := jtv.Int64() 17321 if err != nil { 17322 return err 17323 } 17324 sv.DbInstancePort = int32(i64) 17325 } 17326 17327 case "DbInstanceStatus": 17328 if value != nil { 17329 jtv, ok := value.(string) 17330 if !ok { 17331 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 17332 } 17333 sv.DbInstanceStatus = ptr.String(jtv) 17334 } 17335 17336 case "DbiResourceId": 17337 if value != nil { 17338 jtv, ok := value.(string) 17339 if !ok { 17340 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 17341 } 17342 sv.DbiResourceId = ptr.String(jtv) 17343 } 17344 17345 case "DBName": 17346 if value != nil { 17347 jtv, ok := value.(string) 17348 if !ok { 17349 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 17350 } 17351 sv.DBName = ptr.String(jtv) 17352 } 17353 17354 case "DbParameterGroups": 17355 if err := awsRestjson1_deserializeDocumentAwsRdsDbParameterGroups(&sv.DbParameterGroups, value); err != nil { 17356 return err 17357 } 17358 17359 case "DbSecurityGroups": 17360 if err := awsRestjson1_deserializeDocumentStringList(&sv.DbSecurityGroups, value); err != nil { 17361 return err 17362 } 17363 17364 case "DbSubnetGroup": 17365 if err := awsRestjson1_deserializeDocumentAwsRdsDbSubnetGroup(&sv.DbSubnetGroup, value); err != nil { 17366 return err 17367 } 17368 17369 case "DeletionProtection": 17370 if value != nil { 17371 jtv, ok := value.(bool) 17372 if !ok { 17373 return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) 17374 } 17375 sv.DeletionProtection = jtv 17376 } 17377 17378 case "DomainMemberships": 17379 if err := awsRestjson1_deserializeDocumentAwsRdsDbDomainMemberships(&sv.DomainMemberships, value); err != nil { 17380 return err 17381 } 17382 17383 case "EnabledCloudWatchLogsExports": 17384 if err := awsRestjson1_deserializeDocumentStringList(&sv.EnabledCloudWatchLogsExports, value); err != nil { 17385 return err 17386 } 17387 17388 case "Endpoint": 17389 if err := awsRestjson1_deserializeDocumentAwsRdsDbInstanceEndpoint(&sv.Endpoint, value); err != nil { 17390 return err 17391 } 17392 17393 case "Engine": 17394 if value != nil { 17395 jtv, ok := value.(string) 17396 if !ok { 17397 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 17398 } 17399 sv.Engine = ptr.String(jtv) 17400 } 17401 17402 case "EngineVersion": 17403 if value != nil { 17404 jtv, ok := value.(string) 17405 if !ok { 17406 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 17407 } 17408 sv.EngineVersion = ptr.String(jtv) 17409 } 17410 17411 case "EnhancedMonitoringResourceArn": 17412 if value != nil { 17413 jtv, ok := value.(string) 17414 if !ok { 17415 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 17416 } 17417 sv.EnhancedMonitoringResourceArn = ptr.String(jtv) 17418 } 17419 17420 case "IAMDatabaseAuthenticationEnabled": 17421 if value != nil { 17422 jtv, ok := value.(bool) 17423 if !ok { 17424 return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) 17425 } 17426 sv.IAMDatabaseAuthenticationEnabled = jtv 17427 } 17428 17429 case "InstanceCreateTime": 17430 if value != nil { 17431 jtv, ok := value.(string) 17432 if !ok { 17433 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 17434 } 17435 sv.InstanceCreateTime = ptr.String(jtv) 17436 } 17437 17438 case "Iops": 17439 if value != nil { 17440 jtv, ok := value.(json.Number) 17441 if !ok { 17442 return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) 17443 } 17444 i64, err := jtv.Int64() 17445 if err != nil { 17446 return err 17447 } 17448 sv.Iops = int32(i64) 17449 } 17450 17451 case "KmsKeyId": 17452 if value != nil { 17453 jtv, ok := value.(string) 17454 if !ok { 17455 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 17456 } 17457 sv.KmsKeyId = ptr.String(jtv) 17458 } 17459 17460 case "LatestRestorableTime": 17461 if value != nil { 17462 jtv, ok := value.(string) 17463 if !ok { 17464 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 17465 } 17466 sv.LatestRestorableTime = ptr.String(jtv) 17467 } 17468 17469 case "LicenseModel": 17470 if value != nil { 17471 jtv, ok := value.(string) 17472 if !ok { 17473 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 17474 } 17475 sv.LicenseModel = ptr.String(jtv) 17476 } 17477 17478 case "ListenerEndpoint": 17479 if err := awsRestjson1_deserializeDocumentAwsRdsDbInstanceEndpoint(&sv.ListenerEndpoint, value); err != nil { 17480 return err 17481 } 17482 17483 case "MasterUsername": 17484 if value != nil { 17485 jtv, ok := value.(string) 17486 if !ok { 17487 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 17488 } 17489 sv.MasterUsername = ptr.String(jtv) 17490 } 17491 17492 case "MaxAllocatedStorage": 17493 if value != nil { 17494 jtv, ok := value.(json.Number) 17495 if !ok { 17496 return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) 17497 } 17498 i64, err := jtv.Int64() 17499 if err != nil { 17500 return err 17501 } 17502 sv.MaxAllocatedStorage = int32(i64) 17503 } 17504 17505 case "MonitoringInterval": 17506 if value != nil { 17507 jtv, ok := value.(json.Number) 17508 if !ok { 17509 return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) 17510 } 17511 i64, err := jtv.Int64() 17512 if err != nil { 17513 return err 17514 } 17515 sv.MonitoringInterval = int32(i64) 17516 } 17517 17518 case "MonitoringRoleArn": 17519 if value != nil { 17520 jtv, ok := value.(string) 17521 if !ok { 17522 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 17523 } 17524 sv.MonitoringRoleArn = ptr.String(jtv) 17525 } 17526 17527 case "MultiAz": 17528 if value != nil { 17529 jtv, ok := value.(bool) 17530 if !ok { 17531 return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) 17532 } 17533 sv.MultiAz = jtv 17534 } 17535 17536 case "OptionGroupMemberships": 17537 if err := awsRestjson1_deserializeDocumentAwsRdsDbOptionGroupMemberships(&sv.OptionGroupMemberships, value); err != nil { 17538 return err 17539 } 17540 17541 case "PendingModifiedValues": 17542 if err := awsRestjson1_deserializeDocumentAwsRdsDbPendingModifiedValues(&sv.PendingModifiedValues, value); err != nil { 17543 return err 17544 } 17545 17546 case "PerformanceInsightsEnabled": 17547 if value != nil { 17548 jtv, ok := value.(bool) 17549 if !ok { 17550 return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) 17551 } 17552 sv.PerformanceInsightsEnabled = jtv 17553 } 17554 17555 case "PerformanceInsightsKmsKeyId": 17556 if value != nil { 17557 jtv, ok := value.(string) 17558 if !ok { 17559 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 17560 } 17561 sv.PerformanceInsightsKmsKeyId = ptr.String(jtv) 17562 } 17563 17564 case "PerformanceInsightsRetentionPeriod": 17565 if value != nil { 17566 jtv, ok := value.(json.Number) 17567 if !ok { 17568 return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) 17569 } 17570 i64, err := jtv.Int64() 17571 if err != nil { 17572 return err 17573 } 17574 sv.PerformanceInsightsRetentionPeriod = int32(i64) 17575 } 17576 17577 case "PreferredBackupWindow": 17578 if value != nil { 17579 jtv, ok := value.(string) 17580 if !ok { 17581 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 17582 } 17583 sv.PreferredBackupWindow = ptr.String(jtv) 17584 } 17585 17586 case "PreferredMaintenanceWindow": 17587 if value != nil { 17588 jtv, ok := value.(string) 17589 if !ok { 17590 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 17591 } 17592 sv.PreferredMaintenanceWindow = ptr.String(jtv) 17593 } 17594 17595 case "ProcessorFeatures": 17596 if err := awsRestjson1_deserializeDocumentAwsRdsDbProcessorFeatures(&sv.ProcessorFeatures, value); err != nil { 17597 return err 17598 } 17599 17600 case "PromotionTier": 17601 if value != nil { 17602 jtv, ok := value.(json.Number) 17603 if !ok { 17604 return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) 17605 } 17606 i64, err := jtv.Int64() 17607 if err != nil { 17608 return err 17609 } 17610 sv.PromotionTier = int32(i64) 17611 } 17612 17613 case "PubliclyAccessible": 17614 if value != nil { 17615 jtv, ok := value.(bool) 17616 if !ok { 17617 return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) 17618 } 17619 sv.PubliclyAccessible = jtv 17620 } 17621 17622 case "ReadReplicaDBClusterIdentifiers": 17623 if err := awsRestjson1_deserializeDocumentStringList(&sv.ReadReplicaDBClusterIdentifiers, value); err != nil { 17624 return err 17625 } 17626 17627 case "ReadReplicaDBInstanceIdentifiers": 17628 if err := awsRestjson1_deserializeDocumentStringList(&sv.ReadReplicaDBInstanceIdentifiers, value); err != nil { 17629 return err 17630 } 17631 17632 case "ReadReplicaSourceDBInstanceIdentifier": 17633 if value != nil { 17634 jtv, ok := value.(string) 17635 if !ok { 17636 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 17637 } 17638 sv.ReadReplicaSourceDBInstanceIdentifier = ptr.String(jtv) 17639 } 17640 17641 case "SecondaryAvailabilityZone": 17642 if value != nil { 17643 jtv, ok := value.(string) 17644 if !ok { 17645 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 17646 } 17647 sv.SecondaryAvailabilityZone = ptr.String(jtv) 17648 } 17649 17650 case "StatusInfos": 17651 if err := awsRestjson1_deserializeDocumentAwsRdsDbStatusInfos(&sv.StatusInfos, value); err != nil { 17652 return err 17653 } 17654 17655 case "StorageEncrypted": 17656 if value != nil { 17657 jtv, ok := value.(bool) 17658 if !ok { 17659 return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) 17660 } 17661 sv.StorageEncrypted = jtv 17662 } 17663 17664 case "StorageType": 17665 if value != nil { 17666 jtv, ok := value.(string) 17667 if !ok { 17668 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 17669 } 17670 sv.StorageType = ptr.String(jtv) 17671 } 17672 17673 case "TdeCredentialArn": 17674 if value != nil { 17675 jtv, ok := value.(string) 17676 if !ok { 17677 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 17678 } 17679 sv.TdeCredentialArn = ptr.String(jtv) 17680 } 17681 17682 case "Timezone": 17683 if value != nil { 17684 jtv, ok := value.(string) 17685 if !ok { 17686 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 17687 } 17688 sv.Timezone = ptr.String(jtv) 17689 } 17690 17691 case "VpcSecurityGroups": 17692 if err := awsRestjson1_deserializeDocumentAwsRdsDbInstanceVpcSecurityGroups(&sv.VpcSecurityGroups, value); err != nil { 17693 return err 17694 } 17695 17696 default: 17697 _, _ = key, value 17698 17699 } 17700 } 17701 *v = sv 17702 return nil 17703} 17704 17705func awsRestjson1_deserializeDocumentAwsRdsDbInstanceEndpoint(v **types.AwsRdsDbInstanceEndpoint, value interface{}) error { 17706 if v == nil { 17707 return fmt.Errorf("unexpected nil of type %T", v) 17708 } 17709 if value == nil { 17710 return nil 17711 } 17712 17713 shape, ok := value.(map[string]interface{}) 17714 if !ok { 17715 return fmt.Errorf("unexpected JSON type %v", value) 17716 } 17717 17718 var sv *types.AwsRdsDbInstanceEndpoint 17719 if *v == nil { 17720 sv = &types.AwsRdsDbInstanceEndpoint{} 17721 } else { 17722 sv = *v 17723 } 17724 17725 for key, value := range shape { 17726 switch key { 17727 case "Address": 17728 if value != nil { 17729 jtv, ok := value.(string) 17730 if !ok { 17731 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 17732 } 17733 sv.Address = ptr.String(jtv) 17734 } 17735 17736 case "HostedZoneId": 17737 if value != nil { 17738 jtv, ok := value.(string) 17739 if !ok { 17740 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 17741 } 17742 sv.HostedZoneId = ptr.String(jtv) 17743 } 17744 17745 case "Port": 17746 if value != nil { 17747 jtv, ok := value.(json.Number) 17748 if !ok { 17749 return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) 17750 } 17751 i64, err := jtv.Int64() 17752 if err != nil { 17753 return err 17754 } 17755 sv.Port = int32(i64) 17756 } 17757 17758 default: 17759 _, _ = key, value 17760 17761 } 17762 } 17763 *v = sv 17764 return nil 17765} 17766 17767func awsRestjson1_deserializeDocumentAwsRdsDbInstanceVpcSecurityGroup(v **types.AwsRdsDbInstanceVpcSecurityGroup, value interface{}) error { 17768 if v == nil { 17769 return fmt.Errorf("unexpected nil of type %T", v) 17770 } 17771 if value == nil { 17772 return nil 17773 } 17774 17775 shape, ok := value.(map[string]interface{}) 17776 if !ok { 17777 return fmt.Errorf("unexpected JSON type %v", value) 17778 } 17779 17780 var sv *types.AwsRdsDbInstanceVpcSecurityGroup 17781 if *v == nil { 17782 sv = &types.AwsRdsDbInstanceVpcSecurityGroup{} 17783 } else { 17784 sv = *v 17785 } 17786 17787 for key, value := range shape { 17788 switch key { 17789 case "Status": 17790 if value != nil { 17791 jtv, ok := value.(string) 17792 if !ok { 17793 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 17794 } 17795 sv.Status = ptr.String(jtv) 17796 } 17797 17798 case "VpcSecurityGroupId": 17799 if value != nil { 17800 jtv, ok := value.(string) 17801 if !ok { 17802 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 17803 } 17804 sv.VpcSecurityGroupId = ptr.String(jtv) 17805 } 17806 17807 default: 17808 _, _ = key, value 17809 17810 } 17811 } 17812 *v = sv 17813 return nil 17814} 17815 17816func awsRestjson1_deserializeDocumentAwsRdsDbInstanceVpcSecurityGroups(v *[]types.AwsRdsDbInstanceVpcSecurityGroup, value interface{}) error { 17817 if v == nil { 17818 return fmt.Errorf("unexpected nil of type %T", v) 17819 } 17820 if value == nil { 17821 return nil 17822 } 17823 17824 shape, ok := value.([]interface{}) 17825 if !ok { 17826 return fmt.Errorf("unexpected JSON type %v", value) 17827 } 17828 17829 var cv []types.AwsRdsDbInstanceVpcSecurityGroup 17830 if *v == nil { 17831 cv = []types.AwsRdsDbInstanceVpcSecurityGroup{} 17832 } else { 17833 cv = *v 17834 } 17835 17836 for _, value := range shape { 17837 var col types.AwsRdsDbInstanceVpcSecurityGroup 17838 destAddr := &col 17839 if err := awsRestjson1_deserializeDocumentAwsRdsDbInstanceVpcSecurityGroup(&destAddr, value); err != nil { 17840 return err 17841 } 17842 col = *destAddr 17843 cv = append(cv, col) 17844 17845 } 17846 *v = cv 17847 return nil 17848} 17849 17850func awsRestjson1_deserializeDocumentAwsRdsDbOptionGroupMembership(v **types.AwsRdsDbOptionGroupMembership, value interface{}) error { 17851 if v == nil { 17852 return fmt.Errorf("unexpected nil of type %T", v) 17853 } 17854 if value == nil { 17855 return nil 17856 } 17857 17858 shape, ok := value.(map[string]interface{}) 17859 if !ok { 17860 return fmt.Errorf("unexpected JSON type %v", value) 17861 } 17862 17863 var sv *types.AwsRdsDbOptionGroupMembership 17864 if *v == nil { 17865 sv = &types.AwsRdsDbOptionGroupMembership{} 17866 } else { 17867 sv = *v 17868 } 17869 17870 for key, value := range shape { 17871 switch key { 17872 case "OptionGroupName": 17873 if value != nil { 17874 jtv, ok := value.(string) 17875 if !ok { 17876 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 17877 } 17878 sv.OptionGroupName = ptr.String(jtv) 17879 } 17880 17881 case "Status": 17882 if value != nil { 17883 jtv, ok := value.(string) 17884 if !ok { 17885 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 17886 } 17887 sv.Status = ptr.String(jtv) 17888 } 17889 17890 default: 17891 _, _ = key, value 17892 17893 } 17894 } 17895 *v = sv 17896 return nil 17897} 17898 17899func awsRestjson1_deserializeDocumentAwsRdsDbOptionGroupMemberships(v *[]types.AwsRdsDbOptionGroupMembership, value interface{}) error { 17900 if v == nil { 17901 return fmt.Errorf("unexpected nil of type %T", v) 17902 } 17903 if value == nil { 17904 return nil 17905 } 17906 17907 shape, ok := value.([]interface{}) 17908 if !ok { 17909 return fmt.Errorf("unexpected JSON type %v", value) 17910 } 17911 17912 var cv []types.AwsRdsDbOptionGroupMembership 17913 if *v == nil { 17914 cv = []types.AwsRdsDbOptionGroupMembership{} 17915 } else { 17916 cv = *v 17917 } 17918 17919 for _, value := range shape { 17920 var col types.AwsRdsDbOptionGroupMembership 17921 destAddr := &col 17922 if err := awsRestjson1_deserializeDocumentAwsRdsDbOptionGroupMembership(&destAddr, value); err != nil { 17923 return err 17924 } 17925 col = *destAddr 17926 cv = append(cv, col) 17927 17928 } 17929 *v = cv 17930 return nil 17931} 17932 17933func awsRestjson1_deserializeDocumentAwsRdsDbParameterGroup(v **types.AwsRdsDbParameterGroup, value interface{}) error { 17934 if v == nil { 17935 return fmt.Errorf("unexpected nil of type %T", v) 17936 } 17937 if value == nil { 17938 return nil 17939 } 17940 17941 shape, ok := value.(map[string]interface{}) 17942 if !ok { 17943 return fmt.Errorf("unexpected JSON type %v", value) 17944 } 17945 17946 var sv *types.AwsRdsDbParameterGroup 17947 if *v == nil { 17948 sv = &types.AwsRdsDbParameterGroup{} 17949 } else { 17950 sv = *v 17951 } 17952 17953 for key, value := range shape { 17954 switch key { 17955 case "DbParameterGroupName": 17956 if value != nil { 17957 jtv, ok := value.(string) 17958 if !ok { 17959 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 17960 } 17961 sv.DbParameterGroupName = ptr.String(jtv) 17962 } 17963 17964 case "ParameterApplyStatus": 17965 if value != nil { 17966 jtv, ok := value.(string) 17967 if !ok { 17968 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 17969 } 17970 sv.ParameterApplyStatus = ptr.String(jtv) 17971 } 17972 17973 default: 17974 _, _ = key, value 17975 17976 } 17977 } 17978 *v = sv 17979 return nil 17980} 17981 17982func awsRestjson1_deserializeDocumentAwsRdsDbParameterGroups(v *[]types.AwsRdsDbParameterGroup, value interface{}) error { 17983 if v == nil { 17984 return fmt.Errorf("unexpected nil of type %T", v) 17985 } 17986 if value == nil { 17987 return nil 17988 } 17989 17990 shape, ok := value.([]interface{}) 17991 if !ok { 17992 return fmt.Errorf("unexpected JSON type %v", value) 17993 } 17994 17995 var cv []types.AwsRdsDbParameterGroup 17996 if *v == nil { 17997 cv = []types.AwsRdsDbParameterGroup{} 17998 } else { 17999 cv = *v 18000 } 18001 18002 for _, value := range shape { 18003 var col types.AwsRdsDbParameterGroup 18004 destAddr := &col 18005 if err := awsRestjson1_deserializeDocumentAwsRdsDbParameterGroup(&destAddr, value); err != nil { 18006 return err 18007 } 18008 col = *destAddr 18009 cv = append(cv, col) 18010 18011 } 18012 *v = cv 18013 return nil 18014} 18015 18016func awsRestjson1_deserializeDocumentAwsRdsDbPendingModifiedValues(v **types.AwsRdsDbPendingModifiedValues, value interface{}) error { 18017 if v == nil { 18018 return fmt.Errorf("unexpected nil of type %T", v) 18019 } 18020 if value == nil { 18021 return nil 18022 } 18023 18024 shape, ok := value.(map[string]interface{}) 18025 if !ok { 18026 return fmt.Errorf("unexpected JSON type %v", value) 18027 } 18028 18029 var sv *types.AwsRdsDbPendingModifiedValues 18030 if *v == nil { 18031 sv = &types.AwsRdsDbPendingModifiedValues{} 18032 } else { 18033 sv = *v 18034 } 18035 18036 for key, value := range shape { 18037 switch key { 18038 case "AllocatedStorage": 18039 if value != nil { 18040 jtv, ok := value.(json.Number) 18041 if !ok { 18042 return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) 18043 } 18044 i64, err := jtv.Int64() 18045 if err != nil { 18046 return err 18047 } 18048 sv.AllocatedStorage = int32(i64) 18049 } 18050 18051 case "BackupRetentionPeriod": 18052 if value != nil { 18053 jtv, ok := value.(json.Number) 18054 if !ok { 18055 return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) 18056 } 18057 i64, err := jtv.Int64() 18058 if err != nil { 18059 return err 18060 } 18061 sv.BackupRetentionPeriod = int32(i64) 18062 } 18063 18064 case "CaCertificateIdentifier": 18065 if value != nil { 18066 jtv, ok := value.(string) 18067 if !ok { 18068 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 18069 } 18070 sv.CaCertificateIdentifier = ptr.String(jtv) 18071 } 18072 18073 case "DbInstanceClass": 18074 if value != nil { 18075 jtv, ok := value.(string) 18076 if !ok { 18077 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 18078 } 18079 sv.DbInstanceClass = ptr.String(jtv) 18080 } 18081 18082 case "DbInstanceIdentifier": 18083 if value != nil { 18084 jtv, ok := value.(string) 18085 if !ok { 18086 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 18087 } 18088 sv.DbInstanceIdentifier = ptr.String(jtv) 18089 } 18090 18091 case "DbSubnetGroupName": 18092 if value != nil { 18093 jtv, ok := value.(string) 18094 if !ok { 18095 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 18096 } 18097 sv.DbSubnetGroupName = ptr.String(jtv) 18098 } 18099 18100 case "EngineVersion": 18101 if value != nil { 18102 jtv, ok := value.(string) 18103 if !ok { 18104 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 18105 } 18106 sv.EngineVersion = ptr.String(jtv) 18107 } 18108 18109 case "Iops": 18110 if value != nil { 18111 jtv, ok := value.(json.Number) 18112 if !ok { 18113 return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) 18114 } 18115 i64, err := jtv.Int64() 18116 if err != nil { 18117 return err 18118 } 18119 sv.Iops = int32(i64) 18120 } 18121 18122 case "LicenseModel": 18123 if value != nil { 18124 jtv, ok := value.(string) 18125 if !ok { 18126 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 18127 } 18128 sv.LicenseModel = ptr.String(jtv) 18129 } 18130 18131 case "MasterUserPassword": 18132 if value != nil { 18133 jtv, ok := value.(string) 18134 if !ok { 18135 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 18136 } 18137 sv.MasterUserPassword = ptr.String(jtv) 18138 } 18139 18140 case "MultiAZ": 18141 if value != nil { 18142 jtv, ok := value.(bool) 18143 if !ok { 18144 return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) 18145 } 18146 sv.MultiAZ = jtv 18147 } 18148 18149 case "PendingCloudWatchLogsExports": 18150 if err := awsRestjson1_deserializeDocumentAwsRdsPendingCloudWatchLogsExports(&sv.PendingCloudWatchLogsExports, value); err != nil { 18151 return err 18152 } 18153 18154 case "Port": 18155 if value != nil { 18156 jtv, ok := value.(json.Number) 18157 if !ok { 18158 return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) 18159 } 18160 i64, err := jtv.Int64() 18161 if err != nil { 18162 return err 18163 } 18164 sv.Port = int32(i64) 18165 } 18166 18167 case "ProcessorFeatures": 18168 if err := awsRestjson1_deserializeDocumentAwsRdsDbProcessorFeatures(&sv.ProcessorFeatures, value); err != nil { 18169 return err 18170 } 18171 18172 case "StorageType": 18173 if value != nil { 18174 jtv, ok := value.(string) 18175 if !ok { 18176 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 18177 } 18178 sv.StorageType = ptr.String(jtv) 18179 } 18180 18181 default: 18182 _, _ = key, value 18183 18184 } 18185 } 18186 *v = sv 18187 return nil 18188} 18189 18190func awsRestjson1_deserializeDocumentAwsRdsDbProcessorFeature(v **types.AwsRdsDbProcessorFeature, value interface{}) error { 18191 if v == nil { 18192 return fmt.Errorf("unexpected nil of type %T", v) 18193 } 18194 if value == nil { 18195 return nil 18196 } 18197 18198 shape, ok := value.(map[string]interface{}) 18199 if !ok { 18200 return fmt.Errorf("unexpected JSON type %v", value) 18201 } 18202 18203 var sv *types.AwsRdsDbProcessorFeature 18204 if *v == nil { 18205 sv = &types.AwsRdsDbProcessorFeature{} 18206 } else { 18207 sv = *v 18208 } 18209 18210 for key, value := range shape { 18211 switch key { 18212 case "Name": 18213 if value != nil { 18214 jtv, ok := value.(string) 18215 if !ok { 18216 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 18217 } 18218 sv.Name = ptr.String(jtv) 18219 } 18220 18221 case "Value": 18222 if value != nil { 18223 jtv, ok := value.(string) 18224 if !ok { 18225 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 18226 } 18227 sv.Value = ptr.String(jtv) 18228 } 18229 18230 default: 18231 _, _ = key, value 18232 18233 } 18234 } 18235 *v = sv 18236 return nil 18237} 18238 18239func awsRestjson1_deserializeDocumentAwsRdsDbProcessorFeatures(v *[]types.AwsRdsDbProcessorFeature, value interface{}) error { 18240 if v == nil { 18241 return fmt.Errorf("unexpected nil of type %T", v) 18242 } 18243 if value == nil { 18244 return nil 18245 } 18246 18247 shape, ok := value.([]interface{}) 18248 if !ok { 18249 return fmt.Errorf("unexpected JSON type %v", value) 18250 } 18251 18252 var cv []types.AwsRdsDbProcessorFeature 18253 if *v == nil { 18254 cv = []types.AwsRdsDbProcessorFeature{} 18255 } else { 18256 cv = *v 18257 } 18258 18259 for _, value := range shape { 18260 var col types.AwsRdsDbProcessorFeature 18261 destAddr := &col 18262 if err := awsRestjson1_deserializeDocumentAwsRdsDbProcessorFeature(&destAddr, value); err != nil { 18263 return err 18264 } 18265 col = *destAddr 18266 cv = append(cv, col) 18267 18268 } 18269 *v = cv 18270 return nil 18271} 18272 18273func awsRestjson1_deserializeDocumentAwsRdsDbSnapshotDetails(v **types.AwsRdsDbSnapshotDetails, value interface{}) error { 18274 if v == nil { 18275 return fmt.Errorf("unexpected nil of type %T", v) 18276 } 18277 if value == nil { 18278 return nil 18279 } 18280 18281 shape, ok := value.(map[string]interface{}) 18282 if !ok { 18283 return fmt.Errorf("unexpected JSON type %v", value) 18284 } 18285 18286 var sv *types.AwsRdsDbSnapshotDetails 18287 if *v == nil { 18288 sv = &types.AwsRdsDbSnapshotDetails{} 18289 } else { 18290 sv = *v 18291 } 18292 18293 for key, value := range shape { 18294 switch key { 18295 case "AllocatedStorage": 18296 if value != nil { 18297 jtv, ok := value.(json.Number) 18298 if !ok { 18299 return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) 18300 } 18301 i64, err := jtv.Int64() 18302 if err != nil { 18303 return err 18304 } 18305 sv.AllocatedStorage = int32(i64) 18306 } 18307 18308 case "AvailabilityZone": 18309 if value != nil { 18310 jtv, ok := value.(string) 18311 if !ok { 18312 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 18313 } 18314 sv.AvailabilityZone = ptr.String(jtv) 18315 } 18316 18317 case "DbInstanceIdentifier": 18318 if value != nil { 18319 jtv, ok := value.(string) 18320 if !ok { 18321 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 18322 } 18323 sv.DbInstanceIdentifier = ptr.String(jtv) 18324 } 18325 18326 case "DbiResourceId": 18327 if value != nil { 18328 jtv, ok := value.(string) 18329 if !ok { 18330 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 18331 } 18332 sv.DbiResourceId = ptr.String(jtv) 18333 } 18334 18335 case "DbSnapshotIdentifier": 18336 if value != nil { 18337 jtv, ok := value.(string) 18338 if !ok { 18339 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 18340 } 18341 sv.DbSnapshotIdentifier = ptr.String(jtv) 18342 } 18343 18344 case "Encrypted": 18345 if value != nil { 18346 jtv, ok := value.(bool) 18347 if !ok { 18348 return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) 18349 } 18350 sv.Encrypted = jtv 18351 } 18352 18353 case "Engine": 18354 if value != nil { 18355 jtv, ok := value.(string) 18356 if !ok { 18357 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 18358 } 18359 sv.Engine = ptr.String(jtv) 18360 } 18361 18362 case "EngineVersion": 18363 if value != nil { 18364 jtv, ok := value.(string) 18365 if !ok { 18366 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 18367 } 18368 sv.EngineVersion = ptr.String(jtv) 18369 } 18370 18371 case "IamDatabaseAuthenticationEnabled": 18372 if value != nil { 18373 jtv, ok := value.(bool) 18374 if !ok { 18375 return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) 18376 } 18377 sv.IamDatabaseAuthenticationEnabled = jtv 18378 } 18379 18380 case "InstanceCreateTime": 18381 if value != nil { 18382 jtv, ok := value.(string) 18383 if !ok { 18384 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 18385 } 18386 sv.InstanceCreateTime = ptr.String(jtv) 18387 } 18388 18389 case "Iops": 18390 if value != nil { 18391 jtv, ok := value.(json.Number) 18392 if !ok { 18393 return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) 18394 } 18395 i64, err := jtv.Int64() 18396 if err != nil { 18397 return err 18398 } 18399 sv.Iops = int32(i64) 18400 } 18401 18402 case "KmsKeyId": 18403 if value != nil { 18404 jtv, ok := value.(string) 18405 if !ok { 18406 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 18407 } 18408 sv.KmsKeyId = ptr.String(jtv) 18409 } 18410 18411 case "LicenseModel": 18412 if value != nil { 18413 jtv, ok := value.(string) 18414 if !ok { 18415 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 18416 } 18417 sv.LicenseModel = ptr.String(jtv) 18418 } 18419 18420 case "MasterUsername": 18421 if value != nil { 18422 jtv, ok := value.(string) 18423 if !ok { 18424 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 18425 } 18426 sv.MasterUsername = ptr.String(jtv) 18427 } 18428 18429 case "OptionGroupName": 18430 if value != nil { 18431 jtv, ok := value.(string) 18432 if !ok { 18433 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 18434 } 18435 sv.OptionGroupName = ptr.String(jtv) 18436 } 18437 18438 case "PercentProgress": 18439 if value != nil { 18440 jtv, ok := value.(json.Number) 18441 if !ok { 18442 return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) 18443 } 18444 i64, err := jtv.Int64() 18445 if err != nil { 18446 return err 18447 } 18448 sv.PercentProgress = int32(i64) 18449 } 18450 18451 case "Port": 18452 if value != nil { 18453 jtv, ok := value.(json.Number) 18454 if !ok { 18455 return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) 18456 } 18457 i64, err := jtv.Int64() 18458 if err != nil { 18459 return err 18460 } 18461 sv.Port = int32(i64) 18462 } 18463 18464 case "ProcessorFeatures": 18465 if err := awsRestjson1_deserializeDocumentAwsRdsDbProcessorFeatures(&sv.ProcessorFeatures, value); err != nil { 18466 return err 18467 } 18468 18469 case "SnapshotCreateTime": 18470 if value != nil { 18471 jtv, ok := value.(string) 18472 if !ok { 18473 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 18474 } 18475 sv.SnapshotCreateTime = ptr.String(jtv) 18476 } 18477 18478 case "SnapshotType": 18479 if value != nil { 18480 jtv, ok := value.(string) 18481 if !ok { 18482 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 18483 } 18484 sv.SnapshotType = ptr.String(jtv) 18485 } 18486 18487 case "SourceDbSnapshotIdentifier": 18488 if value != nil { 18489 jtv, ok := value.(string) 18490 if !ok { 18491 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 18492 } 18493 sv.SourceDbSnapshotIdentifier = ptr.String(jtv) 18494 } 18495 18496 case "SourceRegion": 18497 if value != nil { 18498 jtv, ok := value.(string) 18499 if !ok { 18500 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 18501 } 18502 sv.SourceRegion = ptr.String(jtv) 18503 } 18504 18505 case "Status": 18506 if value != nil { 18507 jtv, ok := value.(string) 18508 if !ok { 18509 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 18510 } 18511 sv.Status = ptr.String(jtv) 18512 } 18513 18514 case "StorageType": 18515 if value != nil { 18516 jtv, ok := value.(string) 18517 if !ok { 18518 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 18519 } 18520 sv.StorageType = ptr.String(jtv) 18521 } 18522 18523 case "TdeCredentialArn": 18524 if value != nil { 18525 jtv, ok := value.(string) 18526 if !ok { 18527 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 18528 } 18529 sv.TdeCredentialArn = ptr.String(jtv) 18530 } 18531 18532 case "Timezone": 18533 if value != nil { 18534 jtv, ok := value.(string) 18535 if !ok { 18536 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 18537 } 18538 sv.Timezone = ptr.String(jtv) 18539 } 18540 18541 case "VpcId": 18542 if value != nil { 18543 jtv, ok := value.(string) 18544 if !ok { 18545 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 18546 } 18547 sv.VpcId = ptr.String(jtv) 18548 } 18549 18550 default: 18551 _, _ = key, value 18552 18553 } 18554 } 18555 *v = sv 18556 return nil 18557} 18558 18559func awsRestjson1_deserializeDocumentAwsRdsDbStatusInfo(v **types.AwsRdsDbStatusInfo, value interface{}) error { 18560 if v == nil { 18561 return fmt.Errorf("unexpected nil of type %T", v) 18562 } 18563 if value == nil { 18564 return nil 18565 } 18566 18567 shape, ok := value.(map[string]interface{}) 18568 if !ok { 18569 return fmt.Errorf("unexpected JSON type %v", value) 18570 } 18571 18572 var sv *types.AwsRdsDbStatusInfo 18573 if *v == nil { 18574 sv = &types.AwsRdsDbStatusInfo{} 18575 } else { 18576 sv = *v 18577 } 18578 18579 for key, value := range shape { 18580 switch key { 18581 case "Message": 18582 if value != nil { 18583 jtv, ok := value.(string) 18584 if !ok { 18585 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 18586 } 18587 sv.Message = ptr.String(jtv) 18588 } 18589 18590 case "Normal": 18591 if value != nil { 18592 jtv, ok := value.(bool) 18593 if !ok { 18594 return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) 18595 } 18596 sv.Normal = jtv 18597 } 18598 18599 case "Status": 18600 if value != nil { 18601 jtv, ok := value.(string) 18602 if !ok { 18603 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 18604 } 18605 sv.Status = ptr.String(jtv) 18606 } 18607 18608 case "StatusType": 18609 if value != nil { 18610 jtv, ok := value.(string) 18611 if !ok { 18612 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 18613 } 18614 sv.StatusType = ptr.String(jtv) 18615 } 18616 18617 default: 18618 _, _ = key, value 18619 18620 } 18621 } 18622 *v = sv 18623 return nil 18624} 18625 18626func awsRestjson1_deserializeDocumentAwsRdsDbStatusInfos(v *[]types.AwsRdsDbStatusInfo, value interface{}) error { 18627 if v == nil { 18628 return fmt.Errorf("unexpected nil of type %T", v) 18629 } 18630 if value == nil { 18631 return nil 18632 } 18633 18634 shape, ok := value.([]interface{}) 18635 if !ok { 18636 return fmt.Errorf("unexpected JSON type %v", value) 18637 } 18638 18639 var cv []types.AwsRdsDbStatusInfo 18640 if *v == nil { 18641 cv = []types.AwsRdsDbStatusInfo{} 18642 } else { 18643 cv = *v 18644 } 18645 18646 for _, value := range shape { 18647 var col types.AwsRdsDbStatusInfo 18648 destAddr := &col 18649 if err := awsRestjson1_deserializeDocumentAwsRdsDbStatusInfo(&destAddr, value); err != nil { 18650 return err 18651 } 18652 col = *destAddr 18653 cv = append(cv, col) 18654 18655 } 18656 *v = cv 18657 return nil 18658} 18659 18660func awsRestjson1_deserializeDocumentAwsRdsDbSubnetGroup(v **types.AwsRdsDbSubnetGroup, value interface{}) error { 18661 if v == nil { 18662 return fmt.Errorf("unexpected nil of type %T", v) 18663 } 18664 if value == nil { 18665 return nil 18666 } 18667 18668 shape, ok := value.(map[string]interface{}) 18669 if !ok { 18670 return fmt.Errorf("unexpected JSON type %v", value) 18671 } 18672 18673 var sv *types.AwsRdsDbSubnetGroup 18674 if *v == nil { 18675 sv = &types.AwsRdsDbSubnetGroup{} 18676 } else { 18677 sv = *v 18678 } 18679 18680 for key, value := range shape { 18681 switch key { 18682 case "DbSubnetGroupArn": 18683 if value != nil { 18684 jtv, ok := value.(string) 18685 if !ok { 18686 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 18687 } 18688 sv.DbSubnetGroupArn = ptr.String(jtv) 18689 } 18690 18691 case "DbSubnetGroupDescription": 18692 if value != nil { 18693 jtv, ok := value.(string) 18694 if !ok { 18695 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 18696 } 18697 sv.DbSubnetGroupDescription = ptr.String(jtv) 18698 } 18699 18700 case "DbSubnetGroupName": 18701 if value != nil { 18702 jtv, ok := value.(string) 18703 if !ok { 18704 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 18705 } 18706 sv.DbSubnetGroupName = ptr.String(jtv) 18707 } 18708 18709 case "SubnetGroupStatus": 18710 if value != nil { 18711 jtv, ok := value.(string) 18712 if !ok { 18713 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 18714 } 18715 sv.SubnetGroupStatus = ptr.String(jtv) 18716 } 18717 18718 case "Subnets": 18719 if err := awsRestjson1_deserializeDocumentAwsRdsDbSubnetGroupSubnets(&sv.Subnets, value); err != nil { 18720 return err 18721 } 18722 18723 case "VpcId": 18724 if value != nil { 18725 jtv, ok := value.(string) 18726 if !ok { 18727 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 18728 } 18729 sv.VpcId = ptr.String(jtv) 18730 } 18731 18732 default: 18733 _, _ = key, value 18734 18735 } 18736 } 18737 *v = sv 18738 return nil 18739} 18740 18741func awsRestjson1_deserializeDocumentAwsRdsDbSubnetGroupSubnet(v **types.AwsRdsDbSubnetGroupSubnet, value interface{}) error { 18742 if v == nil { 18743 return fmt.Errorf("unexpected nil of type %T", v) 18744 } 18745 if value == nil { 18746 return nil 18747 } 18748 18749 shape, ok := value.(map[string]interface{}) 18750 if !ok { 18751 return fmt.Errorf("unexpected JSON type %v", value) 18752 } 18753 18754 var sv *types.AwsRdsDbSubnetGroupSubnet 18755 if *v == nil { 18756 sv = &types.AwsRdsDbSubnetGroupSubnet{} 18757 } else { 18758 sv = *v 18759 } 18760 18761 for key, value := range shape { 18762 switch key { 18763 case "SubnetAvailabilityZone": 18764 if err := awsRestjson1_deserializeDocumentAwsRdsDbSubnetGroupSubnetAvailabilityZone(&sv.SubnetAvailabilityZone, value); err != nil { 18765 return err 18766 } 18767 18768 case "SubnetIdentifier": 18769 if value != nil { 18770 jtv, ok := value.(string) 18771 if !ok { 18772 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 18773 } 18774 sv.SubnetIdentifier = ptr.String(jtv) 18775 } 18776 18777 case "SubnetStatus": 18778 if value != nil { 18779 jtv, ok := value.(string) 18780 if !ok { 18781 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 18782 } 18783 sv.SubnetStatus = ptr.String(jtv) 18784 } 18785 18786 default: 18787 _, _ = key, value 18788 18789 } 18790 } 18791 *v = sv 18792 return nil 18793} 18794 18795func awsRestjson1_deserializeDocumentAwsRdsDbSubnetGroupSubnetAvailabilityZone(v **types.AwsRdsDbSubnetGroupSubnetAvailabilityZone, value interface{}) error { 18796 if v == nil { 18797 return fmt.Errorf("unexpected nil of type %T", v) 18798 } 18799 if value == nil { 18800 return nil 18801 } 18802 18803 shape, ok := value.(map[string]interface{}) 18804 if !ok { 18805 return fmt.Errorf("unexpected JSON type %v", value) 18806 } 18807 18808 var sv *types.AwsRdsDbSubnetGroupSubnetAvailabilityZone 18809 if *v == nil { 18810 sv = &types.AwsRdsDbSubnetGroupSubnetAvailabilityZone{} 18811 } else { 18812 sv = *v 18813 } 18814 18815 for key, value := range shape { 18816 switch key { 18817 case "Name": 18818 if value != nil { 18819 jtv, ok := value.(string) 18820 if !ok { 18821 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 18822 } 18823 sv.Name = ptr.String(jtv) 18824 } 18825 18826 default: 18827 _, _ = key, value 18828 18829 } 18830 } 18831 *v = sv 18832 return nil 18833} 18834 18835func awsRestjson1_deserializeDocumentAwsRdsDbSubnetGroupSubnets(v *[]types.AwsRdsDbSubnetGroupSubnet, value interface{}) error { 18836 if v == nil { 18837 return fmt.Errorf("unexpected nil of type %T", v) 18838 } 18839 if value == nil { 18840 return nil 18841 } 18842 18843 shape, ok := value.([]interface{}) 18844 if !ok { 18845 return fmt.Errorf("unexpected JSON type %v", value) 18846 } 18847 18848 var cv []types.AwsRdsDbSubnetGroupSubnet 18849 if *v == nil { 18850 cv = []types.AwsRdsDbSubnetGroupSubnet{} 18851 } else { 18852 cv = *v 18853 } 18854 18855 for _, value := range shape { 18856 var col types.AwsRdsDbSubnetGroupSubnet 18857 destAddr := &col 18858 if err := awsRestjson1_deserializeDocumentAwsRdsDbSubnetGroupSubnet(&destAddr, value); err != nil { 18859 return err 18860 } 18861 col = *destAddr 18862 cv = append(cv, col) 18863 18864 } 18865 *v = cv 18866 return nil 18867} 18868 18869func awsRestjson1_deserializeDocumentAwsRdsPendingCloudWatchLogsExports(v **types.AwsRdsPendingCloudWatchLogsExports, value interface{}) error { 18870 if v == nil { 18871 return fmt.Errorf("unexpected nil of type %T", v) 18872 } 18873 if value == nil { 18874 return nil 18875 } 18876 18877 shape, ok := value.(map[string]interface{}) 18878 if !ok { 18879 return fmt.Errorf("unexpected JSON type %v", value) 18880 } 18881 18882 var sv *types.AwsRdsPendingCloudWatchLogsExports 18883 if *v == nil { 18884 sv = &types.AwsRdsPendingCloudWatchLogsExports{} 18885 } else { 18886 sv = *v 18887 } 18888 18889 for key, value := range shape { 18890 switch key { 18891 case "LogTypesToDisable": 18892 if err := awsRestjson1_deserializeDocumentStringList(&sv.LogTypesToDisable, value); err != nil { 18893 return err 18894 } 18895 18896 case "LogTypesToEnable": 18897 if err := awsRestjson1_deserializeDocumentStringList(&sv.LogTypesToEnable, value); err != nil { 18898 return err 18899 } 18900 18901 default: 18902 _, _ = key, value 18903 18904 } 18905 } 18906 *v = sv 18907 return nil 18908} 18909 18910func awsRestjson1_deserializeDocumentAwsRedshiftClusterClusterNode(v **types.AwsRedshiftClusterClusterNode, value interface{}) error { 18911 if v == nil { 18912 return fmt.Errorf("unexpected nil of type %T", v) 18913 } 18914 if value == nil { 18915 return nil 18916 } 18917 18918 shape, ok := value.(map[string]interface{}) 18919 if !ok { 18920 return fmt.Errorf("unexpected JSON type %v", value) 18921 } 18922 18923 var sv *types.AwsRedshiftClusterClusterNode 18924 if *v == nil { 18925 sv = &types.AwsRedshiftClusterClusterNode{} 18926 } else { 18927 sv = *v 18928 } 18929 18930 for key, value := range shape { 18931 switch key { 18932 case "NodeRole": 18933 if value != nil { 18934 jtv, ok := value.(string) 18935 if !ok { 18936 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 18937 } 18938 sv.NodeRole = ptr.String(jtv) 18939 } 18940 18941 case "PrivateIpAddress": 18942 if value != nil { 18943 jtv, ok := value.(string) 18944 if !ok { 18945 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 18946 } 18947 sv.PrivateIpAddress = ptr.String(jtv) 18948 } 18949 18950 case "PublicIpAddress": 18951 if value != nil { 18952 jtv, ok := value.(string) 18953 if !ok { 18954 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 18955 } 18956 sv.PublicIpAddress = ptr.String(jtv) 18957 } 18958 18959 default: 18960 _, _ = key, value 18961 18962 } 18963 } 18964 *v = sv 18965 return nil 18966} 18967 18968func awsRestjson1_deserializeDocumentAwsRedshiftClusterClusterNodes(v *[]types.AwsRedshiftClusterClusterNode, value interface{}) error { 18969 if v == nil { 18970 return fmt.Errorf("unexpected nil of type %T", v) 18971 } 18972 if value == nil { 18973 return nil 18974 } 18975 18976 shape, ok := value.([]interface{}) 18977 if !ok { 18978 return fmt.Errorf("unexpected JSON type %v", value) 18979 } 18980 18981 var cv []types.AwsRedshiftClusterClusterNode 18982 if *v == nil { 18983 cv = []types.AwsRedshiftClusterClusterNode{} 18984 } else { 18985 cv = *v 18986 } 18987 18988 for _, value := range shape { 18989 var col types.AwsRedshiftClusterClusterNode 18990 destAddr := &col 18991 if err := awsRestjson1_deserializeDocumentAwsRedshiftClusterClusterNode(&destAddr, value); err != nil { 18992 return err 18993 } 18994 col = *destAddr 18995 cv = append(cv, col) 18996 18997 } 18998 *v = cv 18999 return nil 19000} 19001 19002func awsRestjson1_deserializeDocumentAwsRedshiftClusterClusterParameterGroup(v **types.AwsRedshiftClusterClusterParameterGroup, value interface{}) error { 19003 if v == nil { 19004 return fmt.Errorf("unexpected nil of type %T", v) 19005 } 19006 if value == nil { 19007 return nil 19008 } 19009 19010 shape, ok := value.(map[string]interface{}) 19011 if !ok { 19012 return fmt.Errorf("unexpected JSON type %v", value) 19013 } 19014 19015 var sv *types.AwsRedshiftClusterClusterParameterGroup 19016 if *v == nil { 19017 sv = &types.AwsRedshiftClusterClusterParameterGroup{} 19018 } else { 19019 sv = *v 19020 } 19021 19022 for key, value := range shape { 19023 switch key { 19024 case "ClusterParameterStatusList": 19025 if err := awsRestjson1_deserializeDocumentAwsRedshiftClusterClusterParameterStatusList(&sv.ClusterParameterStatusList, value); err != nil { 19026 return err 19027 } 19028 19029 case "ParameterApplyStatus": 19030 if value != nil { 19031 jtv, ok := value.(string) 19032 if !ok { 19033 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 19034 } 19035 sv.ParameterApplyStatus = ptr.String(jtv) 19036 } 19037 19038 case "ParameterGroupName": 19039 if value != nil { 19040 jtv, ok := value.(string) 19041 if !ok { 19042 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 19043 } 19044 sv.ParameterGroupName = ptr.String(jtv) 19045 } 19046 19047 default: 19048 _, _ = key, value 19049 19050 } 19051 } 19052 *v = sv 19053 return nil 19054} 19055 19056func awsRestjson1_deserializeDocumentAwsRedshiftClusterClusterParameterGroups(v *[]types.AwsRedshiftClusterClusterParameterGroup, value interface{}) error { 19057 if v == nil { 19058 return fmt.Errorf("unexpected nil of type %T", v) 19059 } 19060 if value == nil { 19061 return nil 19062 } 19063 19064 shape, ok := value.([]interface{}) 19065 if !ok { 19066 return fmt.Errorf("unexpected JSON type %v", value) 19067 } 19068 19069 var cv []types.AwsRedshiftClusterClusterParameterGroup 19070 if *v == nil { 19071 cv = []types.AwsRedshiftClusterClusterParameterGroup{} 19072 } else { 19073 cv = *v 19074 } 19075 19076 for _, value := range shape { 19077 var col types.AwsRedshiftClusterClusterParameterGroup 19078 destAddr := &col 19079 if err := awsRestjson1_deserializeDocumentAwsRedshiftClusterClusterParameterGroup(&destAddr, value); err != nil { 19080 return err 19081 } 19082 col = *destAddr 19083 cv = append(cv, col) 19084 19085 } 19086 *v = cv 19087 return nil 19088} 19089 19090func awsRestjson1_deserializeDocumentAwsRedshiftClusterClusterParameterStatus(v **types.AwsRedshiftClusterClusterParameterStatus, value interface{}) error { 19091 if v == nil { 19092 return fmt.Errorf("unexpected nil of type %T", v) 19093 } 19094 if value == nil { 19095 return nil 19096 } 19097 19098 shape, ok := value.(map[string]interface{}) 19099 if !ok { 19100 return fmt.Errorf("unexpected JSON type %v", value) 19101 } 19102 19103 var sv *types.AwsRedshiftClusterClusterParameterStatus 19104 if *v == nil { 19105 sv = &types.AwsRedshiftClusterClusterParameterStatus{} 19106 } else { 19107 sv = *v 19108 } 19109 19110 for key, value := range shape { 19111 switch key { 19112 case "ParameterApplyErrorDescription": 19113 if value != nil { 19114 jtv, ok := value.(string) 19115 if !ok { 19116 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 19117 } 19118 sv.ParameterApplyErrorDescription = ptr.String(jtv) 19119 } 19120 19121 case "ParameterApplyStatus": 19122 if value != nil { 19123 jtv, ok := value.(string) 19124 if !ok { 19125 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 19126 } 19127 sv.ParameterApplyStatus = ptr.String(jtv) 19128 } 19129 19130 case "ParameterName": 19131 if value != nil { 19132 jtv, ok := value.(string) 19133 if !ok { 19134 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 19135 } 19136 sv.ParameterName = ptr.String(jtv) 19137 } 19138 19139 default: 19140 _, _ = key, value 19141 19142 } 19143 } 19144 *v = sv 19145 return nil 19146} 19147 19148func awsRestjson1_deserializeDocumentAwsRedshiftClusterClusterParameterStatusList(v *[]types.AwsRedshiftClusterClusterParameterStatus, value interface{}) error { 19149 if v == nil { 19150 return fmt.Errorf("unexpected nil of type %T", v) 19151 } 19152 if value == nil { 19153 return nil 19154 } 19155 19156 shape, ok := value.([]interface{}) 19157 if !ok { 19158 return fmt.Errorf("unexpected JSON type %v", value) 19159 } 19160 19161 var cv []types.AwsRedshiftClusterClusterParameterStatus 19162 if *v == nil { 19163 cv = []types.AwsRedshiftClusterClusterParameterStatus{} 19164 } else { 19165 cv = *v 19166 } 19167 19168 for _, value := range shape { 19169 var col types.AwsRedshiftClusterClusterParameterStatus 19170 destAddr := &col 19171 if err := awsRestjson1_deserializeDocumentAwsRedshiftClusterClusterParameterStatus(&destAddr, value); err != nil { 19172 return err 19173 } 19174 col = *destAddr 19175 cv = append(cv, col) 19176 19177 } 19178 *v = cv 19179 return nil 19180} 19181 19182func awsRestjson1_deserializeDocumentAwsRedshiftClusterClusterSecurityGroup(v **types.AwsRedshiftClusterClusterSecurityGroup, value interface{}) error { 19183 if v == nil { 19184 return fmt.Errorf("unexpected nil of type %T", v) 19185 } 19186 if value == nil { 19187 return nil 19188 } 19189 19190 shape, ok := value.(map[string]interface{}) 19191 if !ok { 19192 return fmt.Errorf("unexpected JSON type %v", value) 19193 } 19194 19195 var sv *types.AwsRedshiftClusterClusterSecurityGroup 19196 if *v == nil { 19197 sv = &types.AwsRedshiftClusterClusterSecurityGroup{} 19198 } else { 19199 sv = *v 19200 } 19201 19202 for key, value := range shape { 19203 switch key { 19204 case "ClusterSecurityGroupName": 19205 if value != nil { 19206 jtv, ok := value.(string) 19207 if !ok { 19208 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 19209 } 19210 sv.ClusterSecurityGroupName = ptr.String(jtv) 19211 } 19212 19213 case "Status": 19214 if value != nil { 19215 jtv, ok := value.(string) 19216 if !ok { 19217 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 19218 } 19219 sv.Status = ptr.String(jtv) 19220 } 19221 19222 default: 19223 _, _ = key, value 19224 19225 } 19226 } 19227 *v = sv 19228 return nil 19229} 19230 19231func awsRestjson1_deserializeDocumentAwsRedshiftClusterClusterSecurityGroups(v *[]types.AwsRedshiftClusterClusterSecurityGroup, value interface{}) error { 19232 if v == nil { 19233 return fmt.Errorf("unexpected nil of type %T", v) 19234 } 19235 if value == nil { 19236 return nil 19237 } 19238 19239 shape, ok := value.([]interface{}) 19240 if !ok { 19241 return fmt.Errorf("unexpected JSON type %v", value) 19242 } 19243 19244 var cv []types.AwsRedshiftClusterClusterSecurityGroup 19245 if *v == nil { 19246 cv = []types.AwsRedshiftClusterClusterSecurityGroup{} 19247 } else { 19248 cv = *v 19249 } 19250 19251 for _, value := range shape { 19252 var col types.AwsRedshiftClusterClusterSecurityGroup 19253 destAddr := &col 19254 if err := awsRestjson1_deserializeDocumentAwsRedshiftClusterClusterSecurityGroup(&destAddr, value); err != nil { 19255 return err 19256 } 19257 col = *destAddr 19258 cv = append(cv, col) 19259 19260 } 19261 *v = cv 19262 return nil 19263} 19264 19265func awsRestjson1_deserializeDocumentAwsRedshiftClusterClusterSnapshotCopyStatus(v **types.AwsRedshiftClusterClusterSnapshotCopyStatus, value interface{}) error { 19266 if v == nil { 19267 return fmt.Errorf("unexpected nil of type %T", v) 19268 } 19269 if value == nil { 19270 return nil 19271 } 19272 19273 shape, ok := value.(map[string]interface{}) 19274 if !ok { 19275 return fmt.Errorf("unexpected JSON type %v", value) 19276 } 19277 19278 var sv *types.AwsRedshiftClusterClusterSnapshotCopyStatus 19279 if *v == nil { 19280 sv = &types.AwsRedshiftClusterClusterSnapshotCopyStatus{} 19281 } else { 19282 sv = *v 19283 } 19284 19285 for key, value := range shape { 19286 switch key { 19287 case "DestinationRegion": 19288 if value != nil { 19289 jtv, ok := value.(string) 19290 if !ok { 19291 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 19292 } 19293 sv.DestinationRegion = ptr.String(jtv) 19294 } 19295 19296 case "ManualSnapshotRetentionPeriod": 19297 if value != nil { 19298 jtv, ok := value.(json.Number) 19299 if !ok { 19300 return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) 19301 } 19302 i64, err := jtv.Int64() 19303 if err != nil { 19304 return err 19305 } 19306 sv.ManualSnapshotRetentionPeriod = int32(i64) 19307 } 19308 19309 case "RetentionPeriod": 19310 if value != nil { 19311 jtv, ok := value.(json.Number) 19312 if !ok { 19313 return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) 19314 } 19315 i64, err := jtv.Int64() 19316 if err != nil { 19317 return err 19318 } 19319 sv.RetentionPeriod = int32(i64) 19320 } 19321 19322 case "SnapshotCopyGrantName": 19323 if value != nil { 19324 jtv, ok := value.(string) 19325 if !ok { 19326 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 19327 } 19328 sv.SnapshotCopyGrantName = ptr.String(jtv) 19329 } 19330 19331 default: 19332 _, _ = key, value 19333 19334 } 19335 } 19336 *v = sv 19337 return nil 19338} 19339 19340func awsRestjson1_deserializeDocumentAwsRedshiftClusterDeferredMaintenanceWindow(v **types.AwsRedshiftClusterDeferredMaintenanceWindow, value interface{}) error { 19341 if v == nil { 19342 return fmt.Errorf("unexpected nil of type %T", v) 19343 } 19344 if value == nil { 19345 return nil 19346 } 19347 19348 shape, ok := value.(map[string]interface{}) 19349 if !ok { 19350 return fmt.Errorf("unexpected JSON type %v", value) 19351 } 19352 19353 var sv *types.AwsRedshiftClusterDeferredMaintenanceWindow 19354 if *v == nil { 19355 sv = &types.AwsRedshiftClusterDeferredMaintenanceWindow{} 19356 } else { 19357 sv = *v 19358 } 19359 19360 for key, value := range shape { 19361 switch key { 19362 case "DeferMaintenanceEndTime": 19363 if value != nil { 19364 jtv, ok := value.(string) 19365 if !ok { 19366 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 19367 } 19368 sv.DeferMaintenanceEndTime = ptr.String(jtv) 19369 } 19370 19371 case "DeferMaintenanceIdentifier": 19372 if value != nil { 19373 jtv, ok := value.(string) 19374 if !ok { 19375 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 19376 } 19377 sv.DeferMaintenanceIdentifier = ptr.String(jtv) 19378 } 19379 19380 case "DeferMaintenanceStartTime": 19381 if value != nil { 19382 jtv, ok := value.(string) 19383 if !ok { 19384 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 19385 } 19386 sv.DeferMaintenanceStartTime = ptr.String(jtv) 19387 } 19388 19389 default: 19390 _, _ = key, value 19391 19392 } 19393 } 19394 *v = sv 19395 return nil 19396} 19397 19398func awsRestjson1_deserializeDocumentAwsRedshiftClusterDeferredMaintenanceWindows(v *[]types.AwsRedshiftClusterDeferredMaintenanceWindow, value interface{}) error { 19399 if v == nil { 19400 return fmt.Errorf("unexpected nil of type %T", v) 19401 } 19402 if value == nil { 19403 return nil 19404 } 19405 19406 shape, ok := value.([]interface{}) 19407 if !ok { 19408 return fmt.Errorf("unexpected JSON type %v", value) 19409 } 19410 19411 var cv []types.AwsRedshiftClusterDeferredMaintenanceWindow 19412 if *v == nil { 19413 cv = []types.AwsRedshiftClusterDeferredMaintenanceWindow{} 19414 } else { 19415 cv = *v 19416 } 19417 19418 for _, value := range shape { 19419 var col types.AwsRedshiftClusterDeferredMaintenanceWindow 19420 destAddr := &col 19421 if err := awsRestjson1_deserializeDocumentAwsRedshiftClusterDeferredMaintenanceWindow(&destAddr, value); err != nil { 19422 return err 19423 } 19424 col = *destAddr 19425 cv = append(cv, col) 19426 19427 } 19428 *v = cv 19429 return nil 19430} 19431 19432func awsRestjson1_deserializeDocumentAwsRedshiftClusterDetails(v **types.AwsRedshiftClusterDetails, value interface{}) error { 19433 if v == nil { 19434 return fmt.Errorf("unexpected nil of type %T", v) 19435 } 19436 if value == nil { 19437 return nil 19438 } 19439 19440 shape, ok := value.(map[string]interface{}) 19441 if !ok { 19442 return fmt.Errorf("unexpected JSON type %v", value) 19443 } 19444 19445 var sv *types.AwsRedshiftClusterDetails 19446 if *v == nil { 19447 sv = &types.AwsRedshiftClusterDetails{} 19448 } else { 19449 sv = *v 19450 } 19451 19452 for key, value := range shape { 19453 switch key { 19454 case "AllowVersionUpgrade": 19455 if value != nil { 19456 jtv, ok := value.(bool) 19457 if !ok { 19458 return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) 19459 } 19460 sv.AllowVersionUpgrade = jtv 19461 } 19462 19463 case "AutomatedSnapshotRetentionPeriod": 19464 if value != nil { 19465 jtv, ok := value.(json.Number) 19466 if !ok { 19467 return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) 19468 } 19469 i64, err := jtv.Int64() 19470 if err != nil { 19471 return err 19472 } 19473 sv.AutomatedSnapshotRetentionPeriod = int32(i64) 19474 } 19475 19476 case "AvailabilityZone": 19477 if value != nil { 19478 jtv, ok := value.(string) 19479 if !ok { 19480 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 19481 } 19482 sv.AvailabilityZone = ptr.String(jtv) 19483 } 19484 19485 case "ClusterAvailabilityStatus": 19486 if value != nil { 19487 jtv, ok := value.(string) 19488 if !ok { 19489 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 19490 } 19491 sv.ClusterAvailabilityStatus = ptr.String(jtv) 19492 } 19493 19494 case "ClusterCreateTime": 19495 if value != nil { 19496 jtv, ok := value.(string) 19497 if !ok { 19498 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 19499 } 19500 sv.ClusterCreateTime = ptr.String(jtv) 19501 } 19502 19503 case "ClusterIdentifier": 19504 if value != nil { 19505 jtv, ok := value.(string) 19506 if !ok { 19507 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 19508 } 19509 sv.ClusterIdentifier = ptr.String(jtv) 19510 } 19511 19512 case "ClusterNodes": 19513 if err := awsRestjson1_deserializeDocumentAwsRedshiftClusterClusterNodes(&sv.ClusterNodes, value); err != nil { 19514 return err 19515 } 19516 19517 case "ClusterParameterGroups": 19518 if err := awsRestjson1_deserializeDocumentAwsRedshiftClusterClusterParameterGroups(&sv.ClusterParameterGroups, value); err != nil { 19519 return err 19520 } 19521 19522 case "ClusterPublicKey": 19523 if value != nil { 19524 jtv, ok := value.(string) 19525 if !ok { 19526 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 19527 } 19528 sv.ClusterPublicKey = ptr.String(jtv) 19529 } 19530 19531 case "ClusterRevisionNumber": 19532 if value != nil { 19533 jtv, ok := value.(string) 19534 if !ok { 19535 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 19536 } 19537 sv.ClusterRevisionNumber = ptr.String(jtv) 19538 } 19539 19540 case "ClusterSecurityGroups": 19541 if err := awsRestjson1_deserializeDocumentAwsRedshiftClusterClusterSecurityGroups(&sv.ClusterSecurityGroups, value); err != nil { 19542 return err 19543 } 19544 19545 case "ClusterSnapshotCopyStatus": 19546 if err := awsRestjson1_deserializeDocumentAwsRedshiftClusterClusterSnapshotCopyStatus(&sv.ClusterSnapshotCopyStatus, value); err != nil { 19547 return err 19548 } 19549 19550 case "ClusterStatus": 19551 if value != nil { 19552 jtv, ok := value.(string) 19553 if !ok { 19554 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 19555 } 19556 sv.ClusterStatus = ptr.String(jtv) 19557 } 19558 19559 case "ClusterSubnetGroupName": 19560 if value != nil { 19561 jtv, ok := value.(string) 19562 if !ok { 19563 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 19564 } 19565 sv.ClusterSubnetGroupName = ptr.String(jtv) 19566 } 19567 19568 case "ClusterVersion": 19569 if value != nil { 19570 jtv, ok := value.(string) 19571 if !ok { 19572 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 19573 } 19574 sv.ClusterVersion = ptr.String(jtv) 19575 } 19576 19577 case "DBName": 19578 if value != nil { 19579 jtv, ok := value.(string) 19580 if !ok { 19581 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 19582 } 19583 sv.DBName = ptr.String(jtv) 19584 } 19585 19586 case "DeferredMaintenanceWindows": 19587 if err := awsRestjson1_deserializeDocumentAwsRedshiftClusterDeferredMaintenanceWindows(&sv.DeferredMaintenanceWindows, value); err != nil { 19588 return err 19589 } 19590 19591 case "ElasticIpStatus": 19592 if err := awsRestjson1_deserializeDocumentAwsRedshiftClusterElasticIpStatus(&sv.ElasticIpStatus, value); err != nil { 19593 return err 19594 } 19595 19596 case "ElasticResizeNumberOfNodeOptions": 19597 if value != nil { 19598 jtv, ok := value.(string) 19599 if !ok { 19600 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 19601 } 19602 sv.ElasticResizeNumberOfNodeOptions = ptr.String(jtv) 19603 } 19604 19605 case "Encrypted": 19606 if value != nil { 19607 jtv, ok := value.(bool) 19608 if !ok { 19609 return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) 19610 } 19611 sv.Encrypted = jtv 19612 } 19613 19614 case "Endpoint": 19615 if err := awsRestjson1_deserializeDocumentAwsRedshiftClusterEndpoint(&sv.Endpoint, value); err != nil { 19616 return err 19617 } 19618 19619 case "EnhancedVpcRouting": 19620 if value != nil { 19621 jtv, ok := value.(bool) 19622 if !ok { 19623 return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) 19624 } 19625 sv.EnhancedVpcRouting = jtv 19626 } 19627 19628 case "ExpectedNextSnapshotScheduleTime": 19629 if value != nil { 19630 jtv, ok := value.(string) 19631 if !ok { 19632 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 19633 } 19634 sv.ExpectedNextSnapshotScheduleTime = ptr.String(jtv) 19635 } 19636 19637 case "ExpectedNextSnapshotScheduleTimeStatus": 19638 if value != nil { 19639 jtv, ok := value.(string) 19640 if !ok { 19641 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 19642 } 19643 sv.ExpectedNextSnapshotScheduleTimeStatus = ptr.String(jtv) 19644 } 19645 19646 case "HsmStatus": 19647 if err := awsRestjson1_deserializeDocumentAwsRedshiftClusterHsmStatus(&sv.HsmStatus, value); err != nil { 19648 return err 19649 } 19650 19651 case "IamRoles": 19652 if err := awsRestjson1_deserializeDocumentAwsRedshiftClusterIamRoles(&sv.IamRoles, value); err != nil { 19653 return err 19654 } 19655 19656 case "KmsKeyId": 19657 if value != nil { 19658 jtv, ok := value.(string) 19659 if !ok { 19660 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 19661 } 19662 sv.KmsKeyId = ptr.String(jtv) 19663 } 19664 19665 case "MaintenanceTrackName": 19666 if value != nil { 19667 jtv, ok := value.(string) 19668 if !ok { 19669 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 19670 } 19671 sv.MaintenanceTrackName = ptr.String(jtv) 19672 } 19673 19674 case "ManualSnapshotRetentionPeriod": 19675 if value != nil { 19676 jtv, ok := value.(json.Number) 19677 if !ok { 19678 return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) 19679 } 19680 i64, err := jtv.Int64() 19681 if err != nil { 19682 return err 19683 } 19684 sv.ManualSnapshotRetentionPeriod = int32(i64) 19685 } 19686 19687 case "MasterUsername": 19688 if value != nil { 19689 jtv, ok := value.(string) 19690 if !ok { 19691 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 19692 } 19693 sv.MasterUsername = ptr.String(jtv) 19694 } 19695 19696 case "NextMaintenanceWindowStartTime": 19697 if value != nil { 19698 jtv, ok := value.(string) 19699 if !ok { 19700 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 19701 } 19702 sv.NextMaintenanceWindowStartTime = ptr.String(jtv) 19703 } 19704 19705 case "NodeType": 19706 if value != nil { 19707 jtv, ok := value.(string) 19708 if !ok { 19709 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 19710 } 19711 sv.NodeType = ptr.String(jtv) 19712 } 19713 19714 case "NumberOfNodes": 19715 if value != nil { 19716 jtv, ok := value.(json.Number) 19717 if !ok { 19718 return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) 19719 } 19720 i64, err := jtv.Int64() 19721 if err != nil { 19722 return err 19723 } 19724 sv.NumberOfNodes = int32(i64) 19725 } 19726 19727 case "PendingActions": 19728 if err := awsRestjson1_deserializeDocumentStringList(&sv.PendingActions, value); err != nil { 19729 return err 19730 } 19731 19732 case "PendingModifiedValues": 19733 if err := awsRestjson1_deserializeDocumentAwsRedshiftClusterPendingModifiedValues(&sv.PendingModifiedValues, value); err != nil { 19734 return err 19735 } 19736 19737 case "PreferredMaintenanceWindow": 19738 if value != nil { 19739 jtv, ok := value.(string) 19740 if !ok { 19741 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 19742 } 19743 sv.PreferredMaintenanceWindow = ptr.String(jtv) 19744 } 19745 19746 case "PubliclyAccessible": 19747 if value != nil { 19748 jtv, ok := value.(bool) 19749 if !ok { 19750 return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) 19751 } 19752 sv.PubliclyAccessible = jtv 19753 } 19754 19755 case "ResizeInfo": 19756 if err := awsRestjson1_deserializeDocumentAwsRedshiftClusterResizeInfo(&sv.ResizeInfo, value); err != nil { 19757 return err 19758 } 19759 19760 case "RestoreStatus": 19761 if err := awsRestjson1_deserializeDocumentAwsRedshiftClusterRestoreStatus(&sv.RestoreStatus, value); err != nil { 19762 return err 19763 } 19764 19765 case "SnapshotScheduleIdentifier": 19766 if value != nil { 19767 jtv, ok := value.(string) 19768 if !ok { 19769 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 19770 } 19771 sv.SnapshotScheduleIdentifier = ptr.String(jtv) 19772 } 19773 19774 case "SnapshotScheduleState": 19775 if value != nil { 19776 jtv, ok := value.(string) 19777 if !ok { 19778 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 19779 } 19780 sv.SnapshotScheduleState = ptr.String(jtv) 19781 } 19782 19783 case "VpcId": 19784 if value != nil { 19785 jtv, ok := value.(string) 19786 if !ok { 19787 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 19788 } 19789 sv.VpcId = ptr.String(jtv) 19790 } 19791 19792 case "VpcSecurityGroups": 19793 if err := awsRestjson1_deserializeDocumentAwsRedshiftClusterVpcSecurityGroups(&sv.VpcSecurityGroups, value); err != nil { 19794 return err 19795 } 19796 19797 default: 19798 _, _ = key, value 19799 19800 } 19801 } 19802 *v = sv 19803 return nil 19804} 19805 19806func awsRestjson1_deserializeDocumentAwsRedshiftClusterElasticIpStatus(v **types.AwsRedshiftClusterElasticIpStatus, value interface{}) error { 19807 if v == nil { 19808 return fmt.Errorf("unexpected nil of type %T", v) 19809 } 19810 if value == nil { 19811 return nil 19812 } 19813 19814 shape, ok := value.(map[string]interface{}) 19815 if !ok { 19816 return fmt.Errorf("unexpected JSON type %v", value) 19817 } 19818 19819 var sv *types.AwsRedshiftClusterElasticIpStatus 19820 if *v == nil { 19821 sv = &types.AwsRedshiftClusterElasticIpStatus{} 19822 } else { 19823 sv = *v 19824 } 19825 19826 for key, value := range shape { 19827 switch key { 19828 case "ElasticIp": 19829 if value != nil { 19830 jtv, ok := value.(string) 19831 if !ok { 19832 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 19833 } 19834 sv.ElasticIp = ptr.String(jtv) 19835 } 19836 19837 case "Status": 19838 if value != nil { 19839 jtv, ok := value.(string) 19840 if !ok { 19841 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 19842 } 19843 sv.Status = ptr.String(jtv) 19844 } 19845 19846 default: 19847 _, _ = key, value 19848 19849 } 19850 } 19851 *v = sv 19852 return nil 19853} 19854 19855func awsRestjson1_deserializeDocumentAwsRedshiftClusterEndpoint(v **types.AwsRedshiftClusterEndpoint, value interface{}) error { 19856 if v == nil { 19857 return fmt.Errorf("unexpected nil of type %T", v) 19858 } 19859 if value == nil { 19860 return nil 19861 } 19862 19863 shape, ok := value.(map[string]interface{}) 19864 if !ok { 19865 return fmt.Errorf("unexpected JSON type %v", value) 19866 } 19867 19868 var sv *types.AwsRedshiftClusterEndpoint 19869 if *v == nil { 19870 sv = &types.AwsRedshiftClusterEndpoint{} 19871 } else { 19872 sv = *v 19873 } 19874 19875 for key, value := range shape { 19876 switch key { 19877 case "Address": 19878 if value != nil { 19879 jtv, ok := value.(string) 19880 if !ok { 19881 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 19882 } 19883 sv.Address = ptr.String(jtv) 19884 } 19885 19886 case "Port": 19887 if value != nil { 19888 jtv, ok := value.(json.Number) 19889 if !ok { 19890 return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) 19891 } 19892 i64, err := jtv.Int64() 19893 if err != nil { 19894 return err 19895 } 19896 sv.Port = int32(i64) 19897 } 19898 19899 default: 19900 _, _ = key, value 19901 19902 } 19903 } 19904 *v = sv 19905 return nil 19906} 19907 19908func awsRestjson1_deserializeDocumentAwsRedshiftClusterHsmStatus(v **types.AwsRedshiftClusterHsmStatus, value interface{}) error { 19909 if v == nil { 19910 return fmt.Errorf("unexpected nil of type %T", v) 19911 } 19912 if value == nil { 19913 return nil 19914 } 19915 19916 shape, ok := value.(map[string]interface{}) 19917 if !ok { 19918 return fmt.Errorf("unexpected JSON type %v", value) 19919 } 19920 19921 var sv *types.AwsRedshiftClusterHsmStatus 19922 if *v == nil { 19923 sv = &types.AwsRedshiftClusterHsmStatus{} 19924 } else { 19925 sv = *v 19926 } 19927 19928 for key, value := range shape { 19929 switch key { 19930 case "HsmClientCertificateIdentifier": 19931 if value != nil { 19932 jtv, ok := value.(string) 19933 if !ok { 19934 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 19935 } 19936 sv.HsmClientCertificateIdentifier = ptr.String(jtv) 19937 } 19938 19939 case "HsmConfigurationIdentifier": 19940 if value != nil { 19941 jtv, ok := value.(string) 19942 if !ok { 19943 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 19944 } 19945 sv.HsmConfigurationIdentifier = ptr.String(jtv) 19946 } 19947 19948 case "Status": 19949 if value != nil { 19950 jtv, ok := value.(string) 19951 if !ok { 19952 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 19953 } 19954 sv.Status = ptr.String(jtv) 19955 } 19956 19957 default: 19958 _, _ = key, value 19959 19960 } 19961 } 19962 *v = sv 19963 return nil 19964} 19965 19966func awsRestjson1_deserializeDocumentAwsRedshiftClusterIamRole(v **types.AwsRedshiftClusterIamRole, value interface{}) error { 19967 if v == nil { 19968 return fmt.Errorf("unexpected nil of type %T", v) 19969 } 19970 if value == nil { 19971 return nil 19972 } 19973 19974 shape, ok := value.(map[string]interface{}) 19975 if !ok { 19976 return fmt.Errorf("unexpected JSON type %v", value) 19977 } 19978 19979 var sv *types.AwsRedshiftClusterIamRole 19980 if *v == nil { 19981 sv = &types.AwsRedshiftClusterIamRole{} 19982 } else { 19983 sv = *v 19984 } 19985 19986 for key, value := range shape { 19987 switch key { 19988 case "ApplyStatus": 19989 if value != nil { 19990 jtv, ok := value.(string) 19991 if !ok { 19992 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 19993 } 19994 sv.ApplyStatus = ptr.String(jtv) 19995 } 19996 19997 case "IamRoleArn": 19998 if value != nil { 19999 jtv, ok := value.(string) 20000 if !ok { 20001 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 20002 } 20003 sv.IamRoleArn = ptr.String(jtv) 20004 } 20005 20006 default: 20007 _, _ = key, value 20008 20009 } 20010 } 20011 *v = sv 20012 return nil 20013} 20014 20015func awsRestjson1_deserializeDocumentAwsRedshiftClusterIamRoles(v *[]types.AwsRedshiftClusterIamRole, value interface{}) error { 20016 if v == nil { 20017 return fmt.Errorf("unexpected nil of type %T", v) 20018 } 20019 if value == nil { 20020 return nil 20021 } 20022 20023 shape, ok := value.([]interface{}) 20024 if !ok { 20025 return fmt.Errorf("unexpected JSON type %v", value) 20026 } 20027 20028 var cv []types.AwsRedshiftClusterIamRole 20029 if *v == nil { 20030 cv = []types.AwsRedshiftClusterIamRole{} 20031 } else { 20032 cv = *v 20033 } 20034 20035 for _, value := range shape { 20036 var col types.AwsRedshiftClusterIamRole 20037 destAddr := &col 20038 if err := awsRestjson1_deserializeDocumentAwsRedshiftClusterIamRole(&destAddr, value); err != nil { 20039 return err 20040 } 20041 col = *destAddr 20042 cv = append(cv, col) 20043 20044 } 20045 *v = cv 20046 return nil 20047} 20048 20049func awsRestjson1_deserializeDocumentAwsRedshiftClusterPendingModifiedValues(v **types.AwsRedshiftClusterPendingModifiedValues, value interface{}) error { 20050 if v == nil { 20051 return fmt.Errorf("unexpected nil of type %T", v) 20052 } 20053 if value == nil { 20054 return nil 20055 } 20056 20057 shape, ok := value.(map[string]interface{}) 20058 if !ok { 20059 return fmt.Errorf("unexpected JSON type %v", value) 20060 } 20061 20062 var sv *types.AwsRedshiftClusterPendingModifiedValues 20063 if *v == nil { 20064 sv = &types.AwsRedshiftClusterPendingModifiedValues{} 20065 } else { 20066 sv = *v 20067 } 20068 20069 for key, value := range shape { 20070 switch key { 20071 case "AutomatedSnapshotRetentionPeriod": 20072 if value != nil { 20073 jtv, ok := value.(json.Number) 20074 if !ok { 20075 return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) 20076 } 20077 i64, err := jtv.Int64() 20078 if err != nil { 20079 return err 20080 } 20081 sv.AutomatedSnapshotRetentionPeriod = int32(i64) 20082 } 20083 20084 case "ClusterIdentifier": 20085 if value != nil { 20086 jtv, ok := value.(string) 20087 if !ok { 20088 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 20089 } 20090 sv.ClusterIdentifier = ptr.String(jtv) 20091 } 20092 20093 case "ClusterType": 20094 if value != nil { 20095 jtv, ok := value.(string) 20096 if !ok { 20097 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 20098 } 20099 sv.ClusterType = ptr.String(jtv) 20100 } 20101 20102 case "ClusterVersion": 20103 if value != nil { 20104 jtv, ok := value.(string) 20105 if !ok { 20106 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 20107 } 20108 sv.ClusterVersion = ptr.String(jtv) 20109 } 20110 20111 case "EncryptionType": 20112 if value != nil { 20113 jtv, ok := value.(string) 20114 if !ok { 20115 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 20116 } 20117 sv.EncryptionType = ptr.String(jtv) 20118 } 20119 20120 case "EnhancedVpcRouting": 20121 if value != nil { 20122 jtv, ok := value.(bool) 20123 if !ok { 20124 return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) 20125 } 20126 sv.EnhancedVpcRouting = jtv 20127 } 20128 20129 case "MaintenanceTrackName": 20130 if value != nil { 20131 jtv, ok := value.(string) 20132 if !ok { 20133 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 20134 } 20135 sv.MaintenanceTrackName = ptr.String(jtv) 20136 } 20137 20138 case "MasterUserPassword": 20139 if value != nil { 20140 jtv, ok := value.(string) 20141 if !ok { 20142 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 20143 } 20144 sv.MasterUserPassword = ptr.String(jtv) 20145 } 20146 20147 case "NodeType": 20148 if value != nil { 20149 jtv, ok := value.(string) 20150 if !ok { 20151 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 20152 } 20153 sv.NodeType = ptr.String(jtv) 20154 } 20155 20156 case "NumberOfNodes": 20157 if value != nil { 20158 jtv, ok := value.(json.Number) 20159 if !ok { 20160 return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) 20161 } 20162 i64, err := jtv.Int64() 20163 if err != nil { 20164 return err 20165 } 20166 sv.NumberOfNodes = int32(i64) 20167 } 20168 20169 case "PubliclyAccessible": 20170 if value != nil { 20171 jtv, ok := value.(bool) 20172 if !ok { 20173 return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) 20174 } 20175 sv.PubliclyAccessible = jtv 20176 } 20177 20178 default: 20179 _, _ = key, value 20180 20181 } 20182 } 20183 *v = sv 20184 return nil 20185} 20186 20187func awsRestjson1_deserializeDocumentAwsRedshiftClusterResizeInfo(v **types.AwsRedshiftClusterResizeInfo, value interface{}) error { 20188 if v == nil { 20189 return fmt.Errorf("unexpected nil of type %T", v) 20190 } 20191 if value == nil { 20192 return nil 20193 } 20194 20195 shape, ok := value.(map[string]interface{}) 20196 if !ok { 20197 return fmt.Errorf("unexpected JSON type %v", value) 20198 } 20199 20200 var sv *types.AwsRedshiftClusterResizeInfo 20201 if *v == nil { 20202 sv = &types.AwsRedshiftClusterResizeInfo{} 20203 } else { 20204 sv = *v 20205 } 20206 20207 for key, value := range shape { 20208 switch key { 20209 case "AllowCancelResize": 20210 if value != nil { 20211 jtv, ok := value.(bool) 20212 if !ok { 20213 return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) 20214 } 20215 sv.AllowCancelResize = jtv 20216 } 20217 20218 case "ResizeType": 20219 if value != nil { 20220 jtv, ok := value.(string) 20221 if !ok { 20222 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 20223 } 20224 sv.ResizeType = ptr.String(jtv) 20225 } 20226 20227 default: 20228 _, _ = key, value 20229 20230 } 20231 } 20232 *v = sv 20233 return nil 20234} 20235 20236func awsRestjson1_deserializeDocumentAwsRedshiftClusterRestoreStatus(v **types.AwsRedshiftClusterRestoreStatus, value interface{}) error { 20237 if v == nil { 20238 return fmt.Errorf("unexpected nil of type %T", v) 20239 } 20240 if value == nil { 20241 return nil 20242 } 20243 20244 shape, ok := value.(map[string]interface{}) 20245 if !ok { 20246 return fmt.Errorf("unexpected JSON type %v", value) 20247 } 20248 20249 var sv *types.AwsRedshiftClusterRestoreStatus 20250 if *v == nil { 20251 sv = &types.AwsRedshiftClusterRestoreStatus{} 20252 } else { 20253 sv = *v 20254 } 20255 20256 for key, value := range shape { 20257 switch key { 20258 case "CurrentRestoreRateInMegaBytesPerSecond": 20259 if value != nil { 20260 jtv, ok := value.(json.Number) 20261 if !ok { 20262 return fmt.Errorf("expected Double to be json.Number, got %T instead", value) 20263 } 20264 f64, err := jtv.Float64() 20265 if err != nil { 20266 return err 20267 } 20268 sv.CurrentRestoreRateInMegaBytesPerSecond = f64 20269 } 20270 20271 case "ElapsedTimeInSeconds": 20272 if value != nil { 20273 jtv, ok := value.(json.Number) 20274 if !ok { 20275 return fmt.Errorf("expected Long to be json.Number, got %T instead", value) 20276 } 20277 i64, err := jtv.Int64() 20278 if err != nil { 20279 return err 20280 } 20281 sv.ElapsedTimeInSeconds = i64 20282 } 20283 20284 case "EstimatedTimeToCompletionInSeconds": 20285 if value != nil { 20286 jtv, ok := value.(json.Number) 20287 if !ok { 20288 return fmt.Errorf("expected Long to be json.Number, got %T instead", value) 20289 } 20290 i64, err := jtv.Int64() 20291 if err != nil { 20292 return err 20293 } 20294 sv.EstimatedTimeToCompletionInSeconds = i64 20295 } 20296 20297 case "ProgressInMegaBytes": 20298 if value != nil { 20299 jtv, ok := value.(json.Number) 20300 if !ok { 20301 return fmt.Errorf("expected Long to be json.Number, got %T instead", value) 20302 } 20303 i64, err := jtv.Int64() 20304 if err != nil { 20305 return err 20306 } 20307 sv.ProgressInMegaBytes = i64 20308 } 20309 20310 case "SnapshotSizeInMegaBytes": 20311 if value != nil { 20312 jtv, ok := value.(json.Number) 20313 if !ok { 20314 return fmt.Errorf("expected Long to be json.Number, got %T instead", value) 20315 } 20316 i64, err := jtv.Int64() 20317 if err != nil { 20318 return err 20319 } 20320 sv.SnapshotSizeInMegaBytes = i64 20321 } 20322 20323 case "Status": 20324 if value != nil { 20325 jtv, ok := value.(string) 20326 if !ok { 20327 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 20328 } 20329 sv.Status = ptr.String(jtv) 20330 } 20331 20332 default: 20333 _, _ = key, value 20334 20335 } 20336 } 20337 *v = sv 20338 return nil 20339} 20340 20341func awsRestjson1_deserializeDocumentAwsRedshiftClusterVpcSecurityGroup(v **types.AwsRedshiftClusterVpcSecurityGroup, value interface{}) error { 20342 if v == nil { 20343 return fmt.Errorf("unexpected nil of type %T", v) 20344 } 20345 if value == nil { 20346 return nil 20347 } 20348 20349 shape, ok := value.(map[string]interface{}) 20350 if !ok { 20351 return fmt.Errorf("unexpected JSON type %v", value) 20352 } 20353 20354 var sv *types.AwsRedshiftClusterVpcSecurityGroup 20355 if *v == nil { 20356 sv = &types.AwsRedshiftClusterVpcSecurityGroup{} 20357 } else { 20358 sv = *v 20359 } 20360 20361 for key, value := range shape { 20362 switch key { 20363 case "Status": 20364 if value != nil { 20365 jtv, ok := value.(string) 20366 if !ok { 20367 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 20368 } 20369 sv.Status = ptr.String(jtv) 20370 } 20371 20372 case "VpcSecurityGroupId": 20373 if value != nil { 20374 jtv, ok := value.(string) 20375 if !ok { 20376 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 20377 } 20378 sv.VpcSecurityGroupId = ptr.String(jtv) 20379 } 20380 20381 default: 20382 _, _ = key, value 20383 20384 } 20385 } 20386 *v = sv 20387 return nil 20388} 20389 20390func awsRestjson1_deserializeDocumentAwsRedshiftClusterVpcSecurityGroups(v *[]types.AwsRedshiftClusterVpcSecurityGroup, value interface{}) error { 20391 if v == nil { 20392 return fmt.Errorf("unexpected nil of type %T", v) 20393 } 20394 if value == nil { 20395 return nil 20396 } 20397 20398 shape, ok := value.([]interface{}) 20399 if !ok { 20400 return fmt.Errorf("unexpected JSON type %v", value) 20401 } 20402 20403 var cv []types.AwsRedshiftClusterVpcSecurityGroup 20404 if *v == nil { 20405 cv = []types.AwsRedshiftClusterVpcSecurityGroup{} 20406 } else { 20407 cv = *v 20408 } 20409 20410 for _, value := range shape { 20411 var col types.AwsRedshiftClusterVpcSecurityGroup 20412 destAddr := &col 20413 if err := awsRestjson1_deserializeDocumentAwsRedshiftClusterVpcSecurityGroup(&destAddr, value); err != nil { 20414 return err 20415 } 20416 col = *destAddr 20417 cv = append(cv, col) 20418 20419 } 20420 *v = cv 20421 return nil 20422} 20423 20424func awsRestjson1_deserializeDocumentAwsS3BucketDetails(v **types.AwsS3BucketDetails, value interface{}) error { 20425 if v == nil { 20426 return fmt.Errorf("unexpected nil of type %T", v) 20427 } 20428 if value == nil { 20429 return nil 20430 } 20431 20432 shape, ok := value.(map[string]interface{}) 20433 if !ok { 20434 return fmt.Errorf("unexpected JSON type %v", value) 20435 } 20436 20437 var sv *types.AwsS3BucketDetails 20438 if *v == nil { 20439 sv = &types.AwsS3BucketDetails{} 20440 } else { 20441 sv = *v 20442 } 20443 20444 for key, value := range shape { 20445 switch key { 20446 case "CreatedAt": 20447 if value != nil { 20448 jtv, ok := value.(string) 20449 if !ok { 20450 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 20451 } 20452 sv.CreatedAt = ptr.String(jtv) 20453 } 20454 20455 case "OwnerId": 20456 if value != nil { 20457 jtv, ok := value.(string) 20458 if !ok { 20459 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 20460 } 20461 sv.OwnerId = ptr.String(jtv) 20462 } 20463 20464 case "OwnerName": 20465 if value != nil { 20466 jtv, ok := value.(string) 20467 if !ok { 20468 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 20469 } 20470 sv.OwnerName = ptr.String(jtv) 20471 } 20472 20473 case "ServerSideEncryptionConfiguration": 20474 if err := awsRestjson1_deserializeDocumentAwsS3BucketServerSideEncryptionConfiguration(&sv.ServerSideEncryptionConfiguration, value); err != nil { 20475 return err 20476 } 20477 20478 default: 20479 _, _ = key, value 20480 20481 } 20482 } 20483 *v = sv 20484 return nil 20485} 20486 20487func awsRestjson1_deserializeDocumentAwsS3BucketServerSideEncryptionByDefault(v **types.AwsS3BucketServerSideEncryptionByDefault, value interface{}) error { 20488 if v == nil { 20489 return fmt.Errorf("unexpected nil of type %T", v) 20490 } 20491 if value == nil { 20492 return nil 20493 } 20494 20495 shape, ok := value.(map[string]interface{}) 20496 if !ok { 20497 return fmt.Errorf("unexpected JSON type %v", value) 20498 } 20499 20500 var sv *types.AwsS3BucketServerSideEncryptionByDefault 20501 if *v == nil { 20502 sv = &types.AwsS3BucketServerSideEncryptionByDefault{} 20503 } else { 20504 sv = *v 20505 } 20506 20507 for key, value := range shape { 20508 switch key { 20509 case "KMSMasterKeyID": 20510 if value != nil { 20511 jtv, ok := value.(string) 20512 if !ok { 20513 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 20514 } 20515 sv.KMSMasterKeyID = ptr.String(jtv) 20516 } 20517 20518 case "SSEAlgorithm": 20519 if value != nil { 20520 jtv, ok := value.(string) 20521 if !ok { 20522 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 20523 } 20524 sv.SSEAlgorithm = ptr.String(jtv) 20525 } 20526 20527 default: 20528 _, _ = key, value 20529 20530 } 20531 } 20532 *v = sv 20533 return nil 20534} 20535 20536func awsRestjson1_deserializeDocumentAwsS3BucketServerSideEncryptionConfiguration(v **types.AwsS3BucketServerSideEncryptionConfiguration, value interface{}) error { 20537 if v == nil { 20538 return fmt.Errorf("unexpected nil of type %T", v) 20539 } 20540 if value == nil { 20541 return nil 20542 } 20543 20544 shape, ok := value.(map[string]interface{}) 20545 if !ok { 20546 return fmt.Errorf("unexpected JSON type %v", value) 20547 } 20548 20549 var sv *types.AwsS3BucketServerSideEncryptionConfiguration 20550 if *v == nil { 20551 sv = &types.AwsS3BucketServerSideEncryptionConfiguration{} 20552 } else { 20553 sv = *v 20554 } 20555 20556 for key, value := range shape { 20557 switch key { 20558 case "Rules": 20559 if err := awsRestjson1_deserializeDocumentAwsS3BucketServerSideEncryptionRules(&sv.Rules, value); err != nil { 20560 return err 20561 } 20562 20563 default: 20564 _, _ = key, value 20565 20566 } 20567 } 20568 *v = sv 20569 return nil 20570} 20571 20572func awsRestjson1_deserializeDocumentAwsS3BucketServerSideEncryptionRule(v **types.AwsS3BucketServerSideEncryptionRule, value interface{}) error { 20573 if v == nil { 20574 return fmt.Errorf("unexpected nil of type %T", v) 20575 } 20576 if value == nil { 20577 return nil 20578 } 20579 20580 shape, ok := value.(map[string]interface{}) 20581 if !ok { 20582 return fmt.Errorf("unexpected JSON type %v", value) 20583 } 20584 20585 var sv *types.AwsS3BucketServerSideEncryptionRule 20586 if *v == nil { 20587 sv = &types.AwsS3BucketServerSideEncryptionRule{} 20588 } else { 20589 sv = *v 20590 } 20591 20592 for key, value := range shape { 20593 switch key { 20594 case "ApplyServerSideEncryptionByDefault": 20595 if err := awsRestjson1_deserializeDocumentAwsS3BucketServerSideEncryptionByDefault(&sv.ApplyServerSideEncryptionByDefault, value); err != nil { 20596 return err 20597 } 20598 20599 default: 20600 _, _ = key, value 20601 20602 } 20603 } 20604 *v = sv 20605 return nil 20606} 20607 20608func awsRestjson1_deserializeDocumentAwsS3BucketServerSideEncryptionRules(v *[]types.AwsS3BucketServerSideEncryptionRule, value interface{}) error { 20609 if v == nil { 20610 return fmt.Errorf("unexpected nil of type %T", v) 20611 } 20612 if value == nil { 20613 return nil 20614 } 20615 20616 shape, ok := value.([]interface{}) 20617 if !ok { 20618 return fmt.Errorf("unexpected JSON type %v", value) 20619 } 20620 20621 var cv []types.AwsS3BucketServerSideEncryptionRule 20622 if *v == nil { 20623 cv = []types.AwsS3BucketServerSideEncryptionRule{} 20624 } else { 20625 cv = *v 20626 } 20627 20628 for _, value := range shape { 20629 var col types.AwsS3BucketServerSideEncryptionRule 20630 destAddr := &col 20631 if err := awsRestjson1_deserializeDocumentAwsS3BucketServerSideEncryptionRule(&destAddr, value); err != nil { 20632 return err 20633 } 20634 col = *destAddr 20635 cv = append(cv, col) 20636 20637 } 20638 *v = cv 20639 return nil 20640} 20641 20642func awsRestjson1_deserializeDocumentAwsS3ObjectDetails(v **types.AwsS3ObjectDetails, value interface{}) error { 20643 if v == nil { 20644 return fmt.Errorf("unexpected nil of type %T", v) 20645 } 20646 if value == nil { 20647 return nil 20648 } 20649 20650 shape, ok := value.(map[string]interface{}) 20651 if !ok { 20652 return fmt.Errorf("unexpected JSON type %v", value) 20653 } 20654 20655 var sv *types.AwsS3ObjectDetails 20656 if *v == nil { 20657 sv = &types.AwsS3ObjectDetails{} 20658 } else { 20659 sv = *v 20660 } 20661 20662 for key, value := range shape { 20663 switch key { 20664 case "ContentType": 20665 if value != nil { 20666 jtv, ok := value.(string) 20667 if !ok { 20668 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 20669 } 20670 sv.ContentType = ptr.String(jtv) 20671 } 20672 20673 case "ETag": 20674 if value != nil { 20675 jtv, ok := value.(string) 20676 if !ok { 20677 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 20678 } 20679 sv.ETag = ptr.String(jtv) 20680 } 20681 20682 case "LastModified": 20683 if value != nil { 20684 jtv, ok := value.(string) 20685 if !ok { 20686 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 20687 } 20688 sv.LastModified = ptr.String(jtv) 20689 } 20690 20691 case "ServerSideEncryption": 20692 if value != nil { 20693 jtv, ok := value.(string) 20694 if !ok { 20695 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 20696 } 20697 sv.ServerSideEncryption = ptr.String(jtv) 20698 } 20699 20700 case "SSEKMSKeyId": 20701 if value != nil { 20702 jtv, ok := value.(string) 20703 if !ok { 20704 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 20705 } 20706 sv.SSEKMSKeyId = ptr.String(jtv) 20707 } 20708 20709 case "VersionId": 20710 if value != nil { 20711 jtv, ok := value.(string) 20712 if !ok { 20713 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 20714 } 20715 sv.VersionId = ptr.String(jtv) 20716 } 20717 20718 default: 20719 _, _ = key, value 20720 20721 } 20722 } 20723 *v = sv 20724 return nil 20725} 20726 20727func awsRestjson1_deserializeDocumentAwsSecretsManagerSecretDetails(v **types.AwsSecretsManagerSecretDetails, value interface{}) error { 20728 if v == nil { 20729 return fmt.Errorf("unexpected nil of type %T", v) 20730 } 20731 if value == nil { 20732 return nil 20733 } 20734 20735 shape, ok := value.(map[string]interface{}) 20736 if !ok { 20737 return fmt.Errorf("unexpected JSON type %v", value) 20738 } 20739 20740 var sv *types.AwsSecretsManagerSecretDetails 20741 if *v == nil { 20742 sv = &types.AwsSecretsManagerSecretDetails{} 20743 } else { 20744 sv = *v 20745 } 20746 20747 for key, value := range shape { 20748 switch key { 20749 case "Deleted": 20750 if value != nil { 20751 jtv, ok := value.(bool) 20752 if !ok { 20753 return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) 20754 } 20755 sv.Deleted = jtv 20756 } 20757 20758 case "Description": 20759 if value != nil { 20760 jtv, ok := value.(string) 20761 if !ok { 20762 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 20763 } 20764 sv.Description = ptr.String(jtv) 20765 } 20766 20767 case "KmsKeyId": 20768 if value != nil { 20769 jtv, ok := value.(string) 20770 if !ok { 20771 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 20772 } 20773 sv.KmsKeyId = ptr.String(jtv) 20774 } 20775 20776 case "Name": 20777 if value != nil { 20778 jtv, ok := value.(string) 20779 if !ok { 20780 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 20781 } 20782 sv.Name = ptr.String(jtv) 20783 } 20784 20785 case "RotationEnabled": 20786 if value != nil { 20787 jtv, ok := value.(bool) 20788 if !ok { 20789 return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) 20790 } 20791 sv.RotationEnabled = jtv 20792 } 20793 20794 case "RotationLambdaArn": 20795 if value != nil { 20796 jtv, ok := value.(string) 20797 if !ok { 20798 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 20799 } 20800 sv.RotationLambdaArn = ptr.String(jtv) 20801 } 20802 20803 case "RotationOccurredWithinFrequency": 20804 if value != nil { 20805 jtv, ok := value.(bool) 20806 if !ok { 20807 return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) 20808 } 20809 sv.RotationOccurredWithinFrequency = jtv 20810 } 20811 20812 case "RotationRules": 20813 if err := awsRestjson1_deserializeDocumentAwsSecretsManagerSecretRotationRules(&sv.RotationRules, value); err != nil { 20814 return err 20815 } 20816 20817 default: 20818 _, _ = key, value 20819 20820 } 20821 } 20822 *v = sv 20823 return nil 20824} 20825 20826func awsRestjson1_deserializeDocumentAwsSecretsManagerSecretRotationRules(v **types.AwsSecretsManagerSecretRotationRules, value interface{}) error { 20827 if v == nil { 20828 return fmt.Errorf("unexpected nil of type %T", v) 20829 } 20830 if value == nil { 20831 return nil 20832 } 20833 20834 shape, ok := value.(map[string]interface{}) 20835 if !ok { 20836 return fmt.Errorf("unexpected JSON type %v", value) 20837 } 20838 20839 var sv *types.AwsSecretsManagerSecretRotationRules 20840 if *v == nil { 20841 sv = &types.AwsSecretsManagerSecretRotationRules{} 20842 } else { 20843 sv = *v 20844 } 20845 20846 for key, value := range shape { 20847 switch key { 20848 case "AutomaticallyAfterDays": 20849 if value != nil { 20850 jtv, ok := value.(json.Number) 20851 if !ok { 20852 return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) 20853 } 20854 i64, err := jtv.Int64() 20855 if err != nil { 20856 return err 20857 } 20858 sv.AutomaticallyAfterDays = int32(i64) 20859 } 20860 20861 default: 20862 _, _ = key, value 20863 20864 } 20865 } 20866 *v = sv 20867 return nil 20868} 20869 20870func awsRestjson1_deserializeDocumentAwsSecurityFinding(v **types.AwsSecurityFinding, value interface{}) error { 20871 if v == nil { 20872 return fmt.Errorf("unexpected nil of type %T", v) 20873 } 20874 if value == nil { 20875 return nil 20876 } 20877 20878 shape, ok := value.(map[string]interface{}) 20879 if !ok { 20880 return fmt.Errorf("unexpected JSON type %v", value) 20881 } 20882 20883 var sv *types.AwsSecurityFinding 20884 if *v == nil { 20885 sv = &types.AwsSecurityFinding{} 20886 } else { 20887 sv = *v 20888 } 20889 20890 for key, value := range shape { 20891 switch key { 20892 case "AwsAccountId": 20893 if value != nil { 20894 jtv, ok := value.(string) 20895 if !ok { 20896 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 20897 } 20898 sv.AwsAccountId = ptr.String(jtv) 20899 } 20900 20901 case "Compliance": 20902 if err := awsRestjson1_deserializeDocumentCompliance(&sv.Compliance, value); err != nil { 20903 return err 20904 } 20905 20906 case "Confidence": 20907 if value != nil { 20908 jtv, ok := value.(json.Number) 20909 if !ok { 20910 return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) 20911 } 20912 i64, err := jtv.Int64() 20913 if err != nil { 20914 return err 20915 } 20916 sv.Confidence = int32(i64) 20917 } 20918 20919 case "CreatedAt": 20920 if value != nil { 20921 jtv, ok := value.(string) 20922 if !ok { 20923 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 20924 } 20925 sv.CreatedAt = ptr.String(jtv) 20926 } 20927 20928 case "Criticality": 20929 if value != nil { 20930 jtv, ok := value.(json.Number) 20931 if !ok { 20932 return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) 20933 } 20934 i64, err := jtv.Int64() 20935 if err != nil { 20936 return err 20937 } 20938 sv.Criticality = int32(i64) 20939 } 20940 20941 case "Description": 20942 if value != nil { 20943 jtv, ok := value.(string) 20944 if !ok { 20945 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 20946 } 20947 sv.Description = ptr.String(jtv) 20948 } 20949 20950 case "FirstObservedAt": 20951 if value != nil { 20952 jtv, ok := value.(string) 20953 if !ok { 20954 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 20955 } 20956 sv.FirstObservedAt = ptr.String(jtv) 20957 } 20958 20959 case "GeneratorId": 20960 if value != nil { 20961 jtv, ok := value.(string) 20962 if !ok { 20963 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 20964 } 20965 sv.GeneratorId = ptr.String(jtv) 20966 } 20967 20968 case "Id": 20969 if value != nil { 20970 jtv, ok := value.(string) 20971 if !ok { 20972 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 20973 } 20974 sv.Id = ptr.String(jtv) 20975 } 20976 20977 case "LastObservedAt": 20978 if value != nil { 20979 jtv, ok := value.(string) 20980 if !ok { 20981 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 20982 } 20983 sv.LastObservedAt = ptr.String(jtv) 20984 } 20985 20986 case "Malware": 20987 if err := awsRestjson1_deserializeDocumentMalwareList(&sv.Malware, value); err != nil { 20988 return err 20989 } 20990 20991 case "Network": 20992 if err := awsRestjson1_deserializeDocumentNetwork(&sv.Network, value); err != nil { 20993 return err 20994 } 20995 20996 case "NetworkPath": 20997 if err := awsRestjson1_deserializeDocumentNetworkPathList(&sv.NetworkPath, value); err != nil { 20998 return err 20999 } 21000 21001 case "Note": 21002 if err := awsRestjson1_deserializeDocumentNote(&sv.Note, value); err != nil { 21003 return err 21004 } 21005 21006 case "PatchSummary": 21007 if err := awsRestjson1_deserializeDocumentPatchSummary(&sv.PatchSummary, value); err != nil { 21008 return err 21009 } 21010 21011 case "Process": 21012 if err := awsRestjson1_deserializeDocumentProcessDetails(&sv.Process, value); err != nil { 21013 return err 21014 } 21015 21016 case "ProductArn": 21017 if value != nil { 21018 jtv, ok := value.(string) 21019 if !ok { 21020 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 21021 } 21022 sv.ProductArn = ptr.String(jtv) 21023 } 21024 21025 case "ProductFields": 21026 if err := awsRestjson1_deserializeDocumentFieldMap(&sv.ProductFields, value); err != nil { 21027 return err 21028 } 21029 21030 case "RecordState": 21031 if value != nil { 21032 jtv, ok := value.(string) 21033 if !ok { 21034 return fmt.Errorf("expected RecordState to be of type string, got %T instead", value) 21035 } 21036 sv.RecordState = types.RecordState(jtv) 21037 } 21038 21039 case "RelatedFindings": 21040 if err := awsRestjson1_deserializeDocumentRelatedFindingList(&sv.RelatedFindings, value); err != nil { 21041 return err 21042 } 21043 21044 case "Remediation": 21045 if err := awsRestjson1_deserializeDocumentRemediation(&sv.Remediation, value); err != nil { 21046 return err 21047 } 21048 21049 case "Resources": 21050 if err := awsRestjson1_deserializeDocumentResourceList(&sv.Resources, value); err != nil { 21051 return err 21052 } 21053 21054 case "SchemaVersion": 21055 if value != nil { 21056 jtv, ok := value.(string) 21057 if !ok { 21058 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 21059 } 21060 sv.SchemaVersion = ptr.String(jtv) 21061 } 21062 21063 case "Severity": 21064 if err := awsRestjson1_deserializeDocumentSeverity(&sv.Severity, value); err != nil { 21065 return err 21066 } 21067 21068 case "SourceUrl": 21069 if value != nil { 21070 jtv, ok := value.(string) 21071 if !ok { 21072 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 21073 } 21074 sv.SourceUrl = ptr.String(jtv) 21075 } 21076 21077 case "ThreatIntelIndicators": 21078 if err := awsRestjson1_deserializeDocumentThreatIntelIndicatorList(&sv.ThreatIntelIndicators, value); err != nil { 21079 return err 21080 } 21081 21082 case "Title": 21083 if value != nil { 21084 jtv, ok := value.(string) 21085 if !ok { 21086 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 21087 } 21088 sv.Title = ptr.String(jtv) 21089 } 21090 21091 case "Types": 21092 if err := awsRestjson1_deserializeDocumentTypeList(&sv.Types, value); err != nil { 21093 return err 21094 } 21095 21096 case "UpdatedAt": 21097 if value != nil { 21098 jtv, ok := value.(string) 21099 if !ok { 21100 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 21101 } 21102 sv.UpdatedAt = ptr.String(jtv) 21103 } 21104 21105 case "UserDefinedFields": 21106 if err := awsRestjson1_deserializeDocumentFieldMap(&sv.UserDefinedFields, value); err != nil { 21107 return err 21108 } 21109 21110 case "VerificationState": 21111 if value != nil { 21112 jtv, ok := value.(string) 21113 if !ok { 21114 return fmt.Errorf("expected VerificationState to be of type string, got %T instead", value) 21115 } 21116 sv.VerificationState = types.VerificationState(jtv) 21117 } 21118 21119 case "Vulnerabilities": 21120 if err := awsRestjson1_deserializeDocumentVulnerabilityList(&sv.Vulnerabilities, value); err != nil { 21121 return err 21122 } 21123 21124 case "Workflow": 21125 if err := awsRestjson1_deserializeDocumentWorkflow(&sv.Workflow, value); err != nil { 21126 return err 21127 } 21128 21129 case "WorkflowState": 21130 if value != nil { 21131 jtv, ok := value.(string) 21132 if !ok { 21133 return fmt.Errorf("expected WorkflowState to be of type string, got %T instead", value) 21134 } 21135 sv.WorkflowState = types.WorkflowState(jtv) 21136 } 21137 21138 default: 21139 _, _ = key, value 21140 21141 } 21142 } 21143 *v = sv 21144 return nil 21145} 21146 21147func awsRestjson1_deserializeDocumentAwsSecurityFindingFilters(v **types.AwsSecurityFindingFilters, value interface{}) error { 21148 if v == nil { 21149 return fmt.Errorf("unexpected nil of type %T", v) 21150 } 21151 if value == nil { 21152 return nil 21153 } 21154 21155 shape, ok := value.(map[string]interface{}) 21156 if !ok { 21157 return fmt.Errorf("unexpected JSON type %v", value) 21158 } 21159 21160 var sv *types.AwsSecurityFindingFilters 21161 if *v == nil { 21162 sv = &types.AwsSecurityFindingFilters{} 21163 } else { 21164 sv = *v 21165 } 21166 21167 for key, value := range shape { 21168 switch key { 21169 case "AwsAccountId": 21170 if err := awsRestjson1_deserializeDocumentStringFilterList(&sv.AwsAccountId, value); err != nil { 21171 return err 21172 } 21173 21174 case "CompanyName": 21175 if err := awsRestjson1_deserializeDocumentStringFilterList(&sv.CompanyName, value); err != nil { 21176 return err 21177 } 21178 21179 case "ComplianceStatus": 21180 if err := awsRestjson1_deserializeDocumentStringFilterList(&sv.ComplianceStatus, value); err != nil { 21181 return err 21182 } 21183 21184 case "Confidence": 21185 if err := awsRestjson1_deserializeDocumentNumberFilterList(&sv.Confidence, value); err != nil { 21186 return err 21187 } 21188 21189 case "CreatedAt": 21190 if err := awsRestjson1_deserializeDocumentDateFilterList(&sv.CreatedAt, value); err != nil { 21191 return err 21192 } 21193 21194 case "Criticality": 21195 if err := awsRestjson1_deserializeDocumentNumberFilterList(&sv.Criticality, value); err != nil { 21196 return err 21197 } 21198 21199 case "Description": 21200 if err := awsRestjson1_deserializeDocumentStringFilterList(&sv.Description, value); err != nil { 21201 return err 21202 } 21203 21204 case "FirstObservedAt": 21205 if err := awsRestjson1_deserializeDocumentDateFilterList(&sv.FirstObservedAt, value); err != nil { 21206 return err 21207 } 21208 21209 case "GeneratorId": 21210 if err := awsRestjson1_deserializeDocumentStringFilterList(&sv.GeneratorId, value); err != nil { 21211 return err 21212 } 21213 21214 case "Id": 21215 if err := awsRestjson1_deserializeDocumentStringFilterList(&sv.Id, value); err != nil { 21216 return err 21217 } 21218 21219 case "Keyword": 21220 if err := awsRestjson1_deserializeDocumentKeywordFilterList(&sv.Keyword, value); err != nil { 21221 return err 21222 } 21223 21224 case "LastObservedAt": 21225 if err := awsRestjson1_deserializeDocumentDateFilterList(&sv.LastObservedAt, value); err != nil { 21226 return err 21227 } 21228 21229 case "MalwareName": 21230 if err := awsRestjson1_deserializeDocumentStringFilterList(&sv.MalwareName, value); err != nil { 21231 return err 21232 } 21233 21234 case "MalwarePath": 21235 if err := awsRestjson1_deserializeDocumentStringFilterList(&sv.MalwarePath, value); err != nil { 21236 return err 21237 } 21238 21239 case "MalwareState": 21240 if err := awsRestjson1_deserializeDocumentStringFilterList(&sv.MalwareState, value); err != nil { 21241 return err 21242 } 21243 21244 case "MalwareType": 21245 if err := awsRestjson1_deserializeDocumentStringFilterList(&sv.MalwareType, value); err != nil { 21246 return err 21247 } 21248 21249 case "NetworkDestinationDomain": 21250 if err := awsRestjson1_deserializeDocumentStringFilterList(&sv.NetworkDestinationDomain, value); err != nil { 21251 return err 21252 } 21253 21254 case "NetworkDestinationIpV4": 21255 if err := awsRestjson1_deserializeDocumentIpFilterList(&sv.NetworkDestinationIpV4, value); err != nil { 21256 return err 21257 } 21258 21259 case "NetworkDestinationIpV6": 21260 if err := awsRestjson1_deserializeDocumentIpFilterList(&sv.NetworkDestinationIpV6, value); err != nil { 21261 return err 21262 } 21263 21264 case "NetworkDestinationPort": 21265 if err := awsRestjson1_deserializeDocumentNumberFilterList(&sv.NetworkDestinationPort, value); err != nil { 21266 return err 21267 } 21268 21269 case "NetworkDirection": 21270 if err := awsRestjson1_deserializeDocumentStringFilterList(&sv.NetworkDirection, value); err != nil { 21271 return err 21272 } 21273 21274 case "NetworkProtocol": 21275 if err := awsRestjson1_deserializeDocumentStringFilterList(&sv.NetworkProtocol, value); err != nil { 21276 return err 21277 } 21278 21279 case "NetworkSourceDomain": 21280 if err := awsRestjson1_deserializeDocumentStringFilterList(&sv.NetworkSourceDomain, value); err != nil { 21281 return err 21282 } 21283 21284 case "NetworkSourceIpV4": 21285 if err := awsRestjson1_deserializeDocumentIpFilterList(&sv.NetworkSourceIpV4, value); err != nil { 21286 return err 21287 } 21288 21289 case "NetworkSourceIpV6": 21290 if err := awsRestjson1_deserializeDocumentIpFilterList(&sv.NetworkSourceIpV6, value); err != nil { 21291 return err 21292 } 21293 21294 case "NetworkSourceMac": 21295 if err := awsRestjson1_deserializeDocumentStringFilterList(&sv.NetworkSourceMac, value); err != nil { 21296 return err 21297 } 21298 21299 case "NetworkSourcePort": 21300 if err := awsRestjson1_deserializeDocumentNumberFilterList(&sv.NetworkSourcePort, value); err != nil { 21301 return err 21302 } 21303 21304 case "NoteText": 21305 if err := awsRestjson1_deserializeDocumentStringFilterList(&sv.NoteText, value); err != nil { 21306 return err 21307 } 21308 21309 case "NoteUpdatedAt": 21310 if err := awsRestjson1_deserializeDocumentDateFilterList(&sv.NoteUpdatedAt, value); err != nil { 21311 return err 21312 } 21313 21314 case "NoteUpdatedBy": 21315 if err := awsRestjson1_deserializeDocumentStringFilterList(&sv.NoteUpdatedBy, value); err != nil { 21316 return err 21317 } 21318 21319 case "ProcessLaunchedAt": 21320 if err := awsRestjson1_deserializeDocumentDateFilterList(&sv.ProcessLaunchedAt, value); err != nil { 21321 return err 21322 } 21323 21324 case "ProcessName": 21325 if err := awsRestjson1_deserializeDocumentStringFilterList(&sv.ProcessName, value); err != nil { 21326 return err 21327 } 21328 21329 case "ProcessParentPid": 21330 if err := awsRestjson1_deserializeDocumentNumberFilterList(&sv.ProcessParentPid, value); err != nil { 21331 return err 21332 } 21333 21334 case "ProcessPath": 21335 if err := awsRestjson1_deserializeDocumentStringFilterList(&sv.ProcessPath, value); err != nil { 21336 return err 21337 } 21338 21339 case "ProcessPid": 21340 if err := awsRestjson1_deserializeDocumentNumberFilterList(&sv.ProcessPid, value); err != nil { 21341 return err 21342 } 21343 21344 case "ProcessTerminatedAt": 21345 if err := awsRestjson1_deserializeDocumentDateFilterList(&sv.ProcessTerminatedAt, value); err != nil { 21346 return err 21347 } 21348 21349 case "ProductArn": 21350 if err := awsRestjson1_deserializeDocumentStringFilterList(&sv.ProductArn, value); err != nil { 21351 return err 21352 } 21353 21354 case "ProductFields": 21355 if err := awsRestjson1_deserializeDocumentMapFilterList(&sv.ProductFields, value); err != nil { 21356 return err 21357 } 21358 21359 case "ProductName": 21360 if err := awsRestjson1_deserializeDocumentStringFilterList(&sv.ProductName, value); err != nil { 21361 return err 21362 } 21363 21364 case "RecommendationText": 21365 if err := awsRestjson1_deserializeDocumentStringFilterList(&sv.RecommendationText, value); err != nil { 21366 return err 21367 } 21368 21369 case "RecordState": 21370 if err := awsRestjson1_deserializeDocumentStringFilterList(&sv.RecordState, value); err != nil { 21371 return err 21372 } 21373 21374 case "RelatedFindingsId": 21375 if err := awsRestjson1_deserializeDocumentStringFilterList(&sv.RelatedFindingsId, value); err != nil { 21376 return err 21377 } 21378 21379 case "RelatedFindingsProductArn": 21380 if err := awsRestjson1_deserializeDocumentStringFilterList(&sv.RelatedFindingsProductArn, value); err != nil { 21381 return err 21382 } 21383 21384 case "ResourceAwsEc2InstanceIamInstanceProfileArn": 21385 if err := awsRestjson1_deserializeDocumentStringFilterList(&sv.ResourceAwsEc2InstanceIamInstanceProfileArn, value); err != nil { 21386 return err 21387 } 21388 21389 case "ResourceAwsEc2InstanceImageId": 21390 if err := awsRestjson1_deserializeDocumentStringFilterList(&sv.ResourceAwsEc2InstanceImageId, value); err != nil { 21391 return err 21392 } 21393 21394 case "ResourceAwsEc2InstanceIpV4Addresses": 21395 if err := awsRestjson1_deserializeDocumentIpFilterList(&sv.ResourceAwsEc2InstanceIpV4Addresses, value); err != nil { 21396 return err 21397 } 21398 21399 case "ResourceAwsEc2InstanceIpV6Addresses": 21400 if err := awsRestjson1_deserializeDocumentIpFilterList(&sv.ResourceAwsEc2InstanceIpV6Addresses, value); err != nil { 21401 return err 21402 } 21403 21404 case "ResourceAwsEc2InstanceKeyName": 21405 if err := awsRestjson1_deserializeDocumentStringFilterList(&sv.ResourceAwsEc2InstanceKeyName, value); err != nil { 21406 return err 21407 } 21408 21409 case "ResourceAwsEc2InstanceLaunchedAt": 21410 if err := awsRestjson1_deserializeDocumentDateFilterList(&sv.ResourceAwsEc2InstanceLaunchedAt, value); err != nil { 21411 return err 21412 } 21413 21414 case "ResourceAwsEc2InstanceSubnetId": 21415 if err := awsRestjson1_deserializeDocumentStringFilterList(&sv.ResourceAwsEc2InstanceSubnetId, value); err != nil { 21416 return err 21417 } 21418 21419 case "ResourceAwsEc2InstanceType": 21420 if err := awsRestjson1_deserializeDocumentStringFilterList(&sv.ResourceAwsEc2InstanceType, value); err != nil { 21421 return err 21422 } 21423 21424 case "ResourceAwsEc2InstanceVpcId": 21425 if err := awsRestjson1_deserializeDocumentStringFilterList(&sv.ResourceAwsEc2InstanceVpcId, value); err != nil { 21426 return err 21427 } 21428 21429 case "ResourceAwsIamAccessKeyCreatedAt": 21430 if err := awsRestjson1_deserializeDocumentDateFilterList(&sv.ResourceAwsIamAccessKeyCreatedAt, value); err != nil { 21431 return err 21432 } 21433 21434 case "ResourceAwsIamAccessKeyStatus": 21435 if err := awsRestjson1_deserializeDocumentStringFilterList(&sv.ResourceAwsIamAccessKeyStatus, value); err != nil { 21436 return err 21437 } 21438 21439 case "ResourceAwsIamAccessKeyUserName": 21440 if err := awsRestjson1_deserializeDocumentStringFilterList(&sv.ResourceAwsIamAccessKeyUserName, value); err != nil { 21441 return err 21442 } 21443 21444 case "ResourceAwsS3BucketOwnerId": 21445 if err := awsRestjson1_deserializeDocumentStringFilterList(&sv.ResourceAwsS3BucketOwnerId, value); err != nil { 21446 return err 21447 } 21448 21449 case "ResourceAwsS3BucketOwnerName": 21450 if err := awsRestjson1_deserializeDocumentStringFilterList(&sv.ResourceAwsS3BucketOwnerName, value); err != nil { 21451 return err 21452 } 21453 21454 case "ResourceContainerImageId": 21455 if err := awsRestjson1_deserializeDocumentStringFilterList(&sv.ResourceContainerImageId, value); err != nil { 21456 return err 21457 } 21458 21459 case "ResourceContainerImageName": 21460 if err := awsRestjson1_deserializeDocumentStringFilterList(&sv.ResourceContainerImageName, value); err != nil { 21461 return err 21462 } 21463 21464 case "ResourceContainerLaunchedAt": 21465 if err := awsRestjson1_deserializeDocumentDateFilterList(&sv.ResourceContainerLaunchedAt, value); err != nil { 21466 return err 21467 } 21468 21469 case "ResourceContainerName": 21470 if err := awsRestjson1_deserializeDocumentStringFilterList(&sv.ResourceContainerName, value); err != nil { 21471 return err 21472 } 21473 21474 case "ResourceDetailsOther": 21475 if err := awsRestjson1_deserializeDocumentMapFilterList(&sv.ResourceDetailsOther, value); err != nil { 21476 return err 21477 } 21478 21479 case "ResourceId": 21480 if err := awsRestjson1_deserializeDocumentStringFilterList(&sv.ResourceId, value); err != nil { 21481 return err 21482 } 21483 21484 case "ResourcePartition": 21485 if err := awsRestjson1_deserializeDocumentStringFilterList(&sv.ResourcePartition, value); err != nil { 21486 return err 21487 } 21488 21489 case "ResourceRegion": 21490 if err := awsRestjson1_deserializeDocumentStringFilterList(&sv.ResourceRegion, value); err != nil { 21491 return err 21492 } 21493 21494 case "ResourceTags": 21495 if err := awsRestjson1_deserializeDocumentMapFilterList(&sv.ResourceTags, value); err != nil { 21496 return err 21497 } 21498 21499 case "ResourceType": 21500 if err := awsRestjson1_deserializeDocumentStringFilterList(&sv.ResourceType, value); err != nil { 21501 return err 21502 } 21503 21504 case "SeverityLabel": 21505 if err := awsRestjson1_deserializeDocumentStringFilterList(&sv.SeverityLabel, value); err != nil { 21506 return err 21507 } 21508 21509 case "SeverityNormalized": 21510 if err := awsRestjson1_deserializeDocumentNumberFilterList(&sv.SeverityNormalized, value); err != nil { 21511 return err 21512 } 21513 21514 case "SeverityProduct": 21515 if err := awsRestjson1_deserializeDocumentNumberFilterList(&sv.SeverityProduct, value); err != nil { 21516 return err 21517 } 21518 21519 case "SourceUrl": 21520 if err := awsRestjson1_deserializeDocumentStringFilterList(&sv.SourceUrl, value); err != nil { 21521 return err 21522 } 21523 21524 case "ThreatIntelIndicatorCategory": 21525 if err := awsRestjson1_deserializeDocumentStringFilterList(&sv.ThreatIntelIndicatorCategory, value); err != nil { 21526 return err 21527 } 21528 21529 case "ThreatIntelIndicatorLastObservedAt": 21530 if err := awsRestjson1_deserializeDocumentDateFilterList(&sv.ThreatIntelIndicatorLastObservedAt, value); err != nil { 21531 return err 21532 } 21533 21534 case "ThreatIntelIndicatorSource": 21535 if err := awsRestjson1_deserializeDocumentStringFilterList(&sv.ThreatIntelIndicatorSource, value); err != nil { 21536 return err 21537 } 21538 21539 case "ThreatIntelIndicatorSourceUrl": 21540 if err := awsRestjson1_deserializeDocumentStringFilterList(&sv.ThreatIntelIndicatorSourceUrl, value); err != nil { 21541 return err 21542 } 21543 21544 case "ThreatIntelIndicatorType": 21545 if err := awsRestjson1_deserializeDocumentStringFilterList(&sv.ThreatIntelIndicatorType, value); err != nil { 21546 return err 21547 } 21548 21549 case "ThreatIntelIndicatorValue": 21550 if err := awsRestjson1_deserializeDocumentStringFilterList(&sv.ThreatIntelIndicatorValue, value); err != nil { 21551 return err 21552 } 21553 21554 case "Title": 21555 if err := awsRestjson1_deserializeDocumentStringFilterList(&sv.Title, value); err != nil { 21556 return err 21557 } 21558 21559 case "Type": 21560 if err := awsRestjson1_deserializeDocumentStringFilterList(&sv.Type, value); err != nil { 21561 return err 21562 } 21563 21564 case "UpdatedAt": 21565 if err := awsRestjson1_deserializeDocumentDateFilterList(&sv.UpdatedAt, value); err != nil { 21566 return err 21567 } 21568 21569 case "UserDefinedFields": 21570 if err := awsRestjson1_deserializeDocumentMapFilterList(&sv.UserDefinedFields, value); err != nil { 21571 return err 21572 } 21573 21574 case "VerificationState": 21575 if err := awsRestjson1_deserializeDocumentStringFilterList(&sv.VerificationState, value); err != nil { 21576 return err 21577 } 21578 21579 case "WorkflowState": 21580 if err := awsRestjson1_deserializeDocumentStringFilterList(&sv.WorkflowState, value); err != nil { 21581 return err 21582 } 21583 21584 case "WorkflowStatus": 21585 if err := awsRestjson1_deserializeDocumentStringFilterList(&sv.WorkflowStatus, value); err != nil { 21586 return err 21587 } 21588 21589 default: 21590 _, _ = key, value 21591 21592 } 21593 } 21594 *v = sv 21595 return nil 21596} 21597 21598func awsRestjson1_deserializeDocumentAwsSecurityFindingIdentifier(v **types.AwsSecurityFindingIdentifier, value interface{}) error { 21599 if v == nil { 21600 return fmt.Errorf("unexpected nil of type %T", v) 21601 } 21602 if value == nil { 21603 return nil 21604 } 21605 21606 shape, ok := value.(map[string]interface{}) 21607 if !ok { 21608 return fmt.Errorf("unexpected JSON type %v", value) 21609 } 21610 21611 var sv *types.AwsSecurityFindingIdentifier 21612 if *v == nil { 21613 sv = &types.AwsSecurityFindingIdentifier{} 21614 } else { 21615 sv = *v 21616 } 21617 21618 for key, value := range shape { 21619 switch key { 21620 case "Id": 21621 if value != nil { 21622 jtv, ok := value.(string) 21623 if !ok { 21624 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 21625 } 21626 sv.Id = ptr.String(jtv) 21627 } 21628 21629 case "ProductArn": 21630 if value != nil { 21631 jtv, ok := value.(string) 21632 if !ok { 21633 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 21634 } 21635 sv.ProductArn = ptr.String(jtv) 21636 } 21637 21638 default: 21639 _, _ = key, value 21640 21641 } 21642 } 21643 *v = sv 21644 return nil 21645} 21646 21647func awsRestjson1_deserializeDocumentAwsSecurityFindingIdentifierList(v *[]types.AwsSecurityFindingIdentifier, value interface{}) error { 21648 if v == nil { 21649 return fmt.Errorf("unexpected nil of type %T", v) 21650 } 21651 if value == nil { 21652 return nil 21653 } 21654 21655 shape, ok := value.([]interface{}) 21656 if !ok { 21657 return fmt.Errorf("unexpected JSON type %v", value) 21658 } 21659 21660 var cv []types.AwsSecurityFindingIdentifier 21661 if *v == nil { 21662 cv = []types.AwsSecurityFindingIdentifier{} 21663 } else { 21664 cv = *v 21665 } 21666 21667 for _, value := range shape { 21668 var col types.AwsSecurityFindingIdentifier 21669 destAddr := &col 21670 if err := awsRestjson1_deserializeDocumentAwsSecurityFindingIdentifier(&destAddr, value); err != nil { 21671 return err 21672 } 21673 col = *destAddr 21674 cv = append(cv, col) 21675 21676 } 21677 *v = cv 21678 return nil 21679} 21680 21681func awsRestjson1_deserializeDocumentAwsSecurityFindingList(v *[]types.AwsSecurityFinding, value interface{}) error { 21682 if v == nil { 21683 return fmt.Errorf("unexpected nil of type %T", v) 21684 } 21685 if value == nil { 21686 return nil 21687 } 21688 21689 shape, ok := value.([]interface{}) 21690 if !ok { 21691 return fmt.Errorf("unexpected JSON type %v", value) 21692 } 21693 21694 var cv []types.AwsSecurityFinding 21695 if *v == nil { 21696 cv = []types.AwsSecurityFinding{} 21697 } else { 21698 cv = *v 21699 } 21700 21701 for _, value := range shape { 21702 var col types.AwsSecurityFinding 21703 destAddr := &col 21704 if err := awsRestjson1_deserializeDocumentAwsSecurityFinding(&destAddr, value); err != nil { 21705 return err 21706 } 21707 col = *destAddr 21708 cv = append(cv, col) 21709 21710 } 21711 *v = cv 21712 return nil 21713} 21714 21715func awsRestjson1_deserializeDocumentAwsSnsTopicDetails(v **types.AwsSnsTopicDetails, value interface{}) error { 21716 if v == nil { 21717 return fmt.Errorf("unexpected nil of type %T", v) 21718 } 21719 if value == nil { 21720 return nil 21721 } 21722 21723 shape, ok := value.(map[string]interface{}) 21724 if !ok { 21725 return fmt.Errorf("unexpected JSON type %v", value) 21726 } 21727 21728 var sv *types.AwsSnsTopicDetails 21729 if *v == nil { 21730 sv = &types.AwsSnsTopicDetails{} 21731 } else { 21732 sv = *v 21733 } 21734 21735 for key, value := range shape { 21736 switch key { 21737 case "KmsMasterKeyId": 21738 if value != nil { 21739 jtv, ok := value.(string) 21740 if !ok { 21741 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 21742 } 21743 sv.KmsMasterKeyId = ptr.String(jtv) 21744 } 21745 21746 case "Owner": 21747 if value != nil { 21748 jtv, ok := value.(string) 21749 if !ok { 21750 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 21751 } 21752 sv.Owner = ptr.String(jtv) 21753 } 21754 21755 case "Subscription": 21756 if err := awsRestjson1_deserializeDocumentAwsSnsTopicSubscriptionList(&sv.Subscription, value); err != nil { 21757 return err 21758 } 21759 21760 case "TopicName": 21761 if value != nil { 21762 jtv, ok := value.(string) 21763 if !ok { 21764 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 21765 } 21766 sv.TopicName = ptr.String(jtv) 21767 } 21768 21769 default: 21770 _, _ = key, value 21771 21772 } 21773 } 21774 *v = sv 21775 return nil 21776} 21777 21778func awsRestjson1_deserializeDocumentAwsSnsTopicSubscription(v **types.AwsSnsTopicSubscription, value interface{}) error { 21779 if v == nil { 21780 return fmt.Errorf("unexpected nil of type %T", v) 21781 } 21782 if value == nil { 21783 return nil 21784 } 21785 21786 shape, ok := value.(map[string]interface{}) 21787 if !ok { 21788 return fmt.Errorf("unexpected JSON type %v", value) 21789 } 21790 21791 var sv *types.AwsSnsTopicSubscription 21792 if *v == nil { 21793 sv = &types.AwsSnsTopicSubscription{} 21794 } else { 21795 sv = *v 21796 } 21797 21798 for key, value := range shape { 21799 switch key { 21800 case "Endpoint": 21801 if value != nil { 21802 jtv, ok := value.(string) 21803 if !ok { 21804 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 21805 } 21806 sv.Endpoint = ptr.String(jtv) 21807 } 21808 21809 case "Protocol": 21810 if value != nil { 21811 jtv, ok := value.(string) 21812 if !ok { 21813 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 21814 } 21815 sv.Protocol = ptr.String(jtv) 21816 } 21817 21818 default: 21819 _, _ = key, value 21820 21821 } 21822 } 21823 *v = sv 21824 return nil 21825} 21826 21827func awsRestjson1_deserializeDocumentAwsSnsTopicSubscriptionList(v *[]types.AwsSnsTopicSubscription, value interface{}) error { 21828 if v == nil { 21829 return fmt.Errorf("unexpected nil of type %T", v) 21830 } 21831 if value == nil { 21832 return nil 21833 } 21834 21835 shape, ok := value.([]interface{}) 21836 if !ok { 21837 return fmt.Errorf("unexpected JSON type %v", value) 21838 } 21839 21840 var cv []types.AwsSnsTopicSubscription 21841 if *v == nil { 21842 cv = []types.AwsSnsTopicSubscription{} 21843 } else { 21844 cv = *v 21845 } 21846 21847 for _, value := range shape { 21848 var col types.AwsSnsTopicSubscription 21849 destAddr := &col 21850 if err := awsRestjson1_deserializeDocumentAwsSnsTopicSubscription(&destAddr, value); err != nil { 21851 return err 21852 } 21853 col = *destAddr 21854 cv = append(cv, col) 21855 21856 } 21857 *v = cv 21858 return nil 21859} 21860 21861func awsRestjson1_deserializeDocumentAwsSqsQueueDetails(v **types.AwsSqsQueueDetails, value interface{}) error { 21862 if v == nil { 21863 return fmt.Errorf("unexpected nil of type %T", v) 21864 } 21865 if value == nil { 21866 return nil 21867 } 21868 21869 shape, ok := value.(map[string]interface{}) 21870 if !ok { 21871 return fmt.Errorf("unexpected JSON type %v", value) 21872 } 21873 21874 var sv *types.AwsSqsQueueDetails 21875 if *v == nil { 21876 sv = &types.AwsSqsQueueDetails{} 21877 } else { 21878 sv = *v 21879 } 21880 21881 for key, value := range shape { 21882 switch key { 21883 case "DeadLetterTargetArn": 21884 if value != nil { 21885 jtv, ok := value.(string) 21886 if !ok { 21887 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 21888 } 21889 sv.DeadLetterTargetArn = ptr.String(jtv) 21890 } 21891 21892 case "KmsDataKeyReusePeriodSeconds": 21893 if value != nil { 21894 jtv, ok := value.(json.Number) 21895 if !ok { 21896 return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) 21897 } 21898 i64, err := jtv.Int64() 21899 if err != nil { 21900 return err 21901 } 21902 sv.KmsDataKeyReusePeriodSeconds = int32(i64) 21903 } 21904 21905 case "KmsMasterKeyId": 21906 if value != nil { 21907 jtv, ok := value.(string) 21908 if !ok { 21909 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 21910 } 21911 sv.KmsMasterKeyId = ptr.String(jtv) 21912 } 21913 21914 case "QueueName": 21915 if value != nil { 21916 jtv, ok := value.(string) 21917 if !ok { 21918 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 21919 } 21920 sv.QueueName = ptr.String(jtv) 21921 } 21922 21923 default: 21924 _, _ = key, value 21925 21926 } 21927 } 21928 *v = sv 21929 return nil 21930} 21931 21932func awsRestjson1_deserializeDocumentAwsWafWebAclDetails(v **types.AwsWafWebAclDetails, value interface{}) error { 21933 if v == nil { 21934 return fmt.Errorf("unexpected nil of type %T", v) 21935 } 21936 if value == nil { 21937 return nil 21938 } 21939 21940 shape, ok := value.(map[string]interface{}) 21941 if !ok { 21942 return fmt.Errorf("unexpected JSON type %v", value) 21943 } 21944 21945 var sv *types.AwsWafWebAclDetails 21946 if *v == nil { 21947 sv = &types.AwsWafWebAclDetails{} 21948 } else { 21949 sv = *v 21950 } 21951 21952 for key, value := range shape { 21953 switch key { 21954 case "DefaultAction": 21955 if value != nil { 21956 jtv, ok := value.(string) 21957 if !ok { 21958 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 21959 } 21960 sv.DefaultAction = ptr.String(jtv) 21961 } 21962 21963 case "Name": 21964 if value != nil { 21965 jtv, ok := value.(string) 21966 if !ok { 21967 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 21968 } 21969 sv.Name = ptr.String(jtv) 21970 } 21971 21972 case "Rules": 21973 if err := awsRestjson1_deserializeDocumentAwsWafWebAclRuleList(&sv.Rules, value); err != nil { 21974 return err 21975 } 21976 21977 case "WebAclId": 21978 if value != nil { 21979 jtv, ok := value.(string) 21980 if !ok { 21981 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 21982 } 21983 sv.WebAclId = ptr.String(jtv) 21984 } 21985 21986 default: 21987 _, _ = key, value 21988 21989 } 21990 } 21991 *v = sv 21992 return nil 21993} 21994 21995func awsRestjson1_deserializeDocumentAwsWafWebAclRule(v **types.AwsWafWebAclRule, value interface{}) error { 21996 if v == nil { 21997 return fmt.Errorf("unexpected nil of type %T", v) 21998 } 21999 if value == nil { 22000 return nil 22001 } 22002 22003 shape, ok := value.(map[string]interface{}) 22004 if !ok { 22005 return fmt.Errorf("unexpected JSON type %v", value) 22006 } 22007 22008 var sv *types.AwsWafWebAclRule 22009 if *v == nil { 22010 sv = &types.AwsWafWebAclRule{} 22011 } else { 22012 sv = *v 22013 } 22014 22015 for key, value := range shape { 22016 switch key { 22017 case "Action": 22018 if err := awsRestjson1_deserializeDocumentWafAction(&sv.Action, value); err != nil { 22019 return err 22020 } 22021 22022 case "ExcludedRules": 22023 if err := awsRestjson1_deserializeDocumentWafExcludedRuleList(&sv.ExcludedRules, value); err != nil { 22024 return err 22025 } 22026 22027 case "OverrideAction": 22028 if err := awsRestjson1_deserializeDocumentWafOverrideAction(&sv.OverrideAction, value); err != nil { 22029 return err 22030 } 22031 22032 case "Priority": 22033 if value != nil { 22034 jtv, ok := value.(json.Number) 22035 if !ok { 22036 return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) 22037 } 22038 i64, err := jtv.Int64() 22039 if err != nil { 22040 return err 22041 } 22042 sv.Priority = int32(i64) 22043 } 22044 22045 case "RuleId": 22046 if value != nil { 22047 jtv, ok := value.(string) 22048 if !ok { 22049 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 22050 } 22051 sv.RuleId = ptr.String(jtv) 22052 } 22053 22054 case "Type": 22055 if value != nil { 22056 jtv, ok := value.(string) 22057 if !ok { 22058 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 22059 } 22060 sv.Type = ptr.String(jtv) 22061 } 22062 22063 default: 22064 _, _ = key, value 22065 22066 } 22067 } 22068 *v = sv 22069 return nil 22070} 22071 22072func awsRestjson1_deserializeDocumentAwsWafWebAclRuleList(v *[]types.AwsWafWebAclRule, value interface{}) error { 22073 if v == nil { 22074 return fmt.Errorf("unexpected nil of type %T", v) 22075 } 22076 if value == nil { 22077 return nil 22078 } 22079 22080 shape, ok := value.([]interface{}) 22081 if !ok { 22082 return fmt.Errorf("unexpected JSON type %v", value) 22083 } 22084 22085 var cv []types.AwsWafWebAclRule 22086 if *v == nil { 22087 cv = []types.AwsWafWebAclRule{} 22088 } else { 22089 cv = *v 22090 } 22091 22092 for _, value := range shape { 22093 var col types.AwsWafWebAclRule 22094 destAddr := &col 22095 if err := awsRestjson1_deserializeDocumentAwsWafWebAclRule(&destAddr, value); err != nil { 22096 return err 22097 } 22098 col = *destAddr 22099 cv = append(cv, col) 22100 22101 } 22102 *v = cv 22103 return nil 22104} 22105 22106func awsRestjson1_deserializeDocumentBatchUpdateFindingsUnprocessedFinding(v **types.BatchUpdateFindingsUnprocessedFinding, value interface{}) error { 22107 if v == nil { 22108 return fmt.Errorf("unexpected nil of type %T", v) 22109 } 22110 if value == nil { 22111 return nil 22112 } 22113 22114 shape, ok := value.(map[string]interface{}) 22115 if !ok { 22116 return fmt.Errorf("unexpected JSON type %v", value) 22117 } 22118 22119 var sv *types.BatchUpdateFindingsUnprocessedFinding 22120 if *v == nil { 22121 sv = &types.BatchUpdateFindingsUnprocessedFinding{} 22122 } else { 22123 sv = *v 22124 } 22125 22126 for key, value := range shape { 22127 switch key { 22128 case "ErrorCode": 22129 if value != nil { 22130 jtv, ok := value.(string) 22131 if !ok { 22132 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 22133 } 22134 sv.ErrorCode = ptr.String(jtv) 22135 } 22136 22137 case "ErrorMessage": 22138 if value != nil { 22139 jtv, ok := value.(string) 22140 if !ok { 22141 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 22142 } 22143 sv.ErrorMessage = ptr.String(jtv) 22144 } 22145 22146 case "FindingIdentifier": 22147 if err := awsRestjson1_deserializeDocumentAwsSecurityFindingIdentifier(&sv.FindingIdentifier, value); err != nil { 22148 return err 22149 } 22150 22151 default: 22152 _, _ = key, value 22153 22154 } 22155 } 22156 *v = sv 22157 return nil 22158} 22159 22160func awsRestjson1_deserializeDocumentBatchUpdateFindingsUnprocessedFindingsList(v *[]types.BatchUpdateFindingsUnprocessedFinding, value interface{}) error { 22161 if v == nil { 22162 return fmt.Errorf("unexpected nil of type %T", v) 22163 } 22164 if value == nil { 22165 return nil 22166 } 22167 22168 shape, ok := value.([]interface{}) 22169 if !ok { 22170 return fmt.Errorf("unexpected JSON type %v", value) 22171 } 22172 22173 var cv []types.BatchUpdateFindingsUnprocessedFinding 22174 if *v == nil { 22175 cv = []types.BatchUpdateFindingsUnprocessedFinding{} 22176 } else { 22177 cv = *v 22178 } 22179 22180 for _, value := range shape { 22181 var col types.BatchUpdateFindingsUnprocessedFinding 22182 destAddr := &col 22183 if err := awsRestjson1_deserializeDocumentBatchUpdateFindingsUnprocessedFinding(&destAddr, value); err != nil { 22184 return err 22185 } 22186 col = *destAddr 22187 cv = append(cv, col) 22188 22189 } 22190 *v = cv 22191 return nil 22192} 22193 22194func awsRestjson1_deserializeDocumentCategoryList(v *[]string, value interface{}) error { 22195 if v == nil { 22196 return fmt.Errorf("unexpected nil of type %T", v) 22197 } 22198 if value == nil { 22199 return nil 22200 } 22201 22202 shape, ok := value.([]interface{}) 22203 if !ok { 22204 return fmt.Errorf("unexpected JSON type %v", value) 22205 } 22206 22207 var cv []string 22208 if *v == nil { 22209 cv = []string{} 22210 } else { 22211 cv = *v 22212 } 22213 22214 for _, value := range shape { 22215 var col string 22216 if value != nil { 22217 jtv, ok := value.(string) 22218 if !ok { 22219 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 22220 } 22221 col = jtv 22222 } 22223 cv = append(cv, col) 22224 22225 } 22226 *v = cv 22227 return nil 22228} 22229 22230func awsRestjson1_deserializeDocumentCidrBlockAssociation(v **types.CidrBlockAssociation, value interface{}) error { 22231 if v == nil { 22232 return fmt.Errorf("unexpected nil of type %T", v) 22233 } 22234 if value == nil { 22235 return nil 22236 } 22237 22238 shape, ok := value.(map[string]interface{}) 22239 if !ok { 22240 return fmt.Errorf("unexpected JSON type %v", value) 22241 } 22242 22243 var sv *types.CidrBlockAssociation 22244 if *v == nil { 22245 sv = &types.CidrBlockAssociation{} 22246 } else { 22247 sv = *v 22248 } 22249 22250 for key, value := range shape { 22251 switch key { 22252 case "AssociationId": 22253 if value != nil { 22254 jtv, ok := value.(string) 22255 if !ok { 22256 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 22257 } 22258 sv.AssociationId = ptr.String(jtv) 22259 } 22260 22261 case "CidrBlock": 22262 if value != nil { 22263 jtv, ok := value.(string) 22264 if !ok { 22265 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 22266 } 22267 sv.CidrBlock = ptr.String(jtv) 22268 } 22269 22270 case "CidrBlockState": 22271 if value != nil { 22272 jtv, ok := value.(string) 22273 if !ok { 22274 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 22275 } 22276 sv.CidrBlockState = ptr.String(jtv) 22277 } 22278 22279 default: 22280 _, _ = key, value 22281 22282 } 22283 } 22284 *v = sv 22285 return nil 22286} 22287 22288func awsRestjson1_deserializeDocumentCidrBlockAssociationList(v *[]types.CidrBlockAssociation, value interface{}) error { 22289 if v == nil { 22290 return fmt.Errorf("unexpected nil of type %T", v) 22291 } 22292 if value == nil { 22293 return nil 22294 } 22295 22296 shape, ok := value.([]interface{}) 22297 if !ok { 22298 return fmt.Errorf("unexpected JSON type %v", value) 22299 } 22300 22301 var cv []types.CidrBlockAssociation 22302 if *v == nil { 22303 cv = []types.CidrBlockAssociation{} 22304 } else { 22305 cv = *v 22306 } 22307 22308 for _, value := range shape { 22309 var col types.CidrBlockAssociation 22310 destAddr := &col 22311 if err := awsRestjson1_deserializeDocumentCidrBlockAssociation(&destAddr, value); err != nil { 22312 return err 22313 } 22314 col = *destAddr 22315 cv = append(cv, col) 22316 22317 } 22318 *v = cv 22319 return nil 22320} 22321 22322func awsRestjson1_deserializeDocumentCompliance(v **types.Compliance, value interface{}) error { 22323 if v == nil { 22324 return fmt.Errorf("unexpected nil of type %T", v) 22325 } 22326 if value == nil { 22327 return nil 22328 } 22329 22330 shape, ok := value.(map[string]interface{}) 22331 if !ok { 22332 return fmt.Errorf("unexpected JSON type %v", value) 22333 } 22334 22335 var sv *types.Compliance 22336 if *v == nil { 22337 sv = &types.Compliance{} 22338 } else { 22339 sv = *v 22340 } 22341 22342 for key, value := range shape { 22343 switch key { 22344 case "RelatedRequirements": 22345 if err := awsRestjson1_deserializeDocumentRelatedRequirementsList(&sv.RelatedRequirements, value); err != nil { 22346 return err 22347 } 22348 22349 case "Status": 22350 if value != nil { 22351 jtv, ok := value.(string) 22352 if !ok { 22353 return fmt.Errorf("expected ComplianceStatus to be of type string, got %T instead", value) 22354 } 22355 sv.Status = types.ComplianceStatus(jtv) 22356 } 22357 22358 case "StatusReasons": 22359 if err := awsRestjson1_deserializeDocumentStatusReasonsList(&sv.StatusReasons, value); err != nil { 22360 return err 22361 } 22362 22363 default: 22364 _, _ = key, value 22365 22366 } 22367 } 22368 *v = sv 22369 return nil 22370} 22371 22372func awsRestjson1_deserializeDocumentContainerDetails(v **types.ContainerDetails, value interface{}) error { 22373 if v == nil { 22374 return fmt.Errorf("unexpected nil of type %T", v) 22375 } 22376 if value == nil { 22377 return nil 22378 } 22379 22380 shape, ok := value.(map[string]interface{}) 22381 if !ok { 22382 return fmt.Errorf("unexpected JSON type %v", value) 22383 } 22384 22385 var sv *types.ContainerDetails 22386 if *v == nil { 22387 sv = &types.ContainerDetails{} 22388 } else { 22389 sv = *v 22390 } 22391 22392 for key, value := range shape { 22393 switch key { 22394 case "ImageId": 22395 if value != nil { 22396 jtv, ok := value.(string) 22397 if !ok { 22398 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 22399 } 22400 sv.ImageId = ptr.String(jtv) 22401 } 22402 22403 case "ImageName": 22404 if value != nil { 22405 jtv, ok := value.(string) 22406 if !ok { 22407 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 22408 } 22409 sv.ImageName = ptr.String(jtv) 22410 } 22411 22412 case "LaunchedAt": 22413 if value != nil { 22414 jtv, ok := value.(string) 22415 if !ok { 22416 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 22417 } 22418 sv.LaunchedAt = ptr.String(jtv) 22419 } 22420 22421 case "Name": 22422 if value != nil { 22423 jtv, ok := value.(string) 22424 if !ok { 22425 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 22426 } 22427 sv.Name = ptr.String(jtv) 22428 } 22429 22430 default: 22431 _, _ = key, value 22432 22433 } 22434 } 22435 *v = sv 22436 return nil 22437} 22438 22439func awsRestjson1_deserializeDocumentCvss(v **types.Cvss, value interface{}) error { 22440 if v == nil { 22441 return fmt.Errorf("unexpected nil of type %T", v) 22442 } 22443 if value == nil { 22444 return nil 22445 } 22446 22447 shape, ok := value.(map[string]interface{}) 22448 if !ok { 22449 return fmt.Errorf("unexpected JSON type %v", value) 22450 } 22451 22452 var sv *types.Cvss 22453 if *v == nil { 22454 sv = &types.Cvss{} 22455 } else { 22456 sv = *v 22457 } 22458 22459 for key, value := range shape { 22460 switch key { 22461 case "BaseScore": 22462 if value != nil { 22463 jtv, ok := value.(json.Number) 22464 if !ok { 22465 return fmt.Errorf("expected Double to be json.Number, got %T instead", value) 22466 } 22467 f64, err := jtv.Float64() 22468 if err != nil { 22469 return err 22470 } 22471 sv.BaseScore = f64 22472 } 22473 22474 case "BaseVector": 22475 if value != nil { 22476 jtv, ok := value.(string) 22477 if !ok { 22478 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 22479 } 22480 sv.BaseVector = ptr.String(jtv) 22481 } 22482 22483 case "Version": 22484 if value != nil { 22485 jtv, ok := value.(string) 22486 if !ok { 22487 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 22488 } 22489 sv.Version = ptr.String(jtv) 22490 } 22491 22492 default: 22493 _, _ = key, value 22494 22495 } 22496 } 22497 *v = sv 22498 return nil 22499} 22500 22501func awsRestjson1_deserializeDocumentCvssList(v *[]types.Cvss, value interface{}) error { 22502 if v == nil { 22503 return fmt.Errorf("unexpected nil of type %T", v) 22504 } 22505 if value == nil { 22506 return nil 22507 } 22508 22509 shape, ok := value.([]interface{}) 22510 if !ok { 22511 return fmt.Errorf("unexpected JSON type %v", value) 22512 } 22513 22514 var cv []types.Cvss 22515 if *v == nil { 22516 cv = []types.Cvss{} 22517 } else { 22518 cv = *v 22519 } 22520 22521 for _, value := range shape { 22522 var col types.Cvss 22523 destAddr := &col 22524 if err := awsRestjson1_deserializeDocumentCvss(&destAddr, value); err != nil { 22525 return err 22526 } 22527 col = *destAddr 22528 cv = append(cv, col) 22529 22530 } 22531 *v = cv 22532 return nil 22533} 22534 22535func awsRestjson1_deserializeDocumentDateFilter(v **types.DateFilter, value interface{}) error { 22536 if v == nil { 22537 return fmt.Errorf("unexpected nil of type %T", v) 22538 } 22539 if value == nil { 22540 return nil 22541 } 22542 22543 shape, ok := value.(map[string]interface{}) 22544 if !ok { 22545 return fmt.Errorf("unexpected JSON type %v", value) 22546 } 22547 22548 var sv *types.DateFilter 22549 if *v == nil { 22550 sv = &types.DateFilter{} 22551 } else { 22552 sv = *v 22553 } 22554 22555 for key, value := range shape { 22556 switch key { 22557 case "DateRange": 22558 if err := awsRestjson1_deserializeDocumentDateRange(&sv.DateRange, value); err != nil { 22559 return err 22560 } 22561 22562 case "End": 22563 if value != nil { 22564 jtv, ok := value.(string) 22565 if !ok { 22566 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 22567 } 22568 sv.End = ptr.String(jtv) 22569 } 22570 22571 case "Start": 22572 if value != nil { 22573 jtv, ok := value.(string) 22574 if !ok { 22575 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 22576 } 22577 sv.Start = ptr.String(jtv) 22578 } 22579 22580 default: 22581 _, _ = key, value 22582 22583 } 22584 } 22585 *v = sv 22586 return nil 22587} 22588 22589func awsRestjson1_deserializeDocumentDateFilterList(v *[]types.DateFilter, value interface{}) error { 22590 if v == nil { 22591 return fmt.Errorf("unexpected nil of type %T", v) 22592 } 22593 if value == nil { 22594 return nil 22595 } 22596 22597 shape, ok := value.([]interface{}) 22598 if !ok { 22599 return fmt.Errorf("unexpected JSON type %v", value) 22600 } 22601 22602 var cv []types.DateFilter 22603 if *v == nil { 22604 cv = []types.DateFilter{} 22605 } else { 22606 cv = *v 22607 } 22608 22609 for _, value := range shape { 22610 var col types.DateFilter 22611 destAddr := &col 22612 if err := awsRestjson1_deserializeDocumentDateFilter(&destAddr, value); err != nil { 22613 return err 22614 } 22615 col = *destAddr 22616 cv = append(cv, col) 22617 22618 } 22619 *v = cv 22620 return nil 22621} 22622 22623func awsRestjson1_deserializeDocumentDateRange(v **types.DateRange, value interface{}) error { 22624 if v == nil { 22625 return fmt.Errorf("unexpected nil of type %T", v) 22626 } 22627 if value == nil { 22628 return nil 22629 } 22630 22631 shape, ok := value.(map[string]interface{}) 22632 if !ok { 22633 return fmt.Errorf("unexpected JSON type %v", value) 22634 } 22635 22636 var sv *types.DateRange 22637 if *v == nil { 22638 sv = &types.DateRange{} 22639 } else { 22640 sv = *v 22641 } 22642 22643 for key, value := range shape { 22644 switch key { 22645 case "Unit": 22646 if value != nil { 22647 jtv, ok := value.(string) 22648 if !ok { 22649 return fmt.Errorf("expected DateRangeUnit to be of type string, got %T instead", value) 22650 } 22651 sv.Unit = types.DateRangeUnit(jtv) 22652 } 22653 22654 case "Value": 22655 if value != nil { 22656 jtv, ok := value.(json.Number) 22657 if !ok { 22658 return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) 22659 } 22660 i64, err := jtv.Int64() 22661 if err != nil { 22662 return err 22663 } 22664 sv.Value = int32(i64) 22665 } 22666 22667 default: 22668 _, _ = key, value 22669 22670 } 22671 } 22672 *v = sv 22673 return nil 22674} 22675 22676func awsRestjson1_deserializeDocumentFieldMap(v *map[string]string, value interface{}) error { 22677 if v == nil { 22678 return fmt.Errorf("unexpected nil of type %T", v) 22679 } 22680 if value == nil { 22681 return nil 22682 } 22683 22684 shape, ok := value.(map[string]interface{}) 22685 if !ok { 22686 return fmt.Errorf("unexpected JSON type %v", value) 22687 } 22688 22689 var mv map[string]string 22690 if *v == nil { 22691 mv = map[string]string{} 22692 } else { 22693 mv = *v 22694 } 22695 22696 for key, value := range shape { 22697 var parsedVal string 22698 if value != nil { 22699 jtv, ok := value.(string) 22700 if !ok { 22701 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 22702 } 22703 parsedVal = jtv 22704 } 22705 mv[key] = parsedVal 22706 22707 } 22708 *v = mv 22709 return nil 22710} 22711 22712func awsRestjson1_deserializeDocumentImportFindingsError(v **types.ImportFindingsError, value interface{}) error { 22713 if v == nil { 22714 return fmt.Errorf("unexpected nil of type %T", v) 22715 } 22716 if value == nil { 22717 return nil 22718 } 22719 22720 shape, ok := value.(map[string]interface{}) 22721 if !ok { 22722 return fmt.Errorf("unexpected JSON type %v", value) 22723 } 22724 22725 var sv *types.ImportFindingsError 22726 if *v == nil { 22727 sv = &types.ImportFindingsError{} 22728 } else { 22729 sv = *v 22730 } 22731 22732 for key, value := range shape { 22733 switch key { 22734 case "ErrorCode": 22735 if value != nil { 22736 jtv, ok := value.(string) 22737 if !ok { 22738 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 22739 } 22740 sv.ErrorCode = ptr.String(jtv) 22741 } 22742 22743 case "ErrorMessage": 22744 if value != nil { 22745 jtv, ok := value.(string) 22746 if !ok { 22747 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 22748 } 22749 sv.ErrorMessage = ptr.String(jtv) 22750 } 22751 22752 case "Id": 22753 if value != nil { 22754 jtv, ok := value.(string) 22755 if !ok { 22756 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 22757 } 22758 sv.Id = ptr.String(jtv) 22759 } 22760 22761 default: 22762 _, _ = key, value 22763 22764 } 22765 } 22766 *v = sv 22767 return nil 22768} 22769 22770func awsRestjson1_deserializeDocumentImportFindingsErrorList(v *[]types.ImportFindingsError, value interface{}) error { 22771 if v == nil { 22772 return fmt.Errorf("unexpected nil of type %T", v) 22773 } 22774 if value == nil { 22775 return nil 22776 } 22777 22778 shape, ok := value.([]interface{}) 22779 if !ok { 22780 return fmt.Errorf("unexpected JSON type %v", value) 22781 } 22782 22783 var cv []types.ImportFindingsError 22784 if *v == nil { 22785 cv = []types.ImportFindingsError{} 22786 } else { 22787 cv = *v 22788 } 22789 22790 for _, value := range shape { 22791 var col types.ImportFindingsError 22792 destAddr := &col 22793 if err := awsRestjson1_deserializeDocumentImportFindingsError(&destAddr, value); err != nil { 22794 return err 22795 } 22796 col = *destAddr 22797 cv = append(cv, col) 22798 22799 } 22800 *v = cv 22801 return nil 22802} 22803 22804func awsRestjson1_deserializeDocumentInsight(v **types.Insight, value interface{}) error { 22805 if v == nil { 22806 return fmt.Errorf("unexpected nil of type %T", v) 22807 } 22808 if value == nil { 22809 return nil 22810 } 22811 22812 shape, ok := value.(map[string]interface{}) 22813 if !ok { 22814 return fmt.Errorf("unexpected JSON type %v", value) 22815 } 22816 22817 var sv *types.Insight 22818 if *v == nil { 22819 sv = &types.Insight{} 22820 } else { 22821 sv = *v 22822 } 22823 22824 for key, value := range shape { 22825 switch key { 22826 case "Filters": 22827 if err := awsRestjson1_deserializeDocumentAwsSecurityFindingFilters(&sv.Filters, value); err != nil { 22828 return err 22829 } 22830 22831 case "GroupByAttribute": 22832 if value != nil { 22833 jtv, ok := value.(string) 22834 if !ok { 22835 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 22836 } 22837 sv.GroupByAttribute = ptr.String(jtv) 22838 } 22839 22840 case "InsightArn": 22841 if value != nil { 22842 jtv, ok := value.(string) 22843 if !ok { 22844 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 22845 } 22846 sv.InsightArn = ptr.String(jtv) 22847 } 22848 22849 case "Name": 22850 if value != nil { 22851 jtv, ok := value.(string) 22852 if !ok { 22853 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 22854 } 22855 sv.Name = ptr.String(jtv) 22856 } 22857 22858 default: 22859 _, _ = key, value 22860 22861 } 22862 } 22863 *v = sv 22864 return nil 22865} 22866 22867func awsRestjson1_deserializeDocumentInsightList(v *[]types.Insight, value interface{}) error { 22868 if v == nil { 22869 return fmt.Errorf("unexpected nil of type %T", v) 22870 } 22871 if value == nil { 22872 return nil 22873 } 22874 22875 shape, ok := value.([]interface{}) 22876 if !ok { 22877 return fmt.Errorf("unexpected JSON type %v", value) 22878 } 22879 22880 var cv []types.Insight 22881 if *v == nil { 22882 cv = []types.Insight{} 22883 } else { 22884 cv = *v 22885 } 22886 22887 for _, value := range shape { 22888 var col types.Insight 22889 destAddr := &col 22890 if err := awsRestjson1_deserializeDocumentInsight(&destAddr, value); err != nil { 22891 return err 22892 } 22893 col = *destAddr 22894 cv = append(cv, col) 22895 22896 } 22897 *v = cv 22898 return nil 22899} 22900 22901func awsRestjson1_deserializeDocumentInsightResults(v **types.InsightResults, value interface{}) error { 22902 if v == nil { 22903 return fmt.Errorf("unexpected nil of type %T", v) 22904 } 22905 if value == nil { 22906 return nil 22907 } 22908 22909 shape, ok := value.(map[string]interface{}) 22910 if !ok { 22911 return fmt.Errorf("unexpected JSON type %v", value) 22912 } 22913 22914 var sv *types.InsightResults 22915 if *v == nil { 22916 sv = &types.InsightResults{} 22917 } else { 22918 sv = *v 22919 } 22920 22921 for key, value := range shape { 22922 switch key { 22923 case "GroupByAttribute": 22924 if value != nil { 22925 jtv, ok := value.(string) 22926 if !ok { 22927 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 22928 } 22929 sv.GroupByAttribute = ptr.String(jtv) 22930 } 22931 22932 case "InsightArn": 22933 if value != nil { 22934 jtv, ok := value.(string) 22935 if !ok { 22936 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 22937 } 22938 sv.InsightArn = ptr.String(jtv) 22939 } 22940 22941 case "ResultValues": 22942 if err := awsRestjson1_deserializeDocumentInsightResultValueList(&sv.ResultValues, value); err != nil { 22943 return err 22944 } 22945 22946 default: 22947 _, _ = key, value 22948 22949 } 22950 } 22951 *v = sv 22952 return nil 22953} 22954 22955func awsRestjson1_deserializeDocumentInsightResultValue(v **types.InsightResultValue, value interface{}) error { 22956 if v == nil { 22957 return fmt.Errorf("unexpected nil of type %T", v) 22958 } 22959 if value == nil { 22960 return nil 22961 } 22962 22963 shape, ok := value.(map[string]interface{}) 22964 if !ok { 22965 return fmt.Errorf("unexpected JSON type %v", value) 22966 } 22967 22968 var sv *types.InsightResultValue 22969 if *v == nil { 22970 sv = &types.InsightResultValue{} 22971 } else { 22972 sv = *v 22973 } 22974 22975 for key, value := range shape { 22976 switch key { 22977 case "Count": 22978 if value != nil { 22979 jtv, ok := value.(json.Number) 22980 if !ok { 22981 return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) 22982 } 22983 i64, err := jtv.Int64() 22984 if err != nil { 22985 return err 22986 } 22987 sv.Count = int32(i64) 22988 } 22989 22990 case "GroupByAttributeValue": 22991 if value != nil { 22992 jtv, ok := value.(string) 22993 if !ok { 22994 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 22995 } 22996 sv.GroupByAttributeValue = ptr.String(jtv) 22997 } 22998 22999 default: 23000 _, _ = key, value 23001 23002 } 23003 } 23004 *v = sv 23005 return nil 23006} 23007 23008func awsRestjson1_deserializeDocumentInsightResultValueList(v *[]types.InsightResultValue, value interface{}) error { 23009 if v == nil { 23010 return fmt.Errorf("unexpected nil of type %T", v) 23011 } 23012 if value == nil { 23013 return nil 23014 } 23015 23016 shape, ok := value.([]interface{}) 23017 if !ok { 23018 return fmt.Errorf("unexpected JSON type %v", value) 23019 } 23020 23021 var cv []types.InsightResultValue 23022 if *v == nil { 23023 cv = []types.InsightResultValue{} 23024 } else { 23025 cv = *v 23026 } 23027 23028 for _, value := range shape { 23029 var col types.InsightResultValue 23030 destAddr := &col 23031 if err := awsRestjson1_deserializeDocumentInsightResultValue(&destAddr, value); err != nil { 23032 return err 23033 } 23034 col = *destAddr 23035 cv = append(cv, col) 23036 23037 } 23038 *v = cv 23039 return nil 23040} 23041 23042func awsRestjson1_deserializeDocumentIntegrationTypeList(v *[]types.IntegrationType, value interface{}) error { 23043 if v == nil { 23044 return fmt.Errorf("unexpected nil of type %T", v) 23045 } 23046 if value == nil { 23047 return nil 23048 } 23049 23050 shape, ok := value.([]interface{}) 23051 if !ok { 23052 return fmt.Errorf("unexpected JSON type %v", value) 23053 } 23054 23055 var cv []types.IntegrationType 23056 if *v == nil { 23057 cv = []types.IntegrationType{} 23058 } else { 23059 cv = *v 23060 } 23061 23062 for _, value := range shape { 23063 var col types.IntegrationType 23064 if value != nil { 23065 jtv, ok := value.(string) 23066 if !ok { 23067 return fmt.Errorf("expected IntegrationType to be of type string, got %T instead", value) 23068 } 23069 col = types.IntegrationType(jtv) 23070 } 23071 cv = append(cv, col) 23072 23073 } 23074 *v = cv 23075 return nil 23076} 23077 23078func awsRestjson1_deserializeDocumentInternalException(v **types.InternalException, value interface{}) error { 23079 if v == nil { 23080 return fmt.Errorf("unexpected nil of type %T", v) 23081 } 23082 if value == nil { 23083 return nil 23084 } 23085 23086 shape, ok := value.(map[string]interface{}) 23087 if !ok { 23088 return fmt.Errorf("unexpected JSON type %v", value) 23089 } 23090 23091 var sv *types.InternalException 23092 if *v == nil { 23093 sv = &types.InternalException{} 23094 } else { 23095 sv = *v 23096 } 23097 23098 for key, value := range shape { 23099 switch key { 23100 case "Code": 23101 if value != nil { 23102 jtv, ok := value.(string) 23103 if !ok { 23104 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 23105 } 23106 sv.Code = ptr.String(jtv) 23107 } 23108 23109 case "Message": 23110 if value != nil { 23111 jtv, ok := value.(string) 23112 if !ok { 23113 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 23114 } 23115 sv.Message = ptr.String(jtv) 23116 } 23117 23118 default: 23119 _, _ = key, value 23120 23121 } 23122 } 23123 *v = sv 23124 return nil 23125} 23126 23127func awsRestjson1_deserializeDocumentInvalidAccessException(v **types.InvalidAccessException, value interface{}) error { 23128 if v == nil { 23129 return fmt.Errorf("unexpected nil of type %T", v) 23130 } 23131 if value == nil { 23132 return nil 23133 } 23134 23135 shape, ok := value.(map[string]interface{}) 23136 if !ok { 23137 return fmt.Errorf("unexpected JSON type %v", value) 23138 } 23139 23140 var sv *types.InvalidAccessException 23141 if *v == nil { 23142 sv = &types.InvalidAccessException{} 23143 } else { 23144 sv = *v 23145 } 23146 23147 for key, value := range shape { 23148 switch key { 23149 case "Code": 23150 if value != nil { 23151 jtv, ok := value.(string) 23152 if !ok { 23153 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 23154 } 23155 sv.Code = ptr.String(jtv) 23156 } 23157 23158 case "Message": 23159 if value != nil { 23160 jtv, ok := value.(string) 23161 if !ok { 23162 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 23163 } 23164 sv.Message = ptr.String(jtv) 23165 } 23166 23167 default: 23168 _, _ = key, value 23169 23170 } 23171 } 23172 *v = sv 23173 return nil 23174} 23175 23176func awsRestjson1_deserializeDocumentInvalidInputException(v **types.InvalidInputException, value interface{}) error { 23177 if v == nil { 23178 return fmt.Errorf("unexpected nil of type %T", v) 23179 } 23180 if value == nil { 23181 return nil 23182 } 23183 23184 shape, ok := value.(map[string]interface{}) 23185 if !ok { 23186 return fmt.Errorf("unexpected JSON type %v", value) 23187 } 23188 23189 var sv *types.InvalidInputException 23190 if *v == nil { 23191 sv = &types.InvalidInputException{} 23192 } else { 23193 sv = *v 23194 } 23195 23196 for key, value := range shape { 23197 switch key { 23198 case "Code": 23199 if value != nil { 23200 jtv, ok := value.(string) 23201 if !ok { 23202 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 23203 } 23204 sv.Code = ptr.String(jtv) 23205 } 23206 23207 case "Message": 23208 if value != nil { 23209 jtv, ok := value.(string) 23210 if !ok { 23211 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 23212 } 23213 sv.Message = ptr.String(jtv) 23214 } 23215 23216 default: 23217 _, _ = key, value 23218 23219 } 23220 } 23221 *v = sv 23222 return nil 23223} 23224 23225func awsRestjson1_deserializeDocumentInvitation(v **types.Invitation, value interface{}) error { 23226 if v == nil { 23227 return fmt.Errorf("unexpected nil of type %T", v) 23228 } 23229 if value == nil { 23230 return nil 23231 } 23232 23233 shape, ok := value.(map[string]interface{}) 23234 if !ok { 23235 return fmt.Errorf("unexpected JSON type %v", value) 23236 } 23237 23238 var sv *types.Invitation 23239 if *v == nil { 23240 sv = &types.Invitation{} 23241 } else { 23242 sv = *v 23243 } 23244 23245 for key, value := range shape { 23246 switch key { 23247 case "AccountId": 23248 if value != nil { 23249 jtv, ok := value.(string) 23250 if !ok { 23251 return fmt.Errorf("expected AccountId to be of type string, got %T instead", value) 23252 } 23253 sv.AccountId = ptr.String(jtv) 23254 } 23255 23256 case "InvitationId": 23257 if value != nil { 23258 jtv, ok := value.(string) 23259 if !ok { 23260 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 23261 } 23262 sv.InvitationId = ptr.String(jtv) 23263 } 23264 23265 case "InvitedAt": 23266 if value != nil { 23267 jtv, ok := value.(string) 23268 if !ok { 23269 return fmt.Errorf("expected Timestamp to be of type string, got %T instead", value) 23270 } 23271 t, err := smithytime.ParseDateTime(jtv) 23272 if err != nil { 23273 return err 23274 } 23275 sv.InvitedAt = ptr.Time(t) 23276 } 23277 23278 case "MemberStatus": 23279 if value != nil { 23280 jtv, ok := value.(string) 23281 if !ok { 23282 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 23283 } 23284 sv.MemberStatus = ptr.String(jtv) 23285 } 23286 23287 default: 23288 _, _ = key, value 23289 23290 } 23291 } 23292 *v = sv 23293 return nil 23294} 23295 23296func awsRestjson1_deserializeDocumentInvitationList(v *[]types.Invitation, value interface{}) error { 23297 if v == nil { 23298 return fmt.Errorf("unexpected nil of type %T", v) 23299 } 23300 if value == nil { 23301 return nil 23302 } 23303 23304 shape, ok := value.([]interface{}) 23305 if !ok { 23306 return fmt.Errorf("unexpected JSON type %v", value) 23307 } 23308 23309 var cv []types.Invitation 23310 if *v == nil { 23311 cv = []types.Invitation{} 23312 } else { 23313 cv = *v 23314 } 23315 23316 for _, value := range shape { 23317 var col types.Invitation 23318 destAddr := &col 23319 if err := awsRestjson1_deserializeDocumentInvitation(&destAddr, value); err != nil { 23320 return err 23321 } 23322 col = *destAddr 23323 cv = append(cv, col) 23324 23325 } 23326 *v = cv 23327 return nil 23328} 23329 23330func awsRestjson1_deserializeDocumentIpFilter(v **types.IpFilter, value interface{}) error { 23331 if v == nil { 23332 return fmt.Errorf("unexpected nil of type %T", v) 23333 } 23334 if value == nil { 23335 return nil 23336 } 23337 23338 shape, ok := value.(map[string]interface{}) 23339 if !ok { 23340 return fmt.Errorf("unexpected JSON type %v", value) 23341 } 23342 23343 var sv *types.IpFilter 23344 if *v == nil { 23345 sv = &types.IpFilter{} 23346 } else { 23347 sv = *v 23348 } 23349 23350 for key, value := range shape { 23351 switch key { 23352 case "Cidr": 23353 if value != nil { 23354 jtv, ok := value.(string) 23355 if !ok { 23356 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 23357 } 23358 sv.Cidr = ptr.String(jtv) 23359 } 23360 23361 default: 23362 _, _ = key, value 23363 23364 } 23365 } 23366 *v = sv 23367 return nil 23368} 23369 23370func awsRestjson1_deserializeDocumentIpFilterList(v *[]types.IpFilter, value interface{}) error { 23371 if v == nil { 23372 return fmt.Errorf("unexpected nil of type %T", v) 23373 } 23374 if value == nil { 23375 return nil 23376 } 23377 23378 shape, ok := value.([]interface{}) 23379 if !ok { 23380 return fmt.Errorf("unexpected JSON type %v", value) 23381 } 23382 23383 var cv []types.IpFilter 23384 if *v == nil { 23385 cv = []types.IpFilter{} 23386 } else { 23387 cv = *v 23388 } 23389 23390 for _, value := range shape { 23391 var col types.IpFilter 23392 destAddr := &col 23393 if err := awsRestjson1_deserializeDocumentIpFilter(&destAddr, value); err != nil { 23394 return err 23395 } 23396 col = *destAddr 23397 cv = append(cv, col) 23398 23399 } 23400 *v = cv 23401 return nil 23402} 23403 23404func awsRestjson1_deserializeDocumentIpv6CidrBlockAssociation(v **types.Ipv6CidrBlockAssociation, value interface{}) error { 23405 if v == nil { 23406 return fmt.Errorf("unexpected nil of type %T", v) 23407 } 23408 if value == nil { 23409 return nil 23410 } 23411 23412 shape, ok := value.(map[string]interface{}) 23413 if !ok { 23414 return fmt.Errorf("unexpected JSON type %v", value) 23415 } 23416 23417 var sv *types.Ipv6CidrBlockAssociation 23418 if *v == nil { 23419 sv = &types.Ipv6CidrBlockAssociation{} 23420 } else { 23421 sv = *v 23422 } 23423 23424 for key, value := range shape { 23425 switch key { 23426 case "AssociationId": 23427 if value != nil { 23428 jtv, ok := value.(string) 23429 if !ok { 23430 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 23431 } 23432 sv.AssociationId = ptr.String(jtv) 23433 } 23434 23435 case "CidrBlockState": 23436 if value != nil { 23437 jtv, ok := value.(string) 23438 if !ok { 23439 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 23440 } 23441 sv.CidrBlockState = ptr.String(jtv) 23442 } 23443 23444 case "Ipv6CidrBlock": 23445 if value != nil { 23446 jtv, ok := value.(string) 23447 if !ok { 23448 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 23449 } 23450 sv.Ipv6CidrBlock = ptr.String(jtv) 23451 } 23452 23453 default: 23454 _, _ = key, value 23455 23456 } 23457 } 23458 *v = sv 23459 return nil 23460} 23461 23462func awsRestjson1_deserializeDocumentIpv6CidrBlockAssociationList(v *[]types.Ipv6CidrBlockAssociation, value interface{}) error { 23463 if v == nil { 23464 return fmt.Errorf("unexpected nil of type %T", v) 23465 } 23466 if value == nil { 23467 return nil 23468 } 23469 23470 shape, ok := value.([]interface{}) 23471 if !ok { 23472 return fmt.Errorf("unexpected JSON type %v", value) 23473 } 23474 23475 var cv []types.Ipv6CidrBlockAssociation 23476 if *v == nil { 23477 cv = []types.Ipv6CidrBlockAssociation{} 23478 } else { 23479 cv = *v 23480 } 23481 23482 for _, value := range shape { 23483 var col types.Ipv6CidrBlockAssociation 23484 destAddr := &col 23485 if err := awsRestjson1_deserializeDocumentIpv6CidrBlockAssociation(&destAddr, value); err != nil { 23486 return err 23487 } 23488 col = *destAddr 23489 cv = append(cv, col) 23490 23491 } 23492 *v = cv 23493 return nil 23494} 23495 23496func awsRestjson1_deserializeDocumentKeywordFilter(v **types.KeywordFilter, value interface{}) error { 23497 if v == nil { 23498 return fmt.Errorf("unexpected nil of type %T", v) 23499 } 23500 if value == nil { 23501 return nil 23502 } 23503 23504 shape, ok := value.(map[string]interface{}) 23505 if !ok { 23506 return fmt.Errorf("unexpected JSON type %v", value) 23507 } 23508 23509 var sv *types.KeywordFilter 23510 if *v == nil { 23511 sv = &types.KeywordFilter{} 23512 } else { 23513 sv = *v 23514 } 23515 23516 for key, value := range shape { 23517 switch key { 23518 case "Value": 23519 if value != nil { 23520 jtv, ok := value.(string) 23521 if !ok { 23522 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 23523 } 23524 sv.Value = ptr.String(jtv) 23525 } 23526 23527 default: 23528 _, _ = key, value 23529 23530 } 23531 } 23532 *v = sv 23533 return nil 23534} 23535 23536func awsRestjson1_deserializeDocumentKeywordFilterList(v *[]types.KeywordFilter, value interface{}) error { 23537 if v == nil { 23538 return fmt.Errorf("unexpected nil of type %T", v) 23539 } 23540 if value == nil { 23541 return nil 23542 } 23543 23544 shape, ok := value.([]interface{}) 23545 if !ok { 23546 return fmt.Errorf("unexpected JSON type %v", value) 23547 } 23548 23549 var cv []types.KeywordFilter 23550 if *v == nil { 23551 cv = []types.KeywordFilter{} 23552 } else { 23553 cv = *v 23554 } 23555 23556 for _, value := range shape { 23557 var col types.KeywordFilter 23558 destAddr := &col 23559 if err := awsRestjson1_deserializeDocumentKeywordFilter(&destAddr, value); err != nil { 23560 return err 23561 } 23562 col = *destAddr 23563 cv = append(cv, col) 23564 23565 } 23566 *v = cv 23567 return nil 23568} 23569 23570func awsRestjson1_deserializeDocumentLimitExceededException(v **types.LimitExceededException, value interface{}) error { 23571 if v == nil { 23572 return fmt.Errorf("unexpected nil of type %T", v) 23573 } 23574 if value == nil { 23575 return nil 23576 } 23577 23578 shape, ok := value.(map[string]interface{}) 23579 if !ok { 23580 return fmt.Errorf("unexpected JSON type %v", value) 23581 } 23582 23583 var sv *types.LimitExceededException 23584 if *v == nil { 23585 sv = &types.LimitExceededException{} 23586 } else { 23587 sv = *v 23588 } 23589 23590 for key, value := range shape { 23591 switch key { 23592 case "Code": 23593 if value != nil { 23594 jtv, ok := value.(string) 23595 if !ok { 23596 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 23597 } 23598 sv.Code = ptr.String(jtv) 23599 } 23600 23601 case "Message": 23602 if value != nil { 23603 jtv, ok := value.(string) 23604 if !ok { 23605 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 23606 } 23607 sv.Message = ptr.String(jtv) 23608 } 23609 23610 default: 23611 _, _ = key, value 23612 23613 } 23614 } 23615 *v = sv 23616 return nil 23617} 23618 23619func awsRestjson1_deserializeDocumentLoadBalancerState(v **types.LoadBalancerState, value interface{}) error { 23620 if v == nil { 23621 return fmt.Errorf("unexpected nil of type %T", v) 23622 } 23623 if value == nil { 23624 return nil 23625 } 23626 23627 shape, ok := value.(map[string]interface{}) 23628 if !ok { 23629 return fmt.Errorf("unexpected JSON type %v", value) 23630 } 23631 23632 var sv *types.LoadBalancerState 23633 if *v == nil { 23634 sv = &types.LoadBalancerState{} 23635 } else { 23636 sv = *v 23637 } 23638 23639 for key, value := range shape { 23640 switch key { 23641 case "Code": 23642 if value != nil { 23643 jtv, ok := value.(string) 23644 if !ok { 23645 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 23646 } 23647 sv.Code = ptr.String(jtv) 23648 } 23649 23650 case "Reason": 23651 if value != nil { 23652 jtv, ok := value.(string) 23653 if !ok { 23654 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 23655 } 23656 sv.Reason = ptr.String(jtv) 23657 } 23658 23659 default: 23660 _, _ = key, value 23661 23662 } 23663 } 23664 *v = sv 23665 return nil 23666} 23667 23668func awsRestjson1_deserializeDocumentMalware(v **types.Malware, value interface{}) error { 23669 if v == nil { 23670 return fmt.Errorf("unexpected nil of type %T", v) 23671 } 23672 if value == nil { 23673 return nil 23674 } 23675 23676 shape, ok := value.(map[string]interface{}) 23677 if !ok { 23678 return fmt.Errorf("unexpected JSON type %v", value) 23679 } 23680 23681 var sv *types.Malware 23682 if *v == nil { 23683 sv = &types.Malware{} 23684 } else { 23685 sv = *v 23686 } 23687 23688 for key, value := range shape { 23689 switch key { 23690 case "Name": 23691 if value != nil { 23692 jtv, ok := value.(string) 23693 if !ok { 23694 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 23695 } 23696 sv.Name = ptr.String(jtv) 23697 } 23698 23699 case "Path": 23700 if value != nil { 23701 jtv, ok := value.(string) 23702 if !ok { 23703 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 23704 } 23705 sv.Path = ptr.String(jtv) 23706 } 23707 23708 case "State": 23709 if value != nil { 23710 jtv, ok := value.(string) 23711 if !ok { 23712 return fmt.Errorf("expected MalwareState to be of type string, got %T instead", value) 23713 } 23714 sv.State = types.MalwareState(jtv) 23715 } 23716 23717 case "Type": 23718 if value != nil { 23719 jtv, ok := value.(string) 23720 if !ok { 23721 return fmt.Errorf("expected MalwareType to be of type string, got %T instead", value) 23722 } 23723 sv.Type = types.MalwareType(jtv) 23724 } 23725 23726 default: 23727 _, _ = key, value 23728 23729 } 23730 } 23731 *v = sv 23732 return nil 23733} 23734 23735func awsRestjson1_deserializeDocumentMalwareList(v *[]types.Malware, value interface{}) error { 23736 if v == nil { 23737 return fmt.Errorf("unexpected nil of type %T", v) 23738 } 23739 if value == nil { 23740 return nil 23741 } 23742 23743 shape, ok := value.([]interface{}) 23744 if !ok { 23745 return fmt.Errorf("unexpected JSON type %v", value) 23746 } 23747 23748 var cv []types.Malware 23749 if *v == nil { 23750 cv = []types.Malware{} 23751 } else { 23752 cv = *v 23753 } 23754 23755 for _, value := range shape { 23756 var col types.Malware 23757 destAddr := &col 23758 if err := awsRestjson1_deserializeDocumentMalware(&destAddr, value); err != nil { 23759 return err 23760 } 23761 col = *destAddr 23762 cv = append(cv, col) 23763 23764 } 23765 *v = cv 23766 return nil 23767} 23768 23769func awsRestjson1_deserializeDocumentMapFilter(v **types.MapFilter, value interface{}) error { 23770 if v == nil { 23771 return fmt.Errorf("unexpected nil of type %T", v) 23772 } 23773 if value == nil { 23774 return nil 23775 } 23776 23777 shape, ok := value.(map[string]interface{}) 23778 if !ok { 23779 return fmt.Errorf("unexpected JSON type %v", value) 23780 } 23781 23782 var sv *types.MapFilter 23783 if *v == nil { 23784 sv = &types.MapFilter{} 23785 } else { 23786 sv = *v 23787 } 23788 23789 for key, value := range shape { 23790 switch key { 23791 case "Comparison": 23792 if value != nil { 23793 jtv, ok := value.(string) 23794 if !ok { 23795 return fmt.Errorf("expected MapFilterComparison to be of type string, got %T instead", value) 23796 } 23797 sv.Comparison = types.MapFilterComparison(jtv) 23798 } 23799 23800 case "Key": 23801 if value != nil { 23802 jtv, ok := value.(string) 23803 if !ok { 23804 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 23805 } 23806 sv.Key = ptr.String(jtv) 23807 } 23808 23809 case "Value": 23810 if value != nil { 23811 jtv, ok := value.(string) 23812 if !ok { 23813 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 23814 } 23815 sv.Value = ptr.String(jtv) 23816 } 23817 23818 default: 23819 _, _ = key, value 23820 23821 } 23822 } 23823 *v = sv 23824 return nil 23825} 23826 23827func awsRestjson1_deserializeDocumentMapFilterList(v *[]types.MapFilter, value interface{}) error { 23828 if v == nil { 23829 return fmt.Errorf("unexpected nil of type %T", v) 23830 } 23831 if value == nil { 23832 return nil 23833 } 23834 23835 shape, ok := value.([]interface{}) 23836 if !ok { 23837 return fmt.Errorf("unexpected JSON type %v", value) 23838 } 23839 23840 var cv []types.MapFilter 23841 if *v == nil { 23842 cv = []types.MapFilter{} 23843 } else { 23844 cv = *v 23845 } 23846 23847 for _, value := range shape { 23848 var col types.MapFilter 23849 destAddr := &col 23850 if err := awsRestjson1_deserializeDocumentMapFilter(&destAddr, value); err != nil { 23851 return err 23852 } 23853 col = *destAddr 23854 cv = append(cv, col) 23855 23856 } 23857 *v = cv 23858 return nil 23859} 23860 23861func awsRestjson1_deserializeDocumentMember(v **types.Member, value interface{}) error { 23862 if v == nil { 23863 return fmt.Errorf("unexpected nil of type %T", v) 23864 } 23865 if value == nil { 23866 return nil 23867 } 23868 23869 shape, ok := value.(map[string]interface{}) 23870 if !ok { 23871 return fmt.Errorf("unexpected JSON type %v", value) 23872 } 23873 23874 var sv *types.Member 23875 if *v == nil { 23876 sv = &types.Member{} 23877 } else { 23878 sv = *v 23879 } 23880 23881 for key, value := range shape { 23882 switch key { 23883 case "AccountId": 23884 if value != nil { 23885 jtv, ok := value.(string) 23886 if !ok { 23887 return fmt.Errorf("expected AccountId to be of type string, got %T instead", value) 23888 } 23889 sv.AccountId = ptr.String(jtv) 23890 } 23891 23892 case "Email": 23893 if value != nil { 23894 jtv, ok := value.(string) 23895 if !ok { 23896 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 23897 } 23898 sv.Email = ptr.String(jtv) 23899 } 23900 23901 case "InvitedAt": 23902 if value != nil { 23903 jtv, ok := value.(string) 23904 if !ok { 23905 return fmt.Errorf("expected Timestamp to be of type string, got %T instead", value) 23906 } 23907 t, err := smithytime.ParseDateTime(jtv) 23908 if err != nil { 23909 return err 23910 } 23911 sv.InvitedAt = ptr.Time(t) 23912 } 23913 23914 case "MasterId": 23915 if value != nil { 23916 jtv, ok := value.(string) 23917 if !ok { 23918 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 23919 } 23920 sv.MasterId = ptr.String(jtv) 23921 } 23922 23923 case "MemberStatus": 23924 if value != nil { 23925 jtv, ok := value.(string) 23926 if !ok { 23927 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 23928 } 23929 sv.MemberStatus = ptr.String(jtv) 23930 } 23931 23932 case "UpdatedAt": 23933 if value != nil { 23934 jtv, ok := value.(string) 23935 if !ok { 23936 return fmt.Errorf("expected Timestamp to be of type string, got %T instead", value) 23937 } 23938 t, err := smithytime.ParseDateTime(jtv) 23939 if err != nil { 23940 return err 23941 } 23942 sv.UpdatedAt = ptr.Time(t) 23943 } 23944 23945 default: 23946 _, _ = key, value 23947 23948 } 23949 } 23950 *v = sv 23951 return nil 23952} 23953 23954func awsRestjson1_deserializeDocumentMemberList(v *[]types.Member, value interface{}) error { 23955 if v == nil { 23956 return fmt.Errorf("unexpected nil of type %T", v) 23957 } 23958 if value == nil { 23959 return nil 23960 } 23961 23962 shape, ok := value.([]interface{}) 23963 if !ok { 23964 return fmt.Errorf("unexpected JSON type %v", value) 23965 } 23966 23967 var cv []types.Member 23968 if *v == nil { 23969 cv = []types.Member{} 23970 } else { 23971 cv = *v 23972 } 23973 23974 for _, value := range shape { 23975 var col types.Member 23976 destAddr := &col 23977 if err := awsRestjson1_deserializeDocumentMember(&destAddr, value); err != nil { 23978 return err 23979 } 23980 col = *destAddr 23981 cv = append(cv, col) 23982 23983 } 23984 *v = cv 23985 return nil 23986} 23987 23988func awsRestjson1_deserializeDocumentNetwork(v **types.Network, value interface{}) error { 23989 if v == nil { 23990 return fmt.Errorf("unexpected nil of type %T", v) 23991 } 23992 if value == nil { 23993 return nil 23994 } 23995 23996 shape, ok := value.(map[string]interface{}) 23997 if !ok { 23998 return fmt.Errorf("unexpected JSON type %v", value) 23999 } 24000 24001 var sv *types.Network 24002 if *v == nil { 24003 sv = &types.Network{} 24004 } else { 24005 sv = *v 24006 } 24007 24008 for key, value := range shape { 24009 switch key { 24010 case "DestinationDomain": 24011 if value != nil { 24012 jtv, ok := value.(string) 24013 if !ok { 24014 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 24015 } 24016 sv.DestinationDomain = ptr.String(jtv) 24017 } 24018 24019 case "DestinationIpV4": 24020 if value != nil { 24021 jtv, ok := value.(string) 24022 if !ok { 24023 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 24024 } 24025 sv.DestinationIpV4 = ptr.String(jtv) 24026 } 24027 24028 case "DestinationIpV6": 24029 if value != nil { 24030 jtv, ok := value.(string) 24031 if !ok { 24032 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 24033 } 24034 sv.DestinationIpV6 = ptr.String(jtv) 24035 } 24036 24037 case "DestinationPort": 24038 if value != nil { 24039 jtv, ok := value.(json.Number) 24040 if !ok { 24041 return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) 24042 } 24043 i64, err := jtv.Int64() 24044 if err != nil { 24045 return err 24046 } 24047 sv.DestinationPort = int32(i64) 24048 } 24049 24050 case "Direction": 24051 if value != nil { 24052 jtv, ok := value.(string) 24053 if !ok { 24054 return fmt.Errorf("expected NetworkDirection to be of type string, got %T instead", value) 24055 } 24056 sv.Direction = types.NetworkDirection(jtv) 24057 } 24058 24059 case "OpenPortRange": 24060 if err := awsRestjson1_deserializeDocumentPortRange(&sv.OpenPortRange, value); err != nil { 24061 return err 24062 } 24063 24064 case "Protocol": 24065 if value != nil { 24066 jtv, ok := value.(string) 24067 if !ok { 24068 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 24069 } 24070 sv.Protocol = ptr.String(jtv) 24071 } 24072 24073 case "SourceDomain": 24074 if value != nil { 24075 jtv, ok := value.(string) 24076 if !ok { 24077 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 24078 } 24079 sv.SourceDomain = ptr.String(jtv) 24080 } 24081 24082 case "SourceIpV4": 24083 if value != nil { 24084 jtv, ok := value.(string) 24085 if !ok { 24086 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 24087 } 24088 sv.SourceIpV4 = ptr.String(jtv) 24089 } 24090 24091 case "SourceIpV6": 24092 if value != nil { 24093 jtv, ok := value.(string) 24094 if !ok { 24095 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 24096 } 24097 sv.SourceIpV6 = ptr.String(jtv) 24098 } 24099 24100 case "SourceMac": 24101 if value != nil { 24102 jtv, ok := value.(string) 24103 if !ok { 24104 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 24105 } 24106 sv.SourceMac = ptr.String(jtv) 24107 } 24108 24109 case "SourcePort": 24110 if value != nil { 24111 jtv, ok := value.(json.Number) 24112 if !ok { 24113 return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) 24114 } 24115 i64, err := jtv.Int64() 24116 if err != nil { 24117 return err 24118 } 24119 sv.SourcePort = int32(i64) 24120 } 24121 24122 default: 24123 _, _ = key, value 24124 24125 } 24126 } 24127 *v = sv 24128 return nil 24129} 24130 24131func awsRestjson1_deserializeDocumentNetworkHeader(v **types.NetworkHeader, value interface{}) error { 24132 if v == nil { 24133 return fmt.Errorf("unexpected nil of type %T", v) 24134 } 24135 if value == nil { 24136 return nil 24137 } 24138 24139 shape, ok := value.(map[string]interface{}) 24140 if !ok { 24141 return fmt.Errorf("unexpected JSON type %v", value) 24142 } 24143 24144 var sv *types.NetworkHeader 24145 if *v == nil { 24146 sv = &types.NetworkHeader{} 24147 } else { 24148 sv = *v 24149 } 24150 24151 for key, value := range shape { 24152 switch key { 24153 case "Destination": 24154 if err := awsRestjson1_deserializeDocumentNetworkPathComponentDetails(&sv.Destination, value); err != nil { 24155 return err 24156 } 24157 24158 case "Protocol": 24159 if value != nil { 24160 jtv, ok := value.(string) 24161 if !ok { 24162 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 24163 } 24164 sv.Protocol = ptr.String(jtv) 24165 } 24166 24167 case "Source": 24168 if err := awsRestjson1_deserializeDocumentNetworkPathComponentDetails(&sv.Source, value); err != nil { 24169 return err 24170 } 24171 24172 default: 24173 _, _ = key, value 24174 24175 } 24176 } 24177 *v = sv 24178 return nil 24179} 24180 24181func awsRestjson1_deserializeDocumentNetworkPathComponent(v **types.NetworkPathComponent, value interface{}) error { 24182 if v == nil { 24183 return fmt.Errorf("unexpected nil of type %T", v) 24184 } 24185 if value == nil { 24186 return nil 24187 } 24188 24189 shape, ok := value.(map[string]interface{}) 24190 if !ok { 24191 return fmt.Errorf("unexpected JSON type %v", value) 24192 } 24193 24194 var sv *types.NetworkPathComponent 24195 if *v == nil { 24196 sv = &types.NetworkPathComponent{} 24197 } else { 24198 sv = *v 24199 } 24200 24201 for key, value := range shape { 24202 switch key { 24203 case "ComponentId": 24204 if value != nil { 24205 jtv, ok := value.(string) 24206 if !ok { 24207 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 24208 } 24209 sv.ComponentId = ptr.String(jtv) 24210 } 24211 24212 case "ComponentType": 24213 if value != nil { 24214 jtv, ok := value.(string) 24215 if !ok { 24216 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 24217 } 24218 sv.ComponentType = ptr.String(jtv) 24219 } 24220 24221 case "Egress": 24222 if err := awsRestjson1_deserializeDocumentNetworkHeader(&sv.Egress, value); err != nil { 24223 return err 24224 } 24225 24226 case "Ingress": 24227 if err := awsRestjson1_deserializeDocumentNetworkHeader(&sv.Ingress, value); err != nil { 24228 return err 24229 } 24230 24231 default: 24232 _, _ = key, value 24233 24234 } 24235 } 24236 *v = sv 24237 return nil 24238} 24239 24240func awsRestjson1_deserializeDocumentNetworkPathComponentDetails(v **types.NetworkPathComponentDetails, value interface{}) error { 24241 if v == nil { 24242 return fmt.Errorf("unexpected nil of type %T", v) 24243 } 24244 if value == nil { 24245 return nil 24246 } 24247 24248 shape, ok := value.(map[string]interface{}) 24249 if !ok { 24250 return fmt.Errorf("unexpected JSON type %v", value) 24251 } 24252 24253 var sv *types.NetworkPathComponentDetails 24254 if *v == nil { 24255 sv = &types.NetworkPathComponentDetails{} 24256 } else { 24257 sv = *v 24258 } 24259 24260 for key, value := range shape { 24261 switch key { 24262 case "Address": 24263 if err := awsRestjson1_deserializeDocumentStringList(&sv.Address, value); err != nil { 24264 return err 24265 } 24266 24267 case "PortRanges": 24268 if err := awsRestjson1_deserializeDocumentPortRangeList(&sv.PortRanges, value); err != nil { 24269 return err 24270 } 24271 24272 default: 24273 _, _ = key, value 24274 24275 } 24276 } 24277 *v = sv 24278 return nil 24279} 24280 24281func awsRestjson1_deserializeDocumentNetworkPathList(v *[]types.NetworkPathComponent, value interface{}) error { 24282 if v == nil { 24283 return fmt.Errorf("unexpected nil of type %T", v) 24284 } 24285 if value == nil { 24286 return nil 24287 } 24288 24289 shape, ok := value.([]interface{}) 24290 if !ok { 24291 return fmt.Errorf("unexpected JSON type %v", value) 24292 } 24293 24294 var cv []types.NetworkPathComponent 24295 if *v == nil { 24296 cv = []types.NetworkPathComponent{} 24297 } else { 24298 cv = *v 24299 } 24300 24301 for _, value := range shape { 24302 var col types.NetworkPathComponent 24303 destAddr := &col 24304 if err := awsRestjson1_deserializeDocumentNetworkPathComponent(&destAddr, value); err != nil { 24305 return err 24306 } 24307 col = *destAddr 24308 cv = append(cv, col) 24309 24310 } 24311 *v = cv 24312 return nil 24313} 24314 24315func awsRestjson1_deserializeDocumentNonEmptyStringList(v *[]string, value interface{}) error { 24316 if v == nil { 24317 return fmt.Errorf("unexpected nil of type %T", v) 24318 } 24319 if value == nil { 24320 return nil 24321 } 24322 24323 shape, ok := value.([]interface{}) 24324 if !ok { 24325 return fmt.Errorf("unexpected JSON type %v", value) 24326 } 24327 24328 var cv []string 24329 if *v == nil { 24330 cv = []string{} 24331 } else { 24332 cv = *v 24333 } 24334 24335 for _, value := range shape { 24336 var col string 24337 if value != nil { 24338 jtv, ok := value.(string) 24339 if !ok { 24340 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 24341 } 24342 col = jtv 24343 } 24344 cv = append(cv, col) 24345 24346 } 24347 *v = cv 24348 return nil 24349} 24350 24351func awsRestjson1_deserializeDocumentNote(v **types.Note, value interface{}) error { 24352 if v == nil { 24353 return fmt.Errorf("unexpected nil of type %T", v) 24354 } 24355 if value == nil { 24356 return nil 24357 } 24358 24359 shape, ok := value.(map[string]interface{}) 24360 if !ok { 24361 return fmt.Errorf("unexpected JSON type %v", value) 24362 } 24363 24364 var sv *types.Note 24365 if *v == nil { 24366 sv = &types.Note{} 24367 } else { 24368 sv = *v 24369 } 24370 24371 for key, value := range shape { 24372 switch key { 24373 case "Text": 24374 if value != nil { 24375 jtv, ok := value.(string) 24376 if !ok { 24377 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 24378 } 24379 sv.Text = ptr.String(jtv) 24380 } 24381 24382 case "UpdatedAt": 24383 if value != nil { 24384 jtv, ok := value.(string) 24385 if !ok { 24386 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 24387 } 24388 sv.UpdatedAt = ptr.String(jtv) 24389 } 24390 24391 case "UpdatedBy": 24392 if value != nil { 24393 jtv, ok := value.(string) 24394 if !ok { 24395 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 24396 } 24397 sv.UpdatedBy = ptr.String(jtv) 24398 } 24399 24400 default: 24401 _, _ = key, value 24402 24403 } 24404 } 24405 *v = sv 24406 return nil 24407} 24408 24409func awsRestjson1_deserializeDocumentNumberFilter(v **types.NumberFilter, value interface{}) error { 24410 if v == nil { 24411 return fmt.Errorf("unexpected nil of type %T", v) 24412 } 24413 if value == nil { 24414 return nil 24415 } 24416 24417 shape, ok := value.(map[string]interface{}) 24418 if !ok { 24419 return fmt.Errorf("unexpected JSON type %v", value) 24420 } 24421 24422 var sv *types.NumberFilter 24423 if *v == nil { 24424 sv = &types.NumberFilter{} 24425 } else { 24426 sv = *v 24427 } 24428 24429 for key, value := range shape { 24430 switch key { 24431 case "Eq": 24432 if value != nil { 24433 jtv, ok := value.(json.Number) 24434 if !ok { 24435 return fmt.Errorf("expected Double to be json.Number, got %T instead", value) 24436 } 24437 f64, err := jtv.Float64() 24438 if err != nil { 24439 return err 24440 } 24441 sv.Eq = f64 24442 } 24443 24444 case "Gte": 24445 if value != nil { 24446 jtv, ok := value.(json.Number) 24447 if !ok { 24448 return fmt.Errorf("expected Double to be json.Number, got %T instead", value) 24449 } 24450 f64, err := jtv.Float64() 24451 if err != nil { 24452 return err 24453 } 24454 sv.Gte = f64 24455 } 24456 24457 case "Lte": 24458 if value != nil { 24459 jtv, ok := value.(json.Number) 24460 if !ok { 24461 return fmt.Errorf("expected Double to be json.Number, got %T instead", value) 24462 } 24463 f64, err := jtv.Float64() 24464 if err != nil { 24465 return err 24466 } 24467 sv.Lte = f64 24468 } 24469 24470 default: 24471 _, _ = key, value 24472 24473 } 24474 } 24475 *v = sv 24476 return nil 24477} 24478 24479func awsRestjson1_deserializeDocumentNumberFilterList(v *[]types.NumberFilter, value interface{}) error { 24480 if v == nil { 24481 return fmt.Errorf("unexpected nil of type %T", v) 24482 } 24483 if value == nil { 24484 return nil 24485 } 24486 24487 shape, ok := value.([]interface{}) 24488 if !ok { 24489 return fmt.Errorf("unexpected JSON type %v", value) 24490 } 24491 24492 var cv []types.NumberFilter 24493 if *v == nil { 24494 cv = []types.NumberFilter{} 24495 } else { 24496 cv = *v 24497 } 24498 24499 for _, value := range shape { 24500 var col types.NumberFilter 24501 destAddr := &col 24502 if err := awsRestjson1_deserializeDocumentNumberFilter(&destAddr, value); err != nil { 24503 return err 24504 } 24505 col = *destAddr 24506 cv = append(cv, col) 24507 24508 } 24509 *v = cv 24510 return nil 24511} 24512 24513func awsRestjson1_deserializeDocumentPatchSummary(v **types.PatchSummary, value interface{}) error { 24514 if v == nil { 24515 return fmt.Errorf("unexpected nil of type %T", v) 24516 } 24517 if value == nil { 24518 return nil 24519 } 24520 24521 shape, ok := value.(map[string]interface{}) 24522 if !ok { 24523 return fmt.Errorf("unexpected JSON type %v", value) 24524 } 24525 24526 var sv *types.PatchSummary 24527 if *v == nil { 24528 sv = &types.PatchSummary{} 24529 } else { 24530 sv = *v 24531 } 24532 24533 for key, value := range shape { 24534 switch key { 24535 case "FailedCount": 24536 if value != nil { 24537 jtv, ok := value.(json.Number) 24538 if !ok { 24539 return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) 24540 } 24541 i64, err := jtv.Int64() 24542 if err != nil { 24543 return err 24544 } 24545 sv.FailedCount = int32(i64) 24546 } 24547 24548 case "Id": 24549 if value != nil { 24550 jtv, ok := value.(string) 24551 if !ok { 24552 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 24553 } 24554 sv.Id = ptr.String(jtv) 24555 } 24556 24557 case "InstalledCount": 24558 if value != nil { 24559 jtv, ok := value.(json.Number) 24560 if !ok { 24561 return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) 24562 } 24563 i64, err := jtv.Int64() 24564 if err != nil { 24565 return err 24566 } 24567 sv.InstalledCount = int32(i64) 24568 } 24569 24570 case "InstalledOtherCount": 24571 if value != nil { 24572 jtv, ok := value.(json.Number) 24573 if !ok { 24574 return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) 24575 } 24576 i64, err := jtv.Int64() 24577 if err != nil { 24578 return err 24579 } 24580 sv.InstalledOtherCount = int32(i64) 24581 } 24582 24583 case "InstalledPendingReboot": 24584 if value != nil { 24585 jtv, ok := value.(json.Number) 24586 if !ok { 24587 return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) 24588 } 24589 i64, err := jtv.Int64() 24590 if err != nil { 24591 return err 24592 } 24593 sv.InstalledPendingReboot = int32(i64) 24594 } 24595 24596 case "InstalledRejectedCount": 24597 if value != nil { 24598 jtv, ok := value.(json.Number) 24599 if !ok { 24600 return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) 24601 } 24602 i64, err := jtv.Int64() 24603 if err != nil { 24604 return err 24605 } 24606 sv.InstalledRejectedCount = int32(i64) 24607 } 24608 24609 case "MissingCount": 24610 if value != nil { 24611 jtv, ok := value.(json.Number) 24612 if !ok { 24613 return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) 24614 } 24615 i64, err := jtv.Int64() 24616 if err != nil { 24617 return err 24618 } 24619 sv.MissingCount = int32(i64) 24620 } 24621 24622 case "Operation": 24623 if value != nil { 24624 jtv, ok := value.(string) 24625 if !ok { 24626 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 24627 } 24628 sv.Operation = ptr.String(jtv) 24629 } 24630 24631 case "OperationEndTime": 24632 if value != nil { 24633 jtv, ok := value.(string) 24634 if !ok { 24635 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 24636 } 24637 sv.OperationEndTime = ptr.String(jtv) 24638 } 24639 24640 case "OperationStartTime": 24641 if value != nil { 24642 jtv, ok := value.(string) 24643 if !ok { 24644 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 24645 } 24646 sv.OperationStartTime = ptr.String(jtv) 24647 } 24648 24649 case "RebootOption": 24650 if value != nil { 24651 jtv, ok := value.(string) 24652 if !ok { 24653 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 24654 } 24655 sv.RebootOption = ptr.String(jtv) 24656 } 24657 24658 default: 24659 _, _ = key, value 24660 24661 } 24662 } 24663 *v = sv 24664 return nil 24665} 24666 24667func awsRestjson1_deserializeDocumentPortRange(v **types.PortRange, value interface{}) error { 24668 if v == nil { 24669 return fmt.Errorf("unexpected nil of type %T", v) 24670 } 24671 if value == nil { 24672 return nil 24673 } 24674 24675 shape, ok := value.(map[string]interface{}) 24676 if !ok { 24677 return fmt.Errorf("unexpected JSON type %v", value) 24678 } 24679 24680 var sv *types.PortRange 24681 if *v == nil { 24682 sv = &types.PortRange{} 24683 } else { 24684 sv = *v 24685 } 24686 24687 for key, value := range shape { 24688 switch key { 24689 case "Begin": 24690 if value != nil { 24691 jtv, ok := value.(json.Number) 24692 if !ok { 24693 return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) 24694 } 24695 i64, err := jtv.Int64() 24696 if err != nil { 24697 return err 24698 } 24699 sv.Begin = int32(i64) 24700 } 24701 24702 case "End": 24703 if value != nil { 24704 jtv, ok := value.(json.Number) 24705 if !ok { 24706 return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) 24707 } 24708 i64, err := jtv.Int64() 24709 if err != nil { 24710 return err 24711 } 24712 sv.End = int32(i64) 24713 } 24714 24715 default: 24716 _, _ = key, value 24717 24718 } 24719 } 24720 *v = sv 24721 return nil 24722} 24723 24724func awsRestjson1_deserializeDocumentPortRangeList(v *[]types.PortRange, value interface{}) error { 24725 if v == nil { 24726 return fmt.Errorf("unexpected nil of type %T", v) 24727 } 24728 if value == nil { 24729 return nil 24730 } 24731 24732 shape, ok := value.([]interface{}) 24733 if !ok { 24734 return fmt.Errorf("unexpected JSON type %v", value) 24735 } 24736 24737 var cv []types.PortRange 24738 if *v == nil { 24739 cv = []types.PortRange{} 24740 } else { 24741 cv = *v 24742 } 24743 24744 for _, value := range shape { 24745 var col types.PortRange 24746 destAddr := &col 24747 if err := awsRestjson1_deserializeDocumentPortRange(&destAddr, value); err != nil { 24748 return err 24749 } 24750 col = *destAddr 24751 cv = append(cv, col) 24752 24753 } 24754 *v = cv 24755 return nil 24756} 24757 24758func awsRestjson1_deserializeDocumentProcessDetails(v **types.ProcessDetails, value interface{}) error { 24759 if v == nil { 24760 return fmt.Errorf("unexpected nil of type %T", v) 24761 } 24762 if value == nil { 24763 return nil 24764 } 24765 24766 shape, ok := value.(map[string]interface{}) 24767 if !ok { 24768 return fmt.Errorf("unexpected JSON type %v", value) 24769 } 24770 24771 var sv *types.ProcessDetails 24772 if *v == nil { 24773 sv = &types.ProcessDetails{} 24774 } else { 24775 sv = *v 24776 } 24777 24778 for key, value := range shape { 24779 switch key { 24780 case "LaunchedAt": 24781 if value != nil { 24782 jtv, ok := value.(string) 24783 if !ok { 24784 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 24785 } 24786 sv.LaunchedAt = ptr.String(jtv) 24787 } 24788 24789 case "Name": 24790 if value != nil { 24791 jtv, ok := value.(string) 24792 if !ok { 24793 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 24794 } 24795 sv.Name = ptr.String(jtv) 24796 } 24797 24798 case "ParentPid": 24799 if value != nil { 24800 jtv, ok := value.(json.Number) 24801 if !ok { 24802 return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) 24803 } 24804 i64, err := jtv.Int64() 24805 if err != nil { 24806 return err 24807 } 24808 sv.ParentPid = int32(i64) 24809 } 24810 24811 case "Path": 24812 if value != nil { 24813 jtv, ok := value.(string) 24814 if !ok { 24815 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 24816 } 24817 sv.Path = ptr.String(jtv) 24818 } 24819 24820 case "Pid": 24821 if value != nil { 24822 jtv, ok := value.(json.Number) 24823 if !ok { 24824 return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) 24825 } 24826 i64, err := jtv.Int64() 24827 if err != nil { 24828 return err 24829 } 24830 sv.Pid = int32(i64) 24831 } 24832 24833 case "TerminatedAt": 24834 if value != nil { 24835 jtv, ok := value.(string) 24836 if !ok { 24837 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 24838 } 24839 sv.TerminatedAt = ptr.String(jtv) 24840 } 24841 24842 default: 24843 _, _ = key, value 24844 24845 } 24846 } 24847 *v = sv 24848 return nil 24849} 24850 24851func awsRestjson1_deserializeDocumentProduct(v **types.Product, value interface{}) error { 24852 if v == nil { 24853 return fmt.Errorf("unexpected nil of type %T", v) 24854 } 24855 if value == nil { 24856 return nil 24857 } 24858 24859 shape, ok := value.(map[string]interface{}) 24860 if !ok { 24861 return fmt.Errorf("unexpected JSON type %v", value) 24862 } 24863 24864 var sv *types.Product 24865 if *v == nil { 24866 sv = &types.Product{} 24867 } else { 24868 sv = *v 24869 } 24870 24871 for key, value := range shape { 24872 switch key { 24873 case "ActivationUrl": 24874 if value != nil { 24875 jtv, ok := value.(string) 24876 if !ok { 24877 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 24878 } 24879 sv.ActivationUrl = ptr.String(jtv) 24880 } 24881 24882 case "Categories": 24883 if err := awsRestjson1_deserializeDocumentCategoryList(&sv.Categories, value); err != nil { 24884 return err 24885 } 24886 24887 case "CompanyName": 24888 if value != nil { 24889 jtv, ok := value.(string) 24890 if !ok { 24891 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 24892 } 24893 sv.CompanyName = ptr.String(jtv) 24894 } 24895 24896 case "Description": 24897 if value != nil { 24898 jtv, ok := value.(string) 24899 if !ok { 24900 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 24901 } 24902 sv.Description = ptr.String(jtv) 24903 } 24904 24905 case "IntegrationTypes": 24906 if err := awsRestjson1_deserializeDocumentIntegrationTypeList(&sv.IntegrationTypes, value); err != nil { 24907 return err 24908 } 24909 24910 case "MarketplaceUrl": 24911 if value != nil { 24912 jtv, ok := value.(string) 24913 if !ok { 24914 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 24915 } 24916 sv.MarketplaceUrl = ptr.String(jtv) 24917 } 24918 24919 case "ProductArn": 24920 if value != nil { 24921 jtv, ok := value.(string) 24922 if !ok { 24923 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 24924 } 24925 sv.ProductArn = ptr.String(jtv) 24926 } 24927 24928 case "ProductName": 24929 if value != nil { 24930 jtv, ok := value.(string) 24931 if !ok { 24932 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 24933 } 24934 sv.ProductName = ptr.String(jtv) 24935 } 24936 24937 case "ProductSubscriptionResourcePolicy": 24938 if value != nil { 24939 jtv, ok := value.(string) 24940 if !ok { 24941 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 24942 } 24943 sv.ProductSubscriptionResourcePolicy = ptr.String(jtv) 24944 } 24945 24946 default: 24947 _, _ = key, value 24948 24949 } 24950 } 24951 *v = sv 24952 return nil 24953} 24954 24955func awsRestjson1_deserializeDocumentProductsList(v *[]types.Product, value interface{}) error { 24956 if v == nil { 24957 return fmt.Errorf("unexpected nil of type %T", v) 24958 } 24959 if value == nil { 24960 return nil 24961 } 24962 24963 shape, ok := value.([]interface{}) 24964 if !ok { 24965 return fmt.Errorf("unexpected JSON type %v", value) 24966 } 24967 24968 var cv []types.Product 24969 if *v == nil { 24970 cv = []types.Product{} 24971 } else { 24972 cv = *v 24973 } 24974 24975 for _, value := range shape { 24976 var col types.Product 24977 destAddr := &col 24978 if err := awsRestjson1_deserializeDocumentProduct(&destAddr, value); err != nil { 24979 return err 24980 } 24981 col = *destAddr 24982 cv = append(cv, col) 24983 24984 } 24985 *v = cv 24986 return nil 24987} 24988 24989func awsRestjson1_deserializeDocumentProductSubscriptionArnList(v *[]string, value interface{}) error { 24990 if v == nil { 24991 return fmt.Errorf("unexpected nil of type %T", v) 24992 } 24993 if value == nil { 24994 return nil 24995 } 24996 24997 shape, ok := value.([]interface{}) 24998 if !ok { 24999 return fmt.Errorf("unexpected JSON type %v", value) 25000 } 25001 25002 var cv []string 25003 if *v == nil { 25004 cv = []string{} 25005 } else { 25006 cv = *v 25007 } 25008 25009 for _, value := range shape { 25010 var col string 25011 if value != nil { 25012 jtv, ok := value.(string) 25013 if !ok { 25014 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 25015 } 25016 col = jtv 25017 } 25018 cv = append(cv, col) 25019 25020 } 25021 *v = cv 25022 return nil 25023} 25024 25025func awsRestjson1_deserializeDocumentRecommendation(v **types.Recommendation, value interface{}) error { 25026 if v == nil { 25027 return fmt.Errorf("unexpected nil of type %T", v) 25028 } 25029 if value == nil { 25030 return nil 25031 } 25032 25033 shape, ok := value.(map[string]interface{}) 25034 if !ok { 25035 return fmt.Errorf("unexpected JSON type %v", value) 25036 } 25037 25038 var sv *types.Recommendation 25039 if *v == nil { 25040 sv = &types.Recommendation{} 25041 } else { 25042 sv = *v 25043 } 25044 25045 for key, value := range shape { 25046 switch key { 25047 case "Text": 25048 if value != nil { 25049 jtv, ok := value.(string) 25050 if !ok { 25051 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 25052 } 25053 sv.Text = ptr.String(jtv) 25054 } 25055 25056 case "Url": 25057 if value != nil { 25058 jtv, ok := value.(string) 25059 if !ok { 25060 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 25061 } 25062 sv.Url = ptr.String(jtv) 25063 } 25064 25065 default: 25066 _, _ = key, value 25067 25068 } 25069 } 25070 *v = sv 25071 return nil 25072} 25073 25074func awsRestjson1_deserializeDocumentRelatedFinding(v **types.RelatedFinding, value interface{}) error { 25075 if v == nil { 25076 return fmt.Errorf("unexpected nil of type %T", v) 25077 } 25078 if value == nil { 25079 return nil 25080 } 25081 25082 shape, ok := value.(map[string]interface{}) 25083 if !ok { 25084 return fmt.Errorf("unexpected JSON type %v", value) 25085 } 25086 25087 var sv *types.RelatedFinding 25088 if *v == nil { 25089 sv = &types.RelatedFinding{} 25090 } else { 25091 sv = *v 25092 } 25093 25094 for key, value := range shape { 25095 switch key { 25096 case "Id": 25097 if value != nil { 25098 jtv, ok := value.(string) 25099 if !ok { 25100 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 25101 } 25102 sv.Id = ptr.String(jtv) 25103 } 25104 25105 case "ProductArn": 25106 if value != nil { 25107 jtv, ok := value.(string) 25108 if !ok { 25109 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 25110 } 25111 sv.ProductArn = ptr.String(jtv) 25112 } 25113 25114 default: 25115 _, _ = key, value 25116 25117 } 25118 } 25119 *v = sv 25120 return nil 25121} 25122 25123func awsRestjson1_deserializeDocumentRelatedFindingList(v *[]types.RelatedFinding, value interface{}) error { 25124 if v == nil { 25125 return fmt.Errorf("unexpected nil of type %T", v) 25126 } 25127 if value == nil { 25128 return nil 25129 } 25130 25131 shape, ok := value.([]interface{}) 25132 if !ok { 25133 return fmt.Errorf("unexpected JSON type %v", value) 25134 } 25135 25136 var cv []types.RelatedFinding 25137 if *v == nil { 25138 cv = []types.RelatedFinding{} 25139 } else { 25140 cv = *v 25141 } 25142 25143 for _, value := range shape { 25144 var col types.RelatedFinding 25145 destAddr := &col 25146 if err := awsRestjson1_deserializeDocumentRelatedFinding(&destAddr, value); err != nil { 25147 return err 25148 } 25149 col = *destAddr 25150 cv = append(cv, col) 25151 25152 } 25153 *v = cv 25154 return nil 25155} 25156 25157func awsRestjson1_deserializeDocumentRelatedRequirementsList(v *[]string, value interface{}) error { 25158 if v == nil { 25159 return fmt.Errorf("unexpected nil of type %T", v) 25160 } 25161 if value == nil { 25162 return nil 25163 } 25164 25165 shape, ok := value.([]interface{}) 25166 if !ok { 25167 return fmt.Errorf("unexpected JSON type %v", value) 25168 } 25169 25170 var cv []string 25171 if *v == nil { 25172 cv = []string{} 25173 } else { 25174 cv = *v 25175 } 25176 25177 for _, value := range shape { 25178 var col string 25179 if value != nil { 25180 jtv, ok := value.(string) 25181 if !ok { 25182 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 25183 } 25184 col = jtv 25185 } 25186 cv = append(cv, col) 25187 25188 } 25189 *v = cv 25190 return nil 25191} 25192 25193func awsRestjson1_deserializeDocumentRemediation(v **types.Remediation, value interface{}) error { 25194 if v == nil { 25195 return fmt.Errorf("unexpected nil of type %T", v) 25196 } 25197 if value == nil { 25198 return nil 25199 } 25200 25201 shape, ok := value.(map[string]interface{}) 25202 if !ok { 25203 return fmt.Errorf("unexpected JSON type %v", value) 25204 } 25205 25206 var sv *types.Remediation 25207 if *v == nil { 25208 sv = &types.Remediation{} 25209 } else { 25210 sv = *v 25211 } 25212 25213 for key, value := range shape { 25214 switch key { 25215 case "Recommendation": 25216 if err := awsRestjson1_deserializeDocumentRecommendation(&sv.Recommendation, value); err != nil { 25217 return err 25218 } 25219 25220 default: 25221 _, _ = key, value 25222 25223 } 25224 } 25225 *v = sv 25226 return nil 25227} 25228 25229func awsRestjson1_deserializeDocumentResource(v **types.Resource, value interface{}) error { 25230 if v == nil { 25231 return fmt.Errorf("unexpected nil of type %T", v) 25232 } 25233 if value == nil { 25234 return nil 25235 } 25236 25237 shape, ok := value.(map[string]interface{}) 25238 if !ok { 25239 return fmt.Errorf("unexpected JSON type %v", value) 25240 } 25241 25242 var sv *types.Resource 25243 if *v == nil { 25244 sv = &types.Resource{} 25245 } else { 25246 sv = *v 25247 } 25248 25249 for key, value := range shape { 25250 switch key { 25251 case "Details": 25252 if err := awsRestjson1_deserializeDocumentResourceDetails(&sv.Details, value); err != nil { 25253 return err 25254 } 25255 25256 case "Id": 25257 if value != nil { 25258 jtv, ok := value.(string) 25259 if !ok { 25260 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 25261 } 25262 sv.Id = ptr.String(jtv) 25263 } 25264 25265 case "Partition": 25266 if value != nil { 25267 jtv, ok := value.(string) 25268 if !ok { 25269 return fmt.Errorf("expected Partition to be of type string, got %T instead", value) 25270 } 25271 sv.Partition = types.Partition(jtv) 25272 } 25273 25274 case "Region": 25275 if value != nil { 25276 jtv, ok := value.(string) 25277 if !ok { 25278 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 25279 } 25280 sv.Region = ptr.String(jtv) 25281 } 25282 25283 case "ResourceRole": 25284 if value != nil { 25285 jtv, ok := value.(string) 25286 if !ok { 25287 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 25288 } 25289 sv.ResourceRole = ptr.String(jtv) 25290 } 25291 25292 case "Tags": 25293 if err := awsRestjson1_deserializeDocumentFieldMap(&sv.Tags, value); err != nil { 25294 return err 25295 } 25296 25297 case "Type": 25298 if value != nil { 25299 jtv, ok := value.(string) 25300 if !ok { 25301 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 25302 } 25303 sv.Type = ptr.String(jtv) 25304 } 25305 25306 default: 25307 _, _ = key, value 25308 25309 } 25310 } 25311 *v = sv 25312 return nil 25313} 25314 25315func awsRestjson1_deserializeDocumentResourceConflictException(v **types.ResourceConflictException, value interface{}) error { 25316 if v == nil { 25317 return fmt.Errorf("unexpected nil of type %T", v) 25318 } 25319 if value == nil { 25320 return nil 25321 } 25322 25323 shape, ok := value.(map[string]interface{}) 25324 if !ok { 25325 return fmt.Errorf("unexpected JSON type %v", value) 25326 } 25327 25328 var sv *types.ResourceConflictException 25329 if *v == nil { 25330 sv = &types.ResourceConflictException{} 25331 } else { 25332 sv = *v 25333 } 25334 25335 for key, value := range shape { 25336 switch key { 25337 case "Code": 25338 if value != nil { 25339 jtv, ok := value.(string) 25340 if !ok { 25341 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 25342 } 25343 sv.Code = ptr.String(jtv) 25344 } 25345 25346 case "Message": 25347 if value != nil { 25348 jtv, ok := value.(string) 25349 if !ok { 25350 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 25351 } 25352 sv.Message = ptr.String(jtv) 25353 } 25354 25355 default: 25356 _, _ = key, value 25357 25358 } 25359 } 25360 *v = sv 25361 return nil 25362} 25363 25364func awsRestjson1_deserializeDocumentResourceDetails(v **types.ResourceDetails, value interface{}) error { 25365 if v == nil { 25366 return fmt.Errorf("unexpected nil of type %T", v) 25367 } 25368 if value == nil { 25369 return nil 25370 } 25371 25372 shape, ok := value.(map[string]interface{}) 25373 if !ok { 25374 return fmt.Errorf("unexpected JSON type %v", value) 25375 } 25376 25377 var sv *types.ResourceDetails 25378 if *v == nil { 25379 sv = &types.ResourceDetails{} 25380 } else { 25381 sv = *v 25382 } 25383 25384 for key, value := range shape { 25385 switch key { 25386 case "AwsApiGatewayRestApi": 25387 if err := awsRestjson1_deserializeDocumentAwsApiGatewayRestApiDetails(&sv.AwsApiGatewayRestApi, value); err != nil { 25388 return err 25389 } 25390 25391 case "AwsApiGatewayStage": 25392 if err := awsRestjson1_deserializeDocumentAwsApiGatewayStageDetails(&sv.AwsApiGatewayStage, value); err != nil { 25393 return err 25394 } 25395 25396 case "AwsApiGatewayV2Api": 25397 if err := awsRestjson1_deserializeDocumentAwsApiGatewayV2ApiDetails(&sv.AwsApiGatewayV2Api, value); err != nil { 25398 return err 25399 } 25400 25401 case "AwsApiGatewayV2Stage": 25402 if err := awsRestjson1_deserializeDocumentAwsApiGatewayV2StageDetails(&sv.AwsApiGatewayV2Stage, value); err != nil { 25403 return err 25404 } 25405 25406 case "AwsAutoScalingAutoScalingGroup": 25407 if err := awsRestjson1_deserializeDocumentAwsAutoScalingAutoScalingGroupDetails(&sv.AwsAutoScalingAutoScalingGroup, value); err != nil { 25408 return err 25409 } 25410 25411 case "AwsCertificateManagerCertificate": 25412 if err := awsRestjson1_deserializeDocumentAwsCertificateManagerCertificateDetails(&sv.AwsCertificateManagerCertificate, value); err != nil { 25413 return err 25414 } 25415 25416 case "AwsCloudFrontDistribution": 25417 if err := awsRestjson1_deserializeDocumentAwsCloudFrontDistributionDetails(&sv.AwsCloudFrontDistribution, value); err != nil { 25418 return err 25419 } 25420 25421 case "AwsCloudTrailTrail": 25422 if err := awsRestjson1_deserializeDocumentAwsCloudTrailTrailDetails(&sv.AwsCloudTrailTrail, value); err != nil { 25423 return err 25424 } 25425 25426 case "AwsCodeBuildProject": 25427 if err := awsRestjson1_deserializeDocumentAwsCodeBuildProjectDetails(&sv.AwsCodeBuildProject, value); err != nil { 25428 return err 25429 } 25430 25431 case "AwsDynamoDbTable": 25432 if err := awsRestjson1_deserializeDocumentAwsDynamoDbTableDetails(&sv.AwsDynamoDbTable, value); err != nil { 25433 return err 25434 } 25435 25436 case "AwsEc2Eip": 25437 if err := awsRestjson1_deserializeDocumentAwsEc2EipDetails(&sv.AwsEc2Eip, value); err != nil { 25438 return err 25439 } 25440 25441 case "AwsEc2Instance": 25442 if err := awsRestjson1_deserializeDocumentAwsEc2InstanceDetails(&sv.AwsEc2Instance, value); err != nil { 25443 return err 25444 } 25445 25446 case "AwsEc2NetworkInterface": 25447 if err := awsRestjson1_deserializeDocumentAwsEc2NetworkInterfaceDetails(&sv.AwsEc2NetworkInterface, value); err != nil { 25448 return err 25449 } 25450 25451 case "AwsEc2SecurityGroup": 25452 if err := awsRestjson1_deserializeDocumentAwsEc2SecurityGroupDetails(&sv.AwsEc2SecurityGroup, value); err != nil { 25453 return err 25454 } 25455 25456 case "AwsEc2Volume": 25457 if err := awsRestjson1_deserializeDocumentAwsEc2VolumeDetails(&sv.AwsEc2Volume, value); err != nil { 25458 return err 25459 } 25460 25461 case "AwsEc2Vpc": 25462 if err := awsRestjson1_deserializeDocumentAwsEc2VpcDetails(&sv.AwsEc2Vpc, value); err != nil { 25463 return err 25464 } 25465 25466 case "AwsElasticsearchDomain": 25467 if err := awsRestjson1_deserializeDocumentAwsElasticsearchDomainDetails(&sv.AwsElasticsearchDomain, value); err != nil { 25468 return err 25469 } 25470 25471 case "AwsElbLoadBalancer": 25472 if err := awsRestjson1_deserializeDocumentAwsElbLoadBalancerDetails(&sv.AwsElbLoadBalancer, value); err != nil { 25473 return err 25474 } 25475 25476 case "AwsElbv2LoadBalancer": 25477 if err := awsRestjson1_deserializeDocumentAwsElbv2LoadBalancerDetails(&sv.AwsElbv2LoadBalancer, value); err != nil { 25478 return err 25479 } 25480 25481 case "AwsIamAccessKey": 25482 if err := awsRestjson1_deserializeDocumentAwsIamAccessKeyDetails(&sv.AwsIamAccessKey, value); err != nil { 25483 return err 25484 } 25485 25486 case "AwsIamGroup": 25487 if err := awsRestjson1_deserializeDocumentAwsIamGroupDetails(&sv.AwsIamGroup, value); err != nil { 25488 return err 25489 } 25490 25491 case "AwsIamPolicy": 25492 if err := awsRestjson1_deserializeDocumentAwsIamPolicyDetails(&sv.AwsIamPolicy, value); err != nil { 25493 return err 25494 } 25495 25496 case "AwsIamRole": 25497 if err := awsRestjson1_deserializeDocumentAwsIamRoleDetails(&sv.AwsIamRole, value); err != nil { 25498 return err 25499 } 25500 25501 case "AwsIamUser": 25502 if err := awsRestjson1_deserializeDocumentAwsIamUserDetails(&sv.AwsIamUser, value); err != nil { 25503 return err 25504 } 25505 25506 case "AwsKmsKey": 25507 if err := awsRestjson1_deserializeDocumentAwsKmsKeyDetails(&sv.AwsKmsKey, value); err != nil { 25508 return err 25509 } 25510 25511 case "AwsLambdaFunction": 25512 if err := awsRestjson1_deserializeDocumentAwsLambdaFunctionDetails(&sv.AwsLambdaFunction, value); err != nil { 25513 return err 25514 } 25515 25516 case "AwsLambdaLayerVersion": 25517 if err := awsRestjson1_deserializeDocumentAwsLambdaLayerVersionDetails(&sv.AwsLambdaLayerVersion, value); err != nil { 25518 return err 25519 } 25520 25521 case "AwsRdsDbCluster": 25522 if err := awsRestjson1_deserializeDocumentAwsRdsDbClusterDetails(&sv.AwsRdsDbCluster, value); err != nil { 25523 return err 25524 } 25525 25526 case "AwsRdsDbClusterSnapshot": 25527 if err := awsRestjson1_deserializeDocumentAwsRdsDbClusterSnapshotDetails(&sv.AwsRdsDbClusterSnapshot, value); err != nil { 25528 return err 25529 } 25530 25531 case "AwsRdsDbInstance": 25532 if err := awsRestjson1_deserializeDocumentAwsRdsDbInstanceDetails(&sv.AwsRdsDbInstance, value); err != nil { 25533 return err 25534 } 25535 25536 case "AwsRdsDbSnapshot": 25537 if err := awsRestjson1_deserializeDocumentAwsRdsDbSnapshotDetails(&sv.AwsRdsDbSnapshot, value); err != nil { 25538 return err 25539 } 25540 25541 case "AwsRedshiftCluster": 25542 if err := awsRestjson1_deserializeDocumentAwsRedshiftClusterDetails(&sv.AwsRedshiftCluster, value); err != nil { 25543 return err 25544 } 25545 25546 case "AwsS3Bucket": 25547 if err := awsRestjson1_deserializeDocumentAwsS3BucketDetails(&sv.AwsS3Bucket, value); err != nil { 25548 return err 25549 } 25550 25551 case "AwsS3Object": 25552 if err := awsRestjson1_deserializeDocumentAwsS3ObjectDetails(&sv.AwsS3Object, value); err != nil { 25553 return err 25554 } 25555 25556 case "AwsSecretsManagerSecret": 25557 if err := awsRestjson1_deserializeDocumentAwsSecretsManagerSecretDetails(&sv.AwsSecretsManagerSecret, value); err != nil { 25558 return err 25559 } 25560 25561 case "AwsSnsTopic": 25562 if err := awsRestjson1_deserializeDocumentAwsSnsTopicDetails(&sv.AwsSnsTopic, value); err != nil { 25563 return err 25564 } 25565 25566 case "AwsSqsQueue": 25567 if err := awsRestjson1_deserializeDocumentAwsSqsQueueDetails(&sv.AwsSqsQueue, value); err != nil { 25568 return err 25569 } 25570 25571 case "AwsWafWebAcl": 25572 if err := awsRestjson1_deserializeDocumentAwsWafWebAclDetails(&sv.AwsWafWebAcl, value); err != nil { 25573 return err 25574 } 25575 25576 case "Container": 25577 if err := awsRestjson1_deserializeDocumentContainerDetails(&sv.Container, value); err != nil { 25578 return err 25579 } 25580 25581 case "Other": 25582 if err := awsRestjson1_deserializeDocumentFieldMap(&sv.Other, value); err != nil { 25583 return err 25584 } 25585 25586 default: 25587 _, _ = key, value 25588 25589 } 25590 } 25591 *v = sv 25592 return nil 25593} 25594 25595func awsRestjson1_deserializeDocumentResourceList(v *[]types.Resource, value interface{}) error { 25596 if v == nil { 25597 return fmt.Errorf("unexpected nil of type %T", v) 25598 } 25599 if value == nil { 25600 return nil 25601 } 25602 25603 shape, ok := value.([]interface{}) 25604 if !ok { 25605 return fmt.Errorf("unexpected JSON type %v", value) 25606 } 25607 25608 var cv []types.Resource 25609 if *v == nil { 25610 cv = []types.Resource{} 25611 } else { 25612 cv = *v 25613 } 25614 25615 for _, value := range shape { 25616 var col types.Resource 25617 destAddr := &col 25618 if err := awsRestjson1_deserializeDocumentResource(&destAddr, value); err != nil { 25619 return err 25620 } 25621 col = *destAddr 25622 cv = append(cv, col) 25623 25624 } 25625 *v = cv 25626 return nil 25627} 25628 25629func awsRestjson1_deserializeDocumentResourceNotFoundException(v **types.ResourceNotFoundException, value interface{}) error { 25630 if v == nil { 25631 return fmt.Errorf("unexpected nil of type %T", v) 25632 } 25633 if value == nil { 25634 return nil 25635 } 25636 25637 shape, ok := value.(map[string]interface{}) 25638 if !ok { 25639 return fmt.Errorf("unexpected JSON type %v", value) 25640 } 25641 25642 var sv *types.ResourceNotFoundException 25643 if *v == nil { 25644 sv = &types.ResourceNotFoundException{} 25645 } else { 25646 sv = *v 25647 } 25648 25649 for key, value := range shape { 25650 switch key { 25651 case "Code": 25652 if value != nil { 25653 jtv, ok := value.(string) 25654 if !ok { 25655 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 25656 } 25657 sv.Code = ptr.String(jtv) 25658 } 25659 25660 case "Message": 25661 if value != nil { 25662 jtv, ok := value.(string) 25663 if !ok { 25664 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 25665 } 25666 sv.Message = ptr.String(jtv) 25667 } 25668 25669 default: 25670 _, _ = key, value 25671 25672 } 25673 } 25674 *v = sv 25675 return nil 25676} 25677 25678func awsRestjson1_deserializeDocumentResult(v **types.Result, value interface{}) error { 25679 if v == nil { 25680 return fmt.Errorf("unexpected nil of type %T", v) 25681 } 25682 if value == nil { 25683 return nil 25684 } 25685 25686 shape, ok := value.(map[string]interface{}) 25687 if !ok { 25688 return fmt.Errorf("unexpected JSON type %v", value) 25689 } 25690 25691 var sv *types.Result 25692 if *v == nil { 25693 sv = &types.Result{} 25694 } else { 25695 sv = *v 25696 } 25697 25698 for key, value := range shape { 25699 switch key { 25700 case "AccountId": 25701 if value != nil { 25702 jtv, ok := value.(string) 25703 if !ok { 25704 return fmt.Errorf("expected AccountId to be of type string, got %T instead", value) 25705 } 25706 sv.AccountId = ptr.String(jtv) 25707 } 25708 25709 case "ProcessingResult": 25710 if value != nil { 25711 jtv, ok := value.(string) 25712 if !ok { 25713 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 25714 } 25715 sv.ProcessingResult = ptr.String(jtv) 25716 } 25717 25718 default: 25719 _, _ = key, value 25720 25721 } 25722 } 25723 *v = sv 25724 return nil 25725} 25726 25727func awsRestjson1_deserializeDocumentResultList(v *[]types.Result, value interface{}) error { 25728 if v == nil { 25729 return fmt.Errorf("unexpected nil of type %T", v) 25730 } 25731 if value == nil { 25732 return nil 25733 } 25734 25735 shape, ok := value.([]interface{}) 25736 if !ok { 25737 return fmt.Errorf("unexpected JSON type %v", value) 25738 } 25739 25740 var cv []types.Result 25741 if *v == nil { 25742 cv = []types.Result{} 25743 } else { 25744 cv = *v 25745 } 25746 25747 for _, value := range shape { 25748 var col types.Result 25749 destAddr := &col 25750 if err := awsRestjson1_deserializeDocumentResult(&destAddr, value); err != nil { 25751 return err 25752 } 25753 col = *destAddr 25754 cv = append(cv, col) 25755 25756 } 25757 *v = cv 25758 return nil 25759} 25760 25761func awsRestjson1_deserializeDocumentSecurityGroups(v *[]string, value interface{}) error { 25762 if v == nil { 25763 return fmt.Errorf("unexpected nil of type %T", v) 25764 } 25765 if value == nil { 25766 return nil 25767 } 25768 25769 shape, ok := value.([]interface{}) 25770 if !ok { 25771 return fmt.Errorf("unexpected JSON type %v", value) 25772 } 25773 25774 var cv []string 25775 if *v == nil { 25776 cv = []string{} 25777 } else { 25778 cv = *v 25779 } 25780 25781 for _, value := range shape { 25782 var col string 25783 if value != nil { 25784 jtv, ok := value.(string) 25785 if !ok { 25786 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 25787 } 25788 col = jtv 25789 } 25790 cv = append(cv, col) 25791 25792 } 25793 *v = cv 25794 return nil 25795} 25796 25797func awsRestjson1_deserializeDocumentSeverity(v **types.Severity, value interface{}) error { 25798 if v == nil { 25799 return fmt.Errorf("unexpected nil of type %T", v) 25800 } 25801 if value == nil { 25802 return nil 25803 } 25804 25805 shape, ok := value.(map[string]interface{}) 25806 if !ok { 25807 return fmt.Errorf("unexpected JSON type %v", value) 25808 } 25809 25810 var sv *types.Severity 25811 if *v == nil { 25812 sv = &types.Severity{} 25813 } else { 25814 sv = *v 25815 } 25816 25817 for key, value := range shape { 25818 switch key { 25819 case "Label": 25820 if value != nil { 25821 jtv, ok := value.(string) 25822 if !ok { 25823 return fmt.Errorf("expected SeverityLabel to be of type string, got %T instead", value) 25824 } 25825 sv.Label = types.SeverityLabel(jtv) 25826 } 25827 25828 case "Normalized": 25829 if value != nil { 25830 jtv, ok := value.(json.Number) 25831 if !ok { 25832 return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) 25833 } 25834 i64, err := jtv.Int64() 25835 if err != nil { 25836 return err 25837 } 25838 sv.Normalized = int32(i64) 25839 } 25840 25841 case "Original": 25842 if value != nil { 25843 jtv, ok := value.(string) 25844 if !ok { 25845 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 25846 } 25847 sv.Original = ptr.String(jtv) 25848 } 25849 25850 case "Product": 25851 if value != nil { 25852 jtv, ok := value.(json.Number) 25853 if !ok { 25854 return fmt.Errorf("expected Double to be json.Number, got %T instead", value) 25855 } 25856 f64, err := jtv.Float64() 25857 if err != nil { 25858 return err 25859 } 25860 sv.Product = f64 25861 } 25862 25863 default: 25864 _, _ = key, value 25865 25866 } 25867 } 25868 *v = sv 25869 return nil 25870} 25871 25872func awsRestjson1_deserializeDocumentSoftwarePackage(v **types.SoftwarePackage, value interface{}) error { 25873 if v == nil { 25874 return fmt.Errorf("unexpected nil of type %T", v) 25875 } 25876 if value == nil { 25877 return nil 25878 } 25879 25880 shape, ok := value.(map[string]interface{}) 25881 if !ok { 25882 return fmt.Errorf("unexpected JSON type %v", value) 25883 } 25884 25885 var sv *types.SoftwarePackage 25886 if *v == nil { 25887 sv = &types.SoftwarePackage{} 25888 } else { 25889 sv = *v 25890 } 25891 25892 for key, value := range shape { 25893 switch key { 25894 case "Architecture": 25895 if value != nil { 25896 jtv, ok := value.(string) 25897 if !ok { 25898 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 25899 } 25900 sv.Architecture = ptr.String(jtv) 25901 } 25902 25903 case "Epoch": 25904 if value != nil { 25905 jtv, ok := value.(string) 25906 if !ok { 25907 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 25908 } 25909 sv.Epoch = ptr.String(jtv) 25910 } 25911 25912 case "Name": 25913 if value != nil { 25914 jtv, ok := value.(string) 25915 if !ok { 25916 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 25917 } 25918 sv.Name = ptr.String(jtv) 25919 } 25920 25921 case "Release": 25922 if value != nil { 25923 jtv, ok := value.(string) 25924 if !ok { 25925 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 25926 } 25927 sv.Release = ptr.String(jtv) 25928 } 25929 25930 case "Version": 25931 if value != nil { 25932 jtv, ok := value.(string) 25933 if !ok { 25934 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 25935 } 25936 sv.Version = ptr.String(jtv) 25937 } 25938 25939 default: 25940 _, _ = key, value 25941 25942 } 25943 } 25944 *v = sv 25945 return nil 25946} 25947 25948func awsRestjson1_deserializeDocumentSoftwarePackageList(v *[]types.SoftwarePackage, value interface{}) error { 25949 if v == nil { 25950 return fmt.Errorf("unexpected nil of type %T", v) 25951 } 25952 if value == nil { 25953 return nil 25954 } 25955 25956 shape, ok := value.([]interface{}) 25957 if !ok { 25958 return fmt.Errorf("unexpected JSON type %v", value) 25959 } 25960 25961 var cv []types.SoftwarePackage 25962 if *v == nil { 25963 cv = []types.SoftwarePackage{} 25964 } else { 25965 cv = *v 25966 } 25967 25968 for _, value := range shape { 25969 var col types.SoftwarePackage 25970 destAddr := &col 25971 if err := awsRestjson1_deserializeDocumentSoftwarePackage(&destAddr, value); err != nil { 25972 return err 25973 } 25974 col = *destAddr 25975 cv = append(cv, col) 25976 25977 } 25978 *v = cv 25979 return nil 25980} 25981 25982func awsRestjson1_deserializeDocumentStandard(v **types.Standard, value interface{}) error { 25983 if v == nil { 25984 return fmt.Errorf("unexpected nil of type %T", v) 25985 } 25986 if value == nil { 25987 return nil 25988 } 25989 25990 shape, ok := value.(map[string]interface{}) 25991 if !ok { 25992 return fmt.Errorf("unexpected JSON type %v", value) 25993 } 25994 25995 var sv *types.Standard 25996 if *v == nil { 25997 sv = &types.Standard{} 25998 } else { 25999 sv = *v 26000 } 26001 26002 for key, value := range shape { 26003 switch key { 26004 case "Description": 26005 if value != nil { 26006 jtv, ok := value.(string) 26007 if !ok { 26008 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 26009 } 26010 sv.Description = ptr.String(jtv) 26011 } 26012 26013 case "EnabledByDefault": 26014 if value != nil { 26015 jtv, ok := value.(bool) 26016 if !ok { 26017 return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) 26018 } 26019 sv.EnabledByDefault = jtv 26020 } 26021 26022 case "Name": 26023 if value != nil { 26024 jtv, ok := value.(string) 26025 if !ok { 26026 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 26027 } 26028 sv.Name = ptr.String(jtv) 26029 } 26030 26031 case "StandardsArn": 26032 if value != nil { 26033 jtv, ok := value.(string) 26034 if !ok { 26035 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 26036 } 26037 sv.StandardsArn = ptr.String(jtv) 26038 } 26039 26040 default: 26041 _, _ = key, value 26042 26043 } 26044 } 26045 *v = sv 26046 return nil 26047} 26048 26049func awsRestjson1_deserializeDocumentStandards(v *[]types.Standard, value interface{}) error { 26050 if v == nil { 26051 return fmt.Errorf("unexpected nil of type %T", v) 26052 } 26053 if value == nil { 26054 return nil 26055 } 26056 26057 shape, ok := value.([]interface{}) 26058 if !ok { 26059 return fmt.Errorf("unexpected JSON type %v", value) 26060 } 26061 26062 var cv []types.Standard 26063 if *v == nil { 26064 cv = []types.Standard{} 26065 } else { 26066 cv = *v 26067 } 26068 26069 for _, value := range shape { 26070 var col types.Standard 26071 destAddr := &col 26072 if err := awsRestjson1_deserializeDocumentStandard(&destAddr, value); err != nil { 26073 return err 26074 } 26075 col = *destAddr 26076 cv = append(cv, col) 26077 26078 } 26079 *v = cv 26080 return nil 26081} 26082 26083func awsRestjson1_deserializeDocumentStandardsControl(v **types.StandardsControl, value interface{}) error { 26084 if v == nil { 26085 return fmt.Errorf("unexpected nil of type %T", v) 26086 } 26087 if value == nil { 26088 return nil 26089 } 26090 26091 shape, ok := value.(map[string]interface{}) 26092 if !ok { 26093 return fmt.Errorf("unexpected JSON type %v", value) 26094 } 26095 26096 var sv *types.StandardsControl 26097 if *v == nil { 26098 sv = &types.StandardsControl{} 26099 } else { 26100 sv = *v 26101 } 26102 26103 for key, value := range shape { 26104 switch key { 26105 case "ControlId": 26106 if value != nil { 26107 jtv, ok := value.(string) 26108 if !ok { 26109 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 26110 } 26111 sv.ControlId = ptr.String(jtv) 26112 } 26113 26114 case "ControlStatus": 26115 if value != nil { 26116 jtv, ok := value.(string) 26117 if !ok { 26118 return fmt.Errorf("expected ControlStatus to be of type string, got %T instead", value) 26119 } 26120 sv.ControlStatus = types.ControlStatus(jtv) 26121 } 26122 26123 case "ControlStatusUpdatedAt": 26124 if value != nil { 26125 jtv, ok := value.(string) 26126 if !ok { 26127 return fmt.Errorf("expected Timestamp to be of type string, got %T instead", value) 26128 } 26129 t, err := smithytime.ParseDateTime(jtv) 26130 if err != nil { 26131 return err 26132 } 26133 sv.ControlStatusUpdatedAt = ptr.Time(t) 26134 } 26135 26136 case "Description": 26137 if value != nil { 26138 jtv, ok := value.(string) 26139 if !ok { 26140 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 26141 } 26142 sv.Description = ptr.String(jtv) 26143 } 26144 26145 case "DisabledReason": 26146 if value != nil { 26147 jtv, ok := value.(string) 26148 if !ok { 26149 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 26150 } 26151 sv.DisabledReason = ptr.String(jtv) 26152 } 26153 26154 case "RelatedRequirements": 26155 if err := awsRestjson1_deserializeDocumentRelatedRequirementsList(&sv.RelatedRequirements, value); err != nil { 26156 return err 26157 } 26158 26159 case "RemediationUrl": 26160 if value != nil { 26161 jtv, ok := value.(string) 26162 if !ok { 26163 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 26164 } 26165 sv.RemediationUrl = ptr.String(jtv) 26166 } 26167 26168 case "SeverityRating": 26169 if value != nil { 26170 jtv, ok := value.(string) 26171 if !ok { 26172 return fmt.Errorf("expected SeverityRating to be of type string, got %T instead", value) 26173 } 26174 sv.SeverityRating = types.SeverityRating(jtv) 26175 } 26176 26177 case "StandardsControlArn": 26178 if value != nil { 26179 jtv, ok := value.(string) 26180 if !ok { 26181 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 26182 } 26183 sv.StandardsControlArn = ptr.String(jtv) 26184 } 26185 26186 case "Title": 26187 if value != nil { 26188 jtv, ok := value.(string) 26189 if !ok { 26190 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 26191 } 26192 sv.Title = ptr.String(jtv) 26193 } 26194 26195 default: 26196 _, _ = key, value 26197 26198 } 26199 } 26200 *v = sv 26201 return nil 26202} 26203 26204func awsRestjson1_deserializeDocumentStandardsControls(v *[]types.StandardsControl, value interface{}) error { 26205 if v == nil { 26206 return fmt.Errorf("unexpected nil of type %T", v) 26207 } 26208 if value == nil { 26209 return nil 26210 } 26211 26212 shape, ok := value.([]interface{}) 26213 if !ok { 26214 return fmt.Errorf("unexpected JSON type %v", value) 26215 } 26216 26217 var cv []types.StandardsControl 26218 if *v == nil { 26219 cv = []types.StandardsControl{} 26220 } else { 26221 cv = *v 26222 } 26223 26224 for _, value := range shape { 26225 var col types.StandardsControl 26226 destAddr := &col 26227 if err := awsRestjson1_deserializeDocumentStandardsControl(&destAddr, value); err != nil { 26228 return err 26229 } 26230 col = *destAddr 26231 cv = append(cv, col) 26232 26233 } 26234 *v = cv 26235 return nil 26236} 26237 26238func awsRestjson1_deserializeDocumentStandardsInputParameterMap(v *map[string]string, value interface{}) error { 26239 if v == nil { 26240 return fmt.Errorf("unexpected nil of type %T", v) 26241 } 26242 if value == nil { 26243 return nil 26244 } 26245 26246 shape, ok := value.(map[string]interface{}) 26247 if !ok { 26248 return fmt.Errorf("unexpected JSON type %v", value) 26249 } 26250 26251 var mv map[string]string 26252 if *v == nil { 26253 mv = map[string]string{} 26254 } else { 26255 mv = *v 26256 } 26257 26258 for key, value := range shape { 26259 var parsedVal string 26260 if value != nil { 26261 jtv, ok := value.(string) 26262 if !ok { 26263 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 26264 } 26265 parsedVal = jtv 26266 } 26267 mv[key] = parsedVal 26268 26269 } 26270 *v = mv 26271 return nil 26272} 26273 26274func awsRestjson1_deserializeDocumentStandardsSubscription(v **types.StandardsSubscription, value interface{}) error { 26275 if v == nil { 26276 return fmt.Errorf("unexpected nil of type %T", v) 26277 } 26278 if value == nil { 26279 return nil 26280 } 26281 26282 shape, ok := value.(map[string]interface{}) 26283 if !ok { 26284 return fmt.Errorf("unexpected JSON type %v", value) 26285 } 26286 26287 var sv *types.StandardsSubscription 26288 if *v == nil { 26289 sv = &types.StandardsSubscription{} 26290 } else { 26291 sv = *v 26292 } 26293 26294 for key, value := range shape { 26295 switch key { 26296 case "StandardsArn": 26297 if value != nil { 26298 jtv, ok := value.(string) 26299 if !ok { 26300 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 26301 } 26302 sv.StandardsArn = ptr.String(jtv) 26303 } 26304 26305 case "StandardsInput": 26306 if err := awsRestjson1_deserializeDocumentStandardsInputParameterMap(&sv.StandardsInput, value); err != nil { 26307 return err 26308 } 26309 26310 case "StandardsStatus": 26311 if value != nil { 26312 jtv, ok := value.(string) 26313 if !ok { 26314 return fmt.Errorf("expected StandardsStatus to be of type string, got %T instead", value) 26315 } 26316 sv.StandardsStatus = types.StandardsStatus(jtv) 26317 } 26318 26319 case "StandardsSubscriptionArn": 26320 if value != nil { 26321 jtv, ok := value.(string) 26322 if !ok { 26323 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 26324 } 26325 sv.StandardsSubscriptionArn = ptr.String(jtv) 26326 } 26327 26328 default: 26329 _, _ = key, value 26330 26331 } 26332 } 26333 *v = sv 26334 return nil 26335} 26336 26337func awsRestjson1_deserializeDocumentStandardsSubscriptions(v *[]types.StandardsSubscription, value interface{}) error { 26338 if v == nil { 26339 return fmt.Errorf("unexpected nil of type %T", v) 26340 } 26341 if value == nil { 26342 return nil 26343 } 26344 26345 shape, ok := value.([]interface{}) 26346 if !ok { 26347 return fmt.Errorf("unexpected JSON type %v", value) 26348 } 26349 26350 var cv []types.StandardsSubscription 26351 if *v == nil { 26352 cv = []types.StandardsSubscription{} 26353 } else { 26354 cv = *v 26355 } 26356 26357 for _, value := range shape { 26358 var col types.StandardsSubscription 26359 destAddr := &col 26360 if err := awsRestjson1_deserializeDocumentStandardsSubscription(&destAddr, value); err != nil { 26361 return err 26362 } 26363 col = *destAddr 26364 cv = append(cv, col) 26365 26366 } 26367 *v = cv 26368 return nil 26369} 26370 26371func awsRestjson1_deserializeDocumentStatusReason(v **types.StatusReason, value interface{}) error { 26372 if v == nil { 26373 return fmt.Errorf("unexpected nil of type %T", v) 26374 } 26375 if value == nil { 26376 return nil 26377 } 26378 26379 shape, ok := value.(map[string]interface{}) 26380 if !ok { 26381 return fmt.Errorf("unexpected JSON type %v", value) 26382 } 26383 26384 var sv *types.StatusReason 26385 if *v == nil { 26386 sv = &types.StatusReason{} 26387 } else { 26388 sv = *v 26389 } 26390 26391 for key, value := range shape { 26392 switch key { 26393 case "Description": 26394 if value != nil { 26395 jtv, ok := value.(string) 26396 if !ok { 26397 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 26398 } 26399 sv.Description = ptr.String(jtv) 26400 } 26401 26402 case "ReasonCode": 26403 if value != nil { 26404 jtv, ok := value.(string) 26405 if !ok { 26406 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 26407 } 26408 sv.ReasonCode = ptr.String(jtv) 26409 } 26410 26411 default: 26412 _, _ = key, value 26413 26414 } 26415 } 26416 *v = sv 26417 return nil 26418} 26419 26420func awsRestjson1_deserializeDocumentStatusReasonsList(v *[]types.StatusReason, value interface{}) error { 26421 if v == nil { 26422 return fmt.Errorf("unexpected nil of type %T", v) 26423 } 26424 if value == nil { 26425 return nil 26426 } 26427 26428 shape, ok := value.([]interface{}) 26429 if !ok { 26430 return fmt.Errorf("unexpected JSON type %v", value) 26431 } 26432 26433 var cv []types.StatusReason 26434 if *v == nil { 26435 cv = []types.StatusReason{} 26436 } else { 26437 cv = *v 26438 } 26439 26440 for _, value := range shape { 26441 var col types.StatusReason 26442 destAddr := &col 26443 if err := awsRestjson1_deserializeDocumentStatusReason(&destAddr, value); err != nil { 26444 return err 26445 } 26446 col = *destAddr 26447 cv = append(cv, col) 26448 26449 } 26450 *v = cv 26451 return nil 26452} 26453 26454func awsRestjson1_deserializeDocumentStringFilter(v **types.StringFilter, value interface{}) error { 26455 if v == nil { 26456 return fmt.Errorf("unexpected nil of type %T", v) 26457 } 26458 if value == nil { 26459 return nil 26460 } 26461 26462 shape, ok := value.(map[string]interface{}) 26463 if !ok { 26464 return fmt.Errorf("unexpected JSON type %v", value) 26465 } 26466 26467 var sv *types.StringFilter 26468 if *v == nil { 26469 sv = &types.StringFilter{} 26470 } else { 26471 sv = *v 26472 } 26473 26474 for key, value := range shape { 26475 switch key { 26476 case "Comparison": 26477 if value != nil { 26478 jtv, ok := value.(string) 26479 if !ok { 26480 return fmt.Errorf("expected StringFilterComparison to be of type string, got %T instead", value) 26481 } 26482 sv.Comparison = types.StringFilterComparison(jtv) 26483 } 26484 26485 case "Value": 26486 if value != nil { 26487 jtv, ok := value.(string) 26488 if !ok { 26489 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 26490 } 26491 sv.Value = ptr.String(jtv) 26492 } 26493 26494 default: 26495 _, _ = key, value 26496 26497 } 26498 } 26499 *v = sv 26500 return nil 26501} 26502 26503func awsRestjson1_deserializeDocumentStringFilterList(v *[]types.StringFilter, value interface{}) error { 26504 if v == nil { 26505 return fmt.Errorf("unexpected nil of type %T", v) 26506 } 26507 if value == nil { 26508 return nil 26509 } 26510 26511 shape, ok := value.([]interface{}) 26512 if !ok { 26513 return fmt.Errorf("unexpected JSON type %v", value) 26514 } 26515 26516 var cv []types.StringFilter 26517 if *v == nil { 26518 cv = []types.StringFilter{} 26519 } else { 26520 cv = *v 26521 } 26522 26523 for _, value := range shape { 26524 var col types.StringFilter 26525 destAddr := &col 26526 if err := awsRestjson1_deserializeDocumentStringFilter(&destAddr, value); err != nil { 26527 return err 26528 } 26529 col = *destAddr 26530 cv = append(cv, col) 26531 26532 } 26533 *v = cv 26534 return nil 26535} 26536 26537func awsRestjson1_deserializeDocumentStringList(v *[]string, value interface{}) error { 26538 if v == nil { 26539 return fmt.Errorf("unexpected nil of type %T", v) 26540 } 26541 if value == nil { 26542 return nil 26543 } 26544 26545 shape, ok := value.([]interface{}) 26546 if !ok { 26547 return fmt.Errorf("unexpected JSON type %v", value) 26548 } 26549 26550 var cv []string 26551 if *v == nil { 26552 cv = []string{} 26553 } else { 26554 cv = *v 26555 } 26556 26557 for _, value := range shape { 26558 var col string 26559 if value != nil { 26560 jtv, ok := value.(string) 26561 if !ok { 26562 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 26563 } 26564 col = jtv 26565 } 26566 cv = append(cv, col) 26567 26568 } 26569 *v = cv 26570 return nil 26571} 26572 26573func awsRestjson1_deserializeDocumentTagMap(v *map[string]string, value interface{}) error { 26574 if v == nil { 26575 return fmt.Errorf("unexpected nil of type %T", v) 26576 } 26577 if value == nil { 26578 return nil 26579 } 26580 26581 shape, ok := value.(map[string]interface{}) 26582 if !ok { 26583 return fmt.Errorf("unexpected JSON type %v", value) 26584 } 26585 26586 var mv map[string]string 26587 if *v == nil { 26588 mv = map[string]string{} 26589 } else { 26590 mv = *v 26591 } 26592 26593 for key, value := range shape { 26594 var parsedVal string 26595 if value != nil { 26596 jtv, ok := value.(string) 26597 if !ok { 26598 return fmt.Errorf("expected TagValue to be of type string, got %T instead", value) 26599 } 26600 parsedVal = jtv 26601 } 26602 mv[key] = parsedVal 26603 26604 } 26605 *v = mv 26606 return nil 26607} 26608 26609func awsRestjson1_deserializeDocumentThreatIntelIndicator(v **types.ThreatIntelIndicator, value interface{}) error { 26610 if v == nil { 26611 return fmt.Errorf("unexpected nil of type %T", v) 26612 } 26613 if value == nil { 26614 return nil 26615 } 26616 26617 shape, ok := value.(map[string]interface{}) 26618 if !ok { 26619 return fmt.Errorf("unexpected JSON type %v", value) 26620 } 26621 26622 var sv *types.ThreatIntelIndicator 26623 if *v == nil { 26624 sv = &types.ThreatIntelIndicator{} 26625 } else { 26626 sv = *v 26627 } 26628 26629 for key, value := range shape { 26630 switch key { 26631 case "Category": 26632 if value != nil { 26633 jtv, ok := value.(string) 26634 if !ok { 26635 return fmt.Errorf("expected ThreatIntelIndicatorCategory to be of type string, got %T instead", value) 26636 } 26637 sv.Category = types.ThreatIntelIndicatorCategory(jtv) 26638 } 26639 26640 case "LastObservedAt": 26641 if value != nil { 26642 jtv, ok := value.(string) 26643 if !ok { 26644 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 26645 } 26646 sv.LastObservedAt = ptr.String(jtv) 26647 } 26648 26649 case "Source": 26650 if value != nil { 26651 jtv, ok := value.(string) 26652 if !ok { 26653 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 26654 } 26655 sv.Source = ptr.String(jtv) 26656 } 26657 26658 case "SourceUrl": 26659 if value != nil { 26660 jtv, ok := value.(string) 26661 if !ok { 26662 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 26663 } 26664 sv.SourceUrl = ptr.String(jtv) 26665 } 26666 26667 case "Type": 26668 if value != nil { 26669 jtv, ok := value.(string) 26670 if !ok { 26671 return fmt.Errorf("expected ThreatIntelIndicatorType to be of type string, got %T instead", value) 26672 } 26673 sv.Type = types.ThreatIntelIndicatorType(jtv) 26674 } 26675 26676 case "Value": 26677 if value != nil { 26678 jtv, ok := value.(string) 26679 if !ok { 26680 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 26681 } 26682 sv.Value = ptr.String(jtv) 26683 } 26684 26685 default: 26686 _, _ = key, value 26687 26688 } 26689 } 26690 *v = sv 26691 return nil 26692} 26693 26694func awsRestjson1_deserializeDocumentThreatIntelIndicatorList(v *[]types.ThreatIntelIndicator, value interface{}) error { 26695 if v == nil { 26696 return fmt.Errorf("unexpected nil of type %T", v) 26697 } 26698 if value == nil { 26699 return nil 26700 } 26701 26702 shape, ok := value.([]interface{}) 26703 if !ok { 26704 return fmt.Errorf("unexpected JSON type %v", value) 26705 } 26706 26707 var cv []types.ThreatIntelIndicator 26708 if *v == nil { 26709 cv = []types.ThreatIntelIndicator{} 26710 } else { 26711 cv = *v 26712 } 26713 26714 for _, value := range shape { 26715 var col types.ThreatIntelIndicator 26716 destAddr := &col 26717 if err := awsRestjson1_deserializeDocumentThreatIntelIndicator(&destAddr, value); err != nil { 26718 return err 26719 } 26720 col = *destAddr 26721 cv = append(cv, col) 26722 26723 } 26724 *v = cv 26725 return nil 26726} 26727 26728func awsRestjson1_deserializeDocumentTypeList(v *[]string, value interface{}) error { 26729 if v == nil { 26730 return fmt.Errorf("unexpected nil of type %T", v) 26731 } 26732 if value == nil { 26733 return nil 26734 } 26735 26736 shape, ok := value.([]interface{}) 26737 if !ok { 26738 return fmt.Errorf("unexpected JSON type %v", value) 26739 } 26740 26741 var cv []string 26742 if *v == nil { 26743 cv = []string{} 26744 } else { 26745 cv = *v 26746 } 26747 26748 for _, value := range shape { 26749 var col string 26750 if value != nil { 26751 jtv, ok := value.(string) 26752 if !ok { 26753 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 26754 } 26755 col = jtv 26756 } 26757 cv = append(cv, col) 26758 26759 } 26760 *v = cv 26761 return nil 26762} 26763 26764func awsRestjson1_deserializeDocumentVulnerability(v **types.Vulnerability, value interface{}) error { 26765 if v == nil { 26766 return fmt.Errorf("unexpected nil of type %T", v) 26767 } 26768 if value == nil { 26769 return nil 26770 } 26771 26772 shape, ok := value.(map[string]interface{}) 26773 if !ok { 26774 return fmt.Errorf("unexpected JSON type %v", value) 26775 } 26776 26777 var sv *types.Vulnerability 26778 if *v == nil { 26779 sv = &types.Vulnerability{} 26780 } else { 26781 sv = *v 26782 } 26783 26784 for key, value := range shape { 26785 switch key { 26786 case "Cvss": 26787 if err := awsRestjson1_deserializeDocumentCvssList(&sv.Cvss, value); err != nil { 26788 return err 26789 } 26790 26791 case "Id": 26792 if value != nil { 26793 jtv, ok := value.(string) 26794 if !ok { 26795 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 26796 } 26797 sv.Id = ptr.String(jtv) 26798 } 26799 26800 case "ReferenceUrls": 26801 if err := awsRestjson1_deserializeDocumentStringList(&sv.ReferenceUrls, value); err != nil { 26802 return err 26803 } 26804 26805 case "RelatedVulnerabilities": 26806 if err := awsRestjson1_deserializeDocumentStringList(&sv.RelatedVulnerabilities, value); err != nil { 26807 return err 26808 } 26809 26810 case "Vendor": 26811 if err := awsRestjson1_deserializeDocumentVulnerabilityVendor(&sv.Vendor, value); err != nil { 26812 return err 26813 } 26814 26815 case "VulnerablePackages": 26816 if err := awsRestjson1_deserializeDocumentSoftwarePackageList(&sv.VulnerablePackages, value); err != nil { 26817 return err 26818 } 26819 26820 default: 26821 _, _ = key, value 26822 26823 } 26824 } 26825 *v = sv 26826 return nil 26827} 26828 26829func awsRestjson1_deserializeDocumentVulnerabilityList(v *[]types.Vulnerability, value interface{}) error { 26830 if v == nil { 26831 return fmt.Errorf("unexpected nil of type %T", v) 26832 } 26833 if value == nil { 26834 return nil 26835 } 26836 26837 shape, ok := value.([]interface{}) 26838 if !ok { 26839 return fmt.Errorf("unexpected JSON type %v", value) 26840 } 26841 26842 var cv []types.Vulnerability 26843 if *v == nil { 26844 cv = []types.Vulnerability{} 26845 } else { 26846 cv = *v 26847 } 26848 26849 for _, value := range shape { 26850 var col types.Vulnerability 26851 destAddr := &col 26852 if err := awsRestjson1_deserializeDocumentVulnerability(&destAddr, value); err != nil { 26853 return err 26854 } 26855 col = *destAddr 26856 cv = append(cv, col) 26857 26858 } 26859 *v = cv 26860 return nil 26861} 26862 26863func awsRestjson1_deserializeDocumentVulnerabilityVendor(v **types.VulnerabilityVendor, value interface{}) error { 26864 if v == nil { 26865 return fmt.Errorf("unexpected nil of type %T", v) 26866 } 26867 if value == nil { 26868 return nil 26869 } 26870 26871 shape, ok := value.(map[string]interface{}) 26872 if !ok { 26873 return fmt.Errorf("unexpected JSON type %v", value) 26874 } 26875 26876 var sv *types.VulnerabilityVendor 26877 if *v == nil { 26878 sv = &types.VulnerabilityVendor{} 26879 } else { 26880 sv = *v 26881 } 26882 26883 for key, value := range shape { 26884 switch key { 26885 case "Name": 26886 if value != nil { 26887 jtv, ok := value.(string) 26888 if !ok { 26889 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 26890 } 26891 sv.Name = ptr.String(jtv) 26892 } 26893 26894 case "Url": 26895 if value != nil { 26896 jtv, ok := value.(string) 26897 if !ok { 26898 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 26899 } 26900 sv.Url = ptr.String(jtv) 26901 } 26902 26903 case "VendorCreatedAt": 26904 if value != nil { 26905 jtv, ok := value.(string) 26906 if !ok { 26907 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 26908 } 26909 sv.VendorCreatedAt = ptr.String(jtv) 26910 } 26911 26912 case "VendorSeverity": 26913 if value != nil { 26914 jtv, ok := value.(string) 26915 if !ok { 26916 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 26917 } 26918 sv.VendorSeverity = ptr.String(jtv) 26919 } 26920 26921 case "VendorUpdatedAt": 26922 if value != nil { 26923 jtv, ok := value.(string) 26924 if !ok { 26925 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 26926 } 26927 sv.VendorUpdatedAt = ptr.String(jtv) 26928 } 26929 26930 default: 26931 _, _ = key, value 26932 26933 } 26934 } 26935 *v = sv 26936 return nil 26937} 26938 26939func awsRestjson1_deserializeDocumentWafAction(v **types.WafAction, value interface{}) error { 26940 if v == nil { 26941 return fmt.Errorf("unexpected nil of type %T", v) 26942 } 26943 if value == nil { 26944 return nil 26945 } 26946 26947 shape, ok := value.(map[string]interface{}) 26948 if !ok { 26949 return fmt.Errorf("unexpected JSON type %v", value) 26950 } 26951 26952 var sv *types.WafAction 26953 if *v == nil { 26954 sv = &types.WafAction{} 26955 } else { 26956 sv = *v 26957 } 26958 26959 for key, value := range shape { 26960 switch key { 26961 case "Type": 26962 if value != nil { 26963 jtv, ok := value.(string) 26964 if !ok { 26965 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 26966 } 26967 sv.Type = ptr.String(jtv) 26968 } 26969 26970 default: 26971 _, _ = key, value 26972 26973 } 26974 } 26975 *v = sv 26976 return nil 26977} 26978 26979func awsRestjson1_deserializeDocumentWafExcludedRule(v **types.WafExcludedRule, value interface{}) error { 26980 if v == nil { 26981 return fmt.Errorf("unexpected nil of type %T", v) 26982 } 26983 if value == nil { 26984 return nil 26985 } 26986 26987 shape, ok := value.(map[string]interface{}) 26988 if !ok { 26989 return fmt.Errorf("unexpected JSON type %v", value) 26990 } 26991 26992 var sv *types.WafExcludedRule 26993 if *v == nil { 26994 sv = &types.WafExcludedRule{} 26995 } else { 26996 sv = *v 26997 } 26998 26999 for key, value := range shape { 27000 switch key { 27001 case "RuleId": 27002 if value != nil { 27003 jtv, ok := value.(string) 27004 if !ok { 27005 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 27006 } 27007 sv.RuleId = ptr.String(jtv) 27008 } 27009 27010 default: 27011 _, _ = key, value 27012 27013 } 27014 } 27015 *v = sv 27016 return nil 27017} 27018 27019func awsRestjson1_deserializeDocumentWafExcludedRuleList(v *[]types.WafExcludedRule, value interface{}) error { 27020 if v == nil { 27021 return fmt.Errorf("unexpected nil of type %T", v) 27022 } 27023 if value == nil { 27024 return nil 27025 } 27026 27027 shape, ok := value.([]interface{}) 27028 if !ok { 27029 return fmt.Errorf("unexpected JSON type %v", value) 27030 } 27031 27032 var cv []types.WafExcludedRule 27033 if *v == nil { 27034 cv = []types.WafExcludedRule{} 27035 } else { 27036 cv = *v 27037 } 27038 27039 for _, value := range shape { 27040 var col types.WafExcludedRule 27041 destAddr := &col 27042 if err := awsRestjson1_deserializeDocumentWafExcludedRule(&destAddr, value); err != nil { 27043 return err 27044 } 27045 col = *destAddr 27046 cv = append(cv, col) 27047 27048 } 27049 *v = cv 27050 return nil 27051} 27052 27053func awsRestjson1_deserializeDocumentWafOverrideAction(v **types.WafOverrideAction, value interface{}) error { 27054 if v == nil { 27055 return fmt.Errorf("unexpected nil of type %T", v) 27056 } 27057 if value == nil { 27058 return nil 27059 } 27060 27061 shape, ok := value.(map[string]interface{}) 27062 if !ok { 27063 return fmt.Errorf("unexpected JSON type %v", value) 27064 } 27065 27066 var sv *types.WafOverrideAction 27067 if *v == nil { 27068 sv = &types.WafOverrideAction{} 27069 } else { 27070 sv = *v 27071 } 27072 27073 for key, value := range shape { 27074 switch key { 27075 case "Type": 27076 if value != nil { 27077 jtv, ok := value.(string) 27078 if !ok { 27079 return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) 27080 } 27081 sv.Type = ptr.String(jtv) 27082 } 27083 27084 default: 27085 _, _ = key, value 27086 27087 } 27088 } 27089 *v = sv 27090 return nil 27091} 27092 27093func awsRestjson1_deserializeDocumentWorkflow(v **types.Workflow, value interface{}) error { 27094 if v == nil { 27095 return fmt.Errorf("unexpected nil of type %T", v) 27096 } 27097 if value == nil { 27098 return nil 27099 } 27100 27101 shape, ok := value.(map[string]interface{}) 27102 if !ok { 27103 return fmt.Errorf("unexpected JSON type %v", value) 27104 } 27105 27106 var sv *types.Workflow 27107 if *v == nil { 27108 sv = &types.Workflow{} 27109 } else { 27110 sv = *v 27111 } 27112 27113 for key, value := range shape { 27114 switch key { 27115 case "Status": 27116 if value != nil { 27117 jtv, ok := value.(string) 27118 if !ok { 27119 return fmt.Errorf("expected WorkflowStatus to be of type string, got %T instead", value) 27120 } 27121 sv.Status = types.WorkflowStatus(jtv) 27122 } 27123 27124 default: 27125 _, _ = key, value 27126 27127 } 27128 } 27129 *v = sv 27130 return nil 27131} 27132