1// Code generated by smithy-go-codegen DO NOT EDIT. 2 3package amplify 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/amplify/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_deserializeOpCreateApp struct { 23} 24 25func (*awsRestjson1_deserializeOpCreateApp) ID() string { 26 return "OperationDeserializer" 27} 28 29func (m *awsRestjson1_deserializeOpCreateApp) 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_deserializeOpErrorCreateApp(response, &metadata) 44 } 45 output := &CreateAppOutput{} 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_deserializeOpDocumentCreateAppOutput(&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_deserializeOpErrorCreateApp(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("BadRequestException", errorCode): 121 return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) 122 123 case strings.EqualFold("DependentServiceFailureException", errorCode): 124 return awsRestjson1_deserializeErrorDependentServiceFailureException(response, errorBody) 125 126 case strings.EqualFold("InternalFailureException", errorCode): 127 return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) 128 129 case strings.EqualFold("LimitExceededException", errorCode): 130 return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) 131 132 case strings.EqualFold("UnauthorizedException", errorCode): 133 return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody) 134 135 default: 136 genericError := &smithy.GenericAPIError{ 137 Code: errorCode, 138 Message: errorMessage, 139 } 140 return genericError 141 142 } 143} 144 145func awsRestjson1_deserializeOpDocumentCreateAppOutput(v **CreateAppOutput, value interface{}) error { 146 if v == nil { 147 return fmt.Errorf("unexpected nil of type %T", v) 148 } 149 if value == nil { 150 return nil 151 } 152 153 shape, ok := value.(map[string]interface{}) 154 if !ok { 155 return fmt.Errorf("unexpected JSON type %v", value) 156 } 157 158 var sv *CreateAppOutput 159 if *v == nil { 160 sv = &CreateAppOutput{} 161 } else { 162 sv = *v 163 } 164 165 for key, value := range shape { 166 switch key { 167 case "app": 168 if err := awsRestjson1_deserializeDocumentApp(&sv.App, value); err != nil { 169 return err 170 } 171 172 default: 173 _, _ = key, value 174 175 } 176 } 177 *v = sv 178 return nil 179} 180 181type awsRestjson1_deserializeOpCreateBackendEnvironment struct { 182} 183 184func (*awsRestjson1_deserializeOpCreateBackendEnvironment) ID() string { 185 return "OperationDeserializer" 186} 187 188func (m *awsRestjson1_deserializeOpCreateBackendEnvironment) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 189 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 190) { 191 out, metadata, err = next.HandleDeserialize(ctx, in) 192 if err != nil { 193 return out, metadata, err 194 } 195 196 response, ok := out.RawResponse.(*smithyhttp.Response) 197 if !ok { 198 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 199 } 200 201 if response.StatusCode < 200 || response.StatusCode >= 300 { 202 return out, metadata, awsRestjson1_deserializeOpErrorCreateBackendEnvironment(response, &metadata) 203 } 204 output := &CreateBackendEnvironmentOutput{} 205 out.Result = output 206 207 var buff [1024]byte 208 ringBuffer := smithyio.NewRingBuffer(buff[:]) 209 210 body := io.TeeReader(response.Body, ringBuffer) 211 212 decoder := json.NewDecoder(body) 213 decoder.UseNumber() 214 var shape interface{} 215 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 216 var snapshot bytes.Buffer 217 io.Copy(&snapshot, ringBuffer) 218 err = &smithy.DeserializationError{ 219 Err: fmt.Errorf("failed to decode response body, %w", err), 220 Snapshot: snapshot.Bytes(), 221 } 222 return out, metadata, err 223 } 224 225 err = awsRestjson1_deserializeOpDocumentCreateBackendEnvironmentOutput(&output, shape) 226 if err != nil { 227 var snapshot bytes.Buffer 228 io.Copy(&snapshot, ringBuffer) 229 return out, metadata, &smithy.DeserializationError{ 230 Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), 231 Snapshot: snapshot.Bytes(), 232 } 233 } 234 235 return out, metadata, err 236} 237 238func awsRestjson1_deserializeOpErrorCreateBackendEnvironment(response *smithyhttp.Response, metadata *middleware.Metadata) error { 239 var errorBuffer bytes.Buffer 240 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 241 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 242 } 243 errorBody := bytes.NewReader(errorBuffer.Bytes()) 244 245 errorCode := "UnknownError" 246 errorMessage := errorCode 247 248 code := response.Header.Get("X-Amzn-ErrorType") 249 if len(code) != 0 { 250 errorCode = restjson.SanitizeErrorCode(code) 251 } 252 253 var buff [1024]byte 254 ringBuffer := smithyio.NewRingBuffer(buff[:]) 255 256 body := io.TeeReader(errorBody, ringBuffer) 257 decoder := json.NewDecoder(body) 258 decoder.UseNumber() 259 code, message, err := restjson.GetErrorInfo(decoder) 260 if err != nil { 261 var snapshot bytes.Buffer 262 io.Copy(&snapshot, ringBuffer) 263 err = &smithy.DeserializationError{ 264 Err: fmt.Errorf("failed to decode response body, %w", err), 265 Snapshot: snapshot.Bytes(), 266 } 267 return err 268 } 269 270 errorBody.Seek(0, io.SeekStart) 271 if len(code) != 0 { 272 errorCode = restjson.SanitizeErrorCode(code) 273 } 274 if len(message) != 0 { 275 errorMessage = message 276 } 277 278 switch { 279 case strings.EqualFold("BadRequestException", errorCode): 280 return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) 281 282 case strings.EqualFold("InternalFailureException", errorCode): 283 return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) 284 285 case strings.EqualFold("LimitExceededException", errorCode): 286 return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) 287 288 case strings.EqualFold("NotFoundException", errorCode): 289 return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) 290 291 case strings.EqualFold("UnauthorizedException", errorCode): 292 return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody) 293 294 default: 295 genericError := &smithy.GenericAPIError{ 296 Code: errorCode, 297 Message: errorMessage, 298 } 299 return genericError 300 301 } 302} 303 304func awsRestjson1_deserializeOpDocumentCreateBackendEnvironmentOutput(v **CreateBackendEnvironmentOutput, value interface{}) error { 305 if v == nil { 306 return fmt.Errorf("unexpected nil of type %T", v) 307 } 308 if value == nil { 309 return nil 310 } 311 312 shape, ok := value.(map[string]interface{}) 313 if !ok { 314 return fmt.Errorf("unexpected JSON type %v", value) 315 } 316 317 var sv *CreateBackendEnvironmentOutput 318 if *v == nil { 319 sv = &CreateBackendEnvironmentOutput{} 320 } else { 321 sv = *v 322 } 323 324 for key, value := range shape { 325 switch key { 326 case "backendEnvironment": 327 if err := awsRestjson1_deserializeDocumentBackendEnvironment(&sv.BackendEnvironment, value); err != nil { 328 return err 329 } 330 331 default: 332 _, _ = key, value 333 334 } 335 } 336 *v = sv 337 return nil 338} 339 340type awsRestjson1_deserializeOpCreateBranch struct { 341} 342 343func (*awsRestjson1_deserializeOpCreateBranch) ID() string { 344 return "OperationDeserializer" 345} 346 347func (m *awsRestjson1_deserializeOpCreateBranch) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 348 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 349) { 350 out, metadata, err = next.HandleDeserialize(ctx, in) 351 if err != nil { 352 return out, metadata, err 353 } 354 355 response, ok := out.RawResponse.(*smithyhttp.Response) 356 if !ok { 357 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 358 } 359 360 if response.StatusCode < 200 || response.StatusCode >= 300 { 361 return out, metadata, awsRestjson1_deserializeOpErrorCreateBranch(response, &metadata) 362 } 363 output := &CreateBranchOutput{} 364 out.Result = output 365 366 var buff [1024]byte 367 ringBuffer := smithyio.NewRingBuffer(buff[:]) 368 369 body := io.TeeReader(response.Body, ringBuffer) 370 371 decoder := json.NewDecoder(body) 372 decoder.UseNumber() 373 var shape interface{} 374 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 375 var snapshot bytes.Buffer 376 io.Copy(&snapshot, ringBuffer) 377 err = &smithy.DeserializationError{ 378 Err: fmt.Errorf("failed to decode response body, %w", err), 379 Snapshot: snapshot.Bytes(), 380 } 381 return out, metadata, err 382 } 383 384 err = awsRestjson1_deserializeOpDocumentCreateBranchOutput(&output, shape) 385 if err != nil { 386 var snapshot bytes.Buffer 387 io.Copy(&snapshot, ringBuffer) 388 return out, metadata, &smithy.DeserializationError{ 389 Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), 390 Snapshot: snapshot.Bytes(), 391 } 392 } 393 394 return out, metadata, err 395} 396 397func awsRestjson1_deserializeOpErrorCreateBranch(response *smithyhttp.Response, metadata *middleware.Metadata) error { 398 var errorBuffer bytes.Buffer 399 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 400 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 401 } 402 errorBody := bytes.NewReader(errorBuffer.Bytes()) 403 404 errorCode := "UnknownError" 405 errorMessage := errorCode 406 407 code := response.Header.Get("X-Amzn-ErrorType") 408 if len(code) != 0 { 409 errorCode = restjson.SanitizeErrorCode(code) 410 } 411 412 var buff [1024]byte 413 ringBuffer := smithyio.NewRingBuffer(buff[:]) 414 415 body := io.TeeReader(errorBody, ringBuffer) 416 decoder := json.NewDecoder(body) 417 decoder.UseNumber() 418 code, message, err := restjson.GetErrorInfo(decoder) 419 if err != nil { 420 var snapshot bytes.Buffer 421 io.Copy(&snapshot, ringBuffer) 422 err = &smithy.DeserializationError{ 423 Err: fmt.Errorf("failed to decode response body, %w", err), 424 Snapshot: snapshot.Bytes(), 425 } 426 return err 427 } 428 429 errorBody.Seek(0, io.SeekStart) 430 if len(code) != 0 { 431 errorCode = restjson.SanitizeErrorCode(code) 432 } 433 if len(message) != 0 { 434 errorMessage = message 435 } 436 437 switch { 438 case strings.EqualFold("BadRequestException", errorCode): 439 return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) 440 441 case strings.EqualFold("DependentServiceFailureException", errorCode): 442 return awsRestjson1_deserializeErrorDependentServiceFailureException(response, errorBody) 443 444 case strings.EqualFold("InternalFailureException", errorCode): 445 return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) 446 447 case strings.EqualFold("LimitExceededException", errorCode): 448 return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) 449 450 case strings.EqualFold("NotFoundException", errorCode): 451 return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) 452 453 case strings.EqualFold("UnauthorizedException", errorCode): 454 return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody) 455 456 default: 457 genericError := &smithy.GenericAPIError{ 458 Code: errorCode, 459 Message: errorMessage, 460 } 461 return genericError 462 463 } 464} 465 466func awsRestjson1_deserializeOpDocumentCreateBranchOutput(v **CreateBranchOutput, value interface{}) error { 467 if v == nil { 468 return fmt.Errorf("unexpected nil of type %T", v) 469 } 470 if value == nil { 471 return nil 472 } 473 474 shape, ok := value.(map[string]interface{}) 475 if !ok { 476 return fmt.Errorf("unexpected JSON type %v", value) 477 } 478 479 var sv *CreateBranchOutput 480 if *v == nil { 481 sv = &CreateBranchOutput{} 482 } else { 483 sv = *v 484 } 485 486 for key, value := range shape { 487 switch key { 488 case "branch": 489 if err := awsRestjson1_deserializeDocumentBranch(&sv.Branch, value); err != nil { 490 return err 491 } 492 493 default: 494 _, _ = key, value 495 496 } 497 } 498 *v = sv 499 return nil 500} 501 502type awsRestjson1_deserializeOpCreateDeployment struct { 503} 504 505func (*awsRestjson1_deserializeOpCreateDeployment) ID() string { 506 return "OperationDeserializer" 507} 508 509func (m *awsRestjson1_deserializeOpCreateDeployment) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 510 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 511) { 512 out, metadata, err = next.HandleDeserialize(ctx, in) 513 if err != nil { 514 return out, metadata, err 515 } 516 517 response, ok := out.RawResponse.(*smithyhttp.Response) 518 if !ok { 519 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 520 } 521 522 if response.StatusCode < 200 || response.StatusCode >= 300 { 523 return out, metadata, awsRestjson1_deserializeOpErrorCreateDeployment(response, &metadata) 524 } 525 output := &CreateDeploymentOutput{} 526 out.Result = output 527 528 var buff [1024]byte 529 ringBuffer := smithyio.NewRingBuffer(buff[:]) 530 531 body := io.TeeReader(response.Body, ringBuffer) 532 533 decoder := json.NewDecoder(body) 534 decoder.UseNumber() 535 var shape interface{} 536 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 537 var snapshot bytes.Buffer 538 io.Copy(&snapshot, ringBuffer) 539 err = &smithy.DeserializationError{ 540 Err: fmt.Errorf("failed to decode response body, %w", err), 541 Snapshot: snapshot.Bytes(), 542 } 543 return out, metadata, err 544 } 545 546 err = awsRestjson1_deserializeOpDocumentCreateDeploymentOutput(&output, shape) 547 if err != nil { 548 var snapshot bytes.Buffer 549 io.Copy(&snapshot, ringBuffer) 550 return out, metadata, &smithy.DeserializationError{ 551 Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), 552 Snapshot: snapshot.Bytes(), 553 } 554 } 555 556 return out, metadata, err 557} 558 559func awsRestjson1_deserializeOpErrorCreateDeployment(response *smithyhttp.Response, metadata *middleware.Metadata) error { 560 var errorBuffer bytes.Buffer 561 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 562 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 563 } 564 errorBody := bytes.NewReader(errorBuffer.Bytes()) 565 566 errorCode := "UnknownError" 567 errorMessage := errorCode 568 569 code := response.Header.Get("X-Amzn-ErrorType") 570 if len(code) != 0 { 571 errorCode = restjson.SanitizeErrorCode(code) 572 } 573 574 var buff [1024]byte 575 ringBuffer := smithyio.NewRingBuffer(buff[:]) 576 577 body := io.TeeReader(errorBody, ringBuffer) 578 decoder := json.NewDecoder(body) 579 decoder.UseNumber() 580 code, message, err := restjson.GetErrorInfo(decoder) 581 if err != nil { 582 var snapshot bytes.Buffer 583 io.Copy(&snapshot, ringBuffer) 584 err = &smithy.DeserializationError{ 585 Err: fmt.Errorf("failed to decode response body, %w", err), 586 Snapshot: snapshot.Bytes(), 587 } 588 return err 589 } 590 591 errorBody.Seek(0, io.SeekStart) 592 if len(code) != 0 { 593 errorCode = restjson.SanitizeErrorCode(code) 594 } 595 if len(message) != 0 { 596 errorMessage = message 597 } 598 599 switch { 600 case strings.EqualFold("BadRequestException", errorCode): 601 return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) 602 603 case strings.EqualFold("InternalFailureException", errorCode): 604 return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) 605 606 case strings.EqualFold("LimitExceededException", errorCode): 607 return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) 608 609 case strings.EqualFold("UnauthorizedException", errorCode): 610 return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody) 611 612 default: 613 genericError := &smithy.GenericAPIError{ 614 Code: errorCode, 615 Message: errorMessage, 616 } 617 return genericError 618 619 } 620} 621 622func awsRestjson1_deserializeOpDocumentCreateDeploymentOutput(v **CreateDeploymentOutput, value interface{}) error { 623 if v == nil { 624 return fmt.Errorf("unexpected nil of type %T", v) 625 } 626 if value == nil { 627 return nil 628 } 629 630 shape, ok := value.(map[string]interface{}) 631 if !ok { 632 return fmt.Errorf("unexpected JSON type %v", value) 633 } 634 635 var sv *CreateDeploymentOutput 636 if *v == nil { 637 sv = &CreateDeploymentOutput{} 638 } else { 639 sv = *v 640 } 641 642 for key, value := range shape { 643 switch key { 644 case "fileUploadUrls": 645 if err := awsRestjson1_deserializeDocumentFileUploadUrls(&sv.FileUploadUrls, value); err != nil { 646 return err 647 } 648 649 case "jobId": 650 if value != nil { 651 jtv, ok := value.(string) 652 if !ok { 653 return fmt.Errorf("expected JobId to be of type string, got %T instead", value) 654 } 655 sv.JobId = ptr.String(jtv) 656 } 657 658 case "zipUploadUrl": 659 if value != nil { 660 jtv, ok := value.(string) 661 if !ok { 662 return fmt.Errorf("expected UploadUrl to be of type string, got %T instead", value) 663 } 664 sv.ZipUploadUrl = ptr.String(jtv) 665 } 666 667 default: 668 _, _ = key, value 669 670 } 671 } 672 *v = sv 673 return nil 674} 675 676type awsRestjson1_deserializeOpCreateDomainAssociation struct { 677} 678 679func (*awsRestjson1_deserializeOpCreateDomainAssociation) ID() string { 680 return "OperationDeserializer" 681} 682 683func (m *awsRestjson1_deserializeOpCreateDomainAssociation) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 684 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 685) { 686 out, metadata, err = next.HandleDeserialize(ctx, in) 687 if err != nil { 688 return out, metadata, err 689 } 690 691 response, ok := out.RawResponse.(*smithyhttp.Response) 692 if !ok { 693 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 694 } 695 696 if response.StatusCode < 200 || response.StatusCode >= 300 { 697 return out, metadata, awsRestjson1_deserializeOpErrorCreateDomainAssociation(response, &metadata) 698 } 699 output := &CreateDomainAssociationOutput{} 700 out.Result = output 701 702 var buff [1024]byte 703 ringBuffer := smithyio.NewRingBuffer(buff[:]) 704 705 body := io.TeeReader(response.Body, ringBuffer) 706 707 decoder := json.NewDecoder(body) 708 decoder.UseNumber() 709 var shape interface{} 710 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 711 var snapshot bytes.Buffer 712 io.Copy(&snapshot, ringBuffer) 713 err = &smithy.DeserializationError{ 714 Err: fmt.Errorf("failed to decode response body, %w", err), 715 Snapshot: snapshot.Bytes(), 716 } 717 return out, metadata, err 718 } 719 720 err = awsRestjson1_deserializeOpDocumentCreateDomainAssociationOutput(&output, shape) 721 if err != nil { 722 var snapshot bytes.Buffer 723 io.Copy(&snapshot, ringBuffer) 724 return out, metadata, &smithy.DeserializationError{ 725 Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), 726 Snapshot: snapshot.Bytes(), 727 } 728 } 729 730 return out, metadata, err 731} 732 733func awsRestjson1_deserializeOpErrorCreateDomainAssociation(response *smithyhttp.Response, metadata *middleware.Metadata) error { 734 var errorBuffer bytes.Buffer 735 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 736 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 737 } 738 errorBody := bytes.NewReader(errorBuffer.Bytes()) 739 740 errorCode := "UnknownError" 741 errorMessage := errorCode 742 743 code := response.Header.Get("X-Amzn-ErrorType") 744 if len(code) != 0 { 745 errorCode = restjson.SanitizeErrorCode(code) 746 } 747 748 var buff [1024]byte 749 ringBuffer := smithyio.NewRingBuffer(buff[:]) 750 751 body := io.TeeReader(errorBody, ringBuffer) 752 decoder := json.NewDecoder(body) 753 decoder.UseNumber() 754 code, message, err := restjson.GetErrorInfo(decoder) 755 if err != nil { 756 var snapshot bytes.Buffer 757 io.Copy(&snapshot, ringBuffer) 758 err = &smithy.DeserializationError{ 759 Err: fmt.Errorf("failed to decode response body, %w", err), 760 Snapshot: snapshot.Bytes(), 761 } 762 return err 763 } 764 765 errorBody.Seek(0, io.SeekStart) 766 if len(code) != 0 { 767 errorCode = restjson.SanitizeErrorCode(code) 768 } 769 if len(message) != 0 { 770 errorMessage = message 771 } 772 773 switch { 774 case strings.EqualFold("BadRequestException", errorCode): 775 return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) 776 777 case strings.EqualFold("DependentServiceFailureException", errorCode): 778 return awsRestjson1_deserializeErrorDependentServiceFailureException(response, errorBody) 779 780 case strings.EqualFold("InternalFailureException", errorCode): 781 return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) 782 783 case strings.EqualFold("LimitExceededException", errorCode): 784 return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) 785 786 case strings.EqualFold("NotFoundException", errorCode): 787 return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) 788 789 case strings.EqualFold("UnauthorizedException", errorCode): 790 return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody) 791 792 default: 793 genericError := &smithy.GenericAPIError{ 794 Code: errorCode, 795 Message: errorMessage, 796 } 797 return genericError 798 799 } 800} 801 802func awsRestjson1_deserializeOpDocumentCreateDomainAssociationOutput(v **CreateDomainAssociationOutput, value interface{}) error { 803 if v == nil { 804 return fmt.Errorf("unexpected nil of type %T", v) 805 } 806 if value == nil { 807 return nil 808 } 809 810 shape, ok := value.(map[string]interface{}) 811 if !ok { 812 return fmt.Errorf("unexpected JSON type %v", value) 813 } 814 815 var sv *CreateDomainAssociationOutput 816 if *v == nil { 817 sv = &CreateDomainAssociationOutput{} 818 } else { 819 sv = *v 820 } 821 822 for key, value := range shape { 823 switch key { 824 case "domainAssociation": 825 if err := awsRestjson1_deserializeDocumentDomainAssociation(&sv.DomainAssociation, value); err != nil { 826 return err 827 } 828 829 default: 830 _, _ = key, value 831 832 } 833 } 834 *v = sv 835 return nil 836} 837 838type awsRestjson1_deserializeOpCreateWebhook struct { 839} 840 841func (*awsRestjson1_deserializeOpCreateWebhook) ID() string { 842 return "OperationDeserializer" 843} 844 845func (m *awsRestjson1_deserializeOpCreateWebhook) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 846 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 847) { 848 out, metadata, err = next.HandleDeserialize(ctx, in) 849 if err != nil { 850 return out, metadata, err 851 } 852 853 response, ok := out.RawResponse.(*smithyhttp.Response) 854 if !ok { 855 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 856 } 857 858 if response.StatusCode < 200 || response.StatusCode >= 300 { 859 return out, metadata, awsRestjson1_deserializeOpErrorCreateWebhook(response, &metadata) 860 } 861 output := &CreateWebhookOutput{} 862 out.Result = output 863 864 var buff [1024]byte 865 ringBuffer := smithyio.NewRingBuffer(buff[:]) 866 867 body := io.TeeReader(response.Body, ringBuffer) 868 869 decoder := json.NewDecoder(body) 870 decoder.UseNumber() 871 var shape interface{} 872 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 873 var snapshot bytes.Buffer 874 io.Copy(&snapshot, ringBuffer) 875 err = &smithy.DeserializationError{ 876 Err: fmt.Errorf("failed to decode response body, %w", err), 877 Snapshot: snapshot.Bytes(), 878 } 879 return out, metadata, err 880 } 881 882 err = awsRestjson1_deserializeOpDocumentCreateWebhookOutput(&output, shape) 883 if err != nil { 884 var snapshot bytes.Buffer 885 io.Copy(&snapshot, ringBuffer) 886 return out, metadata, &smithy.DeserializationError{ 887 Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), 888 Snapshot: snapshot.Bytes(), 889 } 890 } 891 892 return out, metadata, err 893} 894 895func awsRestjson1_deserializeOpErrorCreateWebhook(response *smithyhttp.Response, metadata *middleware.Metadata) error { 896 var errorBuffer bytes.Buffer 897 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 898 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 899 } 900 errorBody := bytes.NewReader(errorBuffer.Bytes()) 901 902 errorCode := "UnknownError" 903 errorMessage := errorCode 904 905 code := response.Header.Get("X-Amzn-ErrorType") 906 if len(code) != 0 { 907 errorCode = restjson.SanitizeErrorCode(code) 908 } 909 910 var buff [1024]byte 911 ringBuffer := smithyio.NewRingBuffer(buff[:]) 912 913 body := io.TeeReader(errorBody, ringBuffer) 914 decoder := json.NewDecoder(body) 915 decoder.UseNumber() 916 code, message, err := restjson.GetErrorInfo(decoder) 917 if err != nil { 918 var snapshot bytes.Buffer 919 io.Copy(&snapshot, ringBuffer) 920 err = &smithy.DeserializationError{ 921 Err: fmt.Errorf("failed to decode response body, %w", err), 922 Snapshot: snapshot.Bytes(), 923 } 924 return err 925 } 926 927 errorBody.Seek(0, io.SeekStart) 928 if len(code) != 0 { 929 errorCode = restjson.SanitizeErrorCode(code) 930 } 931 if len(message) != 0 { 932 errorMessage = message 933 } 934 935 switch { 936 case strings.EqualFold("BadRequestException", errorCode): 937 return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) 938 939 case strings.EqualFold("DependentServiceFailureException", errorCode): 940 return awsRestjson1_deserializeErrorDependentServiceFailureException(response, errorBody) 941 942 case strings.EqualFold("InternalFailureException", errorCode): 943 return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) 944 945 case strings.EqualFold("LimitExceededException", errorCode): 946 return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) 947 948 case strings.EqualFold("NotFoundException", errorCode): 949 return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) 950 951 case strings.EqualFold("UnauthorizedException", errorCode): 952 return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody) 953 954 default: 955 genericError := &smithy.GenericAPIError{ 956 Code: errorCode, 957 Message: errorMessage, 958 } 959 return genericError 960 961 } 962} 963 964func awsRestjson1_deserializeOpDocumentCreateWebhookOutput(v **CreateWebhookOutput, value interface{}) error { 965 if v == nil { 966 return fmt.Errorf("unexpected nil of type %T", v) 967 } 968 if value == nil { 969 return nil 970 } 971 972 shape, ok := value.(map[string]interface{}) 973 if !ok { 974 return fmt.Errorf("unexpected JSON type %v", value) 975 } 976 977 var sv *CreateWebhookOutput 978 if *v == nil { 979 sv = &CreateWebhookOutput{} 980 } else { 981 sv = *v 982 } 983 984 for key, value := range shape { 985 switch key { 986 case "webhook": 987 if err := awsRestjson1_deserializeDocumentWebhook(&sv.Webhook, value); err != nil { 988 return err 989 } 990 991 default: 992 _, _ = key, value 993 994 } 995 } 996 *v = sv 997 return nil 998} 999 1000type awsRestjson1_deserializeOpDeleteApp struct { 1001} 1002 1003func (*awsRestjson1_deserializeOpDeleteApp) ID() string { 1004 return "OperationDeserializer" 1005} 1006 1007func (m *awsRestjson1_deserializeOpDeleteApp) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 1008 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 1009) { 1010 out, metadata, err = next.HandleDeserialize(ctx, in) 1011 if err != nil { 1012 return out, metadata, err 1013 } 1014 1015 response, ok := out.RawResponse.(*smithyhttp.Response) 1016 if !ok { 1017 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 1018 } 1019 1020 if response.StatusCode < 200 || response.StatusCode >= 300 { 1021 return out, metadata, awsRestjson1_deserializeOpErrorDeleteApp(response, &metadata) 1022 } 1023 output := &DeleteAppOutput{} 1024 out.Result = output 1025 1026 var buff [1024]byte 1027 ringBuffer := smithyio.NewRingBuffer(buff[:]) 1028 1029 body := io.TeeReader(response.Body, ringBuffer) 1030 1031 decoder := json.NewDecoder(body) 1032 decoder.UseNumber() 1033 var shape interface{} 1034 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 1035 var snapshot bytes.Buffer 1036 io.Copy(&snapshot, ringBuffer) 1037 err = &smithy.DeserializationError{ 1038 Err: fmt.Errorf("failed to decode response body, %w", err), 1039 Snapshot: snapshot.Bytes(), 1040 } 1041 return out, metadata, err 1042 } 1043 1044 err = awsRestjson1_deserializeOpDocumentDeleteAppOutput(&output, shape) 1045 if err != nil { 1046 var snapshot bytes.Buffer 1047 io.Copy(&snapshot, ringBuffer) 1048 return out, metadata, &smithy.DeserializationError{ 1049 Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), 1050 Snapshot: snapshot.Bytes(), 1051 } 1052 } 1053 1054 return out, metadata, err 1055} 1056 1057func awsRestjson1_deserializeOpErrorDeleteApp(response *smithyhttp.Response, metadata *middleware.Metadata) error { 1058 var errorBuffer bytes.Buffer 1059 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 1060 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 1061 } 1062 errorBody := bytes.NewReader(errorBuffer.Bytes()) 1063 1064 errorCode := "UnknownError" 1065 errorMessage := errorCode 1066 1067 code := response.Header.Get("X-Amzn-ErrorType") 1068 if len(code) != 0 { 1069 errorCode = restjson.SanitizeErrorCode(code) 1070 } 1071 1072 var buff [1024]byte 1073 ringBuffer := smithyio.NewRingBuffer(buff[:]) 1074 1075 body := io.TeeReader(errorBody, ringBuffer) 1076 decoder := json.NewDecoder(body) 1077 decoder.UseNumber() 1078 code, message, err := restjson.GetErrorInfo(decoder) 1079 if err != nil { 1080 var snapshot bytes.Buffer 1081 io.Copy(&snapshot, ringBuffer) 1082 err = &smithy.DeserializationError{ 1083 Err: fmt.Errorf("failed to decode response body, %w", err), 1084 Snapshot: snapshot.Bytes(), 1085 } 1086 return err 1087 } 1088 1089 errorBody.Seek(0, io.SeekStart) 1090 if len(code) != 0 { 1091 errorCode = restjson.SanitizeErrorCode(code) 1092 } 1093 if len(message) != 0 { 1094 errorMessage = message 1095 } 1096 1097 switch { 1098 case strings.EqualFold("BadRequestException", errorCode): 1099 return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) 1100 1101 case strings.EqualFold("DependentServiceFailureException", errorCode): 1102 return awsRestjson1_deserializeErrorDependentServiceFailureException(response, errorBody) 1103 1104 case strings.EqualFold("InternalFailureException", errorCode): 1105 return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) 1106 1107 case strings.EqualFold("NotFoundException", errorCode): 1108 return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) 1109 1110 case strings.EqualFold("UnauthorizedException", errorCode): 1111 return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody) 1112 1113 default: 1114 genericError := &smithy.GenericAPIError{ 1115 Code: errorCode, 1116 Message: errorMessage, 1117 } 1118 return genericError 1119 1120 } 1121} 1122 1123func awsRestjson1_deserializeOpDocumentDeleteAppOutput(v **DeleteAppOutput, value interface{}) error { 1124 if v == nil { 1125 return fmt.Errorf("unexpected nil of type %T", v) 1126 } 1127 if value == nil { 1128 return nil 1129 } 1130 1131 shape, ok := value.(map[string]interface{}) 1132 if !ok { 1133 return fmt.Errorf("unexpected JSON type %v", value) 1134 } 1135 1136 var sv *DeleteAppOutput 1137 if *v == nil { 1138 sv = &DeleteAppOutput{} 1139 } else { 1140 sv = *v 1141 } 1142 1143 for key, value := range shape { 1144 switch key { 1145 case "app": 1146 if err := awsRestjson1_deserializeDocumentApp(&sv.App, value); err != nil { 1147 return err 1148 } 1149 1150 default: 1151 _, _ = key, value 1152 1153 } 1154 } 1155 *v = sv 1156 return nil 1157} 1158 1159type awsRestjson1_deserializeOpDeleteBackendEnvironment struct { 1160} 1161 1162func (*awsRestjson1_deserializeOpDeleteBackendEnvironment) ID() string { 1163 return "OperationDeserializer" 1164} 1165 1166func (m *awsRestjson1_deserializeOpDeleteBackendEnvironment) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 1167 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 1168) { 1169 out, metadata, err = next.HandleDeserialize(ctx, in) 1170 if err != nil { 1171 return out, metadata, err 1172 } 1173 1174 response, ok := out.RawResponse.(*smithyhttp.Response) 1175 if !ok { 1176 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 1177 } 1178 1179 if response.StatusCode < 200 || response.StatusCode >= 300 { 1180 return out, metadata, awsRestjson1_deserializeOpErrorDeleteBackendEnvironment(response, &metadata) 1181 } 1182 output := &DeleteBackendEnvironmentOutput{} 1183 out.Result = output 1184 1185 var buff [1024]byte 1186 ringBuffer := smithyio.NewRingBuffer(buff[:]) 1187 1188 body := io.TeeReader(response.Body, ringBuffer) 1189 1190 decoder := json.NewDecoder(body) 1191 decoder.UseNumber() 1192 var shape interface{} 1193 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 1194 var snapshot bytes.Buffer 1195 io.Copy(&snapshot, ringBuffer) 1196 err = &smithy.DeserializationError{ 1197 Err: fmt.Errorf("failed to decode response body, %w", err), 1198 Snapshot: snapshot.Bytes(), 1199 } 1200 return out, metadata, err 1201 } 1202 1203 err = awsRestjson1_deserializeOpDocumentDeleteBackendEnvironmentOutput(&output, shape) 1204 if err != nil { 1205 var snapshot bytes.Buffer 1206 io.Copy(&snapshot, ringBuffer) 1207 return out, metadata, &smithy.DeserializationError{ 1208 Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), 1209 Snapshot: snapshot.Bytes(), 1210 } 1211 } 1212 1213 return out, metadata, err 1214} 1215 1216func awsRestjson1_deserializeOpErrorDeleteBackendEnvironment(response *smithyhttp.Response, metadata *middleware.Metadata) error { 1217 var errorBuffer bytes.Buffer 1218 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 1219 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 1220 } 1221 errorBody := bytes.NewReader(errorBuffer.Bytes()) 1222 1223 errorCode := "UnknownError" 1224 errorMessage := errorCode 1225 1226 code := response.Header.Get("X-Amzn-ErrorType") 1227 if len(code) != 0 { 1228 errorCode = restjson.SanitizeErrorCode(code) 1229 } 1230 1231 var buff [1024]byte 1232 ringBuffer := smithyio.NewRingBuffer(buff[:]) 1233 1234 body := io.TeeReader(errorBody, ringBuffer) 1235 decoder := json.NewDecoder(body) 1236 decoder.UseNumber() 1237 code, message, err := restjson.GetErrorInfo(decoder) 1238 if err != nil { 1239 var snapshot bytes.Buffer 1240 io.Copy(&snapshot, ringBuffer) 1241 err = &smithy.DeserializationError{ 1242 Err: fmt.Errorf("failed to decode response body, %w", err), 1243 Snapshot: snapshot.Bytes(), 1244 } 1245 return err 1246 } 1247 1248 errorBody.Seek(0, io.SeekStart) 1249 if len(code) != 0 { 1250 errorCode = restjson.SanitizeErrorCode(code) 1251 } 1252 if len(message) != 0 { 1253 errorMessage = message 1254 } 1255 1256 switch { 1257 case strings.EqualFold("BadRequestException", errorCode): 1258 return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) 1259 1260 case strings.EqualFold("DependentServiceFailureException", errorCode): 1261 return awsRestjson1_deserializeErrorDependentServiceFailureException(response, errorBody) 1262 1263 case strings.EqualFold("InternalFailureException", errorCode): 1264 return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) 1265 1266 case strings.EqualFold("NotFoundException", errorCode): 1267 return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) 1268 1269 case strings.EqualFold("UnauthorizedException", errorCode): 1270 return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody) 1271 1272 default: 1273 genericError := &smithy.GenericAPIError{ 1274 Code: errorCode, 1275 Message: errorMessage, 1276 } 1277 return genericError 1278 1279 } 1280} 1281 1282func awsRestjson1_deserializeOpDocumentDeleteBackendEnvironmentOutput(v **DeleteBackendEnvironmentOutput, value interface{}) error { 1283 if v == nil { 1284 return fmt.Errorf("unexpected nil of type %T", v) 1285 } 1286 if value == nil { 1287 return nil 1288 } 1289 1290 shape, ok := value.(map[string]interface{}) 1291 if !ok { 1292 return fmt.Errorf("unexpected JSON type %v", value) 1293 } 1294 1295 var sv *DeleteBackendEnvironmentOutput 1296 if *v == nil { 1297 sv = &DeleteBackendEnvironmentOutput{} 1298 } else { 1299 sv = *v 1300 } 1301 1302 for key, value := range shape { 1303 switch key { 1304 case "backendEnvironment": 1305 if err := awsRestjson1_deserializeDocumentBackendEnvironment(&sv.BackendEnvironment, value); err != nil { 1306 return err 1307 } 1308 1309 default: 1310 _, _ = key, value 1311 1312 } 1313 } 1314 *v = sv 1315 return nil 1316} 1317 1318type awsRestjson1_deserializeOpDeleteBranch struct { 1319} 1320 1321func (*awsRestjson1_deserializeOpDeleteBranch) ID() string { 1322 return "OperationDeserializer" 1323} 1324 1325func (m *awsRestjson1_deserializeOpDeleteBranch) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 1326 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 1327) { 1328 out, metadata, err = next.HandleDeserialize(ctx, in) 1329 if err != nil { 1330 return out, metadata, err 1331 } 1332 1333 response, ok := out.RawResponse.(*smithyhttp.Response) 1334 if !ok { 1335 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 1336 } 1337 1338 if response.StatusCode < 200 || response.StatusCode >= 300 { 1339 return out, metadata, awsRestjson1_deserializeOpErrorDeleteBranch(response, &metadata) 1340 } 1341 output := &DeleteBranchOutput{} 1342 out.Result = output 1343 1344 var buff [1024]byte 1345 ringBuffer := smithyio.NewRingBuffer(buff[:]) 1346 1347 body := io.TeeReader(response.Body, ringBuffer) 1348 1349 decoder := json.NewDecoder(body) 1350 decoder.UseNumber() 1351 var shape interface{} 1352 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 1353 var snapshot bytes.Buffer 1354 io.Copy(&snapshot, ringBuffer) 1355 err = &smithy.DeserializationError{ 1356 Err: fmt.Errorf("failed to decode response body, %w", err), 1357 Snapshot: snapshot.Bytes(), 1358 } 1359 return out, metadata, err 1360 } 1361 1362 err = awsRestjson1_deserializeOpDocumentDeleteBranchOutput(&output, shape) 1363 if err != nil { 1364 var snapshot bytes.Buffer 1365 io.Copy(&snapshot, ringBuffer) 1366 return out, metadata, &smithy.DeserializationError{ 1367 Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), 1368 Snapshot: snapshot.Bytes(), 1369 } 1370 } 1371 1372 return out, metadata, err 1373} 1374 1375func awsRestjson1_deserializeOpErrorDeleteBranch(response *smithyhttp.Response, metadata *middleware.Metadata) error { 1376 var errorBuffer bytes.Buffer 1377 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 1378 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 1379 } 1380 errorBody := bytes.NewReader(errorBuffer.Bytes()) 1381 1382 errorCode := "UnknownError" 1383 errorMessage := errorCode 1384 1385 code := response.Header.Get("X-Amzn-ErrorType") 1386 if len(code) != 0 { 1387 errorCode = restjson.SanitizeErrorCode(code) 1388 } 1389 1390 var buff [1024]byte 1391 ringBuffer := smithyio.NewRingBuffer(buff[:]) 1392 1393 body := io.TeeReader(errorBody, ringBuffer) 1394 decoder := json.NewDecoder(body) 1395 decoder.UseNumber() 1396 code, message, err := restjson.GetErrorInfo(decoder) 1397 if err != nil { 1398 var snapshot bytes.Buffer 1399 io.Copy(&snapshot, ringBuffer) 1400 err = &smithy.DeserializationError{ 1401 Err: fmt.Errorf("failed to decode response body, %w", err), 1402 Snapshot: snapshot.Bytes(), 1403 } 1404 return err 1405 } 1406 1407 errorBody.Seek(0, io.SeekStart) 1408 if len(code) != 0 { 1409 errorCode = restjson.SanitizeErrorCode(code) 1410 } 1411 if len(message) != 0 { 1412 errorMessage = message 1413 } 1414 1415 switch { 1416 case strings.EqualFold("BadRequestException", errorCode): 1417 return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) 1418 1419 case strings.EqualFold("DependentServiceFailureException", errorCode): 1420 return awsRestjson1_deserializeErrorDependentServiceFailureException(response, errorBody) 1421 1422 case strings.EqualFold("InternalFailureException", errorCode): 1423 return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) 1424 1425 case strings.EqualFold("NotFoundException", errorCode): 1426 return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) 1427 1428 case strings.EqualFold("UnauthorizedException", errorCode): 1429 return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody) 1430 1431 default: 1432 genericError := &smithy.GenericAPIError{ 1433 Code: errorCode, 1434 Message: errorMessage, 1435 } 1436 return genericError 1437 1438 } 1439} 1440 1441func awsRestjson1_deserializeOpDocumentDeleteBranchOutput(v **DeleteBranchOutput, value interface{}) error { 1442 if v == nil { 1443 return fmt.Errorf("unexpected nil of type %T", v) 1444 } 1445 if value == nil { 1446 return nil 1447 } 1448 1449 shape, ok := value.(map[string]interface{}) 1450 if !ok { 1451 return fmt.Errorf("unexpected JSON type %v", value) 1452 } 1453 1454 var sv *DeleteBranchOutput 1455 if *v == nil { 1456 sv = &DeleteBranchOutput{} 1457 } else { 1458 sv = *v 1459 } 1460 1461 for key, value := range shape { 1462 switch key { 1463 case "branch": 1464 if err := awsRestjson1_deserializeDocumentBranch(&sv.Branch, value); err != nil { 1465 return err 1466 } 1467 1468 default: 1469 _, _ = key, value 1470 1471 } 1472 } 1473 *v = sv 1474 return nil 1475} 1476 1477type awsRestjson1_deserializeOpDeleteDomainAssociation struct { 1478} 1479 1480func (*awsRestjson1_deserializeOpDeleteDomainAssociation) ID() string { 1481 return "OperationDeserializer" 1482} 1483 1484func (m *awsRestjson1_deserializeOpDeleteDomainAssociation) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 1485 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 1486) { 1487 out, metadata, err = next.HandleDeserialize(ctx, in) 1488 if err != nil { 1489 return out, metadata, err 1490 } 1491 1492 response, ok := out.RawResponse.(*smithyhttp.Response) 1493 if !ok { 1494 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 1495 } 1496 1497 if response.StatusCode < 200 || response.StatusCode >= 300 { 1498 return out, metadata, awsRestjson1_deserializeOpErrorDeleteDomainAssociation(response, &metadata) 1499 } 1500 output := &DeleteDomainAssociationOutput{} 1501 out.Result = output 1502 1503 var buff [1024]byte 1504 ringBuffer := smithyio.NewRingBuffer(buff[:]) 1505 1506 body := io.TeeReader(response.Body, ringBuffer) 1507 1508 decoder := json.NewDecoder(body) 1509 decoder.UseNumber() 1510 var shape interface{} 1511 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 1512 var snapshot bytes.Buffer 1513 io.Copy(&snapshot, ringBuffer) 1514 err = &smithy.DeserializationError{ 1515 Err: fmt.Errorf("failed to decode response body, %w", err), 1516 Snapshot: snapshot.Bytes(), 1517 } 1518 return out, metadata, err 1519 } 1520 1521 err = awsRestjson1_deserializeOpDocumentDeleteDomainAssociationOutput(&output, shape) 1522 if err != nil { 1523 var snapshot bytes.Buffer 1524 io.Copy(&snapshot, ringBuffer) 1525 return out, metadata, &smithy.DeserializationError{ 1526 Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), 1527 Snapshot: snapshot.Bytes(), 1528 } 1529 } 1530 1531 return out, metadata, err 1532} 1533 1534func awsRestjson1_deserializeOpErrorDeleteDomainAssociation(response *smithyhttp.Response, metadata *middleware.Metadata) error { 1535 var errorBuffer bytes.Buffer 1536 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 1537 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 1538 } 1539 errorBody := bytes.NewReader(errorBuffer.Bytes()) 1540 1541 errorCode := "UnknownError" 1542 errorMessage := errorCode 1543 1544 code := response.Header.Get("X-Amzn-ErrorType") 1545 if len(code) != 0 { 1546 errorCode = restjson.SanitizeErrorCode(code) 1547 } 1548 1549 var buff [1024]byte 1550 ringBuffer := smithyio.NewRingBuffer(buff[:]) 1551 1552 body := io.TeeReader(errorBody, ringBuffer) 1553 decoder := json.NewDecoder(body) 1554 decoder.UseNumber() 1555 code, message, err := restjson.GetErrorInfo(decoder) 1556 if err != nil { 1557 var snapshot bytes.Buffer 1558 io.Copy(&snapshot, ringBuffer) 1559 err = &smithy.DeserializationError{ 1560 Err: fmt.Errorf("failed to decode response body, %w", err), 1561 Snapshot: snapshot.Bytes(), 1562 } 1563 return err 1564 } 1565 1566 errorBody.Seek(0, io.SeekStart) 1567 if len(code) != 0 { 1568 errorCode = restjson.SanitizeErrorCode(code) 1569 } 1570 if len(message) != 0 { 1571 errorMessage = message 1572 } 1573 1574 switch { 1575 case strings.EqualFold("BadRequestException", errorCode): 1576 return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) 1577 1578 case strings.EqualFold("DependentServiceFailureException", errorCode): 1579 return awsRestjson1_deserializeErrorDependentServiceFailureException(response, errorBody) 1580 1581 case strings.EqualFold("InternalFailureException", errorCode): 1582 return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) 1583 1584 case strings.EqualFold("NotFoundException", errorCode): 1585 return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) 1586 1587 case strings.EqualFold("UnauthorizedException", errorCode): 1588 return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody) 1589 1590 default: 1591 genericError := &smithy.GenericAPIError{ 1592 Code: errorCode, 1593 Message: errorMessage, 1594 } 1595 return genericError 1596 1597 } 1598} 1599 1600func awsRestjson1_deserializeOpDocumentDeleteDomainAssociationOutput(v **DeleteDomainAssociationOutput, value interface{}) error { 1601 if v == nil { 1602 return fmt.Errorf("unexpected nil of type %T", v) 1603 } 1604 if value == nil { 1605 return nil 1606 } 1607 1608 shape, ok := value.(map[string]interface{}) 1609 if !ok { 1610 return fmt.Errorf("unexpected JSON type %v", value) 1611 } 1612 1613 var sv *DeleteDomainAssociationOutput 1614 if *v == nil { 1615 sv = &DeleteDomainAssociationOutput{} 1616 } else { 1617 sv = *v 1618 } 1619 1620 for key, value := range shape { 1621 switch key { 1622 case "domainAssociation": 1623 if err := awsRestjson1_deserializeDocumentDomainAssociation(&sv.DomainAssociation, value); err != nil { 1624 return err 1625 } 1626 1627 default: 1628 _, _ = key, value 1629 1630 } 1631 } 1632 *v = sv 1633 return nil 1634} 1635 1636type awsRestjson1_deserializeOpDeleteJob struct { 1637} 1638 1639func (*awsRestjson1_deserializeOpDeleteJob) ID() string { 1640 return "OperationDeserializer" 1641} 1642 1643func (m *awsRestjson1_deserializeOpDeleteJob) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 1644 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 1645) { 1646 out, metadata, err = next.HandleDeserialize(ctx, in) 1647 if err != nil { 1648 return out, metadata, err 1649 } 1650 1651 response, ok := out.RawResponse.(*smithyhttp.Response) 1652 if !ok { 1653 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 1654 } 1655 1656 if response.StatusCode < 200 || response.StatusCode >= 300 { 1657 return out, metadata, awsRestjson1_deserializeOpErrorDeleteJob(response, &metadata) 1658 } 1659 output := &DeleteJobOutput{} 1660 out.Result = output 1661 1662 var buff [1024]byte 1663 ringBuffer := smithyio.NewRingBuffer(buff[:]) 1664 1665 body := io.TeeReader(response.Body, ringBuffer) 1666 1667 decoder := json.NewDecoder(body) 1668 decoder.UseNumber() 1669 var shape interface{} 1670 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 1671 var snapshot bytes.Buffer 1672 io.Copy(&snapshot, ringBuffer) 1673 err = &smithy.DeserializationError{ 1674 Err: fmt.Errorf("failed to decode response body, %w", err), 1675 Snapshot: snapshot.Bytes(), 1676 } 1677 return out, metadata, err 1678 } 1679 1680 err = awsRestjson1_deserializeOpDocumentDeleteJobOutput(&output, shape) 1681 if err != nil { 1682 var snapshot bytes.Buffer 1683 io.Copy(&snapshot, ringBuffer) 1684 return out, metadata, &smithy.DeserializationError{ 1685 Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), 1686 Snapshot: snapshot.Bytes(), 1687 } 1688 } 1689 1690 return out, metadata, err 1691} 1692 1693func awsRestjson1_deserializeOpErrorDeleteJob(response *smithyhttp.Response, metadata *middleware.Metadata) error { 1694 var errorBuffer bytes.Buffer 1695 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 1696 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 1697 } 1698 errorBody := bytes.NewReader(errorBuffer.Bytes()) 1699 1700 errorCode := "UnknownError" 1701 errorMessage := errorCode 1702 1703 code := response.Header.Get("X-Amzn-ErrorType") 1704 if len(code) != 0 { 1705 errorCode = restjson.SanitizeErrorCode(code) 1706 } 1707 1708 var buff [1024]byte 1709 ringBuffer := smithyio.NewRingBuffer(buff[:]) 1710 1711 body := io.TeeReader(errorBody, ringBuffer) 1712 decoder := json.NewDecoder(body) 1713 decoder.UseNumber() 1714 code, message, err := restjson.GetErrorInfo(decoder) 1715 if err != nil { 1716 var snapshot bytes.Buffer 1717 io.Copy(&snapshot, ringBuffer) 1718 err = &smithy.DeserializationError{ 1719 Err: fmt.Errorf("failed to decode response body, %w", err), 1720 Snapshot: snapshot.Bytes(), 1721 } 1722 return err 1723 } 1724 1725 errorBody.Seek(0, io.SeekStart) 1726 if len(code) != 0 { 1727 errorCode = restjson.SanitizeErrorCode(code) 1728 } 1729 if len(message) != 0 { 1730 errorMessage = message 1731 } 1732 1733 switch { 1734 case strings.EqualFold("BadRequestException", errorCode): 1735 return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) 1736 1737 case strings.EqualFold("InternalFailureException", errorCode): 1738 return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) 1739 1740 case strings.EqualFold("LimitExceededException", errorCode): 1741 return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) 1742 1743 case strings.EqualFold("NotFoundException", errorCode): 1744 return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) 1745 1746 case strings.EqualFold("UnauthorizedException", errorCode): 1747 return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody) 1748 1749 default: 1750 genericError := &smithy.GenericAPIError{ 1751 Code: errorCode, 1752 Message: errorMessage, 1753 } 1754 return genericError 1755 1756 } 1757} 1758 1759func awsRestjson1_deserializeOpDocumentDeleteJobOutput(v **DeleteJobOutput, value interface{}) error { 1760 if v == nil { 1761 return fmt.Errorf("unexpected nil of type %T", v) 1762 } 1763 if value == nil { 1764 return nil 1765 } 1766 1767 shape, ok := value.(map[string]interface{}) 1768 if !ok { 1769 return fmt.Errorf("unexpected JSON type %v", value) 1770 } 1771 1772 var sv *DeleteJobOutput 1773 if *v == nil { 1774 sv = &DeleteJobOutput{} 1775 } else { 1776 sv = *v 1777 } 1778 1779 for key, value := range shape { 1780 switch key { 1781 case "jobSummary": 1782 if err := awsRestjson1_deserializeDocumentJobSummary(&sv.JobSummary, value); err != nil { 1783 return err 1784 } 1785 1786 default: 1787 _, _ = key, value 1788 1789 } 1790 } 1791 *v = sv 1792 return nil 1793} 1794 1795type awsRestjson1_deserializeOpDeleteWebhook struct { 1796} 1797 1798func (*awsRestjson1_deserializeOpDeleteWebhook) ID() string { 1799 return "OperationDeserializer" 1800} 1801 1802func (m *awsRestjson1_deserializeOpDeleteWebhook) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 1803 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 1804) { 1805 out, metadata, err = next.HandleDeserialize(ctx, in) 1806 if err != nil { 1807 return out, metadata, err 1808 } 1809 1810 response, ok := out.RawResponse.(*smithyhttp.Response) 1811 if !ok { 1812 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 1813 } 1814 1815 if response.StatusCode < 200 || response.StatusCode >= 300 { 1816 return out, metadata, awsRestjson1_deserializeOpErrorDeleteWebhook(response, &metadata) 1817 } 1818 output := &DeleteWebhookOutput{} 1819 out.Result = output 1820 1821 var buff [1024]byte 1822 ringBuffer := smithyio.NewRingBuffer(buff[:]) 1823 1824 body := io.TeeReader(response.Body, ringBuffer) 1825 1826 decoder := json.NewDecoder(body) 1827 decoder.UseNumber() 1828 var shape interface{} 1829 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 1830 var snapshot bytes.Buffer 1831 io.Copy(&snapshot, ringBuffer) 1832 err = &smithy.DeserializationError{ 1833 Err: fmt.Errorf("failed to decode response body, %w", err), 1834 Snapshot: snapshot.Bytes(), 1835 } 1836 return out, metadata, err 1837 } 1838 1839 err = awsRestjson1_deserializeOpDocumentDeleteWebhookOutput(&output, shape) 1840 if err != nil { 1841 var snapshot bytes.Buffer 1842 io.Copy(&snapshot, ringBuffer) 1843 return out, metadata, &smithy.DeserializationError{ 1844 Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), 1845 Snapshot: snapshot.Bytes(), 1846 } 1847 } 1848 1849 return out, metadata, err 1850} 1851 1852func awsRestjson1_deserializeOpErrorDeleteWebhook(response *smithyhttp.Response, metadata *middleware.Metadata) error { 1853 var errorBuffer bytes.Buffer 1854 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 1855 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 1856 } 1857 errorBody := bytes.NewReader(errorBuffer.Bytes()) 1858 1859 errorCode := "UnknownError" 1860 errorMessage := errorCode 1861 1862 code := response.Header.Get("X-Amzn-ErrorType") 1863 if len(code) != 0 { 1864 errorCode = restjson.SanitizeErrorCode(code) 1865 } 1866 1867 var buff [1024]byte 1868 ringBuffer := smithyio.NewRingBuffer(buff[:]) 1869 1870 body := io.TeeReader(errorBody, ringBuffer) 1871 decoder := json.NewDecoder(body) 1872 decoder.UseNumber() 1873 code, message, err := restjson.GetErrorInfo(decoder) 1874 if err != nil { 1875 var snapshot bytes.Buffer 1876 io.Copy(&snapshot, ringBuffer) 1877 err = &smithy.DeserializationError{ 1878 Err: fmt.Errorf("failed to decode response body, %w", err), 1879 Snapshot: snapshot.Bytes(), 1880 } 1881 return err 1882 } 1883 1884 errorBody.Seek(0, io.SeekStart) 1885 if len(code) != 0 { 1886 errorCode = restjson.SanitizeErrorCode(code) 1887 } 1888 if len(message) != 0 { 1889 errorMessage = message 1890 } 1891 1892 switch { 1893 case strings.EqualFold("BadRequestException", errorCode): 1894 return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) 1895 1896 case strings.EqualFold("InternalFailureException", errorCode): 1897 return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) 1898 1899 case strings.EqualFold("LimitExceededException", errorCode): 1900 return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) 1901 1902 case strings.EqualFold("NotFoundException", errorCode): 1903 return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) 1904 1905 case strings.EqualFold("UnauthorizedException", errorCode): 1906 return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody) 1907 1908 default: 1909 genericError := &smithy.GenericAPIError{ 1910 Code: errorCode, 1911 Message: errorMessage, 1912 } 1913 return genericError 1914 1915 } 1916} 1917 1918func awsRestjson1_deserializeOpDocumentDeleteWebhookOutput(v **DeleteWebhookOutput, value interface{}) error { 1919 if v == nil { 1920 return fmt.Errorf("unexpected nil of type %T", v) 1921 } 1922 if value == nil { 1923 return nil 1924 } 1925 1926 shape, ok := value.(map[string]interface{}) 1927 if !ok { 1928 return fmt.Errorf("unexpected JSON type %v", value) 1929 } 1930 1931 var sv *DeleteWebhookOutput 1932 if *v == nil { 1933 sv = &DeleteWebhookOutput{} 1934 } else { 1935 sv = *v 1936 } 1937 1938 for key, value := range shape { 1939 switch key { 1940 case "webhook": 1941 if err := awsRestjson1_deserializeDocumentWebhook(&sv.Webhook, value); err != nil { 1942 return err 1943 } 1944 1945 default: 1946 _, _ = key, value 1947 1948 } 1949 } 1950 *v = sv 1951 return nil 1952} 1953 1954type awsRestjson1_deserializeOpGenerateAccessLogs struct { 1955} 1956 1957func (*awsRestjson1_deserializeOpGenerateAccessLogs) ID() string { 1958 return "OperationDeserializer" 1959} 1960 1961func (m *awsRestjson1_deserializeOpGenerateAccessLogs) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 1962 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 1963) { 1964 out, metadata, err = next.HandleDeserialize(ctx, in) 1965 if err != nil { 1966 return out, metadata, err 1967 } 1968 1969 response, ok := out.RawResponse.(*smithyhttp.Response) 1970 if !ok { 1971 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 1972 } 1973 1974 if response.StatusCode < 200 || response.StatusCode >= 300 { 1975 return out, metadata, awsRestjson1_deserializeOpErrorGenerateAccessLogs(response, &metadata) 1976 } 1977 output := &GenerateAccessLogsOutput{} 1978 out.Result = output 1979 1980 var buff [1024]byte 1981 ringBuffer := smithyio.NewRingBuffer(buff[:]) 1982 1983 body := io.TeeReader(response.Body, ringBuffer) 1984 1985 decoder := json.NewDecoder(body) 1986 decoder.UseNumber() 1987 var shape interface{} 1988 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 1989 var snapshot bytes.Buffer 1990 io.Copy(&snapshot, ringBuffer) 1991 err = &smithy.DeserializationError{ 1992 Err: fmt.Errorf("failed to decode response body, %w", err), 1993 Snapshot: snapshot.Bytes(), 1994 } 1995 return out, metadata, err 1996 } 1997 1998 err = awsRestjson1_deserializeOpDocumentGenerateAccessLogsOutput(&output, shape) 1999 if err != nil { 2000 var snapshot bytes.Buffer 2001 io.Copy(&snapshot, ringBuffer) 2002 return out, metadata, &smithy.DeserializationError{ 2003 Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), 2004 Snapshot: snapshot.Bytes(), 2005 } 2006 } 2007 2008 return out, metadata, err 2009} 2010 2011func awsRestjson1_deserializeOpErrorGenerateAccessLogs(response *smithyhttp.Response, metadata *middleware.Metadata) error { 2012 var errorBuffer bytes.Buffer 2013 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 2014 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 2015 } 2016 errorBody := bytes.NewReader(errorBuffer.Bytes()) 2017 2018 errorCode := "UnknownError" 2019 errorMessage := errorCode 2020 2021 code := response.Header.Get("X-Amzn-ErrorType") 2022 if len(code) != 0 { 2023 errorCode = restjson.SanitizeErrorCode(code) 2024 } 2025 2026 var buff [1024]byte 2027 ringBuffer := smithyio.NewRingBuffer(buff[:]) 2028 2029 body := io.TeeReader(errorBody, ringBuffer) 2030 decoder := json.NewDecoder(body) 2031 decoder.UseNumber() 2032 code, message, err := restjson.GetErrorInfo(decoder) 2033 if err != nil { 2034 var snapshot bytes.Buffer 2035 io.Copy(&snapshot, ringBuffer) 2036 err = &smithy.DeserializationError{ 2037 Err: fmt.Errorf("failed to decode response body, %w", err), 2038 Snapshot: snapshot.Bytes(), 2039 } 2040 return err 2041 } 2042 2043 errorBody.Seek(0, io.SeekStart) 2044 if len(code) != 0 { 2045 errorCode = restjson.SanitizeErrorCode(code) 2046 } 2047 if len(message) != 0 { 2048 errorMessage = message 2049 } 2050 2051 switch { 2052 case strings.EqualFold("BadRequestException", errorCode): 2053 return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) 2054 2055 case strings.EqualFold("InternalFailureException", errorCode): 2056 return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) 2057 2058 case strings.EqualFold("NotFoundException", errorCode): 2059 return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) 2060 2061 case strings.EqualFold("UnauthorizedException", errorCode): 2062 return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody) 2063 2064 default: 2065 genericError := &smithy.GenericAPIError{ 2066 Code: errorCode, 2067 Message: errorMessage, 2068 } 2069 return genericError 2070 2071 } 2072} 2073 2074func awsRestjson1_deserializeOpDocumentGenerateAccessLogsOutput(v **GenerateAccessLogsOutput, value interface{}) error { 2075 if v == nil { 2076 return fmt.Errorf("unexpected nil of type %T", v) 2077 } 2078 if value == nil { 2079 return nil 2080 } 2081 2082 shape, ok := value.(map[string]interface{}) 2083 if !ok { 2084 return fmt.Errorf("unexpected JSON type %v", value) 2085 } 2086 2087 var sv *GenerateAccessLogsOutput 2088 if *v == nil { 2089 sv = &GenerateAccessLogsOutput{} 2090 } else { 2091 sv = *v 2092 } 2093 2094 for key, value := range shape { 2095 switch key { 2096 case "logUrl": 2097 if value != nil { 2098 jtv, ok := value.(string) 2099 if !ok { 2100 return fmt.Errorf("expected LogUrl to be of type string, got %T instead", value) 2101 } 2102 sv.LogUrl = ptr.String(jtv) 2103 } 2104 2105 default: 2106 _, _ = key, value 2107 2108 } 2109 } 2110 *v = sv 2111 return nil 2112} 2113 2114type awsRestjson1_deserializeOpGetApp struct { 2115} 2116 2117func (*awsRestjson1_deserializeOpGetApp) ID() string { 2118 return "OperationDeserializer" 2119} 2120 2121func (m *awsRestjson1_deserializeOpGetApp) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 2122 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 2123) { 2124 out, metadata, err = next.HandleDeserialize(ctx, in) 2125 if err != nil { 2126 return out, metadata, err 2127 } 2128 2129 response, ok := out.RawResponse.(*smithyhttp.Response) 2130 if !ok { 2131 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 2132 } 2133 2134 if response.StatusCode < 200 || response.StatusCode >= 300 { 2135 return out, metadata, awsRestjson1_deserializeOpErrorGetApp(response, &metadata) 2136 } 2137 output := &GetAppOutput{} 2138 out.Result = output 2139 2140 var buff [1024]byte 2141 ringBuffer := smithyio.NewRingBuffer(buff[:]) 2142 2143 body := io.TeeReader(response.Body, ringBuffer) 2144 2145 decoder := json.NewDecoder(body) 2146 decoder.UseNumber() 2147 var shape interface{} 2148 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 2149 var snapshot bytes.Buffer 2150 io.Copy(&snapshot, ringBuffer) 2151 err = &smithy.DeserializationError{ 2152 Err: fmt.Errorf("failed to decode response body, %w", err), 2153 Snapshot: snapshot.Bytes(), 2154 } 2155 return out, metadata, err 2156 } 2157 2158 err = awsRestjson1_deserializeOpDocumentGetAppOutput(&output, shape) 2159 if err != nil { 2160 var snapshot bytes.Buffer 2161 io.Copy(&snapshot, ringBuffer) 2162 return out, metadata, &smithy.DeserializationError{ 2163 Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), 2164 Snapshot: snapshot.Bytes(), 2165 } 2166 } 2167 2168 return out, metadata, err 2169} 2170 2171func awsRestjson1_deserializeOpErrorGetApp(response *smithyhttp.Response, metadata *middleware.Metadata) error { 2172 var errorBuffer bytes.Buffer 2173 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 2174 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 2175 } 2176 errorBody := bytes.NewReader(errorBuffer.Bytes()) 2177 2178 errorCode := "UnknownError" 2179 errorMessage := errorCode 2180 2181 code := response.Header.Get("X-Amzn-ErrorType") 2182 if len(code) != 0 { 2183 errorCode = restjson.SanitizeErrorCode(code) 2184 } 2185 2186 var buff [1024]byte 2187 ringBuffer := smithyio.NewRingBuffer(buff[:]) 2188 2189 body := io.TeeReader(errorBody, ringBuffer) 2190 decoder := json.NewDecoder(body) 2191 decoder.UseNumber() 2192 code, message, err := restjson.GetErrorInfo(decoder) 2193 if err != nil { 2194 var snapshot bytes.Buffer 2195 io.Copy(&snapshot, ringBuffer) 2196 err = &smithy.DeserializationError{ 2197 Err: fmt.Errorf("failed to decode response body, %w", err), 2198 Snapshot: snapshot.Bytes(), 2199 } 2200 return err 2201 } 2202 2203 errorBody.Seek(0, io.SeekStart) 2204 if len(code) != 0 { 2205 errorCode = restjson.SanitizeErrorCode(code) 2206 } 2207 if len(message) != 0 { 2208 errorMessage = message 2209 } 2210 2211 switch { 2212 case strings.EqualFold("BadRequestException", errorCode): 2213 return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) 2214 2215 case strings.EqualFold("InternalFailureException", errorCode): 2216 return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) 2217 2218 case strings.EqualFold("NotFoundException", errorCode): 2219 return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) 2220 2221 case strings.EqualFold("UnauthorizedException", errorCode): 2222 return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody) 2223 2224 default: 2225 genericError := &smithy.GenericAPIError{ 2226 Code: errorCode, 2227 Message: errorMessage, 2228 } 2229 return genericError 2230 2231 } 2232} 2233 2234func awsRestjson1_deserializeOpDocumentGetAppOutput(v **GetAppOutput, value interface{}) error { 2235 if v == nil { 2236 return fmt.Errorf("unexpected nil of type %T", v) 2237 } 2238 if value == nil { 2239 return nil 2240 } 2241 2242 shape, ok := value.(map[string]interface{}) 2243 if !ok { 2244 return fmt.Errorf("unexpected JSON type %v", value) 2245 } 2246 2247 var sv *GetAppOutput 2248 if *v == nil { 2249 sv = &GetAppOutput{} 2250 } else { 2251 sv = *v 2252 } 2253 2254 for key, value := range shape { 2255 switch key { 2256 case "app": 2257 if err := awsRestjson1_deserializeDocumentApp(&sv.App, value); err != nil { 2258 return err 2259 } 2260 2261 default: 2262 _, _ = key, value 2263 2264 } 2265 } 2266 *v = sv 2267 return nil 2268} 2269 2270type awsRestjson1_deserializeOpGetArtifactUrl struct { 2271} 2272 2273func (*awsRestjson1_deserializeOpGetArtifactUrl) ID() string { 2274 return "OperationDeserializer" 2275} 2276 2277func (m *awsRestjson1_deserializeOpGetArtifactUrl) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 2278 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 2279) { 2280 out, metadata, err = next.HandleDeserialize(ctx, in) 2281 if err != nil { 2282 return out, metadata, err 2283 } 2284 2285 response, ok := out.RawResponse.(*smithyhttp.Response) 2286 if !ok { 2287 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 2288 } 2289 2290 if response.StatusCode < 200 || response.StatusCode >= 300 { 2291 return out, metadata, awsRestjson1_deserializeOpErrorGetArtifactUrl(response, &metadata) 2292 } 2293 output := &GetArtifactUrlOutput{} 2294 out.Result = output 2295 2296 var buff [1024]byte 2297 ringBuffer := smithyio.NewRingBuffer(buff[:]) 2298 2299 body := io.TeeReader(response.Body, ringBuffer) 2300 2301 decoder := json.NewDecoder(body) 2302 decoder.UseNumber() 2303 var shape interface{} 2304 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 2305 var snapshot bytes.Buffer 2306 io.Copy(&snapshot, ringBuffer) 2307 err = &smithy.DeserializationError{ 2308 Err: fmt.Errorf("failed to decode response body, %w", err), 2309 Snapshot: snapshot.Bytes(), 2310 } 2311 return out, metadata, err 2312 } 2313 2314 err = awsRestjson1_deserializeOpDocumentGetArtifactUrlOutput(&output, shape) 2315 if err != nil { 2316 var snapshot bytes.Buffer 2317 io.Copy(&snapshot, ringBuffer) 2318 return out, metadata, &smithy.DeserializationError{ 2319 Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), 2320 Snapshot: snapshot.Bytes(), 2321 } 2322 } 2323 2324 return out, metadata, err 2325} 2326 2327func awsRestjson1_deserializeOpErrorGetArtifactUrl(response *smithyhttp.Response, metadata *middleware.Metadata) error { 2328 var errorBuffer bytes.Buffer 2329 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 2330 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 2331 } 2332 errorBody := bytes.NewReader(errorBuffer.Bytes()) 2333 2334 errorCode := "UnknownError" 2335 errorMessage := errorCode 2336 2337 code := response.Header.Get("X-Amzn-ErrorType") 2338 if len(code) != 0 { 2339 errorCode = restjson.SanitizeErrorCode(code) 2340 } 2341 2342 var buff [1024]byte 2343 ringBuffer := smithyio.NewRingBuffer(buff[:]) 2344 2345 body := io.TeeReader(errorBody, ringBuffer) 2346 decoder := json.NewDecoder(body) 2347 decoder.UseNumber() 2348 code, message, err := restjson.GetErrorInfo(decoder) 2349 if err != nil { 2350 var snapshot bytes.Buffer 2351 io.Copy(&snapshot, ringBuffer) 2352 err = &smithy.DeserializationError{ 2353 Err: fmt.Errorf("failed to decode response body, %w", err), 2354 Snapshot: snapshot.Bytes(), 2355 } 2356 return err 2357 } 2358 2359 errorBody.Seek(0, io.SeekStart) 2360 if len(code) != 0 { 2361 errorCode = restjson.SanitizeErrorCode(code) 2362 } 2363 if len(message) != 0 { 2364 errorMessage = message 2365 } 2366 2367 switch { 2368 case strings.EqualFold("BadRequestException", errorCode): 2369 return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) 2370 2371 case strings.EqualFold("InternalFailureException", errorCode): 2372 return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) 2373 2374 case strings.EqualFold("LimitExceededException", errorCode): 2375 return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) 2376 2377 case strings.EqualFold("NotFoundException", errorCode): 2378 return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) 2379 2380 case strings.EqualFold("UnauthorizedException", errorCode): 2381 return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody) 2382 2383 default: 2384 genericError := &smithy.GenericAPIError{ 2385 Code: errorCode, 2386 Message: errorMessage, 2387 } 2388 return genericError 2389 2390 } 2391} 2392 2393func awsRestjson1_deserializeOpDocumentGetArtifactUrlOutput(v **GetArtifactUrlOutput, value interface{}) error { 2394 if v == nil { 2395 return fmt.Errorf("unexpected nil of type %T", v) 2396 } 2397 if value == nil { 2398 return nil 2399 } 2400 2401 shape, ok := value.(map[string]interface{}) 2402 if !ok { 2403 return fmt.Errorf("unexpected JSON type %v", value) 2404 } 2405 2406 var sv *GetArtifactUrlOutput 2407 if *v == nil { 2408 sv = &GetArtifactUrlOutput{} 2409 } else { 2410 sv = *v 2411 } 2412 2413 for key, value := range shape { 2414 switch key { 2415 case "artifactId": 2416 if value != nil { 2417 jtv, ok := value.(string) 2418 if !ok { 2419 return fmt.Errorf("expected ArtifactId to be of type string, got %T instead", value) 2420 } 2421 sv.ArtifactId = ptr.String(jtv) 2422 } 2423 2424 case "artifactUrl": 2425 if value != nil { 2426 jtv, ok := value.(string) 2427 if !ok { 2428 return fmt.Errorf("expected ArtifactUrl to be of type string, got %T instead", value) 2429 } 2430 sv.ArtifactUrl = ptr.String(jtv) 2431 } 2432 2433 default: 2434 _, _ = key, value 2435 2436 } 2437 } 2438 *v = sv 2439 return nil 2440} 2441 2442type awsRestjson1_deserializeOpGetBackendEnvironment struct { 2443} 2444 2445func (*awsRestjson1_deserializeOpGetBackendEnvironment) ID() string { 2446 return "OperationDeserializer" 2447} 2448 2449func (m *awsRestjson1_deserializeOpGetBackendEnvironment) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 2450 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 2451) { 2452 out, metadata, err = next.HandleDeserialize(ctx, in) 2453 if err != nil { 2454 return out, metadata, err 2455 } 2456 2457 response, ok := out.RawResponse.(*smithyhttp.Response) 2458 if !ok { 2459 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 2460 } 2461 2462 if response.StatusCode < 200 || response.StatusCode >= 300 { 2463 return out, metadata, awsRestjson1_deserializeOpErrorGetBackendEnvironment(response, &metadata) 2464 } 2465 output := &GetBackendEnvironmentOutput{} 2466 out.Result = output 2467 2468 var buff [1024]byte 2469 ringBuffer := smithyio.NewRingBuffer(buff[:]) 2470 2471 body := io.TeeReader(response.Body, ringBuffer) 2472 2473 decoder := json.NewDecoder(body) 2474 decoder.UseNumber() 2475 var shape interface{} 2476 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 2477 var snapshot bytes.Buffer 2478 io.Copy(&snapshot, ringBuffer) 2479 err = &smithy.DeserializationError{ 2480 Err: fmt.Errorf("failed to decode response body, %w", err), 2481 Snapshot: snapshot.Bytes(), 2482 } 2483 return out, metadata, err 2484 } 2485 2486 err = awsRestjson1_deserializeOpDocumentGetBackendEnvironmentOutput(&output, shape) 2487 if err != nil { 2488 var snapshot bytes.Buffer 2489 io.Copy(&snapshot, ringBuffer) 2490 return out, metadata, &smithy.DeserializationError{ 2491 Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), 2492 Snapshot: snapshot.Bytes(), 2493 } 2494 } 2495 2496 return out, metadata, err 2497} 2498 2499func awsRestjson1_deserializeOpErrorGetBackendEnvironment(response *smithyhttp.Response, metadata *middleware.Metadata) error { 2500 var errorBuffer bytes.Buffer 2501 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 2502 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 2503 } 2504 errorBody := bytes.NewReader(errorBuffer.Bytes()) 2505 2506 errorCode := "UnknownError" 2507 errorMessage := errorCode 2508 2509 code := response.Header.Get("X-Amzn-ErrorType") 2510 if len(code) != 0 { 2511 errorCode = restjson.SanitizeErrorCode(code) 2512 } 2513 2514 var buff [1024]byte 2515 ringBuffer := smithyio.NewRingBuffer(buff[:]) 2516 2517 body := io.TeeReader(errorBody, ringBuffer) 2518 decoder := json.NewDecoder(body) 2519 decoder.UseNumber() 2520 code, message, err := restjson.GetErrorInfo(decoder) 2521 if err != nil { 2522 var snapshot bytes.Buffer 2523 io.Copy(&snapshot, ringBuffer) 2524 err = &smithy.DeserializationError{ 2525 Err: fmt.Errorf("failed to decode response body, %w", err), 2526 Snapshot: snapshot.Bytes(), 2527 } 2528 return err 2529 } 2530 2531 errorBody.Seek(0, io.SeekStart) 2532 if len(code) != 0 { 2533 errorCode = restjson.SanitizeErrorCode(code) 2534 } 2535 if len(message) != 0 { 2536 errorMessage = message 2537 } 2538 2539 switch { 2540 case strings.EqualFold("BadRequestException", errorCode): 2541 return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) 2542 2543 case strings.EqualFold("InternalFailureException", errorCode): 2544 return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) 2545 2546 case strings.EqualFold("NotFoundException", errorCode): 2547 return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) 2548 2549 case strings.EqualFold("UnauthorizedException", errorCode): 2550 return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody) 2551 2552 default: 2553 genericError := &smithy.GenericAPIError{ 2554 Code: errorCode, 2555 Message: errorMessage, 2556 } 2557 return genericError 2558 2559 } 2560} 2561 2562func awsRestjson1_deserializeOpDocumentGetBackendEnvironmentOutput(v **GetBackendEnvironmentOutput, value interface{}) error { 2563 if v == nil { 2564 return fmt.Errorf("unexpected nil of type %T", v) 2565 } 2566 if value == nil { 2567 return nil 2568 } 2569 2570 shape, ok := value.(map[string]interface{}) 2571 if !ok { 2572 return fmt.Errorf("unexpected JSON type %v", value) 2573 } 2574 2575 var sv *GetBackendEnvironmentOutput 2576 if *v == nil { 2577 sv = &GetBackendEnvironmentOutput{} 2578 } else { 2579 sv = *v 2580 } 2581 2582 for key, value := range shape { 2583 switch key { 2584 case "backendEnvironment": 2585 if err := awsRestjson1_deserializeDocumentBackendEnvironment(&sv.BackendEnvironment, value); err != nil { 2586 return err 2587 } 2588 2589 default: 2590 _, _ = key, value 2591 2592 } 2593 } 2594 *v = sv 2595 return nil 2596} 2597 2598type awsRestjson1_deserializeOpGetBranch struct { 2599} 2600 2601func (*awsRestjson1_deserializeOpGetBranch) ID() string { 2602 return "OperationDeserializer" 2603} 2604 2605func (m *awsRestjson1_deserializeOpGetBranch) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 2606 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 2607) { 2608 out, metadata, err = next.HandleDeserialize(ctx, in) 2609 if err != nil { 2610 return out, metadata, err 2611 } 2612 2613 response, ok := out.RawResponse.(*smithyhttp.Response) 2614 if !ok { 2615 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 2616 } 2617 2618 if response.StatusCode < 200 || response.StatusCode >= 300 { 2619 return out, metadata, awsRestjson1_deserializeOpErrorGetBranch(response, &metadata) 2620 } 2621 output := &GetBranchOutput{} 2622 out.Result = output 2623 2624 var buff [1024]byte 2625 ringBuffer := smithyio.NewRingBuffer(buff[:]) 2626 2627 body := io.TeeReader(response.Body, ringBuffer) 2628 2629 decoder := json.NewDecoder(body) 2630 decoder.UseNumber() 2631 var shape interface{} 2632 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 2633 var snapshot bytes.Buffer 2634 io.Copy(&snapshot, ringBuffer) 2635 err = &smithy.DeserializationError{ 2636 Err: fmt.Errorf("failed to decode response body, %w", err), 2637 Snapshot: snapshot.Bytes(), 2638 } 2639 return out, metadata, err 2640 } 2641 2642 err = awsRestjson1_deserializeOpDocumentGetBranchOutput(&output, shape) 2643 if err != nil { 2644 var snapshot bytes.Buffer 2645 io.Copy(&snapshot, ringBuffer) 2646 return out, metadata, &smithy.DeserializationError{ 2647 Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), 2648 Snapshot: snapshot.Bytes(), 2649 } 2650 } 2651 2652 return out, metadata, err 2653} 2654 2655func awsRestjson1_deserializeOpErrorGetBranch(response *smithyhttp.Response, metadata *middleware.Metadata) error { 2656 var errorBuffer bytes.Buffer 2657 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 2658 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 2659 } 2660 errorBody := bytes.NewReader(errorBuffer.Bytes()) 2661 2662 errorCode := "UnknownError" 2663 errorMessage := errorCode 2664 2665 code := response.Header.Get("X-Amzn-ErrorType") 2666 if len(code) != 0 { 2667 errorCode = restjson.SanitizeErrorCode(code) 2668 } 2669 2670 var buff [1024]byte 2671 ringBuffer := smithyio.NewRingBuffer(buff[:]) 2672 2673 body := io.TeeReader(errorBody, ringBuffer) 2674 decoder := json.NewDecoder(body) 2675 decoder.UseNumber() 2676 code, message, err := restjson.GetErrorInfo(decoder) 2677 if err != nil { 2678 var snapshot bytes.Buffer 2679 io.Copy(&snapshot, ringBuffer) 2680 err = &smithy.DeserializationError{ 2681 Err: fmt.Errorf("failed to decode response body, %w", err), 2682 Snapshot: snapshot.Bytes(), 2683 } 2684 return err 2685 } 2686 2687 errorBody.Seek(0, io.SeekStart) 2688 if len(code) != 0 { 2689 errorCode = restjson.SanitizeErrorCode(code) 2690 } 2691 if len(message) != 0 { 2692 errorMessage = message 2693 } 2694 2695 switch { 2696 case strings.EqualFold("BadRequestException", errorCode): 2697 return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) 2698 2699 case strings.EqualFold("InternalFailureException", errorCode): 2700 return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) 2701 2702 case strings.EqualFold("NotFoundException", errorCode): 2703 return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) 2704 2705 case strings.EqualFold("UnauthorizedException", errorCode): 2706 return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody) 2707 2708 default: 2709 genericError := &smithy.GenericAPIError{ 2710 Code: errorCode, 2711 Message: errorMessage, 2712 } 2713 return genericError 2714 2715 } 2716} 2717 2718func awsRestjson1_deserializeOpDocumentGetBranchOutput(v **GetBranchOutput, value interface{}) error { 2719 if v == nil { 2720 return fmt.Errorf("unexpected nil of type %T", v) 2721 } 2722 if value == nil { 2723 return nil 2724 } 2725 2726 shape, ok := value.(map[string]interface{}) 2727 if !ok { 2728 return fmt.Errorf("unexpected JSON type %v", value) 2729 } 2730 2731 var sv *GetBranchOutput 2732 if *v == nil { 2733 sv = &GetBranchOutput{} 2734 } else { 2735 sv = *v 2736 } 2737 2738 for key, value := range shape { 2739 switch key { 2740 case "branch": 2741 if err := awsRestjson1_deserializeDocumentBranch(&sv.Branch, value); err != nil { 2742 return err 2743 } 2744 2745 default: 2746 _, _ = key, value 2747 2748 } 2749 } 2750 *v = sv 2751 return nil 2752} 2753 2754type awsRestjson1_deserializeOpGetDomainAssociation struct { 2755} 2756 2757func (*awsRestjson1_deserializeOpGetDomainAssociation) ID() string { 2758 return "OperationDeserializer" 2759} 2760 2761func (m *awsRestjson1_deserializeOpGetDomainAssociation) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 2762 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 2763) { 2764 out, metadata, err = next.HandleDeserialize(ctx, in) 2765 if err != nil { 2766 return out, metadata, err 2767 } 2768 2769 response, ok := out.RawResponse.(*smithyhttp.Response) 2770 if !ok { 2771 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 2772 } 2773 2774 if response.StatusCode < 200 || response.StatusCode >= 300 { 2775 return out, metadata, awsRestjson1_deserializeOpErrorGetDomainAssociation(response, &metadata) 2776 } 2777 output := &GetDomainAssociationOutput{} 2778 out.Result = output 2779 2780 var buff [1024]byte 2781 ringBuffer := smithyio.NewRingBuffer(buff[:]) 2782 2783 body := io.TeeReader(response.Body, ringBuffer) 2784 2785 decoder := json.NewDecoder(body) 2786 decoder.UseNumber() 2787 var shape interface{} 2788 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 2789 var snapshot bytes.Buffer 2790 io.Copy(&snapshot, ringBuffer) 2791 err = &smithy.DeserializationError{ 2792 Err: fmt.Errorf("failed to decode response body, %w", err), 2793 Snapshot: snapshot.Bytes(), 2794 } 2795 return out, metadata, err 2796 } 2797 2798 err = awsRestjson1_deserializeOpDocumentGetDomainAssociationOutput(&output, shape) 2799 if err != nil { 2800 var snapshot bytes.Buffer 2801 io.Copy(&snapshot, ringBuffer) 2802 return out, metadata, &smithy.DeserializationError{ 2803 Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), 2804 Snapshot: snapshot.Bytes(), 2805 } 2806 } 2807 2808 return out, metadata, err 2809} 2810 2811func awsRestjson1_deserializeOpErrorGetDomainAssociation(response *smithyhttp.Response, metadata *middleware.Metadata) error { 2812 var errorBuffer bytes.Buffer 2813 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 2814 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 2815 } 2816 errorBody := bytes.NewReader(errorBuffer.Bytes()) 2817 2818 errorCode := "UnknownError" 2819 errorMessage := errorCode 2820 2821 code := response.Header.Get("X-Amzn-ErrorType") 2822 if len(code) != 0 { 2823 errorCode = restjson.SanitizeErrorCode(code) 2824 } 2825 2826 var buff [1024]byte 2827 ringBuffer := smithyio.NewRingBuffer(buff[:]) 2828 2829 body := io.TeeReader(errorBody, ringBuffer) 2830 decoder := json.NewDecoder(body) 2831 decoder.UseNumber() 2832 code, message, err := restjson.GetErrorInfo(decoder) 2833 if err != nil { 2834 var snapshot bytes.Buffer 2835 io.Copy(&snapshot, ringBuffer) 2836 err = &smithy.DeserializationError{ 2837 Err: fmt.Errorf("failed to decode response body, %w", err), 2838 Snapshot: snapshot.Bytes(), 2839 } 2840 return err 2841 } 2842 2843 errorBody.Seek(0, io.SeekStart) 2844 if len(code) != 0 { 2845 errorCode = restjson.SanitizeErrorCode(code) 2846 } 2847 if len(message) != 0 { 2848 errorMessage = message 2849 } 2850 2851 switch { 2852 case strings.EqualFold("BadRequestException", errorCode): 2853 return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) 2854 2855 case strings.EqualFold("InternalFailureException", errorCode): 2856 return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) 2857 2858 case strings.EqualFold("NotFoundException", errorCode): 2859 return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) 2860 2861 case strings.EqualFold("UnauthorizedException", errorCode): 2862 return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody) 2863 2864 default: 2865 genericError := &smithy.GenericAPIError{ 2866 Code: errorCode, 2867 Message: errorMessage, 2868 } 2869 return genericError 2870 2871 } 2872} 2873 2874func awsRestjson1_deserializeOpDocumentGetDomainAssociationOutput(v **GetDomainAssociationOutput, value interface{}) error { 2875 if v == nil { 2876 return fmt.Errorf("unexpected nil of type %T", v) 2877 } 2878 if value == nil { 2879 return nil 2880 } 2881 2882 shape, ok := value.(map[string]interface{}) 2883 if !ok { 2884 return fmt.Errorf("unexpected JSON type %v", value) 2885 } 2886 2887 var sv *GetDomainAssociationOutput 2888 if *v == nil { 2889 sv = &GetDomainAssociationOutput{} 2890 } else { 2891 sv = *v 2892 } 2893 2894 for key, value := range shape { 2895 switch key { 2896 case "domainAssociation": 2897 if err := awsRestjson1_deserializeDocumentDomainAssociation(&sv.DomainAssociation, value); err != nil { 2898 return err 2899 } 2900 2901 default: 2902 _, _ = key, value 2903 2904 } 2905 } 2906 *v = sv 2907 return nil 2908} 2909 2910type awsRestjson1_deserializeOpGetJob struct { 2911} 2912 2913func (*awsRestjson1_deserializeOpGetJob) ID() string { 2914 return "OperationDeserializer" 2915} 2916 2917func (m *awsRestjson1_deserializeOpGetJob) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 2918 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 2919) { 2920 out, metadata, err = next.HandleDeserialize(ctx, in) 2921 if err != nil { 2922 return out, metadata, err 2923 } 2924 2925 response, ok := out.RawResponse.(*smithyhttp.Response) 2926 if !ok { 2927 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 2928 } 2929 2930 if response.StatusCode < 200 || response.StatusCode >= 300 { 2931 return out, metadata, awsRestjson1_deserializeOpErrorGetJob(response, &metadata) 2932 } 2933 output := &GetJobOutput{} 2934 out.Result = output 2935 2936 var buff [1024]byte 2937 ringBuffer := smithyio.NewRingBuffer(buff[:]) 2938 2939 body := io.TeeReader(response.Body, ringBuffer) 2940 2941 decoder := json.NewDecoder(body) 2942 decoder.UseNumber() 2943 var shape interface{} 2944 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 2945 var snapshot bytes.Buffer 2946 io.Copy(&snapshot, ringBuffer) 2947 err = &smithy.DeserializationError{ 2948 Err: fmt.Errorf("failed to decode response body, %w", err), 2949 Snapshot: snapshot.Bytes(), 2950 } 2951 return out, metadata, err 2952 } 2953 2954 err = awsRestjson1_deserializeOpDocumentGetJobOutput(&output, shape) 2955 if err != nil { 2956 var snapshot bytes.Buffer 2957 io.Copy(&snapshot, ringBuffer) 2958 return out, metadata, &smithy.DeserializationError{ 2959 Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), 2960 Snapshot: snapshot.Bytes(), 2961 } 2962 } 2963 2964 return out, metadata, err 2965} 2966 2967func awsRestjson1_deserializeOpErrorGetJob(response *smithyhttp.Response, metadata *middleware.Metadata) error { 2968 var errorBuffer bytes.Buffer 2969 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 2970 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 2971 } 2972 errorBody := bytes.NewReader(errorBuffer.Bytes()) 2973 2974 errorCode := "UnknownError" 2975 errorMessage := errorCode 2976 2977 code := response.Header.Get("X-Amzn-ErrorType") 2978 if len(code) != 0 { 2979 errorCode = restjson.SanitizeErrorCode(code) 2980 } 2981 2982 var buff [1024]byte 2983 ringBuffer := smithyio.NewRingBuffer(buff[:]) 2984 2985 body := io.TeeReader(errorBody, ringBuffer) 2986 decoder := json.NewDecoder(body) 2987 decoder.UseNumber() 2988 code, message, err := restjson.GetErrorInfo(decoder) 2989 if err != nil { 2990 var snapshot bytes.Buffer 2991 io.Copy(&snapshot, ringBuffer) 2992 err = &smithy.DeserializationError{ 2993 Err: fmt.Errorf("failed to decode response body, %w", err), 2994 Snapshot: snapshot.Bytes(), 2995 } 2996 return err 2997 } 2998 2999 errorBody.Seek(0, io.SeekStart) 3000 if len(code) != 0 { 3001 errorCode = restjson.SanitizeErrorCode(code) 3002 } 3003 if len(message) != 0 { 3004 errorMessage = message 3005 } 3006 3007 switch { 3008 case strings.EqualFold("BadRequestException", errorCode): 3009 return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) 3010 3011 case strings.EqualFold("InternalFailureException", errorCode): 3012 return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) 3013 3014 case strings.EqualFold("LimitExceededException", errorCode): 3015 return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) 3016 3017 case strings.EqualFold("NotFoundException", errorCode): 3018 return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) 3019 3020 case strings.EqualFold("UnauthorizedException", errorCode): 3021 return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody) 3022 3023 default: 3024 genericError := &smithy.GenericAPIError{ 3025 Code: errorCode, 3026 Message: errorMessage, 3027 } 3028 return genericError 3029 3030 } 3031} 3032 3033func awsRestjson1_deserializeOpDocumentGetJobOutput(v **GetJobOutput, value interface{}) error { 3034 if v == nil { 3035 return fmt.Errorf("unexpected nil of type %T", v) 3036 } 3037 if value == nil { 3038 return nil 3039 } 3040 3041 shape, ok := value.(map[string]interface{}) 3042 if !ok { 3043 return fmt.Errorf("unexpected JSON type %v", value) 3044 } 3045 3046 var sv *GetJobOutput 3047 if *v == nil { 3048 sv = &GetJobOutput{} 3049 } else { 3050 sv = *v 3051 } 3052 3053 for key, value := range shape { 3054 switch key { 3055 case "job": 3056 if err := awsRestjson1_deserializeDocumentJob(&sv.Job, value); err != nil { 3057 return err 3058 } 3059 3060 default: 3061 _, _ = key, value 3062 3063 } 3064 } 3065 *v = sv 3066 return nil 3067} 3068 3069type awsRestjson1_deserializeOpGetWebhook struct { 3070} 3071 3072func (*awsRestjson1_deserializeOpGetWebhook) ID() string { 3073 return "OperationDeserializer" 3074} 3075 3076func (m *awsRestjson1_deserializeOpGetWebhook) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 3077 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 3078) { 3079 out, metadata, err = next.HandleDeserialize(ctx, in) 3080 if err != nil { 3081 return out, metadata, err 3082 } 3083 3084 response, ok := out.RawResponse.(*smithyhttp.Response) 3085 if !ok { 3086 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 3087 } 3088 3089 if response.StatusCode < 200 || response.StatusCode >= 300 { 3090 return out, metadata, awsRestjson1_deserializeOpErrorGetWebhook(response, &metadata) 3091 } 3092 output := &GetWebhookOutput{} 3093 out.Result = output 3094 3095 var buff [1024]byte 3096 ringBuffer := smithyio.NewRingBuffer(buff[:]) 3097 3098 body := io.TeeReader(response.Body, ringBuffer) 3099 3100 decoder := json.NewDecoder(body) 3101 decoder.UseNumber() 3102 var shape interface{} 3103 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 3104 var snapshot bytes.Buffer 3105 io.Copy(&snapshot, ringBuffer) 3106 err = &smithy.DeserializationError{ 3107 Err: fmt.Errorf("failed to decode response body, %w", err), 3108 Snapshot: snapshot.Bytes(), 3109 } 3110 return out, metadata, err 3111 } 3112 3113 err = awsRestjson1_deserializeOpDocumentGetWebhookOutput(&output, shape) 3114 if err != nil { 3115 var snapshot bytes.Buffer 3116 io.Copy(&snapshot, ringBuffer) 3117 return out, metadata, &smithy.DeserializationError{ 3118 Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), 3119 Snapshot: snapshot.Bytes(), 3120 } 3121 } 3122 3123 return out, metadata, err 3124} 3125 3126func awsRestjson1_deserializeOpErrorGetWebhook(response *smithyhttp.Response, metadata *middleware.Metadata) error { 3127 var errorBuffer bytes.Buffer 3128 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 3129 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 3130 } 3131 errorBody := bytes.NewReader(errorBuffer.Bytes()) 3132 3133 errorCode := "UnknownError" 3134 errorMessage := errorCode 3135 3136 code := response.Header.Get("X-Amzn-ErrorType") 3137 if len(code) != 0 { 3138 errorCode = restjson.SanitizeErrorCode(code) 3139 } 3140 3141 var buff [1024]byte 3142 ringBuffer := smithyio.NewRingBuffer(buff[:]) 3143 3144 body := io.TeeReader(errorBody, ringBuffer) 3145 decoder := json.NewDecoder(body) 3146 decoder.UseNumber() 3147 code, message, err := restjson.GetErrorInfo(decoder) 3148 if err != nil { 3149 var snapshot bytes.Buffer 3150 io.Copy(&snapshot, ringBuffer) 3151 err = &smithy.DeserializationError{ 3152 Err: fmt.Errorf("failed to decode response body, %w", err), 3153 Snapshot: snapshot.Bytes(), 3154 } 3155 return err 3156 } 3157 3158 errorBody.Seek(0, io.SeekStart) 3159 if len(code) != 0 { 3160 errorCode = restjson.SanitizeErrorCode(code) 3161 } 3162 if len(message) != 0 { 3163 errorMessage = message 3164 } 3165 3166 switch { 3167 case strings.EqualFold("BadRequestException", errorCode): 3168 return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) 3169 3170 case strings.EqualFold("InternalFailureException", errorCode): 3171 return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) 3172 3173 case strings.EqualFold("LimitExceededException", errorCode): 3174 return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) 3175 3176 case strings.EqualFold("NotFoundException", errorCode): 3177 return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) 3178 3179 case strings.EqualFold("UnauthorizedException", errorCode): 3180 return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody) 3181 3182 default: 3183 genericError := &smithy.GenericAPIError{ 3184 Code: errorCode, 3185 Message: errorMessage, 3186 } 3187 return genericError 3188 3189 } 3190} 3191 3192func awsRestjson1_deserializeOpDocumentGetWebhookOutput(v **GetWebhookOutput, value interface{}) error { 3193 if v == nil { 3194 return fmt.Errorf("unexpected nil of type %T", v) 3195 } 3196 if value == nil { 3197 return nil 3198 } 3199 3200 shape, ok := value.(map[string]interface{}) 3201 if !ok { 3202 return fmt.Errorf("unexpected JSON type %v", value) 3203 } 3204 3205 var sv *GetWebhookOutput 3206 if *v == nil { 3207 sv = &GetWebhookOutput{} 3208 } else { 3209 sv = *v 3210 } 3211 3212 for key, value := range shape { 3213 switch key { 3214 case "webhook": 3215 if err := awsRestjson1_deserializeDocumentWebhook(&sv.Webhook, value); err != nil { 3216 return err 3217 } 3218 3219 default: 3220 _, _ = key, value 3221 3222 } 3223 } 3224 *v = sv 3225 return nil 3226} 3227 3228type awsRestjson1_deserializeOpListApps struct { 3229} 3230 3231func (*awsRestjson1_deserializeOpListApps) ID() string { 3232 return "OperationDeserializer" 3233} 3234 3235func (m *awsRestjson1_deserializeOpListApps) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 3236 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 3237) { 3238 out, metadata, err = next.HandleDeserialize(ctx, in) 3239 if err != nil { 3240 return out, metadata, err 3241 } 3242 3243 response, ok := out.RawResponse.(*smithyhttp.Response) 3244 if !ok { 3245 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 3246 } 3247 3248 if response.StatusCode < 200 || response.StatusCode >= 300 { 3249 return out, metadata, awsRestjson1_deserializeOpErrorListApps(response, &metadata) 3250 } 3251 output := &ListAppsOutput{} 3252 out.Result = output 3253 3254 var buff [1024]byte 3255 ringBuffer := smithyio.NewRingBuffer(buff[:]) 3256 3257 body := io.TeeReader(response.Body, ringBuffer) 3258 3259 decoder := json.NewDecoder(body) 3260 decoder.UseNumber() 3261 var shape interface{} 3262 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 3263 var snapshot bytes.Buffer 3264 io.Copy(&snapshot, ringBuffer) 3265 err = &smithy.DeserializationError{ 3266 Err: fmt.Errorf("failed to decode response body, %w", err), 3267 Snapshot: snapshot.Bytes(), 3268 } 3269 return out, metadata, err 3270 } 3271 3272 err = awsRestjson1_deserializeOpDocumentListAppsOutput(&output, shape) 3273 if err != nil { 3274 var snapshot bytes.Buffer 3275 io.Copy(&snapshot, ringBuffer) 3276 return out, metadata, &smithy.DeserializationError{ 3277 Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), 3278 Snapshot: snapshot.Bytes(), 3279 } 3280 } 3281 3282 return out, metadata, err 3283} 3284 3285func awsRestjson1_deserializeOpErrorListApps(response *smithyhttp.Response, metadata *middleware.Metadata) error { 3286 var errorBuffer bytes.Buffer 3287 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 3288 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 3289 } 3290 errorBody := bytes.NewReader(errorBuffer.Bytes()) 3291 3292 errorCode := "UnknownError" 3293 errorMessage := errorCode 3294 3295 code := response.Header.Get("X-Amzn-ErrorType") 3296 if len(code) != 0 { 3297 errorCode = restjson.SanitizeErrorCode(code) 3298 } 3299 3300 var buff [1024]byte 3301 ringBuffer := smithyio.NewRingBuffer(buff[:]) 3302 3303 body := io.TeeReader(errorBody, ringBuffer) 3304 decoder := json.NewDecoder(body) 3305 decoder.UseNumber() 3306 code, message, err := restjson.GetErrorInfo(decoder) 3307 if err != nil { 3308 var snapshot bytes.Buffer 3309 io.Copy(&snapshot, ringBuffer) 3310 err = &smithy.DeserializationError{ 3311 Err: fmt.Errorf("failed to decode response body, %w", err), 3312 Snapshot: snapshot.Bytes(), 3313 } 3314 return err 3315 } 3316 3317 errorBody.Seek(0, io.SeekStart) 3318 if len(code) != 0 { 3319 errorCode = restjson.SanitizeErrorCode(code) 3320 } 3321 if len(message) != 0 { 3322 errorMessage = message 3323 } 3324 3325 switch { 3326 case strings.EqualFold("BadRequestException", errorCode): 3327 return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) 3328 3329 case strings.EqualFold("InternalFailureException", errorCode): 3330 return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) 3331 3332 case strings.EqualFold("UnauthorizedException", errorCode): 3333 return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody) 3334 3335 default: 3336 genericError := &smithy.GenericAPIError{ 3337 Code: errorCode, 3338 Message: errorMessage, 3339 } 3340 return genericError 3341 3342 } 3343} 3344 3345func awsRestjson1_deserializeOpDocumentListAppsOutput(v **ListAppsOutput, value interface{}) error { 3346 if v == nil { 3347 return fmt.Errorf("unexpected nil of type %T", v) 3348 } 3349 if value == nil { 3350 return nil 3351 } 3352 3353 shape, ok := value.(map[string]interface{}) 3354 if !ok { 3355 return fmt.Errorf("unexpected JSON type %v", value) 3356 } 3357 3358 var sv *ListAppsOutput 3359 if *v == nil { 3360 sv = &ListAppsOutput{} 3361 } else { 3362 sv = *v 3363 } 3364 3365 for key, value := range shape { 3366 switch key { 3367 case "apps": 3368 if err := awsRestjson1_deserializeDocumentApps(&sv.Apps, value); err != nil { 3369 return err 3370 } 3371 3372 case "nextToken": 3373 if value != nil { 3374 jtv, ok := value.(string) 3375 if !ok { 3376 return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) 3377 } 3378 sv.NextToken = ptr.String(jtv) 3379 } 3380 3381 default: 3382 _, _ = key, value 3383 3384 } 3385 } 3386 *v = sv 3387 return nil 3388} 3389 3390type awsRestjson1_deserializeOpListArtifacts struct { 3391} 3392 3393func (*awsRestjson1_deserializeOpListArtifacts) ID() string { 3394 return "OperationDeserializer" 3395} 3396 3397func (m *awsRestjson1_deserializeOpListArtifacts) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 3398 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 3399) { 3400 out, metadata, err = next.HandleDeserialize(ctx, in) 3401 if err != nil { 3402 return out, metadata, err 3403 } 3404 3405 response, ok := out.RawResponse.(*smithyhttp.Response) 3406 if !ok { 3407 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 3408 } 3409 3410 if response.StatusCode < 200 || response.StatusCode >= 300 { 3411 return out, metadata, awsRestjson1_deserializeOpErrorListArtifacts(response, &metadata) 3412 } 3413 output := &ListArtifactsOutput{} 3414 out.Result = output 3415 3416 var buff [1024]byte 3417 ringBuffer := smithyio.NewRingBuffer(buff[:]) 3418 3419 body := io.TeeReader(response.Body, ringBuffer) 3420 3421 decoder := json.NewDecoder(body) 3422 decoder.UseNumber() 3423 var shape interface{} 3424 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 3425 var snapshot bytes.Buffer 3426 io.Copy(&snapshot, ringBuffer) 3427 err = &smithy.DeserializationError{ 3428 Err: fmt.Errorf("failed to decode response body, %w", err), 3429 Snapshot: snapshot.Bytes(), 3430 } 3431 return out, metadata, err 3432 } 3433 3434 err = awsRestjson1_deserializeOpDocumentListArtifactsOutput(&output, shape) 3435 if err != nil { 3436 var snapshot bytes.Buffer 3437 io.Copy(&snapshot, ringBuffer) 3438 return out, metadata, &smithy.DeserializationError{ 3439 Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), 3440 Snapshot: snapshot.Bytes(), 3441 } 3442 } 3443 3444 return out, metadata, err 3445} 3446 3447func awsRestjson1_deserializeOpErrorListArtifacts(response *smithyhttp.Response, metadata *middleware.Metadata) error { 3448 var errorBuffer bytes.Buffer 3449 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 3450 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 3451 } 3452 errorBody := bytes.NewReader(errorBuffer.Bytes()) 3453 3454 errorCode := "UnknownError" 3455 errorMessage := errorCode 3456 3457 code := response.Header.Get("X-Amzn-ErrorType") 3458 if len(code) != 0 { 3459 errorCode = restjson.SanitizeErrorCode(code) 3460 } 3461 3462 var buff [1024]byte 3463 ringBuffer := smithyio.NewRingBuffer(buff[:]) 3464 3465 body := io.TeeReader(errorBody, ringBuffer) 3466 decoder := json.NewDecoder(body) 3467 decoder.UseNumber() 3468 code, message, err := restjson.GetErrorInfo(decoder) 3469 if err != nil { 3470 var snapshot bytes.Buffer 3471 io.Copy(&snapshot, ringBuffer) 3472 err = &smithy.DeserializationError{ 3473 Err: fmt.Errorf("failed to decode response body, %w", err), 3474 Snapshot: snapshot.Bytes(), 3475 } 3476 return err 3477 } 3478 3479 errorBody.Seek(0, io.SeekStart) 3480 if len(code) != 0 { 3481 errorCode = restjson.SanitizeErrorCode(code) 3482 } 3483 if len(message) != 0 { 3484 errorMessage = message 3485 } 3486 3487 switch { 3488 case strings.EqualFold("BadRequestException", errorCode): 3489 return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) 3490 3491 case strings.EqualFold("InternalFailureException", errorCode): 3492 return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) 3493 3494 case strings.EqualFold("LimitExceededException", errorCode): 3495 return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) 3496 3497 case strings.EqualFold("UnauthorizedException", errorCode): 3498 return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody) 3499 3500 default: 3501 genericError := &smithy.GenericAPIError{ 3502 Code: errorCode, 3503 Message: errorMessage, 3504 } 3505 return genericError 3506 3507 } 3508} 3509 3510func awsRestjson1_deserializeOpDocumentListArtifactsOutput(v **ListArtifactsOutput, value interface{}) error { 3511 if v == nil { 3512 return fmt.Errorf("unexpected nil of type %T", v) 3513 } 3514 if value == nil { 3515 return nil 3516 } 3517 3518 shape, ok := value.(map[string]interface{}) 3519 if !ok { 3520 return fmt.Errorf("unexpected JSON type %v", value) 3521 } 3522 3523 var sv *ListArtifactsOutput 3524 if *v == nil { 3525 sv = &ListArtifactsOutput{} 3526 } else { 3527 sv = *v 3528 } 3529 3530 for key, value := range shape { 3531 switch key { 3532 case "artifacts": 3533 if err := awsRestjson1_deserializeDocumentArtifacts(&sv.Artifacts, value); err != nil { 3534 return err 3535 } 3536 3537 case "nextToken": 3538 if value != nil { 3539 jtv, ok := value.(string) 3540 if !ok { 3541 return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) 3542 } 3543 sv.NextToken = ptr.String(jtv) 3544 } 3545 3546 default: 3547 _, _ = key, value 3548 3549 } 3550 } 3551 *v = sv 3552 return nil 3553} 3554 3555type awsRestjson1_deserializeOpListBackendEnvironments struct { 3556} 3557 3558func (*awsRestjson1_deserializeOpListBackendEnvironments) ID() string { 3559 return "OperationDeserializer" 3560} 3561 3562func (m *awsRestjson1_deserializeOpListBackendEnvironments) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 3563 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 3564) { 3565 out, metadata, err = next.HandleDeserialize(ctx, in) 3566 if err != nil { 3567 return out, metadata, err 3568 } 3569 3570 response, ok := out.RawResponse.(*smithyhttp.Response) 3571 if !ok { 3572 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 3573 } 3574 3575 if response.StatusCode < 200 || response.StatusCode >= 300 { 3576 return out, metadata, awsRestjson1_deserializeOpErrorListBackendEnvironments(response, &metadata) 3577 } 3578 output := &ListBackendEnvironmentsOutput{} 3579 out.Result = output 3580 3581 var buff [1024]byte 3582 ringBuffer := smithyio.NewRingBuffer(buff[:]) 3583 3584 body := io.TeeReader(response.Body, ringBuffer) 3585 3586 decoder := json.NewDecoder(body) 3587 decoder.UseNumber() 3588 var shape interface{} 3589 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 3590 var snapshot bytes.Buffer 3591 io.Copy(&snapshot, ringBuffer) 3592 err = &smithy.DeserializationError{ 3593 Err: fmt.Errorf("failed to decode response body, %w", err), 3594 Snapshot: snapshot.Bytes(), 3595 } 3596 return out, metadata, err 3597 } 3598 3599 err = awsRestjson1_deserializeOpDocumentListBackendEnvironmentsOutput(&output, shape) 3600 if err != nil { 3601 var snapshot bytes.Buffer 3602 io.Copy(&snapshot, ringBuffer) 3603 return out, metadata, &smithy.DeserializationError{ 3604 Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), 3605 Snapshot: snapshot.Bytes(), 3606 } 3607 } 3608 3609 return out, metadata, err 3610} 3611 3612func awsRestjson1_deserializeOpErrorListBackendEnvironments(response *smithyhttp.Response, metadata *middleware.Metadata) error { 3613 var errorBuffer bytes.Buffer 3614 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 3615 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 3616 } 3617 errorBody := bytes.NewReader(errorBuffer.Bytes()) 3618 3619 errorCode := "UnknownError" 3620 errorMessage := errorCode 3621 3622 code := response.Header.Get("X-Amzn-ErrorType") 3623 if len(code) != 0 { 3624 errorCode = restjson.SanitizeErrorCode(code) 3625 } 3626 3627 var buff [1024]byte 3628 ringBuffer := smithyio.NewRingBuffer(buff[:]) 3629 3630 body := io.TeeReader(errorBody, ringBuffer) 3631 decoder := json.NewDecoder(body) 3632 decoder.UseNumber() 3633 code, message, err := restjson.GetErrorInfo(decoder) 3634 if err != nil { 3635 var snapshot bytes.Buffer 3636 io.Copy(&snapshot, ringBuffer) 3637 err = &smithy.DeserializationError{ 3638 Err: fmt.Errorf("failed to decode response body, %w", err), 3639 Snapshot: snapshot.Bytes(), 3640 } 3641 return err 3642 } 3643 3644 errorBody.Seek(0, io.SeekStart) 3645 if len(code) != 0 { 3646 errorCode = restjson.SanitizeErrorCode(code) 3647 } 3648 if len(message) != 0 { 3649 errorMessage = message 3650 } 3651 3652 switch { 3653 case strings.EqualFold("BadRequestException", errorCode): 3654 return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) 3655 3656 case strings.EqualFold("InternalFailureException", errorCode): 3657 return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) 3658 3659 case strings.EqualFold("UnauthorizedException", errorCode): 3660 return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody) 3661 3662 default: 3663 genericError := &smithy.GenericAPIError{ 3664 Code: errorCode, 3665 Message: errorMessage, 3666 } 3667 return genericError 3668 3669 } 3670} 3671 3672func awsRestjson1_deserializeOpDocumentListBackendEnvironmentsOutput(v **ListBackendEnvironmentsOutput, value interface{}) error { 3673 if v == nil { 3674 return fmt.Errorf("unexpected nil of type %T", v) 3675 } 3676 if value == nil { 3677 return nil 3678 } 3679 3680 shape, ok := value.(map[string]interface{}) 3681 if !ok { 3682 return fmt.Errorf("unexpected JSON type %v", value) 3683 } 3684 3685 var sv *ListBackendEnvironmentsOutput 3686 if *v == nil { 3687 sv = &ListBackendEnvironmentsOutput{} 3688 } else { 3689 sv = *v 3690 } 3691 3692 for key, value := range shape { 3693 switch key { 3694 case "backendEnvironments": 3695 if err := awsRestjson1_deserializeDocumentBackendEnvironments(&sv.BackendEnvironments, value); err != nil { 3696 return err 3697 } 3698 3699 case "nextToken": 3700 if value != nil { 3701 jtv, ok := value.(string) 3702 if !ok { 3703 return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) 3704 } 3705 sv.NextToken = ptr.String(jtv) 3706 } 3707 3708 default: 3709 _, _ = key, value 3710 3711 } 3712 } 3713 *v = sv 3714 return nil 3715} 3716 3717type awsRestjson1_deserializeOpListBranches struct { 3718} 3719 3720func (*awsRestjson1_deserializeOpListBranches) ID() string { 3721 return "OperationDeserializer" 3722} 3723 3724func (m *awsRestjson1_deserializeOpListBranches) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 3725 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 3726) { 3727 out, metadata, err = next.HandleDeserialize(ctx, in) 3728 if err != nil { 3729 return out, metadata, err 3730 } 3731 3732 response, ok := out.RawResponse.(*smithyhttp.Response) 3733 if !ok { 3734 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 3735 } 3736 3737 if response.StatusCode < 200 || response.StatusCode >= 300 { 3738 return out, metadata, awsRestjson1_deserializeOpErrorListBranches(response, &metadata) 3739 } 3740 output := &ListBranchesOutput{} 3741 out.Result = output 3742 3743 var buff [1024]byte 3744 ringBuffer := smithyio.NewRingBuffer(buff[:]) 3745 3746 body := io.TeeReader(response.Body, ringBuffer) 3747 3748 decoder := json.NewDecoder(body) 3749 decoder.UseNumber() 3750 var shape interface{} 3751 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 3752 var snapshot bytes.Buffer 3753 io.Copy(&snapshot, ringBuffer) 3754 err = &smithy.DeserializationError{ 3755 Err: fmt.Errorf("failed to decode response body, %w", err), 3756 Snapshot: snapshot.Bytes(), 3757 } 3758 return out, metadata, err 3759 } 3760 3761 err = awsRestjson1_deserializeOpDocumentListBranchesOutput(&output, shape) 3762 if err != nil { 3763 var snapshot bytes.Buffer 3764 io.Copy(&snapshot, ringBuffer) 3765 return out, metadata, &smithy.DeserializationError{ 3766 Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), 3767 Snapshot: snapshot.Bytes(), 3768 } 3769 } 3770 3771 return out, metadata, err 3772} 3773 3774func awsRestjson1_deserializeOpErrorListBranches(response *smithyhttp.Response, metadata *middleware.Metadata) error { 3775 var errorBuffer bytes.Buffer 3776 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 3777 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 3778 } 3779 errorBody := bytes.NewReader(errorBuffer.Bytes()) 3780 3781 errorCode := "UnknownError" 3782 errorMessage := errorCode 3783 3784 code := response.Header.Get("X-Amzn-ErrorType") 3785 if len(code) != 0 { 3786 errorCode = restjson.SanitizeErrorCode(code) 3787 } 3788 3789 var buff [1024]byte 3790 ringBuffer := smithyio.NewRingBuffer(buff[:]) 3791 3792 body := io.TeeReader(errorBody, ringBuffer) 3793 decoder := json.NewDecoder(body) 3794 decoder.UseNumber() 3795 code, message, err := restjson.GetErrorInfo(decoder) 3796 if err != nil { 3797 var snapshot bytes.Buffer 3798 io.Copy(&snapshot, ringBuffer) 3799 err = &smithy.DeserializationError{ 3800 Err: fmt.Errorf("failed to decode response body, %w", err), 3801 Snapshot: snapshot.Bytes(), 3802 } 3803 return err 3804 } 3805 3806 errorBody.Seek(0, io.SeekStart) 3807 if len(code) != 0 { 3808 errorCode = restjson.SanitizeErrorCode(code) 3809 } 3810 if len(message) != 0 { 3811 errorMessage = message 3812 } 3813 3814 switch { 3815 case strings.EqualFold("BadRequestException", errorCode): 3816 return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) 3817 3818 case strings.EqualFold("InternalFailureException", errorCode): 3819 return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) 3820 3821 case strings.EqualFold("UnauthorizedException", errorCode): 3822 return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody) 3823 3824 default: 3825 genericError := &smithy.GenericAPIError{ 3826 Code: errorCode, 3827 Message: errorMessage, 3828 } 3829 return genericError 3830 3831 } 3832} 3833 3834func awsRestjson1_deserializeOpDocumentListBranchesOutput(v **ListBranchesOutput, value interface{}) error { 3835 if v == nil { 3836 return fmt.Errorf("unexpected nil of type %T", v) 3837 } 3838 if value == nil { 3839 return nil 3840 } 3841 3842 shape, ok := value.(map[string]interface{}) 3843 if !ok { 3844 return fmt.Errorf("unexpected JSON type %v", value) 3845 } 3846 3847 var sv *ListBranchesOutput 3848 if *v == nil { 3849 sv = &ListBranchesOutput{} 3850 } else { 3851 sv = *v 3852 } 3853 3854 for key, value := range shape { 3855 switch key { 3856 case "branches": 3857 if err := awsRestjson1_deserializeDocumentBranches(&sv.Branches, value); err != nil { 3858 return err 3859 } 3860 3861 case "nextToken": 3862 if value != nil { 3863 jtv, ok := value.(string) 3864 if !ok { 3865 return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) 3866 } 3867 sv.NextToken = ptr.String(jtv) 3868 } 3869 3870 default: 3871 _, _ = key, value 3872 3873 } 3874 } 3875 *v = sv 3876 return nil 3877} 3878 3879type awsRestjson1_deserializeOpListDomainAssociations struct { 3880} 3881 3882func (*awsRestjson1_deserializeOpListDomainAssociations) ID() string { 3883 return "OperationDeserializer" 3884} 3885 3886func (m *awsRestjson1_deserializeOpListDomainAssociations) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 3887 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 3888) { 3889 out, metadata, err = next.HandleDeserialize(ctx, in) 3890 if err != nil { 3891 return out, metadata, err 3892 } 3893 3894 response, ok := out.RawResponse.(*smithyhttp.Response) 3895 if !ok { 3896 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 3897 } 3898 3899 if response.StatusCode < 200 || response.StatusCode >= 300 { 3900 return out, metadata, awsRestjson1_deserializeOpErrorListDomainAssociations(response, &metadata) 3901 } 3902 output := &ListDomainAssociationsOutput{} 3903 out.Result = output 3904 3905 var buff [1024]byte 3906 ringBuffer := smithyio.NewRingBuffer(buff[:]) 3907 3908 body := io.TeeReader(response.Body, ringBuffer) 3909 3910 decoder := json.NewDecoder(body) 3911 decoder.UseNumber() 3912 var shape interface{} 3913 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 3914 var snapshot bytes.Buffer 3915 io.Copy(&snapshot, ringBuffer) 3916 err = &smithy.DeserializationError{ 3917 Err: fmt.Errorf("failed to decode response body, %w", err), 3918 Snapshot: snapshot.Bytes(), 3919 } 3920 return out, metadata, err 3921 } 3922 3923 err = awsRestjson1_deserializeOpDocumentListDomainAssociationsOutput(&output, shape) 3924 if err != nil { 3925 var snapshot bytes.Buffer 3926 io.Copy(&snapshot, ringBuffer) 3927 return out, metadata, &smithy.DeserializationError{ 3928 Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), 3929 Snapshot: snapshot.Bytes(), 3930 } 3931 } 3932 3933 return out, metadata, err 3934} 3935 3936func awsRestjson1_deserializeOpErrorListDomainAssociations(response *smithyhttp.Response, metadata *middleware.Metadata) error { 3937 var errorBuffer bytes.Buffer 3938 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 3939 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 3940 } 3941 errorBody := bytes.NewReader(errorBuffer.Bytes()) 3942 3943 errorCode := "UnknownError" 3944 errorMessage := errorCode 3945 3946 code := response.Header.Get("X-Amzn-ErrorType") 3947 if len(code) != 0 { 3948 errorCode = restjson.SanitizeErrorCode(code) 3949 } 3950 3951 var buff [1024]byte 3952 ringBuffer := smithyio.NewRingBuffer(buff[:]) 3953 3954 body := io.TeeReader(errorBody, ringBuffer) 3955 decoder := json.NewDecoder(body) 3956 decoder.UseNumber() 3957 code, message, err := restjson.GetErrorInfo(decoder) 3958 if err != nil { 3959 var snapshot bytes.Buffer 3960 io.Copy(&snapshot, ringBuffer) 3961 err = &smithy.DeserializationError{ 3962 Err: fmt.Errorf("failed to decode response body, %w", err), 3963 Snapshot: snapshot.Bytes(), 3964 } 3965 return err 3966 } 3967 3968 errorBody.Seek(0, io.SeekStart) 3969 if len(code) != 0 { 3970 errorCode = restjson.SanitizeErrorCode(code) 3971 } 3972 if len(message) != 0 { 3973 errorMessage = message 3974 } 3975 3976 switch { 3977 case strings.EqualFold("BadRequestException", errorCode): 3978 return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) 3979 3980 case strings.EqualFold("InternalFailureException", errorCode): 3981 return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) 3982 3983 case strings.EqualFold("UnauthorizedException", errorCode): 3984 return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody) 3985 3986 default: 3987 genericError := &smithy.GenericAPIError{ 3988 Code: errorCode, 3989 Message: errorMessage, 3990 } 3991 return genericError 3992 3993 } 3994} 3995 3996func awsRestjson1_deserializeOpDocumentListDomainAssociationsOutput(v **ListDomainAssociationsOutput, value interface{}) error { 3997 if v == nil { 3998 return fmt.Errorf("unexpected nil of type %T", v) 3999 } 4000 if value == nil { 4001 return nil 4002 } 4003 4004 shape, ok := value.(map[string]interface{}) 4005 if !ok { 4006 return fmt.Errorf("unexpected JSON type %v", value) 4007 } 4008 4009 var sv *ListDomainAssociationsOutput 4010 if *v == nil { 4011 sv = &ListDomainAssociationsOutput{} 4012 } else { 4013 sv = *v 4014 } 4015 4016 for key, value := range shape { 4017 switch key { 4018 case "domainAssociations": 4019 if err := awsRestjson1_deserializeDocumentDomainAssociations(&sv.DomainAssociations, value); err != nil { 4020 return err 4021 } 4022 4023 case "nextToken": 4024 if value != nil { 4025 jtv, ok := value.(string) 4026 if !ok { 4027 return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) 4028 } 4029 sv.NextToken = ptr.String(jtv) 4030 } 4031 4032 default: 4033 _, _ = key, value 4034 4035 } 4036 } 4037 *v = sv 4038 return nil 4039} 4040 4041type awsRestjson1_deserializeOpListJobs struct { 4042} 4043 4044func (*awsRestjson1_deserializeOpListJobs) ID() string { 4045 return "OperationDeserializer" 4046} 4047 4048func (m *awsRestjson1_deserializeOpListJobs) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 4049 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 4050) { 4051 out, metadata, err = next.HandleDeserialize(ctx, in) 4052 if err != nil { 4053 return out, metadata, err 4054 } 4055 4056 response, ok := out.RawResponse.(*smithyhttp.Response) 4057 if !ok { 4058 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 4059 } 4060 4061 if response.StatusCode < 200 || response.StatusCode >= 300 { 4062 return out, metadata, awsRestjson1_deserializeOpErrorListJobs(response, &metadata) 4063 } 4064 output := &ListJobsOutput{} 4065 out.Result = output 4066 4067 var buff [1024]byte 4068 ringBuffer := smithyio.NewRingBuffer(buff[:]) 4069 4070 body := io.TeeReader(response.Body, ringBuffer) 4071 4072 decoder := json.NewDecoder(body) 4073 decoder.UseNumber() 4074 var shape interface{} 4075 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 4076 var snapshot bytes.Buffer 4077 io.Copy(&snapshot, ringBuffer) 4078 err = &smithy.DeserializationError{ 4079 Err: fmt.Errorf("failed to decode response body, %w", err), 4080 Snapshot: snapshot.Bytes(), 4081 } 4082 return out, metadata, err 4083 } 4084 4085 err = awsRestjson1_deserializeOpDocumentListJobsOutput(&output, shape) 4086 if err != nil { 4087 var snapshot bytes.Buffer 4088 io.Copy(&snapshot, ringBuffer) 4089 return out, metadata, &smithy.DeserializationError{ 4090 Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), 4091 Snapshot: snapshot.Bytes(), 4092 } 4093 } 4094 4095 return out, metadata, err 4096} 4097 4098func awsRestjson1_deserializeOpErrorListJobs(response *smithyhttp.Response, metadata *middleware.Metadata) error { 4099 var errorBuffer bytes.Buffer 4100 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 4101 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 4102 } 4103 errorBody := bytes.NewReader(errorBuffer.Bytes()) 4104 4105 errorCode := "UnknownError" 4106 errorMessage := errorCode 4107 4108 code := response.Header.Get("X-Amzn-ErrorType") 4109 if len(code) != 0 { 4110 errorCode = restjson.SanitizeErrorCode(code) 4111 } 4112 4113 var buff [1024]byte 4114 ringBuffer := smithyio.NewRingBuffer(buff[:]) 4115 4116 body := io.TeeReader(errorBody, ringBuffer) 4117 decoder := json.NewDecoder(body) 4118 decoder.UseNumber() 4119 code, message, err := restjson.GetErrorInfo(decoder) 4120 if err != nil { 4121 var snapshot bytes.Buffer 4122 io.Copy(&snapshot, ringBuffer) 4123 err = &smithy.DeserializationError{ 4124 Err: fmt.Errorf("failed to decode response body, %w", err), 4125 Snapshot: snapshot.Bytes(), 4126 } 4127 return err 4128 } 4129 4130 errorBody.Seek(0, io.SeekStart) 4131 if len(code) != 0 { 4132 errorCode = restjson.SanitizeErrorCode(code) 4133 } 4134 if len(message) != 0 { 4135 errorMessage = message 4136 } 4137 4138 switch { 4139 case strings.EqualFold("BadRequestException", errorCode): 4140 return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) 4141 4142 case strings.EqualFold("InternalFailureException", errorCode): 4143 return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) 4144 4145 case strings.EqualFold("LimitExceededException", errorCode): 4146 return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) 4147 4148 case strings.EqualFold("UnauthorizedException", errorCode): 4149 return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody) 4150 4151 default: 4152 genericError := &smithy.GenericAPIError{ 4153 Code: errorCode, 4154 Message: errorMessage, 4155 } 4156 return genericError 4157 4158 } 4159} 4160 4161func awsRestjson1_deserializeOpDocumentListJobsOutput(v **ListJobsOutput, value interface{}) error { 4162 if v == nil { 4163 return fmt.Errorf("unexpected nil of type %T", v) 4164 } 4165 if value == nil { 4166 return nil 4167 } 4168 4169 shape, ok := value.(map[string]interface{}) 4170 if !ok { 4171 return fmt.Errorf("unexpected JSON type %v", value) 4172 } 4173 4174 var sv *ListJobsOutput 4175 if *v == nil { 4176 sv = &ListJobsOutput{} 4177 } else { 4178 sv = *v 4179 } 4180 4181 for key, value := range shape { 4182 switch key { 4183 case "jobSummaries": 4184 if err := awsRestjson1_deserializeDocumentJobSummaries(&sv.JobSummaries, value); err != nil { 4185 return err 4186 } 4187 4188 case "nextToken": 4189 if value != nil { 4190 jtv, ok := value.(string) 4191 if !ok { 4192 return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) 4193 } 4194 sv.NextToken = ptr.String(jtv) 4195 } 4196 4197 default: 4198 _, _ = key, value 4199 4200 } 4201 } 4202 *v = sv 4203 return nil 4204} 4205 4206type awsRestjson1_deserializeOpListTagsForResource struct { 4207} 4208 4209func (*awsRestjson1_deserializeOpListTagsForResource) ID() string { 4210 return "OperationDeserializer" 4211} 4212 4213func (m *awsRestjson1_deserializeOpListTagsForResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 4214 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 4215) { 4216 out, metadata, err = next.HandleDeserialize(ctx, in) 4217 if err != nil { 4218 return out, metadata, err 4219 } 4220 4221 response, ok := out.RawResponse.(*smithyhttp.Response) 4222 if !ok { 4223 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 4224 } 4225 4226 if response.StatusCode < 200 || response.StatusCode >= 300 { 4227 return out, metadata, awsRestjson1_deserializeOpErrorListTagsForResource(response, &metadata) 4228 } 4229 output := &ListTagsForResourceOutput{} 4230 out.Result = output 4231 4232 var buff [1024]byte 4233 ringBuffer := smithyio.NewRingBuffer(buff[:]) 4234 4235 body := io.TeeReader(response.Body, ringBuffer) 4236 4237 decoder := json.NewDecoder(body) 4238 decoder.UseNumber() 4239 var shape interface{} 4240 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 4241 var snapshot bytes.Buffer 4242 io.Copy(&snapshot, ringBuffer) 4243 err = &smithy.DeserializationError{ 4244 Err: fmt.Errorf("failed to decode response body, %w", err), 4245 Snapshot: snapshot.Bytes(), 4246 } 4247 return out, metadata, err 4248 } 4249 4250 err = awsRestjson1_deserializeOpDocumentListTagsForResourceOutput(&output, shape) 4251 if err != nil { 4252 var snapshot bytes.Buffer 4253 io.Copy(&snapshot, ringBuffer) 4254 return out, metadata, &smithy.DeserializationError{ 4255 Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), 4256 Snapshot: snapshot.Bytes(), 4257 } 4258 } 4259 4260 return out, metadata, err 4261} 4262 4263func awsRestjson1_deserializeOpErrorListTagsForResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { 4264 var errorBuffer bytes.Buffer 4265 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 4266 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 4267 } 4268 errorBody := bytes.NewReader(errorBuffer.Bytes()) 4269 4270 errorCode := "UnknownError" 4271 errorMessage := errorCode 4272 4273 code := response.Header.Get("X-Amzn-ErrorType") 4274 if len(code) != 0 { 4275 errorCode = restjson.SanitizeErrorCode(code) 4276 } 4277 4278 var buff [1024]byte 4279 ringBuffer := smithyio.NewRingBuffer(buff[:]) 4280 4281 body := io.TeeReader(errorBody, ringBuffer) 4282 decoder := json.NewDecoder(body) 4283 decoder.UseNumber() 4284 code, message, err := restjson.GetErrorInfo(decoder) 4285 if err != nil { 4286 var snapshot bytes.Buffer 4287 io.Copy(&snapshot, ringBuffer) 4288 err = &smithy.DeserializationError{ 4289 Err: fmt.Errorf("failed to decode response body, %w", err), 4290 Snapshot: snapshot.Bytes(), 4291 } 4292 return err 4293 } 4294 4295 errorBody.Seek(0, io.SeekStart) 4296 if len(code) != 0 { 4297 errorCode = restjson.SanitizeErrorCode(code) 4298 } 4299 if len(message) != 0 { 4300 errorMessage = message 4301 } 4302 4303 switch { 4304 case strings.EqualFold("BadRequestException", errorCode): 4305 return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) 4306 4307 case strings.EqualFold("InternalFailureException", errorCode): 4308 return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) 4309 4310 case strings.EqualFold("ResourceNotFoundException", errorCode): 4311 return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) 4312 4313 default: 4314 genericError := &smithy.GenericAPIError{ 4315 Code: errorCode, 4316 Message: errorMessage, 4317 } 4318 return genericError 4319 4320 } 4321} 4322 4323func awsRestjson1_deserializeOpDocumentListTagsForResourceOutput(v **ListTagsForResourceOutput, value interface{}) error { 4324 if v == nil { 4325 return fmt.Errorf("unexpected nil of type %T", v) 4326 } 4327 if value == nil { 4328 return nil 4329 } 4330 4331 shape, ok := value.(map[string]interface{}) 4332 if !ok { 4333 return fmt.Errorf("unexpected JSON type %v", value) 4334 } 4335 4336 var sv *ListTagsForResourceOutput 4337 if *v == nil { 4338 sv = &ListTagsForResourceOutput{} 4339 } else { 4340 sv = *v 4341 } 4342 4343 for key, value := range shape { 4344 switch key { 4345 case "tags": 4346 if err := awsRestjson1_deserializeDocumentTagMap(&sv.Tags, value); err != nil { 4347 return err 4348 } 4349 4350 default: 4351 _, _ = key, value 4352 4353 } 4354 } 4355 *v = sv 4356 return nil 4357} 4358 4359type awsRestjson1_deserializeOpListWebhooks struct { 4360} 4361 4362func (*awsRestjson1_deserializeOpListWebhooks) ID() string { 4363 return "OperationDeserializer" 4364} 4365 4366func (m *awsRestjson1_deserializeOpListWebhooks) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 4367 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 4368) { 4369 out, metadata, err = next.HandleDeserialize(ctx, in) 4370 if err != nil { 4371 return out, metadata, err 4372 } 4373 4374 response, ok := out.RawResponse.(*smithyhttp.Response) 4375 if !ok { 4376 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 4377 } 4378 4379 if response.StatusCode < 200 || response.StatusCode >= 300 { 4380 return out, metadata, awsRestjson1_deserializeOpErrorListWebhooks(response, &metadata) 4381 } 4382 output := &ListWebhooksOutput{} 4383 out.Result = output 4384 4385 var buff [1024]byte 4386 ringBuffer := smithyio.NewRingBuffer(buff[:]) 4387 4388 body := io.TeeReader(response.Body, ringBuffer) 4389 4390 decoder := json.NewDecoder(body) 4391 decoder.UseNumber() 4392 var shape interface{} 4393 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 4394 var snapshot bytes.Buffer 4395 io.Copy(&snapshot, ringBuffer) 4396 err = &smithy.DeserializationError{ 4397 Err: fmt.Errorf("failed to decode response body, %w", err), 4398 Snapshot: snapshot.Bytes(), 4399 } 4400 return out, metadata, err 4401 } 4402 4403 err = awsRestjson1_deserializeOpDocumentListWebhooksOutput(&output, shape) 4404 if err != nil { 4405 var snapshot bytes.Buffer 4406 io.Copy(&snapshot, ringBuffer) 4407 return out, metadata, &smithy.DeserializationError{ 4408 Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), 4409 Snapshot: snapshot.Bytes(), 4410 } 4411 } 4412 4413 return out, metadata, err 4414} 4415 4416func awsRestjson1_deserializeOpErrorListWebhooks(response *smithyhttp.Response, metadata *middleware.Metadata) error { 4417 var errorBuffer bytes.Buffer 4418 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 4419 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 4420 } 4421 errorBody := bytes.NewReader(errorBuffer.Bytes()) 4422 4423 errorCode := "UnknownError" 4424 errorMessage := errorCode 4425 4426 code := response.Header.Get("X-Amzn-ErrorType") 4427 if len(code) != 0 { 4428 errorCode = restjson.SanitizeErrorCode(code) 4429 } 4430 4431 var buff [1024]byte 4432 ringBuffer := smithyio.NewRingBuffer(buff[:]) 4433 4434 body := io.TeeReader(errorBody, ringBuffer) 4435 decoder := json.NewDecoder(body) 4436 decoder.UseNumber() 4437 code, message, err := restjson.GetErrorInfo(decoder) 4438 if err != nil { 4439 var snapshot bytes.Buffer 4440 io.Copy(&snapshot, ringBuffer) 4441 err = &smithy.DeserializationError{ 4442 Err: fmt.Errorf("failed to decode response body, %w", err), 4443 Snapshot: snapshot.Bytes(), 4444 } 4445 return err 4446 } 4447 4448 errorBody.Seek(0, io.SeekStart) 4449 if len(code) != 0 { 4450 errorCode = restjson.SanitizeErrorCode(code) 4451 } 4452 if len(message) != 0 { 4453 errorMessage = message 4454 } 4455 4456 switch { 4457 case strings.EqualFold("BadRequestException", errorCode): 4458 return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) 4459 4460 case strings.EqualFold("InternalFailureException", errorCode): 4461 return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) 4462 4463 case strings.EqualFold("LimitExceededException", errorCode): 4464 return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) 4465 4466 case strings.EqualFold("UnauthorizedException", errorCode): 4467 return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody) 4468 4469 default: 4470 genericError := &smithy.GenericAPIError{ 4471 Code: errorCode, 4472 Message: errorMessage, 4473 } 4474 return genericError 4475 4476 } 4477} 4478 4479func awsRestjson1_deserializeOpDocumentListWebhooksOutput(v **ListWebhooksOutput, value interface{}) error { 4480 if v == nil { 4481 return fmt.Errorf("unexpected nil of type %T", v) 4482 } 4483 if value == nil { 4484 return nil 4485 } 4486 4487 shape, ok := value.(map[string]interface{}) 4488 if !ok { 4489 return fmt.Errorf("unexpected JSON type %v", value) 4490 } 4491 4492 var sv *ListWebhooksOutput 4493 if *v == nil { 4494 sv = &ListWebhooksOutput{} 4495 } else { 4496 sv = *v 4497 } 4498 4499 for key, value := range shape { 4500 switch key { 4501 case "nextToken": 4502 if value != nil { 4503 jtv, ok := value.(string) 4504 if !ok { 4505 return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) 4506 } 4507 sv.NextToken = ptr.String(jtv) 4508 } 4509 4510 case "webhooks": 4511 if err := awsRestjson1_deserializeDocumentWebhooks(&sv.Webhooks, value); err != nil { 4512 return err 4513 } 4514 4515 default: 4516 _, _ = key, value 4517 4518 } 4519 } 4520 *v = sv 4521 return nil 4522} 4523 4524type awsRestjson1_deserializeOpStartDeployment struct { 4525} 4526 4527func (*awsRestjson1_deserializeOpStartDeployment) ID() string { 4528 return "OperationDeserializer" 4529} 4530 4531func (m *awsRestjson1_deserializeOpStartDeployment) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 4532 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 4533) { 4534 out, metadata, err = next.HandleDeserialize(ctx, in) 4535 if err != nil { 4536 return out, metadata, err 4537 } 4538 4539 response, ok := out.RawResponse.(*smithyhttp.Response) 4540 if !ok { 4541 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 4542 } 4543 4544 if response.StatusCode < 200 || response.StatusCode >= 300 { 4545 return out, metadata, awsRestjson1_deserializeOpErrorStartDeployment(response, &metadata) 4546 } 4547 output := &StartDeploymentOutput{} 4548 out.Result = output 4549 4550 var buff [1024]byte 4551 ringBuffer := smithyio.NewRingBuffer(buff[:]) 4552 4553 body := io.TeeReader(response.Body, ringBuffer) 4554 4555 decoder := json.NewDecoder(body) 4556 decoder.UseNumber() 4557 var shape interface{} 4558 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 4559 var snapshot bytes.Buffer 4560 io.Copy(&snapshot, ringBuffer) 4561 err = &smithy.DeserializationError{ 4562 Err: fmt.Errorf("failed to decode response body, %w", err), 4563 Snapshot: snapshot.Bytes(), 4564 } 4565 return out, metadata, err 4566 } 4567 4568 err = awsRestjson1_deserializeOpDocumentStartDeploymentOutput(&output, shape) 4569 if err != nil { 4570 var snapshot bytes.Buffer 4571 io.Copy(&snapshot, ringBuffer) 4572 return out, metadata, &smithy.DeserializationError{ 4573 Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), 4574 Snapshot: snapshot.Bytes(), 4575 } 4576 } 4577 4578 return out, metadata, err 4579} 4580 4581func awsRestjson1_deserializeOpErrorStartDeployment(response *smithyhttp.Response, metadata *middleware.Metadata) error { 4582 var errorBuffer bytes.Buffer 4583 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 4584 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 4585 } 4586 errorBody := bytes.NewReader(errorBuffer.Bytes()) 4587 4588 errorCode := "UnknownError" 4589 errorMessage := errorCode 4590 4591 code := response.Header.Get("X-Amzn-ErrorType") 4592 if len(code) != 0 { 4593 errorCode = restjson.SanitizeErrorCode(code) 4594 } 4595 4596 var buff [1024]byte 4597 ringBuffer := smithyio.NewRingBuffer(buff[:]) 4598 4599 body := io.TeeReader(errorBody, ringBuffer) 4600 decoder := json.NewDecoder(body) 4601 decoder.UseNumber() 4602 code, message, err := restjson.GetErrorInfo(decoder) 4603 if err != nil { 4604 var snapshot bytes.Buffer 4605 io.Copy(&snapshot, ringBuffer) 4606 err = &smithy.DeserializationError{ 4607 Err: fmt.Errorf("failed to decode response body, %w", err), 4608 Snapshot: snapshot.Bytes(), 4609 } 4610 return err 4611 } 4612 4613 errorBody.Seek(0, io.SeekStart) 4614 if len(code) != 0 { 4615 errorCode = restjson.SanitizeErrorCode(code) 4616 } 4617 if len(message) != 0 { 4618 errorMessage = message 4619 } 4620 4621 switch { 4622 case strings.EqualFold("BadRequestException", errorCode): 4623 return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) 4624 4625 case strings.EqualFold("InternalFailureException", errorCode): 4626 return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) 4627 4628 case strings.EqualFold("LimitExceededException", errorCode): 4629 return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) 4630 4631 case strings.EqualFold("NotFoundException", errorCode): 4632 return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) 4633 4634 case strings.EqualFold("UnauthorizedException", errorCode): 4635 return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody) 4636 4637 default: 4638 genericError := &smithy.GenericAPIError{ 4639 Code: errorCode, 4640 Message: errorMessage, 4641 } 4642 return genericError 4643 4644 } 4645} 4646 4647func awsRestjson1_deserializeOpDocumentStartDeploymentOutput(v **StartDeploymentOutput, value interface{}) error { 4648 if v == nil { 4649 return fmt.Errorf("unexpected nil of type %T", v) 4650 } 4651 if value == nil { 4652 return nil 4653 } 4654 4655 shape, ok := value.(map[string]interface{}) 4656 if !ok { 4657 return fmt.Errorf("unexpected JSON type %v", value) 4658 } 4659 4660 var sv *StartDeploymentOutput 4661 if *v == nil { 4662 sv = &StartDeploymentOutput{} 4663 } else { 4664 sv = *v 4665 } 4666 4667 for key, value := range shape { 4668 switch key { 4669 case "jobSummary": 4670 if err := awsRestjson1_deserializeDocumentJobSummary(&sv.JobSummary, value); err != nil { 4671 return err 4672 } 4673 4674 default: 4675 _, _ = key, value 4676 4677 } 4678 } 4679 *v = sv 4680 return nil 4681} 4682 4683type awsRestjson1_deserializeOpStartJob struct { 4684} 4685 4686func (*awsRestjson1_deserializeOpStartJob) ID() string { 4687 return "OperationDeserializer" 4688} 4689 4690func (m *awsRestjson1_deserializeOpStartJob) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 4691 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 4692) { 4693 out, metadata, err = next.HandleDeserialize(ctx, in) 4694 if err != nil { 4695 return out, metadata, err 4696 } 4697 4698 response, ok := out.RawResponse.(*smithyhttp.Response) 4699 if !ok { 4700 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 4701 } 4702 4703 if response.StatusCode < 200 || response.StatusCode >= 300 { 4704 return out, metadata, awsRestjson1_deserializeOpErrorStartJob(response, &metadata) 4705 } 4706 output := &StartJobOutput{} 4707 out.Result = output 4708 4709 var buff [1024]byte 4710 ringBuffer := smithyio.NewRingBuffer(buff[:]) 4711 4712 body := io.TeeReader(response.Body, ringBuffer) 4713 4714 decoder := json.NewDecoder(body) 4715 decoder.UseNumber() 4716 var shape interface{} 4717 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 4718 var snapshot bytes.Buffer 4719 io.Copy(&snapshot, ringBuffer) 4720 err = &smithy.DeserializationError{ 4721 Err: fmt.Errorf("failed to decode response body, %w", err), 4722 Snapshot: snapshot.Bytes(), 4723 } 4724 return out, metadata, err 4725 } 4726 4727 err = awsRestjson1_deserializeOpDocumentStartJobOutput(&output, shape) 4728 if err != nil { 4729 var snapshot bytes.Buffer 4730 io.Copy(&snapshot, ringBuffer) 4731 return out, metadata, &smithy.DeserializationError{ 4732 Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), 4733 Snapshot: snapshot.Bytes(), 4734 } 4735 } 4736 4737 return out, metadata, err 4738} 4739 4740func awsRestjson1_deserializeOpErrorStartJob(response *smithyhttp.Response, metadata *middleware.Metadata) error { 4741 var errorBuffer bytes.Buffer 4742 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 4743 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 4744 } 4745 errorBody := bytes.NewReader(errorBuffer.Bytes()) 4746 4747 errorCode := "UnknownError" 4748 errorMessage := errorCode 4749 4750 code := response.Header.Get("X-Amzn-ErrorType") 4751 if len(code) != 0 { 4752 errorCode = restjson.SanitizeErrorCode(code) 4753 } 4754 4755 var buff [1024]byte 4756 ringBuffer := smithyio.NewRingBuffer(buff[:]) 4757 4758 body := io.TeeReader(errorBody, ringBuffer) 4759 decoder := json.NewDecoder(body) 4760 decoder.UseNumber() 4761 code, message, err := restjson.GetErrorInfo(decoder) 4762 if err != nil { 4763 var snapshot bytes.Buffer 4764 io.Copy(&snapshot, ringBuffer) 4765 err = &smithy.DeserializationError{ 4766 Err: fmt.Errorf("failed to decode response body, %w", err), 4767 Snapshot: snapshot.Bytes(), 4768 } 4769 return err 4770 } 4771 4772 errorBody.Seek(0, io.SeekStart) 4773 if len(code) != 0 { 4774 errorCode = restjson.SanitizeErrorCode(code) 4775 } 4776 if len(message) != 0 { 4777 errorMessage = message 4778 } 4779 4780 switch { 4781 case strings.EqualFold("BadRequestException", errorCode): 4782 return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) 4783 4784 case strings.EqualFold("InternalFailureException", errorCode): 4785 return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) 4786 4787 case strings.EqualFold("LimitExceededException", errorCode): 4788 return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) 4789 4790 case strings.EqualFold("NotFoundException", errorCode): 4791 return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) 4792 4793 case strings.EqualFold("UnauthorizedException", errorCode): 4794 return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody) 4795 4796 default: 4797 genericError := &smithy.GenericAPIError{ 4798 Code: errorCode, 4799 Message: errorMessage, 4800 } 4801 return genericError 4802 4803 } 4804} 4805 4806func awsRestjson1_deserializeOpDocumentStartJobOutput(v **StartJobOutput, value interface{}) error { 4807 if v == nil { 4808 return fmt.Errorf("unexpected nil of type %T", v) 4809 } 4810 if value == nil { 4811 return nil 4812 } 4813 4814 shape, ok := value.(map[string]interface{}) 4815 if !ok { 4816 return fmt.Errorf("unexpected JSON type %v", value) 4817 } 4818 4819 var sv *StartJobOutput 4820 if *v == nil { 4821 sv = &StartJobOutput{} 4822 } else { 4823 sv = *v 4824 } 4825 4826 for key, value := range shape { 4827 switch key { 4828 case "jobSummary": 4829 if err := awsRestjson1_deserializeDocumentJobSummary(&sv.JobSummary, value); err != nil { 4830 return err 4831 } 4832 4833 default: 4834 _, _ = key, value 4835 4836 } 4837 } 4838 *v = sv 4839 return nil 4840} 4841 4842type awsRestjson1_deserializeOpStopJob struct { 4843} 4844 4845func (*awsRestjson1_deserializeOpStopJob) ID() string { 4846 return "OperationDeserializer" 4847} 4848 4849func (m *awsRestjson1_deserializeOpStopJob) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 4850 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 4851) { 4852 out, metadata, err = next.HandleDeserialize(ctx, in) 4853 if err != nil { 4854 return out, metadata, err 4855 } 4856 4857 response, ok := out.RawResponse.(*smithyhttp.Response) 4858 if !ok { 4859 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 4860 } 4861 4862 if response.StatusCode < 200 || response.StatusCode >= 300 { 4863 return out, metadata, awsRestjson1_deserializeOpErrorStopJob(response, &metadata) 4864 } 4865 output := &StopJobOutput{} 4866 out.Result = output 4867 4868 var buff [1024]byte 4869 ringBuffer := smithyio.NewRingBuffer(buff[:]) 4870 4871 body := io.TeeReader(response.Body, ringBuffer) 4872 4873 decoder := json.NewDecoder(body) 4874 decoder.UseNumber() 4875 var shape interface{} 4876 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 4877 var snapshot bytes.Buffer 4878 io.Copy(&snapshot, ringBuffer) 4879 err = &smithy.DeserializationError{ 4880 Err: fmt.Errorf("failed to decode response body, %w", err), 4881 Snapshot: snapshot.Bytes(), 4882 } 4883 return out, metadata, err 4884 } 4885 4886 err = awsRestjson1_deserializeOpDocumentStopJobOutput(&output, shape) 4887 if err != nil { 4888 var snapshot bytes.Buffer 4889 io.Copy(&snapshot, ringBuffer) 4890 return out, metadata, &smithy.DeserializationError{ 4891 Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), 4892 Snapshot: snapshot.Bytes(), 4893 } 4894 } 4895 4896 return out, metadata, err 4897} 4898 4899func awsRestjson1_deserializeOpErrorStopJob(response *smithyhttp.Response, metadata *middleware.Metadata) error { 4900 var errorBuffer bytes.Buffer 4901 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 4902 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 4903 } 4904 errorBody := bytes.NewReader(errorBuffer.Bytes()) 4905 4906 errorCode := "UnknownError" 4907 errorMessage := errorCode 4908 4909 code := response.Header.Get("X-Amzn-ErrorType") 4910 if len(code) != 0 { 4911 errorCode = restjson.SanitizeErrorCode(code) 4912 } 4913 4914 var buff [1024]byte 4915 ringBuffer := smithyio.NewRingBuffer(buff[:]) 4916 4917 body := io.TeeReader(errorBody, ringBuffer) 4918 decoder := json.NewDecoder(body) 4919 decoder.UseNumber() 4920 code, message, err := restjson.GetErrorInfo(decoder) 4921 if err != nil { 4922 var snapshot bytes.Buffer 4923 io.Copy(&snapshot, ringBuffer) 4924 err = &smithy.DeserializationError{ 4925 Err: fmt.Errorf("failed to decode response body, %w", err), 4926 Snapshot: snapshot.Bytes(), 4927 } 4928 return err 4929 } 4930 4931 errorBody.Seek(0, io.SeekStart) 4932 if len(code) != 0 { 4933 errorCode = restjson.SanitizeErrorCode(code) 4934 } 4935 if len(message) != 0 { 4936 errorMessage = message 4937 } 4938 4939 switch { 4940 case strings.EqualFold("BadRequestException", errorCode): 4941 return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) 4942 4943 case strings.EqualFold("InternalFailureException", errorCode): 4944 return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) 4945 4946 case strings.EqualFold("LimitExceededException", errorCode): 4947 return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) 4948 4949 case strings.EqualFold("NotFoundException", errorCode): 4950 return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) 4951 4952 case strings.EqualFold("UnauthorizedException", errorCode): 4953 return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody) 4954 4955 default: 4956 genericError := &smithy.GenericAPIError{ 4957 Code: errorCode, 4958 Message: errorMessage, 4959 } 4960 return genericError 4961 4962 } 4963} 4964 4965func awsRestjson1_deserializeOpDocumentStopJobOutput(v **StopJobOutput, value interface{}) error { 4966 if v == nil { 4967 return fmt.Errorf("unexpected nil of type %T", v) 4968 } 4969 if value == nil { 4970 return nil 4971 } 4972 4973 shape, ok := value.(map[string]interface{}) 4974 if !ok { 4975 return fmt.Errorf("unexpected JSON type %v", value) 4976 } 4977 4978 var sv *StopJobOutput 4979 if *v == nil { 4980 sv = &StopJobOutput{} 4981 } else { 4982 sv = *v 4983 } 4984 4985 for key, value := range shape { 4986 switch key { 4987 case "jobSummary": 4988 if err := awsRestjson1_deserializeDocumentJobSummary(&sv.JobSummary, value); err != nil { 4989 return err 4990 } 4991 4992 default: 4993 _, _ = key, value 4994 4995 } 4996 } 4997 *v = sv 4998 return nil 4999} 5000 5001type awsRestjson1_deserializeOpTagResource struct { 5002} 5003 5004func (*awsRestjson1_deserializeOpTagResource) ID() string { 5005 return "OperationDeserializer" 5006} 5007 5008func (m *awsRestjson1_deserializeOpTagResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 5009 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 5010) { 5011 out, metadata, err = next.HandleDeserialize(ctx, in) 5012 if err != nil { 5013 return out, metadata, err 5014 } 5015 5016 response, ok := out.RawResponse.(*smithyhttp.Response) 5017 if !ok { 5018 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 5019 } 5020 5021 if response.StatusCode < 200 || response.StatusCode >= 300 { 5022 return out, metadata, awsRestjson1_deserializeOpErrorTagResource(response, &metadata) 5023 } 5024 output := &TagResourceOutput{} 5025 out.Result = output 5026 5027 return out, metadata, err 5028} 5029 5030func awsRestjson1_deserializeOpErrorTagResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { 5031 var errorBuffer bytes.Buffer 5032 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 5033 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 5034 } 5035 errorBody := bytes.NewReader(errorBuffer.Bytes()) 5036 5037 errorCode := "UnknownError" 5038 errorMessage := errorCode 5039 5040 code := response.Header.Get("X-Amzn-ErrorType") 5041 if len(code) != 0 { 5042 errorCode = restjson.SanitizeErrorCode(code) 5043 } 5044 5045 var buff [1024]byte 5046 ringBuffer := smithyio.NewRingBuffer(buff[:]) 5047 5048 body := io.TeeReader(errorBody, ringBuffer) 5049 decoder := json.NewDecoder(body) 5050 decoder.UseNumber() 5051 code, message, err := restjson.GetErrorInfo(decoder) 5052 if err != nil { 5053 var snapshot bytes.Buffer 5054 io.Copy(&snapshot, ringBuffer) 5055 err = &smithy.DeserializationError{ 5056 Err: fmt.Errorf("failed to decode response body, %w", err), 5057 Snapshot: snapshot.Bytes(), 5058 } 5059 return err 5060 } 5061 5062 errorBody.Seek(0, io.SeekStart) 5063 if len(code) != 0 { 5064 errorCode = restjson.SanitizeErrorCode(code) 5065 } 5066 if len(message) != 0 { 5067 errorMessage = message 5068 } 5069 5070 switch { 5071 case strings.EqualFold("BadRequestException", errorCode): 5072 return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) 5073 5074 case strings.EqualFold("InternalFailureException", errorCode): 5075 return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) 5076 5077 case strings.EqualFold("ResourceNotFoundException", errorCode): 5078 return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) 5079 5080 default: 5081 genericError := &smithy.GenericAPIError{ 5082 Code: errorCode, 5083 Message: errorMessage, 5084 } 5085 return genericError 5086 5087 } 5088} 5089 5090type awsRestjson1_deserializeOpUntagResource struct { 5091} 5092 5093func (*awsRestjson1_deserializeOpUntagResource) ID() string { 5094 return "OperationDeserializer" 5095} 5096 5097func (m *awsRestjson1_deserializeOpUntagResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 5098 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 5099) { 5100 out, metadata, err = next.HandleDeserialize(ctx, in) 5101 if err != nil { 5102 return out, metadata, err 5103 } 5104 5105 response, ok := out.RawResponse.(*smithyhttp.Response) 5106 if !ok { 5107 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 5108 } 5109 5110 if response.StatusCode < 200 || response.StatusCode >= 300 { 5111 return out, metadata, awsRestjson1_deserializeOpErrorUntagResource(response, &metadata) 5112 } 5113 output := &UntagResourceOutput{} 5114 out.Result = output 5115 5116 return out, metadata, err 5117} 5118 5119func awsRestjson1_deserializeOpErrorUntagResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { 5120 var errorBuffer bytes.Buffer 5121 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 5122 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 5123 } 5124 errorBody := bytes.NewReader(errorBuffer.Bytes()) 5125 5126 errorCode := "UnknownError" 5127 errorMessage := errorCode 5128 5129 code := response.Header.Get("X-Amzn-ErrorType") 5130 if len(code) != 0 { 5131 errorCode = restjson.SanitizeErrorCode(code) 5132 } 5133 5134 var buff [1024]byte 5135 ringBuffer := smithyio.NewRingBuffer(buff[:]) 5136 5137 body := io.TeeReader(errorBody, ringBuffer) 5138 decoder := json.NewDecoder(body) 5139 decoder.UseNumber() 5140 code, message, err := restjson.GetErrorInfo(decoder) 5141 if err != nil { 5142 var snapshot bytes.Buffer 5143 io.Copy(&snapshot, ringBuffer) 5144 err = &smithy.DeserializationError{ 5145 Err: fmt.Errorf("failed to decode response body, %w", err), 5146 Snapshot: snapshot.Bytes(), 5147 } 5148 return err 5149 } 5150 5151 errorBody.Seek(0, io.SeekStart) 5152 if len(code) != 0 { 5153 errorCode = restjson.SanitizeErrorCode(code) 5154 } 5155 if len(message) != 0 { 5156 errorMessage = message 5157 } 5158 5159 switch { 5160 case strings.EqualFold("BadRequestException", errorCode): 5161 return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) 5162 5163 case strings.EqualFold("InternalFailureException", errorCode): 5164 return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) 5165 5166 case strings.EqualFold("ResourceNotFoundException", errorCode): 5167 return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) 5168 5169 default: 5170 genericError := &smithy.GenericAPIError{ 5171 Code: errorCode, 5172 Message: errorMessage, 5173 } 5174 return genericError 5175 5176 } 5177} 5178 5179type awsRestjson1_deserializeOpUpdateApp struct { 5180} 5181 5182func (*awsRestjson1_deserializeOpUpdateApp) ID() string { 5183 return "OperationDeserializer" 5184} 5185 5186func (m *awsRestjson1_deserializeOpUpdateApp) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 5187 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 5188) { 5189 out, metadata, err = next.HandleDeserialize(ctx, in) 5190 if err != nil { 5191 return out, metadata, err 5192 } 5193 5194 response, ok := out.RawResponse.(*smithyhttp.Response) 5195 if !ok { 5196 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 5197 } 5198 5199 if response.StatusCode < 200 || response.StatusCode >= 300 { 5200 return out, metadata, awsRestjson1_deserializeOpErrorUpdateApp(response, &metadata) 5201 } 5202 output := &UpdateAppOutput{} 5203 out.Result = output 5204 5205 var buff [1024]byte 5206 ringBuffer := smithyio.NewRingBuffer(buff[:]) 5207 5208 body := io.TeeReader(response.Body, ringBuffer) 5209 5210 decoder := json.NewDecoder(body) 5211 decoder.UseNumber() 5212 var shape interface{} 5213 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 5214 var snapshot bytes.Buffer 5215 io.Copy(&snapshot, ringBuffer) 5216 err = &smithy.DeserializationError{ 5217 Err: fmt.Errorf("failed to decode response body, %w", err), 5218 Snapshot: snapshot.Bytes(), 5219 } 5220 return out, metadata, err 5221 } 5222 5223 err = awsRestjson1_deserializeOpDocumentUpdateAppOutput(&output, shape) 5224 if err != nil { 5225 var snapshot bytes.Buffer 5226 io.Copy(&snapshot, ringBuffer) 5227 return out, metadata, &smithy.DeserializationError{ 5228 Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), 5229 Snapshot: snapshot.Bytes(), 5230 } 5231 } 5232 5233 return out, metadata, err 5234} 5235 5236func awsRestjson1_deserializeOpErrorUpdateApp(response *smithyhttp.Response, metadata *middleware.Metadata) error { 5237 var errorBuffer bytes.Buffer 5238 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 5239 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 5240 } 5241 errorBody := bytes.NewReader(errorBuffer.Bytes()) 5242 5243 errorCode := "UnknownError" 5244 errorMessage := errorCode 5245 5246 code := response.Header.Get("X-Amzn-ErrorType") 5247 if len(code) != 0 { 5248 errorCode = restjson.SanitizeErrorCode(code) 5249 } 5250 5251 var buff [1024]byte 5252 ringBuffer := smithyio.NewRingBuffer(buff[:]) 5253 5254 body := io.TeeReader(errorBody, ringBuffer) 5255 decoder := json.NewDecoder(body) 5256 decoder.UseNumber() 5257 code, message, err := restjson.GetErrorInfo(decoder) 5258 if err != nil { 5259 var snapshot bytes.Buffer 5260 io.Copy(&snapshot, ringBuffer) 5261 err = &smithy.DeserializationError{ 5262 Err: fmt.Errorf("failed to decode response body, %w", err), 5263 Snapshot: snapshot.Bytes(), 5264 } 5265 return err 5266 } 5267 5268 errorBody.Seek(0, io.SeekStart) 5269 if len(code) != 0 { 5270 errorCode = restjson.SanitizeErrorCode(code) 5271 } 5272 if len(message) != 0 { 5273 errorMessage = message 5274 } 5275 5276 switch { 5277 case strings.EqualFold("BadRequestException", errorCode): 5278 return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) 5279 5280 case strings.EqualFold("InternalFailureException", errorCode): 5281 return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) 5282 5283 case strings.EqualFold("NotFoundException", errorCode): 5284 return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) 5285 5286 case strings.EqualFold("UnauthorizedException", errorCode): 5287 return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody) 5288 5289 default: 5290 genericError := &smithy.GenericAPIError{ 5291 Code: errorCode, 5292 Message: errorMessage, 5293 } 5294 return genericError 5295 5296 } 5297} 5298 5299func awsRestjson1_deserializeOpDocumentUpdateAppOutput(v **UpdateAppOutput, value interface{}) error { 5300 if v == nil { 5301 return fmt.Errorf("unexpected nil of type %T", v) 5302 } 5303 if value == nil { 5304 return nil 5305 } 5306 5307 shape, ok := value.(map[string]interface{}) 5308 if !ok { 5309 return fmt.Errorf("unexpected JSON type %v", value) 5310 } 5311 5312 var sv *UpdateAppOutput 5313 if *v == nil { 5314 sv = &UpdateAppOutput{} 5315 } else { 5316 sv = *v 5317 } 5318 5319 for key, value := range shape { 5320 switch key { 5321 case "app": 5322 if err := awsRestjson1_deserializeDocumentApp(&sv.App, value); err != nil { 5323 return err 5324 } 5325 5326 default: 5327 _, _ = key, value 5328 5329 } 5330 } 5331 *v = sv 5332 return nil 5333} 5334 5335type awsRestjson1_deserializeOpUpdateBranch struct { 5336} 5337 5338func (*awsRestjson1_deserializeOpUpdateBranch) ID() string { 5339 return "OperationDeserializer" 5340} 5341 5342func (m *awsRestjson1_deserializeOpUpdateBranch) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 5343 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 5344) { 5345 out, metadata, err = next.HandleDeserialize(ctx, in) 5346 if err != nil { 5347 return out, metadata, err 5348 } 5349 5350 response, ok := out.RawResponse.(*smithyhttp.Response) 5351 if !ok { 5352 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 5353 } 5354 5355 if response.StatusCode < 200 || response.StatusCode >= 300 { 5356 return out, metadata, awsRestjson1_deserializeOpErrorUpdateBranch(response, &metadata) 5357 } 5358 output := &UpdateBranchOutput{} 5359 out.Result = output 5360 5361 var buff [1024]byte 5362 ringBuffer := smithyio.NewRingBuffer(buff[:]) 5363 5364 body := io.TeeReader(response.Body, ringBuffer) 5365 5366 decoder := json.NewDecoder(body) 5367 decoder.UseNumber() 5368 var shape interface{} 5369 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 5370 var snapshot bytes.Buffer 5371 io.Copy(&snapshot, ringBuffer) 5372 err = &smithy.DeserializationError{ 5373 Err: fmt.Errorf("failed to decode response body, %w", err), 5374 Snapshot: snapshot.Bytes(), 5375 } 5376 return out, metadata, err 5377 } 5378 5379 err = awsRestjson1_deserializeOpDocumentUpdateBranchOutput(&output, shape) 5380 if err != nil { 5381 var snapshot bytes.Buffer 5382 io.Copy(&snapshot, ringBuffer) 5383 return out, metadata, &smithy.DeserializationError{ 5384 Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), 5385 Snapshot: snapshot.Bytes(), 5386 } 5387 } 5388 5389 return out, metadata, err 5390} 5391 5392func awsRestjson1_deserializeOpErrorUpdateBranch(response *smithyhttp.Response, metadata *middleware.Metadata) error { 5393 var errorBuffer bytes.Buffer 5394 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 5395 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 5396 } 5397 errorBody := bytes.NewReader(errorBuffer.Bytes()) 5398 5399 errorCode := "UnknownError" 5400 errorMessage := errorCode 5401 5402 code := response.Header.Get("X-Amzn-ErrorType") 5403 if len(code) != 0 { 5404 errorCode = restjson.SanitizeErrorCode(code) 5405 } 5406 5407 var buff [1024]byte 5408 ringBuffer := smithyio.NewRingBuffer(buff[:]) 5409 5410 body := io.TeeReader(errorBody, ringBuffer) 5411 decoder := json.NewDecoder(body) 5412 decoder.UseNumber() 5413 code, message, err := restjson.GetErrorInfo(decoder) 5414 if err != nil { 5415 var snapshot bytes.Buffer 5416 io.Copy(&snapshot, ringBuffer) 5417 err = &smithy.DeserializationError{ 5418 Err: fmt.Errorf("failed to decode response body, %w", err), 5419 Snapshot: snapshot.Bytes(), 5420 } 5421 return err 5422 } 5423 5424 errorBody.Seek(0, io.SeekStart) 5425 if len(code) != 0 { 5426 errorCode = restjson.SanitizeErrorCode(code) 5427 } 5428 if len(message) != 0 { 5429 errorMessage = message 5430 } 5431 5432 switch { 5433 case strings.EqualFold("BadRequestException", errorCode): 5434 return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) 5435 5436 case strings.EqualFold("DependentServiceFailureException", errorCode): 5437 return awsRestjson1_deserializeErrorDependentServiceFailureException(response, errorBody) 5438 5439 case strings.EqualFold("InternalFailureException", errorCode): 5440 return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) 5441 5442 case strings.EqualFold("NotFoundException", errorCode): 5443 return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) 5444 5445 case strings.EqualFold("UnauthorizedException", errorCode): 5446 return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody) 5447 5448 default: 5449 genericError := &smithy.GenericAPIError{ 5450 Code: errorCode, 5451 Message: errorMessage, 5452 } 5453 return genericError 5454 5455 } 5456} 5457 5458func awsRestjson1_deserializeOpDocumentUpdateBranchOutput(v **UpdateBranchOutput, value interface{}) error { 5459 if v == nil { 5460 return fmt.Errorf("unexpected nil of type %T", v) 5461 } 5462 if value == nil { 5463 return nil 5464 } 5465 5466 shape, ok := value.(map[string]interface{}) 5467 if !ok { 5468 return fmt.Errorf("unexpected JSON type %v", value) 5469 } 5470 5471 var sv *UpdateBranchOutput 5472 if *v == nil { 5473 sv = &UpdateBranchOutput{} 5474 } else { 5475 sv = *v 5476 } 5477 5478 for key, value := range shape { 5479 switch key { 5480 case "branch": 5481 if err := awsRestjson1_deserializeDocumentBranch(&sv.Branch, value); err != nil { 5482 return err 5483 } 5484 5485 default: 5486 _, _ = key, value 5487 5488 } 5489 } 5490 *v = sv 5491 return nil 5492} 5493 5494type awsRestjson1_deserializeOpUpdateDomainAssociation struct { 5495} 5496 5497func (*awsRestjson1_deserializeOpUpdateDomainAssociation) ID() string { 5498 return "OperationDeserializer" 5499} 5500 5501func (m *awsRestjson1_deserializeOpUpdateDomainAssociation) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 5502 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 5503) { 5504 out, metadata, err = next.HandleDeserialize(ctx, in) 5505 if err != nil { 5506 return out, metadata, err 5507 } 5508 5509 response, ok := out.RawResponse.(*smithyhttp.Response) 5510 if !ok { 5511 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 5512 } 5513 5514 if response.StatusCode < 200 || response.StatusCode >= 300 { 5515 return out, metadata, awsRestjson1_deserializeOpErrorUpdateDomainAssociation(response, &metadata) 5516 } 5517 output := &UpdateDomainAssociationOutput{} 5518 out.Result = output 5519 5520 var buff [1024]byte 5521 ringBuffer := smithyio.NewRingBuffer(buff[:]) 5522 5523 body := io.TeeReader(response.Body, ringBuffer) 5524 5525 decoder := json.NewDecoder(body) 5526 decoder.UseNumber() 5527 var shape interface{} 5528 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 5529 var snapshot bytes.Buffer 5530 io.Copy(&snapshot, ringBuffer) 5531 err = &smithy.DeserializationError{ 5532 Err: fmt.Errorf("failed to decode response body, %w", err), 5533 Snapshot: snapshot.Bytes(), 5534 } 5535 return out, metadata, err 5536 } 5537 5538 err = awsRestjson1_deserializeOpDocumentUpdateDomainAssociationOutput(&output, shape) 5539 if err != nil { 5540 var snapshot bytes.Buffer 5541 io.Copy(&snapshot, ringBuffer) 5542 return out, metadata, &smithy.DeserializationError{ 5543 Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), 5544 Snapshot: snapshot.Bytes(), 5545 } 5546 } 5547 5548 return out, metadata, err 5549} 5550 5551func awsRestjson1_deserializeOpErrorUpdateDomainAssociation(response *smithyhttp.Response, metadata *middleware.Metadata) error { 5552 var errorBuffer bytes.Buffer 5553 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 5554 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 5555 } 5556 errorBody := bytes.NewReader(errorBuffer.Bytes()) 5557 5558 errorCode := "UnknownError" 5559 errorMessage := errorCode 5560 5561 code := response.Header.Get("X-Amzn-ErrorType") 5562 if len(code) != 0 { 5563 errorCode = restjson.SanitizeErrorCode(code) 5564 } 5565 5566 var buff [1024]byte 5567 ringBuffer := smithyio.NewRingBuffer(buff[:]) 5568 5569 body := io.TeeReader(errorBody, ringBuffer) 5570 decoder := json.NewDecoder(body) 5571 decoder.UseNumber() 5572 code, message, err := restjson.GetErrorInfo(decoder) 5573 if err != nil { 5574 var snapshot bytes.Buffer 5575 io.Copy(&snapshot, ringBuffer) 5576 err = &smithy.DeserializationError{ 5577 Err: fmt.Errorf("failed to decode response body, %w", err), 5578 Snapshot: snapshot.Bytes(), 5579 } 5580 return err 5581 } 5582 5583 errorBody.Seek(0, io.SeekStart) 5584 if len(code) != 0 { 5585 errorCode = restjson.SanitizeErrorCode(code) 5586 } 5587 if len(message) != 0 { 5588 errorMessage = message 5589 } 5590 5591 switch { 5592 case strings.EqualFold("BadRequestException", errorCode): 5593 return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) 5594 5595 case strings.EqualFold("DependentServiceFailureException", errorCode): 5596 return awsRestjson1_deserializeErrorDependentServiceFailureException(response, errorBody) 5597 5598 case strings.EqualFold("InternalFailureException", errorCode): 5599 return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) 5600 5601 case strings.EqualFold("NotFoundException", errorCode): 5602 return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) 5603 5604 case strings.EqualFold("UnauthorizedException", errorCode): 5605 return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody) 5606 5607 default: 5608 genericError := &smithy.GenericAPIError{ 5609 Code: errorCode, 5610 Message: errorMessage, 5611 } 5612 return genericError 5613 5614 } 5615} 5616 5617func awsRestjson1_deserializeOpDocumentUpdateDomainAssociationOutput(v **UpdateDomainAssociationOutput, value interface{}) error { 5618 if v == nil { 5619 return fmt.Errorf("unexpected nil of type %T", v) 5620 } 5621 if value == nil { 5622 return nil 5623 } 5624 5625 shape, ok := value.(map[string]interface{}) 5626 if !ok { 5627 return fmt.Errorf("unexpected JSON type %v", value) 5628 } 5629 5630 var sv *UpdateDomainAssociationOutput 5631 if *v == nil { 5632 sv = &UpdateDomainAssociationOutput{} 5633 } else { 5634 sv = *v 5635 } 5636 5637 for key, value := range shape { 5638 switch key { 5639 case "domainAssociation": 5640 if err := awsRestjson1_deserializeDocumentDomainAssociation(&sv.DomainAssociation, value); err != nil { 5641 return err 5642 } 5643 5644 default: 5645 _, _ = key, value 5646 5647 } 5648 } 5649 *v = sv 5650 return nil 5651} 5652 5653type awsRestjson1_deserializeOpUpdateWebhook struct { 5654} 5655 5656func (*awsRestjson1_deserializeOpUpdateWebhook) ID() string { 5657 return "OperationDeserializer" 5658} 5659 5660func (m *awsRestjson1_deserializeOpUpdateWebhook) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 5661 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 5662) { 5663 out, metadata, err = next.HandleDeserialize(ctx, in) 5664 if err != nil { 5665 return out, metadata, err 5666 } 5667 5668 response, ok := out.RawResponse.(*smithyhttp.Response) 5669 if !ok { 5670 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 5671 } 5672 5673 if response.StatusCode < 200 || response.StatusCode >= 300 { 5674 return out, metadata, awsRestjson1_deserializeOpErrorUpdateWebhook(response, &metadata) 5675 } 5676 output := &UpdateWebhookOutput{} 5677 out.Result = output 5678 5679 var buff [1024]byte 5680 ringBuffer := smithyio.NewRingBuffer(buff[:]) 5681 5682 body := io.TeeReader(response.Body, ringBuffer) 5683 5684 decoder := json.NewDecoder(body) 5685 decoder.UseNumber() 5686 var shape interface{} 5687 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 5688 var snapshot bytes.Buffer 5689 io.Copy(&snapshot, ringBuffer) 5690 err = &smithy.DeserializationError{ 5691 Err: fmt.Errorf("failed to decode response body, %w", err), 5692 Snapshot: snapshot.Bytes(), 5693 } 5694 return out, metadata, err 5695 } 5696 5697 err = awsRestjson1_deserializeOpDocumentUpdateWebhookOutput(&output, shape) 5698 if err != nil { 5699 var snapshot bytes.Buffer 5700 io.Copy(&snapshot, ringBuffer) 5701 return out, metadata, &smithy.DeserializationError{ 5702 Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), 5703 Snapshot: snapshot.Bytes(), 5704 } 5705 } 5706 5707 return out, metadata, err 5708} 5709 5710func awsRestjson1_deserializeOpErrorUpdateWebhook(response *smithyhttp.Response, metadata *middleware.Metadata) error { 5711 var errorBuffer bytes.Buffer 5712 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 5713 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 5714 } 5715 errorBody := bytes.NewReader(errorBuffer.Bytes()) 5716 5717 errorCode := "UnknownError" 5718 errorMessage := errorCode 5719 5720 code := response.Header.Get("X-Amzn-ErrorType") 5721 if len(code) != 0 { 5722 errorCode = restjson.SanitizeErrorCode(code) 5723 } 5724 5725 var buff [1024]byte 5726 ringBuffer := smithyio.NewRingBuffer(buff[:]) 5727 5728 body := io.TeeReader(errorBody, ringBuffer) 5729 decoder := json.NewDecoder(body) 5730 decoder.UseNumber() 5731 code, message, err := restjson.GetErrorInfo(decoder) 5732 if err != nil { 5733 var snapshot bytes.Buffer 5734 io.Copy(&snapshot, ringBuffer) 5735 err = &smithy.DeserializationError{ 5736 Err: fmt.Errorf("failed to decode response body, %w", err), 5737 Snapshot: snapshot.Bytes(), 5738 } 5739 return err 5740 } 5741 5742 errorBody.Seek(0, io.SeekStart) 5743 if len(code) != 0 { 5744 errorCode = restjson.SanitizeErrorCode(code) 5745 } 5746 if len(message) != 0 { 5747 errorMessage = message 5748 } 5749 5750 switch { 5751 case strings.EqualFold("BadRequestException", errorCode): 5752 return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) 5753 5754 case strings.EqualFold("DependentServiceFailureException", errorCode): 5755 return awsRestjson1_deserializeErrorDependentServiceFailureException(response, errorBody) 5756 5757 case strings.EqualFold("InternalFailureException", errorCode): 5758 return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) 5759 5760 case strings.EqualFold("NotFoundException", errorCode): 5761 return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) 5762 5763 case strings.EqualFold("UnauthorizedException", errorCode): 5764 return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody) 5765 5766 default: 5767 genericError := &smithy.GenericAPIError{ 5768 Code: errorCode, 5769 Message: errorMessage, 5770 } 5771 return genericError 5772 5773 } 5774} 5775 5776func awsRestjson1_deserializeOpDocumentUpdateWebhookOutput(v **UpdateWebhookOutput, value interface{}) error { 5777 if v == nil { 5778 return fmt.Errorf("unexpected nil of type %T", v) 5779 } 5780 if value == nil { 5781 return nil 5782 } 5783 5784 shape, ok := value.(map[string]interface{}) 5785 if !ok { 5786 return fmt.Errorf("unexpected JSON type %v", value) 5787 } 5788 5789 var sv *UpdateWebhookOutput 5790 if *v == nil { 5791 sv = &UpdateWebhookOutput{} 5792 } else { 5793 sv = *v 5794 } 5795 5796 for key, value := range shape { 5797 switch key { 5798 case "webhook": 5799 if err := awsRestjson1_deserializeDocumentWebhook(&sv.Webhook, value); err != nil { 5800 return err 5801 } 5802 5803 default: 5804 _, _ = key, value 5805 5806 } 5807 } 5808 *v = sv 5809 return nil 5810} 5811 5812func awsRestjson1_deserializeErrorBadRequestException(response *smithyhttp.Response, errorBody *bytes.Reader) error { 5813 output := &types.BadRequestException{} 5814 var buff [1024]byte 5815 ringBuffer := smithyio.NewRingBuffer(buff[:]) 5816 5817 body := io.TeeReader(errorBody, ringBuffer) 5818 decoder := json.NewDecoder(body) 5819 decoder.UseNumber() 5820 var shape interface{} 5821 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 5822 var snapshot bytes.Buffer 5823 io.Copy(&snapshot, ringBuffer) 5824 err = &smithy.DeserializationError{ 5825 Err: fmt.Errorf("failed to decode response body, %w", err), 5826 Snapshot: snapshot.Bytes(), 5827 } 5828 return err 5829 } 5830 5831 err := awsRestjson1_deserializeDocumentBadRequestException(&output, shape) 5832 5833 if err != nil { 5834 var snapshot bytes.Buffer 5835 io.Copy(&snapshot, ringBuffer) 5836 err = &smithy.DeserializationError{ 5837 Err: fmt.Errorf("failed to decode response body, %w", err), 5838 Snapshot: snapshot.Bytes(), 5839 } 5840 return err 5841 } 5842 5843 errorBody.Seek(0, io.SeekStart) 5844 5845 return output 5846} 5847 5848func awsRestjson1_deserializeErrorDependentServiceFailureException(response *smithyhttp.Response, errorBody *bytes.Reader) error { 5849 output := &types.DependentServiceFailureException{} 5850 var buff [1024]byte 5851 ringBuffer := smithyio.NewRingBuffer(buff[:]) 5852 5853 body := io.TeeReader(errorBody, ringBuffer) 5854 decoder := json.NewDecoder(body) 5855 decoder.UseNumber() 5856 var shape interface{} 5857 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 5858 var snapshot bytes.Buffer 5859 io.Copy(&snapshot, ringBuffer) 5860 err = &smithy.DeserializationError{ 5861 Err: fmt.Errorf("failed to decode response body, %w", err), 5862 Snapshot: snapshot.Bytes(), 5863 } 5864 return err 5865 } 5866 5867 err := awsRestjson1_deserializeDocumentDependentServiceFailureException(&output, shape) 5868 5869 if err != nil { 5870 var snapshot bytes.Buffer 5871 io.Copy(&snapshot, ringBuffer) 5872 err = &smithy.DeserializationError{ 5873 Err: fmt.Errorf("failed to decode response body, %w", err), 5874 Snapshot: snapshot.Bytes(), 5875 } 5876 return err 5877 } 5878 5879 errorBody.Seek(0, io.SeekStart) 5880 5881 return output 5882} 5883 5884func awsRestjson1_deserializeErrorInternalFailureException(response *smithyhttp.Response, errorBody *bytes.Reader) error { 5885 output := &types.InternalFailureException{} 5886 var buff [1024]byte 5887 ringBuffer := smithyio.NewRingBuffer(buff[:]) 5888 5889 body := io.TeeReader(errorBody, ringBuffer) 5890 decoder := json.NewDecoder(body) 5891 decoder.UseNumber() 5892 var shape interface{} 5893 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 5894 var snapshot bytes.Buffer 5895 io.Copy(&snapshot, ringBuffer) 5896 err = &smithy.DeserializationError{ 5897 Err: fmt.Errorf("failed to decode response body, %w", err), 5898 Snapshot: snapshot.Bytes(), 5899 } 5900 return err 5901 } 5902 5903 err := awsRestjson1_deserializeDocumentInternalFailureException(&output, shape) 5904 5905 if err != nil { 5906 var snapshot bytes.Buffer 5907 io.Copy(&snapshot, ringBuffer) 5908 err = &smithy.DeserializationError{ 5909 Err: fmt.Errorf("failed to decode response body, %w", err), 5910 Snapshot: snapshot.Bytes(), 5911 } 5912 return err 5913 } 5914 5915 errorBody.Seek(0, io.SeekStart) 5916 5917 return output 5918} 5919 5920func awsRestjson1_deserializeErrorLimitExceededException(response *smithyhttp.Response, errorBody *bytes.Reader) error { 5921 output := &types.LimitExceededException{} 5922 var buff [1024]byte 5923 ringBuffer := smithyio.NewRingBuffer(buff[:]) 5924 5925 body := io.TeeReader(errorBody, ringBuffer) 5926 decoder := json.NewDecoder(body) 5927 decoder.UseNumber() 5928 var shape interface{} 5929 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 5930 var snapshot bytes.Buffer 5931 io.Copy(&snapshot, ringBuffer) 5932 err = &smithy.DeserializationError{ 5933 Err: fmt.Errorf("failed to decode response body, %w", err), 5934 Snapshot: snapshot.Bytes(), 5935 } 5936 return err 5937 } 5938 5939 err := awsRestjson1_deserializeDocumentLimitExceededException(&output, shape) 5940 5941 if err != nil { 5942 var snapshot bytes.Buffer 5943 io.Copy(&snapshot, ringBuffer) 5944 err = &smithy.DeserializationError{ 5945 Err: fmt.Errorf("failed to decode response body, %w", err), 5946 Snapshot: snapshot.Bytes(), 5947 } 5948 return err 5949 } 5950 5951 errorBody.Seek(0, io.SeekStart) 5952 5953 return output 5954} 5955 5956func awsRestjson1_deserializeErrorNotFoundException(response *smithyhttp.Response, errorBody *bytes.Reader) error { 5957 output := &types.NotFoundException{} 5958 var buff [1024]byte 5959 ringBuffer := smithyio.NewRingBuffer(buff[:]) 5960 5961 body := io.TeeReader(errorBody, ringBuffer) 5962 decoder := json.NewDecoder(body) 5963 decoder.UseNumber() 5964 var shape interface{} 5965 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 5966 var snapshot bytes.Buffer 5967 io.Copy(&snapshot, ringBuffer) 5968 err = &smithy.DeserializationError{ 5969 Err: fmt.Errorf("failed to decode response body, %w", err), 5970 Snapshot: snapshot.Bytes(), 5971 } 5972 return err 5973 } 5974 5975 err := awsRestjson1_deserializeDocumentNotFoundException(&output, shape) 5976 5977 if err != nil { 5978 var snapshot bytes.Buffer 5979 io.Copy(&snapshot, ringBuffer) 5980 err = &smithy.DeserializationError{ 5981 Err: fmt.Errorf("failed to decode response body, %w", err), 5982 Snapshot: snapshot.Bytes(), 5983 } 5984 return err 5985 } 5986 5987 errorBody.Seek(0, io.SeekStart) 5988 5989 return output 5990} 5991 5992func awsRestjson1_deserializeErrorResourceNotFoundException(response *smithyhttp.Response, errorBody *bytes.Reader) error { 5993 output := &types.ResourceNotFoundException{} 5994 var buff [1024]byte 5995 ringBuffer := smithyio.NewRingBuffer(buff[:]) 5996 5997 body := io.TeeReader(errorBody, ringBuffer) 5998 decoder := json.NewDecoder(body) 5999 decoder.UseNumber() 6000 var shape interface{} 6001 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 6002 var snapshot bytes.Buffer 6003 io.Copy(&snapshot, ringBuffer) 6004 err = &smithy.DeserializationError{ 6005 Err: fmt.Errorf("failed to decode response body, %w", err), 6006 Snapshot: snapshot.Bytes(), 6007 } 6008 return err 6009 } 6010 6011 err := awsRestjson1_deserializeDocumentResourceNotFoundException(&output, shape) 6012 6013 if err != nil { 6014 var snapshot bytes.Buffer 6015 io.Copy(&snapshot, ringBuffer) 6016 err = &smithy.DeserializationError{ 6017 Err: fmt.Errorf("failed to decode response body, %w", err), 6018 Snapshot: snapshot.Bytes(), 6019 } 6020 return err 6021 } 6022 6023 errorBody.Seek(0, io.SeekStart) 6024 6025 return output 6026} 6027 6028func awsRestjson1_deserializeErrorUnauthorizedException(response *smithyhttp.Response, errorBody *bytes.Reader) error { 6029 output := &types.UnauthorizedException{} 6030 var buff [1024]byte 6031 ringBuffer := smithyio.NewRingBuffer(buff[:]) 6032 6033 body := io.TeeReader(errorBody, ringBuffer) 6034 decoder := json.NewDecoder(body) 6035 decoder.UseNumber() 6036 var shape interface{} 6037 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 6038 var snapshot bytes.Buffer 6039 io.Copy(&snapshot, ringBuffer) 6040 err = &smithy.DeserializationError{ 6041 Err: fmt.Errorf("failed to decode response body, %w", err), 6042 Snapshot: snapshot.Bytes(), 6043 } 6044 return err 6045 } 6046 6047 err := awsRestjson1_deserializeDocumentUnauthorizedException(&output, shape) 6048 6049 if err != nil { 6050 var snapshot bytes.Buffer 6051 io.Copy(&snapshot, ringBuffer) 6052 err = &smithy.DeserializationError{ 6053 Err: fmt.Errorf("failed to decode response body, %w", err), 6054 Snapshot: snapshot.Bytes(), 6055 } 6056 return err 6057 } 6058 6059 errorBody.Seek(0, io.SeekStart) 6060 6061 return output 6062} 6063 6064func awsRestjson1_deserializeDocumentApp(v **types.App, value interface{}) error { 6065 if v == nil { 6066 return fmt.Errorf("unexpected nil of type %T", v) 6067 } 6068 if value == nil { 6069 return nil 6070 } 6071 6072 shape, ok := value.(map[string]interface{}) 6073 if !ok { 6074 return fmt.Errorf("unexpected JSON type %v", value) 6075 } 6076 6077 var sv *types.App 6078 if *v == nil { 6079 sv = &types.App{} 6080 } else { 6081 sv = *v 6082 } 6083 6084 for key, value := range shape { 6085 switch key { 6086 case "appArn": 6087 if value != nil { 6088 jtv, ok := value.(string) 6089 if !ok { 6090 return fmt.Errorf("expected AppArn to be of type string, got %T instead", value) 6091 } 6092 sv.AppArn = ptr.String(jtv) 6093 } 6094 6095 case "appId": 6096 if value != nil { 6097 jtv, ok := value.(string) 6098 if !ok { 6099 return fmt.Errorf("expected AppId to be of type string, got %T instead", value) 6100 } 6101 sv.AppId = ptr.String(jtv) 6102 } 6103 6104 case "autoBranchCreationConfig": 6105 if err := awsRestjson1_deserializeDocumentAutoBranchCreationConfig(&sv.AutoBranchCreationConfig, value); err != nil { 6106 return err 6107 } 6108 6109 case "autoBranchCreationPatterns": 6110 if err := awsRestjson1_deserializeDocumentAutoBranchCreationPatterns(&sv.AutoBranchCreationPatterns, value); err != nil { 6111 return err 6112 } 6113 6114 case "basicAuthCredentials": 6115 if value != nil { 6116 jtv, ok := value.(string) 6117 if !ok { 6118 return fmt.Errorf("expected BasicAuthCredentials to be of type string, got %T instead", value) 6119 } 6120 sv.BasicAuthCredentials = ptr.String(jtv) 6121 } 6122 6123 case "buildSpec": 6124 if value != nil { 6125 jtv, ok := value.(string) 6126 if !ok { 6127 return fmt.Errorf("expected BuildSpec to be of type string, got %T instead", value) 6128 } 6129 sv.BuildSpec = ptr.String(jtv) 6130 } 6131 6132 case "createTime": 6133 if value != nil { 6134 jtv, ok := value.(json.Number) 6135 if !ok { 6136 return fmt.Errorf("expected CreateTime to be json.Number, got %T instead", value) 6137 } 6138 f64, err := jtv.Float64() 6139 if err != nil { 6140 return err 6141 } 6142 sv.CreateTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) 6143 } 6144 6145 case "customHeaders": 6146 if value != nil { 6147 jtv, ok := value.(string) 6148 if !ok { 6149 return fmt.Errorf("expected CustomHeaders to be of type string, got %T instead", value) 6150 } 6151 sv.CustomHeaders = ptr.String(jtv) 6152 } 6153 6154 case "customRules": 6155 if err := awsRestjson1_deserializeDocumentCustomRules(&sv.CustomRules, value); err != nil { 6156 return err 6157 } 6158 6159 case "defaultDomain": 6160 if value != nil { 6161 jtv, ok := value.(string) 6162 if !ok { 6163 return fmt.Errorf("expected DefaultDomain to be of type string, got %T instead", value) 6164 } 6165 sv.DefaultDomain = ptr.String(jtv) 6166 } 6167 6168 case "description": 6169 if value != nil { 6170 jtv, ok := value.(string) 6171 if !ok { 6172 return fmt.Errorf("expected Description to be of type string, got %T instead", value) 6173 } 6174 sv.Description = ptr.String(jtv) 6175 } 6176 6177 case "enableAutoBranchCreation": 6178 if value != nil { 6179 jtv, ok := value.(bool) 6180 if !ok { 6181 return fmt.Errorf("expected EnableAutoBranchCreation to be of type *bool, got %T instead", value) 6182 } 6183 sv.EnableAutoBranchCreation = ptr.Bool(jtv) 6184 } 6185 6186 case "enableBasicAuth": 6187 if value != nil { 6188 jtv, ok := value.(bool) 6189 if !ok { 6190 return fmt.Errorf("expected EnableBasicAuth to be of type *bool, got %T instead", value) 6191 } 6192 sv.EnableBasicAuth = ptr.Bool(jtv) 6193 } 6194 6195 case "enableBranchAutoBuild": 6196 if value != nil { 6197 jtv, ok := value.(bool) 6198 if !ok { 6199 return fmt.Errorf("expected EnableBranchAutoBuild to be of type *bool, got %T instead", value) 6200 } 6201 sv.EnableBranchAutoBuild = ptr.Bool(jtv) 6202 } 6203 6204 case "enableBranchAutoDeletion": 6205 if value != nil { 6206 jtv, ok := value.(bool) 6207 if !ok { 6208 return fmt.Errorf("expected EnableBranchAutoDeletion to be of type *bool, got %T instead", value) 6209 } 6210 sv.EnableBranchAutoDeletion = ptr.Bool(jtv) 6211 } 6212 6213 case "environmentVariables": 6214 if err := awsRestjson1_deserializeDocumentEnvironmentVariables(&sv.EnvironmentVariables, value); err != nil { 6215 return err 6216 } 6217 6218 case "iamServiceRoleArn": 6219 if value != nil { 6220 jtv, ok := value.(string) 6221 if !ok { 6222 return fmt.Errorf("expected ServiceRoleArn to be of type string, got %T instead", value) 6223 } 6224 sv.IamServiceRoleArn = ptr.String(jtv) 6225 } 6226 6227 case "name": 6228 if value != nil { 6229 jtv, ok := value.(string) 6230 if !ok { 6231 return fmt.Errorf("expected Name to be of type string, got %T instead", value) 6232 } 6233 sv.Name = ptr.String(jtv) 6234 } 6235 6236 case "platform": 6237 if value != nil { 6238 jtv, ok := value.(string) 6239 if !ok { 6240 return fmt.Errorf("expected Platform to be of type string, got %T instead", value) 6241 } 6242 sv.Platform = types.Platform(jtv) 6243 } 6244 6245 case "productionBranch": 6246 if err := awsRestjson1_deserializeDocumentProductionBranch(&sv.ProductionBranch, value); err != nil { 6247 return err 6248 } 6249 6250 case "repository": 6251 if value != nil { 6252 jtv, ok := value.(string) 6253 if !ok { 6254 return fmt.Errorf("expected Repository to be of type string, got %T instead", value) 6255 } 6256 sv.Repository = ptr.String(jtv) 6257 } 6258 6259 case "tags": 6260 if err := awsRestjson1_deserializeDocumentTagMap(&sv.Tags, value); err != nil { 6261 return err 6262 } 6263 6264 case "updateTime": 6265 if value != nil { 6266 jtv, ok := value.(json.Number) 6267 if !ok { 6268 return fmt.Errorf("expected UpdateTime to be json.Number, got %T instead", value) 6269 } 6270 f64, err := jtv.Float64() 6271 if err != nil { 6272 return err 6273 } 6274 sv.UpdateTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) 6275 } 6276 6277 default: 6278 _, _ = key, value 6279 6280 } 6281 } 6282 *v = sv 6283 return nil 6284} 6285 6286func awsRestjson1_deserializeDocumentApps(v *[]types.App, value interface{}) error { 6287 if v == nil { 6288 return fmt.Errorf("unexpected nil of type %T", v) 6289 } 6290 if value == nil { 6291 return nil 6292 } 6293 6294 shape, ok := value.([]interface{}) 6295 if !ok { 6296 return fmt.Errorf("unexpected JSON type %v", value) 6297 } 6298 6299 var cv []types.App 6300 if *v == nil { 6301 cv = []types.App{} 6302 } else { 6303 cv = *v 6304 } 6305 6306 for _, value := range shape { 6307 var col types.App 6308 destAddr := &col 6309 if err := awsRestjson1_deserializeDocumentApp(&destAddr, value); err != nil { 6310 return err 6311 } 6312 col = *destAddr 6313 cv = append(cv, col) 6314 6315 } 6316 *v = cv 6317 return nil 6318} 6319 6320func awsRestjson1_deserializeDocumentArtifact(v **types.Artifact, value interface{}) error { 6321 if v == nil { 6322 return fmt.Errorf("unexpected nil of type %T", v) 6323 } 6324 if value == nil { 6325 return nil 6326 } 6327 6328 shape, ok := value.(map[string]interface{}) 6329 if !ok { 6330 return fmt.Errorf("unexpected JSON type %v", value) 6331 } 6332 6333 var sv *types.Artifact 6334 if *v == nil { 6335 sv = &types.Artifact{} 6336 } else { 6337 sv = *v 6338 } 6339 6340 for key, value := range shape { 6341 switch key { 6342 case "artifactFileName": 6343 if value != nil { 6344 jtv, ok := value.(string) 6345 if !ok { 6346 return fmt.Errorf("expected ArtifactFileName to be of type string, got %T instead", value) 6347 } 6348 sv.ArtifactFileName = ptr.String(jtv) 6349 } 6350 6351 case "artifactId": 6352 if value != nil { 6353 jtv, ok := value.(string) 6354 if !ok { 6355 return fmt.Errorf("expected ArtifactId to be of type string, got %T instead", value) 6356 } 6357 sv.ArtifactId = ptr.String(jtv) 6358 } 6359 6360 default: 6361 _, _ = key, value 6362 6363 } 6364 } 6365 *v = sv 6366 return nil 6367} 6368 6369func awsRestjson1_deserializeDocumentArtifacts(v *[]types.Artifact, value interface{}) error { 6370 if v == nil { 6371 return fmt.Errorf("unexpected nil of type %T", v) 6372 } 6373 if value == nil { 6374 return nil 6375 } 6376 6377 shape, ok := value.([]interface{}) 6378 if !ok { 6379 return fmt.Errorf("unexpected JSON type %v", value) 6380 } 6381 6382 var cv []types.Artifact 6383 if *v == nil { 6384 cv = []types.Artifact{} 6385 } else { 6386 cv = *v 6387 } 6388 6389 for _, value := range shape { 6390 var col types.Artifact 6391 destAddr := &col 6392 if err := awsRestjson1_deserializeDocumentArtifact(&destAddr, value); err != nil { 6393 return err 6394 } 6395 col = *destAddr 6396 cv = append(cv, col) 6397 6398 } 6399 *v = cv 6400 return nil 6401} 6402 6403func awsRestjson1_deserializeDocumentAssociatedResources(v *[]string, value interface{}) error { 6404 if v == nil { 6405 return fmt.Errorf("unexpected nil of type %T", v) 6406 } 6407 if value == nil { 6408 return nil 6409 } 6410 6411 shape, ok := value.([]interface{}) 6412 if !ok { 6413 return fmt.Errorf("unexpected JSON type %v", value) 6414 } 6415 6416 var cv []string 6417 if *v == nil { 6418 cv = []string{} 6419 } else { 6420 cv = *v 6421 } 6422 6423 for _, value := range shape { 6424 var col string 6425 if value != nil { 6426 jtv, ok := value.(string) 6427 if !ok { 6428 return fmt.Errorf("expected AssociatedResource to be of type string, got %T instead", value) 6429 } 6430 col = jtv 6431 } 6432 cv = append(cv, col) 6433 6434 } 6435 *v = cv 6436 return nil 6437} 6438 6439func awsRestjson1_deserializeDocumentAutoBranchCreationConfig(v **types.AutoBranchCreationConfig, value interface{}) error { 6440 if v == nil { 6441 return fmt.Errorf("unexpected nil of type %T", v) 6442 } 6443 if value == nil { 6444 return nil 6445 } 6446 6447 shape, ok := value.(map[string]interface{}) 6448 if !ok { 6449 return fmt.Errorf("unexpected JSON type %v", value) 6450 } 6451 6452 var sv *types.AutoBranchCreationConfig 6453 if *v == nil { 6454 sv = &types.AutoBranchCreationConfig{} 6455 } else { 6456 sv = *v 6457 } 6458 6459 for key, value := range shape { 6460 switch key { 6461 case "basicAuthCredentials": 6462 if value != nil { 6463 jtv, ok := value.(string) 6464 if !ok { 6465 return fmt.Errorf("expected BasicAuthCredentials to be of type string, got %T instead", value) 6466 } 6467 sv.BasicAuthCredentials = ptr.String(jtv) 6468 } 6469 6470 case "buildSpec": 6471 if value != nil { 6472 jtv, ok := value.(string) 6473 if !ok { 6474 return fmt.Errorf("expected BuildSpec to be of type string, got %T instead", value) 6475 } 6476 sv.BuildSpec = ptr.String(jtv) 6477 } 6478 6479 case "enableAutoBuild": 6480 if value != nil { 6481 jtv, ok := value.(bool) 6482 if !ok { 6483 return fmt.Errorf("expected EnableAutoBuild to be of type *bool, got %T instead", value) 6484 } 6485 sv.EnableAutoBuild = ptr.Bool(jtv) 6486 } 6487 6488 case "enableBasicAuth": 6489 if value != nil { 6490 jtv, ok := value.(bool) 6491 if !ok { 6492 return fmt.Errorf("expected EnableBasicAuth to be of type *bool, got %T instead", value) 6493 } 6494 sv.EnableBasicAuth = ptr.Bool(jtv) 6495 } 6496 6497 case "enablePerformanceMode": 6498 if value != nil { 6499 jtv, ok := value.(bool) 6500 if !ok { 6501 return fmt.Errorf("expected EnablePerformanceMode to be of type *bool, got %T instead", value) 6502 } 6503 sv.EnablePerformanceMode = ptr.Bool(jtv) 6504 } 6505 6506 case "enablePullRequestPreview": 6507 if value != nil { 6508 jtv, ok := value.(bool) 6509 if !ok { 6510 return fmt.Errorf("expected EnablePullRequestPreview to be of type *bool, got %T instead", value) 6511 } 6512 sv.EnablePullRequestPreview = ptr.Bool(jtv) 6513 } 6514 6515 case "environmentVariables": 6516 if err := awsRestjson1_deserializeDocumentEnvironmentVariables(&sv.EnvironmentVariables, value); err != nil { 6517 return err 6518 } 6519 6520 case "framework": 6521 if value != nil { 6522 jtv, ok := value.(string) 6523 if !ok { 6524 return fmt.Errorf("expected Framework to be of type string, got %T instead", value) 6525 } 6526 sv.Framework = ptr.String(jtv) 6527 } 6528 6529 case "pullRequestEnvironmentName": 6530 if value != nil { 6531 jtv, ok := value.(string) 6532 if !ok { 6533 return fmt.Errorf("expected PullRequestEnvironmentName to be of type string, got %T instead", value) 6534 } 6535 sv.PullRequestEnvironmentName = ptr.String(jtv) 6536 } 6537 6538 case "stage": 6539 if value != nil { 6540 jtv, ok := value.(string) 6541 if !ok { 6542 return fmt.Errorf("expected Stage to be of type string, got %T instead", value) 6543 } 6544 sv.Stage = types.Stage(jtv) 6545 } 6546 6547 default: 6548 _, _ = key, value 6549 6550 } 6551 } 6552 *v = sv 6553 return nil 6554} 6555 6556func awsRestjson1_deserializeDocumentAutoBranchCreationPatterns(v *[]string, value interface{}) error { 6557 if v == nil { 6558 return fmt.Errorf("unexpected nil of type %T", v) 6559 } 6560 if value == nil { 6561 return nil 6562 } 6563 6564 shape, ok := value.([]interface{}) 6565 if !ok { 6566 return fmt.Errorf("unexpected JSON type %v", value) 6567 } 6568 6569 var cv []string 6570 if *v == nil { 6571 cv = []string{} 6572 } else { 6573 cv = *v 6574 } 6575 6576 for _, value := range shape { 6577 var col string 6578 if value != nil { 6579 jtv, ok := value.(string) 6580 if !ok { 6581 return fmt.Errorf("expected AutoBranchCreationPattern to be of type string, got %T instead", value) 6582 } 6583 col = jtv 6584 } 6585 cv = append(cv, col) 6586 6587 } 6588 *v = cv 6589 return nil 6590} 6591 6592func awsRestjson1_deserializeDocumentAutoSubDomainCreationPatterns(v *[]string, value interface{}) error { 6593 if v == nil { 6594 return fmt.Errorf("unexpected nil of type %T", v) 6595 } 6596 if value == nil { 6597 return nil 6598 } 6599 6600 shape, ok := value.([]interface{}) 6601 if !ok { 6602 return fmt.Errorf("unexpected JSON type %v", value) 6603 } 6604 6605 var cv []string 6606 if *v == nil { 6607 cv = []string{} 6608 } else { 6609 cv = *v 6610 } 6611 6612 for _, value := range shape { 6613 var col string 6614 if value != nil { 6615 jtv, ok := value.(string) 6616 if !ok { 6617 return fmt.Errorf("expected AutoSubDomainCreationPattern to be of type string, got %T instead", value) 6618 } 6619 col = jtv 6620 } 6621 cv = append(cv, col) 6622 6623 } 6624 *v = cv 6625 return nil 6626} 6627 6628func awsRestjson1_deserializeDocumentBackendEnvironment(v **types.BackendEnvironment, value interface{}) error { 6629 if v == nil { 6630 return fmt.Errorf("unexpected nil of type %T", v) 6631 } 6632 if value == nil { 6633 return nil 6634 } 6635 6636 shape, ok := value.(map[string]interface{}) 6637 if !ok { 6638 return fmt.Errorf("unexpected JSON type %v", value) 6639 } 6640 6641 var sv *types.BackendEnvironment 6642 if *v == nil { 6643 sv = &types.BackendEnvironment{} 6644 } else { 6645 sv = *v 6646 } 6647 6648 for key, value := range shape { 6649 switch key { 6650 case "backendEnvironmentArn": 6651 if value != nil { 6652 jtv, ok := value.(string) 6653 if !ok { 6654 return fmt.Errorf("expected BackendEnvironmentArn to be of type string, got %T instead", value) 6655 } 6656 sv.BackendEnvironmentArn = ptr.String(jtv) 6657 } 6658 6659 case "createTime": 6660 if value != nil { 6661 jtv, ok := value.(json.Number) 6662 if !ok { 6663 return fmt.Errorf("expected CreateTime to be json.Number, got %T instead", value) 6664 } 6665 f64, err := jtv.Float64() 6666 if err != nil { 6667 return err 6668 } 6669 sv.CreateTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) 6670 } 6671 6672 case "deploymentArtifacts": 6673 if value != nil { 6674 jtv, ok := value.(string) 6675 if !ok { 6676 return fmt.Errorf("expected DeploymentArtifacts to be of type string, got %T instead", value) 6677 } 6678 sv.DeploymentArtifacts = ptr.String(jtv) 6679 } 6680 6681 case "environmentName": 6682 if value != nil { 6683 jtv, ok := value.(string) 6684 if !ok { 6685 return fmt.Errorf("expected EnvironmentName to be of type string, got %T instead", value) 6686 } 6687 sv.EnvironmentName = ptr.String(jtv) 6688 } 6689 6690 case "stackName": 6691 if value != nil { 6692 jtv, ok := value.(string) 6693 if !ok { 6694 return fmt.Errorf("expected StackName to be of type string, got %T instead", value) 6695 } 6696 sv.StackName = ptr.String(jtv) 6697 } 6698 6699 case "updateTime": 6700 if value != nil { 6701 jtv, ok := value.(json.Number) 6702 if !ok { 6703 return fmt.Errorf("expected UpdateTime to be json.Number, got %T instead", value) 6704 } 6705 f64, err := jtv.Float64() 6706 if err != nil { 6707 return err 6708 } 6709 sv.UpdateTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) 6710 } 6711 6712 default: 6713 _, _ = key, value 6714 6715 } 6716 } 6717 *v = sv 6718 return nil 6719} 6720 6721func awsRestjson1_deserializeDocumentBackendEnvironments(v *[]types.BackendEnvironment, value interface{}) error { 6722 if v == nil { 6723 return fmt.Errorf("unexpected nil of type %T", v) 6724 } 6725 if value == nil { 6726 return nil 6727 } 6728 6729 shape, ok := value.([]interface{}) 6730 if !ok { 6731 return fmt.Errorf("unexpected JSON type %v", value) 6732 } 6733 6734 var cv []types.BackendEnvironment 6735 if *v == nil { 6736 cv = []types.BackendEnvironment{} 6737 } else { 6738 cv = *v 6739 } 6740 6741 for _, value := range shape { 6742 var col types.BackendEnvironment 6743 destAddr := &col 6744 if err := awsRestjson1_deserializeDocumentBackendEnvironment(&destAddr, value); err != nil { 6745 return err 6746 } 6747 col = *destAddr 6748 cv = append(cv, col) 6749 6750 } 6751 *v = cv 6752 return nil 6753} 6754 6755func awsRestjson1_deserializeDocumentBadRequestException(v **types.BadRequestException, value interface{}) error { 6756 if v == nil { 6757 return fmt.Errorf("unexpected nil of type %T", v) 6758 } 6759 if value == nil { 6760 return nil 6761 } 6762 6763 shape, ok := value.(map[string]interface{}) 6764 if !ok { 6765 return fmt.Errorf("unexpected JSON type %v", value) 6766 } 6767 6768 var sv *types.BadRequestException 6769 if *v == nil { 6770 sv = &types.BadRequestException{} 6771 } else { 6772 sv = *v 6773 } 6774 6775 for key, value := range shape { 6776 switch key { 6777 case "message": 6778 if value != nil { 6779 jtv, ok := value.(string) 6780 if !ok { 6781 return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) 6782 } 6783 sv.Message = ptr.String(jtv) 6784 } 6785 6786 default: 6787 _, _ = key, value 6788 6789 } 6790 } 6791 *v = sv 6792 return nil 6793} 6794 6795func awsRestjson1_deserializeDocumentBranch(v **types.Branch, value interface{}) error { 6796 if v == nil { 6797 return fmt.Errorf("unexpected nil of type %T", v) 6798 } 6799 if value == nil { 6800 return nil 6801 } 6802 6803 shape, ok := value.(map[string]interface{}) 6804 if !ok { 6805 return fmt.Errorf("unexpected JSON type %v", value) 6806 } 6807 6808 var sv *types.Branch 6809 if *v == nil { 6810 sv = &types.Branch{} 6811 } else { 6812 sv = *v 6813 } 6814 6815 for key, value := range shape { 6816 switch key { 6817 case "activeJobId": 6818 if value != nil { 6819 jtv, ok := value.(string) 6820 if !ok { 6821 return fmt.Errorf("expected ActiveJobId to be of type string, got %T instead", value) 6822 } 6823 sv.ActiveJobId = ptr.String(jtv) 6824 } 6825 6826 case "associatedResources": 6827 if err := awsRestjson1_deserializeDocumentAssociatedResources(&sv.AssociatedResources, value); err != nil { 6828 return err 6829 } 6830 6831 case "backendEnvironmentArn": 6832 if value != nil { 6833 jtv, ok := value.(string) 6834 if !ok { 6835 return fmt.Errorf("expected BackendEnvironmentArn to be of type string, got %T instead", value) 6836 } 6837 sv.BackendEnvironmentArn = ptr.String(jtv) 6838 } 6839 6840 case "basicAuthCredentials": 6841 if value != nil { 6842 jtv, ok := value.(string) 6843 if !ok { 6844 return fmt.Errorf("expected BasicAuthCredentials to be of type string, got %T instead", value) 6845 } 6846 sv.BasicAuthCredentials = ptr.String(jtv) 6847 } 6848 6849 case "branchArn": 6850 if value != nil { 6851 jtv, ok := value.(string) 6852 if !ok { 6853 return fmt.Errorf("expected BranchArn to be of type string, got %T instead", value) 6854 } 6855 sv.BranchArn = ptr.String(jtv) 6856 } 6857 6858 case "branchName": 6859 if value != nil { 6860 jtv, ok := value.(string) 6861 if !ok { 6862 return fmt.Errorf("expected BranchName to be of type string, got %T instead", value) 6863 } 6864 sv.BranchName = ptr.String(jtv) 6865 } 6866 6867 case "buildSpec": 6868 if value != nil { 6869 jtv, ok := value.(string) 6870 if !ok { 6871 return fmt.Errorf("expected BuildSpec to be of type string, got %T instead", value) 6872 } 6873 sv.BuildSpec = ptr.String(jtv) 6874 } 6875 6876 case "createTime": 6877 if value != nil { 6878 jtv, ok := value.(json.Number) 6879 if !ok { 6880 return fmt.Errorf("expected CreateTime to be json.Number, got %T instead", value) 6881 } 6882 f64, err := jtv.Float64() 6883 if err != nil { 6884 return err 6885 } 6886 sv.CreateTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) 6887 } 6888 6889 case "customDomains": 6890 if err := awsRestjson1_deserializeDocumentCustomDomains(&sv.CustomDomains, value); err != nil { 6891 return err 6892 } 6893 6894 case "description": 6895 if value != nil { 6896 jtv, ok := value.(string) 6897 if !ok { 6898 return fmt.Errorf("expected Description to be of type string, got %T instead", value) 6899 } 6900 sv.Description = ptr.String(jtv) 6901 } 6902 6903 case "destinationBranch": 6904 if value != nil { 6905 jtv, ok := value.(string) 6906 if !ok { 6907 return fmt.Errorf("expected BranchName to be of type string, got %T instead", value) 6908 } 6909 sv.DestinationBranch = ptr.String(jtv) 6910 } 6911 6912 case "displayName": 6913 if value != nil { 6914 jtv, ok := value.(string) 6915 if !ok { 6916 return fmt.Errorf("expected DisplayName to be of type string, got %T instead", value) 6917 } 6918 sv.DisplayName = ptr.String(jtv) 6919 } 6920 6921 case "enableAutoBuild": 6922 if value != nil { 6923 jtv, ok := value.(bool) 6924 if !ok { 6925 return fmt.Errorf("expected EnableAutoBuild to be of type *bool, got %T instead", value) 6926 } 6927 sv.EnableAutoBuild = ptr.Bool(jtv) 6928 } 6929 6930 case "enableBasicAuth": 6931 if value != nil { 6932 jtv, ok := value.(bool) 6933 if !ok { 6934 return fmt.Errorf("expected EnableBasicAuth to be of type *bool, got %T instead", value) 6935 } 6936 sv.EnableBasicAuth = ptr.Bool(jtv) 6937 } 6938 6939 case "enableNotification": 6940 if value != nil { 6941 jtv, ok := value.(bool) 6942 if !ok { 6943 return fmt.Errorf("expected EnableNotification to be of type *bool, got %T instead", value) 6944 } 6945 sv.EnableNotification = ptr.Bool(jtv) 6946 } 6947 6948 case "enablePerformanceMode": 6949 if value != nil { 6950 jtv, ok := value.(bool) 6951 if !ok { 6952 return fmt.Errorf("expected EnablePerformanceMode to be of type *bool, got %T instead", value) 6953 } 6954 sv.EnablePerformanceMode = ptr.Bool(jtv) 6955 } 6956 6957 case "enablePullRequestPreview": 6958 if value != nil { 6959 jtv, ok := value.(bool) 6960 if !ok { 6961 return fmt.Errorf("expected EnablePullRequestPreview to be of type *bool, got %T instead", value) 6962 } 6963 sv.EnablePullRequestPreview = ptr.Bool(jtv) 6964 } 6965 6966 case "environmentVariables": 6967 if err := awsRestjson1_deserializeDocumentEnvironmentVariables(&sv.EnvironmentVariables, value); err != nil { 6968 return err 6969 } 6970 6971 case "framework": 6972 if value != nil { 6973 jtv, ok := value.(string) 6974 if !ok { 6975 return fmt.Errorf("expected Framework to be of type string, got %T instead", value) 6976 } 6977 sv.Framework = ptr.String(jtv) 6978 } 6979 6980 case "pullRequestEnvironmentName": 6981 if value != nil { 6982 jtv, ok := value.(string) 6983 if !ok { 6984 return fmt.Errorf("expected PullRequestEnvironmentName to be of type string, got %T instead", value) 6985 } 6986 sv.PullRequestEnvironmentName = ptr.String(jtv) 6987 } 6988 6989 case "sourceBranch": 6990 if value != nil { 6991 jtv, ok := value.(string) 6992 if !ok { 6993 return fmt.Errorf("expected BranchName to be of type string, got %T instead", value) 6994 } 6995 sv.SourceBranch = ptr.String(jtv) 6996 } 6997 6998 case "stage": 6999 if value != nil { 7000 jtv, ok := value.(string) 7001 if !ok { 7002 return fmt.Errorf("expected Stage to be of type string, got %T instead", value) 7003 } 7004 sv.Stage = types.Stage(jtv) 7005 } 7006 7007 case "tags": 7008 if err := awsRestjson1_deserializeDocumentTagMap(&sv.Tags, value); err != nil { 7009 return err 7010 } 7011 7012 case "thumbnailUrl": 7013 if value != nil { 7014 jtv, ok := value.(string) 7015 if !ok { 7016 return fmt.Errorf("expected ThumbnailUrl to be of type string, got %T instead", value) 7017 } 7018 sv.ThumbnailUrl = ptr.String(jtv) 7019 } 7020 7021 case "totalNumberOfJobs": 7022 if value != nil { 7023 jtv, ok := value.(string) 7024 if !ok { 7025 return fmt.Errorf("expected TotalNumberOfJobs to be of type string, got %T instead", value) 7026 } 7027 sv.TotalNumberOfJobs = ptr.String(jtv) 7028 } 7029 7030 case "ttl": 7031 if value != nil { 7032 jtv, ok := value.(string) 7033 if !ok { 7034 return fmt.Errorf("expected TTL to be of type string, got %T instead", value) 7035 } 7036 sv.Ttl = ptr.String(jtv) 7037 } 7038 7039 case "updateTime": 7040 if value != nil { 7041 jtv, ok := value.(json.Number) 7042 if !ok { 7043 return fmt.Errorf("expected UpdateTime to be json.Number, got %T instead", value) 7044 } 7045 f64, err := jtv.Float64() 7046 if err != nil { 7047 return err 7048 } 7049 sv.UpdateTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) 7050 } 7051 7052 default: 7053 _, _ = key, value 7054 7055 } 7056 } 7057 *v = sv 7058 return nil 7059} 7060 7061func awsRestjson1_deserializeDocumentBranches(v *[]types.Branch, value interface{}) error { 7062 if v == nil { 7063 return fmt.Errorf("unexpected nil of type %T", v) 7064 } 7065 if value == nil { 7066 return nil 7067 } 7068 7069 shape, ok := value.([]interface{}) 7070 if !ok { 7071 return fmt.Errorf("unexpected JSON type %v", value) 7072 } 7073 7074 var cv []types.Branch 7075 if *v == nil { 7076 cv = []types.Branch{} 7077 } else { 7078 cv = *v 7079 } 7080 7081 for _, value := range shape { 7082 var col types.Branch 7083 destAddr := &col 7084 if err := awsRestjson1_deserializeDocumentBranch(&destAddr, value); err != nil { 7085 return err 7086 } 7087 col = *destAddr 7088 cv = append(cv, col) 7089 7090 } 7091 *v = cv 7092 return nil 7093} 7094 7095func awsRestjson1_deserializeDocumentCustomDomains(v *[]string, value interface{}) error { 7096 if v == nil { 7097 return fmt.Errorf("unexpected nil of type %T", v) 7098 } 7099 if value == nil { 7100 return nil 7101 } 7102 7103 shape, ok := value.([]interface{}) 7104 if !ok { 7105 return fmt.Errorf("unexpected JSON type %v", value) 7106 } 7107 7108 var cv []string 7109 if *v == nil { 7110 cv = []string{} 7111 } else { 7112 cv = *v 7113 } 7114 7115 for _, value := range shape { 7116 var col string 7117 if value != nil { 7118 jtv, ok := value.(string) 7119 if !ok { 7120 return fmt.Errorf("expected CustomDomain to be of type string, got %T instead", value) 7121 } 7122 col = jtv 7123 } 7124 cv = append(cv, col) 7125 7126 } 7127 *v = cv 7128 return nil 7129} 7130 7131func awsRestjson1_deserializeDocumentCustomRule(v **types.CustomRule, value interface{}) error { 7132 if v == nil { 7133 return fmt.Errorf("unexpected nil of type %T", v) 7134 } 7135 if value == nil { 7136 return nil 7137 } 7138 7139 shape, ok := value.(map[string]interface{}) 7140 if !ok { 7141 return fmt.Errorf("unexpected JSON type %v", value) 7142 } 7143 7144 var sv *types.CustomRule 7145 if *v == nil { 7146 sv = &types.CustomRule{} 7147 } else { 7148 sv = *v 7149 } 7150 7151 for key, value := range shape { 7152 switch key { 7153 case "condition": 7154 if value != nil { 7155 jtv, ok := value.(string) 7156 if !ok { 7157 return fmt.Errorf("expected Condition to be of type string, got %T instead", value) 7158 } 7159 sv.Condition = ptr.String(jtv) 7160 } 7161 7162 case "source": 7163 if value != nil { 7164 jtv, ok := value.(string) 7165 if !ok { 7166 return fmt.Errorf("expected Source to be of type string, got %T instead", value) 7167 } 7168 sv.Source = ptr.String(jtv) 7169 } 7170 7171 case "status": 7172 if value != nil { 7173 jtv, ok := value.(string) 7174 if !ok { 7175 return fmt.Errorf("expected Status to be of type string, got %T instead", value) 7176 } 7177 sv.Status = ptr.String(jtv) 7178 } 7179 7180 case "target": 7181 if value != nil { 7182 jtv, ok := value.(string) 7183 if !ok { 7184 return fmt.Errorf("expected Target to be of type string, got %T instead", value) 7185 } 7186 sv.Target = ptr.String(jtv) 7187 } 7188 7189 default: 7190 _, _ = key, value 7191 7192 } 7193 } 7194 *v = sv 7195 return nil 7196} 7197 7198func awsRestjson1_deserializeDocumentCustomRules(v *[]types.CustomRule, value interface{}) error { 7199 if v == nil { 7200 return fmt.Errorf("unexpected nil of type %T", v) 7201 } 7202 if value == nil { 7203 return nil 7204 } 7205 7206 shape, ok := value.([]interface{}) 7207 if !ok { 7208 return fmt.Errorf("unexpected JSON type %v", value) 7209 } 7210 7211 var cv []types.CustomRule 7212 if *v == nil { 7213 cv = []types.CustomRule{} 7214 } else { 7215 cv = *v 7216 } 7217 7218 for _, value := range shape { 7219 var col types.CustomRule 7220 destAddr := &col 7221 if err := awsRestjson1_deserializeDocumentCustomRule(&destAddr, value); err != nil { 7222 return err 7223 } 7224 col = *destAddr 7225 cv = append(cv, col) 7226 7227 } 7228 *v = cv 7229 return nil 7230} 7231 7232func awsRestjson1_deserializeDocumentDependentServiceFailureException(v **types.DependentServiceFailureException, value interface{}) error { 7233 if v == nil { 7234 return fmt.Errorf("unexpected nil of type %T", v) 7235 } 7236 if value == nil { 7237 return nil 7238 } 7239 7240 shape, ok := value.(map[string]interface{}) 7241 if !ok { 7242 return fmt.Errorf("unexpected JSON type %v", value) 7243 } 7244 7245 var sv *types.DependentServiceFailureException 7246 if *v == nil { 7247 sv = &types.DependentServiceFailureException{} 7248 } else { 7249 sv = *v 7250 } 7251 7252 for key, value := range shape { 7253 switch key { 7254 case "message": 7255 if value != nil { 7256 jtv, ok := value.(string) 7257 if !ok { 7258 return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) 7259 } 7260 sv.Message = ptr.String(jtv) 7261 } 7262 7263 default: 7264 _, _ = key, value 7265 7266 } 7267 } 7268 *v = sv 7269 return nil 7270} 7271 7272func awsRestjson1_deserializeDocumentDomainAssociation(v **types.DomainAssociation, value interface{}) error { 7273 if v == nil { 7274 return fmt.Errorf("unexpected nil of type %T", v) 7275 } 7276 if value == nil { 7277 return nil 7278 } 7279 7280 shape, ok := value.(map[string]interface{}) 7281 if !ok { 7282 return fmt.Errorf("unexpected JSON type %v", value) 7283 } 7284 7285 var sv *types.DomainAssociation 7286 if *v == nil { 7287 sv = &types.DomainAssociation{} 7288 } else { 7289 sv = *v 7290 } 7291 7292 for key, value := range shape { 7293 switch key { 7294 case "autoSubDomainCreationPatterns": 7295 if err := awsRestjson1_deserializeDocumentAutoSubDomainCreationPatterns(&sv.AutoSubDomainCreationPatterns, value); err != nil { 7296 return err 7297 } 7298 7299 case "autoSubDomainIAMRole": 7300 if value != nil { 7301 jtv, ok := value.(string) 7302 if !ok { 7303 return fmt.Errorf("expected AutoSubDomainIAMRole to be of type string, got %T instead", value) 7304 } 7305 sv.AutoSubDomainIAMRole = ptr.String(jtv) 7306 } 7307 7308 case "certificateVerificationDNSRecord": 7309 if value != nil { 7310 jtv, ok := value.(string) 7311 if !ok { 7312 return fmt.Errorf("expected CertificateVerificationDNSRecord to be of type string, got %T instead", value) 7313 } 7314 sv.CertificateVerificationDNSRecord = ptr.String(jtv) 7315 } 7316 7317 case "domainAssociationArn": 7318 if value != nil { 7319 jtv, ok := value.(string) 7320 if !ok { 7321 return fmt.Errorf("expected DomainAssociationArn to be of type string, got %T instead", value) 7322 } 7323 sv.DomainAssociationArn = ptr.String(jtv) 7324 } 7325 7326 case "domainName": 7327 if value != nil { 7328 jtv, ok := value.(string) 7329 if !ok { 7330 return fmt.Errorf("expected DomainName to be of type string, got %T instead", value) 7331 } 7332 sv.DomainName = ptr.String(jtv) 7333 } 7334 7335 case "domainStatus": 7336 if value != nil { 7337 jtv, ok := value.(string) 7338 if !ok { 7339 return fmt.Errorf("expected DomainStatus to be of type string, got %T instead", value) 7340 } 7341 sv.DomainStatus = types.DomainStatus(jtv) 7342 } 7343 7344 case "enableAutoSubDomain": 7345 if value != nil { 7346 jtv, ok := value.(bool) 7347 if !ok { 7348 return fmt.Errorf("expected EnableAutoSubDomain to be of type *bool, got %T instead", value) 7349 } 7350 sv.EnableAutoSubDomain = ptr.Bool(jtv) 7351 } 7352 7353 case "statusReason": 7354 if value != nil { 7355 jtv, ok := value.(string) 7356 if !ok { 7357 return fmt.Errorf("expected StatusReason to be of type string, got %T instead", value) 7358 } 7359 sv.StatusReason = ptr.String(jtv) 7360 } 7361 7362 case "subDomains": 7363 if err := awsRestjson1_deserializeDocumentSubDomains(&sv.SubDomains, value); err != nil { 7364 return err 7365 } 7366 7367 default: 7368 _, _ = key, value 7369 7370 } 7371 } 7372 *v = sv 7373 return nil 7374} 7375 7376func awsRestjson1_deserializeDocumentDomainAssociations(v *[]types.DomainAssociation, value interface{}) error { 7377 if v == nil { 7378 return fmt.Errorf("unexpected nil of type %T", v) 7379 } 7380 if value == nil { 7381 return nil 7382 } 7383 7384 shape, ok := value.([]interface{}) 7385 if !ok { 7386 return fmt.Errorf("unexpected JSON type %v", value) 7387 } 7388 7389 var cv []types.DomainAssociation 7390 if *v == nil { 7391 cv = []types.DomainAssociation{} 7392 } else { 7393 cv = *v 7394 } 7395 7396 for _, value := range shape { 7397 var col types.DomainAssociation 7398 destAddr := &col 7399 if err := awsRestjson1_deserializeDocumentDomainAssociation(&destAddr, value); err != nil { 7400 return err 7401 } 7402 col = *destAddr 7403 cv = append(cv, col) 7404 7405 } 7406 *v = cv 7407 return nil 7408} 7409 7410func awsRestjson1_deserializeDocumentEnvironmentVariables(v *map[string]string, value interface{}) error { 7411 if v == nil { 7412 return fmt.Errorf("unexpected nil of type %T", v) 7413 } 7414 if value == nil { 7415 return nil 7416 } 7417 7418 shape, ok := value.(map[string]interface{}) 7419 if !ok { 7420 return fmt.Errorf("unexpected JSON type %v", value) 7421 } 7422 7423 var mv map[string]string 7424 if *v == nil { 7425 mv = map[string]string{} 7426 } else { 7427 mv = *v 7428 } 7429 7430 for key, value := range shape { 7431 var parsedVal string 7432 if value != nil { 7433 jtv, ok := value.(string) 7434 if !ok { 7435 return fmt.Errorf("expected EnvValue to be of type string, got %T instead", value) 7436 } 7437 parsedVal = jtv 7438 } 7439 mv[key] = parsedVal 7440 7441 } 7442 *v = mv 7443 return nil 7444} 7445 7446func awsRestjson1_deserializeDocumentFileUploadUrls(v *map[string]string, value interface{}) error { 7447 if v == nil { 7448 return fmt.Errorf("unexpected nil of type %T", v) 7449 } 7450 if value == nil { 7451 return nil 7452 } 7453 7454 shape, ok := value.(map[string]interface{}) 7455 if !ok { 7456 return fmt.Errorf("unexpected JSON type %v", value) 7457 } 7458 7459 var mv map[string]string 7460 if *v == nil { 7461 mv = map[string]string{} 7462 } else { 7463 mv = *v 7464 } 7465 7466 for key, value := range shape { 7467 var parsedVal string 7468 if value != nil { 7469 jtv, ok := value.(string) 7470 if !ok { 7471 return fmt.Errorf("expected UploadUrl to be of type string, got %T instead", value) 7472 } 7473 parsedVal = jtv 7474 } 7475 mv[key] = parsedVal 7476 7477 } 7478 *v = mv 7479 return nil 7480} 7481 7482func awsRestjson1_deserializeDocumentInternalFailureException(v **types.InternalFailureException, value interface{}) error { 7483 if v == nil { 7484 return fmt.Errorf("unexpected nil of type %T", v) 7485 } 7486 if value == nil { 7487 return nil 7488 } 7489 7490 shape, ok := value.(map[string]interface{}) 7491 if !ok { 7492 return fmt.Errorf("unexpected JSON type %v", value) 7493 } 7494 7495 var sv *types.InternalFailureException 7496 if *v == nil { 7497 sv = &types.InternalFailureException{} 7498 } else { 7499 sv = *v 7500 } 7501 7502 for key, value := range shape { 7503 switch key { 7504 case "message": 7505 if value != nil { 7506 jtv, ok := value.(string) 7507 if !ok { 7508 return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) 7509 } 7510 sv.Message = ptr.String(jtv) 7511 } 7512 7513 default: 7514 _, _ = key, value 7515 7516 } 7517 } 7518 *v = sv 7519 return nil 7520} 7521 7522func awsRestjson1_deserializeDocumentJob(v **types.Job, value interface{}) error { 7523 if v == nil { 7524 return fmt.Errorf("unexpected nil of type %T", v) 7525 } 7526 if value == nil { 7527 return nil 7528 } 7529 7530 shape, ok := value.(map[string]interface{}) 7531 if !ok { 7532 return fmt.Errorf("unexpected JSON type %v", value) 7533 } 7534 7535 var sv *types.Job 7536 if *v == nil { 7537 sv = &types.Job{} 7538 } else { 7539 sv = *v 7540 } 7541 7542 for key, value := range shape { 7543 switch key { 7544 case "steps": 7545 if err := awsRestjson1_deserializeDocumentSteps(&sv.Steps, value); err != nil { 7546 return err 7547 } 7548 7549 case "summary": 7550 if err := awsRestjson1_deserializeDocumentJobSummary(&sv.Summary, value); err != nil { 7551 return err 7552 } 7553 7554 default: 7555 _, _ = key, value 7556 7557 } 7558 } 7559 *v = sv 7560 return nil 7561} 7562 7563func awsRestjson1_deserializeDocumentJobSummaries(v *[]types.JobSummary, value interface{}) error { 7564 if v == nil { 7565 return fmt.Errorf("unexpected nil of type %T", v) 7566 } 7567 if value == nil { 7568 return nil 7569 } 7570 7571 shape, ok := value.([]interface{}) 7572 if !ok { 7573 return fmt.Errorf("unexpected JSON type %v", value) 7574 } 7575 7576 var cv []types.JobSummary 7577 if *v == nil { 7578 cv = []types.JobSummary{} 7579 } else { 7580 cv = *v 7581 } 7582 7583 for _, value := range shape { 7584 var col types.JobSummary 7585 destAddr := &col 7586 if err := awsRestjson1_deserializeDocumentJobSummary(&destAddr, value); err != nil { 7587 return err 7588 } 7589 col = *destAddr 7590 cv = append(cv, col) 7591 7592 } 7593 *v = cv 7594 return nil 7595} 7596 7597func awsRestjson1_deserializeDocumentJobSummary(v **types.JobSummary, value interface{}) error { 7598 if v == nil { 7599 return fmt.Errorf("unexpected nil of type %T", v) 7600 } 7601 if value == nil { 7602 return nil 7603 } 7604 7605 shape, ok := value.(map[string]interface{}) 7606 if !ok { 7607 return fmt.Errorf("unexpected JSON type %v", value) 7608 } 7609 7610 var sv *types.JobSummary 7611 if *v == nil { 7612 sv = &types.JobSummary{} 7613 } else { 7614 sv = *v 7615 } 7616 7617 for key, value := range shape { 7618 switch key { 7619 case "commitId": 7620 if value != nil { 7621 jtv, ok := value.(string) 7622 if !ok { 7623 return fmt.Errorf("expected CommitId to be of type string, got %T instead", value) 7624 } 7625 sv.CommitId = ptr.String(jtv) 7626 } 7627 7628 case "commitMessage": 7629 if value != nil { 7630 jtv, ok := value.(string) 7631 if !ok { 7632 return fmt.Errorf("expected CommitMessage to be of type string, got %T instead", value) 7633 } 7634 sv.CommitMessage = ptr.String(jtv) 7635 } 7636 7637 case "commitTime": 7638 if value != nil { 7639 jtv, ok := value.(json.Number) 7640 if !ok { 7641 return fmt.Errorf("expected CommitTime to be json.Number, got %T instead", value) 7642 } 7643 f64, err := jtv.Float64() 7644 if err != nil { 7645 return err 7646 } 7647 sv.CommitTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) 7648 } 7649 7650 case "endTime": 7651 if value != nil { 7652 jtv, ok := value.(json.Number) 7653 if !ok { 7654 return fmt.Errorf("expected EndTime to be json.Number, got %T instead", value) 7655 } 7656 f64, err := jtv.Float64() 7657 if err != nil { 7658 return err 7659 } 7660 sv.EndTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) 7661 } 7662 7663 case "jobArn": 7664 if value != nil { 7665 jtv, ok := value.(string) 7666 if !ok { 7667 return fmt.Errorf("expected JobArn to be of type string, got %T instead", value) 7668 } 7669 sv.JobArn = ptr.String(jtv) 7670 } 7671 7672 case "jobId": 7673 if value != nil { 7674 jtv, ok := value.(string) 7675 if !ok { 7676 return fmt.Errorf("expected JobId to be of type string, got %T instead", value) 7677 } 7678 sv.JobId = ptr.String(jtv) 7679 } 7680 7681 case "jobType": 7682 if value != nil { 7683 jtv, ok := value.(string) 7684 if !ok { 7685 return fmt.Errorf("expected JobType to be of type string, got %T instead", value) 7686 } 7687 sv.JobType = types.JobType(jtv) 7688 } 7689 7690 case "startTime": 7691 if value != nil { 7692 jtv, ok := value.(json.Number) 7693 if !ok { 7694 return fmt.Errorf("expected StartTime to be json.Number, got %T instead", value) 7695 } 7696 f64, err := jtv.Float64() 7697 if err != nil { 7698 return err 7699 } 7700 sv.StartTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) 7701 } 7702 7703 case "status": 7704 if value != nil { 7705 jtv, ok := value.(string) 7706 if !ok { 7707 return fmt.Errorf("expected JobStatus to be of type string, got %T instead", value) 7708 } 7709 sv.Status = types.JobStatus(jtv) 7710 } 7711 7712 default: 7713 _, _ = key, value 7714 7715 } 7716 } 7717 *v = sv 7718 return nil 7719} 7720 7721func awsRestjson1_deserializeDocumentLimitExceededException(v **types.LimitExceededException, value interface{}) error { 7722 if v == nil { 7723 return fmt.Errorf("unexpected nil of type %T", v) 7724 } 7725 if value == nil { 7726 return nil 7727 } 7728 7729 shape, ok := value.(map[string]interface{}) 7730 if !ok { 7731 return fmt.Errorf("unexpected JSON type %v", value) 7732 } 7733 7734 var sv *types.LimitExceededException 7735 if *v == nil { 7736 sv = &types.LimitExceededException{} 7737 } else { 7738 sv = *v 7739 } 7740 7741 for key, value := range shape { 7742 switch key { 7743 case "message": 7744 if value != nil { 7745 jtv, ok := value.(string) 7746 if !ok { 7747 return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) 7748 } 7749 sv.Message = ptr.String(jtv) 7750 } 7751 7752 default: 7753 _, _ = key, value 7754 7755 } 7756 } 7757 *v = sv 7758 return nil 7759} 7760 7761func awsRestjson1_deserializeDocumentNotFoundException(v **types.NotFoundException, value interface{}) error { 7762 if v == nil { 7763 return fmt.Errorf("unexpected nil of type %T", v) 7764 } 7765 if value == nil { 7766 return nil 7767 } 7768 7769 shape, ok := value.(map[string]interface{}) 7770 if !ok { 7771 return fmt.Errorf("unexpected JSON type %v", value) 7772 } 7773 7774 var sv *types.NotFoundException 7775 if *v == nil { 7776 sv = &types.NotFoundException{} 7777 } else { 7778 sv = *v 7779 } 7780 7781 for key, value := range shape { 7782 switch key { 7783 case "message": 7784 if value != nil { 7785 jtv, ok := value.(string) 7786 if !ok { 7787 return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) 7788 } 7789 sv.Message = ptr.String(jtv) 7790 } 7791 7792 default: 7793 _, _ = key, value 7794 7795 } 7796 } 7797 *v = sv 7798 return nil 7799} 7800 7801func awsRestjson1_deserializeDocumentProductionBranch(v **types.ProductionBranch, value interface{}) error { 7802 if v == nil { 7803 return fmt.Errorf("unexpected nil of type %T", v) 7804 } 7805 if value == nil { 7806 return nil 7807 } 7808 7809 shape, ok := value.(map[string]interface{}) 7810 if !ok { 7811 return fmt.Errorf("unexpected JSON type %v", value) 7812 } 7813 7814 var sv *types.ProductionBranch 7815 if *v == nil { 7816 sv = &types.ProductionBranch{} 7817 } else { 7818 sv = *v 7819 } 7820 7821 for key, value := range shape { 7822 switch key { 7823 case "branchName": 7824 if value != nil { 7825 jtv, ok := value.(string) 7826 if !ok { 7827 return fmt.Errorf("expected BranchName to be of type string, got %T instead", value) 7828 } 7829 sv.BranchName = ptr.String(jtv) 7830 } 7831 7832 case "lastDeployTime": 7833 if value != nil { 7834 jtv, ok := value.(json.Number) 7835 if !ok { 7836 return fmt.Errorf("expected LastDeployTime to be json.Number, got %T instead", value) 7837 } 7838 f64, err := jtv.Float64() 7839 if err != nil { 7840 return err 7841 } 7842 sv.LastDeployTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) 7843 } 7844 7845 case "status": 7846 if value != nil { 7847 jtv, ok := value.(string) 7848 if !ok { 7849 return fmt.Errorf("expected Status to be of type string, got %T instead", value) 7850 } 7851 sv.Status = ptr.String(jtv) 7852 } 7853 7854 case "thumbnailUrl": 7855 if value != nil { 7856 jtv, ok := value.(string) 7857 if !ok { 7858 return fmt.Errorf("expected ThumbnailUrl to be of type string, got %T instead", value) 7859 } 7860 sv.ThumbnailUrl = ptr.String(jtv) 7861 } 7862 7863 default: 7864 _, _ = key, value 7865 7866 } 7867 } 7868 *v = sv 7869 return nil 7870} 7871 7872func awsRestjson1_deserializeDocumentResourceNotFoundException(v **types.ResourceNotFoundException, value interface{}) error { 7873 if v == nil { 7874 return fmt.Errorf("unexpected nil of type %T", v) 7875 } 7876 if value == nil { 7877 return nil 7878 } 7879 7880 shape, ok := value.(map[string]interface{}) 7881 if !ok { 7882 return fmt.Errorf("unexpected JSON type %v", value) 7883 } 7884 7885 var sv *types.ResourceNotFoundException 7886 if *v == nil { 7887 sv = &types.ResourceNotFoundException{} 7888 } else { 7889 sv = *v 7890 } 7891 7892 for key, value := range shape { 7893 switch key { 7894 case "code": 7895 if value != nil { 7896 jtv, ok := value.(string) 7897 if !ok { 7898 return fmt.Errorf("expected Code to be of type string, got %T instead", value) 7899 } 7900 sv.Code = ptr.String(jtv) 7901 } 7902 7903 case "message": 7904 if value != nil { 7905 jtv, ok := value.(string) 7906 if !ok { 7907 return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) 7908 } 7909 sv.Message = ptr.String(jtv) 7910 } 7911 7912 default: 7913 _, _ = key, value 7914 7915 } 7916 } 7917 *v = sv 7918 return nil 7919} 7920 7921func awsRestjson1_deserializeDocumentScreenshots(v *map[string]string, value interface{}) error { 7922 if v == nil { 7923 return fmt.Errorf("unexpected nil of type %T", v) 7924 } 7925 if value == nil { 7926 return nil 7927 } 7928 7929 shape, ok := value.(map[string]interface{}) 7930 if !ok { 7931 return fmt.Errorf("unexpected JSON type %v", value) 7932 } 7933 7934 var mv map[string]string 7935 if *v == nil { 7936 mv = map[string]string{} 7937 } else { 7938 mv = *v 7939 } 7940 7941 for key, value := range shape { 7942 var parsedVal string 7943 if value != nil { 7944 jtv, ok := value.(string) 7945 if !ok { 7946 return fmt.Errorf("expected ThumbnailUrl to be of type string, got %T instead", value) 7947 } 7948 parsedVal = jtv 7949 } 7950 mv[key] = parsedVal 7951 7952 } 7953 *v = mv 7954 return nil 7955} 7956 7957func awsRestjson1_deserializeDocumentStep(v **types.Step, value interface{}) error { 7958 if v == nil { 7959 return fmt.Errorf("unexpected nil of type %T", v) 7960 } 7961 if value == nil { 7962 return nil 7963 } 7964 7965 shape, ok := value.(map[string]interface{}) 7966 if !ok { 7967 return fmt.Errorf("unexpected JSON type %v", value) 7968 } 7969 7970 var sv *types.Step 7971 if *v == nil { 7972 sv = &types.Step{} 7973 } else { 7974 sv = *v 7975 } 7976 7977 for key, value := range shape { 7978 switch key { 7979 case "artifactsUrl": 7980 if value != nil { 7981 jtv, ok := value.(string) 7982 if !ok { 7983 return fmt.Errorf("expected ArtifactsUrl to be of type string, got %T instead", value) 7984 } 7985 sv.ArtifactsUrl = ptr.String(jtv) 7986 } 7987 7988 case "context": 7989 if value != nil { 7990 jtv, ok := value.(string) 7991 if !ok { 7992 return fmt.Errorf("expected Context to be of type string, got %T instead", value) 7993 } 7994 sv.Context = ptr.String(jtv) 7995 } 7996 7997 case "endTime": 7998 if value != nil { 7999 jtv, ok := value.(json.Number) 8000 if !ok { 8001 return fmt.Errorf("expected EndTime to be json.Number, got %T instead", value) 8002 } 8003 f64, err := jtv.Float64() 8004 if err != nil { 8005 return err 8006 } 8007 sv.EndTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) 8008 } 8009 8010 case "logUrl": 8011 if value != nil { 8012 jtv, ok := value.(string) 8013 if !ok { 8014 return fmt.Errorf("expected LogUrl to be of type string, got %T instead", value) 8015 } 8016 sv.LogUrl = ptr.String(jtv) 8017 } 8018 8019 case "screenshots": 8020 if err := awsRestjson1_deserializeDocumentScreenshots(&sv.Screenshots, value); err != nil { 8021 return err 8022 } 8023 8024 case "startTime": 8025 if value != nil { 8026 jtv, ok := value.(json.Number) 8027 if !ok { 8028 return fmt.Errorf("expected StartTime to be json.Number, got %T instead", value) 8029 } 8030 f64, err := jtv.Float64() 8031 if err != nil { 8032 return err 8033 } 8034 sv.StartTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) 8035 } 8036 8037 case "status": 8038 if value != nil { 8039 jtv, ok := value.(string) 8040 if !ok { 8041 return fmt.Errorf("expected JobStatus to be of type string, got %T instead", value) 8042 } 8043 sv.Status = types.JobStatus(jtv) 8044 } 8045 8046 case "statusReason": 8047 if value != nil { 8048 jtv, ok := value.(string) 8049 if !ok { 8050 return fmt.Errorf("expected StatusReason to be of type string, got %T instead", value) 8051 } 8052 sv.StatusReason = ptr.String(jtv) 8053 } 8054 8055 case "stepName": 8056 if value != nil { 8057 jtv, ok := value.(string) 8058 if !ok { 8059 return fmt.Errorf("expected StepName to be of type string, got %T instead", value) 8060 } 8061 sv.StepName = ptr.String(jtv) 8062 } 8063 8064 case "testArtifactsUrl": 8065 if value != nil { 8066 jtv, ok := value.(string) 8067 if !ok { 8068 return fmt.Errorf("expected TestArtifactsUrl to be of type string, got %T instead", value) 8069 } 8070 sv.TestArtifactsUrl = ptr.String(jtv) 8071 } 8072 8073 case "testConfigUrl": 8074 if value != nil { 8075 jtv, ok := value.(string) 8076 if !ok { 8077 return fmt.Errorf("expected TestConfigUrl to be of type string, got %T instead", value) 8078 } 8079 sv.TestConfigUrl = ptr.String(jtv) 8080 } 8081 8082 default: 8083 _, _ = key, value 8084 8085 } 8086 } 8087 *v = sv 8088 return nil 8089} 8090 8091func awsRestjson1_deserializeDocumentSteps(v *[]types.Step, value interface{}) error { 8092 if v == nil { 8093 return fmt.Errorf("unexpected nil of type %T", v) 8094 } 8095 if value == nil { 8096 return nil 8097 } 8098 8099 shape, ok := value.([]interface{}) 8100 if !ok { 8101 return fmt.Errorf("unexpected JSON type %v", value) 8102 } 8103 8104 var cv []types.Step 8105 if *v == nil { 8106 cv = []types.Step{} 8107 } else { 8108 cv = *v 8109 } 8110 8111 for _, value := range shape { 8112 var col types.Step 8113 destAddr := &col 8114 if err := awsRestjson1_deserializeDocumentStep(&destAddr, value); err != nil { 8115 return err 8116 } 8117 col = *destAddr 8118 cv = append(cv, col) 8119 8120 } 8121 *v = cv 8122 return nil 8123} 8124 8125func awsRestjson1_deserializeDocumentSubDomain(v **types.SubDomain, value interface{}) error { 8126 if v == nil { 8127 return fmt.Errorf("unexpected nil of type %T", v) 8128 } 8129 if value == nil { 8130 return nil 8131 } 8132 8133 shape, ok := value.(map[string]interface{}) 8134 if !ok { 8135 return fmt.Errorf("unexpected JSON type %v", value) 8136 } 8137 8138 var sv *types.SubDomain 8139 if *v == nil { 8140 sv = &types.SubDomain{} 8141 } else { 8142 sv = *v 8143 } 8144 8145 for key, value := range shape { 8146 switch key { 8147 case "dnsRecord": 8148 if value != nil { 8149 jtv, ok := value.(string) 8150 if !ok { 8151 return fmt.Errorf("expected DNSRecord to be of type string, got %T instead", value) 8152 } 8153 sv.DnsRecord = ptr.String(jtv) 8154 } 8155 8156 case "subDomainSetting": 8157 if err := awsRestjson1_deserializeDocumentSubDomainSetting(&sv.SubDomainSetting, value); err != nil { 8158 return err 8159 } 8160 8161 case "verified": 8162 if value != nil { 8163 jtv, ok := value.(bool) 8164 if !ok { 8165 return fmt.Errorf("expected Verified to be of type *bool, got %T instead", value) 8166 } 8167 sv.Verified = ptr.Bool(jtv) 8168 } 8169 8170 default: 8171 _, _ = key, value 8172 8173 } 8174 } 8175 *v = sv 8176 return nil 8177} 8178 8179func awsRestjson1_deserializeDocumentSubDomains(v *[]types.SubDomain, value interface{}) error { 8180 if v == nil { 8181 return fmt.Errorf("unexpected nil of type %T", v) 8182 } 8183 if value == nil { 8184 return nil 8185 } 8186 8187 shape, ok := value.([]interface{}) 8188 if !ok { 8189 return fmt.Errorf("unexpected JSON type %v", value) 8190 } 8191 8192 var cv []types.SubDomain 8193 if *v == nil { 8194 cv = []types.SubDomain{} 8195 } else { 8196 cv = *v 8197 } 8198 8199 for _, value := range shape { 8200 var col types.SubDomain 8201 destAddr := &col 8202 if err := awsRestjson1_deserializeDocumentSubDomain(&destAddr, value); err != nil { 8203 return err 8204 } 8205 col = *destAddr 8206 cv = append(cv, col) 8207 8208 } 8209 *v = cv 8210 return nil 8211} 8212 8213func awsRestjson1_deserializeDocumentSubDomainSetting(v **types.SubDomainSetting, value interface{}) error { 8214 if v == nil { 8215 return fmt.Errorf("unexpected nil of type %T", v) 8216 } 8217 if value == nil { 8218 return nil 8219 } 8220 8221 shape, ok := value.(map[string]interface{}) 8222 if !ok { 8223 return fmt.Errorf("unexpected JSON type %v", value) 8224 } 8225 8226 var sv *types.SubDomainSetting 8227 if *v == nil { 8228 sv = &types.SubDomainSetting{} 8229 } else { 8230 sv = *v 8231 } 8232 8233 for key, value := range shape { 8234 switch key { 8235 case "branchName": 8236 if value != nil { 8237 jtv, ok := value.(string) 8238 if !ok { 8239 return fmt.Errorf("expected BranchName to be of type string, got %T instead", value) 8240 } 8241 sv.BranchName = ptr.String(jtv) 8242 } 8243 8244 case "prefix": 8245 if value != nil { 8246 jtv, ok := value.(string) 8247 if !ok { 8248 return fmt.Errorf("expected DomainPrefix to be of type string, got %T instead", value) 8249 } 8250 sv.Prefix = ptr.String(jtv) 8251 } 8252 8253 default: 8254 _, _ = key, value 8255 8256 } 8257 } 8258 *v = sv 8259 return nil 8260} 8261 8262func awsRestjson1_deserializeDocumentTagMap(v *map[string]string, value interface{}) error { 8263 if v == nil { 8264 return fmt.Errorf("unexpected nil of type %T", v) 8265 } 8266 if value == nil { 8267 return nil 8268 } 8269 8270 shape, ok := value.(map[string]interface{}) 8271 if !ok { 8272 return fmt.Errorf("unexpected JSON type %v", value) 8273 } 8274 8275 var mv map[string]string 8276 if *v == nil { 8277 mv = map[string]string{} 8278 } else { 8279 mv = *v 8280 } 8281 8282 for key, value := range shape { 8283 var parsedVal string 8284 if value != nil { 8285 jtv, ok := value.(string) 8286 if !ok { 8287 return fmt.Errorf("expected TagValue to be of type string, got %T instead", value) 8288 } 8289 parsedVal = jtv 8290 } 8291 mv[key] = parsedVal 8292 8293 } 8294 *v = mv 8295 return nil 8296} 8297 8298func awsRestjson1_deserializeDocumentUnauthorizedException(v **types.UnauthorizedException, value interface{}) error { 8299 if v == nil { 8300 return fmt.Errorf("unexpected nil of type %T", v) 8301 } 8302 if value == nil { 8303 return nil 8304 } 8305 8306 shape, ok := value.(map[string]interface{}) 8307 if !ok { 8308 return fmt.Errorf("unexpected JSON type %v", value) 8309 } 8310 8311 var sv *types.UnauthorizedException 8312 if *v == nil { 8313 sv = &types.UnauthorizedException{} 8314 } else { 8315 sv = *v 8316 } 8317 8318 for key, value := range shape { 8319 switch key { 8320 case "message": 8321 if value != nil { 8322 jtv, ok := value.(string) 8323 if !ok { 8324 return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) 8325 } 8326 sv.Message = ptr.String(jtv) 8327 } 8328 8329 default: 8330 _, _ = key, value 8331 8332 } 8333 } 8334 *v = sv 8335 return nil 8336} 8337 8338func awsRestjson1_deserializeDocumentWebhook(v **types.Webhook, value interface{}) error { 8339 if v == nil { 8340 return fmt.Errorf("unexpected nil of type %T", v) 8341 } 8342 if value == nil { 8343 return nil 8344 } 8345 8346 shape, ok := value.(map[string]interface{}) 8347 if !ok { 8348 return fmt.Errorf("unexpected JSON type %v", value) 8349 } 8350 8351 var sv *types.Webhook 8352 if *v == nil { 8353 sv = &types.Webhook{} 8354 } else { 8355 sv = *v 8356 } 8357 8358 for key, value := range shape { 8359 switch key { 8360 case "branchName": 8361 if value != nil { 8362 jtv, ok := value.(string) 8363 if !ok { 8364 return fmt.Errorf("expected BranchName to be of type string, got %T instead", value) 8365 } 8366 sv.BranchName = ptr.String(jtv) 8367 } 8368 8369 case "createTime": 8370 if value != nil { 8371 jtv, ok := value.(json.Number) 8372 if !ok { 8373 return fmt.Errorf("expected CreateTime to be json.Number, got %T instead", value) 8374 } 8375 f64, err := jtv.Float64() 8376 if err != nil { 8377 return err 8378 } 8379 sv.CreateTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) 8380 } 8381 8382 case "description": 8383 if value != nil { 8384 jtv, ok := value.(string) 8385 if !ok { 8386 return fmt.Errorf("expected Description to be of type string, got %T instead", value) 8387 } 8388 sv.Description = ptr.String(jtv) 8389 } 8390 8391 case "updateTime": 8392 if value != nil { 8393 jtv, ok := value.(json.Number) 8394 if !ok { 8395 return fmt.Errorf("expected UpdateTime to be json.Number, got %T instead", value) 8396 } 8397 f64, err := jtv.Float64() 8398 if err != nil { 8399 return err 8400 } 8401 sv.UpdateTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) 8402 } 8403 8404 case "webhookArn": 8405 if value != nil { 8406 jtv, ok := value.(string) 8407 if !ok { 8408 return fmt.Errorf("expected WebhookArn to be of type string, got %T instead", value) 8409 } 8410 sv.WebhookArn = ptr.String(jtv) 8411 } 8412 8413 case "webhookId": 8414 if value != nil { 8415 jtv, ok := value.(string) 8416 if !ok { 8417 return fmt.Errorf("expected WebhookId to be of type string, got %T instead", value) 8418 } 8419 sv.WebhookId = ptr.String(jtv) 8420 } 8421 8422 case "webhookUrl": 8423 if value != nil { 8424 jtv, ok := value.(string) 8425 if !ok { 8426 return fmt.Errorf("expected WebhookUrl to be of type string, got %T instead", value) 8427 } 8428 sv.WebhookUrl = ptr.String(jtv) 8429 } 8430 8431 default: 8432 _, _ = key, value 8433 8434 } 8435 } 8436 *v = sv 8437 return nil 8438} 8439 8440func awsRestjson1_deserializeDocumentWebhooks(v *[]types.Webhook, value interface{}) error { 8441 if v == nil { 8442 return fmt.Errorf("unexpected nil of type %T", v) 8443 } 8444 if value == nil { 8445 return nil 8446 } 8447 8448 shape, ok := value.([]interface{}) 8449 if !ok { 8450 return fmt.Errorf("unexpected JSON type %v", value) 8451 } 8452 8453 var cv []types.Webhook 8454 if *v == nil { 8455 cv = []types.Webhook{} 8456 } else { 8457 cv = *v 8458 } 8459 8460 for _, value := range shape { 8461 var col types.Webhook 8462 destAddr := &col 8463 if err := awsRestjson1_deserializeDocumentWebhook(&destAddr, value); err != nil { 8464 return err 8465 } 8466 col = *destAddr 8467 cv = append(cv, col) 8468 8469 } 8470 *v = cv 8471 return nil 8472} 8473