1// Code generated by smithy-go-codegen DO NOT EDIT. 2 3package elasticsearchservice 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/elasticsearchservice/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 "io/ioutil" 20 "strings" 21) 22 23type awsRestjson1_deserializeOpAcceptInboundCrossClusterSearchConnection struct { 24} 25 26func (*awsRestjson1_deserializeOpAcceptInboundCrossClusterSearchConnection) ID() string { 27 return "OperationDeserializer" 28} 29 30func (m *awsRestjson1_deserializeOpAcceptInboundCrossClusterSearchConnection) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 31 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 32) { 33 out, metadata, err = next.HandleDeserialize(ctx, in) 34 if err != nil { 35 return out, metadata, err 36 } 37 38 response, ok := out.RawResponse.(*smithyhttp.Response) 39 if !ok { 40 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 41 } 42 43 if response.StatusCode < 200 || response.StatusCode >= 300 { 44 return out, metadata, awsRestjson1_deserializeOpErrorAcceptInboundCrossClusterSearchConnection(response, &metadata) 45 } 46 output := &AcceptInboundCrossClusterSearchConnectionOutput{} 47 out.Result = output 48 49 var buff [1024]byte 50 ringBuffer := smithyio.NewRingBuffer(buff[:]) 51 52 body := io.TeeReader(response.Body, ringBuffer) 53 54 decoder := json.NewDecoder(body) 55 decoder.UseNumber() 56 var shape interface{} 57 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 58 var snapshot bytes.Buffer 59 io.Copy(&snapshot, ringBuffer) 60 err = &smithy.DeserializationError{ 61 Err: fmt.Errorf("failed to decode response body, %w", err), 62 Snapshot: snapshot.Bytes(), 63 } 64 return out, metadata, err 65 } 66 67 err = awsRestjson1_deserializeOpDocumentAcceptInboundCrossClusterSearchConnectionOutput(&output, shape) 68 if err != nil { 69 var snapshot bytes.Buffer 70 io.Copy(&snapshot, ringBuffer) 71 return out, metadata, &smithy.DeserializationError{ 72 Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), 73 Snapshot: snapshot.Bytes(), 74 } 75 } 76 77 return out, metadata, err 78} 79 80func awsRestjson1_deserializeOpErrorAcceptInboundCrossClusterSearchConnection(response *smithyhttp.Response, metadata *middleware.Metadata) error { 81 var errorBuffer bytes.Buffer 82 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 83 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 84 } 85 errorBody := bytes.NewReader(errorBuffer.Bytes()) 86 87 errorCode := "UnknownError" 88 errorMessage := errorCode 89 90 code := response.Header.Get("X-Amzn-ErrorType") 91 if len(code) != 0 { 92 errorCode = restjson.SanitizeErrorCode(code) 93 } 94 95 var buff [1024]byte 96 ringBuffer := smithyio.NewRingBuffer(buff[:]) 97 98 body := io.TeeReader(errorBody, ringBuffer) 99 decoder := json.NewDecoder(body) 100 decoder.UseNumber() 101 code, message, err := restjson.GetErrorInfo(decoder) 102 if err != nil { 103 var snapshot bytes.Buffer 104 io.Copy(&snapshot, ringBuffer) 105 err = &smithy.DeserializationError{ 106 Err: fmt.Errorf("failed to decode response body, %w", err), 107 Snapshot: snapshot.Bytes(), 108 } 109 return err 110 } 111 112 errorBody.Seek(0, io.SeekStart) 113 if len(code) != 0 { 114 errorCode = restjson.SanitizeErrorCode(code) 115 } 116 if len(message) != 0 { 117 errorMessage = message 118 } 119 120 switch { 121 case strings.EqualFold("DisabledOperationException", errorCode): 122 return awsRestjson1_deserializeErrorDisabledOperationException(response, errorBody) 123 124 case strings.EqualFold("LimitExceededException", errorCode): 125 return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) 126 127 case strings.EqualFold("ResourceNotFoundException", errorCode): 128 return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) 129 130 default: 131 genericError := &smithy.GenericAPIError{ 132 Code: errorCode, 133 Message: errorMessage, 134 } 135 return genericError 136 137 } 138} 139 140func awsRestjson1_deserializeOpDocumentAcceptInboundCrossClusterSearchConnectionOutput(v **AcceptInboundCrossClusterSearchConnectionOutput, value interface{}) error { 141 if v == nil { 142 return fmt.Errorf("unexpected nil of type %T", v) 143 } 144 if value == nil { 145 return nil 146 } 147 148 shape, ok := value.(map[string]interface{}) 149 if !ok { 150 return fmt.Errorf("unexpected JSON type %v", value) 151 } 152 153 var sv *AcceptInboundCrossClusterSearchConnectionOutput 154 if *v == nil { 155 sv = &AcceptInboundCrossClusterSearchConnectionOutput{} 156 } else { 157 sv = *v 158 } 159 160 for key, value := range shape { 161 switch key { 162 case "CrossClusterSearchConnection": 163 if err := awsRestjson1_deserializeDocumentInboundCrossClusterSearchConnection(&sv.CrossClusterSearchConnection, value); err != nil { 164 return err 165 } 166 167 default: 168 _, _ = key, value 169 170 } 171 } 172 *v = sv 173 return nil 174} 175 176type awsRestjson1_deserializeOpAddTags struct { 177} 178 179func (*awsRestjson1_deserializeOpAddTags) ID() string { 180 return "OperationDeserializer" 181} 182 183func (m *awsRestjson1_deserializeOpAddTags) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 184 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 185) { 186 out, metadata, err = next.HandleDeserialize(ctx, in) 187 if err != nil { 188 return out, metadata, err 189 } 190 191 response, ok := out.RawResponse.(*smithyhttp.Response) 192 if !ok { 193 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 194 } 195 196 if response.StatusCode < 200 || response.StatusCode >= 300 { 197 return out, metadata, awsRestjson1_deserializeOpErrorAddTags(response, &metadata) 198 } 199 output := &AddTagsOutput{} 200 out.Result = output 201 202 if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { 203 return out, metadata, &smithy.DeserializationError{ 204 Err: fmt.Errorf("failed to discard response body, %w", err), 205 } 206 } 207 208 return out, metadata, err 209} 210 211func awsRestjson1_deserializeOpErrorAddTags(response *smithyhttp.Response, metadata *middleware.Metadata) error { 212 var errorBuffer bytes.Buffer 213 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 214 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 215 } 216 errorBody := bytes.NewReader(errorBuffer.Bytes()) 217 218 errorCode := "UnknownError" 219 errorMessage := errorCode 220 221 code := response.Header.Get("X-Amzn-ErrorType") 222 if len(code) != 0 { 223 errorCode = restjson.SanitizeErrorCode(code) 224 } 225 226 var buff [1024]byte 227 ringBuffer := smithyio.NewRingBuffer(buff[:]) 228 229 body := io.TeeReader(errorBody, ringBuffer) 230 decoder := json.NewDecoder(body) 231 decoder.UseNumber() 232 code, message, err := restjson.GetErrorInfo(decoder) 233 if err != nil { 234 var snapshot bytes.Buffer 235 io.Copy(&snapshot, ringBuffer) 236 err = &smithy.DeserializationError{ 237 Err: fmt.Errorf("failed to decode response body, %w", err), 238 Snapshot: snapshot.Bytes(), 239 } 240 return err 241 } 242 243 errorBody.Seek(0, io.SeekStart) 244 if len(code) != 0 { 245 errorCode = restjson.SanitizeErrorCode(code) 246 } 247 if len(message) != 0 { 248 errorMessage = message 249 } 250 251 switch { 252 case strings.EqualFold("BaseException", errorCode): 253 return awsRestjson1_deserializeErrorBaseException(response, errorBody) 254 255 case strings.EqualFold("InternalException", errorCode): 256 return awsRestjson1_deserializeErrorInternalException(response, errorBody) 257 258 case strings.EqualFold("LimitExceededException", errorCode): 259 return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) 260 261 case strings.EqualFold("ValidationException", errorCode): 262 return awsRestjson1_deserializeErrorValidationException(response, errorBody) 263 264 default: 265 genericError := &smithy.GenericAPIError{ 266 Code: errorCode, 267 Message: errorMessage, 268 } 269 return genericError 270 271 } 272} 273 274type awsRestjson1_deserializeOpAssociatePackage struct { 275} 276 277func (*awsRestjson1_deserializeOpAssociatePackage) ID() string { 278 return "OperationDeserializer" 279} 280 281func (m *awsRestjson1_deserializeOpAssociatePackage) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 282 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 283) { 284 out, metadata, err = next.HandleDeserialize(ctx, in) 285 if err != nil { 286 return out, metadata, err 287 } 288 289 response, ok := out.RawResponse.(*smithyhttp.Response) 290 if !ok { 291 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 292 } 293 294 if response.StatusCode < 200 || response.StatusCode >= 300 { 295 return out, metadata, awsRestjson1_deserializeOpErrorAssociatePackage(response, &metadata) 296 } 297 output := &AssociatePackageOutput{} 298 out.Result = output 299 300 var buff [1024]byte 301 ringBuffer := smithyio.NewRingBuffer(buff[:]) 302 303 body := io.TeeReader(response.Body, ringBuffer) 304 305 decoder := json.NewDecoder(body) 306 decoder.UseNumber() 307 var shape interface{} 308 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 309 var snapshot bytes.Buffer 310 io.Copy(&snapshot, ringBuffer) 311 err = &smithy.DeserializationError{ 312 Err: fmt.Errorf("failed to decode response body, %w", err), 313 Snapshot: snapshot.Bytes(), 314 } 315 return out, metadata, err 316 } 317 318 err = awsRestjson1_deserializeOpDocumentAssociatePackageOutput(&output, shape) 319 if err != nil { 320 var snapshot bytes.Buffer 321 io.Copy(&snapshot, ringBuffer) 322 return out, metadata, &smithy.DeserializationError{ 323 Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), 324 Snapshot: snapshot.Bytes(), 325 } 326 } 327 328 return out, metadata, err 329} 330 331func awsRestjson1_deserializeOpErrorAssociatePackage(response *smithyhttp.Response, metadata *middleware.Metadata) error { 332 var errorBuffer bytes.Buffer 333 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 334 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 335 } 336 errorBody := bytes.NewReader(errorBuffer.Bytes()) 337 338 errorCode := "UnknownError" 339 errorMessage := errorCode 340 341 code := response.Header.Get("X-Amzn-ErrorType") 342 if len(code) != 0 { 343 errorCode = restjson.SanitizeErrorCode(code) 344 } 345 346 var buff [1024]byte 347 ringBuffer := smithyio.NewRingBuffer(buff[:]) 348 349 body := io.TeeReader(errorBody, ringBuffer) 350 decoder := json.NewDecoder(body) 351 decoder.UseNumber() 352 code, message, err := restjson.GetErrorInfo(decoder) 353 if err != nil { 354 var snapshot bytes.Buffer 355 io.Copy(&snapshot, ringBuffer) 356 err = &smithy.DeserializationError{ 357 Err: fmt.Errorf("failed to decode response body, %w", err), 358 Snapshot: snapshot.Bytes(), 359 } 360 return err 361 } 362 363 errorBody.Seek(0, io.SeekStart) 364 if len(code) != 0 { 365 errorCode = restjson.SanitizeErrorCode(code) 366 } 367 if len(message) != 0 { 368 errorMessage = message 369 } 370 371 switch { 372 case strings.EqualFold("AccessDeniedException", errorCode): 373 return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) 374 375 case strings.EqualFold("BaseException", errorCode): 376 return awsRestjson1_deserializeErrorBaseException(response, errorBody) 377 378 case strings.EqualFold("ConflictException", errorCode): 379 return awsRestjson1_deserializeErrorConflictException(response, errorBody) 380 381 case strings.EqualFold("InternalException", errorCode): 382 return awsRestjson1_deserializeErrorInternalException(response, errorBody) 383 384 case strings.EqualFold("ResourceNotFoundException", errorCode): 385 return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) 386 387 case strings.EqualFold("ValidationException", errorCode): 388 return awsRestjson1_deserializeErrorValidationException(response, errorBody) 389 390 default: 391 genericError := &smithy.GenericAPIError{ 392 Code: errorCode, 393 Message: errorMessage, 394 } 395 return genericError 396 397 } 398} 399 400func awsRestjson1_deserializeOpDocumentAssociatePackageOutput(v **AssociatePackageOutput, value interface{}) error { 401 if v == nil { 402 return fmt.Errorf("unexpected nil of type %T", v) 403 } 404 if value == nil { 405 return nil 406 } 407 408 shape, ok := value.(map[string]interface{}) 409 if !ok { 410 return fmt.Errorf("unexpected JSON type %v", value) 411 } 412 413 var sv *AssociatePackageOutput 414 if *v == nil { 415 sv = &AssociatePackageOutput{} 416 } else { 417 sv = *v 418 } 419 420 for key, value := range shape { 421 switch key { 422 case "DomainPackageDetails": 423 if err := awsRestjson1_deserializeDocumentDomainPackageDetails(&sv.DomainPackageDetails, value); err != nil { 424 return err 425 } 426 427 default: 428 _, _ = key, value 429 430 } 431 } 432 *v = sv 433 return nil 434} 435 436type awsRestjson1_deserializeOpCancelElasticsearchServiceSoftwareUpdate struct { 437} 438 439func (*awsRestjson1_deserializeOpCancelElasticsearchServiceSoftwareUpdate) ID() string { 440 return "OperationDeserializer" 441} 442 443func (m *awsRestjson1_deserializeOpCancelElasticsearchServiceSoftwareUpdate) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 444 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 445) { 446 out, metadata, err = next.HandleDeserialize(ctx, in) 447 if err != nil { 448 return out, metadata, err 449 } 450 451 response, ok := out.RawResponse.(*smithyhttp.Response) 452 if !ok { 453 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 454 } 455 456 if response.StatusCode < 200 || response.StatusCode >= 300 { 457 return out, metadata, awsRestjson1_deserializeOpErrorCancelElasticsearchServiceSoftwareUpdate(response, &metadata) 458 } 459 output := &CancelElasticsearchServiceSoftwareUpdateOutput{} 460 out.Result = output 461 462 var buff [1024]byte 463 ringBuffer := smithyio.NewRingBuffer(buff[:]) 464 465 body := io.TeeReader(response.Body, ringBuffer) 466 467 decoder := json.NewDecoder(body) 468 decoder.UseNumber() 469 var shape interface{} 470 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 471 var snapshot bytes.Buffer 472 io.Copy(&snapshot, ringBuffer) 473 err = &smithy.DeserializationError{ 474 Err: fmt.Errorf("failed to decode response body, %w", err), 475 Snapshot: snapshot.Bytes(), 476 } 477 return out, metadata, err 478 } 479 480 err = awsRestjson1_deserializeOpDocumentCancelElasticsearchServiceSoftwareUpdateOutput(&output, shape) 481 if err != nil { 482 var snapshot bytes.Buffer 483 io.Copy(&snapshot, ringBuffer) 484 return out, metadata, &smithy.DeserializationError{ 485 Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), 486 Snapshot: snapshot.Bytes(), 487 } 488 } 489 490 return out, metadata, err 491} 492 493func awsRestjson1_deserializeOpErrorCancelElasticsearchServiceSoftwareUpdate(response *smithyhttp.Response, metadata *middleware.Metadata) error { 494 var errorBuffer bytes.Buffer 495 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 496 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 497 } 498 errorBody := bytes.NewReader(errorBuffer.Bytes()) 499 500 errorCode := "UnknownError" 501 errorMessage := errorCode 502 503 code := response.Header.Get("X-Amzn-ErrorType") 504 if len(code) != 0 { 505 errorCode = restjson.SanitizeErrorCode(code) 506 } 507 508 var buff [1024]byte 509 ringBuffer := smithyio.NewRingBuffer(buff[:]) 510 511 body := io.TeeReader(errorBody, ringBuffer) 512 decoder := json.NewDecoder(body) 513 decoder.UseNumber() 514 code, message, err := restjson.GetErrorInfo(decoder) 515 if err != nil { 516 var snapshot bytes.Buffer 517 io.Copy(&snapshot, ringBuffer) 518 err = &smithy.DeserializationError{ 519 Err: fmt.Errorf("failed to decode response body, %w", err), 520 Snapshot: snapshot.Bytes(), 521 } 522 return err 523 } 524 525 errorBody.Seek(0, io.SeekStart) 526 if len(code) != 0 { 527 errorCode = restjson.SanitizeErrorCode(code) 528 } 529 if len(message) != 0 { 530 errorMessage = message 531 } 532 533 switch { 534 case strings.EqualFold("BaseException", errorCode): 535 return awsRestjson1_deserializeErrorBaseException(response, errorBody) 536 537 case strings.EqualFold("InternalException", errorCode): 538 return awsRestjson1_deserializeErrorInternalException(response, errorBody) 539 540 case strings.EqualFold("ResourceNotFoundException", errorCode): 541 return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) 542 543 case strings.EqualFold("ValidationException", errorCode): 544 return awsRestjson1_deserializeErrorValidationException(response, errorBody) 545 546 default: 547 genericError := &smithy.GenericAPIError{ 548 Code: errorCode, 549 Message: errorMessage, 550 } 551 return genericError 552 553 } 554} 555 556func awsRestjson1_deserializeOpDocumentCancelElasticsearchServiceSoftwareUpdateOutput(v **CancelElasticsearchServiceSoftwareUpdateOutput, value interface{}) error { 557 if v == nil { 558 return fmt.Errorf("unexpected nil of type %T", v) 559 } 560 if value == nil { 561 return nil 562 } 563 564 shape, ok := value.(map[string]interface{}) 565 if !ok { 566 return fmt.Errorf("unexpected JSON type %v", value) 567 } 568 569 var sv *CancelElasticsearchServiceSoftwareUpdateOutput 570 if *v == nil { 571 sv = &CancelElasticsearchServiceSoftwareUpdateOutput{} 572 } else { 573 sv = *v 574 } 575 576 for key, value := range shape { 577 switch key { 578 case "ServiceSoftwareOptions": 579 if err := awsRestjson1_deserializeDocumentServiceSoftwareOptions(&sv.ServiceSoftwareOptions, value); err != nil { 580 return err 581 } 582 583 default: 584 _, _ = key, value 585 586 } 587 } 588 *v = sv 589 return nil 590} 591 592type awsRestjson1_deserializeOpCreateElasticsearchDomain struct { 593} 594 595func (*awsRestjson1_deserializeOpCreateElasticsearchDomain) ID() string { 596 return "OperationDeserializer" 597} 598 599func (m *awsRestjson1_deserializeOpCreateElasticsearchDomain) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 600 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 601) { 602 out, metadata, err = next.HandleDeserialize(ctx, in) 603 if err != nil { 604 return out, metadata, err 605 } 606 607 response, ok := out.RawResponse.(*smithyhttp.Response) 608 if !ok { 609 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 610 } 611 612 if response.StatusCode < 200 || response.StatusCode >= 300 { 613 return out, metadata, awsRestjson1_deserializeOpErrorCreateElasticsearchDomain(response, &metadata) 614 } 615 output := &CreateElasticsearchDomainOutput{} 616 out.Result = output 617 618 var buff [1024]byte 619 ringBuffer := smithyio.NewRingBuffer(buff[:]) 620 621 body := io.TeeReader(response.Body, ringBuffer) 622 623 decoder := json.NewDecoder(body) 624 decoder.UseNumber() 625 var shape interface{} 626 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 627 var snapshot bytes.Buffer 628 io.Copy(&snapshot, ringBuffer) 629 err = &smithy.DeserializationError{ 630 Err: fmt.Errorf("failed to decode response body, %w", err), 631 Snapshot: snapshot.Bytes(), 632 } 633 return out, metadata, err 634 } 635 636 err = awsRestjson1_deserializeOpDocumentCreateElasticsearchDomainOutput(&output, shape) 637 if err != nil { 638 var snapshot bytes.Buffer 639 io.Copy(&snapshot, ringBuffer) 640 return out, metadata, &smithy.DeserializationError{ 641 Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), 642 Snapshot: snapshot.Bytes(), 643 } 644 } 645 646 return out, metadata, err 647} 648 649func awsRestjson1_deserializeOpErrorCreateElasticsearchDomain(response *smithyhttp.Response, metadata *middleware.Metadata) error { 650 var errorBuffer bytes.Buffer 651 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 652 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 653 } 654 errorBody := bytes.NewReader(errorBuffer.Bytes()) 655 656 errorCode := "UnknownError" 657 errorMessage := errorCode 658 659 code := response.Header.Get("X-Amzn-ErrorType") 660 if len(code) != 0 { 661 errorCode = restjson.SanitizeErrorCode(code) 662 } 663 664 var buff [1024]byte 665 ringBuffer := smithyio.NewRingBuffer(buff[:]) 666 667 body := io.TeeReader(errorBody, ringBuffer) 668 decoder := json.NewDecoder(body) 669 decoder.UseNumber() 670 code, message, err := restjson.GetErrorInfo(decoder) 671 if err != nil { 672 var snapshot bytes.Buffer 673 io.Copy(&snapshot, ringBuffer) 674 err = &smithy.DeserializationError{ 675 Err: fmt.Errorf("failed to decode response body, %w", err), 676 Snapshot: snapshot.Bytes(), 677 } 678 return err 679 } 680 681 errorBody.Seek(0, io.SeekStart) 682 if len(code) != 0 { 683 errorCode = restjson.SanitizeErrorCode(code) 684 } 685 if len(message) != 0 { 686 errorMessage = message 687 } 688 689 switch { 690 case strings.EqualFold("BaseException", errorCode): 691 return awsRestjson1_deserializeErrorBaseException(response, errorBody) 692 693 case strings.EqualFold("DisabledOperationException", errorCode): 694 return awsRestjson1_deserializeErrorDisabledOperationException(response, errorBody) 695 696 case strings.EqualFold("InternalException", errorCode): 697 return awsRestjson1_deserializeErrorInternalException(response, errorBody) 698 699 case strings.EqualFold("InvalidTypeException", errorCode): 700 return awsRestjson1_deserializeErrorInvalidTypeException(response, errorBody) 701 702 case strings.EqualFold("LimitExceededException", errorCode): 703 return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) 704 705 case strings.EqualFold("ResourceAlreadyExistsException", errorCode): 706 return awsRestjson1_deserializeErrorResourceAlreadyExistsException(response, errorBody) 707 708 case strings.EqualFold("ValidationException", errorCode): 709 return awsRestjson1_deserializeErrorValidationException(response, errorBody) 710 711 default: 712 genericError := &smithy.GenericAPIError{ 713 Code: errorCode, 714 Message: errorMessage, 715 } 716 return genericError 717 718 } 719} 720 721func awsRestjson1_deserializeOpDocumentCreateElasticsearchDomainOutput(v **CreateElasticsearchDomainOutput, value interface{}) error { 722 if v == nil { 723 return fmt.Errorf("unexpected nil of type %T", v) 724 } 725 if value == nil { 726 return nil 727 } 728 729 shape, ok := value.(map[string]interface{}) 730 if !ok { 731 return fmt.Errorf("unexpected JSON type %v", value) 732 } 733 734 var sv *CreateElasticsearchDomainOutput 735 if *v == nil { 736 sv = &CreateElasticsearchDomainOutput{} 737 } else { 738 sv = *v 739 } 740 741 for key, value := range shape { 742 switch key { 743 case "DomainStatus": 744 if err := awsRestjson1_deserializeDocumentElasticsearchDomainStatus(&sv.DomainStatus, value); err != nil { 745 return err 746 } 747 748 default: 749 _, _ = key, value 750 751 } 752 } 753 *v = sv 754 return nil 755} 756 757type awsRestjson1_deserializeOpCreateOutboundCrossClusterSearchConnection struct { 758} 759 760func (*awsRestjson1_deserializeOpCreateOutboundCrossClusterSearchConnection) ID() string { 761 return "OperationDeserializer" 762} 763 764func (m *awsRestjson1_deserializeOpCreateOutboundCrossClusterSearchConnection) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 765 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 766) { 767 out, metadata, err = next.HandleDeserialize(ctx, in) 768 if err != nil { 769 return out, metadata, err 770 } 771 772 response, ok := out.RawResponse.(*smithyhttp.Response) 773 if !ok { 774 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 775 } 776 777 if response.StatusCode < 200 || response.StatusCode >= 300 { 778 return out, metadata, awsRestjson1_deserializeOpErrorCreateOutboundCrossClusterSearchConnection(response, &metadata) 779 } 780 output := &CreateOutboundCrossClusterSearchConnectionOutput{} 781 out.Result = output 782 783 var buff [1024]byte 784 ringBuffer := smithyio.NewRingBuffer(buff[:]) 785 786 body := io.TeeReader(response.Body, ringBuffer) 787 788 decoder := json.NewDecoder(body) 789 decoder.UseNumber() 790 var shape interface{} 791 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 792 var snapshot bytes.Buffer 793 io.Copy(&snapshot, ringBuffer) 794 err = &smithy.DeserializationError{ 795 Err: fmt.Errorf("failed to decode response body, %w", err), 796 Snapshot: snapshot.Bytes(), 797 } 798 return out, metadata, err 799 } 800 801 err = awsRestjson1_deserializeOpDocumentCreateOutboundCrossClusterSearchConnectionOutput(&output, shape) 802 if err != nil { 803 var snapshot bytes.Buffer 804 io.Copy(&snapshot, ringBuffer) 805 return out, metadata, &smithy.DeserializationError{ 806 Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), 807 Snapshot: snapshot.Bytes(), 808 } 809 } 810 811 return out, metadata, err 812} 813 814func awsRestjson1_deserializeOpErrorCreateOutboundCrossClusterSearchConnection(response *smithyhttp.Response, metadata *middleware.Metadata) error { 815 var errorBuffer bytes.Buffer 816 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 817 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 818 } 819 errorBody := bytes.NewReader(errorBuffer.Bytes()) 820 821 errorCode := "UnknownError" 822 errorMessage := errorCode 823 824 code := response.Header.Get("X-Amzn-ErrorType") 825 if len(code) != 0 { 826 errorCode = restjson.SanitizeErrorCode(code) 827 } 828 829 var buff [1024]byte 830 ringBuffer := smithyio.NewRingBuffer(buff[:]) 831 832 body := io.TeeReader(errorBody, ringBuffer) 833 decoder := json.NewDecoder(body) 834 decoder.UseNumber() 835 code, message, err := restjson.GetErrorInfo(decoder) 836 if err != nil { 837 var snapshot bytes.Buffer 838 io.Copy(&snapshot, ringBuffer) 839 err = &smithy.DeserializationError{ 840 Err: fmt.Errorf("failed to decode response body, %w", err), 841 Snapshot: snapshot.Bytes(), 842 } 843 return err 844 } 845 846 errorBody.Seek(0, io.SeekStart) 847 if len(code) != 0 { 848 errorCode = restjson.SanitizeErrorCode(code) 849 } 850 if len(message) != 0 { 851 errorMessage = message 852 } 853 854 switch { 855 case strings.EqualFold("DisabledOperationException", errorCode): 856 return awsRestjson1_deserializeErrorDisabledOperationException(response, errorBody) 857 858 case strings.EqualFold("InternalException", errorCode): 859 return awsRestjson1_deserializeErrorInternalException(response, errorBody) 860 861 case strings.EqualFold("LimitExceededException", errorCode): 862 return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) 863 864 case strings.EqualFold("ResourceAlreadyExistsException", errorCode): 865 return awsRestjson1_deserializeErrorResourceAlreadyExistsException(response, errorBody) 866 867 default: 868 genericError := &smithy.GenericAPIError{ 869 Code: errorCode, 870 Message: errorMessage, 871 } 872 return genericError 873 874 } 875} 876 877func awsRestjson1_deserializeOpDocumentCreateOutboundCrossClusterSearchConnectionOutput(v **CreateOutboundCrossClusterSearchConnectionOutput, value interface{}) error { 878 if v == nil { 879 return fmt.Errorf("unexpected nil of type %T", v) 880 } 881 if value == nil { 882 return nil 883 } 884 885 shape, ok := value.(map[string]interface{}) 886 if !ok { 887 return fmt.Errorf("unexpected JSON type %v", value) 888 } 889 890 var sv *CreateOutboundCrossClusterSearchConnectionOutput 891 if *v == nil { 892 sv = &CreateOutboundCrossClusterSearchConnectionOutput{} 893 } else { 894 sv = *v 895 } 896 897 for key, value := range shape { 898 switch key { 899 case "ConnectionAlias": 900 if value != nil { 901 jtv, ok := value.(string) 902 if !ok { 903 return fmt.Errorf("expected ConnectionAlias to be of type string, got %T instead", value) 904 } 905 sv.ConnectionAlias = ptr.String(jtv) 906 } 907 908 case "ConnectionStatus": 909 if err := awsRestjson1_deserializeDocumentOutboundCrossClusterSearchConnectionStatus(&sv.ConnectionStatus, value); err != nil { 910 return err 911 } 912 913 case "CrossClusterSearchConnectionId": 914 if value != nil { 915 jtv, ok := value.(string) 916 if !ok { 917 return fmt.Errorf("expected CrossClusterSearchConnectionId to be of type string, got %T instead", value) 918 } 919 sv.CrossClusterSearchConnectionId = ptr.String(jtv) 920 } 921 922 case "DestinationDomainInfo": 923 if err := awsRestjson1_deserializeDocumentDomainInformation(&sv.DestinationDomainInfo, value); err != nil { 924 return err 925 } 926 927 case "SourceDomainInfo": 928 if err := awsRestjson1_deserializeDocumentDomainInformation(&sv.SourceDomainInfo, value); err != nil { 929 return err 930 } 931 932 default: 933 _, _ = key, value 934 935 } 936 } 937 *v = sv 938 return nil 939} 940 941type awsRestjson1_deserializeOpCreatePackage struct { 942} 943 944func (*awsRestjson1_deserializeOpCreatePackage) ID() string { 945 return "OperationDeserializer" 946} 947 948func (m *awsRestjson1_deserializeOpCreatePackage) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 949 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 950) { 951 out, metadata, err = next.HandleDeserialize(ctx, in) 952 if err != nil { 953 return out, metadata, err 954 } 955 956 response, ok := out.RawResponse.(*smithyhttp.Response) 957 if !ok { 958 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 959 } 960 961 if response.StatusCode < 200 || response.StatusCode >= 300 { 962 return out, metadata, awsRestjson1_deserializeOpErrorCreatePackage(response, &metadata) 963 } 964 output := &CreatePackageOutput{} 965 out.Result = output 966 967 var buff [1024]byte 968 ringBuffer := smithyio.NewRingBuffer(buff[:]) 969 970 body := io.TeeReader(response.Body, ringBuffer) 971 972 decoder := json.NewDecoder(body) 973 decoder.UseNumber() 974 var shape interface{} 975 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 976 var snapshot bytes.Buffer 977 io.Copy(&snapshot, ringBuffer) 978 err = &smithy.DeserializationError{ 979 Err: fmt.Errorf("failed to decode response body, %w", err), 980 Snapshot: snapshot.Bytes(), 981 } 982 return out, metadata, err 983 } 984 985 err = awsRestjson1_deserializeOpDocumentCreatePackageOutput(&output, shape) 986 if err != nil { 987 var snapshot bytes.Buffer 988 io.Copy(&snapshot, ringBuffer) 989 return out, metadata, &smithy.DeserializationError{ 990 Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), 991 Snapshot: snapshot.Bytes(), 992 } 993 } 994 995 return out, metadata, err 996} 997 998func awsRestjson1_deserializeOpErrorCreatePackage(response *smithyhttp.Response, metadata *middleware.Metadata) error { 999 var errorBuffer bytes.Buffer 1000 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 1001 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 1002 } 1003 errorBody := bytes.NewReader(errorBuffer.Bytes()) 1004 1005 errorCode := "UnknownError" 1006 errorMessage := errorCode 1007 1008 code := response.Header.Get("X-Amzn-ErrorType") 1009 if len(code) != 0 { 1010 errorCode = restjson.SanitizeErrorCode(code) 1011 } 1012 1013 var buff [1024]byte 1014 ringBuffer := smithyio.NewRingBuffer(buff[:]) 1015 1016 body := io.TeeReader(errorBody, ringBuffer) 1017 decoder := json.NewDecoder(body) 1018 decoder.UseNumber() 1019 code, message, err := restjson.GetErrorInfo(decoder) 1020 if err != nil { 1021 var snapshot bytes.Buffer 1022 io.Copy(&snapshot, ringBuffer) 1023 err = &smithy.DeserializationError{ 1024 Err: fmt.Errorf("failed to decode response body, %w", err), 1025 Snapshot: snapshot.Bytes(), 1026 } 1027 return err 1028 } 1029 1030 errorBody.Seek(0, io.SeekStart) 1031 if len(code) != 0 { 1032 errorCode = restjson.SanitizeErrorCode(code) 1033 } 1034 if len(message) != 0 { 1035 errorMessage = message 1036 } 1037 1038 switch { 1039 case strings.EqualFold("AccessDeniedException", errorCode): 1040 return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) 1041 1042 case strings.EqualFold("BaseException", errorCode): 1043 return awsRestjson1_deserializeErrorBaseException(response, errorBody) 1044 1045 case strings.EqualFold("InternalException", errorCode): 1046 return awsRestjson1_deserializeErrorInternalException(response, errorBody) 1047 1048 case strings.EqualFold("InvalidTypeException", errorCode): 1049 return awsRestjson1_deserializeErrorInvalidTypeException(response, errorBody) 1050 1051 case strings.EqualFold("LimitExceededException", errorCode): 1052 return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) 1053 1054 case strings.EqualFold("ResourceAlreadyExistsException", errorCode): 1055 return awsRestjson1_deserializeErrorResourceAlreadyExistsException(response, errorBody) 1056 1057 case strings.EqualFold("ValidationException", errorCode): 1058 return awsRestjson1_deserializeErrorValidationException(response, errorBody) 1059 1060 default: 1061 genericError := &smithy.GenericAPIError{ 1062 Code: errorCode, 1063 Message: errorMessage, 1064 } 1065 return genericError 1066 1067 } 1068} 1069 1070func awsRestjson1_deserializeOpDocumentCreatePackageOutput(v **CreatePackageOutput, value interface{}) error { 1071 if v == nil { 1072 return fmt.Errorf("unexpected nil of type %T", v) 1073 } 1074 if value == nil { 1075 return nil 1076 } 1077 1078 shape, ok := value.(map[string]interface{}) 1079 if !ok { 1080 return fmt.Errorf("unexpected JSON type %v", value) 1081 } 1082 1083 var sv *CreatePackageOutput 1084 if *v == nil { 1085 sv = &CreatePackageOutput{} 1086 } else { 1087 sv = *v 1088 } 1089 1090 for key, value := range shape { 1091 switch key { 1092 case "PackageDetails": 1093 if err := awsRestjson1_deserializeDocumentPackageDetails(&sv.PackageDetails, value); err != nil { 1094 return err 1095 } 1096 1097 default: 1098 _, _ = key, value 1099 1100 } 1101 } 1102 *v = sv 1103 return nil 1104} 1105 1106type awsRestjson1_deserializeOpDeleteElasticsearchDomain struct { 1107} 1108 1109func (*awsRestjson1_deserializeOpDeleteElasticsearchDomain) ID() string { 1110 return "OperationDeserializer" 1111} 1112 1113func (m *awsRestjson1_deserializeOpDeleteElasticsearchDomain) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 1114 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 1115) { 1116 out, metadata, err = next.HandleDeserialize(ctx, in) 1117 if err != nil { 1118 return out, metadata, err 1119 } 1120 1121 response, ok := out.RawResponse.(*smithyhttp.Response) 1122 if !ok { 1123 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 1124 } 1125 1126 if response.StatusCode < 200 || response.StatusCode >= 300 { 1127 return out, metadata, awsRestjson1_deserializeOpErrorDeleteElasticsearchDomain(response, &metadata) 1128 } 1129 output := &DeleteElasticsearchDomainOutput{} 1130 out.Result = output 1131 1132 var buff [1024]byte 1133 ringBuffer := smithyio.NewRingBuffer(buff[:]) 1134 1135 body := io.TeeReader(response.Body, ringBuffer) 1136 1137 decoder := json.NewDecoder(body) 1138 decoder.UseNumber() 1139 var shape interface{} 1140 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 1141 var snapshot bytes.Buffer 1142 io.Copy(&snapshot, ringBuffer) 1143 err = &smithy.DeserializationError{ 1144 Err: fmt.Errorf("failed to decode response body, %w", err), 1145 Snapshot: snapshot.Bytes(), 1146 } 1147 return out, metadata, err 1148 } 1149 1150 err = awsRestjson1_deserializeOpDocumentDeleteElasticsearchDomainOutput(&output, shape) 1151 if err != nil { 1152 var snapshot bytes.Buffer 1153 io.Copy(&snapshot, ringBuffer) 1154 return out, metadata, &smithy.DeserializationError{ 1155 Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), 1156 Snapshot: snapshot.Bytes(), 1157 } 1158 } 1159 1160 return out, metadata, err 1161} 1162 1163func awsRestjson1_deserializeOpErrorDeleteElasticsearchDomain(response *smithyhttp.Response, metadata *middleware.Metadata) error { 1164 var errorBuffer bytes.Buffer 1165 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 1166 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 1167 } 1168 errorBody := bytes.NewReader(errorBuffer.Bytes()) 1169 1170 errorCode := "UnknownError" 1171 errorMessage := errorCode 1172 1173 code := response.Header.Get("X-Amzn-ErrorType") 1174 if len(code) != 0 { 1175 errorCode = restjson.SanitizeErrorCode(code) 1176 } 1177 1178 var buff [1024]byte 1179 ringBuffer := smithyio.NewRingBuffer(buff[:]) 1180 1181 body := io.TeeReader(errorBody, ringBuffer) 1182 decoder := json.NewDecoder(body) 1183 decoder.UseNumber() 1184 code, message, err := restjson.GetErrorInfo(decoder) 1185 if err != nil { 1186 var snapshot bytes.Buffer 1187 io.Copy(&snapshot, ringBuffer) 1188 err = &smithy.DeserializationError{ 1189 Err: fmt.Errorf("failed to decode response body, %w", err), 1190 Snapshot: snapshot.Bytes(), 1191 } 1192 return err 1193 } 1194 1195 errorBody.Seek(0, io.SeekStart) 1196 if len(code) != 0 { 1197 errorCode = restjson.SanitizeErrorCode(code) 1198 } 1199 if len(message) != 0 { 1200 errorMessage = message 1201 } 1202 1203 switch { 1204 case strings.EqualFold("BaseException", errorCode): 1205 return awsRestjson1_deserializeErrorBaseException(response, errorBody) 1206 1207 case strings.EqualFold("InternalException", errorCode): 1208 return awsRestjson1_deserializeErrorInternalException(response, errorBody) 1209 1210 case strings.EqualFold("ResourceNotFoundException", errorCode): 1211 return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) 1212 1213 case strings.EqualFold("ValidationException", errorCode): 1214 return awsRestjson1_deserializeErrorValidationException(response, errorBody) 1215 1216 default: 1217 genericError := &smithy.GenericAPIError{ 1218 Code: errorCode, 1219 Message: errorMessage, 1220 } 1221 return genericError 1222 1223 } 1224} 1225 1226func awsRestjson1_deserializeOpDocumentDeleteElasticsearchDomainOutput(v **DeleteElasticsearchDomainOutput, value interface{}) error { 1227 if v == nil { 1228 return fmt.Errorf("unexpected nil of type %T", v) 1229 } 1230 if value == nil { 1231 return nil 1232 } 1233 1234 shape, ok := value.(map[string]interface{}) 1235 if !ok { 1236 return fmt.Errorf("unexpected JSON type %v", value) 1237 } 1238 1239 var sv *DeleteElasticsearchDomainOutput 1240 if *v == nil { 1241 sv = &DeleteElasticsearchDomainOutput{} 1242 } else { 1243 sv = *v 1244 } 1245 1246 for key, value := range shape { 1247 switch key { 1248 case "DomainStatus": 1249 if err := awsRestjson1_deserializeDocumentElasticsearchDomainStatus(&sv.DomainStatus, value); err != nil { 1250 return err 1251 } 1252 1253 default: 1254 _, _ = key, value 1255 1256 } 1257 } 1258 *v = sv 1259 return nil 1260} 1261 1262type awsRestjson1_deserializeOpDeleteElasticsearchServiceRole struct { 1263} 1264 1265func (*awsRestjson1_deserializeOpDeleteElasticsearchServiceRole) ID() string { 1266 return "OperationDeserializer" 1267} 1268 1269func (m *awsRestjson1_deserializeOpDeleteElasticsearchServiceRole) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 1270 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 1271) { 1272 out, metadata, err = next.HandleDeserialize(ctx, in) 1273 if err != nil { 1274 return out, metadata, err 1275 } 1276 1277 response, ok := out.RawResponse.(*smithyhttp.Response) 1278 if !ok { 1279 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 1280 } 1281 1282 if response.StatusCode < 200 || response.StatusCode >= 300 { 1283 return out, metadata, awsRestjson1_deserializeOpErrorDeleteElasticsearchServiceRole(response, &metadata) 1284 } 1285 output := &DeleteElasticsearchServiceRoleOutput{} 1286 out.Result = output 1287 1288 if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { 1289 return out, metadata, &smithy.DeserializationError{ 1290 Err: fmt.Errorf("failed to discard response body, %w", err), 1291 } 1292 } 1293 1294 return out, metadata, err 1295} 1296 1297func awsRestjson1_deserializeOpErrorDeleteElasticsearchServiceRole(response *smithyhttp.Response, metadata *middleware.Metadata) error { 1298 var errorBuffer bytes.Buffer 1299 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 1300 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 1301 } 1302 errorBody := bytes.NewReader(errorBuffer.Bytes()) 1303 1304 errorCode := "UnknownError" 1305 errorMessage := errorCode 1306 1307 code := response.Header.Get("X-Amzn-ErrorType") 1308 if len(code) != 0 { 1309 errorCode = restjson.SanitizeErrorCode(code) 1310 } 1311 1312 var buff [1024]byte 1313 ringBuffer := smithyio.NewRingBuffer(buff[:]) 1314 1315 body := io.TeeReader(errorBody, ringBuffer) 1316 decoder := json.NewDecoder(body) 1317 decoder.UseNumber() 1318 code, message, err := restjson.GetErrorInfo(decoder) 1319 if err != nil { 1320 var snapshot bytes.Buffer 1321 io.Copy(&snapshot, ringBuffer) 1322 err = &smithy.DeserializationError{ 1323 Err: fmt.Errorf("failed to decode response body, %w", err), 1324 Snapshot: snapshot.Bytes(), 1325 } 1326 return err 1327 } 1328 1329 errorBody.Seek(0, io.SeekStart) 1330 if len(code) != 0 { 1331 errorCode = restjson.SanitizeErrorCode(code) 1332 } 1333 if len(message) != 0 { 1334 errorMessage = message 1335 } 1336 1337 switch { 1338 case strings.EqualFold("BaseException", errorCode): 1339 return awsRestjson1_deserializeErrorBaseException(response, errorBody) 1340 1341 case strings.EqualFold("InternalException", errorCode): 1342 return awsRestjson1_deserializeErrorInternalException(response, errorBody) 1343 1344 case strings.EqualFold("ValidationException", errorCode): 1345 return awsRestjson1_deserializeErrorValidationException(response, errorBody) 1346 1347 default: 1348 genericError := &smithy.GenericAPIError{ 1349 Code: errorCode, 1350 Message: errorMessage, 1351 } 1352 return genericError 1353 1354 } 1355} 1356 1357type awsRestjson1_deserializeOpDeleteInboundCrossClusterSearchConnection struct { 1358} 1359 1360func (*awsRestjson1_deserializeOpDeleteInboundCrossClusterSearchConnection) ID() string { 1361 return "OperationDeserializer" 1362} 1363 1364func (m *awsRestjson1_deserializeOpDeleteInboundCrossClusterSearchConnection) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 1365 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 1366) { 1367 out, metadata, err = next.HandleDeserialize(ctx, in) 1368 if err != nil { 1369 return out, metadata, err 1370 } 1371 1372 response, ok := out.RawResponse.(*smithyhttp.Response) 1373 if !ok { 1374 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 1375 } 1376 1377 if response.StatusCode < 200 || response.StatusCode >= 300 { 1378 return out, metadata, awsRestjson1_deserializeOpErrorDeleteInboundCrossClusterSearchConnection(response, &metadata) 1379 } 1380 output := &DeleteInboundCrossClusterSearchConnectionOutput{} 1381 out.Result = output 1382 1383 var buff [1024]byte 1384 ringBuffer := smithyio.NewRingBuffer(buff[:]) 1385 1386 body := io.TeeReader(response.Body, ringBuffer) 1387 1388 decoder := json.NewDecoder(body) 1389 decoder.UseNumber() 1390 var shape interface{} 1391 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 1392 var snapshot bytes.Buffer 1393 io.Copy(&snapshot, ringBuffer) 1394 err = &smithy.DeserializationError{ 1395 Err: fmt.Errorf("failed to decode response body, %w", err), 1396 Snapshot: snapshot.Bytes(), 1397 } 1398 return out, metadata, err 1399 } 1400 1401 err = awsRestjson1_deserializeOpDocumentDeleteInboundCrossClusterSearchConnectionOutput(&output, shape) 1402 if err != nil { 1403 var snapshot bytes.Buffer 1404 io.Copy(&snapshot, ringBuffer) 1405 return out, metadata, &smithy.DeserializationError{ 1406 Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), 1407 Snapshot: snapshot.Bytes(), 1408 } 1409 } 1410 1411 return out, metadata, err 1412} 1413 1414func awsRestjson1_deserializeOpErrorDeleteInboundCrossClusterSearchConnection(response *smithyhttp.Response, metadata *middleware.Metadata) error { 1415 var errorBuffer bytes.Buffer 1416 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 1417 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 1418 } 1419 errorBody := bytes.NewReader(errorBuffer.Bytes()) 1420 1421 errorCode := "UnknownError" 1422 errorMessage := errorCode 1423 1424 code := response.Header.Get("X-Amzn-ErrorType") 1425 if len(code) != 0 { 1426 errorCode = restjson.SanitizeErrorCode(code) 1427 } 1428 1429 var buff [1024]byte 1430 ringBuffer := smithyio.NewRingBuffer(buff[:]) 1431 1432 body := io.TeeReader(errorBody, ringBuffer) 1433 decoder := json.NewDecoder(body) 1434 decoder.UseNumber() 1435 code, message, err := restjson.GetErrorInfo(decoder) 1436 if err != nil { 1437 var snapshot bytes.Buffer 1438 io.Copy(&snapshot, ringBuffer) 1439 err = &smithy.DeserializationError{ 1440 Err: fmt.Errorf("failed to decode response body, %w", err), 1441 Snapshot: snapshot.Bytes(), 1442 } 1443 return err 1444 } 1445 1446 errorBody.Seek(0, io.SeekStart) 1447 if len(code) != 0 { 1448 errorCode = restjson.SanitizeErrorCode(code) 1449 } 1450 if len(message) != 0 { 1451 errorMessage = message 1452 } 1453 1454 switch { 1455 case strings.EqualFold("DisabledOperationException", errorCode): 1456 return awsRestjson1_deserializeErrorDisabledOperationException(response, errorBody) 1457 1458 case strings.EqualFold("ResourceNotFoundException", errorCode): 1459 return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) 1460 1461 default: 1462 genericError := &smithy.GenericAPIError{ 1463 Code: errorCode, 1464 Message: errorMessage, 1465 } 1466 return genericError 1467 1468 } 1469} 1470 1471func awsRestjson1_deserializeOpDocumentDeleteInboundCrossClusterSearchConnectionOutput(v **DeleteInboundCrossClusterSearchConnectionOutput, value interface{}) error { 1472 if v == nil { 1473 return fmt.Errorf("unexpected nil of type %T", v) 1474 } 1475 if value == nil { 1476 return nil 1477 } 1478 1479 shape, ok := value.(map[string]interface{}) 1480 if !ok { 1481 return fmt.Errorf("unexpected JSON type %v", value) 1482 } 1483 1484 var sv *DeleteInboundCrossClusterSearchConnectionOutput 1485 if *v == nil { 1486 sv = &DeleteInboundCrossClusterSearchConnectionOutput{} 1487 } else { 1488 sv = *v 1489 } 1490 1491 for key, value := range shape { 1492 switch key { 1493 case "CrossClusterSearchConnection": 1494 if err := awsRestjson1_deserializeDocumentInboundCrossClusterSearchConnection(&sv.CrossClusterSearchConnection, value); err != nil { 1495 return err 1496 } 1497 1498 default: 1499 _, _ = key, value 1500 1501 } 1502 } 1503 *v = sv 1504 return nil 1505} 1506 1507type awsRestjson1_deserializeOpDeleteOutboundCrossClusterSearchConnection struct { 1508} 1509 1510func (*awsRestjson1_deserializeOpDeleteOutboundCrossClusterSearchConnection) ID() string { 1511 return "OperationDeserializer" 1512} 1513 1514func (m *awsRestjson1_deserializeOpDeleteOutboundCrossClusterSearchConnection) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 1515 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 1516) { 1517 out, metadata, err = next.HandleDeserialize(ctx, in) 1518 if err != nil { 1519 return out, metadata, err 1520 } 1521 1522 response, ok := out.RawResponse.(*smithyhttp.Response) 1523 if !ok { 1524 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 1525 } 1526 1527 if response.StatusCode < 200 || response.StatusCode >= 300 { 1528 return out, metadata, awsRestjson1_deserializeOpErrorDeleteOutboundCrossClusterSearchConnection(response, &metadata) 1529 } 1530 output := &DeleteOutboundCrossClusterSearchConnectionOutput{} 1531 out.Result = output 1532 1533 var buff [1024]byte 1534 ringBuffer := smithyio.NewRingBuffer(buff[:]) 1535 1536 body := io.TeeReader(response.Body, ringBuffer) 1537 1538 decoder := json.NewDecoder(body) 1539 decoder.UseNumber() 1540 var shape interface{} 1541 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 1542 var snapshot bytes.Buffer 1543 io.Copy(&snapshot, ringBuffer) 1544 err = &smithy.DeserializationError{ 1545 Err: fmt.Errorf("failed to decode response body, %w", err), 1546 Snapshot: snapshot.Bytes(), 1547 } 1548 return out, metadata, err 1549 } 1550 1551 err = awsRestjson1_deserializeOpDocumentDeleteOutboundCrossClusterSearchConnectionOutput(&output, shape) 1552 if err != nil { 1553 var snapshot bytes.Buffer 1554 io.Copy(&snapshot, ringBuffer) 1555 return out, metadata, &smithy.DeserializationError{ 1556 Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), 1557 Snapshot: snapshot.Bytes(), 1558 } 1559 } 1560 1561 return out, metadata, err 1562} 1563 1564func awsRestjson1_deserializeOpErrorDeleteOutboundCrossClusterSearchConnection(response *smithyhttp.Response, metadata *middleware.Metadata) error { 1565 var errorBuffer bytes.Buffer 1566 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 1567 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 1568 } 1569 errorBody := bytes.NewReader(errorBuffer.Bytes()) 1570 1571 errorCode := "UnknownError" 1572 errorMessage := errorCode 1573 1574 code := response.Header.Get("X-Amzn-ErrorType") 1575 if len(code) != 0 { 1576 errorCode = restjson.SanitizeErrorCode(code) 1577 } 1578 1579 var buff [1024]byte 1580 ringBuffer := smithyio.NewRingBuffer(buff[:]) 1581 1582 body := io.TeeReader(errorBody, ringBuffer) 1583 decoder := json.NewDecoder(body) 1584 decoder.UseNumber() 1585 code, message, err := restjson.GetErrorInfo(decoder) 1586 if err != nil { 1587 var snapshot bytes.Buffer 1588 io.Copy(&snapshot, ringBuffer) 1589 err = &smithy.DeserializationError{ 1590 Err: fmt.Errorf("failed to decode response body, %w", err), 1591 Snapshot: snapshot.Bytes(), 1592 } 1593 return err 1594 } 1595 1596 errorBody.Seek(0, io.SeekStart) 1597 if len(code) != 0 { 1598 errorCode = restjson.SanitizeErrorCode(code) 1599 } 1600 if len(message) != 0 { 1601 errorMessage = message 1602 } 1603 1604 switch { 1605 case strings.EqualFold("DisabledOperationException", errorCode): 1606 return awsRestjson1_deserializeErrorDisabledOperationException(response, errorBody) 1607 1608 case strings.EqualFold("ResourceNotFoundException", errorCode): 1609 return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) 1610 1611 default: 1612 genericError := &smithy.GenericAPIError{ 1613 Code: errorCode, 1614 Message: errorMessage, 1615 } 1616 return genericError 1617 1618 } 1619} 1620 1621func awsRestjson1_deserializeOpDocumentDeleteOutboundCrossClusterSearchConnectionOutput(v **DeleteOutboundCrossClusterSearchConnectionOutput, value interface{}) error { 1622 if v == nil { 1623 return fmt.Errorf("unexpected nil of type %T", v) 1624 } 1625 if value == nil { 1626 return nil 1627 } 1628 1629 shape, ok := value.(map[string]interface{}) 1630 if !ok { 1631 return fmt.Errorf("unexpected JSON type %v", value) 1632 } 1633 1634 var sv *DeleteOutboundCrossClusterSearchConnectionOutput 1635 if *v == nil { 1636 sv = &DeleteOutboundCrossClusterSearchConnectionOutput{} 1637 } else { 1638 sv = *v 1639 } 1640 1641 for key, value := range shape { 1642 switch key { 1643 case "CrossClusterSearchConnection": 1644 if err := awsRestjson1_deserializeDocumentOutboundCrossClusterSearchConnection(&sv.CrossClusterSearchConnection, value); err != nil { 1645 return err 1646 } 1647 1648 default: 1649 _, _ = key, value 1650 1651 } 1652 } 1653 *v = sv 1654 return nil 1655} 1656 1657type awsRestjson1_deserializeOpDeletePackage struct { 1658} 1659 1660func (*awsRestjson1_deserializeOpDeletePackage) ID() string { 1661 return "OperationDeserializer" 1662} 1663 1664func (m *awsRestjson1_deserializeOpDeletePackage) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 1665 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 1666) { 1667 out, metadata, err = next.HandleDeserialize(ctx, in) 1668 if err != nil { 1669 return out, metadata, err 1670 } 1671 1672 response, ok := out.RawResponse.(*smithyhttp.Response) 1673 if !ok { 1674 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 1675 } 1676 1677 if response.StatusCode < 200 || response.StatusCode >= 300 { 1678 return out, metadata, awsRestjson1_deserializeOpErrorDeletePackage(response, &metadata) 1679 } 1680 output := &DeletePackageOutput{} 1681 out.Result = output 1682 1683 var buff [1024]byte 1684 ringBuffer := smithyio.NewRingBuffer(buff[:]) 1685 1686 body := io.TeeReader(response.Body, ringBuffer) 1687 1688 decoder := json.NewDecoder(body) 1689 decoder.UseNumber() 1690 var shape interface{} 1691 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 1692 var snapshot bytes.Buffer 1693 io.Copy(&snapshot, ringBuffer) 1694 err = &smithy.DeserializationError{ 1695 Err: fmt.Errorf("failed to decode response body, %w", err), 1696 Snapshot: snapshot.Bytes(), 1697 } 1698 return out, metadata, err 1699 } 1700 1701 err = awsRestjson1_deserializeOpDocumentDeletePackageOutput(&output, shape) 1702 if err != nil { 1703 var snapshot bytes.Buffer 1704 io.Copy(&snapshot, ringBuffer) 1705 return out, metadata, &smithy.DeserializationError{ 1706 Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), 1707 Snapshot: snapshot.Bytes(), 1708 } 1709 } 1710 1711 return out, metadata, err 1712} 1713 1714func awsRestjson1_deserializeOpErrorDeletePackage(response *smithyhttp.Response, metadata *middleware.Metadata) error { 1715 var errorBuffer bytes.Buffer 1716 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 1717 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 1718 } 1719 errorBody := bytes.NewReader(errorBuffer.Bytes()) 1720 1721 errorCode := "UnknownError" 1722 errorMessage := errorCode 1723 1724 code := response.Header.Get("X-Amzn-ErrorType") 1725 if len(code) != 0 { 1726 errorCode = restjson.SanitizeErrorCode(code) 1727 } 1728 1729 var buff [1024]byte 1730 ringBuffer := smithyio.NewRingBuffer(buff[:]) 1731 1732 body := io.TeeReader(errorBody, ringBuffer) 1733 decoder := json.NewDecoder(body) 1734 decoder.UseNumber() 1735 code, message, err := restjson.GetErrorInfo(decoder) 1736 if err != nil { 1737 var snapshot bytes.Buffer 1738 io.Copy(&snapshot, ringBuffer) 1739 err = &smithy.DeserializationError{ 1740 Err: fmt.Errorf("failed to decode response body, %w", err), 1741 Snapshot: snapshot.Bytes(), 1742 } 1743 return err 1744 } 1745 1746 errorBody.Seek(0, io.SeekStart) 1747 if len(code) != 0 { 1748 errorCode = restjson.SanitizeErrorCode(code) 1749 } 1750 if len(message) != 0 { 1751 errorMessage = message 1752 } 1753 1754 switch { 1755 case strings.EqualFold("AccessDeniedException", errorCode): 1756 return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) 1757 1758 case strings.EqualFold("BaseException", errorCode): 1759 return awsRestjson1_deserializeErrorBaseException(response, errorBody) 1760 1761 case strings.EqualFold("ConflictException", errorCode): 1762 return awsRestjson1_deserializeErrorConflictException(response, errorBody) 1763 1764 case strings.EqualFold("InternalException", errorCode): 1765 return awsRestjson1_deserializeErrorInternalException(response, errorBody) 1766 1767 case strings.EqualFold("ResourceNotFoundException", errorCode): 1768 return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) 1769 1770 case strings.EqualFold("ValidationException", errorCode): 1771 return awsRestjson1_deserializeErrorValidationException(response, errorBody) 1772 1773 default: 1774 genericError := &smithy.GenericAPIError{ 1775 Code: errorCode, 1776 Message: errorMessage, 1777 } 1778 return genericError 1779 1780 } 1781} 1782 1783func awsRestjson1_deserializeOpDocumentDeletePackageOutput(v **DeletePackageOutput, value interface{}) error { 1784 if v == nil { 1785 return fmt.Errorf("unexpected nil of type %T", v) 1786 } 1787 if value == nil { 1788 return nil 1789 } 1790 1791 shape, ok := value.(map[string]interface{}) 1792 if !ok { 1793 return fmt.Errorf("unexpected JSON type %v", value) 1794 } 1795 1796 var sv *DeletePackageOutput 1797 if *v == nil { 1798 sv = &DeletePackageOutput{} 1799 } else { 1800 sv = *v 1801 } 1802 1803 for key, value := range shape { 1804 switch key { 1805 case "PackageDetails": 1806 if err := awsRestjson1_deserializeDocumentPackageDetails(&sv.PackageDetails, value); err != nil { 1807 return err 1808 } 1809 1810 default: 1811 _, _ = key, value 1812 1813 } 1814 } 1815 *v = sv 1816 return nil 1817} 1818 1819type awsRestjson1_deserializeOpDescribeDomainAutoTunes struct { 1820} 1821 1822func (*awsRestjson1_deserializeOpDescribeDomainAutoTunes) ID() string { 1823 return "OperationDeserializer" 1824} 1825 1826func (m *awsRestjson1_deserializeOpDescribeDomainAutoTunes) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 1827 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 1828) { 1829 out, metadata, err = next.HandleDeserialize(ctx, in) 1830 if err != nil { 1831 return out, metadata, err 1832 } 1833 1834 response, ok := out.RawResponse.(*smithyhttp.Response) 1835 if !ok { 1836 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 1837 } 1838 1839 if response.StatusCode < 200 || response.StatusCode >= 300 { 1840 return out, metadata, awsRestjson1_deserializeOpErrorDescribeDomainAutoTunes(response, &metadata) 1841 } 1842 output := &DescribeDomainAutoTunesOutput{} 1843 out.Result = output 1844 1845 var buff [1024]byte 1846 ringBuffer := smithyio.NewRingBuffer(buff[:]) 1847 1848 body := io.TeeReader(response.Body, ringBuffer) 1849 1850 decoder := json.NewDecoder(body) 1851 decoder.UseNumber() 1852 var shape interface{} 1853 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 1854 var snapshot bytes.Buffer 1855 io.Copy(&snapshot, ringBuffer) 1856 err = &smithy.DeserializationError{ 1857 Err: fmt.Errorf("failed to decode response body, %w", err), 1858 Snapshot: snapshot.Bytes(), 1859 } 1860 return out, metadata, err 1861 } 1862 1863 err = awsRestjson1_deserializeOpDocumentDescribeDomainAutoTunesOutput(&output, shape) 1864 if err != nil { 1865 var snapshot bytes.Buffer 1866 io.Copy(&snapshot, ringBuffer) 1867 return out, metadata, &smithy.DeserializationError{ 1868 Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), 1869 Snapshot: snapshot.Bytes(), 1870 } 1871 } 1872 1873 return out, metadata, err 1874} 1875 1876func awsRestjson1_deserializeOpErrorDescribeDomainAutoTunes(response *smithyhttp.Response, metadata *middleware.Metadata) error { 1877 var errorBuffer bytes.Buffer 1878 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 1879 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 1880 } 1881 errorBody := bytes.NewReader(errorBuffer.Bytes()) 1882 1883 errorCode := "UnknownError" 1884 errorMessage := errorCode 1885 1886 code := response.Header.Get("X-Amzn-ErrorType") 1887 if len(code) != 0 { 1888 errorCode = restjson.SanitizeErrorCode(code) 1889 } 1890 1891 var buff [1024]byte 1892 ringBuffer := smithyio.NewRingBuffer(buff[:]) 1893 1894 body := io.TeeReader(errorBody, ringBuffer) 1895 decoder := json.NewDecoder(body) 1896 decoder.UseNumber() 1897 code, message, err := restjson.GetErrorInfo(decoder) 1898 if err != nil { 1899 var snapshot bytes.Buffer 1900 io.Copy(&snapshot, ringBuffer) 1901 err = &smithy.DeserializationError{ 1902 Err: fmt.Errorf("failed to decode response body, %w", err), 1903 Snapshot: snapshot.Bytes(), 1904 } 1905 return err 1906 } 1907 1908 errorBody.Seek(0, io.SeekStart) 1909 if len(code) != 0 { 1910 errorCode = restjson.SanitizeErrorCode(code) 1911 } 1912 if len(message) != 0 { 1913 errorMessage = message 1914 } 1915 1916 switch { 1917 case strings.EqualFold("BaseException", errorCode): 1918 return awsRestjson1_deserializeErrorBaseException(response, errorBody) 1919 1920 case strings.EqualFold("InternalException", errorCode): 1921 return awsRestjson1_deserializeErrorInternalException(response, errorBody) 1922 1923 case strings.EqualFold("ResourceNotFoundException", errorCode): 1924 return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) 1925 1926 case strings.EqualFold("ValidationException", errorCode): 1927 return awsRestjson1_deserializeErrorValidationException(response, errorBody) 1928 1929 default: 1930 genericError := &smithy.GenericAPIError{ 1931 Code: errorCode, 1932 Message: errorMessage, 1933 } 1934 return genericError 1935 1936 } 1937} 1938 1939func awsRestjson1_deserializeOpDocumentDescribeDomainAutoTunesOutput(v **DescribeDomainAutoTunesOutput, value interface{}) error { 1940 if v == nil { 1941 return fmt.Errorf("unexpected nil of type %T", v) 1942 } 1943 if value == nil { 1944 return nil 1945 } 1946 1947 shape, ok := value.(map[string]interface{}) 1948 if !ok { 1949 return fmt.Errorf("unexpected JSON type %v", value) 1950 } 1951 1952 var sv *DescribeDomainAutoTunesOutput 1953 if *v == nil { 1954 sv = &DescribeDomainAutoTunesOutput{} 1955 } else { 1956 sv = *v 1957 } 1958 1959 for key, value := range shape { 1960 switch key { 1961 case "AutoTunes": 1962 if err := awsRestjson1_deserializeDocumentAutoTuneList(&sv.AutoTunes, value); err != nil { 1963 return err 1964 } 1965 1966 case "NextToken": 1967 if value != nil { 1968 jtv, ok := value.(string) 1969 if !ok { 1970 return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) 1971 } 1972 sv.NextToken = ptr.String(jtv) 1973 } 1974 1975 default: 1976 _, _ = key, value 1977 1978 } 1979 } 1980 *v = sv 1981 return nil 1982} 1983 1984type awsRestjson1_deserializeOpDescribeElasticsearchDomain struct { 1985} 1986 1987func (*awsRestjson1_deserializeOpDescribeElasticsearchDomain) ID() string { 1988 return "OperationDeserializer" 1989} 1990 1991func (m *awsRestjson1_deserializeOpDescribeElasticsearchDomain) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 1992 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 1993) { 1994 out, metadata, err = next.HandleDeserialize(ctx, in) 1995 if err != nil { 1996 return out, metadata, err 1997 } 1998 1999 response, ok := out.RawResponse.(*smithyhttp.Response) 2000 if !ok { 2001 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 2002 } 2003 2004 if response.StatusCode < 200 || response.StatusCode >= 300 { 2005 return out, metadata, awsRestjson1_deserializeOpErrorDescribeElasticsearchDomain(response, &metadata) 2006 } 2007 output := &DescribeElasticsearchDomainOutput{} 2008 out.Result = output 2009 2010 var buff [1024]byte 2011 ringBuffer := smithyio.NewRingBuffer(buff[:]) 2012 2013 body := io.TeeReader(response.Body, ringBuffer) 2014 2015 decoder := json.NewDecoder(body) 2016 decoder.UseNumber() 2017 var shape interface{} 2018 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 2019 var snapshot bytes.Buffer 2020 io.Copy(&snapshot, ringBuffer) 2021 err = &smithy.DeserializationError{ 2022 Err: fmt.Errorf("failed to decode response body, %w", err), 2023 Snapshot: snapshot.Bytes(), 2024 } 2025 return out, metadata, err 2026 } 2027 2028 err = awsRestjson1_deserializeOpDocumentDescribeElasticsearchDomainOutput(&output, shape) 2029 if err != nil { 2030 var snapshot bytes.Buffer 2031 io.Copy(&snapshot, ringBuffer) 2032 return out, metadata, &smithy.DeserializationError{ 2033 Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), 2034 Snapshot: snapshot.Bytes(), 2035 } 2036 } 2037 2038 return out, metadata, err 2039} 2040 2041func awsRestjson1_deserializeOpErrorDescribeElasticsearchDomain(response *smithyhttp.Response, metadata *middleware.Metadata) error { 2042 var errorBuffer bytes.Buffer 2043 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 2044 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 2045 } 2046 errorBody := bytes.NewReader(errorBuffer.Bytes()) 2047 2048 errorCode := "UnknownError" 2049 errorMessage := errorCode 2050 2051 code := response.Header.Get("X-Amzn-ErrorType") 2052 if len(code) != 0 { 2053 errorCode = restjson.SanitizeErrorCode(code) 2054 } 2055 2056 var buff [1024]byte 2057 ringBuffer := smithyio.NewRingBuffer(buff[:]) 2058 2059 body := io.TeeReader(errorBody, ringBuffer) 2060 decoder := json.NewDecoder(body) 2061 decoder.UseNumber() 2062 code, message, err := restjson.GetErrorInfo(decoder) 2063 if err != nil { 2064 var snapshot bytes.Buffer 2065 io.Copy(&snapshot, ringBuffer) 2066 err = &smithy.DeserializationError{ 2067 Err: fmt.Errorf("failed to decode response body, %w", err), 2068 Snapshot: snapshot.Bytes(), 2069 } 2070 return err 2071 } 2072 2073 errorBody.Seek(0, io.SeekStart) 2074 if len(code) != 0 { 2075 errorCode = restjson.SanitizeErrorCode(code) 2076 } 2077 if len(message) != 0 { 2078 errorMessage = message 2079 } 2080 2081 switch { 2082 case strings.EqualFold("BaseException", errorCode): 2083 return awsRestjson1_deserializeErrorBaseException(response, errorBody) 2084 2085 case strings.EqualFold("InternalException", errorCode): 2086 return awsRestjson1_deserializeErrorInternalException(response, errorBody) 2087 2088 case strings.EqualFold("ResourceNotFoundException", errorCode): 2089 return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) 2090 2091 case strings.EqualFold("ValidationException", errorCode): 2092 return awsRestjson1_deserializeErrorValidationException(response, errorBody) 2093 2094 default: 2095 genericError := &smithy.GenericAPIError{ 2096 Code: errorCode, 2097 Message: errorMessage, 2098 } 2099 return genericError 2100 2101 } 2102} 2103 2104func awsRestjson1_deserializeOpDocumentDescribeElasticsearchDomainOutput(v **DescribeElasticsearchDomainOutput, value interface{}) error { 2105 if v == nil { 2106 return fmt.Errorf("unexpected nil of type %T", v) 2107 } 2108 if value == nil { 2109 return nil 2110 } 2111 2112 shape, ok := value.(map[string]interface{}) 2113 if !ok { 2114 return fmt.Errorf("unexpected JSON type %v", value) 2115 } 2116 2117 var sv *DescribeElasticsearchDomainOutput 2118 if *v == nil { 2119 sv = &DescribeElasticsearchDomainOutput{} 2120 } else { 2121 sv = *v 2122 } 2123 2124 for key, value := range shape { 2125 switch key { 2126 case "DomainStatus": 2127 if err := awsRestjson1_deserializeDocumentElasticsearchDomainStatus(&sv.DomainStatus, value); err != nil { 2128 return err 2129 } 2130 2131 default: 2132 _, _ = key, value 2133 2134 } 2135 } 2136 *v = sv 2137 return nil 2138} 2139 2140type awsRestjson1_deserializeOpDescribeElasticsearchDomainConfig struct { 2141} 2142 2143func (*awsRestjson1_deserializeOpDescribeElasticsearchDomainConfig) ID() string { 2144 return "OperationDeserializer" 2145} 2146 2147func (m *awsRestjson1_deserializeOpDescribeElasticsearchDomainConfig) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 2148 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 2149) { 2150 out, metadata, err = next.HandleDeserialize(ctx, in) 2151 if err != nil { 2152 return out, metadata, err 2153 } 2154 2155 response, ok := out.RawResponse.(*smithyhttp.Response) 2156 if !ok { 2157 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 2158 } 2159 2160 if response.StatusCode < 200 || response.StatusCode >= 300 { 2161 return out, metadata, awsRestjson1_deserializeOpErrorDescribeElasticsearchDomainConfig(response, &metadata) 2162 } 2163 output := &DescribeElasticsearchDomainConfigOutput{} 2164 out.Result = output 2165 2166 var buff [1024]byte 2167 ringBuffer := smithyio.NewRingBuffer(buff[:]) 2168 2169 body := io.TeeReader(response.Body, ringBuffer) 2170 2171 decoder := json.NewDecoder(body) 2172 decoder.UseNumber() 2173 var shape interface{} 2174 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 2175 var snapshot bytes.Buffer 2176 io.Copy(&snapshot, ringBuffer) 2177 err = &smithy.DeserializationError{ 2178 Err: fmt.Errorf("failed to decode response body, %w", err), 2179 Snapshot: snapshot.Bytes(), 2180 } 2181 return out, metadata, err 2182 } 2183 2184 err = awsRestjson1_deserializeOpDocumentDescribeElasticsearchDomainConfigOutput(&output, shape) 2185 if err != nil { 2186 var snapshot bytes.Buffer 2187 io.Copy(&snapshot, ringBuffer) 2188 return out, metadata, &smithy.DeserializationError{ 2189 Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), 2190 Snapshot: snapshot.Bytes(), 2191 } 2192 } 2193 2194 return out, metadata, err 2195} 2196 2197func awsRestjson1_deserializeOpErrorDescribeElasticsearchDomainConfig(response *smithyhttp.Response, metadata *middleware.Metadata) error { 2198 var errorBuffer bytes.Buffer 2199 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 2200 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 2201 } 2202 errorBody := bytes.NewReader(errorBuffer.Bytes()) 2203 2204 errorCode := "UnknownError" 2205 errorMessage := errorCode 2206 2207 code := response.Header.Get("X-Amzn-ErrorType") 2208 if len(code) != 0 { 2209 errorCode = restjson.SanitizeErrorCode(code) 2210 } 2211 2212 var buff [1024]byte 2213 ringBuffer := smithyio.NewRingBuffer(buff[:]) 2214 2215 body := io.TeeReader(errorBody, ringBuffer) 2216 decoder := json.NewDecoder(body) 2217 decoder.UseNumber() 2218 code, message, err := restjson.GetErrorInfo(decoder) 2219 if err != nil { 2220 var snapshot bytes.Buffer 2221 io.Copy(&snapshot, ringBuffer) 2222 err = &smithy.DeserializationError{ 2223 Err: fmt.Errorf("failed to decode response body, %w", err), 2224 Snapshot: snapshot.Bytes(), 2225 } 2226 return err 2227 } 2228 2229 errorBody.Seek(0, io.SeekStart) 2230 if len(code) != 0 { 2231 errorCode = restjson.SanitizeErrorCode(code) 2232 } 2233 if len(message) != 0 { 2234 errorMessage = message 2235 } 2236 2237 switch { 2238 case strings.EqualFold("BaseException", errorCode): 2239 return awsRestjson1_deserializeErrorBaseException(response, errorBody) 2240 2241 case strings.EqualFold("InternalException", errorCode): 2242 return awsRestjson1_deserializeErrorInternalException(response, errorBody) 2243 2244 case strings.EqualFold("ResourceNotFoundException", errorCode): 2245 return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) 2246 2247 case strings.EqualFold("ValidationException", errorCode): 2248 return awsRestjson1_deserializeErrorValidationException(response, errorBody) 2249 2250 default: 2251 genericError := &smithy.GenericAPIError{ 2252 Code: errorCode, 2253 Message: errorMessage, 2254 } 2255 return genericError 2256 2257 } 2258} 2259 2260func awsRestjson1_deserializeOpDocumentDescribeElasticsearchDomainConfigOutput(v **DescribeElasticsearchDomainConfigOutput, value interface{}) error { 2261 if v == nil { 2262 return fmt.Errorf("unexpected nil of type %T", v) 2263 } 2264 if value == nil { 2265 return nil 2266 } 2267 2268 shape, ok := value.(map[string]interface{}) 2269 if !ok { 2270 return fmt.Errorf("unexpected JSON type %v", value) 2271 } 2272 2273 var sv *DescribeElasticsearchDomainConfigOutput 2274 if *v == nil { 2275 sv = &DescribeElasticsearchDomainConfigOutput{} 2276 } else { 2277 sv = *v 2278 } 2279 2280 for key, value := range shape { 2281 switch key { 2282 case "DomainConfig": 2283 if err := awsRestjson1_deserializeDocumentElasticsearchDomainConfig(&sv.DomainConfig, value); err != nil { 2284 return err 2285 } 2286 2287 default: 2288 _, _ = key, value 2289 2290 } 2291 } 2292 *v = sv 2293 return nil 2294} 2295 2296type awsRestjson1_deserializeOpDescribeElasticsearchDomains struct { 2297} 2298 2299func (*awsRestjson1_deserializeOpDescribeElasticsearchDomains) ID() string { 2300 return "OperationDeserializer" 2301} 2302 2303func (m *awsRestjson1_deserializeOpDescribeElasticsearchDomains) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 2304 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 2305) { 2306 out, metadata, err = next.HandleDeserialize(ctx, in) 2307 if err != nil { 2308 return out, metadata, err 2309 } 2310 2311 response, ok := out.RawResponse.(*smithyhttp.Response) 2312 if !ok { 2313 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 2314 } 2315 2316 if response.StatusCode < 200 || response.StatusCode >= 300 { 2317 return out, metadata, awsRestjson1_deserializeOpErrorDescribeElasticsearchDomains(response, &metadata) 2318 } 2319 output := &DescribeElasticsearchDomainsOutput{} 2320 out.Result = output 2321 2322 var buff [1024]byte 2323 ringBuffer := smithyio.NewRingBuffer(buff[:]) 2324 2325 body := io.TeeReader(response.Body, ringBuffer) 2326 2327 decoder := json.NewDecoder(body) 2328 decoder.UseNumber() 2329 var shape interface{} 2330 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 2331 var snapshot bytes.Buffer 2332 io.Copy(&snapshot, ringBuffer) 2333 err = &smithy.DeserializationError{ 2334 Err: fmt.Errorf("failed to decode response body, %w", err), 2335 Snapshot: snapshot.Bytes(), 2336 } 2337 return out, metadata, err 2338 } 2339 2340 err = awsRestjson1_deserializeOpDocumentDescribeElasticsearchDomainsOutput(&output, shape) 2341 if err != nil { 2342 var snapshot bytes.Buffer 2343 io.Copy(&snapshot, ringBuffer) 2344 return out, metadata, &smithy.DeserializationError{ 2345 Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), 2346 Snapshot: snapshot.Bytes(), 2347 } 2348 } 2349 2350 return out, metadata, err 2351} 2352 2353func awsRestjson1_deserializeOpErrorDescribeElasticsearchDomains(response *smithyhttp.Response, metadata *middleware.Metadata) error { 2354 var errorBuffer bytes.Buffer 2355 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 2356 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 2357 } 2358 errorBody := bytes.NewReader(errorBuffer.Bytes()) 2359 2360 errorCode := "UnknownError" 2361 errorMessage := errorCode 2362 2363 code := response.Header.Get("X-Amzn-ErrorType") 2364 if len(code) != 0 { 2365 errorCode = restjson.SanitizeErrorCode(code) 2366 } 2367 2368 var buff [1024]byte 2369 ringBuffer := smithyio.NewRingBuffer(buff[:]) 2370 2371 body := io.TeeReader(errorBody, ringBuffer) 2372 decoder := json.NewDecoder(body) 2373 decoder.UseNumber() 2374 code, message, err := restjson.GetErrorInfo(decoder) 2375 if err != nil { 2376 var snapshot bytes.Buffer 2377 io.Copy(&snapshot, ringBuffer) 2378 err = &smithy.DeserializationError{ 2379 Err: fmt.Errorf("failed to decode response body, %w", err), 2380 Snapshot: snapshot.Bytes(), 2381 } 2382 return err 2383 } 2384 2385 errorBody.Seek(0, io.SeekStart) 2386 if len(code) != 0 { 2387 errorCode = restjson.SanitizeErrorCode(code) 2388 } 2389 if len(message) != 0 { 2390 errorMessage = message 2391 } 2392 2393 switch { 2394 case strings.EqualFold("BaseException", errorCode): 2395 return awsRestjson1_deserializeErrorBaseException(response, errorBody) 2396 2397 case strings.EqualFold("InternalException", errorCode): 2398 return awsRestjson1_deserializeErrorInternalException(response, errorBody) 2399 2400 case strings.EqualFold("ValidationException", errorCode): 2401 return awsRestjson1_deserializeErrorValidationException(response, errorBody) 2402 2403 default: 2404 genericError := &smithy.GenericAPIError{ 2405 Code: errorCode, 2406 Message: errorMessage, 2407 } 2408 return genericError 2409 2410 } 2411} 2412 2413func awsRestjson1_deserializeOpDocumentDescribeElasticsearchDomainsOutput(v **DescribeElasticsearchDomainsOutput, value interface{}) error { 2414 if v == nil { 2415 return fmt.Errorf("unexpected nil of type %T", v) 2416 } 2417 if value == nil { 2418 return nil 2419 } 2420 2421 shape, ok := value.(map[string]interface{}) 2422 if !ok { 2423 return fmt.Errorf("unexpected JSON type %v", value) 2424 } 2425 2426 var sv *DescribeElasticsearchDomainsOutput 2427 if *v == nil { 2428 sv = &DescribeElasticsearchDomainsOutput{} 2429 } else { 2430 sv = *v 2431 } 2432 2433 for key, value := range shape { 2434 switch key { 2435 case "DomainStatusList": 2436 if err := awsRestjson1_deserializeDocumentElasticsearchDomainStatusList(&sv.DomainStatusList, value); err != nil { 2437 return err 2438 } 2439 2440 default: 2441 _, _ = key, value 2442 2443 } 2444 } 2445 *v = sv 2446 return nil 2447} 2448 2449type awsRestjson1_deserializeOpDescribeElasticsearchInstanceTypeLimits struct { 2450} 2451 2452func (*awsRestjson1_deserializeOpDescribeElasticsearchInstanceTypeLimits) ID() string { 2453 return "OperationDeserializer" 2454} 2455 2456func (m *awsRestjson1_deserializeOpDescribeElasticsearchInstanceTypeLimits) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 2457 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 2458) { 2459 out, metadata, err = next.HandleDeserialize(ctx, in) 2460 if err != nil { 2461 return out, metadata, err 2462 } 2463 2464 response, ok := out.RawResponse.(*smithyhttp.Response) 2465 if !ok { 2466 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 2467 } 2468 2469 if response.StatusCode < 200 || response.StatusCode >= 300 { 2470 return out, metadata, awsRestjson1_deserializeOpErrorDescribeElasticsearchInstanceTypeLimits(response, &metadata) 2471 } 2472 output := &DescribeElasticsearchInstanceTypeLimitsOutput{} 2473 out.Result = output 2474 2475 var buff [1024]byte 2476 ringBuffer := smithyio.NewRingBuffer(buff[:]) 2477 2478 body := io.TeeReader(response.Body, ringBuffer) 2479 2480 decoder := json.NewDecoder(body) 2481 decoder.UseNumber() 2482 var shape interface{} 2483 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 2484 var snapshot bytes.Buffer 2485 io.Copy(&snapshot, ringBuffer) 2486 err = &smithy.DeserializationError{ 2487 Err: fmt.Errorf("failed to decode response body, %w", err), 2488 Snapshot: snapshot.Bytes(), 2489 } 2490 return out, metadata, err 2491 } 2492 2493 err = awsRestjson1_deserializeOpDocumentDescribeElasticsearchInstanceTypeLimitsOutput(&output, shape) 2494 if err != nil { 2495 var snapshot bytes.Buffer 2496 io.Copy(&snapshot, ringBuffer) 2497 return out, metadata, &smithy.DeserializationError{ 2498 Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), 2499 Snapshot: snapshot.Bytes(), 2500 } 2501 } 2502 2503 return out, metadata, err 2504} 2505 2506func awsRestjson1_deserializeOpErrorDescribeElasticsearchInstanceTypeLimits(response *smithyhttp.Response, metadata *middleware.Metadata) error { 2507 var errorBuffer bytes.Buffer 2508 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 2509 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 2510 } 2511 errorBody := bytes.NewReader(errorBuffer.Bytes()) 2512 2513 errorCode := "UnknownError" 2514 errorMessage := errorCode 2515 2516 code := response.Header.Get("X-Amzn-ErrorType") 2517 if len(code) != 0 { 2518 errorCode = restjson.SanitizeErrorCode(code) 2519 } 2520 2521 var buff [1024]byte 2522 ringBuffer := smithyio.NewRingBuffer(buff[:]) 2523 2524 body := io.TeeReader(errorBody, ringBuffer) 2525 decoder := json.NewDecoder(body) 2526 decoder.UseNumber() 2527 code, message, err := restjson.GetErrorInfo(decoder) 2528 if err != nil { 2529 var snapshot bytes.Buffer 2530 io.Copy(&snapshot, ringBuffer) 2531 err = &smithy.DeserializationError{ 2532 Err: fmt.Errorf("failed to decode response body, %w", err), 2533 Snapshot: snapshot.Bytes(), 2534 } 2535 return err 2536 } 2537 2538 errorBody.Seek(0, io.SeekStart) 2539 if len(code) != 0 { 2540 errorCode = restjson.SanitizeErrorCode(code) 2541 } 2542 if len(message) != 0 { 2543 errorMessage = message 2544 } 2545 2546 switch { 2547 case strings.EqualFold("BaseException", errorCode): 2548 return awsRestjson1_deserializeErrorBaseException(response, errorBody) 2549 2550 case strings.EqualFold("InternalException", errorCode): 2551 return awsRestjson1_deserializeErrorInternalException(response, errorBody) 2552 2553 case strings.EqualFold("InvalidTypeException", errorCode): 2554 return awsRestjson1_deserializeErrorInvalidTypeException(response, errorBody) 2555 2556 case strings.EqualFold("LimitExceededException", errorCode): 2557 return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) 2558 2559 case strings.EqualFold("ResourceNotFoundException", errorCode): 2560 return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) 2561 2562 case strings.EqualFold("ValidationException", errorCode): 2563 return awsRestjson1_deserializeErrorValidationException(response, errorBody) 2564 2565 default: 2566 genericError := &smithy.GenericAPIError{ 2567 Code: errorCode, 2568 Message: errorMessage, 2569 } 2570 return genericError 2571 2572 } 2573} 2574 2575func awsRestjson1_deserializeOpDocumentDescribeElasticsearchInstanceTypeLimitsOutput(v **DescribeElasticsearchInstanceTypeLimitsOutput, value interface{}) error { 2576 if v == nil { 2577 return fmt.Errorf("unexpected nil of type %T", v) 2578 } 2579 if value == nil { 2580 return nil 2581 } 2582 2583 shape, ok := value.(map[string]interface{}) 2584 if !ok { 2585 return fmt.Errorf("unexpected JSON type %v", value) 2586 } 2587 2588 var sv *DescribeElasticsearchInstanceTypeLimitsOutput 2589 if *v == nil { 2590 sv = &DescribeElasticsearchInstanceTypeLimitsOutput{} 2591 } else { 2592 sv = *v 2593 } 2594 2595 for key, value := range shape { 2596 switch key { 2597 case "LimitsByRole": 2598 if err := awsRestjson1_deserializeDocumentLimitsByRole(&sv.LimitsByRole, value); err != nil { 2599 return err 2600 } 2601 2602 default: 2603 _, _ = key, value 2604 2605 } 2606 } 2607 *v = sv 2608 return nil 2609} 2610 2611type awsRestjson1_deserializeOpDescribeInboundCrossClusterSearchConnections struct { 2612} 2613 2614func (*awsRestjson1_deserializeOpDescribeInboundCrossClusterSearchConnections) ID() string { 2615 return "OperationDeserializer" 2616} 2617 2618func (m *awsRestjson1_deserializeOpDescribeInboundCrossClusterSearchConnections) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 2619 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 2620) { 2621 out, metadata, err = next.HandleDeserialize(ctx, in) 2622 if err != nil { 2623 return out, metadata, err 2624 } 2625 2626 response, ok := out.RawResponse.(*smithyhttp.Response) 2627 if !ok { 2628 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 2629 } 2630 2631 if response.StatusCode < 200 || response.StatusCode >= 300 { 2632 return out, metadata, awsRestjson1_deserializeOpErrorDescribeInboundCrossClusterSearchConnections(response, &metadata) 2633 } 2634 output := &DescribeInboundCrossClusterSearchConnectionsOutput{} 2635 out.Result = output 2636 2637 var buff [1024]byte 2638 ringBuffer := smithyio.NewRingBuffer(buff[:]) 2639 2640 body := io.TeeReader(response.Body, ringBuffer) 2641 2642 decoder := json.NewDecoder(body) 2643 decoder.UseNumber() 2644 var shape interface{} 2645 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 2646 var snapshot bytes.Buffer 2647 io.Copy(&snapshot, ringBuffer) 2648 err = &smithy.DeserializationError{ 2649 Err: fmt.Errorf("failed to decode response body, %w", err), 2650 Snapshot: snapshot.Bytes(), 2651 } 2652 return out, metadata, err 2653 } 2654 2655 err = awsRestjson1_deserializeOpDocumentDescribeInboundCrossClusterSearchConnectionsOutput(&output, shape) 2656 if err != nil { 2657 var snapshot bytes.Buffer 2658 io.Copy(&snapshot, ringBuffer) 2659 return out, metadata, &smithy.DeserializationError{ 2660 Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), 2661 Snapshot: snapshot.Bytes(), 2662 } 2663 } 2664 2665 return out, metadata, err 2666} 2667 2668func awsRestjson1_deserializeOpErrorDescribeInboundCrossClusterSearchConnections(response *smithyhttp.Response, metadata *middleware.Metadata) error { 2669 var errorBuffer bytes.Buffer 2670 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 2671 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 2672 } 2673 errorBody := bytes.NewReader(errorBuffer.Bytes()) 2674 2675 errorCode := "UnknownError" 2676 errorMessage := errorCode 2677 2678 code := response.Header.Get("X-Amzn-ErrorType") 2679 if len(code) != 0 { 2680 errorCode = restjson.SanitizeErrorCode(code) 2681 } 2682 2683 var buff [1024]byte 2684 ringBuffer := smithyio.NewRingBuffer(buff[:]) 2685 2686 body := io.TeeReader(errorBody, ringBuffer) 2687 decoder := json.NewDecoder(body) 2688 decoder.UseNumber() 2689 code, message, err := restjson.GetErrorInfo(decoder) 2690 if err != nil { 2691 var snapshot bytes.Buffer 2692 io.Copy(&snapshot, ringBuffer) 2693 err = &smithy.DeserializationError{ 2694 Err: fmt.Errorf("failed to decode response body, %w", err), 2695 Snapshot: snapshot.Bytes(), 2696 } 2697 return err 2698 } 2699 2700 errorBody.Seek(0, io.SeekStart) 2701 if len(code) != 0 { 2702 errorCode = restjson.SanitizeErrorCode(code) 2703 } 2704 if len(message) != 0 { 2705 errorMessage = message 2706 } 2707 2708 switch { 2709 case strings.EqualFold("DisabledOperationException", errorCode): 2710 return awsRestjson1_deserializeErrorDisabledOperationException(response, errorBody) 2711 2712 case strings.EqualFold("InvalidPaginationTokenException", errorCode): 2713 return awsRestjson1_deserializeErrorInvalidPaginationTokenException(response, errorBody) 2714 2715 default: 2716 genericError := &smithy.GenericAPIError{ 2717 Code: errorCode, 2718 Message: errorMessage, 2719 } 2720 return genericError 2721 2722 } 2723} 2724 2725func awsRestjson1_deserializeOpDocumentDescribeInboundCrossClusterSearchConnectionsOutput(v **DescribeInboundCrossClusterSearchConnectionsOutput, value interface{}) error { 2726 if v == nil { 2727 return fmt.Errorf("unexpected nil of type %T", v) 2728 } 2729 if value == nil { 2730 return nil 2731 } 2732 2733 shape, ok := value.(map[string]interface{}) 2734 if !ok { 2735 return fmt.Errorf("unexpected JSON type %v", value) 2736 } 2737 2738 var sv *DescribeInboundCrossClusterSearchConnectionsOutput 2739 if *v == nil { 2740 sv = &DescribeInboundCrossClusterSearchConnectionsOutput{} 2741 } else { 2742 sv = *v 2743 } 2744 2745 for key, value := range shape { 2746 switch key { 2747 case "CrossClusterSearchConnections": 2748 if err := awsRestjson1_deserializeDocumentInboundCrossClusterSearchConnections(&sv.CrossClusterSearchConnections, value); err != nil { 2749 return err 2750 } 2751 2752 case "NextToken": 2753 if value != nil { 2754 jtv, ok := value.(string) 2755 if !ok { 2756 return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) 2757 } 2758 sv.NextToken = ptr.String(jtv) 2759 } 2760 2761 default: 2762 _, _ = key, value 2763 2764 } 2765 } 2766 *v = sv 2767 return nil 2768} 2769 2770type awsRestjson1_deserializeOpDescribeOutboundCrossClusterSearchConnections struct { 2771} 2772 2773func (*awsRestjson1_deserializeOpDescribeOutboundCrossClusterSearchConnections) ID() string { 2774 return "OperationDeserializer" 2775} 2776 2777func (m *awsRestjson1_deserializeOpDescribeOutboundCrossClusterSearchConnections) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 2778 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 2779) { 2780 out, metadata, err = next.HandleDeserialize(ctx, in) 2781 if err != nil { 2782 return out, metadata, err 2783 } 2784 2785 response, ok := out.RawResponse.(*smithyhttp.Response) 2786 if !ok { 2787 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 2788 } 2789 2790 if response.StatusCode < 200 || response.StatusCode >= 300 { 2791 return out, metadata, awsRestjson1_deserializeOpErrorDescribeOutboundCrossClusterSearchConnections(response, &metadata) 2792 } 2793 output := &DescribeOutboundCrossClusterSearchConnectionsOutput{} 2794 out.Result = output 2795 2796 var buff [1024]byte 2797 ringBuffer := smithyio.NewRingBuffer(buff[:]) 2798 2799 body := io.TeeReader(response.Body, ringBuffer) 2800 2801 decoder := json.NewDecoder(body) 2802 decoder.UseNumber() 2803 var shape interface{} 2804 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 2805 var snapshot bytes.Buffer 2806 io.Copy(&snapshot, ringBuffer) 2807 err = &smithy.DeserializationError{ 2808 Err: fmt.Errorf("failed to decode response body, %w", err), 2809 Snapshot: snapshot.Bytes(), 2810 } 2811 return out, metadata, err 2812 } 2813 2814 err = awsRestjson1_deserializeOpDocumentDescribeOutboundCrossClusterSearchConnectionsOutput(&output, shape) 2815 if err != nil { 2816 var snapshot bytes.Buffer 2817 io.Copy(&snapshot, ringBuffer) 2818 return out, metadata, &smithy.DeserializationError{ 2819 Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), 2820 Snapshot: snapshot.Bytes(), 2821 } 2822 } 2823 2824 return out, metadata, err 2825} 2826 2827func awsRestjson1_deserializeOpErrorDescribeOutboundCrossClusterSearchConnections(response *smithyhttp.Response, metadata *middleware.Metadata) error { 2828 var errorBuffer bytes.Buffer 2829 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 2830 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 2831 } 2832 errorBody := bytes.NewReader(errorBuffer.Bytes()) 2833 2834 errorCode := "UnknownError" 2835 errorMessage := errorCode 2836 2837 code := response.Header.Get("X-Amzn-ErrorType") 2838 if len(code) != 0 { 2839 errorCode = restjson.SanitizeErrorCode(code) 2840 } 2841 2842 var buff [1024]byte 2843 ringBuffer := smithyio.NewRingBuffer(buff[:]) 2844 2845 body := io.TeeReader(errorBody, ringBuffer) 2846 decoder := json.NewDecoder(body) 2847 decoder.UseNumber() 2848 code, message, err := restjson.GetErrorInfo(decoder) 2849 if err != nil { 2850 var snapshot bytes.Buffer 2851 io.Copy(&snapshot, ringBuffer) 2852 err = &smithy.DeserializationError{ 2853 Err: fmt.Errorf("failed to decode response body, %w", err), 2854 Snapshot: snapshot.Bytes(), 2855 } 2856 return err 2857 } 2858 2859 errorBody.Seek(0, io.SeekStart) 2860 if len(code) != 0 { 2861 errorCode = restjson.SanitizeErrorCode(code) 2862 } 2863 if len(message) != 0 { 2864 errorMessage = message 2865 } 2866 2867 switch { 2868 case strings.EqualFold("DisabledOperationException", errorCode): 2869 return awsRestjson1_deserializeErrorDisabledOperationException(response, errorBody) 2870 2871 case strings.EqualFold("InvalidPaginationTokenException", errorCode): 2872 return awsRestjson1_deserializeErrorInvalidPaginationTokenException(response, errorBody) 2873 2874 default: 2875 genericError := &smithy.GenericAPIError{ 2876 Code: errorCode, 2877 Message: errorMessage, 2878 } 2879 return genericError 2880 2881 } 2882} 2883 2884func awsRestjson1_deserializeOpDocumentDescribeOutboundCrossClusterSearchConnectionsOutput(v **DescribeOutboundCrossClusterSearchConnectionsOutput, value interface{}) error { 2885 if v == nil { 2886 return fmt.Errorf("unexpected nil of type %T", v) 2887 } 2888 if value == nil { 2889 return nil 2890 } 2891 2892 shape, ok := value.(map[string]interface{}) 2893 if !ok { 2894 return fmt.Errorf("unexpected JSON type %v", value) 2895 } 2896 2897 var sv *DescribeOutboundCrossClusterSearchConnectionsOutput 2898 if *v == nil { 2899 sv = &DescribeOutboundCrossClusterSearchConnectionsOutput{} 2900 } else { 2901 sv = *v 2902 } 2903 2904 for key, value := range shape { 2905 switch key { 2906 case "CrossClusterSearchConnections": 2907 if err := awsRestjson1_deserializeDocumentOutboundCrossClusterSearchConnections(&sv.CrossClusterSearchConnections, value); err != nil { 2908 return err 2909 } 2910 2911 case "NextToken": 2912 if value != nil { 2913 jtv, ok := value.(string) 2914 if !ok { 2915 return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) 2916 } 2917 sv.NextToken = ptr.String(jtv) 2918 } 2919 2920 default: 2921 _, _ = key, value 2922 2923 } 2924 } 2925 *v = sv 2926 return nil 2927} 2928 2929type awsRestjson1_deserializeOpDescribePackages struct { 2930} 2931 2932func (*awsRestjson1_deserializeOpDescribePackages) ID() string { 2933 return "OperationDeserializer" 2934} 2935 2936func (m *awsRestjson1_deserializeOpDescribePackages) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 2937 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 2938) { 2939 out, metadata, err = next.HandleDeserialize(ctx, in) 2940 if err != nil { 2941 return out, metadata, err 2942 } 2943 2944 response, ok := out.RawResponse.(*smithyhttp.Response) 2945 if !ok { 2946 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 2947 } 2948 2949 if response.StatusCode < 200 || response.StatusCode >= 300 { 2950 return out, metadata, awsRestjson1_deserializeOpErrorDescribePackages(response, &metadata) 2951 } 2952 output := &DescribePackagesOutput{} 2953 out.Result = output 2954 2955 var buff [1024]byte 2956 ringBuffer := smithyio.NewRingBuffer(buff[:]) 2957 2958 body := io.TeeReader(response.Body, ringBuffer) 2959 2960 decoder := json.NewDecoder(body) 2961 decoder.UseNumber() 2962 var shape interface{} 2963 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 2964 var snapshot bytes.Buffer 2965 io.Copy(&snapshot, ringBuffer) 2966 err = &smithy.DeserializationError{ 2967 Err: fmt.Errorf("failed to decode response body, %w", err), 2968 Snapshot: snapshot.Bytes(), 2969 } 2970 return out, metadata, err 2971 } 2972 2973 err = awsRestjson1_deserializeOpDocumentDescribePackagesOutput(&output, shape) 2974 if err != nil { 2975 var snapshot bytes.Buffer 2976 io.Copy(&snapshot, ringBuffer) 2977 return out, metadata, &smithy.DeserializationError{ 2978 Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), 2979 Snapshot: snapshot.Bytes(), 2980 } 2981 } 2982 2983 return out, metadata, err 2984} 2985 2986func awsRestjson1_deserializeOpErrorDescribePackages(response *smithyhttp.Response, metadata *middleware.Metadata) error { 2987 var errorBuffer bytes.Buffer 2988 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 2989 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 2990 } 2991 errorBody := bytes.NewReader(errorBuffer.Bytes()) 2992 2993 errorCode := "UnknownError" 2994 errorMessage := errorCode 2995 2996 code := response.Header.Get("X-Amzn-ErrorType") 2997 if len(code) != 0 { 2998 errorCode = restjson.SanitizeErrorCode(code) 2999 } 3000 3001 var buff [1024]byte 3002 ringBuffer := smithyio.NewRingBuffer(buff[:]) 3003 3004 body := io.TeeReader(errorBody, ringBuffer) 3005 decoder := json.NewDecoder(body) 3006 decoder.UseNumber() 3007 code, message, err := restjson.GetErrorInfo(decoder) 3008 if err != nil { 3009 var snapshot bytes.Buffer 3010 io.Copy(&snapshot, ringBuffer) 3011 err = &smithy.DeserializationError{ 3012 Err: fmt.Errorf("failed to decode response body, %w", err), 3013 Snapshot: snapshot.Bytes(), 3014 } 3015 return err 3016 } 3017 3018 errorBody.Seek(0, io.SeekStart) 3019 if len(code) != 0 { 3020 errorCode = restjson.SanitizeErrorCode(code) 3021 } 3022 if len(message) != 0 { 3023 errorMessage = message 3024 } 3025 3026 switch { 3027 case strings.EqualFold("AccessDeniedException", errorCode): 3028 return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) 3029 3030 case strings.EqualFold("BaseException", errorCode): 3031 return awsRestjson1_deserializeErrorBaseException(response, errorBody) 3032 3033 case strings.EqualFold("InternalException", errorCode): 3034 return awsRestjson1_deserializeErrorInternalException(response, errorBody) 3035 3036 case strings.EqualFold("ResourceNotFoundException", errorCode): 3037 return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) 3038 3039 case strings.EqualFold("ValidationException", errorCode): 3040 return awsRestjson1_deserializeErrorValidationException(response, errorBody) 3041 3042 default: 3043 genericError := &smithy.GenericAPIError{ 3044 Code: errorCode, 3045 Message: errorMessage, 3046 } 3047 return genericError 3048 3049 } 3050} 3051 3052func awsRestjson1_deserializeOpDocumentDescribePackagesOutput(v **DescribePackagesOutput, value interface{}) error { 3053 if v == nil { 3054 return fmt.Errorf("unexpected nil of type %T", v) 3055 } 3056 if value == nil { 3057 return nil 3058 } 3059 3060 shape, ok := value.(map[string]interface{}) 3061 if !ok { 3062 return fmt.Errorf("unexpected JSON type %v", value) 3063 } 3064 3065 var sv *DescribePackagesOutput 3066 if *v == nil { 3067 sv = &DescribePackagesOutput{} 3068 } else { 3069 sv = *v 3070 } 3071 3072 for key, value := range shape { 3073 switch key { 3074 case "NextToken": 3075 if value != nil { 3076 jtv, ok := value.(string) 3077 if !ok { 3078 return fmt.Errorf("expected String to be of type string, got %T instead", value) 3079 } 3080 sv.NextToken = ptr.String(jtv) 3081 } 3082 3083 case "PackageDetailsList": 3084 if err := awsRestjson1_deserializeDocumentPackageDetailsList(&sv.PackageDetailsList, value); err != nil { 3085 return err 3086 } 3087 3088 default: 3089 _, _ = key, value 3090 3091 } 3092 } 3093 *v = sv 3094 return nil 3095} 3096 3097type awsRestjson1_deserializeOpDescribeReservedElasticsearchInstanceOfferings struct { 3098} 3099 3100func (*awsRestjson1_deserializeOpDescribeReservedElasticsearchInstanceOfferings) ID() string { 3101 return "OperationDeserializer" 3102} 3103 3104func (m *awsRestjson1_deserializeOpDescribeReservedElasticsearchInstanceOfferings) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 3105 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 3106) { 3107 out, metadata, err = next.HandleDeserialize(ctx, in) 3108 if err != nil { 3109 return out, metadata, err 3110 } 3111 3112 response, ok := out.RawResponse.(*smithyhttp.Response) 3113 if !ok { 3114 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 3115 } 3116 3117 if response.StatusCode < 200 || response.StatusCode >= 300 { 3118 return out, metadata, awsRestjson1_deserializeOpErrorDescribeReservedElasticsearchInstanceOfferings(response, &metadata) 3119 } 3120 output := &DescribeReservedElasticsearchInstanceOfferingsOutput{} 3121 out.Result = output 3122 3123 var buff [1024]byte 3124 ringBuffer := smithyio.NewRingBuffer(buff[:]) 3125 3126 body := io.TeeReader(response.Body, ringBuffer) 3127 3128 decoder := json.NewDecoder(body) 3129 decoder.UseNumber() 3130 var shape interface{} 3131 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 3132 var snapshot bytes.Buffer 3133 io.Copy(&snapshot, ringBuffer) 3134 err = &smithy.DeserializationError{ 3135 Err: fmt.Errorf("failed to decode response body, %w", err), 3136 Snapshot: snapshot.Bytes(), 3137 } 3138 return out, metadata, err 3139 } 3140 3141 err = awsRestjson1_deserializeOpDocumentDescribeReservedElasticsearchInstanceOfferingsOutput(&output, shape) 3142 if err != nil { 3143 var snapshot bytes.Buffer 3144 io.Copy(&snapshot, ringBuffer) 3145 return out, metadata, &smithy.DeserializationError{ 3146 Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), 3147 Snapshot: snapshot.Bytes(), 3148 } 3149 } 3150 3151 return out, metadata, err 3152} 3153 3154func awsRestjson1_deserializeOpErrorDescribeReservedElasticsearchInstanceOfferings(response *smithyhttp.Response, metadata *middleware.Metadata) error { 3155 var errorBuffer bytes.Buffer 3156 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 3157 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 3158 } 3159 errorBody := bytes.NewReader(errorBuffer.Bytes()) 3160 3161 errorCode := "UnknownError" 3162 errorMessage := errorCode 3163 3164 code := response.Header.Get("X-Amzn-ErrorType") 3165 if len(code) != 0 { 3166 errorCode = restjson.SanitizeErrorCode(code) 3167 } 3168 3169 var buff [1024]byte 3170 ringBuffer := smithyio.NewRingBuffer(buff[:]) 3171 3172 body := io.TeeReader(errorBody, ringBuffer) 3173 decoder := json.NewDecoder(body) 3174 decoder.UseNumber() 3175 code, message, err := restjson.GetErrorInfo(decoder) 3176 if err != nil { 3177 var snapshot bytes.Buffer 3178 io.Copy(&snapshot, ringBuffer) 3179 err = &smithy.DeserializationError{ 3180 Err: fmt.Errorf("failed to decode response body, %w", err), 3181 Snapshot: snapshot.Bytes(), 3182 } 3183 return err 3184 } 3185 3186 errorBody.Seek(0, io.SeekStart) 3187 if len(code) != 0 { 3188 errorCode = restjson.SanitizeErrorCode(code) 3189 } 3190 if len(message) != 0 { 3191 errorMessage = message 3192 } 3193 3194 switch { 3195 case strings.EqualFold("DisabledOperationException", errorCode): 3196 return awsRestjson1_deserializeErrorDisabledOperationException(response, errorBody) 3197 3198 case strings.EqualFold("InternalException", errorCode): 3199 return awsRestjson1_deserializeErrorInternalException(response, errorBody) 3200 3201 case strings.EqualFold("ResourceNotFoundException", errorCode): 3202 return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) 3203 3204 case strings.EqualFold("ValidationException", errorCode): 3205 return awsRestjson1_deserializeErrorValidationException(response, errorBody) 3206 3207 default: 3208 genericError := &smithy.GenericAPIError{ 3209 Code: errorCode, 3210 Message: errorMessage, 3211 } 3212 return genericError 3213 3214 } 3215} 3216 3217func awsRestjson1_deserializeOpDocumentDescribeReservedElasticsearchInstanceOfferingsOutput(v **DescribeReservedElasticsearchInstanceOfferingsOutput, value interface{}) error { 3218 if v == nil { 3219 return fmt.Errorf("unexpected nil of type %T", v) 3220 } 3221 if value == nil { 3222 return nil 3223 } 3224 3225 shape, ok := value.(map[string]interface{}) 3226 if !ok { 3227 return fmt.Errorf("unexpected JSON type %v", value) 3228 } 3229 3230 var sv *DescribeReservedElasticsearchInstanceOfferingsOutput 3231 if *v == nil { 3232 sv = &DescribeReservedElasticsearchInstanceOfferingsOutput{} 3233 } else { 3234 sv = *v 3235 } 3236 3237 for key, value := range shape { 3238 switch key { 3239 case "NextToken": 3240 if value != nil { 3241 jtv, ok := value.(string) 3242 if !ok { 3243 return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) 3244 } 3245 sv.NextToken = ptr.String(jtv) 3246 } 3247 3248 case "ReservedElasticsearchInstanceOfferings": 3249 if err := awsRestjson1_deserializeDocumentReservedElasticsearchInstanceOfferingList(&sv.ReservedElasticsearchInstanceOfferings, value); err != nil { 3250 return err 3251 } 3252 3253 default: 3254 _, _ = key, value 3255 3256 } 3257 } 3258 *v = sv 3259 return nil 3260} 3261 3262type awsRestjson1_deserializeOpDescribeReservedElasticsearchInstances struct { 3263} 3264 3265func (*awsRestjson1_deserializeOpDescribeReservedElasticsearchInstances) ID() string { 3266 return "OperationDeserializer" 3267} 3268 3269func (m *awsRestjson1_deserializeOpDescribeReservedElasticsearchInstances) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 3270 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 3271) { 3272 out, metadata, err = next.HandleDeserialize(ctx, in) 3273 if err != nil { 3274 return out, metadata, err 3275 } 3276 3277 response, ok := out.RawResponse.(*smithyhttp.Response) 3278 if !ok { 3279 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 3280 } 3281 3282 if response.StatusCode < 200 || response.StatusCode >= 300 { 3283 return out, metadata, awsRestjson1_deserializeOpErrorDescribeReservedElasticsearchInstances(response, &metadata) 3284 } 3285 output := &DescribeReservedElasticsearchInstancesOutput{} 3286 out.Result = output 3287 3288 var buff [1024]byte 3289 ringBuffer := smithyio.NewRingBuffer(buff[:]) 3290 3291 body := io.TeeReader(response.Body, ringBuffer) 3292 3293 decoder := json.NewDecoder(body) 3294 decoder.UseNumber() 3295 var shape interface{} 3296 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 3297 var snapshot bytes.Buffer 3298 io.Copy(&snapshot, ringBuffer) 3299 err = &smithy.DeserializationError{ 3300 Err: fmt.Errorf("failed to decode response body, %w", err), 3301 Snapshot: snapshot.Bytes(), 3302 } 3303 return out, metadata, err 3304 } 3305 3306 err = awsRestjson1_deserializeOpDocumentDescribeReservedElasticsearchInstancesOutput(&output, shape) 3307 if err != nil { 3308 var snapshot bytes.Buffer 3309 io.Copy(&snapshot, ringBuffer) 3310 return out, metadata, &smithy.DeserializationError{ 3311 Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), 3312 Snapshot: snapshot.Bytes(), 3313 } 3314 } 3315 3316 return out, metadata, err 3317} 3318 3319func awsRestjson1_deserializeOpErrorDescribeReservedElasticsearchInstances(response *smithyhttp.Response, metadata *middleware.Metadata) error { 3320 var errorBuffer bytes.Buffer 3321 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 3322 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 3323 } 3324 errorBody := bytes.NewReader(errorBuffer.Bytes()) 3325 3326 errorCode := "UnknownError" 3327 errorMessage := errorCode 3328 3329 code := response.Header.Get("X-Amzn-ErrorType") 3330 if len(code) != 0 { 3331 errorCode = restjson.SanitizeErrorCode(code) 3332 } 3333 3334 var buff [1024]byte 3335 ringBuffer := smithyio.NewRingBuffer(buff[:]) 3336 3337 body := io.TeeReader(errorBody, ringBuffer) 3338 decoder := json.NewDecoder(body) 3339 decoder.UseNumber() 3340 code, message, err := restjson.GetErrorInfo(decoder) 3341 if err != nil { 3342 var snapshot bytes.Buffer 3343 io.Copy(&snapshot, ringBuffer) 3344 err = &smithy.DeserializationError{ 3345 Err: fmt.Errorf("failed to decode response body, %w", err), 3346 Snapshot: snapshot.Bytes(), 3347 } 3348 return err 3349 } 3350 3351 errorBody.Seek(0, io.SeekStart) 3352 if len(code) != 0 { 3353 errorCode = restjson.SanitizeErrorCode(code) 3354 } 3355 if len(message) != 0 { 3356 errorMessage = message 3357 } 3358 3359 switch { 3360 case strings.EqualFold("DisabledOperationException", errorCode): 3361 return awsRestjson1_deserializeErrorDisabledOperationException(response, errorBody) 3362 3363 case strings.EqualFold("InternalException", errorCode): 3364 return awsRestjson1_deserializeErrorInternalException(response, errorBody) 3365 3366 case strings.EqualFold("ResourceNotFoundException", errorCode): 3367 return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) 3368 3369 case strings.EqualFold("ValidationException", errorCode): 3370 return awsRestjson1_deserializeErrorValidationException(response, errorBody) 3371 3372 default: 3373 genericError := &smithy.GenericAPIError{ 3374 Code: errorCode, 3375 Message: errorMessage, 3376 } 3377 return genericError 3378 3379 } 3380} 3381 3382func awsRestjson1_deserializeOpDocumentDescribeReservedElasticsearchInstancesOutput(v **DescribeReservedElasticsearchInstancesOutput, value interface{}) error { 3383 if v == nil { 3384 return fmt.Errorf("unexpected nil of type %T", v) 3385 } 3386 if value == nil { 3387 return nil 3388 } 3389 3390 shape, ok := value.(map[string]interface{}) 3391 if !ok { 3392 return fmt.Errorf("unexpected JSON type %v", value) 3393 } 3394 3395 var sv *DescribeReservedElasticsearchInstancesOutput 3396 if *v == nil { 3397 sv = &DescribeReservedElasticsearchInstancesOutput{} 3398 } else { 3399 sv = *v 3400 } 3401 3402 for key, value := range shape { 3403 switch key { 3404 case "NextToken": 3405 if value != nil { 3406 jtv, ok := value.(string) 3407 if !ok { 3408 return fmt.Errorf("expected String to be of type string, got %T instead", value) 3409 } 3410 sv.NextToken = ptr.String(jtv) 3411 } 3412 3413 case "ReservedElasticsearchInstances": 3414 if err := awsRestjson1_deserializeDocumentReservedElasticsearchInstanceList(&sv.ReservedElasticsearchInstances, value); err != nil { 3415 return err 3416 } 3417 3418 default: 3419 _, _ = key, value 3420 3421 } 3422 } 3423 *v = sv 3424 return nil 3425} 3426 3427type awsRestjson1_deserializeOpDissociatePackage struct { 3428} 3429 3430func (*awsRestjson1_deserializeOpDissociatePackage) ID() string { 3431 return "OperationDeserializer" 3432} 3433 3434func (m *awsRestjson1_deserializeOpDissociatePackage) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 3435 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 3436) { 3437 out, metadata, err = next.HandleDeserialize(ctx, in) 3438 if err != nil { 3439 return out, metadata, err 3440 } 3441 3442 response, ok := out.RawResponse.(*smithyhttp.Response) 3443 if !ok { 3444 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 3445 } 3446 3447 if response.StatusCode < 200 || response.StatusCode >= 300 { 3448 return out, metadata, awsRestjson1_deserializeOpErrorDissociatePackage(response, &metadata) 3449 } 3450 output := &DissociatePackageOutput{} 3451 out.Result = output 3452 3453 var buff [1024]byte 3454 ringBuffer := smithyio.NewRingBuffer(buff[:]) 3455 3456 body := io.TeeReader(response.Body, ringBuffer) 3457 3458 decoder := json.NewDecoder(body) 3459 decoder.UseNumber() 3460 var shape interface{} 3461 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 3462 var snapshot bytes.Buffer 3463 io.Copy(&snapshot, ringBuffer) 3464 err = &smithy.DeserializationError{ 3465 Err: fmt.Errorf("failed to decode response body, %w", err), 3466 Snapshot: snapshot.Bytes(), 3467 } 3468 return out, metadata, err 3469 } 3470 3471 err = awsRestjson1_deserializeOpDocumentDissociatePackageOutput(&output, shape) 3472 if err != nil { 3473 var snapshot bytes.Buffer 3474 io.Copy(&snapshot, ringBuffer) 3475 return out, metadata, &smithy.DeserializationError{ 3476 Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), 3477 Snapshot: snapshot.Bytes(), 3478 } 3479 } 3480 3481 return out, metadata, err 3482} 3483 3484func awsRestjson1_deserializeOpErrorDissociatePackage(response *smithyhttp.Response, metadata *middleware.Metadata) error { 3485 var errorBuffer bytes.Buffer 3486 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 3487 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 3488 } 3489 errorBody := bytes.NewReader(errorBuffer.Bytes()) 3490 3491 errorCode := "UnknownError" 3492 errorMessage := errorCode 3493 3494 code := response.Header.Get("X-Amzn-ErrorType") 3495 if len(code) != 0 { 3496 errorCode = restjson.SanitizeErrorCode(code) 3497 } 3498 3499 var buff [1024]byte 3500 ringBuffer := smithyio.NewRingBuffer(buff[:]) 3501 3502 body := io.TeeReader(errorBody, ringBuffer) 3503 decoder := json.NewDecoder(body) 3504 decoder.UseNumber() 3505 code, message, err := restjson.GetErrorInfo(decoder) 3506 if err != nil { 3507 var snapshot bytes.Buffer 3508 io.Copy(&snapshot, ringBuffer) 3509 err = &smithy.DeserializationError{ 3510 Err: fmt.Errorf("failed to decode response body, %w", err), 3511 Snapshot: snapshot.Bytes(), 3512 } 3513 return err 3514 } 3515 3516 errorBody.Seek(0, io.SeekStart) 3517 if len(code) != 0 { 3518 errorCode = restjson.SanitizeErrorCode(code) 3519 } 3520 if len(message) != 0 { 3521 errorMessage = message 3522 } 3523 3524 switch { 3525 case strings.EqualFold("AccessDeniedException", errorCode): 3526 return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) 3527 3528 case strings.EqualFold("BaseException", errorCode): 3529 return awsRestjson1_deserializeErrorBaseException(response, errorBody) 3530 3531 case strings.EqualFold("ConflictException", errorCode): 3532 return awsRestjson1_deserializeErrorConflictException(response, errorBody) 3533 3534 case strings.EqualFold("InternalException", errorCode): 3535 return awsRestjson1_deserializeErrorInternalException(response, errorBody) 3536 3537 case strings.EqualFold("ResourceNotFoundException", errorCode): 3538 return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) 3539 3540 case strings.EqualFold("ValidationException", errorCode): 3541 return awsRestjson1_deserializeErrorValidationException(response, errorBody) 3542 3543 default: 3544 genericError := &smithy.GenericAPIError{ 3545 Code: errorCode, 3546 Message: errorMessage, 3547 } 3548 return genericError 3549 3550 } 3551} 3552 3553func awsRestjson1_deserializeOpDocumentDissociatePackageOutput(v **DissociatePackageOutput, value interface{}) error { 3554 if v == nil { 3555 return fmt.Errorf("unexpected nil of type %T", v) 3556 } 3557 if value == nil { 3558 return nil 3559 } 3560 3561 shape, ok := value.(map[string]interface{}) 3562 if !ok { 3563 return fmt.Errorf("unexpected JSON type %v", value) 3564 } 3565 3566 var sv *DissociatePackageOutput 3567 if *v == nil { 3568 sv = &DissociatePackageOutput{} 3569 } else { 3570 sv = *v 3571 } 3572 3573 for key, value := range shape { 3574 switch key { 3575 case "DomainPackageDetails": 3576 if err := awsRestjson1_deserializeDocumentDomainPackageDetails(&sv.DomainPackageDetails, value); err != nil { 3577 return err 3578 } 3579 3580 default: 3581 _, _ = key, value 3582 3583 } 3584 } 3585 *v = sv 3586 return nil 3587} 3588 3589type awsRestjson1_deserializeOpGetCompatibleElasticsearchVersions struct { 3590} 3591 3592func (*awsRestjson1_deserializeOpGetCompatibleElasticsearchVersions) ID() string { 3593 return "OperationDeserializer" 3594} 3595 3596func (m *awsRestjson1_deserializeOpGetCompatibleElasticsearchVersions) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 3597 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 3598) { 3599 out, metadata, err = next.HandleDeserialize(ctx, in) 3600 if err != nil { 3601 return out, metadata, err 3602 } 3603 3604 response, ok := out.RawResponse.(*smithyhttp.Response) 3605 if !ok { 3606 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 3607 } 3608 3609 if response.StatusCode < 200 || response.StatusCode >= 300 { 3610 return out, metadata, awsRestjson1_deserializeOpErrorGetCompatibleElasticsearchVersions(response, &metadata) 3611 } 3612 output := &GetCompatibleElasticsearchVersionsOutput{} 3613 out.Result = output 3614 3615 var buff [1024]byte 3616 ringBuffer := smithyio.NewRingBuffer(buff[:]) 3617 3618 body := io.TeeReader(response.Body, ringBuffer) 3619 3620 decoder := json.NewDecoder(body) 3621 decoder.UseNumber() 3622 var shape interface{} 3623 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 3624 var snapshot bytes.Buffer 3625 io.Copy(&snapshot, ringBuffer) 3626 err = &smithy.DeserializationError{ 3627 Err: fmt.Errorf("failed to decode response body, %w", err), 3628 Snapshot: snapshot.Bytes(), 3629 } 3630 return out, metadata, err 3631 } 3632 3633 err = awsRestjson1_deserializeOpDocumentGetCompatibleElasticsearchVersionsOutput(&output, shape) 3634 if err != nil { 3635 var snapshot bytes.Buffer 3636 io.Copy(&snapshot, ringBuffer) 3637 return out, metadata, &smithy.DeserializationError{ 3638 Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), 3639 Snapshot: snapshot.Bytes(), 3640 } 3641 } 3642 3643 return out, metadata, err 3644} 3645 3646func awsRestjson1_deserializeOpErrorGetCompatibleElasticsearchVersions(response *smithyhttp.Response, metadata *middleware.Metadata) error { 3647 var errorBuffer bytes.Buffer 3648 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 3649 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 3650 } 3651 errorBody := bytes.NewReader(errorBuffer.Bytes()) 3652 3653 errorCode := "UnknownError" 3654 errorMessage := errorCode 3655 3656 code := response.Header.Get("X-Amzn-ErrorType") 3657 if len(code) != 0 { 3658 errorCode = restjson.SanitizeErrorCode(code) 3659 } 3660 3661 var buff [1024]byte 3662 ringBuffer := smithyio.NewRingBuffer(buff[:]) 3663 3664 body := io.TeeReader(errorBody, ringBuffer) 3665 decoder := json.NewDecoder(body) 3666 decoder.UseNumber() 3667 code, message, err := restjson.GetErrorInfo(decoder) 3668 if err != nil { 3669 var snapshot bytes.Buffer 3670 io.Copy(&snapshot, ringBuffer) 3671 err = &smithy.DeserializationError{ 3672 Err: fmt.Errorf("failed to decode response body, %w", err), 3673 Snapshot: snapshot.Bytes(), 3674 } 3675 return err 3676 } 3677 3678 errorBody.Seek(0, io.SeekStart) 3679 if len(code) != 0 { 3680 errorCode = restjson.SanitizeErrorCode(code) 3681 } 3682 if len(message) != 0 { 3683 errorMessage = message 3684 } 3685 3686 switch { 3687 case strings.EqualFold("BaseException", errorCode): 3688 return awsRestjson1_deserializeErrorBaseException(response, errorBody) 3689 3690 case strings.EqualFold("DisabledOperationException", errorCode): 3691 return awsRestjson1_deserializeErrorDisabledOperationException(response, errorBody) 3692 3693 case strings.EqualFold("InternalException", errorCode): 3694 return awsRestjson1_deserializeErrorInternalException(response, errorBody) 3695 3696 case strings.EqualFold("ResourceNotFoundException", errorCode): 3697 return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) 3698 3699 case strings.EqualFold("ValidationException", errorCode): 3700 return awsRestjson1_deserializeErrorValidationException(response, errorBody) 3701 3702 default: 3703 genericError := &smithy.GenericAPIError{ 3704 Code: errorCode, 3705 Message: errorMessage, 3706 } 3707 return genericError 3708 3709 } 3710} 3711 3712func awsRestjson1_deserializeOpDocumentGetCompatibleElasticsearchVersionsOutput(v **GetCompatibleElasticsearchVersionsOutput, value interface{}) error { 3713 if v == nil { 3714 return fmt.Errorf("unexpected nil of type %T", v) 3715 } 3716 if value == nil { 3717 return nil 3718 } 3719 3720 shape, ok := value.(map[string]interface{}) 3721 if !ok { 3722 return fmt.Errorf("unexpected JSON type %v", value) 3723 } 3724 3725 var sv *GetCompatibleElasticsearchVersionsOutput 3726 if *v == nil { 3727 sv = &GetCompatibleElasticsearchVersionsOutput{} 3728 } else { 3729 sv = *v 3730 } 3731 3732 for key, value := range shape { 3733 switch key { 3734 case "CompatibleElasticsearchVersions": 3735 if err := awsRestjson1_deserializeDocumentCompatibleElasticsearchVersionsList(&sv.CompatibleElasticsearchVersions, value); err != nil { 3736 return err 3737 } 3738 3739 default: 3740 _, _ = key, value 3741 3742 } 3743 } 3744 *v = sv 3745 return nil 3746} 3747 3748type awsRestjson1_deserializeOpGetPackageVersionHistory struct { 3749} 3750 3751func (*awsRestjson1_deserializeOpGetPackageVersionHistory) ID() string { 3752 return "OperationDeserializer" 3753} 3754 3755func (m *awsRestjson1_deserializeOpGetPackageVersionHistory) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 3756 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 3757) { 3758 out, metadata, err = next.HandleDeserialize(ctx, in) 3759 if err != nil { 3760 return out, metadata, err 3761 } 3762 3763 response, ok := out.RawResponse.(*smithyhttp.Response) 3764 if !ok { 3765 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 3766 } 3767 3768 if response.StatusCode < 200 || response.StatusCode >= 300 { 3769 return out, metadata, awsRestjson1_deserializeOpErrorGetPackageVersionHistory(response, &metadata) 3770 } 3771 output := &GetPackageVersionHistoryOutput{} 3772 out.Result = output 3773 3774 var buff [1024]byte 3775 ringBuffer := smithyio.NewRingBuffer(buff[:]) 3776 3777 body := io.TeeReader(response.Body, ringBuffer) 3778 3779 decoder := json.NewDecoder(body) 3780 decoder.UseNumber() 3781 var shape interface{} 3782 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 3783 var snapshot bytes.Buffer 3784 io.Copy(&snapshot, ringBuffer) 3785 err = &smithy.DeserializationError{ 3786 Err: fmt.Errorf("failed to decode response body, %w", err), 3787 Snapshot: snapshot.Bytes(), 3788 } 3789 return out, metadata, err 3790 } 3791 3792 err = awsRestjson1_deserializeOpDocumentGetPackageVersionHistoryOutput(&output, shape) 3793 if err != nil { 3794 var snapshot bytes.Buffer 3795 io.Copy(&snapshot, ringBuffer) 3796 return out, metadata, &smithy.DeserializationError{ 3797 Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), 3798 Snapshot: snapshot.Bytes(), 3799 } 3800 } 3801 3802 return out, metadata, err 3803} 3804 3805func awsRestjson1_deserializeOpErrorGetPackageVersionHistory(response *smithyhttp.Response, metadata *middleware.Metadata) error { 3806 var errorBuffer bytes.Buffer 3807 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 3808 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 3809 } 3810 errorBody := bytes.NewReader(errorBuffer.Bytes()) 3811 3812 errorCode := "UnknownError" 3813 errorMessage := errorCode 3814 3815 code := response.Header.Get("X-Amzn-ErrorType") 3816 if len(code) != 0 { 3817 errorCode = restjson.SanitizeErrorCode(code) 3818 } 3819 3820 var buff [1024]byte 3821 ringBuffer := smithyio.NewRingBuffer(buff[:]) 3822 3823 body := io.TeeReader(errorBody, ringBuffer) 3824 decoder := json.NewDecoder(body) 3825 decoder.UseNumber() 3826 code, message, err := restjson.GetErrorInfo(decoder) 3827 if err != nil { 3828 var snapshot bytes.Buffer 3829 io.Copy(&snapshot, ringBuffer) 3830 err = &smithy.DeserializationError{ 3831 Err: fmt.Errorf("failed to decode response body, %w", err), 3832 Snapshot: snapshot.Bytes(), 3833 } 3834 return err 3835 } 3836 3837 errorBody.Seek(0, io.SeekStart) 3838 if len(code) != 0 { 3839 errorCode = restjson.SanitizeErrorCode(code) 3840 } 3841 if len(message) != 0 { 3842 errorMessage = message 3843 } 3844 3845 switch { 3846 case strings.EqualFold("AccessDeniedException", errorCode): 3847 return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) 3848 3849 case strings.EqualFold("BaseException", errorCode): 3850 return awsRestjson1_deserializeErrorBaseException(response, errorBody) 3851 3852 case strings.EqualFold("InternalException", errorCode): 3853 return awsRestjson1_deserializeErrorInternalException(response, errorBody) 3854 3855 case strings.EqualFold("ResourceNotFoundException", errorCode): 3856 return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) 3857 3858 case strings.EqualFold("ValidationException", errorCode): 3859 return awsRestjson1_deserializeErrorValidationException(response, errorBody) 3860 3861 default: 3862 genericError := &smithy.GenericAPIError{ 3863 Code: errorCode, 3864 Message: errorMessage, 3865 } 3866 return genericError 3867 3868 } 3869} 3870 3871func awsRestjson1_deserializeOpDocumentGetPackageVersionHistoryOutput(v **GetPackageVersionHistoryOutput, value interface{}) error { 3872 if v == nil { 3873 return fmt.Errorf("unexpected nil of type %T", v) 3874 } 3875 if value == nil { 3876 return nil 3877 } 3878 3879 shape, ok := value.(map[string]interface{}) 3880 if !ok { 3881 return fmt.Errorf("unexpected JSON type %v", value) 3882 } 3883 3884 var sv *GetPackageVersionHistoryOutput 3885 if *v == nil { 3886 sv = &GetPackageVersionHistoryOutput{} 3887 } else { 3888 sv = *v 3889 } 3890 3891 for key, value := range shape { 3892 switch key { 3893 case "NextToken": 3894 if value != nil { 3895 jtv, ok := value.(string) 3896 if !ok { 3897 return fmt.Errorf("expected String to be of type string, got %T instead", value) 3898 } 3899 sv.NextToken = ptr.String(jtv) 3900 } 3901 3902 case "PackageID": 3903 if value != nil { 3904 jtv, ok := value.(string) 3905 if !ok { 3906 return fmt.Errorf("expected PackageID to be of type string, got %T instead", value) 3907 } 3908 sv.PackageID = ptr.String(jtv) 3909 } 3910 3911 case "PackageVersionHistoryList": 3912 if err := awsRestjson1_deserializeDocumentPackageVersionHistoryList(&sv.PackageVersionHistoryList, value); err != nil { 3913 return err 3914 } 3915 3916 default: 3917 _, _ = key, value 3918 3919 } 3920 } 3921 *v = sv 3922 return nil 3923} 3924 3925type awsRestjson1_deserializeOpGetUpgradeHistory struct { 3926} 3927 3928func (*awsRestjson1_deserializeOpGetUpgradeHistory) ID() string { 3929 return "OperationDeserializer" 3930} 3931 3932func (m *awsRestjson1_deserializeOpGetUpgradeHistory) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 3933 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 3934) { 3935 out, metadata, err = next.HandleDeserialize(ctx, in) 3936 if err != nil { 3937 return out, metadata, err 3938 } 3939 3940 response, ok := out.RawResponse.(*smithyhttp.Response) 3941 if !ok { 3942 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 3943 } 3944 3945 if response.StatusCode < 200 || response.StatusCode >= 300 { 3946 return out, metadata, awsRestjson1_deserializeOpErrorGetUpgradeHistory(response, &metadata) 3947 } 3948 output := &GetUpgradeHistoryOutput{} 3949 out.Result = output 3950 3951 var buff [1024]byte 3952 ringBuffer := smithyio.NewRingBuffer(buff[:]) 3953 3954 body := io.TeeReader(response.Body, ringBuffer) 3955 3956 decoder := json.NewDecoder(body) 3957 decoder.UseNumber() 3958 var shape interface{} 3959 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 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 out, metadata, err 3967 } 3968 3969 err = awsRestjson1_deserializeOpDocumentGetUpgradeHistoryOutput(&output, shape) 3970 if err != nil { 3971 var snapshot bytes.Buffer 3972 io.Copy(&snapshot, ringBuffer) 3973 return out, metadata, &smithy.DeserializationError{ 3974 Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), 3975 Snapshot: snapshot.Bytes(), 3976 } 3977 } 3978 3979 return out, metadata, err 3980} 3981 3982func awsRestjson1_deserializeOpErrorGetUpgradeHistory(response *smithyhttp.Response, metadata *middleware.Metadata) error { 3983 var errorBuffer bytes.Buffer 3984 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 3985 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 3986 } 3987 errorBody := bytes.NewReader(errorBuffer.Bytes()) 3988 3989 errorCode := "UnknownError" 3990 errorMessage := errorCode 3991 3992 code := response.Header.Get("X-Amzn-ErrorType") 3993 if len(code) != 0 { 3994 errorCode = restjson.SanitizeErrorCode(code) 3995 } 3996 3997 var buff [1024]byte 3998 ringBuffer := smithyio.NewRingBuffer(buff[:]) 3999 4000 body := io.TeeReader(errorBody, ringBuffer) 4001 decoder := json.NewDecoder(body) 4002 decoder.UseNumber() 4003 code, message, err := restjson.GetErrorInfo(decoder) 4004 if err != nil { 4005 var snapshot bytes.Buffer 4006 io.Copy(&snapshot, ringBuffer) 4007 err = &smithy.DeserializationError{ 4008 Err: fmt.Errorf("failed to decode response body, %w", err), 4009 Snapshot: snapshot.Bytes(), 4010 } 4011 return err 4012 } 4013 4014 errorBody.Seek(0, io.SeekStart) 4015 if len(code) != 0 { 4016 errorCode = restjson.SanitizeErrorCode(code) 4017 } 4018 if len(message) != 0 { 4019 errorMessage = message 4020 } 4021 4022 switch { 4023 case strings.EqualFold("BaseException", errorCode): 4024 return awsRestjson1_deserializeErrorBaseException(response, errorBody) 4025 4026 case strings.EqualFold("DisabledOperationException", errorCode): 4027 return awsRestjson1_deserializeErrorDisabledOperationException(response, errorBody) 4028 4029 case strings.EqualFold("InternalException", errorCode): 4030 return awsRestjson1_deserializeErrorInternalException(response, errorBody) 4031 4032 case strings.EqualFold("ResourceNotFoundException", errorCode): 4033 return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) 4034 4035 case strings.EqualFold("ValidationException", errorCode): 4036 return awsRestjson1_deserializeErrorValidationException(response, errorBody) 4037 4038 default: 4039 genericError := &smithy.GenericAPIError{ 4040 Code: errorCode, 4041 Message: errorMessage, 4042 } 4043 return genericError 4044 4045 } 4046} 4047 4048func awsRestjson1_deserializeOpDocumentGetUpgradeHistoryOutput(v **GetUpgradeHistoryOutput, value interface{}) error { 4049 if v == nil { 4050 return fmt.Errorf("unexpected nil of type %T", v) 4051 } 4052 if value == nil { 4053 return nil 4054 } 4055 4056 shape, ok := value.(map[string]interface{}) 4057 if !ok { 4058 return fmt.Errorf("unexpected JSON type %v", value) 4059 } 4060 4061 var sv *GetUpgradeHistoryOutput 4062 if *v == nil { 4063 sv = &GetUpgradeHistoryOutput{} 4064 } else { 4065 sv = *v 4066 } 4067 4068 for key, value := range shape { 4069 switch key { 4070 case "NextToken": 4071 if value != nil { 4072 jtv, ok := value.(string) 4073 if !ok { 4074 return fmt.Errorf("expected String to be of type string, got %T instead", value) 4075 } 4076 sv.NextToken = ptr.String(jtv) 4077 } 4078 4079 case "UpgradeHistories": 4080 if err := awsRestjson1_deserializeDocumentUpgradeHistoryList(&sv.UpgradeHistories, value); err != nil { 4081 return err 4082 } 4083 4084 default: 4085 _, _ = key, value 4086 4087 } 4088 } 4089 *v = sv 4090 return nil 4091} 4092 4093type awsRestjson1_deserializeOpGetUpgradeStatus struct { 4094} 4095 4096func (*awsRestjson1_deserializeOpGetUpgradeStatus) ID() string { 4097 return "OperationDeserializer" 4098} 4099 4100func (m *awsRestjson1_deserializeOpGetUpgradeStatus) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 4101 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 4102) { 4103 out, metadata, err = next.HandleDeserialize(ctx, in) 4104 if err != nil { 4105 return out, metadata, err 4106 } 4107 4108 response, ok := out.RawResponse.(*smithyhttp.Response) 4109 if !ok { 4110 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 4111 } 4112 4113 if response.StatusCode < 200 || response.StatusCode >= 300 { 4114 return out, metadata, awsRestjson1_deserializeOpErrorGetUpgradeStatus(response, &metadata) 4115 } 4116 output := &GetUpgradeStatusOutput{} 4117 out.Result = output 4118 4119 var buff [1024]byte 4120 ringBuffer := smithyio.NewRingBuffer(buff[:]) 4121 4122 body := io.TeeReader(response.Body, ringBuffer) 4123 4124 decoder := json.NewDecoder(body) 4125 decoder.UseNumber() 4126 var shape interface{} 4127 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 4128 var snapshot bytes.Buffer 4129 io.Copy(&snapshot, ringBuffer) 4130 err = &smithy.DeserializationError{ 4131 Err: fmt.Errorf("failed to decode response body, %w", err), 4132 Snapshot: snapshot.Bytes(), 4133 } 4134 return out, metadata, err 4135 } 4136 4137 err = awsRestjson1_deserializeOpDocumentGetUpgradeStatusOutput(&output, shape) 4138 if err != nil { 4139 var snapshot bytes.Buffer 4140 io.Copy(&snapshot, ringBuffer) 4141 return out, metadata, &smithy.DeserializationError{ 4142 Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), 4143 Snapshot: snapshot.Bytes(), 4144 } 4145 } 4146 4147 return out, metadata, err 4148} 4149 4150func awsRestjson1_deserializeOpErrorGetUpgradeStatus(response *smithyhttp.Response, metadata *middleware.Metadata) error { 4151 var errorBuffer bytes.Buffer 4152 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 4153 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 4154 } 4155 errorBody := bytes.NewReader(errorBuffer.Bytes()) 4156 4157 errorCode := "UnknownError" 4158 errorMessage := errorCode 4159 4160 code := response.Header.Get("X-Amzn-ErrorType") 4161 if len(code) != 0 { 4162 errorCode = restjson.SanitizeErrorCode(code) 4163 } 4164 4165 var buff [1024]byte 4166 ringBuffer := smithyio.NewRingBuffer(buff[:]) 4167 4168 body := io.TeeReader(errorBody, ringBuffer) 4169 decoder := json.NewDecoder(body) 4170 decoder.UseNumber() 4171 code, message, err := restjson.GetErrorInfo(decoder) 4172 if err != nil { 4173 var snapshot bytes.Buffer 4174 io.Copy(&snapshot, ringBuffer) 4175 err = &smithy.DeserializationError{ 4176 Err: fmt.Errorf("failed to decode response body, %w", err), 4177 Snapshot: snapshot.Bytes(), 4178 } 4179 return err 4180 } 4181 4182 errorBody.Seek(0, io.SeekStart) 4183 if len(code) != 0 { 4184 errorCode = restjson.SanitizeErrorCode(code) 4185 } 4186 if len(message) != 0 { 4187 errorMessage = message 4188 } 4189 4190 switch { 4191 case strings.EqualFold("BaseException", errorCode): 4192 return awsRestjson1_deserializeErrorBaseException(response, errorBody) 4193 4194 case strings.EqualFold("DisabledOperationException", errorCode): 4195 return awsRestjson1_deserializeErrorDisabledOperationException(response, errorBody) 4196 4197 case strings.EqualFold("InternalException", errorCode): 4198 return awsRestjson1_deserializeErrorInternalException(response, errorBody) 4199 4200 case strings.EqualFold("ResourceNotFoundException", errorCode): 4201 return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) 4202 4203 case strings.EqualFold("ValidationException", errorCode): 4204 return awsRestjson1_deserializeErrorValidationException(response, errorBody) 4205 4206 default: 4207 genericError := &smithy.GenericAPIError{ 4208 Code: errorCode, 4209 Message: errorMessage, 4210 } 4211 return genericError 4212 4213 } 4214} 4215 4216func awsRestjson1_deserializeOpDocumentGetUpgradeStatusOutput(v **GetUpgradeStatusOutput, value interface{}) error { 4217 if v == nil { 4218 return fmt.Errorf("unexpected nil of type %T", v) 4219 } 4220 if value == nil { 4221 return nil 4222 } 4223 4224 shape, ok := value.(map[string]interface{}) 4225 if !ok { 4226 return fmt.Errorf("unexpected JSON type %v", value) 4227 } 4228 4229 var sv *GetUpgradeStatusOutput 4230 if *v == nil { 4231 sv = &GetUpgradeStatusOutput{} 4232 } else { 4233 sv = *v 4234 } 4235 4236 for key, value := range shape { 4237 switch key { 4238 case "StepStatus": 4239 if value != nil { 4240 jtv, ok := value.(string) 4241 if !ok { 4242 return fmt.Errorf("expected UpgradeStatus to be of type string, got %T instead", value) 4243 } 4244 sv.StepStatus = types.UpgradeStatus(jtv) 4245 } 4246 4247 case "UpgradeName": 4248 if value != nil { 4249 jtv, ok := value.(string) 4250 if !ok { 4251 return fmt.Errorf("expected UpgradeName to be of type string, got %T instead", value) 4252 } 4253 sv.UpgradeName = ptr.String(jtv) 4254 } 4255 4256 case "UpgradeStep": 4257 if value != nil { 4258 jtv, ok := value.(string) 4259 if !ok { 4260 return fmt.Errorf("expected UpgradeStep to be of type string, got %T instead", value) 4261 } 4262 sv.UpgradeStep = types.UpgradeStep(jtv) 4263 } 4264 4265 default: 4266 _, _ = key, value 4267 4268 } 4269 } 4270 *v = sv 4271 return nil 4272} 4273 4274type awsRestjson1_deserializeOpListDomainNames struct { 4275} 4276 4277func (*awsRestjson1_deserializeOpListDomainNames) ID() string { 4278 return "OperationDeserializer" 4279} 4280 4281func (m *awsRestjson1_deserializeOpListDomainNames) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 4282 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 4283) { 4284 out, metadata, err = next.HandleDeserialize(ctx, in) 4285 if err != nil { 4286 return out, metadata, err 4287 } 4288 4289 response, ok := out.RawResponse.(*smithyhttp.Response) 4290 if !ok { 4291 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 4292 } 4293 4294 if response.StatusCode < 200 || response.StatusCode >= 300 { 4295 return out, metadata, awsRestjson1_deserializeOpErrorListDomainNames(response, &metadata) 4296 } 4297 output := &ListDomainNamesOutput{} 4298 out.Result = output 4299 4300 var buff [1024]byte 4301 ringBuffer := smithyio.NewRingBuffer(buff[:]) 4302 4303 body := io.TeeReader(response.Body, ringBuffer) 4304 4305 decoder := json.NewDecoder(body) 4306 decoder.UseNumber() 4307 var shape interface{} 4308 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 4309 var snapshot bytes.Buffer 4310 io.Copy(&snapshot, ringBuffer) 4311 err = &smithy.DeserializationError{ 4312 Err: fmt.Errorf("failed to decode response body, %w", err), 4313 Snapshot: snapshot.Bytes(), 4314 } 4315 return out, metadata, err 4316 } 4317 4318 err = awsRestjson1_deserializeOpDocumentListDomainNamesOutput(&output, shape) 4319 if err != nil { 4320 var snapshot bytes.Buffer 4321 io.Copy(&snapshot, ringBuffer) 4322 return out, metadata, &smithy.DeserializationError{ 4323 Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), 4324 Snapshot: snapshot.Bytes(), 4325 } 4326 } 4327 4328 return out, metadata, err 4329} 4330 4331func awsRestjson1_deserializeOpErrorListDomainNames(response *smithyhttp.Response, metadata *middleware.Metadata) error { 4332 var errorBuffer bytes.Buffer 4333 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 4334 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 4335 } 4336 errorBody := bytes.NewReader(errorBuffer.Bytes()) 4337 4338 errorCode := "UnknownError" 4339 errorMessage := errorCode 4340 4341 code := response.Header.Get("X-Amzn-ErrorType") 4342 if len(code) != 0 { 4343 errorCode = restjson.SanitizeErrorCode(code) 4344 } 4345 4346 var buff [1024]byte 4347 ringBuffer := smithyio.NewRingBuffer(buff[:]) 4348 4349 body := io.TeeReader(errorBody, ringBuffer) 4350 decoder := json.NewDecoder(body) 4351 decoder.UseNumber() 4352 code, message, err := restjson.GetErrorInfo(decoder) 4353 if err != nil { 4354 var snapshot bytes.Buffer 4355 io.Copy(&snapshot, ringBuffer) 4356 err = &smithy.DeserializationError{ 4357 Err: fmt.Errorf("failed to decode response body, %w", err), 4358 Snapshot: snapshot.Bytes(), 4359 } 4360 return err 4361 } 4362 4363 errorBody.Seek(0, io.SeekStart) 4364 if len(code) != 0 { 4365 errorCode = restjson.SanitizeErrorCode(code) 4366 } 4367 if len(message) != 0 { 4368 errorMessage = message 4369 } 4370 4371 switch { 4372 case strings.EqualFold("BaseException", errorCode): 4373 return awsRestjson1_deserializeErrorBaseException(response, errorBody) 4374 4375 case strings.EqualFold("ValidationException", errorCode): 4376 return awsRestjson1_deserializeErrorValidationException(response, errorBody) 4377 4378 default: 4379 genericError := &smithy.GenericAPIError{ 4380 Code: errorCode, 4381 Message: errorMessage, 4382 } 4383 return genericError 4384 4385 } 4386} 4387 4388func awsRestjson1_deserializeOpDocumentListDomainNamesOutput(v **ListDomainNamesOutput, value interface{}) error { 4389 if v == nil { 4390 return fmt.Errorf("unexpected nil of type %T", v) 4391 } 4392 if value == nil { 4393 return nil 4394 } 4395 4396 shape, ok := value.(map[string]interface{}) 4397 if !ok { 4398 return fmt.Errorf("unexpected JSON type %v", value) 4399 } 4400 4401 var sv *ListDomainNamesOutput 4402 if *v == nil { 4403 sv = &ListDomainNamesOutput{} 4404 } else { 4405 sv = *v 4406 } 4407 4408 for key, value := range shape { 4409 switch key { 4410 case "DomainNames": 4411 if err := awsRestjson1_deserializeDocumentDomainInfoList(&sv.DomainNames, value); err != nil { 4412 return err 4413 } 4414 4415 default: 4416 _, _ = key, value 4417 4418 } 4419 } 4420 *v = sv 4421 return nil 4422} 4423 4424type awsRestjson1_deserializeOpListDomainsForPackage struct { 4425} 4426 4427func (*awsRestjson1_deserializeOpListDomainsForPackage) ID() string { 4428 return "OperationDeserializer" 4429} 4430 4431func (m *awsRestjson1_deserializeOpListDomainsForPackage) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 4432 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 4433) { 4434 out, metadata, err = next.HandleDeserialize(ctx, in) 4435 if err != nil { 4436 return out, metadata, err 4437 } 4438 4439 response, ok := out.RawResponse.(*smithyhttp.Response) 4440 if !ok { 4441 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 4442 } 4443 4444 if response.StatusCode < 200 || response.StatusCode >= 300 { 4445 return out, metadata, awsRestjson1_deserializeOpErrorListDomainsForPackage(response, &metadata) 4446 } 4447 output := &ListDomainsForPackageOutput{} 4448 out.Result = output 4449 4450 var buff [1024]byte 4451 ringBuffer := smithyio.NewRingBuffer(buff[:]) 4452 4453 body := io.TeeReader(response.Body, ringBuffer) 4454 4455 decoder := json.NewDecoder(body) 4456 decoder.UseNumber() 4457 var shape interface{} 4458 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 4459 var snapshot bytes.Buffer 4460 io.Copy(&snapshot, ringBuffer) 4461 err = &smithy.DeserializationError{ 4462 Err: fmt.Errorf("failed to decode response body, %w", err), 4463 Snapshot: snapshot.Bytes(), 4464 } 4465 return out, metadata, err 4466 } 4467 4468 err = awsRestjson1_deserializeOpDocumentListDomainsForPackageOutput(&output, shape) 4469 if err != nil { 4470 var snapshot bytes.Buffer 4471 io.Copy(&snapshot, ringBuffer) 4472 return out, metadata, &smithy.DeserializationError{ 4473 Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), 4474 Snapshot: snapshot.Bytes(), 4475 } 4476 } 4477 4478 return out, metadata, err 4479} 4480 4481func awsRestjson1_deserializeOpErrorListDomainsForPackage(response *smithyhttp.Response, metadata *middleware.Metadata) error { 4482 var errorBuffer bytes.Buffer 4483 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 4484 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 4485 } 4486 errorBody := bytes.NewReader(errorBuffer.Bytes()) 4487 4488 errorCode := "UnknownError" 4489 errorMessage := errorCode 4490 4491 code := response.Header.Get("X-Amzn-ErrorType") 4492 if len(code) != 0 { 4493 errorCode = restjson.SanitizeErrorCode(code) 4494 } 4495 4496 var buff [1024]byte 4497 ringBuffer := smithyio.NewRingBuffer(buff[:]) 4498 4499 body := io.TeeReader(errorBody, ringBuffer) 4500 decoder := json.NewDecoder(body) 4501 decoder.UseNumber() 4502 code, message, err := restjson.GetErrorInfo(decoder) 4503 if err != nil { 4504 var snapshot bytes.Buffer 4505 io.Copy(&snapshot, ringBuffer) 4506 err = &smithy.DeserializationError{ 4507 Err: fmt.Errorf("failed to decode response body, %w", err), 4508 Snapshot: snapshot.Bytes(), 4509 } 4510 return err 4511 } 4512 4513 errorBody.Seek(0, io.SeekStart) 4514 if len(code) != 0 { 4515 errorCode = restjson.SanitizeErrorCode(code) 4516 } 4517 if len(message) != 0 { 4518 errorMessage = message 4519 } 4520 4521 switch { 4522 case strings.EqualFold("AccessDeniedException", errorCode): 4523 return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) 4524 4525 case strings.EqualFold("BaseException", errorCode): 4526 return awsRestjson1_deserializeErrorBaseException(response, errorBody) 4527 4528 case strings.EqualFold("InternalException", errorCode): 4529 return awsRestjson1_deserializeErrorInternalException(response, errorBody) 4530 4531 case strings.EqualFold("ResourceNotFoundException", errorCode): 4532 return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) 4533 4534 case strings.EqualFold("ValidationException", errorCode): 4535 return awsRestjson1_deserializeErrorValidationException(response, errorBody) 4536 4537 default: 4538 genericError := &smithy.GenericAPIError{ 4539 Code: errorCode, 4540 Message: errorMessage, 4541 } 4542 return genericError 4543 4544 } 4545} 4546 4547func awsRestjson1_deserializeOpDocumentListDomainsForPackageOutput(v **ListDomainsForPackageOutput, value interface{}) error { 4548 if v == nil { 4549 return fmt.Errorf("unexpected nil of type %T", v) 4550 } 4551 if value == nil { 4552 return nil 4553 } 4554 4555 shape, ok := value.(map[string]interface{}) 4556 if !ok { 4557 return fmt.Errorf("unexpected JSON type %v", value) 4558 } 4559 4560 var sv *ListDomainsForPackageOutput 4561 if *v == nil { 4562 sv = &ListDomainsForPackageOutput{} 4563 } else { 4564 sv = *v 4565 } 4566 4567 for key, value := range shape { 4568 switch key { 4569 case "DomainPackageDetailsList": 4570 if err := awsRestjson1_deserializeDocumentDomainPackageDetailsList(&sv.DomainPackageDetailsList, value); err != nil { 4571 return err 4572 } 4573 4574 case "NextToken": 4575 if value != nil { 4576 jtv, ok := value.(string) 4577 if !ok { 4578 return fmt.Errorf("expected String to be of type string, got %T instead", value) 4579 } 4580 sv.NextToken = ptr.String(jtv) 4581 } 4582 4583 default: 4584 _, _ = key, value 4585 4586 } 4587 } 4588 *v = sv 4589 return nil 4590} 4591 4592type awsRestjson1_deserializeOpListElasticsearchInstanceTypes struct { 4593} 4594 4595func (*awsRestjson1_deserializeOpListElasticsearchInstanceTypes) ID() string { 4596 return "OperationDeserializer" 4597} 4598 4599func (m *awsRestjson1_deserializeOpListElasticsearchInstanceTypes) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 4600 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 4601) { 4602 out, metadata, err = next.HandleDeserialize(ctx, in) 4603 if err != nil { 4604 return out, metadata, err 4605 } 4606 4607 response, ok := out.RawResponse.(*smithyhttp.Response) 4608 if !ok { 4609 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 4610 } 4611 4612 if response.StatusCode < 200 || response.StatusCode >= 300 { 4613 return out, metadata, awsRestjson1_deserializeOpErrorListElasticsearchInstanceTypes(response, &metadata) 4614 } 4615 output := &ListElasticsearchInstanceTypesOutput{} 4616 out.Result = output 4617 4618 var buff [1024]byte 4619 ringBuffer := smithyio.NewRingBuffer(buff[:]) 4620 4621 body := io.TeeReader(response.Body, ringBuffer) 4622 4623 decoder := json.NewDecoder(body) 4624 decoder.UseNumber() 4625 var shape interface{} 4626 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 4627 var snapshot bytes.Buffer 4628 io.Copy(&snapshot, ringBuffer) 4629 err = &smithy.DeserializationError{ 4630 Err: fmt.Errorf("failed to decode response body, %w", err), 4631 Snapshot: snapshot.Bytes(), 4632 } 4633 return out, metadata, err 4634 } 4635 4636 err = awsRestjson1_deserializeOpDocumentListElasticsearchInstanceTypesOutput(&output, shape) 4637 if err != nil { 4638 var snapshot bytes.Buffer 4639 io.Copy(&snapshot, ringBuffer) 4640 return out, metadata, &smithy.DeserializationError{ 4641 Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), 4642 Snapshot: snapshot.Bytes(), 4643 } 4644 } 4645 4646 return out, metadata, err 4647} 4648 4649func awsRestjson1_deserializeOpErrorListElasticsearchInstanceTypes(response *smithyhttp.Response, metadata *middleware.Metadata) error { 4650 var errorBuffer bytes.Buffer 4651 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 4652 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 4653 } 4654 errorBody := bytes.NewReader(errorBuffer.Bytes()) 4655 4656 errorCode := "UnknownError" 4657 errorMessage := errorCode 4658 4659 code := response.Header.Get("X-Amzn-ErrorType") 4660 if len(code) != 0 { 4661 errorCode = restjson.SanitizeErrorCode(code) 4662 } 4663 4664 var buff [1024]byte 4665 ringBuffer := smithyio.NewRingBuffer(buff[:]) 4666 4667 body := io.TeeReader(errorBody, ringBuffer) 4668 decoder := json.NewDecoder(body) 4669 decoder.UseNumber() 4670 code, message, err := restjson.GetErrorInfo(decoder) 4671 if err != nil { 4672 var snapshot bytes.Buffer 4673 io.Copy(&snapshot, ringBuffer) 4674 err = &smithy.DeserializationError{ 4675 Err: fmt.Errorf("failed to decode response body, %w", err), 4676 Snapshot: snapshot.Bytes(), 4677 } 4678 return err 4679 } 4680 4681 errorBody.Seek(0, io.SeekStart) 4682 if len(code) != 0 { 4683 errorCode = restjson.SanitizeErrorCode(code) 4684 } 4685 if len(message) != 0 { 4686 errorMessage = message 4687 } 4688 4689 switch { 4690 case strings.EqualFold("BaseException", errorCode): 4691 return awsRestjson1_deserializeErrorBaseException(response, errorBody) 4692 4693 case strings.EqualFold("InternalException", errorCode): 4694 return awsRestjson1_deserializeErrorInternalException(response, errorBody) 4695 4696 case strings.EqualFold("ResourceNotFoundException", errorCode): 4697 return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) 4698 4699 case strings.EqualFold("ValidationException", errorCode): 4700 return awsRestjson1_deserializeErrorValidationException(response, errorBody) 4701 4702 default: 4703 genericError := &smithy.GenericAPIError{ 4704 Code: errorCode, 4705 Message: errorMessage, 4706 } 4707 return genericError 4708 4709 } 4710} 4711 4712func awsRestjson1_deserializeOpDocumentListElasticsearchInstanceTypesOutput(v **ListElasticsearchInstanceTypesOutput, value interface{}) error { 4713 if v == nil { 4714 return fmt.Errorf("unexpected nil of type %T", v) 4715 } 4716 if value == nil { 4717 return nil 4718 } 4719 4720 shape, ok := value.(map[string]interface{}) 4721 if !ok { 4722 return fmt.Errorf("unexpected JSON type %v", value) 4723 } 4724 4725 var sv *ListElasticsearchInstanceTypesOutput 4726 if *v == nil { 4727 sv = &ListElasticsearchInstanceTypesOutput{} 4728 } else { 4729 sv = *v 4730 } 4731 4732 for key, value := range shape { 4733 switch key { 4734 case "ElasticsearchInstanceTypes": 4735 if err := awsRestjson1_deserializeDocumentElasticsearchInstanceTypeList(&sv.ElasticsearchInstanceTypes, value); err != nil { 4736 return err 4737 } 4738 4739 case "NextToken": 4740 if value != nil { 4741 jtv, ok := value.(string) 4742 if !ok { 4743 return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) 4744 } 4745 sv.NextToken = ptr.String(jtv) 4746 } 4747 4748 default: 4749 _, _ = key, value 4750 4751 } 4752 } 4753 *v = sv 4754 return nil 4755} 4756 4757type awsRestjson1_deserializeOpListElasticsearchVersions struct { 4758} 4759 4760func (*awsRestjson1_deserializeOpListElasticsearchVersions) ID() string { 4761 return "OperationDeserializer" 4762} 4763 4764func (m *awsRestjson1_deserializeOpListElasticsearchVersions) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 4765 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 4766) { 4767 out, metadata, err = next.HandleDeserialize(ctx, in) 4768 if err != nil { 4769 return out, metadata, err 4770 } 4771 4772 response, ok := out.RawResponse.(*smithyhttp.Response) 4773 if !ok { 4774 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 4775 } 4776 4777 if response.StatusCode < 200 || response.StatusCode >= 300 { 4778 return out, metadata, awsRestjson1_deserializeOpErrorListElasticsearchVersions(response, &metadata) 4779 } 4780 output := &ListElasticsearchVersionsOutput{} 4781 out.Result = output 4782 4783 var buff [1024]byte 4784 ringBuffer := smithyio.NewRingBuffer(buff[:]) 4785 4786 body := io.TeeReader(response.Body, ringBuffer) 4787 4788 decoder := json.NewDecoder(body) 4789 decoder.UseNumber() 4790 var shape interface{} 4791 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 4792 var snapshot bytes.Buffer 4793 io.Copy(&snapshot, ringBuffer) 4794 err = &smithy.DeserializationError{ 4795 Err: fmt.Errorf("failed to decode response body, %w", err), 4796 Snapshot: snapshot.Bytes(), 4797 } 4798 return out, metadata, err 4799 } 4800 4801 err = awsRestjson1_deserializeOpDocumentListElasticsearchVersionsOutput(&output, shape) 4802 if err != nil { 4803 var snapshot bytes.Buffer 4804 io.Copy(&snapshot, ringBuffer) 4805 return out, metadata, &smithy.DeserializationError{ 4806 Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), 4807 Snapshot: snapshot.Bytes(), 4808 } 4809 } 4810 4811 return out, metadata, err 4812} 4813 4814func awsRestjson1_deserializeOpErrorListElasticsearchVersions(response *smithyhttp.Response, metadata *middleware.Metadata) error { 4815 var errorBuffer bytes.Buffer 4816 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 4817 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 4818 } 4819 errorBody := bytes.NewReader(errorBuffer.Bytes()) 4820 4821 errorCode := "UnknownError" 4822 errorMessage := errorCode 4823 4824 code := response.Header.Get("X-Amzn-ErrorType") 4825 if len(code) != 0 { 4826 errorCode = restjson.SanitizeErrorCode(code) 4827 } 4828 4829 var buff [1024]byte 4830 ringBuffer := smithyio.NewRingBuffer(buff[:]) 4831 4832 body := io.TeeReader(errorBody, ringBuffer) 4833 decoder := json.NewDecoder(body) 4834 decoder.UseNumber() 4835 code, message, err := restjson.GetErrorInfo(decoder) 4836 if err != nil { 4837 var snapshot bytes.Buffer 4838 io.Copy(&snapshot, ringBuffer) 4839 err = &smithy.DeserializationError{ 4840 Err: fmt.Errorf("failed to decode response body, %w", err), 4841 Snapshot: snapshot.Bytes(), 4842 } 4843 return err 4844 } 4845 4846 errorBody.Seek(0, io.SeekStart) 4847 if len(code) != 0 { 4848 errorCode = restjson.SanitizeErrorCode(code) 4849 } 4850 if len(message) != 0 { 4851 errorMessage = message 4852 } 4853 4854 switch { 4855 case strings.EqualFold("BaseException", errorCode): 4856 return awsRestjson1_deserializeErrorBaseException(response, errorBody) 4857 4858 case strings.EqualFold("InternalException", errorCode): 4859 return awsRestjson1_deserializeErrorInternalException(response, errorBody) 4860 4861 case strings.EqualFold("ResourceNotFoundException", errorCode): 4862 return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) 4863 4864 case strings.EqualFold("ValidationException", errorCode): 4865 return awsRestjson1_deserializeErrorValidationException(response, errorBody) 4866 4867 default: 4868 genericError := &smithy.GenericAPIError{ 4869 Code: errorCode, 4870 Message: errorMessage, 4871 } 4872 return genericError 4873 4874 } 4875} 4876 4877func awsRestjson1_deserializeOpDocumentListElasticsearchVersionsOutput(v **ListElasticsearchVersionsOutput, value interface{}) error { 4878 if v == nil { 4879 return fmt.Errorf("unexpected nil of type %T", v) 4880 } 4881 if value == nil { 4882 return nil 4883 } 4884 4885 shape, ok := value.(map[string]interface{}) 4886 if !ok { 4887 return fmt.Errorf("unexpected JSON type %v", value) 4888 } 4889 4890 var sv *ListElasticsearchVersionsOutput 4891 if *v == nil { 4892 sv = &ListElasticsearchVersionsOutput{} 4893 } else { 4894 sv = *v 4895 } 4896 4897 for key, value := range shape { 4898 switch key { 4899 case "ElasticsearchVersions": 4900 if err := awsRestjson1_deserializeDocumentElasticsearchVersionList(&sv.ElasticsearchVersions, value); err != nil { 4901 return err 4902 } 4903 4904 case "NextToken": 4905 if value != nil { 4906 jtv, ok := value.(string) 4907 if !ok { 4908 return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) 4909 } 4910 sv.NextToken = ptr.String(jtv) 4911 } 4912 4913 default: 4914 _, _ = key, value 4915 4916 } 4917 } 4918 *v = sv 4919 return nil 4920} 4921 4922type awsRestjson1_deserializeOpListPackagesForDomain struct { 4923} 4924 4925func (*awsRestjson1_deserializeOpListPackagesForDomain) ID() string { 4926 return "OperationDeserializer" 4927} 4928 4929func (m *awsRestjson1_deserializeOpListPackagesForDomain) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 4930 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 4931) { 4932 out, metadata, err = next.HandleDeserialize(ctx, in) 4933 if err != nil { 4934 return out, metadata, err 4935 } 4936 4937 response, ok := out.RawResponse.(*smithyhttp.Response) 4938 if !ok { 4939 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 4940 } 4941 4942 if response.StatusCode < 200 || response.StatusCode >= 300 { 4943 return out, metadata, awsRestjson1_deserializeOpErrorListPackagesForDomain(response, &metadata) 4944 } 4945 output := &ListPackagesForDomainOutput{} 4946 out.Result = output 4947 4948 var buff [1024]byte 4949 ringBuffer := smithyio.NewRingBuffer(buff[:]) 4950 4951 body := io.TeeReader(response.Body, ringBuffer) 4952 4953 decoder := json.NewDecoder(body) 4954 decoder.UseNumber() 4955 var shape interface{} 4956 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 4957 var snapshot bytes.Buffer 4958 io.Copy(&snapshot, ringBuffer) 4959 err = &smithy.DeserializationError{ 4960 Err: fmt.Errorf("failed to decode response body, %w", err), 4961 Snapshot: snapshot.Bytes(), 4962 } 4963 return out, metadata, err 4964 } 4965 4966 err = awsRestjson1_deserializeOpDocumentListPackagesForDomainOutput(&output, shape) 4967 if err != nil { 4968 var snapshot bytes.Buffer 4969 io.Copy(&snapshot, ringBuffer) 4970 return out, metadata, &smithy.DeserializationError{ 4971 Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), 4972 Snapshot: snapshot.Bytes(), 4973 } 4974 } 4975 4976 return out, metadata, err 4977} 4978 4979func awsRestjson1_deserializeOpErrorListPackagesForDomain(response *smithyhttp.Response, metadata *middleware.Metadata) error { 4980 var errorBuffer bytes.Buffer 4981 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 4982 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 4983 } 4984 errorBody := bytes.NewReader(errorBuffer.Bytes()) 4985 4986 errorCode := "UnknownError" 4987 errorMessage := errorCode 4988 4989 code := response.Header.Get("X-Amzn-ErrorType") 4990 if len(code) != 0 { 4991 errorCode = restjson.SanitizeErrorCode(code) 4992 } 4993 4994 var buff [1024]byte 4995 ringBuffer := smithyio.NewRingBuffer(buff[:]) 4996 4997 body := io.TeeReader(errorBody, ringBuffer) 4998 decoder := json.NewDecoder(body) 4999 decoder.UseNumber() 5000 code, message, err := restjson.GetErrorInfo(decoder) 5001 if err != nil { 5002 var snapshot bytes.Buffer 5003 io.Copy(&snapshot, ringBuffer) 5004 err = &smithy.DeserializationError{ 5005 Err: fmt.Errorf("failed to decode response body, %w", err), 5006 Snapshot: snapshot.Bytes(), 5007 } 5008 return err 5009 } 5010 5011 errorBody.Seek(0, io.SeekStart) 5012 if len(code) != 0 { 5013 errorCode = restjson.SanitizeErrorCode(code) 5014 } 5015 if len(message) != 0 { 5016 errorMessage = message 5017 } 5018 5019 switch { 5020 case strings.EqualFold("AccessDeniedException", errorCode): 5021 return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) 5022 5023 case strings.EqualFold("BaseException", errorCode): 5024 return awsRestjson1_deserializeErrorBaseException(response, errorBody) 5025 5026 case strings.EqualFold("InternalException", errorCode): 5027 return awsRestjson1_deserializeErrorInternalException(response, errorBody) 5028 5029 case strings.EqualFold("ResourceNotFoundException", errorCode): 5030 return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) 5031 5032 case strings.EqualFold("ValidationException", errorCode): 5033 return awsRestjson1_deserializeErrorValidationException(response, errorBody) 5034 5035 default: 5036 genericError := &smithy.GenericAPIError{ 5037 Code: errorCode, 5038 Message: errorMessage, 5039 } 5040 return genericError 5041 5042 } 5043} 5044 5045func awsRestjson1_deserializeOpDocumentListPackagesForDomainOutput(v **ListPackagesForDomainOutput, value interface{}) error { 5046 if v == nil { 5047 return fmt.Errorf("unexpected nil of type %T", v) 5048 } 5049 if value == nil { 5050 return nil 5051 } 5052 5053 shape, ok := value.(map[string]interface{}) 5054 if !ok { 5055 return fmt.Errorf("unexpected JSON type %v", value) 5056 } 5057 5058 var sv *ListPackagesForDomainOutput 5059 if *v == nil { 5060 sv = &ListPackagesForDomainOutput{} 5061 } else { 5062 sv = *v 5063 } 5064 5065 for key, value := range shape { 5066 switch key { 5067 case "DomainPackageDetailsList": 5068 if err := awsRestjson1_deserializeDocumentDomainPackageDetailsList(&sv.DomainPackageDetailsList, value); err != nil { 5069 return err 5070 } 5071 5072 case "NextToken": 5073 if value != nil { 5074 jtv, ok := value.(string) 5075 if !ok { 5076 return fmt.Errorf("expected String to be of type string, got %T instead", value) 5077 } 5078 sv.NextToken = ptr.String(jtv) 5079 } 5080 5081 default: 5082 _, _ = key, value 5083 5084 } 5085 } 5086 *v = sv 5087 return nil 5088} 5089 5090type awsRestjson1_deserializeOpListTags struct { 5091} 5092 5093func (*awsRestjson1_deserializeOpListTags) ID() string { 5094 return "OperationDeserializer" 5095} 5096 5097func (m *awsRestjson1_deserializeOpListTags) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 5098 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 5099) { 5100 out, metadata, err = next.HandleDeserialize(ctx, in) 5101 if err != nil { 5102 return out, metadata, err 5103 } 5104 5105 response, ok := out.RawResponse.(*smithyhttp.Response) 5106 if !ok { 5107 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 5108 } 5109 5110 if response.StatusCode < 200 || response.StatusCode >= 300 { 5111 return out, metadata, awsRestjson1_deserializeOpErrorListTags(response, &metadata) 5112 } 5113 output := &ListTagsOutput{} 5114 out.Result = output 5115 5116 var buff [1024]byte 5117 ringBuffer := smithyio.NewRingBuffer(buff[:]) 5118 5119 body := io.TeeReader(response.Body, ringBuffer) 5120 5121 decoder := json.NewDecoder(body) 5122 decoder.UseNumber() 5123 var shape interface{} 5124 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 5125 var snapshot bytes.Buffer 5126 io.Copy(&snapshot, ringBuffer) 5127 err = &smithy.DeserializationError{ 5128 Err: fmt.Errorf("failed to decode response body, %w", err), 5129 Snapshot: snapshot.Bytes(), 5130 } 5131 return out, metadata, err 5132 } 5133 5134 err = awsRestjson1_deserializeOpDocumentListTagsOutput(&output, shape) 5135 if err != nil { 5136 var snapshot bytes.Buffer 5137 io.Copy(&snapshot, ringBuffer) 5138 return out, metadata, &smithy.DeserializationError{ 5139 Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), 5140 Snapshot: snapshot.Bytes(), 5141 } 5142 } 5143 5144 return out, metadata, err 5145} 5146 5147func awsRestjson1_deserializeOpErrorListTags(response *smithyhttp.Response, metadata *middleware.Metadata) error { 5148 var errorBuffer bytes.Buffer 5149 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 5150 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 5151 } 5152 errorBody := bytes.NewReader(errorBuffer.Bytes()) 5153 5154 errorCode := "UnknownError" 5155 errorMessage := errorCode 5156 5157 code := response.Header.Get("X-Amzn-ErrorType") 5158 if len(code) != 0 { 5159 errorCode = restjson.SanitizeErrorCode(code) 5160 } 5161 5162 var buff [1024]byte 5163 ringBuffer := smithyio.NewRingBuffer(buff[:]) 5164 5165 body := io.TeeReader(errorBody, ringBuffer) 5166 decoder := json.NewDecoder(body) 5167 decoder.UseNumber() 5168 code, message, err := restjson.GetErrorInfo(decoder) 5169 if err != nil { 5170 var snapshot bytes.Buffer 5171 io.Copy(&snapshot, ringBuffer) 5172 err = &smithy.DeserializationError{ 5173 Err: fmt.Errorf("failed to decode response body, %w", err), 5174 Snapshot: snapshot.Bytes(), 5175 } 5176 return err 5177 } 5178 5179 errorBody.Seek(0, io.SeekStart) 5180 if len(code) != 0 { 5181 errorCode = restjson.SanitizeErrorCode(code) 5182 } 5183 if len(message) != 0 { 5184 errorMessage = message 5185 } 5186 5187 switch { 5188 case strings.EqualFold("BaseException", errorCode): 5189 return awsRestjson1_deserializeErrorBaseException(response, errorBody) 5190 5191 case strings.EqualFold("InternalException", errorCode): 5192 return awsRestjson1_deserializeErrorInternalException(response, errorBody) 5193 5194 case strings.EqualFold("ResourceNotFoundException", errorCode): 5195 return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) 5196 5197 case strings.EqualFold("ValidationException", errorCode): 5198 return awsRestjson1_deserializeErrorValidationException(response, errorBody) 5199 5200 default: 5201 genericError := &smithy.GenericAPIError{ 5202 Code: errorCode, 5203 Message: errorMessage, 5204 } 5205 return genericError 5206 5207 } 5208} 5209 5210func awsRestjson1_deserializeOpDocumentListTagsOutput(v **ListTagsOutput, value interface{}) error { 5211 if v == nil { 5212 return fmt.Errorf("unexpected nil of type %T", v) 5213 } 5214 if value == nil { 5215 return nil 5216 } 5217 5218 shape, ok := value.(map[string]interface{}) 5219 if !ok { 5220 return fmt.Errorf("unexpected JSON type %v", value) 5221 } 5222 5223 var sv *ListTagsOutput 5224 if *v == nil { 5225 sv = &ListTagsOutput{} 5226 } else { 5227 sv = *v 5228 } 5229 5230 for key, value := range shape { 5231 switch key { 5232 case "TagList": 5233 if err := awsRestjson1_deserializeDocumentTagList(&sv.TagList, value); err != nil { 5234 return err 5235 } 5236 5237 default: 5238 _, _ = key, value 5239 5240 } 5241 } 5242 *v = sv 5243 return nil 5244} 5245 5246type awsRestjson1_deserializeOpPurchaseReservedElasticsearchInstanceOffering struct { 5247} 5248 5249func (*awsRestjson1_deserializeOpPurchaseReservedElasticsearchInstanceOffering) ID() string { 5250 return "OperationDeserializer" 5251} 5252 5253func (m *awsRestjson1_deserializeOpPurchaseReservedElasticsearchInstanceOffering) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 5254 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 5255) { 5256 out, metadata, err = next.HandleDeserialize(ctx, in) 5257 if err != nil { 5258 return out, metadata, err 5259 } 5260 5261 response, ok := out.RawResponse.(*smithyhttp.Response) 5262 if !ok { 5263 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 5264 } 5265 5266 if response.StatusCode < 200 || response.StatusCode >= 300 { 5267 return out, metadata, awsRestjson1_deserializeOpErrorPurchaseReservedElasticsearchInstanceOffering(response, &metadata) 5268 } 5269 output := &PurchaseReservedElasticsearchInstanceOfferingOutput{} 5270 out.Result = output 5271 5272 var buff [1024]byte 5273 ringBuffer := smithyio.NewRingBuffer(buff[:]) 5274 5275 body := io.TeeReader(response.Body, ringBuffer) 5276 5277 decoder := json.NewDecoder(body) 5278 decoder.UseNumber() 5279 var shape interface{} 5280 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 5281 var snapshot bytes.Buffer 5282 io.Copy(&snapshot, ringBuffer) 5283 err = &smithy.DeserializationError{ 5284 Err: fmt.Errorf("failed to decode response body, %w", err), 5285 Snapshot: snapshot.Bytes(), 5286 } 5287 return out, metadata, err 5288 } 5289 5290 err = awsRestjson1_deserializeOpDocumentPurchaseReservedElasticsearchInstanceOfferingOutput(&output, shape) 5291 if err != nil { 5292 var snapshot bytes.Buffer 5293 io.Copy(&snapshot, ringBuffer) 5294 return out, metadata, &smithy.DeserializationError{ 5295 Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), 5296 Snapshot: snapshot.Bytes(), 5297 } 5298 } 5299 5300 return out, metadata, err 5301} 5302 5303func awsRestjson1_deserializeOpErrorPurchaseReservedElasticsearchInstanceOffering(response *smithyhttp.Response, metadata *middleware.Metadata) error { 5304 var errorBuffer bytes.Buffer 5305 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 5306 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 5307 } 5308 errorBody := bytes.NewReader(errorBuffer.Bytes()) 5309 5310 errorCode := "UnknownError" 5311 errorMessage := errorCode 5312 5313 code := response.Header.Get("X-Amzn-ErrorType") 5314 if len(code) != 0 { 5315 errorCode = restjson.SanitizeErrorCode(code) 5316 } 5317 5318 var buff [1024]byte 5319 ringBuffer := smithyio.NewRingBuffer(buff[:]) 5320 5321 body := io.TeeReader(errorBody, ringBuffer) 5322 decoder := json.NewDecoder(body) 5323 decoder.UseNumber() 5324 code, message, err := restjson.GetErrorInfo(decoder) 5325 if err != nil { 5326 var snapshot bytes.Buffer 5327 io.Copy(&snapshot, ringBuffer) 5328 err = &smithy.DeserializationError{ 5329 Err: fmt.Errorf("failed to decode response body, %w", err), 5330 Snapshot: snapshot.Bytes(), 5331 } 5332 return err 5333 } 5334 5335 errorBody.Seek(0, io.SeekStart) 5336 if len(code) != 0 { 5337 errorCode = restjson.SanitizeErrorCode(code) 5338 } 5339 if len(message) != 0 { 5340 errorMessage = message 5341 } 5342 5343 switch { 5344 case strings.EqualFold("DisabledOperationException", errorCode): 5345 return awsRestjson1_deserializeErrorDisabledOperationException(response, errorBody) 5346 5347 case strings.EqualFold("InternalException", errorCode): 5348 return awsRestjson1_deserializeErrorInternalException(response, errorBody) 5349 5350 case strings.EqualFold("LimitExceededException", errorCode): 5351 return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) 5352 5353 case strings.EqualFold("ResourceAlreadyExistsException", errorCode): 5354 return awsRestjson1_deserializeErrorResourceAlreadyExistsException(response, errorBody) 5355 5356 case strings.EqualFold("ResourceNotFoundException", errorCode): 5357 return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) 5358 5359 case strings.EqualFold("ValidationException", errorCode): 5360 return awsRestjson1_deserializeErrorValidationException(response, errorBody) 5361 5362 default: 5363 genericError := &smithy.GenericAPIError{ 5364 Code: errorCode, 5365 Message: errorMessage, 5366 } 5367 return genericError 5368 5369 } 5370} 5371 5372func awsRestjson1_deserializeOpDocumentPurchaseReservedElasticsearchInstanceOfferingOutput(v **PurchaseReservedElasticsearchInstanceOfferingOutput, value interface{}) error { 5373 if v == nil { 5374 return fmt.Errorf("unexpected nil of type %T", v) 5375 } 5376 if value == nil { 5377 return nil 5378 } 5379 5380 shape, ok := value.(map[string]interface{}) 5381 if !ok { 5382 return fmt.Errorf("unexpected JSON type %v", value) 5383 } 5384 5385 var sv *PurchaseReservedElasticsearchInstanceOfferingOutput 5386 if *v == nil { 5387 sv = &PurchaseReservedElasticsearchInstanceOfferingOutput{} 5388 } else { 5389 sv = *v 5390 } 5391 5392 for key, value := range shape { 5393 switch key { 5394 case "ReservationName": 5395 if value != nil { 5396 jtv, ok := value.(string) 5397 if !ok { 5398 return fmt.Errorf("expected ReservationToken to be of type string, got %T instead", value) 5399 } 5400 sv.ReservationName = ptr.String(jtv) 5401 } 5402 5403 case "ReservedElasticsearchInstanceId": 5404 if value != nil { 5405 jtv, ok := value.(string) 5406 if !ok { 5407 return fmt.Errorf("expected GUID to be of type string, got %T instead", value) 5408 } 5409 sv.ReservedElasticsearchInstanceId = ptr.String(jtv) 5410 } 5411 5412 default: 5413 _, _ = key, value 5414 5415 } 5416 } 5417 *v = sv 5418 return nil 5419} 5420 5421type awsRestjson1_deserializeOpRejectInboundCrossClusterSearchConnection struct { 5422} 5423 5424func (*awsRestjson1_deserializeOpRejectInboundCrossClusterSearchConnection) ID() string { 5425 return "OperationDeserializer" 5426} 5427 5428func (m *awsRestjson1_deserializeOpRejectInboundCrossClusterSearchConnection) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 5429 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 5430) { 5431 out, metadata, err = next.HandleDeserialize(ctx, in) 5432 if err != nil { 5433 return out, metadata, err 5434 } 5435 5436 response, ok := out.RawResponse.(*smithyhttp.Response) 5437 if !ok { 5438 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 5439 } 5440 5441 if response.StatusCode < 200 || response.StatusCode >= 300 { 5442 return out, metadata, awsRestjson1_deserializeOpErrorRejectInboundCrossClusterSearchConnection(response, &metadata) 5443 } 5444 output := &RejectInboundCrossClusterSearchConnectionOutput{} 5445 out.Result = output 5446 5447 var buff [1024]byte 5448 ringBuffer := smithyio.NewRingBuffer(buff[:]) 5449 5450 body := io.TeeReader(response.Body, ringBuffer) 5451 5452 decoder := json.NewDecoder(body) 5453 decoder.UseNumber() 5454 var shape interface{} 5455 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 5456 var snapshot bytes.Buffer 5457 io.Copy(&snapshot, ringBuffer) 5458 err = &smithy.DeserializationError{ 5459 Err: fmt.Errorf("failed to decode response body, %w", err), 5460 Snapshot: snapshot.Bytes(), 5461 } 5462 return out, metadata, err 5463 } 5464 5465 err = awsRestjson1_deserializeOpDocumentRejectInboundCrossClusterSearchConnectionOutput(&output, shape) 5466 if err != nil { 5467 var snapshot bytes.Buffer 5468 io.Copy(&snapshot, ringBuffer) 5469 return out, metadata, &smithy.DeserializationError{ 5470 Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), 5471 Snapshot: snapshot.Bytes(), 5472 } 5473 } 5474 5475 return out, metadata, err 5476} 5477 5478func awsRestjson1_deserializeOpErrorRejectInboundCrossClusterSearchConnection(response *smithyhttp.Response, metadata *middleware.Metadata) error { 5479 var errorBuffer bytes.Buffer 5480 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 5481 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 5482 } 5483 errorBody := bytes.NewReader(errorBuffer.Bytes()) 5484 5485 errorCode := "UnknownError" 5486 errorMessage := errorCode 5487 5488 code := response.Header.Get("X-Amzn-ErrorType") 5489 if len(code) != 0 { 5490 errorCode = restjson.SanitizeErrorCode(code) 5491 } 5492 5493 var buff [1024]byte 5494 ringBuffer := smithyio.NewRingBuffer(buff[:]) 5495 5496 body := io.TeeReader(errorBody, ringBuffer) 5497 decoder := json.NewDecoder(body) 5498 decoder.UseNumber() 5499 code, message, err := restjson.GetErrorInfo(decoder) 5500 if err != nil { 5501 var snapshot bytes.Buffer 5502 io.Copy(&snapshot, ringBuffer) 5503 err = &smithy.DeserializationError{ 5504 Err: fmt.Errorf("failed to decode response body, %w", err), 5505 Snapshot: snapshot.Bytes(), 5506 } 5507 return err 5508 } 5509 5510 errorBody.Seek(0, io.SeekStart) 5511 if len(code) != 0 { 5512 errorCode = restjson.SanitizeErrorCode(code) 5513 } 5514 if len(message) != 0 { 5515 errorMessage = message 5516 } 5517 5518 switch { 5519 case strings.EqualFold("DisabledOperationException", errorCode): 5520 return awsRestjson1_deserializeErrorDisabledOperationException(response, errorBody) 5521 5522 case strings.EqualFold("ResourceNotFoundException", errorCode): 5523 return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) 5524 5525 default: 5526 genericError := &smithy.GenericAPIError{ 5527 Code: errorCode, 5528 Message: errorMessage, 5529 } 5530 return genericError 5531 5532 } 5533} 5534 5535func awsRestjson1_deserializeOpDocumentRejectInboundCrossClusterSearchConnectionOutput(v **RejectInboundCrossClusterSearchConnectionOutput, value interface{}) error { 5536 if v == nil { 5537 return fmt.Errorf("unexpected nil of type %T", v) 5538 } 5539 if value == nil { 5540 return nil 5541 } 5542 5543 shape, ok := value.(map[string]interface{}) 5544 if !ok { 5545 return fmt.Errorf("unexpected JSON type %v", value) 5546 } 5547 5548 var sv *RejectInboundCrossClusterSearchConnectionOutput 5549 if *v == nil { 5550 sv = &RejectInboundCrossClusterSearchConnectionOutput{} 5551 } else { 5552 sv = *v 5553 } 5554 5555 for key, value := range shape { 5556 switch key { 5557 case "CrossClusterSearchConnection": 5558 if err := awsRestjson1_deserializeDocumentInboundCrossClusterSearchConnection(&sv.CrossClusterSearchConnection, value); err != nil { 5559 return err 5560 } 5561 5562 default: 5563 _, _ = key, value 5564 5565 } 5566 } 5567 *v = sv 5568 return nil 5569} 5570 5571type awsRestjson1_deserializeOpRemoveTags struct { 5572} 5573 5574func (*awsRestjson1_deserializeOpRemoveTags) ID() string { 5575 return "OperationDeserializer" 5576} 5577 5578func (m *awsRestjson1_deserializeOpRemoveTags) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 5579 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 5580) { 5581 out, metadata, err = next.HandleDeserialize(ctx, in) 5582 if err != nil { 5583 return out, metadata, err 5584 } 5585 5586 response, ok := out.RawResponse.(*smithyhttp.Response) 5587 if !ok { 5588 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 5589 } 5590 5591 if response.StatusCode < 200 || response.StatusCode >= 300 { 5592 return out, metadata, awsRestjson1_deserializeOpErrorRemoveTags(response, &metadata) 5593 } 5594 output := &RemoveTagsOutput{} 5595 out.Result = output 5596 5597 if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { 5598 return out, metadata, &smithy.DeserializationError{ 5599 Err: fmt.Errorf("failed to discard response body, %w", err), 5600 } 5601 } 5602 5603 return out, metadata, err 5604} 5605 5606func awsRestjson1_deserializeOpErrorRemoveTags(response *smithyhttp.Response, metadata *middleware.Metadata) error { 5607 var errorBuffer bytes.Buffer 5608 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 5609 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 5610 } 5611 errorBody := bytes.NewReader(errorBuffer.Bytes()) 5612 5613 errorCode := "UnknownError" 5614 errorMessage := errorCode 5615 5616 code := response.Header.Get("X-Amzn-ErrorType") 5617 if len(code) != 0 { 5618 errorCode = restjson.SanitizeErrorCode(code) 5619 } 5620 5621 var buff [1024]byte 5622 ringBuffer := smithyio.NewRingBuffer(buff[:]) 5623 5624 body := io.TeeReader(errorBody, ringBuffer) 5625 decoder := json.NewDecoder(body) 5626 decoder.UseNumber() 5627 code, message, err := restjson.GetErrorInfo(decoder) 5628 if err != nil { 5629 var snapshot bytes.Buffer 5630 io.Copy(&snapshot, ringBuffer) 5631 err = &smithy.DeserializationError{ 5632 Err: fmt.Errorf("failed to decode response body, %w", err), 5633 Snapshot: snapshot.Bytes(), 5634 } 5635 return err 5636 } 5637 5638 errorBody.Seek(0, io.SeekStart) 5639 if len(code) != 0 { 5640 errorCode = restjson.SanitizeErrorCode(code) 5641 } 5642 if len(message) != 0 { 5643 errorMessage = message 5644 } 5645 5646 switch { 5647 case strings.EqualFold("BaseException", errorCode): 5648 return awsRestjson1_deserializeErrorBaseException(response, errorBody) 5649 5650 case strings.EqualFold("InternalException", errorCode): 5651 return awsRestjson1_deserializeErrorInternalException(response, errorBody) 5652 5653 case strings.EqualFold("ValidationException", errorCode): 5654 return awsRestjson1_deserializeErrorValidationException(response, errorBody) 5655 5656 default: 5657 genericError := &smithy.GenericAPIError{ 5658 Code: errorCode, 5659 Message: errorMessage, 5660 } 5661 return genericError 5662 5663 } 5664} 5665 5666type awsRestjson1_deserializeOpStartElasticsearchServiceSoftwareUpdate struct { 5667} 5668 5669func (*awsRestjson1_deserializeOpStartElasticsearchServiceSoftwareUpdate) ID() string { 5670 return "OperationDeserializer" 5671} 5672 5673func (m *awsRestjson1_deserializeOpStartElasticsearchServiceSoftwareUpdate) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 5674 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 5675) { 5676 out, metadata, err = next.HandleDeserialize(ctx, in) 5677 if err != nil { 5678 return out, metadata, err 5679 } 5680 5681 response, ok := out.RawResponse.(*smithyhttp.Response) 5682 if !ok { 5683 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 5684 } 5685 5686 if response.StatusCode < 200 || response.StatusCode >= 300 { 5687 return out, metadata, awsRestjson1_deserializeOpErrorStartElasticsearchServiceSoftwareUpdate(response, &metadata) 5688 } 5689 output := &StartElasticsearchServiceSoftwareUpdateOutput{} 5690 out.Result = output 5691 5692 var buff [1024]byte 5693 ringBuffer := smithyio.NewRingBuffer(buff[:]) 5694 5695 body := io.TeeReader(response.Body, ringBuffer) 5696 5697 decoder := json.NewDecoder(body) 5698 decoder.UseNumber() 5699 var shape interface{} 5700 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 5701 var snapshot bytes.Buffer 5702 io.Copy(&snapshot, ringBuffer) 5703 err = &smithy.DeserializationError{ 5704 Err: fmt.Errorf("failed to decode response body, %w", err), 5705 Snapshot: snapshot.Bytes(), 5706 } 5707 return out, metadata, err 5708 } 5709 5710 err = awsRestjson1_deserializeOpDocumentStartElasticsearchServiceSoftwareUpdateOutput(&output, shape) 5711 if err != nil { 5712 var snapshot bytes.Buffer 5713 io.Copy(&snapshot, ringBuffer) 5714 return out, metadata, &smithy.DeserializationError{ 5715 Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), 5716 Snapshot: snapshot.Bytes(), 5717 } 5718 } 5719 5720 return out, metadata, err 5721} 5722 5723func awsRestjson1_deserializeOpErrorStartElasticsearchServiceSoftwareUpdate(response *smithyhttp.Response, metadata *middleware.Metadata) error { 5724 var errorBuffer bytes.Buffer 5725 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 5726 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 5727 } 5728 errorBody := bytes.NewReader(errorBuffer.Bytes()) 5729 5730 errorCode := "UnknownError" 5731 errorMessage := errorCode 5732 5733 code := response.Header.Get("X-Amzn-ErrorType") 5734 if len(code) != 0 { 5735 errorCode = restjson.SanitizeErrorCode(code) 5736 } 5737 5738 var buff [1024]byte 5739 ringBuffer := smithyio.NewRingBuffer(buff[:]) 5740 5741 body := io.TeeReader(errorBody, ringBuffer) 5742 decoder := json.NewDecoder(body) 5743 decoder.UseNumber() 5744 code, message, err := restjson.GetErrorInfo(decoder) 5745 if err != nil { 5746 var snapshot bytes.Buffer 5747 io.Copy(&snapshot, ringBuffer) 5748 err = &smithy.DeserializationError{ 5749 Err: fmt.Errorf("failed to decode response body, %w", err), 5750 Snapshot: snapshot.Bytes(), 5751 } 5752 return err 5753 } 5754 5755 errorBody.Seek(0, io.SeekStart) 5756 if len(code) != 0 { 5757 errorCode = restjson.SanitizeErrorCode(code) 5758 } 5759 if len(message) != 0 { 5760 errorMessage = message 5761 } 5762 5763 switch { 5764 case strings.EqualFold("BaseException", errorCode): 5765 return awsRestjson1_deserializeErrorBaseException(response, errorBody) 5766 5767 case strings.EqualFold("InternalException", errorCode): 5768 return awsRestjson1_deserializeErrorInternalException(response, errorBody) 5769 5770 case strings.EqualFold("ResourceNotFoundException", errorCode): 5771 return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) 5772 5773 case strings.EqualFold("ValidationException", errorCode): 5774 return awsRestjson1_deserializeErrorValidationException(response, errorBody) 5775 5776 default: 5777 genericError := &smithy.GenericAPIError{ 5778 Code: errorCode, 5779 Message: errorMessage, 5780 } 5781 return genericError 5782 5783 } 5784} 5785 5786func awsRestjson1_deserializeOpDocumentStartElasticsearchServiceSoftwareUpdateOutput(v **StartElasticsearchServiceSoftwareUpdateOutput, value interface{}) error { 5787 if v == nil { 5788 return fmt.Errorf("unexpected nil of type %T", v) 5789 } 5790 if value == nil { 5791 return nil 5792 } 5793 5794 shape, ok := value.(map[string]interface{}) 5795 if !ok { 5796 return fmt.Errorf("unexpected JSON type %v", value) 5797 } 5798 5799 var sv *StartElasticsearchServiceSoftwareUpdateOutput 5800 if *v == nil { 5801 sv = &StartElasticsearchServiceSoftwareUpdateOutput{} 5802 } else { 5803 sv = *v 5804 } 5805 5806 for key, value := range shape { 5807 switch key { 5808 case "ServiceSoftwareOptions": 5809 if err := awsRestjson1_deserializeDocumentServiceSoftwareOptions(&sv.ServiceSoftwareOptions, value); err != nil { 5810 return err 5811 } 5812 5813 default: 5814 _, _ = key, value 5815 5816 } 5817 } 5818 *v = sv 5819 return nil 5820} 5821 5822type awsRestjson1_deserializeOpUpdateElasticsearchDomainConfig struct { 5823} 5824 5825func (*awsRestjson1_deserializeOpUpdateElasticsearchDomainConfig) ID() string { 5826 return "OperationDeserializer" 5827} 5828 5829func (m *awsRestjson1_deserializeOpUpdateElasticsearchDomainConfig) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 5830 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 5831) { 5832 out, metadata, err = next.HandleDeserialize(ctx, in) 5833 if err != nil { 5834 return out, metadata, err 5835 } 5836 5837 response, ok := out.RawResponse.(*smithyhttp.Response) 5838 if !ok { 5839 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 5840 } 5841 5842 if response.StatusCode < 200 || response.StatusCode >= 300 { 5843 return out, metadata, awsRestjson1_deserializeOpErrorUpdateElasticsearchDomainConfig(response, &metadata) 5844 } 5845 output := &UpdateElasticsearchDomainConfigOutput{} 5846 out.Result = output 5847 5848 var buff [1024]byte 5849 ringBuffer := smithyio.NewRingBuffer(buff[:]) 5850 5851 body := io.TeeReader(response.Body, ringBuffer) 5852 5853 decoder := json.NewDecoder(body) 5854 decoder.UseNumber() 5855 var shape interface{} 5856 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 5857 var snapshot bytes.Buffer 5858 io.Copy(&snapshot, ringBuffer) 5859 err = &smithy.DeserializationError{ 5860 Err: fmt.Errorf("failed to decode response body, %w", err), 5861 Snapshot: snapshot.Bytes(), 5862 } 5863 return out, metadata, err 5864 } 5865 5866 err = awsRestjson1_deserializeOpDocumentUpdateElasticsearchDomainConfigOutput(&output, shape) 5867 if err != nil { 5868 var snapshot bytes.Buffer 5869 io.Copy(&snapshot, ringBuffer) 5870 return out, metadata, &smithy.DeserializationError{ 5871 Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), 5872 Snapshot: snapshot.Bytes(), 5873 } 5874 } 5875 5876 return out, metadata, err 5877} 5878 5879func awsRestjson1_deserializeOpErrorUpdateElasticsearchDomainConfig(response *smithyhttp.Response, metadata *middleware.Metadata) error { 5880 var errorBuffer bytes.Buffer 5881 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 5882 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 5883 } 5884 errorBody := bytes.NewReader(errorBuffer.Bytes()) 5885 5886 errorCode := "UnknownError" 5887 errorMessage := errorCode 5888 5889 code := response.Header.Get("X-Amzn-ErrorType") 5890 if len(code) != 0 { 5891 errorCode = restjson.SanitizeErrorCode(code) 5892 } 5893 5894 var buff [1024]byte 5895 ringBuffer := smithyio.NewRingBuffer(buff[:]) 5896 5897 body := io.TeeReader(errorBody, ringBuffer) 5898 decoder := json.NewDecoder(body) 5899 decoder.UseNumber() 5900 code, message, err := restjson.GetErrorInfo(decoder) 5901 if err != nil { 5902 var snapshot bytes.Buffer 5903 io.Copy(&snapshot, ringBuffer) 5904 err = &smithy.DeserializationError{ 5905 Err: fmt.Errorf("failed to decode response body, %w", err), 5906 Snapshot: snapshot.Bytes(), 5907 } 5908 return err 5909 } 5910 5911 errorBody.Seek(0, io.SeekStart) 5912 if len(code) != 0 { 5913 errorCode = restjson.SanitizeErrorCode(code) 5914 } 5915 if len(message) != 0 { 5916 errorMessage = message 5917 } 5918 5919 switch { 5920 case strings.EqualFold("BaseException", errorCode): 5921 return awsRestjson1_deserializeErrorBaseException(response, errorBody) 5922 5923 case strings.EqualFold("InternalException", errorCode): 5924 return awsRestjson1_deserializeErrorInternalException(response, errorBody) 5925 5926 case strings.EqualFold("InvalidTypeException", errorCode): 5927 return awsRestjson1_deserializeErrorInvalidTypeException(response, errorBody) 5928 5929 case strings.EqualFold("LimitExceededException", errorCode): 5930 return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) 5931 5932 case strings.EqualFold("ResourceNotFoundException", errorCode): 5933 return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) 5934 5935 case strings.EqualFold("ValidationException", errorCode): 5936 return awsRestjson1_deserializeErrorValidationException(response, errorBody) 5937 5938 default: 5939 genericError := &smithy.GenericAPIError{ 5940 Code: errorCode, 5941 Message: errorMessage, 5942 } 5943 return genericError 5944 5945 } 5946} 5947 5948func awsRestjson1_deserializeOpDocumentUpdateElasticsearchDomainConfigOutput(v **UpdateElasticsearchDomainConfigOutput, value interface{}) error { 5949 if v == nil { 5950 return fmt.Errorf("unexpected nil of type %T", v) 5951 } 5952 if value == nil { 5953 return nil 5954 } 5955 5956 shape, ok := value.(map[string]interface{}) 5957 if !ok { 5958 return fmt.Errorf("unexpected JSON type %v", value) 5959 } 5960 5961 var sv *UpdateElasticsearchDomainConfigOutput 5962 if *v == nil { 5963 sv = &UpdateElasticsearchDomainConfigOutput{} 5964 } else { 5965 sv = *v 5966 } 5967 5968 for key, value := range shape { 5969 switch key { 5970 case "DomainConfig": 5971 if err := awsRestjson1_deserializeDocumentElasticsearchDomainConfig(&sv.DomainConfig, value); err != nil { 5972 return err 5973 } 5974 5975 default: 5976 _, _ = key, value 5977 5978 } 5979 } 5980 *v = sv 5981 return nil 5982} 5983 5984type awsRestjson1_deserializeOpUpdatePackage struct { 5985} 5986 5987func (*awsRestjson1_deserializeOpUpdatePackage) ID() string { 5988 return "OperationDeserializer" 5989} 5990 5991func (m *awsRestjson1_deserializeOpUpdatePackage) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 5992 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 5993) { 5994 out, metadata, err = next.HandleDeserialize(ctx, in) 5995 if err != nil { 5996 return out, metadata, err 5997 } 5998 5999 response, ok := out.RawResponse.(*smithyhttp.Response) 6000 if !ok { 6001 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 6002 } 6003 6004 if response.StatusCode < 200 || response.StatusCode >= 300 { 6005 return out, metadata, awsRestjson1_deserializeOpErrorUpdatePackage(response, &metadata) 6006 } 6007 output := &UpdatePackageOutput{} 6008 out.Result = output 6009 6010 var buff [1024]byte 6011 ringBuffer := smithyio.NewRingBuffer(buff[:]) 6012 6013 body := io.TeeReader(response.Body, ringBuffer) 6014 6015 decoder := json.NewDecoder(body) 6016 decoder.UseNumber() 6017 var shape interface{} 6018 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 6019 var snapshot bytes.Buffer 6020 io.Copy(&snapshot, ringBuffer) 6021 err = &smithy.DeserializationError{ 6022 Err: fmt.Errorf("failed to decode response body, %w", err), 6023 Snapshot: snapshot.Bytes(), 6024 } 6025 return out, metadata, err 6026 } 6027 6028 err = awsRestjson1_deserializeOpDocumentUpdatePackageOutput(&output, shape) 6029 if err != nil { 6030 var snapshot bytes.Buffer 6031 io.Copy(&snapshot, ringBuffer) 6032 return out, metadata, &smithy.DeserializationError{ 6033 Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), 6034 Snapshot: snapshot.Bytes(), 6035 } 6036 } 6037 6038 return out, metadata, err 6039} 6040 6041func awsRestjson1_deserializeOpErrorUpdatePackage(response *smithyhttp.Response, metadata *middleware.Metadata) error { 6042 var errorBuffer bytes.Buffer 6043 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 6044 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 6045 } 6046 errorBody := bytes.NewReader(errorBuffer.Bytes()) 6047 6048 errorCode := "UnknownError" 6049 errorMessage := errorCode 6050 6051 code := response.Header.Get("X-Amzn-ErrorType") 6052 if len(code) != 0 { 6053 errorCode = restjson.SanitizeErrorCode(code) 6054 } 6055 6056 var buff [1024]byte 6057 ringBuffer := smithyio.NewRingBuffer(buff[:]) 6058 6059 body := io.TeeReader(errorBody, ringBuffer) 6060 decoder := json.NewDecoder(body) 6061 decoder.UseNumber() 6062 code, message, err := restjson.GetErrorInfo(decoder) 6063 if err != nil { 6064 var snapshot bytes.Buffer 6065 io.Copy(&snapshot, ringBuffer) 6066 err = &smithy.DeserializationError{ 6067 Err: fmt.Errorf("failed to decode response body, %w", err), 6068 Snapshot: snapshot.Bytes(), 6069 } 6070 return err 6071 } 6072 6073 errorBody.Seek(0, io.SeekStart) 6074 if len(code) != 0 { 6075 errorCode = restjson.SanitizeErrorCode(code) 6076 } 6077 if len(message) != 0 { 6078 errorMessage = message 6079 } 6080 6081 switch { 6082 case strings.EqualFold("AccessDeniedException", errorCode): 6083 return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) 6084 6085 case strings.EqualFold("BaseException", errorCode): 6086 return awsRestjson1_deserializeErrorBaseException(response, errorBody) 6087 6088 case strings.EqualFold("InternalException", errorCode): 6089 return awsRestjson1_deserializeErrorInternalException(response, errorBody) 6090 6091 case strings.EqualFold("LimitExceededException", errorCode): 6092 return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) 6093 6094 case strings.EqualFold("ResourceNotFoundException", errorCode): 6095 return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) 6096 6097 case strings.EqualFold("ValidationException", errorCode): 6098 return awsRestjson1_deserializeErrorValidationException(response, errorBody) 6099 6100 default: 6101 genericError := &smithy.GenericAPIError{ 6102 Code: errorCode, 6103 Message: errorMessage, 6104 } 6105 return genericError 6106 6107 } 6108} 6109 6110func awsRestjson1_deserializeOpDocumentUpdatePackageOutput(v **UpdatePackageOutput, value interface{}) error { 6111 if v == nil { 6112 return fmt.Errorf("unexpected nil of type %T", v) 6113 } 6114 if value == nil { 6115 return nil 6116 } 6117 6118 shape, ok := value.(map[string]interface{}) 6119 if !ok { 6120 return fmt.Errorf("unexpected JSON type %v", value) 6121 } 6122 6123 var sv *UpdatePackageOutput 6124 if *v == nil { 6125 sv = &UpdatePackageOutput{} 6126 } else { 6127 sv = *v 6128 } 6129 6130 for key, value := range shape { 6131 switch key { 6132 case "PackageDetails": 6133 if err := awsRestjson1_deserializeDocumentPackageDetails(&sv.PackageDetails, value); err != nil { 6134 return err 6135 } 6136 6137 default: 6138 _, _ = key, value 6139 6140 } 6141 } 6142 *v = sv 6143 return nil 6144} 6145 6146type awsRestjson1_deserializeOpUpgradeElasticsearchDomain struct { 6147} 6148 6149func (*awsRestjson1_deserializeOpUpgradeElasticsearchDomain) ID() string { 6150 return "OperationDeserializer" 6151} 6152 6153func (m *awsRestjson1_deserializeOpUpgradeElasticsearchDomain) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 6154 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 6155) { 6156 out, metadata, err = next.HandleDeserialize(ctx, in) 6157 if err != nil { 6158 return out, metadata, err 6159 } 6160 6161 response, ok := out.RawResponse.(*smithyhttp.Response) 6162 if !ok { 6163 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 6164 } 6165 6166 if response.StatusCode < 200 || response.StatusCode >= 300 { 6167 return out, metadata, awsRestjson1_deserializeOpErrorUpgradeElasticsearchDomain(response, &metadata) 6168 } 6169 output := &UpgradeElasticsearchDomainOutput{} 6170 out.Result = output 6171 6172 var buff [1024]byte 6173 ringBuffer := smithyio.NewRingBuffer(buff[:]) 6174 6175 body := io.TeeReader(response.Body, ringBuffer) 6176 6177 decoder := json.NewDecoder(body) 6178 decoder.UseNumber() 6179 var shape interface{} 6180 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 6181 var snapshot bytes.Buffer 6182 io.Copy(&snapshot, ringBuffer) 6183 err = &smithy.DeserializationError{ 6184 Err: fmt.Errorf("failed to decode response body, %w", err), 6185 Snapshot: snapshot.Bytes(), 6186 } 6187 return out, metadata, err 6188 } 6189 6190 err = awsRestjson1_deserializeOpDocumentUpgradeElasticsearchDomainOutput(&output, shape) 6191 if err != nil { 6192 var snapshot bytes.Buffer 6193 io.Copy(&snapshot, ringBuffer) 6194 return out, metadata, &smithy.DeserializationError{ 6195 Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), 6196 Snapshot: snapshot.Bytes(), 6197 } 6198 } 6199 6200 return out, metadata, err 6201} 6202 6203func awsRestjson1_deserializeOpErrorUpgradeElasticsearchDomain(response *smithyhttp.Response, metadata *middleware.Metadata) error { 6204 var errorBuffer bytes.Buffer 6205 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 6206 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 6207 } 6208 errorBody := bytes.NewReader(errorBuffer.Bytes()) 6209 6210 errorCode := "UnknownError" 6211 errorMessage := errorCode 6212 6213 code := response.Header.Get("X-Amzn-ErrorType") 6214 if len(code) != 0 { 6215 errorCode = restjson.SanitizeErrorCode(code) 6216 } 6217 6218 var buff [1024]byte 6219 ringBuffer := smithyio.NewRingBuffer(buff[:]) 6220 6221 body := io.TeeReader(errorBody, ringBuffer) 6222 decoder := json.NewDecoder(body) 6223 decoder.UseNumber() 6224 code, message, err := restjson.GetErrorInfo(decoder) 6225 if err != nil { 6226 var snapshot bytes.Buffer 6227 io.Copy(&snapshot, ringBuffer) 6228 err = &smithy.DeserializationError{ 6229 Err: fmt.Errorf("failed to decode response body, %w", err), 6230 Snapshot: snapshot.Bytes(), 6231 } 6232 return err 6233 } 6234 6235 errorBody.Seek(0, io.SeekStart) 6236 if len(code) != 0 { 6237 errorCode = restjson.SanitizeErrorCode(code) 6238 } 6239 if len(message) != 0 { 6240 errorMessage = message 6241 } 6242 6243 switch { 6244 case strings.EqualFold("BaseException", errorCode): 6245 return awsRestjson1_deserializeErrorBaseException(response, errorBody) 6246 6247 case strings.EqualFold("DisabledOperationException", errorCode): 6248 return awsRestjson1_deserializeErrorDisabledOperationException(response, errorBody) 6249 6250 case strings.EqualFold("InternalException", errorCode): 6251 return awsRestjson1_deserializeErrorInternalException(response, errorBody) 6252 6253 case strings.EqualFold("ResourceAlreadyExistsException", errorCode): 6254 return awsRestjson1_deserializeErrorResourceAlreadyExistsException(response, errorBody) 6255 6256 case strings.EqualFold("ResourceNotFoundException", errorCode): 6257 return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) 6258 6259 case strings.EqualFold("ValidationException", errorCode): 6260 return awsRestjson1_deserializeErrorValidationException(response, errorBody) 6261 6262 default: 6263 genericError := &smithy.GenericAPIError{ 6264 Code: errorCode, 6265 Message: errorMessage, 6266 } 6267 return genericError 6268 6269 } 6270} 6271 6272func awsRestjson1_deserializeOpDocumentUpgradeElasticsearchDomainOutput(v **UpgradeElasticsearchDomainOutput, value interface{}) error { 6273 if v == nil { 6274 return fmt.Errorf("unexpected nil of type %T", v) 6275 } 6276 if value == nil { 6277 return nil 6278 } 6279 6280 shape, ok := value.(map[string]interface{}) 6281 if !ok { 6282 return fmt.Errorf("unexpected JSON type %v", value) 6283 } 6284 6285 var sv *UpgradeElasticsearchDomainOutput 6286 if *v == nil { 6287 sv = &UpgradeElasticsearchDomainOutput{} 6288 } else { 6289 sv = *v 6290 } 6291 6292 for key, value := range shape { 6293 switch key { 6294 case "DomainName": 6295 if value != nil { 6296 jtv, ok := value.(string) 6297 if !ok { 6298 return fmt.Errorf("expected DomainName to be of type string, got %T instead", value) 6299 } 6300 sv.DomainName = ptr.String(jtv) 6301 } 6302 6303 case "PerformCheckOnly": 6304 if value != nil { 6305 jtv, ok := value.(bool) 6306 if !ok { 6307 return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) 6308 } 6309 sv.PerformCheckOnly = ptr.Bool(jtv) 6310 } 6311 6312 case "TargetVersion": 6313 if value != nil { 6314 jtv, ok := value.(string) 6315 if !ok { 6316 return fmt.Errorf("expected ElasticsearchVersionString to be of type string, got %T instead", value) 6317 } 6318 sv.TargetVersion = ptr.String(jtv) 6319 } 6320 6321 default: 6322 _, _ = key, value 6323 6324 } 6325 } 6326 *v = sv 6327 return nil 6328} 6329 6330func awsRestjson1_deserializeErrorAccessDeniedException(response *smithyhttp.Response, errorBody *bytes.Reader) error { 6331 output := &types.AccessDeniedException{} 6332 var buff [1024]byte 6333 ringBuffer := smithyio.NewRingBuffer(buff[:]) 6334 6335 body := io.TeeReader(errorBody, ringBuffer) 6336 decoder := json.NewDecoder(body) 6337 decoder.UseNumber() 6338 var shape interface{} 6339 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 6340 var snapshot bytes.Buffer 6341 io.Copy(&snapshot, ringBuffer) 6342 err = &smithy.DeserializationError{ 6343 Err: fmt.Errorf("failed to decode response body, %w", err), 6344 Snapshot: snapshot.Bytes(), 6345 } 6346 return err 6347 } 6348 6349 err := awsRestjson1_deserializeDocumentAccessDeniedException(&output, shape) 6350 6351 if err != nil { 6352 var snapshot bytes.Buffer 6353 io.Copy(&snapshot, ringBuffer) 6354 err = &smithy.DeserializationError{ 6355 Err: fmt.Errorf("failed to decode response body, %w", err), 6356 Snapshot: snapshot.Bytes(), 6357 } 6358 return err 6359 } 6360 6361 errorBody.Seek(0, io.SeekStart) 6362 6363 return output 6364} 6365 6366func awsRestjson1_deserializeErrorBaseException(response *smithyhttp.Response, errorBody *bytes.Reader) error { 6367 output := &types.BaseException{} 6368 var buff [1024]byte 6369 ringBuffer := smithyio.NewRingBuffer(buff[:]) 6370 6371 body := io.TeeReader(errorBody, ringBuffer) 6372 decoder := json.NewDecoder(body) 6373 decoder.UseNumber() 6374 var shape interface{} 6375 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 6376 var snapshot bytes.Buffer 6377 io.Copy(&snapshot, ringBuffer) 6378 err = &smithy.DeserializationError{ 6379 Err: fmt.Errorf("failed to decode response body, %w", err), 6380 Snapshot: snapshot.Bytes(), 6381 } 6382 return err 6383 } 6384 6385 err := awsRestjson1_deserializeDocumentBaseException(&output, shape) 6386 6387 if err != nil { 6388 var snapshot bytes.Buffer 6389 io.Copy(&snapshot, ringBuffer) 6390 err = &smithy.DeserializationError{ 6391 Err: fmt.Errorf("failed to decode response body, %w", err), 6392 Snapshot: snapshot.Bytes(), 6393 } 6394 return err 6395 } 6396 6397 errorBody.Seek(0, io.SeekStart) 6398 6399 return output 6400} 6401 6402func awsRestjson1_deserializeErrorConflictException(response *smithyhttp.Response, errorBody *bytes.Reader) error { 6403 output := &types.ConflictException{} 6404 var buff [1024]byte 6405 ringBuffer := smithyio.NewRingBuffer(buff[:]) 6406 6407 body := io.TeeReader(errorBody, ringBuffer) 6408 decoder := json.NewDecoder(body) 6409 decoder.UseNumber() 6410 var shape interface{} 6411 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 6412 var snapshot bytes.Buffer 6413 io.Copy(&snapshot, ringBuffer) 6414 err = &smithy.DeserializationError{ 6415 Err: fmt.Errorf("failed to decode response body, %w", err), 6416 Snapshot: snapshot.Bytes(), 6417 } 6418 return err 6419 } 6420 6421 err := awsRestjson1_deserializeDocumentConflictException(&output, shape) 6422 6423 if err != nil { 6424 var snapshot bytes.Buffer 6425 io.Copy(&snapshot, ringBuffer) 6426 err = &smithy.DeserializationError{ 6427 Err: fmt.Errorf("failed to decode response body, %w", err), 6428 Snapshot: snapshot.Bytes(), 6429 } 6430 return err 6431 } 6432 6433 errorBody.Seek(0, io.SeekStart) 6434 6435 return output 6436} 6437 6438func awsRestjson1_deserializeErrorDisabledOperationException(response *smithyhttp.Response, errorBody *bytes.Reader) error { 6439 output := &types.DisabledOperationException{} 6440 var buff [1024]byte 6441 ringBuffer := smithyio.NewRingBuffer(buff[:]) 6442 6443 body := io.TeeReader(errorBody, ringBuffer) 6444 decoder := json.NewDecoder(body) 6445 decoder.UseNumber() 6446 var shape interface{} 6447 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 6448 var snapshot bytes.Buffer 6449 io.Copy(&snapshot, ringBuffer) 6450 err = &smithy.DeserializationError{ 6451 Err: fmt.Errorf("failed to decode response body, %w", err), 6452 Snapshot: snapshot.Bytes(), 6453 } 6454 return err 6455 } 6456 6457 err := awsRestjson1_deserializeDocumentDisabledOperationException(&output, shape) 6458 6459 if err != nil { 6460 var snapshot bytes.Buffer 6461 io.Copy(&snapshot, ringBuffer) 6462 err = &smithy.DeserializationError{ 6463 Err: fmt.Errorf("failed to decode response body, %w", err), 6464 Snapshot: snapshot.Bytes(), 6465 } 6466 return err 6467 } 6468 6469 errorBody.Seek(0, io.SeekStart) 6470 6471 return output 6472} 6473 6474func awsRestjson1_deserializeErrorInternalException(response *smithyhttp.Response, errorBody *bytes.Reader) error { 6475 output := &types.InternalException{} 6476 var buff [1024]byte 6477 ringBuffer := smithyio.NewRingBuffer(buff[:]) 6478 6479 body := io.TeeReader(errorBody, ringBuffer) 6480 decoder := json.NewDecoder(body) 6481 decoder.UseNumber() 6482 var shape interface{} 6483 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 6484 var snapshot bytes.Buffer 6485 io.Copy(&snapshot, ringBuffer) 6486 err = &smithy.DeserializationError{ 6487 Err: fmt.Errorf("failed to decode response body, %w", err), 6488 Snapshot: snapshot.Bytes(), 6489 } 6490 return err 6491 } 6492 6493 err := awsRestjson1_deserializeDocumentInternalException(&output, shape) 6494 6495 if err != nil { 6496 var snapshot bytes.Buffer 6497 io.Copy(&snapshot, ringBuffer) 6498 err = &smithy.DeserializationError{ 6499 Err: fmt.Errorf("failed to decode response body, %w", err), 6500 Snapshot: snapshot.Bytes(), 6501 } 6502 return err 6503 } 6504 6505 errorBody.Seek(0, io.SeekStart) 6506 6507 return output 6508} 6509 6510func awsRestjson1_deserializeErrorInvalidPaginationTokenException(response *smithyhttp.Response, errorBody *bytes.Reader) error { 6511 output := &types.InvalidPaginationTokenException{} 6512 var buff [1024]byte 6513 ringBuffer := smithyio.NewRingBuffer(buff[:]) 6514 6515 body := io.TeeReader(errorBody, ringBuffer) 6516 decoder := json.NewDecoder(body) 6517 decoder.UseNumber() 6518 var shape interface{} 6519 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 6520 var snapshot bytes.Buffer 6521 io.Copy(&snapshot, ringBuffer) 6522 err = &smithy.DeserializationError{ 6523 Err: fmt.Errorf("failed to decode response body, %w", err), 6524 Snapshot: snapshot.Bytes(), 6525 } 6526 return err 6527 } 6528 6529 err := awsRestjson1_deserializeDocumentInvalidPaginationTokenException(&output, shape) 6530 6531 if err != nil { 6532 var snapshot bytes.Buffer 6533 io.Copy(&snapshot, ringBuffer) 6534 err = &smithy.DeserializationError{ 6535 Err: fmt.Errorf("failed to decode response body, %w", err), 6536 Snapshot: snapshot.Bytes(), 6537 } 6538 return err 6539 } 6540 6541 errorBody.Seek(0, io.SeekStart) 6542 6543 return output 6544} 6545 6546func awsRestjson1_deserializeErrorInvalidTypeException(response *smithyhttp.Response, errorBody *bytes.Reader) error { 6547 output := &types.InvalidTypeException{} 6548 var buff [1024]byte 6549 ringBuffer := smithyio.NewRingBuffer(buff[:]) 6550 6551 body := io.TeeReader(errorBody, ringBuffer) 6552 decoder := json.NewDecoder(body) 6553 decoder.UseNumber() 6554 var shape interface{} 6555 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 6556 var snapshot bytes.Buffer 6557 io.Copy(&snapshot, ringBuffer) 6558 err = &smithy.DeserializationError{ 6559 Err: fmt.Errorf("failed to decode response body, %w", err), 6560 Snapshot: snapshot.Bytes(), 6561 } 6562 return err 6563 } 6564 6565 err := awsRestjson1_deserializeDocumentInvalidTypeException(&output, shape) 6566 6567 if err != nil { 6568 var snapshot bytes.Buffer 6569 io.Copy(&snapshot, ringBuffer) 6570 err = &smithy.DeserializationError{ 6571 Err: fmt.Errorf("failed to decode response body, %w", err), 6572 Snapshot: snapshot.Bytes(), 6573 } 6574 return err 6575 } 6576 6577 errorBody.Seek(0, io.SeekStart) 6578 6579 return output 6580} 6581 6582func awsRestjson1_deserializeErrorLimitExceededException(response *smithyhttp.Response, errorBody *bytes.Reader) error { 6583 output := &types.LimitExceededException{} 6584 var buff [1024]byte 6585 ringBuffer := smithyio.NewRingBuffer(buff[:]) 6586 6587 body := io.TeeReader(errorBody, ringBuffer) 6588 decoder := json.NewDecoder(body) 6589 decoder.UseNumber() 6590 var shape interface{} 6591 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 6592 var snapshot bytes.Buffer 6593 io.Copy(&snapshot, ringBuffer) 6594 err = &smithy.DeserializationError{ 6595 Err: fmt.Errorf("failed to decode response body, %w", err), 6596 Snapshot: snapshot.Bytes(), 6597 } 6598 return err 6599 } 6600 6601 err := awsRestjson1_deserializeDocumentLimitExceededException(&output, shape) 6602 6603 if err != nil { 6604 var snapshot bytes.Buffer 6605 io.Copy(&snapshot, ringBuffer) 6606 err = &smithy.DeserializationError{ 6607 Err: fmt.Errorf("failed to decode response body, %w", err), 6608 Snapshot: snapshot.Bytes(), 6609 } 6610 return err 6611 } 6612 6613 errorBody.Seek(0, io.SeekStart) 6614 6615 return output 6616} 6617 6618func awsRestjson1_deserializeErrorResourceAlreadyExistsException(response *smithyhttp.Response, errorBody *bytes.Reader) error { 6619 output := &types.ResourceAlreadyExistsException{} 6620 var buff [1024]byte 6621 ringBuffer := smithyio.NewRingBuffer(buff[:]) 6622 6623 body := io.TeeReader(errorBody, ringBuffer) 6624 decoder := json.NewDecoder(body) 6625 decoder.UseNumber() 6626 var shape interface{} 6627 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 6628 var snapshot bytes.Buffer 6629 io.Copy(&snapshot, ringBuffer) 6630 err = &smithy.DeserializationError{ 6631 Err: fmt.Errorf("failed to decode response body, %w", err), 6632 Snapshot: snapshot.Bytes(), 6633 } 6634 return err 6635 } 6636 6637 err := awsRestjson1_deserializeDocumentResourceAlreadyExistsException(&output, shape) 6638 6639 if err != nil { 6640 var snapshot bytes.Buffer 6641 io.Copy(&snapshot, ringBuffer) 6642 err = &smithy.DeserializationError{ 6643 Err: fmt.Errorf("failed to decode response body, %w", err), 6644 Snapshot: snapshot.Bytes(), 6645 } 6646 return err 6647 } 6648 6649 errorBody.Seek(0, io.SeekStart) 6650 6651 return output 6652} 6653 6654func awsRestjson1_deserializeErrorResourceNotFoundException(response *smithyhttp.Response, errorBody *bytes.Reader) error { 6655 output := &types.ResourceNotFoundException{} 6656 var buff [1024]byte 6657 ringBuffer := smithyio.NewRingBuffer(buff[:]) 6658 6659 body := io.TeeReader(errorBody, ringBuffer) 6660 decoder := json.NewDecoder(body) 6661 decoder.UseNumber() 6662 var shape interface{} 6663 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 6664 var snapshot bytes.Buffer 6665 io.Copy(&snapshot, ringBuffer) 6666 err = &smithy.DeserializationError{ 6667 Err: fmt.Errorf("failed to decode response body, %w", err), 6668 Snapshot: snapshot.Bytes(), 6669 } 6670 return err 6671 } 6672 6673 err := awsRestjson1_deserializeDocumentResourceNotFoundException(&output, shape) 6674 6675 if err != nil { 6676 var snapshot bytes.Buffer 6677 io.Copy(&snapshot, ringBuffer) 6678 err = &smithy.DeserializationError{ 6679 Err: fmt.Errorf("failed to decode response body, %w", err), 6680 Snapshot: snapshot.Bytes(), 6681 } 6682 return err 6683 } 6684 6685 errorBody.Seek(0, io.SeekStart) 6686 6687 return output 6688} 6689 6690func awsRestjson1_deserializeErrorValidationException(response *smithyhttp.Response, errorBody *bytes.Reader) error { 6691 output := &types.ValidationException{} 6692 var buff [1024]byte 6693 ringBuffer := smithyio.NewRingBuffer(buff[:]) 6694 6695 body := io.TeeReader(errorBody, ringBuffer) 6696 decoder := json.NewDecoder(body) 6697 decoder.UseNumber() 6698 var shape interface{} 6699 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 6700 var snapshot bytes.Buffer 6701 io.Copy(&snapshot, ringBuffer) 6702 err = &smithy.DeserializationError{ 6703 Err: fmt.Errorf("failed to decode response body, %w", err), 6704 Snapshot: snapshot.Bytes(), 6705 } 6706 return err 6707 } 6708 6709 err := awsRestjson1_deserializeDocumentValidationException(&output, shape) 6710 6711 if err != nil { 6712 var snapshot bytes.Buffer 6713 io.Copy(&snapshot, ringBuffer) 6714 err = &smithy.DeserializationError{ 6715 Err: fmt.Errorf("failed to decode response body, %w", err), 6716 Snapshot: snapshot.Bytes(), 6717 } 6718 return err 6719 } 6720 6721 errorBody.Seek(0, io.SeekStart) 6722 6723 return output 6724} 6725 6726func awsRestjson1_deserializeDocumentAccessDeniedException(v **types.AccessDeniedException, value interface{}) error { 6727 if v == nil { 6728 return fmt.Errorf("unexpected nil of type %T", v) 6729 } 6730 if value == nil { 6731 return nil 6732 } 6733 6734 shape, ok := value.(map[string]interface{}) 6735 if !ok { 6736 return fmt.Errorf("unexpected JSON type %v", value) 6737 } 6738 6739 var sv *types.AccessDeniedException 6740 if *v == nil { 6741 sv = &types.AccessDeniedException{} 6742 } else { 6743 sv = *v 6744 } 6745 6746 for key, value := range shape { 6747 switch key { 6748 case "message": 6749 if value != nil { 6750 jtv, ok := value.(string) 6751 if !ok { 6752 return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) 6753 } 6754 sv.Message = ptr.String(jtv) 6755 } 6756 6757 default: 6758 _, _ = key, value 6759 6760 } 6761 } 6762 *v = sv 6763 return nil 6764} 6765 6766func awsRestjson1_deserializeDocumentAccessPoliciesStatus(v **types.AccessPoliciesStatus, value interface{}) error { 6767 if v == nil { 6768 return fmt.Errorf("unexpected nil of type %T", v) 6769 } 6770 if value == nil { 6771 return nil 6772 } 6773 6774 shape, ok := value.(map[string]interface{}) 6775 if !ok { 6776 return fmt.Errorf("unexpected JSON type %v", value) 6777 } 6778 6779 var sv *types.AccessPoliciesStatus 6780 if *v == nil { 6781 sv = &types.AccessPoliciesStatus{} 6782 } else { 6783 sv = *v 6784 } 6785 6786 for key, value := range shape { 6787 switch key { 6788 case "Options": 6789 if value != nil { 6790 jtv, ok := value.(string) 6791 if !ok { 6792 return fmt.Errorf("expected PolicyDocument to be of type string, got %T instead", value) 6793 } 6794 sv.Options = ptr.String(jtv) 6795 } 6796 6797 case "Status": 6798 if err := awsRestjson1_deserializeDocumentOptionStatus(&sv.Status, value); err != nil { 6799 return err 6800 } 6801 6802 default: 6803 _, _ = key, value 6804 6805 } 6806 } 6807 *v = sv 6808 return nil 6809} 6810 6811func awsRestjson1_deserializeDocumentAdditionalLimit(v **types.AdditionalLimit, value interface{}) error { 6812 if v == nil { 6813 return fmt.Errorf("unexpected nil of type %T", v) 6814 } 6815 if value == nil { 6816 return nil 6817 } 6818 6819 shape, ok := value.(map[string]interface{}) 6820 if !ok { 6821 return fmt.Errorf("unexpected JSON type %v", value) 6822 } 6823 6824 var sv *types.AdditionalLimit 6825 if *v == nil { 6826 sv = &types.AdditionalLimit{} 6827 } else { 6828 sv = *v 6829 } 6830 6831 for key, value := range shape { 6832 switch key { 6833 case "LimitName": 6834 if value != nil { 6835 jtv, ok := value.(string) 6836 if !ok { 6837 return fmt.Errorf("expected LimitName to be of type string, got %T instead", value) 6838 } 6839 sv.LimitName = ptr.String(jtv) 6840 } 6841 6842 case "LimitValues": 6843 if err := awsRestjson1_deserializeDocumentLimitValueList(&sv.LimitValues, value); err != nil { 6844 return err 6845 } 6846 6847 default: 6848 _, _ = key, value 6849 6850 } 6851 } 6852 *v = sv 6853 return nil 6854} 6855 6856func awsRestjson1_deserializeDocumentAdditionalLimitList(v *[]types.AdditionalLimit, value interface{}) error { 6857 if v == nil { 6858 return fmt.Errorf("unexpected nil of type %T", v) 6859 } 6860 if value == nil { 6861 return nil 6862 } 6863 6864 shape, ok := value.([]interface{}) 6865 if !ok { 6866 return fmt.Errorf("unexpected JSON type %v", value) 6867 } 6868 6869 var cv []types.AdditionalLimit 6870 if *v == nil { 6871 cv = []types.AdditionalLimit{} 6872 } else { 6873 cv = *v 6874 } 6875 6876 for _, value := range shape { 6877 var col types.AdditionalLimit 6878 destAddr := &col 6879 if err := awsRestjson1_deserializeDocumentAdditionalLimit(&destAddr, value); err != nil { 6880 return err 6881 } 6882 col = *destAddr 6883 cv = append(cv, col) 6884 6885 } 6886 *v = cv 6887 return nil 6888} 6889 6890func awsRestjson1_deserializeDocumentAdvancedOptions(v *map[string]string, value interface{}) error { 6891 if v == nil { 6892 return fmt.Errorf("unexpected nil of type %T", v) 6893 } 6894 if value == nil { 6895 return nil 6896 } 6897 6898 shape, ok := value.(map[string]interface{}) 6899 if !ok { 6900 return fmt.Errorf("unexpected JSON type %v", value) 6901 } 6902 6903 var mv map[string]string 6904 if *v == nil { 6905 mv = map[string]string{} 6906 } else { 6907 mv = *v 6908 } 6909 6910 for key, value := range shape { 6911 var parsedVal string 6912 if value != nil { 6913 jtv, ok := value.(string) 6914 if !ok { 6915 return fmt.Errorf("expected String to be of type string, got %T instead", value) 6916 } 6917 parsedVal = jtv 6918 } 6919 mv[key] = parsedVal 6920 6921 } 6922 *v = mv 6923 return nil 6924} 6925 6926func awsRestjson1_deserializeDocumentAdvancedOptionsStatus(v **types.AdvancedOptionsStatus, value interface{}) error { 6927 if v == nil { 6928 return fmt.Errorf("unexpected nil of type %T", v) 6929 } 6930 if value == nil { 6931 return nil 6932 } 6933 6934 shape, ok := value.(map[string]interface{}) 6935 if !ok { 6936 return fmt.Errorf("unexpected JSON type %v", value) 6937 } 6938 6939 var sv *types.AdvancedOptionsStatus 6940 if *v == nil { 6941 sv = &types.AdvancedOptionsStatus{} 6942 } else { 6943 sv = *v 6944 } 6945 6946 for key, value := range shape { 6947 switch key { 6948 case "Options": 6949 if err := awsRestjson1_deserializeDocumentAdvancedOptions(&sv.Options, value); err != nil { 6950 return err 6951 } 6952 6953 case "Status": 6954 if err := awsRestjson1_deserializeDocumentOptionStatus(&sv.Status, value); err != nil { 6955 return err 6956 } 6957 6958 default: 6959 _, _ = key, value 6960 6961 } 6962 } 6963 *v = sv 6964 return nil 6965} 6966 6967func awsRestjson1_deserializeDocumentAdvancedSecurityOptions(v **types.AdvancedSecurityOptions, value interface{}) error { 6968 if v == nil { 6969 return fmt.Errorf("unexpected nil of type %T", v) 6970 } 6971 if value == nil { 6972 return nil 6973 } 6974 6975 shape, ok := value.(map[string]interface{}) 6976 if !ok { 6977 return fmt.Errorf("unexpected JSON type %v", value) 6978 } 6979 6980 var sv *types.AdvancedSecurityOptions 6981 if *v == nil { 6982 sv = &types.AdvancedSecurityOptions{} 6983 } else { 6984 sv = *v 6985 } 6986 6987 for key, value := range shape { 6988 switch key { 6989 case "Enabled": 6990 if value != nil { 6991 jtv, ok := value.(bool) 6992 if !ok { 6993 return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) 6994 } 6995 sv.Enabled = ptr.Bool(jtv) 6996 } 6997 6998 case "InternalUserDatabaseEnabled": 6999 if value != nil { 7000 jtv, ok := value.(bool) 7001 if !ok { 7002 return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) 7003 } 7004 sv.InternalUserDatabaseEnabled = ptr.Bool(jtv) 7005 } 7006 7007 case "SAMLOptions": 7008 if err := awsRestjson1_deserializeDocumentSAMLOptionsOutput(&sv.SAMLOptions, value); err != nil { 7009 return err 7010 } 7011 7012 default: 7013 _, _ = key, value 7014 7015 } 7016 } 7017 *v = sv 7018 return nil 7019} 7020 7021func awsRestjson1_deserializeDocumentAdvancedSecurityOptionsStatus(v **types.AdvancedSecurityOptionsStatus, value interface{}) error { 7022 if v == nil { 7023 return fmt.Errorf("unexpected nil of type %T", v) 7024 } 7025 if value == nil { 7026 return nil 7027 } 7028 7029 shape, ok := value.(map[string]interface{}) 7030 if !ok { 7031 return fmt.Errorf("unexpected JSON type %v", value) 7032 } 7033 7034 var sv *types.AdvancedSecurityOptionsStatus 7035 if *v == nil { 7036 sv = &types.AdvancedSecurityOptionsStatus{} 7037 } else { 7038 sv = *v 7039 } 7040 7041 for key, value := range shape { 7042 switch key { 7043 case "Options": 7044 if err := awsRestjson1_deserializeDocumentAdvancedSecurityOptions(&sv.Options, value); err != nil { 7045 return err 7046 } 7047 7048 case "Status": 7049 if err := awsRestjson1_deserializeDocumentOptionStatus(&sv.Status, value); err != nil { 7050 return err 7051 } 7052 7053 default: 7054 _, _ = key, value 7055 7056 } 7057 } 7058 *v = sv 7059 return nil 7060} 7061 7062func awsRestjson1_deserializeDocumentAutoTune(v **types.AutoTune, value interface{}) error { 7063 if v == nil { 7064 return fmt.Errorf("unexpected nil of type %T", v) 7065 } 7066 if value == nil { 7067 return nil 7068 } 7069 7070 shape, ok := value.(map[string]interface{}) 7071 if !ok { 7072 return fmt.Errorf("unexpected JSON type %v", value) 7073 } 7074 7075 var sv *types.AutoTune 7076 if *v == nil { 7077 sv = &types.AutoTune{} 7078 } else { 7079 sv = *v 7080 } 7081 7082 for key, value := range shape { 7083 switch key { 7084 case "AutoTuneDetails": 7085 if err := awsRestjson1_deserializeDocumentAutoTuneDetails(&sv.AutoTuneDetails, value); err != nil { 7086 return err 7087 } 7088 7089 case "AutoTuneType": 7090 if value != nil { 7091 jtv, ok := value.(string) 7092 if !ok { 7093 return fmt.Errorf("expected AutoTuneType to be of type string, got %T instead", value) 7094 } 7095 sv.AutoTuneType = types.AutoTuneType(jtv) 7096 } 7097 7098 default: 7099 _, _ = key, value 7100 7101 } 7102 } 7103 *v = sv 7104 return nil 7105} 7106 7107func awsRestjson1_deserializeDocumentAutoTuneDetails(v **types.AutoTuneDetails, value interface{}) error { 7108 if v == nil { 7109 return fmt.Errorf("unexpected nil of type %T", v) 7110 } 7111 if value == nil { 7112 return nil 7113 } 7114 7115 shape, ok := value.(map[string]interface{}) 7116 if !ok { 7117 return fmt.Errorf("unexpected JSON type %v", value) 7118 } 7119 7120 var sv *types.AutoTuneDetails 7121 if *v == nil { 7122 sv = &types.AutoTuneDetails{} 7123 } else { 7124 sv = *v 7125 } 7126 7127 for key, value := range shape { 7128 switch key { 7129 case "ScheduledAutoTuneDetails": 7130 if err := awsRestjson1_deserializeDocumentScheduledAutoTuneDetails(&sv.ScheduledAutoTuneDetails, value); err != nil { 7131 return err 7132 } 7133 7134 default: 7135 _, _ = key, value 7136 7137 } 7138 } 7139 *v = sv 7140 return nil 7141} 7142 7143func awsRestjson1_deserializeDocumentAutoTuneList(v *[]types.AutoTune, value interface{}) error { 7144 if v == nil { 7145 return fmt.Errorf("unexpected nil of type %T", v) 7146 } 7147 if value == nil { 7148 return nil 7149 } 7150 7151 shape, ok := value.([]interface{}) 7152 if !ok { 7153 return fmt.Errorf("unexpected JSON type %v", value) 7154 } 7155 7156 var cv []types.AutoTune 7157 if *v == nil { 7158 cv = []types.AutoTune{} 7159 } else { 7160 cv = *v 7161 } 7162 7163 for _, value := range shape { 7164 var col types.AutoTune 7165 destAddr := &col 7166 if err := awsRestjson1_deserializeDocumentAutoTune(&destAddr, value); err != nil { 7167 return err 7168 } 7169 col = *destAddr 7170 cv = append(cv, col) 7171 7172 } 7173 *v = cv 7174 return nil 7175} 7176 7177func awsRestjson1_deserializeDocumentAutoTuneMaintenanceSchedule(v **types.AutoTuneMaintenanceSchedule, value interface{}) error { 7178 if v == nil { 7179 return fmt.Errorf("unexpected nil of type %T", v) 7180 } 7181 if value == nil { 7182 return nil 7183 } 7184 7185 shape, ok := value.(map[string]interface{}) 7186 if !ok { 7187 return fmt.Errorf("unexpected JSON type %v", value) 7188 } 7189 7190 var sv *types.AutoTuneMaintenanceSchedule 7191 if *v == nil { 7192 sv = &types.AutoTuneMaintenanceSchedule{} 7193 } else { 7194 sv = *v 7195 } 7196 7197 for key, value := range shape { 7198 switch key { 7199 case "CronExpressionForRecurrence": 7200 if value != nil { 7201 jtv, ok := value.(string) 7202 if !ok { 7203 return fmt.Errorf("expected String to be of type string, got %T instead", value) 7204 } 7205 sv.CronExpressionForRecurrence = ptr.String(jtv) 7206 } 7207 7208 case "Duration": 7209 if err := awsRestjson1_deserializeDocumentDuration(&sv.Duration, value); err != nil { 7210 return err 7211 } 7212 7213 case "StartAt": 7214 if value != nil { 7215 jtv, ok := value.(json.Number) 7216 if !ok { 7217 return fmt.Errorf("expected StartAt to be json.Number, got %T instead", value) 7218 } 7219 f64, err := jtv.Float64() 7220 if err != nil { 7221 return err 7222 } 7223 sv.StartAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) 7224 } 7225 7226 default: 7227 _, _ = key, value 7228 7229 } 7230 } 7231 *v = sv 7232 return nil 7233} 7234 7235func awsRestjson1_deserializeDocumentAutoTuneMaintenanceScheduleList(v *[]types.AutoTuneMaintenanceSchedule, value interface{}) error { 7236 if v == nil { 7237 return fmt.Errorf("unexpected nil of type %T", v) 7238 } 7239 if value == nil { 7240 return nil 7241 } 7242 7243 shape, ok := value.([]interface{}) 7244 if !ok { 7245 return fmt.Errorf("unexpected JSON type %v", value) 7246 } 7247 7248 var cv []types.AutoTuneMaintenanceSchedule 7249 if *v == nil { 7250 cv = []types.AutoTuneMaintenanceSchedule{} 7251 } else { 7252 cv = *v 7253 } 7254 7255 for _, value := range shape { 7256 var col types.AutoTuneMaintenanceSchedule 7257 destAddr := &col 7258 if err := awsRestjson1_deserializeDocumentAutoTuneMaintenanceSchedule(&destAddr, value); err != nil { 7259 return err 7260 } 7261 col = *destAddr 7262 cv = append(cv, col) 7263 7264 } 7265 *v = cv 7266 return nil 7267} 7268 7269func awsRestjson1_deserializeDocumentAutoTuneOptions(v **types.AutoTuneOptions, value interface{}) error { 7270 if v == nil { 7271 return fmt.Errorf("unexpected nil of type %T", v) 7272 } 7273 if value == nil { 7274 return nil 7275 } 7276 7277 shape, ok := value.(map[string]interface{}) 7278 if !ok { 7279 return fmt.Errorf("unexpected JSON type %v", value) 7280 } 7281 7282 var sv *types.AutoTuneOptions 7283 if *v == nil { 7284 sv = &types.AutoTuneOptions{} 7285 } else { 7286 sv = *v 7287 } 7288 7289 for key, value := range shape { 7290 switch key { 7291 case "DesiredState": 7292 if value != nil { 7293 jtv, ok := value.(string) 7294 if !ok { 7295 return fmt.Errorf("expected AutoTuneDesiredState to be of type string, got %T instead", value) 7296 } 7297 sv.DesiredState = types.AutoTuneDesiredState(jtv) 7298 } 7299 7300 case "MaintenanceSchedules": 7301 if err := awsRestjson1_deserializeDocumentAutoTuneMaintenanceScheduleList(&sv.MaintenanceSchedules, value); err != nil { 7302 return err 7303 } 7304 7305 case "RollbackOnDisable": 7306 if value != nil { 7307 jtv, ok := value.(string) 7308 if !ok { 7309 return fmt.Errorf("expected RollbackOnDisable to be of type string, got %T instead", value) 7310 } 7311 sv.RollbackOnDisable = types.RollbackOnDisable(jtv) 7312 } 7313 7314 default: 7315 _, _ = key, value 7316 7317 } 7318 } 7319 *v = sv 7320 return nil 7321} 7322 7323func awsRestjson1_deserializeDocumentAutoTuneOptionsOutput(v **types.AutoTuneOptionsOutput, value interface{}) error { 7324 if v == nil { 7325 return fmt.Errorf("unexpected nil of type %T", v) 7326 } 7327 if value == nil { 7328 return nil 7329 } 7330 7331 shape, ok := value.(map[string]interface{}) 7332 if !ok { 7333 return fmt.Errorf("unexpected JSON type %v", value) 7334 } 7335 7336 var sv *types.AutoTuneOptionsOutput 7337 if *v == nil { 7338 sv = &types.AutoTuneOptionsOutput{} 7339 } else { 7340 sv = *v 7341 } 7342 7343 for key, value := range shape { 7344 switch key { 7345 case "ErrorMessage": 7346 if value != nil { 7347 jtv, ok := value.(string) 7348 if !ok { 7349 return fmt.Errorf("expected String to be of type string, got %T instead", value) 7350 } 7351 sv.ErrorMessage = ptr.String(jtv) 7352 } 7353 7354 case "State": 7355 if value != nil { 7356 jtv, ok := value.(string) 7357 if !ok { 7358 return fmt.Errorf("expected AutoTuneState to be of type string, got %T instead", value) 7359 } 7360 sv.State = types.AutoTuneState(jtv) 7361 } 7362 7363 default: 7364 _, _ = key, value 7365 7366 } 7367 } 7368 *v = sv 7369 return nil 7370} 7371 7372func awsRestjson1_deserializeDocumentAutoTuneOptionsStatus(v **types.AutoTuneOptionsStatus, value interface{}) error { 7373 if v == nil { 7374 return fmt.Errorf("unexpected nil of type %T", v) 7375 } 7376 if value == nil { 7377 return nil 7378 } 7379 7380 shape, ok := value.(map[string]interface{}) 7381 if !ok { 7382 return fmt.Errorf("unexpected JSON type %v", value) 7383 } 7384 7385 var sv *types.AutoTuneOptionsStatus 7386 if *v == nil { 7387 sv = &types.AutoTuneOptionsStatus{} 7388 } else { 7389 sv = *v 7390 } 7391 7392 for key, value := range shape { 7393 switch key { 7394 case "Options": 7395 if err := awsRestjson1_deserializeDocumentAutoTuneOptions(&sv.Options, value); err != nil { 7396 return err 7397 } 7398 7399 case "Status": 7400 if err := awsRestjson1_deserializeDocumentAutoTuneStatus(&sv.Status, value); err != nil { 7401 return err 7402 } 7403 7404 default: 7405 _, _ = key, value 7406 7407 } 7408 } 7409 *v = sv 7410 return nil 7411} 7412 7413func awsRestjson1_deserializeDocumentAutoTuneStatus(v **types.AutoTuneStatus, value interface{}) error { 7414 if v == nil { 7415 return fmt.Errorf("unexpected nil of type %T", v) 7416 } 7417 if value == nil { 7418 return nil 7419 } 7420 7421 shape, ok := value.(map[string]interface{}) 7422 if !ok { 7423 return fmt.Errorf("unexpected JSON type %v", value) 7424 } 7425 7426 var sv *types.AutoTuneStatus 7427 if *v == nil { 7428 sv = &types.AutoTuneStatus{} 7429 } else { 7430 sv = *v 7431 } 7432 7433 for key, value := range shape { 7434 switch key { 7435 case "CreationDate": 7436 if value != nil { 7437 jtv, ok := value.(json.Number) 7438 if !ok { 7439 return fmt.Errorf("expected UpdateTimestamp to be json.Number, got %T instead", value) 7440 } 7441 f64, err := jtv.Float64() 7442 if err != nil { 7443 return err 7444 } 7445 sv.CreationDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) 7446 } 7447 7448 case "ErrorMessage": 7449 if value != nil { 7450 jtv, ok := value.(string) 7451 if !ok { 7452 return fmt.Errorf("expected String to be of type string, got %T instead", value) 7453 } 7454 sv.ErrorMessage = ptr.String(jtv) 7455 } 7456 7457 case "PendingDeletion": 7458 if value != nil { 7459 jtv, ok := value.(bool) 7460 if !ok { 7461 return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) 7462 } 7463 sv.PendingDeletion = ptr.Bool(jtv) 7464 } 7465 7466 case "State": 7467 if value != nil { 7468 jtv, ok := value.(string) 7469 if !ok { 7470 return fmt.Errorf("expected AutoTuneState to be of type string, got %T instead", value) 7471 } 7472 sv.State = types.AutoTuneState(jtv) 7473 } 7474 7475 case "UpdateDate": 7476 if value != nil { 7477 jtv, ok := value.(json.Number) 7478 if !ok { 7479 return fmt.Errorf("expected UpdateTimestamp to be json.Number, got %T instead", value) 7480 } 7481 f64, err := jtv.Float64() 7482 if err != nil { 7483 return err 7484 } 7485 sv.UpdateDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) 7486 } 7487 7488 case "UpdateVersion": 7489 if value != nil { 7490 jtv, ok := value.(json.Number) 7491 if !ok { 7492 return fmt.Errorf("expected UIntValue to be json.Number, got %T instead", value) 7493 } 7494 i64, err := jtv.Int64() 7495 if err != nil { 7496 return err 7497 } 7498 sv.UpdateVersion = int32(i64) 7499 } 7500 7501 default: 7502 _, _ = key, value 7503 7504 } 7505 } 7506 *v = sv 7507 return nil 7508} 7509 7510func awsRestjson1_deserializeDocumentBaseException(v **types.BaseException, value interface{}) error { 7511 if v == nil { 7512 return fmt.Errorf("unexpected nil of type %T", v) 7513 } 7514 if value == nil { 7515 return nil 7516 } 7517 7518 shape, ok := value.(map[string]interface{}) 7519 if !ok { 7520 return fmt.Errorf("unexpected JSON type %v", value) 7521 } 7522 7523 var sv *types.BaseException 7524 if *v == nil { 7525 sv = &types.BaseException{} 7526 } else { 7527 sv = *v 7528 } 7529 7530 for key, value := range shape { 7531 switch key { 7532 case "message": 7533 if value != nil { 7534 jtv, ok := value.(string) 7535 if !ok { 7536 return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) 7537 } 7538 sv.Message = ptr.String(jtv) 7539 } 7540 7541 default: 7542 _, _ = key, value 7543 7544 } 7545 } 7546 *v = sv 7547 return nil 7548} 7549 7550func awsRestjson1_deserializeDocumentCognitoOptions(v **types.CognitoOptions, value interface{}) error { 7551 if v == nil { 7552 return fmt.Errorf("unexpected nil of type %T", v) 7553 } 7554 if value == nil { 7555 return nil 7556 } 7557 7558 shape, ok := value.(map[string]interface{}) 7559 if !ok { 7560 return fmt.Errorf("unexpected JSON type %v", value) 7561 } 7562 7563 var sv *types.CognitoOptions 7564 if *v == nil { 7565 sv = &types.CognitoOptions{} 7566 } else { 7567 sv = *v 7568 } 7569 7570 for key, value := range shape { 7571 switch key { 7572 case "Enabled": 7573 if value != nil { 7574 jtv, ok := value.(bool) 7575 if !ok { 7576 return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) 7577 } 7578 sv.Enabled = ptr.Bool(jtv) 7579 } 7580 7581 case "IdentityPoolId": 7582 if value != nil { 7583 jtv, ok := value.(string) 7584 if !ok { 7585 return fmt.Errorf("expected IdentityPoolId to be of type string, got %T instead", value) 7586 } 7587 sv.IdentityPoolId = ptr.String(jtv) 7588 } 7589 7590 case "RoleArn": 7591 if value != nil { 7592 jtv, ok := value.(string) 7593 if !ok { 7594 return fmt.Errorf("expected RoleArn to be of type string, got %T instead", value) 7595 } 7596 sv.RoleArn = ptr.String(jtv) 7597 } 7598 7599 case "UserPoolId": 7600 if value != nil { 7601 jtv, ok := value.(string) 7602 if !ok { 7603 return fmt.Errorf("expected UserPoolId to be of type string, got %T instead", value) 7604 } 7605 sv.UserPoolId = ptr.String(jtv) 7606 } 7607 7608 default: 7609 _, _ = key, value 7610 7611 } 7612 } 7613 *v = sv 7614 return nil 7615} 7616 7617func awsRestjson1_deserializeDocumentCognitoOptionsStatus(v **types.CognitoOptionsStatus, value interface{}) error { 7618 if v == nil { 7619 return fmt.Errorf("unexpected nil of type %T", v) 7620 } 7621 if value == nil { 7622 return nil 7623 } 7624 7625 shape, ok := value.(map[string]interface{}) 7626 if !ok { 7627 return fmt.Errorf("unexpected JSON type %v", value) 7628 } 7629 7630 var sv *types.CognitoOptionsStatus 7631 if *v == nil { 7632 sv = &types.CognitoOptionsStatus{} 7633 } else { 7634 sv = *v 7635 } 7636 7637 for key, value := range shape { 7638 switch key { 7639 case "Options": 7640 if err := awsRestjson1_deserializeDocumentCognitoOptions(&sv.Options, value); err != nil { 7641 return err 7642 } 7643 7644 case "Status": 7645 if err := awsRestjson1_deserializeDocumentOptionStatus(&sv.Status, value); err != nil { 7646 return err 7647 } 7648 7649 default: 7650 _, _ = key, value 7651 7652 } 7653 } 7654 *v = sv 7655 return nil 7656} 7657 7658func awsRestjson1_deserializeDocumentCompatibleElasticsearchVersionsList(v *[]types.CompatibleVersionsMap, value interface{}) error { 7659 if v == nil { 7660 return fmt.Errorf("unexpected nil of type %T", v) 7661 } 7662 if value == nil { 7663 return nil 7664 } 7665 7666 shape, ok := value.([]interface{}) 7667 if !ok { 7668 return fmt.Errorf("unexpected JSON type %v", value) 7669 } 7670 7671 var cv []types.CompatibleVersionsMap 7672 if *v == nil { 7673 cv = []types.CompatibleVersionsMap{} 7674 } else { 7675 cv = *v 7676 } 7677 7678 for _, value := range shape { 7679 var col types.CompatibleVersionsMap 7680 destAddr := &col 7681 if err := awsRestjson1_deserializeDocumentCompatibleVersionsMap(&destAddr, value); err != nil { 7682 return err 7683 } 7684 col = *destAddr 7685 cv = append(cv, col) 7686 7687 } 7688 *v = cv 7689 return nil 7690} 7691 7692func awsRestjson1_deserializeDocumentCompatibleVersionsMap(v **types.CompatibleVersionsMap, value interface{}) error { 7693 if v == nil { 7694 return fmt.Errorf("unexpected nil of type %T", v) 7695 } 7696 if value == nil { 7697 return nil 7698 } 7699 7700 shape, ok := value.(map[string]interface{}) 7701 if !ok { 7702 return fmt.Errorf("unexpected JSON type %v", value) 7703 } 7704 7705 var sv *types.CompatibleVersionsMap 7706 if *v == nil { 7707 sv = &types.CompatibleVersionsMap{} 7708 } else { 7709 sv = *v 7710 } 7711 7712 for key, value := range shape { 7713 switch key { 7714 case "SourceVersion": 7715 if value != nil { 7716 jtv, ok := value.(string) 7717 if !ok { 7718 return fmt.Errorf("expected ElasticsearchVersionString to be of type string, got %T instead", value) 7719 } 7720 sv.SourceVersion = ptr.String(jtv) 7721 } 7722 7723 case "TargetVersions": 7724 if err := awsRestjson1_deserializeDocumentElasticsearchVersionList(&sv.TargetVersions, value); err != nil { 7725 return err 7726 } 7727 7728 default: 7729 _, _ = key, value 7730 7731 } 7732 } 7733 *v = sv 7734 return nil 7735} 7736 7737func awsRestjson1_deserializeDocumentConflictException(v **types.ConflictException, value interface{}) error { 7738 if v == nil { 7739 return fmt.Errorf("unexpected nil of type %T", v) 7740 } 7741 if value == nil { 7742 return nil 7743 } 7744 7745 shape, ok := value.(map[string]interface{}) 7746 if !ok { 7747 return fmt.Errorf("unexpected JSON type %v", value) 7748 } 7749 7750 var sv *types.ConflictException 7751 if *v == nil { 7752 sv = &types.ConflictException{} 7753 } else { 7754 sv = *v 7755 } 7756 7757 for key, value := range shape { 7758 switch key { 7759 case "message": 7760 if value != nil { 7761 jtv, ok := value.(string) 7762 if !ok { 7763 return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) 7764 } 7765 sv.Message = ptr.String(jtv) 7766 } 7767 7768 default: 7769 _, _ = key, value 7770 7771 } 7772 } 7773 *v = sv 7774 return nil 7775} 7776 7777func awsRestjson1_deserializeDocumentDisabledOperationException(v **types.DisabledOperationException, value interface{}) error { 7778 if v == nil { 7779 return fmt.Errorf("unexpected nil of type %T", v) 7780 } 7781 if value == nil { 7782 return nil 7783 } 7784 7785 shape, ok := value.(map[string]interface{}) 7786 if !ok { 7787 return fmt.Errorf("unexpected JSON type %v", value) 7788 } 7789 7790 var sv *types.DisabledOperationException 7791 if *v == nil { 7792 sv = &types.DisabledOperationException{} 7793 } else { 7794 sv = *v 7795 } 7796 7797 for key, value := range shape { 7798 switch key { 7799 case "message": 7800 if value != nil { 7801 jtv, ok := value.(string) 7802 if !ok { 7803 return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) 7804 } 7805 sv.Message = ptr.String(jtv) 7806 } 7807 7808 default: 7809 _, _ = key, value 7810 7811 } 7812 } 7813 *v = sv 7814 return nil 7815} 7816 7817func awsRestjson1_deserializeDocumentDomainEndpointOptions(v **types.DomainEndpointOptions, value interface{}) error { 7818 if v == nil { 7819 return fmt.Errorf("unexpected nil of type %T", v) 7820 } 7821 if value == nil { 7822 return nil 7823 } 7824 7825 shape, ok := value.(map[string]interface{}) 7826 if !ok { 7827 return fmt.Errorf("unexpected JSON type %v", value) 7828 } 7829 7830 var sv *types.DomainEndpointOptions 7831 if *v == nil { 7832 sv = &types.DomainEndpointOptions{} 7833 } else { 7834 sv = *v 7835 } 7836 7837 for key, value := range shape { 7838 switch key { 7839 case "CustomEndpoint": 7840 if value != nil { 7841 jtv, ok := value.(string) 7842 if !ok { 7843 return fmt.Errorf("expected DomainNameFqdn to be of type string, got %T instead", value) 7844 } 7845 sv.CustomEndpoint = ptr.String(jtv) 7846 } 7847 7848 case "CustomEndpointCertificateArn": 7849 if value != nil { 7850 jtv, ok := value.(string) 7851 if !ok { 7852 return fmt.Errorf("expected ARN to be of type string, got %T instead", value) 7853 } 7854 sv.CustomEndpointCertificateArn = ptr.String(jtv) 7855 } 7856 7857 case "CustomEndpointEnabled": 7858 if value != nil { 7859 jtv, ok := value.(bool) 7860 if !ok { 7861 return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) 7862 } 7863 sv.CustomEndpointEnabled = ptr.Bool(jtv) 7864 } 7865 7866 case "EnforceHTTPS": 7867 if value != nil { 7868 jtv, ok := value.(bool) 7869 if !ok { 7870 return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) 7871 } 7872 sv.EnforceHTTPS = ptr.Bool(jtv) 7873 } 7874 7875 case "TLSSecurityPolicy": 7876 if value != nil { 7877 jtv, ok := value.(string) 7878 if !ok { 7879 return fmt.Errorf("expected TLSSecurityPolicy to be of type string, got %T instead", value) 7880 } 7881 sv.TLSSecurityPolicy = types.TLSSecurityPolicy(jtv) 7882 } 7883 7884 default: 7885 _, _ = key, value 7886 7887 } 7888 } 7889 *v = sv 7890 return nil 7891} 7892 7893func awsRestjson1_deserializeDocumentDomainEndpointOptionsStatus(v **types.DomainEndpointOptionsStatus, value interface{}) error { 7894 if v == nil { 7895 return fmt.Errorf("unexpected nil of type %T", v) 7896 } 7897 if value == nil { 7898 return nil 7899 } 7900 7901 shape, ok := value.(map[string]interface{}) 7902 if !ok { 7903 return fmt.Errorf("unexpected JSON type %v", value) 7904 } 7905 7906 var sv *types.DomainEndpointOptionsStatus 7907 if *v == nil { 7908 sv = &types.DomainEndpointOptionsStatus{} 7909 } else { 7910 sv = *v 7911 } 7912 7913 for key, value := range shape { 7914 switch key { 7915 case "Options": 7916 if err := awsRestjson1_deserializeDocumentDomainEndpointOptions(&sv.Options, value); err != nil { 7917 return err 7918 } 7919 7920 case "Status": 7921 if err := awsRestjson1_deserializeDocumentOptionStatus(&sv.Status, value); err != nil { 7922 return err 7923 } 7924 7925 default: 7926 _, _ = key, value 7927 7928 } 7929 } 7930 *v = sv 7931 return nil 7932} 7933 7934func awsRestjson1_deserializeDocumentDomainInfo(v **types.DomainInfo, value interface{}) error { 7935 if v == nil { 7936 return fmt.Errorf("unexpected nil of type %T", v) 7937 } 7938 if value == nil { 7939 return nil 7940 } 7941 7942 shape, ok := value.(map[string]interface{}) 7943 if !ok { 7944 return fmt.Errorf("unexpected JSON type %v", value) 7945 } 7946 7947 var sv *types.DomainInfo 7948 if *v == nil { 7949 sv = &types.DomainInfo{} 7950 } else { 7951 sv = *v 7952 } 7953 7954 for key, value := range shape { 7955 switch key { 7956 case "DomainName": 7957 if value != nil { 7958 jtv, ok := value.(string) 7959 if !ok { 7960 return fmt.Errorf("expected DomainName to be of type string, got %T instead", value) 7961 } 7962 sv.DomainName = ptr.String(jtv) 7963 } 7964 7965 default: 7966 _, _ = key, value 7967 7968 } 7969 } 7970 *v = sv 7971 return nil 7972} 7973 7974func awsRestjson1_deserializeDocumentDomainInfoList(v *[]types.DomainInfo, value interface{}) error { 7975 if v == nil { 7976 return fmt.Errorf("unexpected nil of type %T", v) 7977 } 7978 if value == nil { 7979 return nil 7980 } 7981 7982 shape, ok := value.([]interface{}) 7983 if !ok { 7984 return fmt.Errorf("unexpected JSON type %v", value) 7985 } 7986 7987 var cv []types.DomainInfo 7988 if *v == nil { 7989 cv = []types.DomainInfo{} 7990 } else { 7991 cv = *v 7992 } 7993 7994 for _, value := range shape { 7995 var col types.DomainInfo 7996 destAddr := &col 7997 if err := awsRestjson1_deserializeDocumentDomainInfo(&destAddr, value); err != nil { 7998 return err 7999 } 8000 col = *destAddr 8001 cv = append(cv, col) 8002 8003 } 8004 *v = cv 8005 return nil 8006} 8007 8008func awsRestjson1_deserializeDocumentDomainInformation(v **types.DomainInformation, value interface{}) error { 8009 if v == nil { 8010 return fmt.Errorf("unexpected nil of type %T", v) 8011 } 8012 if value == nil { 8013 return nil 8014 } 8015 8016 shape, ok := value.(map[string]interface{}) 8017 if !ok { 8018 return fmt.Errorf("unexpected JSON type %v", value) 8019 } 8020 8021 var sv *types.DomainInformation 8022 if *v == nil { 8023 sv = &types.DomainInformation{} 8024 } else { 8025 sv = *v 8026 } 8027 8028 for key, value := range shape { 8029 switch key { 8030 case "DomainName": 8031 if value != nil { 8032 jtv, ok := value.(string) 8033 if !ok { 8034 return fmt.Errorf("expected DomainName to be of type string, got %T instead", value) 8035 } 8036 sv.DomainName = ptr.String(jtv) 8037 } 8038 8039 case "OwnerId": 8040 if value != nil { 8041 jtv, ok := value.(string) 8042 if !ok { 8043 return fmt.Errorf("expected OwnerId to be of type string, got %T instead", value) 8044 } 8045 sv.OwnerId = ptr.String(jtv) 8046 } 8047 8048 case "Region": 8049 if value != nil { 8050 jtv, ok := value.(string) 8051 if !ok { 8052 return fmt.Errorf("expected Region to be of type string, got %T instead", value) 8053 } 8054 sv.Region = ptr.String(jtv) 8055 } 8056 8057 default: 8058 _, _ = key, value 8059 8060 } 8061 } 8062 *v = sv 8063 return nil 8064} 8065 8066func awsRestjson1_deserializeDocumentDomainPackageDetails(v **types.DomainPackageDetails, value interface{}) error { 8067 if v == nil { 8068 return fmt.Errorf("unexpected nil of type %T", v) 8069 } 8070 if value == nil { 8071 return nil 8072 } 8073 8074 shape, ok := value.(map[string]interface{}) 8075 if !ok { 8076 return fmt.Errorf("unexpected JSON type %v", value) 8077 } 8078 8079 var sv *types.DomainPackageDetails 8080 if *v == nil { 8081 sv = &types.DomainPackageDetails{} 8082 } else { 8083 sv = *v 8084 } 8085 8086 for key, value := range shape { 8087 switch key { 8088 case "DomainName": 8089 if value != nil { 8090 jtv, ok := value.(string) 8091 if !ok { 8092 return fmt.Errorf("expected DomainName to be of type string, got %T instead", value) 8093 } 8094 sv.DomainName = ptr.String(jtv) 8095 } 8096 8097 case "DomainPackageStatus": 8098 if value != nil { 8099 jtv, ok := value.(string) 8100 if !ok { 8101 return fmt.Errorf("expected DomainPackageStatus to be of type string, got %T instead", value) 8102 } 8103 sv.DomainPackageStatus = types.DomainPackageStatus(jtv) 8104 } 8105 8106 case "ErrorDetails": 8107 if err := awsRestjson1_deserializeDocumentErrorDetails(&sv.ErrorDetails, value); err != nil { 8108 return err 8109 } 8110 8111 case "LastUpdated": 8112 if value != nil { 8113 jtv, ok := value.(json.Number) 8114 if !ok { 8115 return fmt.Errorf("expected LastUpdated to be json.Number, got %T instead", value) 8116 } 8117 f64, err := jtv.Float64() 8118 if err != nil { 8119 return err 8120 } 8121 sv.LastUpdated = ptr.Time(smithytime.ParseEpochSeconds(f64)) 8122 } 8123 8124 case "PackageID": 8125 if value != nil { 8126 jtv, ok := value.(string) 8127 if !ok { 8128 return fmt.Errorf("expected PackageID to be of type string, got %T instead", value) 8129 } 8130 sv.PackageID = ptr.String(jtv) 8131 } 8132 8133 case "PackageName": 8134 if value != nil { 8135 jtv, ok := value.(string) 8136 if !ok { 8137 return fmt.Errorf("expected PackageName to be of type string, got %T instead", value) 8138 } 8139 sv.PackageName = ptr.String(jtv) 8140 } 8141 8142 case "PackageType": 8143 if value != nil { 8144 jtv, ok := value.(string) 8145 if !ok { 8146 return fmt.Errorf("expected PackageType to be of type string, got %T instead", value) 8147 } 8148 sv.PackageType = types.PackageType(jtv) 8149 } 8150 8151 case "PackageVersion": 8152 if value != nil { 8153 jtv, ok := value.(string) 8154 if !ok { 8155 return fmt.Errorf("expected PackageVersion to be of type string, got %T instead", value) 8156 } 8157 sv.PackageVersion = ptr.String(jtv) 8158 } 8159 8160 case "ReferencePath": 8161 if value != nil { 8162 jtv, ok := value.(string) 8163 if !ok { 8164 return fmt.Errorf("expected ReferencePath to be of type string, got %T instead", value) 8165 } 8166 sv.ReferencePath = ptr.String(jtv) 8167 } 8168 8169 default: 8170 _, _ = key, value 8171 8172 } 8173 } 8174 *v = sv 8175 return nil 8176} 8177 8178func awsRestjson1_deserializeDocumentDomainPackageDetailsList(v *[]types.DomainPackageDetails, value interface{}) error { 8179 if v == nil { 8180 return fmt.Errorf("unexpected nil of type %T", v) 8181 } 8182 if value == nil { 8183 return nil 8184 } 8185 8186 shape, ok := value.([]interface{}) 8187 if !ok { 8188 return fmt.Errorf("unexpected JSON type %v", value) 8189 } 8190 8191 var cv []types.DomainPackageDetails 8192 if *v == nil { 8193 cv = []types.DomainPackageDetails{} 8194 } else { 8195 cv = *v 8196 } 8197 8198 for _, value := range shape { 8199 var col types.DomainPackageDetails 8200 destAddr := &col 8201 if err := awsRestjson1_deserializeDocumentDomainPackageDetails(&destAddr, value); err != nil { 8202 return err 8203 } 8204 col = *destAddr 8205 cv = append(cv, col) 8206 8207 } 8208 *v = cv 8209 return nil 8210} 8211 8212func awsRestjson1_deserializeDocumentDuration(v **types.Duration, value interface{}) error { 8213 if v == nil { 8214 return fmt.Errorf("unexpected nil of type %T", v) 8215 } 8216 if value == nil { 8217 return nil 8218 } 8219 8220 shape, ok := value.(map[string]interface{}) 8221 if !ok { 8222 return fmt.Errorf("unexpected JSON type %v", value) 8223 } 8224 8225 var sv *types.Duration 8226 if *v == nil { 8227 sv = &types.Duration{} 8228 } else { 8229 sv = *v 8230 } 8231 8232 for key, value := range shape { 8233 switch key { 8234 case "Unit": 8235 if value != nil { 8236 jtv, ok := value.(string) 8237 if !ok { 8238 return fmt.Errorf("expected TimeUnit to be of type string, got %T instead", value) 8239 } 8240 sv.Unit = types.TimeUnit(jtv) 8241 } 8242 8243 case "Value": 8244 if value != nil { 8245 jtv, ok := value.(json.Number) 8246 if !ok { 8247 return fmt.Errorf("expected DurationValue to be json.Number, got %T instead", value) 8248 } 8249 i64, err := jtv.Int64() 8250 if err != nil { 8251 return err 8252 } 8253 sv.Value = i64 8254 } 8255 8256 default: 8257 _, _ = key, value 8258 8259 } 8260 } 8261 *v = sv 8262 return nil 8263} 8264 8265func awsRestjson1_deserializeDocumentEBSOptions(v **types.EBSOptions, value interface{}) error { 8266 if v == nil { 8267 return fmt.Errorf("unexpected nil of type %T", v) 8268 } 8269 if value == nil { 8270 return nil 8271 } 8272 8273 shape, ok := value.(map[string]interface{}) 8274 if !ok { 8275 return fmt.Errorf("unexpected JSON type %v", value) 8276 } 8277 8278 var sv *types.EBSOptions 8279 if *v == nil { 8280 sv = &types.EBSOptions{} 8281 } else { 8282 sv = *v 8283 } 8284 8285 for key, value := range shape { 8286 switch key { 8287 case "EBSEnabled": 8288 if value != nil { 8289 jtv, ok := value.(bool) 8290 if !ok { 8291 return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) 8292 } 8293 sv.EBSEnabled = ptr.Bool(jtv) 8294 } 8295 8296 case "Iops": 8297 if value != nil { 8298 jtv, ok := value.(json.Number) 8299 if !ok { 8300 return fmt.Errorf("expected IntegerClass to be json.Number, got %T instead", value) 8301 } 8302 i64, err := jtv.Int64() 8303 if err != nil { 8304 return err 8305 } 8306 sv.Iops = ptr.Int32(int32(i64)) 8307 } 8308 8309 case "VolumeSize": 8310 if value != nil { 8311 jtv, ok := value.(json.Number) 8312 if !ok { 8313 return fmt.Errorf("expected IntegerClass to be json.Number, got %T instead", value) 8314 } 8315 i64, err := jtv.Int64() 8316 if err != nil { 8317 return err 8318 } 8319 sv.VolumeSize = ptr.Int32(int32(i64)) 8320 } 8321 8322 case "VolumeType": 8323 if value != nil { 8324 jtv, ok := value.(string) 8325 if !ok { 8326 return fmt.Errorf("expected VolumeType to be of type string, got %T instead", value) 8327 } 8328 sv.VolumeType = types.VolumeType(jtv) 8329 } 8330 8331 default: 8332 _, _ = key, value 8333 8334 } 8335 } 8336 *v = sv 8337 return nil 8338} 8339 8340func awsRestjson1_deserializeDocumentEBSOptionsStatus(v **types.EBSOptionsStatus, value interface{}) error { 8341 if v == nil { 8342 return fmt.Errorf("unexpected nil of type %T", v) 8343 } 8344 if value == nil { 8345 return nil 8346 } 8347 8348 shape, ok := value.(map[string]interface{}) 8349 if !ok { 8350 return fmt.Errorf("unexpected JSON type %v", value) 8351 } 8352 8353 var sv *types.EBSOptionsStatus 8354 if *v == nil { 8355 sv = &types.EBSOptionsStatus{} 8356 } else { 8357 sv = *v 8358 } 8359 8360 for key, value := range shape { 8361 switch key { 8362 case "Options": 8363 if err := awsRestjson1_deserializeDocumentEBSOptions(&sv.Options, value); err != nil { 8364 return err 8365 } 8366 8367 case "Status": 8368 if err := awsRestjson1_deserializeDocumentOptionStatus(&sv.Status, value); err != nil { 8369 return err 8370 } 8371 8372 default: 8373 _, _ = key, value 8374 8375 } 8376 } 8377 *v = sv 8378 return nil 8379} 8380 8381func awsRestjson1_deserializeDocumentElasticsearchClusterConfig(v **types.ElasticsearchClusterConfig, value interface{}) error { 8382 if v == nil { 8383 return fmt.Errorf("unexpected nil of type %T", v) 8384 } 8385 if value == nil { 8386 return nil 8387 } 8388 8389 shape, ok := value.(map[string]interface{}) 8390 if !ok { 8391 return fmt.Errorf("unexpected JSON type %v", value) 8392 } 8393 8394 var sv *types.ElasticsearchClusterConfig 8395 if *v == nil { 8396 sv = &types.ElasticsearchClusterConfig{} 8397 } else { 8398 sv = *v 8399 } 8400 8401 for key, value := range shape { 8402 switch key { 8403 case "DedicatedMasterCount": 8404 if value != nil { 8405 jtv, ok := value.(json.Number) 8406 if !ok { 8407 return fmt.Errorf("expected IntegerClass to be json.Number, got %T instead", value) 8408 } 8409 i64, err := jtv.Int64() 8410 if err != nil { 8411 return err 8412 } 8413 sv.DedicatedMasterCount = ptr.Int32(int32(i64)) 8414 } 8415 8416 case "DedicatedMasterEnabled": 8417 if value != nil { 8418 jtv, ok := value.(bool) 8419 if !ok { 8420 return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) 8421 } 8422 sv.DedicatedMasterEnabled = ptr.Bool(jtv) 8423 } 8424 8425 case "DedicatedMasterType": 8426 if value != nil { 8427 jtv, ok := value.(string) 8428 if !ok { 8429 return fmt.Errorf("expected ESPartitionInstanceType to be of type string, got %T instead", value) 8430 } 8431 sv.DedicatedMasterType = types.ESPartitionInstanceType(jtv) 8432 } 8433 8434 case "InstanceCount": 8435 if value != nil { 8436 jtv, ok := value.(json.Number) 8437 if !ok { 8438 return fmt.Errorf("expected IntegerClass to be json.Number, got %T instead", value) 8439 } 8440 i64, err := jtv.Int64() 8441 if err != nil { 8442 return err 8443 } 8444 sv.InstanceCount = ptr.Int32(int32(i64)) 8445 } 8446 8447 case "InstanceType": 8448 if value != nil { 8449 jtv, ok := value.(string) 8450 if !ok { 8451 return fmt.Errorf("expected ESPartitionInstanceType to be of type string, got %T instead", value) 8452 } 8453 sv.InstanceType = types.ESPartitionInstanceType(jtv) 8454 } 8455 8456 case "WarmCount": 8457 if value != nil { 8458 jtv, ok := value.(json.Number) 8459 if !ok { 8460 return fmt.Errorf("expected IntegerClass to be json.Number, got %T instead", value) 8461 } 8462 i64, err := jtv.Int64() 8463 if err != nil { 8464 return err 8465 } 8466 sv.WarmCount = ptr.Int32(int32(i64)) 8467 } 8468 8469 case "WarmEnabled": 8470 if value != nil { 8471 jtv, ok := value.(bool) 8472 if !ok { 8473 return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) 8474 } 8475 sv.WarmEnabled = ptr.Bool(jtv) 8476 } 8477 8478 case "WarmType": 8479 if value != nil { 8480 jtv, ok := value.(string) 8481 if !ok { 8482 return fmt.Errorf("expected ESWarmPartitionInstanceType to be of type string, got %T instead", value) 8483 } 8484 sv.WarmType = types.ESWarmPartitionInstanceType(jtv) 8485 } 8486 8487 case "ZoneAwarenessConfig": 8488 if err := awsRestjson1_deserializeDocumentZoneAwarenessConfig(&sv.ZoneAwarenessConfig, value); err != nil { 8489 return err 8490 } 8491 8492 case "ZoneAwarenessEnabled": 8493 if value != nil { 8494 jtv, ok := value.(bool) 8495 if !ok { 8496 return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) 8497 } 8498 sv.ZoneAwarenessEnabled = ptr.Bool(jtv) 8499 } 8500 8501 default: 8502 _, _ = key, value 8503 8504 } 8505 } 8506 *v = sv 8507 return nil 8508} 8509 8510func awsRestjson1_deserializeDocumentElasticsearchClusterConfigStatus(v **types.ElasticsearchClusterConfigStatus, value interface{}) error { 8511 if v == nil { 8512 return fmt.Errorf("unexpected nil of type %T", v) 8513 } 8514 if value == nil { 8515 return nil 8516 } 8517 8518 shape, ok := value.(map[string]interface{}) 8519 if !ok { 8520 return fmt.Errorf("unexpected JSON type %v", value) 8521 } 8522 8523 var sv *types.ElasticsearchClusterConfigStatus 8524 if *v == nil { 8525 sv = &types.ElasticsearchClusterConfigStatus{} 8526 } else { 8527 sv = *v 8528 } 8529 8530 for key, value := range shape { 8531 switch key { 8532 case "Options": 8533 if err := awsRestjson1_deserializeDocumentElasticsearchClusterConfig(&sv.Options, value); err != nil { 8534 return err 8535 } 8536 8537 case "Status": 8538 if err := awsRestjson1_deserializeDocumentOptionStatus(&sv.Status, value); err != nil { 8539 return err 8540 } 8541 8542 default: 8543 _, _ = key, value 8544 8545 } 8546 } 8547 *v = sv 8548 return nil 8549} 8550 8551func awsRestjson1_deserializeDocumentElasticsearchDomainConfig(v **types.ElasticsearchDomainConfig, value interface{}) error { 8552 if v == nil { 8553 return fmt.Errorf("unexpected nil of type %T", v) 8554 } 8555 if value == nil { 8556 return nil 8557 } 8558 8559 shape, ok := value.(map[string]interface{}) 8560 if !ok { 8561 return fmt.Errorf("unexpected JSON type %v", value) 8562 } 8563 8564 var sv *types.ElasticsearchDomainConfig 8565 if *v == nil { 8566 sv = &types.ElasticsearchDomainConfig{} 8567 } else { 8568 sv = *v 8569 } 8570 8571 for key, value := range shape { 8572 switch key { 8573 case "AccessPolicies": 8574 if err := awsRestjson1_deserializeDocumentAccessPoliciesStatus(&sv.AccessPolicies, value); err != nil { 8575 return err 8576 } 8577 8578 case "AdvancedOptions": 8579 if err := awsRestjson1_deserializeDocumentAdvancedOptionsStatus(&sv.AdvancedOptions, value); err != nil { 8580 return err 8581 } 8582 8583 case "AdvancedSecurityOptions": 8584 if err := awsRestjson1_deserializeDocumentAdvancedSecurityOptionsStatus(&sv.AdvancedSecurityOptions, value); err != nil { 8585 return err 8586 } 8587 8588 case "AutoTuneOptions": 8589 if err := awsRestjson1_deserializeDocumentAutoTuneOptionsStatus(&sv.AutoTuneOptions, value); err != nil { 8590 return err 8591 } 8592 8593 case "CognitoOptions": 8594 if err := awsRestjson1_deserializeDocumentCognitoOptionsStatus(&sv.CognitoOptions, value); err != nil { 8595 return err 8596 } 8597 8598 case "DomainEndpointOptions": 8599 if err := awsRestjson1_deserializeDocumentDomainEndpointOptionsStatus(&sv.DomainEndpointOptions, value); err != nil { 8600 return err 8601 } 8602 8603 case "EBSOptions": 8604 if err := awsRestjson1_deserializeDocumentEBSOptionsStatus(&sv.EBSOptions, value); err != nil { 8605 return err 8606 } 8607 8608 case "ElasticsearchClusterConfig": 8609 if err := awsRestjson1_deserializeDocumentElasticsearchClusterConfigStatus(&sv.ElasticsearchClusterConfig, value); err != nil { 8610 return err 8611 } 8612 8613 case "ElasticsearchVersion": 8614 if err := awsRestjson1_deserializeDocumentElasticsearchVersionStatus(&sv.ElasticsearchVersion, value); err != nil { 8615 return err 8616 } 8617 8618 case "EncryptionAtRestOptions": 8619 if err := awsRestjson1_deserializeDocumentEncryptionAtRestOptionsStatus(&sv.EncryptionAtRestOptions, value); err != nil { 8620 return err 8621 } 8622 8623 case "LogPublishingOptions": 8624 if err := awsRestjson1_deserializeDocumentLogPublishingOptionsStatus(&sv.LogPublishingOptions, value); err != nil { 8625 return err 8626 } 8627 8628 case "NodeToNodeEncryptionOptions": 8629 if err := awsRestjson1_deserializeDocumentNodeToNodeEncryptionOptionsStatus(&sv.NodeToNodeEncryptionOptions, value); err != nil { 8630 return err 8631 } 8632 8633 case "SnapshotOptions": 8634 if err := awsRestjson1_deserializeDocumentSnapshotOptionsStatus(&sv.SnapshotOptions, value); err != nil { 8635 return err 8636 } 8637 8638 case "VPCOptions": 8639 if err := awsRestjson1_deserializeDocumentVPCDerivedInfoStatus(&sv.VPCOptions, value); err != nil { 8640 return err 8641 } 8642 8643 default: 8644 _, _ = key, value 8645 8646 } 8647 } 8648 *v = sv 8649 return nil 8650} 8651 8652func awsRestjson1_deserializeDocumentElasticsearchDomainStatus(v **types.ElasticsearchDomainStatus, value interface{}) error { 8653 if v == nil { 8654 return fmt.Errorf("unexpected nil of type %T", v) 8655 } 8656 if value == nil { 8657 return nil 8658 } 8659 8660 shape, ok := value.(map[string]interface{}) 8661 if !ok { 8662 return fmt.Errorf("unexpected JSON type %v", value) 8663 } 8664 8665 var sv *types.ElasticsearchDomainStatus 8666 if *v == nil { 8667 sv = &types.ElasticsearchDomainStatus{} 8668 } else { 8669 sv = *v 8670 } 8671 8672 for key, value := range shape { 8673 switch key { 8674 case "AccessPolicies": 8675 if value != nil { 8676 jtv, ok := value.(string) 8677 if !ok { 8678 return fmt.Errorf("expected PolicyDocument to be of type string, got %T instead", value) 8679 } 8680 sv.AccessPolicies = ptr.String(jtv) 8681 } 8682 8683 case "AdvancedOptions": 8684 if err := awsRestjson1_deserializeDocumentAdvancedOptions(&sv.AdvancedOptions, value); err != nil { 8685 return err 8686 } 8687 8688 case "AdvancedSecurityOptions": 8689 if err := awsRestjson1_deserializeDocumentAdvancedSecurityOptions(&sv.AdvancedSecurityOptions, value); err != nil { 8690 return err 8691 } 8692 8693 case "ARN": 8694 if value != nil { 8695 jtv, ok := value.(string) 8696 if !ok { 8697 return fmt.Errorf("expected ARN to be of type string, got %T instead", value) 8698 } 8699 sv.ARN = ptr.String(jtv) 8700 } 8701 8702 case "AutoTuneOptions": 8703 if err := awsRestjson1_deserializeDocumentAutoTuneOptionsOutput(&sv.AutoTuneOptions, value); err != nil { 8704 return err 8705 } 8706 8707 case "CognitoOptions": 8708 if err := awsRestjson1_deserializeDocumentCognitoOptions(&sv.CognitoOptions, value); err != nil { 8709 return err 8710 } 8711 8712 case "Created": 8713 if value != nil { 8714 jtv, ok := value.(bool) 8715 if !ok { 8716 return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) 8717 } 8718 sv.Created = ptr.Bool(jtv) 8719 } 8720 8721 case "Deleted": 8722 if value != nil { 8723 jtv, ok := value.(bool) 8724 if !ok { 8725 return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) 8726 } 8727 sv.Deleted = ptr.Bool(jtv) 8728 } 8729 8730 case "DomainEndpointOptions": 8731 if err := awsRestjson1_deserializeDocumentDomainEndpointOptions(&sv.DomainEndpointOptions, value); err != nil { 8732 return err 8733 } 8734 8735 case "DomainId": 8736 if value != nil { 8737 jtv, ok := value.(string) 8738 if !ok { 8739 return fmt.Errorf("expected DomainId to be of type string, got %T instead", value) 8740 } 8741 sv.DomainId = ptr.String(jtv) 8742 } 8743 8744 case "DomainName": 8745 if value != nil { 8746 jtv, ok := value.(string) 8747 if !ok { 8748 return fmt.Errorf("expected DomainName to be of type string, got %T instead", value) 8749 } 8750 sv.DomainName = ptr.String(jtv) 8751 } 8752 8753 case "EBSOptions": 8754 if err := awsRestjson1_deserializeDocumentEBSOptions(&sv.EBSOptions, value); err != nil { 8755 return err 8756 } 8757 8758 case "ElasticsearchClusterConfig": 8759 if err := awsRestjson1_deserializeDocumentElasticsearchClusterConfig(&sv.ElasticsearchClusterConfig, value); err != nil { 8760 return err 8761 } 8762 8763 case "ElasticsearchVersion": 8764 if value != nil { 8765 jtv, ok := value.(string) 8766 if !ok { 8767 return fmt.Errorf("expected ElasticsearchVersionString to be of type string, got %T instead", value) 8768 } 8769 sv.ElasticsearchVersion = ptr.String(jtv) 8770 } 8771 8772 case "EncryptionAtRestOptions": 8773 if err := awsRestjson1_deserializeDocumentEncryptionAtRestOptions(&sv.EncryptionAtRestOptions, value); err != nil { 8774 return err 8775 } 8776 8777 case "Endpoint": 8778 if value != nil { 8779 jtv, ok := value.(string) 8780 if !ok { 8781 return fmt.Errorf("expected ServiceUrl to be of type string, got %T instead", value) 8782 } 8783 sv.Endpoint = ptr.String(jtv) 8784 } 8785 8786 case "Endpoints": 8787 if err := awsRestjson1_deserializeDocumentEndpointsMap(&sv.Endpoints, value); err != nil { 8788 return err 8789 } 8790 8791 case "LogPublishingOptions": 8792 if err := awsRestjson1_deserializeDocumentLogPublishingOptions(&sv.LogPublishingOptions, value); err != nil { 8793 return err 8794 } 8795 8796 case "NodeToNodeEncryptionOptions": 8797 if err := awsRestjson1_deserializeDocumentNodeToNodeEncryptionOptions(&sv.NodeToNodeEncryptionOptions, value); err != nil { 8798 return err 8799 } 8800 8801 case "Processing": 8802 if value != nil { 8803 jtv, ok := value.(bool) 8804 if !ok { 8805 return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) 8806 } 8807 sv.Processing = ptr.Bool(jtv) 8808 } 8809 8810 case "ServiceSoftwareOptions": 8811 if err := awsRestjson1_deserializeDocumentServiceSoftwareOptions(&sv.ServiceSoftwareOptions, value); err != nil { 8812 return err 8813 } 8814 8815 case "SnapshotOptions": 8816 if err := awsRestjson1_deserializeDocumentSnapshotOptions(&sv.SnapshotOptions, value); err != nil { 8817 return err 8818 } 8819 8820 case "UpgradeProcessing": 8821 if value != nil { 8822 jtv, ok := value.(bool) 8823 if !ok { 8824 return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) 8825 } 8826 sv.UpgradeProcessing = ptr.Bool(jtv) 8827 } 8828 8829 case "VPCOptions": 8830 if err := awsRestjson1_deserializeDocumentVPCDerivedInfo(&sv.VPCOptions, value); err != nil { 8831 return err 8832 } 8833 8834 default: 8835 _, _ = key, value 8836 8837 } 8838 } 8839 *v = sv 8840 return nil 8841} 8842 8843func awsRestjson1_deserializeDocumentElasticsearchDomainStatusList(v *[]types.ElasticsearchDomainStatus, value interface{}) error { 8844 if v == nil { 8845 return fmt.Errorf("unexpected nil of type %T", v) 8846 } 8847 if value == nil { 8848 return nil 8849 } 8850 8851 shape, ok := value.([]interface{}) 8852 if !ok { 8853 return fmt.Errorf("unexpected JSON type %v", value) 8854 } 8855 8856 var cv []types.ElasticsearchDomainStatus 8857 if *v == nil { 8858 cv = []types.ElasticsearchDomainStatus{} 8859 } else { 8860 cv = *v 8861 } 8862 8863 for _, value := range shape { 8864 var col types.ElasticsearchDomainStatus 8865 destAddr := &col 8866 if err := awsRestjson1_deserializeDocumentElasticsearchDomainStatus(&destAddr, value); err != nil { 8867 return err 8868 } 8869 col = *destAddr 8870 cv = append(cv, col) 8871 8872 } 8873 *v = cv 8874 return nil 8875} 8876 8877func awsRestjson1_deserializeDocumentElasticsearchInstanceTypeList(v *[]types.ESPartitionInstanceType, value interface{}) error { 8878 if v == nil { 8879 return fmt.Errorf("unexpected nil of type %T", v) 8880 } 8881 if value == nil { 8882 return nil 8883 } 8884 8885 shape, ok := value.([]interface{}) 8886 if !ok { 8887 return fmt.Errorf("unexpected JSON type %v", value) 8888 } 8889 8890 var cv []types.ESPartitionInstanceType 8891 if *v == nil { 8892 cv = []types.ESPartitionInstanceType{} 8893 } else { 8894 cv = *v 8895 } 8896 8897 for _, value := range shape { 8898 var col types.ESPartitionInstanceType 8899 if value != nil { 8900 jtv, ok := value.(string) 8901 if !ok { 8902 return fmt.Errorf("expected ESPartitionInstanceType to be of type string, got %T instead", value) 8903 } 8904 col = types.ESPartitionInstanceType(jtv) 8905 } 8906 cv = append(cv, col) 8907 8908 } 8909 *v = cv 8910 return nil 8911} 8912 8913func awsRestjson1_deserializeDocumentElasticsearchVersionList(v *[]string, value interface{}) error { 8914 if v == nil { 8915 return fmt.Errorf("unexpected nil of type %T", v) 8916 } 8917 if value == nil { 8918 return nil 8919 } 8920 8921 shape, ok := value.([]interface{}) 8922 if !ok { 8923 return fmt.Errorf("unexpected JSON type %v", value) 8924 } 8925 8926 var cv []string 8927 if *v == nil { 8928 cv = []string{} 8929 } else { 8930 cv = *v 8931 } 8932 8933 for _, value := range shape { 8934 var col string 8935 if value != nil { 8936 jtv, ok := value.(string) 8937 if !ok { 8938 return fmt.Errorf("expected ElasticsearchVersionString to be of type string, got %T instead", value) 8939 } 8940 col = jtv 8941 } 8942 cv = append(cv, col) 8943 8944 } 8945 *v = cv 8946 return nil 8947} 8948 8949func awsRestjson1_deserializeDocumentElasticsearchVersionStatus(v **types.ElasticsearchVersionStatus, value interface{}) error { 8950 if v == nil { 8951 return fmt.Errorf("unexpected nil of type %T", v) 8952 } 8953 if value == nil { 8954 return nil 8955 } 8956 8957 shape, ok := value.(map[string]interface{}) 8958 if !ok { 8959 return fmt.Errorf("unexpected JSON type %v", value) 8960 } 8961 8962 var sv *types.ElasticsearchVersionStatus 8963 if *v == nil { 8964 sv = &types.ElasticsearchVersionStatus{} 8965 } else { 8966 sv = *v 8967 } 8968 8969 for key, value := range shape { 8970 switch key { 8971 case "Options": 8972 if value != nil { 8973 jtv, ok := value.(string) 8974 if !ok { 8975 return fmt.Errorf("expected ElasticsearchVersionString to be of type string, got %T instead", value) 8976 } 8977 sv.Options = ptr.String(jtv) 8978 } 8979 8980 case "Status": 8981 if err := awsRestjson1_deserializeDocumentOptionStatus(&sv.Status, value); err != nil { 8982 return err 8983 } 8984 8985 default: 8986 _, _ = key, value 8987 8988 } 8989 } 8990 *v = sv 8991 return nil 8992} 8993 8994func awsRestjson1_deserializeDocumentEncryptionAtRestOptions(v **types.EncryptionAtRestOptions, value interface{}) error { 8995 if v == nil { 8996 return fmt.Errorf("unexpected nil of type %T", v) 8997 } 8998 if value == nil { 8999 return nil 9000 } 9001 9002 shape, ok := value.(map[string]interface{}) 9003 if !ok { 9004 return fmt.Errorf("unexpected JSON type %v", value) 9005 } 9006 9007 var sv *types.EncryptionAtRestOptions 9008 if *v == nil { 9009 sv = &types.EncryptionAtRestOptions{} 9010 } else { 9011 sv = *v 9012 } 9013 9014 for key, value := range shape { 9015 switch key { 9016 case "Enabled": 9017 if value != nil { 9018 jtv, ok := value.(bool) 9019 if !ok { 9020 return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) 9021 } 9022 sv.Enabled = ptr.Bool(jtv) 9023 } 9024 9025 case "KmsKeyId": 9026 if value != nil { 9027 jtv, ok := value.(string) 9028 if !ok { 9029 return fmt.Errorf("expected KmsKeyId to be of type string, got %T instead", value) 9030 } 9031 sv.KmsKeyId = ptr.String(jtv) 9032 } 9033 9034 default: 9035 _, _ = key, value 9036 9037 } 9038 } 9039 *v = sv 9040 return nil 9041} 9042 9043func awsRestjson1_deserializeDocumentEncryptionAtRestOptionsStatus(v **types.EncryptionAtRestOptionsStatus, value interface{}) error { 9044 if v == nil { 9045 return fmt.Errorf("unexpected nil of type %T", v) 9046 } 9047 if value == nil { 9048 return nil 9049 } 9050 9051 shape, ok := value.(map[string]interface{}) 9052 if !ok { 9053 return fmt.Errorf("unexpected JSON type %v", value) 9054 } 9055 9056 var sv *types.EncryptionAtRestOptionsStatus 9057 if *v == nil { 9058 sv = &types.EncryptionAtRestOptionsStatus{} 9059 } else { 9060 sv = *v 9061 } 9062 9063 for key, value := range shape { 9064 switch key { 9065 case "Options": 9066 if err := awsRestjson1_deserializeDocumentEncryptionAtRestOptions(&sv.Options, value); err != nil { 9067 return err 9068 } 9069 9070 case "Status": 9071 if err := awsRestjson1_deserializeDocumentOptionStatus(&sv.Status, value); err != nil { 9072 return err 9073 } 9074 9075 default: 9076 _, _ = key, value 9077 9078 } 9079 } 9080 *v = sv 9081 return nil 9082} 9083 9084func awsRestjson1_deserializeDocumentEndpointsMap(v *map[string]string, 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 mv map[string]string 9098 if *v == nil { 9099 mv = map[string]string{} 9100 } else { 9101 mv = *v 9102 } 9103 9104 for key, value := range shape { 9105 var parsedVal string 9106 if value != nil { 9107 jtv, ok := value.(string) 9108 if !ok { 9109 return fmt.Errorf("expected ServiceUrl to be of type string, got %T instead", value) 9110 } 9111 parsedVal = jtv 9112 } 9113 mv[key] = parsedVal 9114 9115 } 9116 *v = mv 9117 return nil 9118} 9119 9120func awsRestjson1_deserializeDocumentErrorDetails(v **types.ErrorDetails, value interface{}) error { 9121 if v == nil { 9122 return fmt.Errorf("unexpected nil of type %T", v) 9123 } 9124 if value == nil { 9125 return nil 9126 } 9127 9128 shape, ok := value.(map[string]interface{}) 9129 if !ok { 9130 return fmt.Errorf("unexpected JSON type %v", value) 9131 } 9132 9133 var sv *types.ErrorDetails 9134 if *v == nil { 9135 sv = &types.ErrorDetails{} 9136 } else { 9137 sv = *v 9138 } 9139 9140 for key, value := range shape { 9141 switch key { 9142 case "ErrorMessage": 9143 if value != nil { 9144 jtv, ok := value.(string) 9145 if !ok { 9146 return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) 9147 } 9148 sv.ErrorMessage = ptr.String(jtv) 9149 } 9150 9151 case "ErrorType": 9152 if value != nil { 9153 jtv, ok := value.(string) 9154 if !ok { 9155 return fmt.Errorf("expected ErrorType to be of type string, got %T instead", value) 9156 } 9157 sv.ErrorType = ptr.String(jtv) 9158 } 9159 9160 default: 9161 _, _ = key, value 9162 9163 } 9164 } 9165 *v = sv 9166 return nil 9167} 9168 9169func awsRestjson1_deserializeDocumentInboundCrossClusterSearchConnection(v **types.InboundCrossClusterSearchConnection, value interface{}) error { 9170 if v == nil { 9171 return fmt.Errorf("unexpected nil of type %T", v) 9172 } 9173 if value == nil { 9174 return nil 9175 } 9176 9177 shape, ok := value.(map[string]interface{}) 9178 if !ok { 9179 return fmt.Errorf("unexpected JSON type %v", value) 9180 } 9181 9182 var sv *types.InboundCrossClusterSearchConnection 9183 if *v == nil { 9184 sv = &types.InboundCrossClusterSearchConnection{} 9185 } else { 9186 sv = *v 9187 } 9188 9189 for key, value := range shape { 9190 switch key { 9191 case "ConnectionStatus": 9192 if err := awsRestjson1_deserializeDocumentInboundCrossClusterSearchConnectionStatus(&sv.ConnectionStatus, value); err != nil { 9193 return err 9194 } 9195 9196 case "CrossClusterSearchConnectionId": 9197 if value != nil { 9198 jtv, ok := value.(string) 9199 if !ok { 9200 return fmt.Errorf("expected CrossClusterSearchConnectionId to be of type string, got %T instead", value) 9201 } 9202 sv.CrossClusterSearchConnectionId = ptr.String(jtv) 9203 } 9204 9205 case "DestinationDomainInfo": 9206 if err := awsRestjson1_deserializeDocumentDomainInformation(&sv.DestinationDomainInfo, value); err != nil { 9207 return err 9208 } 9209 9210 case "SourceDomainInfo": 9211 if err := awsRestjson1_deserializeDocumentDomainInformation(&sv.SourceDomainInfo, value); err != nil { 9212 return err 9213 } 9214 9215 default: 9216 _, _ = key, value 9217 9218 } 9219 } 9220 *v = sv 9221 return nil 9222} 9223 9224func awsRestjson1_deserializeDocumentInboundCrossClusterSearchConnections(v *[]types.InboundCrossClusterSearchConnection, value interface{}) error { 9225 if v == nil { 9226 return fmt.Errorf("unexpected nil of type %T", v) 9227 } 9228 if value == nil { 9229 return nil 9230 } 9231 9232 shape, ok := value.([]interface{}) 9233 if !ok { 9234 return fmt.Errorf("unexpected JSON type %v", value) 9235 } 9236 9237 var cv []types.InboundCrossClusterSearchConnection 9238 if *v == nil { 9239 cv = []types.InboundCrossClusterSearchConnection{} 9240 } else { 9241 cv = *v 9242 } 9243 9244 for _, value := range shape { 9245 var col types.InboundCrossClusterSearchConnection 9246 destAddr := &col 9247 if err := awsRestjson1_deserializeDocumentInboundCrossClusterSearchConnection(&destAddr, value); err != nil { 9248 return err 9249 } 9250 col = *destAddr 9251 cv = append(cv, col) 9252 9253 } 9254 *v = cv 9255 return nil 9256} 9257 9258func awsRestjson1_deserializeDocumentInboundCrossClusterSearchConnectionStatus(v **types.InboundCrossClusterSearchConnectionStatus, value interface{}) error { 9259 if v == nil { 9260 return fmt.Errorf("unexpected nil of type %T", v) 9261 } 9262 if value == nil { 9263 return nil 9264 } 9265 9266 shape, ok := value.(map[string]interface{}) 9267 if !ok { 9268 return fmt.Errorf("unexpected JSON type %v", value) 9269 } 9270 9271 var sv *types.InboundCrossClusterSearchConnectionStatus 9272 if *v == nil { 9273 sv = &types.InboundCrossClusterSearchConnectionStatus{} 9274 } else { 9275 sv = *v 9276 } 9277 9278 for key, value := range shape { 9279 switch key { 9280 case "Message": 9281 if value != nil { 9282 jtv, ok := value.(string) 9283 if !ok { 9284 return fmt.Errorf("expected CrossClusterSearchConnectionStatusMessage to be of type string, got %T instead", value) 9285 } 9286 sv.Message = ptr.String(jtv) 9287 } 9288 9289 case "StatusCode": 9290 if value != nil { 9291 jtv, ok := value.(string) 9292 if !ok { 9293 return fmt.Errorf("expected InboundCrossClusterSearchConnectionStatusCode to be of type string, got %T instead", value) 9294 } 9295 sv.StatusCode = types.InboundCrossClusterSearchConnectionStatusCode(jtv) 9296 } 9297 9298 default: 9299 _, _ = key, value 9300 9301 } 9302 } 9303 *v = sv 9304 return nil 9305} 9306 9307func awsRestjson1_deserializeDocumentInstanceCountLimits(v **types.InstanceCountLimits, value interface{}) error { 9308 if v == nil { 9309 return fmt.Errorf("unexpected nil of type %T", v) 9310 } 9311 if value == nil { 9312 return nil 9313 } 9314 9315 shape, ok := value.(map[string]interface{}) 9316 if !ok { 9317 return fmt.Errorf("unexpected JSON type %v", value) 9318 } 9319 9320 var sv *types.InstanceCountLimits 9321 if *v == nil { 9322 sv = &types.InstanceCountLimits{} 9323 } else { 9324 sv = *v 9325 } 9326 9327 for key, value := range shape { 9328 switch key { 9329 case "MaximumInstanceCount": 9330 if value != nil { 9331 jtv, ok := value.(json.Number) 9332 if !ok { 9333 return fmt.Errorf("expected MaximumInstanceCount to be json.Number, got %T instead", value) 9334 } 9335 i64, err := jtv.Int64() 9336 if err != nil { 9337 return err 9338 } 9339 sv.MaximumInstanceCount = int32(i64) 9340 } 9341 9342 case "MinimumInstanceCount": 9343 if value != nil { 9344 jtv, ok := value.(json.Number) 9345 if !ok { 9346 return fmt.Errorf("expected MinimumInstanceCount to be json.Number, got %T instead", value) 9347 } 9348 i64, err := jtv.Int64() 9349 if err != nil { 9350 return err 9351 } 9352 sv.MinimumInstanceCount = int32(i64) 9353 } 9354 9355 default: 9356 _, _ = key, value 9357 9358 } 9359 } 9360 *v = sv 9361 return nil 9362} 9363 9364func awsRestjson1_deserializeDocumentInstanceLimits(v **types.InstanceLimits, value interface{}) error { 9365 if v == nil { 9366 return fmt.Errorf("unexpected nil of type %T", v) 9367 } 9368 if value == nil { 9369 return nil 9370 } 9371 9372 shape, ok := value.(map[string]interface{}) 9373 if !ok { 9374 return fmt.Errorf("unexpected JSON type %v", value) 9375 } 9376 9377 var sv *types.InstanceLimits 9378 if *v == nil { 9379 sv = &types.InstanceLimits{} 9380 } else { 9381 sv = *v 9382 } 9383 9384 for key, value := range shape { 9385 switch key { 9386 case "InstanceCountLimits": 9387 if err := awsRestjson1_deserializeDocumentInstanceCountLimits(&sv.InstanceCountLimits, value); err != nil { 9388 return err 9389 } 9390 9391 default: 9392 _, _ = key, value 9393 9394 } 9395 } 9396 *v = sv 9397 return nil 9398} 9399 9400func awsRestjson1_deserializeDocumentInternalException(v **types.InternalException, value interface{}) error { 9401 if v == nil { 9402 return fmt.Errorf("unexpected nil of type %T", v) 9403 } 9404 if value == nil { 9405 return nil 9406 } 9407 9408 shape, ok := value.(map[string]interface{}) 9409 if !ok { 9410 return fmt.Errorf("unexpected JSON type %v", value) 9411 } 9412 9413 var sv *types.InternalException 9414 if *v == nil { 9415 sv = &types.InternalException{} 9416 } else { 9417 sv = *v 9418 } 9419 9420 for key, value := range shape { 9421 switch key { 9422 case "message": 9423 if value != nil { 9424 jtv, ok := value.(string) 9425 if !ok { 9426 return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) 9427 } 9428 sv.Message = ptr.String(jtv) 9429 } 9430 9431 default: 9432 _, _ = key, value 9433 9434 } 9435 } 9436 *v = sv 9437 return nil 9438} 9439 9440func awsRestjson1_deserializeDocumentInvalidPaginationTokenException(v **types.InvalidPaginationTokenException, value interface{}) error { 9441 if v == nil { 9442 return fmt.Errorf("unexpected nil of type %T", v) 9443 } 9444 if value == nil { 9445 return nil 9446 } 9447 9448 shape, ok := value.(map[string]interface{}) 9449 if !ok { 9450 return fmt.Errorf("unexpected JSON type %v", value) 9451 } 9452 9453 var sv *types.InvalidPaginationTokenException 9454 if *v == nil { 9455 sv = &types.InvalidPaginationTokenException{} 9456 } else { 9457 sv = *v 9458 } 9459 9460 for key, value := range shape { 9461 switch key { 9462 case "message": 9463 if value != nil { 9464 jtv, ok := value.(string) 9465 if !ok { 9466 return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) 9467 } 9468 sv.Message = ptr.String(jtv) 9469 } 9470 9471 default: 9472 _, _ = key, value 9473 9474 } 9475 } 9476 *v = sv 9477 return nil 9478} 9479 9480func awsRestjson1_deserializeDocumentInvalidTypeException(v **types.InvalidTypeException, value interface{}) error { 9481 if v == nil { 9482 return fmt.Errorf("unexpected nil of type %T", v) 9483 } 9484 if value == nil { 9485 return nil 9486 } 9487 9488 shape, ok := value.(map[string]interface{}) 9489 if !ok { 9490 return fmt.Errorf("unexpected JSON type %v", value) 9491 } 9492 9493 var sv *types.InvalidTypeException 9494 if *v == nil { 9495 sv = &types.InvalidTypeException{} 9496 } else { 9497 sv = *v 9498 } 9499 9500 for key, value := range shape { 9501 switch key { 9502 case "message": 9503 if value != nil { 9504 jtv, ok := value.(string) 9505 if !ok { 9506 return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) 9507 } 9508 sv.Message = ptr.String(jtv) 9509 } 9510 9511 default: 9512 _, _ = key, value 9513 9514 } 9515 } 9516 *v = sv 9517 return nil 9518} 9519 9520func awsRestjson1_deserializeDocumentIssues(v *[]string, value interface{}) error { 9521 if v == nil { 9522 return fmt.Errorf("unexpected nil of type %T", v) 9523 } 9524 if value == nil { 9525 return nil 9526 } 9527 9528 shape, ok := value.([]interface{}) 9529 if !ok { 9530 return fmt.Errorf("unexpected JSON type %v", value) 9531 } 9532 9533 var cv []string 9534 if *v == nil { 9535 cv = []string{} 9536 } else { 9537 cv = *v 9538 } 9539 9540 for _, value := range shape { 9541 var col string 9542 if value != nil { 9543 jtv, ok := value.(string) 9544 if !ok { 9545 return fmt.Errorf("expected Issue to be of type string, got %T instead", value) 9546 } 9547 col = jtv 9548 } 9549 cv = append(cv, col) 9550 9551 } 9552 *v = cv 9553 return nil 9554} 9555 9556func awsRestjson1_deserializeDocumentLimitExceededException(v **types.LimitExceededException, value interface{}) error { 9557 if v == nil { 9558 return fmt.Errorf("unexpected nil of type %T", v) 9559 } 9560 if value == nil { 9561 return nil 9562 } 9563 9564 shape, ok := value.(map[string]interface{}) 9565 if !ok { 9566 return fmt.Errorf("unexpected JSON type %v", value) 9567 } 9568 9569 var sv *types.LimitExceededException 9570 if *v == nil { 9571 sv = &types.LimitExceededException{} 9572 } else { 9573 sv = *v 9574 } 9575 9576 for key, value := range shape { 9577 switch key { 9578 case "message": 9579 if value != nil { 9580 jtv, ok := value.(string) 9581 if !ok { 9582 return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) 9583 } 9584 sv.Message = ptr.String(jtv) 9585 } 9586 9587 default: 9588 _, _ = key, value 9589 9590 } 9591 } 9592 *v = sv 9593 return nil 9594} 9595 9596func awsRestjson1_deserializeDocumentLimits(v **types.Limits, value interface{}) error { 9597 if v == nil { 9598 return fmt.Errorf("unexpected nil of type %T", v) 9599 } 9600 if value == nil { 9601 return nil 9602 } 9603 9604 shape, ok := value.(map[string]interface{}) 9605 if !ok { 9606 return fmt.Errorf("unexpected JSON type %v", value) 9607 } 9608 9609 var sv *types.Limits 9610 if *v == nil { 9611 sv = &types.Limits{} 9612 } else { 9613 sv = *v 9614 } 9615 9616 for key, value := range shape { 9617 switch key { 9618 case "AdditionalLimits": 9619 if err := awsRestjson1_deserializeDocumentAdditionalLimitList(&sv.AdditionalLimits, value); err != nil { 9620 return err 9621 } 9622 9623 case "InstanceLimits": 9624 if err := awsRestjson1_deserializeDocumentInstanceLimits(&sv.InstanceLimits, value); err != nil { 9625 return err 9626 } 9627 9628 case "StorageTypes": 9629 if err := awsRestjson1_deserializeDocumentStorageTypeList(&sv.StorageTypes, value); err != nil { 9630 return err 9631 } 9632 9633 default: 9634 _, _ = key, value 9635 9636 } 9637 } 9638 *v = sv 9639 return nil 9640} 9641 9642func awsRestjson1_deserializeDocumentLimitsByRole(v *map[string]types.Limits, value interface{}) error { 9643 if v == nil { 9644 return fmt.Errorf("unexpected nil of type %T", v) 9645 } 9646 if value == nil { 9647 return nil 9648 } 9649 9650 shape, ok := value.(map[string]interface{}) 9651 if !ok { 9652 return fmt.Errorf("unexpected JSON type %v", value) 9653 } 9654 9655 var mv map[string]types.Limits 9656 if *v == nil { 9657 mv = map[string]types.Limits{} 9658 } else { 9659 mv = *v 9660 } 9661 9662 for key, value := range shape { 9663 var parsedVal types.Limits 9664 mapVar := parsedVal 9665 destAddr := &mapVar 9666 if err := awsRestjson1_deserializeDocumentLimits(&destAddr, value); err != nil { 9667 return err 9668 } 9669 parsedVal = *destAddr 9670 mv[key] = parsedVal 9671 9672 } 9673 *v = mv 9674 return nil 9675} 9676 9677func awsRestjson1_deserializeDocumentLimitValueList(v *[]string, value interface{}) error { 9678 if v == nil { 9679 return fmt.Errorf("unexpected nil of type %T", v) 9680 } 9681 if value == nil { 9682 return nil 9683 } 9684 9685 shape, ok := value.([]interface{}) 9686 if !ok { 9687 return fmt.Errorf("unexpected JSON type %v", value) 9688 } 9689 9690 var cv []string 9691 if *v == nil { 9692 cv = []string{} 9693 } else { 9694 cv = *v 9695 } 9696 9697 for _, value := range shape { 9698 var col string 9699 if value != nil { 9700 jtv, ok := value.(string) 9701 if !ok { 9702 return fmt.Errorf("expected LimitValue to be of type string, got %T instead", value) 9703 } 9704 col = jtv 9705 } 9706 cv = append(cv, col) 9707 9708 } 9709 *v = cv 9710 return nil 9711} 9712 9713func awsRestjson1_deserializeDocumentLogPublishingOption(v **types.LogPublishingOption, value interface{}) error { 9714 if v == nil { 9715 return fmt.Errorf("unexpected nil of type %T", v) 9716 } 9717 if value == nil { 9718 return nil 9719 } 9720 9721 shape, ok := value.(map[string]interface{}) 9722 if !ok { 9723 return fmt.Errorf("unexpected JSON type %v", value) 9724 } 9725 9726 var sv *types.LogPublishingOption 9727 if *v == nil { 9728 sv = &types.LogPublishingOption{} 9729 } else { 9730 sv = *v 9731 } 9732 9733 for key, value := range shape { 9734 switch key { 9735 case "CloudWatchLogsLogGroupArn": 9736 if value != nil { 9737 jtv, ok := value.(string) 9738 if !ok { 9739 return fmt.Errorf("expected CloudWatchLogsLogGroupArn to be of type string, got %T instead", value) 9740 } 9741 sv.CloudWatchLogsLogGroupArn = ptr.String(jtv) 9742 } 9743 9744 case "Enabled": 9745 if value != nil { 9746 jtv, ok := value.(bool) 9747 if !ok { 9748 return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) 9749 } 9750 sv.Enabled = ptr.Bool(jtv) 9751 } 9752 9753 default: 9754 _, _ = key, value 9755 9756 } 9757 } 9758 *v = sv 9759 return nil 9760} 9761 9762func awsRestjson1_deserializeDocumentLogPublishingOptions(v *map[string]types.LogPublishingOption, value interface{}) error { 9763 if v == nil { 9764 return fmt.Errorf("unexpected nil of type %T", v) 9765 } 9766 if value == nil { 9767 return nil 9768 } 9769 9770 shape, ok := value.(map[string]interface{}) 9771 if !ok { 9772 return fmt.Errorf("unexpected JSON type %v", value) 9773 } 9774 9775 var mv map[string]types.LogPublishingOption 9776 if *v == nil { 9777 mv = map[string]types.LogPublishingOption{} 9778 } else { 9779 mv = *v 9780 } 9781 9782 for key, value := range shape { 9783 var parsedVal types.LogPublishingOption 9784 mapVar := parsedVal 9785 destAddr := &mapVar 9786 if err := awsRestjson1_deserializeDocumentLogPublishingOption(&destAddr, value); err != nil { 9787 return err 9788 } 9789 parsedVal = *destAddr 9790 mv[key] = parsedVal 9791 9792 } 9793 *v = mv 9794 return nil 9795} 9796 9797func awsRestjson1_deserializeDocumentLogPublishingOptionsStatus(v **types.LogPublishingOptionsStatus, value interface{}) error { 9798 if v == nil { 9799 return fmt.Errorf("unexpected nil of type %T", v) 9800 } 9801 if value == nil { 9802 return nil 9803 } 9804 9805 shape, ok := value.(map[string]interface{}) 9806 if !ok { 9807 return fmt.Errorf("unexpected JSON type %v", value) 9808 } 9809 9810 var sv *types.LogPublishingOptionsStatus 9811 if *v == nil { 9812 sv = &types.LogPublishingOptionsStatus{} 9813 } else { 9814 sv = *v 9815 } 9816 9817 for key, value := range shape { 9818 switch key { 9819 case "Options": 9820 if err := awsRestjson1_deserializeDocumentLogPublishingOptions(&sv.Options, value); err != nil { 9821 return err 9822 } 9823 9824 case "Status": 9825 if err := awsRestjson1_deserializeDocumentOptionStatus(&sv.Status, value); err != nil { 9826 return err 9827 } 9828 9829 default: 9830 _, _ = key, value 9831 9832 } 9833 } 9834 *v = sv 9835 return nil 9836} 9837 9838func awsRestjson1_deserializeDocumentNodeToNodeEncryptionOptions(v **types.NodeToNodeEncryptionOptions, value interface{}) error { 9839 if v == nil { 9840 return fmt.Errorf("unexpected nil of type %T", v) 9841 } 9842 if value == nil { 9843 return nil 9844 } 9845 9846 shape, ok := value.(map[string]interface{}) 9847 if !ok { 9848 return fmt.Errorf("unexpected JSON type %v", value) 9849 } 9850 9851 var sv *types.NodeToNodeEncryptionOptions 9852 if *v == nil { 9853 sv = &types.NodeToNodeEncryptionOptions{} 9854 } else { 9855 sv = *v 9856 } 9857 9858 for key, value := range shape { 9859 switch key { 9860 case "Enabled": 9861 if value != nil { 9862 jtv, ok := value.(bool) 9863 if !ok { 9864 return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) 9865 } 9866 sv.Enabled = ptr.Bool(jtv) 9867 } 9868 9869 default: 9870 _, _ = key, value 9871 9872 } 9873 } 9874 *v = sv 9875 return nil 9876} 9877 9878func awsRestjson1_deserializeDocumentNodeToNodeEncryptionOptionsStatus(v **types.NodeToNodeEncryptionOptionsStatus, value interface{}) error { 9879 if v == nil { 9880 return fmt.Errorf("unexpected nil of type %T", v) 9881 } 9882 if value == nil { 9883 return nil 9884 } 9885 9886 shape, ok := value.(map[string]interface{}) 9887 if !ok { 9888 return fmt.Errorf("unexpected JSON type %v", value) 9889 } 9890 9891 var sv *types.NodeToNodeEncryptionOptionsStatus 9892 if *v == nil { 9893 sv = &types.NodeToNodeEncryptionOptionsStatus{} 9894 } else { 9895 sv = *v 9896 } 9897 9898 for key, value := range shape { 9899 switch key { 9900 case "Options": 9901 if err := awsRestjson1_deserializeDocumentNodeToNodeEncryptionOptions(&sv.Options, value); err != nil { 9902 return err 9903 } 9904 9905 case "Status": 9906 if err := awsRestjson1_deserializeDocumentOptionStatus(&sv.Status, value); err != nil { 9907 return err 9908 } 9909 9910 default: 9911 _, _ = key, value 9912 9913 } 9914 } 9915 *v = sv 9916 return nil 9917} 9918 9919func awsRestjson1_deserializeDocumentOptionStatus(v **types.OptionStatus, value interface{}) error { 9920 if v == nil { 9921 return fmt.Errorf("unexpected nil of type %T", v) 9922 } 9923 if value == nil { 9924 return nil 9925 } 9926 9927 shape, ok := value.(map[string]interface{}) 9928 if !ok { 9929 return fmt.Errorf("unexpected JSON type %v", value) 9930 } 9931 9932 var sv *types.OptionStatus 9933 if *v == nil { 9934 sv = &types.OptionStatus{} 9935 } else { 9936 sv = *v 9937 } 9938 9939 for key, value := range shape { 9940 switch key { 9941 case "CreationDate": 9942 if value != nil { 9943 jtv, ok := value.(json.Number) 9944 if !ok { 9945 return fmt.Errorf("expected UpdateTimestamp to be json.Number, got %T instead", value) 9946 } 9947 f64, err := jtv.Float64() 9948 if err != nil { 9949 return err 9950 } 9951 sv.CreationDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) 9952 } 9953 9954 case "PendingDeletion": 9955 if value != nil { 9956 jtv, ok := value.(bool) 9957 if !ok { 9958 return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) 9959 } 9960 sv.PendingDeletion = ptr.Bool(jtv) 9961 } 9962 9963 case "State": 9964 if value != nil { 9965 jtv, ok := value.(string) 9966 if !ok { 9967 return fmt.Errorf("expected OptionState to be of type string, got %T instead", value) 9968 } 9969 sv.State = types.OptionState(jtv) 9970 } 9971 9972 case "UpdateDate": 9973 if value != nil { 9974 jtv, ok := value.(json.Number) 9975 if !ok { 9976 return fmt.Errorf("expected UpdateTimestamp to be json.Number, got %T instead", value) 9977 } 9978 f64, err := jtv.Float64() 9979 if err != nil { 9980 return err 9981 } 9982 sv.UpdateDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) 9983 } 9984 9985 case "UpdateVersion": 9986 if value != nil { 9987 jtv, ok := value.(json.Number) 9988 if !ok { 9989 return fmt.Errorf("expected UIntValue to be json.Number, got %T instead", value) 9990 } 9991 i64, err := jtv.Int64() 9992 if err != nil { 9993 return err 9994 } 9995 sv.UpdateVersion = int32(i64) 9996 } 9997 9998 default: 9999 _, _ = key, value 10000 10001 } 10002 } 10003 *v = sv 10004 return nil 10005} 10006 10007func awsRestjson1_deserializeDocumentOutboundCrossClusterSearchConnection(v **types.OutboundCrossClusterSearchConnection, value interface{}) error { 10008 if v == nil { 10009 return fmt.Errorf("unexpected nil of type %T", v) 10010 } 10011 if value == nil { 10012 return nil 10013 } 10014 10015 shape, ok := value.(map[string]interface{}) 10016 if !ok { 10017 return fmt.Errorf("unexpected JSON type %v", value) 10018 } 10019 10020 var sv *types.OutboundCrossClusterSearchConnection 10021 if *v == nil { 10022 sv = &types.OutboundCrossClusterSearchConnection{} 10023 } else { 10024 sv = *v 10025 } 10026 10027 for key, value := range shape { 10028 switch key { 10029 case "ConnectionAlias": 10030 if value != nil { 10031 jtv, ok := value.(string) 10032 if !ok { 10033 return fmt.Errorf("expected ConnectionAlias to be of type string, got %T instead", value) 10034 } 10035 sv.ConnectionAlias = ptr.String(jtv) 10036 } 10037 10038 case "ConnectionStatus": 10039 if err := awsRestjson1_deserializeDocumentOutboundCrossClusterSearchConnectionStatus(&sv.ConnectionStatus, value); err != nil { 10040 return err 10041 } 10042 10043 case "CrossClusterSearchConnectionId": 10044 if value != nil { 10045 jtv, ok := value.(string) 10046 if !ok { 10047 return fmt.Errorf("expected CrossClusterSearchConnectionId to be of type string, got %T instead", value) 10048 } 10049 sv.CrossClusterSearchConnectionId = ptr.String(jtv) 10050 } 10051 10052 case "DestinationDomainInfo": 10053 if err := awsRestjson1_deserializeDocumentDomainInformation(&sv.DestinationDomainInfo, value); err != nil { 10054 return err 10055 } 10056 10057 case "SourceDomainInfo": 10058 if err := awsRestjson1_deserializeDocumentDomainInformation(&sv.SourceDomainInfo, value); err != nil { 10059 return err 10060 } 10061 10062 default: 10063 _, _ = key, value 10064 10065 } 10066 } 10067 *v = sv 10068 return nil 10069} 10070 10071func awsRestjson1_deserializeDocumentOutboundCrossClusterSearchConnections(v *[]types.OutboundCrossClusterSearchConnection, value interface{}) error { 10072 if v == nil { 10073 return fmt.Errorf("unexpected nil of type %T", v) 10074 } 10075 if value == nil { 10076 return nil 10077 } 10078 10079 shape, ok := value.([]interface{}) 10080 if !ok { 10081 return fmt.Errorf("unexpected JSON type %v", value) 10082 } 10083 10084 var cv []types.OutboundCrossClusterSearchConnection 10085 if *v == nil { 10086 cv = []types.OutboundCrossClusterSearchConnection{} 10087 } else { 10088 cv = *v 10089 } 10090 10091 for _, value := range shape { 10092 var col types.OutboundCrossClusterSearchConnection 10093 destAddr := &col 10094 if err := awsRestjson1_deserializeDocumentOutboundCrossClusterSearchConnection(&destAddr, value); err != nil { 10095 return err 10096 } 10097 col = *destAddr 10098 cv = append(cv, col) 10099 10100 } 10101 *v = cv 10102 return nil 10103} 10104 10105func awsRestjson1_deserializeDocumentOutboundCrossClusterSearchConnectionStatus(v **types.OutboundCrossClusterSearchConnectionStatus, value interface{}) error { 10106 if v == nil { 10107 return fmt.Errorf("unexpected nil of type %T", v) 10108 } 10109 if value == nil { 10110 return nil 10111 } 10112 10113 shape, ok := value.(map[string]interface{}) 10114 if !ok { 10115 return fmt.Errorf("unexpected JSON type %v", value) 10116 } 10117 10118 var sv *types.OutboundCrossClusterSearchConnectionStatus 10119 if *v == nil { 10120 sv = &types.OutboundCrossClusterSearchConnectionStatus{} 10121 } else { 10122 sv = *v 10123 } 10124 10125 for key, value := range shape { 10126 switch key { 10127 case "Message": 10128 if value != nil { 10129 jtv, ok := value.(string) 10130 if !ok { 10131 return fmt.Errorf("expected CrossClusterSearchConnectionStatusMessage to be of type string, got %T instead", value) 10132 } 10133 sv.Message = ptr.String(jtv) 10134 } 10135 10136 case "StatusCode": 10137 if value != nil { 10138 jtv, ok := value.(string) 10139 if !ok { 10140 return fmt.Errorf("expected OutboundCrossClusterSearchConnectionStatusCode to be of type string, got %T instead", value) 10141 } 10142 sv.StatusCode = types.OutboundCrossClusterSearchConnectionStatusCode(jtv) 10143 } 10144 10145 default: 10146 _, _ = key, value 10147 10148 } 10149 } 10150 *v = sv 10151 return nil 10152} 10153 10154func awsRestjson1_deserializeDocumentPackageDetails(v **types.PackageDetails, value interface{}) error { 10155 if v == nil { 10156 return fmt.Errorf("unexpected nil of type %T", v) 10157 } 10158 if value == nil { 10159 return nil 10160 } 10161 10162 shape, ok := value.(map[string]interface{}) 10163 if !ok { 10164 return fmt.Errorf("unexpected JSON type %v", value) 10165 } 10166 10167 var sv *types.PackageDetails 10168 if *v == nil { 10169 sv = &types.PackageDetails{} 10170 } else { 10171 sv = *v 10172 } 10173 10174 for key, value := range shape { 10175 switch key { 10176 case "AvailablePackageVersion": 10177 if value != nil { 10178 jtv, ok := value.(string) 10179 if !ok { 10180 return fmt.Errorf("expected PackageVersion to be of type string, got %T instead", value) 10181 } 10182 sv.AvailablePackageVersion = ptr.String(jtv) 10183 } 10184 10185 case "CreatedAt": 10186 if value != nil { 10187 jtv, ok := value.(json.Number) 10188 if !ok { 10189 return fmt.Errorf("expected CreatedAt to be json.Number, got %T instead", value) 10190 } 10191 f64, err := jtv.Float64() 10192 if err != nil { 10193 return err 10194 } 10195 sv.CreatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) 10196 } 10197 10198 case "ErrorDetails": 10199 if err := awsRestjson1_deserializeDocumentErrorDetails(&sv.ErrorDetails, value); err != nil { 10200 return err 10201 } 10202 10203 case "LastUpdatedAt": 10204 if value != nil { 10205 jtv, ok := value.(json.Number) 10206 if !ok { 10207 return fmt.Errorf("expected LastUpdated to be json.Number, got %T instead", value) 10208 } 10209 f64, err := jtv.Float64() 10210 if err != nil { 10211 return err 10212 } 10213 sv.LastUpdatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) 10214 } 10215 10216 case "PackageDescription": 10217 if value != nil { 10218 jtv, ok := value.(string) 10219 if !ok { 10220 return fmt.Errorf("expected PackageDescription to be of type string, got %T instead", value) 10221 } 10222 sv.PackageDescription = ptr.String(jtv) 10223 } 10224 10225 case "PackageID": 10226 if value != nil { 10227 jtv, ok := value.(string) 10228 if !ok { 10229 return fmt.Errorf("expected PackageID to be of type string, got %T instead", value) 10230 } 10231 sv.PackageID = ptr.String(jtv) 10232 } 10233 10234 case "PackageName": 10235 if value != nil { 10236 jtv, ok := value.(string) 10237 if !ok { 10238 return fmt.Errorf("expected PackageName to be of type string, got %T instead", value) 10239 } 10240 sv.PackageName = ptr.String(jtv) 10241 } 10242 10243 case "PackageStatus": 10244 if value != nil { 10245 jtv, ok := value.(string) 10246 if !ok { 10247 return fmt.Errorf("expected PackageStatus to be of type string, got %T instead", value) 10248 } 10249 sv.PackageStatus = types.PackageStatus(jtv) 10250 } 10251 10252 case "PackageType": 10253 if value != nil { 10254 jtv, ok := value.(string) 10255 if !ok { 10256 return fmt.Errorf("expected PackageType to be of type string, got %T instead", value) 10257 } 10258 sv.PackageType = types.PackageType(jtv) 10259 } 10260 10261 default: 10262 _, _ = key, value 10263 10264 } 10265 } 10266 *v = sv 10267 return nil 10268} 10269 10270func awsRestjson1_deserializeDocumentPackageDetailsList(v *[]types.PackageDetails, value interface{}) error { 10271 if v == nil { 10272 return fmt.Errorf("unexpected nil of type %T", v) 10273 } 10274 if value == nil { 10275 return nil 10276 } 10277 10278 shape, ok := value.([]interface{}) 10279 if !ok { 10280 return fmt.Errorf("unexpected JSON type %v", value) 10281 } 10282 10283 var cv []types.PackageDetails 10284 if *v == nil { 10285 cv = []types.PackageDetails{} 10286 } else { 10287 cv = *v 10288 } 10289 10290 for _, value := range shape { 10291 var col types.PackageDetails 10292 destAddr := &col 10293 if err := awsRestjson1_deserializeDocumentPackageDetails(&destAddr, value); err != nil { 10294 return err 10295 } 10296 col = *destAddr 10297 cv = append(cv, col) 10298 10299 } 10300 *v = cv 10301 return nil 10302} 10303 10304func awsRestjson1_deserializeDocumentPackageVersionHistory(v **types.PackageVersionHistory, value interface{}) error { 10305 if v == nil { 10306 return fmt.Errorf("unexpected nil of type %T", v) 10307 } 10308 if value == nil { 10309 return nil 10310 } 10311 10312 shape, ok := value.(map[string]interface{}) 10313 if !ok { 10314 return fmt.Errorf("unexpected JSON type %v", value) 10315 } 10316 10317 var sv *types.PackageVersionHistory 10318 if *v == nil { 10319 sv = &types.PackageVersionHistory{} 10320 } else { 10321 sv = *v 10322 } 10323 10324 for key, value := range shape { 10325 switch key { 10326 case "CommitMessage": 10327 if value != nil { 10328 jtv, ok := value.(string) 10329 if !ok { 10330 return fmt.Errorf("expected CommitMessage to be of type string, got %T instead", value) 10331 } 10332 sv.CommitMessage = ptr.String(jtv) 10333 } 10334 10335 case "CreatedAt": 10336 if value != nil { 10337 jtv, ok := value.(json.Number) 10338 if !ok { 10339 return fmt.Errorf("expected CreatedAt to be json.Number, got %T instead", value) 10340 } 10341 f64, err := jtv.Float64() 10342 if err != nil { 10343 return err 10344 } 10345 sv.CreatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) 10346 } 10347 10348 case "PackageVersion": 10349 if value != nil { 10350 jtv, ok := value.(string) 10351 if !ok { 10352 return fmt.Errorf("expected PackageVersion to be of type string, got %T instead", value) 10353 } 10354 sv.PackageVersion = ptr.String(jtv) 10355 } 10356 10357 default: 10358 _, _ = key, value 10359 10360 } 10361 } 10362 *v = sv 10363 return nil 10364} 10365 10366func awsRestjson1_deserializeDocumentPackageVersionHistoryList(v *[]types.PackageVersionHistory, value interface{}) error { 10367 if v == nil { 10368 return fmt.Errorf("unexpected nil of type %T", v) 10369 } 10370 if value == nil { 10371 return nil 10372 } 10373 10374 shape, ok := value.([]interface{}) 10375 if !ok { 10376 return fmt.Errorf("unexpected JSON type %v", value) 10377 } 10378 10379 var cv []types.PackageVersionHistory 10380 if *v == nil { 10381 cv = []types.PackageVersionHistory{} 10382 } else { 10383 cv = *v 10384 } 10385 10386 for _, value := range shape { 10387 var col types.PackageVersionHistory 10388 destAddr := &col 10389 if err := awsRestjson1_deserializeDocumentPackageVersionHistory(&destAddr, value); err != nil { 10390 return err 10391 } 10392 col = *destAddr 10393 cv = append(cv, col) 10394 10395 } 10396 *v = cv 10397 return nil 10398} 10399 10400func awsRestjson1_deserializeDocumentRecurringCharge(v **types.RecurringCharge, value interface{}) error { 10401 if v == nil { 10402 return fmt.Errorf("unexpected nil of type %T", v) 10403 } 10404 if value == nil { 10405 return nil 10406 } 10407 10408 shape, ok := value.(map[string]interface{}) 10409 if !ok { 10410 return fmt.Errorf("unexpected JSON type %v", value) 10411 } 10412 10413 var sv *types.RecurringCharge 10414 if *v == nil { 10415 sv = &types.RecurringCharge{} 10416 } else { 10417 sv = *v 10418 } 10419 10420 for key, value := range shape { 10421 switch key { 10422 case "RecurringChargeAmount": 10423 if value != nil { 10424 jtv, ok := value.(json.Number) 10425 if !ok { 10426 return fmt.Errorf("expected Double to be json.Number, got %T instead", value) 10427 } 10428 f64, err := jtv.Float64() 10429 if err != nil { 10430 return err 10431 } 10432 sv.RecurringChargeAmount = ptr.Float64(f64) 10433 } 10434 10435 case "RecurringChargeFrequency": 10436 if value != nil { 10437 jtv, ok := value.(string) 10438 if !ok { 10439 return fmt.Errorf("expected String to be of type string, got %T instead", value) 10440 } 10441 sv.RecurringChargeFrequency = ptr.String(jtv) 10442 } 10443 10444 default: 10445 _, _ = key, value 10446 10447 } 10448 } 10449 *v = sv 10450 return nil 10451} 10452 10453func awsRestjson1_deserializeDocumentRecurringChargeList(v *[]types.RecurringCharge, value interface{}) error { 10454 if v == nil { 10455 return fmt.Errorf("unexpected nil of type %T", v) 10456 } 10457 if value == nil { 10458 return nil 10459 } 10460 10461 shape, ok := value.([]interface{}) 10462 if !ok { 10463 return fmt.Errorf("unexpected JSON type %v", value) 10464 } 10465 10466 var cv []types.RecurringCharge 10467 if *v == nil { 10468 cv = []types.RecurringCharge{} 10469 } else { 10470 cv = *v 10471 } 10472 10473 for _, value := range shape { 10474 var col types.RecurringCharge 10475 destAddr := &col 10476 if err := awsRestjson1_deserializeDocumentRecurringCharge(&destAddr, value); err != nil { 10477 return err 10478 } 10479 col = *destAddr 10480 cv = append(cv, col) 10481 10482 } 10483 *v = cv 10484 return nil 10485} 10486 10487func awsRestjson1_deserializeDocumentReservedElasticsearchInstance(v **types.ReservedElasticsearchInstance, value interface{}) error { 10488 if v == nil { 10489 return fmt.Errorf("unexpected nil of type %T", v) 10490 } 10491 if value == nil { 10492 return nil 10493 } 10494 10495 shape, ok := value.(map[string]interface{}) 10496 if !ok { 10497 return fmt.Errorf("unexpected JSON type %v", value) 10498 } 10499 10500 var sv *types.ReservedElasticsearchInstance 10501 if *v == nil { 10502 sv = &types.ReservedElasticsearchInstance{} 10503 } else { 10504 sv = *v 10505 } 10506 10507 for key, value := range shape { 10508 switch key { 10509 case "CurrencyCode": 10510 if value != nil { 10511 jtv, ok := value.(string) 10512 if !ok { 10513 return fmt.Errorf("expected String to be of type string, got %T instead", value) 10514 } 10515 sv.CurrencyCode = ptr.String(jtv) 10516 } 10517 10518 case "Duration": 10519 if value != nil { 10520 jtv, ok := value.(json.Number) 10521 if !ok { 10522 return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) 10523 } 10524 i64, err := jtv.Int64() 10525 if err != nil { 10526 return err 10527 } 10528 sv.Duration = int32(i64) 10529 } 10530 10531 case "ElasticsearchInstanceCount": 10532 if value != nil { 10533 jtv, ok := value.(json.Number) 10534 if !ok { 10535 return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) 10536 } 10537 i64, err := jtv.Int64() 10538 if err != nil { 10539 return err 10540 } 10541 sv.ElasticsearchInstanceCount = int32(i64) 10542 } 10543 10544 case "ElasticsearchInstanceType": 10545 if value != nil { 10546 jtv, ok := value.(string) 10547 if !ok { 10548 return fmt.Errorf("expected ESPartitionInstanceType to be of type string, got %T instead", value) 10549 } 10550 sv.ElasticsearchInstanceType = types.ESPartitionInstanceType(jtv) 10551 } 10552 10553 case "FixedPrice": 10554 if value != nil { 10555 jtv, ok := value.(json.Number) 10556 if !ok { 10557 return fmt.Errorf("expected Double to be json.Number, got %T instead", value) 10558 } 10559 f64, err := jtv.Float64() 10560 if err != nil { 10561 return err 10562 } 10563 sv.FixedPrice = ptr.Float64(f64) 10564 } 10565 10566 case "PaymentOption": 10567 if value != nil { 10568 jtv, ok := value.(string) 10569 if !ok { 10570 return fmt.Errorf("expected ReservedElasticsearchInstancePaymentOption to be of type string, got %T instead", value) 10571 } 10572 sv.PaymentOption = types.ReservedElasticsearchInstancePaymentOption(jtv) 10573 } 10574 10575 case "RecurringCharges": 10576 if err := awsRestjson1_deserializeDocumentRecurringChargeList(&sv.RecurringCharges, value); err != nil { 10577 return err 10578 } 10579 10580 case "ReservationName": 10581 if value != nil { 10582 jtv, ok := value.(string) 10583 if !ok { 10584 return fmt.Errorf("expected ReservationToken to be of type string, got %T instead", value) 10585 } 10586 sv.ReservationName = ptr.String(jtv) 10587 } 10588 10589 case "ReservedElasticsearchInstanceId": 10590 if value != nil { 10591 jtv, ok := value.(string) 10592 if !ok { 10593 return fmt.Errorf("expected GUID to be of type string, got %T instead", value) 10594 } 10595 sv.ReservedElasticsearchInstanceId = ptr.String(jtv) 10596 } 10597 10598 case "ReservedElasticsearchInstanceOfferingId": 10599 if value != nil { 10600 jtv, ok := value.(string) 10601 if !ok { 10602 return fmt.Errorf("expected String to be of type string, got %T instead", value) 10603 } 10604 sv.ReservedElasticsearchInstanceOfferingId = ptr.String(jtv) 10605 } 10606 10607 case "StartTime": 10608 if value != nil { 10609 jtv, ok := value.(json.Number) 10610 if !ok { 10611 return fmt.Errorf("expected UpdateTimestamp to be json.Number, got %T instead", value) 10612 } 10613 f64, err := jtv.Float64() 10614 if err != nil { 10615 return err 10616 } 10617 sv.StartTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) 10618 } 10619 10620 case "State": 10621 if value != nil { 10622 jtv, ok := value.(string) 10623 if !ok { 10624 return fmt.Errorf("expected String to be of type string, got %T instead", value) 10625 } 10626 sv.State = ptr.String(jtv) 10627 } 10628 10629 case "UsagePrice": 10630 if value != nil { 10631 jtv, ok := value.(json.Number) 10632 if !ok { 10633 return fmt.Errorf("expected Double to be json.Number, got %T instead", value) 10634 } 10635 f64, err := jtv.Float64() 10636 if err != nil { 10637 return err 10638 } 10639 sv.UsagePrice = ptr.Float64(f64) 10640 } 10641 10642 default: 10643 _, _ = key, value 10644 10645 } 10646 } 10647 *v = sv 10648 return nil 10649} 10650 10651func awsRestjson1_deserializeDocumentReservedElasticsearchInstanceList(v *[]types.ReservedElasticsearchInstance, value interface{}) error { 10652 if v == nil { 10653 return fmt.Errorf("unexpected nil of type %T", v) 10654 } 10655 if value == nil { 10656 return nil 10657 } 10658 10659 shape, ok := value.([]interface{}) 10660 if !ok { 10661 return fmt.Errorf("unexpected JSON type %v", value) 10662 } 10663 10664 var cv []types.ReservedElasticsearchInstance 10665 if *v == nil { 10666 cv = []types.ReservedElasticsearchInstance{} 10667 } else { 10668 cv = *v 10669 } 10670 10671 for _, value := range shape { 10672 var col types.ReservedElasticsearchInstance 10673 destAddr := &col 10674 if err := awsRestjson1_deserializeDocumentReservedElasticsearchInstance(&destAddr, value); err != nil { 10675 return err 10676 } 10677 col = *destAddr 10678 cv = append(cv, col) 10679 10680 } 10681 *v = cv 10682 return nil 10683} 10684 10685func awsRestjson1_deserializeDocumentReservedElasticsearchInstanceOffering(v **types.ReservedElasticsearchInstanceOffering, value interface{}) error { 10686 if v == nil { 10687 return fmt.Errorf("unexpected nil of type %T", v) 10688 } 10689 if value == nil { 10690 return nil 10691 } 10692 10693 shape, ok := value.(map[string]interface{}) 10694 if !ok { 10695 return fmt.Errorf("unexpected JSON type %v", value) 10696 } 10697 10698 var sv *types.ReservedElasticsearchInstanceOffering 10699 if *v == nil { 10700 sv = &types.ReservedElasticsearchInstanceOffering{} 10701 } else { 10702 sv = *v 10703 } 10704 10705 for key, value := range shape { 10706 switch key { 10707 case "CurrencyCode": 10708 if value != nil { 10709 jtv, ok := value.(string) 10710 if !ok { 10711 return fmt.Errorf("expected String to be of type string, got %T instead", value) 10712 } 10713 sv.CurrencyCode = ptr.String(jtv) 10714 } 10715 10716 case "Duration": 10717 if value != nil { 10718 jtv, ok := value.(json.Number) 10719 if !ok { 10720 return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) 10721 } 10722 i64, err := jtv.Int64() 10723 if err != nil { 10724 return err 10725 } 10726 sv.Duration = int32(i64) 10727 } 10728 10729 case "ElasticsearchInstanceType": 10730 if value != nil { 10731 jtv, ok := value.(string) 10732 if !ok { 10733 return fmt.Errorf("expected ESPartitionInstanceType to be of type string, got %T instead", value) 10734 } 10735 sv.ElasticsearchInstanceType = types.ESPartitionInstanceType(jtv) 10736 } 10737 10738 case "FixedPrice": 10739 if value != nil { 10740 jtv, ok := value.(json.Number) 10741 if !ok { 10742 return fmt.Errorf("expected Double to be json.Number, got %T instead", value) 10743 } 10744 f64, err := jtv.Float64() 10745 if err != nil { 10746 return err 10747 } 10748 sv.FixedPrice = ptr.Float64(f64) 10749 } 10750 10751 case "PaymentOption": 10752 if value != nil { 10753 jtv, ok := value.(string) 10754 if !ok { 10755 return fmt.Errorf("expected ReservedElasticsearchInstancePaymentOption to be of type string, got %T instead", value) 10756 } 10757 sv.PaymentOption = types.ReservedElasticsearchInstancePaymentOption(jtv) 10758 } 10759 10760 case "RecurringCharges": 10761 if err := awsRestjson1_deserializeDocumentRecurringChargeList(&sv.RecurringCharges, value); err != nil { 10762 return err 10763 } 10764 10765 case "ReservedElasticsearchInstanceOfferingId": 10766 if value != nil { 10767 jtv, ok := value.(string) 10768 if !ok { 10769 return fmt.Errorf("expected GUID to be of type string, got %T instead", value) 10770 } 10771 sv.ReservedElasticsearchInstanceOfferingId = ptr.String(jtv) 10772 } 10773 10774 case "UsagePrice": 10775 if value != nil { 10776 jtv, ok := value.(json.Number) 10777 if !ok { 10778 return fmt.Errorf("expected Double to be json.Number, got %T instead", value) 10779 } 10780 f64, err := jtv.Float64() 10781 if err != nil { 10782 return err 10783 } 10784 sv.UsagePrice = ptr.Float64(f64) 10785 } 10786 10787 default: 10788 _, _ = key, value 10789 10790 } 10791 } 10792 *v = sv 10793 return nil 10794} 10795 10796func awsRestjson1_deserializeDocumentReservedElasticsearchInstanceOfferingList(v *[]types.ReservedElasticsearchInstanceOffering, 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.ReservedElasticsearchInstanceOffering 10810 if *v == nil { 10811 cv = []types.ReservedElasticsearchInstanceOffering{} 10812 } else { 10813 cv = *v 10814 } 10815 10816 for _, value := range shape { 10817 var col types.ReservedElasticsearchInstanceOffering 10818 destAddr := &col 10819 if err := awsRestjson1_deserializeDocumentReservedElasticsearchInstanceOffering(&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_deserializeDocumentResourceAlreadyExistsException(v **types.ResourceAlreadyExistsException, 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.ResourceAlreadyExistsException 10844 if *v == nil { 10845 sv = &types.ResourceAlreadyExistsException{} 10846 } else { 10847 sv = *v 10848 } 10849 10850 for key, value := range shape { 10851 switch key { 10852 case "message": 10853 if value != nil { 10854 jtv, ok := value.(string) 10855 if !ok { 10856 return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) 10857 } 10858 sv.Message = ptr.String(jtv) 10859 } 10860 10861 default: 10862 _, _ = key, value 10863 10864 } 10865 } 10866 *v = sv 10867 return nil 10868} 10869 10870func awsRestjson1_deserializeDocumentResourceNotFoundException(v **types.ResourceNotFoundException, value interface{}) error { 10871 if v == nil { 10872 return fmt.Errorf("unexpected nil of type %T", v) 10873 } 10874 if value == nil { 10875 return nil 10876 } 10877 10878 shape, ok := value.(map[string]interface{}) 10879 if !ok { 10880 return fmt.Errorf("unexpected JSON type %v", value) 10881 } 10882 10883 var sv *types.ResourceNotFoundException 10884 if *v == nil { 10885 sv = &types.ResourceNotFoundException{} 10886 } else { 10887 sv = *v 10888 } 10889 10890 for key, value := range shape { 10891 switch key { 10892 case "message": 10893 if value != nil { 10894 jtv, ok := value.(string) 10895 if !ok { 10896 return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) 10897 } 10898 sv.Message = ptr.String(jtv) 10899 } 10900 10901 default: 10902 _, _ = key, value 10903 10904 } 10905 } 10906 *v = sv 10907 return nil 10908} 10909 10910func awsRestjson1_deserializeDocumentSAMLIdp(v **types.SAMLIdp, value interface{}) error { 10911 if v == nil { 10912 return fmt.Errorf("unexpected nil of type %T", v) 10913 } 10914 if value == nil { 10915 return nil 10916 } 10917 10918 shape, ok := value.(map[string]interface{}) 10919 if !ok { 10920 return fmt.Errorf("unexpected JSON type %v", value) 10921 } 10922 10923 var sv *types.SAMLIdp 10924 if *v == nil { 10925 sv = &types.SAMLIdp{} 10926 } else { 10927 sv = *v 10928 } 10929 10930 for key, value := range shape { 10931 switch key { 10932 case "EntityId": 10933 if value != nil { 10934 jtv, ok := value.(string) 10935 if !ok { 10936 return fmt.Errorf("expected SAMLEntityId to be of type string, got %T instead", value) 10937 } 10938 sv.EntityId = ptr.String(jtv) 10939 } 10940 10941 case "MetadataContent": 10942 if value != nil { 10943 jtv, ok := value.(string) 10944 if !ok { 10945 return fmt.Errorf("expected SAMLMetadata to be of type string, got %T instead", value) 10946 } 10947 sv.MetadataContent = ptr.String(jtv) 10948 } 10949 10950 default: 10951 _, _ = key, value 10952 10953 } 10954 } 10955 *v = sv 10956 return nil 10957} 10958 10959func awsRestjson1_deserializeDocumentSAMLOptionsOutput(v **types.SAMLOptionsOutput, value interface{}) error { 10960 if v == nil { 10961 return fmt.Errorf("unexpected nil of type %T", v) 10962 } 10963 if value == nil { 10964 return nil 10965 } 10966 10967 shape, ok := value.(map[string]interface{}) 10968 if !ok { 10969 return fmt.Errorf("unexpected JSON type %v", value) 10970 } 10971 10972 var sv *types.SAMLOptionsOutput 10973 if *v == nil { 10974 sv = &types.SAMLOptionsOutput{} 10975 } else { 10976 sv = *v 10977 } 10978 10979 for key, value := range shape { 10980 switch key { 10981 case "Enabled": 10982 if value != nil { 10983 jtv, ok := value.(bool) 10984 if !ok { 10985 return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) 10986 } 10987 sv.Enabled = ptr.Bool(jtv) 10988 } 10989 10990 case "Idp": 10991 if err := awsRestjson1_deserializeDocumentSAMLIdp(&sv.Idp, value); err != nil { 10992 return err 10993 } 10994 10995 case "RolesKey": 10996 if value != nil { 10997 jtv, ok := value.(string) 10998 if !ok { 10999 return fmt.Errorf("expected String to be of type string, got %T instead", value) 11000 } 11001 sv.RolesKey = ptr.String(jtv) 11002 } 11003 11004 case "SessionTimeoutMinutes": 11005 if value != nil { 11006 jtv, ok := value.(json.Number) 11007 if !ok { 11008 return fmt.Errorf("expected IntegerClass to be json.Number, got %T instead", value) 11009 } 11010 i64, err := jtv.Int64() 11011 if err != nil { 11012 return err 11013 } 11014 sv.SessionTimeoutMinutes = ptr.Int32(int32(i64)) 11015 } 11016 11017 case "SubjectKey": 11018 if value != nil { 11019 jtv, ok := value.(string) 11020 if !ok { 11021 return fmt.Errorf("expected String to be of type string, got %T instead", value) 11022 } 11023 sv.SubjectKey = ptr.String(jtv) 11024 } 11025 11026 default: 11027 _, _ = key, value 11028 11029 } 11030 } 11031 *v = sv 11032 return nil 11033} 11034 11035func awsRestjson1_deserializeDocumentScheduledAutoTuneDetails(v **types.ScheduledAutoTuneDetails, value interface{}) error { 11036 if v == nil { 11037 return fmt.Errorf("unexpected nil of type %T", v) 11038 } 11039 if value == nil { 11040 return nil 11041 } 11042 11043 shape, ok := value.(map[string]interface{}) 11044 if !ok { 11045 return fmt.Errorf("unexpected JSON type %v", value) 11046 } 11047 11048 var sv *types.ScheduledAutoTuneDetails 11049 if *v == nil { 11050 sv = &types.ScheduledAutoTuneDetails{} 11051 } else { 11052 sv = *v 11053 } 11054 11055 for key, value := range shape { 11056 switch key { 11057 case "Action": 11058 if value != nil { 11059 jtv, ok := value.(string) 11060 if !ok { 11061 return fmt.Errorf("expected ScheduledAutoTuneDescription to be of type string, got %T instead", value) 11062 } 11063 sv.Action = ptr.String(jtv) 11064 } 11065 11066 case "ActionType": 11067 if value != nil { 11068 jtv, ok := value.(string) 11069 if !ok { 11070 return fmt.Errorf("expected ScheduledAutoTuneActionType to be of type string, got %T instead", value) 11071 } 11072 sv.ActionType = types.ScheduledAutoTuneActionType(jtv) 11073 } 11074 11075 case "Date": 11076 if value != nil { 11077 jtv, ok := value.(json.Number) 11078 if !ok { 11079 return fmt.Errorf("expected AutoTuneDate to be json.Number, got %T instead", value) 11080 } 11081 f64, err := jtv.Float64() 11082 if err != nil { 11083 return err 11084 } 11085 sv.Date = ptr.Time(smithytime.ParseEpochSeconds(f64)) 11086 } 11087 11088 case "Severity": 11089 if value != nil { 11090 jtv, ok := value.(string) 11091 if !ok { 11092 return fmt.Errorf("expected ScheduledAutoTuneSeverityType to be of type string, got %T instead", value) 11093 } 11094 sv.Severity = types.ScheduledAutoTuneSeverityType(jtv) 11095 } 11096 11097 default: 11098 _, _ = key, value 11099 11100 } 11101 } 11102 *v = sv 11103 return nil 11104} 11105 11106func awsRestjson1_deserializeDocumentServiceSoftwareOptions(v **types.ServiceSoftwareOptions, value interface{}) error { 11107 if v == nil { 11108 return fmt.Errorf("unexpected nil of type %T", v) 11109 } 11110 if value == nil { 11111 return nil 11112 } 11113 11114 shape, ok := value.(map[string]interface{}) 11115 if !ok { 11116 return fmt.Errorf("unexpected JSON type %v", value) 11117 } 11118 11119 var sv *types.ServiceSoftwareOptions 11120 if *v == nil { 11121 sv = &types.ServiceSoftwareOptions{} 11122 } else { 11123 sv = *v 11124 } 11125 11126 for key, value := range shape { 11127 switch key { 11128 case "AutomatedUpdateDate": 11129 if value != nil { 11130 jtv, ok := value.(json.Number) 11131 if !ok { 11132 return fmt.Errorf("expected DeploymentCloseDateTimeStamp to be json.Number, got %T instead", value) 11133 } 11134 f64, err := jtv.Float64() 11135 if err != nil { 11136 return err 11137 } 11138 sv.AutomatedUpdateDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) 11139 } 11140 11141 case "Cancellable": 11142 if value != nil { 11143 jtv, ok := value.(bool) 11144 if !ok { 11145 return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) 11146 } 11147 sv.Cancellable = ptr.Bool(jtv) 11148 } 11149 11150 case "CurrentVersion": 11151 if value != nil { 11152 jtv, ok := value.(string) 11153 if !ok { 11154 return fmt.Errorf("expected String to be of type string, got %T instead", value) 11155 } 11156 sv.CurrentVersion = ptr.String(jtv) 11157 } 11158 11159 case "Description": 11160 if value != nil { 11161 jtv, ok := value.(string) 11162 if !ok { 11163 return fmt.Errorf("expected String to be of type string, got %T instead", value) 11164 } 11165 sv.Description = ptr.String(jtv) 11166 } 11167 11168 case "NewVersion": 11169 if value != nil { 11170 jtv, ok := value.(string) 11171 if !ok { 11172 return fmt.Errorf("expected String to be of type string, got %T instead", value) 11173 } 11174 sv.NewVersion = ptr.String(jtv) 11175 } 11176 11177 case "OptionalDeployment": 11178 if value != nil { 11179 jtv, ok := value.(bool) 11180 if !ok { 11181 return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) 11182 } 11183 sv.OptionalDeployment = ptr.Bool(jtv) 11184 } 11185 11186 case "UpdateAvailable": 11187 if value != nil { 11188 jtv, ok := value.(bool) 11189 if !ok { 11190 return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) 11191 } 11192 sv.UpdateAvailable = ptr.Bool(jtv) 11193 } 11194 11195 case "UpdateStatus": 11196 if value != nil { 11197 jtv, ok := value.(string) 11198 if !ok { 11199 return fmt.Errorf("expected DeploymentStatus to be of type string, got %T instead", value) 11200 } 11201 sv.UpdateStatus = types.DeploymentStatus(jtv) 11202 } 11203 11204 default: 11205 _, _ = key, value 11206 11207 } 11208 } 11209 *v = sv 11210 return nil 11211} 11212 11213func awsRestjson1_deserializeDocumentSnapshotOptions(v **types.SnapshotOptions, value interface{}) error { 11214 if v == nil { 11215 return fmt.Errorf("unexpected nil of type %T", v) 11216 } 11217 if value == nil { 11218 return nil 11219 } 11220 11221 shape, ok := value.(map[string]interface{}) 11222 if !ok { 11223 return fmt.Errorf("unexpected JSON type %v", value) 11224 } 11225 11226 var sv *types.SnapshotOptions 11227 if *v == nil { 11228 sv = &types.SnapshotOptions{} 11229 } else { 11230 sv = *v 11231 } 11232 11233 for key, value := range shape { 11234 switch key { 11235 case "AutomatedSnapshotStartHour": 11236 if value != nil { 11237 jtv, ok := value.(json.Number) 11238 if !ok { 11239 return fmt.Errorf("expected IntegerClass to be json.Number, got %T instead", value) 11240 } 11241 i64, err := jtv.Int64() 11242 if err != nil { 11243 return err 11244 } 11245 sv.AutomatedSnapshotStartHour = ptr.Int32(int32(i64)) 11246 } 11247 11248 default: 11249 _, _ = key, value 11250 11251 } 11252 } 11253 *v = sv 11254 return nil 11255} 11256 11257func awsRestjson1_deserializeDocumentSnapshotOptionsStatus(v **types.SnapshotOptionsStatus, value interface{}) error { 11258 if v == nil { 11259 return fmt.Errorf("unexpected nil of type %T", v) 11260 } 11261 if value == nil { 11262 return nil 11263 } 11264 11265 shape, ok := value.(map[string]interface{}) 11266 if !ok { 11267 return fmt.Errorf("unexpected JSON type %v", value) 11268 } 11269 11270 var sv *types.SnapshotOptionsStatus 11271 if *v == nil { 11272 sv = &types.SnapshotOptionsStatus{} 11273 } else { 11274 sv = *v 11275 } 11276 11277 for key, value := range shape { 11278 switch key { 11279 case "Options": 11280 if err := awsRestjson1_deserializeDocumentSnapshotOptions(&sv.Options, value); err != nil { 11281 return err 11282 } 11283 11284 case "Status": 11285 if err := awsRestjson1_deserializeDocumentOptionStatus(&sv.Status, value); err != nil { 11286 return err 11287 } 11288 11289 default: 11290 _, _ = key, value 11291 11292 } 11293 } 11294 *v = sv 11295 return nil 11296} 11297 11298func awsRestjson1_deserializeDocumentStorageType(v **types.StorageType, value interface{}) error { 11299 if v == nil { 11300 return fmt.Errorf("unexpected nil of type %T", v) 11301 } 11302 if value == nil { 11303 return nil 11304 } 11305 11306 shape, ok := value.(map[string]interface{}) 11307 if !ok { 11308 return fmt.Errorf("unexpected JSON type %v", value) 11309 } 11310 11311 var sv *types.StorageType 11312 if *v == nil { 11313 sv = &types.StorageType{} 11314 } else { 11315 sv = *v 11316 } 11317 11318 for key, value := range shape { 11319 switch key { 11320 case "StorageSubTypeName": 11321 if value != nil { 11322 jtv, ok := value.(string) 11323 if !ok { 11324 return fmt.Errorf("expected StorageSubTypeName to be of type string, got %T instead", value) 11325 } 11326 sv.StorageSubTypeName = ptr.String(jtv) 11327 } 11328 11329 case "StorageTypeLimits": 11330 if err := awsRestjson1_deserializeDocumentStorageTypeLimitList(&sv.StorageTypeLimits, value); err != nil { 11331 return err 11332 } 11333 11334 case "StorageTypeName": 11335 if value != nil { 11336 jtv, ok := value.(string) 11337 if !ok { 11338 return fmt.Errorf("expected StorageTypeName to be of type string, got %T instead", value) 11339 } 11340 sv.StorageTypeName = ptr.String(jtv) 11341 } 11342 11343 default: 11344 _, _ = key, value 11345 11346 } 11347 } 11348 *v = sv 11349 return nil 11350} 11351 11352func awsRestjson1_deserializeDocumentStorageTypeLimit(v **types.StorageTypeLimit, value interface{}) error { 11353 if v == nil { 11354 return fmt.Errorf("unexpected nil of type %T", v) 11355 } 11356 if value == nil { 11357 return nil 11358 } 11359 11360 shape, ok := value.(map[string]interface{}) 11361 if !ok { 11362 return fmt.Errorf("unexpected JSON type %v", value) 11363 } 11364 11365 var sv *types.StorageTypeLimit 11366 if *v == nil { 11367 sv = &types.StorageTypeLimit{} 11368 } else { 11369 sv = *v 11370 } 11371 11372 for key, value := range shape { 11373 switch key { 11374 case "LimitName": 11375 if value != nil { 11376 jtv, ok := value.(string) 11377 if !ok { 11378 return fmt.Errorf("expected LimitName to be of type string, got %T instead", value) 11379 } 11380 sv.LimitName = ptr.String(jtv) 11381 } 11382 11383 case "LimitValues": 11384 if err := awsRestjson1_deserializeDocumentLimitValueList(&sv.LimitValues, value); err != nil { 11385 return err 11386 } 11387 11388 default: 11389 _, _ = key, value 11390 11391 } 11392 } 11393 *v = sv 11394 return nil 11395} 11396 11397func awsRestjson1_deserializeDocumentStorageTypeLimitList(v *[]types.StorageTypeLimit, value interface{}) error { 11398 if v == nil { 11399 return fmt.Errorf("unexpected nil of type %T", v) 11400 } 11401 if value == nil { 11402 return nil 11403 } 11404 11405 shape, ok := value.([]interface{}) 11406 if !ok { 11407 return fmt.Errorf("unexpected JSON type %v", value) 11408 } 11409 11410 var cv []types.StorageTypeLimit 11411 if *v == nil { 11412 cv = []types.StorageTypeLimit{} 11413 } else { 11414 cv = *v 11415 } 11416 11417 for _, value := range shape { 11418 var col types.StorageTypeLimit 11419 destAddr := &col 11420 if err := awsRestjson1_deserializeDocumentStorageTypeLimit(&destAddr, value); err != nil { 11421 return err 11422 } 11423 col = *destAddr 11424 cv = append(cv, col) 11425 11426 } 11427 *v = cv 11428 return nil 11429} 11430 11431func awsRestjson1_deserializeDocumentStorageTypeList(v *[]types.StorageType, value interface{}) error { 11432 if v == nil { 11433 return fmt.Errorf("unexpected nil of type %T", v) 11434 } 11435 if value == nil { 11436 return nil 11437 } 11438 11439 shape, ok := value.([]interface{}) 11440 if !ok { 11441 return fmt.Errorf("unexpected JSON type %v", value) 11442 } 11443 11444 var cv []types.StorageType 11445 if *v == nil { 11446 cv = []types.StorageType{} 11447 } else { 11448 cv = *v 11449 } 11450 11451 for _, value := range shape { 11452 var col types.StorageType 11453 destAddr := &col 11454 if err := awsRestjson1_deserializeDocumentStorageType(&destAddr, value); err != nil { 11455 return err 11456 } 11457 col = *destAddr 11458 cv = append(cv, col) 11459 11460 } 11461 *v = cv 11462 return nil 11463} 11464 11465func awsRestjson1_deserializeDocumentStringList(v *[]string, value interface{}) error { 11466 if v == nil { 11467 return fmt.Errorf("unexpected nil of type %T", v) 11468 } 11469 if value == nil { 11470 return nil 11471 } 11472 11473 shape, ok := value.([]interface{}) 11474 if !ok { 11475 return fmt.Errorf("unexpected JSON type %v", value) 11476 } 11477 11478 var cv []string 11479 if *v == nil { 11480 cv = []string{} 11481 } else { 11482 cv = *v 11483 } 11484 11485 for _, value := range shape { 11486 var col string 11487 if value != nil { 11488 jtv, ok := value.(string) 11489 if !ok { 11490 return fmt.Errorf("expected String to be of type string, got %T instead", value) 11491 } 11492 col = jtv 11493 } 11494 cv = append(cv, col) 11495 11496 } 11497 *v = cv 11498 return nil 11499} 11500 11501func awsRestjson1_deserializeDocumentTag(v **types.Tag, 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.Tag 11515 if *v == nil { 11516 sv = &types.Tag{} 11517 } else { 11518 sv = *v 11519 } 11520 11521 for key, value := range shape { 11522 switch key { 11523 case "Key": 11524 if value != nil { 11525 jtv, ok := value.(string) 11526 if !ok { 11527 return fmt.Errorf("expected TagKey to be of type string, got %T instead", value) 11528 } 11529 sv.Key = ptr.String(jtv) 11530 } 11531 11532 case "Value": 11533 if value != nil { 11534 jtv, ok := value.(string) 11535 if !ok { 11536 return fmt.Errorf("expected TagValue to be of type string, got %T instead", value) 11537 } 11538 sv.Value = ptr.String(jtv) 11539 } 11540 11541 default: 11542 _, _ = key, value 11543 11544 } 11545 } 11546 *v = sv 11547 return nil 11548} 11549 11550func awsRestjson1_deserializeDocumentTagList(v *[]types.Tag, value interface{}) error { 11551 if v == nil { 11552 return fmt.Errorf("unexpected nil of type %T", v) 11553 } 11554 if value == nil { 11555 return nil 11556 } 11557 11558 shape, ok := value.([]interface{}) 11559 if !ok { 11560 return fmt.Errorf("unexpected JSON type %v", value) 11561 } 11562 11563 var cv []types.Tag 11564 if *v == nil { 11565 cv = []types.Tag{} 11566 } else { 11567 cv = *v 11568 } 11569 11570 for _, value := range shape { 11571 var col types.Tag 11572 destAddr := &col 11573 if err := awsRestjson1_deserializeDocumentTag(&destAddr, value); err != nil { 11574 return err 11575 } 11576 col = *destAddr 11577 cv = append(cv, col) 11578 11579 } 11580 *v = cv 11581 return nil 11582} 11583 11584func awsRestjson1_deserializeDocumentUpgradeHistory(v **types.UpgradeHistory, value interface{}) error { 11585 if v == nil { 11586 return fmt.Errorf("unexpected nil of type %T", v) 11587 } 11588 if value == nil { 11589 return nil 11590 } 11591 11592 shape, ok := value.(map[string]interface{}) 11593 if !ok { 11594 return fmt.Errorf("unexpected JSON type %v", value) 11595 } 11596 11597 var sv *types.UpgradeHistory 11598 if *v == nil { 11599 sv = &types.UpgradeHistory{} 11600 } else { 11601 sv = *v 11602 } 11603 11604 for key, value := range shape { 11605 switch key { 11606 case "StartTimestamp": 11607 if value != nil { 11608 jtv, ok := value.(json.Number) 11609 if !ok { 11610 return fmt.Errorf("expected StartTimestamp to be json.Number, got %T instead", value) 11611 } 11612 f64, err := jtv.Float64() 11613 if err != nil { 11614 return err 11615 } 11616 sv.StartTimestamp = ptr.Time(smithytime.ParseEpochSeconds(f64)) 11617 } 11618 11619 case "StepsList": 11620 if err := awsRestjson1_deserializeDocumentUpgradeStepsList(&sv.StepsList, value); err != nil { 11621 return err 11622 } 11623 11624 case "UpgradeName": 11625 if value != nil { 11626 jtv, ok := value.(string) 11627 if !ok { 11628 return fmt.Errorf("expected UpgradeName to be of type string, got %T instead", value) 11629 } 11630 sv.UpgradeName = ptr.String(jtv) 11631 } 11632 11633 case "UpgradeStatus": 11634 if value != nil { 11635 jtv, ok := value.(string) 11636 if !ok { 11637 return fmt.Errorf("expected UpgradeStatus to be of type string, got %T instead", value) 11638 } 11639 sv.UpgradeStatus = types.UpgradeStatus(jtv) 11640 } 11641 11642 default: 11643 _, _ = key, value 11644 11645 } 11646 } 11647 *v = sv 11648 return nil 11649} 11650 11651func awsRestjson1_deserializeDocumentUpgradeHistoryList(v *[]types.UpgradeHistory, value interface{}) error { 11652 if v == nil { 11653 return fmt.Errorf("unexpected nil of type %T", v) 11654 } 11655 if value == nil { 11656 return nil 11657 } 11658 11659 shape, ok := value.([]interface{}) 11660 if !ok { 11661 return fmt.Errorf("unexpected JSON type %v", value) 11662 } 11663 11664 var cv []types.UpgradeHistory 11665 if *v == nil { 11666 cv = []types.UpgradeHistory{} 11667 } else { 11668 cv = *v 11669 } 11670 11671 for _, value := range shape { 11672 var col types.UpgradeHistory 11673 destAddr := &col 11674 if err := awsRestjson1_deserializeDocumentUpgradeHistory(&destAddr, value); err != nil { 11675 return err 11676 } 11677 col = *destAddr 11678 cv = append(cv, col) 11679 11680 } 11681 *v = cv 11682 return nil 11683} 11684 11685func awsRestjson1_deserializeDocumentUpgradeStepItem(v **types.UpgradeStepItem, value interface{}) error { 11686 if v == nil { 11687 return fmt.Errorf("unexpected nil of type %T", v) 11688 } 11689 if value == nil { 11690 return nil 11691 } 11692 11693 shape, ok := value.(map[string]interface{}) 11694 if !ok { 11695 return fmt.Errorf("unexpected JSON type %v", value) 11696 } 11697 11698 var sv *types.UpgradeStepItem 11699 if *v == nil { 11700 sv = &types.UpgradeStepItem{} 11701 } else { 11702 sv = *v 11703 } 11704 11705 for key, value := range shape { 11706 switch key { 11707 case "Issues": 11708 if err := awsRestjson1_deserializeDocumentIssues(&sv.Issues, value); err != nil { 11709 return err 11710 } 11711 11712 case "ProgressPercent": 11713 if value != nil { 11714 jtv, ok := value.(json.Number) 11715 if !ok { 11716 return fmt.Errorf("expected Double to be json.Number, got %T instead", value) 11717 } 11718 f64, err := jtv.Float64() 11719 if err != nil { 11720 return err 11721 } 11722 sv.ProgressPercent = ptr.Float64(f64) 11723 } 11724 11725 case "UpgradeStep": 11726 if value != nil { 11727 jtv, ok := value.(string) 11728 if !ok { 11729 return fmt.Errorf("expected UpgradeStep to be of type string, got %T instead", value) 11730 } 11731 sv.UpgradeStep = types.UpgradeStep(jtv) 11732 } 11733 11734 case "UpgradeStepStatus": 11735 if value != nil { 11736 jtv, ok := value.(string) 11737 if !ok { 11738 return fmt.Errorf("expected UpgradeStatus to be of type string, got %T instead", value) 11739 } 11740 sv.UpgradeStepStatus = types.UpgradeStatus(jtv) 11741 } 11742 11743 default: 11744 _, _ = key, value 11745 11746 } 11747 } 11748 *v = sv 11749 return nil 11750} 11751 11752func awsRestjson1_deserializeDocumentUpgradeStepsList(v *[]types.UpgradeStepItem, value interface{}) error { 11753 if v == nil { 11754 return fmt.Errorf("unexpected nil of type %T", v) 11755 } 11756 if value == nil { 11757 return nil 11758 } 11759 11760 shape, ok := value.([]interface{}) 11761 if !ok { 11762 return fmt.Errorf("unexpected JSON type %v", value) 11763 } 11764 11765 var cv []types.UpgradeStepItem 11766 if *v == nil { 11767 cv = []types.UpgradeStepItem{} 11768 } else { 11769 cv = *v 11770 } 11771 11772 for _, value := range shape { 11773 var col types.UpgradeStepItem 11774 destAddr := &col 11775 if err := awsRestjson1_deserializeDocumentUpgradeStepItem(&destAddr, value); err != nil { 11776 return err 11777 } 11778 col = *destAddr 11779 cv = append(cv, col) 11780 11781 } 11782 *v = cv 11783 return nil 11784} 11785 11786func awsRestjson1_deserializeDocumentValidationException(v **types.ValidationException, value interface{}) error { 11787 if v == nil { 11788 return fmt.Errorf("unexpected nil of type %T", v) 11789 } 11790 if value == nil { 11791 return nil 11792 } 11793 11794 shape, ok := value.(map[string]interface{}) 11795 if !ok { 11796 return fmt.Errorf("unexpected JSON type %v", value) 11797 } 11798 11799 var sv *types.ValidationException 11800 if *v == nil { 11801 sv = &types.ValidationException{} 11802 } else { 11803 sv = *v 11804 } 11805 11806 for key, value := range shape { 11807 switch key { 11808 case "message": 11809 if value != nil { 11810 jtv, ok := value.(string) 11811 if !ok { 11812 return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) 11813 } 11814 sv.Message = ptr.String(jtv) 11815 } 11816 11817 default: 11818 _, _ = key, value 11819 11820 } 11821 } 11822 *v = sv 11823 return nil 11824} 11825 11826func awsRestjson1_deserializeDocumentVPCDerivedInfo(v **types.VPCDerivedInfo, value interface{}) error { 11827 if v == nil { 11828 return fmt.Errorf("unexpected nil of type %T", v) 11829 } 11830 if value == nil { 11831 return nil 11832 } 11833 11834 shape, ok := value.(map[string]interface{}) 11835 if !ok { 11836 return fmt.Errorf("unexpected JSON type %v", value) 11837 } 11838 11839 var sv *types.VPCDerivedInfo 11840 if *v == nil { 11841 sv = &types.VPCDerivedInfo{} 11842 } else { 11843 sv = *v 11844 } 11845 11846 for key, value := range shape { 11847 switch key { 11848 case "AvailabilityZones": 11849 if err := awsRestjson1_deserializeDocumentStringList(&sv.AvailabilityZones, value); err != nil { 11850 return err 11851 } 11852 11853 case "SecurityGroupIds": 11854 if err := awsRestjson1_deserializeDocumentStringList(&sv.SecurityGroupIds, value); err != nil { 11855 return err 11856 } 11857 11858 case "SubnetIds": 11859 if err := awsRestjson1_deserializeDocumentStringList(&sv.SubnetIds, value); err != nil { 11860 return err 11861 } 11862 11863 case "VPCId": 11864 if value != nil { 11865 jtv, ok := value.(string) 11866 if !ok { 11867 return fmt.Errorf("expected String to be of type string, got %T instead", value) 11868 } 11869 sv.VPCId = ptr.String(jtv) 11870 } 11871 11872 default: 11873 _, _ = key, value 11874 11875 } 11876 } 11877 *v = sv 11878 return nil 11879} 11880 11881func awsRestjson1_deserializeDocumentVPCDerivedInfoStatus(v **types.VPCDerivedInfoStatus, value interface{}) error { 11882 if v == nil { 11883 return fmt.Errorf("unexpected nil of type %T", v) 11884 } 11885 if value == nil { 11886 return nil 11887 } 11888 11889 shape, ok := value.(map[string]interface{}) 11890 if !ok { 11891 return fmt.Errorf("unexpected JSON type %v", value) 11892 } 11893 11894 var sv *types.VPCDerivedInfoStatus 11895 if *v == nil { 11896 sv = &types.VPCDerivedInfoStatus{} 11897 } else { 11898 sv = *v 11899 } 11900 11901 for key, value := range shape { 11902 switch key { 11903 case "Options": 11904 if err := awsRestjson1_deserializeDocumentVPCDerivedInfo(&sv.Options, value); err != nil { 11905 return err 11906 } 11907 11908 case "Status": 11909 if err := awsRestjson1_deserializeDocumentOptionStatus(&sv.Status, value); err != nil { 11910 return err 11911 } 11912 11913 default: 11914 _, _ = key, value 11915 11916 } 11917 } 11918 *v = sv 11919 return nil 11920} 11921 11922func awsRestjson1_deserializeDocumentZoneAwarenessConfig(v **types.ZoneAwarenessConfig, 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.ZoneAwarenessConfig 11936 if *v == nil { 11937 sv = &types.ZoneAwarenessConfig{} 11938 } else { 11939 sv = *v 11940 } 11941 11942 for key, value := range shape { 11943 switch key { 11944 case "AvailabilityZoneCount": 11945 if value != nil { 11946 jtv, ok := value.(json.Number) 11947 if !ok { 11948 return fmt.Errorf("expected IntegerClass to be json.Number, got %T instead", value) 11949 } 11950 i64, err := jtv.Int64() 11951 if err != nil { 11952 return err 11953 } 11954 sv.AvailabilityZoneCount = ptr.Int32(int32(i64)) 11955 } 11956 11957 default: 11958 _, _ = key, value 11959 11960 } 11961 } 11962 *v = sv 11963 return nil 11964} 11965