1// Code generated by smithy-go-codegen DO NOT EDIT. 2 3package groundstation 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/groundstation/types" 12 smithy "github.com/aws/smithy-go" 13 smithyio "github.com/aws/smithy-go/io" 14 "github.com/aws/smithy-go/middleware" 15 "github.com/aws/smithy-go/ptr" 16 smithytime "github.com/aws/smithy-go/time" 17 smithyhttp "github.com/aws/smithy-go/transport/http" 18 "io" 19 "strings" 20) 21 22type awsRestjson1_deserializeOpCancelContact struct { 23} 24 25func (*awsRestjson1_deserializeOpCancelContact) ID() string { 26 return "OperationDeserializer" 27} 28 29func (m *awsRestjson1_deserializeOpCancelContact) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 30 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 31) { 32 out, metadata, err = next.HandleDeserialize(ctx, in) 33 if err != nil { 34 return out, metadata, err 35 } 36 37 response, ok := out.RawResponse.(*smithyhttp.Response) 38 if !ok { 39 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 40 } 41 42 if response.StatusCode < 200 || response.StatusCode >= 300 { 43 return out, metadata, awsRestjson1_deserializeOpErrorCancelContact(response, &metadata) 44 } 45 output := &CancelContactOutput{} 46 out.Result = output 47 48 var buff [1024]byte 49 ringBuffer := smithyio.NewRingBuffer(buff[:]) 50 51 body := io.TeeReader(response.Body, ringBuffer) 52 53 decoder := json.NewDecoder(body) 54 decoder.UseNumber() 55 var shape interface{} 56 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 57 var snapshot bytes.Buffer 58 io.Copy(&snapshot, ringBuffer) 59 err = &smithy.DeserializationError{ 60 Err: fmt.Errorf("failed to decode response body, %w", err), 61 Snapshot: snapshot.Bytes(), 62 } 63 return out, metadata, err 64 } 65 66 err = awsRestjson1_deserializeOpDocumentCancelContactOutput(&output, shape) 67 if err != nil { 68 var snapshot bytes.Buffer 69 io.Copy(&snapshot, ringBuffer) 70 return out, metadata, &smithy.DeserializationError{ 71 Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), 72 Snapshot: snapshot.Bytes(), 73 } 74 } 75 76 return out, metadata, err 77} 78 79func awsRestjson1_deserializeOpErrorCancelContact(response *smithyhttp.Response, metadata *middleware.Metadata) error { 80 var errorBuffer bytes.Buffer 81 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 82 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 83 } 84 errorBody := bytes.NewReader(errorBuffer.Bytes()) 85 86 errorCode := "UnknownError" 87 errorMessage := errorCode 88 89 code := response.Header.Get("X-Amzn-ErrorType") 90 if len(code) != 0 { 91 errorCode = restjson.SanitizeErrorCode(code) 92 } 93 94 var buff [1024]byte 95 ringBuffer := smithyio.NewRingBuffer(buff[:]) 96 97 body := io.TeeReader(errorBody, ringBuffer) 98 decoder := json.NewDecoder(body) 99 decoder.UseNumber() 100 code, message, err := restjson.GetErrorInfo(decoder) 101 if err != nil { 102 var snapshot bytes.Buffer 103 io.Copy(&snapshot, ringBuffer) 104 err = &smithy.DeserializationError{ 105 Err: fmt.Errorf("failed to decode response body, %w", err), 106 Snapshot: snapshot.Bytes(), 107 } 108 return err 109 } 110 111 errorBody.Seek(0, io.SeekStart) 112 if len(code) != 0 { 113 errorCode = restjson.SanitizeErrorCode(code) 114 } 115 if len(message) != 0 { 116 errorMessage = message 117 } 118 119 switch { 120 case strings.EqualFold("DependencyException", errorCode): 121 return awsRestjson1_deserializeErrorDependencyException(response, errorBody) 122 123 case strings.EqualFold("InvalidParameterException", errorCode): 124 return awsRestjson1_deserializeErrorInvalidParameterException(response, errorBody) 125 126 case strings.EqualFold("ResourceNotFoundException", errorCode): 127 return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) 128 129 default: 130 genericError := &smithy.GenericAPIError{ 131 Code: errorCode, 132 Message: errorMessage, 133 } 134 return genericError 135 136 } 137} 138 139func awsRestjson1_deserializeOpDocumentCancelContactOutput(v **CancelContactOutput, value interface{}) error { 140 if v == nil { 141 return fmt.Errorf("unexpected nil of type %T", v) 142 } 143 if value == nil { 144 return nil 145 } 146 147 shape, ok := value.(map[string]interface{}) 148 if !ok { 149 return fmt.Errorf("unexpected JSON type %v", value) 150 } 151 152 var sv *CancelContactOutput 153 if *v == nil { 154 sv = &CancelContactOutput{} 155 } else { 156 sv = *v 157 } 158 159 for key, value := range shape { 160 switch key { 161 case "contactId": 162 if value != nil { 163 jtv, ok := value.(string) 164 if !ok { 165 return fmt.Errorf("expected String to be of type string, got %T instead", value) 166 } 167 sv.ContactId = ptr.String(jtv) 168 } 169 170 default: 171 _, _ = key, value 172 173 } 174 } 175 *v = sv 176 return nil 177} 178 179type awsRestjson1_deserializeOpCreateConfig struct { 180} 181 182func (*awsRestjson1_deserializeOpCreateConfig) ID() string { 183 return "OperationDeserializer" 184} 185 186func (m *awsRestjson1_deserializeOpCreateConfig) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 187 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 188) { 189 out, metadata, err = next.HandleDeserialize(ctx, in) 190 if err != nil { 191 return out, metadata, err 192 } 193 194 response, ok := out.RawResponse.(*smithyhttp.Response) 195 if !ok { 196 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 197 } 198 199 if response.StatusCode < 200 || response.StatusCode >= 300 { 200 return out, metadata, awsRestjson1_deserializeOpErrorCreateConfig(response, &metadata) 201 } 202 output := &CreateConfigOutput{} 203 out.Result = output 204 205 var buff [1024]byte 206 ringBuffer := smithyio.NewRingBuffer(buff[:]) 207 208 body := io.TeeReader(response.Body, ringBuffer) 209 210 decoder := json.NewDecoder(body) 211 decoder.UseNumber() 212 var shape interface{} 213 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 214 var snapshot bytes.Buffer 215 io.Copy(&snapshot, ringBuffer) 216 err = &smithy.DeserializationError{ 217 Err: fmt.Errorf("failed to decode response body, %w", err), 218 Snapshot: snapshot.Bytes(), 219 } 220 return out, metadata, err 221 } 222 223 err = awsRestjson1_deserializeOpDocumentCreateConfigOutput(&output, shape) 224 if err != nil { 225 var snapshot bytes.Buffer 226 io.Copy(&snapshot, ringBuffer) 227 return out, metadata, &smithy.DeserializationError{ 228 Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), 229 Snapshot: snapshot.Bytes(), 230 } 231 } 232 233 return out, metadata, err 234} 235 236func awsRestjson1_deserializeOpErrorCreateConfig(response *smithyhttp.Response, metadata *middleware.Metadata) error { 237 var errorBuffer bytes.Buffer 238 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 239 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 240 } 241 errorBody := bytes.NewReader(errorBuffer.Bytes()) 242 243 errorCode := "UnknownError" 244 errorMessage := errorCode 245 246 code := response.Header.Get("X-Amzn-ErrorType") 247 if len(code) != 0 { 248 errorCode = restjson.SanitizeErrorCode(code) 249 } 250 251 var buff [1024]byte 252 ringBuffer := smithyio.NewRingBuffer(buff[:]) 253 254 body := io.TeeReader(errorBody, ringBuffer) 255 decoder := json.NewDecoder(body) 256 decoder.UseNumber() 257 code, message, err := restjson.GetErrorInfo(decoder) 258 if err != nil { 259 var snapshot bytes.Buffer 260 io.Copy(&snapshot, ringBuffer) 261 err = &smithy.DeserializationError{ 262 Err: fmt.Errorf("failed to decode response body, %w", err), 263 Snapshot: snapshot.Bytes(), 264 } 265 return err 266 } 267 268 errorBody.Seek(0, io.SeekStart) 269 if len(code) != 0 { 270 errorCode = restjson.SanitizeErrorCode(code) 271 } 272 if len(message) != 0 { 273 errorMessage = message 274 } 275 276 switch { 277 case strings.EqualFold("DependencyException", errorCode): 278 return awsRestjson1_deserializeErrorDependencyException(response, errorBody) 279 280 case strings.EqualFold("InvalidParameterException", errorCode): 281 return awsRestjson1_deserializeErrorInvalidParameterException(response, errorBody) 282 283 case strings.EqualFold("ResourceLimitExceededException", errorCode): 284 return awsRestjson1_deserializeErrorResourceLimitExceededException(response, errorBody) 285 286 case strings.EqualFold("ResourceNotFoundException", errorCode): 287 return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) 288 289 default: 290 genericError := &smithy.GenericAPIError{ 291 Code: errorCode, 292 Message: errorMessage, 293 } 294 return genericError 295 296 } 297} 298 299func awsRestjson1_deserializeOpDocumentCreateConfigOutput(v **CreateConfigOutput, value interface{}) error { 300 if v == nil { 301 return fmt.Errorf("unexpected nil of type %T", v) 302 } 303 if value == nil { 304 return nil 305 } 306 307 shape, ok := value.(map[string]interface{}) 308 if !ok { 309 return fmt.Errorf("unexpected JSON type %v", value) 310 } 311 312 var sv *CreateConfigOutput 313 if *v == nil { 314 sv = &CreateConfigOutput{} 315 } else { 316 sv = *v 317 } 318 319 for key, value := range shape { 320 switch key { 321 case "configArn": 322 if value != nil { 323 jtv, ok := value.(string) 324 if !ok { 325 return fmt.Errorf("expected ConfigArn to be of type string, got %T instead", value) 326 } 327 sv.ConfigArn = ptr.String(jtv) 328 } 329 330 case "configId": 331 if value != nil { 332 jtv, ok := value.(string) 333 if !ok { 334 return fmt.Errorf("expected String to be of type string, got %T instead", value) 335 } 336 sv.ConfigId = ptr.String(jtv) 337 } 338 339 case "configType": 340 if value != nil { 341 jtv, ok := value.(string) 342 if !ok { 343 return fmt.Errorf("expected ConfigCapabilityType to be of type string, got %T instead", value) 344 } 345 sv.ConfigType = types.ConfigCapabilityType(jtv) 346 } 347 348 default: 349 _, _ = key, value 350 351 } 352 } 353 *v = sv 354 return nil 355} 356 357type awsRestjson1_deserializeOpCreateDataflowEndpointGroup struct { 358} 359 360func (*awsRestjson1_deserializeOpCreateDataflowEndpointGroup) ID() string { 361 return "OperationDeserializer" 362} 363 364func (m *awsRestjson1_deserializeOpCreateDataflowEndpointGroup) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 365 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 366) { 367 out, metadata, err = next.HandleDeserialize(ctx, in) 368 if err != nil { 369 return out, metadata, err 370 } 371 372 response, ok := out.RawResponse.(*smithyhttp.Response) 373 if !ok { 374 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 375 } 376 377 if response.StatusCode < 200 || response.StatusCode >= 300 { 378 return out, metadata, awsRestjson1_deserializeOpErrorCreateDataflowEndpointGroup(response, &metadata) 379 } 380 output := &CreateDataflowEndpointGroupOutput{} 381 out.Result = output 382 383 var buff [1024]byte 384 ringBuffer := smithyio.NewRingBuffer(buff[:]) 385 386 body := io.TeeReader(response.Body, ringBuffer) 387 388 decoder := json.NewDecoder(body) 389 decoder.UseNumber() 390 var shape interface{} 391 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 392 var snapshot bytes.Buffer 393 io.Copy(&snapshot, ringBuffer) 394 err = &smithy.DeserializationError{ 395 Err: fmt.Errorf("failed to decode response body, %w", err), 396 Snapshot: snapshot.Bytes(), 397 } 398 return out, metadata, err 399 } 400 401 err = awsRestjson1_deserializeOpDocumentCreateDataflowEndpointGroupOutput(&output, shape) 402 if err != nil { 403 var snapshot bytes.Buffer 404 io.Copy(&snapshot, ringBuffer) 405 return out, metadata, &smithy.DeserializationError{ 406 Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), 407 Snapshot: snapshot.Bytes(), 408 } 409 } 410 411 return out, metadata, err 412} 413 414func awsRestjson1_deserializeOpErrorCreateDataflowEndpointGroup(response *smithyhttp.Response, metadata *middleware.Metadata) error { 415 var errorBuffer bytes.Buffer 416 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 417 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 418 } 419 errorBody := bytes.NewReader(errorBuffer.Bytes()) 420 421 errorCode := "UnknownError" 422 errorMessage := errorCode 423 424 code := response.Header.Get("X-Amzn-ErrorType") 425 if len(code) != 0 { 426 errorCode = restjson.SanitizeErrorCode(code) 427 } 428 429 var buff [1024]byte 430 ringBuffer := smithyio.NewRingBuffer(buff[:]) 431 432 body := io.TeeReader(errorBody, ringBuffer) 433 decoder := json.NewDecoder(body) 434 decoder.UseNumber() 435 code, message, err := restjson.GetErrorInfo(decoder) 436 if err != nil { 437 var snapshot bytes.Buffer 438 io.Copy(&snapshot, ringBuffer) 439 err = &smithy.DeserializationError{ 440 Err: fmt.Errorf("failed to decode response body, %w", err), 441 Snapshot: snapshot.Bytes(), 442 } 443 return err 444 } 445 446 errorBody.Seek(0, io.SeekStart) 447 if len(code) != 0 { 448 errorCode = restjson.SanitizeErrorCode(code) 449 } 450 if len(message) != 0 { 451 errorMessage = message 452 } 453 454 switch { 455 case strings.EqualFold("DependencyException", errorCode): 456 return awsRestjson1_deserializeErrorDependencyException(response, errorBody) 457 458 case strings.EqualFold("InvalidParameterException", errorCode): 459 return awsRestjson1_deserializeErrorInvalidParameterException(response, errorBody) 460 461 case strings.EqualFold("ResourceNotFoundException", errorCode): 462 return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) 463 464 default: 465 genericError := &smithy.GenericAPIError{ 466 Code: errorCode, 467 Message: errorMessage, 468 } 469 return genericError 470 471 } 472} 473 474func awsRestjson1_deserializeOpDocumentCreateDataflowEndpointGroupOutput(v **CreateDataflowEndpointGroupOutput, value interface{}) error { 475 if v == nil { 476 return fmt.Errorf("unexpected nil of type %T", v) 477 } 478 if value == nil { 479 return nil 480 } 481 482 shape, ok := value.(map[string]interface{}) 483 if !ok { 484 return fmt.Errorf("unexpected JSON type %v", value) 485 } 486 487 var sv *CreateDataflowEndpointGroupOutput 488 if *v == nil { 489 sv = &CreateDataflowEndpointGroupOutput{} 490 } else { 491 sv = *v 492 } 493 494 for key, value := range shape { 495 switch key { 496 case "dataflowEndpointGroupId": 497 if value != nil { 498 jtv, ok := value.(string) 499 if !ok { 500 return fmt.Errorf("expected String to be of type string, got %T instead", value) 501 } 502 sv.DataflowEndpointGroupId = ptr.String(jtv) 503 } 504 505 default: 506 _, _ = key, value 507 508 } 509 } 510 *v = sv 511 return nil 512} 513 514type awsRestjson1_deserializeOpCreateMissionProfile struct { 515} 516 517func (*awsRestjson1_deserializeOpCreateMissionProfile) ID() string { 518 return "OperationDeserializer" 519} 520 521func (m *awsRestjson1_deserializeOpCreateMissionProfile) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 522 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 523) { 524 out, metadata, err = next.HandleDeserialize(ctx, in) 525 if err != nil { 526 return out, metadata, err 527 } 528 529 response, ok := out.RawResponse.(*smithyhttp.Response) 530 if !ok { 531 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 532 } 533 534 if response.StatusCode < 200 || response.StatusCode >= 300 { 535 return out, metadata, awsRestjson1_deserializeOpErrorCreateMissionProfile(response, &metadata) 536 } 537 output := &CreateMissionProfileOutput{} 538 out.Result = output 539 540 var buff [1024]byte 541 ringBuffer := smithyio.NewRingBuffer(buff[:]) 542 543 body := io.TeeReader(response.Body, ringBuffer) 544 545 decoder := json.NewDecoder(body) 546 decoder.UseNumber() 547 var shape interface{} 548 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 549 var snapshot bytes.Buffer 550 io.Copy(&snapshot, ringBuffer) 551 err = &smithy.DeserializationError{ 552 Err: fmt.Errorf("failed to decode response body, %w", err), 553 Snapshot: snapshot.Bytes(), 554 } 555 return out, metadata, err 556 } 557 558 err = awsRestjson1_deserializeOpDocumentCreateMissionProfileOutput(&output, shape) 559 if err != nil { 560 var snapshot bytes.Buffer 561 io.Copy(&snapshot, ringBuffer) 562 return out, metadata, &smithy.DeserializationError{ 563 Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), 564 Snapshot: snapshot.Bytes(), 565 } 566 } 567 568 return out, metadata, err 569} 570 571func awsRestjson1_deserializeOpErrorCreateMissionProfile(response *smithyhttp.Response, metadata *middleware.Metadata) error { 572 var errorBuffer bytes.Buffer 573 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 574 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 575 } 576 errorBody := bytes.NewReader(errorBuffer.Bytes()) 577 578 errorCode := "UnknownError" 579 errorMessage := errorCode 580 581 code := response.Header.Get("X-Amzn-ErrorType") 582 if len(code) != 0 { 583 errorCode = restjson.SanitizeErrorCode(code) 584 } 585 586 var buff [1024]byte 587 ringBuffer := smithyio.NewRingBuffer(buff[:]) 588 589 body := io.TeeReader(errorBody, ringBuffer) 590 decoder := json.NewDecoder(body) 591 decoder.UseNumber() 592 code, message, err := restjson.GetErrorInfo(decoder) 593 if err != nil { 594 var snapshot bytes.Buffer 595 io.Copy(&snapshot, ringBuffer) 596 err = &smithy.DeserializationError{ 597 Err: fmt.Errorf("failed to decode response body, %w", err), 598 Snapshot: snapshot.Bytes(), 599 } 600 return err 601 } 602 603 errorBody.Seek(0, io.SeekStart) 604 if len(code) != 0 { 605 errorCode = restjson.SanitizeErrorCode(code) 606 } 607 if len(message) != 0 { 608 errorMessage = message 609 } 610 611 switch { 612 case strings.EqualFold("DependencyException", errorCode): 613 return awsRestjson1_deserializeErrorDependencyException(response, errorBody) 614 615 case strings.EqualFold("InvalidParameterException", errorCode): 616 return awsRestjson1_deserializeErrorInvalidParameterException(response, errorBody) 617 618 case strings.EqualFold("ResourceNotFoundException", errorCode): 619 return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) 620 621 default: 622 genericError := &smithy.GenericAPIError{ 623 Code: errorCode, 624 Message: errorMessage, 625 } 626 return genericError 627 628 } 629} 630 631func awsRestjson1_deserializeOpDocumentCreateMissionProfileOutput(v **CreateMissionProfileOutput, value interface{}) error { 632 if v == nil { 633 return fmt.Errorf("unexpected nil of type %T", v) 634 } 635 if value == nil { 636 return nil 637 } 638 639 shape, ok := value.(map[string]interface{}) 640 if !ok { 641 return fmt.Errorf("unexpected JSON type %v", value) 642 } 643 644 var sv *CreateMissionProfileOutput 645 if *v == nil { 646 sv = &CreateMissionProfileOutput{} 647 } else { 648 sv = *v 649 } 650 651 for key, value := range shape { 652 switch key { 653 case "missionProfileId": 654 if value != nil { 655 jtv, ok := value.(string) 656 if !ok { 657 return fmt.Errorf("expected String to be of type string, got %T instead", value) 658 } 659 sv.MissionProfileId = ptr.String(jtv) 660 } 661 662 default: 663 _, _ = key, value 664 665 } 666 } 667 *v = sv 668 return nil 669} 670 671type awsRestjson1_deserializeOpDeleteConfig struct { 672} 673 674func (*awsRestjson1_deserializeOpDeleteConfig) ID() string { 675 return "OperationDeserializer" 676} 677 678func (m *awsRestjson1_deserializeOpDeleteConfig) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 679 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 680) { 681 out, metadata, err = next.HandleDeserialize(ctx, in) 682 if err != nil { 683 return out, metadata, err 684 } 685 686 response, ok := out.RawResponse.(*smithyhttp.Response) 687 if !ok { 688 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 689 } 690 691 if response.StatusCode < 200 || response.StatusCode >= 300 { 692 return out, metadata, awsRestjson1_deserializeOpErrorDeleteConfig(response, &metadata) 693 } 694 output := &DeleteConfigOutput{} 695 out.Result = output 696 697 var buff [1024]byte 698 ringBuffer := smithyio.NewRingBuffer(buff[:]) 699 700 body := io.TeeReader(response.Body, ringBuffer) 701 702 decoder := json.NewDecoder(body) 703 decoder.UseNumber() 704 var shape interface{} 705 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 706 var snapshot bytes.Buffer 707 io.Copy(&snapshot, ringBuffer) 708 err = &smithy.DeserializationError{ 709 Err: fmt.Errorf("failed to decode response body, %w", err), 710 Snapshot: snapshot.Bytes(), 711 } 712 return out, metadata, err 713 } 714 715 err = awsRestjson1_deserializeOpDocumentDeleteConfigOutput(&output, shape) 716 if err != nil { 717 var snapshot bytes.Buffer 718 io.Copy(&snapshot, ringBuffer) 719 return out, metadata, &smithy.DeserializationError{ 720 Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), 721 Snapshot: snapshot.Bytes(), 722 } 723 } 724 725 return out, metadata, err 726} 727 728func awsRestjson1_deserializeOpErrorDeleteConfig(response *smithyhttp.Response, metadata *middleware.Metadata) error { 729 var errorBuffer bytes.Buffer 730 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 731 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 732 } 733 errorBody := bytes.NewReader(errorBuffer.Bytes()) 734 735 errorCode := "UnknownError" 736 errorMessage := errorCode 737 738 code := response.Header.Get("X-Amzn-ErrorType") 739 if len(code) != 0 { 740 errorCode = restjson.SanitizeErrorCode(code) 741 } 742 743 var buff [1024]byte 744 ringBuffer := smithyio.NewRingBuffer(buff[:]) 745 746 body := io.TeeReader(errorBody, ringBuffer) 747 decoder := json.NewDecoder(body) 748 decoder.UseNumber() 749 code, message, err := restjson.GetErrorInfo(decoder) 750 if err != nil { 751 var snapshot bytes.Buffer 752 io.Copy(&snapshot, ringBuffer) 753 err = &smithy.DeserializationError{ 754 Err: fmt.Errorf("failed to decode response body, %w", err), 755 Snapshot: snapshot.Bytes(), 756 } 757 return err 758 } 759 760 errorBody.Seek(0, io.SeekStart) 761 if len(code) != 0 { 762 errorCode = restjson.SanitizeErrorCode(code) 763 } 764 if len(message) != 0 { 765 errorMessage = message 766 } 767 768 switch { 769 case strings.EqualFold("DependencyException", errorCode): 770 return awsRestjson1_deserializeErrorDependencyException(response, errorBody) 771 772 case strings.EqualFold("InvalidParameterException", errorCode): 773 return awsRestjson1_deserializeErrorInvalidParameterException(response, errorBody) 774 775 case strings.EqualFold("ResourceNotFoundException", errorCode): 776 return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) 777 778 default: 779 genericError := &smithy.GenericAPIError{ 780 Code: errorCode, 781 Message: errorMessage, 782 } 783 return genericError 784 785 } 786} 787 788func awsRestjson1_deserializeOpDocumentDeleteConfigOutput(v **DeleteConfigOutput, value interface{}) error { 789 if v == nil { 790 return fmt.Errorf("unexpected nil of type %T", v) 791 } 792 if value == nil { 793 return nil 794 } 795 796 shape, ok := value.(map[string]interface{}) 797 if !ok { 798 return fmt.Errorf("unexpected JSON type %v", value) 799 } 800 801 var sv *DeleteConfigOutput 802 if *v == nil { 803 sv = &DeleteConfigOutput{} 804 } else { 805 sv = *v 806 } 807 808 for key, value := range shape { 809 switch key { 810 case "configArn": 811 if value != nil { 812 jtv, ok := value.(string) 813 if !ok { 814 return fmt.Errorf("expected ConfigArn to be of type string, got %T instead", value) 815 } 816 sv.ConfigArn = ptr.String(jtv) 817 } 818 819 case "configId": 820 if value != nil { 821 jtv, ok := value.(string) 822 if !ok { 823 return fmt.Errorf("expected String to be of type string, got %T instead", value) 824 } 825 sv.ConfigId = ptr.String(jtv) 826 } 827 828 case "configType": 829 if value != nil { 830 jtv, ok := value.(string) 831 if !ok { 832 return fmt.Errorf("expected ConfigCapabilityType to be of type string, got %T instead", value) 833 } 834 sv.ConfigType = types.ConfigCapabilityType(jtv) 835 } 836 837 default: 838 _, _ = key, value 839 840 } 841 } 842 *v = sv 843 return nil 844} 845 846type awsRestjson1_deserializeOpDeleteDataflowEndpointGroup struct { 847} 848 849func (*awsRestjson1_deserializeOpDeleteDataflowEndpointGroup) ID() string { 850 return "OperationDeserializer" 851} 852 853func (m *awsRestjson1_deserializeOpDeleteDataflowEndpointGroup) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 854 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 855) { 856 out, metadata, err = next.HandleDeserialize(ctx, in) 857 if err != nil { 858 return out, metadata, err 859 } 860 861 response, ok := out.RawResponse.(*smithyhttp.Response) 862 if !ok { 863 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 864 } 865 866 if response.StatusCode < 200 || response.StatusCode >= 300 { 867 return out, metadata, awsRestjson1_deserializeOpErrorDeleteDataflowEndpointGroup(response, &metadata) 868 } 869 output := &DeleteDataflowEndpointGroupOutput{} 870 out.Result = output 871 872 var buff [1024]byte 873 ringBuffer := smithyio.NewRingBuffer(buff[:]) 874 875 body := io.TeeReader(response.Body, ringBuffer) 876 877 decoder := json.NewDecoder(body) 878 decoder.UseNumber() 879 var shape interface{} 880 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 881 var snapshot bytes.Buffer 882 io.Copy(&snapshot, ringBuffer) 883 err = &smithy.DeserializationError{ 884 Err: fmt.Errorf("failed to decode response body, %w", err), 885 Snapshot: snapshot.Bytes(), 886 } 887 return out, metadata, err 888 } 889 890 err = awsRestjson1_deserializeOpDocumentDeleteDataflowEndpointGroupOutput(&output, shape) 891 if err != nil { 892 var snapshot bytes.Buffer 893 io.Copy(&snapshot, ringBuffer) 894 return out, metadata, &smithy.DeserializationError{ 895 Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), 896 Snapshot: snapshot.Bytes(), 897 } 898 } 899 900 return out, metadata, err 901} 902 903func awsRestjson1_deserializeOpErrorDeleteDataflowEndpointGroup(response *smithyhttp.Response, metadata *middleware.Metadata) error { 904 var errorBuffer bytes.Buffer 905 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 906 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 907 } 908 errorBody := bytes.NewReader(errorBuffer.Bytes()) 909 910 errorCode := "UnknownError" 911 errorMessage := errorCode 912 913 code := response.Header.Get("X-Amzn-ErrorType") 914 if len(code) != 0 { 915 errorCode = restjson.SanitizeErrorCode(code) 916 } 917 918 var buff [1024]byte 919 ringBuffer := smithyio.NewRingBuffer(buff[:]) 920 921 body := io.TeeReader(errorBody, ringBuffer) 922 decoder := json.NewDecoder(body) 923 decoder.UseNumber() 924 code, message, err := restjson.GetErrorInfo(decoder) 925 if err != nil { 926 var snapshot bytes.Buffer 927 io.Copy(&snapshot, ringBuffer) 928 err = &smithy.DeserializationError{ 929 Err: fmt.Errorf("failed to decode response body, %w", err), 930 Snapshot: snapshot.Bytes(), 931 } 932 return err 933 } 934 935 errorBody.Seek(0, io.SeekStart) 936 if len(code) != 0 { 937 errorCode = restjson.SanitizeErrorCode(code) 938 } 939 if len(message) != 0 { 940 errorMessage = message 941 } 942 943 switch { 944 case strings.EqualFold("DependencyException", errorCode): 945 return awsRestjson1_deserializeErrorDependencyException(response, errorBody) 946 947 case strings.EqualFold("InvalidParameterException", errorCode): 948 return awsRestjson1_deserializeErrorInvalidParameterException(response, errorBody) 949 950 case strings.EqualFold("ResourceNotFoundException", errorCode): 951 return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) 952 953 default: 954 genericError := &smithy.GenericAPIError{ 955 Code: errorCode, 956 Message: errorMessage, 957 } 958 return genericError 959 960 } 961} 962 963func awsRestjson1_deserializeOpDocumentDeleteDataflowEndpointGroupOutput(v **DeleteDataflowEndpointGroupOutput, value interface{}) error { 964 if v == nil { 965 return fmt.Errorf("unexpected nil of type %T", v) 966 } 967 if value == nil { 968 return nil 969 } 970 971 shape, ok := value.(map[string]interface{}) 972 if !ok { 973 return fmt.Errorf("unexpected JSON type %v", value) 974 } 975 976 var sv *DeleteDataflowEndpointGroupOutput 977 if *v == nil { 978 sv = &DeleteDataflowEndpointGroupOutput{} 979 } else { 980 sv = *v 981 } 982 983 for key, value := range shape { 984 switch key { 985 case "dataflowEndpointGroupId": 986 if value != nil { 987 jtv, ok := value.(string) 988 if !ok { 989 return fmt.Errorf("expected String to be of type string, got %T instead", value) 990 } 991 sv.DataflowEndpointGroupId = ptr.String(jtv) 992 } 993 994 default: 995 _, _ = key, value 996 997 } 998 } 999 *v = sv 1000 return nil 1001} 1002 1003type awsRestjson1_deserializeOpDeleteMissionProfile struct { 1004} 1005 1006func (*awsRestjson1_deserializeOpDeleteMissionProfile) ID() string { 1007 return "OperationDeserializer" 1008} 1009 1010func (m *awsRestjson1_deserializeOpDeleteMissionProfile) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 1011 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 1012) { 1013 out, metadata, err = next.HandleDeserialize(ctx, in) 1014 if err != nil { 1015 return out, metadata, err 1016 } 1017 1018 response, ok := out.RawResponse.(*smithyhttp.Response) 1019 if !ok { 1020 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 1021 } 1022 1023 if response.StatusCode < 200 || response.StatusCode >= 300 { 1024 return out, metadata, awsRestjson1_deserializeOpErrorDeleteMissionProfile(response, &metadata) 1025 } 1026 output := &DeleteMissionProfileOutput{} 1027 out.Result = output 1028 1029 var buff [1024]byte 1030 ringBuffer := smithyio.NewRingBuffer(buff[:]) 1031 1032 body := io.TeeReader(response.Body, ringBuffer) 1033 1034 decoder := json.NewDecoder(body) 1035 decoder.UseNumber() 1036 var shape interface{} 1037 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 1038 var snapshot bytes.Buffer 1039 io.Copy(&snapshot, ringBuffer) 1040 err = &smithy.DeserializationError{ 1041 Err: fmt.Errorf("failed to decode response body, %w", err), 1042 Snapshot: snapshot.Bytes(), 1043 } 1044 return out, metadata, err 1045 } 1046 1047 err = awsRestjson1_deserializeOpDocumentDeleteMissionProfileOutput(&output, shape) 1048 if err != nil { 1049 var snapshot bytes.Buffer 1050 io.Copy(&snapshot, ringBuffer) 1051 return out, metadata, &smithy.DeserializationError{ 1052 Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), 1053 Snapshot: snapshot.Bytes(), 1054 } 1055 } 1056 1057 return out, metadata, err 1058} 1059 1060func awsRestjson1_deserializeOpErrorDeleteMissionProfile(response *smithyhttp.Response, metadata *middleware.Metadata) error { 1061 var errorBuffer bytes.Buffer 1062 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 1063 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 1064 } 1065 errorBody := bytes.NewReader(errorBuffer.Bytes()) 1066 1067 errorCode := "UnknownError" 1068 errorMessage := errorCode 1069 1070 code := response.Header.Get("X-Amzn-ErrorType") 1071 if len(code) != 0 { 1072 errorCode = restjson.SanitizeErrorCode(code) 1073 } 1074 1075 var buff [1024]byte 1076 ringBuffer := smithyio.NewRingBuffer(buff[:]) 1077 1078 body := io.TeeReader(errorBody, ringBuffer) 1079 decoder := json.NewDecoder(body) 1080 decoder.UseNumber() 1081 code, message, err := restjson.GetErrorInfo(decoder) 1082 if err != nil { 1083 var snapshot bytes.Buffer 1084 io.Copy(&snapshot, ringBuffer) 1085 err = &smithy.DeserializationError{ 1086 Err: fmt.Errorf("failed to decode response body, %w", err), 1087 Snapshot: snapshot.Bytes(), 1088 } 1089 return err 1090 } 1091 1092 errorBody.Seek(0, io.SeekStart) 1093 if len(code) != 0 { 1094 errorCode = restjson.SanitizeErrorCode(code) 1095 } 1096 if len(message) != 0 { 1097 errorMessage = message 1098 } 1099 1100 switch { 1101 case strings.EqualFold("DependencyException", errorCode): 1102 return awsRestjson1_deserializeErrorDependencyException(response, errorBody) 1103 1104 case strings.EqualFold("InvalidParameterException", errorCode): 1105 return awsRestjson1_deserializeErrorInvalidParameterException(response, errorBody) 1106 1107 case strings.EqualFold("ResourceNotFoundException", errorCode): 1108 return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) 1109 1110 default: 1111 genericError := &smithy.GenericAPIError{ 1112 Code: errorCode, 1113 Message: errorMessage, 1114 } 1115 return genericError 1116 1117 } 1118} 1119 1120func awsRestjson1_deserializeOpDocumentDeleteMissionProfileOutput(v **DeleteMissionProfileOutput, value interface{}) error { 1121 if v == nil { 1122 return fmt.Errorf("unexpected nil of type %T", v) 1123 } 1124 if value == nil { 1125 return nil 1126 } 1127 1128 shape, ok := value.(map[string]interface{}) 1129 if !ok { 1130 return fmt.Errorf("unexpected JSON type %v", value) 1131 } 1132 1133 var sv *DeleteMissionProfileOutput 1134 if *v == nil { 1135 sv = &DeleteMissionProfileOutput{} 1136 } else { 1137 sv = *v 1138 } 1139 1140 for key, value := range shape { 1141 switch key { 1142 case "missionProfileId": 1143 if value != nil { 1144 jtv, ok := value.(string) 1145 if !ok { 1146 return fmt.Errorf("expected String to be of type string, got %T instead", value) 1147 } 1148 sv.MissionProfileId = ptr.String(jtv) 1149 } 1150 1151 default: 1152 _, _ = key, value 1153 1154 } 1155 } 1156 *v = sv 1157 return nil 1158} 1159 1160type awsRestjson1_deserializeOpDescribeContact struct { 1161} 1162 1163func (*awsRestjson1_deserializeOpDescribeContact) ID() string { 1164 return "OperationDeserializer" 1165} 1166 1167func (m *awsRestjson1_deserializeOpDescribeContact) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 1168 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 1169) { 1170 out, metadata, err = next.HandleDeserialize(ctx, in) 1171 if err != nil { 1172 return out, metadata, err 1173 } 1174 1175 response, ok := out.RawResponse.(*smithyhttp.Response) 1176 if !ok { 1177 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 1178 } 1179 1180 if response.StatusCode < 200 || response.StatusCode >= 300 { 1181 return out, metadata, awsRestjson1_deserializeOpErrorDescribeContact(response, &metadata) 1182 } 1183 output := &DescribeContactOutput{} 1184 out.Result = output 1185 1186 var buff [1024]byte 1187 ringBuffer := smithyio.NewRingBuffer(buff[:]) 1188 1189 body := io.TeeReader(response.Body, ringBuffer) 1190 1191 decoder := json.NewDecoder(body) 1192 decoder.UseNumber() 1193 var shape interface{} 1194 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 1195 var snapshot bytes.Buffer 1196 io.Copy(&snapshot, ringBuffer) 1197 err = &smithy.DeserializationError{ 1198 Err: fmt.Errorf("failed to decode response body, %w", err), 1199 Snapshot: snapshot.Bytes(), 1200 } 1201 return out, metadata, err 1202 } 1203 1204 err = awsRestjson1_deserializeOpDocumentDescribeContactOutput(&output, shape) 1205 if err != nil { 1206 var snapshot bytes.Buffer 1207 io.Copy(&snapshot, ringBuffer) 1208 return out, metadata, &smithy.DeserializationError{ 1209 Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), 1210 Snapshot: snapshot.Bytes(), 1211 } 1212 } 1213 1214 return out, metadata, err 1215} 1216 1217func awsRestjson1_deserializeOpErrorDescribeContact(response *smithyhttp.Response, metadata *middleware.Metadata) error { 1218 var errorBuffer bytes.Buffer 1219 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 1220 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 1221 } 1222 errorBody := bytes.NewReader(errorBuffer.Bytes()) 1223 1224 errorCode := "UnknownError" 1225 errorMessage := errorCode 1226 1227 code := response.Header.Get("X-Amzn-ErrorType") 1228 if len(code) != 0 { 1229 errorCode = restjson.SanitizeErrorCode(code) 1230 } 1231 1232 var buff [1024]byte 1233 ringBuffer := smithyio.NewRingBuffer(buff[:]) 1234 1235 body := io.TeeReader(errorBody, ringBuffer) 1236 decoder := json.NewDecoder(body) 1237 decoder.UseNumber() 1238 code, message, err := restjson.GetErrorInfo(decoder) 1239 if err != nil { 1240 var snapshot bytes.Buffer 1241 io.Copy(&snapshot, ringBuffer) 1242 err = &smithy.DeserializationError{ 1243 Err: fmt.Errorf("failed to decode response body, %w", err), 1244 Snapshot: snapshot.Bytes(), 1245 } 1246 return err 1247 } 1248 1249 errorBody.Seek(0, io.SeekStart) 1250 if len(code) != 0 { 1251 errorCode = restjson.SanitizeErrorCode(code) 1252 } 1253 if len(message) != 0 { 1254 errorMessage = message 1255 } 1256 1257 switch { 1258 case strings.EqualFold("DependencyException", errorCode): 1259 return awsRestjson1_deserializeErrorDependencyException(response, errorBody) 1260 1261 case strings.EqualFold("InvalidParameterException", errorCode): 1262 return awsRestjson1_deserializeErrorInvalidParameterException(response, errorBody) 1263 1264 case strings.EqualFold("ResourceNotFoundException", errorCode): 1265 return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) 1266 1267 default: 1268 genericError := &smithy.GenericAPIError{ 1269 Code: errorCode, 1270 Message: errorMessage, 1271 } 1272 return genericError 1273 1274 } 1275} 1276 1277func awsRestjson1_deserializeOpDocumentDescribeContactOutput(v **DescribeContactOutput, value interface{}) error { 1278 if v == nil { 1279 return fmt.Errorf("unexpected nil of type %T", v) 1280 } 1281 if value == nil { 1282 return nil 1283 } 1284 1285 shape, ok := value.(map[string]interface{}) 1286 if !ok { 1287 return fmt.Errorf("unexpected JSON type %v", value) 1288 } 1289 1290 var sv *DescribeContactOutput 1291 if *v == nil { 1292 sv = &DescribeContactOutput{} 1293 } else { 1294 sv = *v 1295 } 1296 1297 for key, value := range shape { 1298 switch key { 1299 case "contactId": 1300 if value != nil { 1301 jtv, ok := value.(string) 1302 if !ok { 1303 return fmt.Errorf("expected String to be of type string, got %T instead", value) 1304 } 1305 sv.ContactId = ptr.String(jtv) 1306 } 1307 1308 case "contactStatus": 1309 if value != nil { 1310 jtv, ok := value.(string) 1311 if !ok { 1312 return fmt.Errorf("expected ContactStatus to be of type string, got %T instead", value) 1313 } 1314 sv.ContactStatus = types.ContactStatus(jtv) 1315 } 1316 1317 case "dataflowList": 1318 if err := awsRestjson1_deserializeDocumentDataflowList(&sv.DataflowList, value); err != nil { 1319 return err 1320 } 1321 1322 case "endTime": 1323 if value != nil { 1324 jtv, ok := value.(json.Number) 1325 if !ok { 1326 return fmt.Errorf("expected Timestamp to be json.Number, got %T instead", value) 1327 } 1328 f64, err := jtv.Float64() 1329 if err != nil { 1330 return err 1331 } 1332 sv.EndTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) 1333 } 1334 1335 case "errorMessage": 1336 if value != nil { 1337 jtv, ok := value.(string) 1338 if !ok { 1339 return fmt.Errorf("expected String to be of type string, got %T instead", value) 1340 } 1341 sv.ErrorMessage = ptr.String(jtv) 1342 } 1343 1344 case "groundStation": 1345 if value != nil { 1346 jtv, ok := value.(string) 1347 if !ok { 1348 return fmt.Errorf("expected String to be of type string, got %T instead", value) 1349 } 1350 sv.GroundStation = ptr.String(jtv) 1351 } 1352 1353 case "maximumElevation": 1354 if err := awsRestjson1_deserializeDocumentElevation(&sv.MaximumElevation, value); err != nil { 1355 return err 1356 } 1357 1358 case "missionProfileArn": 1359 if value != nil { 1360 jtv, ok := value.(string) 1361 if !ok { 1362 return fmt.Errorf("expected MissionProfileArn to be of type string, got %T instead", value) 1363 } 1364 sv.MissionProfileArn = ptr.String(jtv) 1365 } 1366 1367 case "postPassEndTime": 1368 if value != nil { 1369 jtv, ok := value.(json.Number) 1370 if !ok { 1371 return fmt.Errorf("expected Timestamp to be json.Number, got %T instead", value) 1372 } 1373 f64, err := jtv.Float64() 1374 if err != nil { 1375 return err 1376 } 1377 sv.PostPassEndTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) 1378 } 1379 1380 case "prePassStartTime": 1381 if value != nil { 1382 jtv, ok := value.(json.Number) 1383 if !ok { 1384 return fmt.Errorf("expected Timestamp to be json.Number, got %T instead", value) 1385 } 1386 f64, err := jtv.Float64() 1387 if err != nil { 1388 return err 1389 } 1390 sv.PrePassStartTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) 1391 } 1392 1393 case "region": 1394 if value != nil { 1395 jtv, ok := value.(string) 1396 if !ok { 1397 return fmt.Errorf("expected String to be of type string, got %T instead", value) 1398 } 1399 sv.Region = ptr.String(jtv) 1400 } 1401 1402 case "satelliteArn": 1403 if value != nil { 1404 jtv, ok := value.(string) 1405 if !ok { 1406 return fmt.Errorf("expected satelliteArn to be of type string, got %T instead", value) 1407 } 1408 sv.SatelliteArn = ptr.String(jtv) 1409 } 1410 1411 case "startTime": 1412 if value != nil { 1413 jtv, ok := value.(json.Number) 1414 if !ok { 1415 return fmt.Errorf("expected Timestamp to be json.Number, got %T instead", value) 1416 } 1417 f64, err := jtv.Float64() 1418 if err != nil { 1419 return err 1420 } 1421 sv.StartTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) 1422 } 1423 1424 case "tags": 1425 if err := awsRestjson1_deserializeDocumentTagsMap(&sv.Tags, value); err != nil { 1426 return err 1427 } 1428 1429 default: 1430 _, _ = key, value 1431 1432 } 1433 } 1434 *v = sv 1435 return nil 1436} 1437 1438type awsRestjson1_deserializeOpGetConfig struct { 1439} 1440 1441func (*awsRestjson1_deserializeOpGetConfig) ID() string { 1442 return "OperationDeserializer" 1443} 1444 1445func (m *awsRestjson1_deserializeOpGetConfig) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 1446 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 1447) { 1448 out, metadata, err = next.HandleDeserialize(ctx, in) 1449 if err != nil { 1450 return out, metadata, err 1451 } 1452 1453 response, ok := out.RawResponse.(*smithyhttp.Response) 1454 if !ok { 1455 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 1456 } 1457 1458 if response.StatusCode < 200 || response.StatusCode >= 300 { 1459 return out, metadata, awsRestjson1_deserializeOpErrorGetConfig(response, &metadata) 1460 } 1461 output := &GetConfigOutput{} 1462 out.Result = output 1463 1464 var buff [1024]byte 1465 ringBuffer := smithyio.NewRingBuffer(buff[:]) 1466 1467 body := io.TeeReader(response.Body, ringBuffer) 1468 1469 decoder := json.NewDecoder(body) 1470 decoder.UseNumber() 1471 var shape interface{} 1472 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 1473 var snapshot bytes.Buffer 1474 io.Copy(&snapshot, ringBuffer) 1475 err = &smithy.DeserializationError{ 1476 Err: fmt.Errorf("failed to decode response body, %w", err), 1477 Snapshot: snapshot.Bytes(), 1478 } 1479 return out, metadata, err 1480 } 1481 1482 err = awsRestjson1_deserializeOpDocumentGetConfigOutput(&output, shape) 1483 if err != nil { 1484 var snapshot bytes.Buffer 1485 io.Copy(&snapshot, ringBuffer) 1486 return out, metadata, &smithy.DeserializationError{ 1487 Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), 1488 Snapshot: snapshot.Bytes(), 1489 } 1490 } 1491 1492 return out, metadata, err 1493} 1494 1495func awsRestjson1_deserializeOpErrorGetConfig(response *smithyhttp.Response, metadata *middleware.Metadata) error { 1496 var errorBuffer bytes.Buffer 1497 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 1498 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 1499 } 1500 errorBody := bytes.NewReader(errorBuffer.Bytes()) 1501 1502 errorCode := "UnknownError" 1503 errorMessage := errorCode 1504 1505 code := response.Header.Get("X-Amzn-ErrorType") 1506 if len(code) != 0 { 1507 errorCode = restjson.SanitizeErrorCode(code) 1508 } 1509 1510 var buff [1024]byte 1511 ringBuffer := smithyio.NewRingBuffer(buff[:]) 1512 1513 body := io.TeeReader(errorBody, ringBuffer) 1514 decoder := json.NewDecoder(body) 1515 decoder.UseNumber() 1516 code, message, err := restjson.GetErrorInfo(decoder) 1517 if err != nil { 1518 var snapshot bytes.Buffer 1519 io.Copy(&snapshot, ringBuffer) 1520 err = &smithy.DeserializationError{ 1521 Err: fmt.Errorf("failed to decode response body, %w", err), 1522 Snapshot: snapshot.Bytes(), 1523 } 1524 return err 1525 } 1526 1527 errorBody.Seek(0, io.SeekStart) 1528 if len(code) != 0 { 1529 errorCode = restjson.SanitizeErrorCode(code) 1530 } 1531 if len(message) != 0 { 1532 errorMessage = message 1533 } 1534 1535 switch { 1536 case strings.EqualFold("DependencyException", errorCode): 1537 return awsRestjson1_deserializeErrorDependencyException(response, errorBody) 1538 1539 case strings.EqualFold("InvalidParameterException", errorCode): 1540 return awsRestjson1_deserializeErrorInvalidParameterException(response, errorBody) 1541 1542 case strings.EqualFold("ResourceNotFoundException", errorCode): 1543 return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) 1544 1545 default: 1546 genericError := &smithy.GenericAPIError{ 1547 Code: errorCode, 1548 Message: errorMessage, 1549 } 1550 return genericError 1551 1552 } 1553} 1554 1555func awsRestjson1_deserializeOpDocumentGetConfigOutput(v **GetConfigOutput, value interface{}) error { 1556 if v == nil { 1557 return fmt.Errorf("unexpected nil of type %T", v) 1558 } 1559 if value == nil { 1560 return nil 1561 } 1562 1563 shape, ok := value.(map[string]interface{}) 1564 if !ok { 1565 return fmt.Errorf("unexpected JSON type %v", value) 1566 } 1567 1568 var sv *GetConfigOutput 1569 if *v == nil { 1570 sv = &GetConfigOutput{} 1571 } else { 1572 sv = *v 1573 } 1574 1575 for key, value := range shape { 1576 switch key { 1577 case "configArn": 1578 if value != nil { 1579 jtv, ok := value.(string) 1580 if !ok { 1581 return fmt.Errorf("expected ConfigArn to be of type string, got %T instead", value) 1582 } 1583 sv.ConfigArn = ptr.String(jtv) 1584 } 1585 1586 case "configData": 1587 if err := awsRestjson1_deserializeDocumentConfigTypeData(&sv.ConfigData, value); err != nil { 1588 return err 1589 } 1590 1591 case "configId": 1592 if value != nil { 1593 jtv, ok := value.(string) 1594 if !ok { 1595 return fmt.Errorf("expected String to be of type string, got %T instead", value) 1596 } 1597 sv.ConfigId = ptr.String(jtv) 1598 } 1599 1600 case "configType": 1601 if value != nil { 1602 jtv, ok := value.(string) 1603 if !ok { 1604 return fmt.Errorf("expected ConfigCapabilityType to be of type string, got %T instead", value) 1605 } 1606 sv.ConfigType = types.ConfigCapabilityType(jtv) 1607 } 1608 1609 case "name": 1610 if value != nil { 1611 jtv, ok := value.(string) 1612 if !ok { 1613 return fmt.Errorf("expected String to be of type string, got %T instead", value) 1614 } 1615 sv.Name = ptr.String(jtv) 1616 } 1617 1618 case "tags": 1619 if err := awsRestjson1_deserializeDocumentTagsMap(&sv.Tags, value); err != nil { 1620 return err 1621 } 1622 1623 default: 1624 _, _ = key, value 1625 1626 } 1627 } 1628 *v = sv 1629 return nil 1630} 1631 1632type awsRestjson1_deserializeOpGetDataflowEndpointGroup struct { 1633} 1634 1635func (*awsRestjson1_deserializeOpGetDataflowEndpointGroup) ID() string { 1636 return "OperationDeserializer" 1637} 1638 1639func (m *awsRestjson1_deserializeOpGetDataflowEndpointGroup) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 1640 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 1641) { 1642 out, metadata, err = next.HandleDeserialize(ctx, in) 1643 if err != nil { 1644 return out, metadata, err 1645 } 1646 1647 response, ok := out.RawResponse.(*smithyhttp.Response) 1648 if !ok { 1649 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 1650 } 1651 1652 if response.StatusCode < 200 || response.StatusCode >= 300 { 1653 return out, metadata, awsRestjson1_deserializeOpErrorGetDataflowEndpointGroup(response, &metadata) 1654 } 1655 output := &GetDataflowEndpointGroupOutput{} 1656 out.Result = output 1657 1658 var buff [1024]byte 1659 ringBuffer := smithyio.NewRingBuffer(buff[:]) 1660 1661 body := io.TeeReader(response.Body, ringBuffer) 1662 1663 decoder := json.NewDecoder(body) 1664 decoder.UseNumber() 1665 var shape interface{} 1666 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 1667 var snapshot bytes.Buffer 1668 io.Copy(&snapshot, ringBuffer) 1669 err = &smithy.DeserializationError{ 1670 Err: fmt.Errorf("failed to decode response body, %w", err), 1671 Snapshot: snapshot.Bytes(), 1672 } 1673 return out, metadata, err 1674 } 1675 1676 err = awsRestjson1_deserializeOpDocumentGetDataflowEndpointGroupOutput(&output, shape) 1677 if err != nil { 1678 var snapshot bytes.Buffer 1679 io.Copy(&snapshot, ringBuffer) 1680 return out, metadata, &smithy.DeserializationError{ 1681 Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), 1682 Snapshot: snapshot.Bytes(), 1683 } 1684 } 1685 1686 return out, metadata, err 1687} 1688 1689func awsRestjson1_deserializeOpErrorGetDataflowEndpointGroup(response *smithyhttp.Response, metadata *middleware.Metadata) error { 1690 var errorBuffer bytes.Buffer 1691 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 1692 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 1693 } 1694 errorBody := bytes.NewReader(errorBuffer.Bytes()) 1695 1696 errorCode := "UnknownError" 1697 errorMessage := errorCode 1698 1699 code := response.Header.Get("X-Amzn-ErrorType") 1700 if len(code) != 0 { 1701 errorCode = restjson.SanitizeErrorCode(code) 1702 } 1703 1704 var buff [1024]byte 1705 ringBuffer := smithyio.NewRingBuffer(buff[:]) 1706 1707 body := io.TeeReader(errorBody, ringBuffer) 1708 decoder := json.NewDecoder(body) 1709 decoder.UseNumber() 1710 code, message, err := restjson.GetErrorInfo(decoder) 1711 if err != nil { 1712 var snapshot bytes.Buffer 1713 io.Copy(&snapshot, ringBuffer) 1714 err = &smithy.DeserializationError{ 1715 Err: fmt.Errorf("failed to decode response body, %w", err), 1716 Snapshot: snapshot.Bytes(), 1717 } 1718 return err 1719 } 1720 1721 errorBody.Seek(0, io.SeekStart) 1722 if len(code) != 0 { 1723 errorCode = restjson.SanitizeErrorCode(code) 1724 } 1725 if len(message) != 0 { 1726 errorMessage = message 1727 } 1728 1729 switch { 1730 case strings.EqualFold("DependencyException", errorCode): 1731 return awsRestjson1_deserializeErrorDependencyException(response, errorBody) 1732 1733 case strings.EqualFold("InvalidParameterException", errorCode): 1734 return awsRestjson1_deserializeErrorInvalidParameterException(response, errorBody) 1735 1736 case strings.EqualFold("ResourceNotFoundException", errorCode): 1737 return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) 1738 1739 default: 1740 genericError := &smithy.GenericAPIError{ 1741 Code: errorCode, 1742 Message: errorMessage, 1743 } 1744 return genericError 1745 1746 } 1747} 1748 1749func awsRestjson1_deserializeOpDocumentGetDataflowEndpointGroupOutput(v **GetDataflowEndpointGroupOutput, value interface{}) error { 1750 if v == nil { 1751 return fmt.Errorf("unexpected nil of type %T", v) 1752 } 1753 if value == nil { 1754 return nil 1755 } 1756 1757 shape, ok := value.(map[string]interface{}) 1758 if !ok { 1759 return fmt.Errorf("unexpected JSON type %v", value) 1760 } 1761 1762 var sv *GetDataflowEndpointGroupOutput 1763 if *v == nil { 1764 sv = &GetDataflowEndpointGroupOutput{} 1765 } else { 1766 sv = *v 1767 } 1768 1769 for key, value := range shape { 1770 switch key { 1771 case "dataflowEndpointGroupArn": 1772 if value != nil { 1773 jtv, ok := value.(string) 1774 if !ok { 1775 return fmt.Errorf("expected DataflowEndpointGroupArn to be of type string, got %T instead", value) 1776 } 1777 sv.DataflowEndpointGroupArn = ptr.String(jtv) 1778 } 1779 1780 case "dataflowEndpointGroupId": 1781 if value != nil { 1782 jtv, ok := value.(string) 1783 if !ok { 1784 return fmt.Errorf("expected String to be of type string, got %T instead", value) 1785 } 1786 sv.DataflowEndpointGroupId = ptr.String(jtv) 1787 } 1788 1789 case "endpointsDetails": 1790 if err := awsRestjson1_deserializeDocumentEndpointDetailsList(&sv.EndpointsDetails, value); err != nil { 1791 return err 1792 } 1793 1794 case "tags": 1795 if err := awsRestjson1_deserializeDocumentTagsMap(&sv.Tags, value); err != nil { 1796 return err 1797 } 1798 1799 default: 1800 _, _ = key, value 1801 1802 } 1803 } 1804 *v = sv 1805 return nil 1806} 1807 1808type awsRestjson1_deserializeOpGetMinuteUsage struct { 1809} 1810 1811func (*awsRestjson1_deserializeOpGetMinuteUsage) ID() string { 1812 return "OperationDeserializer" 1813} 1814 1815func (m *awsRestjson1_deserializeOpGetMinuteUsage) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 1816 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 1817) { 1818 out, metadata, err = next.HandleDeserialize(ctx, in) 1819 if err != nil { 1820 return out, metadata, err 1821 } 1822 1823 response, ok := out.RawResponse.(*smithyhttp.Response) 1824 if !ok { 1825 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 1826 } 1827 1828 if response.StatusCode < 200 || response.StatusCode >= 300 { 1829 return out, metadata, awsRestjson1_deserializeOpErrorGetMinuteUsage(response, &metadata) 1830 } 1831 output := &GetMinuteUsageOutput{} 1832 out.Result = output 1833 1834 var buff [1024]byte 1835 ringBuffer := smithyio.NewRingBuffer(buff[:]) 1836 1837 body := io.TeeReader(response.Body, ringBuffer) 1838 1839 decoder := json.NewDecoder(body) 1840 decoder.UseNumber() 1841 var shape interface{} 1842 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 1843 var snapshot bytes.Buffer 1844 io.Copy(&snapshot, ringBuffer) 1845 err = &smithy.DeserializationError{ 1846 Err: fmt.Errorf("failed to decode response body, %w", err), 1847 Snapshot: snapshot.Bytes(), 1848 } 1849 return out, metadata, err 1850 } 1851 1852 err = awsRestjson1_deserializeOpDocumentGetMinuteUsageOutput(&output, shape) 1853 if err != nil { 1854 var snapshot bytes.Buffer 1855 io.Copy(&snapshot, ringBuffer) 1856 return out, metadata, &smithy.DeserializationError{ 1857 Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), 1858 Snapshot: snapshot.Bytes(), 1859 } 1860 } 1861 1862 return out, metadata, err 1863} 1864 1865func awsRestjson1_deserializeOpErrorGetMinuteUsage(response *smithyhttp.Response, metadata *middleware.Metadata) error { 1866 var errorBuffer bytes.Buffer 1867 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 1868 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 1869 } 1870 errorBody := bytes.NewReader(errorBuffer.Bytes()) 1871 1872 errorCode := "UnknownError" 1873 errorMessage := errorCode 1874 1875 code := response.Header.Get("X-Amzn-ErrorType") 1876 if len(code) != 0 { 1877 errorCode = restjson.SanitizeErrorCode(code) 1878 } 1879 1880 var buff [1024]byte 1881 ringBuffer := smithyio.NewRingBuffer(buff[:]) 1882 1883 body := io.TeeReader(errorBody, ringBuffer) 1884 decoder := json.NewDecoder(body) 1885 decoder.UseNumber() 1886 code, message, err := restjson.GetErrorInfo(decoder) 1887 if err != nil { 1888 var snapshot bytes.Buffer 1889 io.Copy(&snapshot, ringBuffer) 1890 err = &smithy.DeserializationError{ 1891 Err: fmt.Errorf("failed to decode response body, %w", err), 1892 Snapshot: snapshot.Bytes(), 1893 } 1894 return err 1895 } 1896 1897 errorBody.Seek(0, io.SeekStart) 1898 if len(code) != 0 { 1899 errorCode = restjson.SanitizeErrorCode(code) 1900 } 1901 if len(message) != 0 { 1902 errorMessage = message 1903 } 1904 1905 switch { 1906 case strings.EqualFold("DependencyException", errorCode): 1907 return awsRestjson1_deserializeErrorDependencyException(response, errorBody) 1908 1909 case strings.EqualFold("InvalidParameterException", errorCode): 1910 return awsRestjson1_deserializeErrorInvalidParameterException(response, errorBody) 1911 1912 case strings.EqualFold("ResourceNotFoundException", errorCode): 1913 return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) 1914 1915 default: 1916 genericError := &smithy.GenericAPIError{ 1917 Code: errorCode, 1918 Message: errorMessage, 1919 } 1920 return genericError 1921 1922 } 1923} 1924 1925func awsRestjson1_deserializeOpDocumentGetMinuteUsageOutput(v **GetMinuteUsageOutput, value interface{}) error { 1926 if v == nil { 1927 return fmt.Errorf("unexpected nil of type %T", v) 1928 } 1929 if value == nil { 1930 return nil 1931 } 1932 1933 shape, ok := value.(map[string]interface{}) 1934 if !ok { 1935 return fmt.Errorf("unexpected JSON type %v", value) 1936 } 1937 1938 var sv *GetMinuteUsageOutput 1939 if *v == nil { 1940 sv = &GetMinuteUsageOutput{} 1941 } else { 1942 sv = *v 1943 } 1944 1945 for key, value := range shape { 1946 switch key { 1947 case "estimatedMinutesRemaining": 1948 if value != nil { 1949 jtv, ok := value.(json.Number) 1950 if !ok { 1951 return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) 1952 } 1953 i64, err := jtv.Int64() 1954 if err != nil { 1955 return err 1956 } 1957 sv.EstimatedMinutesRemaining = ptr.Int32(int32(i64)) 1958 } 1959 1960 case "isReservedMinutesCustomer": 1961 if value != nil { 1962 jtv, ok := value.(bool) 1963 if !ok { 1964 return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) 1965 } 1966 sv.IsReservedMinutesCustomer = ptr.Bool(jtv) 1967 } 1968 1969 case "totalReservedMinuteAllocation": 1970 if value != nil { 1971 jtv, ok := value.(json.Number) 1972 if !ok { 1973 return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) 1974 } 1975 i64, err := jtv.Int64() 1976 if err != nil { 1977 return err 1978 } 1979 sv.TotalReservedMinuteAllocation = ptr.Int32(int32(i64)) 1980 } 1981 1982 case "totalScheduledMinutes": 1983 if value != nil { 1984 jtv, ok := value.(json.Number) 1985 if !ok { 1986 return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) 1987 } 1988 i64, err := jtv.Int64() 1989 if err != nil { 1990 return err 1991 } 1992 sv.TotalScheduledMinutes = ptr.Int32(int32(i64)) 1993 } 1994 1995 case "upcomingMinutesScheduled": 1996 if value != nil { 1997 jtv, ok := value.(json.Number) 1998 if !ok { 1999 return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) 2000 } 2001 i64, err := jtv.Int64() 2002 if err != nil { 2003 return err 2004 } 2005 sv.UpcomingMinutesScheduled = ptr.Int32(int32(i64)) 2006 } 2007 2008 default: 2009 _, _ = key, value 2010 2011 } 2012 } 2013 *v = sv 2014 return nil 2015} 2016 2017type awsRestjson1_deserializeOpGetMissionProfile struct { 2018} 2019 2020func (*awsRestjson1_deserializeOpGetMissionProfile) ID() string { 2021 return "OperationDeserializer" 2022} 2023 2024func (m *awsRestjson1_deserializeOpGetMissionProfile) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 2025 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 2026) { 2027 out, metadata, err = next.HandleDeserialize(ctx, in) 2028 if err != nil { 2029 return out, metadata, err 2030 } 2031 2032 response, ok := out.RawResponse.(*smithyhttp.Response) 2033 if !ok { 2034 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 2035 } 2036 2037 if response.StatusCode < 200 || response.StatusCode >= 300 { 2038 return out, metadata, awsRestjson1_deserializeOpErrorGetMissionProfile(response, &metadata) 2039 } 2040 output := &GetMissionProfileOutput{} 2041 out.Result = output 2042 2043 var buff [1024]byte 2044 ringBuffer := smithyio.NewRingBuffer(buff[:]) 2045 2046 body := io.TeeReader(response.Body, ringBuffer) 2047 2048 decoder := json.NewDecoder(body) 2049 decoder.UseNumber() 2050 var shape interface{} 2051 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 2052 var snapshot bytes.Buffer 2053 io.Copy(&snapshot, ringBuffer) 2054 err = &smithy.DeserializationError{ 2055 Err: fmt.Errorf("failed to decode response body, %w", err), 2056 Snapshot: snapshot.Bytes(), 2057 } 2058 return out, metadata, err 2059 } 2060 2061 err = awsRestjson1_deserializeOpDocumentGetMissionProfileOutput(&output, shape) 2062 if err != nil { 2063 var snapshot bytes.Buffer 2064 io.Copy(&snapshot, ringBuffer) 2065 return out, metadata, &smithy.DeserializationError{ 2066 Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), 2067 Snapshot: snapshot.Bytes(), 2068 } 2069 } 2070 2071 return out, metadata, err 2072} 2073 2074func awsRestjson1_deserializeOpErrorGetMissionProfile(response *smithyhttp.Response, metadata *middleware.Metadata) error { 2075 var errorBuffer bytes.Buffer 2076 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 2077 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 2078 } 2079 errorBody := bytes.NewReader(errorBuffer.Bytes()) 2080 2081 errorCode := "UnknownError" 2082 errorMessage := errorCode 2083 2084 code := response.Header.Get("X-Amzn-ErrorType") 2085 if len(code) != 0 { 2086 errorCode = restjson.SanitizeErrorCode(code) 2087 } 2088 2089 var buff [1024]byte 2090 ringBuffer := smithyio.NewRingBuffer(buff[:]) 2091 2092 body := io.TeeReader(errorBody, ringBuffer) 2093 decoder := json.NewDecoder(body) 2094 decoder.UseNumber() 2095 code, message, err := restjson.GetErrorInfo(decoder) 2096 if err != nil { 2097 var snapshot bytes.Buffer 2098 io.Copy(&snapshot, ringBuffer) 2099 err = &smithy.DeserializationError{ 2100 Err: fmt.Errorf("failed to decode response body, %w", err), 2101 Snapshot: snapshot.Bytes(), 2102 } 2103 return err 2104 } 2105 2106 errorBody.Seek(0, io.SeekStart) 2107 if len(code) != 0 { 2108 errorCode = restjson.SanitizeErrorCode(code) 2109 } 2110 if len(message) != 0 { 2111 errorMessage = message 2112 } 2113 2114 switch { 2115 case strings.EqualFold("DependencyException", errorCode): 2116 return awsRestjson1_deserializeErrorDependencyException(response, errorBody) 2117 2118 case strings.EqualFold("InvalidParameterException", errorCode): 2119 return awsRestjson1_deserializeErrorInvalidParameterException(response, errorBody) 2120 2121 case strings.EqualFold("ResourceNotFoundException", errorCode): 2122 return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) 2123 2124 default: 2125 genericError := &smithy.GenericAPIError{ 2126 Code: errorCode, 2127 Message: errorMessage, 2128 } 2129 return genericError 2130 2131 } 2132} 2133 2134func awsRestjson1_deserializeOpDocumentGetMissionProfileOutput(v **GetMissionProfileOutput, value interface{}) error { 2135 if v == nil { 2136 return fmt.Errorf("unexpected nil of type %T", v) 2137 } 2138 if value == nil { 2139 return nil 2140 } 2141 2142 shape, ok := value.(map[string]interface{}) 2143 if !ok { 2144 return fmt.Errorf("unexpected JSON type %v", value) 2145 } 2146 2147 var sv *GetMissionProfileOutput 2148 if *v == nil { 2149 sv = &GetMissionProfileOutput{} 2150 } else { 2151 sv = *v 2152 } 2153 2154 for key, value := range shape { 2155 switch key { 2156 case "contactPostPassDurationSeconds": 2157 if value != nil { 2158 jtv, ok := value.(json.Number) 2159 if !ok { 2160 return fmt.Errorf("expected DurationInSeconds to be json.Number, got %T instead", value) 2161 } 2162 i64, err := jtv.Int64() 2163 if err != nil { 2164 return err 2165 } 2166 sv.ContactPostPassDurationSeconds = ptr.Int32(int32(i64)) 2167 } 2168 2169 case "contactPrePassDurationSeconds": 2170 if value != nil { 2171 jtv, ok := value.(json.Number) 2172 if !ok { 2173 return fmt.Errorf("expected DurationInSeconds to be json.Number, got %T instead", value) 2174 } 2175 i64, err := jtv.Int64() 2176 if err != nil { 2177 return err 2178 } 2179 sv.ContactPrePassDurationSeconds = ptr.Int32(int32(i64)) 2180 } 2181 2182 case "dataflowEdges": 2183 if err := awsRestjson1_deserializeDocumentDataflowEdgeList(&sv.DataflowEdges, value); err != nil { 2184 return err 2185 } 2186 2187 case "minimumViableContactDurationSeconds": 2188 if value != nil { 2189 jtv, ok := value.(json.Number) 2190 if !ok { 2191 return fmt.Errorf("expected DurationInSeconds to be json.Number, got %T instead", value) 2192 } 2193 i64, err := jtv.Int64() 2194 if err != nil { 2195 return err 2196 } 2197 sv.MinimumViableContactDurationSeconds = ptr.Int32(int32(i64)) 2198 } 2199 2200 case "missionProfileArn": 2201 if value != nil { 2202 jtv, ok := value.(string) 2203 if !ok { 2204 return fmt.Errorf("expected MissionProfileArn to be of type string, got %T instead", value) 2205 } 2206 sv.MissionProfileArn = ptr.String(jtv) 2207 } 2208 2209 case "missionProfileId": 2210 if value != nil { 2211 jtv, ok := value.(string) 2212 if !ok { 2213 return fmt.Errorf("expected String to be of type string, got %T instead", value) 2214 } 2215 sv.MissionProfileId = ptr.String(jtv) 2216 } 2217 2218 case "name": 2219 if value != nil { 2220 jtv, ok := value.(string) 2221 if !ok { 2222 return fmt.Errorf("expected String to be of type string, got %T instead", value) 2223 } 2224 sv.Name = ptr.String(jtv) 2225 } 2226 2227 case "region": 2228 if value != nil { 2229 jtv, ok := value.(string) 2230 if !ok { 2231 return fmt.Errorf("expected String to be of type string, got %T instead", value) 2232 } 2233 sv.Region = ptr.String(jtv) 2234 } 2235 2236 case "tags": 2237 if err := awsRestjson1_deserializeDocumentTagsMap(&sv.Tags, value); err != nil { 2238 return err 2239 } 2240 2241 case "trackingConfigArn": 2242 if value != nil { 2243 jtv, ok := value.(string) 2244 if !ok { 2245 return fmt.Errorf("expected ConfigArn to be of type string, got %T instead", value) 2246 } 2247 sv.TrackingConfigArn = ptr.String(jtv) 2248 } 2249 2250 default: 2251 _, _ = key, value 2252 2253 } 2254 } 2255 *v = sv 2256 return nil 2257} 2258 2259type awsRestjson1_deserializeOpGetSatellite struct { 2260} 2261 2262func (*awsRestjson1_deserializeOpGetSatellite) ID() string { 2263 return "OperationDeserializer" 2264} 2265 2266func (m *awsRestjson1_deserializeOpGetSatellite) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 2267 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 2268) { 2269 out, metadata, err = next.HandleDeserialize(ctx, in) 2270 if err != nil { 2271 return out, metadata, err 2272 } 2273 2274 response, ok := out.RawResponse.(*smithyhttp.Response) 2275 if !ok { 2276 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 2277 } 2278 2279 if response.StatusCode < 200 || response.StatusCode >= 300 { 2280 return out, metadata, awsRestjson1_deserializeOpErrorGetSatellite(response, &metadata) 2281 } 2282 output := &GetSatelliteOutput{} 2283 out.Result = output 2284 2285 var buff [1024]byte 2286 ringBuffer := smithyio.NewRingBuffer(buff[:]) 2287 2288 body := io.TeeReader(response.Body, ringBuffer) 2289 2290 decoder := json.NewDecoder(body) 2291 decoder.UseNumber() 2292 var shape interface{} 2293 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 2294 var snapshot bytes.Buffer 2295 io.Copy(&snapshot, ringBuffer) 2296 err = &smithy.DeserializationError{ 2297 Err: fmt.Errorf("failed to decode response body, %w", err), 2298 Snapshot: snapshot.Bytes(), 2299 } 2300 return out, metadata, err 2301 } 2302 2303 err = awsRestjson1_deserializeOpDocumentGetSatelliteOutput(&output, shape) 2304 if err != nil { 2305 var snapshot bytes.Buffer 2306 io.Copy(&snapshot, ringBuffer) 2307 return out, metadata, &smithy.DeserializationError{ 2308 Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), 2309 Snapshot: snapshot.Bytes(), 2310 } 2311 } 2312 2313 return out, metadata, err 2314} 2315 2316func awsRestjson1_deserializeOpErrorGetSatellite(response *smithyhttp.Response, metadata *middleware.Metadata) error { 2317 var errorBuffer bytes.Buffer 2318 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 2319 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 2320 } 2321 errorBody := bytes.NewReader(errorBuffer.Bytes()) 2322 2323 errorCode := "UnknownError" 2324 errorMessage := errorCode 2325 2326 code := response.Header.Get("X-Amzn-ErrorType") 2327 if len(code) != 0 { 2328 errorCode = restjson.SanitizeErrorCode(code) 2329 } 2330 2331 var buff [1024]byte 2332 ringBuffer := smithyio.NewRingBuffer(buff[:]) 2333 2334 body := io.TeeReader(errorBody, ringBuffer) 2335 decoder := json.NewDecoder(body) 2336 decoder.UseNumber() 2337 code, message, err := restjson.GetErrorInfo(decoder) 2338 if err != nil { 2339 var snapshot bytes.Buffer 2340 io.Copy(&snapshot, ringBuffer) 2341 err = &smithy.DeserializationError{ 2342 Err: fmt.Errorf("failed to decode response body, %w", err), 2343 Snapshot: snapshot.Bytes(), 2344 } 2345 return err 2346 } 2347 2348 errorBody.Seek(0, io.SeekStart) 2349 if len(code) != 0 { 2350 errorCode = restjson.SanitizeErrorCode(code) 2351 } 2352 if len(message) != 0 { 2353 errorMessage = message 2354 } 2355 2356 switch { 2357 case strings.EqualFold("DependencyException", errorCode): 2358 return awsRestjson1_deserializeErrorDependencyException(response, errorBody) 2359 2360 case strings.EqualFold("InvalidParameterException", errorCode): 2361 return awsRestjson1_deserializeErrorInvalidParameterException(response, errorBody) 2362 2363 case strings.EqualFold("ResourceNotFoundException", errorCode): 2364 return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) 2365 2366 default: 2367 genericError := &smithy.GenericAPIError{ 2368 Code: errorCode, 2369 Message: errorMessage, 2370 } 2371 return genericError 2372 2373 } 2374} 2375 2376func awsRestjson1_deserializeOpDocumentGetSatelliteOutput(v **GetSatelliteOutput, value interface{}) error { 2377 if v == nil { 2378 return fmt.Errorf("unexpected nil of type %T", v) 2379 } 2380 if value == nil { 2381 return nil 2382 } 2383 2384 shape, ok := value.(map[string]interface{}) 2385 if !ok { 2386 return fmt.Errorf("unexpected JSON type %v", value) 2387 } 2388 2389 var sv *GetSatelliteOutput 2390 if *v == nil { 2391 sv = &GetSatelliteOutput{} 2392 } else { 2393 sv = *v 2394 } 2395 2396 for key, value := range shape { 2397 switch key { 2398 case "groundStations": 2399 if err := awsRestjson1_deserializeDocumentGroundStationIdList(&sv.GroundStations, value); err != nil { 2400 return err 2401 } 2402 2403 case "noradSatelliteID": 2404 if value != nil { 2405 jtv, ok := value.(json.Number) 2406 if !ok { 2407 return fmt.Errorf("expected noradSatelliteID to be json.Number, got %T instead", value) 2408 } 2409 i64, err := jtv.Int64() 2410 if err != nil { 2411 return err 2412 } 2413 sv.NoradSatelliteID = int32(i64) 2414 } 2415 2416 case "satelliteArn": 2417 if value != nil { 2418 jtv, ok := value.(string) 2419 if !ok { 2420 return fmt.Errorf("expected satelliteArn to be of type string, got %T instead", value) 2421 } 2422 sv.SatelliteArn = ptr.String(jtv) 2423 } 2424 2425 case "satelliteId": 2426 if value != nil { 2427 jtv, ok := value.(string) 2428 if !ok { 2429 return fmt.Errorf("expected Uuid to be of type string, got %T instead", value) 2430 } 2431 sv.SatelliteId = ptr.String(jtv) 2432 } 2433 2434 default: 2435 _, _ = key, value 2436 2437 } 2438 } 2439 *v = sv 2440 return nil 2441} 2442 2443type awsRestjson1_deserializeOpListConfigs struct { 2444} 2445 2446func (*awsRestjson1_deserializeOpListConfigs) ID() string { 2447 return "OperationDeserializer" 2448} 2449 2450func (m *awsRestjson1_deserializeOpListConfigs) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 2451 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 2452) { 2453 out, metadata, err = next.HandleDeserialize(ctx, in) 2454 if err != nil { 2455 return out, metadata, err 2456 } 2457 2458 response, ok := out.RawResponse.(*smithyhttp.Response) 2459 if !ok { 2460 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 2461 } 2462 2463 if response.StatusCode < 200 || response.StatusCode >= 300 { 2464 return out, metadata, awsRestjson1_deserializeOpErrorListConfigs(response, &metadata) 2465 } 2466 output := &ListConfigsOutput{} 2467 out.Result = output 2468 2469 var buff [1024]byte 2470 ringBuffer := smithyio.NewRingBuffer(buff[:]) 2471 2472 body := io.TeeReader(response.Body, ringBuffer) 2473 2474 decoder := json.NewDecoder(body) 2475 decoder.UseNumber() 2476 var shape interface{} 2477 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 2478 var snapshot bytes.Buffer 2479 io.Copy(&snapshot, ringBuffer) 2480 err = &smithy.DeserializationError{ 2481 Err: fmt.Errorf("failed to decode response body, %w", err), 2482 Snapshot: snapshot.Bytes(), 2483 } 2484 return out, metadata, err 2485 } 2486 2487 err = awsRestjson1_deserializeOpDocumentListConfigsOutput(&output, shape) 2488 if err != nil { 2489 var snapshot bytes.Buffer 2490 io.Copy(&snapshot, ringBuffer) 2491 return out, metadata, &smithy.DeserializationError{ 2492 Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), 2493 Snapshot: snapshot.Bytes(), 2494 } 2495 } 2496 2497 return out, metadata, err 2498} 2499 2500func awsRestjson1_deserializeOpErrorListConfigs(response *smithyhttp.Response, metadata *middleware.Metadata) error { 2501 var errorBuffer bytes.Buffer 2502 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 2503 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 2504 } 2505 errorBody := bytes.NewReader(errorBuffer.Bytes()) 2506 2507 errorCode := "UnknownError" 2508 errorMessage := errorCode 2509 2510 code := response.Header.Get("X-Amzn-ErrorType") 2511 if len(code) != 0 { 2512 errorCode = restjson.SanitizeErrorCode(code) 2513 } 2514 2515 var buff [1024]byte 2516 ringBuffer := smithyio.NewRingBuffer(buff[:]) 2517 2518 body := io.TeeReader(errorBody, ringBuffer) 2519 decoder := json.NewDecoder(body) 2520 decoder.UseNumber() 2521 code, message, err := restjson.GetErrorInfo(decoder) 2522 if err != nil { 2523 var snapshot bytes.Buffer 2524 io.Copy(&snapshot, ringBuffer) 2525 err = &smithy.DeserializationError{ 2526 Err: fmt.Errorf("failed to decode response body, %w", err), 2527 Snapshot: snapshot.Bytes(), 2528 } 2529 return err 2530 } 2531 2532 errorBody.Seek(0, io.SeekStart) 2533 if len(code) != 0 { 2534 errorCode = restjson.SanitizeErrorCode(code) 2535 } 2536 if len(message) != 0 { 2537 errorMessage = message 2538 } 2539 2540 switch { 2541 case strings.EqualFold("DependencyException", errorCode): 2542 return awsRestjson1_deserializeErrorDependencyException(response, errorBody) 2543 2544 case strings.EqualFold("InvalidParameterException", errorCode): 2545 return awsRestjson1_deserializeErrorInvalidParameterException(response, errorBody) 2546 2547 case strings.EqualFold("ResourceNotFoundException", errorCode): 2548 return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) 2549 2550 default: 2551 genericError := &smithy.GenericAPIError{ 2552 Code: errorCode, 2553 Message: errorMessage, 2554 } 2555 return genericError 2556 2557 } 2558} 2559 2560func awsRestjson1_deserializeOpDocumentListConfigsOutput(v **ListConfigsOutput, value interface{}) error { 2561 if v == nil { 2562 return fmt.Errorf("unexpected nil of type %T", v) 2563 } 2564 if value == nil { 2565 return nil 2566 } 2567 2568 shape, ok := value.(map[string]interface{}) 2569 if !ok { 2570 return fmt.Errorf("unexpected JSON type %v", value) 2571 } 2572 2573 var sv *ListConfigsOutput 2574 if *v == nil { 2575 sv = &ListConfigsOutput{} 2576 } else { 2577 sv = *v 2578 } 2579 2580 for key, value := range shape { 2581 switch key { 2582 case "configList": 2583 if err := awsRestjson1_deserializeDocumentConfigList(&sv.ConfigList, value); err != nil { 2584 return err 2585 } 2586 2587 case "nextToken": 2588 if value != nil { 2589 jtv, ok := value.(string) 2590 if !ok { 2591 return fmt.Errorf("expected String to be of type string, got %T instead", value) 2592 } 2593 sv.NextToken = ptr.String(jtv) 2594 } 2595 2596 default: 2597 _, _ = key, value 2598 2599 } 2600 } 2601 *v = sv 2602 return nil 2603} 2604 2605type awsRestjson1_deserializeOpListContacts struct { 2606} 2607 2608func (*awsRestjson1_deserializeOpListContacts) ID() string { 2609 return "OperationDeserializer" 2610} 2611 2612func (m *awsRestjson1_deserializeOpListContacts) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 2613 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 2614) { 2615 out, metadata, err = next.HandleDeserialize(ctx, in) 2616 if err != nil { 2617 return out, metadata, err 2618 } 2619 2620 response, ok := out.RawResponse.(*smithyhttp.Response) 2621 if !ok { 2622 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 2623 } 2624 2625 if response.StatusCode < 200 || response.StatusCode >= 300 { 2626 return out, metadata, awsRestjson1_deserializeOpErrorListContacts(response, &metadata) 2627 } 2628 output := &ListContactsOutput{} 2629 out.Result = output 2630 2631 var buff [1024]byte 2632 ringBuffer := smithyio.NewRingBuffer(buff[:]) 2633 2634 body := io.TeeReader(response.Body, ringBuffer) 2635 2636 decoder := json.NewDecoder(body) 2637 decoder.UseNumber() 2638 var shape interface{} 2639 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 2640 var snapshot bytes.Buffer 2641 io.Copy(&snapshot, ringBuffer) 2642 err = &smithy.DeserializationError{ 2643 Err: fmt.Errorf("failed to decode response body, %w", err), 2644 Snapshot: snapshot.Bytes(), 2645 } 2646 return out, metadata, err 2647 } 2648 2649 err = awsRestjson1_deserializeOpDocumentListContactsOutput(&output, shape) 2650 if err != nil { 2651 var snapshot bytes.Buffer 2652 io.Copy(&snapshot, ringBuffer) 2653 return out, metadata, &smithy.DeserializationError{ 2654 Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), 2655 Snapshot: snapshot.Bytes(), 2656 } 2657 } 2658 2659 return out, metadata, err 2660} 2661 2662func awsRestjson1_deserializeOpErrorListContacts(response *smithyhttp.Response, metadata *middleware.Metadata) error { 2663 var errorBuffer bytes.Buffer 2664 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 2665 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 2666 } 2667 errorBody := bytes.NewReader(errorBuffer.Bytes()) 2668 2669 errorCode := "UnknownError" 2670 errorMessage := errorCode 2671 2672 code := response.Header.Get("X-Amzn-ErrorType") 2673 if len(code) != 0 { 2674 errorCode = restjson.SanitizeErrorCode(code) 2675 } 2676 2677 var buff [1024]byte 2678 ringBuffer := smithyio.NewRingBuffer(buff[:]) 2679 2680 body := io.TeeReader(errorBody, ringBuffer) 2681 decoder := json.NewDecoder(body) 2682 decoder.UseNumber() 2683 code, message, err := restjson.GetErrorInfo(decoder) 2684 if err != nil { 2685 var snapshot bytes.Buffer 2686 io.Copy(&snapshot, ringBuffer) 2687 err = &smithy.DeserializationError{ 2688 Err: fmt.Errorf("failed to decode response body, %w", err), 2689 Snapshot: snapshot.Bytes(), 2690 } 2691 return err 2692 } 2693 2694 errorBody.Seek(0, io.SeekStart) 2695 if len(code) != 0 { 2696 errorCode = restjson.SanitizeErrorCode(code) 2697 } 2698 if len(message) != 0 { 2699 errorMessage = message 2700 } 2701 2702 switch { 2703 case strings.EqualFold("DependencyException", errorCode): 2704 return awsRestjson1_deserializeErrorDependencyException(response, errorBody) 2705 2706 case strings.EqualFold("InvalidParameterException", errorCode): 2707 return awsRestjson1_deserializeErrorInvalidParameterException(response, errorBody) 2708 2709 case strings.EqualFold("ResourceNotFoundException", errorCode): 2710 return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) 2711 2712 default: 2713 genericError := &smithy.GenericAPIError{ 2714 Code: errorCode, 2715 Message: errorMessage, 2716 } 2717 return genericError 2718 2719 } 2720} 2721 2722func awsRestjson1_deserializeOpDocumentListContactsOutput(v **ListContactsOutput, value interface{}) error { 2723 if v == nil { 2724 return fmt.Errorf("unexpected nil of type %T", v) 2725 } 2726 if value == nil { 2727 return nil 2728 } 2729 2730 shape, ok := value.(map[string]interface{}) 2731 if !ok { 2732 return fmt.Errorf("unexpected JSON type %v", value) 2733 } 2734 2735 var sv *ListContactsOutput 2736 if *v == nil { 2737 sv = &ListContactsOutput{} 2738 } else { 2739 sv = *v 2740 } 2741 2742 for key, value := range shape { 2743 switch key { 2744 case "contactList": 2745 if err := awsRestjson1_deserializeDocumentContactList(&sv.ContactList, value); err != nil { 2746 return err 2747 } 2748 2749 case "nextToken": 2750 if value != nil { 2751 jtv, ok := value.(string) 2752 if !ok { 2753 return fmt.Errorf("expected String to be of type string, got %T instead", value) 2754 } 2755 sv.NextToken = ptr.String(jtv) 2756 } 2757 2758 default: 2759 _, _ = key, value 2760 2761 } 2762 } 2763 *v = sv 2764 return nil 2765} 2766 2767type awsRestjson1_deserializeOpListDataflowEndpointGroups struct { 2768} 2769 2770func (*awsRestjson1_deserializeOpListDataflowEndpointGroups) ID() string { 2771 return "OperationDeserializer" 2772} 2773 2774func (m *awsRestjson1_deserializeOpListDataflowEndpointGroups) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 2775 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 2776) { 2777 out, metadata, err = next.HandleDeserialize(ctx, in) 2778 if err != nil { 2779 return out, metadata, err 2780 } 2781 2782 response, ok := out.RawResponse.(*smithyhttp.Response) 2783 if !ok { 2784 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 2785 } 2786 2787 if response.StatusCode < 200 || response.StatusCode >= 300 { 2788 return out, metadata, awsRestjson1_deserializeOpErrorListDataflowEndpointGroups(response, &metadata) 2789 } 2790 output := &ListDataflowEndpointGroupsOutput{} 2791 out.Result = output 2792 2793 var buff [1024]byte 2794 ringBuffer := smithyio.NewRingBuffer(buff[:]) 2795 2796 body := io.TeeReader(response.Body, ringBuffer) 2797 2798 decoder := json.NewDecoder(body) 2799 decoder.UseNumber() 2800 var shape interface{} 2801 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 2802 var snapshot bytes.Buffer 2803 io.Copy(&snapshot, ringBuffer) 2804 err = &smithy.DeserializationError{ 2805 Err: fmt.Errorf("failed to decode response body, %w", err), 2806 Snapshot: snapshot.Bytes(), 2807 } 2808 return out, metadata, err 2809 } 2810 2811 err = awsRestjson1_deserializeOpDocumentListDataflowEndpointGroupsOutput(&output, shape) 2812 if err != nil { 2813 var snapshot bytes.Buffer 2814 io.Copy(&snapshot, ringBuffer) 2815 return out, metadata, &smithy.DeserializationError{ 2816 Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), 2817 Snapshot: snapshot.Bytes(), 2818 } 2819 } 2820 2821 return out, metadata, err 2822} 2823 2824func awsRestjson1_deserializeOpErrorListDataflowEndpointGroups(response *smithyhttp.Response, metadata *middleware.Metadata) error { 2825 var errorBuffer bytes.Buffer 2826 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 2827 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 2828 } 2829 errorBody := bytes.NewReader(errorBuffer.Bytes()) 2830 2831 errorCode := "UnknownError" 2832 errorMessage := errorCode 2833 2834 code := response.Header.Get("X-Amzn-ErrorType") 2835 if len(code) != 0 { 2836 errorCode = restjson.SanitizeErrorCode(code) 2837 } 2838 2839 var buff [1024]byte 2840 ringBuffer := smithyio.NewRingBuffer(buff[:]) 2841 2842 body := io.TeeReader(errorBody, ringBuffer) 2843 decoder := json.NewDecoder(body) 2844 decoder.UseNumber() 2845 code, message, err := restjson.GetErrorInfo(decoder) 2846 if err != nil { 2847 var snapshot bytes.Buffer 2848 io.Copy(&snapshot, ringBuffer) 2849 err = &smithy.DeserializationError{ 2850 Err: fmt.Errorf("failed to decode response body, %w", err), 2851 Snapshot: snapshot.Bytes(), 2852 } 2853 return err 2854 } 2855 2856 errorBody.Seek(0, io.SeekStart) 2857 if len(code) != 0 { 2858 errorCode = restjson.SanitizeErrorCode(code) 2859 } 2860 if len(message) != 0 { 2861 errorMessage = message 2862 } 2863 2864 switch { 2865 case strings.EqualFold("DependencyException", errorCode): 2866 return awsRestjson1_deserializeErrorDependencyException(response, errorBody) 2867 2868 case strings.EqualFold("InvalidParameterException", errorCode): 2869 return awsRestjson1_deserializeErrorInvalidParameterException(response, errorBody) 2870 2871 case strings.EqualFold("ResourceNotFoundException", errorCode): 2872 return awsRestjson1_deserializeErrorResourceNotFoundException(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_deserializeOpDocumentListDataflowEndpointGroupsOutput(v **ListDataflowEndpointGroupsOutput, 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 *ListDataflowEndpointGroupsOutput 2898 if *v == nil { 2899 sv = &ListDataflowEndpointGroupsOutput{} 2900 } else { 2901 sv = *v 2902 } 2903 2904 for key, value := range shape { 2905 switch key { 2906 case "dataflowEndpointGroupList": 2907 if err := awsRestjson1_deserializeDocumentDataflowEndpointGroupList(&sv.DataflowEndpointGroupList, 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 String 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_deserializeOpListGroundStations struct { 2930} 2931 2932func (*awsRestjson1_deserializeOpListGroundStations) ID() string { 2933 return "OperationDeserializer" 2934} 2935 2936func (m *awsRestjson1_deserializeOpListGroundStations) 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_deserializeOpErrorListGroundStations(response, &metadata) 2951 } 2952 output := &ListGroundStationsOutput{} 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_deserializeOpDocumentListGroundStationsOutput(&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_deserializeOpErrorListGroundStations(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("DependencyException", errorCode): 3028 return awsRestjson1_deserializeErrorDependencyException(response, errorBody) 3029 3030 case strings.EqualFold("InvalidParameterException", errorCode): 3031 return awsRestjson1_deserializeErrorInvalidParameterException(response, errorBody) 3032 3033 case strings.EqualFold("ResourceNotFoundException", errorCode): 3034 return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) 3035 3036 default: 3037 genericError := &smithy.GenericAPIError{ 3038 Code: errorCode, 3039 Message: errorMessage, 3040 } 3041 return genericError 3042 3043 } 3044} 3045 3046func awsRestjson1_deserializeOpDocumentListGroundStationsOutput(v **ListGroundStationsOutput, value interface{}) error { 3047 if v == nil { 3048 return fmt.Errorf("unexpected nil of type %T", v) 3049 } 3050 if value == nil { 3051 return nil 3052 } 3053 3054 shape, ok := value.(map[string]interface{}) 3055 if !ok { 3056 return fmt.Errorf("unexpected JSON type %v", value) 3057 } 3058 3059 var sv *ListGroundStationsOutput 3060 if *v == nil { 3061 sv = &ListGroundStationsOutput{} 3062 } else { 3063 sv = *v 3064 } 3065 3066 for key, value := range shape { 3067 switch key { 3068 case "groundStationList": 3069 if err := awsRestjson1_deserializeDocumentGroundStationList(&sv.GroundStationList, value); err != nil { 3070 return err 3071 } 3072 3073 case "nextToken": 3074 if value != nil { 3075 jtv, ok := value.(string) 3076 if !ok { 3077 return fmt.Errorf("expected String to be of type string, got %T instead", value) 3078 } 3079 sv.NextToken = ptr.String(jtv) 3080 } 3081 3082 default: 3083 _, _ = key, value 3084 3085 } 3086 } 3087 *v = sv 3088 return nil 3089} 3090 3091type awsRestjson1_deserializeOpListMissionProfiles struct { 3092} 3093 3094func (*awsRestjson1_deserializeOpListMissionProfiles) ID() string { 3095 return "OperationDeserializer" 3096} 3097 3098func (m *awsRestjson1_deserializeOpListMissionProfiles) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 3099 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 3100) { 3101 out, metadata, err = next.HandleDeserialize(ctx, in) 3102 if err != nil { 3103 return out, metadata, err 3104 } 3105 3106 response, ok := out.RawResponse.(*smithyhttp.Response) 3107 if !ok { 3108 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 3109 } 3110 3111 if response.StatusCode < 200 || response.StatusCode >= 300 { 3112 return out, metadata, awsRestjson1_deserializeOpErrorListMissionProfiles(response, &metadata) 3113 } 3114 output := &ListMissionProfilesOutput{} 3115 out.Result = output 3116 3117 var buff [1024]byte 3118 ringBuffer := smithyio.NewRingBuffer(buff[:]) 3119 3120 body := io.TeeReader(response.Body, ringBuffer) 3121 3122 decoder := json.NewDecoder(body) 3123 decoder.UseNumber() 3124 var shape interface{} 3125 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 3126 var snapshot bytes.Buffer 3127 io.Copy(&snapshot, ringBuffer) 3128 err = &smithy.DeserializationError{ 3129 Err: fmt.Errorf("failed to decode response body, %w", err), 3130 Snapshot: snapshot.Bytes(), 3131 } 3132 return out, metadata, err 3133 } 3134 3135 err = awsRestjson1_deserializeOpDocumentListMissionProfilesOutput(&output, shape) 3136 if err != nil { 3137 var snapshot bytes.Buffer 3138 io.Copy(&snapshot, ringBuffer) 3139 return out, metadata, &smithy.DeserializationError{ 3140 Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), 3141 Snapshot: snapshot.Bytes(), 3142 } 3143 } 3144 3145 return out, metadata, err 3146} 3147 3148func awsRestjson1_deserializeOpErrorListMissionProfiles(response *smithyhttp.Response, metadata *middleware.Metadata) error { 3149 var errorBuffer bytes.Buffer 3150 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 3151 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 3152 } 3153 errorBody := bytes.NewReader(errorBuffer.Bytes()) 3154 3155 errorCode := "UnknownError" 3156 errorMessage := errorCode 3157 3158 code := response.Header.Get("X-Amzn-ErrorType") 3159 if len(code) != 0 { 3160 errorCode = restjson.SanitizeErrorCode(code) 3161 } 3162 3163 var buff [1024]byte 3164 ringBuffer := smithyio.NewRingBuffer(buff[:]) 3165 3166 body := io.TeeReader(errorBody, ringBuffer) 3167 decoder := json.NewDecoder(body) 3168 decoder.UseNumber() 3169 code, message, err := restjson.GetErrorInfo(decoder) 3170 if err != nil { 3171 var snapshot bytes.Buffer 3172 io.Copy(&snapshot, ringBuffer) 3173 err = &smithy.DeserializationError{ 3174 Err: fmt.Errorf("failed to decode response body, %w", err), 3175 Snapshot: snapshot.Bytes(), 3176 } 3177 return err 3178 } 3179 3180 errorBody.Seek(0, io.SeekStart) 3181 if len(code) != 0 { 3182 errorCode = restjson.SanitizeErrorCode(code) 3183 } 3184 if len(message) != 0 { 3185 errorMessage = message 3186 } 3187 3188 switch { 3189 case strings.EqualFold("DependencyException", errorCode): 3190 return awsRestjson1_deserializeErrorDependencyException(response, errorBody) 3191 3192 case strings.EqualFold("InvalidParameterException", errorCode): 3193 return awsRestjson1_deserializeErrorInvalidParameterException(response, errorBody) 3194 3195 case strings.EqualFold("ResourceNotFoundException", errorCode): 3196 return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) 3197 3198 default: 3199 genericError := &smithy.GenericAPIError{ 3200 Code: errorCode, 3201 Message: errorMessage, 3202 } 3203 return genericError 3204 3205 } 3206} 3207 3208func awsRestjson1_deserializeOpDocumentListMissionProfilesOutput(v **ListMissionProfilesOutput, value interface{}) error { 3209 if v == nil { 3210 return fmt.Errorf("unexpected nil of type %T", v) 3211 } 3212 if value == nil { 3213 return nil 3214 } 3215 3216 shape, ok := value.(map[string]interface{}) 3217 if !ok { 3218 return fmt.Errorf("unexpected JSON type %v", value) 3219 } 3220 3221 var sv *ListMissionProfilesOutput 3222 if *v == nil { 3223 sv = &ListMissionProfilesOutput{} 3224 } else { 3225 sv = *v 3226 } 3227 3228 for key, value := range shape { 3229 switch key { 3230 case "missionProfileList": 3231 if err := awsRestjson1_deserializeDocumentMissionProfileList(&sv.MissionProfileList, value); err != nil { 3232 return err 3233 } 3234 3235 case "nextToken": 3236 if value != nil { 3237 jtv, ok := value.(string) 3238 if !ok { 3239 return fmt.Errorf("expected String to be of type string, got %T instead", value) 3240 } 3241 sv.NextToken = ptr.String(jtv) 3242 } 3243 3244 default: 3245 _, _ = key, value 3246 3247 } 3248 } 3249 *v = sv 3250 return nil 3251} 3252 3253type awsRestjson1_deserializeOpListSatellites struct { 3254} 3255 3256func (*awsRestjson1_deserializeOpListSatellites) ID() string { 3257 return "OperationDeserializer" 3258} 3259 3260func (m *awsRestjson1_deserializeOpListSatellites) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 3261 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 3262) { 3263 out, metadata, err = next.HandleDeserialize(ctx, in) 3264 if err != nil { 3265 return out, metadata, err 3266 } 3267 3268 response, ok := out.RawResponse.(*smithyhttp.Response) 3269 if !ok { 3270 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 3271 } 3272 3273 if response.StatusCode < 200 || response.StatusCode >= 300 { 3274 return out, metadata, awsRestjson1_deserializeOpErrorListSatellites(response, &metadata) 3275 } 3276 output := &ListSatellitesOutput{} 3277 out.Result = output 3278 3279 var buff [1024]byte 3280 ringBuffer := smithyio.NewRingBuffer(buff[:]) 3281 3282 body := io.TeeReader(response.Body, ringBuffer) 3283 3284 decoder := json.NewDecoder(body) 3285 decoder.UseNumber() 3286 var shape interface{} 3287 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 3288 var snapshot bytes.Buffer 3289 io.Copy(&snapshot, ringBuffer) 3290 err = &smithy.DeserializationError{ 3291 Err: fmt.Errorf("failed to decode response body, %w", err), 3292 Snapshot: snapshot.Bytes(), 3293 } 3294 return out, metadata, err 3295 } 3296 3297 err = awsRestjson1_deserializeOpDocumentListSatellitesOutput(&output, shape) 3298 if err != nil { 3299 var snapshot bytes.Buffer 3300 io.Copy(&snapshot, ringBuffer) 3301 return out, metadata, &smithy.DeserializationError{ 3302 Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), 3303 Snapshot: snapshot.Bytes(), 3304 } 3305 } 3306 3307 return out, metadata, err 3308} 3309 3310func awsRestjson1_deserializeOpErrorListSatellites(response *smithyhttp.Response, metadata *middleware.Metadata) error { 3311 var errorBuffer bytes.Buffer 3312 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 3313 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 3314 } 3315 errorBody := bytes.NewReader(errorBuffer.Bytes()) 3316 3317 errorCode := "UnknownError" 3318 errorMessage := errorCode 3319 3320 code := response.Header.Get("X-Amzn-ErrorType") 3321 if len(code) != 0 { 3322 errorCode = restjson.SanitizeErrorCode(code) 3323 } 3324 3325 var buff [1024]byte 3326 ringBuffer := smithyio.NewRingBuffer(buff[:]) 3327 3328 body := io.TeeReader(errorBody, ringBuffer) 3329 decoder := json.NewDecoder(body) 3330 decoder.UseNumber() 3331 code, message, err := restjson.GetErrorInfo(decoder) 3332 if err != nil { 3333 var snapshot bytes.Buffer 3334 io.Copy(&snapshot, ringBuffer) 3335 err = &smithy.DeserializationError{ 3336 Err: fmt.Errorf("failed to decode response body, %w", err), 3337 Snapshot: snapshot.Bytes(), 3338 } 3339 return err 3340 } 3341 3342 errorBody.Seek(0, io.SeekStart) 3343 if len(code) != 0 { 3344 errorCode = restjson.SanitizeErrorCode(code) 3345 } 3346 if len(message) != 0 { 3347 errorMessage = message 3348 } 3349 3350 switch { 3351 case strings.EqualFold("DependencyException", errorCode): 3352 return awsRestjson1_deserializeErrorDependencyException(response, errorBody) 3353 3354 case strings.EqualFold("InvalidParameterException", errorCode): 3355 return awsRestjson1_deserializeErrorInvalidParameterException(response, errorBody) 3356 3357 case strings.EqualFold("ResourceNotFoundException", errorCode): 3358 return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) 3359 3360 default: 3361 genericError := &smithy.GenericAPIError{ 3362 Code: errorCode, 3363 Message: errorMessage, 3364 } 3365 return genericError 3366 3367 } 3368} 3369 3370func awsRestjson1_deserializeOpDocumentListSatellitesOutput(v **ListSatellitesOutput, value interface{}) error { 3371 if v == nil { 3372 return fmt.Errorf("unexpected nil of type %T", v) 3373 } 3374 if value == nil { 3375 return nil 3376 } 3377 3378 shape, ok := value.(map[string]interface{}) 3379 if !ok { 3380 return fmt.Errorf("unexpected JSON type %v", value) 3381 } 3382 3383 var sv *ListSatellitesOutput 3384 if *v == nil { 3385 sv = &ListSatellitesOutput{} 3386 } else { 3387 sv = *v 3388 } 3389 3390 for key, value := range shape { 3391 switch key { 3392 case "nextToken": 3393 if value != nil { 3394 jtv, ok := value.(string) 3395 if !ok { 3396 return fmt.Errorf("expected String to be of type string, got %T instead", value) 3397 } 3398 sv.NextToken = ptr.String(jtv) 3399 } 3400 3401 case "satellites": 3402 if err := awsRestjson1_deserializeDocumentSatelliteList(&sv.Satellites, value); err != nil { 3403 return err 3404 } 3405 3406 default: 3407 _, _ = key, value 3408 3409 } 3410 } 3411 *v = sv 3412 return nil 3413} 3414 3415type awsRestjson1_deserializeOpListTagsForResource struct { 3416} 3417 3418func (*awsRestjson1_deserializeOpListTagsForResource) ID() string { 3419 return "OperationDeserializer" 3420} 3421 3422func (m *awsRestjson1_deserializeOpListTagsForResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 3423 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 3424) { 3425 out, metadata, err = next.HandleDeserialize(ctx, in) 3426 if err != nil { 3427 return out, metadata, err 3428 } 3429 3430 response, ok := out.RawResponse.(*smithyhttp.Response) 3431 if !ok { 3432 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 3433 } 3434 3435 if response.StatusCode < 200 || response.StatusCode >= 300 { 3436 return out, metadata, awsRestjson1_deserializeOpErrorListTagsForResource(response, &metadata) 3437 } 3438 output := &ListTagsForResourceOutput{} 3439 out.Result = output 3440 3441 var buff [1024]byte 3442 ringBuffer := smithyio.NewRingBuffer(buff[:]) 3443 3444 body := io.TeeReader(response.Body, ringBuffer) 3445 3446 decoder := json.NewDecoder(body) 3447 decoder.UseNumber() 3448 var shape interface{} 3449 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 3450 var snapshot bytes.Buffer 3451 io.Copy(&snapshot, ringBuffer) 3452 err = &smithy.DeserializationError{ 3453 Err: fmt.Errorf("failed to decode response body, %w", err), 3454 Snapshot: snapshot.Bytes(), 3455 } 3456 return out, metadata, err 3457 } 3458 3459 err = awsRestjson1_deserializeOpDocumentListTagsForResourceOutput(&output, shape) 3460 if err != nil { 3461 var snapshot bytes.Buffer 3462 io.Copy(&snapshot, ringBuffer) 3463 return out, metadata, &smithy.DeserializationError{ 3464 Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), 3465 Snapshot: snapshot.Bytes(), 3466 } 3467 } 3468 3469 return out, metadata, err 3470} 3471 3472func awsRestjson1_deserializeOpErrorListTagsForResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { 3473 var errorBuffer bytes.Buffer 3474 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 3475 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 3476 } 3477 errorBody := bytes.NewReader(errorBuffer.Bytes()) 3478 3479 errorCode := "UnknownError" 3480 errorMessage := errorCode 3481 3482 code := response.Header.Get("X-Amzn-ErrorType") 3483 if len(code) != 0 { 3484 errorCode = restjson.SanitizeErrorCode(code) 3485 } 3486 3487 var buff [1024]byte 3488 ringBuffer := smithyio.NewRingBuffer(buff[:]) 3489 3490 body := io.TeeReader(errorBody, ringBuffer) 3491 decoder := json.NewDecoder(body) 3492 decoder.UseNumber() 3493 code, message, err := restjson.GetErrorInfo(decoder) 3494 if err != nil { 3495 var snapshot bytes.Buffer 3496 io.Copy(&snapshot, ringBuffer) 3497 err = &smithy.DeserializationError{ 3498 Err: fmt.Errorf("failed to decode response body, %w", err), 3499 Snapshot: snapshot.Bytes(), 3500 } 3501 return err 3502 } 3503 3504 errorBody.Seek(0, io.SeekStart) 3505 if len(code) != 0 { 3506 errorCode = restjson.SanitizeErrorCode(code) 3507 } 3508 if len(message) != 0 { 3509 errorMessage = message 3510 } 3511 3512 switch { 3513 case strings.EqualFold("DependencyException", errorCode): 3514 return awsRestjson1_deserializeErrorDependencyException(response, errorBody) 3515 3516 case strings.EqualFold("InvalidParameterException", errorCode): 3517 return awsRestjson1_deserializeErrorInvalidParameterException(response, errorBody) 3518 3519 case strings.EqualFold("ResourceNotFoundException", errorCode): 3520 return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) 3521 3522 default: 3523 genericError := &smithy.GenericAPIError{ 3524 Code: errorCode, 3525 Message: errorMessage, 3526 } 3527 return genericError 3528 3529 } 3530} 3531 3532func awsRestjson1_deserializeOpDocumentListTagsForResourceOutput(v **ListTagsForResourceOutput, value interface{}) error { 3533 if v == nil { 3534 return fmt.Errorf("unexpected nil of type %T", v) 3535 } 3536 if value == nil { 3537 return nil 3538 } 3539 3540 shape, ok := value.(map[string]interface{}) 3541 if !ok { 3542 return fmt.Errorf("unexpected JSON type %v", value) 3543 } 3544 3545 var sv *ListTagsForResourceOutput 3546 if *v == nil { 3547 sv = &ListTagsForResourceOutput{} 3548 } else { 3549 sv = *v 3550 } 3551 3552 for key, value := range shape { 3553 switch key { 3554 case "tags": 3555 if err := awsRestjson1_deserializeDocumentTagsMap(&sv.Tags, value); err != nil { 3556 return err 3557 } 3558 3559 default: 3560 _, _ = key, value 3561 3562 } 3563 } 3564 *v = sv 3565 return nil 3566} 3567 3568type awsRestjson1_deserializeOpReserveContact struct { 3569} 3570 3571func (*awsRestjson1_deserializeOpReserveContact) ID() string { 3572 return "OperationDeserializer" 3573} 3574 3575func (m *awsRestjson1_deserializeOpReserveContact) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 3576 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 3577) { 3578 out, metadata, err = next.HandleDeserialize(ctx, in) 3579 if err != nil { 3580 return out, metadata, err 3581 } 3582 3583 response, ok := out.RawResponse.(*smithyhttp.Response) 3584 if !ok { 3585 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 3586 } 3587 3588 if response.StatusCode < 200 || response.StatusCode >= 300 { 3589 return out, metadata, awsRestjson1_deserializeOpErrorReserveContact(response, &metadata) 3590 } 3591 output := &ReserveContactOutput{} 3592 out.Result = output 3593 3594 var buff [1024]byte 3595 ringBuffer := smithyio.NewRingBuffer(buff[:]) 3596 3597 body := io.TeeReader(response.Body, ringBuffer) 3598 3599 decoder := json.NewDecoder(body) 3600 decoder.UseNumber() 3601 var shape interface{} 3602 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 3603 var snapshot bytes.Buffer 3604 io.Copy(&snapshot, ringBuffer) 3605 err = &smithy.DeserializationError{ 3606 Err: fmt.Errorf("failed to decode response body, %w", err), 3607 Snapshot: snapshot.Bytes(), 3608 } 3609 return out, metadata, err 3610 } 3611 3612 err = awsRestjson1_deserializeOpDocumentReserveContactOutput(&output, shape) 3613 if err != nil { 3614 var snapshot bytes.Buffer 3615 io.Copy(&snapshot, ringBuffer) 3616 return out, metadata, &smithy.DeserializationError{ 3617 Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), 3618 Snapshot: snapshot.Bytes(), 3619 } 3620 } 3621 3622 return out, metadata, err 3623} 3624 3625func awsRestjson1_deserializeOpErrorReserveContact(response *smithyhttp.Response, metadata *middleware.Metadata) error { 3626 var errorBuffer bytes.Buffer 3627 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 3628 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 3629 } 3630 errorBody := bytes.NewReader(errorBuffer.Bytes()) 3631 3632 errorCode := "UnknownError" 3633 errorMessage := errorCode 3634 3635 code := response.Header.Get("X-Amzn-ErrorType") 3636 if len(code) != 0 { 3637 errorCode = restjson.SanitizeErrorCode(code) 3638 } 3639 3640 var buff [1024]byte 3641 ringBuffer := smithyio.NewRingBuffer(buff[:]) 3642 3643 body := io.TeeReader(errorBody, ringBuffer) 3644 decoder := json.NewDecoder(body) 3645 decoder.UseNumber() 3646 code, message, err := restjson.GetErrorInfo(decoder) 3647 if err != nil { 3648 var snapshot bytes.Buffer 3649 io.Copy(&snapshot, ringBuffer) 3650 err = &smithy.DeserializationError{ 3651 Err: fmt.Errorf("failed to decode response body, %w", err), 3652 Snapshot: snapshot.Bytes(), 3653 } 3654 return err 3655 } 3656 3657 errorBody.Seek(0, io.SeekStart) 3658 if len(code) != 0 { 3659 errorCode = restjson.SanitizeErrorCode(code) 3660 } 3661 if len(message) != 0 { 3662 errorMessage = message 3663 } 3664 3665 switch { 3666 case strings.EqualFold("DependencyException", errorCode): 3667 return awsRestjson1_deserializeErrorDependencyException(response, errorBody) 3668 3669 case strings.EqualFold("InvalidParameterException", errorCode): 3670 return awsRestjson1_deserializeErrorInvalidParameterException(response, errorBody) 3671 3672 case strings.EqualFold("ResourceNotFoundException", errorCode): 3673 return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) 3674 3675 default: 3676 genericError := &smithy.GenericAPIError{ 3677 Code: errorCode, 3678 Message: errorMessage, 3679 } 3680 return genericError 3681 3682 } 3683} 3684 3685func awsRestjson1_deserializeOpDocumentReserveContactOutput(v **ReserveContactOutput, value interface{}) error { 3686 if v == nil { 3687 return fmt.Errorf("unexpected nil of type %T", v) 3688 } 3689 if value == nil { 3690 return nil 3691 } 3692 3693 shape, ok := value.(map[string]interface{}) 3694 if !ok { 3695 return fmt.Errorf("unexpected JSON type %v", value) 3696 } 3697 3698 var sv *ReserveContactOutput 3699 if *v == nil { 3700 sv = &ReserveContactOutput{} 3701 } else { 3702 sv = *v 3703 } 3704 3705 for key, value := range shape { 3706 switch key { 3707 case "contactId": 3708 if value != nil { 3709 jtv, ok := value.(string) 3710 if !ok { 3711 return fmt.Errorf("expected String to be of type string, got %T instead", value) 3712 } 3713 sv.ContactId = ptr.String(jtv) 3714 } 3715 3716 default: 3717 _, _ = key, value 3718 3719 } 3720 } 3721 *v = sv 3722 return nil 3723} 3724 3725type awsRestjson1_deserializeOpTagResource struct { 3726} 3727 3728func (*awsRestjson1_deserializeOpTagResource) ID() string { 3729 return "OperationDeserializer" 3730} 3731 3732func (m *awsRestjson1_deserializeOpTagResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 3733 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 3734) { 3735 out, metadata, err = next.HandleDeserialize(ctx, in) 3736 if err != nil { 3737 return out, metadata, err 3738 } 3739 3740 response, ok := out.RawResponse.(*smithyhttp.Response) 3741 if !ok { 3742 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 3743 } 3744 3745 if response.StatusCode < 200 || response.StatusCode >= 300 { 3746 return out, metadata, awsRestjson1_deserializeOpErrorTagResource(response, &metadata) 3747 } 3748 output := &TagResourceOutput{} 3749 out.Result = output 3750 3751 return out, metadata, err 3752} 3753 3754func awsRestjson1_deserializeOpErrorTagResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { 3755 var errorBuffer bytes.Buffer 3756 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 3757 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 3758 } 3759 errorBody := bytes.NewReader(errorBuffer.Bytes()) 3760 3761 errorCode := "UnknownError" 3762 errorMessage := errorCode 3763 3764 code := response.Header.Get("X-Amzn-ErrorType") 3765 if len(code) != 0 { 3766 errorCode = restjson.SanitizeErrorCode(code) 3767 } 3768 3769 var buff [1024]byte 3770 ringBuffer := smithyio.NewRingBuffer(buff[:]) 3771 3772 body := io.TeeReader(errorBody, ringBuffer) 3773 decoder := json.NewDecoder(body) 3774 decoder.UseNumber() 3775 code, message, err := restjson.GetErrorInfo(decoder) 3776 if err != nil { 3777 var snapshot bytes.Buffer 3778 io.Copy(&snapshot, ringBuffer) 3779 err = &smithy.DeserializationError{ 3780 Err: fmt.Errorf("failed to decode response body, %w", err), 3781 Snapshot: snapshot.Bytes(), 3782 } 3783 return err 3784 } 3785 3786 errorBody.Seek(0, io.SeekStart) 3787 if len(code) != 0 { 3788 errorCode = restjson.SanitizeErrorCode(code) 3789 } 3790 if len(message) != 0 { 3791 errorMessage = message 3792 } 3793 3794 switch { 3795 case strings.EqualFold("DependencyException", errorCode): 3796 return awsRestjson1_deserializeErrorDependencyException(response, errorBody) 3797 3798 case strings.EqualFold("InvalidParameterException", errorCode): 3799 return awsRestjson1_deserializeErrorInvalidParameterException(response, errorBody) 3800 3801 case strings.EqualFold("ResourceNotFoundException", errorCode): 3802 return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) 3803 3804 default: 3805 genericError := &smithy.GenericAPIError{ 3806 Code: errorCode, 3807 Message: errorMessage, 3808 } 3809 return genericError 3810 3811 } 3812} 3813 3814type awsRestjson1_deserializeOpUntagResource struct { 3815} 3816 3817func (*awsRestjson1_deserializeOpUntagResource) ID() string { 3818 return "OperationDeserializer" 3819} 3820 3821func (m *awsRestjson1_deserializeOpUntagResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 3822 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 3823) { 3824 out, metadata, err = next.HandleDeserialize(ctx, in) 3825 if err != nil { 3826 return out, metadata, err 3827 } 3828 3829 response, ok := out.RawResponse.(*smithyhttp.Response) 3830 if !ok { 3831 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 3832 } 3833 3834 if response.StatusCode < 200 || response.StatusCode >= 300 { 3835 return out, metadata, awsRestjson1_deserializeOpErrorUntagResource(response, &metadata) 3836 } 3837 output := &UntagResourceOutput{} 3838 out.Result = output 3839 3840 return out, metadata, err 3841} 3842 3843func awsRestjson1_deserializeOpErrorUntagResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { 3844 var errorBuffer bytes.Buffer 3845 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 3846 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 3847 } 3848 errorBody := bytes.NewReader(errorBuffer.Bytes()) 3849 3850 errorCode := "UnknownError" 3851 errorMessage := errorCode 3852 3853 code := response.Header.Get("X-Amzn-ErrorType") 3854 if len(code) != 0 { 3855 errorCode = restjson.SanitizeErrorCode(code) 3856 } 3857 3858 var buff [1024]byte 3859 ringBuffer := smithyio.NewRingBuffer(buff[:]) 3860 3861 body := io.TeeReader(errorBody, ringBuffer) 3862 decoder := json.NewDecoder(body) 3863 decoder.UseNumber() 3864 code, message, err := restjson.GetErrorInfo(decoder) 3865 if err != nil { 3866 var snapshot bytes.Buffer 3867 io.Copy(&snapshot, ringBuffer) 3868 err = &smithy.DeserializationError{ 3869 Err: fmt.Errorf("failed to decode response body, %w", err), 3870 Snapshot: snapshot.Bytes(), 3871 } 3872 return err 3873 } 3874 3875 errorBody.Seek(0, io.SeekStart) 3876 if len(code) != 0 { 3877 errorCode = restjson.SanitizeErrorCode(code) 3878 } 3879 if len(message) != 0 { 3880 errorMessage = message 3881 } 3882 3883 switch { 3884 case strings.EqualFold("DependencyException", errorCode): 3885 return awsRestjson1_deserializeErrorDependencyException(response, errorBody) 3886 3887 case strings.EqualFold("InvalidParameterException", errorCode): 3888 return awsRestjson1_deserializeErrorInvalidParameterException(response, errorBody) 3889 3890 case strings.EqualFold("ResourceNotFoundException", errorCode): 3891 return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) 3892 3893 default: 3894 genericError := &smithy.GenericAPIError{ 3895 Code: errorCode, 3896 Message: errorMessage, 3897 } 3898 return genericError 3899 3900 } 3901} 3902 3903type awsRestjson1_deserializeOpUpdateConfig struct { 3904} 3905 3906func (*awsRestjson1_deserializeOpUpdateConfig) ID() string { 3907 return "OperationDeserializer" 3908} 3909 3910func (m *awsRestjson1_deserializeOpUpdateConfig) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 3911 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 3912) { 3913 out, metadata, err = next.HandleDeserialize(ctx, in) 3914 if err != nil { 3915 return out, metadata, err 3916 } 3917 3918 response, ok := out.RawResponse.(*smithyhttp.Response) 3919 if !ok { 3920 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 3921 } 3922 3923 if response.StatusCode < 200 || response.StatusCode >= 300 { 3924 return out, metadata, awsRestjson1_deserializeOpErrorUpdateConfig(response, &metadata) 3925 } 3926 output := &UpdateConfigOutput{} 3927 out.Result = output 3928 3929 var buff [1024]byte 3930 ringBuffer := smithyio.NewRingBuffer(buff[:]) 3931 3932 body := io.TeeReader(response.Body, ringBuffer) 3933 3934 decoder := json.NewDecoder(body) 3935 decoder.UseNumber() 3936 var shape interface{} 3937 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 3938 var snapshot bytes.Buffer 3939 io.Copy(&snapshot, ringBuffer) 3940 err = &smithy.DeserializationError{ 3941 Err: fmt.Errorf("failed to decode response body, %w", err), 3942 Snapshot: snapshot.Bytes(), 3943 } 3944 return out, metadata, err 3945 } 3946 3947 err = awsRestjson1_deserializeOpDocumentUpdateConfigOutput(&output, shape) 3948 if err != nil { 3949 var snapshot bytes.Buffer 3950 io.Copy(&snapshot, ringBuffer) 3951 return out, metadata, &smithy.DeserializationError{ 3952 Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), 3953 Snapshot: snapshot.Bytes(), 3954 } 3955 } 3956 3957 return out, metadata, err 3958} 3959 3960func awsRestjson1_deserializeOpErrorUpdateConfig(response *smithyhttp.Response, metadata *middleware.Metadata) error { 3961 var errorBuffer bytes.Buffer 3962 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 3963 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 3964 } 3965 errorBody := bytes.NewReader(errorBuffer.Bytes()) 3966 3967 errorCode := "UnknownError" 3968 errorMessage := errorCode 3969 3970 code := response.Header.Get("X-Amzn-ErrorType") 3971 if len(code) != 0 { 3972 errorCode = restjson.SanitizeErrorCode(code) 3973 } 3974 3975 var buff [1024]byte 3976 ringBuffer := smithyio.NewRingBuffer(buff[:]) 3977 3978 body := io.TeeReader(errorBody, ringBuffer) 3979 decoder := json.NewDecoder(body) 3980 decoder.UseNumber() 3981 code, message, err := restjson.GetErrorInfo(decoder) 3982 if err != nil { 3983 var snapshot bytes.Buffer 3984 io.Copy(&snapshot, ringBuffer) 3985 err = &smithy.DeserializationError{ 3986 Err: fmt.Errorf("failed to decode response body, %w", err), 3987 Snapshot: snapshot.Bytes(), 3988 } 3989 return err 3990 } 3991 3992 errorBody.Seek(0, io.SeekStart) 3993 if len(code) != 0 { 3994 errorCode = restjson.SanitizeErrorCode(code) 3995 } 3996 if len(message) != 0 { 3997 errorMessage = message 3998 } 3999 4000 switch { 4001 case strings.EqualFold("DependencyException", errorCode): 4002 return awsRestjson1_deserializeErrorDependencyException(response, errorBody) 4003 4004 case strings.EqualFold("InvalidParameterException", errorCode): 4005 return awsRestjson1_deserializeErrorInvalidParameterException(response, errorBody) 4006 4007 case strings.EqualFold("ResourceNotFoundException", errorCode): 4008 return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) 4009 4010 default: 4011 genericError := &smithy.GenericAPIError{ 4012 Code: errorCode, 4013 Message: errorMessage, 4014 } 4015 return genericError 4016 4017 } 4018} 4019 4020func awsRestjson1_deserializeOpDocumentUpdateConfigOutput(v **UpdateConfigOutput, value interface{}) error { 4021 if v == nil { 4022 return fmt.Errorf("unexpected nil of type %T", v) 4023 } 4024 if value == nil { 4025 return nil 4026 } 4027 4028 shape, ok := value.(map[string]interface{}) 4029 if !ok { 4030 return fmt.Errorf("unexpected JSON type %v", value) 4031 } 4032 4033 var sv *UpdateConfigOutput 4034 if *v == nil { 4035 sv = &UpdateConfigOutput{} 4036 } else { 4037 sv = *v 4038 } 4039 4040 for key, value := range shape { 4041 switch key { 4042 case "configArn": 4043 if value != nil { 4044 jtv, ok := value.(string) 4045 if !ok { 4046 return fmt.Errorf("expected ConfigArn to be of type string, got %T instead", value) 4047 } 4048 sv.ConfigArn = ptr.String(jtv) 4049 } 4050 4051 case "configId": 4052 if value != nil { 4053 jtv, ok := value.(string) 4054 if !ok { 4055 return fmt.Errorf("expected String to be of type string, got %T instead", value) 4056 } 4057 sv.ConfigId = ptr.String(jtv) 4058 } 4059 4060 case "configType": 4061 if value != nil { 4062 jtv, ok := value.(string) 4063 if !ok { 4064 return fmt.Errorf("expected ConfigCapabilityType to be of type string, got %T instead", value) 4065 } 4066 sv.ConfigType = types.ConfigCapabilityType(jtv) 4067 } 4068 4069 default: 4070 _, _ = key, value 4071 4072 } 4073 } 4074 *v = sv 4075 return nil 4076} 4077 4078type awsRestjson1_deserializeOpUpdateMissionProfile struct { 4079} 4080 4081func (*awsRestjson1_deserializeOpUpdateMissionProfile) ID() string { 4082 return "OperationDeserializer" 4083} 4084 4085func (m *awsRestjson1_deserializeOpUpdateMissionProfile) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 4086 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 4087) { 4088 out, metadata, err = next.HandleDeserialize(ctx, in) 4089 if err != nil { 4090 return out, metadata, err 4091 } 4092 4093 response, ok := out.RawResponse.(*smithyhttp.Response) 4094 if !ok { 4095 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 4096 } 4097 4098 if response.StatusCode < 200 || response.StatusCode >= 300 { 4099 return out, metadata, awsRestjson1_deserializeOpErrorUpdateMissionProfile(response, &metadata) 4100 } 4101 output := &UpdateMissionProfileOutput{} 4102 out.Result = output 4103 4104 var buff [1024]byte 4105 ringBuffer := smithyio.NewRingBuffer(buff[:]) 4106 4107 body := io.TeeReader(response.Body, ringBuffer) 4108 4109 decoder := json.NewDecoder(body) 4110 decoder.UseNumber() 4111 var shape interface{} 4112 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 4113 var snapshot bytes.Buffer 4114 io.Copy(&snapshot, ringBuffer) 4115 err = &smithy.DeserializationError{ 4116 Err: fmt.Errorf("failed to decode response body, %w", err), 4117 Snapshot: snapshot.Bytes(), 4118 } 4119 return out, metadata, err 4120 } 4121 4122 err = awsRestjson1_deserializeOpDocumentUpdateMissionProfileOutput(&output, shape) 4123 if err != nil { 4124 var snapshot bytes.Buffer 4125 io.Copy(&snapshot, ringBuffer) 4126 return out, metadata, &smithy.DeserializationError{ 4127 Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), 4128 Snapshot: snapshot.Bytes(), 4129 } 4130 } 4131 4132 return out, metadata, err 4133} 4134 4135func awsRestjson1_deserializeOpErrorUpdateMissionProfile(response *smithyhttp.Response, metadata *middleware.Metadata) error { 4136 var errorBuffer bytes.Buffer 4137 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 4138 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 4139 } 4140 errorBody := bytes.NewReader(errorBuffer.Bytes()) 4141 4142 errorCode := "UnknownError" 4143 errorMessage := errorCode 4144 4145 code := response.Header.Get("X-Amzn-ErrorType") 4146 if len(code) != 0 { 4147 errorCode = restjson.SanitizeErrorCode(code) 4148 } 4149 4150 var buff [1024]byte 4151 ringBuffer := smithyio.NewRingBuffer(buff[:]) 4152 4153 body := io.TeeReader(errorBody, ringBuffer) 4154 decoder := json.NewDecoder(body) 4155 decoder.UseNumber() 4156 code, message, err := restjson.GetErrorInfo(decoder) 4157 if err != nil { 4158 var snapshot bytes.Buffer 4159 io.Copy(&snapshot, ringBuffer) 4160 err = &smithy.DeserializationError{ 4161 Err: fmt.Errorf("failed to decode response body, %w", err), 4162 Snapshot: snapshot.Bytes(), 4163 } 4164 return err 4165 } 4166 4167 errorBody.Seek(0, io.SeekStart) 4168 if len(code) != 0 { 4169 errorCode = restjson.SanitizeErrorCode(code) 4170 } 4171 if len(message) != 0 { 4172 errorMessage = message 4173 } 4174 4175 switch { 4176 case strings.EqualFold("DependencyException", errorCode): 4177 return awsRestjson1_deserializeErrorDependencyException(response, errorBody) 4178 4179 case strings.EqualFold("InvalidParameterException", errorCode): 4180 return awsRestjson1_deserializeErrorInvalidParameterException(response, errorBody) 4181 4182 case strings.EqualFold("ResourceNotFoundException", errorCode): 4183 return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) 4184 4185 default: 4186 genericError := &smithy.GenericAPIError{ 4187 Code: errorCode, 4188 Message: errorMessage, 4189 } 4190 return genericError 4191 4192 } 4193} 4194 4195func awsRestjson1_deserializeOpDocumentUpdateMissionProfileOutput(v **UpdateMissionProfileOutput, value interface{}) error { 4196 if v == nil { 4197 return fmt.Errorf("unexpected nil of type %T", v) 4198 } 4199 if value == nil { 4200 return nil 4201 } 4202 4203 shape, ok := value.(map[string]interface{}) 4204 if !ok { 4205 return fmt.Errorf("unexpected JSON type %v", value) 4206 } 4207 4208 var sv *UpdateMissionProfileOutput 4209 if *v == nil { 4210 sv = &UpdateMissionProfileOutput{} 4211 } else { 4212 sv = *v 4213 } 4214 4215 for key, value := range shape { 4216 switch key { 4217 case "missionProfileId": 4218 if value != nil { 4219 jtv, ok := value.(string) 4220 if !ok { 4221 return fmt.Errorf("expected String to be of type string, got %T instead", value) 4222 } 4223 sv.MissionProfileId = ptr.String(jtv) 4224 } 4225 4226 default: 4227 _, _ = key, value 4228 4229 } 4230 } 4231 *v = sv 4232 return nil 4233} 4234 4235func awsRestjson1_deserializeErrorDependencyException(response *smithyhttp.Response, errorBody *bytes.Reader) error { 4236 output := &types.DependencyException{} 4237 var buff [1024]byte 4238 ringBuffer := smithyio.NewRingBuffer(buff[:]) 4239 4240 body := io.TeeReader(errorBody, ringBuffer) 4241 decoder := json.NewDecoder(body) 4242 decoder.UseNumber() 4243 var shape interface{} 4244 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 4245 var snapshot bytes.Buffer 4246 io.Copy(&snapshot, ringBuffer) 4247 err = &smithy.DeserializationError{ 4248 Err: fmt.Errorf("failed to decode response body, %w", err), 4249 Snapshot: snapshot.Bytes(), 4250 } 4251 return err 4252 } 4253 4254 err := awsRestjson1_deserializeDocumentDependencyException(&output, shape) 4255 4256 if err != nil { 4257 var snapshot bytes.Buffer 4258 io.Copy(&snapshot, ringBuffer) 4259 err = &smithy.DeserializationError{ 4260 Err: fmt.Errorf("failed to decode response body, %w", err), 4261 Snapshot: snapshot.Bytes(), 4262 } 4263 return err 4264 } 4265 4266 errorBody.Seek(0, io.SeekStart) 4267 4268 return output 4269} 4270 4271func awsRestjson1_deserializeErrorInvalidParameterException(response *smithyhttp.Response, errorBody *bytes.Reader) error { 4272 output := &types.InvalidParameterException{} 4273 var buff [1024]byte 4274 ringBuffer := smithyio.NewRingBuffer(buff[:]) 4275 4276 body := io.TeeReader(errorBody, ringBuffer) 4277 decoder := json.NewDecoder(body) 4278 decoder.UseNumber() 4279 var shape interface{} 4280 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 4281 var snapshot bytes.Buffer 4282 io.Copy(&snapshot, ringBuffer) 4283 err = &smithy.DeserializationError{ 4284 Err: fmt.Errorf("failed to decode response body, %w", err), 4285 Snapshot: snapshot.Bytes(), 4286 } 4287 return err 4288 } 4289 4290 err := awsRestjson1_deserializeDocumentInvalidParameterException(&output, shape) 4291 4292 if err != nil { 4293 var snapshot bytes.Buffer 4294 io.Copy(&snapshot, ringBuffer) 4295 err = &smithy.DeserializationError{ 4296 Err: fmt.Errorf("failed to decode response body, %w", err), 4297 Snapshot: snapshot.Bytes(), 4298 } 4299 return err 4300 } 4301 4302 errorBody.Seek(0, io.SeekStart) 4303 4304 return output 4305} 4306 4307func awsRestjson1_deserializeErrorResourceLimitExceededException(response *smithyhttp.Response, errorBody *bytes.Reader) error { 4308 output := &types.ResourceLimitExceededException{} 4309 var buff [1024]byte 4310 ringBuffer := smithyio.NewRingBuffer(buff[:]) 4311 4312 body := io.TeeReader(errorBody, ringBuffer) 4313 decoder := json.NewDecoder(body) 4314 decoder.UseNumber() 4315 var shape interface{} 4316 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 4317 var snapshot bytes.Buffer 4318 io.Copy(&snapshot, ringBuffer) 4319 err = &smithy.DeserializationError{ 4320 Err: fmt.Errorf("failed to decode response body, %w", err), 4321 Snapshot: snapshot.Bytes(), 4322 } 4323 return err 4324 } 4325 4326 err := awsRestjson1_deserializeDocumentResourceLimitExceededException(&output, shape) 4327 4328 if err != nil { 4329 var snapshot bytes.Buffer 4330 io.Copy(&snapshot, ringBuffer) 4331 err = &smithy.DeserializationError{ 4332 Err: fmt.Errorf("failed to decode response body, %w", err), 4333 Snapshot: snapshot.Bytes(), 4334 } 4335 return err 4336 } 4337 4338 errorBody.Seek(0, io.SeekStart) 4339 4340 return output 4341} 4342 4343func awsRestjson1_deserializeErrorResourceNotFoundException(response *smithyhttp.Response, errorBody *bytes.Reader) error { 4344 output := &types.ResourceNotFoundException{} 4345 var buff [1024]byte 4346 ringBuffer := smithyio.NewRingBuffer(buff[:]) 4347 4348 body := io.TeeReader(errorBody, ringBuffer) 4349 decoder := json.NewDecoder(body) 4350 decoder.UseNumber() 4351 var shape interface{} 4352 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 4353 var snapshot bytes.Buffer 4354 io.Copy(&snapshot, ringBuffer) 4355 err = &smithy.DeserializationError{ 4356 Err: fmt.Errorf("failed to decode response body, %w", err), 4357 Snapshot: snapshot.Bytes(), 4358 } 4359 return err 4360 } 4361 4362 err := awsRestjson1_deserializeDocumentResourceNotFoundException(&output, shape) 4363 4364 if err != nil { 4365 var snapshot bytes.Buffer 4366 io.Copy(&snapshot, ringBuffer) 4367 err = &smithy.DeserializationError{ 4368 Err: fmt.Errorf("failed to decode response body, %w", err), 4369 Snapshot: snapshot.Bytes(), 4370 } 4371 return err 4372 } 4373 4374 errorBody.Seek(0, io.SeekStart) 4375 4376 return output 4377} 4378 4379func awsRestjson1_deserializeDocumentAntennaDemodDecodeDetails(v **types.AntennaDemodDecodeDetails, value interface{}) error { 4380 if v == nil { 4381 return fmt.Errorf("unexpected nil of type %T", v) 4382 } 4383 if value == nil { 4384 return nil 4385 } 4386 4387 shape, ok := value.(map[string]interface{}) 4388 if !ok { 4389 return fmt.Errorf("unexpected JSON type %v", value) 4390 } 4391 4392 var sv *types.AntennaDemodDecodeDetails 4393 if *v == nil { 4394 sv = &types.AntennaDemodDecodeDetails{} 4395 } else { 4396 sv = *v 4397 } 4398 4399 for key, value := range shape { 4400 switch key { 4401 case "outputNode": 4402 if value != nil { 4403 jtv, ok := value.(string) 4404 if !ok { 4405 return fmt.Errorf("expected String to be of type string, got %T instead", value) 4406 } 4407 sv.OutputNode = ptr.String(jtv) 4408 } 4409 4410 default: 4411 _, _ = key, value 4412 4413 } 4414 } 4415 *v = sv 4416 return nil 4417} 4418 4419func awsRestjson1_deserializeDocumentAntennaDownlinkConfig(v **types.AntennaDownlinkConfig, value interface{}) error { 4420 if v == nil { 4421 return fmt.Errorf("unexpected nil of type %T", v) 4422 } 4423 if value == nil { 4424 return nil 4425 } 4426 4427 shape, ok := value.(map[string]interface{}) 4428 if !ok { 4429 return fmt.Errorf("unexpected JSON type %v", value) 4430 } 4431 4432 var sv *types.AntennaDownlinkConfig 4433 if *v == nil { 4434 sv = &types.AntennaDownlinkConfig{} 4435 } else { 4436 sv = *v 4437 } 4438 4439 for key, value := range shape { 4440 switch key { 4441 case "spectrumConfig": 4442 if err := awsRestjson1_deserializeDocumentSpectrumConfig(&sv.SpectrumConfig, value); err != nil { 4443 return err 4444 } 4445 4446 default: 4447 _, _ = key, value 4448 4449 } 4450 } 4451 *v = sv 4452 return nil 4453} 4454 4455func awsRestjson1_deserializeDocumentAntennaDownlinkDemodDecodeConfig(v **types.AntennaDownlinkDemodDecodeConfig, value interface{}) error { 4456 if v == nil { 4457 return fmt.Errorf("unexpected nil of type %T", v) 4458 } 4459 if value == nil { 4460 return nil 4461 } 4462 4463 shape, ok := value.(map[string]interface{}) 4464 if !ok { 4465 return fmt.Errorf("unexpected JSON type %v", value) 4466 } 4467 4468 var sv *types.AntennaDownlinkDemodDecodeConfig 4469 if *v == nil { 4470 sv = &types.AntennaDownlinkDemodDecodeConfig{} 4471 } else { 4472 sv = *v 4473 } 4474 4475 for key, value := range shape { 4476 switch key { 4477 case "decodeConfig": 4478 if err := awsRestjson1_deserializeDocumentDecodeConfig(&sv.DecodeConfig, value); err != nil { 4479 return err 4480 } 4481 4482 case "demodulationConfig": 4483 if err := awsRestjson1_deserializeDocumentDemodulationConfig(&sv.DemodulationConfig, value); err != nil { 4484 return err 4485 } 4486 4487 case "spectrumConfig": 4488 if err := awsRestjson1_deserializeDocumentSpectrumConfig(&sv.SpectrumConfig, value); err != nil { 4489 return err 4490 } 4491 4492 default: 4493 _, _ = key, value 4494 4495 } 4496 } 4497 *v = sv 4498 return nil 4499} 4500 4501func awsRestjson1_deserializeDocumentAntennaUplinkConfig(v **types.AntennaUplinkConfig, value interface{}) error { 4502 if v == nil { 4503 return fmt.Errorf("unexpected nil of type %T", v) 4504 } 4505 if value == nil { 4506 return nil 4507 } 4508 4509 shape, ok := value.(map[string]interface{}) 4510 if !ok { 4511 return fmt.Errorf("unexpected JSON type %v", value) 4512 } 4513 4514 var sv *types.AntennaUplinkConfig 4515 if *v == nil { 4516 sv = &types.AntennaUplinkConfig{} 4517 } else { 4518 sv = *v 4519 } 4520 4521 for key, value := range shape { 4522 switch key { 4523 case "spectrumConfig": 4524 if err := awsRestjson1_deserializeDocumentUplinkSpectrumConfig(&sv.SpectrumConfig, value); err != nil { 4525 return err 4526 } 4527 4528 case "targetEirp": 4529 if err := awsRestjson1_deserializeDocumentEirp(&sv.TargetEirp, value); err != nil { 4530 return err 4531 } 4532 4533 case "transmitDisabled": 4534 if value != nil { 4535 jtv, ok := value.(bool) 4536 if !ok { 4537 return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) 4538 } 4539 sv.TransmitDisabled = ptr.Bool(jtv) 4540 } 4541 4542 default: 4543 _, _ = key, value 4544 4545 } 4546 } 4547 *v = sv 4548 return nil 4549} 4550 4551func awsRestjson1_deserializeDocumentConfigDetails(v *types.ConfigDetails, value interface{}) error { 4552 if v == nil { 4553 return fmt.Errorf("unexpected nil of type %T", v) 4554 } 4555 if value == nil { 4556 return nil 4557 } 4558 4559 shape, ok := value.(map[string]interface{}) 4560 if !ok { 4561 return fmt.Errorf("unexpected JSON type %v", value) 4562 } 4563 4564 var uv types.ConfigDetails 4565loop: 4566 for key, value := range shape { 4567 if value == nil { 4568 continue 4569 } 4570 switch key { 4571 case "antennaDemodDecodeDetails": 4572 var mv types.AntennaDemodDecodeDetails 4573 destAddr := &mv 4574 if err := awsRestjson1_deserializeDocumentAntennaDemodDecodeDetails(&destAddr, value); err != nil { 4575 return err 4576 } 4577 mv = *destAddr 4578 uv = &types.ConfigDetailsMemberAntennaDemodDecodeDetails{Value: mv} 4579 break loop 4580 4581 case "endpointDetails": 4582 var mv types.EndpointDetails 4583 destAddr := &mv 4584 if err := awsRestjson1_deserializeDocumentEndpointDetails(&destAddr, value); err != nil { 4585 return err 4586 } 4587 mv = *destAddr 4588 uv = &types.ConfigDetailsMemberEndpointDetails{Value: mv} 4589 break loop 4590 4591 case "s3RecordingDetails": 4592 var mv types.S3RecordingDetails 4593 destAddr := &mv 4594 if err := awsRestjson1_deserializeDocumentS3RecordingDetails(&destAddr, value); err != nil { 4595 return err 4596 } 4597 mv = *destAddr 4598 uv = &types.ConfigDetailsMemberS3RecordingDetails{Value: mv} 4599 break loop 4600 4601 default: 4602 uv = &types.UnknownUnionMember{Tag: key} 4603 break loop 4604 4605 } 4606 } 4607 *v = uv 4608 return nil 4609} 4610 4611func awsRestjson1_deserializeDocumentConfigList(v *[]types.ConfigListItem, value interface{}) error { 4612 if v == nil { 4613 return fmt.Errorf("unexpected nil of type %T", v) 4614 } 4615 if value == nil { 4616 return nil 4617 } 4618 4619 shape, ok := value.([]interface{}) 4620 if !ok { 4621 return fmt.Errorf("unexpected JSON type %v", value) 4622 } 4623 4624 var cv []types.ConfigListItem 4625 if *v == nil { 4626 cv = []types.ConfigListItem{} 4627 } else { 4628 cv = *v 4629 } 4630 4631 for _, value := range shape { 4632 var col types.ConfigListItem 4633 destAddr := &col 4634 if err := awsRestjson1_deserializeDocumentConfigListItem(&destAddr, value); err != nil { 4635 return err 4636 } 4637 col = *destAddr 4638 cv = append(cv, col) 4639 4640 } 4641 *v = cv 4642 return nil 4643} 4644 4645func awsRestjson1_deserializeDocumentConfigListItem(v **types.ConfigListItem, value interface{}) error { 4646 if v == nil { 4647 return fmt.Errorf("unexpected nil of type %T", v) 4648 } 4649 if value == nil { 4650 return nil 4651 } 4652 4653 shape, ok := value.(map[string]interface{}) 4654 if !ok { 4655 return fmt.Errorf("unexpected JSON type %v", value) 4656 } 4657 4658 var sv *types.ConfigListItem 4659 if *v == nil { 4660 sv = &types.ConfigListItem{} 4661 } else { 4662 sv = *v 4663 } 4664 4665 for key, value := range shape { 4666 switch key { 4667 case "configArn": 4668 if value != nil { 4669 jtv, ok := value.(string) 4670 if !ok { 4671 return fmt.Errorf("expected ConfigArn to be of type string, got %T instead", value) 4672 } 4673 sv.ConfigArn = ptr.String(jtv) 4674 } 4675 4676 case "configId": 4677 if value != nil { 4678 jtv, ok := value.(string) 4679 if !ok { 4680 return fmt.Errorf("expected String to be of type string, got %T instead", value) 4681 } 4682 sv.ConfigId = ptr.String(jtv) 4683 } 4684 4685 case "configType": 4686 if value != nil { 4687 jtv, ok := value.(string) 4688 if !ok { 4689 return fmt.Errorf("expected ConfigCapabilityType to be of type string, got %T instead", value) 4690 } 4691 sv.ConfigType = types.ConfigCapabilityType(jtv) 4692 } 4693 4694 case "name": 4695 if value != nil { 4696 jtv, ok := value.(string) 4697 if !ok { 4698 return fmt.Errorf("expected String to be of type string, got %T instead", value) 4699 } 4700 sv.Name = ptr.String(jtv) 4701 } 4702 4703 default: 4704 _, _ = key, value 4705 4706 } 4707 } 4708 *v = sv 4709 return nil 4710} 4711 4712func awsRestjson1_deserializeDocumentConfigTypeData(v *types.ConfigTypeData, 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 uv types.ConfigTypeData 4726loop: 4727 for key, value := range shape { 4728 if value == nil { 4729 continue 4730 } 4731 switch key { 4732 case "antennaDownlinkConfig": 4733 var mv types.AntennaDownlinkConfig 4734 destAddr := &mv 4735 if err := awsRestjson1_deserializeDocumentAntennaDownlinkConfig(&destAddr, value); err != nil { 4736 return err 4737 } 4738 mv = *destAddr 4739 uv = &types.ConfigTypeDataMemberAntennaDownlinkConfig{Value: mv} 4740 break loop 4741 4742 case "antennaDownlinkDemodDecodeConfig": 4743 var mv types.AntennaDownlinkDemodDecodeConfig 4744 destAddr := &mv 4745 if err := awsRestjson1_deserializeDocumentAntennaDownlinkDemodDecodeConfig(&destAddr, value); err != nil { 4746 return err 4747 } 4748 mv = *destAddr 4749 uv = &types.ConfigTypeDataMemberAntennaDownlinkDemodDecodeConfig{Value: mv} 4750 break loop 4751 4752 case "antennaUplinkConfig": 4753 var mv types.AntennaUplinkConfig 4754 destAddr := &mv 4755 if err := awsRestjson1_deserializeDocumentAntennaUplinkConfig(&destAddr, value); err != nil { 4756 return err 4757 } 4758 mv = *destAddr 4759 uv = &types.ConfigTypeDataMemberAntennaUplinkConfig{Value: mv} 4760 break loop 4761 4762 case "dataflowEndpointConfig": 4763 var mv types.DataflowEndpointConfig 4764 destAddr := &mv 4765 if err := awsRestjson1_deserializeDocumentDataflowEndpointConfig(&destAddr, value); err != nil { 4766 return err 4767 } 4768 mv = *destAddr 4769 uv = &types.ConfigTypeDataMemberDataflowEndpointConfig{Value: mv} 4770 break loop 4771 4772 case "s3RecordingConfig": 4773 var mv types.S3RecordingConfig 4774 destAddr := &mv 4775 if err := awsRestjson1_deserializeDocumentS3RecordingConfig(&destAddr, value); err != nil { 4776 return err 4777 } 4778 mv = *destAddr 4779 uv = &types.ConfigTypeDataMemberS3RecordingConfig{Value: mv} 4780 break loop 4781 4782 case "trackingConfig": 4783 var mv types.TrackingConfig 4784 destAddr := &mv 4785 if err := awsRestjson1_deserializeDocumentTrackingConfig(&destAddr, value); err != nil { 4786 return err 4787 } 4788 mv = *destAddr 4789 uv = &types.ConfigTypeDataMemberTrackingConfig{Value: mv} 4790 break loop 4791 4792 case "uplinkEchoConfig": 4793 var mv types.UplinkEchoConfig 4794 destAddr := &mv 4795 if err := awsRestjson1_deserializeDocumentUplinkEchoConfig(&destAddr, value); err != nil { 4796 return err 4797 } 4798 mv = *destAddr 4799 uv = &types.ConfigTypeDataMemberUplinkEchoConfig{Value: mv} 4800 break loop 4801 4802 default: 4803 uv = &types.UnknownUnionMember{Tag: key} 4804 break loop 4805 4806 } 4807 } 4808 *v = uv 4809 return nil 4810} 4811 4812func awsRestjson1_deserializeDocumentContactData(v **types.ContactData, value interface{}) error { 4813 if v == nil { 4814 return fmt.Errorf("unexpected nil of type %T", v) 4815 } 4816 if value == nil { 4817 return nil 4818 } 4819 4820 shape, ok := value.(map[string]interface{}) 4821 if !ok { 4822 return fmt.Errorf("unexpected JSON type %v", value) 4823 } 4824 4825 var sv *types.ContactData 4826 if *v == nil { 4827 sv = &types.ContactData{} 4828 } else { 4829 sv = *v 4830 } 4831 4832 for key, value := range shape { 4833 switch key { 4834 case "contactId": 4835 if value != nil { 4836 jtv, ok := value.(string) 4837 if !ok { 4838 return fmt.Errorf("expected String to be of type string, got %T instead", value) 4839 } 4840 sv.ContactId = ptr.String(jtv) 4841 } 4842 4843 case "contactStatus": 4844 if value != nil { 4845 jtv, ok := value.(string) 4846 if !ok { 4847 return fmt.Errorf("expected ContactStatus to be of type string, got %T instead", value) 4848 } 4849 sv.ContactStatus = types.ContactStatus(jtv) 4850 } 4851 4852 case "endTime": 4853 if value != nil { 4854 jtv, ok := value.(json.Number) 4855 if !ok { 4856 return fmt.Errorf("expected Timestamp to be json.Number, got %T instead", value) 4857 } 4858 f64, err := jtv.Float64() 4859 if err != nil { 4860 return err 4861 } 4862 sv.EndTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) 4863 } 4864 4865 case "errorMessage": 4866 if value != nil { 4867 jtv, ok := value.(string) 4868 if !ok { 4869 return fmt.Errorf("expected String to be of type string, got %T instead", value) 4870 } 4871 sv.ErrorMessage = ptr.String(jtv) 4872 } 4873 4874 case "groundStation": 4875 if value != nil { 4876 jtv, ok := value.(string) 4877 if !ok { 4878 return fmt.Errorf("expected String to be of type string, got %T instead", value) 4879 } 4880 sv.GroundStation = ptr.String(jtv) 4881 } 4882 4883 case "maximumElevation": 4884 if err := awsRestjson1_deserializeDocumentElevation(&sv.MaximumElevation, value); err != nil { 4885 return err 4886 } 4887 4888 case "missionProfileArn": 4889 if value != nil { 4890 jtv, ok := value.(string) 4891 if !ok { 4892 return fmt.Errorf("expected MissionProfileArn to be of type string, got %T instead", value) 4893 } 4894 sv.MissionProfileArn = ptr.String(jtv) 4895 } 4896 4897 case "postPassEndTime": 4898 if value != nil { 4899 jtv, ok := value.(json.Number) 4900 if !ok { 4901 return fmt.Errorf("expected Timestamp to be json.Number, got %T instead", value) 4902 } 4903 f64, err := jtv.Float64() 4904 if err != nil { 4905 return err 4906 } 4907 sv.PostPassEndTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) 4908 } 4909 4910 case "prePassStartTime": 4911 if value != nil { 4912 jtv, ok := value.(json.Number) 4913 if !ok { 4914 return fmt.Errorf("expected Timestamp to be json.Number, got %T instead", value) 4915 } 4916 f64, err := jtv.Float64() 4917 if err != nil { 4918 return err 4919 } 4920 sv.PrePassStartTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) 4921 } 4922 4923 case "region": 4924 if value != nil { 4925 jtv, ok := value.(string) 4926 if !ok { 4927 return fmt.Errorf("expected String to be of type string, got %T instead", value) 4928 } 4929 sv.Region = ptr.String(jtv) 4930 } 4931 4932 case "satelliteArn": 4933 if value != nil { 4934 jtv, ok := value.(string) 4935 if !ok { 4936 return fmt.Errorf("expected satelliteArn to be of type string, got %T instead", value) 4937 } 4938 sv.SatelliteArn = ptr.String(jtv) 4939 } 4940 4941 case "startTime": 4942 if value != nil { 4943 jtv, ok := value.(json.Number) 4944 if !ok { 4945 return fmt.Errorf("expected Timestamp to be json.Number, got %T instead", value) 4946 } 4947 f64, err := jtv.Float64() 4948 if err != nil { 4949 return err 4950 } 4951 sv.StartTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) 4952 } 4953 4954 case "tags": 4955 if err := awsRestjson1_deserializeDocumentTagsMap(&sv.Tags, value); err != nil { 4956 return err 4957 } 4958 4959 default: 4960 _, _ = key, value 4961 4962 } 4963 } 4964 *v = sv 4965 return nil 4966} 4967 4968func awsRestjson1_deserializeDocumentContactList(v *[]types.ContactData, value interface{}) error { 4969 if v == nil { 4970 return fmt.Errorf("unexpected nil of type %T", v) 4971 } 4972 if value == nil { 4973 return nil 4974 } 4975 4976 shape, ok := value.([]interface{}) 4977 if !ok { 4978 return fmt.Errorf("unexpected JSON type %v", value) 4979 } 4980 4981 var cv []types.ContactData 4982 if *v == nil { 4983 cv = []types.ContactData{} 4984 } else { 4985 cv = *v 4986 } 4987 4988 for _, value := range shape { 4989 var col types.ContactData 4990 destAddr := &col 4991 if err := awsRestjson1_deserializeDocumentContactData(&destAddr, value); err != nil { 4992 return err 4993 } 4994 col = *destAddr 4995 cv = append(cv, col) 4996 4997 } 4998 *v = cv 4999 return nil 5000} 5001 5002func awsRestjson1_deserializeDocumentDataflowDetail(v **types.DataflowDetail, value interface{}) error { 5003 if v == nil { 5004 return fmt.Errorf("unexpected nil of type %T", v) 5005 } 5006 if value == nil { 5007 return nil 5008 } 5009 5010 shape, ok := value.(map[string]interface{}) 5011 if !ok { 5012 return fmt.Errorf("unexpected JSON type %v", value) 5013 } 5014 5015 var sv *types.DataflowDetail 5016 if *v == nil { 5017 sv = &types.DataflowDetail{} 5018 } else { 5019 sv = *v 5020 } 5021 5022 for key, value := range shape { 5023 switch key { 5024 case "destination": 5025 if err := awsRestjson1_deserializeDocumentDestination(&sv.Destination, value); err != nil { 5026 return err 5027 } 5028 5029 case "errorMessage": 5030 if value != nil { 5031 jtv, ok := value.(string) 5032 if !ok { 5033 return fmt.Errorf("expected String to be of type string, got %T instead", value) 5034 } 5035 sv.ErrorMessage = ptr.String(jtv) 5036 } 5037 5038 case "source": 5039 if err := awsRestjson1_deserializeDocumentSource(&sv.Source, value); err != nil { 5040 return err 5041 } 5042 5043 default: 5044 _, _ = key, value 5045 5046 } 5047 } 5048 *v = sv 5049 return nil 5050} 5051 5052func awsRestjson1_deserializeDocumentDataflowEdge(v *[]string, value interface{}) error { 5053 if v == nil { 5054 return fmt.Errorf("unexpected nil of type %T", v) 5055 } 5056 if value == nil { 5057 return nil 5058 } 5059 5060 shape, ok := value.([]interface{}) 5061 if !ok { 5062 return fmt.Errorf("unexpected JSON type %v", value) 5063 } 5064 5065 var cv []string 5066 if *v == nil { 5067 cv = []string{} 5068 } else { 5069 cv = *v 5070 } 5071 5072 for _, value := range shape { 5073 var col string 5074 if value != nil { 5075 jtv, ok := value.(string) 5076 if !ok { 5077 return fmt.Errorf("expected ConfigArn to be of type string, got %T instead", value) 5078 } 5079 col = jtv 5080 } 5081 cv = append(cv, col) 5082 5083 } 5084 *v = cv 5085 return nil 5086} 5087 5088func awsRestjson1_deserializeDocumentDataflowEdgeList(v *[][]string, value interface{}) error { 5089 if v == nil { 5090 return fmt.Errorf("unexpected nil of type %T", v) 5091 } 5092 if value == nil { 5093 return nil 5094 } 5095 5096 shape, ok := value.([]interface{}) 5097 if !ok { 5098 return fmt.Errorf("unexpected JSON type %v", value) 5099 } 5100 5101 var cv [][]string 5102 if *v == nil { 5103 cv = [][]string{} 5104 } else { 5105 cv = *v 5106 } 5107 5108 for _, value := range shape { 5109 var col []string 5110 if err := awsRestjson1_deserializeDocumentDataflowEdge(&col, value); err != nil { 5111 return err 5112 } 5113 cv = append(cv, col) 5114 5115 } 5116 *v = cv 5117 return nil 5118} 5119 5120func awsRestjson1_deserializeDocumentDataflowEndpoint(v **types.DataflowEndpoint, value interface{}) error { 5121 if v == nil { 5122 return fmt.Errorf("unexpected nil of type %T", v) 5123 } 5124 if value == nil { 5125 return nil 5126 } 5127 5128 shape, ok := value.(map[string]interface{}) 5129 if !ok { 5130 return fmt.Errorf("unexpected JSON type %v", value) 5131 } 5132 5133 var sv *types.DataflowEndpoint 5134 if *v == nil { 5135 sv = &types.DataflowEndpoint{} 5136 } else { 5137 sv = *v 5138 } 5139 5140 for key, value := range shape { 5141 switch key { 5142 case "address": 5143 if err := awsRestjson1_deserializeDocumentSocketAddress(&sv.Address, value); err != nil { 5144 return err 5145 } 5146 5147 case "mtu": 5148 if value != nil { 5149 jtv, ok := value.(json.Number) 5150 if !ok { 5151 return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) 5152 } 5153 i64, err := jtv.Int64() 5154 if err != nil { 5155 return err 5156 } 5157 sv.Mtu = ptr.Int32(int32(i64)) 5158 } 5159 5160 case "name": 5161 if value != nil { 5162 jtv, ok := value.(string) 5163 if !ok { 5164 return fmt.Errorf("expected SafeName to be of type string, got %T instead", value) 5165 } 5166 sv.Name = ptr.String(jtv) 5167 } 5168 5169 case "status": 5170 if value != nil { 5171 jtv, ok := value.(string) 5172 if !ok { 5173 return fmt.Errorf("expected EndpointStatus to be of type string, got %T instead", value) 5174 } 5175 sv.Status = types.EndpointStatus(jtv) 5176 } 5177 5178 default: 5179 _, _ = key, value 5180 5181 } 5182 } 5183 *v = sv 5184 return nil 5185} 5186 5187func awsRestjson1_deserializeDocumentDataflowEndpointConfig(v **types.DataflowEndpointConfig, value interface{}) error { 5188 if v == nil { 5189 return fmt.Errorf("unexpected nil of type %T", v) 5190 } 5191 if value == nil { 5192 return nil 5193 } 5194 5195 shape, ok := value.(map[string]interface{}) 5196 if !ok { 5197 return fmt.Errorf("unexpected JSON type %v", value) 5198 } 5199 5200 var sv *types.DataflowEndpointConfig 5201 if *v == nil { 5202 sv = &types.DataflowEndpointConfig{} 5203 } else { 5204 sv = *v 5205 } 5206 5207 for key, value := range shape { 5208 switch key { 5209 case "dataflowEndpointName": 5210 if value != nil { 5211 jtv, ok := value.(string) 5212 if !ok { 5213 return fmt.Errorf("expected String to be of type string, got %T instead", value) 5214 } 5215 sv.DataflowEndpointName = ptr.String(jtv) 5216 } 5217 5218 case "dataflowEndpointRegion": 5219 if value != nil { 5220 jtv, ok := value.(string) 5221 if !ok { 5222 return fmt.Errorf("expected String to be of type string, got %T instead", value) 5223 } 5224 sv.DataflowEndpointRegion = ptr.String(jtv) 5225 } 5226 5227 default: 5228 _, _ = key, value 5229 5230 } 5231 } 5232 *v = sv 5233 return nil 5234} 5235 5236func awsRestjson1_deserializeDocumentDataflowEndpointGroupList(v *[]types.DataflowEndpointListItem, value interface{}) error { 5237 if v == nil { 5238 return fmt.Errorf("unexpected nil of type %T", v) 5239 } 5240 if value == nil { 5241 return nil 5242 } 5243 5244 shape, ok := value.([]interface{}) 5245 if !ok { 5246 return fmt.Errorf("unexpected JSON type %v", value) 5247 } 5248 5249 var cv []types.DataflowEndpointListItem 5250 if *v == nil { 5251 cv = []types.DataflowEndpointListItem{} 5252 } else { 5253 cv = *v 5254 } 5255 5256 for _, value := range shape { 5257 var col types.DataflowEndpointListItem 5258 destAddr := &col 5259 if err := awsRestjson1_deserializeDocumentDataflowEndpointListItem(&destAddr, value); err != nil { 5260 return err 5261 } 5262 col = *destAddr 5263 cv = append(cv, col) 5264 5265 } 5266 *v = cv 5267 return nil 5268} 5269 5270func awsRestjson1_deserializeDocumentDataflowEndpointListItem(v **types.DataflowEndpointListItem, value interface{}) error { 5271 if v == nil { 5272 return fmt.Errorf("unexpected nil of type %T", v) 5273 } 5274 if value == nil { 5275 return nil 5276 } 5277 5278 shape, ok := value.(map[string]interface{}) 5279 if !ok { 5280 return fmt.Errorf("unexpected JSON type %v", value) 5281 } 5282 5283 var sv *types.DataflowEndpointListItem 5284 if *v == nil { 5285 sv = &types.DataflowEndpointListItem{} 5286 } else { 5287 sv = *v 5288 } 5289 5290 for key, value := range shape { 5291 switch key { 5292 case "dataflowEndpointGroupArn": 5293 if value != nil { 5294 jtv, ok := value.(string) 5295 if !ok { 5296 return fmt.Errorf("expected DataflowEndpointGroupArn to be of type string, got %T instead", value) 5297 } 5298 sv.DataflowEndpointGroupArn = ptr.String(jtv) 5299 } 5300 5301 case "dataflowEndpointGroupId": 5302 if value != nil { 5303 jtv, ok := value.(string) 5304 if !ok { 5305 return fmt.Errorf("expected String to be of type string, got %T instead", value) 5306 } 5307 sv.DataflowEndpointGroupId = ptr.String(jtv) 5308 } 5309 5310 default: 5311 _, _ = key, value 5312 5313 } 5314 } 5315 *v = sv 5316 return nil 5317} 5318 5319func awsRestjson1_deserializeDocumentDataflowList(v *[]types.DataflowDetail, value interface{}) error { 5320 if v == nil { 5321 return fmt.Errorf("unexpected nil of type %T", v) 5322 } 5323 if value == nil { 5324 return nil 5325 } 5326 5327 shape, ok := value.([]interface{}) 5328 if !ok { 5329 return fmt.Errorf("unexpected JSON type %v", value) 5330 } 5331 5332 var cv []types.DataflowDetail 5333 if *v == nil { 5334 cv = []types.DataflowDetail{} 5335 } else { 5336 cv = *v 5337 } 5338 5339 for _, value := range shape { 5340 var col types.DataflowDetail 5341 destAddr := &col 5342 if err := awsRestjson1_deserializeDocumentDataflowDetail(&destAddr, value); err != nil { 5343 return err 5344 } 5345 col = *destAddr 5346 cv = append(cv, col) 5347 5348 } 5349 *v = cv 5350 return nil 5351} 5352 5353func awsRestjson1_deserializeDocumentDecodeConfig(v **types.DecodeConfig, value interface{}) error { 5354 if v == nil { 5355 return fmt.Errorf("unexpected nil of type %T", v) 5356 } 5357 if value == nil { 5358 return nil 5359 } 5360 5361 shape, ok := value.(map[string]interface{}) 5362 if !ok { 5363 return fmt.Errorf("unexpected JSON type %v", value) 5364 } 5365 5366 var sv *types.DecodeConfig 5367 if *v == nil { 5368 sv = &types.DecodeConfig{} 5369 } else { 5370 sv = *v 5371 } 5372 5373 for key, value := range shape { 5374 switch key { 5375 case "unvalidatedJSON": 5376 if value != nil { 5377 jtv, ok := value.(string) 5378 if !ok { 5379 return fmt.Errorf("expected JsonString to be of type string, got %T instead", value) 5380 } 5381 sv.UnvalidatedJSON = ptr.String(jtv) 5382 } 5383 5384 default: 5385 _, _ = key, value 5386 5387 } 5388 } 5389 *v = sv 5390 return nil 5391} 5392 5393func awsRestjson1_deserializeDocumentDemodulationConfig(v **types.DemodulationConfig, value interface{}) error { 5394 if v == nil { 5395 return fmt.Errorf("unexpected nil of type %T", v) 5396 } 5397 if value == nil { 5398 return nil 5399 } 5400 5401 shape, ok := value.(map[string]interface{}) 5402 if !ok { 5403 return fmt.Errorf("unexpected JSON type %v", value) 5404 } 5405 5406 var sv *types.DemodulationConfig 5407 if *v == nil { 5408 sv = &types.DemodulationConfig{} 5409 } else { 5410 sv = *v 5411 } 5412 5413 for key, value := range shape { 5414 switch key { 5415 case "unvalidatedJSON": 5416 if value != nil { 5417 jtv, ok := value.(string) 5418 if !ok { 5419 return fmt.Errorf("expected JsonString to be of type string, got %T instead", value) 5420 } 5421 sv.UnvalidatedJSON = ptr.String(jtv) 5422 } 5423 5424 default: 5425 _, _ = key, value 5426 5427 } 5428 } 5429 *v = sv 5430 return nil 5431} 5432 5433func awsRestjson1_deserializeDocumentDependencyException(v **types.DependencyException, value interface{}) error { 5434 if v == nil { 5435 return fmt.Errorf("unexpected nil of type %T", v) 5436 } 5437 if value == nil { 5438 return nil 5439 } 5440 5441 shape, ok := value.(map[string]interface{}) 5442 if !ok { 5443 return fmt.Errorf("unexpected JSON type %v", value) 5444 } 5445 5446 var sv *types.DependencyException 5447 if *v == nil { 5448 sv = &types.DependencyException{} 5449 } else { 5450 sv = *v 5451 } 5452 5453 for key, value := range shape { 5454 switch key { 5455 case "message": 5456 if value != nil { 5457 jtv, ok := value.(string) 5458 if !ok { 5459 return fmt.Errorf("expected String to be of type string, got %T instead", value) 5460 } 5461 sv.Message = ptr.String(jtv) 5462 } 5463 5464 case "parameterName": 5465 if value != nil { 5466 jtv, ok := value.(string) 5467 if !ok { 5468 return fmt.Errorf("expected String to be of type string, got %T instead", value) 5469 } 5470 sv.ParameterName = ptr.String(jtv) 5471 } 5472 5473 default: 5474 _, _ = key, value 5475 5476 } 5477 } 5478 *v = sv 5479 return nil 5480} 5481 5482func awsRestjson1_deserializeDocumentDestination(v **types.Destination, value interface{}) error { 5483 if v == nil { 5484 return fmt.Errorf("unexpected nil of type %T", v) 5485 } 5486 if value == nil { 5487 return nil 5488 } 5489 5490 shape, ok := value.(map[string]interface{}) 5491 if !ok { 5492 return fmt.Errorf("unexpected JSON type %v", value) 5493 } 5494 5495 var sv *types.Destination 5496 if *v == nil { 5497 sv = &types.Destination{} 5498 } else { 5499 sv = *v 5500 } 5501 5502 for key, value := range shape { 5503 switch key { 5504 case "configDetails": 5505 if err := awsRestjson1_deserializeDocumentConfigDetails(&sv.ConfigDetails, value); err != nil { 5506 return err 5507 } 5508 5509 case "configId": 5510 if value != nil { 5511 jtv, ok := value.(string) 5512 if !ok { 5513 return fmt.Errorf("expected String to be of type string, got %T instead", value) 5514 } 5515 sv.ConfigId = ptr.String(jtv) 5516 } 5517 5518 case "configType": 5519 if value != nil { 5520 jtv, ok := value.(string) 5521 if !ok { 5522 return fmt.Errorf("expected ConfigCapabilityType to be of type string, got %T instead", value) 5523 } 5524 sv.ConfigType = types.ConfigCapabilityType(jtv) 5525 } 5526 5527 case "dataflowDestinationRegion": 5528 if value != nil { 5529 jtv, ok := value.(string) 5530 if !ok { 5531 return fmt.Errorf("expected String to be of type string, got %T instead", value) 5532 } 5533 sv.DataflowDestinationRegion = ptr.String(jtv) 5534 } 5535 5536 default: 5537 _, _ = key, value 5538 5539 } 5540 } 5541 *v = sv 5542 return nil 5543} 5544 5545func awsRestjson1_deserializeDocumentEirp(v **types.Eirp, value interface{}) error { 5546 if v == nil { 5547 return fmt.Errorf("unexpected nil of type %T", v) 5548 } 5549 if value == nil { 5550 return nil 5551 } 5552 5553 shape, ok := value.(map[string]interface{}) 5554 if !ok { 5555 return fmt.Errorf("unexpected JSON type %v", value) 5556 } 5557 5558 var sv *types.Eirp 5559 if *v == nil { 5560 sv = &types.Eirp{} 5561 } else { 5562 sv = *v 5563 } 5564 5565 for key, value := range shape { 5566 switch key { 5567 case "units": 5568 if value != nil { 5569 jtv, ok := value.(string) 5570 if !ok { 5571 return fmt.Errorf("expected EirpUnits to be of type string, got %T instead", value) 5572 } 5573 sv.Units = types.EirpUnits(jtv) 5574 } 5575 5576 case "value": 5577 if value != nil { 5578 jtv, ok := value.(json.Number) 5579 if !ok { 5580 return fmt.Errorf("expected Double to be json.Number, got %T instead", value) 5581 } 5582 f64, err := jtv.Float64() 5583 if err != nil { 5584 return err 5585 } 5586 sv.Value = ptr.Float64(f64) 5587 } 5588 5589 default: 5590 _, _ = key, value 5591 5592 } 5593 } 5594 *v = sv 5595 return nil 5596} 5597 5598func awsRestjson1_deserializeDocumentElevation(v **types.Elevation, value interface{}) error { 5599 if v == nil { 5600 return fmt.Errorf("unexpected nil of type %T", v) 5601 } 5602 if value == nil { 5603 return nil 5604 } 5605 5606 shape, ok := value.(map[string]interface{}) 5607 if !ok { 5608 return fmt.Errorf("unexpected JSON type %v", value) 5609 } 5610 5611 var sv *types.Elevation 5612 if *v == nil { 5613 sv = &types.Elevation{} 5614 } else { 5615 sv = *v 5616 } 5617 5618 for key, value := range shape { 5619 switch key { 5620 case "unit": 5621 if value != nil { 5622 jtv, ok := value.(string) 5623 if !ok { 5624 return fmt.Errorf("expected AngleUnits to be of type string, got %T instead", value) 5625 } 5626 sv.Unit = types.AngleUnits(jtv) 5627 } 5628 5629 case "value": 5630 if value != nil { 5631 jtv, ok := value.(json.Number) 5632 if !ok { 5633 return fmt.Errorf("expected Double to be json.Number, got %T instead", value) 5634 } 5635 f64, err := jtv.Float64() 5636 if err != nil { 5637 return err 5638 } 5639 sv.Value = ptr.Float64(f64) 5640 } 5641 5642 default: 5643 _, _ = key, value 5644 5645 } 5646 } 5647 *v = sv 5648 return nil 5649} 5650 5651func awsRestjson1_deserializeDocumentEndpointDetails(v **types.EndpointDetails, value interface{}) error { 5652 if v == nil { 5653 return fmt.Errorf("unexpected nil of type %T", v) 5654 } 5655 if value == nil { 5656 return nil 5657 } 5658 5659 shape, ok := value.(map[string]interface{}) 5660 if !ok { 5661 return fmt.Errorf("unexpected JSON type %v", value) 5662 } 5663 5664 var sv *types.EndpointDetails 5665 if *v == nil { 5666 sv = &types.EndpointDetails{} 5667 } else { 5668 sv = *v 5669 } 5670 5671 for key, value := range shape { 5672 switch key { 5673 case "endpoint": 5674 if err := awsRestjson1_deserializeDocumentDataflowEndpoint(&sv.Endpoint, value); err != nil { 5675 return err 5676 } 5677 5678 case "securityDetails": 5679 if err := awsRestjson1_deserializeDocumentSecurityDetails(&sv.SecurityDetails, value); err != nil { 5680 return err 5681 } 5682 5683 default: 5684 _, _ = key, value 5685 5686 } 5687 } 5688 *v = sv 5689 return nil 5690} 5691 5692func awsRestjson1_deserializeDocumentEndpointDetailsList(v *[]types.EndpointDetails, value interface{}) error { 5693 if v == nil { 5694 return fmt.Errorf("unexpected nil of type %T", v) 5695 } 5696 if value == nil { 5697 return nil 5698 } 5699 5700 shape, ok := value.([]interface{}) 5701 if !ok { 5702 return fmt.Errorf("unexpected JSON type %v", value) 5703 } 5704 5705 var cv []types.EndpointDetails 5706 if *v == nil { 5707 cv = []types.EndpointDetails{} 5708 } else { 5709 cv = *v 5710 } 5711 5712 for _, value := range shape { 5713 var col types.EndpointDetails 5714 destAddr := &col 5715 if err := awsRestjson1_deserializeDocumentEndpointDetails(&destAddr, value); err != nil { 5716 return err 5717 } 5718 col = *destAddr 5719 cv = append(cv, col) 5720 5721 } 5722 *v = cv 5723 return nil 5724} 5725 5726func awsRestjson1_deserializeDocumentFrequency(v **types.Frequency, value interface{}) error { 5727 if v == nil { 5728 return fmt.Errorf("unexpected nil of type %T", v) 5729 } 5730 if value == nil { 5731 return nil 5732 } 5733 5734 shape, ok := value.(map[string]interface{}) 5735 if !ok { 5736 return fmt.Errorf("unexpected JSON type %v", value) 5737 } 5738 5739 var sv *types.Frequency 5740 if *v == nil { 5741 sv = &types.Frequency{} 5742 } else { 5743 sv = *v 5744 } 5745 5746 for key, value := range shape { 5747 switch key { 5748 case "units": 5749 if value != nil { 5750 jtv, ok := value.(string) 5751 if !ok { 5752 return fmt.Errorf("expected FrequencyUnits to be of type string, got %T instead", value) 5753 } 5754 sv.Units = types.FrequencyUnits(jtv) 5755 } 5756 5757 case "value": 5758 if value != nil { 5759 jtv, ok := value.(json.Number) 5760 if !ok { 5761 return fmt.Errorf("expected Double to be json.Number, got %T instead", value) 5762 } 5763 f64, err := jtv.Float64() 5764 if err != nil { 5765 return err 5766 } 5767 sv.Value = ptr.Float64(f64) 5768 } 5769 5770 default: 5771 _, _ = key, value 5772 5773 } 5774 } 5775 *v = sv 5776 return nil 5777} 5778 5779func awsRestjson1_deserializeDocumentFrequencyBandwidth(v **types.FrequencyBandwidth, value interface{}) error { 5780 if v == nil { 5781 return fmt.Errorf("unexpected nil of type %T", v) 5782 } 5783 if value == nil { 5784 return nil 5785 } 5786 5787 shape, ok := value.(map[string]interface{}) 5788 if !ok { 5789 return fmt.Errorf("unexpected JSON type %v", value) 5790 } 5791 5792 var sv *types.FrequencyBandwidth 5793 if *v == nil { 5794 sv = &types.FrequencyBandwidth{} 5795 } else { 5796 sv = *v 5797 } 5798 5799 for key, value := range shape { 5800 switch key { 5801 case "units": 5802 if value != nil { 5803 jtv, ok := value.(string) 5804 if !ok { 5805 return fmt.Errorf("expected BandwidthUnits to be of type string, got %T instead", value) 5806 } 5807 sv.Units = types.BandwidthUnits(jtv) 5808 } 5809 5810 case "value": 5811 if value != nil { 5812 jtv, ok := value.(json.Number) 5813 if !ok { 5814 return fmt.Errorf("expected Double to be json.Number, got %T instead", value) 5815 } 5816 f64, err := jtv.Float64() 5817 if err != nil { 5818 return err 5819 } 5820 sv.Value = ptr.Float64(f64) 5821 } 5822 5823 default: 5824 _, _ = key, value 5825 5826 } 5827 } 5828 *v = sv 5829 return nil 5830} 5831 5832func awsRestjson1_deserializeDocumentGroundStationData(v **types.GroundStationData, value interface{}) error { 5833 if v == nil { 5834 return fmt.Errorf("unexpected nil of type %T", v) 5835 } 5836 if value == nil { 5837 return nil 5838 } 5839 5840 shape, ok := value.(map[string]interface{}) 5841 if !ok { 5842 return fmt.Errorf("unexpected JSON type %v", value) 5843 } 5844 5845 var sv *types.GroundStationData 5846 if *v == nil { 5847 sv = &types.GroundStationData{} 5848 } else { 5849 sv = *v 5850 } 5851 5852 for key, value := range shape { 5853 switch key { 5854 case "groundStationId": 5855 if value != nil { 5856 jtv, ok := value.(string) 5857 if !ok { 5858 return fmt.Errorf("expected String to be of type string, got %T instead", value) 5859 } 5860 sv.GroundStationId = ptr.String(jtv) 5861 } 5862 5863 case "groundStationName": 5864 if value != nil { 5865 jtv, ok := value.(string) 5866 if !ok { 5867 return fmt.Errorf("expected String to be of type string, got %T instead", value) 5868 } 5869 sv.GroundStationName = ptr.String(jtv) 5870 } 5871 5872 case "region": 5873 if value != nil { 5874 jtv, ok := value.(string) 5875 if !ok { 5876 return fmt.Errorf("expected String to be of type string, got %T instead", value) 5877 } 5878 sv.Region = ptr.String(jtv) 5879 } 5880 5881 default: 5882 _, _ = key, value 5883 5884 } 5885 } 5886 *v = sv 5887 return nil 5888} 5889 5890func awsRestjson1_deserializeDocumentGroundStationIdList(v *[]string, value interface{}) error { 5891 if v == nil { 5892 return fmt.Errorf("unexpected nil of type %T", v) 5893 } 5894 if value == nil { 5895 return nil 5896 } 5897 5898 shape, ok := value.([]interface{}) 5899 if !ok { 5900 return fmt.Errorf("unexpected JSON type %v", value) 5901 } 5902 5903 var cv []string 5904 if *v == nil { 5905 cv = []string{} 5906 } else { 5907 cv = *v 5908 } 5909 5910 for _, value := range shape { 5911 var col string 5912 if value != nil { 5913 jtv, ok := value.(string) 5914 if !ok { 5915 return fmt.Errorf("expected String to be of type string, got %T instead", value) 5916 } 5917 col = jtv 5918 } 5919 cv = append(cv, col) 5920 5921 } 5922 *v = cv 5923 return nil 5924} 5925 5926func awsRestjson1_deserializeDocumentGroundStationList(v *[]types.GroundStationData, value interface{}) error { 5927 if v == nil { 5928 return fmt.Errorf("unexpected nil of type %T", v) 5929 } 5930 if value == nil { 5931 return nil 5932 } 5933 5934 shape, ok := value.([]interface{}) 5935 if !ok { 5936 return fmt.Errorf("unexpected JSON type %v", value) 5937 } 5938 5939 var cv []types.GroundStationData 5940 if *v == nil { 5941 cv = []types.GroundStationData{} 5942 } else { 5943 cv = *v 5944 } 5945 5946 for _, value := range shape { 5947 var col types.GroundStationData 5948 destAddr := &col 5949 if err := awsRestjson1_deserializeDocumentGroundStationData(&destAddr, value); err != nil { 5950 return err 5951 } 5952 col = *destAddr 5953 cv = append(cv, col) 5954 5955 } 5956 *v = cv 5957 return nil 5958} 5959 5960func awsRestjson1_deserializeDocumentInvalidParameterException(v **types.InvalidParameterException, value interface{}) error { 5961 if v == nil { 5962 return fmt.Errorf("unexpected nil of type %T", v) 5963 } 5964 if value == nil { 5965 return nil 5966 } 5967 5968 shape, ok := value.(map[string]interface{}) 5969 if !ok { 5970 return fmt.Errorf("unexpected JSON type %v", value) 5971 } 5972 5973 var sv *types.InvalidParameterException 5974 if *v == nil { 5975 sv = &types.InvalidParameterException{} 5976 } else { 5977 sv = *v 5978 } 5979 5980 for key, value := range shape { 5981 switch key { 5982 case "message": 5983 if value != nil { 5984 jtv, ok := value.(string) 5985 if !ok { 5986 return fmt.Errorf("expected String to be of type string, got %T instead", value) 5987 } 5988 sv.Message = ptr.String(jtv) 5989 } 5990 5991 case "parameterName": 5992 if value != nil { 5993 jtv, ok := value.(string) 5994 if !ok { 5995 return fmt.Errorf("expected String to be of type string, got %T instead", value) 5996 } 5997 sv.ParameterName = ptr.String(jtv) 5998 } 5999 6000 default: 6001 _, _ = key, value 6002 6003 } 6004 } 6005 *v = sv 6006 return nil 6007} 6008 6009func awsRestjson1_deserializeDocumentMissionProfileList(v *[]types.MissionProfileListItem, value interface{}) error { 6010 if v == nil { 6011 return fmt.Errorf("unexpected nil of type %T", v) 6012 } 6013 if value == nil { 6014 return nil 6015 } 6016 6017 shape, ok := value.([]interface{}) 6018 if !ok { 6019 return fmt.Errorf("unexpected JSON type %v", value) 6020 } 6021 6022 var cv []types.MissionProfileListItem 6023 if *v == nil { 6024 cv = []types.MissionProfileListItem{} 6025 } else { 6026 cv = *v 6027 } 6028 6029 for _, value := range shape { 6030 var col types.MissionProfileListItem 6031 destAddr := &col 6032 if err := awsRestjson1_deserializeDocumentMissionProfileListItem(&destAddr, value); err != nil { 6033 return err 6034 } 6035 col = *destAddr 6036 cv = append(cv, col) 6037 6038 } 6039 *v = cv 6040 return nil 6041} 6042 6043func awsRestjson1_deserializeDocumentMissionProfileListItem(v **types.MissionProfileListItem, value interface{}) error { 6044 if v == nil { 6045 return fmt.Errorf("unexpected nil of type %T", v) 6046 } 6047 if value == nil { 6048 return nil 6049 } 6050 6051 shape, ok := value.(map[string]interface{}) 6052 if !ok { 6053 return fmt.Errorf("unexpected JSON type %v", value) 6054 } 6055 6056 var sv *types.MissionProfileListItem 6057 if *v == nil { 6058 sv = &types.MissionProfileListItem{} 6059 } else { 6060 sv = *v 6061 } 6062 6063 for key, value := range shape { 6064 switch key { 6065 case "missionProfileArn": 6066 if value != nil { 6067 jtv, ok := value.(string) 6068 if !ok { 6069 return fmt.Errorf("expected MissionProfileArn to be of type string, got %T instead", value) 6070 } 6071 sv.MissionProfileArn = ptr.String(jtv) 6072 } 6073 6074 case "missionProfileId": 6075 if value != nil { 6076 jtv, ok := value.(string) 6077 if !ok { 6078 return fmt.Errorf("expected String to be of type string, got %T instead", value) 6079 } 6080 sv.MissionProfileId = ptr.String(jtv) 6081 } 6082 6083 case "name": 6084 if value != nil { 6085 jtv, ok := value.(string) 6086 if !ok { 6087 return fmt.Errorf("expected String to be of type string, got %T instead", value) 6088 } 6089 sv.Name = ptr.String(jtv) 6090 } 6091 6092 case "region": 6093 if value != nil { 6094 jtv, ok := value.(string) 6095 if !ok { 6096 return fmt.Errorf("expected String to be of type string, got %T instead", value) 6097 } 6098 sv.Region = ptr.String(jtv) 6099 } 6100 6101 default: 6102 _, _ = key, value 6103 6104 } 6105 } 6106 *v = sv 6107 return nil 6108} 6109 6110func awsRestjson1_deserializeDocumentResourceLimitExceededException(v **types.ResourceLimitExceededException, 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 *types.ResourceLimitExceededException 6124 if *v == nil { 6125 sv = &types.ResourceLimitExceededException{} 6126 } else { 6127 sv = *v 6128 } 6129 6130 for key, value := range shape { 6131 switch key { 6132 case "message": 6133 if value != nil { 6134 jtv, ok := value.(string) 6135 if !ok { 6136 return fmt.Errorf("expected String to be of type string, got %T instead", value) 6137 } 6138 sv.Message = ptr.String(jtv) 6139 } 6140 6141 case "parameterName": 6142 if value != nil { 6143 jtv, ok := value.(string) 6144 if !ok { 6145 return fmt.Errorf("expected String to be of type string, got %T instead", value) 6146 } 6147 sv.ParameterName = ptr.String(jtv) 6148 } 6149 6150 default: 6151 _, _ = key, value 6152 6153 } 6154 } 6155 *v = sv 6156 return nil 6157} 6158 6159func awsRestjson1_deserializeDocumentResourceNotFoundException(v **types.ResourceNotFoundException, value interface{}) error { 6160 if v == nil { 6161 return fmt.Errorf("unexpected nil of type %T", v) 6162 } 6163 if value == nil { 6164 return nil 6165 } 6166 6167 shape, ok := value.(map[string]interface{}) 6168 if !ok { 6169 return fmt.Errorf("unexpected JSON type %v", value) 6170 } 6171 6172 var sv *types.ResourceNotFoundException 6173 if *v == nil { 6174 sv = &types.ResourceNotFoundException{} 6175 } else { 6176 sv = *v 6177 } 6178 6179 for key, value := range shape { 6180 switch key { 6181 case "message": 6182 if value != nil { 6183 jtv, ok := value.(string) 6184 if !ok { 6185 return fmt.Errorf("expected String to be of type string, got %T instead", value) 6186 } 6187 sv.Message = ptr.String(jtv) 6188 } 6189 6190 default: 6191 _, _ = key, value 6192 6193 } 6194 } 6195 *v = sv 6196 return nil 6197} 6198 6199func awsRestjson1_deserializeDocumentS3RecordingConfig(v **types.S3RecordingConfig, value interface{}) error { 6200 if v == nil { 6201 return fmt.Errorf("unexpected nil of type %T", v) 6202 } 6203 if value == nil { 6204 return nil 6205 } 6206 6207 shape, ok := value.(map[string]interface{}) 6208 if !ok { 6209 return fmt.Errorf("unexpected JSON type %v", value) 6210 } 6211 6212 var sv *types.S3RecordingConfig 6213 if *v == nil { 6214 sv = &types.S3RecordingConfig{} 6215 } else { 6216 sv = *v 6217 } 6218 6219 for key, value := range shape { 6220 switch key { 6221 case "bucketArn": 6222 if value != nil { 6223 jtv, ok := value.(string) 6224 if !ok { 6225 return fmt.Errorf("expected BucketArn to be of type string, got %T instead", value) 6226 } 6227 sv.BucketArn = ptr.String(jtv) 6228 } 6229 6230 case "prefix": 6231 if value != nil { 6232 jtv, ok := value.(string) 6233 if !ok { 6234 return fmt.Errorf("expected S3KeyPrefix to be of type string, got %T instead", value) 6235 } 6236 sv.Prefix = ptr.String(jtv) 6237 } 6238 6239 case "roleArn": 6240 if value != nil { 6241 jtv, ok := value.(string) 6242 if !ok { 6243 return fmt.Errorf("expected RoleArn to be of type string, got %T instead", value) 6244 } 6245 sv.RoleArn = ptr.String(jtv) 6246 } 6247 6248 default: 6249 _, _ = key, value 6250 6251 } 6252 } 6253 *v = sv 6254 return nil 6255} 6256 6257func awsRestjson1_deserializeDocumentS3RecordingDetails(v **types.S3RecordingDetails, value interface{}) error { 6258 if v == nil { 6259 return fmt.Errorf("unexpected nil of type %T", v) 6260 } 6261 if value == nil { 6262 return nil 6263 } 6264 6265 shape, ok := value.(map[string]interface{}) 6266 if !ok { 6267 return fmt.Errorf("unexpected JSON type %v", value) 6268 } 6269 6270 var sv *types.S3RecordingDetails 6271 if *v == nil { 6272 sv = &types.S3RecordingDetails{} 6273 } else { 6274 sv = *v 6275 } 6276 6277 for key, value := range shape { 6278 switch key { 6279 case "bucketArn": 6280 if value != nil { 6281 jtv, ok := value.(string) 6282 if !ok { 6283 return fmt.Errorf("expected BucketArn to be of type string, got %T instead", value) 6284 } 6285 sv.BucketArn = ptr.String(jtv) 6286 } 6287 6288 case "keyTemplate": 6289 if value != nil { 6290 jtv, ok := value.(string) 6291 if !ok { 6292 return fmt.Errorf("expected String to be of type string, got %T instead", value) 6293 } 6294 sv.KeyTemplate = ptr.String(jtv) 6295 } 6296 6297 default: 6298 _, _ = key, value 6299 6300 } 6301 } 6302 *v = sv 6303 return nil 6304} 6305 6306func awsRestjson1_deserializeDocumentSatelliteList(v *[]types.SatelliteListItem, value interface{}) error { 6307 if v == nil { 6308 return fmt.Errorf("unexpected nil of type %T", v) 6309 } 6310 if value == nil { 6311 return nil 6312 } 6313 6314 shape, ok := value.([]interface{}) 6315 if !ok { 6316 return fmt.Errorf("unexpected JSON type %v", value) 6317 } 6318 6319 var cv []types.SatelliteListItem 6320 if *v == nil { 6321 cv = []types.SatelliteListItem{} 6322 } else { 6323 cv = *v 6324 } 6325 6326 for _, value := range shape { 6327 var col types.SatelliteListItem 6328 destAddr := &col 6329 if err := awsRestjson1_deserializeDocumentSatelliteListItem(&destAddr, value); err != nil { 6330 return err 6331 } 6332 col = *destAddr 6333 cv = append(cv, col) 6334 6335 } 6336 *v = cv 6337 return nil 6338} 6339 6340func awsRestjson1_deserializeDocumentSatelliteListItem(v **types.SatelliteListItem, value interface{}) error { 6341 if v == nil { 6342 return fmt.Errorf("unexpected nil of type %T", v) 6343 } 6344 if value == nil { 6345 return nil 6346 } 6347 6348 shape, ok := value.(map[string]interface{}) 6349 if !ok { 6350 return fmt.Errorf("unexpected JSON type %v", value) 6351 } 6352 6353 var sv *types.SatelliteListItem 6354 if *v == nil { 6355 sv = &types.SatelliteListItem{} 6356 } else { 6357 sv = *v 6358 } 6359 6360 for key, value := range shape { 6361 switch key { 6362 case "groundStations": 6363 if err := awsRestjson1_deserializeDocumentGroundStationIdList(&sv.GroundStations, value); err != nil { 6364 return err 6365 } 6366 6367 case "noradSatelliteID": 6368 if value != nil { 6369 jtv, ok := value.(json.Number) 6370 if !ok { 6371 return fmt.Errorf("expected noradSatelliteID to be json.Number, got %T instead", value) 6372 } 6373 i64, err := jtv.Int64() 6374 if err != nil { 6375 return err 6376 } 6377 sv.NoradSatelliteID = int32(i64) 6378 } 6379 6380 case "satelliteArn": 6381 if value != nil { 6382 jtv, ok := value.(string) 6383 if !ok { 6384 return fmt.Errorf("expected satelliteArn to be of type string, got %T instead", value) 6385 } 6386 sv.SatelliteArn = ptr.String(jtv) 6387 } 6388 6389 case "satelliteId": 6390 if value != nil { 6391 jtv, ok := value.(string) 6392 if !ok { 6393 return fmt.Errorf("expected Uuid to be of type string, got %T instead", value) 6394 } 6395 sv.SatelliteId = ptr.String(jtv) 6396 } 6397 6398 default: 6399 _, _ = key, value 6400 6401 } 6402 } 6403 *v = sv 6404 return nil 6405} 6406 6407func awsRestjson1_deserializeDocumentSecurityDetails(v **types.SecurityDetails, value interface{}) error { 6408 if v == nil { 6409 return fmt.Errorf("unexpected nil of type %T", v) 6410 } 6411 if value == nil { 6412 return nil 6413 } 6414 6415 shape, ok := value.(map[string]interface{}) 6416 if !ok { 6417 return fmt.Errorf("unexpected JSON type %v", value) 6418 } 6419 6420 var sv *types.SecurityDetails 6421 if *v == nil { 6422 sv = &types.SecurityDetails{} 6423 } else { 6424 sv = *v 6425 } 6426 6427 for key, value := range shape { 6428 switch key { 6429 case "roleArn": 6430 if value != nil { 6431 jtv, ok := value.(string) 6432 if !ok { 6433 return fmt.Errorf("expected RoleArn to be of type string, got %T instead", value) 6434 } 6435 sv.RoleArn = ptr.String(jtv) 6436 } 6437 6438 case "securityGroupIds": 6439 if err := awsRestjson1_deserializeDocumentSecurityGroupIdList(&sv.SecurityGroupIds, value); err != nil { 6440 return err 6441 } 6442 6443 case "subnetIds": 6444 if err := awsRestjson1_deserializeDocumentSubnetList(&sv.SubnetIds, value); err != nil { 6445 return err 6446 } 6447 6448 default: 6449 _, _ = key, value 6450 6451 } 6452 } 6453 *v = sv 6454 return nil 6455} 6456 6457func awsRestjson1_deserializeDocumentSecurityGroupIdList(v *[]string, value interface{}) error { 6458 if v == nil { 6459 return fmt.Errorf("unexpected nil of type %T", v) 6460 } 6461 if value == nil { 6462 return nil 6463 } 6464 6465 shape, ok := value.([]interface{}) 6466 if !ok { 6467 return fmt.Errorf("unexpected JSON type %v", value) 6468 } 6469 6470 var cv []string 6471 if *v == nil { 6472 cv = []string{} 6473 } else { 6474 cv = *v 6475 } 6476 6477 for _, value := range shape { 6478 var col string 6479 if value != nil { 6480 jtv, ok := value.(string) 6481 if !ok { 6482 return fmt.Errorf("expected String to be of type string, got %T instead", value) 6483 } 6484 col = jtv 6485 } 6486 cv = append(cv, col) 6487 6488 } 6489 *v = cv 6490 return nil 6491} 6492 6493func awsRestjson1_deserializeDocumentSocketAddress(v **types.SocketAddress, value interface{}) error { 6494 if v == nil { 6495 return fmt.Errorf("unexpected nil of type %T", v) 6496 } 6497 if value == nil { 6498 return nil 6499 } 6500 6501 shape, ok := value.(map[string]interface{}) 6502 if !ok { 6503 return fmt.Errorf("unexpected JSON type %v", value) 6504 } 6505 6506 var sv *types.SocketAddress 6507 if *v == nil { 6508 sv = &types.SocketAddress{} 6509 } else { 6510 sv = *v 6511 } 6512 6513 for key, value := range shape { 6514 switch key { 6515 case "name": 6516 if value != nil { 6517 jtv, ok := value.(string) 6518 if !ok { 6519 return fmt.Errorf("expected String to be of type string, got %T instead", value) 6520 } 6521 sv.Name = ptr.String(jtv) 6522 } 6523 6524 case "port": 6525 if value != nil { 6526 jtv, ok := value.(json.Number) 6527 if !ok { 6528 return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) 6529 } 6530 i64, err := jtv.Int64() 6531 if err != nil { 6532 return err 6533 } 6534 sv.Port = ptr.Int32(int32(i64)) 6535 } 6536 6537 default: 6538 _, _ = key, value 6539 6540 } 6541 } 6542 *v = sv 6543 return nil 6544} 6545 6546func awsRestjson1_deserializeDocumentSource(v **types.Source, value interface{}) error { 6547 if v == nil { 6548 return fmt.Errorf("unexpected nil of type %T", v) 6549 } 6550 if value == nil { 6551 return nil 6552 } 6553 6554 shape, ok := value.(map[string]interface{}) 6555 if !ok { 6556 return fmt.Errorf("unexpected JSON type %v", value) 6557 } 6558 6559 var sv *types.Source 6560 if *v == nil { 6561 sv = &types.Source{} 6562 } else { 6563 sv = *v 6564 } 6565 6566 for key, value := range shape { 6567 switch key { 6568 case "configDetails": 6569 if err := awsRestjson1_deserializeDocumentConfigDetails(&sv.ConfigDetails, value); err != nil { 6570 return err 6571 } 6572 6573 case "configId": 6574 if value != nil { 6575 jtv, ok := value.(string) 6576 if !ok { 6577 return fmt.Errorf("expected String to be of type string, got %T instead", value) 6578 } 6579 sv.ConfigId = ptr.String(jtv) 6580 } 6581 6582 case "configType": 6583 if value != nil { 6584 jtv, ok := value.(string) 6585 if !ok { 6586 return fmt.Errorf("expected ConfigCapabilityType to be of type string, got %T instead", value) 6587 } 6588 sv.ConfigType = types.ConfigCapabilityType(jtv) 6589 } 6590 6591 case "dataflowSourceRegion": 6592 if value != nil { 6593 jtv, ok := value.(string) 6594 if !ok { 6595 return fmt.Errorf("expected String to be of type string, got %T instead", value) 6596 } 6597 sv.DataflowSourceRegion = ptr.String(jtv) 6598 } 6599 6600 default: 6601 _, _ = key, value 6602 6603 } 6604 } 6605 *v = sv 6606 return nil 6607} 6608 6609func awsRestjson1_deserializeDocumentSpectrumConfig(v **types.SpectrumConfig, value interface{}) error { 6610 if v == nil { 6611 return fmt.Errorf("unexpected nil of type %T", v) 6612 } 6613 if value == nil { 6614 return nil 6615 } 6616 6617 shape, ok := value.(map[string]interface{}) 6618 if !ok { 6619 return fmt.Errorf("unexpected JSON type %v", value) 6620 } 6621 6622 var sv *types.SpectrumConfig 6623 if *v == nil { 6624 sv = &types.SpectrumConfig{} 6625 } else { 6626 sv = *v 6627 } 6628 6629 for key, value := range shape { 6630 switch key { 6631 case "bandwidth": 6632 if err := awsRestjson1_deserializeDocumentFrequencyBandwidth(&sv.Bandwidth, value); err != nil { 6633 return err 6634 } 6635 6636 case "centerFrequency": 6637 if err := awsRestjson1_deserializeDocumentFrequency(&sv.CenterFrequency, value); err != nil { 6638 return err 6639 } 6640 6641 case "polarization": 6642 if value != nil { 6643 jtv, ok := value.(string) 6644 if !ok { 6645 return fmt.Errorf("expected Polarization to be of type string, got %T instead", value) 6646 } 6647 sv.Polarization = types.Polarization(jtv) 6648 } 6649 6650 default: 6651 _, _ = key, value 6652 6653 } 6654 } 6655 *v = sv 6656 return nil 6657} 6658 6659func awsRestjson1_deserializeDocumentSubnetList(v *[]string, value interface{}) error { 6660 if v == nil { 6661 return fmt.Errorf("unexpected nil of type %T", v) 6662 } 6663 if value == nil { 6664 return nil 6665 } 6666 6667 shape, ok := value.([]interface{}) 6668 if !ok { 6669 return fmt.Errorf("unexpected JSON type %v", value) 6670 } 6671 6672 var cv []string 6673 if *v == nil { 6674 cv = []string{} 6675 } else { 6676 cv = *v 6677 } 6678 6679 for _, value := range shape { 6680 var col string 6681 if value != nil { 6682 jtv, ok := value.(string) 6683 if !ok { 6684 return fmt.Errorf("expected String to be of type string, got %T instead", value) 6685 } 6686 col = jtv 6687 } 6688 cv = append(cv, col) 6689 6690 } 6691 *v = cv 6692 return nil 6693} 6694 6695func awsRestjson1_deserializeDocumentTagsMap(v *map[string]string, value interface{}) error { 6696 if v == nil { 6697 return fmt.Errorf("unexpected nil of type %T", v) 6698 } 6699 if value == nil { 6700 return nil 6701 } 6702 6703 shape, ok := value.(map[string]interface{}) 6704 if !ok { 6705 return fmt.Errorf("unexpected JSON type %v", value) 6706 } 6707 6708 var mv map[string]string 6709 if *v == nil { 6710 mv = map[string]string{} 6711 } else { 6712 mv = *v 6713 } 6714 6715 for key, value := range shape { 6716 var parsedVal string 6717 if value != nil { 6718 jtv, ok := value.(string) 6719 if !ok { 6720 return fmt.Errorf("expected String to be of type string, got %T instead", value) 6721 } 6722 parsedVal = jtv 6723 } 6724 mv[key] = parsedVal 6725 6726 } 6727 *v = mv 6728 return nil 6729} 6730 6731func awsRestjson1_deserializeDocumentTrackingConfig(v **types.TrackingConfig, value interface{}) error { 6732 if v == nil { 6733 return fmt.Errorf("unexpected nil of type %T", v) 6734 } 6735 if value == nil { 6736 return nil 6737 } 6738 6739 shape, ok := value.(map[string]interface{}) 6740 if !ok { 6741 return fmt.Errorf("unexpected JSON type %v", value) 6742 } 6743 6744 var sv *types.TrackingConfig 6745 if *v == nil { 6746 sv = &types.TrackingConfig{} 6747 } else { 6748 sv = *v 6749 } 6750 6751 for key, value := range shape { 6752 switch key { 6753 case "autotrack": 6754 if value != nil { 6755 jtv, ok := value.(string) 6756 if !ok { 6757 return fmt.Errorf("expected Criticality to be of type string, got %T instead", value) 6758 } 6759 sv.Autotrack = types.Criticality(jtv) 6760 } 6761 6762 default: 6763 _, _ = key, value 6764 6765 } 6766 } 6767 *v = sv 6768 return nil 6769} 6770 6771func awsRestjson1_deserializeDocumentUplinkEchoConfig(v **types.UplinkEchoConfig, value interface{}) error { 6772 if v == nil { 6773 return fmt.Errorf("unexpected nil of type %T", v) 6774 } 6775 if value == nil { 6776 return nil 6777 } 6778 6779 shape, ok := value.(map[string]interface{}) 6780 if !ok { 6781 return fmt.Errorf("unexpected JSON type %v", value) 6782 } 6783 6784 var sv *types.UplinkEchoConfig 6785 if *v == nil { 6786 sv = &types.UplinkEchoConfig{} 6787 } else { 6788 sv = *v 6789 } 6790 6791 for key, value := range shape { 6792 switch key { 6793 case "antennaUplinkConfigArn": 6794 if value != nil { 6795 jtv, ok := value.(string) 6796 if !ok { 6797 return fmt.Errorf("expected ConfigArn to be of type string, got %T instead", value) 6798 } 6799 sv.AntennaUplinkConfigArn = ptr.String(jtv) 6800 } 6801 6802 case "enabled": 6803 if value != nil { 6804 jtv, ok := value.(bool) 6805 if !ok { 6806 return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) 6807 } 6808 sv.Enabled = ptr.Bool(jtv) 6809 } 6810 6811 default: 6812 _, _ = key, value 6813 6814 } 6815 } 6816 *v = sv 6817 return nil 6818} 6819 6820func awsRestjson1_deserializeDocumentUplinkSpectrumConfig(v **types.UplinkSpectrumConfig, value interface{}) error { 6821 if v == nil { 6822 return fmt.Errorf("unexpected nil of type %T", v) 6823 } 6824 if value == nil { 6825 return nil 6826 } 6827 6828 shape, ok := value.(map[string]interface{}) 6829 if !ok { 6830 return fmt.Errorf("unexpected JSON type %v", value) 6831 } 6832 6833 var sv *types.UplinkSpectrumConfig 6834 if *v == nil { 6835 sv = &types.UplinkSpectrumConfig{} 6836 } else { 6837 sv = *v 6838 } 6839 6840 for key, value := range shape { 6841 switch key { 6842 case "centerFrequency": 6843 if err := awsRestjson1_deserializeDocumentFrequency(&sv.CenterFrequency, value); err != nil { 6844 return err 6845 } 6846 6847 case "polarization": 6848 if value != nil { 6849 jtv, ok := value.(string) 6850 if !ok { 6851 return fmt.Errorf("expected Polarization to be of type string, got %T instead", value) 6852 } 6853 sv.Polarization = types.Polarization(jtv) 6854 } 6855 6856 default: 6857 _, _ = key, value 6858 6859 } 6860 } 6861 *v = sv 6862 return nil 6863} 6864