1// Code generated by smithy-go-codegen DO NOT EDIT. 2 3package secretsmanager 4 5import ( 6 "bytes" 7 "context" 8 "encoding/base64" 9 "encoding/json" 10 "fmt" 11 "github.com/aws/aws-sdk-go-v2/aws/protocol/restjson" 12 "github.com/aws/aws-sdk-go-v2/service/secretsmanager/types" 13 smithy "github.com/aws/smithy-go" 14 smithyio "github.com/aws/smithy-go/io" 15 "github.com/aws/smithy-go/middleware" 16 "github.com/aws/smithy-go/ptr" 17 smithytime "github.com/aws/smithy-go/time" 18 smithyhttp "github.com/aws/smithy-go/transport/http" 19 "io" 20 "io/ioutil" 21 "strings" 22) 23 24type awsAwsjson11_deserializeOpCancelRotateSecret struct { 25} 26 27func (*awsAwsjson11_deserializeOpCancelRotateSecret) ID() string { 28 return "OperationDeserializer" 29} 30 31func (m *awsAwsjson11_deserializeOpCancelRotateSecret) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 32 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 33) { 34 out, metadata, err = next.HandleDeserialize(ctx, in) 35 if err != nil { 36 return out, metadata, err 37 } 38 39 response, ok := out.RawResponse.(*smithyhttp.Response) 40 if !ok { 41 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 42 } 43 44 if response.StatusCode < 200 || response.StatusCode >= 300 { 45 return out, metadata, awsAwsjson11_deserializeOpErrorCancelRotateSecret(response, &metadata) 46 } 47 output := &CancelRotateSecretOutput{} 48 out.Result = output 49 50 var buff [1024]byte 51 ringBuffer := smithyio.NewRingBuffer(buff[:]) 52 53 body := io.TeeReader(response.Body, ringBuffer) 54 decoder := json.NewDecoder(body) 55 decoder.UseNumber() 56 var shape interface{} 57 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 58 var snapshot bytes.Buffer 59 io.Copy(&snapshot, ringBuffer) 60 err = &smithy.DeserializationError{ 61 Err: fmt.Errorf("failed to decode response body, %w", err), 62 Snapshot: snapshot.Bytes(), 63 } 64 return out, metadata, err 65 } 66 67 err = awsAwsjson11_deserializeOpDocumentCancelRotateSecretOutput(&output, shape) 68 if err != nil { 69 var snapshot bytes.Buffer 70 io.Copy(&snapshot, ringBuffer) 71 err = &smithy.DeserializationError{ 72 Err: fmt.Errorf("failed to decode response body, %w", err), 73 Snapshot: snapshot.Bytes(), 74 } 75 return out, metadata, err 76 } 77 78 return out, metadata, err 79} 80 81func awsAwsjson11_deserializeOpErrorCancelRotateSecret(response *smithyhttp.Response, metadata *middleware.Metadata) error { 82 var errorBuffer bytes.Buffer 83 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 84 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 85 } 86 errorBody := bytes.NewReader(errorBuffer.Bytes()) 87 88 errorCode := "UnknownError" 89 errorMessage := errorCode 90 91 code := response.Header.Get("X-Amzn-ErrorType") 92 if len(code) != 0 { 93 errorCode = restjson.SanitizeErrorCode(code) 94 } 95 96 var buff [1024]byte 97 ringBuffer := smithyio.NewRingBuffer(buff[:]) 98 99 body := io.TeeReader(errorBody, ringBuffer) 100 decoder := json.NewDecoder(body) 101 decoder.UseNumber() 102 code, message, err := restjson.GetErrorInfo(decoder) 103 if err != nil { 104 var snapshot bytes.Buffer 105 io.Copy(&snapshot, ringBuffer) 106 err = &smithy.DeserializationError{ 107 Err: fmt.Errorf("failed to decode response body, %w", err), 108 Snapshot: snapshot.Bytes(), 109 } 110 return err 111 } 112 113 errorBody.Seek(0, io.SeekStart) 114 if len(code) != 0 { 115 errorCode = restjson.SanitizeErrorCode(code) 116 } 117 if len(message) != 0 { 118 errorMessage = message 119 } 120 121 switch { 122 case strings.EqualFold("InternalServiceError", errorCode): 123 return awsAwsjson11_deserializeErrorInternalServiceError(response, errorBody) 124 125 case strings.EqualFold("InvalidParameterException", errorCode): 126 return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) 127 128 case strings.EqualFold("InvalidRequestException", errorCode): 129 return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody) 130 131 case strings.EqualFold("ResourceNotFoundException", errorCode): 132 return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) 133 134 default: 135 genericError := &smithy.GenericAPIError{ 136 Code: errorCode, 137 Message: errorMessage, 138 } 139 return genericError 140 141 } 142} 143 144type awsAwsjson11_deserializeOpCreateSecret struct { 145} 146 147func (*awsAwsjson11_deserializeOpCreateSecret) ID() string { 148 return "OperationDeserializer" 149} 150 151func (m *awsAwsjson11_deserializeOpCreateSecret) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 152 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 153) { 154 out, metadata, err = next.HandleDeserialize(ctx, in) 155 if err != nil { 156 return out, metadata, err 157 } 158 159 response, ok := out.RawResponse.(*smithyhttp.Response) 160 if !ok { 161 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 162 } 163 164 if response.StatusCode < 200 || response.StatusCode >= 300 { 165 return out, metadata, awsAwsjson11_deserializeOpErrorCreateSecret(response, &metadata) 166 } 167 output := &CreateSecretOutput{} 168 out.Result = output 169 170 var buff [1024]byte 171 ringBuffer := smithyio.NewRingBuffer(buff[:]) 172 173 body := io.TeeReader(response.Body, ringBuffer) 174 decoder := json.NewDecoder(body) 175 decoder.UseNumber() 176 var shape interface{} 177 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 178 var snapshot bytes.Buffer 179 io.Copy(&snapshot, ringBuffer) 180 err = &smithy.DeserializationError{ 181 Err: fmt.Errorf("failed to decode response body, %w", err), 182 Snapshot: snapshot.Bytes(), 183 } 184 return out, metadata, err 185 } 186 187 err = awsAwsjson11_deserializeOpDocumentCreateSecretOutput(&output, shape) 188 if err != nil { 189 var snapshot bytes.Buffer 190 io.Copy(&snapshot, ringBuffer) 191 err = &smithy.DeserializationError{ 192 Err: fmt.Errorf("failed to decode response body, %w", err), 193 Snapshot: snapshot.Bytes(), 194 } 195 return out, metadata, err 196 } 197 198 return out, metadata, err 199} 200 201func awsAwsjson11_deserializeOpErrorCreateSecret(response *smithyhttp.Response, metadata *middleware.Metadata) error { 202 var errorBuffer bytes.Buffer 203 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 204 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 205 } 206 errorBody := bytes.NewReader(errorBuffer.Bytes()) 207 208 errorCode := "UnknownError" 209 errorMessage := errorCode 210 211 code := response.Header.Get("X-Amzn-ErrorType") 212 if len(code) != 0 { 213 errorCode = restjson.SanitizeErrorCode(code) 214 } 215 216 var buff [1024]byte 217 ringBuffer := smithyio.NewRingBuffer(buff[:]) 218 219 body := io.TeeReader(errorBody, ringBuffer) 220 decoder := json.NewDecoder(body) 221 decoder.UseNumber() 222 code, message, err := restjson.GetErrorInfo(decoder) 223 if err != nil { 224 var snapshot bytes.Buffer 225 io.Copy(&snapshot, ringBuffer) 226 err = &smithy.DeserializationError{ 227 Err: fmt.Errorf("failed to decode response body, %w", err), 228 Snapshot: snapshot.Bytes(), 229 } 230 return err 231 } 232 233 errorBody.Seek(0, io.SeekStart) 234 if len(code) != 0 { 235 errorCode = restjson.SanitizeErrorCode(code) 236 } 237 if len(message) != 0 { 238 errorMessage = message 239 } 240 241 switch { 242 case strings.EqualFold("EncryptionFailure", errorCode): 243 return awsAwsjson11_deserializeErrorEncryptionFailure(response, errorBody) 244 245 case strings.EqualFold("InternalServiceError", errorCode): 246 return awsAwsjson11_deserializeErrorInternalServiceError(response, errorBody) 247 248 case strings.EqualFold("InvalidParameterException", errorCode): 249 return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) 250 251 case strings.EqualFold("InvalidRequestException", errorCode): 252 return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody) 253 254 case strings.EqualFold("LimitExceededException", errorCode): 255 return awsAwsjson11_deserializeErrorLimitExceededException(response, errorBody) 256 257 case strings.EqualFold("MalformedPolicyDocumentException", errorCode): 258 return awsAwsjson11_deserializeErrorMalformedPolicyDocumentException(response, errorBody) 259 260 case strings.EqualFold("PreconditionNotMetException", errorCode): 261 return awsAwsjson11_deserializeErrorPreconditionNotMetException(response, errorBody) 262 263 case strings.EqualFold("ResourceExistsException", errorCode): 264 return awsAwsjson11_deserializeErrorResourceExistsException(response, errorBody) 265 266 case strings.EqualFold("ResourceNotFoundException", errorCode): 267 return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) 268 269 default: 270 genericError := &smithy.GenericAPIError{ 271 Code: errorCode, 272 Message: errorMessage, 273 } 274 return genericError 275 276 } 277} 278 279type awsAwsjson11_deserializeOpDeleteResourcePolicy struct { 280} 281 282func (*awsAwsjson11_deserializeOpDeleteResourcePolicy) ID() string { 283 return "OperationDeserializer" 284} 285 286func (m *awsAwsjson11_deserializeOpDeleteResourcePolicy) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 287 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 288) { 289 out, metadata, err = next.HandleDeserialize(ctx, in) 290 if err != nil { 291 return out, metadata, err 292 } 293 294 response, ok := out.RawResponse.(*smithyhttp.Response) 295 if !ok { 296 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 297 } 298 299 if response.StatusCode < 200 || response.StatusCode >= 300 { 300 return out, metadata, awsAwsjson11_deserializeOpErrorDeleteResourcePolicy(response, &metadata) 301 } 302 output := &DeleteResourcePolicyOutput{} 303 out.Result = output 304 305 var buff [1024]byte 306 ringBuffer := smithyio.NewRingBuffer(buff[:]) 307 308 body := io.TeeReader(response.Body, ringBuffer) 309 decoder := json.NewDecoder(body) 310 decoder.UseNumber() 311 var shape interface{} 312 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 313 var snapshot bytes.Buffer 314 io.Copy(&snapshot, ringBuffer) 315 err = &smithy.DeserializationError{ 316 Err: fmt.Errorf("failed to decode response body, %w", err), 317 Snapshot: snapshot.Bytes(), 318 } 319 return out, metadata, err 320 } 321 322 err = awsAwsjson11_deserializeOpDocumentDeleteResourcePolicyOutput(&output, shape) 323 if err != nil { 324 var snapshot bytes.Buffer 325 io.Copy(&snapshot, ringBuffer) 326 err = &smithy.DeserializationError{ 327 Err: fmt.Errorf("failed to decode response body, %w", err), 328 Snapshot: snapshot.Bytes(), 329 } 330 return out, metadata, err 331 } 332 333 return out, metadata, err 334} 335 336func awsAwsjson11_deserializeOpErrorDeleteResourcePolicy(response *smithyhttp.Response, metadata *middleware.Metadata) error { 337 var errorBuffer bytes.Buffer 338 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 339 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 340 } 341 errorBody := bytes.NewReader(errorBuffer.Bytes()) 342 343 errorCode := "UnknownError" 344 errorMessage := errorCode 345 346 code := response.Header.Get("X-Amzn-ErrorType") 347 if len(code) != 0 { 348 errorCode = restjson.SanitizeErrorCode(code) 349 } 350 351 var buff [1024]byte 352 ringBuffer := smithyio.NewRingBuffer(buff[:]) 353 354 body := io.TeeReader(errorBody, ringBuffer) 355 decoder := json.NewDecoder(body) 356 decoder.UseNumber() 357 code, message, err := restjson.GetErrorInfo(decoder) 358 if err != nil { 359 var snapshot bytes.Buffer 360 io.Copy(&snapshot, ringBuffer) 361 err = &smithy.DeserializationError{ 362 Err: fmt.Errorf("failed to decode response body, %w", err), 363 Snapshot: snapshot.Bytes(), 364 } 365 return err 366 } 367 368 errorBody.Seek(0, io.SeekStart) 369 if len(code) != 0 { 370 errorCode = restjson.SanitizeErrorCode(code) 371 } 372 if len(message) != 0 { 373 errorMessage = message 374 } 375 376 switch { 377 case strings.EqualFold("InternalServiceError", errorCode): 378 return awsAwsjson11_deserializeErrorInternalServiceError(response, errorBody) 379 380 case strings.EqualFold("InvalidParameterException", errorCode): 381 return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) 382 383 case strings.EqualFold("InvalidRequestException", errorCode): 384 return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody) 385 386 case strings.EqualFold("ResourceNotFoundException", errorCode): 387 return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) 388 389 default: 390 genericError := &smithy.GenericAPIError{ 391 Code: errorCode, 392 Message: errorMessage, 393 } 394 return genericError 395 396 } 397} 398 399type awsAwsjson11_deserializeOpDeleteSecret struct { 400} 401 402func (*awsAwsjson11_deserializeOpDeleteSecret) ID() string { 403 return "OperationDeserializer" 404} 405 406func (m *awsAwsjson11_deserializeOpDeleteSecret) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 407 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 408) { 409 out, metadata, err = next.HandleDeserialize(ctx, in) 410 if err != nil { 411 return out, metadata, err 412 } 413 414 response, ok := out.RawResponse.(*smithyhttp.Response) 415 if !ok { 416 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 417 } 418 419 if response.StatusCode < 200 || response.StatusCode >= 300 { 420 return out, metadata, awsAwsjson11_deserializeOpErrorDeleteSecret(response, &metadata) 421 } 422 output := &DeleteSecretOutput{} 423 out.Result = output 424 425 var buff [1024]byte 426 ringBuffer := smithyio.NewRingBuffer(buff[:]) 427 428 body := io.TeeReader(response.Body, ringBuffer) 429 decoder := json.NewDecoder(body) 430 decoder.UseNumber() 431 var shape interface{} 432 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 433 var snapshot bytes.Buffer 434 io.Copy(&snapshot, ringBuffer) 435 err = &smithy.DeserializationError{ 436 Err: fmt.Errorf("failed to decode response body, %w", err), 437 Snapshot: snapshot.Bytes(), 438 } 439 return out, metadata, err 440 } 441 442 err = awsAwsjson11_deserializeOpDocumentDeleteSecretOutput(&output, shape) 443 if err != nil { 444 var snapshot bytes.Buffer 445 io.Copy(&snapshot, ringBuffer) 446 err = &smithy.DeserializationError{ 447 Err: fmt.Errorf("failed to decode response body, %w", err), 448 Snapshot: snapshot.Bytes(), 449 } 450 return out, metadata, err 451 } 452 453 return out, metadata, err 454} 455 456func awsAwsjson11_deserializeOpErrorDeleteSecret(response *smithyhttp.Response, metadata *middleware.Metadata) error { 457 var errorBuffer bytes.Buffer 458 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 459 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 460 } 461 errorBody := bytes.NewReader(errorBuffer.Bytes()) 462 463 errorCode := "UnknownError" 464 errorMessage := errorCode 465 466 code := response.Header.Get("X-Amzn-ErrorType") 467 if len(code) != 0 { 468 errorCode = restjson.SanitizeErrorCode(code) 469 } 470 471 var buff [1024]byte 472 ringBuffer := smithyio.NewRingBuffer(buff[:]) 473 474 body := io.TeeReader(errorBody, ringBuffer) 475 decoder := json.NewDecoder(body) 476 decoder.UseNumber() 477 code, message, err := restjson.GetErrorInfo(decoder) 478 if err != nil { 479 var snapshot bytes.Buffer 480 io.Copy(&snapshot, ringBuffer) 481 err = &smithy.DeserializationError{ 482 Err: fmt.Errorf("failed to decode response body, %w", err), 483 Snapshot: snapshot.Bytes(), 484 } 485 return err 486 } 487 488 errorBody.Seek(0, io.SeekStart) 489 if len(code) != 0 { 490 errorCode = restjson.SanitizeErrorCode(code) 491 } 492 if len(message) != 0 { 493 errorMessage = message 494 } 495 496 switch { 497 case strings.EqualFold("InternalServiceError", errorCode): 498 return awsAwsjson11_deserializeErrorInternalServiceError(response, errorBody) 499 500 case strings.EqualFold("InvalidParameterException", errorCode): 501 return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) 502 503 case strings.EqualFold("InvalidRequestException", errorCode): 504 return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody) 505 506 case strings.EqualFold("ResourceNotFoundException", errorCode): 507 return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) 508 509 default: 510 genericError := &smithy.GenericAPIError{ 511 Code: errorCode, 512 Message: errorMessage, 513 } 514 return genericError 515 516 } 517} 518 519type awsAwsjson11_deserializeOpDescribeSecret struct { 520} 521 522func (*awsAwsjson11_deserializeOpDescribeSecret) ID() string { 523 return "OperationDeserializer" 524} 525 526func (m *awsAwsjson11_deserializeOpDescribeSecret) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 527 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 528) { 529 out, metadata, err = next.HandleDeserialize(ctx, in) 530 if err != nil { 531 return out, metadata, err 532 } 533 534 response, ok := out.RawResponse.(*smithyhttp.Response) 535 if !ok { 536 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 537 } 538 539 if response.StatusCode < 200 || response.StatusCode >= 300 { 540 return out, metadata, awsAwsjson11_deserializeOpErrorDescribeSecret(response, &metadata) 541 } 542 output := &DescribeSecretOutput{} 543 out.Result = output 544 545 var buff [1024]byte 546 ringBuffer := smithyio.NewRingBuffer(buff[:]) 547 548 body := io.TeeReader(response.Body, ringBuffer) 549 decoder := json.NewDecoder(body) 550 decoder.UseNumber() 551 var shape interface{} 552 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 553 var snapshot bytes.Buffer 554 io.Copy(&snapshot, ringBuffer) 555 err = &smithy.DeserializationError{ 556 Err: fmt.Errorf("failed to decode response body, %w", err), 557 Snapshot: snapshot.Bytes(), 558 } 559 return out, metadata, err 560 } 561 562 err = awsAwsjson11_deserializeOpDocumentDescribeSecretOutput(&output, shape) 563 if err != nil { 564 var snapshot bytes.Buffer 565 io.Copy(&snapshot, ringBuffer) 566 err = &smithy.DeserializationError{ 567 Err: fmt.Errorf("failed to decode response body, %w", err), 568 Snapshot: snapshot.Bytes(), 569 } 570 return out, metadata, err 571 } 572 573 return out, metadata, err 574} 575 576func awsAwsjson11_deserializeOpErrorDescribeSecret(response *smithyhttp.Response, metadata *middleware.Metadata) error { 577 var errorBuffer bytes.Buffer 578 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 579 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 580 } 581 errorBody := bytes.NewReader(errorBuffer.Bytes()) 582 583 errorCode := "UnknownError" 584 errorMessage := errorCode 585 586 code := response.Header.Get("X-Amzn-ErrorType") 587 if len(code) != 0 { 588 errorCode = restjson.SanitizeErrorCode(code) 589 } 590 591 var buff [1024]byte 592 ringBuffer := smithyio.NewRingBuffer(buff[:]) 593 594 body := io.TeeReader(errorBody, ringBuffer) 595 decoder := json.NewDecoder(body) 596 decoder.UseNumber() 597 code, message, err := restjson.GetErrorInfo(decoder) 598 if err != nil { 599 var snapshot bytes.Buffer 600 io.Copy(&snapshot, ringBuffer) 601 err = &smithy.DeserializationError{ 602 Err: fmt.Errorf("failed to decode response body, %w", err), 603 Snapshot: snapshot.Bytes(), 604 } 605 return err 606 } 607 608 errorBody.Seek(0, io.SeekStart) 609 if len(code) != 0 { 610 errorCode = restjson.SanitizeErrorCode(code) 611 } 612 if len(message) != 0 { 613 errorMessage = message 614 } 615 616 switch { 617 case strings.EqualFold("InternalServiceError", errorCode): 618 return awsAwsjson11_deserializeErrorInternalServiceError(response, errorBody) 619 620 case strings.EqualFold("InvalidParameterException", errorCode): 621 return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) 622 623 case strings.EqualFold("ResourceNotFoundException", errorCode): 624 return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) 625 626 default: 627 genericError := &smithy.GenericAPIError{ 628 Code: errorCode, 629 Message: errorMessage, 630 } 631 return genericError 632 633 } 634} 635 636type awsAwsjson11_deserializeOpGetRandomPassword struct { 637} 638 639func (*awsAwsjson11_deserializeOpGetRandomPassword) ID() string { 640 return "OperationDeserializer" 641} 642 643func (m *awsAwsjson11_deserializeOpGetRandomPassword) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 644 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 645) { 646 out, metadata, err = next.HandleDeserialize(ctx, in) 647 if err != nil { 648 return out, metadata, err 649 } 650 651 response, ok := out.RawResponse.(*smithyhttp.Response) 652 if !ok { 653 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 654 } 655 656 if response.StatusCode < 200 || response.StatusCode >= 300 { 657 return out, metadata, awsAwsjson11_deserializeOpErrorGetRandomPassword(response, &metadata) 658 } 659 output := &GetRandomPasswordOutput{} 660 out.Result = output 661 662 var buff [1024]byte 663 ringBuffer := smithyio.NewRingBuffer(buff[:]) 664 665 body := io.TeeReader(response.Body, ringBuffer) 666 decoder := json.NewDecoder(body) 667 decoder.UseNumber() 668 var shape interface{} 669 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 670 var snapshot bytes.Buffer 671 io.Copy(&snapshot, ringBuffer) 672 err = &smithy.DeserializationError{ 673 Err: fmt.Errorf("failed to decode response body, %w", err), 674 Snapshot: snapshot.Bytes(), 675 } 676 return out, metadata, err 677 } 678 679 err = awsAwsjson11_deserializeOpDocumentGetRandomPasswordOutput(&output, shape) 680 if err != nil { 681 var snapshot bytes.Buffer 682 io.Copy(&snapshot, ringBuffer) 683 err = &smithy.DeserializationError{ 684 Err: fmt.Errorf("failed to decode response body, %w", err), 685 Snapshot: snapshot.Bytes(), 686 } 687 return out, metadata, err 688 } 689 690 return out, metadata, err 691} 692 693func awsAwsjson11_deserializeOpErrorGetRandomPassword(response *smithyhttp.Response, metadata *middleware.Metadata) error { 694 var errorBuffer bytes.Buffer 695 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 696 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 697 } 698 errorBody := bytes.NewReader(errorBuffer.Bytes()) 699 700 errorCode := "UnknownError" 701 errorMessage := errorCode 702 703 code := response.Header.Get("X-Amzn-ErrorType") 704 if len(code) != 0 { 705 errorCode = restjson.SanitizeErrorCode(code) 706 } 707 708 var buff [1024]byte 709 ringBuffer := smithyio.NewRingBuffer(buff[:]) 710 711 body := io.TeeReader(errorBody, ringBuffer) 712 decoder := json.NewDecoder(body) 713 decoder.UseNumber() 714 code, message, err := restjson.GetErrorInfo(decoder) 715 if err != nil { 716 var snapshot bytes.Buffer 717 io.Copy(&snapshot, ringBuffer) 718 err = &smithy.DeserializationError{ 719 Err: fmt.Errorf("failed to decode response body, %w", err), 720 Snapshot: snapshot.Bytes(), 721 } 722 return err 723 } 724 725 errorBody.Seek(0, io.SeekStart) 726 if len(code) != 0 { 727 errorCode = restjson.SanitizeErrorCode(code) 728 } 729 if len(message) != 0 { 730 errorMessage = message 731 } 732 733 switch { 734 case strings.EqualFold("InternalServiceError", errorCode): 735 return awsAwsjson11_deserializeErrorInternalServiceError(response, errorBody) 736 737 case strings.EqualFold("InvalidParameterException", errorCode): 738 return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) 739 740 case strings.EqualFold("InvalidRequestException", errorCode): 741 return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody) 742 743 default: 744 genericError := &smithy.GenericAPIError{ 745 Code: errorCode, 746 Message: errorMessage, 747 } 748 return genericError 749 750 } 751} 752 753type awsAwsjson11_deserializeOpGetResourcePolicy struct { 754} 755 756func (*awsAwsjson11_deserializeOpGetResourcePolicy) ID() string { 757 return "OperationDeserializer" 758} 759 760func (m *awsAwsjson11_deserializeOpGetResourcePolicy) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 761 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 762) { 763 out, metadata, err = next.HandleDeserialize(ctx, in) 764 if err != nil { 765 return out, metadata, err 766 } 767 768 response, ok := out.RawResponse.(*smithyhttp.Response) 769 if !ok { 770 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 771 } 772 773 if response.StatusCode < 200 || response.StatusCode >= 300 { 774 return out, metadata, awsAwsjson11_deserializeOpErrorGetResourcePolicy(response, &metadata) 775 } 776 output := &GetResourcePolicyOutput{} 777 out.Result = output 778 779 var buff [1024]byte 780 ringBuffer := smithyio.NewRingBuffer(buff[:]) 781 782 body := io.TeeReader(response.Body, ringBuffer) 783 decoder := json.NewDecoder(body) 784 decoder.UseNumber() 785 var shape interface{} 786 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 787 var snapshot bytes.Buffer 788 io.Copy(&snapshot, ringBuffer) 789 err = &smithy.DeserializationError{ 790 Err: fmt.Errorf("failed to decode response body, %w", err), 791 Snapshot: snapshot.Bytes(), 792 } 793 return out, metadata, err 794 } 795 796 err = awsAwsjson11_deserializeOpDocumentGetResourcePolicyOutput(&output, shape) 797 if err != nil { 798 var snapshot bytes.Buffer 799 io.Copy(&snapshot, ringBuffer) 800 err = &smithy.DeserializationError{ 801 Err: fmt.Errorf("failed to decode response body, %w", err), 802 Snapshot: snapshot.Bytes(), 803 } 804 return out, metadata, err 805 } 806 807 return out, metadata, err 808} 809 810func awsAwsjson11_deserializeOpErrorGetResourcePolicy(response *smithyhttp.Response, metadata *middleware.Metadata) error { 811 var errorBuffer bytes.Buffer 812 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 813 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 814 } 815 errorBody := bytes.NewReader(errorBuffer.Bytes()) 816 817 errorCode := "UnknownError" 818 errorMessage := errorCode 819 820 code := response.Header.Get("X-Amzn-ErrorType") 821 if len(code) != 0 { 822 errorCode = restjson.SanitizeErrorCode(code) 823 } 824 825 var buff [1024]byte 826 ringBuffer := smithyio.NewRingBuffer(buff[:]) 827 828 body := io.TeeReader(errorBody, ringBuffer) 829 decoder := json.NewDecoder(body) 830 decoder.UseNumber() 831 code, message, err := restjson.GetErrorInfo(decoder) 832 if err != nil { 833 var snapshot bytes.Buffer 834 io.Copy(&snapshot, ringBuffer) 835 err = &smithy.DeserializationError{ 836 Err: fmt.Errorf("failed to decode response body, %w", err), 837 Snapshot: snapshot.Bytes(), 838 } 839 return err 840 } 841 842 errorBody.Seek(0, io.SeekStart) 843 if len(code) != 0 { 844 errorCode = restjson.SanitizeErrorCode(code) 845 } 846 if len(message) != 0 { 847 errorMessage = message 848 } 849 850 switch { 851 case strings.EqualFold("InternalServiceError", errorCode): 852 return awsAwsjson11_deserializeErrorInternalServiceError(response, errorBody) 853 854 case strings.EqualFold("InvalidParameterException", errorCode): 855 return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) 856 857 case strings.EqualFold("InvalidRequestException", errorCode): 858 return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody) 859 860 case strings.EqualFold("ResourceNotFoundException", errorCode): 861 return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) 862 863 default: 864 genericError := &smithy.GenericAPIError{ 865 Code: errorCode, 866 Message: errorMessage, 867 } 868 return genericError 869 870 } 871} 872 873type awsAwsjson11_deserializeOpGetSecretValue struct { 874} 875 876func (*awsAwsjson11_deserializeOpGetSecretValue) ID() string { 877 return "OperationDeserializer" 878} 879 880func (m *awsAwsjson11_deserializeOpGetSecretValue) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 881 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 882) { 883 out, metadata, err = next.HandleDeserialize(ctx, in) 884 if err != nil { 885 return out, metadata, err 886 } 887 888 response, ok := out.RawResponse.(*smithyhttp.Response) 889 if !ok { 890 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 891 } 892 893 if response.StatusCode < 200 || response.StatusCode >= 300 { 894 return out, metadata, awsAwsjson11_deserializeOpErrorGetSecretValue(response, &metadata) 895 } 896 output := &GetSecretValueOutput{} 897 out.Result = output 898 899 var buff [1024]byte 900 ringBuffer := smithyio.NewRingBuffer(buff[:]) 901 902 body := io.TeeReader(response.Body, ringBuffer) 903 decoder := json.NewDecoder(body) 904 decoder.UseNumber() 905 var shape interface{} 906 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 907 var snapshot bytes.Buffer 908 io.Copy(&snapshot, ringBuffer) 909 err = &smithy.DeserializationError{ 910 Err: fmt.Errorf("failed to decode response body, %w", err), 911 Snapshot: snapshot.Bytes(), 912 } 913 return out, metadata, err 914 } 915 916 err = awsAwsjson11_deserializeOpDocumentGetSecretValueOutput(&output, shape) 917 if err != nil { 918 var snapshot bytes.Buffer 919 io.Copy(&snapshot, ringBuffer) 920 err = &smithy.DeserializationError{ 921 Err: fmt.Errorf("failed to decode response body, %w", err), 922 Snapshot: snapshot.Bytes(), 923 } 924 return out, metadata, err 925 } 926 927 return out, metadata, err 928} 929 930func awsAwsjson11_deserializeOpErrorGetSecretValue(response *smithyhttp.Response, metadata *middleware.Metadata) error { 931 var errorBuffer bytes.Buffer 932 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 933 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 934 } 935 errorBody := bytes.NewReader(errorBuffer.Bytes()) 936 937 errorCode := "UnknownError" 938 errorMessage := errorCode 939 940 code := response.Header.Get("X-Amzn-ErrorType") 941 if len(code) != 0 { 942 errorCode = restjson.SanitizeErrorCode(code) 943 } 944 945 var buff [1024]byte 946 ringBuffer := smithyio.NewRingBuffer(buff[:]) 947 948 body := io.TeeReader(errorBody, ringBuffer) 949 decoder := json.NewDecoder(body) 950 decoder.UseNumber() 951 code, message, err := restjson.GetErrorInfo(decoder) 952 if err != nil { 953 var snapshot bytes.Buffer 954 io.Copy(&snapshot, ringBuffer) 955 err = &smithy.DeserializationError{ 956 Err: fmt.Errorf("failed to decode response body, %w", err), 957 Snapshot: snapshot.Bytes(), 958 } 959 return err 960 } 961 962 errorBody.Seek(0, io.SeekStart) 963 if len(code) != 0 { 964 errorCode = restjson.SanitizeErrorCode(code) 965 } 966 if len(message) != 0 { 967 errorMessage = message 968 } 969 970 switch { 971 case strings.EqualFold("DecryptionFailure", errorCode): 972 return awsAwsjson11_deserializeErrorDecryptionFailure(response, errorBody) 973 974 case strings.EqualFold("InternalServiceError", errorCode): 975 return awsAwsjson11_deserializeErrorInternalServiceError(response, errorBody) 976 977 case strings.EqualFold("InvalidParameterException", errorCode): 978 return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) 979 980 case strings.EqualFold("InvalidRequestException", errorCode): 981 return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody) 982 983 case strings.EqualFold("ResourceNotFoundException", errorCode): 984 return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) 985 986 default: 987 genericError := &smithy.GenericAPIError{ 988 Code: errorCode, 989 Message: errorMessage, 990 } 991 return genericError 992 993 } 994} 995 996type awsAwsjson11_deserializeOpListSecrets struct { 997} 998 999func (*awsAwsjson11_deserializeOpListSecrets) ID() string { 1000 return "OperationDeserializer" 1001} 1002 1003func (m *awsAwsjson11_deserializeOpListSecrets) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 1004 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 1005) { 1006 out, metadata, err = next.HandleDeserialize(ctx, in) 1007 if err != nil { 1008 return out, metadata, err 1009 } 1010 1011 response, ok := out.RawResponse.(*smithyhttp.Response) 1012 if !ok { 1013 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 1014 } 1015 1016 if response.StatusCode < 200 || response.StatusCode >= 300 { 1017 return out, metadata, awsAwsjson11_deserializeOpErrorListSecrets(response, &metadata) 1018 } 1019 output := &ListSecretsOutput{} 1020 out.Result = output 1021 1022 var buff [1024]byte 1023 ringBuffer := smithyio.NewRingBuffer(buff[:]) 1024 1025 body := io.TeeReader(response.Body, ringBuffer) 1026 decoder := json.NewDecoder(body) 1027 decoder.UseNumber() 1028 var shape interface{} 1029 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 1030 var snapshot bytes.Buffer 1031 io.Copy(&snapshot, ringBuffer) 1032 err = &smithy.DeserializationError{ 1033 Err: fmt.Errorf("failed to decode response body, %w", err), 1034 Snapshot: snapshot.Bytes(), 1035 } 1036 return out, metadata, err 1037 } 1038 1039 err = awsAwsjson11_deserializeOpDocumentListSecretsOutput(&output, shape) 1040 if err != nil { 1041 var snapshot bytes.Buffer 1042 io.Copy(&snapshot, ringBuffer) 1043 err = &smithy.DeserializationError{ 1044 Err: fmt.Errorf("failed to decode response body, %w", err), 1045 Snapshot: snapshot.Bytes(), 1046 } 1047 return out, metadata, err 1048 } 1049 1050 return out, metadata, err 1051} 1052 1053func awsAwsjson11_deserializeOpErrorListSecrets(response *smithyhttp.Response, metadata *middleware.Metadata) error { 1054 var errorBuffer bytes.Buffer 1055 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 1056 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 1057 } 1058 errorBody := bytes.NewReader(errorBuffer.Bytes()) 1059 1060 errorCode := "UnknownError" 1061 errorMessage := errorCode 1062 1063 code := response.Header.Get("X-Amzn-ErrorType") 1064 if len(code) != 0 { 1065 errorCode = restjson.SanitizeErrorCode(code) 1066 } 1067 1068 var buff [1024]byte 1069 ringBuffer := smithyio.NewRingBuffer(buff[:]) 1070 1071 body := io.TeeReader(errorBody, ringBuffer) 1072 decoder := json.NewDecoder(body) 1073 decoder.UseNumber() 1074 code, message, err := restjson.GetErrorInfo(decoder) 1075 if err != nil { 1076 var snapshot bytes.Buffer 1077 io.Copy(&snapshot, ringBuffer) 1078 err = &smithy.DeserializationError{ 1079 Err: fmt.Errorf("failed to decode response body, %w", err), 1080 Snapshot: snapshot.Bytes(), 1081 } 1082 return err 1083 } 1084 1085 errorBody.Seek(0, io.SeekStart) 1086 if len(code) != 0 { 1087 errorCode = restjson.SanitizeErrorCode(code) 1088 } 1089 if len(message) != 0 { 1090 errorMessage = message 1091 } 1092 1093 switch { 1094 case strings.EqualFold("InternalServiceError", errorCode): 1095 return awsAwsjson11_deserializeErrorInternalServiceError(response, errorBody) 1096 1097 case strings.EqualFold("InvalidNextTokenException", errorCode): 1098 return awsAwsjson11_deserializeErrorInvalidNextTokenException(response, errorBody) 1099 1100 case strings.EqualFold("InvalidParameterException", errorCode): 1101 return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) 1102 1103 default: 1104 genericError := &smithy.GenericAPIError{ 1105 Code: errorCode, 1106 Message: errorMessage, 1107 } 1108 return genericError 1109 1110 } 1111} 1112 1113type awsAwsjson11_deserializeOpListSecretVersionIds struct { 1114} 1115 1116func (*awsAwsjson11_deserializeOpListSecretVersionIds) ID() string { 1117 return "OperationDeserializer" 1118} 1119 1120func (m *awsAwsjson11_deserializeOpListSecretVersionIds) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 1121 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 1122) { 1123 out, metadata, err = next.HandleDeserialize(ctx, in) 1124 if err != nil { 1125 return out, metadata, err 1126 } 1127 1128 response, ok := out.RawResponse.(*smithyhttp.Response) 1129 if !ok { 1130 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 1131 } 1132 1133 if response.StatusCode < 200 || response.StatusCode >= 300 { 1134 return out, metadata, awsAwsjson11_deserializeOpErrorListSecretVersionIds(response, &metadata) 1135 } 1136 output := &ListSecretVersionIdsOutput{} 1137 out.Result = output 1138 1139 var buff [1024]byte 1140 ringBuffer := smithyio.NewRingBuffer(buff[:]) 1141 1142 body := io.TeeReader(response.Body, ringBuffer) 1143 decoder := json.NewDecoder(body) 1144 decoder.UseNumber() 1145 var shape interface{} 1146 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 1147 var snapshot bytes.Buffer 1148 io.Copy(&snapshot, ringBuffer) 1149 err = &smithy.DeserializationError{ 1150 Err: fmt.Errorf("failed to decode response body, %w", err), 1151 Snapshot: snapshot.Bytes(), 1152 } 1153 return out, metadata, err 1154 } 1155 1156 err = awsAwsjson11_deserializeOpDocumentListSecretVersionIdsOutput(&output, shape) 1157 if err != nil { 1158 var snapshot bytes.Buffer 1159 io.Copy(&snapshot, ringBuffer) 1160 err = &smithy.DeserializationError{ 1161 Err: fmt.Errorf("failed to decode response body, %w", err), 1162 Snapshot: snapshot.Bytes(), 1163 } 1164 return out, metadata, err 1165 } 1166 1167 return out, metadata, err 1168} 1169 1170func awsAwsjson11_deserializeOpErrorListSecretVersionIds(response *smithyhttp.Response, metadata *middleware.Metadata) error { 1171 var errorBuffer bytes.Buffer 1172 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 1173 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 1174 } 1175 errorBody := bytes.NewReader(errorBuffer.Bytes()) 1176 1177 errorCode := "UnknownError" 1178 errorMessage := errorCode 1179 1180 code := response.Header.Get("X-Amzn-ErrorType") 1181 if len(code) != 0 { 1182 errorCode = restjson.SanitizeErrorCode(code) 1183 } 1184 1185 var buff [1024]byte 1186 ringBuffer := smithyio.NewRingBuffer(buff[:]) 1187 1188 body := io.TeeReader(errorBody, ringBuffer) 1189 decoder := json.NewDecoder(body) 1190 decoder.UseNumber() 1191 code, message, err := restjson.GetErrorInfo(decoder) 1192 if err != nil { 1193 var snapshot bytes.Buffer 1194 io.Copy(&snapshot, ringBuffer) 1195 err = &smithy.DeserializationError{ 1196 Err: fmt.Errorf("failed to decode response body, %w", err), 1197 Snapshot: snapshot.Bytes(), 1198 } 1199 return err 1200 } 1201 1202 errorBody.Seek(0, io.SeekStart) 1203 if len(code) != 0 { 1204 errorCode = restjson.SanitizeErrorCode(code) 1205 } 1206 if len(message) != 0 { 1207 errorMessage = message 1208 } 1209 1210 switch { 1211 case strings.EqualFold("InternalServiceError", errorCode): 1212 return awsAwsjson11_deserializeErrorInternalServiceError(response, errorBody) 1213 1214 case strings.EqualFold("InvalidNextTokenException", errorCode): 1215 return awsAwsjson11_deserializeErrorInvalidNextTokenException(response, errorBody) 1216 1217 case strings.EqualFold("InvalidParameterException", errorCode): 1218 return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) 1219 1220 case strings.EqualFold("ResourceNotFoundException", errorCode): 1221 return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) 1222 1223 default: 1224 genericError := &smithy.GenericAPIError{ 1225 Code: errorCode, 1226 Message: errorMessage, 1227 } 1228 return genericError 1229 1230 } 1231} 1232 1233type awsAwsjson11_deserializeOpPutResourcePolicy struct { 1234} 1235 1236func (*awsAwsjson11_deserializeOpPutResourcePolicy) ID() string { 1237 return "OperationDeserializer" 1238} 1239 1240func (m *awsAwsjson11_deserializeOpPutResourcePolicy) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 1241 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 1242) { 1243 out, metadata, err = next.HandleDeserialize(ctx, in) 1244 if err != nil { 1245 return out, metadata, err 1246 } 1247 1248 response, ok := out.RawResponse.(*smithyhttp.Response) 1249 if !ok { 1250 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 1251 } 1252 1253 if response.StatusCode < 200 || response.StatusCode >= 300 { 1254 return out, metadata, awsAwsjson11_deserializeOpErrorPutResourcePolicy(response, &metadata) 1255 } 1256 output := &PutResourcePolicyOutput{} 1257 out.Result = output 1258 1259 var buff [1024]byte 1260 ringBuffer := smithyio.NewRingBuffer(buff[:]) 1261 1262 body := io.TeeReader(response.Body, ringBuffer) 1263 decoder := json.NewDecoder(body) 1264 decoder.UseNumber() 1265 var shape interface{} 1266 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 1267 var snapshot bytes.Buffer 1268 io.Copy(&snapshot, ringBuffer) 1269 err = &smithy.DeserializationError{ 1270 Err: fmt.Errorf("failed to decode response body, %w", err), 1271 Snapshot: snapshot.Bytes(), 1272 } 1273 return out, metadata, err 1274 } 1275 1276 err = awsAwsjson11_deserializeOpDocumentPutResourcePolicyOutput(&output, shape) 1277 if err != nil { 1278 var snapshot bytes.Buffer 1279 io.Copy(&snapshot, ringBuffer) 1280 err = &smithy.DeserializationError{ 1281 Err: fmt.Errorf("failed to decode response body, %w", err), 1282 Snapshot: snapshot.Bytes(), 1283 } 1284 return out, metadata, err 1285 } 1286 1287 return out, metadata, err 1288} 1289 1290func awsAwsjson11_deserializeOpErrorPutResourcePolicy(response *smithyhttp.Response, metadata *middleware.Metadata) error { 1291 var errorBuffer bytes.Buffer 1292 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 1293 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 1294 } 1295 errorBody := bytes.NewReader(errorBuffer.Bytes()) 1296 1297 errorCode := "UnknownError" 1298 errorMessage := errorCode 1299 1300 code := response.Header.Get("X-Amzn-ErrorType") 1301 if len(code) != 0 { 1302 errorCode = restjson.SanitizeErrorCode(code) 1303 } 1304 1305 var buff [1024]byte 1306 ringBuffer := smithyio.NewRingBuffer(buff[:]) 1307 1308 body := io.TeeReader(errorBody, ringBuffer) 1309 decoder := json.NewDecoder(body) 1310 decoder.UseNumber() 1311 code, message, err := restjson.GetErrorInfo(decoder) 1312 if err != nil { 1313 var snapshot bytes.Buffer 1314 io.Copy(&snapshot, ringBuffer) 1315 err = &smithy.DeserializationError{ 1316 Err: fmt.Errorf("failed to decode response body, %w", err), 1317 Snapshot: snapshot.Bytes(), 1318 } 1319 return err 1320 } 1321 1322 errorBody.Seek(0, io.SeekStart) 1323 if len(code) != 0 { 1324 errorCode = restjson.SanitizeErrorCode(code) 1325 } 1326 if len(message) != 0 { 1327 errorMessage = message 1328 } 1329 1330 switch { 1331 case strings.EqualFold("InternalServiceError", errorCode): 1332 return awsAwsjson11_deserializeErrorInternalServiceError(response, errorBody) 1333 1334 case strings.EqualFold("InvalidParameterException", errorCode): 1335 return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) 1336 1337 case strings.EqualFold("InvalidRequestException", errorCode): 1338 return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody) 1339 1340 case strings.EqualFold("MalformedPolicyDocumentException", errorCode): 1341 return awsAwsjson11_deserializeErrorMalformedPolicyDocumentException(response, errorBody) 1342 1343 case strings.EqualFold("PublicPolicyException", errorCode): 1344 return awsAwsjson11_deserializeErrorPublicPolicyException(response, errorBody) 1345 1346 case strings.EqualFold("ResourceNotFoundException", errorCode): 1347 return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) 1348 1349 default: 1350 genericError := &smithy.GenericAPIError{ 1351 Code: errorCode, 1352 Message: errorMessage, 1353 } 1354 return genericError 1355 1356 } 1357} 1358 1359type awsAwsjson11_deserializeOpPutSecretValue struct { 1360} 1361 1362func (*awsAwsjson11_deserializeOpPutSecretValue) ID() string { 1363 return "OperationDeserializer" 1364} 1365 1366func (m *awsAwsjson11_deserializeOpPutSecretValue) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 1367 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 1368) { 1369 out, metadata, err = next.HandleDeserialize(ctx, in) 1370 if err != nil { 1371 return out, metadata, err 1372 } 1373 1374 response, ok := out.RawResponse.(*smithyhttp.Response) 1375 if !ok { 1376 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 1377 } 1378 1379 if response.StatusCode < 200 || response.StatusCode >= 300 { 1380 return out, metadata, awsAwsjson11_deserializeOpErrorPutSecretValue(response, &metadata) 1381 } 1382 output := &PutSecretValueOutput{} 1383 out.Result = output 1384 1385 var buff [1024]byte 1386 ringBuffer := smithyio.NewRingBuffer(buff[:]) 1387 1388 body := io.TeeReader(response.Body, ringBuffer) 1389 decoder := json.NewDecoder(body) 1390 decoder.UseNumber() 1391 var shape interface{} 1392 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 1393 var snapshot bytes.Buffer 1394 io.Copy(&snapshot, ringBuffer) 1395 err = &smithy.DeserializationError{ 1396 Err: fmt.Errorf("failed to decode response body, %w", err), 1397 Snapshot: snapshot.Bytes(), 1398 } 1399 return out, metadata, err 1400 } 1401 1402 err = awsAwsjson11_deserializeOpDocumentPutSecretValueOutput(&output, shape) 1403 if err != nil { 1404 var snapshot bytes.Buffer 1405 io.Copy(&snapshot, ringBuffer) 1406 err = &smithy.DeserializationError{ 1407 Err: fmt.Errorf("failed to decode response body, %w", err), 1408 Snapshot: snapshot.Bytes(), 1409 } 1410 return out, metadata, err 1411 } 1412 1413 return out, metadata, err 1414} 1415 1416func awsAwsjson11_deserializeOpErrorPutSecretValue(response *smithyhttp.Response, metadata *middleware.Metadata) error { 1417 var errorBuffer bytes.Buffer 1418 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 1419 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 1420 } 1421 errorBody := bytes.NewReader(errorBuffer.Bytes()) 1422 1423 errorCode := "UnknownError" 1424 errorMessage := errorCode 1425 1426 code := response.Header.Get("X-Amzn-ErrorType") 1427 if len(code) != 0 { 1428 errorCode = restjson.SanitizeErrorCode(code) 1429 } 1430 1431 var buff [1024]byte 1432 ringBuffer := smithyio.NewRingBuffer(buff[:]) 1433 1434 body := io.TeeReader(errorBody, ringBuffer) 1435 decoder := json.NewDecoder(body) 1436 decoder.UseNumber() 1437 code, message, err := restjson.GetErrorInfo(decoder) 1438 if err != nil { 1439 var snapshot bytes.Buffer 1440 io.Copy(&snapshot, ringBuffer) 1441 err = &smithy.DeserializationError{ 1442 Err: fmt.Errorf("failed to decode response body, %w", err), 1443 Snapshot: snapshot.Bytes(), 1444 } 1445 return err 1446 } 1447 1448 errorBody.Seek(0, io.SeekStart) 1449 if len(code) != 0 { 1450 errorCode = restjson.SanitizeErrorCode(code) 1451 } 1452 if len(message) != 0 { 1453 errorMessage = message 1454 } 1455 1456 switch { 1457 case strings.EqualFold("EncryptionFailure", errorCode): 1458 return awsAwsjson11_deserializeErrorEncryptionFailure(response, errorBody) 1459 1460 case strings.EqualFold("InternalServiceError", errorCode): 1461 return awsAwsjson11_deserializeErrorInternalServiceError(response, errorBody) 1462 1463 case strings.EqualFold("InvalidParameterException", errorCode): 1464 return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) 1465 1466 case strings.EqualFold("InvalidRequestException", errorCode): 1467 return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody) 1468 1469 case strings.EqualFold("LimitExceededException", errorCode): 1470 return awsAwsjson11_deserializeErrorLimitExceededException(response, errorBody) 1471 1472 case strings.EqualFold("ResourceExistsException", errorCode): 1473 return awsAwsjson11_deserializeErrorResourceExistsException(response, errorBody) 1474 1475 case strings.EqualFold("ResourceNotFoundException", errorCode): 1476 return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) 1477 1478 default: 1479 genericError := &smithy.GenericAPIError{ 1480 Code: errorCode, 1481 Message: errorMessage, 1482 } 1483 return genericError 1484 1485 } 1486} 1487 1488type awsAwsjson11_deserializeOpRemoveRegionsFromReplication struct { 1489} 1490 1491func (*awsAwsjson11_deserializeOpRemoveRegionsFromReplication) ID() string { 1492 return "OperationDeserializer" 1493} 1494 1495func (m *awsAwsjson11_deserializeOpRemoveRegionsFromReplication) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 1496 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 1497) { 1498 out, metadata, err = next.HandleDeserialize(ctx, in) 1499 if err != nil { 1500 return out, metadata, err 1501 } 1502 1503 response, ok := out.RawResponse.(*smithyhttp.Response) 1504 if !ok { 1505 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 1506 } 1507 1508 if response.StatusCode < 200 || response.StatusCode >= 300 { 1509 return out, metadata, awsAwsjson11_deserializeOpErrorRemoveRegionsFromReplication(response, &metadata) 1510 } 1511 output := &RemoveRegionsFromReplicationOutput{} 1512 out.Result = output 1513 1514 var buff [1024]byte 1515 ringBuffer := smithyio.NewRingBuffer(buff[:]) 1516 1517 body := io.TeeReader(response.Body, ringBuffer) 1518 decoder := json.NewDecoder(body) 1519 decoder.UseNumber() 1520 var shape interface{} 1521 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 1522 var snapshot bytes.Buffer 1523 io.Copy(&snapshot, ringBuffer) 1524 err = &smithy.DeserializationError{ 1525 Err: fmt.Errorf("failed to decode response body, %w", err), 1526 Snapshot: snapshot.Bytes(), 1527 } 1528 return out, metadata, err 1529 } 1530 1531 err = awsAwsjson11_deserializeOpDocumentRemoveRegionsFromReplicationOutput(&output, shape) 1532 if err != nil { 1533 var snapshot bytes.Buffer 1534 io.Copy(&snapshot, ringBuffer) 1535 err = &smithy.DeserializationError{ 1536 Err: fmt.Errorf("failed to decode response body, %w", err), 1537 Snapshot: snapshot.Bytes(), 1538 } 1539 return out, metadata, err 1540 } 1541 1542 return out, metadata, err 1543} 1544 1545func awsAwsjson11_deserializeOpErrorRemoveRegionsFromReplication(response *smithyhttp.Response, metadata *middleware.Metadata) error { 1546 var errorBuffer bytes.Buffer 1547 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 1548 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 1549 } 1550 errorBody := bytes.NewReader(errorBuffer.Bytes()) 1551 1552 errorCode := "UnknownError" 1553 errorMessage := errorCode 1554 1555 code := response.Header.Get("X-Amzn-ErrorType") 1556 if len(code) != 0 { 1557 errorCode = restjson.SanitizeErrorCode(code) 1558 } 1559 1560 var buff [1024]byte 1561 ringBuffer := smithyio.NewRingBuffer(buff[:]) 1562 1563 body := io.TeeReader(errorBody, ringBuffer) 1564 decoder := json.NewDecoder(body) 1565 decoder.UseNumber() 1566 code, message, err := restjson.GetErrorInfo(decoder) 1567 if err != nil { 1568 var snapshot bytes.Buffer 1569 io.Copy(&snapshot, ringBuffer) 1570 err = &smithy.DeserializationError{ 1571 Err: fmt.Errorf("failed to decode response body, %w", err), 1572 Snapshot: snapshot.Bytes(), 1573 } 1574 return err 1575 } 1576 1577 errorBody.Seek(0, io.SeekStart) 1578 if len(code) != 0 { 1579 errorCode = restjson.SanitizeErrorCode(code) 1580 } 1581 if len(message) != 0 { 1582 errorMessage = message 1583 } 1584 1585 switch { 1586 case strings.EqualFold("InternalServiceError", errorCode): 1587 return awsAwsjson11_deserializeErrorInternalServiceError(response, errorBody) 1588 1589 case strings.EqualFold("InvalidParameterException", errorCode): 1590 return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) 1591 1592 case strings.EqualFold("InvalidRequestException", errorCode): 1593 return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody) 1594 1595 case strings.EqualFold("ResourceNotFoundException", errorCode): 1596 return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) 1597 1598 default: 1599 genericError := &smithy.GenericAPIError{ 1600 Code: errorCode, 1601 Message: errorMessage, 1602 } 1603 return genericError 1604 1605 } 1606} 1607 1608type awsAwsjson11_deserializeOpReplicateSecretToRegions struct { 1609} 1610 1611func (*awsAwsjson11_deserializeOpReplicateSecretToRegions) ID() string { 1612 return "OperationDeserializer" 1613} 1614 1615func (m *awsAwsjson11_deserializeOpReplicateSecretToRegions) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 1616 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 1617) { 1618 out, metadata, err = next.HandleDeserialize(ctx, in) 1619 if err != nil { 1620 return out, metadata, err 1621 } 1622 1623 response, ok := out.RawResponse.(*smithyhttp.Response) 1624 if !ok { 1625 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 1626 } 1627 1628 if response.StatusCode < 200 || response.StatusCode >= 300 { 1629 return out, metadata, awsAwsjson11_deserializeOpErrorReplicateSecretToRegions(response, &metadata) 1630 } 1631 output := &ReplicateSecretToRegionsOutput{} 1632 out.Result = output 1633 1634 var buff [1024]byte 1635 ringBuffer := smithyio.NewRingBuffer(buff[:]) 1636 1637 body := io.TeeReader(response.Body, ringBuffer) 1638 decoder := json.NewDecoder(body) 1639 decoder.UseNumber() 1640 var shape interface{} 1641 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 1642 var snapshot bytes.Buffer 1643 io.Copy(&snapshot, ringBuffer) 1644 err = &smithy.DeserializationError{ 1645 Err: fmt.Errorf("failed to decode response body, %w", err), 1646 Snapshot: snapshot.Bytes(), 1647 } 1648 return out, metadata, err 1649 } 1650 1651 err = awsAwsjson11_deserializeOpDocumentReplicateSecretToRegionsOutput(&output, shape) 1652 if err != nil { 1653 var snapshot bytes.Buffer 1654 io.Copy(&snapshot, ringBuffer) 1655 err = &smithy.DeserializationError{ 1656 Err: fmt.Errorf("failed to decode response body, %w", err), 1657 Snapshot: snapshot.Bytes(), 1658 } 1659 return out, metadata, err 1660 } 1661 1662 return out, metadata, err 1663} 1664 1665func awsAwsjson11_deserializeOpErrorReplicateSecretToRegions(response *smithyhttp.Response, metadata *middleware.Metadata) error { 1666 var errorBuffer bytes.Buffer 1667 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 1668 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 1669 } 1670 errorBody := bytes.NewReader(errorBuffer.Bytes()) 1671 1672 errorCode := "UnknownError" 1673 errorMessage := errorCode 1674 1675 code := response.Header.Get("X-Amzn-ErrorType") 1676 if len(code) != 0 { 1677 errorCode = restjson.SanitizeErrorCode(code) 1678 } 1679 1680 var buff [1024]byte 1681 ringBuffer := smithyio.NewRingBuffer(buff[:]) 1682 1683 body := io.TeeReader(errorBody, ringBuffer) 1684 decoder := json.NewDecoder(body) 1685 decoder.UseNumber() 1686 code, message, err := restjson.GetErrorInfo(decoder) 1687 if err != nil { 1688 var snapshot bytes.Buffer 1689 io.Copy(&snapshot, ringBuffer) 1690 err = &smithy.DeserializationError{ 1691 Err: fmt.Errorf("failed to decode response body, %w", err), 1692 Snapshot: snapshot.Bytes(), 1693 } 1694 return err 1695 } 1696 1697 errorBody.Seek(0, io.SeekStart) 1698 if len(code) != 0 { 1699 errorCode = restjson.SanitizeErrorCode(code) 1700 } 1701 if len(message) != 0 { 1702 errorMessage = message 1703 } 1704 1705 switch { 1706 case strings.EqualFold("InternalServiceError", errorCode): 1707 return awsAwsjson11_deserializeErrorInternalServiceError(response, errorBody) 1708 1709 case strings.EqualFold("InvalidParameterException", errorCode): 1710 return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) 1711 1712 case strings.EqualFold("InvalidRequestException", errorCode): 1713 return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody) 1714 1715 case strings.EqualFold("ResourceNotFoundException", errorCode): 1716 return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) 1717 1718 default: 1719 genericError := &smithy.GenericAPIError{ 1720 Code: errorCode, 1721 Message: errorMessage, 1722 } 1723 return genericError 1724 1725 } 1726} 1727 1728type awsAwsjson11_deserializeOpRestoreSecret struct { 1729} 1730 1731func (*awsAwsjson11_deserializeOpRestoreSecret) ID() string { 1732 return "OperationDeserializer" 1733} 1734 1735func (m *awsAwsjson11_deserializeOpRestoreSecret) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 1736 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 1737) { 1738 out, metadata, err = next.HandleDeserialize(ctx, in) 1739 if err != nil { 1740 return out, metadata, err 1741 } 1742 1743 response, ok := out.RawResponse.(*smithyhttp.Response) 1744 if !ok { 1745 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 1746 } 1747 1748 if response.StatusCode < 200 || response.StatusCode >= 300 { 1749 return out, metadata, awsAwsjson11_deserializeOpErrorRestoreSecret(response, &metadata) 1750 } 1751 output := &RestoreSecretOutput{} 1752 out.Result = output 1753 1754 var buff [1024]byte 1755 ringBuffer := smithyio.NewRingBuffer(buff[:]) 1756 1757 body := io.TeeReader(response.Body, ringBuffer) 1758 decoder := json.NewDecoder(body) 1759 decoder.UseNumber() 1760 var shape interface{} 1761 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 1762 var snapshot bytes.Buffer 1763 io.Copy(&snapshot, ringBuffer) 1764 err = &smithy.DeserializationError{ 1765 Err: fmt.Errorf("failed to decode response body, %w", err), 1766 Snapshot: snapshot.Bytes(), 1767 } 1768 return out, metadata, err 1769 } 1770 1771 err = awsAwsjson11_deserializeOpDocumentRestoreSecretOutput(&output, shape) 1772 if err != nil { 1773 var snapshot bytes.Buffer 1774 io.Copy(&snapshot, ringBuffer) 1775 err = &smithy.DeserializationError{ 1776 Err: fmt.Errorf("failed to decode response body, %w", err), 1777 Snapshot: snapshot.Bytes(), 1778 } 1779 return out, metadata, err 1780 } 1781 1782 return out, metadata, err 1783} 1784 1785func awsAwsjson11_deserializeOpErrorRestoreSecret(response *smithyhttp.Response, metadata *middleware.Metadata) error { 1786 var errorBuffer bytes.Buffer 1787 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 1788 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 1789 } 1790 errorBody := bytes.NewReader(errorBuffer.Bytes()) 1791 1792 errorCode := "UnknownError" 1793 errorMessage := errorCode 1794 1795 code := response.Header.Get("X-Amzn-ErrorType") 1796 if len(code) != 0 { 1797 errorCode = restjson.SanitizeErrorCode(code) 1798 } 1799 1800 var buff [1024]byte 1801 ringBuffer := smithyio.NewRingBuffer(buff[:]) 1802 1803 body := io.TeeReader(errorBody, ringBuffer) 1804 decoder := json.NewDecoder(body) 1805 decoder.UseNumber() 1806 code, message, err := restjson.GetErrorInfo(decoder) 1807 if err != nil { 1808 var snapshot bytes.Buffer 1809 io.Copy(&snapshot, ringBuffer) 1810 err = &smithy.DeserializationError{ 1811 Err: fmt.Errorf("failed to decode response body, %w", err), 1812 Snapshot: snapshot.Bytes(), 1813 } 1814 return err 1815 } 1816 1817 errorBody.Seek(0, io.SeekStart) 1818 if len(code) != 0 { 1819 errorCode = restjson.SanitizeErrorCode(code) 1820 } 1821 if len(message) != 0 { 1822 errorMessage = message 1823 } 1824 1825 switch { 1826 case strings.EqualFold("InternalServiceError", errorCode): 1827 return awsAwsjson11_deserializeErrorInternalServiceError(response, errorBody) 1828 1829 case strings.EqualFold("InvalidParameterException", errorCode): 1830 return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) 1831 1832 case strings.EqualFold("InvalidRequestException", errorCode): 1833 return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody) 1834 1835 case strings.EqualFold("ResourceNotFoundException", errorCode): 1836 return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) 1837 1838 default: 1839 genericError := &smithy.GenericAPIError{ 1840 Code: errorCode, 1841 Message: errorMessage, 1842 } 1843 return genericError 1844 1845 } 1846} 1847 1848type awsAwsjson11_deserializeOpRotateSecret struct { 1849} 1850 1851func (*awsAwsjson11_deserializeOpRotateSecret) ID() string { 1852 return "OperationDeserializer" 1853} 1854 1855func (m *awsAwsjson11_deserializeOpRotateSecret) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 1856 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 1857) { 1858 out, metadata, err = next.HandleDeserialize(ctx, in) 1859 if err != nil { 1860 return out, metadata, err 1861 } 1862 1863 response, ok := out.RawResponse.(*smithyhttp.Response) 1864 if !ok { 1865 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 1866 } 1867 1868 if response.StatusCode < 200 || response.StatusCode >= 300 { 1869 return out, metadata, awsAwsjson11_deserializeOpErrorRotateSecret(response, &metadata) 1870 } 1871 output := &RotateSecretOutput{} 1872 out.Result = output 1873 1874 var buff [1024]byte 1875 ringBuffer := smithyio.NewRingBuffer(buff[:]) 1876 1877 body := io.TeeReader(response.Body, ringBuffer) 1878 decoder := json.NewDecoder(body) 1879 decoder.UseNumber() 1880 var shape interface{} 1881 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 1882 var snapshot bytes.Buffer 1883 io.Copy(&snapshot, ringBuffer) 1884 err = &smithy.DeserializationError{ 1885 Err: fmt.Errorf("failed to decode response body, %w", err), 1886 Snapshot: snapshot.Bytes(), 1887 } 1888 return out, metadata, err 1889 } 1890 1891 err = awsAwsjson11_deserializeOpDocumentRotateSecretOutput(&output, shape) 1892 if err != nil { 1893 var snapshot bytes.Buffer 1894 io.Copy(&snapshot, ringBuffer) 1895 err = &smithy.DeserializationError{ 1896 Err: fmt.Errorf("failed to decode response body, %w", err), 1897 Snapshot: snapshot.Bytes(), 1898 } 1899 return out, metadata, err 1900 } 1901 1902 return out, metadata, err 1903} 1904 1905func awsAwsjson11_deserializeOpErrorRotateSecret(response *smithyhttp.Response, metadata *middleware.Metadata) error { 1906 var errorBuffer bytes.Buffer 1907 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 1908 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 1909 } 1910 errorBody := bytes.NewReader(errorBuffer.Bytes()) 1911 1912 errorCode := "UnknownError" 1913 errorMessage := errorCode 1914 1915 code := response.Header.Get("X-Amzn-ErrorType") 1916 if len(code) != 0 { 1917 errorCode = restjson.SanitizeErrorCode(code) 1918 } 1919 1920 var buff [1024]byte 1921 ringBuffer := smithyio.NewRingBuffer(buff[:]) 1922 1923 body := io.TeeReader(errorBody, ringBuffer) 1924 decoder := json.NewDecoder(body) 1925 decoder.UseNumber() 1926 code, message, err := restjson.GetErrorInfo(decoder) 1927 if err != nil { 1928 var snapshot bytes.Buffer 1929 io.Copy(&snapshot, ringBuffer) 1930 err = &smithy.DeserializationError{ 1931 Err: fmt.Errorf("failed to decode response body, %w", err), 1932 Snapshot: snapshot.Bytes(), 1933 } 1934 return err 1935 } 1936 1937 errorBody.Seek(0, io.SeekStart) 1938 if len(code) != 0 { 1939 errorCode = restjson.SanitizeErrorCode(code) 1940 } 1941 if len(message) != 0 { 1942 errorMessage = message 1943 } 1944 1945 switch { 1946 case strings.EqualFold("InternalServiceError", errorCode): 1947 return awsAwsjson11_deserializeErrorInternalServiceError(response, errorBody) 1948 1949 case strings.EqualFold("InvalidParameterException", errorCode): 1950 return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) 1951 1952 case strings.EqualFold("InvalidRequestException", errorCode): 1953 return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody) 1954 1955 case strings.EqualFold("ResourceNotFoundException", errorCode): 1956 return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) 1957 1958 default: 1959 genericError := &smithy.GenericAPIError{ 1960 Code: errorCode, 1961 Message: errorMessage, 1962 } 1963 return genericError 1964 1965 } 1966} 1967 1968type awsAwsjson11_deserializeOpStopReplicationToReplica struct { 1969} 1970 1971func (*awsAwsjson11_deserializeOpStopReplicationToReplica) ID() string { 1972 return "OperationDeserializer" 1973} 1974 1975func (m *awsAwsjson11_deserializeOpStopReplicationToReplica) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 1976 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 1977) { 1978 out, metadata, err = next.HandleDeserialize(ctx, in) 1979 if err != nil { 1980 return out, metadata, err 1981 } 1982 1983 response, ok := out.RawResponse.(*smithyhttp.Response) 1984 if !ok { 1985 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 1986 } 1987 1988 if response.StatusCode < 200 || response.StatusCode >= 300 { 1989 return out, metadata, awsAwsjson11_deserializeOpErrorStopReplicationToReplica(response, &metadata) 1990 } 1991 output := &StopReplicationToReplicaOutput{} 1992 out.Result = output 1993 1994 var buff [1024]byte 1995 ringBuffer := smithyio.NewRingBuffer(buff[:]) 1996 1997 body := io.TeeReader(response.Body, ringBuffer) 1998 decoder := json.NewDecoder(body) 1999 decoder.UseNumber() 2000 var shape interface{} 2001 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 2002 var snapshot bytes.Buffer 2003 io.Copy(&snapshot, ringBuffer) 2004 err = &smithy.DeserializationError{ 2005 Err: fmt.Errorf("failed to decode response body, %w", err), 2006 Snapshot: snapshot.Bytes(), 2007 } 2008 return out, metadata, err 2009 } 2010 2011 err = awsAwsjson11_deserializeOpDocumentStopReplicationToReplicaOutput(&output, shape) 2012 if err != nil { 2013 var snapshot bytes.Buffer 2014 io.Copy(&snapshot, ringBuffer) 2015 err = &smithy.DeserializationError{ 2016 Err: fmt.Errorf("failed to decode response body, %w", err), 2017 Snapshot: snapshot.Bytes(), 2018 } 2019 return out, metadata, err 2020 } 2021 2022 return out, metadata, err 2023} 2024 2025func awsAwsjson11_deserializeOpErrorStopReplicationToReplica(response *smithyhttp.Response, metadata *middleware.Metadata) error { 2026 var errorBuffer bytes.Buffer 2027 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 2028 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 2029 } 2030 errorBody := bytes.NewReader(errorBuffer.Bytes()) 2031 2032 errorCode := "UnknownError" 2033 errorMessage := errorCode 2034 2035 code := response.Header.Get("X-Amzn-ErrorType") 2036 if len(code) != 0 { 2037 errorCode = restjson.SanitizeErrorCode(code) 2038 } 2039 2040 var buff [1024]byte 2041 ringBuffer := smithyio.NewRingBuffer(buff[:]) 2042 2043 body := io.TeeReader(errorBody, ringBuffer) 2044 decoder := json.NewDecoder(body) 2045 decoder.UseNumber() 2046 code, message, err := restjson.GetErrorInfo(decoder) 2047 if err != nil { 2048 var snapshot bytes.Buffer 2049 io.Copy(&snapshot, ringBuffer) 2050 err = &smithy.DeserializationError{ 2051 Err: fmt.Errorf("failed to decode response body, %w", err), 2052 Snapshot: snapshot.Bytes(), 2053 } 2054 return err 2055 } 2056 2057 errorBody.Seek(0, io.SeekStart) 2058 if len(code) != 0 { 2059 errorCode = restjson.SanitizeErrorCode(code) 2060 } 2061 if len(message) != 0 { 2062 errorMessage = message 2063 } 2064 2065 switch { 2066 case strings.EqualFold("InternalServiceError", errorCode): 2067 return awsAwsjson11_deserializeErrorInternalServiceError(response, errorBody) 2068 2069 case strings.EqualFold("InvalidParameterException", errorCode): 2070 return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) 2071 2072 case strings.EqualFold("InvalidRequestException", errorCode): 2073 return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody) 2074 2075 case strings.EqualFold("ResourceNotFoundException", errorCode): 2076 return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) 2077 2078 default: 2079 genericError := &smithy.GenericAPIError{ 2080 Code: errorCode, 2081 Message: errorMessage, 2082 } 2083 return genericError 2084 2085 } 2086} 2087 2088type awsAwsjson11_deserializeOpTagResource struct { 2089} 2090 2091func (*awsAwsjson11_deserializeOpTagResource) ID() string { 2092 return "OperationDeserializer" 2093} 2094 2095func (m *awsAwsjson11_deserializeOpTagResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 2096 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 2097) { 2098 out, metadata, err = next.HandleDeserialize(ctx, in) 2099 if err != nil { 2100 return out, metadata, err 2101 } 2102 2103 response, ok := out.RawResponse.(*smithyhttp.Response) 2104 if !ok { 2105 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 2106 } 2107 2108 if response.StatusCode < 200 || response.StatusCode >= 300 { 2109 return out, metadata, awsAwsjson11_deserializeOpErrorTagResource(response, &metadata) 2110 } 2111 output := &TagResourceOutput{} 2112 out.Result = output 2113 2114 if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { 2115 return out, metadata, &smithy.DeserializationError{ 2116 Err: fmt.Errorf("failed to discard response body, %w", err), 2117 } 2118 } 2119 2120 return out, metadata, err 2121} 2122 2123func awsAwsjson11_deserializeOpErrorTagResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { 2124 var errorBuffer bytes.Buffer 2125 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 2126 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 2127 } 2128 errorBody := bytes.NewReader(errorBuffer.Bytes()) 2129 2130 errorCode := "UnknownError" 2131 errorMessage := errorCode 2132 2133 code := response.Header.Get("X-Amzn-ErrorType") 2134 if len(code) != 0 { 2135 errorCode = restjson.SanitizeErrorCode(code) 2136 } 2137 2138 var buff [1024]byte 2139 ringBuffer := smithyio.NewRingBuffer(buff[:]) 2140 2141 body := io.TeeReader(errorBody, ringBuffer) 2142 decoder := json.NewDecoder(body) 2143 decoder.UseNumber() 2144 code, message, err := restjson.GetErrorInfo(decoder) 2145 if err != nil { 2146 var snapshot bytes.Buffer 2147 io.Copy(&snapshot, ringBuffer) 2148 err = &smithy.DeserializationError{ 2149 Err: fmt.Errorf("failed to decode response body, %w", err), 2150 Snapshot: snapshot.Bytes(), 2151 } 2152 return err 2153 } 2154 2155 errorBody.Seek(0, io.SeekStart) 2156 if len(code) != 0 { 2157 errorCode = restjson.SanitizeErrorCode(code) 2158 } 2159 if len(message) != 0 { 2160 errorMessage = message 2161 } 2162 2163 switch { 2164 case strings.EqualFold("InternalServiceError", errorCode): 2165 return awsAwsjson11_deserializeErrorInternalServiceError(response, errorBody) 2166 2167 case strings.EqualFold("InvalidParameterException", errorCode): 2168 return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) 2169 2170 case strings.EqualFold("InvalidRequestException", errorCode): 2171 return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody) 2172 2173 case strings.EqualFold("ResourceNotFoundException", errorCode): 2174 return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) 2175 2176 default: 2177 genericError := &smithy.GenericAPIError{ 2178 Code: errorCode, 2179 Message: errorMessage, 2180 } 2181 return genericError 2182 2183 } 2184} 2185 2186type awsAwsjson11_deserializeOpUntagResource struct { 2187} 2188 2189func (*awsAwsjson11_deserializeOpUntagResource) ID() string { 2190 return "OperationDeserializer" 2191} 2192 2193func (m *awsAwsjson11_deserializeOpUntagResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 2194 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 2195) { 2196 out, metadata, err = next.HandleDeserialize(ctx, in) 2197 if err != nil { 2198 return out, metadata, err 2199 } 2200 2201 response, ok := out.RawResponse.(*smithyhttp.Response) 2202 if !ok { 2203 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 2204 } 2205 2206 if response.StatusCode < 200 || response.StatusCode >= 300 { 2207 return out, metadata, awsAwsjson11_deserializeOpErrorUntagResource(response, &metadata) 2208 } 2209 output := &UntagResourceOutput{} 2210 out.Result = output 2211 2212 if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { 2213 return out, metadata, &smithy.DeserializationError{ 2214 Err: fmt.Errorf("failed to discard response body, %w", err), 2215 } 2216 } 2217 2218 return out, metadata, err 2219} 2220 2221func awsAwsjson11_deserializeOpErrorUntagResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { 2222 var errorBuffer bytes.Buffer 2223 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 2224 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 2225 } 2226 errorBody := bytes.NewReader(errorBuffer.Bytes()) 2227 2228 errorCode := "UnknownError" 2229 errorMessage := errorCode 2230 2231 code := response.Header.Get("X-Amzn-ErrorType") 2232 if len(code) != 0 { 2233 errorCode = restjson.SanitizeErrorCode(code) 2234 } 2235 2236 var buff [1024]byte 2237 ringBuffer := smithyio.NewRingBuffer(buff[:]) 2238 2239 body := io.TeeReader(errorBody, ringBuffer) 2240 decoder := json.NewDecoder(body) 2241 decoder.UseNumber() 2242 code, message, err := restjson.GetErrorInfo(decoder) 2243 if err != nil { 2244 var snapshot bytes.Buffer 2245 io.Copy(&snapshot, ringBuffer) 2246 err = &smithy.DeserializationError{ 2247 Err: fmt.Errorf("failed to decode response body, %w", err), 2248 Snapshot: snapshot.Bytes(), 2249 } 2250 return err 2251 } 2252 2253 errorBody.Seek(0, io.SeekStart) 2254 if len(code) != 0 { 2255 errorCode = restjson.SanitizeErrorCode(code) 2256 } 2257 if len(message) != 0 { 2258 errorMessage = message 2259 } 2260 2261 switch { 2262 case strings.EqualFold("InternalServiceError", errorCode): 2263 return awsAwsjson11_deserializeErrorInternalServiceError(response, errorBody) 2264 2265 case strings.EqualFold("InvalidParameterException", errorCode): 2266 return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) 2267 2268 case strings.EqualFold("InvalidRequestException", errorCode): 2269 return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody) 2270 2271 case strings.EqualFold("ResourceNotFoundException", errorCode): 2272 return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) 2273 2274 default: 2275 genericError := &smithy.GenericAPIError{ 2276 Code: errorCode, 2277 Message: errorMessage, 2278 } 2279 return genericError 2280 2281 } 2282} 2283 2284type awsAwsjson11_deserializeOpUpdateSecret struct { 2285} 2286 2287func (*awsAwsjson11_deserializeOpUpdateSecret) ID() string { 2288 return "OperationDeserializer" 2289} 2290 2291func (m *awsAwsjson11_deserializeOpUpdateSecret) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 2292 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 2293) { 2294 out, metadata, err = next.HandleDeserialize(ctx, in) 2295 if err != nil { 2296 return out, metadata, err 2297 } 2298 2299 response, ok := out.RawResponse.(*smithyhttp.Response) 2300 if !ok { 2301 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 2302 } 2303 2304 if response.StatusCode < 200 || response.StatusCode >= 300 { 2305 return out, metadata, awsAwsjson11_deserializeOpErrorUpdateSecret(response, &metadata) 2306 } 2307 output := &UpdateSecretOutput{} 2308 out.Result = output 2309 2310 var buff [1024]byte 2311 ringBuffer := smithyio.NewRingBuffer(buff[:]) 2312 2313 body := io.TeeReader(response.Body, ringBuffer) 2314 decoder := json.NewDecoder(body) 2315 decoder.UseNumber() 2316 var shape interface{} 2317 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 2318 var snapshot bytes.Buffer 2319 io.Copy(&snapshot, ringBuffer) 2320 err = &smithy.DeserializationError{ 2321 Err: fmt.Errorf("failed to decode response body, %w", err), 2322 Snapshot: snapshot.Bytes(), 2323 } 2324 return out, metadata, err 2325 } 2326 2327 err = awsAwsjson11_deserializeOpDocumentUpdateSecretOutput(&output, shape) 2328 if err != nil { 2329 var snapshot bytes.Buffer 2330 io.Copy(&snapshot, ringBuffer) 2331 err = &smithy.DeserializationError{ 2332 Err: fmt.Errorf("failed to decode response body, %w", err), 2333 Snapshot: snapshot.Bytes(), 2334 } 2335 return out, metadata, err 2336 } 2337 2338 return out, metadata, err 2339} 2340 2341func awsAwsjson11_deserializeOpErrorUpdateSecret(response *smithyhttp.Response, metadata *middleware.Metadata) error { 2342 var errorBuffer bytes.Buffer 2343 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 2344 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 2345 } 2346 errorBody := bytes.NewReader(errorBuffer.Bytes()) 2347 2348 errorCode := "UnknownError" 2349 errorMessage := errorCode 2350 2351 code := response.Header.Get("X-Amzn-ErrorType") 2352 if len(code) != 0 { 2353 errorCode = restjson.SanitizeErrorCode(code) 2354 } 2355 2356 var buff [1024]byte 2357 ringBuffer := smithyio.NewRingBuffer(buff[:]) 2358 2359 body := io.TeeReader(errorBody, ringBuffer) 2360 decoder := json.NewDecoder(body) 2361 decoder.UseNumber() 2362 code, message, err := restjson.GetErrorInfo(decoder) 2363 if err != nil { 2364 var snapshot bytes.Buffer 2365 io.Copy(&snapshot, ringBuffer) 2366 err = &smithy.DeserializationError{ 2367 Err: fmt.Errorf("failed to decode response body, %w", err), 2368 Snapshot: snapshot.Bytes(), 2369 } 2370 return err 2371 } 2372 2373 errorBody.Seek(0, io.SeekStart) 2374 if len(code) != 0 { 2375 errorCode = restjson.SanitizeErrorCode(code) 2376 } 2377 if len(message) != 0 { 2378 errorMessage = message 2379 } 2380 2381 switch { 2382 case strings.EqualFold("EncryptionFailure", errorCode): 2383 return awsAwsjson11_deserializeErrorEncryptionFailure(response, errorBody) 2384 2385 case strings.EqualFold("InternalServiceError", errorCode): 2386 return awsAwsjson11_deserializeErrorInternalServiceError(response, errorBody) 2387 2388 case strings.EqualFold("InvalidParameterException", errorCode): 2389 return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) 2390 2391 case strings.EqualFold("InvalidRequestException", errorCode): 2392 return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody) 2393 2394 case strings.EqualFold("LimitExceededException", errorCode): 2395 return awsAwsjson11_deserializeErrorLimitExceededException(response, errorBody) 2396 2397 case strings.EqualFold("MalformedPolicyDocumentException", errorCode): 2398 return awsAwsjson11_deserializeErrorMalformedPolicyDocumentException(response, errorBody) 2399 2400 case strings.EqualFold("PreconditionNotMetException", errorCode): 2401 return awsAwsjson11_deserializeErrorPreconditionNotMetException(response, errorBody) 2402 2403 case strings.EqualFold("ResourceExistsException", errorCode): 2404 return awsAwsjson11_deserializeErrorResourceExistsException(response, errorBody) 2405 2406 case strings.EqualFold("ResourceNotFoundException", errorCode): 2407 return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) 2408 2409 default: 2410 genericError := &smithy.GenericAPIError{ 2411 Code: errorCode, 2412 Message: errorMessage, 2413 } 2414 return genericError 2415 2416 } 2417} 2418 2419type awsAwsjson11_deserializeOpUpdateSecretVersionStage struct { 2420} 2421 2422func (*awsAwsjson11_deserializeOpUpdateSecretVersionStage) ID() string { 2423 return "OperationDeserializer" 2424} 2425 2426func (m *awsAwsjson11_deserializeOpUpdateSecretVersionStage) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 2427 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 2428) { 2429 out, metadata, err = next.HandleDeserialize(ctx, in) 2430 if err != nil { 2431 return out, metadata, err 2432 } 2433 2434 response, ok := out.RawResponse.(*smithyhttp.Response) 2435 if !ok { 2436 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 2437 } 2438 2439 if response.StatusCode < 200 || response.StatusCode >= 300 { 2440 return out, metadata, awsAwsjson11_deserializeOpErrorUpdateSecretVersionStage(response, &metadata) 2441 } 2442 output := &UpdateSecretVersionStageOutput{} 2443 out.Result = output 2444 2445 var buff [1024]byte 2446 ringBuffer := smithyio.NewRingBuffer(buff[:]) 2447 2448 body := io.TeeReader(response.Body, ringBuffer) 2449 decoder := json.NewDecoder(body) 2450 decoder.UseNumber() 2451 var shape interface{} 2452 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 2453 var snapshot bytes.Buffer 2454 io.Copy(&snapshot, ringBuffer) 2455 err = &smithy.DeserializationError{ 2456 Err: fmt.Errorf("failed to decode response body, %w", err), 2457 Snapshot: snapshot.Bytes(), 2458 } 2459 return out, metadata, err 2460 } 2461 2462 err = awsAwsjson11_deserializeOpDocumentUpdateSecretVersionStageOutput(&output, shape) 2463 if err != nil { 2464 var snapshot bytes.Buffer 2465 io.Copy(&snapshot, ringBuffer) 2466 err = &smithy.DeserializationError{ 2467 Err: fmt.Errorf("failed to decode response body, %w", err), 2468 Snapshot: snapshot.Bytes(), 2469 } 2470 return out, metadata, err 2471 } 2472 2473 return out, metadata, err 2474} 2475 2476func awsAwsjson11_deserializeOpErrorUpdateSecretVersionStage(response *smithyhttp.Response, metadata *middleware.Metadata) error { 2477 var errorBuffer bytes.Buffer 2478 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 2479 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 2480 } 2481 errorBody := bytes.NewReader(errorBuffer.Bytes()) 2482 2483 errorCode := "UnknownError" 2484 errorMessage := errorCode 2485 2486 code := response.Header.Get("X-Amzn-ErrorType") 2487 if len(code) != 0 { 2488 errorCode = restjson.SanitizeErrorCode(code) 2489 } 2490 2491 var buff [1024]byte 2492 ringBuffer := smithyio.NewRingBuffer(buff[:]) 2493 2494 body := io.TeeReader(errorBody, ringBuffer) 2495 decoder := json.NewDecoder(body) 2496 decoder.UseNumber() 2497 code, message, err := restjson.GetErrorInfo(decoder) 2498 if err != nil { 2499 var snapshot bytes.Buffer 2500 io.Copy(&snapshot, ringBuffer) 2501 err = &smithy.DeserializationError{ 2502 Err: fmt.Errorf("failed to decode response body, %w", err), 2503 Snapshot: snapshot.Bytes(), 2504 } 2505 return err 2506 } 2507 2508 errorBody.Seek(0, io.SeekStart) 2509 if len(code) != 0 { 2510 errorCode = restjson.SanitizeErrorCode(code) 2511 } 2512 if len(message) != 0 { 2513 errorMessage = message 2514 } 2515 2516 switch { 2517 case strings.EqualFold("InternalServiceError", errorCode): 2518 return awsAwsjson11_deserializeErrorInternalServiceError(response, errorBody) 2519 2520 case strings.EqualFold("InvalidParameterException", errorCode): 2521 return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) 2522 2523 case strings.EqualFold("InvalidRequestException", errorCode): 2524 return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody) 2525 2526 case strings.EqualFold("LimitExceededException", errorCode): 2527 return awsAwsjson11_deserializeErrorLimitExceededException(response, errorBody) 2528 2529 case strings.EqualFold("ResourceNotFoundException", errorCode): 2530 return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) 2531 2532 default: 2533 genericError := &smithy.GenericAPIError{ 2534 Code: errorCode, 2535 Message: errorMessage, 2536 } 2537 return genericError 2538 2539 } 2540} 2541 2542type awsAwsjson11_deserializeOpValidateResourcePolicy struct { 2543} 2544 2545func (*awsAwsjson11_deserializeOpValidateResourcePolicy) ID() string { 2546 return "OperationDeserializer" 2547} 2548 2549func (m *awsAwsjson11_deserializeOpValidateResourcePolicy) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 2550 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 2551) { 2552 out, metadata, err = next.HandleDeserialize(ctx, in) 2553 if err != nil { 2554 return out, metadata, err 2555 } 2556 2557 response, ok := out.RawResponse.(*smithyhttp.Response) 2558 if !ok { 2559 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 2560 } 2561 2562 if response.StatusCode < 200 || response.StatusCode >= 300 { 2563 return out, metadata, awsAwsjson11_deserializeOpErrorValidateResourcePolicy(response, &metadata) 2564 } 2565 output := &ValidateResourcePolicyOutput{} 2566 out.Result = output 2567 2568 var buff [1024]byte 2569 ringBuffer := smithyio.NewRingBuffer(buff[:]) 2570 2571 body := io.TeeReader(response.Body, ringBuffer) 2572 decoder := json.NewDecoder(body) 2573 decoder.UseNumber() 2574 var shape interface{} 2575 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 2576 var snapshot bytes.Buffer 2577 io.Copy(&snapshot, ringBuffer) 2578 err = &smithy.DeserializationError{ 2579 Err: fmt.Errorf("failed to decode response body, %w", err), 2580 Snapshot: snapshot.Bytes(), 2581 } 2582 return out, metadata, err 2583 } 2584 2585 err = awsAwsjson11_deserializeOpDocumentValidateResourcePolicyOutput(&output, shape) 2586 if err != nil { 2587 var snapshot bytes.Buffer 2588 io.Copy(&snapshot, ringBuffer) 2589 err = &smithy.DeserializationError{ 2590 Err: fmt.Errorf("failed to decode response body, %w", err), 2591 Snapshot: snapshot.Bytes(), 2592 } 2593 return out, metadata, err 2594 } 2595 2596 return out, metadata, err 2597} 2598 2599func awsAwsjson11_deserializeOpErrorValidateResourcePolicy(response *smithyhttp.Response, metadata *middleware.Metadata) error { 2600 var errorBuffer bytes.Buffer 2601 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 2602 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 2603 } 2604 errorBody := bytes.NewReader(errorBuffer.Bytes()) 2605 2606 errorCode := "UnknownError" 2607 errorMessage := errorCode 2608 2609 code := response.Header.Get("X-Amzn-ErrorType") 2610 if len(code) != 0 { 2611 errorCode = restjson.SanitizeErrorCode(code) 2612 } 2613 2614 var buff [1024]byte 2615 ringBuffer := smithyio.NewRingBuffer(buff[:]) 2616 2617 body := io.TeeReader(errorBody, ringBuffer) 2618 decoder := json.NewDecoder(body) 2619 decoder.UseNumber() 2620 code, message, err := restjson.GetErrorInfo(decoder) 2621 if err != nil { 2622 var snapshot bytes.Buffer 2623 io.Copy(&snapshot, ringBuffer) 2624 err = &smithy.DeserializationError{ 2625 Err: fmt.Errorf("failed to decode response body, %w", err), 2626 Snapshot: snapshot.Bytes(), 2627 } 2628 return err 2629 } 2630 2631 errorBody.Seek(0, io.SeekStart) 2632 if len(code) != 0 { 2633 errorCode = restjson.SanitizeErrorCode(code) 2634 } 2635 if len(message) != 0 { 2636 errorMessage = message 2637 } 2638 2639 switch { 2640 case strings.EqualFold("InternalServiceError", errorCode): 2641 return awsAwsjson11_deserializeErrorInternalServiceError(response, errorBody) 2642 2643 case strings.EqualFold("InvalidParameterException", errorCode): 2644 return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) 2645 2646 case strings.EqualFold("InvalidRequestException", errorCode): 2647 return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody) 2648 2649 case strings.EqualFold("MalformedPolicyDocumentException", errorCode): 2650 return awsAwsjson11_deserializeErrorMalformedPolicyDocumentException(response, errorBody) 2651 2652 case strings.EqualFold("ResourceNotFoundException", errorCode): 2653 return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) 2654 2655 default: 2656 genericError := &smithy.GenericAPIError{ 2657 Code: errorCode, 2658 Message: errorMessage, 2659 } 2660 return genericError 2661 2662 } 2663} 2664 2665func awsAwsjson11_deserializeErrorDecryptionFailure(response *smithyhttp.Response, errorBody *bytes.Reader) error { 2666 var buff [1024]byte 2667 ringBuffer := smithyio.NewRingBuffer(buff[:]) 2668 2669 body := io.TeeReader(errorBody, ringBuffer) 2670 decoder := json.NewDecoder(body) 2671 decoder.UseNumber() 2672 var shape interface{} 2673 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 2674 var snapshot bytes.Buffer 2675 io.Copy(&snapshot, ringBuffer) 2676 err = &smithy.DeserializationError{ 2677 Err: fmt.Errorf("failed to decode response body, %w", err), 2678 Snapshot: snapshot.Bytes(), 2679 } 2680 return err 2681 } 2682 2683 output := &types.DecryptionFailure{} 2684 err := awsAwsjson11_deserializeDocumentDecryptionFailure(&output, shape) 2685 2686 if err != nil { 2687 var snapshot bytes.Buffer 2688 io.Copy(&snapshot, ringBuffer) 2689 err = &smithy.DeserializationError{ 2690 Err: fmt.Errorf("failed to decode response body, %w", err), 2691 Snapshot: snapshot.Bytes(), 2692 } 2693 return err 2694 } 2695 2696 errorBody.Seek(0, io.SeekStart) 2697 return output 2698} 2699 2700func awsAwsjson11_deserializeErrorEncryptionFailure(response *smithyhttp.Response, errorBody *bytes.Reader) error { 2701 var buff [1024]byte 2702 ringBuffer := smithyio.NewRingBuffer(buff[:]) 2703 2704 body := io.TeeReader(errorBody, ringBuffer) 2705 decoder := json.NewDecoder(body) 2706 decoder.UseNumber() 2707 var shape interface{} 2708 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 2709 var snapshot bytes.Buffer 2710 io.Copy(&snapshot, ringBuffer) 2711 err = &smithy.DeserializationError{ 2712 Err: fmt.Errorf("failed to decode response body, %w", err), 2713 Snapshot: snapshot.Bytes(), 2714 } 2715 return err 2716 } 2717 2718 output := &types.EncryptionFailure{} 2719 err := awsAwsjson11_deserializeDocumentEncryptionFailure(&output, shape) 2720 2721 if err != nil { 2722 var snapshot bytes.Buffer 2723 io.Copy(&snapshot, ringBuffer) 2724 err = &smithy.DeserializationError{ 2725 Err: fmt.Errorf("failed to decode response body, %w", err), 2726 Snapshot: snapshot.Bytes(), 2727 } 2728 return err 2729 } 2730 2731 errorBody.Seek(0, io.SeekStart) 2732 return output 2733} 2734 2735func awsAwsjson11_deserializeErrorInternalServiceError(response *smithyhttp.Response, errorBody *bytes.Reader) error { 2736 var buff [1024]byte 2737 ringBuffer := smithyio.NewRingBuffer(buff[:]) 2738 2739 body := io.TeeReader(errorBody, ringBuffer) 2740 decoder := json.NewDecoder(body) 2741 decoder.UseNumber() 2742 var shape interface{} 2743 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 2744 var snapshot bytes.Buffer 2745 io.Copy(&snapshot, ringBuffer) 2746 err = &smithy.DeserializationError{ 2747 Err: fmt.Errorf("failed to decode response body, %w", err), 2748 Snapshot: snapshot.Bytes(), 2749 } 2750 return err 2751 } 2752 2753 output := &types.InternalServiceError{} 2754 err := awsAwsjson11_deserializeDocumentInternalServiceError(&output, shape) 2755 2756 if err != nil { 2757 var snapshot bytes.Buffer 2758 io.Copy(&snapshot, ringBuffer) 2759 err = &smithy.DeserializationError{ 2760 Err: fmt.Errorf("failed to decode response body, %w", err), 2761 Snapshot: snapshot.Bytes(), 2762 } 2763 return err 2764 } 2765 2766 errorBody.Seek(0, io.SeekStart) 2767 return output 2768} 2769 2770func awsAwsjson11_deserializeErrorInvalidNextTokenException(response *smithyhttp.Response, errorBody *bytes.Reader) error { 2771 var buff [1024]byte 2772 ringBuffer := smithyio.NewRingBuffer(buff[:]) 2773 2774 body := io.TeeReader(errorBody, ringBuffer) 2775 decoder := json.NewDecoder(body) 2776 decoder.UseNumber() 2777 var shape interface{} 2778 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 2779 var snapshot bytes.Buffer 2780 io.Copy(&snapshot, ringBuffer) 2781 err = &smithy.DeserializationError{ 2782 Err: fmt.Errorf("failed to decode response body, %w", err), 2783 Snapshot: snapshot.Bytes(), 2784 } 2785 return err 2786 } 2787 2788 output := &types.InvalidNextTokenException{} 2789 err := awsAwsjson11_deserializeDocumentInvalidNextTokenException(&output, shape) 2790 2791 if err != nil { 2792 var snapshot bytes.Buffer 2793 io.Copy(&snapshot, ringBuffer) 2794 err = &smithy.DeserializationError{ 2795 Err: fmt.Errorf("failed to decode response body, %w", err), 2796 Snapshot: snapshot.Bytes(), 2797 } 2798 return err 2799 } 2800 2801 errorBody.Seek(0, io.SeekStart) 2802 return output 2803} 2804 2805func awsAwsjson11_deserializeErrorInvalidParameterException(response *smithyhttp.Response, errorBody *bytes.Reader) error { 2806 var buff [1024]byte 2807 ringBuffer := smithyio.NewRingBuffer(buff[:]) 2808 2809 body := io.TeeReader(errorBody, ringBuffer) 2810 decoder := json.NewDecoder(body) 2811 decoder.UseNumber() 2812 var shape interface{} 2813 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 2814 var snapshot bytes.Buffer 2815 io.Copy(&snapshot, ringBuffer) 2816 err = &smithy.DeserializationError{ 2817 Err: fmt.Errorf("failed to decode response body, %w", err), 2818 Snapshot: snapshot.Bytes(), 2819 } 2820 return err 2821 } 2822 2823 output := &types.InvalidParameterException{} 2824 err := awsAwsjson11_deserializeDocumentInvalidParameterException(&output, shape) 2825 2826 if err != nil { 2827 var snapshot bytes.Buffer 2828 io.Copy(&snapshot, ringBuffer) 2829 err = &smithy.DeserializationError{ 2830 Err: fmt.Errorf("failed to decode response body, %w", err), 2831 Snapshot: snapshot.Bytes(), 2832 } 2833 return err 2834 } 2835 2836 errorBody.Seek(0, io.SeekStart) 2837 return output 2838} 2839 2840func awsAwsjson11_deserializeErrorInvalidRequestException(response *smithyhttp.Response, errorBody *bytes.Reader) error { 2841 var buff [1024]byte 2842 ringBuffer := smithyio.NewRingBuffer(buff[:]) 2843 2844 body := io.TeeReader(errorBody, ringBuffer) 2845 decoder := json.NewDecoder(body) 2846 decoder.UseNumber() 2847 var shape interface{} 2848 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 2849 var snapshot bytes.Buffer 2850 io.Copy(&snapshot, ringBuffer) 2851 err = &smithy.DeserializationError{ 2852 Err: fmt.Errorf("failed to decode response body, %w", err), 2853 Snapshot: snapshot.Bytes(), 2854 } 2855 return err 2856 } 2857 2858 output := &types.InvalidRequestException{} 2859 err := awsAwsjson11_deserializeDocumentInvalidRequestException(&output, shape) 2860 2861 if err != nil { 2862 var snapshot bytes.Buffer 2863 io.Copy(&snapshot, ringBuffer) 2864 err = &smithy.DeserializationError{ 2865 Err: fmt.Errorf("failed to decode response body, %w", err), 2866 Snapshot: snapshot.Bytes(), 2867 } 2868 return err 2869 } 2870 2871 errorBody.Seek(0, io.SeekStart) 2872 return output 2873} 2874 2875func awsAwsjson11_deserializeErrorLimitExceededException(response *smithyhttp.Response, errorBody *bytes.Reader) error { 2876 var buff [1024]byte 2877 ringBuffer := smithyio.NewRingBuffer(buff[:]) 2878 2879 body := io.TeeReader(errorBody, ringBuffer) 2880 decoder := json.NewDecoder(body) 2881 decoder.UseNumber() 2882 var shape interface{} 2883 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 2884 var snapshot bytes.Buffer 2885 io.Copy(&snapshot, ringBuffer) 2886 err = &smithy.DeserializationError{ 2887 Err: fmt.Errorf("failed to decode response body, %w", err), 2888 Snapshot: snapshot.Bytes(), 2889 } 2890 return err 2891 } 2892 2893 output := &types.LimitExceededException{} 2894 err := awsAwsjson11_deserializeDocumentLimitExceededException(&output, shape) 2895 2896 if err != nil { 2897 var snapshot bytes.Buffer 2898 io.Copy(&snapshot, ringBuffer) 2899 err = &smithy.DeserializationError{ 2900 Err: fmt.Errorf("failed to decode response body, %w", err), 2901 Snapshot: snapshot.Bytes(), 2902 } 2903 return err 2904 } 2905 2906 errorBody.Seek(0, io.SeekStart) 2907 return output 2908} 2909 2910func awsAwsjson11_deserializeErrorMalformedPolicyDocumentException(response *smithyhttp.Response, errorBody *bytes.Reader) error { 2911 var buff [1024]byte 2912 ringBuffer := smithyio.NewRingBuffer(buff[:]) 2913 2914 body := io.TeeReader(errorBody, ringBuffer) 2915 decoder := json.NewDecoder(body) 2916 decoder.UseNumber() 2917 var shape interface{} 2918 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 2919 var snapshot bytes.Buffer 2920 io.Copy(&snapshot, ringBuffer) 2921 err = &smithy.DeserializationError{ 2922 Err: fmt.Errorf("failed to decode response body, %w", err), 2923 Snapshot: snapshot.Bytes(), 2924 } 2925 return err 2926 } 2927 2928 output := &types.MalformedPolicyDocumentException{} 2929 err := awsAwsjson11_deserializeDocumentMalformedPolicyDocumentException(&output, shape) 2930 2931 if err != nil { 2932 var snapshot bytes.Buffer 2933 io.Copy(&snapshot, ringBuffer) 2934 err = &smithy.DeserializationError{ 2935 Err: fmt.Errorf("failed to decode response body, %w", err), 2936 Snapshot: snapshot.Bytes(), 2937 } 2938 return err 2939 } 2940 2941 errorBody.Seek(0, io.SeekStart) 2942 return output 2943} 2944 2945func awsAwsjson11_deserializeErrorPreconditionNotMetException(response *smithyhttp.Response, errorBody *bytes.Reader) error { 2946 var buff [1024]byte 2947 ringBuffer := smithyio.NewRingBuffer(buff[:]) 2948 2949 body := io.TeeReader(errorBody, ringBuffer) 2950 decoder := json.NewDecoder(body) 2951 decoder.UseNumber() 2952 var shape interface{} 2953 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 2954 var snapshot bytes.Buffer 2955 io.Copy(&snapshot, ringBuffer) 2956 err = &smithy.DeserializationError{ 2957 Err: fmt.Errorf("failed to decode response body, %w", err), 2958 Snapshot: snapshot.Bytes(), 2959 } 2960 return err 2961 } 2962 2963 output := &types.PreconditionNotMetException{} 2964 err := awsAwsjson11_deserializeDocumentPreconditionNotMetException(&output, shape) 2965 2966 if err != nil { 2967 var snapshot bytes.Buffer 2968 io.Copy(&snapshot, ringBuffer) 2969 err = &smithy.DeserializationError{ 2970 Err: fmt.Errorf("failed to decode response body, %w", err), 2971 Snapshot: snapshot.Bytes(), 2972 } 2973 return err 2974 } 2975 2976 errorBody.Seek(0, io.SeekStart) 2977 return output 2978} 2979 2980func awsAwsjson11_deserializeErrorPublicPolicyException(response *smithyhttp.Response, errorBody *bytes.Reader) error { 2981 var buff [1024]byte 2982 ringBuffer := smithyio.NewRingBuffer(buff[:]) 2983 2984 body := io.TeeReader(errorBody, ringBuffer) 2985 decoder := json.NewDecoder(body) 2986 decoder.UseNumber() 2987 var shape interface{} 2988 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 2989 var snapshot bytes.Buffer 2990 io.Copy(&snapshot, ringBuffer) 2991 err = &smithy.DeserializationError{ 2992 Err: fmt.Errorf("failed to decode response body, %w", err), 2993 Snapshot: snapshot.Bytes(), 2994 } 2995 return err 2996 } 2997 2998 output := &types.PublicPolicyException{} 2999 err := awsAwsjson11_deserializeDocumentPublicPolicyException(&output, shape) 3000 3001 if err != nil { 3002 var snapshot bytes.Buffer 3003 io.Copy(&snapshot, ringBuffer) 3004 err = &smithy.DeserializationError{ 3005 Err: fmt.Errorf("failed to decode response body, %w", err), 3006 Snapshot: snapshot.Bytes(), 3007 } 3008 return err 3009 } 3010 3011 errorBody.Seek(0, io.SeekStart) 3012 return output 3013} 3014 3015func awsAwsjson11_deserializeErrorResourceExistsException(response *smithyhttp.Response, errorBody *bytes.Reader) error { 3016 var buff [1024]byte 3017 ringBuffer := smithyio.NewRingBuffer(buff[:]) 3018 3019 body := io.TeeReader(errorBody, ringBuffer) 3020 decoder := json.NewDecoder(body) 3021 decoder.UseNumber() 3022 var shape interface{} 3023 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 3024 var snapshot bytes.Buffer 3025 io.Copy(&snapshot, ringBuffer) 3026 err = &smithy.DeserializationError{ 3027 Err: fmt.Errorf("failed to decode response body, %w", err), 3028 Snapshot: snapshot.Bytes(), 3029 } 3030 return err 3031 } 3032 3033 output := &types.ResourceExistsException{} 3034 err := awsAwsjson11_deserializeDocumentResourceExistsException(&output, shape) 3035 3036 if err != nil { 3037 var snapshot bytes.Buffer 3038 io.Copy(&snapshot, ringBuffer) 3039 err = &smithy.DeserializationError{ 3040 Err: fmt.Errorf("failed to decode response body, %w", err), 3041 Snapshot: snapshot.Bytes(), 3042 } 3043 return err 3044 } 3045 3046 errorBody.Seek(0, io.SeekStart) 3047 return output 3048} 3049 3050func awsAwsjson11_deserializeErrorResourceNotFoundException(response *smithyhttp.Response, errorBody *bytes.Reader) error { 3051 var buff [1024]byte 3052 ringBuffer := smithyio.NewRingBuffer(buff[:]) 3053 3054 body := io.TeeReader(errorBody, ringBuffer) 3055 decoder := json.NewDecoder(body) 3056 decoder.UseNumber() 3057 var shape interface{} 3058 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 3059 var snapshot bytes.Buffer 3060 io.Copy(&snapshot, ringBuffer) 3061 err = &smithy.DeserializationError{ 3062 Err: fmt.Errorf("failed to decode response body, %w", err), 3063 Snapshot: snapshot.Bytes(), 3064 } 3065 return err 3066 } 3067 3068 output := &types.ResourceNotFoundException{} 3069 err := awsAwsjson11_deserializeDocumentResourceNotFoundException(&output, shape) 3070 3071 if err != nil { 3072 var snapshot bytes.Buffer 3073 io.Copy(&snapshot, ringBuffer) 3074 err = &smithy.DeserializationError{ 3075 Err: fmt.Errorf("failed to decode response body, %w", err), 3076 Snapshot: snapshot.Bytes(), 3077 } 3078 return err 3079 } 3080 3081 errorBody.Seek(0, io.SeekStart) 3082 return output 3083} 3084 3085func awsAwsjson11_deserializeDocumentDecryptionFailure(v **types.DecryptionFailure, value interface{}) error { 3086 if v == nil { 3087 return fmt.Errorf("unexpected nil of type %T", v) 3088 } 3089 if value == nil { 3090 return nil 3091 } 3092 3093 shape, ok := value.(map[string]interface{}) 3094 if !ok { 3095 return fmt.Errorf("unexpected JSON type %v", value) 3096 } 3097 3098 var sv *types.DecryptionFailure 3099 if *v == nil { 3100 sv = &types.DecryptionFailure{} 3101 } else { 3102 sv = *v 3103 } 3104 3105 for key, value := range shape { 3106 switch key { 3107 case "Message": 3108 if value != nil { 3109 jtv, ok := value.(string) 3110 if !ok { 3111 return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) 3112 } 3113 sv.Message = ptr.String(jtv) 3114 } 3115 3116 default: 3117 _, _ = key, value 3118 3119 } 3120 } 3121 *v = sv 3122 return nil 3123} 3124 3125func awsAwsjson11_deserializeDocumentEncryptionFailure(v **types.EncryptionFailure, value interface{}) error { 3126 if v == nil { 3127 return fmt.Errorf("unexpected nil of type %T", v) 3128 } 3129 if value == nil { 3130 return nil 3131 } 3132 3133 shape, ok := value.(map[string]interface{}) 3134 if !ok { 3135 return fmt.Errorf("unexpected JSON type %v", value) 3136 } 3137 3138 var sv *types.EncryptionFailure 3139 if *v == nil { 3140 sv = &types.EncryptionFailure{} 3141 } else { 3142 sv = *v 3143 } 3144 3145 for key, value := range shape { 3146 switch key { 3147 case "Message": 3148 if value != nil { 3149 jtv, ok := value.(string) 3150 if !ok { 3151 return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) 3152 } 3153 sv.Message = ptr.String(jtv) 3154 } 3155 3156 default: 3157 _, _ = key, value 3158 3159 } 3160 } 3161 *v = sv 3162 return nil 3163} 3164 3165func awsAwsjson11_deserializeDocumentInternalServiceError(v **types.InternalServiceError, value interface{}) error { 3166 if v == nil { 3167 return fmt.Errorf("unexpected nil of type %T", v) 3168 } 3169 if value == nil { 3170 return nil 3171 } 3172 3173 shape, ok := value.(map[string]interface{}) 3174 if !ok { 3175 return fmt.Errorf("unexpected JSON type %v", value) 3176 } 3177 3178 var sv *types.InternalServiceError 3179 if *v == nil { 3180 sv = &types.InternalServiceError{} 3181 } else { 3182 sv = *v 3183 } 3184 3185 for key, value := range shape { 3186 switch key { 3187 case "Message": 3188 if value != nil { 3189 jtv, ok := value.(string) 3190 if !ok { 3191 return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) 3192 } 3193 sv.Message = ptr.String(jtv) 3194 } 3195 3196 default: 3197 _, _ = key, value 3198 3199 } 3200 } 3201 *v = sv 3202 return nil 3203} 3204 3205func awsAwsjson11_deserializeDocumentInvalidNextTokenException(v **types.InvalidNextTokenException, value interface{}) error { 3206 if v == nil { 3207 return fmt.Errorf("unexpected nil of type %T", v) 3208 } 3209 if value == nil { 3210 return nil 3211 } 3212 3213 shape, ok := value.(map[string]interface{}) 3214 if !ok { 3215 return fmt.Errorf("unexpected JSON type %v", value) 3216 } 3217 3218 var sv *types.InvalidNextTokenException 3219 if *v == nil { 3220 sv = &types.InvalidNextTokenException{} 3221 } else { 3222 sv = *v 3223 } 3224 3225 for key, value := range shape { 3226 switch key { 3227 case "Message": 3228 if value != nil { 3229 jtv, ok := value.(string) 3230 if !ok { 3231 return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) 3232 } 3233 sv.Message = ptr.String(jtv) 3234 } 3235 3236 default: 3237 _, _ = key, value 3238 3239 } 3240 } 3241 *v = sv 3242 return nil 3243} 3244 3245func awsAwsjson11_deserializeDocumentInvalidParameterException(v **types.InvalidParameterException, value interface{}) error { 3246 if v == nil { 3247 return fmt.Errorf("unexpected nil of type %T", v) 3248 } 3249 if value == nil { 3250 return nil 3251 } 3252 3253 shape, ok := value.(map[string]interface{}) 3254 if !ok { 3255 return fmt.Errorf("unexpected JSON type %v", value) 3256 } 3257 3258 var sv *types.InvalidParameterException 3259 if *v == nil { 3260 sv = &types.InvalidParameterException{} 3261 } else { 3262 sv = *v 3263 } 3264 3265 for key, value := range shape { 3266 switch key { 3267 case "Message": 3268 if value != nil { 3269 jtv, ok := value.(string) 3270 if !ok { 3271 return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) 3272 } 3273 sv.Message = ptr.String(jtv) 3274 } 3275 3276 default: 3277 _, _ = key, value 3278 3279 } 3280 } 3281 *v = sv 3282 return nil 3283} 3284 3285func awsAwsjson11_deserializeDocumentInvalidRequestException(v **types.InvalidRequestException, value interface{}) error { 3286 if v == nil { 3287 return fmt.Errorf("unexpected nil of type %T", v) 3288 } 3289 if value == nil { 3290 return nil 3291 } 3292 3293 shape, ok := value.(map[string]interface{}) 3294 if !ok { 3295 return fmt.Errorf("unexpected JSON type %v", value) 3296 } 3297 3298 var sv *types.InvalidRequestException 3299 if *v == nil { 3300 sv = &types.InvalidRequestException{} 3301 } else { 3302 sv = *v 3303 } 3304 3305 for key, value := range shape { 3306 switch key { 3307 case "Message": 3308 if value != nil { 3309 jtv, ok := value.(string) 3310 if !ok { 3311 return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) 3312 } 3313 sv.Message = ptr.String(jtv) 3314 } 3315 3316 default: 3317 _, _ = key, value 3318 3319 } 3320 } 3321 *v = sv 3322 return nil 3323} 3324 3325func awsAwsjson11_deserializeDocumentKmsKeyIdListType(v *[]string, value interface{}) error { 3326 if v == nil { 3327 return fmt.Errorf("unexpected nil of type %T", v) 3328 } 3329 if value == nil { 3330 return nil 3331 } 3332 3333 shape, ok := value.([]interface{}) 3334 if !ok { 3335 return fmt.Errorf("unexpected JSON type %v", value) 3336 } 3337 3338 var cv []string 3339 if *v == nil { 3340 cv = []string{} 3341 } else { 3342 cv = *v 3343 } 3344 3345 for _, value := range shape { 3346 var col string 3347 if value != nil { 3348 jtv, ok := value.(string) 3349 if !ok { 3350 return fmt.Errorf("expected KmsKeyIdType to be of type string, got %T instead", value) 3351 } 3352 col = jtv 3353 } 3354 cv = append(cv, col) 3355 3356 } 3357 *v = cv 3358 return nil 3359} 3360 3361func awsAwsjson11_deserializeDocumentLimitExceededException(v **types.LimitExceededException, value interface{}) error { 3362 if v == nil { 3363 return fmt.Errorf("unexpected nil of type %T", v) 3364 } 3365 if value == nil { 3366 return nil 3367 } 3368 3369 shape, ok := value.(map[string]interface{}) 3370 if !ok { 3371 return fmt.Errorf("unexpected JSON type %v", value) 3372 } 3373 3374 var sv *types.LimitExceededException 3375 if *v == nil { 3376 sv = &types.LimitExceededException{} 3377 } else { 3378 sv = *v 3379 } 3380 3381 for key, value := range shape { 3382 switch key { 3383 case "Message": 3384 if value != nil { 3385 jtv, ok := value.(string) 3386 if !ok { 3387 return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) 3388 } 3389 sv.Message = ptr.String(jtv) 3390 } 3391 3392 default: 3393 _, _ = key, value 3394 3395 } 3396 } 3397 *v = sv 3398 return nil 3399} 3400 3401func awsAwsjson11_deserializeDocumentMalformedPolicyDocumentException(v **types.MalformedPolicyDocumentException, value interface{}) error { 3402 if v == nil { 3403 return fmt.Errorf("unexpected nil of type %T", v) 3404 } 3405 if value == nil { 3406 return nil 3407 } 3408 3409 shape, ok := value.(map[string]interface{}) 3410 if !ok { 3411 return fmt.Errorf("unexpected JSON type %v", value) 3412 } 3413 3414 var sv *types.MalformedPolicyDocumentException 3415 if *v == nil { 3416 sv = &types.MalformedPolicyDocumentException{} 3417 } else { 3418 sv = *v 3419 } 3420 3421 for key, value := range shape { 3422 switch key { 3423 case "Message": 3424 if value != nil { 3425 jtv, ok := value.(string) 3426 if !ok { 3427 return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) 3428 } 3429 sv.Message = ptr.String(jtv) 3430 } 3431 3432 default: 3433 _, _ = key, value 3434 3435 } 3436 } 3437 *v = sv 3438 return nil 3439} 3440 3441func awsAwsjson11_deserializeDocumentPreconditionNotMetException(v **types.PreconditionNotMetException, value interface{}) error { 3442 if v == nil { 3443 return fmt.Errorf("unexpected nil of type %T", v) 3444 } 3445 if value == nil { 3446 return nil 3447 } 3448 3449 shape, ok := value.(map[string]interface{}) 3450 if !ok { 3451 return fmt.Errorf("unexpected JSON type %v", value) 3452 } 3453 3454 var sv *types.PreconditionNotMetException 3455 if *v == nil { 3456 sv = &types.PreconditionNotMetException{} 3457 } else { 3458 sv = *v 3459 } 3460 3461 for key, value := range shape { 3462 switch key { 3463 case "Message": 3464 if value != nil { 3465 jtv, ok := value.(string) 3466 if !ok { 3467 return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) 3468 } 3469 sv.Message = ptr.String(jtv) 3470 } 3471 3472 default: 3473 _, _ = key, value 3474 3475 } 3476 } 3477 *v = sv 3478 return nil 3479} 3480 3481func awsAwsjson11_deserializeDocumentPublicPolicyException(v **types.PublicPolicyException, value interface{}) error { 3482 if v == nil { 3483 return fmt.Errorf("unexpected nil of type %T", v) 3484 } 3485 if value == nil { 3486 return nil 3487 } 3488 3489 shape, ok := value.(map[string]interface{}) 3490 if !ok { 3491 return fmt.Errorf("unexpected JSON type %v", value) 3492 } 3493 3494 var sv *types.PublicPolicyException 3495 if *v == nil { 3496 sv = &types.PublicPolicyException{} 3497 } else { 3498 sv = *v 3499 } 3500 3501 for key, value := range shape { 3502 switch key { 3503 case "Message": 3504 if value != nil { 3505 jtv, ok := value.(string) 3506 if !ok { 3507 return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) 3508 } 3509 sv.Message = ptr.String(jtv) 3510 } 3511 3512 default: 3513 _, _ = key, value 3514 3515 } 3516 } 3517 *v = sv 3518 return nil 3519} 3520 3521func awsAwsjson11_deserializeDocumentReplicationStatusListType(v *[]types.ReplicationStatusType, value interface{}) error { 3522 if v == nil { 3523 return fmt.Errorf("unexpected nil of type %T", v) 3524 } 3525 if value == nil { 3526 return nil 3527 } 3528 3529 shape, ok := value.([]interface{}) 3530 if !ok { 3531 return fmt.Errorf("unexpected JSON type %v", value) 3532 } 3533 3534 var cv []types.ReplicationStatusType 3535 if *v == nil { 3536 cv = []types.ReplicationStatusType{} 3537 } else { 3538 cv = *v 3539 } 3540 3541 for _, value := range shape { 3542 var col types.ReplicationStatusType 3543 destAddr := &col 3544 if err := awsAwsjson11_deserializeDocumentReplicationStatusType(&destAddr, value); err != nil { 3545 return err 3546 } 3547 col = *destAddr 3548 cv = append(cv, col) 3549 3550 } 3551 *v = cv 3552 return nil 3553} 3554 3555func awsAwsjson11_deserializeDocumentReplicationStatusType(v **types.ReplicationStatusType, value interface{}) error { 3556 if v == nil { 3557 return fmt.Errorf("unexpected nil of type %T", v) 3558 } 3559 if value == nil { 3560 return nil 3561 } 3562 3563 shape, ok := value.(map[string]interface{}) 3564 if !ok { 3565 return fmt.Errorf("unexpected JSON type %v", value) 3566 } 3567 3568 var sv *types.ReplicationStatusType 3569 if *v == nil { 3570 sv = &types.ReplicationStatusType{} 3571 } else { 3572 sv = *v 3573 } 3574 3575 for key, value := range shape { 3576 switch key { 3577 case "KmsKeyId": 3578 if value != nil { 3579 jtv, ok := value.(string) 3580 if !ok { 3581 return fmt.Errorf("expected KmsKeyIdType to be of type string, got %T instead", value) 3582 } 3583 sv.KmsKeyId = ptr.String(jtv) 3584 } 3585 3586 case "LastAccessedDate": 3587 if value != nil { 3588 switch jtv := value.(type) { 3589 case json.Number: 3590 f64, err := jtv.Float64() 3591 if err != nil { 3592 return err 3593 } 3594 sv.LastAccessedDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) 3595 3596 default: 3597 return fmt.Errorf("expected LastAccessedDateType to be a JSON Number, got %T instead", value) 3598 3599 } 3600 } 3601 3602 case "Region": 3603 if value != nil { 3604 jtv, ok := value.(string) 3605 if !ok { 3606 return fmt.Errorf("expected RegionType to be of type string, got %T instead", value) 3607 } 3608 sv.Region = ptr.String(jtv) 3609 } 3610 3611 case "Status": 3612 if value != nil { 3613 jtv, ok := value.(string) 3614 if !ok { 3615 return fmt.Errorf("expected StatusType to be of type string, got %T instead", value) 3616 } 3617 sv.Status = types.StatusType(jtv) 3618 } 3619 3620 case "StatusMessage": 3621 if value != nil { 3622 jtv, ok := value.(string) 3623 if !ok { 3624 return fmt.Errorf("expected StatusMessageType to be of type string, got %T instead", value) 3625 } 3626 sv.StatusMessage = ptr.String(jtv) 3627 } 3628 3629 default: 3630 _, _ = key, value 3631 3632 } 3633 } 3634 *v = sv 3635 return nil 3636} 3637 3638func awsAwsjson11_deserializeDocumentResourceExistsException(v **types.ResourceExistsException, value interface{}) error { 3639 if v == nil { 3640 return fmt.Errorf("unexpected nil of type %T", v) 3641 } 3642 if value == nil { 3643 return nil 3644 } 3645 3646 shape, ok := value.(map[string]interface{}) 3647 if !ok { 3648 return fmt.Errorf("unexpected JSON type %v", value) 3649 } 3650 3651 var sv *types.ResourceExistsException 3652 if *v == nil { 3653 sv = &types.ResourceExistsException{} 3654 } else { 3655 sv = *v 3656 } 3657 3658 for key, value := range shape { 3659 switch key { 3660 case "Message": 3661 if value != nil { 3662 jtv, ok := value.(string) 3663 if !ok { 3664 return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) 3665 } 3666 sv.Message = ptr.String(jtv) 3667 } 3668 3669 default: 3670 _, _ = key, value 3671 3672 } 3673 } 3674 *v = sv 3675 return nil 3676} 3677 3678func awsAwsjson11_deserializeDocumentResourceNotFoundException(v **types.ResourceNotFoundException, value interface{}) error { 3679 if v == nil { 3680 return fmt.Errorf("unexpected nil of type %T", v) 3681 } 3682 if value == nil { 3683 return nil 3684 } 3685 3686 shape, ok := value.(map[string]interface{}) 3687 if !ok { 3688 return fmt.Errorf("unexpected JSON type %v", value) 3689 } 3690 3691 var sv *types.ResourceNotFoundException 3692 if *v == nil { 3693 sv = &types.ResourceNotFoundException{} 3694 } else { 3695 sv = *v 3696 } 3697 3698 for key, value := range shape { 3699 switch key { 3700 case "Message": 3701 if value != nil { 3702 jtv, ok := value.(string) 3703 if !ok { 3704 return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) 3705 } 3706 sv.Message = ptr.String(jtv) 3707 } 3708 3709 default: 3710 _, _ = key, value 3711 3712 } 3713 } 3714 *v = sv 3715 return nil 3716} 3717 3718func awsAwsjson11_deserializeDocumentRotationRulesType(v **types.RotationRulesType, value interface{}) error { 3719 if v == nil { 3720 return fmt.Errorf("unexpected nil of type %T", v) 3721 } 3722 if value == nil { 3723 return nil 3724 } 3725 3726 shape, ok := value.(map[string]interface{}) 3727 if !ok { 3728 return fmt.Errorf("unexpected JSON type %v", value) 3729 } 3730 3731 var sv *types.RotationRulesType 3732 if *v == nil { 3733 sv = &types.RotationRulesType{} 3734 } else { 3735 sv = *v 3736 } 3737 3738 for key, value := range shape { 3739 switch key { 3740 case "AutomaticallyAfterDays": 3741 if value != nil { 3742 jtv, ok := value.(json.Number) 3743 if !ok { 3744 return fmt.Errorf("expected AutomaticallyRotateAfterDaysType to be json.Number, got %T instead", value) 3745 } 3746 i64, err := jtv.Int64() 3747 if err != nil { 3748 return err 3749 } 3750 sv.AutomaticallyAfterDays = i64 3751 } 3752 3753 default: 3754 _, _ = key, value 3755 3756 } 3757 } 3758 *v = sv 3759 return nil 3760} 3761 3762func awsAwsjson11_deserializeDocumentSecretListEntry(v **types.SecretListEntry, value interface{}) error { 3763 if v == nil { 3764 return fmt.Errorf("unexpected nil of type %T", v) 3765 } 3766 if value == nil { 3767 return nil 3768 } 3769 3770 shape, ok := value.(map[string]interface{}) 3771 if !ok { 3772 return fmt.Errorf("unexpected JSON type %v", value) 3773 } 3774 3775 var sv *types.SecretListEntry 3776 if *v == nil { 3777 sv = &types.SecretListEntry{} 3778 } else { 3779 sv = *v 3780 } 3781 3782 for key, value := range shape { 3783 switch key { 3784 case "ARN": 3785 if value != nil { 3786 jtv, ok := value.(string) 3787 if !ok { 3788 return fmt.Errorf("expected SecretARNType to be of type string, got %T instead", value) 3789 } 3790 sv.ARN = ptr.String(jtv) 3791 } 3792 3793 case "CreatedDate": 3794 if value != nil { 3795 switch jtv := value.(type) { 3796 case json.Number: 3797 f64, err := jtv.Float64() 3798 if err != nil { 3799 return err 3800 } 3801 sv.CreatedDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) 3802 3803 default: 3804 return fmt.Errorf("expected TimestampType to be a JSON Number, got %T instead", value) 3805 3806 } 3807 } 3808 3809 case "DeletedDate": 3810 if value != nil { 3811 switch jtv := value.(type) { 3812 case json.Number: 3813 f64, err := jtv.Float64() 3814 if err != nil { 3815 return err 3816 } 3817 sv.DeletedDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) 3818 3819 default: 3820 return fmt.Errorf("expected DeletedDateType to be a JSON Number, got %T instead", value) 3821 3822 } 3823 } 3824 3825 case "Description": 3826 if value != nil { 3827 jtv, ok := value.(string) 3828 if !ok { 3829 return fmt.Errorf("expected DescriptionType to be of type string, got %T instead", value) 3830 } 3831 sv.Description = ptr.String(jtv) 3832 } 3833 3834 case "KmsKeyId": 3835 if value != nil { 3836 jtv, ok := value.(string) 3837 if !ok { 3838 return fmt.Errorf("expected KmsKeyIdType to be of type string, got %T instead", value) 3839 } 3840 sv.KmsKeyId = ptr.String(jtv) 3841 } 3842 3843 case "LastAccessedDate": 3844 if value != nil { 3845 switch jtv := value.(type) { 3846 case json.Number: 3847 f64, err := jtv.Float64() 3848 if err != nil { 3849 return err 3850 } 3851 sv.LastAccessedDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) 3852 3853 default: 3854 return fmt.Errorf("expected LastAccessedDateType to be a JSON Number, got %T instead", value) 3855 3856 } 3857 } 3858 3859 case "LastChangedDate": 3860 if value != nil { 3861 switch jtv := value.(type) { 3862 case json.Number: 3863 f64, err := jtv.Float64() 3864 if err != nil { 3865 return err 3866 } 3867 sv.LastChangedDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) 3868 3869 default: 3870 return fmt.Errorf("expected LastChangedDateType to be a JSON Number, got %T instead", value) 3871 3872 } 3873 } 3874 3875 case "LastRotatedDate": 3876 if value != nil { 3877 switch jtv := value.(type) { 3878 case json.Number: 3879 f64, err := jtv.Float64() 3880 if err != nil { 3881 return err 3882 } 3883 sv.LastRotatedDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) 3884 3885 default: 3886 return fmt.Errorf("expected LastRotatedDateType to be a JSON Number, got %T instead", value) 3887 3888 } 3889 } 3890 3891 case "Name": 3892 if value != nil { 3893 jtv, ok := value.(string) 3894 if !ok { 3895 return fmt.Errorf("expected SecretNameType to be of type string, got %T instead", value) 3896 } 3897 sv.Name = ptr.String(jtv) 3898 } 3899 3900 case "OwningService": 3901 if value != nil { 3902 jtv, ok := value.(string) 3903 if !ok { 3904 return fmt.Errorf("expected OwningServiceType to be of type string, got %T instead", value) 3905 } 3906 sv.OwningService = ptr.String(jtv) 3907 } 3908 3909 case "PrimaryRegion": 3910 if value != nil { 3911 jtv, ok := value.(string) 3912 if !ok { 3913 return fmt.Errorf("expected RegionType to be of type string, got %T instead", value) 3914 } 3915 sv.PrimaryRegion = ptr.String(jtv) 3916 } 3917 3918 case "RotationEnabled": 3919 if value != nil { 3920 jtv, ok := value.(bool) 3921 if !ok { 3922 return fmt.Errorf("expected RotationEnabledType to be of type *bool, got %T instead", value) 3923 } 3924 sv.RotationEnabled = jtv 3925 } 3926 3927 case "RotationLambdaARN": 3928 if value != nil { 3929 jtv, ok := value.(string) 3930 if !ok { 3931 return fmt.Errorf("expected RotationLambdaARNType to be of type string, got %T instead", value) 3932 } 3933 sv.RotationLambdaARN = ptr.String(jtv) 3934 } 3935 3936 case "RotationRules": 3937 if err := awsAwsjson11_deserializeDocumentRotationRulesType(&sv.RotationRules, value); err != nil { 3938 return err 3939 } 3940 3941 case "SecretVersionsToStages": 3942 if err := awsAwsjson11_deserializeDocumentSecretVersionsToStagesMapType(&sv.SecretVersionsToStages, value); err != nil { 3943 return err 3944 } 3945 3946 case "Tags": 3947 if err := awsAwsjson11_deserializeDocumentTagListType(&sv.Tags, value); err != nil { 3948 return err 3949 } 3950 3951 default: 3952 _, _ = key, value 3953 3954 } 3955 } 3956 *v = sv 3957 return nil 3958} 3959 3960func awsAwsjson11_deserializeDocumentSecretListType(v *[]types.SecretListEntry, value interface{}) error { 3961 if v == nil { 3962 return fmt.Errorf("unexpected nil of type %T", v) 3963 } 3964 if value == nil { 3965 return nil 3966 } 3967 3968 shape, ok := value.([]interface{}) 3969 if !ok { 3970 return fmt.Errorf("unexpected JSON type %v", value) 3971 } 3972 3973 var cv []types.SecretListEntry 3974 if *v == nil { 3975 cv = []types.SecretListEntry{} 3976 } else { 3977 cv = *v 3978 } 3979 3980 for _, value := range shape { 3981 var col types.SecretListEntry 3982 destAddr := &col 3983 if err := awsAwsjson11_deserializeDocumentSecretListEntry(&destAddr, value); err != nil { 3984 return err 3985 } 3986 col = *destAddr 3987 cv = append(cv, col) 3988 3989 } 3990 *v = cv 3991 return nil 3992} 3993 3994func awsAwsjson11_deserializeDocumentSecretVersionsListEntry(v **types.SecretVersionsListEntry, value interface{}) error { 3995 if v == nil { 3996 return fmt.Errorf("unexpected nil of type %T", v) 3997 } 3998 if value == nil { 3999 return nil 4000 } 4001 4002 shape, ok := value.(map[string]interface{}) 4003 if !ok { 4004 return fmt.Errorf("unexpected JSON type %v", value) 4005 } 4006 4007 var sv *types.SecretVersionsListEntry 4008 if *v == nil { 4009 sv = &types.SecretVersionsListEntry{} 4010 } else { 4011 sv = *v 4012 } 4013 4014 for key, value := range shape { 4015 switch key { 4016 case "CreatedDate": 4017 if value != nil { 4018 switch jtv := value.(type) { 4019 case json.Number: 4020 f64, err := jtv.Float64() 4021 if err != nil { 4022 return err 4023 } 4024 sv.CreatedDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) 4025 4026 default: 4027 return fmt.Errorf("expected CreatedDateType to be a JSON Number, got %T instead", value) 4028 4029 } 4030 } 4031 4032 case "KmsKeyIds": 4033 if err := awsAwsjson11_deserializeDocumentKmsKeyIdListType(&sv.KmsKeyIds, value); err != nil { 4034 return err 4035 } 4036 4037 case "LastAccessedDate": 4038 if value != nil { 4039 switch jtv := value.(type) { 4040 case json.Number: 4041 f64, err := jtv.Float64() 4042 if err != nil { 4043 return err 4044 } 4045 sv.LastAccessedDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) 4046 4047 default: 4048 return fmt.Errorf("expected LastAccessedDateType to be a JSON Number, got %T instead", value) 4049 4050 } 4051 } 4052 4053 case "VersionId": 4054 if value != nil { 4055 jtv, ok := value.(string) 4056 if !ok { 4057 return fmt.Errorf("expected SecretVersionIdType to be of type string, got %T instead", value) 4058 } 4059 sv.VersionId = ptr.String(jtv) 4060 } 4061 4062 case "VersionStages": 4063 if err := awsAwsjson11_deserializeDocumentSecretVersionStagesType(&sv.VersionStages, value); err != nil { 4064 return err 4065 } 4066 4067 default: 4068 _, _ = key, value 4069 4070 } 4071 } 4072 *v = sv 4073 return nil 4074} 4075 4076func awsAwsjson11_deserializeDocumentSecretVersionsListType(v *[]types.SecretVersionsListEntry, value interface{}) error { 4077 if v == nil { 4078 return fmt.Errorf("unexpected nil of type %T", v) 4079 } 4080 if value == nil { 4081 return nil 4082 } 4083 4084 shape, ok := value.([]interface{}) 4085 if !ok { 4086 return fmt.Errorf("unexpected JSON type %v", value) 4087 } 4088 4089 var cv []types.SecretVersionsListEntry 4090 if *v == nil { 4091 cv = []types.SecretVersionsListEntry{} 4092 } else { 4093 cv = *v 4094 } 4095 4096 for _, value := range shape { 4097 var col types.SecretVersionsListEntry 4098 destAddr := &col 4099 if err := awsAwsjson11_deserializeDocumentSecretVersionsListEntry(&destAddr, value); err != nil { 4100 return err 4101 } 4102 col = *destAddr 4103 cv = append(cv, col) 4104 4105 } 4106 *v = cv 4107 return nil 4108} 4109 4110func awsAwsjson11_deserializeDocumentSecretVersionStagesType(v *[]string, value interface{}) error { 4111 if v == nil { 4112 return fmt.Errorf("unexpected nil of type %T", v) 4113 } 4114 if value == nil { 4115 return nil 4116 } 4117 4118 shape, ok := value.([]interface{}) 4119 if !ok { 4120 return fmt.Errorf("unexpected JSON type %v", value) 4121 } 4122 4123 var cv []string 4124 if *v == nil { 4125 cv = []string{} 4126 } else { 4127 cv = *v 4128 } 4129 4130 for _, value := range shape { 4131 var col string 4132 if value != nil { 4133 jtv, ok := value.(string) 4134 if !ok { 4135 return fmt.Errorf("expected SecretVersionStageType to be of type string, got %T instead", value) 4136 } 4137 col = jtv 4138 } 4139 cv = append(cv, col) 4140 4141 } 4142 *v = cv 4143 return nil 4144} 4145 4146func awsAwsjson11_deserializeDocumentSecretVersionsToStagesMapType(v *map[string][]string, value interface{}) error { 4147 if v == nil { 4148 return fmt.Errorf("unexpected nil of type %T", v) 4149 } 4150 if value == nil { 4151 return nil 4152 } 4153 4154 shape, ok := value.(map[string]interface{}) 4155 if !ok { 4156 return fmt.Errorf("unexpected JSON type %v", value) 4157 } 4158 4159 var mv map[string][]string 4160 if *v == nil { 4161 mv = map[string][]string{} 4162 } else { 4163 mv = *v 4164 } 4165 4166 for key, value := range shape { 4167 var parsedVal []string 4168 mapVar := parsedVal 4169 if err := awsAwsjson11_deserializeDocumentSecretVersionStagesType(&mapVar, value); err != nil { 4170 return err 4171 } 4172 parsedVal = mapVar 4173 mv[key] = parsedVal 4174 4175 } 4176 *v = mv 4177 return nil 4178} 4179 4180func awsAwsjson11_deserializeDocumentTag(v **types.Tag, value interface{}) error { 4181 if v == nil { 4182 return fmt.Errorf("unexpected nil of type %T", v) 4183 } 4184 if value == nil { 4185 return nil 4186 } 4187 4188 shape, ok := value.(map[string]interface{}) 4189 if !ok { 4190 return fmt.Errorf("unexpected JSON type %v", value) 4191 } 4192 4193 var sv *types.Tag 4194 if *v == nil { 4195 sv = &types.Tag{} 4196 } else { 4197 sv = *v 4198 } 4199 4200 for key, value := range shape { 4201 switch key { 4202 case "Key": 4203 if value != nil { 4204 jtv, ok := value.(string) 4205 if !ok { 4206 return fmt.Errorf("expected TagKeyType to be of type string, got %T instead", value) 4207 } 4208 sv.Key = ptr.String(jtv) 4209 } 4210 4211 case "Value": 4212 if value != nil { 4213 jtv, ok := value.(string) 4214 if !ok { 4215 return fmt.Errorf("expected TagValueType to be of type string, got %T instead", value) 4216 } 4217 sv.Value = ptr.String(jtv) 4218 } 4219 4220 default: 4221 _, _ = key, value 4222 4223 } 4224 } 4225 *v = sv 4226 return nil 4227} 4228 4229func awsAwsjson11_deserializeDocumentTagListType(v *[]types.Tag, value interface{}) error { 4230 if v == nil { 4231 return fmt.Errorf("unexpected nil of type %T", v) 4232 } 4233 if value == nil { 4234 return nil 4235 } 4236 4237 shape, ok := value.([]interface{}) 4238 if !ok { 4239 return fmt.Errorf("unexpected JSON type %v", value) 4240 } 4241 4242 var cv []types.Tag 4243 if *v == nil { 4244 cv = []types.Tag{} 4245 } else { 4246 cv = *v 4247 } 4248 4249 for _, value := range shape { 4250 var col types.Tag 4251 destAddr := &col 4252 if err := awsAwsjson11_deserializeDocumentTag(&destAddr, value); err != nil { 4253 return err 4254 } 4255 col = *destAddr 4256 cv = append(cv, col) 4257 4258 } 4259 *v = cv 4260 return nil 4261} 4262 4263func awsAwsjson11_deserializeDocumentValidationErrorsEntry(v **types.ValidationErrorsEntry, value interface{}) error { 4264 if v == nil { 4265 return fmt.Errorf("unexpected nil of type %T", v) 4266 } 4267 if value == nil { 4268 return nil 4269 } 4270 4271 shape, ok := value.(map[string]interface{}) 4272 if !ok { 4273 return fmt.Errorf("unexpected JSON type %v", value) 4274 } 4275 4276 var sv *types.ValidationErrorsEntry 4277 if *v == nil { 4278 sv = &types.ValidationErrorsEntry{} 4279 } else { 4280 sv = *v 4281 } 4282 4283 for key, value := range shape { 4284 switch key { 4285 case "CheckName": 4286 if value != nil { 4287 jtv, ok := value.(string) 4288 if !ok { 4289 return fmt.Errorf("expected NameType to be of type string, got %T instead", value) 4290 } 4291 sv.CheckName = ptr.String(jtv) 4292 } 4293 4294 case "ErrorMessage": 4295 if value != nil { 4296 jtv, ok := value.(string) 4297 if !ok { 4298 return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) 4299 } 4300 sv.ErrorMessage = ptr.String(jtv) 4301 } 4302 4303 default: 4304 _, _ = key, value 4305 4306 } 4307 } 4308 *v = sv 4309 return nil 4310} 4311 4312func awsAwsjson11_deserializeDocumentValidationErrorsType(v *[]types.ValidationErrorsEntry, value interface{}) error { 4313 if v == nil { 4314 return fmt.Errorf("unexpected nil of type %T", v) 4315 } 4316 if value == nil { 4317 return nil 4318 } 4319 4320 shape, ok := value.([]interface{}) 4321 if !ok { 4322 return fmt.Errorf("unexpected JSON type %v", value) 4323 } 4324 4325 var cv []types.ValidationErrorsEntry 4326 if *v == nil { 4327 cv = []types.ValidationErrorsEntry{} 4328 } else { 4329 cv = *v 4330 } 4331 4332 for _, value := range shape { 4333 var col types.ValidationErrorsEntry 4334 destAddr := &col 4335 if err := awsAwsjson11_deserializeDocumentValidationErrorsEntry(&destAddr, value); err != nil { 4336 return err 4337 } 4338 col = *destAddr 4339 cv = append(cv, col) 4340 4341 } 4342 *v = cv 4343 return nil 4344} 4345 4346func awsAwsjson11_deserializeOpDocumentCancelRotateSecretOutput(v **CancelRotateSecretOutput, value interface{}) error { 4347 if v == nil { 4348 return fmt.Errorf("unexpected nil of type %T", v) 4349 } 4350 if value == nil { 4351 return nil 4352 } 4353 4354 shape, ok := value.(map[string]interface{}) 4355 if !ok { 4356 return fmt.Errorf("unexpected JSON type %v", value) 4357 } 4358 4359 var sv *CancelRotateSecretOutput 4360 if *v == nil { 4361 sv = &CancelRotateSecretOutput{} 4362 } else { 4363 sv = *v 4364 } 4365 4366 for key, value := range shape { 4367 switch key { 4368 case "ARN": 4369 if value != nil { 4370 jtv, ok := value.(string) 4371 if !ok { 4372 return fmt.Errorf("expected SecretARNType to be of type string, got %T instead", value) 4373 } 4374 sv.ARN = ptr.String(jtv) 4375 } 4376 4377 case "Name": 4378 if value != nil { 4379 jtv, ok := value.(string) 4380 if !ok { 4381 return fmt.Errorf("expected SecretNameType to be of type string, got %T instead", value) 4382 } 4383 sv.Name = ptr.String(jtv) 4384 } 4385 4386 case "VersionId": 4387 if value != nil { 4388 jtv, ok := value.(string) 4389 if !ok { 4390 return fmt.Errorf("expected SecretVersionIdType to be of type string, got %T instead", value) 4391 } 4392 sv.VersionId = ptr.String(jtv) 4393 } 4394 4395 default: 4396 _, _ = key, value 4397 4398 } 4399 } 4400 *v = sv 4401 return nil 4402} 4403 4404func awsAwsjson11_deserializeOpDocumentCreateSecretOutput(v **CreateSecretOutput, value interface{}) error { 4405 if v == nil { 4406 return fmt.Errorf("unexpected nil of type %T", v) 4407 } 4408 if value == nil { 4409 return nil 4410 } 4411 4412 shape, ok := value.(map[string]interface{}) 4413 if !ok { 4414 return fmt.Errorf("unexpected JSON type %v", value) 4415 } 4416 4417 var sv *CreateSecretOutput 4418 if *v == nil { 4419 sv = &CreateSecretOutput{} 4420 } else { 4421 sv = *v 4422 } 4423 4424 for key, value := range shape { 4425 switch key { 4426 case "ARN": 4427 if value != nil { 4428 jtv, ok := value.(string) 4429 if !ok { 4430 return fmt.Errorf("expected SecretARNType to be of type string, got %T instead", value) 4431 } 4432 sv.ARN = ptr.String(jtv) 4433 } 4434 4435 case "Name": 4436 if value != nil { 4437 jtv, ok := value.(string) 4438 if !ok { 4439 return fmt.Errorf("expected SecretNameType to be of type string, got %T instead", value) 4440 } 4441 sv.Name = ptr.String(jtv) 4442 } 4443 4444 case "ReplicationStatus": 4445 if err := awsAwsjson11_deserializeDocumentReplicationStatusListType(&sv.ReplicationStatus, value); err != nil { 4446 return err 4447 } 4448 4449 case "VersionId": 4450 if value != nil { 4451 jtv, ok := value.(string) 4452 if !ok { 4453 return fmt.Errorf("expected SecretVersionIdType to be of type string, got %T instead", value) 4454 } 4455 sv.VersionId = ptr.String(jtv) 4456 } 4457 4458 default: 4459 _, _ = key, value 4460 4461 } 4462 } 4463 *v = sv 4464 return nil 4465} 4466 4467func awsAwsjson11_deserializeOpDocumentDeleteResourcePolicyOutput(v **DeleteResourcePolicyOutput, value interface{}) error { 4468 if v == nil { 4469 return fmt.Errorf("unexpected nil of type %T", v) 4470 } 4471 if value == nil { 4472 return nil 4473 } 4474 4475 shape, ok := value.(map[string]interface{}) 4476 if !ok { 4477 return fmt.Errorf("unexpected JSON type %v", value) 4478 } 4479 4480 var sv *DeleteResourcePolicyOutput 4481 if *v == nil { 4482 sv = &DeleteResourcePolicyOutput{} 4483 } else { 4484 sv = *v 4485 } 4486 4487 for key, value := range shape { 4488 switch key { 4489 case "ARN": 4490 if value != nil { 4491 jtv, ok := value.(string) 4492 if !ok { 4493 return fmt.Errorf("expected SecretARNType to be of type string, got %T instead", value) 4494 } 4495 sv.ARN = ptr.String(jtv) 4496 } 4497 4498 case "Name": 4499 if value != nil { 4500 jtv, ok := value.(string) 4501 if !ok { 4502 return fmt.Errorf("expected NameType to be of type string, got %T instead", value) 4503 } 4504 sv.Name = ptr.String(jtv) 4505 } 4506 4507 default: 4508 _, _ = key, value 4509 4510 } 4511 } 4512 *v = sv 4513 return nil 4514} 4515 4516func awsAwsjson11_deserializeOpDocumentDeleteSecretOutput(v **DeleteSecretOutput, value interface{}) error { 4517 if v == nil { 4518 return fmt.Errorf("unexpected nil of type %T", v) 4519 } 4520 if value == nil { 4521 return nil 4522 } 4523 4524 shape, ok := value.(map[string]interface{}) 4525 if !ok { 4526 return fmt.Errorf("unexpected JSON type %v", value) 4527 } 4528 4529 var sv *DeleteSecretOutput 4530 if *v == nil { 4531 sv = &DeleteSecretOutput{} 4532 } else { 4533 sv = *v 4534 } 4535 4536 for key, value := range shape { 4537 switch key { 4538 case "ARN": 4539 if value != nil { 4540 jtv, ok := value.(string) 4541 if !ok { 4542 return fmt.Errorf("expected SecretARNType to be of type string, got %T instead", value) 4543 } 4544 sv.ARN = ptr.String(jtv) 4545 } 4546 4547 case "DeletionDate": 4548 if value != nil { 4549 switch jtv := value.(type) { 4550 case json.Number: 4551 f64, err := jtv.Float64() 4552 if err != nil { 4553 return err 4554 } 4555 sv.DeletionDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) 4556 4557 default: 4558 return fmt.Errorf("expected DeletionDateType to be a JSON Number, got %T instead", value) 4559 4560 } 4561 } 4562 4563 case "Name": 4564 if value != nil { 4565 jtv, ok := value.(string) 4566 if !ok { 4567 return fmt.Errorf("expected SecretNameType to be of type string, got %T instead", value) 4568 } 4569 sv.Name = ptr.String(jtv) 4570 } 4571 4572 default: 4573 _, _ = key, value 4574 4575 } 4576 } 4577 *v = sv 4578 return nil 4579} 4580 4581func awsAwsjson11_deserializeOpDocumentDescribeSecretOutput(v **DescribeSecretOutput, value interface{}) error { 4582 if v == nil { 4583 return fmt.Errorf("unexpected nil of type %T", v) 4584 } 4585 if value == nil { 4586 return nil 4587 } 4588 4589 shape, ok := value.(map[string]interface{}) 4590 if !ok { 4591 return fmt.Errorf("unexpected JSON type %v", value) 4592 } 4593 4594 var sv *DescribeSecretOutput 4595 if *v == nil { 4596 sv = &DescribeSecretOutput{} 4597 } else { 4598 sv = *v 4599 } 4600 4601 for key, value := range shape { 4602 switch key { 4603 case "ARN": 4604 if value != nil { 4605 jtv, ok := value.(string) 4606 if !ok { 4607 return fmt.Errorf("expected SecretARNType to be of type string, got %T instead", value) 4608 } 4609 sv.ARN = ptr.String(jtv) 4610 } 4611 4612 case "CreatedDate": 4613 if value != nil { 4614 switch jtv := value.(type) { 4615 case json.Number: 4616 f64, err := jtv.Float64() 4617 if err != nil { 4618 return err 4619 } 4620 sv.CreatedDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) 4621 4622 default: 4623 return fmt.Errorf("expected TimestampType to be a JSON Number, got %T instead", value) 4624 4625 } 4626 } 4627 4628 case "DeletedDate": 4629 if value != nil { 4630 switch jtv := value.(type) { 4631 case json.Number: 4632 f64, err := jtv.Float64() 4633 if err != nil { 4634 return err 4635 } 4636 sv.DeletedDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) 4637 4638 default: 4639 return fmt.Errorf("expected DeletedDateType to be a JSON Number, got %T instead", value) 4640 4641 } 4642 } 4643 4644 case "Description": 4645 if value != nil { 4646 jtv, ok := value.(string) 4647 if !ok { 4648 return fmt.Errorf("expected DescriptionType to be of type string, got %T instead", value) 4649 } 4650 sv.Description = ptr.String(jtv) 4651 } 4652 4653 case "KmsKeyId": 4654 if value != nil { 4655 jtv, ok := value.(string) 4656 if !ok { 4657 return fmt.Errorf("expected KmsKeyIdType to be of type string, got %T instead", value) 4658 } 4659 sv.KmsKeyId = ptr.String(jtv) 4660 } 4661 4662 case "LastAccessedDate": 4663 if value != nil { 4664 switch jtv := value.(type) { 4665 case json.Number: 4666 f64, err := jtv.Float64() 4667 if err != nil { 4668 return err 4669 } 4670 sv.LastAccessedDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) 4671 4672 default: 4673 return fmt.Errorf("expected LastAccessedDateType to be a JSON Number, got %T instead", value) 4674 4675 } 4676 } 4677 4678 case "LastChangedDate": 4679 if value != nil { 4680 switch jtv := value.(type) { 4681 case json.Number: 4682 f64, err := jtv.Float64() 4683 if err != nil { 4684 return err 4685 } 4686 sv.LastChangedDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) 4687 4688 default: 4689 return fmt.Errorf("expected LastChangedDateType to be a JSON Number, got %T instead", value) 4690 4691 } 4692 } 4693 4694 case "LastRotatedDate": 4695 if value != nil { 4696 switch jtv := value.(type) { 4697 case json.Number: 4698 f64, err := jtv.Float64() 4699 if err != nil { 4700 return err 4701 } 4702 sv.LastRotatedDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) 4703 4704 default: 4705 return fmt.Errorf("expected LastRotatedDateType to be a JSON Number, got %T instead", value) 4706 4707 } 4708 } 4709 4710 case "Name": 4711 if value != nil { 4712 jtv, ok := value.(string) 4713 if !ok { 4714 return fmt.Errorf("expected SecretNameType to be of type string, got %T instead", value) 4715 } 4716 sv.Name = ptr.String(jtv) 4717 } 4718 4719 case "OwningService": 4720 if value != nil { 4721 jtv, ok := value.(string) 4722 if !ok { 4723 return fmt.Errorf("expected OwningServiceType to be of type string, got %T instead", value) 4724 } 4725 sv.OwningService = ptr.String(jtv) 4726 } 4727 4728 case "PrimaryRegion": 4729 if value != nil { 4730 jtv, ok := value.(string) 4731 if !ok { 4732 return fmt.Errorf("expected RegionType to be of type string, got %T instead", value) 4733 } 4734 sv.PrimaryRegion = ptr.String(jtv) 4735 } 4736 4737 case "ReplicationStatus": 4738 if err := awsAwsjson11_deserializeDocumentReplicationStatusListType(&sv.ReplicationStatus, value); err != nil { 4739 return err 4740 } 4741 4742 case "RotationEnabled": 4743 if value != nil { 4744 jtv, ok := value.(bool) 4745 if !ok { 4746 return fmt.Errorf("expected RotationEnabledType to be of type *bool, got %T instead", value) 4747 } 4748 sv.RotationEnabled = jtv 4749 } 4750 4751 case "RotationLambdaARN": 4752 if value != nil { 4753 jtv, ok := value.(string) 4754 if !ok { 4755 return fmt.Errorf("expected RotationLambdaARNType to be of type string, got %T instead", value) 4756 } 4757 sv.RotationLambdaARN = ptr.String(jtv) 4758 } 4759 4760 case "RotationRules": 4761 if err := awsAwsjson11_deserializeDocumentRotationRulesType(&sv.RotationRules, value); err != nil { 4762 return err 4763 } 4764 4765 case "Tags": 4766 if err := awsAwsjson11_deserializeDocumentTagListType(&sv.Tags, value); err != nil { 4767 return err 4768 } 4769 4770 case "VersionIdsToStages": 4771 if err := awsAwsjson11_deserializeDocumentSecretVersionsToStagesMapType(&sv.VersionIdsToStages, value); err != nil { 4772 return err 4773 } 4774 4775 default: 4776 _, _ = key, value 4777 4778 } 4779 } 4780 *v = sv 4781 return nil 4782} 4783 4784func awsAwsjson11_deserializeOpDocumentGetRandomPasswordOutput(v **GetRandomPasswordOutput, value interface{}) error { 4785 if v == nil { 4786 return fmt.Errorf("unexpected nil of type %T", v) 4787 } 4788 if value == nil { 4789 return nil 4790 } 4791 4792 shape, ok := value.(map[string]interface{}) 4793 if !ok { 4794 return fmt.Errorf("unexpected JSON type %v", value) 4795 } 4796 4797 var sv *GetRandomPasswordOutput 4798 if *v == nil { 4799 sv = &GetRandomPasswordOutput{} 4800 } else { 4801 sv = *v 4802 } 4803 4804 for key, value := range shape { 4805 switch key { 4806 case "RandomPassword": 4807 if value != nil { 4808 jtv, ok := value.(string) 4809 if !ok { 4810 return fmt.Errorf("expected RandomPasswordType to be of type string, got %T instead", value) 4811 } 4812 sv.RandomPassword = ptr.String(jtv) 4813 } 4814 4815 default: 4816 _, _ = key, value 4817 4818 } 4819 } 4820 *v = sv 4821 return nil 4822} 4823 4824func awsAwsjson11_deserializeOpDocumentGetResourcePolicyOutput(v **GetResourcePolicyOutput, value interface{}) error { 4825 if v == nil { 4826 return fmt.Errorf("unexpected nil of type %T", v) 4827 } 4828 if value == nil { 4829 return nil 4830 } 4831 4832 shape, ok := value.(map[string]interface{}) 4833 if !ok { 4834 return fmt.Errorf("unexpected JSON type %v", value) 4835 } 4836 4837 var sv *GetResourcePolicyOutput 4838 if *v == nil { 4839 sv = &GetResourcePolicyOutput{} 4840 } else { 4841 sv = *v 4842 } 4843 4844 for key, value := range shape { 4845 switch key { 4846 case "ARN": 4847 if value != nil { 4848 jtv, ok := value.(string) 4849 if !ok { 4850 return fmt.Errorf("expected SecretARNType to be of type string, got %T instead", value) 4851 } 4852 sv.ARN = ptr.String(jtv) 4853 } 4854 4855 case "Name": 4856 if value != nil { 4857 jtv, ok := value.(string) 4858 if !ok { 4859 return fmt.Errorf("expected NameType to be of type string, got %T instead", value) 4860 } 4861 sv.Name = ptr.String(jtv) 4862 } 4863 4864 case "ResourcePolicy": 4865 if value != nil { 4866 jtv, ok := value.(string) 4867 if !ok { 4868 return fmt.Errorf("expected NonEmptyResourcePolicyType to be of type string, got %T instead", value) 4869 } 4870 sv.ResourcePolicy = ptr.String(jtv) 4871 } 4872 4873 default: 4874 _, _ = key, value 4875 4876 } 4877 } 4878 *v = sv 4879 return nil 4880} 4881 4882func awsAwsjson11_deserializeOpDocumentGetSecretValueOutput(v **GetSecretValueOutput, value interface{}) error { 4883 if v == nil { 4884 return fmt.Errorf("unexpected nil of type %T", v) 4885 } 4886 if value == nil { 4887 return nil 4888 } 4889 4890 shape, ok := value.(map[string]interface{}) 4891 if !ok { 4892 return fmt.Errorf("unexpected JSON type %v", value) 4893 } 4894 4895 var sv *GetSecretValueOutput 4896 if *v == nil { 4897 sv = &GetSecretValueOutput{} 4898 } else { 4899 sv = *v 4900 } 4901 4902 for key, value := range shape { 4903 switch key { 4904 case "ARN": 4905 if value != nil { 4906 jtv, ok := value.(string) 4907 if !ok { 4908 return fmt.Errorf("expected SecretARNType to be of type string, got %T instead", value) 4909 } 4910 sv.ARN = ptr.String(jtv) 4911 } 4912 4913 case "CreatedDate": 4914 if value != nil { 4915 switch jtv := value.(type) { 4916 case json.Number: 4917 f64, err := jtv.Float64() 4918 if err != nil { 4919 return err 4920 } 4921 sv.CreatedDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) 4922 4923 default: 4924 return fmt.Errorf("expected CreatedDateType to be a JSON Number, got %T instead", value) 4925 4926 } 4927 } 4928 4929 case "Name": 4930 if value != nil { 4931 jtv, ok := value.(string) 4932 if !ok { 4933 return fmt.Errorf("expected SecretNameType to be of type string, got %T instead", value) 4934 } 4935 sv.Name = ptr.String(jtv) 4936 } 4937 4938 case "SecretBinary": 4939 if value != nil { 4940 jtv, ok := value.(string) 4941 if !ok { 4942 return fmt.Errorf("expected SecretBinaryType to be []byte, got %T instead", value) 4943 } 4944 dv, err := base64.StdEncoding.DecodeString(jtv) 4945 if err != nil { 4946 return fmt.Errorf("failed to base64 decode SecretBinaryType, %w", err) 4947 } 4948 sv.SecretBinary = dv 4949 } 4950 4951 case "SecretString": 4952 if value != nil { 4953 jtv, ok := value.(string) 4954 if !ok { 4955 return fmt.Errorf("expected SecretStringType to be of type string, got %T instead", value) 4956 } 4957 sv.SecretString = ptr.String(jtv) 4958 } 4959 4960 case "VersionId": 4961 if value != nil { 4962 jtv, ok := value.(string) 4963 if !ok { 4964 return fmt.Errorf("expected SecretVersionIdType to be of type string, got %T instead", value) 4965 } 4966 sv.VersionId = ptr.String(jtv) 4967 } 4968 4969 case "VersionStages": 4970 if err := awsAwsjson11_deserializeDocumentSecretVersionStagesType(&sv.VersionStages, value); err != nil { 4971 return err 4972 } 4973 4974 default: 4975 _, _ = key, value 4976 4977 } 4978 } 4979 *v = sv 4980 return nil 4981} 4982 4983func awsAwsjson11_deserializeOpDocumentListSecretsOutput(v **ListSecretsOutput, value interface{}) error { 4984 if v == nil { 4985 return fmt.Errorf("unexpected nil of type %T", v) 4986 } 4987 if value == nil { 4988 return nil 4989 } 4990 4991 shape, ok := value.(map[string]interface{}) 4992 if !ok { 4993 return fmt.Errorf("unexpected JSON type %v", value) 4994 } 4995 4996 var sv *ListSecretsOutput 4997 if *v == nil { 4998 sv = &ListSecretsOutput{} 4999 } else { 5000 sv = *v 5001 } 5002 5003 for key, value := range shape { 5004 switch key { 5005 case "NextToken": 5006 if value != nil { 5007 jtv, ok := value.(string) 5008 if !ok { 5009 return fmt.Errorf("expected NextTokenType to be of type string, got %T instead", value) 5010 } 5011 sv.NextToken = ptr.String(jtv) 5012 } 5013 5014 case "SecretList": 5015 if err := awsAwsjson11_deserializeDocumentSecretListType(&sv.SecretList, value); err != nil { 5016 return err 5017 } 5018 5019 default: 5020 _, _ = key, value 5021 5022 } 5023 } 5024 *v = sv 5025 return nil 5026} 5027 5028func awsAwsjson11_deserializeOpDocumentListSecretVersionIdsOutput(v **ListSecretVersionIdsOutput, value interface{}) error { 5029 if v == nil { 5030 return fmt.Errorf("unexpected nil of type %T", v) 5031 } 5032 if value == nil { 5033 return nil 5034 } 5035 5036 shape, ok := value.(map[string]interface{}) 5037 if !ok { 5038 return fmt.Errorf("unexpected JSON type %v", value) 5039 } 5040 5041 var sv *ListSecretVersionIdsOutput 5042 if *v == nil { 5043 sv = &ListSecretVersionIdsOutput{} 5044 } else { 5045 sv = *v 5046 } 5047 5048 for key, value := range shape { 5049 switch key { 5050 case "ARN": 5051 if value != nil { 5052 jtv, ok := value.(string) 5053 if !ok { 5054 return fmt.Errorf("expected SecretARNType to be of type string, got %T instead", value) 5055 } 5056 sv.ARN = ptr.String(jtv) 5057 } 5058 5059 case "Name": 5060 if value != nil { 5061 jtv, ok := value.(string) 5062 if !ok { 5063 return fmt.Errorf("expected SecretNameType to be of type string, got %T instead", value) 5064 } 5065 sv.Name = ptr.String(jtv) 5066 } 5067 5068 case "NextToken": 5069 if value != nil { 5070 jtv, ok := value.(string) 5071 if !ok { 5072 return fmt.Errorf("expected NextTokenType to be of type string, got %T instead", value) 5073 } 5074 sv.NextToken = ptr.String(jtv) 5075 } 5076 5077 case "Versions": 5078 if err := awsAwsjson11_deserializeDocumentSecretVersionsListType(&sv.Versions, value); err != nil { 5079 return err 5080 } 5081 5082 default: 5083 _, _ = key, value 5084 5085 } 5086 } 5087 *v = sv 5088 return nil 5089} 5090 5091func awsAwsjson11_deserializeOpDocumentPutResourcePolicyOutput(v **PutResourcePolicyOutput, value interface{}) error { 5092 if v == nil { 5093 return fmt.Errorf("unexpected nil of type %T", v) 5094 } 5095 if value == nil { 5096 return nil 5097 } 5098 5099 shape, ok := value.(map[string]interface{}) 5100 if !ok { 5101 return fmt.Errorf("unexpected JSON type %v", value) 5102 } 5103 5104 var sv *PutResourcePolicyOutput 5105 if *v == nil { 5106 sv = &PutResourcePolicyOutput{} 5107 } else { 5108 sv = *v 5109 } 5110 5111 for key, value := range shape { 5112 switch key { 5113 case "ARN": 5114 if value != nil { 5115 jtv, ok := value.(string) 5116 if !ok { 5117 return fmt.Errorf("expected SecretARNType to be of type string, got %T instead", value) 5118 } 5119 sv.ARN = ptr.String(jtv) 5120 } 5121 5122 case "Name": 5123 if value != nil { 5124 jtv, ok := value.(string) 5125 if !ok { 5126 return fmt.Errorf("expected NameType to be of type string, got %T instead", value) 5127 } 5128 sv.Name = ptr.String(jtv) 5129 } 5130 5131 default: 5132 _, _ = key, value 5133 5134 } 5135 } 5136 *v = sv 5137 return nil 5138} 5139 5140func awsAwsjson11_deserializeOpDocumentPutSecretValueOutput(v **PutSecretValueOutput, value interface{}) error { 5141 if v == nil { 5142 return fmt.Errorf("unexpected nil of type %T", v) 5143 } 5144 if value == nil { 5145 return nil 5146 } 5147 5148 shape, ok := value.(map[string]interface{}) 5149 if !ok { 5150 return fmt.Errorf("unexpected JSON type %v", value) 5151 } 5152 5153 var sv *PutSecretValueOutput 5154 if *v == nil { 5155 sv = &PutSecretValueOutput{} 5156 } else { 5157 sv = *v 5158 } 5159 5160 for key, value := range shape { 5161 switch key { 5162 case "ARN": 5163 if value != nil { 5164 jtv, ok := value.(string) 5165 if !ok { 5166 return fmt.Errorf("expected SecretARNType to be of type string, got %T instead", value) 5167 } 5168 sv.ARN = ptr.String(jtv) 5169 } 5170 5171 case "Name": 5172 if value != nil { 5173 jtv, ok := value.(string) 5174 if !ok { 5175 return fmt.Errorf("expected SecretNameType to be of type string, got %T instead", value) 5176 } 5177 sv.Name = ptr.String(jtv) 5178 } 5179 5180 case "VersionId": 5181 if value != nil { 5182 jtv, ok := value.(string) 5183 if !ok { 5184 return fmt.Errorf("expected SecretVersionIdType to be of type string, got %T instead", value) 5185 } 5186 sv.VersionId = ptr.String(jtv) 5187 } 5188 5189 case "VersionStages": 5190 if err := awsAwsjson11_deserializeDocumentSecretVersionStagesType(&sv.VersionStages, value); err != nil { 5191 return err 5192 } 5193 5194 default: 5195 _, _ = key, value 5196 5197 } 5198 } 5199 *v = sv 5200 return nil 5201} 5202 5203func awsAwsjson11_deserializeOpDocumentRemoveRegionsFromReplicationOutput(v **RemoveRegionsFromReplicationOutput, value interface{}) error { 5204 if v == nil { 5205 return fmt.Errorf("unexpected nil of type %T", v) 5206 } 5207 if value == nil { 5208 return nil 5209 } 5210 5211 shape, ok := value.(map[string]interface{}) 5212 if !ok { 5213 return fmt.Errorf("unexpected JSON type %v", value) 5214 } 5215 5216 var sv *RemoveRegionsFromReplicationOutput 5217 if *v == nil { 5218 sv = &RemoveRegionsFromReplicationOutput{} 5219 } else { 5220 sv = *v 5221 } 5222 5223 for key, value := range shape { 5224 switch key { 5225 case "ARN": 5226 if value != nil { 5227 jtv, ok := value.(string) 5228 if !ok { 5229 return fmt.Errorf("expected SecretARNType to be of type string, got %T instead", value) 5230 } 5231 sv.ARN = ptr.String(jtv) 5232 } 5233 5234 case "ReplicationStatus": 5235 if err := awsAwsjson11_deserializeDocumentReplicationStatusListType(&sv.ReplicationStatus, value); err != nil { 5236 return err 5237 } 5238 5239 default: 5240 _, _ = key, value 5241 5242 } 5243 } 5244 *v = sv 5245 return nil 5246} 5247 5248func awsAwsjson11_deserializeOpDocumentReplicateSecretToRegionsOutput(v **ReplicateSecretToRegionsOutput, value interface{}) error { 5249 if v == nil { 5250 return fmt.Errorf("unexpected nil of type %T", v) 5251 } 5252 if value == nil { 5253 return nil 5254 } 5255 5256 shape, ok := value.(map[string]interface{}) 5257 if !ok { 5258 return fmt.Errorf("unexpected JSON type %v", value) 5259 } 5260 5261 var sv *ReplicateSecretToRegionsOutput 5262 if *v == nil { 5263 sv = &ReplicateSecretToRegionsOutput{} 5264 } else { 5265 sv = *v 5266 } 5267 5268 for key, value := range shape { 5269 switch key { 5270 case "ARN": 5271 if value != nil { 5272 jtv, ok := value.(string) 5273 if !ok { 5274 return fmt.Errorf("expected SecretARNType to be of type string, got %T instead", value) 5275 } 5276 sv.ARN = ptr.String(jtv) 5277 } 5278 5279 case "ReplicationStatus": 5280 if err := awsAwsjson11_deserializeDocumentReplicationStatusListType(&sv.ReplicationStatus, value); err != nil { 5281 return err 5282 } 5283 5284 default: 5285 _, _ = key, value 5286 5287 } 5288 } 5289 *v = sv 5290 return nil 5291} 5292 5293func awsAwsjson11_deserializeOpDocumentRestoreSecretOutput(v **RestoreSecretOutput, value interface{}) error { 5294 if v == nil { 5295 return fmt.Errorf("unexpected nil of type %T", v) 5296 } 5297 if value == nil { 5298 return nil 5299 } 5300 5301 shape, ok := value.(map[string]interface{}) 5302 if !ok { 5303 return fmt.Errorf("unexpected JSON type %v", value) 5304 } 5305 5306 var sv *RestoreSecretOutput 5307 if *v == nil { 5308 sv = &RestoreSecretOutput{} 5309 } else { 5310 sv = *v 5311 } 5312 5313 for key, value := range shape { 5314 switch key { 5315 case "ARN": 5316 if value != nil { 5317 jtv, ok := value.(string) 5318 if !ok { 5319 return fmt.Errorf("expected SecretARNType to be of type string, got %T instead", value) 5320 } 5321 sv.ARN = ptr.String(jtv) 5322 } 5323 5324 case "Name": 5325 if value != nil { 5326 jtv, ok := value.(string) 5327 if !ok { 5328 return fmt.Errorf("expected SecretNameType to be of type string, got %T instead", value) 5329 } 5330 sv.Name = ptr.String(jtv) 5331 } 5332 5333 default: 5334 _, _ = key, value 5335 5336 } 5337 } 5338 *v = sv 5339 return nil 5340} 5341 5342func awsAwsjson11_deserializeOpDocumentRotateSecretOutput(v **RotateSecretOutput, value interface{}) error { 5343 if v == nil { 5344 return fmt.Errorf("unexpected nil of type %T", v) 5345 } 5346 if value == nil { 5347 return nil 5348 } 5349 5350 shape, ok := value.(map[string]interface{}) 5351 if !ok { 5352 return fmt.Errorf("unexpected JSON type %v", value) 5353 } 5354 5355 var sv *RotateSecretOutput 5356 if *v == nil { 5357 sv = &RotateSecretOutput{} 5358 } else { 5359 sv = *v 5360 } 5361 5362 for key, value := range shape { 5363 switch key { 5364 case "ARN": 5365 if value != nil { 5366 jtv, ok := value.(string) 5367 if !ok { 5368 return fmt.Errorf("expected SecretARNType to be of type string, got %T instead", value) 5369 } 5370 sv.ARN = ptr.String(jtv) 5371 } 5372 5373 case "Name": 5374 if value != nil { 5375 jtv, ok := value.(string) 5376 if !ok { 5377 return fmt.Errorf("expected SecretNameType to be of type string, got %T instead", value) 5378 } 5379 sv.Name = ptr.String(jtv) 5380 } 5381 5382 case "VersionId": 5383 if value != nil { 5384 jtv, ok := value.(string) 5385 if !ok { 5386 return fmt.Errorf("expected SecretVersionIdType to be of type string, got %T instead", value) 5387 } 5388 sv.VersionId = ptr.String(jtv) 5389 } 5390 5391 default: 5392 _, _ = key, value 5393 5394 } 5395 } 5396 *v = sv 5397 return nil 5398} 5399 5400func awsAwsjson11_deserializeOpDocumentStopReplicationToReplicaOutput(v **StopReplicationToReplicaOutput, value interface{}) error { 5401 if v == nil { 5402 return fmt.Errorf("unexpected nil of type %T", v) 5403 } 5404 if value == nil { 5405 return nil 5406 } 5407 5408 shape, ok := value.(map[string]interface{}) 5409 if !ok { 5410 return fmt.Errorf("unexpected JSON type %v", value) 5411 } 5412 5413 var sv *StopReplicationToReplicaOutput 5414 if *v == nil { 5415 sv = &StopReplicationToReplicaOutput{} 5416 } else { 5417 sv = *v 5418 } 5419 5420 for key, value := range shape { 5421 switch key { 5422 case "ARN": 5423 if value != nil { 5424 jtv, ok := value.(string) 5425 if !ok { 5426 return fmt.Errorf("expected SecretARNType to be of type string, got %T instead", value) 5427 } 5428 sv.ARN = ptr.String(jtv) 5429 } 5430 5431 default: 5432 _, _ = key, value 5433 5434 } 5435 } 5436 *v = sv 5437 return nil 5438} 5439 5440func awsAwsjson11_deserializeOpDocumentUpdateSecretOutput(v **UpdateSecretOutput, value interface{}) error { 5441 if v == nil { 5442 return fmt.Errorf("unexpected nil of type %T", v) 5443 } 5444 if value == nil { 5445 return nil 5446 } 5447 5448 shape, ok := value.(map[string]interface{}) 5449 if !ok { 5450 return fmt.Errorf("unexpected JSON type %v", value) 5451 } 5452 5453 var sv *UpdateSecretOutput 5454 if *v == nil { 5455 sv = &UpdateSecretOutput{} 5456 } else { 5457 sv = *v 5458 } 5459 5460 for key, value := range shape { 5461 switch key { 5462 case "ARN": 5463 if value != nil { 5464 jtv, ok := value.(string) 5465 if !ok { 5466 return fmt.Errorf("expected SecretARNType to be of type string, got %T instead", value) 5467 } 5468 sv.ARN = ptr.String(jtv) 5469 } 5470 5471 case "Name": 5472 if value != nil { 5473 jtv, ok := value.(string) 5474 if !ok { 5475 return fmt.Errorf("expected SecretNameType to be of type string, got %T instead", value) 5476 } 5477 sv.Name = ptr.String(jtv) 5478 } 5479 5480 case "VersionId": 5481 if value != nil { 5482 jtv, ok := value.(string) 5483 if !ok { 5484 return fmt.Errorf("expected SecretVersionIdType to be of type string, got %T instead", value) 5485 } 5486 sv.VersionId = ptr.String(jtv) 5487 } 5488 5489 default: 5490 _, _ = key, value 5491 5492 } 5493 } 5494 *v = sv 5495 return nil 5496} 5497 5498func awsAwsjson11_deserializeOpDocumentUpdateSecretVersionStageOutput(v **UpdateSecretVersionStageOutput, value interface{}) error { 5499 if v == nil { 5500 return fmt.Errorf("unexpected nil of type %T", v) 5501 } 5502 if value == nil { 5503 return nil 5504 } 5505 5506 shape, ok := value.(map[string]interface{}) 5507 if !ok { 5508 return fmt.Errorf("unexpected JSON type %v", value) 5509 } 5510 5511 var sv *UpdateSecretVersionStageOutput 5512 if *v == nil { 5513 sv = &UpdateSecretVersionStageOutput{} 5514 } else { 5515 sv = *v 5516 } 5517 5518 for key, value := range shape { 5519 switch key { 5520 case "ARN": 5521 if value != nil { 5522 jtv, ok := value.(string) 5523 if !ok { 5524 return fmt.Errorf("expected SecretARNType to be of type string, got %T instead", value) 5525 } 5526 sv.ARN = ptr.String(jtv) 5527 } 5528 5529 case "Name": 5530 if value != nil { 5531 jtv, ok := value.(string) 5532 if !ok { 5533 return fmt.Errorf("expected SecretNameType to be of type string, got %T instead", value) 5534 } 5535 sv.Name = ptr.String(jtv) 5536 } 5537 5538 default: 5539 _, _ = key, value 5540 5541 } 5542 } 5543 *v = sv 5544 return nil 5545} 5546 5547func awsAwsjson11_deserializeOpDocumentValidateResourcePolicyOutput(v **ValidateResourcePolicyOutput, value interface{}) error { 5548 if v == nil { 5549 return fmt.Errorf("unexpected nil of type %T", v) 5550 } 5551 if value == nil { 5552 return nil 5553 } 5554 5555 shape, ok := value.(map[string]interface{}) 5556 if !ok { 5557 return fmt.Errorf("unexpected JSON type %v", value) 5558 } 5559 5560 var sv *ValidateResourcePolicyOutput 5561 if *v == nil { 5562 sv = &ValidateResourcePolicyOutput{} 5563 } else { 5564 sv = *v 5565 } 5566 5567 for key, value := range shape { 5568 switch key { 5569 case "PolicyValidationPassed": 5570 if value != nil { 5571 jtv, ok := value.(bool) 5572 if !ok { 5573 return fmt.Errorf("expected BooleanType to be of type *bool, got %T instead", value) 5574 } 5575 sv.PolicyValidationPassed = jtv 5576 } 5577 5578 case "ValidationErrors": 5579 if err := awsAwsjson11_deserializeDocumentValidationErrorsType(&sv.ValidationErrors, value); err != nil { 5580 return err 5581 } 5582 5583 default: 5584 _, _ = key, value 5585 5586 } 5587 } 5588 *v = sv 5589 return nil 5590} 5591