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