1// Code generated by smithy-go-codegen DO NOT EDIT. 2 3package sesv2 4 5import ( 6 "bytes" 7 "context" 8 "encoding/json" 9 "fmt" 10 "github.com/aws/aws-sdk-go-v2/aws/protocol/restjson" 11 "github.com/aws/aws-sdk-go-v2/service/sesv2/types" 12 smithy "github.com/aws/smithy-go" 13 smithyio "github.com/aws/smithy-go/io" 14 "github.com/aws/smithy-go/middleware" 15 "github.com/aws/smithy-go/ptr" 16 smithytime "github.com/aws/smithy-go/time" 17 smithyhttp "github.com/aws/smithy-go/transport/http" 18 "io" 19 "strings" 20) 21 22type awsRestjson1_deserializeOpCreateConfigurationSet struct { 23} 24 25func (*awsRestjson1_deserializeOpCreateConfigurationSet) ID() string { 26 return "OperationDeserializer" 27} 28 29func (m *awsRestjson1_deserializeOpCreateConfigurationSet) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 30 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 31) { 32 out, metadata, err = next.HandleDeserialize(ctx, in) 33 if err != nil { 34 return out, metadata, err 35 } 36 37 response, ok := out.RawResponse.(*smithyhttp.Response) 38 if !ok { 39 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 40 } 41 42 if response.StatusCode < 200 || response.StatusCode >= 300 { 43 return out, metadata, awsRestjson1_deserializeOpErrorCreateConfigurationSet(response, &metadata) 44 } 45 output := &CreateConfigurationSetOutput{} 46 out.Result = output 47 48 return out, metadata, err 49} 50 51func awsRestjson1_deserializeOpErrorCreateConfigurationSet(response *smithyhttp.Response, metadata *middleware.Metadata) error { 52 var errorBuffer bytes.Buffer 53 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 54 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 55 } 56 errorBody := bytes.NewReader(errorBuffer.Bytes()) 57 58 errorCode := "UnknownError" 59 errorMessage := errorCode 60 61 code := response.Header.Get("X-Amzn-ErrorType") 62 if len(code) != 0 { 63 errorCode = restjson.SanitizeErrorCode(code) 64 } 65 66 var buff [1024]byte 67 ringBuffer := smithyio.NewRingBuffer(buff[:]) 68 69 body := io.TeeReader(errorBody, ringBuffer) 70 decoder := json.NewDecoder(body) 71 decoder.UseNumber() 72 code, message, err := restjson.GetErrorInfo(decoder) 73 if err != nil { 74 var snapshot bytes.Buffer 75 io.Copy(&snapshot, ringBuffer) 76 err = &smithy.DeserializationError{ 77 Err: fmt.Errorf("failed to decode response body, %w", err), 78 Snapshot: snapshot.Bytes(), 79 } 80 return err 81 } 82 83 errorBody.Seek(0, io.SeekStart) 84 if len(code) != 0 { 85 errorCode = restjson.SanitizeErrorCode(code) 86 } 87 if len(message) != 0 { 88 errorMessage = message 89 } 90 91 switch { 92 case strings.EqualFold("AlreadyExistsException", errorCode): 93 return awsRestjson1_deserializeErrorAlreadyExistsException(response, errorBody) 94 95 case strings.EqualFold("BadRequestException", errorCode): 96 return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) 97 98 case strings.EqualFold("ConcurrentModificationException", errorCode): 99 return awsRestjson1_deserializeErrorConcurrentModificationException(response, errorBody) 100 101 case strings.EqualFold("LimitExceededException", errorCode): 102 return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) 103 104 case strings.EqualFold("NotFoundException", errorCode): 105 return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) 106 107 case strings.EqualFold("TooManyRequestsException", errorCode): 108 return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody) 109 110 default: 111 genericError := &smithy.GenericAPIError{ 112 Code: errorCode, 113 Message: errorMessage, 114 } 115 return genericError 116 117 } 118} 119 120type awsRestjson1_deserializeOpCreateConfigurationSetEventDestination struct { 121} 122 123func (*awsRestjson1_deserializeOpCreateConfigurationSetEventDestination) ID() string { 124 return "OperationDeserializer" 125} 126 127func (m *awsRestjson1_deserializeOpCreateConfigurationSetEventDestination) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 128 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 129) { 130 out, metadata, err = next.HandleDeserialize(ctx, in) 131 if err != nil { 132 return out, metadata, err 133 } 134 135 response, ok := out.RawResponse.(*smithyhttp.Response) 136 if !ok { 137 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 138 } 139 140 if response.StatusCode < 200 || response.StatusCode >= 300 { 141 return out, metadata, awsRestjson1_deserializeOpErrorCreateConfigurationSetEventDestination(response, &metadata) 142 } 143 output := &CreateConfigurationSetEventDestinationOutput{} 144 out.Result = output 145 146 return out, metadata, err 147} 148 149func awsRestjson1_deserializeOpErrorCreateConfigurationSetEventDestination(response *smithyhttp.Response, metadata *middleware.Metadata) error { 150 var errorBuffer bytes.Buffer 151 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 152 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 153 } 154 errorBody := bytes.NewReader(errorBuffer.Bytes()) 155 156 errorCode := "UnknownError" 157 errorMessage := errorCode 158 159 code := response.Header.Get("X-Amzn-ErrorType") 160 if len(code) != 0 { 161 errorCode = restjson.SanitizeErrorCode(code) 162 } 163 164 var buff [1024]byte 165 ringBuffer := smithyio.NewRingBuffer(buff[:]) 166 167 body := io.TeeReader(errorBody, ringBuffer) 168 decoder := json.NewDecoder(body) 169 decoder.UseNumber() 170 code, message, err := restjson.GetErrorInfo(decoder) 171 if err != nil { 172 var snapshot bytes.Buffer 173 io.Copy(&snapshot, ringBuffer) 174 err = &smithy.DeserializationError{ 175 Err: fmt.Errorf("failed to decode response body, %w", err), 176 Snapshot: snapshot.Bytes(), 177 } 178 return err 179 } 180 181 errorBody.Seek(0, io.SeekStart) 182 if len(code) != 0 { 183 errorCode = restjson.SanitizeErrorCode(code) 184 } 185 if len(message) != 0 { 186 errorMessage = message 187 } 188 189 switch { 190 case strings.EqualFold("AlreadyExistsException", errorCode): 191 return awsRestjson1_deserializeErrorAlreadyExistsException(response, errorBody) 192 193 case strings.EqualFold("BadRequestException", errorCode): 194 return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) 195 196 case strings.EqualFold("LimitExceededException", errorCode): 197 return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) 198 199 case strings.EqualFold("NotFoundException", errorCode): 200 return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) 201 202 case strings.EqualFold("TooManyRequestsException", errorCode): 203 return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody) 204 205 default: 206 genericError := &smithy.GenericAPIError{ 207 Code: errorCode, 208 Message: errorMessage, 209 } 210 return genericError 211 212 } 213} 214 215type awsRestjson1_deserializeOpCreateContact struct { 216} 217 218func (*awsRestjson1_deserializeOpCreateContact) ID() string { 219 return "OperationDeserializer" 220} 221 222func (m *awsRestjson1_deserializeOpCreateContact) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 223 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 224) { 225 out, metadata, err = next.HandleDeserialize(ctx, in) 226 if err != nil { 227 return out, metadata, err 228 } 229 230 response, ok := out.RawResponse.(*smithyhttp.Response) 231 if !ok { 232 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 233 } 234 235 if response.StatusCode < 200 || response.StatusCode >= 300 { 236 return out, metadata, awsRestjson1_deserializeOpErrorCreateContact(response, &metadata) 237 } 238 output := &CreateContactOutput{} 239 out.Result = output 240 241 return out, metadata, err 242} 243 244func awsRestjson1_deserializeOpErrorCreateContact(response *smithyhttp.Response, metadata *middleware.Metadata) error { 245 var errorBuffer bytes.Buffer 246 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 247 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 248 } 249 errorBody := bytes.NewReader(errorBuffer.Bytes()) 250 251 errorCode := "UnknownError" 252 errorMessage := errorCode 253 254 code := response.Header.Get("X-Amzn-ErrorType") 255 if len(code) != 0 { 256 errorCode = restjson.SanitizeErrorCode(code) 257 } 258 259 var buff [1024]byte 260 ringBuffer := smithyio.NewRingBuffer(buff[:]) 261 262 body := io.TeeReader(errorBody, ringBuffer) 263 decoder := json.NewDecoder(body) 264 decoder.UseNumber() 265 code, message, err := restjson.GetErrorInfo(decoder) 266 if err != nil { 267 var snapshot bytes.Buffer 268 io.Copy(&snapshot, ringBuffer) 269 err = &smithy.DeserializationError{ 270 Err: fmt.Errorf("failed to decode response body, %w", err), 271 Snapshot: snapshot.Bytes(), 272 } 273 return err 274 } 275 276 errorBody.Seek(0, io.SeekStart) 277 if len(code) != 0 { 278 errorCode = restjson.SanitizeErrorCode(code) 279 } 280 if len(message) != 0 { 281 errorMessage = message 282 } 283 284 switch { 285 case strings.EqualFold("AlreadyExistsException", errorCode): 286 return awsRestjson1_deserializeErrorAlreadyExistsException(response, errorBody) 287 288 case strings.EqualFold("BadRequestException", errorCode): 289 return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) 290 291 case strings.EqualFold("NotFoundException", errorCode): 292 return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) 293 294 case strings.EqualFold("TooManyRequestsException", errorCode): 295 return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody) 296 297 default: 298 genericError := &smithy.GenericAPIError{ 299 Code: errorCode, 300 Message: errorMessage, 301 } 302 return genericError 303 304 } 305} 306 307type awsRestjson1_deserializeOpCreateContactList struct { 308} 309 310func (*awsRestjson1_deserializeOpCreateContactList) ID() string { 311 return "OperationDeserializer" 312} 313 314func (m *awsRestjson1_deserializeOpCreateContactList) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 315 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 316) { 317 out, metadata, err = next.HandleDeserialize(ctx, in) 318 if err != nil { 319 return out, metadata, err 320 } 321 322 response, ok := out.RawResponse.(*smithyhttp.Response) 323 if !ok { 324 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 325 } 326 327 if response.StatusCode < 200 || response.StatusCode >= 300 { 328 return out, metadata, awsRestjson1_deserializeOpErrorCreateContactList(response, &metadata) 329 } 330 output := &CreateContactListOutput{} 331 out.Result = output 332 333 return out, metadata, err 334} 335 336func awsRestjson1_deserializeOpErrorCreateContactList(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("AlreadyExistsException", errorCode): 378 return awsRestjson1_deserializeErrorAlreadyExistsException(response, errorBody) 379 380 case strings.EqualFold("BadRequestException", errorCode): 381 return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) 382 383 case strings.EqualFold("LimitExceededException", errorCode): 384 return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) 385 386 case strings.EqualFold("TooManyRequestsException", errorCode): 387 return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody) 388 389 default: 390 genericError := &smithy.GenericAPIError{ 391 Code: errorCode, 392 Message: errorMessage, 393 } 394 return genericError 395 396 } 397} 398 399type awsRestjson1_deserializeOpCreateCustomVerificationEmailTemplate struct { 400} 401 402func (*awsRestjson1_deserializeOpCreateCustomVerificationEmailTemplate) ID() string { 403 return "OperationDeserializer" 404} 405 406func (m *awsRestjson1_deserializeOpCreateCustomVerificationEmailTemplate) 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, awsRestjson1_deserializeOpErrorCreateCustomVerificationEmailTemplate(response, &metadata) 421 } 422 output := &CreateCustomVerificationEmailTemplateOutput{} 423 out.Result = output 424 425 return out, metadata, err 426} 427 428func awsRestjson1_deserializeOpErrorCreateCustomVerificationEmailTemplate(response *smithyhttp.Response, metadata *middleware.Metadata) error { 429 var errorBuffer bytes.Buffer 430 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 431 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 432 } 433 errorBody := bytes.NewReader(errorBuffer.Bytes()) 434 435 errorCode := "UnknownError" 436 errorMessage := errorCode 437 438 code := response.Header.Get("X-Amzn-ErrorType") 439 if len(code) != 0 { 440 errorCode = restjson.SanitizeErrorCode(code) 441 } 442 443 var buff [1024]byte 444 ringBuffer := smithyio.NewRingBuffer(buff[:]) 445 446 body := io.TeeReader(errorBody, ringBuffer) 447 decoder := json.NewDecoder(body) 448 decoder.UseNumber() 449 code, message, err := restjson.GetErrorInfo(decoder) 450 if err != nil { 451 var snapshot bytes.Buffer 452 io.Copy(&snapshot, ringBuffer) 453 err = &smithy.DeserializationError{ 454 Err: fmt.Errorf("failed to decode response body, %w", err), 455 Snapshot: snapshot.Bytes(), 456 } 457 return err 458 } 459 460 errorBody.Seek(0, io.SeekStart) 461 if len(code) != 0 { 462 errorCode = restjson.SanitizeErrorCode(code) 463 } 464 if len(message) != 0 { 465 errorMessage = message 466 } 467 468 switch { 469 case strings.EqualFold("AlreadyExistsException", errorCode): 470 return awsRestjson1_deserializeErrorAlreadyExistsException(response, errorBody) 471 472 case strings.EqualFold("BadRequestException", errorCode): 473 return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) 474 475 case strings.EqualFold("LimitExceededException", errorCode): 476 return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) 477 478 case strings.EqualFold("NotFoundException", errorCode): 479 return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) 480 481 case strings.EqualFold("TooManyRequestsException", errorCode): 482 return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody) 483 484 default: 485 genericError := &smithy.GenericAPIError{ 486 Code: errorCode, 487 Message: errorMessage, 488 } 489 return genericError 490 491 } 492} 493 494type awsRestjson1_deserializeOpCreateDedicatedIpPool struct { 495} 496 497func (*awsRestjson1_deserializeOpCreateDedicatedIpPool) ID() string { 498 return "OperationDeserializer" 499} 500 501func (m *awsRestjson1_deserializeOpCreateDedicatedIpPool) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 502 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 503) { 504 out, metadata, err = next.HandleDeserialize(ctx, in) 505 if err != nil { 506 return out, metadata, err 507 } 508 509 response, ok := out.RawResponse.(*smithyhttp.Response) 510 if !ok { 511 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 512 } 513 514 if response.StatusCode < 200 || response.StatusCode >= 300 { 515 return out, metadata, awsRestjson1_deserializeOpErrorCreateDedicatedIpPool(response, &metadata) 516 } 517 output := &CreateDedicatedIpPoolOutput{} 518 out.Result = output 519 520 return out, metadata, err 521} 522 523func awsRestjson1_deserializeOpErrorCreateDedicatedIpPool(response *smithyhttp.Response, metadata *middleware.Metadata) error { 524 var errorBuffer bytes.Buffer 525 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 526 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 527 } 528 errorBody := bytes.NewReader(errorBuffer.Bytes()) 529 530 errorCode := "UnknownError" 531 errorMessage := errorCode 532 533 code := response.Header.Get("X-Amzn-ErrorType") 534 if len(code) != 0 { 535 errorCode = restjson.SanitizeErrorCode(code) 536 } 537 538 var buff [1024]byte 539 ringBuffer := smithyio.NewRingBuffer(buff[:]) 540 541 body := io.TeeReader(errorBody, ringBuffer) 542 decoder := json.NewDecoder(body) 543 decoder.UseNumber() 544 code, message, err := restjson.GetErrorInfo(decoder) 545 if err != nil { 546 var snapshot bytes.Buffer 547 io.Copy(&snapshot, ringBuffer) 548 err = &smithy.DeserializationError{ 549 Err: fmt.Errorf("failed to decode response body, %w", err), 550 Snapshot: snapshot.Bytes(), 551 } 552 return err 553 } 554 555 errorBody.Seek(0, io.SeekStart) 556 if len(code) != 0 { 557 errorCode = restjson.SanitizeErrorCode(code) 558 } 559 if len(message) != 0 { 560 errorMessage = message 561 } 562 563 switch { 564 case strings.EqualFold("AlreadyExistsException", errorCode): 565 return awsRestjson1_deserializeErrorAlreadyExistsException(response, errorBody) 566 567 case strings.EqualFold("BadRequestException", errorCode): 568 return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) 569 570 case strings.EqualFold("ConcurrentModificationException", errorCode): 571 return awsRestjson1_deserializeErrorConcurrentModificationException(response, errorBody) 572 573 case strings.EqualFold("LimitExceededException", errorCode): 574 return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) 575 576 case strings.EqualFold("TooManyRequestsException", errorCode): 577 return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody) 578 579 default: 580 genericError := &smithy.GenericAPIError{ 581 Code: errorCode, 582 Message: errorMessage, 583 } 584 return genericError 585 586 } 587} 588 589type awsRestjson1_deserializeOpCreateDeliverabilityTestReport struct { 590} 591 592func (*awsRestjson1_deserializeOpCreateDeliverabilityTestReport) ID() string { 593 return "OperationDeserializer" 594} 595 596func (m *awsRestjson1_deserializeOpCreateDeliverabilityTestReport) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 597 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 598) { 599 out, metadata, err = next.HandleDeserialize(ctx, in) 600 if err != nil { 601 return out, metadata, err 602 } 603 604 response, ok := out.RawResponse.(*smithyhttp.Response) 605 if !ok { 606 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 607 } 608 609 if response.StatusCode < 200 || response.StatusCode >= 300 { 610 return out, metadata, awsRestjson1_deserializeOpErrorCreateDeliverabilityTestReport(response, &metadata) 611 } 612 output := &CreateDeliverabilityTestReportOutput{} 613 out.Result = output 614 615 var buff [1024]byte 616 ringBuffer := smithyio.NewRingBuffer(buff[:]) 617 618 body := io.TeeReader(response.Body, ringBuffer) 619 620 decoder := json.NewDecoder(body) 621 decoder.UseNumber() 622 var shape interface{} 623 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 624 var snapshot bytes.Buffer 625 io.Copy(&snapshot, ringBuffer) 626 err = &smithy.DeserializationError{ 627 Err: fmt.Errorf("failed to decode response body, %w", err), 628 Snapshot: snapshot.Bytes(), 629 } 630 return out, metadata, err 631 } 632 633 err = awsRestjson1_deserializeOpDocumentCreateDeliverabilityTestReportOutput(&output, shape) 634 if err != nil { 635 var snapshot bytes.Buffer 636 io.Copy(&snapshot, ringBuffer) 637 return out, metadata, &smithy.DeserializationError{ 638 Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), 639 Snapshot: snapshot.Bytes(), 640 } 641 } 642 643 return out, metadata, err 644} 645 646func awsRestjson1_deserializeOpErrorCreateDeliverabilityTestReport(response *smithyhttp.Response, metadata *middleware.Metadata) error { 647 var errorBuffer bytes.Buffer 648 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 649 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 650 } 651 errorBody := bytes.NewReader(errorBuffer.Bytes()) 652 653 errorCode := "UnknownError" 654 errorMessage := errorCode 655 656 code := response.Header.Get("X-Amzn-ErrorType") 657 if len(code) != 0 { 658 errorCode = restjson.SanitizeErrorCode(code) 659 } 660 661 var buff [1024]byte 662 ringBuffer := smithyio.NewRingBuffer(buff[:]) 663 664 body := io.TeeReader(errorBody, ringBuffer) 665 decoder := json.NewDecoder(body) 666 decoder.UseNumber() 667 code, message, err := restjson.GetErrorInfo(decoder) 668 if err != nil { 669 var snapshot bytes.Buffer 670 io.Copy(&snapshot, ringBuffer) 671 err = &smithy.DeserializationError{ 672 Err: fmt.Errorf("failed to decode response body, %w", err), 673 Snapshot: snapshot.Bytes(), 674 } 675 return err 676 } 677 678 errorBody.Seek(0, io.SeekStart) 679 if len(code) != 0 { 680 errorCode = restjson.SanitizeErrorCode(code) 681 } 682 if len(message) != 0 { 683 errorMessage = message 684 } 685 686 switch { 687 case strings.EqualFold("AccountSuspendedException", errorCode): 688 return awsRestjson1_deserializeErrorAccountSuspendedException(response, errorBody) 689 690 case strings.EqualFold("BadRequestException", errorCode): 691 return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) 692 693 case strings.EqualFold("ConcurrentModificationException", errorCode): 694 return awsRestjson1_deserializeErrorConcurrentModificationException(response, errorBody) 695 696 case strings.EqualFold("LimitExceededException", errorCode): 697 return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) 698 699 case strings.EqualFold("MailFromDomainNotVerifiedException", errorCode): 700 return awsRestjson1_deserializeErrorMailFromDomainNotVerifiedException(response, errorBody) 701 702 case strings.EqualFold("MessageRejected", errorCode): 703 return awsRestjson1_deserializeErrorMessageRejected(response, errorBody) 704 705 case strings.EqualFold("NotFoundException", errorCode): 706 return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) 707 708 case strings.EqualFold("SendingPausedException", errorCode): 709 return awsRestjson1_deserializeErrorSendingPausedException(response, errorBody) 710 711 case strings.EqualFold("TooManyRequestsException", errorCode): 712 return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody) 713 714 default: 715 genericError := &smithy.GenericAPIError{ 716 Code: errorCode, 717 Message: errorMessage, 718 } 719 return genericError 720 721 } 722} 723 724func awsRestjson1_deserializeOpDocumentCreateDeliverabilityTestReportOutput(v **CreateDeliverabilityTestReportOutput, value interface{}) error { 725 if v == nil { 726 return fmt.Errorf("unexpected nil of type %T", v) 727 } 728 if value == nil { 729 return nil 730 } 731 732 shape, ok := value.(map[string]interface{}) 733 if !ok { 734 return fmt.Errorf("unexpected JSON type %v", value) 735 } 736 737 var sv *CreateDeliverabilityTestReportOutput 738 if *v == nil { 739 sv = &CreateDeliverabilityTestReportOutput{} 740 } else { 741 sv = *v 742 } 743 744 for key, value := range shape { 745 switch key { 746 case "DeliverabilityTestStatus": 747 if value != nil { 748 jtv, ok := value.(string) 749 if !ok { 750 return fmt.Errorf("expected DeliverabilityTestStatus to be of type string, got %T instead", value) 751 } 752 sv.DeliverabilityTestStatus = types.DeliverabilityTestStatus(jtv) 753 } 754 755 case "ReportId": 756 if value != nil { 757 jtv, ok := value.(string) 758 if !ok { 759 return fmt.Errorf("expected ReportId to be of type string, got %T instead", value) 760 } 761 sv.ReportId = ptr.String(jtv) 762 } 763 764 default: 765 _, _ = key, value 766 767 } 768 } 769 *v = sv 770 return nil 771} 772 773type awsRestjson1_deserializeOpCreateEmailIdentity struct { 774} 775 776func (*awsRestjson1_deserializeOpCreateEmailIdentity) ID() string { 777 return "OperationDeserializer" 778} 779 780func (m *awsRestjson1_deserializeOpCreateEmailIdentity) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 781 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 782) { 783 out, metadata, err = next.HandleDeserialize(ctx, in) 784 if err != nil { 785 return out, metadata, err 786 } 787 788 response, ok := out.RawResponse.(*smithyhttp.Response) 789 if !ok { 790 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 791 } 792 793 if response.StatusCode < 200 || response.StatusCode >= 300 { 794 return out, metadata, awsRestjson1_deserializeOpErrorCreateEmailIdentity(response, &metadata) 795 } 796 output := &CreateEmailIdentityOutput{} 797 out.Result = output 798 799 var buff [1024]byte 800 ringBuffer := smithyio.NewRingBuffer(buff[:]) 801 802 body := io.TeeReader(response.Body, ringBuffer) 803 804 decoder := json.NewDecoder(body) 805 decoder.UseNumber() 806 var shape interface{} 807 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 808 var snapshot bytes.Buffer 809 io.Copy(&snapshot, ringBuffer) 810 err = &smithy.DeserializationError{ 811 Err: fmt.Errorf("failed to decode response body, %w", err), 812 Snapshot: snapshot.Bytes(), 813 } 814 return out, metadata, err 815 } 816 817 err = awsRestjson1_deserializeOpDocumentCreateEmailIdentityOutput(&output, shape) 818 if err != nil { 819 var snapshot bytes.Buffer 820 io.Copy(&snapshot, ringBuffer) 821 return out, metadata, &smithy.DeserializationError{ 822 Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), 823 Snapshot: snapshot.Bytes(), 824 } 825 } 826 827 return out, metadata, err 828} 829 830func awsRestjson1_deserializeOpErrorCreateEmailIdentity(response *smithyhttp.Response, metadata *middleware.Metadata) error { 831 var errorBuffer bytes.Buffer 832 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 833 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 834 } 835 errorBody := bytes.NewReader(errorBuffer.Bytes()) 836 837 errorCode := "UnknownError" 838 errorMessage := errorCode 839 840 code := response.Header.Get("X-Amzn-ErrorType") 841 if len(code) != 0 { 842 errorCode = restjson.SanitizeErrorCode(code) 843 } 844 845 var buff [1024]byte 846 ringBuffer := smithyio.NewRingBuffer(buff[:]) 847 848 body := io.TeeReader(errorBody, ringBuffer) 849 decoder := json.NewDecoder(body) 850 decoder.UseNumber() 851 code, message, err := restjson.GetErrorInfo(decoder) 852 if err != nil { 853 var snapshot bytes.Buffer 854 io.Copy(&snapshot, ringBuffer) 855 err = &smithy.DeserializationError{ 856 Err: fmt.Errorf("failed to decode response body, %w", err), 857 Snapshot: snapshot.Bytes(), 858 } 859 return err 860 } 861 862 errorBody.Seek(0, io.SeekStart) 863 if len(code) != 0 { 864 errorCode = restjson.SanitizeErrorCode(code) 865 } 866 if len(message) != 0 { 867 errorMessage = message 868 } 869 870 switch { 871 case strings.EqualFold("AlreadyExistsException", errorCode): 872 return awsRestjson1_deserializeErrorAlreadyExistsException(response, errorBody) 873 874 case strings.EqualFold("BadRequestException", errorCode): 875 return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) 876 877 case strings.EqualFold("ConcurrentModificationException", errorCode): 878 return awsRestjson1_deserializeErrorConcurrentModificationException(response, errorBody) 879 880 case strings.EqualFold("LimitExceededException", errorCode): 881 return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) 882 883 case strings.EqualFold("TooManyRequestsException", errorCode): 884 return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody) 885 886 default: 887 genericError := &smithy.GenericAPIError{ 888 Code: errorCode, 889 Message: errorMessage, 890 } 891 return genericError 892 893 } 894} 895 896func awsRestjson1_deserializeOpDocumentCreateEmailIdentityOutput(v **CreateEmailIdentityOutput, value interface{}) error { 897 if v == nil { 898 return fmt.Errorf("unexpected nil of type %T", v) 899 } 900 if value == nil { 901 return nil 902 } 903 904 shape, ok := value.(map[string]interface{}) 905 if !ok { 906 return fmt.Errorf("unexpected JSON type %v", value) 907 } 908 909 var sv *CreateEmailIdentityOutput 910 if *v == nil { 911 sv = &CreateEmailIdentityOutput{} 912 } else { 913 sv = *v 914 } 915 916 for key, value := range shape { 917 switch key { 918 case "DkimAttributes": 919 if err := awsRestjson1_deserializeDocumentDkimAttributes(&sv.DkimAttributes, value); err != nil { 920 return err 921 } 922 923 case "IdentityType": 924 if value != nil { 925 jtv, ok := value.(string) 926 if !ok { 927 return fmt.Errorf("expected IdentityType to be of type string, got %T instead", value) 928 } 929 sv.IdentityType = types.IdentityType(jtv) 930 } 931 932 case "VerifiedForSendingStatus": 933 if value != nil { 934 jtv, ok := value.(bool) 935 if !ok { 936 return fmt.Errorf("expected Enabled to be of type *bool, got %T instead", value) 937 } 938 sv.VerifiedForSendingStatus = jtv 939 } 940 941 default: 942 _, _ = key, value 943 944 } 945 } 946 *v = sv 947 return nil 948} 949 950type awsRestjson1_deserializeOpCreateEmailIdentityPolicy struct { 951} 952 953func (*awsRestjson1_deserializeOpCreateEmailIdentityPolicy) ID() string { 954 return "OperationDeserializer" 955} 956 957func (m *awsRestjson1_deserializeOpCreateEmailIdentityPolicy) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 958 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 959) { 960 out, metadata, err = next.HandleDeserialize(ctx, in) 961 if err != nil { 962 return out, metadata, err 963 } 964 965 response, ok := out.RawResponse.(*smithyhttp.Response) 966 if !ok { 967 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 968 } 969 970 if response.StatusCode < 200 || response.StatusCode >= 300 { 971 return out, metadata, awsRestjson1_deserializeOpErrorCreateEmailIdentityPolicy(response, &metadata) 972 } 973 output := &CreateEmailIdentityPolicyOutput{} 974 out.Result = output 975 976 return out, metadata, err 977} 978 979func awsRestjson1_deserializeOpErrorCreateEmailIdentityPolicy(response *smithyhttp.Response, metadata *middleware.Metadata) error { 980 var errorBuffer bytes.Buffer 981 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 982 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 983 } 984 errorBody := bytes.NewReader(errorBuffer.Bytes()) 985 986 errorCode := "UnknownError" 987 errorMessage := errorCode 988 989 code := response.Header.Get("X-Amzn-ErrorType") 990 if len(code) != 0 { 991 errorCode = restjson.SanitizeErrorCode(code) 992 } 993 994 var buff [1024]byte 995 ringBuffer := smithyio.NewRingBuffer(buff[:]) 996 997 body := io.TeeReader(errorBody, ringBuffer) 998 decoder := json.NewDecoder(body) 999 decoder.UseNumber() 1000 code, message, err := restjson.GetErrorInfo(decoder) 1001 if err != nil { 1002 var snapshot bytes.Buffer 1003 io.Copy(&snapshot, ringBuffer) 1004 err = &smithy.DeserializationError{ 1005 Err: fmt.Errorf("failed to decode response body, %w", err), 1006 Snapshot: snapshot.Bytes(), 1007 } 1008 return err 1009 } 1010 1011 errorBody.Seek(0, io.SeekStart) 1012 if len(code) != 0 { 1013 errorCode = restjson.SanitizeErrorCode(code) 1014 } 1015 if len(message) != 0 { 1016 errorMessage = message 1017 } 1018 1019 switch { 1020 case strings.EqualFold("AlreadyExistsException", errorCode): 1021 return awsRestjson1_deserializeErrorAlreadyExistsException(response, errorBody) 1022 1023 case strings.EqualFold("BadRequestException", errorCode): 1024 return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) 1025 1026 case strings.EqualFold("LimitExceededException", errorCode): 1027 return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) 1028 1029 case strings.EqualFold("NotFoundException", errorCode): 1030 return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) 1031 1032 case strings.EqualFold("TooManyRequestsException", errorCode): 1033 return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody) 1034 1035 default: 1036 genericError := &smithy.GenericAPIError{ 1037 Code: errorCode, 1038 Message: errorMessage, 1039 } 1040 return genericError 1041 1042 } 1043} 1044 1045type awsRestjson1_deserializeOpCreateEmailTemplate struct { 1046} 1047 1048func (*awsRestjson1_deserializeOpCreateEmailTemplate) ID() string { 1049 return "OperationDeserializer" 1050} 1051 1052func (m *awsRestjson1_deserializeOpCreateEmailTemplate) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 1053 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 1054) { 1055 out, metadata, err = next.HandleDeserialize(ctx, in) 1056 if err != nil { 1057 return out, metadata, err 1058 } 1059 1060 response, ok := out.RawResponse.(*smithyhttp.Response) 1061 if !ok { 1062 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 1063 } 1064 1065 if response.StatusCode < 200 || response.StatusCode >= 300 { 1066 return out, metadata, awsRestjson1_deserializeOpErrorCreateEmailTemplate(response, &metadata) 1067 } 1068 output := &CreateEmailTemplateOutput{} 1069 out.Result = output 1070 1071 return out, metadata, err 1072} 1073 1074func awsRestjson1_deserializeOpErrorCreateEmailTemplate(response *smithyhttp.Response, metadata *middleware.Metadata) error { 1075 var errorBuffer bytes.Buffer 1076 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 1077 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 1078 } 1079 errorBody := bytes.NewReader(errorBuffer.Bytes()) 1080 1081 errorCode := "UnknownError" 1082 errorMessage := errorCode 1083 1084 code := response.Header.Get("X-Amzn-ErrorType") 1085 if len(code) != 0 { 1086 errorCode = restjson.SanitizeErrorCode(code) 1087 } 1088 1089 var buff [1024]byte 1090 ringBuffer := smithyio.NewRingBuffer(buff[:]) 1091 1092 body := io.TeeReader(errorBody, ringBuffer) 1093 decoder := json.NewDecoder(body) 1094 decoder.UseNumber() 1095 code, message, err := restjson.GetErrorInfo(decoder) 1096 if err != nil { 1097 var snapshot bytes.Buffer 1098 io.Copy(&snapshot, ringBuffer) 1099 err = &smithy.DeserializationError{ 1100 Err: fmt.Errorf("failed to decode response body, %w", err), 1101 Snapshot: snapshot.Bytes(), 1102 } 1103 return err 1104 } 1105 1106 errorBody.Seek(0, io.SeekStart) 1107 if len(code) != 0 { 1108 errorCode = restjson.SanitizeErrorCode(code) 1109 } 1110 if len(message) != 0 { 1111 errorMessage = message 1112 } 1113 1114 switch { 1115 case strings.EqualFold("AlreadyExistsException", errorCode): 1116 return awsRestjson1_deserializeErrorAlreadyExistsException(response, errorBody) 1117 1118 case strings.EqualFold("BadRequestException", errorCode): 1119 return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) 1120 1121 case strings.EqualFold("LimitExceededException", errorCode): 1122 return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) 1123 1124 case strings.EqualFold("TooManyRequestsException", errorCode): 1125 return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody) 1126 1127 default: 1128 genericError := &smithy.GenericAPIError{ 1129 Code: errorCode, 1130 Message: errorMessage, 1131 } 1132 return genericError 1133 1134 } 1135} 1136 1137type awsRestjson1_deserializeOpCreateImportJob struct { 1138} 1139 1140func (*awsRestjson1_deserializeOpCreateImportJob) ID() string { 1141 return "OperationDeserializer" 1142} 1143 1144func (m *awsRestjson1_deserializeOpCreateImportJob) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 1145 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 1146) { 1147 out, metadata, err = next.HandleDeserialize(ctx, in) 1148 if err != nil { 1149 return out, metadata, err 1150 } 1151 1152 response, ok := out.RawResponse.(*smithyhttp.Response) 1153 if !ok { 1154 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 1155 } 1156 1157 if response.StatusCode < 200 || response.StatusCode >= 300 { 1158 return out, metadata, awsRestjson1_deserializeOpErrorCreateImportJob(response, &metadata) 1159 } 1160 output := &CreateImportJobOutput{} 1161 out.Result = output 1162 1163 var buff [1024]byte 1164 ringBuffer := smithyio.NewRingBuffer(buff[:]) 1165 1166 body := io.TeeReader(response.Body, ringBuffer) 1167 1168 decoder := json.NewDecoder(body) 1169 decoder.UseNumber() 1170 var shape interface{} 1171 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 1172 var snapshot bytes.Buffer 1173 io.Copy(&snapshot, ringBuffer) 1174 err = &smithy.DeserializationError{ 1175 Err: fmt.Errorf("failed to decode response body, %w", err), 1176 Snapshot: snapshot.Bytes(), 1177 } 1178 return out, metadata, err 1179 } 1180 1181 err = awsRestjson1_deserializeOpDocumentCreateImportJobOutput(&output, shape) 1182 if err != nil { 1183 var snapshot bytes.Buffer 1184 io.Copy(&snapshot, ringBuffer) 1185 return out, metadata, &smithy.DeserializationError{ 1186 Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), 1187 Snapshot: snapshot.Bytes(), 1188 } 1189 } 1190 1191 return out, metadata, err 1192} 1193 1194func awsRestjson1_deserializeOpErrorCreateImportJob(response *smithyhttp.Response, metadata *middleware.Metadata) error { 1195 var errorBuffer bytes.Buffer 1196 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 1197 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 1198 } 1199 errorBody := bytes.NewReader(errorBuffer.Bytes()) 1200 1201 errorCode := "UnknownError" 1202 errorMessage := errorCode 1203 1204 code := response.Header.Get("X-Amzn-ErrorType") 1205 if len(code) != 0 { 1206 errorCode = restjson.SanitizeErrorCode(code) 1207 } 1208 1209 var buff [1024]byte 1210 ringBuffer := smithyio.NewRingBuffer(buff[:]) 1211 1212 body := io.TeeReader(errorBody, ringBuffer) 1213 decoder := json.NewDecoder(body) 1214 decoder.UseNumber() 1215 code, message, err := restjson.GetErrorInfo(decoder) 1216 if err != nil { 1217 var snapshot bytes.Buffer 1218 io.Copy(&snapshot, ringBuffer) 1219 err = &smithy.DeserializationError{ 1220 Err: fmt.Errorf("failed to decode response body, %w", err), 1221 Snapshot: snapshot.Bytes(), 1222 } 1223 return err 1224 } 1225 1226 errorBody.Seek(0, io.SeekStart) 1227 if len(code) != 0 { 1228 errorCode = restjson.SanitizeErrorCode(code) 1229 } 1230 if len(message) != 0 { 1231 errorMessage = message 1232 } 1233 1234 switch { 1235 case strings.EqualFold("BadRequestException", errorCode): 1236 return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) 1237 1238 case strings.EqualFold("LimitExceededException", errorCode): 1239 return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) 1240 1241 case strings.EqualFold("TooManyRequestsException", errorCode): 1242 return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody) 1243 1244 default: 1245 genericError := &smithy.GenericAPIError{ 1246 Code: errorCode, 1247 Message: errorMessage, 1248 } 1249 return genericError 1250 1251 } 1252} 1253 1254func awsRestjson1_deserializeOpDocumentCreateImportJobOutput(v **CreateImportJobOutput, value interface{}) error { 1255 if v == nil { 1256 return fmt.Errorf("unexpected nil of type %T", v) 1257 } 1258 if value == nil { 1259 return nil 1260 } 1261 1262 shape, ok := value.(map[string]interface{}) 1263 if !ok { 1264 return fmt.Errorf("unexpected JSON type %v", value) 1265 } 1266 1267 var sv *CreateImportJobOutput 1268 if *v == nil { 1269 sv = &CreateImportJobOutput{} 1270 } else { 1271 sv = *v 1272 } 1273 1274 for key, value := range shape { 1275 switch key { 1276 case "JobId": 1277 if value != nil { 1278 jtv, ok := value.(string) 1279 if !ok { 1280 return fmt.Errorf("expected JobId to be of type string, got %T instead", value) 1281 } 1282 sv.JobId = ptr.String(jtv) 1283 } 1284 1285 default: 1286 _, _ = key, value 1287 1288 } 1289 } 1290 *v = sv 1291 return nil 1292} 1293 1294type awsRestjson1_deserializeOpDeleteConfigurationSet struct { 1295} 1296 1297func (*awsRestjson1_deserializeOpDeleteConfigurationSet) ID() string { 1298 return "OperationDeserializer" 1299} 1300 1301func (m *awsRestjson1_deserializeOpDeleteConfigurationSet) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 1302 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 1303) { 1304 out, metadata, err = next.HandleDeserialize(ctx, in) 1305 if err != nil { 1306 return out, metadata, err 1307 } 1308 1309 response, ok := out.RawResponse.(*smithyhttp.Response) 1310 if !ok { 1311 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 1312 } 1313 1314 if response.StatusCode < 200 || response.StatusCode >= 300 { 1315 return out, metadata, awsRestjson1_deserializeOpErrorDeleteConfigurationSet(response, &metadata) 1316 } 1317 output := &DeleteConfigurationSetOutput{} 1318 out.Result = output 1319 1320 return out, metadata, err 1321} 1322 1323func awsRestjson1_deserializeOpErrorDeleteConfigurationSet(response *smithyhttp.Response, metadata *middleware.Metadata) error { 1324 var errorBuffer bytes.Buffer 1325 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 1326 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 1327 } 1328 errorBody := bytes.NewReader(errorBuffer.Bytes()) 1329 1330 errorCode := "UnknownError" 1331 errorMessage := errorCode 1332 1333 code := response.Header.Get("X-Amzn-ErrorType") 1334 if len(code) != 0 { 1335 errorCode = restjson.SanitizeErrorCode(code) 1336 } 1337 1338 var buff [1024]byte 1339 ringBuffer := smithyio.NewRingBuffer(buff[:]) 1340 1341 body := io.TeeReader(errorBody, ringBuffer) 1342 decoder := json.NewDecoder(body) 1343 decoder.UseNumber() 1344 code, message, err := restjson.GetErrorInfo(decoder) 1345 if err != nil { 1346 var snapshot bytes.Buffer 1347 io.Copy(&snapshot, ringBuffer) 1348 err = &smithy.DeserializationError{ 1349 Err: fmt.Errorf("failed to decode response body, %w", err), 1350 Snapshot: snapshot.Bytes(), 1351 } 1352 return err 1353 } 1354 1355 errorBody.Seek(0, io.SeekStart) 1356 if len(code) != 0 { 1357 errorCode = restjson.SanitizeErrorCode(code) 1358 } 1359 if len(message) != 0 { 1360 errorMessage = message 1361 } 1362 1363 switch { 1364 case strings.EqualFold("BadRequestException", errorCode): 1365 return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) 1366 1367 case strings.EqualFold("ConcurrentModificationException", errorCode): 1368 return awsRestjson1_deserializeErrorConcurrentModificationException(response, errorBody) 1369 1370 case strings.EqualFold("NotFoundException", errorCode): 1371 return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) 1372 1373 case strings.EqualFold("TooManyRequestsException", errorCode): 1374 return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody) 1375 1376 default: 1377 genericError := &smithy.GenericAPIError{ 1378 Code: errorCode, 1379 Message: errorMessage, 1380 } 1381 return genericError 1382 1383 } 1384} 1385 1386type awsRestjson1_deserializeOpDeleteConfigurationSetEventDestination struct { 1387} 1388 1389func (*awsRestjson1_deserializeOpDeleteConfigurationSetEventDestination) ID() string { 1390 return "OperationDeserializer" 1391} 1392 1393func (m *awsRestjson1_deserializeOpDeleteConfigurationSetEventDestination) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 1394 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 1395) { 1396 out, metadata, err = next.HandleDeserialize(ctx, in) 1397 if err != nil { 1398 return out, metadata, err 1399 } 1400 1401 response, ok := out.RawResponse.(*smithyhttp.Response) 1402 if !ok { 1403 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 1404 } 1405 1406 if response.StatusCode < 200 || response.StatusCode >= 300 { 1407 return out, metadata, awsRestjson1_deserializeOpErrorDeleteConfigurationSetEventDestination(response, &metadata) 1408 } 1409 output := &DeleteConfigurationSetEventDestinationOutput{} 1410 out.Result = output 1411 1412 return out, metadata, err 1413} 1414 1415func awsRestjson1_deserializeOpErrorDeleteConfigurationSetEventDestination(response *smithyhttp.Response, metadata *middleware.Metadata) error { 1416 var errorBuffer bytes.Buffer 1417 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 1418 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 1419 } 1420 errorBody := bytes.NewReader(errorBuffer.Bytes()) 1421 1422 errorCode := "UnknownError" 1423 errorMessage := errorCode 1424 1425 code := response.Header.Get("X-Amzn-ErrorType") 1426 if len(code) != 0 { 1427 errorCode = restjson.SanitizeErrorCode(code) 1428 } 1429 1430 var buff [1024]byte 1431 ringBuffer := smithyio.NewRingBuffer(buff[:]) 1432 1433 body := io.TeeReader(errorBody, ringBuffer) 1434 decoder := json.NewDecoder(body) 1435 decoder.UseNumber() 1436 code, message, err := restjson.GetErrorInfo(decoder) 1437 if err != nil { 1438 var snapshot bytes.Buffer 1439 io.Copy(&snapshot, ringBuffer) 1440 err = &smithy.DeserializationError{ 1441 Err: fmt.Errorf("failed to decode response body, %w", err), 1442 Snapshot: snapshot.Bytes(), 1443 } 1444 return err 1445 } 1446 1447 errorBody.Seek(0, io.SeekStart) 1448 if len(code) != 0 { 1449 errorCode = restjson.SanitizeErrorCode(code) 1450 } 1451 if len(message) != 0 { 1452 errorMessage = message 1453 } 1454 1455 switch { 1456 case strings.EqualFold("BadRequestException", errorCode): 1457 return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) 1458 1459 case strings.EqualFold("NotFoundException", errorCode): 1460 return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) 1461 1462 case strings.EqualFold("TooManyRequestsException", errorCode): 1463 return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody) 1464 1465 default: 1466 genericError := &smithy.GenericAPIError{ 1467 Code: errorCode, 1468 Message: errorMessage, 1469 } 1470 return genericError 1471 1472 } 1473} 1474 1475type awsRestjson1_deserializeOpDeleteContact struct { 1476} 1477 1478func (*awsRestjson1_deserializeOpDeleteContact) ID() string { 1479 return "OperationDeserializer" 1480} 1481 1482func (m *awsRestjson1_deserializeOpDeleteContact) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 1483 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 1484) { 1485 out, metadata, err = next.HandleDeserialize(ctx, in) 1486 if err != nil { 1487 return out, metadata, err 1488 } 1489 1490 response, ok := out.RawResponse.(*smithyhttp.Response) 1491 if !ok { 1492 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 1493 } 1494 1495 if response.StatusCode < 200 || response.StatusCode >= 300 { 1496 return out, metadata, awsRestjson1_deserializeOpErrorDeleteContact(response, &metadata) 1497 } 1498 output := &DeleteContactOutput{} 1499 out.Result = output 1500 1501 return out, metadata, err 1502} 1503 1504func awsRestjson1_deserializeOpErrorDeleteContact(response *smithyhttp.Response, metadata *middleware.Metadata) error { 1505 var errorBuffer bytes.Buffer 1506 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 1507 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 1508 } 1509 errorBody := bytes.NewReader(errorBuffer.Bytes()) 1510 1511 errorCode := "UnknownError" 1512 errorMessage := errorCode 1513 1514 code := response.Header.Get("X-Amzn-ErrorType") 1515 if len(code) != 0 { 1516 errorCode = restjson.SanitizeErrorCode(code) 1517 } 1518 1519 var buff [1024]byte 1520 ringBuffer := smithyio.NewRingBuffer(buff[:]) 1521 1522 body := io.TeeReader(errorBody, ringBuffer) 1523 decoder := json.NewDecoder(body) 1524 decoder.UseNumber() 1525 code, message, err := restjson.GetErrorInfo(decoder) 1526 if err != nil { 1527 var snapshot bytes.Buffer 1528 io.Copy(&snapshot, ringBuffer) 1529 err = &smithy.DeserializationError{ 1530 Err: fmt.Errorf("failed to decode response body, %w", err), 1531 Snapshot: snapshot.Bytes(), 1532 } 1533 return err 1534 } 1535 1536 errorBody.Seek(0, io.SeekStart) 1537 if len(code) != 0 { 1538 errorCode = restjson.SanitizeErrorCode(code) 1539 } 1540 if len(message) != 0 { 1541 errorMessage = message 1542 } 1543 1544 switch { 1545 case strings.EqualFold("BadRequestException", errorCode): 1546 return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) 1547 1548 case strings.EqualFold("NotFoundException", errorCode): 1549 return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) 1550 1551 case strings.EqualFold("TooManyRequestsException", errorCode): 1552 return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody) 1553 1554 default: 1555 genericError := &smithy.GenericAPIError{ 1556 Code: errorCode, 1557 Message: errorMessage, 1558 } 1559 return genericError 1560 1561 } 1562} 1563 1564type awsRestjson1_deserializeOpDeleteContactList struct { 1565} 1566 1567func (*awsRestjson1_deserializeOpDeleteContactList) ID() string { 1568 return "OperationDeserializer" 1569} 1570 1571func (m *awsRestjson1_deserializeOpDeleteContactList) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 1572 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 1573) { 1574 out, metadata, err = next.HandleDeserialize(ctx, in) 1575 if err != nil { 1576 return out, metadata, err 1577 } 1578 1579 response, ok := out.RawResponse.(*smithyhttp.Response) 1580 if !ok { 1581 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 1582 } 1583 1584 if response.StatusCode < 200 || response.StatusCode >= 300 { 1585 return out, metadata, awsRestjson1_deserializeOpErrorDeleteContactList(response, &metadata) 1586 } 1587 output := &DeleteContactListOutput{} 1588 out.Result = output 1589 1590 return out, metadata, err 1591} 1592 1593func awsRestjson1_deserializeOpErrorDeleteContactList(response *smithyhttp.Response, metadata *middleware.Metadata) error { 1594 var errorBuffer bytes.Buffer 1595 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 1596 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 1597 } 1598 errorBody := bytes.NewReader(errorBuffer.Bytes()) 1599 1600 errorCode := "UnknownError" 1601 errorMessage := errorCode 1602 1603 code := response.Header.Get("X-Amzn-ErrorType") 1604 if len(code) != 0 { 1605 errorCode = restjson.SanitizeErrorCode(code) 1606 } 1607 1608 var buff [1024]byte 1609 ringBuffer := smithyio.NewRingBuffer(buff[:]) 1610 1611 body := io.TeeReader(errorBody, ringBuffer) 1612 decoder := json.NewDecoder(body) 1613 decoder.UseNumber() 1614 code, message, err := restjson.GetErrorInfo(decoder) 1615 if err != nil { 1616 var snapshot bytes.Buffer 1617 io.Copy(&snapshot, ringBuffer) 1618 err = &smithy.DeserializationError{ 1619 Err: fmt.Errorf("failed to decode response body, %w", err), 1620 Snapshot: snapshot.Bytes(), 1621 } 1622 return err 1623 } 1624 1625 errorBody.Seek(0, io.SeekStart) 1626 if len(code) != 0 { 1627 errorCode = restjson.SanitizeErrorCode(code) 1628 } 1629 if len(message) != 0 { 1630 errorMessage = message 1631 } 1632 1633 switch { 1634 case strings.EqualFold("BadRequestException", errorCode): 1635 return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) 1636 1637 case strings.EqualFold("ConcurrentModificationException", errorCode): 1638 return awsRestjson1_deserializeErrorConcurrentModificationException(response, errorBody) 1639 1640 case strings.EqualFold("NotFoundException", errorCode): 1641 return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) 1642 1643 case strings.EqualFold("TooManyRequestsException", errorCode): 1644 return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody) 1645 1646 default: 1647 genericError := &smithy.GenericAPIError{ 1648 Code: errorCode, 1649 Message: errorMessage, 1650 } 1651 return genericError 1652 1653 } 1654} 1655 1656type awsRestjson1_deserializeOpDeleteCustomVerificationEmailTemplate struct { 1657} 1658 1659func (*awsRestjson1_deserializeOpDeleteCustomVerificationEmailTemplate) ID() string { 1660 return "OperationDeserializer" 1661} 1662 1663func (m *awsRestjson1_deserializeOpDeleteCustomVerificationEmailTemplate) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 1664 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 1665) { 1666 out, metadata, err = next.HandleDeserialize(ctx, in) 1667 if err != nil { 1668 return out, metadata, err 1669 } 1670 1671 response, ok := out.RawResponse.(*smithyhttp.Response) 1672 if !ok { 1673 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 1674 } 1675 1676 if response.StatusCode < 200 || response.StatusCode >= 300 { 1677 return out, metadata, awsRestjson1_deserializeOpErrorDeleteCustomVerificationEmailTemplate(response, &metadata) 1678 } 1679 output := &DeleteCustomVerificationEmailTemplateOutput{} 1680 out.Result = output 1681 1682 return out, metadata, err 1683} 1684 1685func awsRestjson1_deserializeOpErrorDeleteCustomVerificationEmailTemplate(response *smithyhttp.Response, metadata *middleware.Metadata) error { 1686 var errorBuffer bytes.Buffer 1687 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 1688 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 1689 } 1690 errorBody := bytes.NewReader(errorBuffer.Bytes()) 1691 1692 errorCode := "UnknownError" 1693 errorMessage := errorCode 1694 1695 code := response.Header.Get("X-Amzn-ErrorType") 1696 if len(code) != 0 { 1697 errorCode = restjson.SanitizeErrorCode(code) 1698 } 1699 1700 var buff [1024]byte 1701 ringBuffer := smithyio.NewRingBuffer(buff[:]) 1702 1703 body := io.TeeReader(errorBody, ringBuffer) 1704 decoder := json.NewDecoder(body) 1705 decoder.UseNumber() 1706 code, message, err := restjson.GetErrorInfo(decoder) 1707 if err != nil { 1708 var snapshot bytes.Buffer 1709 io.Copy(&snapshot, ringBuffer) 1710 err = &smithy.DeserializationError{ 1711 Err: fmt.Errorf("failed to decode response body, %w", err), 1712 Snapshot: snapshot.Bytes(), 1713 } 1714 return err 1715 } 1716 1717 errorBody.Seek(0, io.SeekStart) 1718 if len(code) != 0 { 1719 errorCode = restjson.SanitizeErrorCode(code) 1720 } 1721 if len(message) != 0 { 1722 errorMessage = message 1723 } 1724 1725 switch { 1726 case strings.EqualFold("BadRequestException", errorCode): 1727 return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) 1728 1729 case strings.EqualFold("NotFoundException", errorCode): 1730 return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) 1731 1732 case strings.EqualFold("TooManyRequestsException", errorCode): 1733 return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody) 1734 1735 default: 1736 genericError := &smithy.GenericAPIError{ 1737 Code: errorCode, 1738 Message: errorMessage, 1739 } 1740 return genericError 1741 1742 } 1743} 1744 1745type awsRestjson1_deserializeOpDeleteDedicatedIpPool struct { 1746} 1747 1748func (*awsRestjson1_deserializeOpDeleteDedicatedIpPool) ID() string { 1749 return "OperationDeserializer" 1750} 1751 1752func (m *awsRestjson1_deserializeOpDeleteDedicatedIpPool) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 1753 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 1754) { 1755 out, metadata, err = next.HandleDeserialize(ctx, in) 1756 if err != nil { 1757 return out, metadata, err 1758 } 1759 1760 response, ok := out.RawResponse.(*smithyhttp.Response) 1761 if !ok { 1762 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 1763 } 1764 1765 if response.StatusCode < 200 || response.StatusCode >= 300 { 1766 return out, metadata, awsRestjson1_deserializeOpErrorDeleteDedicatedIpPool(response, &metadata) 1767 } 1768 output := &DeleteDedicatedIpPoolOutput{} 1769 out.Result = output 1770 1771 return out, metadata, err 1772} 1773 1774func awsRestjson1_deserializeOpErrorDeleteDedicatedIpPool(response *smithyhttp.Response, metadata *middleware.Metadata) error { 1775 var errorBuffer bytes.Buffer 1776 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 1777 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 1778 } 1779 errorBody := bytes.NewReader(errorBuffer.Bytes()) 1780 1781 errorCode := "UnknownError" 1782 errorMessage := errorCode 1783 1784 code := response.Header.Get("X-Amzn-ErrorType") 1785 if len(code) != 0 { 1786 errorCode = restjson.SanitizeErrorCode(code) 1787 } 1788 1789 var buff [1024]byte 1790 ringBuffer := smithyio.NewRingBuffer(buff[:]) 1791 1792 body := io.TeeReader(errorBody, ringBuffer) 1793 decoder := json.NewDecoder(body) 1794 decoder.UseNumber() 1795 code, message, err := restjson.GetErrorInfo(decoder) 1796 if err != nil { 1797 var snapshot bytes.Buffer 1798 io.Copy(&snapshot, ringBuffer) 1799 err = &smithy.DeserializationError{ 1800 Err: fmt.Errorf("failed to decode response body, %w", err), 1801 Snapshot: snapshot.Bytes(), 1802 } 1803 return err 1804 } 1805 1806 errorBody.Seek(0, io.SeekStart) 1807 if len(code) != 0 { 1808 errorCode = restjson.SanitizeErrorCode(code) 1809 } 1810 if len(message) != 0 { 1811 errorMessage = message 1812 } 1813 1814 switch { 1815 case strings.EqualFold("BadRequestException", errorCode): 1816 return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) 1817 1818 case strings.EqualFold("ConcurrentModificationException", errorCode): 1819 return awsRestjson1_deserializeErrorConcurrentModificationException(response, errorBody) 1820 1821 case strings.EqualFold("NotFoundException", errorCode): 1822 return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) 1823 1824 case strings.EqualFold("TooManyRequestsException", errorCode): 1825 return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody) 1826 1827 default: 1828 genericError := &smithy.GenericAPIError{ 1829 Code: errorCode, 1830 Message: errorMessage, 1831 } 1832 return genericError 1833 1834 } 1835} 1836 1837type awsRestjson1_deserializeOpDeleteEmailIdentity struct { 1838} 1839 1840func (*awsRestjson1_deserializeOpDeleteEmailIdentity) ID() string { 1841 return "OperationDeserializer" 1842} 1843 1844func (m *awsRestjson1_deserializeOpDeleteEmailIdentity) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 1845 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 1846) { 1847 out, metadata, err = next.HandleDeserialize(ctx, in) 1848 if err != nil { 1849 return out, metadata, err 1850 } 1851 1852 response, ok := out.RawResponse.(*smithyhttp.Response) 1853 if !ok { 1854 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 1855 } 1856 1857 if response.StatusCode < 200 || response.StatusCode >= 300 { 1858 return out, metadata, awsRestjson1_deserializeOpErrorDeleteEmailIdentity(response, &metadata) 1859 } 1860 output := &DeleteEmailIdentityOutput{} 1861 out.Result = output 1862 1863 return out, metadata, err 1864} 1865 1866func awsRestjson1_deserializeOpErrorDeleteEmailIdentity(response *smithyhttp.Response, metadata *middleware.Metadata) error { 1867 var errorBuffer bytes.Buffer 1868 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 1869 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 1870 } 1871 errorBody := bytes.NewReader(errorBuffer.Bytes()) 1872 1873 errorCode := "UnknownError" 1874 errorMessage := errorCode 1875 1876 code := response.Header.Get("X-Amzn-ErrorType") 1877 if len(code) != 0 { 1878 errorCode = restjson.SanitizeErrorCode(code) 1879 } 1880 1881 var buff [1024]byte 1882 ringBuffer := smithyio.NewRingBuffer(buff[:]) 1883 1884 body := io.TeeReader(errorBody, ringBuffer) 1885 decoder := json.NewDecoder(body) 1886 decoder.UseNumber() 1887 code, message, err := restjson.GetErrorInfo(decoder) 1888 if err != nil { 1889 var snapshot bytes.Buffer 1890 io.Copy(&snapshot, ringBuffer) 1891 err = &smithy.DeserializationError{ 1892 Err: fmt.Errorf("failed to decode response body, %w", err), 1893 Snapshot: snapshot.Bytes(), 1894 } 1895 return err 1896 } 1897 1898 errorBody.Seek(0, io.SeekStart) 1899 if len(code) != 0 { 1900 errorCode = restjson.SanitizeErrorCode(code) 1901 } 1902 if len(message) != 0 { 1903 errorMessage = message 1904 } 1905 1906 switch { 1907 case strings.EqualFold("BadRequestException", errorCode): 1908 return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) 1909 1910 case strings.EqualFold("ConcurrentModificationException", errorCode): 1911 return awsRestjson1_deserializeErrorConcurrentModificationException(response, errorBody) 1912 1913 case strings.EqualFold("NotFoundException", errorCode): 1914 return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) 1915 1916 case strings.EqualFold("TooManyRequestsException", errorCode): 1917 return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody) 1918 1919 default: 1920 genericError := &smithy.GenericAPIError{ 1921 Code: errorCode, 1922 Message: errorMessage, 1923 } 1924 return genericError 1925 1926 } 1927} 1928 1929type awsRestjson1_deserializeOpDeleteEmailIdentityPolicy struct { 1930} 1931 1932func (*awsRestjson1_deserializeOpDeleteEmailIdentityPolicy) ID() string { 1933 return "OperationDeserializer" 1934} 1935 1936func (m *awsRestjson1_deserializeOpDeleteEmailIdentityPolicy) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 1937 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 1938) { 1939 out, metadata, err = next.HandleDeserialize(ctx, in) 1940 if err != nil { 1941 return out, metadata, err 1942 } 1943 1944 response, ok := out.RawResponse.(*smithyhttp.Response) 1945 if !ok { 1946 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 1947 } 1948 1949 if response.StatusCode < 200 || response.StatusCode >= 300 { 1950 return out, metadata, awsRestjson1_deserializeOpErrorDeleteEmailIdentityPolicy(response, &metadata) 1951 } 1952 output := &DeleteEmailIdentityPolicyOutput{} 1953 out.Result = output 1954 1955 return out, metadata, err 1956} 1957 1958func awsRestjson1_deserializeOpErrorDeleteEmailIdentityPolicy(response *smithyhttp.Response, metadata *middleware.Metadata) error { 1959 var errorBuffer bytes.Buffer 1960 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 1961 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 1962 } 1963 errorBody := bytes.NewReader(errorBuffer.Bytes()) 1964 1965 errorCode := "UnknownError" 1966 errorMessage := errorCode 1967 1968 code := response.Header.Get("X-Amzn-ErrorType") 1969 if len(code) != 0 { 1970 errorCode = restjson.SanitizeErrorCode(code) 1971 } 1972 1973 var buff [1024]byte 1974 ringBuffer := smithyio.NewRingBuffer(buff[:]) 1975 1976 body := io.TeeReader(errorBody, ringBuffer) 1977 decoder := json.NewDecoder(body) 1978 decoder.UseNumber() 1979 code, message, err := restjson.GetErrorInfo(decoder) 1980 if err != nil { 1981 var snapshot bytes.Buffer 1982 io.Copy(&snapshot, ringBuffer) 1983 err = &smithy.DeserializationError{ 1984 Err: fmt.Errorf("failed to decode response body, %w", err), 1985 Snapshot: snapshot.Bytes(), 1986 } 1987 return err 1988 } 1989 1990 errorBody.Seek(0, io.SeekStart) 1991 if len(code) != 0 { 1992 errorCode = restjson.SanitizeErrorCode(code) 1993 } 1994 if len(message) != 0 { 1995 errorMessage = message 1996 } 1997 1998 switch { 1999 case strings.EqualFold("BadRequestException", errorCode): 2000 return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) 2001 2002 case strings.EqualFold("NotFoundException", errorCode): 2003 return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) 2004 2005 case strings.EqualFold("TooManyRequestsException", errorCode): 2006 return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody) 2007 2008 default: 2009 genericError := &smithy.GenericAPIError{ 2010 Code: errorCode, 2011 Message: errorMessage, 2012 } 2013 return genericError 2014 2015 } 2016} 2017 2018type awsRestjson1_deserializeOpDeleteEmailTemplate struct { 2019} 2020 2021func (*awsRestjson1_deserializeOpDeleteEmailTemplate) ID() string { 2022 return "OperationDeserializer" 2023} 2024 2025func (m *awsRestjson1_deserializeOpDeleteEmailTemplate) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 2026 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 2027) { 2028 out, metadata, err = next.HandleDeserialize(ctx, in) 2029 if err != nil { 2030 return out, metadata, err 2031 } 2032 2033 response, ok := out.RawResponse.(*smithyhttp.Response) 2034 if !ok { 2035 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 2036 } 2037 2038 if response.StatusCode < 200 || response.StatusCode >= 300 { 2039 return out, metadata, awsRestjson1_deserializeOpErrorDeleteEmailTemplate(response, &metadata) 2040 } 2041 output := &DeleteEmailTemplateOutput{} 2042 out.Result = output 2043 2044 return out, metadata, err 2045} 2046 2047func awsRestjson1_deserializeOpErrorDeleteEmailTemplate(response *smithyhttp.Response, metadata *middleware.Metadata) error { 2048 var errorBuffer bytes.Buffer 2049 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 2050 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 2051 } 2052 errorBody := bytes.NewReader(errorBuffer.Bytes()) 2053 2054 errorCode := "UnknownError" 2055 errorMessage := errorCode 2056 2057 code := response.Header.Get("X-Amzn-ErrorType") 2058 if len(code) != 0 { 2059 errorCode = restjson.SanitizeErrorCode(code) 2060 } 2061 2062 var buff [1024]byte 2063 ringBuffer := smithyio.NewRingBuffer(buff[:]) 2064 2065 body := io.TeeReader(errorBody, ringBuffer) 2066 decoder := json.NewDecoder(body) 2067 decoder.UseNumber() 2068 code, message, err := restjson.GetErrorInfo(decoder) 2069 if err != nil { 2070 var snapshot bytes.Buffer 2071 io.Copy(&snapshot, ringBuffer) 2072 err = &smithy.DeserializationError{ 2073 Err: fmt.Errorf("failed to decode response body, %w", err), 2074 Snapshot: snapshot.Bytes(), 2075 } 2076 return err 2077 } 2078 2079 errorBody.Seek(0, io.SeekStart) 2080 if len(code) != 0 { 2081 errorCode = restjson.SanitizeErrorCode(code) 2082 } 2083 if len(message) != 0 { 2084 errorMessage = message 2085 } 2086 2087 switch { 2088 case strings.EqualFold("BadRequestException", errorCode): 2089 return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) 2090 2091 case strings.EqualFold("NotFoundException", errorCode): 2092 return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) 2093 2094 case strings.EqualFold("TooManyRequestsException", errorCode): 2095 return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody) 2096 2097 default: 2098 genericError := &smithy.GenericAPIError{ 2099 Code: errorCode, 2100 Message: errorMessage, 2101 } 2102 return genericError 2103 2104 } 2105} 2106 2107type awsRestjson1_deserializeOpDeleteSuppressedDestination struct { 2108} 2109 2110func (*awsRestjson1_deserializeOpDeleteSuppressedDestination) ID() string { 2111 return "OperationDeserializer" 2112} 2113 2114func (m *awsRestjson1_deserializeOpDeleteSuppressedDestination) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 2115 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 2116) { 2117 out, metadata, err = next.HandleDeserialize(ctx, in) 2118 if err != nil { 2119 return out, metadata, err 2120 } 2121 2122 response, ok := out.RawResponse.(*smithyhttp.Response) 2123 if !ok { 2124 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 2125 } 2126 2127 if response.StatusCode < 200 || response.StatusCode >= 300 { 2128 return out, metadata, awsRestjson1_deserializeOpErrorDeleteSuppressedDestination(response, &metadata) 2129 } 2130 output := &DeleteSuppressedDestinationOutput{} 2131 out.Result = output 2132 2133 return out, metadata, err 2134} 2135 2136func awsRestjson1_deserializeOpErrorDeleteSuppressedDestination(response *smithyhttp.Response, metadata *middleware.Metadata) error { 2137 var errorBuffer bytes.Buffer 2138 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 2139 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 2140 } 2141 errorBody := bytes.NewReader(errorBuffer.Bytes()) 2142 2143 errorCode := "UnknownError" 2144 errorMessage := errorCode 2145 2146 code := response.Header.Get("X-Amzn-ErrorType") 2147 if len(code) != 0 { 2148 errorCode = restjson.SanitizeErrorCode(code) 2149 } 2150 2151 var buff [1024]byte 2152 ringBuffer := smithyio.NewRingBuffer(buff[:]) 2153 2154 body := io.TeeReader(errorBody, ringBuffer) 2155 decoder := json.NewDecoder(body) 2156 decoder.UseNumber() 2157 code, message, err := restjson.GetErrorInfo(decoder) 2158 if err != nil { 2159 var snapshot bytes.Buffer 2160 io.Copy(&snapshot, ringBuffer) 2161 err = &smithy.DeserializationError{ 2162 Err: fmt.Errorf("failed to decode response body, %w", err), 2163 Snapshot: snapshot.Bytes(), 2164 } 2165 return err 2166 } 2167 2168 errorBody.Seek(0, io.SeekStart) 2169 if len(code) != 0 { 2170 errorCode = restjson.SanitizeErrorCode(code) 2171 } 2172 if len(message) != 0 { 2173 errorMessage = message 2174 } 2175 2176 switch { 2177 case strings.EqualFold("BadRequestException", errorCode): 2178 return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) 2179 2180 case strings.EqualFold("NotFoundException", errorCode): 2181 return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) 2182 2183 case strings.EqualFold("TooManyRequestsException", errorCode): 2184 return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody) 2185 2186 default: 2187 genericError := &smithy.GenericAPIError{ 2188 Code: errorCode, 2189 Message: errorMessage, 2190 } 2191 return genericError 2192 2193 } 2194} 2195 2196type awsRestjson1_deserializeOpGetAccount struct { 2197} 2198 2199func (*awsRestjson1_deserializeOpGetAccount) ID() string { 2200 return "OperationDeserializer" 2201} 2202 2203func (m *awsRestjson1_deserializeOpGetAccount) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 2204 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 2205) { 2206 out, metadata, err = next.HandleDeserialize(ctx, in) 2207 if err != nil { 2208 return out, metadata, err 2209 } 2210 2211 response, ok := out.RawResponse.(*smithyhttp.Response) 2212 if !ok { 2213 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 2214 } 2215 2216 if response.StatusCode < 200 || response.StatusCode >= 300 { 2217 return out, metadata, awsRestjson1_deserializeOpErrorGetAccount(response, &metadata) 2218 } 2219 output := &GetAccountOutput{} 2220 out.Result = output 2221 2222 var buff [1024]byte 2223 ringBuffer := smithyio.NewRingBuffer(buff[:]) 2224 2225 body := io.TeeReader(response.Body, ringBuffer) 2226 2227 decoder := json.NewDecoder(body) 2228 decoder.UseNumber() 2229 var shape interface{} 2230 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 2231 var snapshot bytes.Buffer 2232 io.Copy(&snapshot, ringBuffer) 2233 err = &smithy.DeserializationError{ 2234 Err: fmt.Errorf("failed to decode response body, %w", err), 2235 Snapshot: snapshot.Bytes(), 2236 } 2237 return out, metadata, err 2238 } 2239 2240 err = awsRestjson1_deserializeOpDocumentGetAccountOutput(&output, shape) 2241 if err != nil { 2242 var snapshot bytes.Buffer 2243 io.Copy(&snapshot, ringBuffer) 2244 return out, metadata, &smithy.DeserializationError{ 2245 Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), 2246 Snapshot: snapshot.Bytes(), 2247 } 2248 } 2249 2250 return out, metadata, err 2251} 2252 2253func awsRestjson1_deserializeOpErrorGetAccount(response *smithyhttp.Response, metadata *middleware.Metadata) error { 2254 var errorBuffer bytes.Buffer 2255 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 2256 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 2257 } 2258 errorBody := bytes.NewReader(errorBuffer.Bytes()) 2259 2260 errorCode := "UnknownError" 2261 errorMessage := errorCode 2262 2263 code := response.Header.Get("X-Amzn-ErrorType") 2264 if len(code) != 0 { 2265 errorCode = restjson.SanitizeErrorCode(code) 2266 } 2267 2268 var buff [1024]byte 2269 ringBuffer := smithyio.NewRingBuffer(buff[:]) 2270 2271 body := io.TeeReader(errorBody, ringBuffer) 2272 decoder := json.NewDecoder(body) 2273 decoder.UseNumber() 2274 code, message, err := restjson.GetErrorInfo(decoder) 2275 if err != nil { 2276 var snapshot bytes.Buffer 2277 io.Copy(&snapshot, ringBuffer) 2278 err = &smithy.DeserializationError{ 2279 Err: fmt.Errorf("failed to decode response body, %w", err), 2280 Snapshot: snapshot.Bytes(), 2281 } 2282 return err 2283 } 2284 2285 errorBody.Seek(0, io.SeekStart) 2286 if len(code) != 0 { 2287 errorCode = restjson.SanitizeErrorCode(code) 2288 } 2289 if len(message) != 0 { 2290 errorMessage = message 2291 } 2292 2293 switch { 2294 case strings.EqualFold("BadRequestException", errorCode): 2295 return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) 2296 2297 case strings.EqualFold("TooManyRequestsException", errorCode): 2298 return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody) 2299 2300 default: 2301 genericError := &smithy.GenericAPIError{ 2302 Code: errorCode, 2303 Message: errorMessage, 2304 } 2305 return genericError 2306 2307 } 2308} 2309 2310func awsRestjson1_deserializeOpDocumentGetAccountOutput(v **GetAccountOutput, value interface{}) error { 2311 if v == nil { 2312 return fmt.Errorf("unexpected nil of type %T", v) 2313 } 2314 if value == nil { 2315 return nil 2316 } 2317 2318 shape, ok := value.(map[string]interface{}) 2319 if !ok { 2320 return fmt.Errorf("unexpected JSON type %v", value) 2321 } 2322 2323 var sv *GetAccountOutput 2324 if *v == nil { 2325 sv = &GetAccountOutput{} 2326 } else { 2327 sv = *v 2328 } 2329 2330 for key, value := range shape { 2331 switch key { 2332 case "DedicatedIpAutoWarmupEnabled": 2333 if value != nil { 2334 jtv, ok := value.(bool) 2335 if !ok { 2336 return fmt.Errorf("expected Enabled to be of type *bool, got %T instead", value) 2337 } 2338 sv.DedicatedIpAutoWarmupEnabled = jtv 2339 } 2340 2341 case "Details": 2342 if err := awsRestjson1_deserializeDocumentAccountDetails(&sv.Details, value); err != nil { 2343 return err 2344 } 2345 2346 case "EnforcementStatus": 2347 if value != nil { 2348 jtv, ok := value.(string) 2349 if !ok { 2350 return fmt.Errorf("expected GeneralEnforcementStatus to be of type string, got %T instead", value) 2351 } 2352 sv.EnforcementStatus = ptr.String(jtv) 2353 } 2354 2355 case "ProductionAccessEnabled": 2356 if value != nil { 2357 jtv, ok := value.(bool) 2358 if !ok { 2359 return fmt.Errorf("expected Enabled to be of type *bool, got %T instead", value) 2360 } 2361 sv.ProductionAccessEnabled = jtv 2362 } 2363 2364 case "SendingEnabled": 2365 if value != nil { 2366 jtv, ok := value.(bool) 2367 if !ok { 2368 return fmt.Errorf("expected Enabled to be of type *bool, got %T instead", value) 2369 } 2370 sv.SendingEnabled = jtv 2371 } 2372 2373 case "SendQuota": 2374 if err := awsRestjson1_deserializeDocumentSendQuota(&sv.SendQuota, value); err != nil { 2375 return err 2376 } 2377 2378 case "SuppressionAttributes": 2379 if err := awsRestjson1_deserializeDocumentSuppressionAttributes(&sv.SuppressionAttributes, value); err != nil { 2380 return err 2381 } 2382 2383 default: 2384 _, _ = key, value 2385 2386 } 2387 } 2388 *v = sv 2389 return nil 2390} 2391 2392type awsRestjson1_deserializeOpGetBlacklistReports struct { 2393} 2394 2395func (*awsRestjson1_deserializeOpGetBlacklistReports) ID() string { 2396 return "OperationDeserializer" 2397} 2398 2399func (m *awsRestjson1_deserializeOpGetBlacklistReports) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 2400 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 2401) { 2402 out, metadata, err = next.HandleDeserialize(ctx, in) 2403 if err != nil { 2404 return out, metadata, err 2405 } 2406 2407 response, ok := out.RawResponse.(*smithyhttp.Response) 2408 if !ok { 2409 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 2410 } 2411 2412 if response.StatusCode < 200 || response.StatusCode >= 300 { 2413 return out, metadata, awsRestjson1_deserializeOpErrorGetBlacklistReports(response, &metadata) 2414 } 2415 output := &GetBlacklistReportsOutput{} 2416 out.Result = output 2417 2418 var buff [1024]byte 2419 ringBuffer := smithyio.NewRingBuffer(buff[:]) 2420 2421 body := io.TeeReader(response.Body, ringBuffer) 2422 2423 decoder := json.NewDecoder(body) 2424 decoder.UseNumber() 2425 var shape interface{} 2426 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 2427 var snapshot bytes.Buffer 2428 io.Copy(&snapshot, ringBuffer) 2429 err = &smithy.DeserializationError{ 2430 Err: fmt.Errorf("failed to decode response body, %w", err), 2431 Snapshot: snapshot.Bytes(), 2432 } 2433 return out, metadata, err 2434 } 2435 2436 err = awsRestjson1_deserializeOpDocumentGetBlacklistReportsOutput(&output, shape) 2437 if err != nil { 2438 var snapshot bytes.Buffer 2439 io.Copy(&snapshot, ringBuffer) 2440 return out, metadata, &smithy.DeserializationError{ 2441 Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), 2442 Snapshot: snapshot.Bytes(), 2443 } 2444 } 2445 2446 return out, metadata, err 2447} 2448 2449func awsRestjson1_deserializeOpErrorGetBlacklistReports(response *smithyhttp.Response, metadata *middleware.Metadata) error { 2450 var errorBuffer bytes.Buffer 2451 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 2452 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 2453 } 2454 errorBody := bytes.NewReader(errorBuffer.Bytes()) 2455 2456 errorCode := "UnknownError" 2457 errorMessage := errorCode 2458 2459 code := response.Header.Get("X-Amzn-ErrorType") 2460 if len(code) != 0 { 2461 errorCode = restjson.SanitizeErrorCode(code) 2462 } 2463 2464 var buff [1024]byte 2465 ringBuffer := smithyio.NewRingBuffer(buff[:]) 2466 2467 body := io.TeeReader(errorBody, ringBuffer) 2468 decoder := json.NewDecoder(body) 2469 decoder.UseNumber() 2470 code, message, err := restjson.GetErrorInfo(decoder) 2471 if err != nil { 2472 var snapshot bytes.Buffer 2473 io.Copy(&snapshot, ringBuffer) 2474 err = &smithy.DeserializationError{ 2475 Err: fmt.Errorf("failed to decode response body, %w", err), 2476 Snapshot: snapshot.Bytes(), 2477 } 2478 return err 2479 } 2480 2481 errorBody.Seek(0, io.SeekStart) 2482 if len(code) != 0 { 2483 errorCode = restjson.SanitizeErrorCode(code) 2484 } 2485 if len(message) != 0 { 2486 errorMessage = message 2487 } 2488 2489 switch { 2490 case strings.EqualFold("BadRequestException", errorCode): 2491 return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) 2492 2493 case strings.EqualFold("NotFoundException", errorCode): 2494 return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) 2495 2496 case strings.EqualFold("TooManyRequestsException", errorCode): 2497 return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody) 2498 2499 default: 2500 genericError := &smithy.GenericAPIError{ 2501 Code: errorCode, 2502 Message: errorMessage, 2503 } 2504 return genericError 2505 2506 } 2507} 2508 2509func awsRestjson1_deserializeOpDocumentGetBlacklistReportsOutput(v **GetBlacklistReportsOutput, value interface{}) error { 2510 if v == nil { 2511 return fmt.Errorf("unexpected nil of type %T", v) 2512 } 2513 if value == nil { 2514 return nil 2515 } 2516 2517 shape, ok := value.(map[string]interface{}) 2518 if !ok { 2519 return fmt.Errorf("unexpected JSON type %v", value) 2520 } 2521 2522 var sv *GetBlacklistReportsOutput 2523 if *v == nil { 2524 sv = &GetBlacklistReportsOutput{} 2525 } else { 2526 sv = *v 2527 } 2528 2529 for key, value := range shape { 2530 switch key { 2531 case "BlacklistReport": 2532 if err := awsRestjson1_deserializeDocumentBlacklistReport(&sv.BlacklistReport, value); err != nil { 2533 return err 2534 } 2535 2536 default: 2537 _, _ = key, value 2538 2539 } 2540 } 2541 *v = sv 2542 return nil 2543} 2544 2545type awsRestjson1_deserializeOpGetConfigurationSet struct { 2546} 2547 2548func (*awsRestjson1_deserializeOpGetConfigurationSet) ID() string { 2549 return "OperationDeserializer" 2550} 2551 2552func (m *awsRestjson1_deserializeOpGetConfigurationSet) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 2553 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 2554) { 2555 out, metadata, err = next.HandleDeserialize(ctx, in) 2556 if err != nil { 2557 return out, metadata, err 2558 } 2559 2560 response, ok := out.RawResponse.(*smithyhttp.Response) 2561 if !ok { 2562 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 2563 } 2564 2565 if response.StatusCode < 200 || response.StatusCode >= 300 { 2566 return out, metadata, awsRestjson1_deserializeOpErrorGetConfigurationSet(response, &metadata) 2567 } 2568 output := &GetConfigurationSetOutput{} 2569 out.Result = output 2570 2571 var buff [1024]byte 2572 ringBuffer := smithyio.NewRingBuffer(buff[:]) 2573 2574 body := io.TeeReader(response.Body, ringBuffer) 2575 2576 decoder := json.NewDecoder(body) 2577 decoder.UseNumber() 2578 var shape interface{} 2579 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 2580 var snapshot bytes.Buffer 2581 io.Copy(&snapshot, ringBuffer) 2582 err = &smithy.DeserializationError{ 2583 Err: fmt.Errorf("failed to decode response body, %w", err), 2584 Snapshot: snapshot.Bytes(), 2585 } 2586 return out, metadata, err 2587 } 2588 2589 err = awsRestjson1_deserializeOpDocumentGetConfigurationSetOutput(&output, shape) 2590 if err != nil { 2591 var snapshot bytes.Buffer 2592 io.Copy(&snapshot, ringBuffer) 2593 return out, metadata, &smithy.DeserializationError{ 2594 Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), 2595 Snapshot: snapshot.Bytes(), 2596 } 2597 } 2598 2599 return out, metadata, err 2600} 2601 2602func awsRestjson1_deserializeOpErrorGetConfigurationSet(response *smithyhttp.Response, metadata *middleware.Metadata) error { 2603 var errorBuffer bytes.Buffer 2604 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 2605 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 2606 } 2607 errorBody := bytes.NewReader(errorBuffer.Bytes()) 2608 2609 errorCode := "UnknownError" 2610 errorMessage := errorCode 2611 2612 code := response.Header.Get("X-Amzn-ErrorType") 2613 if len(code) != 0 { 2614 errorCode = restjson.SanitizeErrorCode(code) 2615 } 2616 2617 var buff [1024]byte 2618 ringBuffer := smithyio.NewRingBuffer(buff[:]) 2619 2620 body := io.TeeReader(errorBody, ringBuffer) 2621 decoder := json.NewDecoder(body) 2622 decoder.UseNumber() 2623 code, message, err := restjson.GetErrorInfo(decoder) 2624 if err != nil { 2625 var snapshot bytes.Buffer 2626 io.Copy(&snapshot, ringBuffer) 2627 err = &smithy.DeserializationError{ 2628 Err: fmt.Errorf("failed to decode response body, %w", err), 2629 Snapshot: snapshot.Bytes(), 2630 } 2631 return err 2632 } 2633 2634 errorBody.Seek(0, io.SeekStart) 2635 if len(code) != 0 { 2636 errorCode = restjson.SanitizeErrorCode(code) 2637 } 2638 if len(message) != 0 { 2639 errorMessage = message 2640 } 2641 2642 switch { 2643 case strings.EqualFold("BadRequestException", errorCode): 2644 return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) 2645 2646 case strings.EqualFold("NotFoundException", errorCode): 2647 return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) 2648 2649 case strings.EqualFold("TooManyRequestsException", errorCode): 2650 return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody) 2651 2652 default: 2653 genericError := &smithy.GenericAPIError{ 2654 Code: errorCode, 2655 Message: errorMessage, 2656 } 2657 return genericError 2658 2659 } 2660} 2661 2662func awsRestjson1_deserializeOpDocumentGetConfigurationSetOutput(v **GetConfigurationSetOutput, value interface{}) error { 2663 if v == nil { 2664 return fmt.Errorf("unexpected nil of type %T", v) 2665 } 2666 if value == nil { 2667 return nil 2668 } 2669 2670 shape, ok := value.(map[string]interface{}) 2671 if !ok { 2672 return fmt.Errorf("unexpected JSON type %v", value) 2673 } 2674 2675 var sv *GetConfigurationSetOutput 2676 if *v == nil { 2677 sv = &GetConfigurationSetOutput{} 2678 } else { 2679 sv = *v 2680 } 2681 2682 for key, value := range shape { 2683 switch key { 2684 case "ConfigurationSetName": 2685 if value != nil { 2686 jtv, ok := value.(string) 2687 if !ok { 2688 return fmt.Errorf("expected ConfigurationSetName to be of type string, got %T instead", value) 2689 } 2690 sv.ConfigurationSetName = ptr.String(jtv) 2691 } 2692 2693 case "DeliveryOptions": 2694 if err := awsRestjson1_deserializeDocumentDeliveryOptions(&sv.DeliveryOptions, value); err != nil { 2695 return err 2696 } 2697 2698 case "ReputationOptions": 2699 if err := awsRestjson1_deserializeDocumentReputationOptions(&sv.ReputationOptions, value); err != nil { 2700 return err 2701 } 2702 2703 case "SendingOptions": 2704 if err := awsRestjson1_deserializeDocumentSendingOptions(&sv.SendingOptions, value); err != nil { 2705 return err 2706 } 2707 2708 case "SuppressionOptions": 2709 if err := awsRestjson1_deserializeDocumentSuppressionOptions(&sv.SuppressionOptions, value); err != nil { 2710 return err 2711 } 2712 2713 case "Tags": 2714 if err := awsRestjson1_deserializeDocumentTagList(&sv.Tags, value); err != nil { 2715 return err 2716 } 2717 2718 case "TrackingOptions": 2719 if err := awsRestjson1_deserializeDocumentTrackingOptions(&sv.TrackingOptions, value); err != nil { 2720 return err 2721 } 2722 2723 default: 2724 _, _ = key, value 2725 2726 } 2727 } 2728 *v = sv 2729 return nil 2730} 2731 2732type awsRestjson1_deserializeOpGetConfigurationSetEventDestinations struct { 2733} 2734 2735func (*awsRestjson1_deserializeOpGetConfigurationSetEventDestinations) ID() string { 2736 return "OperationDeserializer" 2737} 2738 2739func (m *awsRestjson1_deserializeOpGetConfigurationSetEventDestinations) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 2740 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 2741) { 2742 out, metadata, err = next.HandleDeserialize(ctx, in) 2743 if err != nil { 2744 return out, metadata, err 2745 } 2746 2747 response, ok := out.RawResponse.(*smithyhttp.Response) 2748 if !ok { 2749 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 2750 } 2751 2752 if response.StatusCode < 200 || response.StatusCode >= 300 { 2753 return out, metadata, awsRestjson1_deserializeOpErrorGetConfigurationSetEventDestinations(response, &metadata) 2754 } 2755 output := &GetConfigurationSetEventDestinationsOutput{} 2756 out.Result = output 2757 2758 var buff [1024]byte 2759 ringBuffer := smithyio.NewRingBuffer(buff[:]) 2760 2761 body := io.TeeReader(response.Body, ringBuffer) 2762 2763 decoder := json.NewDecoder(body) 2764 decoder.UseNumber() 2765 var shape interface{} 2766 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 2767 var snapshot bytes.Buffer 2768 io.Copy(&snapshot, ringBuffer) 2769 err = &smithy.DeserializationError{ 2770 Err: fmt.Errorf("failed to decode response body, %w", err), 2771 Snapshot: snapshot.Bytes(), 2772 } 2773 return out, metadata, err 2774 } 2775 2776 err = awsRestjson1_deserializeOpDocumentGetConfigurationSetEventDestinationsOutput(&output, shape) 2777 if err != nil { 2778 var snapshot bytes.Buffer 2779 io.Copy(&snapshot, ringBuffer) 2780 return out, metadata, &smithy.DeserializationError{ 2781 Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), 2782 Snapshot: snapshot.Bytes(), 2783 } 2784 } 2785 2786 return out, metadata, err 2787} 2788 2789func awsRestjson1_deserializeOpErrorGetConfigurationSetEventDestinations(response *smithyhttp.Response, metadata *middleware.Metadata) error { 2790 var errorBuffer bytes.Buffer 2791 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 2792 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 2793 } 2794 errorBody := bytes.NewReader(errorBuffer.Bytes()) 2795 2796 errorCode := "UnknownError" 2797 errorMessage := errorCode 2798 2799 code := response.Header.Get("X-Amzn-ErrorType") 2800 if len(code) != 0 { 2801 errorCode = restjson.SanitizeErrorCode(code) 2802 } 2803 2804 var buff [1024]byte 2805 ringBuffer := smithyio.NewRingBuffer(buff[:]) 2806 2807 body := io.TeeReader(errorBody, ringBuffer) 2808 decoder := json.NewDecoder(body) 2809 decoder.UseNumber() 2810 code, message, err := restjson.GetErrorInfo(decoder) 2811 if err != nil { 2812 var snapshot bytes.Buffer 2813 io.Copy(&snapshot, ringBuffer) 2814 err = &smithy.DeserializationError{ 2815 Err: fmt.Errorf("failed to decode response body, %w", err), 2816 Snapshot: snapshot.Bytes(), 2817 } 2818 return err 2819 } 2820 2821 errorBody.Seek(0, io.SeekStart) 2822 if len(code) != 0 { 2823 errorCode = restjson.SanitizeErrorCode(code) 2824 } 2825 if len(message) != 0 { 2826 errorMessage = message 2827 } 2828 2829 switch { 2830 case strings.EqualFold("BadRequestException", errorCode): 2831 return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) 2832 2833 case strings.EqualFold("NotFoundException", errorCode): 2834 return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) 2835 2836 case strings.EqualFold("TooManyRequestsException", errorCode): 2837 return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody) 2838 2839 default: 2840 genericError := &smithy.GenericAPIError{ 2841 Code: errorCode, 2842 Message: errorMessage, 2843 } 2844 return genericError 2845 2846 } 2847} 2848 2849func awsRestjson1_deserializeOpDocumentGetConfigurationSetEventDestinationsOutput(v **GetConfigurationSetEventDestinationsOutput, value interface{}) error { 2850 if v == nil { 2851 return fmt.Errorf("unexpected nil of type %T", v) 2852 } 2853 if value == nil { 2854 return nil 2855 } 2856 2857 shape, ok := value.(map[string]interface{}) 2858 if !ok { 2859 return fmt.Errorf("unexpected JSON type %v", value) 2860 } 2861 2862 var sv *GetConfigurationSetEventDestinationsOutput 2863 if *v == nil { 2864 sv = &GetConfigurationSetEventDestinationsOutput{} 2865 } else { 2866 sv = *v 2867 } 2868 2869 for key, value := range shape { 2870 switch key { 2871 case "EventDestinations": 2872 if err := awsRestjson1_deserializeDocumentEventDestinations(&sv.EventDestinations, value); err != nil { 2873 return err 2874 } 2875 2876 default: 2877 _, _ = key, value 2878 2879 } 2880 } 2881 *v = sv 2882 return nil 2883} 2884 2885type awsRestjson1_deserializeOpGetContact struct { 2886} 2887 2888func (*awsRestjson1_deserializeOpGetContact) ID() string { 2889 return "OperationDeserializer" 2890} 2891 2892func (m *awsRestjson1_deserializeOpGetContact) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 2893 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 2894) { 2895 out, metadata, err = next.HandleDeserialize(ctx, in) 2896 if err != nil { 2897 return out, metadata, err 2898 } 2899 2900 response, ok := out.RawResponse.(*smithyhttp.Response) 2901 if !ok { 2902 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 2903 } 2904 2905 if response.StatusCode < 200 || response.StatusCode >= 300 { 2906 return out, metadata, awsRestjson1_deserializeOpErrorGetContact(response, &metadata) 2907 } 2908 output := &GetContactOutput{} 2909 out.Result = output 2910 2911 var buff [1024]byte 2912 ringBuffer := smithyio.NewRingBuffer(buff[:]) 2913 2914 body := io.TeeReader(response.Body, ringBuffer) 2915 2916 decoder := json.NewDecoder(body) 2917 decoder.UseNumber() 2918 var shape interface{} 2919 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 2920 var snapshot bytes.Buffer 2921 io.Copy(&snapshot, ringBuffer) 2922 err = &smithy.DeserializationError{ 2923 Err: fmt.Errorf("failed to decode response body, %w", err), 2924 Snapshot: snapshot.Bytes(), 2925 } 2926 return out, metadata, err 2927 } 2928 2929 err = awsRestjson1_deserializeOpDocumentGetContactOutput(&output, shape) 2930 if err != nil { 2931 var snapshot bytes.Buffer 2932 io.Copy(&snapshot, ringBuffer) 2933 return out, metadata, &smithy.DeserializationError{ 2934 Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), 2935 Snapshot: snapshot.Bytes(), 2936 } 2937 } 2938 2939 return out, metadata, err 2940} 2941 2942func awsRestjson1_deserializeOpErrorGetContact(response *smithyhttp.Response, metadata *middleware.Metadata) error { 2943 var errorBuffer bytes.Buffer 2944 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 2945 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 2946 } 2947 errorBody := bytes.NewReader(errorBuffer.Bytes()) 2948 2949 errorCode := "UnknownError" 2950 errorMessage := errorCode 2951 2952 code := response.Header.Get("X-Amzn-ErrorType") 2953 if len(code) != 0 { 2954 errorCode = restjson.SanitizeErrorCode(code) 2955 } 2956 2957 var buff [1024]byte 2958 ringBuffer := smithyio.NewRingBuffer(buff[:]) 2959 2960 body := io.TeeReader(errorBody, ringBuffer) 2961 decoder := json.NewDecoder(body) 2962 decoder.UseNumber() 2963 code, message, err := restjson.GetErrorInfo(decoder) 2964 if err != nil { 2965 var snapshot bytes.Buffer 2966 io.Copy(&snapshot, ringBuffer) 2967 err = &smithy.DeserializationError{ 2968 Err: fmt.Errorf("failed to decode response body, %w", err), 2969 Snapshot: snapshot.Bytes(), 2970 } 2971 return err 2972 } 2973 2974 errorBody.Seek(0, io.SeekStart) 2975 if len(code) != 0 { 2976 errorCode = restjson.SanitizeErrorCode(code) 2977 } 2978 if len(message) != 0 { 2979 errorMessage = message 2980 } 2981 2982 switch { 2983 case strings.EqualFold("BadRequestException", errorCode): 2984 return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) 2985 2986 case strings.EqualFold("NotFoundException", errorCode): 2987 return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) 2988 2989 case strings.EqualFold("TooManyRequestsException", errorCode): 2990 return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody) 2991 2992 default: 2993 genericError := &smithy.GenericAPIError{ 2994 Code: errorCode, 2995 Message: errorMessage, 2996 } 2997 return genericError 2998 2999 } 3000} 3001 3002func awsRestjson1_deserializeOpDocumentGetContactOutput(v **GetContactOutput, value interface{}) error { 3003 if v == nil { 3004 return fmt.Errorf("unexpected nil of type %T", v) 3005 } 3006 if value == nil { 3007 return nil 3008 } 3009 3010 shape, ok := value.(map[string]interface{}) 3011 if !ok { 3012 return fmt.Errorf("unexpected JSON type %v", value) 3013 } 3014 3015 var sv *GetContactOutput 3016 if *v == nil { 3017 sv = &GetContactOutput{} 3018 } else { 3019 sv = *v 3020 } 3021 3022 for key, value := range shape { 3023 switch key { 3024 case "AttributesData": 3025 if value != nil { 3026 jtv, ok := value.(string) 3027 if !ok { 3028 return fmt.Errorf("expected AttributesData to be of type string, got %T instead", value) 3029 } 3030 sv.AttributesData = ptr.String(jtv) 3031 } 3032 3033 case "ContactListName": 3034 if value != nil { 3035 jtv, ok := value.(string) 3036 if !ok { 3037 return fmt.Errorf("expected ContactListName to be of type string, got %T instead", value) 3038 } 3039 sv.ContactListName = ptr.String(jtv) 3040 } 3041 3042 case "CreatedTimestamp": 3043 if value != nil { 3044 jtv, ok := value.(json.Number) 3045 if !ok { 3046 return fmt.Errorf("expected Timestamp to be json.Number, got %T instead", value) 3047 } 3048 f64, err := jtv.Float64() 3049 if err != nil { 3050 return err 3051 } 3052 sv.CreatedTimestamp = ptr.Time(smithytime.ParseEpochSeconds(f64)) 3053 } 3054 3055 case "EmailAddress": 3056 if value != nil { 3057 jtv, ok := value.(string) 3058 if !ok { 3059 return fmt.Errorf("expected EmailAddress to be of type string, got %T instead", value) 3060 } 3061 sv.EmailAddress = ptr.String(jtv) 3062 } 3063 3064 case "LastUpdatedTimestamp": 3065 if value != nil { 3066 jtv, ok := value.(json.Number) 3067 if !ok { 3068 return fmt.Errorf("expected Timestamp to be json.Number, got %T instead", value) 3069 } 3070 f64, err := jtv.Float64() 3071 if err != nil { 3072 return err 3073 } 3074 sv.LastUpdatedTimestamp = ptr.Time(smithytime.ParseEpochSeconds(f64)) 3075 } 3076 3077 case "TopicDefaultPreferences": 3078 if err := awsRestjson1_deserializeDocumentTopicPreferenceList(&sv.TopicDefaultPreferences, value); err != nil { 3079 return err 3080 } 3081 3082 case "TopicPreferences": 3083 if err := awsRestjson1_deserializeDocumentTopicPreferenceList(&sv.TopicPreferences, value); err != nil { 3084 return err 3085 } 3086 3087 case "UnsubscribeAll": 3088 if value != nil { 3089 jtv, ok := value.(bool) 3090 if !ok { 3091 return fmt.Errorf("expected UnsubscribeAll to be of type *bool, got %T instead", value) 3092 } 3093 sv.UnsubscribeAll = jtv 3094 } 3095 3096 default: 3097 _, _ = key, value 3098 3099 } 3100 } 3101 *v = sv 3102 return nil 3103} 3104 3105type awsRestjson1_deserializeOpGetContactList struct { 3106} 3107 3108func (*awsRestjson1_deserializeOpGetContactList) ID() string { 3109 return "OperationDeserializer" 3110} 3111 3112func (m *awsRestjson1_deserializeOpGetContactList) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 3113 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 3114) { 3115 out, metadata, err = next.HandleDeserialize(ctx, in) 3116 if err != nil { 3117 return out, metadata, err 3118 } 3119 3120 response, ok := out.RawResponse.(*smithyhttp.Response) 3121 if !ok { 3122 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 3123 } 3124 3125 if response.StatusCode < 200 || response.StatusCode >= 300 { 3126 return out, metadata, awsRestjson1_deserializeOpErrorGetContactList(response, &metadata) 3127 } 3128 output := &GetContactListOutput{} 3129 out.Result = output 3130 3131 var buff [1024]byte 3132 ringBuffer := smithyio.NewRingBuffer(buff[:]) 3133 3134 body := io.TeeReader(response.Body, ringBuffer) 3135 3136 decoder := json.NewDecoder(body) 3137 decoder.UseNumber() 3138 var shape interface{} 3139 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 3140 var snapshot bytes.Buffer 3141 io.Copy(&snapshot, ringBuffer) 3142 err = &smithy.DeserializationError{ 3143 Err: fmt.Errorf("failed to decode response body, %w", err), 3144 Snapshot: snapshot.Bytes(), 3145 } 3146 return out, metadata, err 3147 } 3148 3149 err = awsRestjson1_deserializeOpDocumentGetContactListOutput(&output, shape) 3150 if err != nil { 3151 var snapshot bytes.Buffer 3152 io.Copy(&snapshot, ringBuffer) 3153 return out, metadata, &smithy.DeserializationError{ 3154 Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), 3155 Snapshot: snapshot.Bytes(), 3156 } 3157 } 3158 3159 return out, metadata, err 3160} 3161 3162func awsRestjson1_deserializeOpErrorGetContactList(response *smithyhttp.Response, metadata *middleware.Metadata) error { 3163 var errorBuffer bytes.Buffer 3164 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 3165 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 3166 } 3167 errorBody := bytes.NewReader(errorBuffer.Bytes()) 3168 3169 errorCode := "UnknownError" 3170 errorMessage := errorCode 3171 3172 code := response.Header.Get("X-Amzn-ErrorType") 3173 if len(code) != 0 { 3174 errorCode = restjson.SanitizeErrorCode(code) 3175 } 3176 3177 var buff [1024]byte 3178 ringBuffer := smithyio.NewRingBuffer(buff[:]) 3179 3180 body := io.TeeReader(errorBody, ringBuffer) 3181 decoder := json.NewDecoder(body) 3182 decoder.UseNumber() 3183 code, message, err := restjson.GetErrorInfo(decoder) 3184 if err != nil { 3185 var snapshot bytes.Buffer 3186 io.Copy(&snapshot, ringBuffer) 3187 err = &smithy.DeserializationError{ 3188 Err: fmt.Errorf("failed to decode response body, %w", err), 3189 Snapshot: snapshot.Bytes(), 3190 } 3191 return err 3192 } 3193 3194 errorBody.Seek(0, io.SeekStart) 3195 if len(code) != 0 { 3196 errorCode = restjson.SanitizeErrorCode(code) 3197 } 3198 if len(message) != 0 { 3199 errorMessage = message 3200 } 3201 3202 switch { 3203 case strings.EqualFold("BadRequestException", errorCode): 3204 return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) 3205 3206 case strings.EqualFold("NotFoundException", errorCode): 3207 return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) 3208 3209 case strings.EqualFold("TooManyRequestsException", errorCode): 3210 return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody) 3211 3212 default: 3213 genericError := &smithy.GenericAPIError{ 3214 Code: errorCode, 3215 Message: errorMessage, 3216 } 3217 return genericError 3218 3219 } 3220} 3221 3222func awsRestjson1_deserializeOpDocumentGetContactListOutput(v **GetContactListOutput, value interface{}) error { 3223 if v == nil { 3224 return fmt.Errorf("unexpected nil of type %T", v) 3225 } 3226 if value == nil { 3227 return nil 3228 } 3229 3230 shape, ok := value.(map[string]interface{}) 3231 if !ok { 3232 return fmt.Errorf("unexpected JSON type %v", value) 3233 } 3234 3235 var sv *GetContactListOutput 3236 if *v == nil { 3237 sv = &GetContactListOutput{} 3238 } else { 3239 sv = *v 3240 } 3241 3242 for key, value := range shape { 3243 switch key { 3244 case "ContactListName": 3245 if value != nil { 3246 jtv, ok := value.(string) 3247 if !ok { 3248 return fmt.Errorf("expected ContactListName to be of type string, got %T instead", value) 3249 } 3250 sv.ContactListName = ptr.String(jtv) 3251 } 3252 3253 case "CreatedTimestamp": 3254 if value != nil { 3255 jtv, ok := value.(json.Number) 3256 if !ok { 3257 return fmt.Errorf("expected Timestamp to be json.Number, got %T instead", value) 3258 } 3259 f64, err := jtv.Float64() 3260 if err != nil { 3261 return err 3262 } 3263 sv.CreatedTimestamp = ptr.Time(smithytime.ParseEpochSeconds(f64)) 3264 } 3265 3266 case "Description": 3267 if value != nil { 3268 jtv, ok := value.(string) 3269 if !ok { 3270 return fmt.Errorf("expected Description to be of type string, got %T instead", value) 3271 } 3272 sv.Description = ptr.String(jtv) 3273 } 3274 3275 case "LastUpdatedTimestamp": 3276 if value != nil { 3277 jtv, ok := value.(json.Number) 3278 if !ok { 3279 return fmt.Errorf("expected Timestamp to be json.Number, got %T instead", value) 3280 } 3281 f64, err := jtv.Float64() 3282 if err != nil { 3283 return err 3284 } 3285 sv.LastUpdatedTimestamp = ptr.Time(smithytime.ParseEpochSeconds(f64)) 3286 } 3287 3288 case "Tags": 3289 if err := awsRestjson1_deserializeDocumentTagList(&sv.Tags, value); err != nil { 3290 return err 3291 } 3292 3293 case "Topics": 3294 if err := awsRestjson1_deserializeDocumentTopics(&sv.Topics, value); err != nil { 3295 return err 3296 } 3297 3298 default: 3299 _, _ = key, value 3300 3301 } 3302 } 3303 *v = sv 3304 return nil 3305} 3306 3307type awsRestjson1_deserializeOpGetCustomVerificationEmailTemplate struct { 3308} 3309 3310func (*awsRestjson1_deserializeOpGetCustomVerificationEmailTemplate) ID() string { 3311 return "OperationDeserializer" 3312} 3313 3314func (m *awsRestjson1_deserializeOpGetCustomVerificationEmailTemplate) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 3315 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 3316) { 3317 out, metadata, err = next.HandleDeserialize(ctx, in) 3318 if err != nil { 3319 return out, metadata, err 3320 } 3321 3322 response, ok := out.RawResponse.(*smithyhttp.Response) 3323 if !ok { 3324 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 3325 } 3326 3327 if response.StatusCode < 200 || response.StatusCode >= 300 { 3328 return out, metadata, awsRestjson1_deserializeOpErrorGetCustomVerificationEmailTemplate(response, &metadata) 3329 } 3330 output := &GetCustomVerificationEmailTemplateOutput{} 3331 out.Result = output 3332 3333 var buff [1024]byte 3334 ringBuffer := smithyio.NewRingBuffer(buff[:]) 3335 3336 body := io.TeeReader(response.Body, ringBuffer) 3337 3338 decoder := json.NewDecoder(body) 3339 decoder.UseNumber() 3340 var shape interface{} 3341 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 3342 var snapshot bytes.Buffer 3343 io.Copy(&snapshot, ringBuffer) 3344 err = &smithy.DeserializationError{ 3345 Err: fmt.Errorf("failed to decode response body, %w", err), 3346 Snapshot: snapshot.Bytes(), 3347 } 3348 return out, metadata, err 3349 } 3350 3351 err = awsRestjson1_deserializeOpDocumentGetCustomVerificationEmailTemplateOutput(&output, shape) 3352 if err != nil { 3353 var snapshot bytes.Buffer 3354 io.Copy(&snapshot, ringBuffer) 3355 return out, metadata, &smithy.DeserializationError{ 3356 Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), 3357 Snapshot: snapshot.Bytes(), 3358 } 3359 } 3360 3361 return out, metadata, err 3362} 3363 3364func awsRestjson1_deserializeOpErrorGetCustomVerificationEmailTemplate(response *smithyhttp.Response, metadata *middleware.Metadata) error { 3365 var errorBuffer bytes.Buffer 3366 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 3367 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 3368 } 3369 errorBody := bytes.NewReader(errorBuffer.Bytes()) 3370 3371 errorCode := "UnknownError" 3372 errorMessage := errorCode 3373 3374 code := response.Header.Get("X-Amzn-ErrorType") 3375 if len(code) != 0 { 3376 errorCode = restjson.SanitizeErrorCode(code) 3377 } 3378 3379 var buff [1024]byte 3380 ringBuffer := smithyio.NewRingBuffer(buff[:]) 3381 3382 body := io.TeeReader(errorBody, ringBuffer) 3383 decoder := json.NewDecoder(body) 3384 decoder.UseNumber() 3385 code, message, err := restjson.GetErrorInfo(decoder) 3386 if err != nil { 3387 var snapshot bytes.Buffer 3388 io.Copy(&snapshot, ringBuffer) 3389 err = &smithy.DeserializationError{ 3390 Err: fmt.Errorf("failed to decode response body, %w", err), 3391 Snapshot: snapshot.Bytes(), 3392 } 3393 return err 3394 } 3395 3396 errorBody.Seek(0, io.SeekStart) 3397 if len(code) != 0 { 3398 errorCode = restjson.SanitizeErrorCode(code) 3399 } 3400 if len(message) != 0 { 3401 errorMessage = message 3402 } 3403 3404 switch { 3405 case strings.EqualFold("BadRequestException", errorCode): 3406 return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) 3407 3408 case strings.EqualFold("NotFoundException", errorCode): 3409 return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) 3410 3411 case strings.EqualFold("TooManyRequestsException", errorCode): 3412 return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody) 3413 3414 default: 3415 genericError := &smithy.GenericAPIError{ 3416 Code: errorCode, 3417 Message: errorMessage, 3418 } 3419 return genericError 3420 3421 } 3422} 3423 3424func awsRestjson1_deserializeOpDocumentGetCustomVerificationEmailTemplateOutput(v **GetCustomVerificationEmailTemplateOutput, value interface{}) error { 3425 if v == nil { 3426 return fmt.Errorf("unexpected nil of type %T", v) 3427 } 3428 if value == nil { 3429 return nil 3430 } 3431 3432 shape, ok := value.(map[string]interface{}) 3433 if !ok { 3434 return fmt.Errorf("unexpected JSON type %v", value) 3435 } 3436 3437 var sv *GetCustomVerificationEmailTemplateOutput 3438 if *v == nil { 3439 sv = &GetCustomVerificationEmailTemplateOutput{} 3440 } else { 3441 sv = *v 3442 } 3443 3444 for key, value := range shape { 3445 switch key { 3446 case "FailureRedirectionURL": 3447 if value != nil { 3448 jtv, ok := value.(string) 3449 if !ok { 3450 return fmt.Errorf("expected FailureRedirectionURL to be of type string, got %T instead", value) 3451 } 3452 sv.FailureRedirectionURL = ptr.String(jtv) 3453 } 3454 3455 case "FromEmailAddress": 3456 if value != nil { 3457 jtv, ok := value.(string) 3458 if !ok { 3459 return fmt.Errorf("expected EmailAddress to be of type string, got %T instead", value) 3460 } 3461 sv.FromEmailAddress = ptr.String(jtv) 3462 } 3463 3464 case "SuccessRedirectionURL": 3465 if value != nil { 3466 jtv, ok := value.(string) 3467 if !ok { 3468 return fmt.Errorf("expected SuccessRedirectionURL to be of type string, got %T instead", value) 3469 } 3470 sv.SuccessRedirectionURL = ptr.String(jtv) 3471 } 3472 3473 case "TemplateContent": 3474 if value != nil { 3475 jtv, ok := value.(string) 3476 if !ok { 3477 return fmt.Errorf("expected TemplateContent to be of type string, got %T instead", value) 3478 } 3479 sv.TemplateContent = ptr.String(jtv) 3480 } 3481 3482 case "TemplateName": 3483 if value != nil { 3484 jtv, ok := value.(string) 3485 if !ok { 3486 return fmt.Errorf("expected EmailTemplateName to be of type string, got %T instead", value) 3487 } 3488 sv.TemplateName = ptr.String(jtv) 3489 } 3490 3491 case "TemplateSubject": 3492 if value != nil { 3493 jtv, ok := value.(string) 3494 if !ok { 3495 return fmt.Errorf("expected EmailTemplateSubject to be of type string, got %T instead", value) 3496 } 3497 sv.TemplateSubject = ptr.String(jtv) 3498 } 3499 3500 default: 3501 _, _ = key, value 3502 3503 } 3504 } 3505 *v = sv 3506 return nil 3507} 3508 3509type awsRestjson1_deserializeOpGetDedicatedIp struct { 3510} 3511 3512func (*awsRestjson1_deserializeOpGetDedicatedIp) ID() string { 3513 return "OperationDeserializer" 3514} 3515 3516func (m *awsRestjson1_deserializeOpGetDedicatedIp) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 3517 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 3518) { 3519 out, metadata, err = next.HandleDeserialize(ctx, in) 3520 if err != nil { 3521 return out, metadata, err 3522 } 3523 3524 response, ok := out.RawResponse.(*smithyhttp.Response) 3525 if !ok { 3526 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 3527 } 3528 3529 if response.StatusCode < 200 || response.StatusCode >= 300 { 3530 return out, metadata, awsRestjson1_deserializeOpErrorGetDedicatedIp(response, &metadata) 3531 } 3532 output := &GetDedicatedIpOutput{} 3533 out.Result = output 3534 3535 var buff [1024]byte 3536 ringBuffer := smithyio.NewRingBuffer(buff[:]) 3537 3538 body := io.TeeReader(response.Body, ringBuffer) 3539 3540 decoder := json.NewDecoder(body) 3541 decoder.UseNumber() 3542 var shape interface{} 3543 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 3544 var snapshot bytes.Buffer 3545 io.Copy(&snapshot, ringBuffer) 3546 err = &smithy.DeserializationError{ 3547 Err: fmt.Errorf("failed to decode response body, %w", err), 3548 Snapshot: snapshot.Bytes(), 3549 } 3550 return out, metadata, err 3551 } 3552 3553 err = awsRestjson1_deserializeOpDocumentGetDedicatedIpOutput(&output, shape) 3554 if err != nil { 3555 var snapshot bytes.Buffer 3556 io.Copy(&snapshot, ringBuffer) 3557 return out, metadata, &smithy.DeserializationError{ 3558 Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), 3559 Snapshot: snapshot.Bytes(), 3560 } 3561 } 3562 3563 return out, metadata, err 3564} 3565 3566func awsRestjson1_deserializeOpErrorGetDedicatedIp(response *smithyhttp.Response, metadata *middleware.Metadata) error { 3567 var errorBuffer bytes.Buffer 3568 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 3569 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 3570 } 3571 errorBody := bytes.NewReader(errorBuffer.Bytes()) 3572 3573 errorCode := "UnknownError" 3574 errorMessage := errorCode 3575 3576 code := response.Header.Get("X-Amzn-ErrorType") 3577 if len(code) != 0 { 3578 errorCode = restjson.SanitizeErrorCode(code) 3579 } 3580 3581 var buff [1024]byte 3582 ringBuffer := smithyio.NewRingBuffer(buff[:]) 3583 3584 body := io.TeeReader(errorBody, ringBuffer) 3585 decoder := json.NewDecoder(body) 3586 decoder.UseNumber() 3587 code, message, err := restjson.GetErrorInfo(decoder) 3588 if err != nil { 3589 var snapshot bytes.Buffer 3590 io.Copy(&snapshot, ringBuffer) 3591 err = &smithy.DeserializationError{ 3592 Err: fmt.Errorf("failed to decode response body, %w", err), 3593 Snapshot: snapshot.Bytes(), 3594 } 3595 return err 3596 } 3597 3598 errorBody.Seek(0, io.SeekStart) 3599 if len(code) != 0 { 3600 errorCode = restjson.SanitizeErrorCode(code) 3601 } 3602 if len(message) != 0 { 3603 errorMessage = message 3604 } 3605 3606 switch { 3607 case strings.EqualFold("BadRequestException", errorCode): 3608 return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) 3609 3610 case strings.EqualFold("NotFoundException", errorCode): 3611 return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) 3612 3613 case strings.EqualFold("TooManyRequestsException", errorCode): 3614 return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody) 3615 3616 default: 3617 genericError := &smithy.GenericAPIError{ 3618 Code: errorCode, 3619 Message: errorMessage, 3620 } 3621 return genericError 3622 3623 } 3624} 3625 3626func awsRestjson1_deserializeOpDocumentGetDedicatedIpOutput(v **GetDedicatedIpOutput, value interface{}) error { 3627 if v == nil { 3628 return fmt.Errorf("unexpected nil of type %T", v) 3629 } 3630 if value == nil { 3631 return nil 3632 } 3633 3634 shape, ok := value.(map[string]interface{}) 3635 if !ok { 3636 return fmt.Errorf("unexpected JSON type %v", value) 3637 } 3638 3639 var sv *GetDedicatedIpOutput 3640 if *v == nil { 3641 sv = &GetDedicatedIpOutput{} 3642 } else { 3643 sv = *v 3644 } 3645 3646 for key, value := range shape { 3647 switch key { 3648 case "DedicatedIp": 3649 if err := awsRestjson1_deserializeDocumentDedicatedIp(&sv.DedicatedIp, value); err != nil { 3650 return err 3651 } 3652 3653 default: 3654 _, _ = key, value 3655 3656 } 3657 } 3658 *v = sv 3659 return nil 3660} 3661 3662type awsRestjson1_deserializeOpGetDedicatedIps struct { 3663} 3664 3665func (*awsRestjson1_deserializeOpGetDedicatedIps) ID() string { 3666 return "OperationDeserializer" 3667} 3668 3669func (m *awsRestjson1_deserializeOpGetDedicatedIps) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 3670 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 3671) { 3672 out, metadata, err = next.HandleDeserialize(ctx, in) 3673 if err != nil { 3674 return out, metadata, err 3675 } 3676 3677 response, ok := out.RawResponse.(*smithyhttp.Response) 3678 if !ok { 3679 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 3680 } 3681 3682 if response.StatusCode < 200 || response.StatusCode >= 300 { 3683 return out, metadata, awsRestjson1_deserializeOpErrorGetDedicatedIps(response, &metadata) 3684 } 3685 output := &GetDedicatedIpsOutput{} 3686 out.Result = output 3687 3688 var buff [1024]byte 3689 ringBuffer := smithyio.NewRingBuffer(buff[:]) 3690 3691 body := io.TeeReader(response.Body, ringBuffer) 3692 3693 decoder := json.NewDecoder(body) 3694 decoder.UseNumber() 3695 var shape interface{} 3696 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 3697 var snapshot bytes.Buffer 3698 io.Copy(&snapshot, ringBuffer) 3699 err = &smithy.DeserializationError{ 3700 Err: fmt.Errorf("failed to decode response body, %w", err), 3701 Snapshot: snapshot.Bytes(), 3702 } 3703 return out, metadata, err 3704 } 3705 3706 err = awsRestjson1_deserializeOpDocumentGetDedicatedIpsOutput(&output, shape) 3707 if err != nil { 3708 var snapshot bytes.Buffer 3709 io.Copy(&snapshot, ringBuffer) 3710 return out, metadata, &smithy.DeserializationError{ 3711 Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), 3712 Snapshot: snapshot.Bytes(), 3713 } 3714 } 3715 3716 return out, metadata, err 3717} 3718 3719func awsRestjson1_deserializeOpErrorGetDedicatedIps(response *smithyhttp.Response, metadata *middleware.Metadata) error { 3720 var errorBuffer bytes.Buffer 3721 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 3722 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 3723 } 3724 errorBody := bytes.NewReader(errorBuffer.Bytes()) 3725 3726 errorCode := "UnknownError" 3727 errorMessage := errorCode 3728 3729 code := response.Header.Get("X-Amzn-ErrorType") 3730 if len(code) != 0 { 3731 errorCode = restjson.SanitizeErrorCode(code) 3732 } 3733 3734 var buff [1024]byte 3735 ringBuffer := smithyio.NewRingBuffer(buff[:]) 3736 3737 body := io.TeeReader(errorBody, ringBuffer) 3738 decoder := json.NewDecoder(body) 3739 decoder.UseNumber() 3740 code, message, err := restjson.GetErrorInfo(decoder) 3741 if err != nil { 3742 var snapshot bytes.Buffer 3743 io.Copy(&snapshot, ringBuffer) 3744 err = &smithy.DeserializationError{ 3745 Err: fmt.Errorf("failed to decode response body, %w", err), 3746 Snapshot: snapshot.Bytes(), 3747 } 3748 return err 3749 } 3750 3751 errorBody.Seek(0, io.SeekStart) 3752 if len(code) != 0 { 3753 errorCode = restjson.SanitizeErrorCode(code) 3754 } 3755 if len(message) != 0 { 3756 errorMessage = message 3757 } 3758 3759 switch { 3760 case strings.EqualFold("BadRequestException", errorCode): 3761 return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) 3762 3763 case strings.EqualFold("NotFoundException", errorCode): 3764 return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) 3765 3766 case strings.EqualFold("TooManyRequestsException", errorCode): 3767 return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody) 3768 3769 default: 3770 genericError := &smithy.GenericAPIError{ 3771 Code: errorCode, 3772 Message: errorMessage, 3773 } 3774 return genericError 3775 3776 } 3777} 3778 3779func awsRestjson1_deserializeOpDocumentGetDedicatedIpsOutput(v **GetDedicatedIpsOutput, value interface{}) error { 3780 if v == nil { 3781 return fmt.Errorf("unexpected nil of type %T", v) 3782 } 3783 if value == nil { 3784 return nil 3785 } 3786 3787 shape, ok := value.(map[string]interface{}) 3788 if !ok { 3789 return fmt.Errorf("unexpected JSON type %v", value) 3790 } 3791 3792 var sv *GetDedicatedIpsOutput 3793 if *v == nil { 3794 sv = &GetDedicatedIpsOutput{} 3795 } else { 3796 sv = *v 3797 } 3798 3799 for key, value := range shape { 3800 switch key { 3801 case "DedicatedIps": 3802 if err := awsRestjson1_deserializeDocumentDedicatedIpList(&sv.DedicatedIps, value); err != nil { 3803 return err 3804 } 3805 3806 case "NextToken": 3807 if value != nil { 3808 jtv, ok := value.(string) 3809 if !ok { 3810 return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) 3811 } 3812 sv.NextToken = ptr.String(jtv) 3813 } 3814 3815 default: 3816 _, _ = key, value 3817 3818 } 3819 } 3820 *v = sv 3821 return nil 3822} 3823 3824type awsRestjson1_deserializeOpGetDeliverabilityDashboardOptions struct { 3825} 3826 3827func (*awsRestjson1_deserializeOpGetDeliverabilityDashboardOptions) ID() string { 3828 return "OperationDeserializer" 3829} 3830 3831func (m *awsRestjson1_deserializeOpGetDeliverabilityDashboardOptions) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 3832 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 3833) { 3834 out, metadata, err = next.HandleDeserialize(ctx, in) 3835 if err != nil { 3836 return out, metadata, err 3837 } 3838 3839 response, ok := out.RawResponse.(*smithyhttp.Response) 3840 if !ok { 3841 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 3842 } 3843 3844 if response.StatusCode < 200 || response.StatusCode >= 300 { 3845 return out, metadata, awsRestjson1_deserializeOpErrorGetDeliverabilityDashboardOptions(response, &metadata) 3846 } 3847 output := &GetDeliverabilityDashboardOptionsOutput{} 3848 out.Result = output 3849 3850 var buff [1024]byte 3851 ringBuffer := smithyio.NewRingBuffer(buff[:]) 3852 3853 body := io.TeeReader(response.Body, ringBuffer) 3854 3855 decoder := json.NewDecoder(body) 3856 decoder.UseNumber() 3857 var shape interface{} 3858 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 3859 var snapshot bytes.Buffer 3860 io.Copy(&snapshot, ringBuffer) 3861 err = &smithy.DeserializationError{ 3862 Err: fmt.Errorf("failed to decode response body, %w", err), 3863 Snapshot: snapshot.Bytes(), 3864 } 3865 return out, metadata, err 3866 } 3867 3868 err = awsRestjson1_deserializeOpDocumentGetDeliverabilityDashboardOptionsOutput(&output, shape) 3869 if err != nil { 3870 var snapshot bytes.Buffer 3871 io.Copy(&snapshot, ringBuffer) 3872 return out, metadata, &smithy.DeserializationError{ 3873 Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), 3874 Snapshot: snapshot.Bytes(), 3875 } 3876 } 3877 3878 return out, metadata, err 3879} 3880 3881func awsRestjson1_deserializeOpErrorGetDeliverabilityDashboardOptions(response *smithyhttp.Response, metadata *middleware.Metadata) error { 3882 var errorBuffer bytes.Buffer 3883 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 3884 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 3885 } 3886 errorBody := bytes.NewReader(errorBuffer.Bytes()) 3887 3888 errorCode := "UnknownError" 3889 errorMessage := errorCode 3890 3891 code := response.Header.Get("X-Amzn-ErrorType") 3892 if len(code) != 0 { 3893 errorCode = restjson.SanitizeErrorCode(code) 3894 } 3895 3896 var buff [1024]byte 3897 ringBuffer := smithyio.NewRingBuffer(buff[:]) 3898 3899 body := io.TeeReader(errorBody, ringBuffer) 3900 decoder := json.NewDecoder(body) 3901 decoder.UseNumber() 3902 code, message, err := restjson.GetErrorInfo(decoder) 3903 if err != nil { 3904 var snapshot bytes.Buffer 3905 io.Copy(&snapshot, ringBuffer) 3906 err = &smithy.DeserializationError{ 3907 Err: fmt.Errorf("failed to decode response body, %w", err), 3908 Snapshot: snapshot.Bytes(), 3909 } 3910 return err 3911 } 3912 3913 errorBody.Seek(0, io.SeekStart) 3914 if len(code) != 0 { 3915 errorCode = restjson.SanitizeErrorCode(code) 3916 } 3917 if len(message) != 0 { 3918 errorMessage = message 3919 } 3920 3921 switch { 3922 case strings.EqualFold("BadRequestException", errorCode): 3923 return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) 3924 3925 case strings.EqualFold("LimitExceededException", errorCode): 3926 return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) 3927 3928 case strings.EqualFold("TooManyRequestsException", errorCode): 3929 return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody) 3930 3931 default: 3932 genericError := &smithy.GenericAPIError{ 3933 Code: errorCode, 3934 Message: errorMessage, 3935 } 3936 return genericError 3937 3938 } 3939} 3940 3941func awsRestjson1_deserializeOpDocumentGetDeliverabilityDashboardOptionsOutput(v **GetDeliverabilityDashboardOptionsOutput, value interface{}) error { 3942 if v == nil { 3943 return fmt.Errorf("unexpected nil of type %T", v) 3944 } 3945 if value == nil { 3946 return nil 3947 } 3948 3949 shape, ok := value.(map[string]interface{}) 3950 if !ok { 3951 return fmt.Errorf("unexpected JSON type %v", value) 3952 } 3953 3954 var sv *GetDeliverabilityDashboardOptionsOutput 3955 if *v == nil { 3956 sv = &GetDeliverabilityDashboardOptionsOutput{} 3957 } else { 3958 sv = *v 3959 } 3960 3961 for key, value := range shape { 3962 switch key { 3963 case "AccountStatus": 3964 if value != nil { 3965 jtv, ok := value.(string) 3966 if !ok { 3967 return fmt.Errorf("expected DeliverabilityDashboardAccountStatus to be of type string, got %T instead", value) 3968 } 3969 sv.AccountStatus = types.DeliverabilityDashboardAccountStatus(jtv) 3970 } 3971 3972 case "ActiveSubscribedDomains": 3973 if err := awsRestjson1_deserializeDocumentDomainDeliverabilityTrackingOptions(&sv.ActiveSubscribedDomains, value); err != nil { 3974 return err 3975 } 3976 3977 case "DashboardEnabled": 3978 if value != nil { 3979 jtv, ok := value.(bool) 3980 if !ok { 3981 return fmt.Errorf("expected Enabled to be of type *bool, got %T instead", value) 3982 } 3983 sv.DashboardEnabled = jtv 3984 } 3985 3986 case "PendingExpirationSubscribedDomains": 3987 if err := awsRestjson1_deserializeDocumentDomainDeliverabilityTrackingOptions(&sv.PendingExpirationSubscribedDomains, value); err != nil { 3988 return err 3989 } 3990 3991 case "SubscriptionExpiryDate": 3992 if value != nil { 3993 jtv, ok := value.(json.Number) 3994 if !ok { 3995 return fmt.Errorf("expected Timestamp to be json.Number, got %T instead", value) 3996 } 3997 f64, err := jtv.Float64() 3998 if err != nil { 3999 return err 4000 } 4001 sv.SubscriptionExpiryDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) 4002 } 4003 4004 default: 4005 _, _ = key, value 4006 4007 } 4008 } 4009 *v = sv 4010 return nil 4011} 4012 4013type awsRestjson1_deserializeOpGetDeliverabilityTestReport struct { 4014} 4015 4016func (*awsRestjson1_deserializeOpGetDeliverabilityTestReport) ID() string { 4017 return "OperationDeserializer" 4018} 4019 4020func (m *awsRestjson1_deserializeOpGetDeliverabilityTestReport) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 4021 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 4022) { 4023 out, metadata, err = next.HandleDeserialize(ctx, in) 4024 if err != nil { 4025 return out, metadata, err 4026 } 4027 4028 response, ok := out.RawResponse.(*smithyhttp.Response) 4029 if !ok { 4030 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 4031 } 4032 4033 if response.StatusCode < 200 || response.StatusCode >= 300 { 4034 return out, metadata, awsRestjson1_deserializeOpErrorGetDeliverabilityTestReport(response, &metadata) 4035 } 4036 output := &GetDeliverabilityTestReportOutput{} 4037 out.Result = output 4038 4039 var buff [1024]byte 4040 ringBuffer := smithyio.NewRingBuffer(buff[:]) 4041 4042 body := io.TeeReader(response.Body, ringBuffer) 4043 4044 decoder := json.NewDecoder(body) 4045 decoder.UseNumber() 4046 var shape interface{} 4047 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 4048 var snapshot bytes.Buffer 4049 io.Copy(&snapshot, ringBuffer) 4050 err = &smithy.DeserializationError{ 4051 Err: fmt.Errorf("failed to decode response body, %w", err), 4052 Snapshot: snapshot.Bytes(), 4053 } 4054 return out, metadata, err 4055 } 4056 4057 err = awsRestjson1_deserializeOpDocumentGetDeliverabilityTestReportOutput(&output, shape) 4058 if err != nil { 4059 var snapshot bytes.Buffer 4060 io.Copy(&snapshot, ringBuffer) 4061 return out, metadata, &smithy.DeserializationError{ 4062 Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), 4063 Snapshot: snapshot.Bytes(), 4064 } 4065 } 4066 4067 return out, metadata, err 4068} 4069 4070func awsRestjson1_deserializeOpErrorGetDeliverabilityTestReport(response *smithyhttp.Response, metadata *middleware.Metadata) error { 4071 var errorBuffer bytes.Buffer 4072 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 4073 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 4074 } 4075 errorBody := bytes.NewReader(errorBuffer.Bytes()) 4076 4077 errorCode := "UnknownError" 4078 errorMessage := errorCode 4079 4080 code := response.Header.Get("X-Amzn-ErrorType") 4081 if len(code) != 0 { 4082 errorCode = restjson.SanitizeErrorCode(code) 4083 } 4084 4085 var buff [1024]byte 4086 ringBuffer := smithyio.NewRingBuffer(buff[:]) 4087 4088 body := io.TeeReader(errorBody, ringBuffer) 4089 decoder := json.NewDecoder(body) 4090 decoder.UseNumber() 4091 code, message, err := restjson.GetErrorInfo(decoder) 4092 if err != nil { 4093 var snapshot bytes.Buffer 4094 io.Copy(&snapshot, ringBuffer) 4095 err = &smithy.DeserializationError{ 4096 Err: fmt.Errorf("failed to decode response body, %w", err), 4097 Snapshot: snapshot.Bytes(), 4098 } 4099 return err 4100 } 4101 4102 errorBody.Seek(0, io.SeekStart) 4103 if len(code) != 0 { 4104 errorCode = restjson.SanitizeErrorCode(code) 4105 } 4106 if len(message) != 0 { 4107 errorMessage = message 4108 } 4109 4110 switch { 4111 case strings.EqualFold("BadRequestException", errorCode): 4112 return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) 4113 4114 case strings.EqualFold("NotFoundException", errorCode): 4115 return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) 4116 4117 case strings.EqualFold("TooManyRequestsException", errorCode): 4118 return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody) 4119 4120 default: 4121 genericError := &smithy.GenericAPIError{ 4122 Code: errorCode, 4123 Message: errorMessage, 4124 } 4125 return genericError 4126 4127 } 4128} 4129 4130func awsRestjson1_deserializeOpDocumentGetDeliverabilityTestReportOutput(v **GetDeliverabilityTestReportOutput, value interface{}) error { 4131 if v == nil { 4132 return fmt.Errorf("unexpected nil of type %T", v) 4133 } 4134 if value == nil { 4135 return nil 4136 } 4137 4138 shape, ok := value.(map[string]interface{}) 4139 if !ok { 4140 return fmt.Errorf("unexpected JSON type %v", value) 4141 } 4142 4143 var sv *GetDeliverabilityTestReportOutput 4144 if *v == nil { 4145 sv = &GetDeliverabilityTestReportOutput{} 4146 } else { 4147 sv = *v 4148 } 4149 4150 for key, value := range shape { 4151 switch key { 4152 case "DeliverabilityTestReport": 4153 if err := awsRestjson1_deserializeDocumentDeliverabilityTestReport(&sv.DeliverabilityTestReport, value); err != nil { 4154 return err 4155 } 4156 4157 case "IspPlacements": 4158 if err := awsRestjson1_deserializeDocumentIspPlacements(&sv.IspPlacements, value); err != nil { 4159 return err 4160 } 4161 4162 case "Message": 4163 if value != nil { 4164 jtv, ok := value.(string) 4165 if !ok { 4166 return fmt.Errorf("expected MessageContent to be of type string, got %T instead", value) 4167 } 4168 sv.Message = ptr.String(jtv) 4169 } 4170 4171 case "OverallPlacement": 4172 if err := awsRestjson1_deserializeDocumentPlacementStatistics(&sv.OverallPlacement, value); err != nil { 4173 return err 4174 } 4175 4176 case "Tags": 4177 if err := awsRestjson1_deserializeDocumentTagList(&sv.Tags, value); err != nil { 4178 return err 4179 } 4180 4181 default: 4182 _, _ = key, value 4183 4184 } 4185 } 4186 *v = sv 4187 return nil 4188} 4189 4190type awsRestjson1_deserializeOpGetDomainDeliverabilityCampaign struct { 4191} 4192 4193func (*awsRestjson1_deserializeOpGetDomainDeliverabilityCampaign) ID() string { 4194 return "OperationDeserializer" 4195} 4196 4197func (m *awsRestjson1_deserializeOpGetDomainDeliverabilityCampaign) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 4198 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 4199) { 4200 out, metadata, err = next.HandleDeserialize(ctx, in) 4201 if err != nil { 4202 return out, metadata, err 4203 } 4204 4205 response, ok := out.RawResponse.(*smithyhttp.Response) 4206 if !ok { 4207 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 4208 } 4209 4210 if response.StatusCode < 200 || response.StatusCode >= 300 { 4211 return out, metadata, awsRestjson1_deserializeOpErrorGetDomainDeliverabilityCampaign(response, &metadata) 4212 } 4213 output := &GetDomainDeliverabilityCampaignOutput{} 4214 out.Result = output 4215 4216 var buff [1024]byte 4217 ringBuffer := smithyio.NewRingBuffer(buff[:]) 4218 4219 body := io.TeeReader(response.Body, ringBuffer) 4220 4221 decoder := json.NewDecoder(body) 4222 decoder.UseNumber() 4223 var shape interface{} 4224 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 4225 var snapshot bytes.Buffer 4226 io.Copy(&snapshot, ringBuffer) 4227 err = &smithy.DeserializationError{ 4228 Err: fmt.Errorf("failed to decode response body, %w", err), 4229 Snapshot: snapshot.Bytes(), 4230 } 4231 return out, metadata, err 4232 } 4233 4234 err = awsRestjson1_deserializeOpDocumentGetDomainDeliverabilityCampaignOutput(&output, shape) 4235 if err != nil { 4236 var snapshot bytes.Buffer 4237 io.Copy(&snapshot, ringBuffer) 4238 return out, metadata, &smithy.DeserializationError{ 4239 Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), 4240 Snapshot: snapshot.Bytes(), 4241 } 4242 } 4243 4244 return out, metadata, err 4245} 4246 4247func awsRestjson1_deserializeOpErrorGetDomainDeliverabilityCampaign(response *smithyhttp.Response, metadata *middleware.Metadata) error { 4248 var errorBuffer bytes.Buffer 4249 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 4250 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 4251 } 4252 errorBody := bytes.NewReader(errorBuffer.Bytes()) 4253 4254 errorCode := "UnknownError" 4255 errorMessage := errorCode 4256 4257 code := response.Header.Get("X-Amzn-ErrorType") 4258 if len(code) != 0 { 4259 errorCode = restjson.SanitizeErrorCode(code) 4260 } 4261 4262 var buff [1024]byte 4263 ringBuffer := smithyio.NewRingBuffer(buff[:]) 4264 4265 body := io.TeeReader(errorBody, ringBuffer) 4266 decoder := json.NewDecoder(body) 4267 decoder.UseNumber() 4268 code, message, err := restjson.GetErrorInfo(decoder) 4269 if err != nil { 4270 var snapshot bytes.Buffer 4271 io.Copy(&snapshot, ringBuffer) 4272 err = &smithy.DeserializationError{ 4273 Err: fmt.Errorf("failed to decode response body, %w", err), 4274 Snapshot: snapshot.Bytes(), 4275 } 4276 return err 4277 } 4278 4279 errorBody.Seek(0, io.SeekStart) 4280 if len(code) != 0 { 4281 errorCode = restjson.SanitizeErrorCode(code) 4282 } 4283 if len(message) != 0 { 4284 errorMessage = message 4285 } 4286 4287 switch { 4288 case strings.EqualFold("BadRequestException", errorCode): 4289 return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) 4290 4291 case strings.EqualFold("NotFoundException", errorCode): 4292 return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) 4293 4294 case strings.EqualFold("TooManyRequestsException", errorCode): 4295 return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody) 4296 4297 default: 4298 genericError := &smithy.GenericAPIError{ 4299 Code: errorCode, 4300 Message: errorMessage, 4301 } 4302 return genericError 4303 4304 } 4305} 4306 4307func awsRestjson1_deserializeOpDocumentGetDomainDeliverabilityCampaignOutput(v **GetDomainDeliverabilityCampaignOutput, value interface{}) error { 4308 if v == nil { 4309 return fmt.Errorf("unexpected nil of type %T", v) 4310 } 4311 if value == nil { 4312 return nil 4313 } 4314 4315 shape, ok := value.(map[string]interface{}) 4316 if !ok { 4317 return fmt.Errorf("unexpected JSON type %v", value) 4318 } 4319 4320 var sv *GetDomainDeliverabilityCampaignOutput 4321 if *v == nil { 4322 sv = &GetDomainDeliverabilityCampaignOutput{} 4323 } else { 4324 sv = *v 4325 } 4326 4327 for key, value := range shape { 4328 switch key { 4329 case "DomainDeliverabilityCampaign": 4330 if err := awsRestjson1_deserializeDocumentDomainDeliverabilityCampaign(&sv.DomainDeliverabilityCampaign, value); err != nil { 4331 return err 4332 } 4333 4334 default: 4335 _, _ = key, value 4336 4337 } 4338 } 4339 *v = sv 4340 return nil 4341} 4342 4343type awsRestjson1_deserializeOpGetDomainStatisticsReport struct { 4344} 4345 4346func (*awsRestjson1_deserializeOpGetDomainStatisticsReport) ID() string { 4347 return "OperationDeserializer" 4348} 4349 4350func (m *awsRestjson1_deserializeOpGetDomainStatisticsReport) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 4351 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 4352) { 4353 out, metadata, err = next.HandleDeserialize(ctx, in) 4354 if err != nil { 4355 return out, metadata, err 4356 } 4357 4358 response, ok := out.RawResponse.(*smithyhttp.Response) 4359 if !ok { 4360 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 4361 } 4362 4363 if response.StatusCode < 200 || response.StatusCode >= 300 { 4364 return out, metadata, awsRestjson1_deserializeOpErrorGetDomainStatisticsReport(response, &metadata) 4365 } 4366 output := &GetDomainStatisticsReportOutput{} 4367 out.Result = output 4368 4369 var buff [1024]byte 4370 ringBuffer := smithyio.NewRingBuffer(buff[:]) 4371 4372 body := io.TeeReader(response.Body, ringBuffer) 4373 4374 decoder := json.NewDecoder(body) 4375 decoder.UseNumber() 4376 var shape interface{} 4377 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 4378 var snapshot bytes.Buffer 4379 io.Copy(&snapshot, ringBuffer) 4380 err = &smithy.DeserializationError{ 4381 Err: fmt.Errorf("failed to decode response body, %w", err), 4382 Snapshot: snapshot.Bytes(), 4383 } 4384 return out, metadata, err 4385 } 4386 4387 err = awsRestjson1_deserializeOpDocumentGetDomainStatisticsReportOutput(&output, shape) 4388 if err != nil { 4389 var snapshot bytes.Buffer 4390 io.Copy(&snapshot, ringBuffer) 4391 return out, metadata, &smithy.DeserializationError{ 4392 Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), 4393 Snapshot: snapshot.Bytes(), 4394 } 4395 } 4396 4397 return out, metadata, err 4398} 4399 4400func awsRestjson1_deserializeOpErrorGetDomainStatisticsReport(response *smithyhttp.Response, metadata *middleware.Metadata) error { 4401 var errorBuffer bytes.Buffer 4402 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 4403 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 4404 } 4405 errorBody := bytes.NewReader(errorBuffer.Bytes()) 4406 4407 errorCode := "UnknownError" 4408 errorMessage := errorCode 4409 4410 code := response.Header.Get("X-Amzn-ErrorType") 4411 if len(code) != 0 { 4412 errorCode = restjson.SanitizeErrorCode(code) 4413 } 4414 4415 var buff [1024]byte 4416 ringBuffer := smithyio.NewRingBuffer(buff[:]) 4417 4418 body := io.TeeReader(errorBody, ringBuffer) 4419 decoder := json.NewDecoder(body) 4420 decoder.UseNumber() 4421 code, message, err := restjson.GetErrorInfo(decoder) 4422 if err != nil { 4423 var snapshot bytes.Buffer 4424 io.Copy(&snapshot, ringBuffer) 4425 err = &smithy.DeserializationError{ 4426 Err: fmt.Errorf("failed to decode response body, %w", err), 4427 Snapshot: snapshot.Bytes(), 4428 } 4429 return err 4430 } 4431 4432 errorBody.Seek(0, io.SeekStart) 4433 if len(code) != 0 { 4434 errorCode = restjson.SanitizeErrorCode(code) 4435 } 4436 if len(message) != 0 { 4437 errorMessage = message 4438 } 4439 4440 switch { 4441 case strings.EqualFold("BadRequestException", errorCode): 4442 return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) 4443 4444 case strings.EqualFold("NotFoundException", errorCode): 4445 return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) 4446 4447 case strings.EqualFold("TooManyRequestsException", errorCode): 4448 return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody) 4449 4450 default: 4451 genericError := &smithy.GenericAPIError{ 4452 Code: errorCode, 4453 Message: errorMessage, 4454 } 4455 return genericError 4456 4457 } 4458} 4459 4460func awsRestjson1_deserializeOpDocumentGetDomainStatisticsReportOutput(v **GetDomainStatisticsReportOutput, value interface{}) error { 4461 if v == nil { 4462 return fmt.Errorf("unexpected nil of type %T", v) 4463 } 4464 if value == nil { 4465 return nil 4466 } 4467 4468 shape, ok := value.(map[string]interface{}) 4469 if !ok { 4470 return fmt.Errorf("unexpected JSON type %v", value) 4471 } 4472 4473 var sv *GetDomainStatisticsReportOutput 4474 if *v == nil { 4475 sv = &GetDomainStatisticsReportOutput{} 4476 } else { 4477 sv = *v 4478 } 4479 4480 for key, value := range shape { 4481 switch key { 4482 case "DailyVolumes": 4483 if err := awsRestjson1_deserializeDocumentDailyVolumes(&sv.DailyVolumes, value); err != nil { 4484 return err 4485 } 4486 4487 case "OverallVolume": 4488 if err := awsRestjson1_deserializeDocumentOverallVolume(&sv.OverallVolume, value); err != nil { 4489 return err 4490 } 4491 4492 default: 4493 _, _ = key, value 4494 4495 } 4496 } 4497 *v = sv 4498 return nil 4499} 4500 4501type awsRestjson1_deserializeOpGetEmailIdentity struct { 4502} 4503 4504func (*awsRestjson1_deserializeOpGetEmailIdentity) ID() string { 4505 return "OperationDeserializer" 4506} 4507 4508func (m *awsRestjson1_deserializeOpGetEmailIdentity) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 4509 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 4510) { 4511 out, metadata, err = next.HandleDeserialize(ctx, in) 4512 if err != nil { 4513 return out, metadata, err 4514 } 4515 4516 response, ok := out.RawResponse.(*smithyhttp.Response) 4517 if !ok { 4518 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 4519 } 4520 4521 if response.StatusCode < 200 || response.StatusCode >= 300 { 4522 return out, metadata, awsRestjson1_deserializeOpErrorGetEmailIdentity(response, &metadata) 4523 } 4524 output := &GetEmailIdentityOutput{} 4525 out.Result = output 4526 4527 var buff [1024]byte 4528 ringBuffer := smithyio.NewRingBuffer(buff[:]) 4529 4530 body := io.TeeReader(response.Body, ringBuffer) 4531 4532 decoder := json.NewDecoder(body) 4533 decoder.UseNumber() 4534 var shape interface{} 4535 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 4536 var snapshot bytes.Buffer 4537 io.Copy(&snapshot, ringBuffer) 4538 err = &smithy.DeserializationError{ 4539 Err: fmt.Errorf("failed to decode response body, %w", err), 4540 Snapshot: snapshot.Bytes(), 4541 } 4542 return out, metadata, err 4543 } 4544 4545 err = awsRestjson1_deserializeOpDocumentGetEmailIdentityOutput(&output, shape) 4546 if err != nil { 4547 var snapshot bytes.Buffer 4548 io.Copy(&snapshot, ringBuffer) 4549 return out, metadata, &smithy.DeserializationError{ 4550 Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), 4551 Snapshot: snapshot.Bytes(), 4552 } 4553 } 4554 4555 return out, metadata, err 4556} 4557 4558func awsRestjson1_deserializeOpErrorGetEmailIdentity(response *smithyhttp.Response, metadata *middleware.Metadata) error { 4559 var errorBuffer bytes.Buffer 4560 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 4561 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 4562 } 4563 errorBody := bytes.NewReader(errorBuffer.Bytes()) 4564 4565 errorCode := "UnknownError" 4566 errorMessage := errorCode 4567 4568 code := response.Header.Get("X-Amzn-ErrorType") 4569 if len(code) != 0 { 4570 errorCode = restjson.SanitizeErrorCode(code) 4571 } 4572 4573 var buff [1024]byte 4574 ringBuffer := smithyio.NewRingBuffer(buff[:]) 4575 4576 body := io.TeeReader(errorBody, ringBuffer) 4577 decoder := json.NewDecoder(body) 4578 decoder.UseNumber() 4579 code, message, err := restjson.GetErrorInfo(decoder) 4580 if err != nil { 4581 var snapshot bytes.Buffer 4582 io.Copy(&snapshot, ringBuffer) 4583 err = &smithy.DeserializationError{ 4584 Err: fmt.Errorf("failed to decode response body, %w", err), 4585 Snapshot: snapshot.Bytes(), 4586 } 4587 return err 4588 } 4589 4590 errorBody.Seek(0, io.SeekStart) 4591 if len(code) != 0 { 4592 errorCode = restjson.SanitizeErrorCode(code) 4593 } 4594 if len(message) != 0 { 4595 errorMessage = message 4596 } 4597 4598 switch { 4599 case strings.EqualFold("BadRequestException", errorCode): 4600 return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) 4601 4602 case strings.EqualFold("NotFoundException", errorCode): 4603 return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) 4604 4605 case strings.EqualFold("TooManyRequestsException", errorCode): 4606 return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody) 4607 4608 default: 4609 genericError := &smithy.GenericAPIError{ 4610 Code: errorCode, 4611 Message: errorMessage, 4612 } 4613 return genericError 4614 4615 } 4616} 4617 4618func awsRestjson1_deserializeOpDocumentGetEmailIdentityOutput(v **GetEmailIdentityOutput, value interface{}) error { 4619 if v == nil { 4620 return fmt.Errorf("unexpected nil of type %T", v) 4621 } 4622 if value == nil { 4623 return nil 4624 } 4625 4626 shape, ok := value.(map[string]interface{}) 4627 if !ok { 4628 return fmt.Errorf("unexpected JSON type %v", value) 4629 } 4630 4631 var sv *GetEmailIdentityOutput 4632 if *v == nil { 4633 sv = &GetEmailIdentityOutput{} 4634 } else { 4635 sv = *v 4636 } 4637 4638 for key, value := range shape { 4639 switch key { 4640 case "DkimAttributes": 4641 if err := awsRestjson1_deserializeDocumentDkimAttributes(&sv.DkimAttributes, value); err != nil { 4642 return err 4643 } 4644 4645 case "FeedbackForwardingStatus": 4646 if value != nil { 4647 jtv, ok := value.(bool) 4648 if !ok { 4649 return fmt.Errorf("expected Enabled to be of type *bool, got %T instead", value) 4650 } 4651 sv.FeedbackForwardingStatus = jtv 4652 } 4653 4654 case "IdentityType": 4655 if value != nil { 4656 jtv, ok := value.(string) 4657 if !ok { 4658 return fmt.Errorf("expected IdentityType to be of type string, got %T instead", value) 4659 } 4660 sv.IdentityType = types.IdentityType(jtv) 4661 } 4662 4663 case "MailFromAttributes": 4664 if err := awsRestjson1_deserializeDocumentMailFromAttributes(&sv.MailFromAttributes, value); err != nil { 4665 return err 4666 } 4667 4668 case "Policies": 4669 if err := awsRestjson1_deserializeDocumentPolicyMap(&sv.Policies, value); err != nil { 4670 return err 4671 } 4672 4673 case "Tags": 4674 if err := awsRestjson1_deserializeDocumentTagList(&sv.Tags, value); err != nil { 4675 return err 4676 } 4677 4678 case "VerifiedForSendingStatus": 4679 if value != nil { 4680 jtv, ok := value.(bool) 4681 if !ok { 4682 return fmt.Errorf("expected Enabled to be of type *bool, got %T instead", value) 4683 } 4684 sv.VerifiedForSendingStatus = jtv 4685 } 4686 4687 default: 4688 _, _ = key, value 4689 4690 } 4691 } 4692 *v = sv 4693 return nil 4694} 4695 4696type awsRestjson1_deserializeOpGetEmailIdentityPolicies struct { 4697} 4698 4699func (*awsRestjson1_deserializeOpGetEmailIdentityPolicies) ID() string { 4700 return "OperationDeserializer" 4701} 4702 4703func (m *awsRestjson1_deserializeOpGetEmailIdentityPolicies) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 4704 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 4705) { 4706 out, metadata, err = next.HandleDeserialize(ctx, in) 4707 if err != nil { 4708 return out, metadata, err 4709 } 4710 4711 response, ok := out.RawResponse.(*smithyhttp.Response) 4712 if !ok { 4713 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 4714 } 4715 4716 if response.StatusCode < 200 || response.StatusCode >= 300 { 4717 return out, metadata, awsRestjson1_deserializeOpErrorGetEmailIdentityPolicies(response, &metadata) 4718 } 4719 output := &GetEmailIdentityPoliciesOutput{} 4720 out.Result = output 4721 4722 var buff [1024]byte 4723 ringBuffer := smithyio.NewRingBuffer(buff[:]) 4724 4725 body := io.TeeReader(response.Body, ringBuffer) 4726 4727 decoder := json.NewDecoder(body) 4728 decoder.UseNumber() 4729 var shape interface{} 4730 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 4731 var snapshot bytes.Buffer 4732 io.Copy(&snapshot, ringBuffer) 4733 err = &smithy.DeserializationError{ 4734 Err: fmt.Errorf("failed to decode response body, %w", err), 4735 Snapshot: snapshot.Bytes(), 4736 } 4737 return out, metadata, err 4738 } 4739 4740 err = awsRestjson1_deserializeOpDocumentGetEmailIdentityPoliciesOutput(&output, shape) 4741 if err != nil { 4742 var snapshot bytes.Buffer 4743 io.Copy(&snapshot, ringBuffer) 4744 return out, metadata, &smithy.DeserializationError{ 4745 Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), 4746 Snapshot: snapshot.Bytes(), 4747 } 4748 } 4749 4750 return out, metadata, err 4751} 4752 4753func awsRestjson1_deserializeOpErrorGetEmailIdentityPolicies(response *smithyhttp.Response, metadata *middleware.Metadata) error { 4754 var errorBuffer bytes.Buffer 4755 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 4756 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 4757 } 4758 errorBody := bytes.NewReader(errorBuffer.Bytes()) 4759 4760 errorCode := "UnknownError" 4761 errorMessage := errorCode 4762 4763 code := response.Header.Get("X-Amzn-ErrorType") 4764 if len(code) != 0 { 4765 errorCode = restjson.SanitizeErrorCode(code) 4766 } 4767 4768 var buff [1024]byte 4769 ringBuffer := smithyio.NewRingBuffer(buff[:]) 4770 4771 body := io.TeeReader(errorBody, ringBuffer) 4772 decoder := json.NewDecoder(body) 4773 decoder.UseNumber() 4774 code, message, err := restjson.GetErrorInfo(decoder) 4775 if err != nil { 4776 var snapshot bytes.Buffer 4777 io.Copy(&snapshot, ringBuffer) 4778 err = &smithy.DeserializationError{ 4779 Err: fmt.Errorf("failed to decode response body, %w", err), 4780 Snapshot: snapshot.Bytes(), 4781 } 4782 return err 4783 } 4784 4785 errorBody.Seek(0, io.SeekStart) 4786 if len(code) != 0 { 4787 errorCode = restjson.SanitizeErrorCode(code) 4788 } 4789 if len(message) != 0 { 4790 errorMessage = message 4791 } 4792 4793 switch { 4794 case strings.EqualFold("BadRequestException", errorCode): 4795 return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) 4796 4797 case strings.EqualFold("NotFoundException", errorCode): 4798 return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) 4799 4800 case strings.EqualFold("TooManyRequestsException", errorCode): 4801 return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody) 4802 4803 default: 4804 genericError := &smithy.GenericAPIError{ 4805 Code: errorCode, 4806 Message: errorMessage, 4807 } 4808 return genericError 4809 4810 } 4811} 4812 4813func awsRestjson1_deserializeOpDocumentGetEmailIdentityPoliciesOutput(v **GetEmailIdentityPoliciesOutput, value interface{}) error { 4814 if v == nil { 4815 return fmt.Errorf("unexpected nil of type %T", v) 4816 } 4817 if value == nil { 4818 return nil 4819 } 4820 4821 shape, ok := value.(map[string]interface{}) 4822 if !ok { 4823 return fmt.Errorf("unexpected JSON type %v", value) 4824 } 4825 4826 var sv *GetEmailIdentityPoliciesOutput 4827 if *v == nil { 4828 sv = &GetEmailIdentityPoliciesOutput{} 4829 } else { 4830 sv = *v 4831 } 4832 4833 for key, value := range shape { 4834 switch key { 4835 case "Policies": 4836 if err := awsRestjson1_deserializeDocumentPolicyMap(&sv.Policies, value); err != nil { 4837 return err 4838 } 4839 4840 default: 4841 _, _ = key, value 4842 4843 } 4844 } 4845 *v = sv 4846 return nil 4847} 4848 4849type awsRestjson1_deserializeOpGetEmailTemplate struct { 4850} 4851 4852func (*awsRestjson1_deserializeOpGetEmailTemplate) ID() string { 4853 return "OperationDeserializer" 4854} 4855 4856func (m *awsRestjson1_deserializeOpGetEmailTemplate) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 4857 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 4858) { 4859 out, metadata, err = next.HandleDeserialize(ctx, in) 4860 if err != nil { 4861 return out, metadata, err 4862 } 4863 4864 response, ok := out.RawResponse.(*smithyhttp.Response) 4865 if !ok { 4866 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 4867 } 4868 4869 if response.StatusCode < 200 || response.StatusCode >= 300 { 4870 return out, metadata, awsRestjson1_deserializeOpErrorGetEmailTemplate(response, &metadata) 4871 } 4872 output := &GetEmailTemplateOutput{} 4873 out.Result = output 4874 4875 var buff [1024]byte 4876 ringBuffer := smithyio.NewRingBuffer(buff[:]) 4877 4878 body := io.TeeReader(response.Body, ringBuffer) 4879 4880 decoder := json.NewDecoder(body) 4881 decoder.UseNumber() 4882 var shape interface{} 4883 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 4884 var snapshot bytes.Buffer 4885 io.Copy(&snapshot, ringBuffer) 4886 err = &smithy.DeserializationError{ 4887 Err: fmt.Errorf("failed to decode response body, %w", err), 4888 Snapshot: snapshot.Bytes(), 4889 } 4890 return out, metadata, err 4891 } 4892 4893 err = awsRestjson1_deserializeOpDocumentGetEmailTemplateOutput(&output, shape) 4894 if err != nil { 4895 var snapshot bytes.Buffer 4896 io.Copy(&snapshot, ringBuffer) 4897 return out, metadata, &smithy.DeserializationError{ 4898 Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), 4899 Snapshot: snapshot.Bytes(), 4900 } 4901 } 4902 4903 return out, metadata, err 4904} 4905 4906func awsRestjson1_deserializeOpErrorGetEmailTemplate(response *smithyhttp.Response, metadata *middleware.Metadata) error { 4907 var errorBuffer bytes.Buffer 4908 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 4909 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 4910 } 4911 errorBody := bytes.NewReader(errorBuffer.Bytes()) 4912 4913 errorCode := "UnknownError" 4914 errorMessage := errorCode 4915 4916 code := response.Header.Get("X-Amzn-ErrorType") 4917 if len(code) != 0 { 4918 errorCode = restjson.SanitizeErrorCode(code) 4919 } 4920 4921 var buff [1024]byte 4922 ringBuffer := smithyio.NewRingBuffer(buff[:]) 4923 4924 body := io.TeeReader(errorBody, ringBuffer) 4925 decoder := json.NewDecoder(body) 4926 decoder.UseNumber() 4927 code, message, err := restjson.GetErrorInfo(decoder) 4928 if err != nil { 4929 var snapshot bytes.Buffer 4930 io.Copy(&snapshot, ringBuffer) 4931 err = &smithy.DeserializationError{ 4932 Err: fmt.Errorf("failed to decode response body, %w", err), 4933 Snapshot: snapshot.Bytes(), 4934 } 4935 return err 4936 } 4937 4938 errorBody.Seek(0, io.SeekStart) 4939 if len(code) != 0 { 4940 errorCode = restjson.SanitizeErrorCode(code) 4941 } 4942 if len(message) != 0 { 4943 errorMessage = message 4944 } 4945 4946 switch { 4947 case strings.EqualFold("BadRequestException", errorCode): 4948 return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) 4949 4950 case strings.EqualFold("NotFoundException", errorCode): 4951 return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) 4952 4953 case strings.EqualFold("TooManyRequestsException", errorCode): 4954 return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody) 4955 4956 default: 4957 genericError := &smithy.GenericAPIError{ 4958 Code: errorCode, 4959 Message: errorMessage, 4960 } 4961 return genericError 4962 4963 } 4964} 4965 4966func awsRestjson1_deserializeOpDocumentGetEmailTemplateOutput(v **GetEmailTemplateOutput, value interface{}) error { 4967 if v == nil { 4968 return fmt.Errorf("unexpected nil of type %T", v) 4969 } 4970 if value == nil { 4971 return nil 4972 } 4973 4974 shape, ok := value.(map[string]interface{}) 4975 if !ok { 4976 return fmt.Errorf("unexpected JSON type %v", value) 4977 } 4978 4979 var sv *GetEmailTemplateOutput 4980 if *v == nil { 4981 sv = &GetEmailTemplateOutput{} 4982 } else { 4983 sv = *v 4984 } 4985 4986 for key, value := range shape { 4987 switch key { 4988 case "TemplateContent": 4989 if err := awsRestjson1_deserializeDocumentEmailTemplateContent(&sv.TemplateContent, value); err != nil { 4990 return err 4991 } 4992 4993 case "TemplateName": 4994 if value != nil { 4995 jtv, ok := value.(string) 4996 if !ok { 4997 return fmt.Errorf("expected EmailTemplateName to be of type string, got %T instead", value) 4998 } 4999 sv.TemplateName = ptr.String(jtv) 5000 } 5001 5002 default: 5003 _, _ = key, value 5004 5005 } 5006 } 5007 *v = sv 5008 return nil 5009} 5010 5011type awsRestjson1_deserializeOpGetImportJob struct { 5012} 5013 5014func (*awsRestjson1_deserializeOpGetImportJob) ID() string { 5015 return "OperationDeserializer" 5016} 5017 5018func (m *awsRestjson1_deserializeOpGetImportJob) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 5019 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 5020) { 5021 out, metadata, err = next.HandleDeserialize(ctx, in) 5022 if err != nil { 5023 return out, metadata, err 5024 } 5025 5026 response, ok := out.RawResponse.(*smithyhttp.Response) 5027 if !ok { 5028 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 5029 } 5030 5031 if response.StatusCode < 200 || response.StatusCode >= 300 { 5032 return out, metadata, awsRestjson1_deserializeOpErrorGetImportJob(response, &metadata) 5033 } 5034 output := &GetImportJobOutput{} 5035 out.Result = output 5036 5037 var buff [1024]byte 5038 ringBuffer := smithyio.NewRingBuffer(buff[:]) 5039 5040 body := io.TeeReader(response.Body, ringBuffer) 5041 5042 decoder := json.NewDecoder(body) 5043 decoder.UseNumber() 5044 var shape interface{} 5045 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 5046 var snapshot bytes.Buffer 5047 io.Copy(&snapshot, ringBuffer) 5048 err = &smithy.DeserializationError{ 5049 Err: fmt.Errorf("failed to decode response body, %w", err), 5050 Snapshot: snapshot.Bytes(), 5051 } 5052 return out, metadata, err 5053 } 5054 5055 err = awsRestjson1_deserializeOpDocumentGetImportJobOutput(&output, shape) 5056 if err != nil { 5057 var snapshot bytes.Buffer 5058 io.Copy(&snapshot, ringBuffer) 5059 return out, metadata, &smithy.DeserializationError{ 5060 Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), 5061 Snapshot: snapshot.Bytes(), 5062 } 5063 } 5064 5065 return out, metadata, err 5066} 5067 5068func awsRestjson1_deserializeOpErrorGetImportJob(response *smithyhttp.Response, metadata *middleware.Metadata) error { 5069 var errorBuffer bytes.Buffer 5070 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 5071 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 5072 } 5073 errorBody := bytes.NewReader(errorBuffer.Bytes()) 5074 5075 errorCode := "UnknownError" 5076 errorMessage := errorCode 5077 5078 code := response.Header.Get("X-Amzn-ErrorType") 5079 if len(code) != 0 { 5080 errorCode = restjson.SanitizeErrorCode(code) 5081 } 5082 5083 var buff [1024]byte 5084 ringBuffer := smithyio.NewRingBuffer(buff[:]) 5085 5086 body := io.TeeReader(errorBody, ringBuffer) 5087 decoder := json.NewDecoder(body) 5088 decoder.UseNumber() 5089 code, message, err := restjson.GetErrorInfo(decoder) 5090 if err != nil { 5091 var snapshot bytes.Buffer 5092 io.Copy(&snapshot, ringBuffer) 5093 err = &smithy.DeserializationError{ 5094 Err: fmt.Errorf("failed to decode response body, %w", err), 5095 Snapshot: snapshot.Bytes(), 5096 } 5097 return err 5098 } 5099 5100 errorBody.Seek(0, io.SeekStart) 5101 if len(code) != 0 { 5102 errorCode = restjson.SanitizeErrorCode(code) 5103 } 5104 if len(message) != 0 { 5105 errorMessage = message 5106 } 5107 5108 switch { 5109 case strings.EqualFold("BadRequestException", errorCode): 5110 return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) 5111 5112 case strings.EqualFold("NotFoundException", errorCode): 5113 return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) 5114 5115 case strings.EqualFold("TooManyRequestsException", errorCode): 5116 return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody) 5117 5118 default: 5119 genericError := &smithy.GenericAPIError{ 5120 Code: errorCode, 5121 Message: errorMessage, 5122 } 5123 return genericError 5124 5125 } 5126} 5127 5128func awsRestjson1_deserializeOpDocumentGetImportJobOutput(v **GetImportJobOutput, value interface{}) error { 5129 if v == nil { 5130 return fmt.Errorf("unexpected nil of type %T", v) 5131 } 5132 if value == nil { 5133 return nil 5134 } 5135 5136 shape, ok := value.(map[string]interface{}) 5137 if !ok { 5138 return fmt.Errorf("unexpected JSON type %v", value) 5139 } 5140 5141 var sv *GetImportJobOutput 5142 if *v == nil { 5143 sv = &GetImportJobOutput{} 5144 } else { 5145 sv = *v 5146 } 5147 5148 for key, value := range shape { 5149 switch key { 5150 case "CompletedTimestamp": 5151 if value != nil { 5152 jtv, ok := value.(json.Number) 5153 if !ok { 5154 return fmt.Errorf("expected Timestamp to be json.Number, got %T instead", value) 5155 } 5156 f64, err := jtv.Float64() 5157 if err != nil { 5158 return err 5159 } 5160 sv.CompletedTimestamp = ptr.Time(smithytime.ParseEpochSeconds(f64)) 5161 } 5162 5163 case "CreatedTimestamp": 5164 if value != nil { 5165 jtv, ok := value.(json.Number) 5166 if !ok { 5167 return fmt.Errorf("expected Timestamp to be json.Number, got %T instead", value) 5168 } 5169 f64, err := jtv.Float64() 5170 if err != nil { 5171 return err 5172 } 5173 sv.CreatedTimestamp = ptr.Time(smithytime.ParseEpochSeconds(f64)) 5174 } 5175 5176 case "FailedRecordsCount": 5177 if value != nil { 5178 jtv, ok := value.(json.Number) 5179 if !ok { 5180 return fmt.Errorf("expected FailedRecordsCount to be json.Number, got %T instead", value) 5181 } 5182 i64, err := jtv.Int64() 5183 if err != nil { 5184 return err 5185 } 5186 sv.FailedRecordsCount = ptr.Int32(int32(i64)) 5187 } 5188 5189 case "FailureInfo": 5190 if err := awsRestjson1_deserializeDocumentFailureInfo(&sv.FailureInfo, value); err != nil { 5191 return err 5192 } 5193 5194 case "ImportDataSource": 5195 if err := awsRestjson1_deserializeDocumentImportDataSource(&sv.ImportDataSource, value); err != nil { 5196 return err 5197 } 5198 5199 case "ImportDestination": 5200 if err := awsRestjson1_deserializeDocumentImportDestination(&sv.ImportDestination, value); err != nil { 5201 return err 5202 } 5203 5204 case "JobId": 5205 if value != nil { 5206 jtv, ok := value.(string) 5207 if !ok { 5208 return fmt.Errorf("expected JobId to be of type string, got %T instead", value) 5209 } 5210 sv.JobId = ptr.String(jtv) 5211 } 5212 5213 case "JobStatus": 5214 if value != nil { 5215 jtv, ok := value.(string) 5216 if !ok { 5217 return fmt.Errorf("expected JobStatus to be of type string, got %T instead", value) 5218 } 5219 sv.JobStatus = types.JobStatus(jtv) 5220 } 5221 5222 case "ProcessedRecordsCount": 5223 if value != nil { 5224 jtv, ok := value.(json.Number) 5225 if !ok { 5226 return fmt.Errorf("expected ProcessedRecordsCount to be json.Number, got %T instead", value) 5227 } 5228 i64, err := jtv.Int64() 5229 if err != nil { 5230 return err 5231 } 5232 sv.ProcessedRecordsCount = ptr.Int32(int32(i64)) 5233 } 5234 5235 default: 5236 _, _ = key, value 5237 5238 } 5239 } 5240 *v = sv 5241 return nil 5242} 5243 5244type awsRestjson1_deserializeOpGetSuppressedDestination struct { 5245} 5246 5247func (*awsRestjson1_deserializeOpGetSuppressedDestination) ID() string { 5248 return "OperationDeserializer" 5249} 5250 5251func (m *awsRestjson1_deserializeOpGetSuppressedDestination) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 5252 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 5253) { 5254 out, metadata, err = next.HandleDeserialize(ctx, in) 5255 if err != nil { 5256 return out, metadata, err 5257 } 5258 5259 response, ok := out.RawResponse.(*smithyhttp.Response) 5260 if !ok { 5261 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 5262 } 5263 5264 if response.StatusCode < 200 || response.StatusCode >= 300 { 5265 return out, metadata, awsRestjson1_deserializeOpErrorGetSuppressedDestination(response, &metadata) 5266 } 5267 output := &GetSuppressedDestinationOutput{} 5268 out.Result = output 5269 5270 var buff [1024]byte 5271 ringBuffer := smithyio.NewRingBuffer(buff[:]) 5272 5273 body := io.TeeReader(response.Body, ringBuffer) 5274 5275 decoder := json.NewDecoder(body) 5276 decoder.UseNumber() 5277 var shape interface{} 5278 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 5279 var snapshot bytes.Buffer 5280 io.Copy(&snapshot, ringBuffer) 5281 err = &smithy.DeserializationError{ 5282 Err: fmt.Errorf("failed to decode response body, %w", err), 5283 Snapshot: snapshot.Bytes(), 5284 } 5285 return out, metadata, err 5286 } 5287 5288 err = awsRestjson1_deserializeOpDocumentGetSuppressedDestinationOutput(&output, shape) 5289 if err != nil { 5290 var snapshot bytes.Buffer 5291 io.Copy(&snapshot, ringBuffer) 5292 return out, metadata, &smithy.DeserializationError{ 5293 Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), 5294 Snapshot: snapshot.Bytes(), 5295 } 5296 } 5297 5298 return out, metadata, err 5299} 5300 5301func awsRestjson1_deserializeOpErrorGetSuppressedDestination(response *smithyhttp.Response, metadata *middleware.Metadata) error { 5302 var errorBuffer bytes.Buffer 5303 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 5304 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 5305 } 5306 errorBody := bytes.NewReader(errorBuffer.Bytes()) 5307 5308 errorCode := "UnknownError" 5309 errorMessage := errorCode 5310 5311 code := response.Header.Get("X-Amzn-ErrorType") 5312 if len(code) != 0 { 5313 errorCode = restjson.SanitizeErrorCode(code) 5314 } 5315 5316 var buff [1024]byte 5317 ringBuffer := smithyio.NewRingBuffer(buff[:]) 5318 5319 body := io.TeeReader(errorBody, ringBuffer) 5320 decoder := json.NewDecoder(body) 5321 decoder.UseNumber() 5322 code, message, err := restjson.GetErrorInfo(decoder) 5323 if err != nil { 5324 var snapshot bytes.Buffer 5325 io.Copy(&snapshot, ringBuffer) 5326 err = &smithy.DeserializationError{ 5327 Err: fmt.Errorf("failed to decode response body, %w", err), 5328 Snapshot: snapshot.Bytes(), 5329 } 5330 return err 5331 } 5332 5333 errorBody.Seek(0, io.SeekStart) 5334 if len(code) != 0 { 5335 errorCode = restjson.SanitizeErrorCode(code) 5336 } 5337 if len(message) != 0 { 5338 errorMessage = message 5339 } 5340 5341 switch { 5342 case strings.EqualFold("BadRequestException", errorCode): 5343 return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) 5344 5345 case strings.EqualFold("NotFoundException", errorCode): 5346 return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) 5347 5348 case strings.EqualFold("TooManyRequestsException", errorCode): 5349 return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody) 5350 5351 default: 5352 genericError := &smithy.GenericAPIError{ 5353 Code: errorCode, 5354 Message: errorMessage, 5355 } 5356 return genericError 5357 5358 } 5359} 5360 5361func awsRestjson1_deserializeOpDocumentGetSuppressedDestinationOutput(v **GetSuppressedDestinationOutput, value interface{}) error { 5362 if v == nil { 5363 return fmt.Errorf("unexpected nil of type %T", v) 5364 } 5365 if value == nil { 5366 return nil 5367 } 5368 5369 shape, ok := value.(map[string]interface{}) 5370 if !ok { 5371 return fmt.Errorf("unexpected JSON type %v", value) 5372 } 5373 5374 var sv *GetSuppressedDestinationOutput 5375 if *v == nil { 5376 sv = &GetSuppressedDestinationOutput{} 5377 } else { 5378 sv = *v 5379 } 5380 5381 for key, value := range shape { 5382 switch key { 5383 case "SuppressedDestination": 5384 if err := awsRestjson1_deserializeDocumentSuppressedDestination(&sv.SuppressedDestination, value); err != nil { 5385 return err 5386 } 5387 5388 default: 5389 _, _ = key, value 5390 5391 } 5392 } 5393 *v = sv 5394 return nil 5395} 5396 5397type awsRestjson1_deserializeOpListConfigurationSets struct { 5398} 5399 5400func (*awsRestjson1_deserializeOpListConfigurationSets) ID() string { 5401 return "OperationDeserializer" 5402} 5403 5404func (m *awsRestjson1_deserializeOpListConfigurationSets) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 5405 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 5406) { 5407 out, metadata, err = next.HandleDeserialize(ctx, in) 5408 if err != nil { 5409 return out, metadata, err 5410 } 5411 5412 response, ok := out.RawResponse.(*smithyhttp.Response) 5413 if !ok { 5414 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 5415 } 5416 5417 if response.StatusCode < 200 || response.StatusCode >= 300 { 5418 return out, metadata, awsRestjson1_deserializeOpErrorListConfigurationSets(response, &metadata) 5419 } 5420 output := &ListConfigurationSetsOutput{} 5421 out.Result = output 5422 5423 var buff [1024]byte 5424 ringBuffer := smithyio.NewRingBuffer(buff[:]) 5425 5426 body := io.TeeReader(response.Body, ringBuffer) 5427 5428 decoder := json.NewDecoder(body) 5429 decoder.UseNumber() 5430 var shape interface{} 5431 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 5432 var snapshot bytes.Buffer 5433 io.Copy(&snapshot, ringBuffer) 5434 err = &smithy.DeserializationError{ 5435 Err: fmt.Errorf("failed to decode response body, %w", err), 5436 Snapshot: snapshot.Bytes(), 5437 } 5438 return out, metadata, err 5439 } 5440 5441 err = awsRestjson1_deserializeOpDocumentListConfigurationSetsOutput(&output, shape) 5442 if err != nil { 5443 var snapshot bytes.Buffer 5444 io.Copy(&snapshot, ringBuffer) 5445 return out, metadata, &smithy.DeserializationError{ 5446 Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), 5447 Snapshot: snapshot.Bytes(), 5448 } 5449 } 5450 5451 return out, metadata, err 5452} 5453 5454func awsRestjson1_deserializeOpErrorListConfigurationSets(response *smithyhttp.Response, metadata *middleware.Metadata) error { 5455 var errorBuffer bytes.Buffer 5456 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 5457 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 5458 } 5459 errorBody := bytes.NewReader(errorBuffer.Bytes()) 5460 5461 errorCode := "UnknownError" 5462 errorMessage := errorCode 5463 5464 code := response.Header.Get("X-Amzn-ErrorType") 5465 if len(code) != 0 { 5466 errorCode = restjson.SanitizeErrorCode(code) 5467 } 5468 5469 var buff [1024]byte 5470 ringBuffer := smithyio.NewRingBuffer(buff[:]) 5471 5472 body := io.TeeReader(errorBody, ringBuffer) 5473 decoder := json.NewDecoder(body) 5474 decoder.UseNumber() 5475 code, message, err := restjson.GetErrorInfo(decoder) 5476 if err != nil { 5477 var snapshot bytes.Buffer 5478 io.Copy(&snapshot, ringBuffer) 5479 err = &smithy.DeserializationError{ 5480 Err: fmt.Errorf("failed to decode response body, %w", err), 5481 Snapshot: snapshot.Bytes(), 5482 } 5483 return err 5484 } 5485 5486 errorBody.Seek(0, io.SeekStart) 5487 if len(code) != 0 { 5488 errorCode = restjson.SanitizeErrorCode(code) 5489 } 5490 if len(message) != 0 { 5491 errorMessage = message 5492 } 5493 5494 switch { 5495 case strings.EqualFold("BadRequestException", errorCode): 5496 return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) 5497 5498 case strings.EqualFold("TooManyRequestsException", errorCode): 5499 return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody) 5500 5501 default: 5502 genericError := &smithy.GenericAPIError{ 5503 Code: errorCode, 5504 Message: errorMessage, 5505 } 5506 return genericError 5507 5508 } 5509} 5510 5511func awsRestjson1_deserializeOpDocumentListConfigurationSetsOutput(v **ListConfigurationSetsOutput, value interface{}) error { 5512 if v == nil { 5513 return fmt.Errorf("unexpected nil of type %T", v) 5514 } 5515 if value == nil { 5516 return nil 5517 } 5518 5519 shape, ok := value.(map[string]interface{}) 5520 if !ok { 5521 return fmt.Errorf("unexpected JSON type %v", value) 5522 } 5523 5524 var sv *ListConfigurationSetsOutput 5525 if *v == nil { 5526 sv = &ListConfigurationSetsOutput{} 5527 } else { 5528 sv = *v 5529 } 5530 5531 for key, value := range shape { 5532 switch key { 5533 case "ConfigurationSets": 5534 if err := awsRestjson1_deserializeDocumentConfigurationSetNameList(&sv.ConfigurationSets, value); err != nil { 5535 return err 5536 } 5537 5538 case "NextToken": 5539 if value != nil { 5540 jtv, ok := value.(string) 5541 if !ok { 5542 return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) 5543 } 5544 sv.NextToken = ptr.String(jtv) 5545 } 5546 5547 default: 5548 _, _ = key, value 5549 5550 } 5551 } 5552 *v = sv 5553 return nil 5554} 5555 5556type awsRestjson1_deserializeOpListContactLists struct { 5557} 5558 5559func (*awsRestjson1_deserializeOpListContactLists) ID() string { 5560 return "OperationDeserializer" 5561} 5562 5563func (m *awsRestjson1_deserializeOpListContactLists) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 5564 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 5565) { 5566 out, metadata, err = next.HandleDeserialize(ctx, in) 5567 if err != nil { 5568 return out, metadata, err 5569 } 5570 5571 response, ok := out.RawResponse.(*smithyhttp.Response) 5572 if !ok { 5573 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 5574 } 5575 5576 if response.StatusCode < 200 || response.StatusCode >= 300 { 5577 return out, metadata, awsRestjson1_deserializeOpErrorListContactLists(response, &metadata) 5578 } 5579 output := &ListContactListsOutput{} 5580 out.Result = output 5581 5582 var buff [1024]byte 5583 ringBuffer := smithyio.NewRingBuffer(buff[:]) 5584 5585 body := io.TeeReader(response.Body, ringBuffer) 5586 5587 decoder := json.NewDecoder(body) 5588 decoder.UseNumber() 5589 var shape interface{} 5590 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 5591 var snapshot bytes.Buffer 5592 io.Copy(&snapshot, ringBuffer) 5593 err = &smithy.DeserializationError{ 5594 Err: fmt.Errorf("failed to decode response body, %w", err), 5595 Snapshot: snapshot.Bytes(), 5596 } 5597 return out, metadata, err 5598 } 5599 5600 err = awsRestjson1_deserializeOpDocumentListContactListsOutput(&output, shape) 5601 if err != nil { 5602 var snapshot bytes.Buffer 5603 io.Copy(&snapshot, ringBuffer) 5604 return out, metadata, &smithy.DeserializationError{ 5605 Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), 5606 Snapshot: snapshot.Bytes(), 5607 } 5608 } 5609 5610 return out, metadata, err 5611} 5612 5613func awsRestjson1_deserializeOpErrorListContactLists(response *smithyhttp.Response, metadata *middleware.Metadata) error { 5614 var errorBuffer bytes.Buffer 5615 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 5616 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 5617 } 5618 errorBody := bytes.NewReader(errorBuffer.Bytes()) 5619 5620 errorCode := "UnknownError" 5621 errorMessage := errorCode 5622 5623 code := response.Header.Get("X-Amzn-ErrorType") 5624 if len(code) != 0 { 5625 errorCode = restjson.SanitizeErrorCode(code) 5626 } 5627 5628 var buff [1024]byte 5629 ringBuffer := smithyio.NewRingBuffer(buff[:]) 5630 5631 body := io.TeeReader(errorBody, ringBuffer) 5632 decoder := json.NewDecoder(body) 5633 decoder.UseNumber() 5634 code, message, err := restjson.GetErrorInfo(decoder) 5635 if err != nil { 5636 var snapshot bytes.Buffer 5637 io.Copy(&snapshot, ringBuffer) 5638 err = &smithy.DeserializationError{ 5639 Err: fmt.Errorf("failed to decode response body, %w", err), 5640 Snapshot: snapshot.Bytes(), 5641 } 5642 return err 5643 } 5644 5645 errorBody.Seek(0, io.SeekStart) 5646 if len(code) != 0 { 5647 errorCode = restjson.SanitizeErrorCode(code) 5648 } 5649 if len(message) != 0 { 5650 errorMessage = message 5651 } 5652 5653 switch { 5654 case strings.EqualFold("BadRequestException", errorCode): 5655 return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) 5656 5657 case strings.EqualFold("TooManyRequestsException", errorCode): 5658 return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody) 5659 5660 default: 5661 genericError := &smithy.GenericAPIError{ 5662 Code: errorCode, 5663 Message: errorMessage, 5664 } 5665 return genericError 5666 5667 } 5668} 5669 5670func awsRestjson1_deserializeOpDocumentListContactListsOutput(v **ListContactListsOutput, value interface{}) error { 5671 if v == nil { 5672 return fmt.Errorf("unexpected nil of type %T", v) 5673 } 5674 if value == nil { 5675 return nil 5676 } 5677 5678 shape, ok := value.(map[string]interface{}) 5679 if !ok { 5680 return fmt.Errorf("unexpected JSON type %v", value) 5681 } 5682 5683 var sv *ListContactListsOutput 5684 if *v == nil { 5685 sv = &ListContactListsOutput{} 5686 } else { 5687 sv = *v 5688 } 5689 5690 for key, value := range shape { 5691 switch key { 5692 case "ContactLists": 5693 if err := awsRestjson1_deserializeDocumentListOfContactLists(&sv.ContactLists, value); err != nil { 5694 return err 5695 } 5696 5697 case "NextToken": 5698 if value != nil { 5699 jtv, ok := value.(string) 5700 if !ok { 5701 return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) 5702 } 5703 sv.NextToken = ptr.String(jtv) 5704 } 5705 5706 default: 5707 _, _ = key, value 5708 5709 } 5710 } 5711 *v = sv 5712 return nil 5713} 5714 5715type awsRestjson1_deserializeOpListContacts struct { 5716} 5717 5718func (*awsRestjson1_deserializeOpListContacts) ID() string { 5719 return "OperationDeserializer" 5720} 5721 5722func (m *awsRestjson1_deserializeOpListContacts) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 5723 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 5724) { 5725 out, metadata, err = next.HandleDeserialize(ctx, in) 5726 if err != nil { 5727 return out, metadata, err 5728 } 5729 5730 response, ok := out.RawResponse.(*smithyhttp.Response) 5731 if !ok { 5732 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 5733 } 5734 5735 if response.StatusCode < 200 || response.StatusCode >= 300 { 5736 return out, metadata, awsRestjson1_deserializeOpErrorListContacts(response, &metadata) 5737 } 5738 output := &ListContactsOutput{} 5739 out.Result = output 5740 5741 var buff [1024]byte 5742 ringBuffer := smithyio.NewRingBuffer(buff[:]) 5743 5744 body := io.TeeReader(response.Body, ringBuffer) 5745 5746 decoder := json.NewDecoder(body) 5747 decoder.UseNumber() 5748 var shape interface{} 5749 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 5750 var snapshot bytes.Buffer 5751 io.Copy(&snapshot, ringBuffer) 5752 err = &smithy.DeserializationError{ 5753 Err: fmt.Errorf("failed to decode response body, %w", err), 5754 Snapshot: snapshot.Bytes(), 5755 } 5756 return out, metadata, err 5757 } 5758 5759 err = awsRestjson1_deserializeOpDocumentListContactsOutput(&output, shape) 5760 if err != nil { 5761 var snapshot bytes.Buffer 5762 io.Copy(&snapshot, ringBuffer) 5763 return out, metadata, &smithy.DeserializationError{ 5764 Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), 5765 Snapshot: snapshot.Bytes(), 5766 } 5767 } 5768 5769 return out, metadata, err 5770} 5771 5772func awsRestjson1_deserializeOpErrorListContacts(response *smithyhttp.Response, metadata *middleware.Metadata) error { 5773 var errorBuffer bytes.Buffer 5774 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 5775 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 5776 } 5777 errorBody := bytes.NewReader(errorBuffer.Bytes()) 5778 5779 errorCode := "UnknownError" 5780 errorMessage := errorCode 5781 5782 code := response.Header.Get("X-Amzn-ErrorType") 5783 if len(code) != 0 { 5784 errorCode = restjson.SanitizeErrorCode(code) 5785 } 5786 5787 var buff [1024]byte 5788 ringBuffer := smithyio.NewRingBuffer(buff[:]) 5789 5790 body := io.TeeReader(errorBody, ringBuffer) 5791 decoder := json.NewDecoder(body) 5792 decoder.UseNumber() 5793 code, message, err := restjson.GetErrorInfo(decoder) 5794 if err != nil { 5795 var snapshot bytes.Buffer 5796 io.Copy(&snapshot, ringBuffer) 5797 err = &smithy.DeserializationError{ 5798 Err: fmt.Errorf("failed to decode response body, %w", err), 5799 Snapshot: snapshot.Bytes(), 5800 } 5801 return err 5802 } 5803 5804 errorBody.Seek(0, io.SeekStart) 5805 if len(code) != 0 { 5806 errorCode = restjson.SanitizeErrorCode(code) 5807 } 5808 if len(message) != 0 { 5809 errorMessage = message 5810 } 5811 5812 switch { 5813 case strings.EqualFold("BadRequestException", errorCode): 5814 return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) 5815 5816 case strings.EqualFold("NotFoundException", errorCode): 5817 return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) 5818 5819 case strings.EqualFold("TooManyRequestsException", errorCode): 5820 return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody) 5821 5822 default: 5823 genericError := &smithy.GenericAPIError{ 5824 Code: errorCode, 5825 Message: errorMessage, 5826 } 5827 return genericError 5828 5829 } 5830} 5831 5832func awsRestjson1_deserializeOpDocumentListContactsOutput(v **ListContactsOutput, value interface{}) error { 5833 if v == nil { 5834 return fmt.Errorf("unexpected nil of type %T", v) 5835 } 5836 if value == nil { 5837 return nil 5838 } 5839 5840 shape, ok := value.(map[string]interface{}) 5841 if !ok { 5842 return fmt.Errorf("unexpected JSON type %v", value) 5843 } 5844 5845 var sv *ListContactsOutput 5846 if *v == nil { 5847 sv = &ListContactsOutput{} 5848 } else { 5849 sv = *v 5850 } 5851 5852 for key, value := range shape { 5853 switch key { 5854 case "Contacts": 5855 if err := awsRestjson1_deserializeDocumentListOfContacts(&sv.Contacts, value); err != nil { 5856 return err 5857 } 5858 5859 case "NextToken": 5860 if value != nil { 5861 jtv, ok := value.(string) 5862 if !ok { 5863 return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) 5864 } 5865 sv.NextToken = ptr.String(jtv) 5866 } 5867 5868 default: 5869 _, _ = key, value 5870 5871 } 5872 } 5873 *v = sv 5874 return nil 5875} 5876 5877type awsRestjson1_deserializeOpListCustomVerificationEmailTemplates struct { 5878} 5879 5880func (*awsRestjson1_deserializeOpListCustomVerificationEmailTemplates) ID() string { 5881 return "OperationDeserializer" 5882} 5883 5884func (m *awsRestjson1_deserializeOpListCustomVerificationEmailTemplates) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 5885 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 5886) { 5887 out, metadata, err = next.HandleDeserialize(ctx, in) 5888 if err != nil { 5889 return out, metadata, err 5890 } 5891 5892 response, ok := out.RawResponse.(*smithyhttp.Response) 5893 if !ok { 5894 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 5895 } 5896 5897 if response.StatusCode < 200 || response.StatusCode >= 300 { 5898 return out, metadata, awsRestjson1_deserializeOpErrorListCustomVerificationEmailTemplates(response, &metadata) 5899 } 5900 output := &ListCustomVerificationEmailTemplatesOutput{} 5901 out.Result = output 5902 5903 var buff [1024]byte 5904 ringBuffer := smithyio.NewRingBuffer(buff[:]) 5905 5906 body := io.TeeReader(response.Body, ringBuffer) 5907 5908 decoder := json.NewDecoder(body) 5909 decoder.UseNumber() 5910 var shape interface{} 5911 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 5912 var snapshot bytes.Buffer 5913 io.Copy(&snapshot, ringBuffer) 5914 err = &smithy.DeserializationError{ 5915 Err: fmt.Errorf("failed to decode response body, %w", err), 5916 Snapshot: snapshot.Bytes(), 5917 } 5918 return out, metadata, err 5919 } 5920 5921 err = awsRestjson1_deserializeOpDocumentListCustomVerificationEmailTemplatesOutput(&output, shape) 5922 if err != nil { 5923 var snapshot bytes.Buffer 5924 io.Copy(&snapshot, ringBuffer) 5925 return out, metadata, &smithy.DeserializationError{ 5926 Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), 5927 Snapshot: snapshot.Bytes(), 5928 } 5929 } 5930 5931 return out, metadata, err 5932} 5933 5934func awsRestjson1_deserializeOpErrorListCustomVerificationEmailTemplates(response *smithyhttp.Response, metadata *middleware.Metadata) error { 5935 var errorBuffer bytes.Buffer 5936 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 5937 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 5938 } 5939 errorBody := bytes.NewReader(errorBuffer.Bytes()) 5940 5941 errorCode := "UnknownError" 5942 errorMessage := errorCode 5943 5944 code := response.Header.Get("X-Amzn-ErrorType") 5945 if len(code) != 0 { 5946 errorCode = restjson.SanitizeErrorCode(code) 5947 } 5948 5949 var buff [1024]byte 5950 ringBuffer := smithyio.NewRingBuffer(buff[:]) 5951 5952 body := io.TeeReader(errorBody, ringBuffer) 5953 decoder := json.NewDecoder(body) 5954 decoder.UseNumber() 5955 code, message, err := restjson.GetErrorInfo(decoder) 5956 if err != nil { 5957 var snapshot bytes.Buffer 5958 io.Copy(&snapshot, ringBuffer) 5959 err = &smithy.DeserializationError{ 5960 Err: fmt.Errorf("failed to decode response body, %w", err), 5961 Snapshot: snapshot.Bytes(), 5962 } 5963 return err 5964 } 5965 5966 errorBody.Seek(0, io.SeekStart) 5967 if len(code) != 0 { 5968 errorCode = restjson.SanitizeErrorCode(code) 5969 } 5970 if len(message) != 0 { 5971 errorMessage = message 5972 } 5973 5974 switch { 5975 case strings.EqualFold("BadRequestException", errorCode): 5976 return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) 5977 5978 case strings.EqualFold("TooManyRequestsException", errorCode): 5979 return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody) 5980 5981 default: 5982 genericError := &smithy.GenericAPIError{ 5983 Code: errorCode, 5984 Message: errorMessage, 5985 } 5986 return genericError 5987 5988 } 5989} 5990 5991func awsRestjson1_deserializeOpDocumentListCustomVerificationEmailTemplatesOutput(v **ListCustomVerificationEmailTemplatesOutput, value interface{}) error { 5992 if v == nil { 5993 return fmt.Errorf("unexpected nil of type %T", v) 5994 } 5995 if value == nil { 5996 return nil 5997 } 5998 5999 shape, ok := value.(map[string]interface{}) 6000 if !ok { 6001 return fmt.Errorf("unexpected JSON type %v", value) 6002 } 6003 6004 var sv *ListCustomVerificationEmailTemplatesOutput 6005 if *v == nil { 6006 sv = &ListCustomVerificationEmailTemplatesOutput{} 6007 } else { 6008 sv = *v 6009 } 6010 6011 for key, value := range shape { 6012 switch key { 6013 case "CustomVerificationEmailTemplates": 6014 if err := awsRestjson1_deserializeDocumentCustomVerificationEmailTemplatesList(&sv.CustomVerificationEmailTemplates, value); err != nil { 6015 return err 6016 } 6017 6018 case "NextToken": 6019 if value != nil { 6020 jtv, ok := value.(string) 6021 if !ok { 6022 return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) 6023 } 6024 sv.NextToken = ptr.String(jtv) 6025 } 6026 6027 default: 6028 _, _ = key, value 6029 6030 } 6031 } 6032 *v = sv 6033 return nil 6034} 6035 6036type awsRestjson1_deserializeOpListDedicatedIpPools struct { 6037} 6038 6039func (*awsRestjson1_deserializeOpListDedicatedIpPools) ID() string { 6040 return "OperationDeserializer" 6041} 6042 6043func (m *awsRestjson1_deserializeOpListDedicatedIpPools) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 6044 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 6045) { 6046 out, metadata, err = next.HandleDeserialize(ctx, in) 6047 if err != nil { 6048 return out, metadata, err 6049 } 6050 6051 response, ok := out.RawResponse.(*smithyhttp.Response) 6052 if !ok { 6053 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 6054 } 6055 6056 if response.StatusCode < 200 || response.StatusCode >= 300 { 6057 return out, metadata, awsRestjson1_deserializeOpErrorListDedicatedIpPools(response, &metadata) 6058 } 6059 output := &ListDedicatedIpPoolsOutput{} 6060 out.Result = output 6061 6062 var buff [1024]byte 6063 ringBuffer := smithyio.NewRingBuffer(buff[:]) 6064 6065 body := io.TeeReader(response.Body, ringBuffer) 6066 6067 decoder := json.NewDecoder(body) 6068 decoder.UseNumber() 6069 var shape interface{} 6070 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 6071 var snapshot bytes.Buffer 6072 io.Copy(&snapshot, ringBuffer) 6073 err = &smithy.DeserializationError{ 6074 Err: fmt.Errorf("failed to decode response body, %w", err), 6075 Snapshot: snapshot.Bytes(), 6076 } 6077 return out, metadata, err 6078 } 6079 6080 err = awsRestjson1_deserializeOpDocumentListDedicatedIpPoolsOutput(&output, shape) 6081 if err != nil { 6082 var snapshot bytes.Buffer 6083 io.Copy(&snapshot, ringBuffer) 6084 return out, metadata, &smithy.DeserializationError{ 6085 Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), 6086 Snapshot: snapshot.Bytes(), 6087 } 6088 } 6089 6090 return out, metadata, err 6091} 6092 6093func awsRestjson1_deserializeOpErrorListDedicatedIpPools(response *smithyhttp.Response, metadata *middleware.Metadata) error { 6094 var errorBuffer bytes.Buffer 6095 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 6096 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 6097 } 6098 errorBody := bytes.NewReader(errorBuffer.Bytes()) 6099 6100 errorCode := "UnknownError" 6101 errorMessage := errorCode 6102 6103 code := response.Header.Get("X-Amzn-ErrorType") 6104 if len(code) != 0 { 6105 errorCode = restjson.SanitizeErrorCode(code) 6106 } 6107 6108 var buff [1024]byte 6109 ringBuffer := smithyio.NewRingBuffer(buff[:]) 6110 6111 body := io.TeeReader(errorBody, ringBuffer) 6112 decoder := json.NewDecoder(body) 6113 decoder.UseNumber() 6114 code, message, err := restjson.GetErrorInfo(decoder) 6115 if err != nil { 6116 var snapshot bytes.Buffer 6117 io.Copy(&snapshot, ringBuffer) 6118 err = &smithy.DeserializationError{ 6119 Err: fmt.Errorf("failed to decode response body, %w", err), 6120 Snapshot: snapshot.Bytes(), 6121 } 6122 return err 6123 } 6124 6125 errorBody.Seek(0, io.SeekStart) 6126 if len(code) != 0 { 6127 errorCode = restjson.SanitizeErrorCode(code) 6128 } 6129 if len(message) != 0 { 6130 errorMessage = message 6131 } 6132 6133 switch { 6134 case strings.EqualFold("BadRequestException", errorCode): 6135 return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) 6136 6137 case strings.EqualFold("TooManyRequestsException", errorCode): 6138 return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody) 6139 6140 default: 6141 genericError := &smithy.GenericAPIError{ 6142 Code: errorCode, 6143 Message: errorMessage, 6144 } 6145 return genericError 6146 6147 } 6148} 6149 6150func awsRestjson1_deserializeOpDocumentListDedicatedIpPoolsOutput(v **ListDedicatedIpPoolsOutput, value interface{}) error { 6151 if v == nil { 6152 return fmt.Errorf("unexpected nil of type %T", v) 6153 } 6154 if value == nil { 6155 return nil 6156 } 6157 6158 shape, ok := value.(map[string]interface{}) 6159 if !ok { 6160 return fmt.Errorf("unexpected JSON type %v", value) 6161 } 6162 6163 var sv *ListDedicatedIpPoolsOutput 6164 if *v == nil { 6165 sv = &ListDedicatedIpPoolsOutput{} 6166 } else { 6167 sv = *v 6168 } 6169 6170 for key, value := range shape { 6171 switch key { 6172 case "DedicatedIpPools": 6173 if err := awsRestjson1_deserializeDocumentListOfDedicatedIpPools(&sv.DedicatedIpPools, value); err != nil { 6174 return err 6175 } 6176 6177 case "NextToken": 6178 if value != nil { 6179 jtv, ok := value.(string) 6180 if !ok { 6181 return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) 6182 } 6183 sv.NextToken = ptr.String(jtv) 6184 } 6185 6186 default: 6187 _, _ = key, value 6188 6189 } 6190 } 6191 *v = sv 6192 return nil 6193} 6194 6195type awsRestjson1_deserializeOpListDeliverabilityTestReports struct { 6196} 6197 6198func (*awsRestjson1_deserializeOpListDeliverabilityTestReports) ID() string { 6199 return "OperationDeserializer" 6200} 6201 6202func (m *awsRestjson1_deserializeOpListDeliverabilityTestReports) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 6203 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 6204) { 6205 out, metadata, err = next.HandleDeserialize(ctx, in) 6206 if err != nil { 6207 return out, metadata, err 6208 } 6209 6210 response, ok := out.RawResponse.(*smithyhttp.Response) 6211 if !ok { 6212 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 6213 } 6214 6215 if response.StatusCode < 200 || response.StatusCode >= 300 { 6216 return out, metadata, awsRestjson1_deserializeOpErrorListDeliverabilityTestReports(response, &metadata) 6217 } 6218 output := &ListDeliverabilityTestReportsOutput{} 6219 out.Result = output 6220 6221 var buff [1024]byte 6222 ringBuffer := smithyio.NewRingBuffer(buff[:]) 6223 6224 body := io.TeeReader(response.Body, ringBuffer) 6225 6226 decoder := json.NewDecoder(body) 6227 decoder.UseNumber() 6228 var shape interface{} 6229 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 6230 var snapshot bytes.Buffer 6231 io.Copy(&snapshot, ringBuffer) 6232 err = &smithy.DeserializationError{ 6233 Err: fmt.Errorf("failed to decode response body, %w", err), 6234 Snapshot: snapshot.Bytes(), 6235 } 6236 return out, metadata, err 6237 } 6238 6239 err = awsRestjson1_deserializeOpDocumentListDeliverabilityTestReportsOutput(&output, shape) 6240 if err != nil { 6241 var snapshot bytes.Buffer 6242 io.Copy(&snapshot, ringBuffer) 6243 return out, metadata, &smithy.DeserializationError{ 6244 Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), 6245 Snapshot: snapshot.Bytes(), 6246 } 6247 } 6248 6249 return out, metadata, err 6250} 6251 6252func awsRestjson1_deserializeOpErrorListDeliverabilityTestReports(response *smithyhttp.Response, metadata *middleware.Metadata) error { 6253 var errorBuffer bytes.Buffer 6254 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 6255 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 6256 } 6257 errorBody := bytes.NewReader(errorBuffer.Bytes()) 6258 6259 errorCode := "UnknownError" 6260 errorMessage := errorCode 6261 6262 code := response.Header.Get("X-Amzn-ErrorType") 6263 if len(code) != 0 { 6264 errorCode = restjson.SanitizeErrorCode(code) 6265 } 6266 6267 var buff [1024]byte 6268 ringBuffer := smithyio.NewRingBuffer(buff[:]) 6269 6270 body := io.TeeReader(errorBody, ringBuffer) 6271 decoder := json.NewDecoder(body) 6272 decoder.UseNumber() 6273 code, message, err := restjson.GetErrorInfo(decoder) 6274 if err != nil { 6275 var snapshot bytes.Buffer 6276 io.Copy(&snapshot, ringBuffer) 6277 err = &smithy.DeserializationError{ 6278 Err: fmt.Errorf("failed to decode response body, %w", err), 6279 Snapshot: snapshot.Bytes(), 6280 } 6281 return err 6282 } 6283 6284 errorBody.Seek(0, io.SeekStart) 6285 if len(code) != 0 { 6286 errorCode = restjson.SanitizeErrorCode(code) 6287 } 6288 if len(message) != 0 { 6289 errorMessage = message 6290 } 6291 6292 switch { 6293 case strings.EqualFold("BadRequestException", errorCode): 6294 return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) 6295 6296 case strings.EqualFold("NotFoundException", errorCode): 6297 return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) 6298 6299 case strings.EqualFold("TooManyRequestsException", errorCode): 6300 return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody) 6301 6302 default: 6303 genericError := &smithy.GenericAPIError{ 6304 Code: errorCode, 6305 Message: errorMessage, 6306 } 6307 return genericError 6308 6309 } 6310} 6311 6312func awsRestjson1_deserializeOpDocumentListDeliverabilityTestReportsOutput(v **ListDeliverabilityTestReportsOutput, value interface{}) error { 6313 if v == nil { 6314 return fmt.Errorf("unexpected nil of type %T", v) 6315 } 6316 if value == nil { 6317 return nil 6318 } 6319 6320 shape, ok := value.(map[string]interface{}) 6321 if !ok { 6322 return fmt.Errorf("unexpected JSON type %v", value) 6323 } 6324 6325 var sv *ListDeliverabilityTestReportsOutput 6326 if *v == nil { 6327 sv = &ListDeliverabilityTestReportsOutput{} 6328 } else { 6329 sv = *v 6330 } 6331 6332 for key, value := range shape { 6333 switch key { 6334 case "DeliverabilityTestReports": 6335 if err := awsRestjson1_deserializeDocumentDeliverabilityTestReports(&sv.DeliverabilityTestReports, value); err != nil { 6336 return err 6337 } 6338 6339 case "NextToken": 6340 if value != nil { 6341 jtv, ok := value.(string) 6342 if !ok { 6343 return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) 6344 } 6345 sv.NextToken = ptr.String(jtv) 6346 } 6347 6348 default: 6349 _, _ = key, value 6350 6351 } 6352 } 6353 *v = sv 6354 return nil 6355} 6356 6357type awsRestjson1_deserializeOpListDomainDeliverabilityCampaigns struct { 6358} 6359 6360func (*awsRestjson1_deserializeOpListDomainDeliverabilityCampaigns) ID() string { 6361 return "OperationDeserializer" 6362} 6363 6364func (m *awsRestjson1_deserializeOpListDomainDeliverabilityCampaigns) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 6365 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 6366) { 6367 out, metadata, err = next.HandleDeserialize(ctx, in) 6368 if err != nil { 6369 return out, metadata, err 6370 } 6371 6372 response, ok := out.RawResponse.(*smithyhttp.Response) 6373 if !ok { 6374 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 6375 } 6376 6377 if response.StatusCode < 200 || response.StatusCode >= 300 { 6378 return out, metadata, awsRestjson1_deserializeOpErrorListDomainDeliverabilityCampaigns(response, &metadata) 6379 } 6380 output := &ListDomainDeliverabilityCampaignsOutput{} 6381 out.Result = output 6382 6383 var buff [1024]byte 6384 ringBuffer := smithyio.NewRingBuffer(buff[:]) 6385 6386 body := io.TeeReader(response.Body, ringBuffer) 6387 6388 decoder := json.NewDecoder(body) 6389 decoder.UseNumber() 6390 var shape interface{} 6391 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 6392 var snapshot bytes.Buffer 6393 io.Copy(&snapshot, ringBuffer) 6394 err = &smithy.DeserializationError{ 6395 Err: fmt.Errorf("failed to decode response body, %w", err), 6396 Snapshot: snapshot.Bytes(), 6397 } 6398 return out, metadata, err 6399 } 6400 6401 err = awsRestjson1_deserializeOpDocumentListDomainDeliverabilityCampaignsOutput(&output, shape) 6402 if err != nil { 6403 var snapshot bytes.Buffer 6404 io.Copy(&snapshot, ringBuffer) 6405 return out, metadata, &smithy.DeserializationError{ 6406 Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), 6407 Snapshot: snapshot.Bytes(), 6408 } 6409 } 6410 6411 return out, metadata, err 6412} 6413 6414func awsRestjson1_deserializeOpErrorListDomainDeliverabilityCampaigns(response *smithyhttp.Response, metadata *middleware.Metadata) error { 6415 var errorBuffer bytes.Buffer 6416 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 6417 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 6418 } 6419 errorBody := bytes.NewReader(errorBuffer.Bytes()) 6420 6421 errorCode := "UnknownError" 6422 errorMessage := errorCode 6423 6424 code := response.Header.Get("X-Amzn-ErrorType") 6425 if len(code) != 0 { 6426 errorCode = restjson.SanitizeErrorCode(code) 6427 } 6428 6429 var buff [1024]byte 6430 ringBuffer := smithyio.NewRingBuffer(buff[:]) 6431 6432 body := io.TeeReader(errorBody, ringBuffer) 6433 decoder := json.NewDecoder(body) 6434 decoder.UseNumber() 6435 code, message, err := restjson.GetErrorInfo(decoder) 6436 if err != nil { 6437 var snapshot bytes.Buffer 6438 io.Copy(&snapshot, ringBuffer) 6439 err = &smithy.DeserializationError{ 6440 Err: fmt.Errorf("failed to decode response body, %w", err), 6441 Snapshot: snapshot.Bytes(), 6442 } 6443 return err 6444 } 6445 6446 errorBody.Seek(0, io.SeekStart) 6447 if len(code) != 0 { 6448 errorCode = restjson.SanitizeErrorCode(code) 6449 } 6450 if len(message) != 0 { 6451 errorMessage = message 6452 } 6453 6454 switch { 6455 case strings.EqualFold("BadRequestException", errorCode): 6456 return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) 6457 6458 case strings.EqualFold("NotFoundException", errorCode): 6459 return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) 6460 6461 case strings.EqualFold("TooManyRequestsException", errorCode): 6462 return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody) 6463 6464 default: 6465 genericError := &smithy.GenericAPIError{ 6466 Code: errorCode, 6467 Message: errorMessage, 6468 } 6469 return genericError 6470 6471 } 6472} 6473 6474func awsRestjson1_deserializeOpDocumentListDomainDeliverabilityCampaignsOutput(v **ListDomainDeliverabilityCampaignsOutput, value interface{}) error { 6475 if v == nil { 6476 return fmt.Errorf("unexpected nil of type %T", v) 6477 } 6478 if value == nil { 6479 return nil 6480 } 6481 6482 shape, ok := value.(map[string]interface{}) 6483 if !ok { 6484 return fmt.Errorf("unexpected JSON type %v", value) 6485 } 6486 6487 var sv *ListDomainDeliverabilityCampaignsOutput 6488 if *v == nil { 6489 sv = &ListDomainDeliverabilityCampaignsOutput{} 6490 } else { 6491 sv = *v 6492 } 6493 6494 for key, value := range shape { 6495 switch key { 6496 case "DomainDeliverabilityCampaigns": 6497 if err := awsRestjson1_deserializeDocumentDomainDeliverabilityCampaignList(&sv.DomainDeliverabilityCampaigns, value); err != nil { 6498 return err 6499 } 6500 6501 case "NextToken": 6502 if value != nil { 6503 jtv, ok := value.(string) 6504 if !ok { 6505 return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) 6506 } 6507 sv.NextToken = ptr.String(jtv) 6508 } 6509 6510 default: 6511 _, _ = key, value 6512 6513 } 6514 } 6515 *v = sv 6516 return nil 6517} 6518 6519type awsRestjson1_deserializeOpListEmailIdentities struct { 6520} 6521 6522func (*awsRestjson1_deserializeOpListEmailIdentities) ID() string { 6523 return "OperationDeserializer" 6524} 6525 6526func (m *awsRestjson1_deserializeOpListEmailIdentities) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 6527 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 6528) { 6529 out, metadata, err = next.HandleDeserialize(ctx, in) 6530 if err != nil { 6531 return out, metadata, err 6532 } 6533 6534 response, ok := out.RawResponse.(*smithyhttp.Response) 6535 if !ok { 6536 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 6537 } 6538 6539 if response.StatusCode < 200 || response.StatusCode >= 300 { 6540 return out, metadata, awsRestjson1_deserializeOpErrorListEmailIdentities(response, &metadata) 6541 } 6542 output := &ListEmailIdentitiesOutput{} 6543 out.Result = output 6544 6545 var buff [1024]byte 6546 ringBuffer := smithyio.NewRingBuffer(buff[:]) 6547 6548 body := io.TeeReader(response.Body, ringBuffer) 6549 6550 decoder := json.NewDecoder(body) 6551 decoder.UseNumber() 6552 var shape interface{} 6553 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 6554 var snapshot bytes.Buffer 6555 io.Copy(&snapshot, ringBuffer) 6556 err = &smithy.DeserializationError{ 6557 Err: fmt.Errorf("failed to decode response body, %w", err), 6558 Snapshot: snapshot.Bytes(), 6559 } 6560 return out, metadata, err 6561 } 6562 6563 err = awsRestjson1_deserializeOpDocumentListEmailIdentitiesOutput(&output, shape) 6564 if err != nil { 6565 var snapshot bytes.Buffer 6566 io.Copy(&snapshot, ringBuffer) 6567 return out, metadata, &smithy.DeserializationError{ 6568 Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), 6569 Snapshot: snapshot.Bytes(), 6570 } 6571 } 6572 6573 return out, metadata, err 6574} 6575 6576func awsRestjson1_deserializeOpErrorListEmailIdentities(response *smithyhttp.Response, metadata *middleware.Metadata) error { 6577 var errorBuffer bytes.Buffer 6578 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 6579 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 6580 } 6581 errorBody := bytes.NewReader(errorBuffer.Bytes()) 6582 6583 errorCode := "UnknownError" 6584 errorMessage := errorCode 6585 6586 code := response.Header.Get("X-Amzn-ErrorType") 6587 if len(code) != 0 { 6588 errorCode = restjson.SanitizeErrorCode(code) 6589 } 6590 6591 var buff [1024]byte 6592 ringBuffer := smithyio.NewRingBuffer(buff[:]) 6593 6594 body := io.TeeReader(errorBody, ringBuffer) 6595 decoder := json.NewDecoder(body) 6596 decoder.UseNumber() 6597 code, message, err := restjson.GetErrorInfo(decoder) 6598 if err != nil { 6599 var snapshot bytes.Buffer 6600 io.Copy(&snapshot, ringBuffer) 6601 err = &smithy.DeserializationError{ 6602 Err: fmt.Errorf("failed to decode response body, %w", err), 6603 Snapshot: snapshot.Bytes(), 6604 } 6605 return err 6606 } 6607 6608 errorBody.Seek(0, io.SeekStart) 6609 if len(code) != 0 { 6610 errorCode = restjson.SanitizeErrorCode(code) 6611 } 6612 if len(message) != 0 { 6613 errorMessage = message 6614 } 6615 6616 switch { 6617 case strings.EqualFold("BadRequestException", errorCode): 6618 return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) 6619 6620 case strings.EqualFold("TooManyRequestsException", errorCode): 6621 return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody) 6622 6623 default: 6624 genericError := &smithy.GenericAPIError{ 6625 Code: errorCode, 6626 Message: errorMessage, 6627 } 6628 return genericError 6629 6630 } 6631} 6632 6633func awsRestjson1_deserializeOpDocumentListEmailIdentitiesOutput(v **ListEmailIdentitiesOutput, value interface{}) error { 6634 if v == nil { 6635 return fmt.Errorf("unexpected nil of type %T", v) 6636 } 6637 if value == nil { 6638 return nil 6639 } 6640 6641 shape, ok := value.(map[string]interface{}) 6642 if !ok { 6643 return fmt.Errorf("unexpected JSON type %v", value) 6644 } 6645 6646 var sv *ListEmailIdentitiesOutput 6647 if *v == nil { 6648 sv = &ListEmailIdentitiesOutput{} 6649 } else { 6650 sv = *v 6651 } 6652 6653 for key, value := range shape { 6654 switch key { 6655 case "EmailIdentities": 6656 if err := awsRestjson1_deserializeDocumentIdentityInfoList(&sv.EmailIdentities, value); err != nil { 6657 return err 6658 } 6659 6660 case "NextToken": 6661 if value != nil { 6662 jtv, ok := value.(string) 6663 if !ok { 6664 return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) 6665 } 6666 sv.NextToken = ptr.String(jtv) 6667 } 6668 6669 default: 6670 _, _ = key, value 6671 6672 } 6673 } 6674 *v = sv 6675 return nil 6676} 6677 6678type awsRestjson1_deserializeOpListEmailTemplates struct { 6679} 6680 6681func (*awsRestjson1_deserializeOpListEmailTemplates) ID() string { 6682 return "OperationDeserializer" 6683} 6684 6685func (m *awsRestjson1_deserializeOpListEmailTemplates) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 6686 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 6687) { 6688 out, metadata, err = next.HandleDeserialize(ctx, in) 6689 if err != nil { 6690 return out, metadata, err 6691 } 6692 6693 response, ok := out.RawResponse.(*smithyhttp.Response) 6694 if !ok { 6695 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 6696 } 6697 6698 if response.StatusCode < 200 || response.StatusCode >= 300 { 6699 return out, metadata, awsRestjson1_deserializeOpErrorListEmailTemplates(response, &metadata) 6700 } 6701 output := &ListEmailTemplatesOutput{} 6702 out.Result = output 6703 6704 var buff [1024]byte 6705 ringBuffer := smithyio.NewRingBuffer(buff[:]) 6706 6707 body := io.TeeReader(response.Body, ringBuffer) 6708 6709 decoder := json.NewDecoder(body) 6710 decoder.UseNumber() 6711 var shape interface{} 6712 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 6713 var snapshot bytes.Buffer 6714 io.Copy(&snapshot, ringBuffer) 6715 err = &smithy.DeserializationError{ 6716 Err: fmt.Errorf("failed to decode response body, %w", err), 6717 Snapshot: snapshot.Bytes(), 6718 } 6719 return out, metadata, err 6720 } 6721 6722 err = awsRestjson1_deserializeOpDocumentListEmailTemplatesOutput(&output, shape) 6723 if err != nil { 6724 var snapshot bytes.Buffer 6725 io.Copy(&snapshot, ringBuffer) 6726 return out, metadata, &smithy.DeserializationError{ 6727 Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), 6728 Snapshot: snapshot.Bytes(), 6729 } 6730 } 6731 6732 return out, metadata, err 6733} 6734 6735func awsRestjson1_deserializeOpErrorListEmailTemplates(response *smithyhttp.Response, metadata *middleware.Metadata) error { 6736 var errorBuffer bytes.Buffer 6737 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 6738 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 6739 } 6740 errorBody := bytes.NewReader(errorBuffer.Bytes()) 6741 6742 errorCode := "UnknownError" 6743 errorMessage := errorCode 6744 6745 code := response.Header.Get("X-Amzn-ErrorType") 6746 if len(code) != 0 { 6747 errorCode = restjson.SanitizeErrorCode(code) 6748 } 6749 6750 var buff [1024]byte 6751 ringBuffer := smithyio.NewRingBuffer(buff[:]) 6752 6753 body := io.TeeReader(errorBody, ringBuffer) 6754 decoder := json.NewDecoder(body) 6755 decoder.UseNumber() 6756 code, message, err := restjson.GetErrorInfo(decoder) 6757 if err != nil { 6758 var snapshot bytes.Buffer 6759 io.Copy(&snapshot, ringBuffer) 6760 err = &smithy.DeserializationError{ 6761 Err: fmt.Errorf("failed to decode response body, %w", err), 6762 Snapshot: snapshot.Bytes(), 6763 } 6764 return err 6765 } 6766 6767 errorBody.Seek(0, io.SeekStart) 6768 if len(code) != 0 { 6769 errorCode = restjson.SanitizeErrorCode(code) 6770 } 6771 if len(message) != 0 { 6772 errorMessage = message 6773 } 6774 6775 switch { 6776 case strings.EqualFold("BadRequestException", errorCode): 6777 return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) 6778 6779 case strings.EqualFold("TooManyRequestsException", errorCode): 6780 return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody) 6781 6782 default: 6783 genericError := &smithy.GenericAPIError{ 6784 Code: errorCode, 6785 Message: errorMessage, 6786 } 6787 return genericError 6788 6789 } 6790} 6791 6792func awsRestjson1_deserializeOpDocumentListEmailTemplatesOutput(v **ListEmailTemplatesOutput, value interface{}) error { 6793 if v == nil { 6794 return fmt.Errorf("unexpected nil of type %T", v) 6795 } 6796 if value == nil { 6797 return nil 6798 } 6799 6800 shape, ok := value.(map[string]interface{}) 6801 if !ok { 6802 return fmt.Errorf("unexpected JSON type %v", value) 6803 } 6804 6805 var sv *ListEmailTemplatesOutput 6806 if *v == nil { 6807 sv = &ListEmailTemplatesOutput{} 6808 } else { 6809 sv = *v 6810 } 6811 6812 for key, value := range shape { 6813 switch key { 6814 case "NextToken": 6815 if value != nil { 6816 jtv, ok := value.(string) 6817 if !ok { 6818 return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) 6819 } 6820 sv.NextToken = ptr.String(jtv) 6821 } 6822 6823 case "TemplatesMetadata": 6824 if err := awsRestjson1_deserializeDocumentEmailTemplateMetadataList(&sv.TemplatesMetadata, value); err != nil { 6825 return err 6826 } 6827 6828 default: 6829 _, _ = key, value 6830 6831 } 6832 } 6833 *v = sv 6834 return nil 6835} 6836 6837type awsRestjson1_deserializeOpListImportJobs struct { 6838} 6839 6840func (*awsRestjson1_deserializeOpListImportJobs) ID() string { 6841 return "OperationDeserializer" 6842} 6843 6844func (m *awsRestjson1_deserializeOpListImportJobs) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 6845 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 6846) { 6847 out, metadata, err = next.HandleDeserialize(ctx, in) 6848 if err != nil { 6849 return out, metadata, err 6850 } 6851 6852 response, ok := out.RawResponse.(*smithyhttp.Response) 6853 if !ok { 6854 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 6855 } 6856 6857 if response.StatusCode < 200 || response.StatusCode >= 300 { 6858 return out, metadata, awsRestjson1_deserializeOpErrorListImportJobs(response, &metadata) 6859 } 6860 output := &ListImportJobsOutput{} 6861 out.Result = output 6862 6863 var buff [1024]byte 6864 ringBuffer := smithyio.NewRingBuffer(buff[:]) 6865 6866 body := io.TeeReader(response.Body, ringBuffer) 6867 6868 decoder := json.NewDecoder(body) 6869 decoder.UseNumber() 6870 var shape interface{} 6871 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 6872 var snapshot bytes.Buffer 6873 io.Copy(&snapshot, ringBuffer) 6874 err = &smithy.DeserializationError{ 6875 Err: fmt.Errorf("failed to decode response body, %w", err), 6876 Snapshot: snapshot.Bytes(), 6877 } 6878 return out, metadata, err 6879 } 6880 6881 err = awsRestjson1_deserializeOpDocumentListImportJobsOutput(&output, shape) 6882 if err != nil { 6883 var snapshot bytes.Buffer 6884 io.Copy(&snapshot, ringBuffer) 6885 return out, metadata, &smithy.DeserializationError{ 6886 Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), 6887 Snapshot: snapshot.Bytes(), 6888 } 6889 } 6890 6891 return out, metadata, err 6892} 6893 6894func awsRestjson1_deserializeOpErrorListImportJobs(response *smithyhttp.Response, metadata *middleware.Metadata) error { 6895 var errorBuffer bytes.Buffer 6896 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 6897 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 6898 } 6899 errorBody := bytes.NewReader(errorBuffer.Bytes()) 6900 6901 errorCode := "UnknownError" 6902 errorMessage := errorCode 6903 6904 code := response.Header.Get("X-Amzn-ErrorType") 6905 if len(code) != 0 { 6906 errorCode = restjson.SanitizeErrorCode(code) 6907 } 6908 6909 var buff [1024]byte 6910 ringBuffer := smithyio.NewRingBuffer(buff[:]) 6911 6912 body := io.TeeReader(errorBody, ringBuffer) 6913 decoder := json.NewDecoder(body) 6914 decoder.UseNumber() 6915 code, message, err := restjson.GetErrorInfo(decoder) 6916 if err != nil { 6917 var snapshot bytes.Buffer 6918 io.Copy(&snapshot, ringBuffer) 6919 err = &smithy.DeserializationError{ 6920 Err: fmt.Errorf("failed to decode response body, %w", err), 6921 Snapshot: snapshot.Bytes(), 6922 } 6923 return err 6924 } 6925 6926 errorBody.Seek(0, io.SeekStart) 6927 if len(code) != 0 { 6928 errorCode = restjson.SanitizeErrorCode(code) 6929 } 6930 if len(message) != 0 { 6931 errorMessage = message 6932 } 6933 6934 switch { 6935 case strings.EqualFold("BadRequestException", errorCode): 6936 return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) 6937 6938 case strings.EqualFold("TooManyRequestsException", errorCode): 6939 return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody) 6940 6941 default: 6942 genericError := &smithy.GenericAPIError{ 6943 Code: errorCode, 6944 Message: errorMessage, 6945 } 6946 return genericError 6947 6948 } 6949} 6950 6951func awsRestjson1_deserializeOpDocumentListImportJobsOutput(v **ListImportJobsOutput, value interface{}) error { 6952 if v == nil { 6953 return fmt.Errorf("unexpected nil of type %T", v) 6954 } 6955 if value == nil { 6956 return nil 6957 } 6958 6959 shape, ok := value.(map[string]interface{}) 6960 if !ok { 6961 return fmt.Errorf("unexpected JSON type %v", value) 6962 } 6963 6964 var sv *ListImportJobsOutput 6965 if *v == nil { 6966 sv = &ListImportJobsOutput{} 6967 } else { 6968 sv = *v 6969 } 6970 6971 for key, value := range shape { 6972 switch key { 6973 case "ImportJobs": 6974 if err := awsRestjson1_deserializeDocumentImportJobSummaryList(&sv.ImportJobs, value); err != nil { 6975 return err 6976 } 6977 6978 case "NextToken": 6979 if value != nil { 6980 jtv, ok := value.(string) 6981 if !ok { 6982 return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) 6983 } 6984 sv.NextToken = ptr.String(jtv) 6985 } 6986 6987 default: 6988 _, _ = key, value 6989 6990 } 6991 } 6992 *v = sv 6993 return nil 6994} 6995 6996type awsRestjson1_deserializeOpListSuppressedDestinations struct { 6997} 6998 6999func (*awsRestjson1_deserializeOpListSuppressedDestinations) ID() string { 7000 return "OperationDeserializer" 7001} 7002 7003func (m *awsRestjson1_deserializeOpListSuppressedDestinations) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 7004 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 7005) { 7006 out, metadata, err = next.HandleDeserialize(ctx, in) 7007 if err != nil { 7008 return out, metadata, err 7009 } 7010 7011 response, ok := out.RawResponse.(*smithyhttp.Response) 7012 if !ok { 7013 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 7014 } 7015 7016 if response.StatusCode < 200 || response.StatusCode >= 300 { 7017 return out, metadata, awsRestjson1_deserializeOpErrorListSuppressedDestinations(response, &metadata) 7018 } 7019 output := &ListSuppressedDestinationsOutput{} 7020 out.Result = output 7021 7022 var buff [1024]byte 7023 ringBuffer := smithyio.NewRingBuffer(buff[:]) 7024 7025 body := io.TeeReader(response.Body, ringBuffer) 7026 7027 decoder := json.NewDecoder(body) 7028 decoder.UseNumber() 7029 var shape interface{} 7030 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 7031 var snapshot bytes.Buffer 7032 io.Copy(&snapshot, ringBuffer) 7033 err = &smithy.DeserializationError{ 7034 Err: fmt.Errorf("failed to decode response body, %w", err), 7035 Snapshot: snapshot.Bytes(), 7036 } 7037 return out, metadata, err 7038 } 7039 7040 err = awsRestjson1_deserializeOpDocumentListSuppressedDestinationsOutput(&output, shape) 7041 if err != nil { 7042 var snapshot bytes.Buffer 7043 io.Copy(&snapshot, ringBuffer) 7044 return out, metadata, &smithy.DeserializationError{ 7045 Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), 7046 Snapshot: snapshot.Bytes(), 7047 } 7048 } 7049 7050 return out, metadata, err 7051} 7052 7053func awsRestjson1_deserializeOpErrorListSuppressedDestinations(response *smithyhttp.Response, metadata *middleware.Metadata) error { 7054 var errorBuffer bytes.Buffer 7055 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 7056 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 7057 } 7058 errorBody := bytes.NewReader(errorBuffer.Bytes()) 7059 7060 errorCode := "UnknownError" 7061 errorMessage := errorCode 7062 7063 code := response.Header.Get("X-Amzn-ErrorType") 7064 if len(code) != 0 { 7065 errorCode = restjson.SanitizeErrorCode(code) 7066 } 7067 7068 var buff [1024]byte 7069 ringBuffer := smithyio.NewRingBuffer(buff[:]) 7070 7071 body := io.TeeReader(errorBody, ringBuffer) 7072 decoder := json.NewDecoder(body) 7073 decoder.UseNumber() 7074 code, message, err := restjson.GetErrorInfo(decoder) 7075 if err != nil { 7076 var snapshot bytes.Buffer 7077 io.Copy(&snapshot, ringBuffer) 7078 err = &smithy.DeserializationError{ 7079 Err: fmt.Errorf("failed to decode response body, %w", err), 7080 Snapshot: snapshot.Bytes(), 7081 } 7082 return err 7083 } 7084 7085 errorBody.Seek(0, io.SeekStart) 7086 if len(code) != 0 { 7087 errorCode = restjson.SanitizeErrorCode(code) 7088 } 7089 if len(message) != 0 { 7090 errorMessage = message 7091 } 7092 7093 switch { 7094 case strings.EqualFold("BadRequestException", errorCode): 7095 return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) 7096 7097 case strings.EqualFold("InvalidNextTokenException", errorCode): 7098 return awsRestjson1_deserializeErrorInvalidNextTokenException(response, errorBody) 7099 7100 case strings.EqualFold("TooManyRequestsException", errorCode): 7101 return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody) 7102 7103 default: 7104 genericError := &smithy.GenericAPIError{ 7105 Code: errorCode, 7106 Message: errorMessage, 7107 } 7108 return genericError 7109 7110 } 7111} 7112 7113func awsRestjson1_deserializeOpDocumentListSuppressedDestinationsOutput(v **ListSuppressedDestinationsOutput, value interface{}) error { 7114 if v == nil { 7115 return fmt.Errorf("unexpected nil of type %T", v) 7116 } 7117 if value == nil { 7118 return nil 7119 } 7120 7121 shape, ok := value.(map[string]interface{}) 7122 if !ok { 7123 return fmt.Errorf("unexpected JSON type %v", value) 7124 } 7125 7126 var sv *ListSuppressedDestinationsOutput 7127 if *v == nil { 7128 sv = &ListSuppressedDestinationsOutput{} 7129 } else { 7130 sv = *v 7131 } 7132 7133 for key, value := range shape { 7134 switch key { 7135 case "NextToken": 7136 if value != nil { 7137 jtv, ok := value.(string) 7138 if !ok { 7139 return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) 7140 } 7141 sv.NextToken = ptr.String(jtv) 7142 } 7143 7144 case "SuppressedDestinationSummaries": 7145 if err := awsRestjson1_deserializeDocumentSuppressedDestinationSummaries(&sv.SuppressedDestinationSummaries, value); err != nil { 7146 return err 7147 } 7148 7149 default: 7150 _, _ = key, value 7151 7152 } 7153 } 7154 *v = sv 7155 return nil 7156} 7157 7158type awsRestjson1_deserializeOpListTagsForResource struct { 7159} 7160 7161func (*awsRestjson1_deserializeOpListTagsForResource) ID() string { 7162 return "OperationDeserializer" 7163} 7164 7165func (m *awsRestjson1_deserializeOpListTagsForResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 7166 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 7167) { 7168 out, metadata, err = next.HandleDeserialize(ctx, in) 7169 if err != nil { 7170 return out, metadata, err 7171 } 7172 7173 response, ok := out.RawResponse.(*smithyhttp.Response) 7174 if !ok { 7175 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 7176 } 7177 7178 if response.StatusCode < 200 || response.StatusCode >= 300 { 7179 return out, metadata, awsRestjson1_deserializeOpErrorListTagsForResource(response, &metadata) 7180 } 7181 output := &ListTagsForResourceOutput{} 7182 out.Result = output 7183 7184 var buff [1024]byte 7185 ringBuffer := smithyio.NewRingBuffer(buff[:]) 7186 7187 body := io.TeeReader(response.Body, ringBuffer) 7188 7189 decoder := json.NewDecoder(body) 7190 decoder.UseNumber() 7191 var shape interface{} 7192 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 7193 var snapshot bytes.Buffer 7194 io.Copy(&snapshot, ringBuffer) 7195 err = &smithy.DeserializationError{ 7196 Err: fmt.Errorf("failed to decode response body, %w", err), 7197 Snapshot: snapshot.Bytes(), 7198 } 7199 return out, metadata, err 7200 } 7201 7202 err = awsRestjson1_deserializeOpDocumentListTagsForResourceOutput(&output, shape) 7203 if err != nil { 7204 var snapshot bytes.Buffer 7205 io.Copy(&snapshot, ringBuffer) 7206 return out, metadata, &smithy.DeserializationError{ 7207 Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), 7208 Snapshot: snapshot.Bytes(), 7209 } 7210 } 7211 7212 return out, metadata, err 7213} 7214 7215func awsRestjson1_deserializeOpErrorListTagsForResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { 7216 var errorBuffer bytes.Buffer 7217 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 7218 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 7219 } 7220 errorBody := bytes.NewReader(errorBuffer.Bytes()) 7221 7222 errorCode := "UnknownError" 7223 errorMessage := errorCode 7224 7225 code := response.Header.Get("X-Amzn-ErrorType") 7226 if len(code) != 0 { 7227 errorCode = restjson.SanitizeErrorCode(code) 7228 } 7229 7230 var buff [1024]byte 7231 ringBuffer := smithyio.NewRingBuffer(buff[:]) 7232 7233 body := io.TeeReader(errorBody, ringBuffer) 7234 decoder := json.NewDecoder(body) 7235 decoder.UseNumber() 7236 code, message, err := restjson.GetErrorInfo(decoder) 7237 if err != nil { 7238 var snapshot bytes.Buffer 7239 io.Copy(&snapshot, ringBuffer) 7240 err = &smithy.DeserializationError{ 7241 Err: fmt.Errorf("failed to decode response body, %w", err), 7242 Snapshot: snapshot.Bytes(), 7243 } 7244 return err 7245 } 7246 7247 errorBody.Seek(0, io.SeekStart) 7248 if len(code) != 0 { 7249 errorCode = restjson.SanitizeErrorCode(code) 7250 } 7251 if len(message) != 0 { 7252 errorMessage = message 7253 } 7254 7255 switch { 7256 case strings.EqualFold("BadRequestException", errorCode): 7257 return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) 7258 7259 case strings.EqualFold("NotFoundException", errorCode): 7260 return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) 7261 7262 case strings.EqualFold("TooManyRequestsException", errorCode): 7263 return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody) 7264 7265 default: 7266 genericError := &smithy.GenericAPIError{ 7267 Code: errorCode, 7268 Message: errorMessage, 7269 } 7270 return genericError 7271 7272 } 7273} 7274 7275func awsRestjson1_deserializeOpDocumentListTagsForResourceOutput(v **ListTagsForResourceOutput, value interface{}) error { 7276 if v == nil { 7277 return fmt.Errorf("unexpected nil of type %T", v) 7278 } 7279 if value == nil { 7280 return nil 7281 } 7282 7283 shape, ok := value.(map[string]interface{}) 7284 if !ok { 7285 return fmt.Errorf("unexpected JSON type %v", value) 7286 } 7287 7288 var sv *ListTagsForResourceOutput 7289 if *v == nil { 7290 sv = &ListTagsForResourceOutput{} 7291 } else { 7292 sv = *v 7293 } 7294 7295 for key, value := range shape { 7296 switch key { 7297 case "Tags": 7298 if err := awsRestjson1_deserializeDocumentTagList(&sv.Tags, value); err != nil { 7299 return err 7300 } 7301 7302 default: 7303 _, _ = key, value 7304 7305 } 7306 } 7307 *v = sv 7308 return nil 7309} 7310 7311type awsRestjson1_deserializeOpPutAccountDedicatedIpWarmupAttributes struct { 7312} 7313 7314func (*awsRestjson1_deserializeOpPutAccountDedicatedIpWarmupAttributes) ID() string { 7315 return "OperationDeserializer" 7316} 7317 7318func (m *awsRestjson1_deserializeOpPutAccountDedicatedIpWarmupAttributes) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 7319 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 7320) { 7321 out, metadata, err = next.HandleDeserialize(ctx, in) 7322 if err != nil { 7323 return out, metadata, err 7324 } 7325 7326 response, ok := out.RawResponse.(*smithyhttp.Response) 7327 if !ok { 7328 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 7329 } 7330 7331 if response.StatusCode < 200 || response.StatusCode >= 300 { 7332 return out, metadata, awsRestjson1_deserializeOpErrorPutAccountDedicatedIpWarmupAttributes(response, &metadata) 7333 } 7334 output := &PutAccountDedicatedIpWarmupAttributesOutput{} 7335 out.Result = output 7336 7337 return out, metadata, err 7338} 7339 7340func awsRestjson1_deserializeOpErrorPutAccountDedicatedIpWarmupAttributes(response *smithyhttp.Response, metadata *middleware.Metadata) error { 7341 var errorBuffer bytes.Buffer 7342 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 7343 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 7344 } 7345 errorBody := bytes.NewReader(errorBuffer.Bytes()) 7346 7347 errorCode := "UnknownError" 7348 errorMessage := errorCode 7349 7350 code := response.Header.Get("X-Amzn-ErrorType") 7351 if len(code) != 0 { 7352 errorCode = restjson.SanitizeErrorCode(code) 7353 } 7354 7355 var buff [1024]byte 7356 ringBuffer := smithyio.NewRingBuffer(buff[:]) 7357 7358 body := io.TeeReader(errorBody, ringBuffer) 7359 decoder := json.NewDecoder(body) 7360 decoder.UseNumber() 7361 code, message, err := restjson.GetErrorInfo(decoder) 7362 if err != nil { 7363 var snapshot bytes.Buffer 7364 io.Copy(&snapshot, ringBuffer) 7365 err = &smithy.DeserializationError{ 7366 Err: fmt.Errorf("failed to decode response body, %w", err), 7367 Snapshot: snapshot.Bytes(), 7368 } 7369 return err 7370 } 7371 7372 errorBody.Seek(0, io.SeekStart) 7373 if len(code) != 0 { 7374 errorCode = restjson.SanitizeErrorCode(code) 7375 } 7376 if len(message) != 0 { 7377 errorMessage = message 7378 } 7379 7380 switch { 7381 case strings.EqualFold("BadRequestException", errorCode): 7382 return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) 7383 7384 case strings.EqualFold("TooManyRequestsException", errorCode): 7385 return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody) 7386 7387 default: 7388 genericError := &smithy.GenericAPIError{ 7389 Code: errorCode, 7390 Message: errorMessage, 7391 } 7392 return genericError 7393 7394 } 7395} 7396 7397type awsRestjson1_deserializeOpPutAccountDetails struct { 7398} 7399 7400func (*awsRestjson1_deserializeOpPutAccountDetails) ID() string { 7401 return "OperationDeserializer" 7402} 7403 7404func (m *awsRestjson1_deserializeOpPutAccountDetails) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 7405 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 7406) { 7407 out, metadata, err = next.HandleDeserialize(ctx, in) 7408 if err != nil { 7409 return out, metadata, err 7410 } 7411 7412 response, ok := out.RawResponse.(*smithyhttp.Response) 7413 if !ok { 7414 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 7415 } 7416 7417 if response.StatusCode < 200 || response.StatusCode >= 300 { 7418 return out, metadata, awsRestjson1_deserializeOpErrorPutAccountDetails(response, &metadata) 7419 } 7420 output := &PutAccountDetailsOutput{} 7421 out.Result = output 7422 7423 return out, metadata, err 7424} 7425 7426func awsRestjson1_deserializeOpErrorPutAccountDetails(response *smithyhttp.Response, metadata *middleware.Metadata) error { 7427 var errorBuffer bytes.Buffer 7428 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 7429 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 7430 } 7431 errorBody := bytes.NewReader(errorBuffer.Bytes()) 7432 7433 errorCode := "UnknownError" 7434 errorMessage := errorCode 7435 7436 code := response.Header.Get("X-Amzn-ErrorType") 7437 if len(code) != 0 { 7438 errorCode = restjson.SanitizeErrorCode(code) 7439 } 7440 7441 var buff [1024]byte 7442 ringBuffer := smithyio.NewRingBuffer(buff[:]) 7443 7444 body := io.TeeReader(errorBody, ringBuffer) 7445 decoder := json.NewDecoder(body) 7446 decoder.UseNumber() 7447 code, message, err := restjson.GetErrorInfo(decoder) 7448 if err != nil { 7449 var snapshot bytes.Buffer 7450 io.Copy(&snapshot, ringBuffer) 7451 err = &smithy.DeserializationError{ 7452 Err: fmt.Errorf("failed to decode response body, %w", err), 7453 Snapshot: snapshot.Bytes(), 7454 } 7455 return err 7456 } 7457 7458 errorBody.Seek(0, io.SeekStart) 7459 if len(code) != 0 { 7460 errorCode = restjson.SanitizeErrorCode(code) 7461 } 7462 if len(message) != 0 { 7463 errorMessage = message 7464 } 7465 7466 switch { 7467 case strings.EqualFold("BadRequestException", errorCode): 7468 return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) 7469 7470 case strings.EqualFold("ConflictException", errorCode): 7471 return awsRestjson1_deserializeErrorConflictException(response, errorBody) 7472 7473 case strings.EqualFold("TooManyRequestsException", errorCode): 7474 return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody) 7475 7476 default: 7477 genericError := &smithy.GenericAPIError{ 7478 Code: errorCode, 7479 Message: errorMessage, 7480 } 7481 return genericError 7482 7483 } 7484} 7485 7486type awsRestjson1_deserializeOpPutAccountSendingAttributes struct { 7487} 7488 7489func (*awsRestjson1_deserializeOpPutAccountSendingAttributes) ID() string { 7490 return "OperationDeserializer" 7491} 7492 7493func (m *awsRestjson1_deserializeOpPutAccountSendingAttributes) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 7494 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 7495) { 7496 out, metadata, err = next.HandleDeserialize(ctx, in) 7497 if err != nil { 7498 return out, metadata, err 7499 } 7500 7501 response, ok := out.RawResponse.(*smithyhttp.Response) 7502 if !ok { 7503 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 7504 } 7505 7506 if response.StatusCode < 200 || response.StatusCode >= 300 { 7507 return out, metadata, awsRestjson1_deserializeOpErrorPutAccountSendingAttributes(response, &metadata) 7508 } 7509 output := &PutAccountSendingAttributesOutput{} 7510 out.Result = output 7511 7512 return out, metadata, err 7513} 7514 7515func awsRestjson1_deserializeOpErrorPutAccountSendingAttributes(response *smithyhttp.Response, metadata *middleware.Metadata) error { 7516 var errorBuffer bytes.Buffer 7517 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 7518 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 7519 } 7520 errorBody := bytes.NewReader(errorBuffer.Bytes()) 7521 7522 errorCode := "UnknownError" 7523 errorMessage := errorCode 7524 7525 code := response.Header.Get("X-Amzn-ErrorType") 7526 if len(code) != 0 { 7527 errorCode = restjson.SanitizeErrorCode(code) 7528 } 7529 7530 var buff [1024]byte 7531 ringBuffer := smithyio.NewRingBuffer(buff[:]) 7532 7533 body := io.TeeReader(errorBody, ringBuffer) 7534 decoder := json.NewDecoder(body) 7535 decoder.UseNumber() 7536 code, message, err := restjson.GetErrorInfo(decoder) 7537 if err != nil { 7538 var snapshot bytes.Buffer 7539 io.Copy(&snapshot, ringBuffer) 7540 err = &smithy.DeserializationError{ 7541 Err: fmt.Errorf("failed to decode response body, %w", err), 7542 Snapshot: snapshot.Bytes(), 7543 } 7544 return err 7545 } 7546 7547 errorBody.Seek(0, io.SeekStart) 7548 if len(code) != 0 { 7549 errorCode = restjson.SanitizeErrorCode(code) 7550 } 7551 if len(message) != 0 { 7552 errorMessage = message 7553 } 7554 7555 switch { 7556 case strings.EqualFold("BadRequestException", errorCode): 7557 return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) 7558 7559 case strings.EqualFold("TooManyRequestsException", errorCode): 7560 return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody) 7561 7562 default: 7563 genericError := &smithy.GenericAPIError{ 7564 Code: errorCode, 7565 Message: errorMessage, 7566 } 7567 return genericError 7568 7569 } 7570} 7571 7572type awsRestjson1_deserializeOpPutAccountSuppressionAttributes struct { 7573} 7574 7575func (*awsRestjson1_deserializeOpPutAccountSuppressionAttributes) ID() string { 7576 return "OperationDeserializer" 7577} 7578 7579func (m *awsRestjson1_deserializeOpPutAccountSuppressionAttributes) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 7580 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 7581) { 7582 out, metadata, err = next.HandleDeserialize(ctx, in) 7583 if err != nil { 7584 return out, metadata, err 7585 } 7586 7587 response, ok := out.RawResponse.(*smithyhttp.Response) 7588 if !ok { 7589 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 7590 } 7591 7592 if response.StatusCode < 200 || response.StatusCode >= 300 { 7593 return out, metadata, awsRestjson1_deserializeOpErrorPutAccountSuppressionAttributes(response, &metadata) 7594 } 7595 output := &PutAccountSuppressionAttributesOutput{} 7596 out.Result = output 7597 7598 return out, metadata, err 7599} 7600 7601func awsRestjson1_deserializeOpErrorPutAccountSuppressionAttributes(response *smithyhttp.Response, metadata *middleware.Metadata) error { 7602 var errorBuffer bytes.Buffer 7603 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 7604 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 7605 } 7606 errorBody := bytes.NewReader(errorBuffer.Bytes()) 7607 7608 errorCode := "UnknownError" 7609 errorMessage := errorCode 7610 7611 code := response.Header.Get("X-Amzn-ErrorType") 7612 if len(code) != 0 { 7613 errorCode = restjson.SanitizeErrorCode(code) 7614 } 7615 7616 var buff [1024]byte 7617 ringBuffer := smithyio.NewRingBuffer(buff[:]) 7618 7619 body := io.TeeReader(errorBody, ringBuffer) 7620 decoder := json.NewDecoder(body) 7621 decoder.UseNumber() 7622 code, message, err := restjson.GetErrorInfo(decoder) 7623 if err != nil { 7624 var snapshot bytes.Buffer 7625 io.Copy(&snapshot, ringBuffer) 7626 err = &smithy.DeserializationError{ 7627 Err: fmt.Errorf("failed to decode response body, %w", err), 7628 Snapshot: snapshot.Bytes(), 7629 } 7630 return err 7631 } 7632 7633 errorBody.Seek(0, io.SeekStart) 7634 if len(code) != 0 { 7635 errorCode = restjson.SanitizeErrorCode(code) 7636 } 7637 if len(message) != 0 { 7638 errorMessage = message 7639 } 7640 7641 switch { 7642 case strings.EqualFold("BadRequestException", errorCode): 7643 return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) 7644 7645 case strings.EqualFold("TooManyRequestsException", errorCode): 7646 return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody) 7647 7648 default: 7649 genericError := &smithy.GenericAPIError{ 7650 Code: errorCode, 7651 Message: errorMessage, 7652 } 7653 return genericError 7654 7655 } 7656} 7657 7658type awsRestjson1_deserializeOpPutConfigurationSetDeliveryOptions struct { 7659} 7660 7661func (*awsRestjson1_deserializeOpPutConfigurationSetDeliveryOptions) ID() string { 7662 return "OperationDeserializer" 7663} 7664 7665func (m *awsRestjson1_deserializeOpPutConfigurationSetDeliveryOptions) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 7666 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 7667) { 7668 out, metadata, err = next.HandleDeserialize(ctx, in) 7669 if err != nil { 7670 return out, metadata, err 7671 } 7672 7673 response, ok := out.RawResponse.(*smithyhttp.Response) 7674 if !ok { 7675 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 7676 } 7677 7678 if response.StatusCode < 200 || response.StatusCode >= 300 { 7679 return out, metadata, awsRestjson1_deserializeOpErrorPutConfigurationSetDeliveryOptions(response, &metadata) 7680 } 7681 output := &PutConfigurationSetDeliveryOptionsOutput{} 7682 out.Result = output 7683 7684 return out, metadata, err 7685} 7686 7687func awsRestjson1_deserializeOpErrorPutConfigurationSetDeliveryOptions(response *smithyhttp.Response, metadata *middleware.Metadata) error { 7688 var errorBuffer bytes.Buffer 7689 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 7690 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 7691 } 7692 errorBody := bytes.NewReader(errorBuffer.Bytes()) 7693 7694 errorCode := "UnknownError" 7695 errorMessage := errorCode 7696 7697 code := response.Header.Get("X-Amzn-ErrorType") 7698 if len(code) != 0 { 7699 errorCode = restjson.SanitizeErrorCode(code) 7700 } 7701 7702 var buff [1024]byte 7703 ringBuffer := smithyio.NewRingBuffer(buff[:]) 7704 7705 body := io.TeeReader(errorBody, ringBuffer) 7706 decoder := json.NewDecoder(body) 7707 decoder.UseNumber() 7708 code, message, err := restjson.GetErrorInfo(decoder) 7709 if err != nil { 7710 var snapshot bytes.Buffer 7711 io.Copy(&snapshot, ringBuffer) 7712 err = &smithy.DeserializationError{ 7713 Err: fmt.Errorf("failed to decode response body, %w", err), 7714 Snapshot: snapshot.Bytes(), 7715 } 7716 return err 7717 } 7718 7719 errorBody.Seek(0, io.SeekStart) 7720 if len(code) != 0 { 7721 errorCode = restjson.SanitizeErrorCode(code) 7722 } 7723 if len(message) != 0 { 7724 errorMessage = message 7725 } 7726 7727 switch { 7728 case strings.EqualFold("BadRequestException", errorCode): 7729 return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) 7730 7731 case strings.EqualFold("NotFoundException", errorCode): 7732 return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) 7733 7734 case strings.EqualFold("TooManyRequestsException", errorCode): 7735 return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody) 7736 7737 default: 7738 genericError := &smithy.GenericAPIError{ 7739 Code: errorCode, 7740 Message: errorMessage, 7741 } 7742 return genericError 7743 7744 } 7745} 7746 7747type awsRestjson1_deserializeOpPutConfigurationSetReputationOptions struct { 7748} 7749 7750func (*awsRestjson1_deserializeOpPutConfigurationSetReputationOptions) ID() string { 7751 return "OperationDeserializer" 7752} 7753 7754func (m *awsRestjson1_deserializeOpPutConfigurationSetReputationOptions) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 7755 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 7756) { 7757 out, metadata, err = next.HandleDeserialize(ctx, in) 7758 if err != nil { 7759 return out, metadata, err 7760 } 7761 7762 response, ok := out.RawResponse.(*smithyhttp.Response) 7763 if !ok { 7764 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 7765 } 7766 7767 if response.StatusCode < 200 || response.StatusCode >= 300 { 7768 return out, metadata, awsRestjson1_deserializeOpErrorPutConfigurationSetReputationOptions(response, &metadata) 7769 } 7770 output := &PutConfigurationSetReputationOptionsOutput{} 7771 out.Result = output 7772 7773 return out, metadata, err 7774} 7775 7776func awsRestjson1_deserializeOpErrorPutConfigurationSetReputationOptions(response *smithyhttp.Response, metadata *middleware.Metadata) error { 7777 var errorBuffer bytes.Buffer 7778 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 7779 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 7780 } 7781 errorBody := bytes.NewReader(errorBuffer.Bytes()) 7782 7783 errorCode := "UnknownError" 7784 errorMessage := errorCode 7785 7786 code := response.Header.Get("X-Amzn-ErrorType") 7787 if len(code) != 0 { 7788 errorCode = restjson.SanitizeErrorCode(code) 7789 } 7790 7791 var buff [1024]byte 7792 ringBuffer := smithyio.NewRingBuffer(buff[:]) 7793 7794 body := io.TeeReader(errorBody, ringBuffer) 7795 decoder := json.NewDecoder(body) 7796 decoder.UseNumber() 7797 code, message, err := restjson.GetErrorInfo(decoder) 7798 if err != nil { 7799 var snapshot bytes.Buffer 7800 io.Copy(&snapshot, ringBuffer) 7801 err = &smithy.DeserializationError{ 7802 Err: fmt.Errorf("failed to decode response body, %w", err), 7803 Snapshot: snapshot.Bytes(), 7804 } 7805 return err 7806 } 7807 7808 errorBody.Seek(0, io.SeekStart) 7809 if len(code) != 0 { 7810 errorCode = restjson.SanitizeErrorCode(code) 7811 } 7812 if len(message) != 0 { 7813 errorMessage = message 7814 } 7815 7816 switch { 7817 case strings.EqualFold("BadRequestException", errorCode): 7818 return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) 7819 7820 case strings.EqualFold("NotFoundException", errorCode): 7821 return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) 7822 7823 case strings.EqualFold("TooManyRequestsException", errorCode): 7824 return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody) 7825 7826 default: 7827 genericError := &smithy.GenericAPIError{ 7828 Code: errorCode, 7829 Message: errorMessage, 7830 } 7831 return genericError 7832 7833 } 7834} 7835 7836type awsRestjson1_deserializeOpPutConfigurationSetSendingOptions struct { 7837} 7838 7839func (*awsRestjson1_deserializeOpPutConfigurationSetSendingOptions) ID() string { 7840 return "OperationDeserializer" 7841} 7842 7843func (m *awsRestjson1_deserializeOpPutConfigurationSetSendingOptions) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 7844 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 7845) { 7846 out, metadata, err = next.HandleDeserialize(ctx, in) 7847 if err != nil { 7848 return out, metadata, err 7849 } 7850 7851 response, ok := out.RawResponse.(*smithyhttp.Response) 7852 if !ok { 7853 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 7854 } 7855 7856 if response.StatusCode < 200 || response.StatusCode >= 300 { 7857 return out, metadata, awsRestjson1_deserializeOpErrorPutConfigurationSetSendingOptions(response, &metadata) 7858 } 7859 output := &PutConfigurationSetSendingOptionsOutput{} 7860 out.Result = output 7861 7862 return out, metadata, err 7863} 7864 7865func awsRestjson1_deserializeOpErrorPutConfigurationSetSendingOptions(response *smithyhttp.Response, metadata *middleware.Metadata) error { 7866 var errorBuffer bytes.Buffer 7867 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 7868 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 7869 } 7870 errorBody := bytes.NewReader(errorBuffer.Bytes()) 7871 7872 errorCode := "UnknownError" 7873 errorMessage := errorCode 7874 7875 code := response.Header.Get("X-Amzn-ErrorType") 7876 if len(code) != 0 { 7877 errorCode = restjson.SanitizeErrorCode(code) 7878 } 7879 7880 var buff [1024]byte 7881 ringBuffer := smithyio.NewRingBuffer(buff[:]) 7882 7883 body := io.TeeReader(errorBody, ringBuffer) 7884 decoder := json.NewDecoder(body) 7885 decoder.UseNumber() 7886 code, message, err := restjson.GetErrorInfo(decoder) 7887 if err != nil { 7888 var snapshot bytes.Buffer 7889 io.Copy(&snapshot, ringBuffer) 7890 err = &smithy.DeserializationError{ 7891 Err: fmt.Errorf("failed to decode response body, %w", err), 7892 Snapshot: snapshot.Bytes(), 7893 } 7894 return err 7895 } 7896 7897 errorBody.Seek(0, io.SeekStart) 7898 if len(code) != 0 { 7899 errorCode = restjson.SanitizeErrorCode(code) 7900 } 7901 if len(message) != 0 { 7902 errorMessage = message 7903 } 7904 7905 switch { 7906 case strings.EqualFold("BadRequestException", errorCode): 7907 return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) 7908 7909 case strings.EqualFold("NotFoundException", errorCode): 7910 return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) 7911 7912 case strings.EqualFold("TooManyRequestsException", errorCode): 7913 return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody) 7914 7915 default: 7916 genericError := &smithy.GenericAPIError{ 7917 Code: errorCode, 7918 Message: errorMessage, 7919 } 7920 return genericError 7921 7922 } 7923} 7924 7925type awsRestjson1_deserializeOpPutConfigurationSetSuppressionOptions struct { 7926} 7927 7928func (*awsRestjson1_deserializeOpPutConfigurationSetSuppressionOptions) ID() string { 7929 return "OperationDeserializer" 7930} 7931 7932func (m *awsRestjson1_deserializeOpPutConfigurationSetSuppressionOptions) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 7933 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 7934) { 7935 out, metadata, err = next.HandleDeserialize(ctx, in) 7936 if err != nil { 7937 return out, metadata, err 7938 } 7939 7940 response, ok := out.RawResponse.(*smithyhttp.Response) 7941 if !ok { 7942 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 7943 } 7944 7945 if response.StatusCode < 200 || response.StatusCode >= 300 { 7946 return out, metadata, awsRestjson1_deserializeOpErrorPutConfigurationSetSuppressionOptions(response, &metadata) 7947 } 7948 output := &PutConfigurationSetSuppressionOptionsOutput{} 7949 out.Result = output 7950 7951 return out, metadata, err 7952} 7953 7954func awsRestjson1_deserializeOpErrorPutConfigurationSetSuppressionOptions(response *smithyhttp.Response, metadata *middleware.Metadata) error { 7955 var errorBuffer bytes.Buffer 7956 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 7957 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 7958 } 7959 errorBody := bytes.NewReader(errorBuffer.Bytes()) 7960 7961 errorCode := "UnknownError" 7962 errorMessage := errorCode 7963 7964 code := response.Header.Get("X-Amzn-ErrorType") 7965 if len(code) != 0 { 7966 errorCode = restjson.SanitizeErrorCode(code) 7967 } 7968 7969 var buff [1024]byte 7970 ringBuffer := smithyio.NewRingBuffer(buff[:]) 7971 7972 body := io.TeeReader(errorBody, ringBuffer) 7973 decoder := json.NewDecoder(body) 7974 decoder.UseNumber() 7975 code, message, err := restjson.GetErrorInfo(decoder) 7976 if err != nil { 7977 var snapshot bytes.Buffer 7978 io.Copy(&snapshot, ringBuffer) 7979 err = &smithy.DeserializationError{ 7980 Err: fmt.Errorf("failed to decode response body, %w", err), 7981 Snapshot: snapshot.Bytes(), 7982 } 7983 return err 7984 } 7985 7986 errorBody.Seek(0, io.SeekStart) 7987 if len(code) != 0 { 7988 errorCode = restjson.SanitizeErrorCode(code) 7989 } 7990 if len(message) != 0 { 7991 errorMessage = message 7992 } 7993 7994 switch { 7995 case strings.EqualFold("BadRequestException", errorCode): 7996 return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) 7997 7998 case strings.EqualFold("NotFoundException", errorCode): 7999 return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) 8000 8001 case strings.EqualFold("TooManyRequestsException", errorCode): 8002 return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody) 8003 8004 default: 8005 genericError := &smithy.GenericAPIError{ 8006 Code: errorCode, 8007 Message: errorMessage, 8008 } 8009 return genericError 8010 8011 } 8012} 8013 8014type awsRestjson1_deserializeOpPutConfigurationSetTrackingOptions struct { 8015} 8016 8017func (*awsRestjson1_deserializeOpPutConfigurationSetTrackingOptions) ID() string { 8018 return "OperationDeserializer" 8019} 8020 8021func (m *awsRestjson1_deserializeOpPutConfigurationSetTrackingOptions) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 8022 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 8023) { 8024 out, metadata, err = next.HandleDeserialize(ctx, in) 8025 if err != nil { 8026 return out, metadata, err 8027 } 8028 8029 response, ok := out.RawResponse.(*smithyhttp.Response) 8030 if !ok { 8031 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 8032 } 8033 8034 if response.StatusCode < 200 || response.StatusCode >= 300 { 8035 return out, metadata, awsRestjson1_deserializeOpErrorPutConfigurationSetTrackingOptions(response, &metadata) 8036 } 8037 output := &PutConfigurationSetTrackingOptionsOutput{} 8038 out.Result = output 8039 8040 return out, metadata, err 8041} 8042 8043func awsRestjson1_deserializeOpErrorPutConfigurationSetTrackingOptions(response *smithyhttp.Response, metadata *middleware.Metadata) error { 8044 var errorBuffer bytes.Buffer 8045 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 8046 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 8047 } 8048 errorBody := bytes.NewReader(errorBuffer.Bytes()) 8049 8050 errorCode := "UnknownError" 8051 errorMessage := errorCode 8052 8053 code := response.Header.Get("X-Amzn-ErrorType") 8054 if len(code) != 0 { 8055 errorCode = restjson.SanitizeErrorCode(code) 8056 } 8057 8058 var buff [1024]byte 8059 ringBuffer := smithyio.NewRingBuffer(buff[:]) 8060 8061 body := io.TeeReader(errorBody, ringBuffer) 8062 decoder := json.NewDecoder(body) 8063 decoder.UseNumber() 8064 code, message, err := restjson.GetErrorInfo(decoder) 8065 if err != nil { 8066 var snapshot bytes.Buffer 8067 io.Copy(&snapshot, ringBuffer) 8068 err = &smithy.DeserializationError{ 8069 Err: fmt.Errorf("failed to decode response body, %w", err), 8070 Snapshot: snapshot.Bytes(), 8071 } 8072 return err 8073 } 8074 8075 errorBody.Seek(0, io.SeekStart) 8076 if len(code) != 0 { 8077 errorCode = restjson.SanitizeErrorCode(code) 8078 } 8079 if len(message) != 0 { 8080 errorMessage = message 8081 } 8082 8083 switch { 8084 case strings.EqualFold("BadRequestException", errorCode): 8085 return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) 8086 8087 case strings.EqualFold("NotFoundException", errorCode): 8088 return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) 8089 8090 case strings.EqualFold("TooManyRequestsException", errorCode): 8091 return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody) 8092 8093 default: 8094 genericError := &smithy.GenericAPIError{ 8095 Code: errorCode, 8096 Message: errorMessage, 8097 } 8098 return genericError 8099 8100 } 8101} 8102 8103type awsRestjson1_deserializeOpPutDedicatedIpInPool struct { 8104} 8105 8106func (*awsRestjson1_deserializeOpPutDedicatedIpInPool) ID() string { 8107 return "OperationDeserializer" 8108} 8109 8110func (m *awsRestjson1_deserializeOpPutDedicatedIpInPool) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 8111 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 8112) { 8113 out, metadata, err = next.HandleDeserialize(ctx, in) 8114 if err != nil { 8115 return out, metadata, err 8116 } 8117 8118 response, ok := out.RawResponse.(*smithyhttp.Response) 8119 if !ok { 8120 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 8121 } 8122 8123 if response.StatusCode < 200 || response.StatusCode >= 300 { 8124 return out, metadata, awsRestjson1_deserializeOpErrorPutDedicatedIpInPool(response, &metadata) 8125 } 8126 output := &PutDedicatedIpInPoolOutput{} 8127 out.Result = output 8128 8129 return out, metadata, err 8130} 8131 8132func awsRestjson1_deserializeOpErrorPutDedicatedIpInPool(response *smithyhttp.Response, metadata *middleware.Metadata) error { 8133 var errorBuffer bytes.Buffer 8134 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 8135 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 8136 } 8137 errorBody := bytes.NewReader(errorBuffer.Bytes()) 8138 8139 errorCode := "UnknownError" 8140 errorMessage := errorCode 8141 8142 code := response.Header.Get("X-Amzn-ErrorType") 8143 if len(code) != 0 { 8144 errorCode = restjson.SanitizeErrorCode(code) 8145 } 8146 8147 var buff [1024]byte 8148 ringBuffer := smithyio.NewRingBuffer(buff[:]) 8149 8150 body := io.TeeReader(errorBody, ringBuffer) 8151 decoder := json.NewDecoder(body) 8152 decoder.UseNumber() 8153 code, message, err := restjson.GetErrorInfo(decoder) 8154 if err != nil { 8155 var snapshot bytes.Buffer 8156 io.Copy(&snapshot, ringBuffer) 8157 err = &smithy.DeserializationError{ 8158 Err: fmt.Errorf("failed to decode response body, %w", err), 8159 Snapshot: snapshot.Bytes(), 8160 } 8161 return err 8162 } 8163 8164 errorBody.Seek(0, io.SeekStart) 8165 if len(code) != 0 { 8166 errorCode = restjson.SanitizeErrorCode(code) 8167 } 8168 if len(message) != 0 { 8169 errorMessage = message 8170 } 8171 8172 switch { 8173 case strings.EqualFold("BadRequestException", errorCode): 8174 return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) 8175 8176 case strings.EqualFold("NotFoundException", errorCode): 8177 return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) 8178 8179 case strings.EqualFold("TooManyRequestsException", errorCode): 8180 return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody) 8181 8182 default: 8183 genericError := &smithy.GenericAPIError{ 8184 Code: errorCode, 8185 Message: errorMessage, 8186 } 8187 return genericError 8188 8189 } 8190} 8191 8192type awsRestjson1_deserializeOpPutDedicatedIpWarmupAttributes struct { 8193} 8194 8195func (*awsRestjson1_deserializeOpPutDedicatedIpWarmupAttributes) ID() string { 8196 return "OperationDeserializer" 8197} 8198 8199func (m *awsRestjson1_deserializeOpPutDedicatedIpWarmupAttributes) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 8200 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 8201) { 8202 out, metadata, err = next.HandleDeserialize(ctx, in) 8203 if err != nil { 8204 return out, metadata, err 8205 } 8206 8207 response, ok := out.RawResponse.(*smithyhttp.Response) 8208 if !ok { 8209 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 8210 } 8211 8212 if response.StatusCode < 200 || response.StatusCode >= 300 { 8213 return out, metadata, awsRestjson1_deserializeOpErrorPutDedicatedIpWarmupAttributes(response, &metadata) 8214 } 8215 output := &PutDedicatedIpWarmupAttributesOutput{} 8216 out.Result = output 8217 8218 return out, metadata, err 8219} 8220 8221func awsRestjson1_deserializeOpErrorPutDedicatedIpWarmupAttributes(response *smithyhttp.Response, metadata *middleware.Metadata) error { 8222 var errorBuffer bytes.Buffer 8223 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 8224 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 8225 } 8226 errorBody := bytes.NewReader(errorBuffer.Bytes()) 8227 8228 errorCode := "UnknownError" 8229 errorMessage := errorCode 8230 8231 code := response.Header.Get("X-Amzn-ErrorType") 8232 if len(code) != 0 { 8233 errorCode = restjson.SanitizeErrorCode(code) 8234 } 8235 8236 var buff [1024]byte 8237 ringBuffer := smithyio.NewRingBuffer(buff[:]) 8238 8239 body := io.TeeReader(errorBody, ringBuffer) 8240 decoder := json.NewDecoder(body) 8241 decoder.UseNumber() 8242 code, message, err := restjson.GetErrorInfo(decoder) 8243 if err != nil { 8244 var snapshot bytes.Buffer 8245 io.Copy(&snapshot, ringBuffer) 8246 err = &smithy.DeserializationError{ 8247 Err: fmt.Errorf("failed to decode response body, %w", err), 8248 Snapshot: snapshot.Bytes(), 8249 } 8250 return err 8251 } 8252 8253 errorBody.Seek(0, io.SeekStart) 8254 if len(code) != 0 { 8255 errorCode = restjson.SanitizeErrorCode(code) 8256 } 8257 if len(message) != 0 { 8258 errorMessage = message 8259 } 8260 8261 switch { 8262 case strings.EqualFold("BadRequestException", errorCode): 8263 return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) 8264 8265 case strings.EqualFold("NotFoundException", errorCode): 8266 return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) 8267 8268 case strings.EqualFold("TooManyRequestsException", errorCode): 8269 return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody) 8270 8271 default: 8272 genericError := &smithy.GenericAPIError{ 8273 Code: errorCode, 8274 Message: errorMessage, 8275 } 8276 return genericError 8277 8278 } 8279} 8280 8281type awsRestjson1_deserializeOpPutDeliverabilityDashboardOption struct { 8282} 8283 8284func (*awsRestjson1_deserializeOpPutDeliverabilityDashboardOption) ID() string { 8285 return "OperationDeserializer" 8286} 8287 8288func (m *awsRestjson1_deserializeOpPutDeliverabilityDashboardOption) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 8289 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 8290) { 8291 out, metadata, err = next.HandleDeserialize(ctx, in) 8292 if err != nil { 8293 return out, metadata, err 8294 } 8295 8296 response, ok := out.RawResponse.(*smithyhttp.Response) 8297 if !ok { 8298 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 8299 } 8300 8301 if response.StatusCode < 200 || response.StatusCode >= 300 { 8302 return out, metadata, awsRestjson1_deserializeOpErrorPutDeliverabilityDashboardOption(response, &metadata) 8303 } 8304 output := &PutDeliverabilityDashboardOptionOutput{} 8305 out.Result = output 8306 8307 return out, metadata, err 8308} 8309 8310func awsRestjson1_deserializeOpErrorPutDeliverabilityDashboardOption(response *smithyhttp.Response, metadata *middleware.Metadata) error { 8311 var errorBuffer bytes.Buffer 8312 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 8313 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 8314 } 8315 errorBody := bytes.NewReader(errorBuffer.Bytes()) 8316 8317 errorCode := "UnknownError" 8318 errorMessage := errorCode 8319 8320 code := response.Header.Get("X-Amzn-ErrorType") 8321 if len(code) != 0 { 8322 errorCode = restjson.SanitizeErrorCode(code) 8323 } 8324 8325 var buff [1024]byte 8326 ringBuffer := smithyio.NewRingBuffer(buff[:]) 8327 8328 body := io.TeeReader(errorBody, ringBuffer) 8329 decoder := json.NewDecoder(body) 8330 decoder.UseNumber() 8331 code, message, err := restjson.GetErrorInfo(decoder) 8332 if err != nil { 8333 var snapshot bytes.Buffer 8334 io.Copy(&snapshot, ringBuffer) 8335 err = &smithy.DeserializationError{ 8336 Err: fmt.Errorf("failed to decode response body, %w", err), 8337 Snapshot: snapshot.Bytes(), 8338 } 8339 return err 8340 } 8341 8342 errorBody.Seek(0, io.SeekStart) 8343 if len(code) != 0 { 8344 errorCode = restjson.SanitizeErrorCode(code) 8345 } 8346 if len(message) != 0 { 8347 errorMessage = message 8348 } 8349 8350 switch { 8351 case strings.EqualFold("AlreadyExistsException", errorCode): 8352 return awsRestjson1_deserializeErrorAlreadyExistsException(response, errorBody) 8353 8354 case strings.EqualFold("BadRequestException", errorCode): 8355 return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) 8356 8357 case strings.EqualFold("LimitExceededException", errorCode): 8358 return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) 8359 8360 case strings.EqualFold("NotFoundException", errorCode): 8361 return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) 8362 8363 case strings.EqualFold("TooManyRequestsException", errorCode): 8364 return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody) 8365 8366 default: 8367 genericError := &smithy.GenericAPIError{ 8368 Code: errorCode, 8369 Message: errorMessage, 8370 } 8371 return genericError 8372 8373 } 8374} 8375 8376type awsRestjson1_deserializeOpPutEmailIdentityDkimAttributes struct { 8377} 8378 8379func (*awsRestjson1_deserializeOpPutEmailIdentityDkimAttributes) ID() string { 8380 return "OperationDeserializer" 8381} 8382 8383func (m *awsRestjson1_deserializeOpPutEmailIdentityDkimAttributes) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 8384 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 8385) { 8386 out, metadata, err = next.HandleDeserialize(ctx, in) 8387 if err != nil { 8388 return out, metadata, err 8389 } 8390 8391 response, ok := out.RawResponse.(*smithyhttp.Response) 8392 if !ok { 8393 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 8394 } 8395 8396 if response.StatusCode < 200 || response.StatusCode >= 300 { 8397 return out, metadata, awsRestjson1_deserializeOpErrorPutEmailIdentityDkimAttributes(response, &metadata) 8398 } 8399 output := &PutEmailIdentityDkimAttributesOutput{} 8400 out.Result = output 8401 8402 return out, metadata, err 8403} 8404 8405func awsRestjson1_deserializeOpErrorPutEmailIdentityDkimAttributes(response *smithyhttp.Response, metadata *middleware.Metadata) error { 8406 var errorBuffer bytes.Buffer 8407 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 8408 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 8409 } 8410 errorBody := bytes.NewReader(errorBuffer.Bytes()) 8411 8412 errorCode := "UnknownError" 8413 errorMessage := errorCode 8414 8415 code := response.Header.Get("X-Amzn-ErrorType") 8416 if len(code) != 0 { 8417 errorCode = restjson.SanitizeErrorCode(code) 8418 } 8419 8420 var buff [1024]byte 8421 ringBuffer := smithyio.NewRingBuffer(buff[:]) 8422 8423 body := io.TeeReader(errorBody, ringBuffer) 8424 decoder := json.NewDecoder(body) 8425 decoder.UseNumber() 8426 code, message, err := restjson.GetErrorInfo(decoder) 8427 if err != nil { 8428 var snapshot bytes.Buffer 8429 io.Copy(&snapshot, ringBuffer) 8430 err = &smithy.DeserializationError{ 8431 Err: fmt.Errorf("failed to decode response body, %w", err), 8432 Snapshot: snapshot.Bytes(), 8433 } 8434 return err 8435 } 8436 8437 errorBody.Seek(0, io.SeekStart) 8438 if len(code) != 0 { 8439 errorCode = restjson.SanitizeErrorCode(code) 8440 } 8441 if len(message) != 0 { 8442 errorMessage = message 8443 } 8444 8445 switch { 8446 case strings.EqualFold("BadRequestException", errorCode): 8447 return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) 8448 8449 case strings.EqualFold("NotFoundException", errorCode): 8450 return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) 8451 8452 case strings.EqualFold("TooManyRequestsException", errorCode): 8453 return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody) 8454 8455 default: 8456 genericError := &smithy.GenericAPIError{ 8457 Code: errorCode, 8458 Message: errorMessage, 8459 } 8460 return genericError 8461 8462 } 8463} 8464 8465type awsRestjson1_deserializeOpPutEmailIdentityDkimSigningAttributes struct { 8466} 8467 8468func (*awsRestjson1_deserializeOpPutEmailIdentityDkimSigningAttributes) ID() string { 8469 return "OperationDeserializer" 8470} 8471 8472func (m *awsRestjson1_deserializeOpPutEmailIdentityDkimSigningAttributes) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 8473 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 8474) { 8475 out, metadata, err = next.HandleDeserialize(ctx, in) 8476 if err != nil { 8477 return out, metadata, err 8478 } 8479 8480 response, ok := out.RawResponse.(*smithyhttp.Response) 8481 if !ok { 8482 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 8483 } 8484 8485 if response.StatusCode < 200 || response.StatusCode >= 300 { 8486 return out, metadata, awsRestjson1_deserializeOpErrorPutEmailIdentityDkimSigningAttributes(response, &metadata) 8487 } 8488 output := &PutEmailIdentityDkimSigningAttributesOutput{} 8489 out.Result = output 8490 8491 var buff [1024]byte 8492 ringBuffer := smithyio.NewRingBuffer(buff[:]) 8493 8494 body := io.TeeReader(response.Body, ringBuffer) 8495 8496 decoder := json.NewDecoder(body) 8497 decoder.UseNumber() 8498 var shape interface{} 8499 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 8500 var snapshot bytes.Buffer 8501 io.Copy(&snapshot, ringBuffer) 8502 err = &smithy.DeserializationError{ 8503 Err: fmt.Errorf("failed to decode response body, %w", err), 8504 Snapshot: snapshot.Bytes(), 8505 } 8506 return out, metadata, err 8507 } 8508 8509 err = awsRestjson1_deserializeOpDocumentPutEmailIdentityDkimSigningAttributesOutput(&output, shape) 8510 if err != nil { 8511 var snapshot bytes.Buffer 8512 io.Copy(&snapshot, ringBuffer) 8513 return out, metadata, &smithy.DeserializationError{ 8514 Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), 8515 Snapshot: snapshot.Bytes(), 8516 } 8517 } 8518 8519 return out, metadata, err 8520} 8521 8522func awsRestjson1_deserializeOpErrorPutEmailIdentityDkimSigningAttributes(response *smithyhttp.Response, metadata *middleware.Metadata) error { 8523 var errorBuffer bytes.Buffer 8524 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 8525 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 8526 } 8527 errorBody := bytes.NewReader(errorBuffer.Bytes()) 8528 8529 errorCode := "UnknownError" 8530 errorMessage := errorCode 8531 8532 code := response.Header.Get("X-Amzn-ErrorType") 8533 if len(code) != 0 { 8534 errorCode = restjson.SanitizeErrorCode(code) 8535 } 8536 8537 var buff [1024]byte 8538 ringBuffer := smithyio.NewRingBuffer(buff[:]) 8539 8540 body := io.TeeReader(errorBody, ringBuffer) 8541 decoder := json.NewDecoder(body) 8542 decoder.UseNumber() 8543 code, message, err := restjson.GetErrorInfo(decoder) 8544 if err != nil { 8545 var snapshot bytes.Buffer 8546 io.Copy(&snapshot, ringBuffer) 8547 err = &smithy.DeserializationError{ 8548 Err: fmt.Errorf("failed to decode response body, %w", err), 8549 Snapshot: snapshot.Bytes(), 8550 } 8551 return err 8552 } 8553 8554 errorBody.Seek(0, io.SeekStart) 8555 if len(code) != 0 { 8556 errorCode = restjson.SanitizeErrorCode(code) 8557 } 8558 if len(message) != 0 { 8559 errorMessage = message 8560 } 8561 8562 switch { 8563 case strings.EqualFold("BadRequestException", errorCode): 8564 return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) 8565 8566 case strings.EqualFold("NotFoundException", errorCode): 8567 return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) 8568 8569 case strings.EqualFold("TooManyRequestsException", errorCode): 8570 return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody) 8571 8572 default: 8573 genericError := &smithy.GenericAPIError{ 8574 Code: errorCode, 8575 Message: errorMessage, 8576 } 8577 return genericError 8578 8579 } 8580} 8581 8582func awsRestjson1_deserializeOpDocumentPutEmailIdentityDkimSigningAttributesOutput(v **PutEmailIdentityDkimSigningAttributesOutput, value interface{}) error { 8583 if v == nil { 8584 return fmt.Errorf("unexpected nil of type %T", v) 8585 } 8586 if value == nil { 8587 return nil 8588 } 8589 8590 shape, ok := value.(map[string]interface{}) 8591 if !ok { 8592 return fmt.Errorf("unexpected JSON type %v", value) 8593 } 8594 8595 var sv *PutEmailIdentityDkimSigningAttributesOutput 8596 if *v == nil { 8597 sv = &PutEmailIdentityDkimSigningAttributesOutput{} 8598 } else { 8599 sv = *v 8600 } 8601 8602 for key, value := range shape { 8603 switch key { 8604 case "DkimStatus": 8605 if value != nil { 8606 jtv, ok := value.(string) 8607 if !ok { 8608 return fmt.Errorf("expected DkimStatus to be of type string, got %T instead", value) 8609 } 8610 sv.DkimStatus = types.DkimStatus(jtv) 8611 } 8612 8613 case "DkimTokens": 8614 if err := awsRestjson1_deserializeDocumentDnsTokenList(&sv.DkimTokens, value); err != nil { 8615 return err 8616 } 8617 8618 default: 8619 _, _ = key, value 8620 8621 } 8622 } 8623 *v = sv 8624 return nil 8625} 8626 8627type awsRestjson1_deserializeOpPutEmailIdentityFeedbackAttributes struct { 8628} 8629 8630func (*awsRestjson1_deserializeOpPutEmailIdentityFeedbackAttributes) ID() string { 8631 return "OperationDeserializer" 8632} 8633 8634func (m *awsRestjson1_deserializeOpPutEmailIdentityFeedbackAttributes) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 8635 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 8636) { 8637 out, metadata, err = next.HandleDeserialize(ctx, in) 8638 if err != nil { 8639 return out, metadata, err 8640 } 8641 8642 response, ok := out.RawResponse.(*smithyhttp.Response) 8643 if !ok { 8644 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 8645 } 8646 8647 if response.StatusCode < 200 || response.StatusCode >= 300 { 8648 return out, metadata, awsRestjson1_deserializeOpErrorPutEmailIdentityFeedbackAttributes(response, &metadata) 8649 } 8650 output := &PutEmailIdentityFeedbackAttributesOutput{} 8651 out.Result = output 8652 8653 return out, metadata, err 8654} 8655 8656func awsRestjson1_deserializeOpErrorPutEmailIdentityFeedbackAttributes(response *smithyhttp.Response, metadata *middleware.Metadata) error { 8657 var errorBuffer bytes.Buffer 8658 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 8659 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 8660 } 8661 errorBody := bytes.NewReader(errorBuffer.Bytes()) 8662 8663 errorCode := "UnknownError" 8664 errorMessage := errorCode 8665 8666 code := response.Header.Get("X-Amzn-ErrorType") 8667 if len(code) != 0 { 8668 errorCode = restjson.SanitizeErrorCode(code) 8669 } 8670 8671 var buff [1024]byte 8672 ringBuffer := smithyio.NewRingBuffer(buff[:]) 8673 8674 body := io.TeeReader(errorBody, ringBuffer) 8675 decoder := json.NewDecoder(body) 8676 decoder.UseNumber() 8677 code, message, err := restjson.GetErrorInfo(decoder) 8678 if err != nil { 8679 var snapshot bytes.Buffer 8680 io.Copy(&snapshot, ringBuffer) 8681 err = &smithy.DeserializationError{ 8682 Err: fmt.Errorf("failed to decode response body, %w", err), 8683 Snapshot: snapshot.Bytes(), 8684 } 8685 return err 8686 } 8687 8688 errorBody.Seek(0, io.SeekStart) 8689 if len(code) != 0 { 8690 errorCode = restjson.SanitizeErrorCode(code) 8691 } 8692 if len(message) != 0 { 8693 errorMessage = message 8694 } 8695 8696 switch { 8697 case strings.EqualFold("BadRequestException", errorCode): 8698 return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) 8699 8700 case strings.EqualFold("NotFoundException", errorCode): 8701 return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) 8702 8703 case strings.EqualFold("TooManyRequestsException", errorCode): 8704 return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody) 8705 8706 default: 8707 genericError := &smithy.GenericAPIError{ 8708 Code: errorCode, 8709 Message: errorMessage, 8710 } 8711 return genericError 8712 8713 } 8714} 8715 8716type awsRestjson1_deserializeOpPutEmailIdentityMailFromAttributes struct { 8717} 8718 8719func (*awsRestjson1_deserializeOpPutEmailIdentityMailFromAttributes) ID() string { 8720 return "OperationDeserializer" 8721} 8722 8723func (m *awsRestjson1_deserializeOpPutEmailIdentityMailFromAttributes) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 8724 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 8725) { 8726 out, metadata, err = next.HandleDeserialize(ctx, in) 8727 if err != nil { 8728 return out, metadata, err 8729 } 8730 8731 response, ok := out.RawResponse.(*smithyhttp.Response) 8732 if !ok { 8733 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 8734 } 8735 8736 if response.StatusCode < 200 || response.StatusCode >= 300 { 8737 return out, metadata, awsRestjson1_deserializeOpErrorPutEmailIdentityMailFromAttributes(response, &metadata) 8738 } 8739 output := &PutEmailIdentityMailFromAttributesOutput{} 8740 out.Result = output 8741 8742 return out, metadata, err 8743} 8744 8745func awsRestjson1_deserializeOpErrorPutEmailIdentityMailFromAttributes(response *smithyhttp.Response, metadata *middleware.Metadata) error { 8746 var errorBuffer bytes.Buffer 8747 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 8748 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 8749 } 8750 errorBody := bytes.NewReader(errorBuffer.Bytes()) 8751 8752 errorCode := "UnknownError" 8753 errorMessage := errorCode 8754 8755 code := response.Header.Get("X-Amzn-ErrorType") 8756 if len(code) != 0 { 8757 errorCode = restjson.SanitizeErrorCode(code) 8758 } 8759 8760 var buff [1024]byte 8761 ringBuffer := smithyio.NewRingBuffer(buff[:]) 8762 8763 body := io.TeeReader(errorBody, ringBuffer) 8764 decoder := json.NewDecoder(body) 8765 decoder.UseNumber() 8766 code, message, err := restjson.GetErrorInfo(decoder) 8767 if err != nil { 8768 var snapshot bytes.Buffer 8769 io.Copy(&snapshot, ringBuffer) 8770 err = &smithy.DeserializationError{ 8771 Err: fmt.Errorf("failed to decode response body, %w", err), 8772 Snapshot: snapshot.Bytes(), 8773 } 8774 return err 8775 } 8776 8777 errorBody.Seek(0, io.SeekStart) 8778 if len(code) != 0 { 8779 errorCode = restjson.SanitizeErrorCode(code) 8780 } 8781 if len(message) != 0 { 8782 errorMessage = message 8783 } 8784 8785 switch { 8786 case strings.EqualFold("BadRequestException", errorCode): 8787 return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) 8788 8789 case strings.EqualFold("NotFoundException", errorCode): 8790 return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) 8791 8792 case strings.EqualFold("TooManyRequestsException", errorCode): 8793 return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody) 8794 8795 default: 8796 genericError := &smithy.GenericAPIError{ 8797 Code: errorCode, 8798 Message: errorMessage, 8799 } 8800 return genericError 8801 8802 } 8803} 8804 8805type awsRestjson1_deserializeOpPutSuppressedDestination struct { 8806} 8807 8808func (*awsRestjson1_deserializeOpPutSuppressedDestination) ID() string { 8809 return "OperationDeserializer" 8810} 8811 8812func (m *awsRestjson1_deserializeOpPutSuppressedDestination) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 8813 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 8814) { 8815 out, metadata, err = next.HandleDeserialize(ctx, in) 8816 if err != nil { 8817 return out, metadata, err 8818 } 8819 8820 response, ok := out.RawResponse.(*smithyhttp.Response) 8821 if !ok { 8822 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 8823 } 8824 8825 if response.StatusCode < 200 || response.StatusCode >= 300 { 8826 return out, metadata, awsRestjson1_deserializeOpErrorPutSuppressedDestination(response, &metadata) 8827 } 8828 output := &PutSuppressedDestinationOutput{} 8829 out.Result = output 8830 8831 return out, metadata, err 8832} 8833 8834func awsRestjson1_deserializeOpErrorPutSuppressedDestination(response *smithyhttp.Response, metadata *middleware.Metadata) error { 8835 var errorBuffer bytes.Buffer 8836 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 8837 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 8838 } 8839 errorBody := bytes.NewReader(errorBuffer.Bytes()) 8840 8841 errorCode := "UnknownError" 8842 errorMessage := errorCode 8843 8844 code := response.Header.Get("X-Amzn-ErrorType") 8845 if len(code) != 0 { 8846 errorCode = restjson.SanitizeErrorCode(code) 8847 } 8848 8849 var buff [1024]byte 8850 ringBuffer := smithyio.NewRingBuffer(buff[:]) 8851 8852 body := io.TeeReader(errorBody, ringBuffer) 8853 decoder := json.NewDecoder(body) 8854 decoder.UseNumber() 8855 code, message, err := restjson.GetErrorInfo(decoder) 8856 if err != nil { 8857 var snapshot bytes.Buffer 8858 io.Copy(&snapshot, ringBuffer) 8859 err = &smithy.DeserializationError{ 8860 Err: fmt.Errorf("failed to decode response body, %w", err), 8861 Snapshot: snapshot.Bytes(), 8862 } 8863 return err 8864 } 8865 8866 errorBody.Seek(0, io.SeekStart) 8867 if len(code) != 0 { 8868 errorCode = restjson.SanitizeErrorCode(code) 8869 } 8870 if len(message) != 0 { 8871 errorMessage = message 8872 } 8873 8874 switch { 8875 case strings.EqualFold("BadRequestException", errorCode): 8876 return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) 8877 8878 case strings.EqualFold("TooManyRequestsException", errorCode): 8879 return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody) 8880 8881 default: 8882 genericError := &smithy.GenericAPIError{ 8883 Code: errorCode, 8884 Message: errorMessage, 8885 } 8886 return genericError 8887 8888 } 8889} 8890 8891type awsRestjson1_deserializeOpSendBulkEmail struct { 8892} 8893 8894func (*awsRestjson1_deserializeOpSendBulkEmail) ID() string { 8895 return "OperationDeserializer" 8896} 8897 8898func (m *awsRestjson1_deserializeOpSendBulkEmail) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 8899 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 8900) { 8901 out, metadata, err = next.HandleDeserialize(ctx, in) 8902 if err != nil { 8903 return out, metadata, err 8904 } 8905 8906 response, ok := out.RawResponse.(*smithyhttp.Response) 8907 if !ok { 8908 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 8909 } 8910 8911 if response.StatusCode < 200 || response.StatusCode >= 300 { 8912 return out, metadata, awsRestjson1_deserializeOpErrorSendBulkEmail(response, &metadata) 8913 } 8914 output := &SendBulkEmailOutput{} 8915 out.Result = output 8916 8917 var buff [1024]byte 8918 ringBuffer := smithyio.NewRingBuffer(buff[:]) 8919 8920 body := io.TeeReader(response.Body, ringBuffer) 8921 8922 decoder := json.NewDecoder(body) 8923 decoder.UseNumber() 8924 var shape interface{} 8925 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 8926 var snapshot bytes.Buffer 8927 io.Copy(&snapshot, ringBuffer) 8928 err = &smithy.DeserializationError{ 8929 Err: fmt.Errorf("failed to decode response body, %w", err), 8930 Snapshot: snapshot.Bytes(), 8931 } 8932 return out, metadata, err 8933 } 8934 8935 err = awsRestjson1_deserializeOpDocumentSendBulkEmailOutput(&output, shape) 8936 if err != nil { 8937 var snapshot bytes.Buffer 8938 io.Copy(&snapshot, ringBuffer) 8939 return out, metadata, &smithy.DeserializationError{ 8940 Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), 8941 Snapshot: snapshot.Bytes(), 8942 } 8943 } 8944 8945 return out, metadata, err 8946} 8947 8948func awsRestjson1_deserializeOpErrorSendBulkEmail(response *smithyhttp.Response, metadata *middleware.Metadata) error { 8949 var errorBuffer bytes.Buffer 8950 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 8951 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 8952 } 8953 errorBody := bytes.NewReader(errorBuffer.Bytes()) 8954 8955 errorCode := "UnknownError" 8956 errorMessage := errorCode 8957 8958 code := response.Header.Get("X-Amzn-ErrorType") 8959 if len(code) != 0 { 8960 errorCode = restjson.SanitizeErrorCode(code) 8961 } 8962 8963 var buff [1024]byte 8964 ringBuffer := smithyio.NewRingBuffer(buff[:]) 8965 8966 body := io.TeeReader(errorBody, ringBuffer) 8967 decoder := json.NewDecoder(body) 8968 decoder.UseNumber() 8969 code, message, err := restjson.GetErrorInfo(decoder) 8970 if err != nil { 8971 var snapshot bytes.Buffer 8972 io.Copy(&snapshot, ringBuffer) 8973 err = &smithy.DeserializationError{ 8974 Err: fmt.Errorf("failed to decode response body, %w", err), 8975 Snapshot: snapshot.Bytes(), 8976 } 8977 return err 8978 } 8979 8980 errorBody.Seek(0, io.SeekStart) 8981 if len(code) != 0 { 8982 errorCode = restjson.SanitizeErrorCode(code) 8983 } 8984 if len(message) != 0 { 8985 errorMessage = message 8986 } 8987 8988 switch { 8989 case strings.EqualFold("AccountSuspendedException", errorCode): 8990 return awsRestjson1_deserializeErrorAccountSuspendedException(response, errorBody) 8991 8992 case strings.EqualFold("BadRequestException", errorCode): 8993 return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) 8994 8995 case strings.EqualFold("LimitExceededException", errorCode): 8996 return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) 8997 8998 case strings.EqualFold("MailFromDomainNotVerifiedException", errorCode): 8999 return awsRestjson1_deserializeErrorMailFromDomainNotVerifiedException(response, errorBody) 9000 9001 case strings.EqualFold("MessageRejected", errorCode): 9002 return awsRestjson1_deserializeErrorMessageRejected(response, errorBody) 9003 9004 case strings.EqualFold("NotFoundException", errorCode): 9005 return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) 9006 9007 case strings.EqualFold("SendingPausedException", errorCode): 9008 return awsRestjson1_deserializeErrorSendingPausedException(response, errorBody) 9009 9010 case strings.EqualFold("TooManyRequestsException", errorCode): 9011 return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody) 9012 9013 default: 9014 genericError := &smithy.GenericAPIError{ 9015 Code: errorCode, 9016 Message: errorMessage, 9017 } 9018 return genericError 9019 9020 } 9021} 9022 9023func awsRestjson1_deserializeOpDocumentSendBulkEmailOutput(v **SendBulkEmailOutput, value interface{}) error { 9024 if v == nil { 9025 return fmt.Errorf("unexpected nil of type %T", v) 9026 } 9027 if value == nil { 9028 return nil 9029 } 9030 9031 shape, ok := value.(map[string]interface{}) 9032 if !ok { 9033 return fmt.Errorf("unexpected JSON type %v", value) 9034 } 9035 9036 var sv *SendBulkEmailOutput 9037 if *v == nil { 9038 sv = &SendBulkEmailOutput{} 9039 } else { 9040 sv = *v 9041 } 9042 9043 for key, value := range shape { 9044 switch key { 9045 case "BulkEmailEntryResults": 9046 if err := awsRestjson1_deserializeDocumentBulkEmailEntryResultList(&sv.BulkEmailEntryResults, value); err != nil { 9047 return err 9048 } 9049 9050 default: 9051 _, _ = key, value 9052 9053 } 9054 } 9055 *v = sv 9056 return nil 9057} 9058 9059type awsRestjson1_deserializeOpSendCustomVerificationEmail struct { 9060} 9061 9062func (*awsRestjson1_deserializeOpSendCustomVerificationEmail) ID() string { 9063 return "OperationDeserializer" 9064} 9065 9066func (m *awsRestjson1_deserializeOpSendCustomVerificationEmail) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 9067 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 9068) { 9069 out, metadata, err = next.HandleDeserialize(ctx, in) 9070 if err != nil { 9071 return out, metadata, err 9072 } 9073 9074 response, ok := out.RawResponse.(*smithyhttp.Response) 9075 if !ok { 9076 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 9077 } 9078 9079 if response.StatusCode < 200 || response.StatusCode >= 300 { 9080 return out, metadata, awsRestjson1_deserializeOpErrorSendCustomVerificationEmail(response, &metadata) 9081 } 9082 output := &SendCustomVerificationEmailOutput{} 9083 out.Result = output 9084 9085 var buff [1024]byte 9086 ringBuffer := smithyio.NewRingBuffer(buff[:]) 9087 9088 body := io.TeeReader(response.Body, ringBuffer) 9089 9090 decoder := json.NewDecoder(body) 9091 decoder.UseNumber() 9092 var shape interface{} 9093 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 9094 var snapshot bytes.Buffer 9095 io.Copy(&snapshot, ringBuffer) 9096 err = &smithy.DeserializationError{ 9097 Err: fmt.Errorf("failed to decode response body, %w", err), 9098 Snapshot: snapshot.Bytes(), 9099 } 9100 return out, metadata, err 9101 } 9102 9103 err = awsRestjson1_deserializeOpDocumentSendCustomVerificationEmailOutput(&output, shape) 9104 if err != nil { 9105 var snapshot bytes.Buffer 9106 io.Copy(&snapshot, ringBuffer) 9107 return out, metadata, &smithy.DeserializationError{ 9108 Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), 9109 Snapshot: snapshot.Bytes(), 9110 } 9111 } 9112 9113 return out, metadata, err 9114} 9115 9116func awsRestjson1_deserializeOpErrorSendCustomVerificationEmail(response *smithyhttp.Response, metadata *middleware.Metadata) error { 9117 var errorBuffer bytes.Buffer 9118 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 9119 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 9120 } 9121 errorBody := bytes.NewReader(errorBuffer.Bytes()) 9122 9123 errorCode := "UnknownError" 9124 errorMessage := errorCode 9125 9126 code := response.Header.Get("X-Amzn-ErrorType") 9127 if len(code) != 0 { 9128 errorCode = restjson.SanitizeErrorCode(code) 9129 } 9130 9131 var buff [1024]byte 9132 ringBuffer := smithyio.NewRingBuffer(buff[:]) 9133 9134 body := io.TeeReader(errorBody, ringBuffer) 9135 decoder := json.NewDecoder(body) 9136 decoder.UseNumber() 9137 code, message, err := restjson.GetErrorInfo(decoder) 9138 if err != nil { 9139 var snapshot bytes.Buffer 9140 io.Copy(&snapshot, ringBuffer) 9141 err = &smithy.DeserializationError{ 9142 Err: fmt.Errorf("failed to decode response body, %w", err), 9143 Snapshot: snapshot.Bytes(), 9144 } 9145 return err 9146 } 9147 9148 errorBody.Seek(0, io.SeekStart) 9149 if len(code) != 0 { 9150 errorCode = restjson.SanitizeErrorCode(code) 9151 } 9152 if len(message) != 0 { 9153 errorMessage = message 9154 } 9155 9156 switch { 9157 case strings.EqualFold("BadRequestException", errorCode): 9158 return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) 9159 9160 case strings.EqualFold("LimitExceededException", errorCode): 9161 return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) 9162 9163 case strings.EqualFold("MailFromDomainNotVerifiedException", errorCode): 9164 return awsRestjson1_deserializeErrorMailFromDomainNotVerifiedException(response, errorBody) 9165 9166 case strings.EqualFold("MessageRejected", errorCode): 9167 return awsRestjson1_deserializeErrorMessageRejected(response, errorBody) 9168 9169 case strings.EqualFold("NotFoundException", errorCode): 9170 return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) 9171 9172 case strings.EqualFold("SendingPausedException", errorCode): 9173 return awsRestjson1_deserializeErrorSendingPausedException(response, errorBody) 9174 9175 case strings.EqualFold("TooManyRequestsException", errorCode): 9176 return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody) 9177 9178 default: 9179 genericError := &smithy.GenericAPIError{ 9180 Code: errorCode, 9181 Message: errorMessage, 9182 } 9183 return genericError 9184 9185 } 9186} 9187 9188func awsRestjson1_deserializeOpDocumentSendCustomVerificationEmailOutput(v **SendCustomVerificationEmailOutput, value interface{}) error { 9189 if v == nil { 9190 return fmt.Errorf("unexpected nil of type %T", v) 9191 } 9192 if value == nil { 9193 return nil 9194 } 9195 9196 shape, ok := value.(map[string]interface{}) 9197 if !ok { 9198 return fmt.Errorf("unexpected JSON type %v", value) 9199 } 9200 9201 var sv *SendCustomVerificationEmailOutput 9202 if *v == nil { 9203 sv = &SendCustomVerificationEmailOutput{} 9204 } else { 9205 sv = *v 9206 } 9207 9208 for key, value := range shape { 9209 switch key { 9210 case "MessageId": 9211 if value != nil { 9212 jtv, ok := value.(string) 9213 if !ok { 9214 return fmt.Errorf("expected OutboundMessageId to be of type string, got %T instead", value) 9215 } 9216 sv.MessageId = ptr.String(jtv) 9217 } 9218 9219 default: 9220 _, _ = key, value 9221 9222 } 9223 } 9224 *v = sv 9225 return nil 9226} 9227 9228type awsRestjson1_deserializeOpSendEmail struct { 9229} 9230 9231func (*awsRestjson1_deserializeOpSendEmail) ID() string { 9232 return "OperationDeserializer" 9233} 9234 9235func (m *awsRestjson1_deserializeOpSendEmail) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 9236 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 9237) { 9238 out, metadata, err = next.HandleDeserialize(ctx, in) 9239 if err != nil { 9240 return out, metadata, err 9241 } 9242 9243 response, ok := out.RawResponse.(*smithyhttp.Response) 9244 if !ok { 9245 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 9246 } 9247 9248 if response.StatusCode < 200 || response.StatusCode >= 300 { 9249 return out, metadata, awsRestjson1_deserializeOpErrorSendEmail(response, &metadata) 9250 } 9251 output := &SendEmailOutput{} 9252 out.Result = output 9253 9254 var buff [1024]byte 9255 ringBuffer := smithyio.NewRingBuffer(buff[:]) 9256 9257 body := io.TeeReader(response.Body, ringBuffer) 9258 9259 decoder := json.NewDecoder(body) 9260 decoder.UseNumber() 9261 var shape interface{} 9262 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 9263 var snapshot bytes.Buffer 9264 io.Copy(&snapshot, ringBuffer) 9265 err = &smithy.DeserializationError{ 9266 Err: fmt.Errorf("failed to decode response body, %w", err), 9267 Snapshot: snapshot.Bytes(), 9268 } 9269 return out, metadata, err 9270 } 9271 9272 err = awsRestjson1_deserializeOpDocumentSendEmailOutput(&output, shape) 9273 if err != nil { 9274 var snapshot bytes.Buffer 9275 io.Copy(&snapshot, ringBuffer) 9276 return out, metadata, &smithy.DeserializationError{ 9277 Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), 9278 Snapshot: snapshot.Bytes(), 9279 } 9280 } 9281 9282 return out, metadata, err 9283} 9284 9285func awsRestjson1_deserializeOpErrorSendEmail(response *smithyhttp.Response, metadata *middleware.Metadata) error { 9286 var errorBuffer bytes.Buffer 9287 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 9288 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 9289 } 9290 errorBody := bytes.NewReader(errorBuffer.Bytes()) 9291 9292 errorCode := "UnknownError" 9293 errorMessage := errorCode 9294 9295 code := response.Header.Get("X-Amzn-ErrorType") 9296 if len(code) != 0 { 9297 errorCode = restjson.SanitizeErrorCode(code) 9298 } 9299 9300 var buff [1024]byte 9301 ringBuffer := smithyio.NewRingBuffer(buff[:]) 9302 9303 body := io.TeeReader(errorBody, ringBuffer) 9304 decoder := json.NewDecoder(body) 9305 decoder.UseNumber() 9306 code, message, err := restjson.GetErrorInfo(decoder) 9307 if err != nil { 9308 var snapshot bytes.Buffer 9309 io.Copy(&snapshot, ringBuffer) 9310 err = &smithy.DeserializationError{ 9311 Err: fmt.Errorf("failed to decode response body, %w", err), 9312 Snapshot: snapshot.Bytes(), 9313 } 9314 return err 9315 } 9316 9317 errorBody.Seek(0, io.SeekStart) 9318 if len(code) != 0 { 9319 errorCode = restjson.SanitizeErrorCode(code) 9320 } 9321 if len(message) != 0 { 9322 errorMessage = message 9323 } 9324 9325 switch { 9326 case strings.EqualFold("AccountSuspendedException", errorCode): 9327 return awsRestjson1_deserializeErrorAccountSuspendedException(response, errorBody) 9328 9329 case strings.EqualFold("BadRequestException", errorCode): 9330 return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) 9331 9332 case strings.EqualFold("LimitExceededException", errorCode): 9333 return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) 9334 9335 case strings.EqualFold("MailFromDomainNotVerifiedException", errorCode): 9336 return awsRestjson1_deserializeErrorMailFromDomainNotVerifiedException(response, errorBody) 9337 9338 case strings.EqualFold("MessageRejected", errorCode): 9339 return awsRestjson1_deserializeErrorMessageRejected(response, errorBody) 9340 9341 case strings.EqualFold("NotFoundException", errorCode): 9342 return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) 9343 9344 case strings.EqualFold("SendingPausedException", errorCode): 9345 return awsRestjson1_deserializeErrorSendingPausedException(response, errorBody) 9346 9347 case strings.EqualFold("TooManyRequestsException", errorCode): 9348 return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody) 9349 9350 default: 9351 genericError := &smithy.GenericAPIError{ 9352 Code: errorCode, 9353 Message: errorMessage, 9354 } 9355 return genericError 9356 9357 } 9358} 9359 9360func awsRestjson1_deserializeOpDocumentSendEmailOutput(v **SendEmailOutput, value interface{}) error { 9361 if v == nil { 9362 return fmt.Errorf("unexpected nil of type %T", v) 9363 } 9364 if value == nil { 9365 return nil 9366 } 9367 9368 shape, ok := value.(map[string]interface{}) 9369 if !ok { 9370 return fmt.Errorf("unexpected JSON type %v", value) 9371 } 9372 9373 var sv *SendEmailOutput 9374 if *v == nil { 9375 sv = &SendEmailOutput{} 9376 } else { 9377 sv = *v 9378 } 9379 9380 for key, value := range shape { 9381 switch key { 9382 case "MessageId": 9383 if value != nil { 9384 jtv, ok := value.(string) 9385 if !ok { 9386 return fmt.Errorf("expected OutboundMessageId to be of type string, got %T instead", value) 9387 } 9388 sv.MessageId = ptr.String(jtv) 9389 } 9390 9391 default: 9392 _, _ = key, value 9393 9394 } 9395 } 9396 *v = sv 9397 return nil 9398} 9399 9400type awsRestjson1_deserializeOpTagResource struct { 9401} 9402 9403func (*awsRestjson1_deserializeOpTagResource) ID() string { 9404 return "OperationDeserializer" 9405} 9406 9407func (m *awsRestjson1_deserializeOpTagResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 9408 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 9409) { 9410 out, metadata, err = next.HandleDeserialize(ctx, in) 9411 if err != nil { 9412 return out, metadata, err 9413 } 9414 9415 response, ok := out.RawResponse.(*smithyhttp.Response) 9416 if !ok { 9417 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 9418 } 9419 9420 if response.StatusCode < 200 || response.StatusCode >= 300 { 9421 return out, metadata, awsRestjson1_deserializeOpErrorTagResource(response, &metadata) 9422 } 9423 output := &TagResourceOutput{} 9424 out.Result = output 9425 9426 return out, metadata, err 9427} 9428 9429func awsRestjson1_deserializeOpErrorTagResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { 9430 var errorBuffer bytes.Buffer 9431 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 9432 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 9433 } 9434 errorBody := bytes.NewReader(errorBuffer.Bytes()) 9435 9436 errorCode := "UnknownError" 9437 errorMessage := errorCode 9438 9439 code := response.Header.Get("X-Amzn-ErrorType") 9440 if len(code) != 0 { 9441 errorCode = restjson.SanitizeErrorCode(code) 9442 } 9443 9444 var buff [1024]byte 9445 ringBuffer := smithyio.NewRingBuffer(buff[:]) 9446 9447 body := io.TeeReader(errorBody, ringBuffer) 9448 decoder := json.NewDecoder(body) 9449 decoder.UseNumber() 9450 code, message, err := restjson.GetErrorInfo(decoder) 9451 if err != nil { 9452 var snapshot bytes.Buffer 9453 io.Copy(&snapshot, ringBuffer) 9454 err = &smithy.DeserializationError{ 9455 Err: fmt.Errorf("failed to decode response body, %w", err), 9456 Snapshot: snapshot.Bytes(), 9457 } 9458 return err 9459 } 9460 9461 errorBody.Seek(0, io.SeekStart) 9462 if len(code) != 0 { 9463 errorCode = restjson.SanitizeErrorCode(code) 9464 } 9465 if len(message) != 0 { 9466 errorMessage = message 9467 } 9468 9469 switch { 9470 case strings.EqualFold("BadRequestException", errorCode): 9471 return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) 9472 9473 case strings.EqualFold("ConcurrentModificationException", errorCode): 9474 return awsRestjson1_deserializeErrorConcurrentModificationException(response, errorBody) 9475 9476 case strings.EqualFold("NotFoundException", errorCode): 9477 return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) 9478 9479 case strings.EqualFold("TooManyRequestsException", errorCode): 9480 return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody) 9481 9482 default: 9483 genericError := &smithy.GenericAPIError{ 9484 Code: errorCode, 9485 Message: errorMessage, 9486 } 9487 return genericError 9488 9489 } 9490} 9491 9492type awsRestjson1_deserializeOpTestRenderEmailTemplate struct { 9493} 9494 9495func (*awsRestjson1_deserializeOpTestRenderEmailTemplate) ID() string { 9496 return "OperationDeserializer" 9497} 9498 9499func (m *awsRestjson1_deserializeOpTestRenderEmailTemplate) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 9500 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 9501) { 9502 out, metadata, err = next.HandleDeserialize(ctx, in) 9503 if err != nil { 9504 return out, metadata, err 9505 } 9506 9507 response, ok := out.RawResponse.(*smithyhttp.Response) 9508 if !ok { 9509 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 9510 } 9511 9512 if response.StatusCode < 200 || response.StatusCode >= 300 { 9513 return out, metadata, awsRestjson1_deserializeOpErrorTestRenderEmailTemplate(response, &metadata) 9514 } 9515 output := &TestRenderEmailTemplateOutput{} 9516 out.Result = output 9517 9518 var buff [1024]byte 9519 ringBuffer := smithyio.NewRingBuffer(buff[:]) 9520 9521 body := io.TeeReader(response.Body, ringBuffer) 9522 9523 decoder := json.NewDecoder(body) 9524 decoder.UseNumber() 9525 var shape interface{} 9526 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 9527 var snapshot bytes.Buffer 9528 io.Copy(&snapshot, ringBuffer) 9529 err = &smithy.DeserializationError{ 9530 Err: fmt.Errorf("failed to decode response body, %w", err), 9531 Snapshot: snapshot.Bytes(), 9532 } 9533 return out, metadata, err 9534 } 9535 9536 err = awsRestjson1_deserializeOpDocumentTestRenderEmailTemplateOutput(&output, shape) 9537 if err != nil { 9538 var snapshot bytes.Buffer 9539 io.Copy(&snapshot, ringBuffer) 9540 return out, metadata, &smithy.DeserializationError{ 9541 Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), 9542 Snapshot: snapshot.Bytes(), 9543 } 9544 } 9545 9546 return out, metadata, err 9547} 9548 9549func awsRestjson1_deserializeOpErrorTestRenderEmailTemplate(response *smithyhttp.Response, metadata *middleware.Metadata) error { 9550 var errorBuffer bytes.Buffer 9551 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 9552 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 9553 } 9554 errorBody := bytes.NewReader(errorBuffer.Bytes()) 9555 9556 errorCode := "UnknownError" 9557 errorMessage := errorCode 9558 9559 code := response.Header.Get("X-Amzn-ErrorType") 9560 if len(code) != 0 { 9561 errorCode = restjson.SanitizeErrorCode(code) 9562 } 9563 9564 var buff [1024]byte 9565 ringBuffer := smithyio.NewRingBuffer(buff[:]) 9566 9567 body := io.TeeReader(errorBody, ringBuffer) 9568 decoder := json.NewDecoder(body) 9569 decoder.UseNumber() 9570 code, message, err := restjson.GetErrorInfo(decoder) 9571 if err != nil { 9572 var snapshot bytes.Buffer 9573 io.Copy(&snapshot, ringBuffer) 9574 err = &smithy.DeserializationError{ 9575 Err: fmt.Errorf("failed to decode response body, %w", err), 9576 Snapshot: snapshot.Bytes(), 9577 } 9578 return err 9579 } 9580 9581 errorBody.Seek(0, io.SeekStart) 9582 if len(code) != 0 { 9583 errorCode = restjson.SanitizeErrorCode(code) 9584 } 9585 if len(message) != 0 { 9586 errorMessage = message 9587 } 9588 9589 switch { 9590 case strings.EqualFold("BadRequestException", errorCode): 9591 return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) 9592 9593 case strings.EqualFold("NotFoundException", errorCode): 9594 return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) 9595 9596 case strings.EqualFold("TooManyRequestsException", errorCode): 9597 return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody) 9598 9599 default: 9600 genericError := &smithy.GenericAPIError{ 9601 Code: errorCode, 9602 Message: errorMessage, 9603 } 9604 return genericError 9605 9606 } 9607} 9608 9609func awsRestjson1_deserializeOpDocumentTestRenderEmailTemplateOutput(v **TestRenderEmailTemplateOutput, value interface{}) error { 9610 if v == nil { 9611 return fmt.Errorf("unexpected nil of type %T", v) 9612 } 9613 if value == nil { 9614 return nil 9615 } 9616 9617 shape, ok := value.(map[string]interface{}) 9618 if !ok { 9619 return fmt.Errorf("unexpected JSON type %v", value) 9620 } 9621 9622 var sv *TestRenderEmailTemplateOutput 9623 if *v == nil { 9624 sv = &TestRenderEmailTemplateOutput{} 9625 } else { 9626 sv = *v 9627 } 9628 9629 for key, value := range shape { 9630 switch key { 9631 case "RenderedTemplate": 9632 if value != nil { 9633 jtv, ok := value.(string) 9634 if !ok { 9635 return fmt.Errorf("expected RenderedEmailTemplate to be of type string, got %T instead", value) 9636 } 9637 sv.RenderedTemplate = ptr.String(jtv) 9638 } 9639 9640 default: 9641 _, _ = key, value 9642 9643 } 9644 } 9645 *v = sv 9646 return nil 9647} 9648 9649type awsRestjson1_deserializeOpUntagResource struct { 9650} 9651 9652func (*awsRestjson1_deserializeOpUntagResource) ID() string { 9653 return "OperationDeserializer" 9654} 9655 9656func (m *awsRestjson1_deserializeOpUntagResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 9657 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 9658) { 9659 out, metadata, err = next.HandleDeserialize(ctx, in) 9660 if err != nil { 9661 return out, metadata, err 9662 } 9663 9664 response, ok := out.RawResponse.(*smithyhttp.Response) 9665 if !ok { 9666 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 9667 } 9668 9669 if response.StatusCode < 200 || response.StatusCode >= 300 { 9670 return out, metadata, awsRestjson1_deserializeOpErrorUntagResource(response, &metadata) 9671 } 9672 output := &UntagResourceOutput{} 9673 out.Result = output 9674 9675 return out, metadata, err 9676} 9677 9678func awsRestjson1_deserializeOpErrorUntagResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { 9679 var errorBuffer bytes.Buffer 9680 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 9681 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 9682 } 9683 errorBody := bytes.NewReader(errorBuffer.Bytes()) 9684 9685 errorCode := "UnknownError" 9686 errorMessage := errorCode 9687 9688 code := response.Header.Get("X-Amzn-ErrorType") 9689 if len(code) != 0 { 9690 errorCode = restjson.SanitizeErrorCode(code) 9691 } 9692 9693 var buff [1024]byte 9694 ringBuffer := smithyio.NewRingBuffer(buff[:]) 9695 9696 body := io.TeeReader(errorBody, ringBuffer) 9697 decoder := json.NewDecoder(body) 9698 decoder.UseNumber() 9699 code, message, err := restjson.GetErrorInfo(decoder) 9700 if err != nil { 9701 var snapshot bytes.Buffer 9702 io.Copy(&snapshot, ringBuffer) 9703 err = &smithy.DeserializationError{ 9704 Err: fmt.Errorf("failed to decode response body, %w", err), 9705 Snapshot: snapshot.Bytes(), 9706 } 9707 return err 9708 } 9709 9710 errorBody.Seek(0, io.SeekStart) 9711 if len(code) != 0 { 9712 errorCode = restjson.SanitizeErrorCode(code) 9713 } 9714 if len(message) != 0 { 9715 errorMessage = message 9716 } 9717 9718 switch { 9719 case strings.EqualFold("BadRequestException", errorCode): 9720 return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) 9721 9722 case strings.EqualFold("ConcurrentModificationException", errorCode): 9723 return awsRestjson1_deserializeErrorConcurrentModificationException(response, errorBody) 9724 9725 case strings.EqualFold("NotFoundException", errorCode): 9726 return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) 9727 9728 case strings.EqualFold("TooManyRequestsException", errorCode): 9729 return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody) 9730 9731 default: 9732 genericError := &smithy.GenericAPIError{ 9733 Code: errorCode, 9734 Message: errorMessage, 9735 } 9736 return genericError 9737 9738 } 9739} 9740 9741type awsRestjson1_deserializeOpUpdateConfigurationSetEventDestination struct { 9742} 9743 9744func (*awsRestjson1_deserializeOpUpdateConfigurationSetEventDestination) ID() string { 9745 return "OperationDeserializer" 9746} 9747 9748func (m *awsRestjson1_deserializeOpUpdateConfigurationSetEventDestination) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 9749 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 9750) { 9751 out, metadata, err = next.HandleDeserialize(ctx, in) 9752 if err != nil { 9753 return out, metadata, err 9754 } 9755 9756 response, ok := out.RawResponse.(*smithyhttp.Response) 9757 if !ok { 9758 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 9759 } 9760 9761 if response.StatusCode < 200 || response.StatusCode >= 300 { 9762 return out, metadata, awsRestjson1_deserializeOpErrorUpdateConfigurationSetEventDestination(response, &metadata) 9763 } 9764 output := &UpdateConfigurationSetEventDestinationOutput{} 9765 out.Result = output 9766 9767 return out, metadata, err 9768} 9769 9770func awsRestjson1_deserializeOpErrorUpdateConfigurationSetEventDestination(response *smithyhttp.Response, metadata *middleware.Metadata) error { 9771 var errorBuffer bytes.Buffer 9772 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 9773 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 9774 } 9775 errorBody := bytes.NewReader(errorBuffer.Bytes()) 9776 9777 errorCode := "UnknownError" 9778 errorMessage := errorCode 9779 9780 code := response.Header.Get("X-Amzn-ErrorType") 9781 if len(code) != 0 { 9782 errorCode = restjson.SanitizeErrorCode(code) 9783 } 9784 9785 var buff [1024]byte 9786 ringBuffer := smithyio.NewRingBuffer(buff[:]) 9787 9788 body := io.TeeReader(errorBody, ringBuffer) 9789 decoder := json.NewDecoder(body) 9790 decoder.UseNumber() 9791 code, message, err := restjson.GetErrorInfo(decoder) 9792 if err != nil { 9793 var snapshot bytes.Buffer 9794 io.Copy(&snapshot, ringBuffer) 9795 err = &smithy.DeserializationError{ 9796 Err: fmt.Errorf("failed to decode response body, %w", err), 9797 Snapshot: snapshot.Bytes(), 9798 } 9799 return err 9800 } 9801 9802 errorBody.Seek(0, io.SeekStart) 9803 if len(code) != 0 { 9804 errorCode = restjson.SanitizeErrorCode(code) 9805 } 9806 if len(message) != 0 { 9807 errorMessage = message 9808 } 9809 9810 switch { 9811 case strings.EqualFold("BadRequestException", errorCode): 9812 return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) 9813 9814 case strings.EqualFold("NotFoundException", errorCode): 9815 return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) 9816 9817 case strings.EqualFold("TooManyRequestsException", errorCode): 9818 return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody) 9819 9820 default: 9821 genericError := &smithy.GenericAPIError{ 9822 Code: errorCode, 9823 Message: errorMessage, 9824 } 9825 return genericError 9826 9827 } 9828} 9829 9830type awsRestjson1_deserializeOpUpdateContact struct { 9831} 9832 9833func (*awsRestjson1_deserializeOpUpdateContact) ID() string { 9834 return "OperationDeserializer" 9835} 9836 9837func (m *awsRestjson1_deserializeOpUpdateContact) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 9838 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 9839) { 9840 out, metadata, err = next.HandleDeserialize(ctx, in) 9841 if err != nil { 9842 return out, metadata, err 9843 } 9844 9845 response, ok := out.RawResponse.(*smithyhttp.Response) 9846 if !ok { 9847 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 9848 } 9849 9850 if response.StatusCode < 200 || response.StatusCode >= 300 { 9851 return out, metadata, awsRestjson1_deserializeOpErrorUpdateContact(response, &metadata) 9852 } 9853 output := &UpdateContactOutput{} 9854 out.Result = output 9855 9856 return out, metadata, err 9857} 9858 9859func awsRestjson1_deserializeOpErrorUpdateContact(response *smithyhttp.Response, metadata *middleware.Metadata) error { 9860 var errorBuffer bytes.Buffer 9861 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 9862 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 9863 } 9864 errorBody := bytes.NewReader(errorBuffer.Bytes()) 9865 9866 errorCode := "UnknownError" 9867 errorMessage := errorCode 9868 9869 code := response.Header.Get("X-Amzn-ErrorType") 9870 if len(code) != 0 { 9871 errorCode = restjson.SanitizeErrorCode(code) 9872 } 9873 9874 var buff [1024]byte 9875 ringBuffer := smithyio.NewRingBuffer(buff[:]) 9876 9877 body := io.TeeReader(errorBody, ringBuffer) 9878 decoder := json.NewDecoder(body) 9879 decoder.UseNumber() 9880 code, message, err := restjson.GetErrorInfo(decoder) 9881 if err != nil { 9882 var snapshot bytes.Buffer 9883 io.Copy(&snapshot, ringBuffer) 9884 err = &smithy.DeserializationError{ 9885 Err: fmt.Errorf("failed to decode response body, %w", err), 9886 Snapshot: snapshot.Bytes(), 9887 } 9888 return err 9889 } 9890 9891 errorBody.Seek(0, io.SeekStart) 9892 if len(code) != 0 { 9893 errorCode = restjson.SanitizeErrorCode(code) 9894 } 9895 if len(message) != 0 { 9896 errorMessage = message 9897 } 9898 9899 switch { 9900 case strings.EqualFold("BadRequestException", errorCode): 9901 return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) 9902 9903 case strings.EqualFold("ConcurrentModificationException", errorCode): 9904 return awsRestjson1_deserializeErrorConcurrentModificationException(response, errorBody) 9905 9906 case strings.EqualFold("NotFoundException", errorCode): 9907 return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) 9908 9909 case strings.EqualFold("TooManyRequestsException", errorCode): 9910 return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody) 9911 9912 default: 9913 genericError := &smithy.GenericAPIError{ 9914 Code: errorCode, 9915 Message: errorMessage, 9916 } 9917 return genericError 9918 9919 } 9920} 9921 9922type awsRestjson1_deserializeOpUpdateContactList struct { 9923} 9924 9925func (*awsRestjson1_deserializeOpUpdateContactList) ID() string { 9926 return "OperationDeserializer" 9927} 9928 9929func (m *awsRestjson1_deserializeOpUpdateContactList) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 9930 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 9931) { 9932 out, metadata, err = next.HandleDeserialize(ctx, in) 9933 if err != nil { 9934 return out, metadata, err 9935 } 9936 9937 response, ok := out.RawResponse.(*smithyhttp.Response) 9938 if !ok { 9939 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 9940 } 9941 9942 if response.StatusCode < 200 || response.StatusCode >= 300 { 9943 return out, metadata, awsRestjson1_deserializeOpErrorUpdateContactList(response, &metadata) 9944 } 9945 output := &UpdateContactListOutput{} 9946 out.Result = output 9947 9948 return out, metadata, err 9949} 9950 9951func awsRestjson1_deserializeOpErrorUpdateContactList(response *smithyhttp.Response, metadata *middleware.Metadata) error { 9952 var errorBuffer bytes.Buffer 9953 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 9954 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 9955 } 9956 errorBody := bytes.NewReader(errorBuffer.Bytes()) 9957 9958 errorCode := "UnknownError" 9959 errorMessage := errorCode 9960 9961 code := response.Header.Get("X-Amzn-ErrorType") 9962 if len(code) != 0 { 9963 errorCode = restjson.SanitizeErrorCode(code) 9964 } 9965 9966 var buff [1024]byte 9967 ringBuffer := smithyio.NewRingBuffer(buff[:]) 9968 9969 body := io.TeeReader(errorBody, ringBuffer) 9970 decoder := json.NewDecoder(body) 9971 decoder.UseNumber() 9972 code, message, err := restjson.GetErrorInfo(decoder) 9973 if err != nil { 9974 var snapshot bytes.Buffer 9975 io.Copy(&snapshot, ringBuffer) 9976 err = &smithy.DeserializationError{ 9977 Err: fmt.Errorf("failed to decode response body, %w", err), 9978 Snapshot: snapshot.Bytes(), 9979 } 9980 return err 9981 } 9982 9983 errorBody.Seek(0, io.SeekStart) 9984 if len(code) != 0 { 9985 errorCode = restjson.SanitizeErrorCode(code) 9986 } 9987 if len(message) != 0 { 9988 errorMessage = message 9989 } 9990 9991 switch { 9992 case strings.EqualFold("BadRequestException", errorCode): 9993 return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) 9994 9995 case strings.EqualFold("ConcurrentModificationException", errorCode): 9996 return awsRestjson1_deserializeErrorConcurrentModificationException(response, errorBody) 9997 9998 case strings.EqualFold("NotFoundException", errorCode): 9999 return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) 10000 10001 case strings.EqualFold("TooManyRequestsException", errorCode): 10002 return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody) 10003 10004 default: 10005 genericError := &smithy.GenericAPIError{ 10006 Code: errorCode, 10007 Message: errorMessage, 10008 } 10009 return genericError 10010 10011 } 10012} 10013 10014type awsRestjson1_deserializeOpUpdateCustomVerificationEmailTemplate struct { 10015} 10016 10017func (*awsRestjson1_deserializeOpUpdateCustomVerificationEmailTemplate) ID() string { 10018 return "OperationDeserializer" 10019} 10020 10021func (m *awsRestjson1_deserializeOpUpdateCustomVerificationEmailTemplate) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 10022 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 10023) { 10024 out, metadata, err = next.HandleDeserialize(ctx, in) 10025 if err != nil { 10026 return out, metadata, err 10027 } 10028 10029 response, ok := out.RawResponse.(*smithyhttp.Response) 10030 if !ok { 10031 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 10032 } 10033 10034 if response.StatusCode < 200 || response.StatusCode >= 300 { 10035 return out, metadata, awsRestjson1_deserializeOpErrorUpdateCustomVerificationEmailTemplate(response, &metadata) 10036 } 10037 output := &UpdateCustomVerificationEmailTemplateOutput{} 10038 out.Result = output 10039 10040 return out, metadata, err 10041} 10042 10043func awsRestjson1_deserializeOpErrorUpdateCustomVerificationEmailTemplate(response *smithyhttp.Response, metadata *middleware.Metadata) error { 10044 var errorBuffer bytes.Buffer 10045 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 10046 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 10047 } 10048 errorBody := bytes.NewReader(errorBuffer.Bytes()) 10049 10050 errorCode := "UnknownError" 10051 errorMessage := errorCode 10052 10053 code := response.Header.Get("X-Amzn-ErrorType") 10054 if len(code) != 0 { 10055 errorCode = restjson.SanitizeErrorCode(code) 10056 } 10057 10058 var buff [1024]byte 10059 ringBuffer := smithyio.NewRingBuffer(buff[:]) 10060 10061 body := io.TeeReader(errorBody, ringBuffer) 10062 decoder := json.NewDecoder(body) 10063 decoder.UseNumber() 10064 code, message, err := restjson.GetErrorInfo(decoder) 10065 if err != nil { 10066 var snapshot bytes.Buffer 10067 io.Copy(&snapshot, ringBuffer) 10068 err = &smithy.DeserializationError{ 10069 Err: fmt.Errorf("failed to decode response body, %w", err), 10070 Snapshot: snapshot.Bytes(), 10071 } 10072 return err 10073 } 10074 10075 errorBody.Seek(0, io.SeekStart) 10076 if len(code) != 0 { 10077 errorCode = restjson.SanitizeErrorCode(code) 10078 } 10079 if len(message) != 0 { 10080 errorMessage = message 10081 } 10082 10083 switch { 10084 case strings.EqualFold("BadRequestException", errorCode): 10085 return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) 10086 10087 case strings.EqualFold("NotFoundException", errorCode): 10088 return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) 10089 10090 case strings.EqualFold("TooManyRequestsException", errorCode): 10091 return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody) 10092 10093 default: 10094 genericError := &smithy.GenericAPIError{ 10095 Code: errorCode, 10096 Message: errorMessage, 10097 } 10098 return genericError 10099 10100 } 10101} 10102 10103type awsRestjson1_deserializeOpUpdateEmailIdentityPolicy struct { 10104} 10105 10106func (*awsRestjson1_deserializeOpUpdateEmailIdentityPolicy) ID() string { 10107 return "OperationDeserializer" 10108} 10109 10110func (m *awsRestjson1_deserializeOpUpdateEmailIdentityPolicy) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 10111 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 10112) { 10113 out, metadata, err = next.HandleDeserialize(ctx, in) 10114 if err != nil { 10115 return out, metadata, err 10116 } 10117 10118 response, ok := out.RawResponse.(*smithyhttp.Response) 10119 if !ok { 10120 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 10121 } 10122 10123 if response.StatusCode < 200 || response.StatusCode >= 300 { 10124 return out, metadata, awsRestjson1_deserializeOpErrorUpdateEmailIdentityPolicy(response, &metadata) 10125 } 10126 output := &UpdateEmailIdentityPolicyOutput{} 10127 out.Result = output 10128 10129 return out, metadata, err 10130} 10131 10132func awsRestjson1_deserializeOpErrorUpdateEmailIdentityPolicy(response *smithyhttp.Response, metadata *middleware.Metadata) error { 10133 var errorBuffer bytes.Buffer 10134 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 10135 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 10136 } 10137 errorBody := bytes.NewReader(errorBuffer.Bytes()) 10138 10139 errorCode := "UnknownError" 10140 errorMessage := errorCode 10141 10142 code := response.Header.Get("X-Amzn-ErrorType") 10143 if len(code) != 0 { 10144 errorCode = restjson.SanitizeErrorCode(code) 10145 } 10146 10147 var buff [1024]byte 10148 ringBuffer := smithyio.NewRingBuffer(buff[:]) 10149 10150 body := io.TeeReader(errorBody, ringBuffer) 10151 decoder := json.NewDecoder(body) 10152 decoder.UseNumber() 10153 code, message, err := restjson.GetErrorInfo(decoder) 10154 if err != nil { 10155 var snapshot bytes.Buffer 10156 io.Copy(&snapshot, ringBuffer) 10157 err = &smithy.DeserializationError{ 10158 Err: fmt.Errorf("failed to decode response body, %w", err), 10159 Snapshot: snapshot.Bytes(), 10160 } 10161 return err 10162 } 10163 10164 errorBody.Seek(0, io.SeekStart) 10165 if len(code) != 0 { 10166 errorCode = restjson.SanitizeErrorCode(code) 10167 } 10168 if len(message) != 0 { 10169 errorMessage = message 10170 } 10171 10172 switch { 10173 case strings.EqualFold("BadRequestException", errorCode): 10174 return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) 10175 10176 case strings.EqualFold("NotFoundException", errorCode): 10177 return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) 10178 10179 case strings.EqualFold("TooManyRequestsException", errorCode): 10180 return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody) 10181 10182 default: 10183 genericError := &smithy.GenericAPIError{ 10184 Code: errorCode, 10185 Message: errorMessage, 10186 } 10187 return genericError 10188 10189 } 10190} 10191 10192type awsRestjson1_deserializeOpUpdateEmailTemplate struct { 10193} 10194 10195func (*awsRestjson1_deserializeOpUpdateEmailTemplate) ID() string { 10196 return "OperationDeserializer" 10197} 10198 10199func (m *awsRestjson1_deserializeOpUpdateEmailTemplate) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( 10200 out middleware.DeserializeOutput, metadata middleware.Metadata, err error, 10201) { 10202 out, metadata, err = next.HandleDeserialize(ctx, in) 10203 if err != nil { 10204 return out, metadata, err 10205 } 10206 10207 response, ok := out.RawResponse.(*smithyhttp.Response) 10208 if !ok { 10209 return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} 10210 } 10211 10212 if response.StatusCode < 200 || response.StatusCode >= 300 { 10213 return out, metadata, awsRestjson1_deserializeOpErrorUpdateEmailTemplate(response, &metadata) 10214 } 10215 output := &UpdateEmailTemplateOutput{} 10216 out.Result = output 10217 10218 return out, metadata, err 10219} 10220 10221func awsRestjson1_deserializeOpErrorUpdateEmailTemplate(response *smithyhttp.Response, metadata *middleware.Metadata) error { 10222 var errorBuffer bytes.Buffer 10223 if _, err := io.Copy(&errorBuffer, response.Body); err != nil { 10224 return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} 10225 } 10226 errorBody := bytes.NewReader(errorBuffer.Bytes()) 10227 10228 errorCode := "UnknownError" 10229 errorMessage := errorCode 10230 10231 code := response.Header.Get("X-Amzn-ErrorType") 10232 if len(code) != 0 { 10233 errorCode = restjson.SanitizeErrorCode(code) 10234 } 10235 10236 var buff [1024]byte 10237 ringBuffer := smithyio.NewRingBuffer(buff[:]) 10238 10239 body := io.TeeReader(errorBody, ringBuffer) 10240 decoder := json.NewDecoder(body) 10241 decoder.UseNumber() 10242 code, message, err := restjson.GetErrorInfo(decoder) 10243 if err != nil { 10244 var snapshot bytes.Buffer 10245 io.Copy(&snapshot, ringBuffer) 10246 err = &smithy.DeserializationError{ 10247 Err: fmt.Errorf("failed to decode response body, %w", err), 10248 Snapshot: snapshot.Bytes(), 10249 } 10250 return err 10251 } 10252 10253 errorBody.Seek(0, io.SeekStart) 10254 if len(code) != 0 { 10255 errorCode = restjson.SanitizeErrorCode(code) 10256 } 10257 if len(message) != 0 { 10258 errorMessage = message 10259 } 10260 10261 switch { 10262 case strings.EqualFold("BadRequestException", errorCode): 10263 return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) 10264 10265 case strings.EqualFold("NotFoundException", errorCode): 10266 return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) 10267 10268 case strings.EqualFold("TooManyRequestsException", errorCode): 10269 return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody) 10270 10271 default: 10272 genericError := &smithy.GenericAPIError{ 10273 Code: errorCode, 10274 Message: errorMessage, 10275 } 10276 return genericError 10277 10278 } 10279} 10280 10281func awsRestjson1_deserializeErrorAccountSuspendedException(response *smithyhttp.Response, errorBody *bytes.Reader) error { 10282 output := &types.AccountSuspendedException{} 10283 var buff [1024]byte 10284 ringBuffer := smithyio.NewRingBuffer(buff[:]) 10285 10286 body := io.TeeReader(errorBody, ringBuffer) 10287 decoder := json.NewDecoder(body) 10288 decoder.UseNumber() 10289 var shape interface{} 10290 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 10291 var snapshot bytes.Buffer 10292 io.Copy(&snapshot, ringBuffer) 10293 err = &smithy.DeserializationError{ 10294 Err: fmt.Errorf("failed to decode response body, %w", err), 10295 Snapshot: snapshot.Bytes(), 10296 } 10297 return err 10298 } 10299 10300 err := awsRestjson1_deserializeDocumentAccountSuspendedException(&output, shape) 10301 10302 if err != nil { 10303 var snapshot bytes.Buffer 10304 io.Copy(&snapshot, ringBuffer) 10305 err = &smithy.DeserializationError{ 10306 Err: fmt.Errorf("failed to decode response body, %w", err), 10307 Snapshot: snapshot.Bytes(), 10308 } 10309 return err 10310 } 10311 10312 errorBody.Seek(0, io.SeekStart) 10313 10314 return output 10315} 10316 10317func awsRestjson1_deserializeErrorAlreadyExistsException(response *smithyhttp.Response, errorBody *bytes.Reader) error { 10318 output := &types.AlreadyExistsException{} 10319 var buff [1024]byte 10320 ringBuffer := smithyio.NewRingBuffer(buff[:]) 10321 10322 body := io.TeeReader(errorBody, ringBuffer) 10323 decoder := json.NewDecoder(body) 10324 decoder.UseNumber() 10325 var shape interface{} 10326 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 10327 var snapshot bytes.Buffer 10328 io.Copy(&snapshot, ringBuffer) 10329 err = &smithy.DeserializationError{ 10330 Err: fmt.Errorf("failed to decode response body, %w", err), 10331 Snapshot: snapshot.Bytes(), 10332 } 10333 return err 10334 } 10335 10336 err := awsRestjson1_deserializeDocumentAlreadyExistsException(&output, shape) 10337 10338 if err != nil { 10339 var snapshot bytes.Buffer 10340 io.Copy(&snapshot, ringBuffer) 10341 err = &smithy.DeserializationError{ 10342 Err: fmt.Errorf("failed to decode response body, %w", err), 10343 Snapshot: snapshot.Bytes(), 10344 } 10345 return err 10346 } 10347 10348 errorBody.Seek(0, io.SeekStart) 10349 10350 return output 10351} 10352 10353func awsRestjson1_deserializeErrorBadRequestException(response *smithyhttp.Response, errorBody *bytes.Reader) error { 10354 output := &types.BadRequestException{} 10355 var buff [1024]byte 10356 ringBuffer := smithyio.NewRingBuffer(buff[:]) 10357 10358 body := io.TeeReader(errorBody, ringBuffer) 10359 decoder := json.NewDecoder(body) 10360 decoder.UseNumber() 10361 var shape interface{} 10362 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 10363 var snapshot bytes.Buffer 10364 io.Copy(&snapshot, ringBuffer) 10365 err = &smithy.DeserializationError{ 10366 Err: fmt.Errorf("failed to decode response body, %w", err), 10367 Snapshot: snapshot.Bytes(), 10368 } 10369 return err 10370 } 10371 10372 err := awsRestjson1_deserializeDocumentBadRequestException(&output, shape) 10373 10374 if err != nil { 10375 var snapshot bytes.Buffer 10376 io.Copy(&snapshot, ringBuffer) 10377 err = &smithy.DeserializationError{ 10378 Err: fmt.Errorf("failed to decode response body, %w", err), 10379 Snapshot: snapshot.Bytes(), 10380 } 10381 return err 10382 } 10383 10384 errorBody.Seek(0, io.SeekStart) 10385 10386 return output 10387} 10388 10389func awsRestjson1_deserializeErrorConcurrentModificationException(response *smithyhttp.Response, errorBody *bytes.Reader) error { 10390 output := &types.ConcurrentModificationException{} 10391 var buff [1024]byte 10392 ringBuffer := smithyio.NewRingBuffer(buff[:]) 10393 10394 body := io.TeeReader(errorBody, ringBuffer) 10395 decoder := json.NewDecoder(body) 10396 decoder.UseNumber() 10397 var shape interface{} 10398 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 10399 var snapshot bytes.Buffer 10400 io.Copy(&snapshot, ringBuffer) 10401 err = &smithy.DeserializationError{ 10402 Err: fmt.Errorf("failed to decode response body, %w", err), 10403 Snapshot: snapshot.Bytes(), 10404 } 10405 return err 10406 } 10407 10408 err := awsRestjson1_deserializeDocumentConcurrentModificationException(&output, shape) 10409 10410 if err != nil { 10411 var snapshot bytes.Buffer 10412 io.Copy(&snapshot, ringBuffer) 10413 err = &smithy.DeserializationError{ 10414 Err: fmt.Errorf("failed to decode response body, %w", err), 10415 Snapshot: snapshot.Bytes(), 10416 } 10417 return err 10418 } 10419 10420 errorBody.Seek(0, io.SeekStart) 10421 10422 return output 10423} 10424 10425func awsRestjson1_deserializeErrorConflictException(response *smithyhttp.Response, errorBody *bytes.Reader) error { 10426 output := &types.ConflictException{} 10427 var buff [1024]byte 10428 ringBuffer := smithyio.NewRingBuffer(buff[:]) 10429 10430 body := io.TeeReader(errorBody, ringBuffer) 10431 decoder := json.NewDecoder(body) 10432 decoder.UseNumber() 10433 var shape interface{} 10434 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 10435 var snapshot bytes.Buffer 10436 io.Copy(&snapshot, ringBuffer) 10437 err = &smithy.DeserializationError{ 10438 Err: fmt.Errorf("failed to decode response body, %w", err), 10439 Snapshot: snapshot.Bytes(), 10440 } 10441 return err 10442 } 10443 10444 err := awsRestjson1_deserializeDocumentConflictException(&output, shape) 10445 10446 if err != nil { 10447 var snapshot bytes.Buffer 10448 io.Copy(&snapshot, ringBuffer) 10449 err = &smithy.DeserializationError{ 10450 Err: fmt.Errorf("failed to decode response body, %w", err), 10451 Snapshot: snapshot.Bytes(), 10452 } 10453 return err 10454 } 10455 10456 errorBody.Seek(0, io.SeekStart) 10457 10458 return output 10459} 10460 10461func awsRestjson1_deserializeErrorInvalidNextTokenException(response *smithyhttp.Response, errorBody *bytes.Reader) error { 10462 output := &types.InvalidNextTokenException{} 10463 var buff [1024]byte 10464 ringBuffer := smithyio.NewRingBuffer(buff[:]) 10465 10466 body := io.TeeReader(errorBody, ringBuffer) 10467 decoder := json.NewDecoder(body) 10468 decoder.UseNumber() 10469 var shape interface{} 10470 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 10471 var snapshot bytes.Buffer 10472 io.Copy(&snapshot, ringBuffer) 10473 err = &smithy.DeserializationError{ 10474 Err: fmt.Errorf("failed to decode response body, %w", err), 10475 Snapshot: snapshot.Bytes(), 10476 } 10477 return err 10478 } 10479 10480 err := awsRestjson1_deserializeDocumentInvalidNextTokenException(&output, shape) 10481 10482 if err != nil { 10483 var snapshot bytes.Buffer 10484 io.Copy(&snapshot, ringBuffer) 10485 err = &smithy.DeserializationError{ 10486 Err: fmt.Errorf("failed to decode response body, %w", err), 10487 Snapshot: snapshot.Bytes(), 10488 } 10489 return err 10490 } 10491 10492 errorBody.Seek(0, io.SeekStart) 10493 10494 return output 10495} 10496 10497func awsRestjson1_deserializeErrorLimitExceededException(response *smithyhttp.Response, errorBody *bytes.Reader) error { 10498 output := &types.LimitExceededException{} 10499 var buff [1024]byte 10500 ringBuffer := smithyio.NewRingBuffer(buff[:]) 10501 10502 body := io.TeeReader(errorBody, ringBuffer) 10503 decoder := json.NewDecoder(body) 10504 decoder.UseNumber() 10505 var shape interface{} 10506 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 10507 var snapshot bytes.Buffer 10508 io.Copy(&snapshot, ringBuffer) 10509 err = &smithy.DeserializationError{ 10510 Err: fmt.Errorf("failed to decode response body, %w", err), 10511 Snapshot: snapshot.Bytes(), 10512 } 10513 return err 10514 } 10515 10516 err := awsRestjson1_deserializeDocumentLimitExceededException(&output, shape) 10517 10518 if err != nil { 10519 var snapshot bytes.Buffer 10520 io.Copy(&snapshot, ringBuffer) 10521 err = &smithy.DeserializationError{ 10522 Err: fmt.Errorf("failed to decode response body, %w", err), 10523 Snapshot: snapshot.Bytes(), 10524 } 10525 return err 10526 } 10527 10528 errorBody.Seek(0, io.SeekStart) 10529 10530 return output 10531} 10532 10533func awsRestjson1_deserializeErrorMailFromDomainNotVerifiedException(response *smithyhttp.Response, errorBody *bytes.Reader) error { 10534 output := &types.MailFromDomainNotVerifiedException{} 10535 var buff [1024]byte 10536 ringBuffer := smithyio.NewRingBuffer(buff[:]) 10537 10538 body := io.TeeReader(errorBody, ringBuffer) 10539 decoder := json.NewDecoder(body) 10540 decoder.UseNumber() 10541 var shape interface{} 10542 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 10543 var snapshot bytes.Buffer 10544 io.Copy(&snapshot, ringBuffer) 10545 err = &smithy.DeserializationError{ 10546 Err: fmt.Errorf("failed to decode response body, %w", err), 10547 Snapshot: snapshot.Bytes(), 10548 } 10549 return err 10550 } 10551 10552 err := awsRestjson1_deserializeDocumentMailFromDomainNotVerifiedException(&output, shape) 10553 10554 if err != nil { 10555 var snapshot bytes.Buffer 10556 io.Copy(&snapshot, ringBuffer) 10557 err = &smithy.DeserializationError{ 10558 Err: fmt.Errorf("failed to decode response body, %w", err), 10559 Snapshot: snapshot.Bytes(), 10560 } 10561 return err 10562 } 10563 10564 errorBody.Seek(0, io.SeekStart) 10565 10566 return output 10567} 10568 10569func awsRestjson1_deserializeErrorMessageRejected(response *smithyhttp.Response, errorBody *bytes.Reader) error { 10570 output := &types.MessageRejected{} 10571 var buff [1024]byte 10572 ringBuffer := smithyio.NewRingBuffer(buff[:]) 10573 10574 body := io.TeeReader(errorBody, ringBuffer) 10575 decoder := json.NewDecoder(body) 10576 decoder.UseNumber() 10577 var shape interface{} 10578 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 10579 var snapshot bytes.Buffer 10580 io.Copy(&snapshot, ringBuffer) 10581 err = &smithy.DeserializationError{ 10582 Err: fmt.Errorf("failed to decode response body, %w", err), 10583 Snapshot: snapshot.Bytes(), 10584 } 10585 return err 10586 } 10587 10588 err := awsRestjson1_deserializeDocumentMessageRejected(&output, shape) 10589 10590 if err != nil { 10591 var snapshot bytes.Buffer 10592 io.Copy(&snapshot, ringBuffer) 10593 err = &smithy.DeserializationError{ 10594 Err: fmt.Errorf("failed to decode response body, %w", err), 10595 Snapshot: snapshot.Bytes(), 10596 } 10597 return err 10598 } 10599 10600 errorBody.Seek(0, io.SeekStart) 10601 10602 return output 10603} 10604 10605func awsRestjson1_deserializeErrorNotFoundException(response *smithyhttp.Response, errorBody *bytes.Reader) error { 10606 output := &types.NotFoundException{} 10607 var buff [1024]byte 10608 ringBuffer := smithyio.NewRingBuffer(buff[:]) 10609 10610 body := io.TeeReader(errorBody, ringBuffer) 10611 decoder := json.NewDecoder(body) 10612 decoder.UseNumber() 10613 var shape interface{} 10614 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 10615 var snapshot bytes.Buffer 10616 io.Copy(&snapshot, ringBuffer) 10617 err = &smithy.DeserializationError{ 10618 Err: fmt.Errorf("failed to decode response body, %w", err), 10619 Snapshot: snapshot.Bytes(), 10620 } 10621 return err 10622 } 10623 10624 err := awsRestjson1_deserializeDocumentNotFoundException(&output, shape) 10625 10626 if err != nil { 10627 var snapshot bytes.Buffer 10628 io.Copy(&snapshot, ringBuffer) 10629 err = &smithy.DeserializationError{ 10630 Err: fmt.Errorf("failed to decode response body, %w", err), 10631 Snapshot: snapshot.Bytes(), 10632 } 10633 return err 10634 } 10635 10636 errorBody.Seek(0, io.SeekStart) 10637 10638 return output 10639} 10640 10641func awsRestjson1_deserializeErrorSendingPausedException(response *smithyhttp.Response, errorBody *bytes.Reader) error { 10642 output := &types.SendingPausedException{} 10643 var buff [1024]byte 10644 ringBuffer := smithyio.NewRingBuffer(buff[:]) 10645 10646 body := io.TeeReader(errorBody, ringBuffer) 10647 decoder := json.NewDecoder(body) 10648 decoder.UseNumber() 10649 var shape interface{} 10650 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 10651 var snapshot bytes.Buffer 10652 io.Copy(&snapshot, ringBuffer) 10653 err = &smithy.DeserializationError{ 10654 Err: fmt.Errorf("failed to decode response body, %w", err), 10655 Snapshot: snapshot.Bytes(), 10656 } 10657 return err 10658 } 10659 10660 err := awsRestjson1_deserializeDocumentSendingPausedException(&output, shape) 10661 10662 if err != nil { 10663 var snapshot bytes.Buffer 10664 io.Copy(&snapshot, ringBuffer) 10665 err = &smithy.DeserializationError{ 10666 Err: fmt.Errorf("failed to decode response body, %w", err), 10667 Snapshot: snapshot.Bytes(), 10668 } 10669 return err 10670 } 10671 10672 errorBody.Seek(0, io.SeekStart) 10673 10674 return output 10675} 10676 10677func awsRestjson1_deserializeErrorTooManyRequestsException(response *smithyhttp.Response, errorBody *bytes.Reader) error { 10678 output := &types.TooManyRequestsException{} 10679 var buff [1024]byte 10680 ringBuffer := smithyio.NewRingBuffer(buff[:]) 10681 10682 body := io.TeeReader(errorBody, ringBuffer) 10683 decoder := json.NewDecoder(body) 10684 decoder.UseNumber() 10685 var shape interface{} 10686 if err := decoder.Decode(&shape); err != nil && err != io.EOF { 10687 var snapshot bytes.Buffer 10688 io.Copy(&snapshot, ringBuffer) 10689 err = &smithy.DeserializationError{ 10690 Err: fmt.Errorf("failed to decode response body, %w", err), 10691 Snapshot: snapshot.Bytes(), 10692 } 10693 return err 10694 } 10695 10696 err := awsRestjson1_deserializeDocumentTooManyRequestsException(&output, shape) 10697 10698 if err != nil { 10699 var snapshot bytes.Buffer 10700 io.Copy(&snapshot, ringBuffer) 10701 err = &smithy.DeserializationError{ 10702 Err: fmt.Errorf("failed to decode response body, %w", err), 10703 Snapshot: snapshot.Bytes(), 10704 } 10705 return err 10706 } 10707 10708 errorBody.Seek(0, io.SeekStart) 10709 10710 return output 10711} 10712 10713func awsRestjson1_deserializeDocumentAccountDetails(v **types.AccountDetails, value interface{}) error { 10714 if v == nil { 10715 return fmt.Errorf("unexpected nil of type %T", v) 10716 } 10717 if value == nil { 10718 return nil 10719 } 10720 10721 shape, ok := value.(map[string]interface{}) 10722 if !ok { 10723 return fmt.Errorf("unexpected JSON type %v", value) 10724 } 10725 10726 var sv *types.AccountDetails 10727 if *v == nil { 10728 sv = &types.AccountDetails{} 10729 } else { 10730 sv = *v 10731 } 10732 10733 for key, value := range shape { 10734 switch key { 10735 case "AdditionalContactEmailAddresses": 10736 if err := awsRestjson1_deserializeDocumentAdditionalContactEmailAddresses(&sv.AdditionalContactEmailAddresses, value); err != nil { 10737 return err 10738 } 10739 10740 case "ContactLanguage": 10741 if value != nil { 10742 jtv, ok := value.(string) 10743 if !ok { 10744 return fmt.Errorf("expected ContactLanguage to be of type string, got %T instead", value) 10745 } 10746 sv.ContactLanguage = types.ContactLanguage(jtv) 10747 } 10748 10749 case "MailType": 10750 if value != nil { 10751 jtv, ok := value.(string) 10752 if !ok { 10753 return fmt.Errorf("expected MailType to be of type string, got %T instead", value) 10754 } 10755 sv.MailType = types.MailType(jtv) 10756 } 10757 10758 case "ReviewDetails": 10759 if err := awsRestjson1_deserializeDocumentReviewDetails(&sv.ReviewDetails, value); err != nil { 10760 return err 10761 } 10762 10763 case "UseCaseDescription": 10764 if value != nil { 10765 jtv, ok := value.(string) 10766 if !ok { 10767 return fmt.Errorf("expected UseCaseDescription to be of type string, got %T instead", value) 10768 } 10769 sv.UseCaseDescription = ptr.String(jtv) 10770 } 10771 10772 case "WebsiteURL": 10773 if value != nil { 10774 jtv, ok := value.(string) 10775 if !ok { 10776 return fmt.Errorf("expected WebsiteURL to be of type string, got %T instead", value) 10777 } 10778 sv.WebsiteURL = ptr.String(jtv) 10779 } 10780 10781 default: 10782 _, _ = key, value 10783 10784 } 10785 } 10786 *v = sv 10787 return nil 10788} 10789 10790func awsRestjson1_deserializeDocumentAccountSuspendedException(v **types.AccountSuspendedException, value interface{}) error { 10791 if v == nil { 10792 return fmt.Errorf("unexpected nil of type %T", v) 10793 } 10794 if value == nil { 10795 return nil 10796 } 10797 10798 shape, ok := value.(map[string]interface{}) 10799 if !ok { 10800 return fmt.Errorf("unexpected JSON type %v", value) 10801 } 10802 10803 var sv *types.AccountSuspendedException 10804 if *v == nil { 10805 sv = &types.AccountSuspendedException{} 10806 } else { 10807 sv = *v 10808 } 10809 10810 for key, value := range shape { 10811 switch key { 10812 case "message": 10813 if value != nil { 10814 jtv, ok := value.(string) 10815 if !ok { 10816 return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) 10817 } 10818 sv.Message = ptr.String(jtv) 10819 } 10820 10821 default: 10822 _, _ = key, value 10823 10824 } 10825 } 10826 *v = sv 10827 return nil 10828} 10829 10830func awsRestjson1_deserializeDocumentAdditionalContactEmailAddresses(v *[]string, value interface{}) error { 10831 if v == nil { 10832 return fmt.Errorf("unexpected nil of type %T", v) 10833 } 10834 if value == nil { 10835 return nil 10836 } 10837 10838 shape, ok := value.([]interface{}) 10839 if !ok { 10840 return fmt.Errorf("unexpected JSON type %v", value) 10841 } 10842 10843 var cv []string 10844 if *v == nil { 10845 cv = []string{} 10846 } else { 10847 cv = *v 10848 } 10849 10850 for _, value := range shape { 10851 var col string 10852 if value != nil { 10853 jtv, ok := value.(string) 10854 if !ok { 10855 return fmt.Errorf("expected AdditionalContactEmailAddress to be of type string, got %T instead", value) 10856 } 10857 col = jtv 10858 } 10859 cv = append(cv, col) 10860 10861 } 10862 *v = cv 10863 return nil 10864} 10865 10866func awsRestjson1_deserializeDocumentAlreadyExistsException(v **types.AlreadyExistsException, value interface{}) error { 10867 if v == nil { 10868 return fmt.Errorf("unexpected nil of type %T", v) 10869 } 10870 if value == nil { 10871 return nil 10872 } 10873 10874 shape, ok := value.(map[string]interface{}) 10875 if !ok { 10876 return fmt.Errorf("unexpected JSON type %v", value) 10877 } 10878 10879 var sv *types.AlreadyExistsException 10880 if *v == nil { 10881 sv = &types.AlreadyExistsException{} 10882 } else { 10883 sv = *v 10884 } 10885 10886 for key, value := range shape { 10887 switch key { 10888 case "message": 10889 if value != nil { 10890 jtv, ok := value.(string) 10891 if !ok { 10892 return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) 10893 } 10894 sv.Message = ptr.String(jtv) 10895 } 10896 10897 default: 10898 _, _ = key, value 10899 10900 } 10901 } 10902 *v = sv 10903 return nil 10904} 10905 10906func awsRestjson1_deserializeDocumentBadRequestException(v **types.BadRequestException, value interface{}) error { 10907 if v == nil { 10908 return fmt.Errorf("unexpected nil of type %T", v) 10909 } 10910 if value == nil { 10911 return nil 10912 } 10913 10914 shape, ok := value.(map[string]interface{}) 10915 if !ok { 10916 return fmt.Errorf("unexpected JSON type %v", value) 10917 } 10918 10919 var sv *types.BadRequestException 10920 if *v == nil { 10921 sv = &types.BadRequestException{} 10922 } else { 10923 sv = *v 10924 } 10925 10926 for key, value := range shape { 10927 switch key { 10928 case "message": 10929 if value != nil { 10930 jtv, ok := value.(string) 10931 if !ok { 10932 return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) 10933 } 10934 sv.Message = ptr.String(jtv) 10935 } 10936 10937 default: 10938 _, _ = key, value 10939 10940 } 10941 } 10942 *v = sv 10943 return nil 10944} 10945 10946func awsRestjson1_deserializeDocumentBlacklistEntries(v *[]types.BlacklistEntry, value interface{}) error { 10947 if v == nil { 10948 return fmt.Errorf("unexpected nil of type %T", v) 10949 } 10950 if value == nil { 10951 return nil 10952 } 10953 10954 shape, ok := value.([]interface{}) 10955 if !ok { 10956 return fmt.Errorf("unexpected JSON type %v", value) 10957 } 10958 10959 var cv []types.BlacklistEntry 10960 if *v == nil { 10961 cv = []types.BlacklistEntry{} 10962 } else { 10963 cv = *v 10964 } 10965 10966 for _, value := range shape { 10967 var col types.BlacklistEntry 10968 destAddr := &col 10969 if err := awsRestjson1_deserializeDocumentBlacklistEntry(&destAddr, value); err != nil { 10970 return err 10971 } 10972 col = *destAddr 10973 cv = append(cv, col) 10974 10975 } 10976 *v = cv 10977 return nil 10978} 10979 10980func awsRestjson1_deserializeDocumentBlacklistEntry(v **types.BlacklistEntry, value interface{}) error { 10981 if v == nil { 10982 return fmt.Errorf("unexpected nil of type %T", v) 10983 } 10984 if value == nil { 10985 return nil 10986 } 10987 10988 shape, ok := value.(map[string]interface{}) 10989 if !ok { 10990 return fmt.Errorf("unexpected JSON type %v", value) 10991 } 10992 10993 var sv *types.BlacklistEntry 10994 if *v == nil { 10995 sv = &types.BlacklistEntry{} 10996 } else { 10997 sv = *v 10998 } 10999 11000 for key, value := range shape { 11001 switch key { 11002 case "Description": 11003 if value != nil { 11004 jtv, ok := value.(string) 11005 if !ok { 11006 return fmt.Errorf("expected BlacklistingDescription to be of type string, got %T instead", value) 11007 } 11008 sv.Description = ptr.String(jtv) 11009 } 11010 11011 case "ListingTime": 11012 if value != nil { 11013 jtv, ok := value.(json.Number) 11014 if !ok { 11015 return fmt.Errorf("expected Timestamp to be json.Number, got %T instead", value) 11016 } 11017 f64, err := jtv.Float64() 11018 if err != nil { 11019 return err 11020 } 11021 sv.ListingTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) 11022 } 11023 11024 case "RblName": 11025 if value != nil { 11026 jtv, ok := value.(string) 11027 if !ok { 11028 return fmt.Errorf("expected RblName to be of type string, got %T instead", value) 11029 } 11030 sv.RblName = ptr.String(jtv) 11031 } 11032 11033 default: 11034 _, _ = key, value 11035 11036 } 11037 } 11038 *v = sv 11039 return nil 11040} 11041 11042func awsRestjson1_deserializeDocumentBlacklistReport(v *map[string][]types.BlacklistEntry, value interface{}) error { 11043 if v == nil { 11044 return fmt.Errorf("unexpected nil of type %T", v) 11045 } 11046 if value == nil { 11047 return nil 11048 } 11049 11050 shape, ok := value.(map[string]interface{}) 11051 if !ok { 11052 return fmt.Errorf("unexpected JSON type %v", value) 11053 } 11054 11055 var mv map[string][]types.BlacklistEntry 11056 if *v == nil { 11057 mv = map[string][]types.BlacklistEntry{} 11058 } else { 11059 mv = *v 11060 } 11061 11062 for key, value := range shape { 11063 var parsedVal []types.BlacklistEntry 11064 mapVar := parsedVal 11065 if err := awsRestjson1_deserializeDocumentBlacklistEntries(&mapVar, value); err != nil { 11066 return err 11067 } 11068 parsedVal = mapVar 11069 mv[key] = parsedVal 11070 11071 } 11072 *v = mv 11073 return nil 11074} 11075 11076func awsRestjson1_deserializeDocumentBulkEmailEntryResult(v **types.BulkEmailEntryResult, value interface{}) error { 11077 if v == nil { 11078 return fmt.Errorf("unexpected nil of type %T", v) 11079 } 11080 if value == nil { 11081 return nil 11082 } 11083 11084 shape, ok := value.(map[string]interface{}) 11085 if !ok { 11086 return fmt.Errorf("unexpected JSON type %v", value) 11087 } 11088 11089 var sv *types.BulkEmailEntryResult 11090 if *v == nil { 11091 sv = &types.BulkEmailEntryResult{} 11092 } else { 11093 sv = *v 11094 } 11095 11096 for key, value := range shape { 11097 switch key { 11098 case "Error": 11099 if value != nil { 11100 jtv, ok := value.(string) 11101 if !ok { 11102 return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) 11103 } 11104 sv.Error = ptr.String(jtv) 11105 } 11106 11107 case "MessageId": 11108 if value != nil { 11109 jtv, ok := value.(string) 11110 if !ok { 11111 return fmt.Errorf("expected OutboundMessageId to be of type string, got %T instead", value) 11112 } 11113 sv.MessageId = ptr.String(jtv) 11114 } 11115 11116 case "Status": 11117 if value != nil { 11118 jtv, ok := value.(string) 11119 if !ok { 11120 return fmt.Errorf("expected BulkEmailStatus to be of type string, got %T instead", value) 11121 } 11122 sv.Status = types.BulkEmailStatus(jtv) 11123 } 11124 11125 default: 11126 _, _ = key, value 11127 11128 } 11129 } 11130 *v = sv 11131 return nil 11132} 11133 11134func awsRestjson1_deserializeDocumentBulkEmailEntryResultList(v *[]types.BulkEmailEntryResult, value interface{}) error { 11135 if v == nil { 11136 return fmt.Errorf("unexpected nil of type %T", v) 11137 } 11138 if value == nil { 11139 return nil 11140 } 11141 11142 shape, ok := value.([]interface{}) 11143 if !ok { 11144 return fmt.Errorf("unexpected JSON type %v", value) 11145 } 11146 11147 var cv []types.BulkEmailEntryResult 11148 if *v == nil { 11149 cv = []types.BulkEmailEntryResult{} 11150 } else { 11151 cv = *v 11152 } 11153 11154 for _, value := range shape { 11155 var col types.BulkEmailEntryResult 11156 destAddr := &col 11157 if err := awsRestjson1_deserializeDocumentBulkEmailEntryResult(&destAddr, value); err != nil { 11158 return err 11159 } 11160 col = *destAddr 11161 cv = append(cv, col) 11162 11163 } 11164 *v = cv 11165 return nil 11166} 11167 11168func awsRestjson1_deserializeDocumentCloudWatchDestination(v **types.CloudWatchDestination, value interface{}) error { 11169 if v == nil { 11170 return fmt.Errorf("unexpected nil of type %T", v) 11171 } 11172 if value == nil { 11173 return nil 11174 } 11175 11176 shape, ok := value.(map[string]interface{}) 11177 if !ok { 11178 return fmt.Errorf("unexpected JSON type %v", value) 11179 } 11180 11181 var sv *types.CloudWatchDestination 11182 if *v == nil { 11183 sv = &types.CloudWatchDestination{} 11184 } else { 11185 sv = *v 11186 } 11187 11188 for key, value := range shape { 11189 switch key { 11190 case "DimensionConfigurations": 11191 if err := awsRestjson1_deserializeDocumentCloudWatchDimensionConfigurations(&sv.DimensionConfigurations, value); err != nil { 11192 return err 11193 } 11194 11195 default: 11196 _, _ = key, value 11197 11198 } 11199 } 11200 *v = sv 11201 return nil 11202} 11203 11204func awsRestjson1_deserializeDocumentCloudWatchDimensionConfiguration(v **types.CloudWatchDimensionConfiguration, value interface{}) error { 11205 if v == nil { 11206 return fmt.Errorf("unexpected nil of type %T", v) 11207 } 11208 if value == nil { 11209 return nil 11210 } 11211 11212 shape, ok := value.(map[string]interface{}) 11213 if !ok { 11214 return fmt.Errorf("unexpected JSON type %v", value) 11215 } 11216 11217 var sv *types.CloudWatchDimensionConfiguration 11218 if *v == nil { 11219 sv = &types.CloudWatchDimensionConfiguration{} 11220 } else { 11221 sv = *v 11222 } 11223 11224 for key, value := range shape { 11225 switch key { 11226 case "DefaultDimensionValue": 11227 if value != nil { 11228 jtv, ok := value.(string) 11229 if !ok { 11230 return fmt.Errorf("expected DefaultDimensionValue to be of type string, got %T instead", value) 11231 } 11232 sv.DefaultDimensionValue = ptr.String(jtv) 11233 } 11234 11235 case "DimensionName": 11236 if value != nil { 11237 jtv, ok := value.(string) 11238 if !ok { 11239 return fmt.Errorf("expected DimensionName to be of type string, got %T instead", value) 11240 } 11241 sv.DimensionName = ptr.String(jtv) 11242 } 11243 11244 case "DimensionValueSource": 11245 if value != nil { 11246 jtv, ok := value.(string) 11247 if !ok { 11248 return fmt.Errorf("expected DimensionValueSource to be of type string, got %T instead", value) 11249 } 11250 sv.DimensionValueSource = types.DimensionValueSource(jtv) 11251 } 11252 11253 default: 11254 _, _ = key, value 11255 11256 } 11257 } 11258 *v = sv 11259 return nil 11260} 11261 11262func awsRestjson1_deserializeDocumentCloudWatchDimensionConfigurations(v *[]types.CloudWatchDimensionConfiguration, value interface{}) error { 11263 if v == nil { 11264 return fmt.Errorf("unexpected nil of type %T", v) 11265 } 11266 if value == nil { 11267 return nil 11268 } 11269 11270 shape, ok := value.([]interface{}) 11271 if !ok { 11272 return fmt.Errorf("unexpected JSON type %v", value) 11273 } 11274 11275 var cv []types.CloudWatchDimensionConfiguration 11276 if *v == nil { 11277 cv = []types.CloudWatchDimensionConfiguration{} 11278 } else { 11279 cv = *v 11280 } 11281 11282 for _, value := range shape { 11283 var col types.CloudWatchDimensionConfiguration 11284 destAddr := &col 11285 if err := awsRestjson1_deserializeDocumentCloudWatchDimensionConfiguration(&destAddr, value); err != nil { 11286 return err 11287 } 11288 col = *destAddr 11289 cv = append(cv, col) 11290 11291 } 11292 *v = cv 11293 return nil 11294} 11295 11296func awsRestjson1_deserializeDocumentConcurrentModificationException(v **types.ConcurrentModificationException, value interface{}) error { 11297 if v == nil { 11298 return fmt.Errorf("unexpected nil of type %T", v) 11299 } 11300 if value == nil { 11301 return nil 11302 } 11303 11304 shape, ok := value.(map[string]interface{}) 11305 if !ok { 11306 return fmt.Errorf("unexpected JSON type %v", value) 11307 } 11308 11309 var sv *types.ConcurrentModificationException 11310 if *v == nil { 11311 sv = &types.ConcurrentModificationException{} 11312 } else { 11313 sv = *v 11314 } 11315 11316 for key, value := range shape { 11317 switch key { 11318 case "message": 11319 if value != nil { 11320 jtv, ok := value.(string) 11321 if !ok { 11322 return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) 11323 } 11324 sv.Message = ptr.String(jtv) 11325 } 11326 11327 default: 11328 _, _ = key, value 11329 11330 } 11331 } 11332 *v = sv 11333 return nil 11334} 11335 11336func awsRestjson1_deserializeDocumentConfigurationSetNameList(v *[]string, value interface{}) error { 11337 if v == nil { 11338 return fmt.Errorf("unexpected nil of type %T", v) 11339 } 11340 if value == nil { 11341 return nil 11342 } 11343 11344 shape, ok := value.([]interface{}) 11345 if !ok { 11346 return fmt.Errorf("unexpected JSON type %v", value) 11347 } 11348 11349 var cv []string 11350 if *v == nil { 11351 cv = []string{} 11352 } else { 11353 cv = *v 11354 } 11355 11356 for _, value := range shape { 11357 var col string 11358 if value != nil { 11359 jtv, ok := value.(string) 11360 if !ok { 11361 return fmt.Errorf("expected ConfigurationSetName to be of type string, got %T instead", value) 11362 } 11363 col = jtv 11364 } 11365 cv = append(cv, col) 11366 11367 } 11368 *v = cv 11369 return nil 11370} 11371 11372func awsRestjson1_deserializeDocumentConflictException(v **types.ConflictException, value interface{}) error { 11373 if v == nil { 11374 return fmt.Errorf("unexpected nil of type %T", v) 11375 } 11376 if value == nil { 11377 return nil 11378 } 11379 11380 shape, ok := value.(map[string]interface{}) 11381 if !ok { 11382 return fmt.Errorf("unexpected JSON type %v", value) 11383 } 11384 11385 var sv *types.ConflictException 11386 if *v == nil { 11387 sv = &types.ConflictException{} 11388 } else { 11389 sv = *v 11390 } 11391 11392 for key, value := range shape { 11393 switch key { 11394 case "message": 11395 if value != nil { 11396 jtv, ok := value.(string) 11397 if !ok { 11398 return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) 11399 } 11400 sv.Message = ptr.String(jtv) 11401 } 11402 11403 default: 11404 _, _ = key, value 11405 11406 } 11407 } 11408 *v = sv 11409 return nil 11410} 11411 11412func awsRestjson1_deserializeDocumentContact(v **types.Contact, value interface{}) error { 11413 if v == nil { 11414 return fmt.Errorf("unexpected nil of type %T", v) 11415 } 11416 if value == nil { 11417 return nil 11418 } 11419 11420 shape, ok := value.(map[string]interface{}) 11421 if !ok { 11422 return fmt.Errorf("unexpected JSON type %v", value) 11423 } 11424 11425 var sv *types.Contact 11426 if *v == nil { 11427 sv = &types.Contact{} 11428 } else { 11429 sv = *v 11430 } 11431 11432 for key, value := range shape { 11433 switch key { 11434 case "EmailAddress": 11435 if value != nil { 11436 jtv, ok := value.(string) 11437 if !ok { 11438 return fmt.Errorf("expected EmailAddress to be of type string, got %T instead", value) 11439 } 11440 sv.EmailAddress = ptr.String(jtv) 11441 } 11442 11443 case "LastUpdatedTimestamp": 11444 if value != nil { 11445 jtv, ok := value.(json.Number) 11446 if !ok { 11447 return fmt.Errorf("expected Timestamp to be json.Number, got %T instead", value) 11448 } 11449 f64, err := jtv.Float64() 11450 if err != nil { 11451 return err 11452 } 11453 sv.LastUpdatedTimestamp = ptr.Time(smithytime.ParseEpochSeconds(f64)) 11454 } 11455 11456 case "TopicDefaultPreferences": 11457 if err := awsRestjson1_deserializeDocumentTopicPreferenceList(&sv.TopicDefaultPreferences, value); err != nil { 11458 return err 11459 } 11460 11461 case "TopicPreferences": 11462 if err := awsRestjson1_deserializeDocumentTopicPreferenceList(&sv.TopicPreferences, value); err != nil { 11463 return err 11464 } 11465 11466 case "UnsubscribeAll": 11467 if value != nil { 11468 jtv, ok := value.(bool) 11469 if !ok { 11470 return fmt.Errorf("expected UnsubscribeAll to be of type *bool, got %T instead", value) 11471 } 11472 sv.UnsubscribeAll = jtv 11473 } 11474 11475 default: 11476 _, _ = key, value 11477 11478 } 11479 } 11480 *v = sv 11481 return nil 11482} 11483 11484func awsRestjson1_deserializeDocumentContactList(v **types.ContactList, value interface{}) error { 11485 if v == nil { 11486 return fmt.Errorf("unexpected nil of type %T", v) 11487 } 11488 if value == nil { 11489 return nil 11490 } 11491 11492 shape, ok := value.(map[string]interface{}) 11493 if !ok { 11494 return fmt.Errorf("unexpected JSON type %v", value) 11495 } 11496 11497 var sv *types.ContactList 11498 if *v == nil { 11499 sv = &types.ContactList{} 11500 } else { 11501 sv = *v 11502 } 11503 11504 for key, value := range shape { 11505 switch key { 11506 case "ContactListName": 11507 if value != nil { 11508 jtv, ok := value.(string) 11509 if !ok { 11510 return fmt.Errorf("expected ContactListName to be of type string, got %T instead", value) 11511 } 11512 sv.ContactListName = ptr.String(jtv) 11513 } 11514 11515 case "LastUpdatedTimestamp": 11516 if value != nil { 11517 jtv, ok := value.(json.Number) 11518 if !ok { 11519 return fmt.Errorf("expected Timestamp to be json.Number, got %T instead", value) 11520 } 11521 f64, err := jtv.Float64() 11522 if err != nil { 11523 return err 11524 } 11525 sv.LastUpdatedTimestamp = ptr.Time(smithytime.ParseEpochSeconds(f64)) 11526 } 11527 11528 default: 11529 _, _ = key, value 11530 11531 } 11532 } 11533 *v = sv 11534 return nil 11535} 11536 11537func awsRestjson1_deserializeDocumentContactListDestination(v **types.ContactListDestination, value interface{}) error { 11538 if v == nil { 11539 return fmt.Errorf("unexpected nil of type %T", v) 11540 } 11541 if value == nil { 11542 return nil 11543 } 11544 11545 shape, ok := value.(map[string]interface{}) 11546 if !ok { 11547 return fmt.Errorf("unexpected JSON type %v", value) 11548 } 11549 11550 var sv *types.ContactListDestination 11551 if *v == nil { 11552 sv = &types.ContactListDestination{} 11553 } else { 11554 sv = *v 11555 } 11556 11557 for key, value := range shape { 11558 switch key { 11559 case "ContactListImportAction": 11560 if value != nil { 11561 jtv, ok := value.(string) 11562 if !ok { 11563 return fmt.Errorf("expected ContactListImportAction to be of type string, got %T instead", value) 11564 } 11565 sv.ContactListImportAction = types.ContactListImportAction(jtv) 11566 } 11567 11568 case "ContactListName": 11569 if value != nil { 11570 jtv, ok := value.(string) 11571 if !ok { 11572 return fmt.Errorf("expected ContactListName to be of type string, got %T instead", value) 11573 } 11574 sv.ContactListName = ptr.String(jtv) 11575 } 11576 11577 default: 11578 _, _ = key, value 11579 11580 } 11581 } 11582 *v = sv 11583 return nil 11584} 11585 11586func awsRestjson1_deserializeDocumentCustomVerificationEmailTemplateMetadata(v **types.CustomVerificationEmailTemplateMetadata, value interface{}) error { 11587 if v == nil { 11588 return fmt.Errorf("unexpected nil of type %T", v) 11589 } 11590 if value == nil { 11591 return nil 11592 } 11593 11594 shape, ok := value.(map[string]interface{}) 11595 if !ok { 11596 return fmt.Errorf("unexpected JSON type %v", value) 11597 } 11598 11599 var sv *types.CustomVerificationEmailTemplateMetadata 11600 if *v == nil { 11601 sv = &types.CustomVerificationEmailTemplateMetadata{} 11602 } else { 11603 sv = *v 11604 } 11605 11606 for key, value := range shape { 11607 switch key { 11608 case "FailureRedirectionURL": 11609 if value != nil { 11610 jtv, ok := value.(string) 11611 if !ok { 11612 return fmt.Errorf("expected FailureRedirectionURL to be of type string, got %T instead", value) 11613 } 11614 sv.FailureRedirectionURL = ptr.String(jtv) 11615 } 11616 11617 case "FromEmailAddress": 11618 if value != nil { 11619 jtv, ok := value.(string) 11620 if !ok { 11621 return fmt.Errorf("expected EmailAddress to be of type string, got %T instead", value) 11622 } 11623 sv.FromEmailAddress = ptr.String(jtv) 11624 } 11625 11626 case "SuccessRedirectionURL": 11627 if value != nil { 11628 jtv, ok := value.(string) 11629 if !ok { 11630 return fmt.Errorf("expected SuccessRedirectionURL to be of type string, got %T instead", value) 11631 } 11632 sv.SuccessRedirectionURL = ptr.String(jtv) 11633 } 11634 11635 case "TemplateName": 11636 if value != nil { 11637 jtv, ok := value.(string) 11638 if !ok { 11639 return fmt.Errorf("expected EmailTemplateName to be of type string, got %T instead", value) 11640 } 11641 sv.TemplateName = ptr.String(jtv) 11642 } 11643 11644 case "TemplateSubject": 11645 if value != nil { 11646 jtv, ok := value.(string) 11647 if !ok { 11648 return fmt.Errorf("expected EmailTemplateSubject to be of type string, got %T instead", value) 11649 } 11650 sv.TemplateSubject = ptr.String(jtv) 11651 } 11652 11653 default: 11654 _, _ = key, value 11655 11656 } 11657 } 11658 *v = sv 11659 return nil 11660} 11661 11662func awsRestjson1_deserializeDocumentCustomVerificationEmailTemplatesList(v *[]types.CustomVerificationEmailTemplateMetadata, value interface{}) error { 11663 if v == nil { 11664 return fmt.Errorf("unexpected nil of type %T", v) 11665 } 11666 if value == nil { 11667 return nil 11668 } 11669 11670 shape, ok := value.([]interface{}) 11671 if !ok { 11672 return fmt.Errorf("unexpected JSON type %v", value) 11673 } 11674 11675 var cv []types.CustomVerificationEmailTemplateMetadata 11676 if *v == nil { 11677 cv = []types.CustomVerificationEmailTemplateMetadata{} 11678 } else { 11679 cv = *v 11680 } 11681 11682 for _, value := range shape { 11683 var col types.CustomVerificationEmailTemplateMetadata 11684 destAddr := &col 11685 if err := awsRestjson1_deserializeDocumentCustomVerificationEmailTemplateMetadata(&destAddr, value); err != nil { 11686 return err 11687 } 11688 col = *destAddr 11689 cv = append(cv, col) 11690 11691 } 11692 *v = cv 11693 return nil 11694} 11695 11696func awsRestjson1_deserializeDocumentDailyVolume(v **types.DailyVolume, value interface{}) error { 11697 if v == nil { 11698 return fmt.Errorf("unexpected nil of type %T", v) 11699 } 11700 if value == nil { 11701 return nil 11702 } 11703 11704 shape, ok := value.(map[string]interface{}) 11705 if !ok { 11706 return fmt.Errorf("unexpected JSON type %v", value) 11707 } 11708 11709 var sv *types.DailyVolume 11710 if *v == nil { 11711 sv = &types.DailyVolume{} 11712 } else { 11713 sv = *v 11714 } 11715 11716 for key, value := range shape { 11717 switch key { 11718 case "DomainIspPlacements": 11719 if err := awsRestjson1_deserializeDocumentDomainIspPlacements(&sv.DomainIspPlacements, value); err != nil { 11720 return err 11721 } 11722 11723 case "StartDate": 11724 if value != nil { 11725 jtv, ok := value.(json.Number) 11726 if !ok { 11727 return fmt.Errorf("expected Timestamp to be json.Number, got %T instead", value) 11728 } 11729 f64, err := jtv.Float64() 11730 if err != nil { 11731 return err 11732 } 11733 sv.StartDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) 11734 } 11735 11736 case "VolumeStatistics": 11737 if err := awsRestjson1_deserializeDocumentVolumeStatistics(&sv.VolumeStatistics, value); err != nil { 11738 return err 11739 } 11740 11741 default: 11742 _, _ = key, value 11743 11744 } 11745 } 11746 *v = sv 11747 return nil 11748} 11749 11750func awsRestjson1_deserializeDocumentDailyVolumes(v *[]types.DailyVolume, value interface{}) error { 11751 if v == nil { 11752 return fmt.Errorf("unexpected nil of type %T", v) 11753 } 11754 if value == nil { 11755 return nil 11756 } 11757 11758 shape, ok := value.([]interface{}) 11759 if !ok { 11760 return fmt.Errorf("unexpected JSON type %v", value) 11761 } 11762 11763 var cv []types.DailyVolume 11764 if *v == nil { 11765 cv = []types.DailyVolume{} 11766 } else { 11767 cv = *v 11768 } 11769 11770 for _, value := range shape { 11771 var col types.DailyVolume 11772 destAddr := &col 11773 if err := awsRestjson1_deserializeDocumentDailyVolume(&destAddr, value); err != nil { 11774 return err 11775 } 11776 col = *destAddr 11777 cv = append(cv, col) 11778 11779 } 11780 *v = cv 11781 return nil 11782} 11783 11784func awsRestjson1_deserializeDocumentDedicatedIp(v **types.DedicatedIp, value interface{}) error { 11785 if v == nil { 11786 return fmt.Errorf("unexpected nil of type %T", v) 11787 } 11788 if value == nil { 11789 return nil 11790 } 11791 11792 shape, ok := value.(map[string]interface{}) 11793 if !ok { 11794 return fmt.Errorf("unexpected JSON type %v", value) 11795 } 11796 11797 var sv *types.DedicatedIp 11798 if *v == nil { 11799 sv = &types.DedicatedIp{} 11800 } else { 11801 sv = *v 11802 } 11803 11804 for key, value := range shape { 11805 switch key { 11806 case "Ip": 11807 if value != nil { 11808 jtv, ok := value.(string) 11809 if !ok { 11810 return fmt.Errorf("expected Ip to be of type string, got %T instead", value) 11811 } 11812 sv.Ip = ptr.String(jtv) 11813 } 11814 11815 case "PoolName": 11816 if value != nil { 11817 jtv, ok := value.(string) 11818 if !ok { 11819 return fmt.Errorf("expected PoolName to be of type string, got %T instead", value) 11820 } 11821 sv.PoolName = ptr.String(jtv) 11822 } 11823 11824 case "WarmupPercentage": 11825 if value != nil { 11826 jtv, ok := value.(json.Number) 11827 if !ok { 11828 return fmt.Errorf("expected Percentage100Wrapper to be json.Number, got %T instead", value) 11829 } 11830 i64, err := jtv.Int64() 11831 if err != nil { 11832 return err 11833 } 11834 sv.WarmupPercentage = ptr.Int32(int32(i64)) 11835 } 11836 11837 case "WarmupStatus": 11838 if value != nil { 11839 jtv, ok := value.(string) 11840 if !ok { 11841 return fmt.Errorf("expected WarmupStatus to be of type string, got %T instead", value) 11842 } 11843 sv.WarmupStatus = types.WarmupStatus(jtv) 11844 } 11845 11846 default: 11847 _, _ = key, value 11848 11849 } 11850 } 11851 *v = sv 11852 return nil 11853} 11854 11855func awsRestjson1_deserializeDocumentDedicatedIpList(v *[]types.DedicatedIp, value interface{}) error { 11856 if v == nil { 11857 return fmt.Errorf("unexpected nil of type %T", v) 11858 } 11859 if value == nil { 11860 return nil 11861 } 11862 11863 shape, ok := value.([]interface{}) 11864 if !ok { 11865 return fmt.Errorf("unexpected JSON type %v", value) 11866 } 11867 11868 var cv []types.DedicatedIp 11869 if *v == nil { 11870 cv = []types.DedicatedIp{} 11871 } else { 11872 cv = *v 11873 } 11874 11875 for _, value := range shape { 11876 var col types.DedicatedIp 11877 destAddr := &col 11878 if err := awsRestjson1_deserializeDocumentDedicatedIp(&destAddr, value); err != nil { 11879 return err 11880 } 11881 col = *destAddr 11882 cv = append(cv, col) 11883 11884 } 11885 *v = cv 11886 return nil 11887} 11888 11889func awsRestjson1_deserializeDocumentDeliverabilityTestReport(v **types.DeliverabilityTestReport, value interface{}) error { 11890 if v == nil { 11891 return fmt.Errorf("unexpected nil of type %T", v) 11892 } 11893 if value == nil { 11894 return nil 11895 } 11896 11897 shape, ok := value.(map[string]interface{}) 11898 if !ok { 11899 return fmt.Errorf("unexpected JSON type %v", value) 11900 } 11901 11902 var sv *types.DeliverabilityTestReport 11903 if *v == nil { 11904 sv = &types.DeliverabilityTestReport{} 11905 } else { 11906 sv = *v 11907 } 11908 11909 for key, value := range shape { 11910 switch key { 11911 case "CreateDate": 11912 if value != nil { 11913 jtv, ok := value.(json.Number) 11914 if !ok { 11915 return fmt.Errorf("expected Timestamp to be json.Number, got %T instead", value) 11916 } 11917 f64, err := jtv.Float64() 11918 if err != nil { 11919 return err 11920 } 11921 sv.CreateDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) 11922 } 11923 11924 case "DeliverabilityTestStatus": 11925 if value != nil { 11926 jtv, ok := value.(string) 11927 if !ok { 11928 return fmt.Errorf("expected DeliverabilityTestStatus to be of type string, got %T instead", value) 11929 } 11930 sv.DeliverabilityTestStatus = types.DeliverabilityTestStatus(jtv) 11931 } 11932 11933 case "FromEmailAddress": 11934 if value != nil { 11935 jtv, ok := value.(string) 11936 if !ok { 11937 return fmt.Errorf("expected EmailAddress to be of type string, got %T instead", value) 11938 } 11939 sv.FromEmailAddress = ptr.String(jtv) 11940 } 11941 11942 case "ReportId": 11943 if value != nil { 11944 jtv, ok := value.(string) 11945 if !ok { 11946 return fmt.Errorf("expected ReportId to be of type string, got %T instead", value) 11947 } 11948 sv.ReportId = ptr.String(jtv) 11949 } 11950 11951 case "ReportName": 11952 if value != nil { 11953 jtv, ok := value.(string) 11954 if !ok { 11955 return fmt.Errorf("expected ReportName to be of type string, got %T instead", value) 11956 } 11957 sv.ReportName = ptr.String(jtv) 11958 } 11959 11960 case "Subject": 11961 if value != nil { 11962 jtv, ok := value.(string) 11963 if !ok { 11964 return fmt.Errorf("expected DeliverabilityTestSubject to be of type string, got %T instead", value) 11965 } 11966 sv.Subject = ptr.String(jtv) 11967 } 11968 11969 default: 11970 _, _ = key, value 11971 11972 } 11973 } 11974 *v = sv 11975 return nil 11976} 11977 11978func awsRestjson1_deserializeDocumentDeliverabilityTestReports(v *[]types.DeliverabilityTestReport, value interface{}) error { 11979 if v == nil { 11980 return fmt.Errorf("unexpected nil of type %T", v) 11981 } 11982 if value == nil { 11983 return nil 11984 } 11985 11986 shape, ok := value.([]interface{}) 11987 if !ok { 11988 return fmt.Errorf("unexpected JSON type %v", value) 11989 } 11990 11991 var cv []types.DeliverabilityTestReport 11992 if *v == nil { 11993 cv = []types.DeliverabilityTestReport{} 11994 } else { 11995 cv = *v 11996 } 11997 11998 for _, value := range shape { 11999 var col types.DeliverabilityTestReport 12000 destAddr := &col 12001 if err := awsRestjson1_deserializeDocumentDeliverabilityTestReport(&destAddr, value); err != nil { 12002 return err 12003 } 12004 col = *destAddr 12005 cv = append(cv, col) 12006 12007 } 12008 *v = cv 12009 return nil 12010} 12011 12012func awsRestjson1_deserializeDocumentDeliveryOptions(v **types.DeliveryOptions, value interface{}) error { 12013 if v == nil { 12014 return fmt.Errorf("unexpected nil of type %T", v) 12015 } 12016 if value == nil { 12017 return nil 12018 } 12019 12020 shape, ok := value.(map[string]interface{}) 12021 if !ok { 12022 return fmt.Errorf("unexpected JSON type %v", value) 12023 } 12024 12025 var sv *types.DeliveryOptions 12026 if *v == nil { 12027 sv = &types.DeliveryOptions{} 12028 } else { 12029 sv = *v 12030 } 12031 12032 for key, value := range shape { 12033 switch key { 12034 case "SendingPoolName": 12035 if value != nil { 12036 jtv, ok := value.(string) 12037 if !ok { 12038 return fmt.Errorf("expected PoolName to be of type string, got %T instead", value) 12039 } 12040 sv.SendingPoolName = ptr.String(jtv) 12041 } 12042 12043 case "TlsPolicy": 12044 if value != nil { 12045 jtv, ok := value.(string) 12046 if !ok { 12047 return fmt.Errorf("expected TlsPolicy to be of type string, got %T instead", value) 12048 } 12049 sv.TlsPolicy = types.TlsPolicy(jtv) 12050 } 12051 12052 default: 12053 _, _ = key, value 12054 12055 } 12056 } 12057 *v = sv 12058 return nil 12059} 12060 12061func awsRestjson1_deserializeDocumentDkimAttributes(v **types.DkimAttributes, value interface{}) error { 12062 if v == nil { 12063 return fmt.Errorf("unexpected nil of type %T", v) 12064 } 12065 if value == nil { 12066 return nil 12067 } 12068 12069 shape, ok := value.(map[string]interface{}) 12070 if !ok { 12071 return fmt.Errorf("unexpected JSON type %v", value) 12072 } 12073 12074 var sv *types.DkimAttributes 12075 if *v == nil { 12076 sv = &types.DkimAttributes{} 12077 } else { 12078 sv = *v 12079 } 12080 12081 for key, value := range shape { 12082 switch key { 12083 case "SigningAttributesOrigin": 12084 if value != nil { 12085 jtv, ok := value.(string) 12086 if !ok { 12087 return fmt.Errorf("expected DkimSigningAttributesOrigin to be of type string, got %T instead", value) 12088 } 12089 sv.SigningAttributesOrigin = types.DkimSigningAttributesOrigin(jtv) 12090 } 12091 12092 case "SigningEnabled": 12093 if value != nil { 12094 jtv, ok := value.(bool) 12095 if !ok { 12096 return fmt.Errorf("expected Enabled to be of type *bool, got %T instead", value) 12097 } 12098 sv.SigningEnabled = jtv 12099 } 12100 12101 case "Status": 12102 if value != nil { 12103 jtv, ok := value.(string) 12104 if !ok { 12105 return fmt.Errorf("expected DkimStatus to be of type string, got %T instead", value) 12106 } 12107 sv.Status = types.DkimStatus(jtv) 12108 } 12109 12110 case "Tokens": 12111 if err := awsRestjson1_deserializeDocumentDnsTokenList(&sv.Tokens, value); err != nil { 12112 return err 12113 } 12114 12115 default: 12116 _, _ = key, value 12117 12118 } 12119 } 12120 *v = sv 12121 return nil 12122} 12123 12124func awsRestjson1_deserializeDocumentDnsTokenList(v *[]string, value interface{}) error { 12125 if v == nil { 12126 return fmt.Errorf("unexpected nil of type %T", v) 12127 } 12128 if value == nil { 12129 return nil 12130 } 12131 12132 shape, ok := value.([]interface{}) 12133 if !ok { 12134 return fmt.Errorf("unexpected JSON type %v", value) 12135 } 12136 12137 var cv []string 12138 if *v == nil { 12139 cv = []string{} 12140 } else { 12141 cv = *v 12142 } 12143 12144 for _, value := range shape { 12145 var col string 12146 if value != nil { 12147 jtv, ok := value.(string) 12148 if !ok { 12149 return fmt.Errorf("expected DnsToken to be of type string, got %T instead", value) 12150 } 12151 col = jtv 12152 } 12153 cv = append(cv, col) 12154 12155 } 12156 *v = cv 12157 return nil 12158} 12159 12160func awsRestjson1_deserializeDocumentDomainDeliverabilityCampaign(v **types.DomainDeliverabilityCampaign, value interface{}) error { 12161 if v == nil { 12162 return fmt.Errorf("unexpected nil of type %T", v) 12163 } 12164 if value == nil { 12165 return nil 12166 } 12167 12168 shape, ok := value.(map[string]interface{}) 12169 if !ok { 12170 return fmt.Errorf("unexpected JSON type %v", value) 12171 } 12172 12173 var sv *types.DomainDeliverabilityCampaign 12174 if *v == nil { 12175 sv = &types.DomainDeliverabilityCampaign{} 12176 } else { 12177 sv = *v 12178 } 12179 12180 for key, value := range shape { 12181 switch key { 12182 case "CampaignId": 12183 if value != nil { 12184 jtv, ok := value.(string) 12185 if !ok { 12186 return fmt.Errorf("expected CampaignId to be of type string, got %T instead", value) 12187 } 12188 sv.CampaignId = ptr.String(jtv) 12189 } 12190 12191 case "DeleteRate": 12192 if value != nil { 12193 jtv, ok := value.(json.Number) 12194 if !ok { 12195 return fmt.Errorf("expected Percentage to be json.Number, got %T instead", value) 12196 } 12197 f64, err := jtv.Float64() 12198 if err != nil { 12199 return err 12200 } 12201 sv.DeleteRate = ptr.Float64(f64) 12202 } 12203 12204 case "Esps": 12205 if err := awsRestjson1_deserializeDocumentEsps(&sv.Esps, value); err != nil { 12206 return err 12207 } 12208 12209 case "FirstSeenDateTime": 12210 if value != nil { 12211 jtv, ok := value.(json.Number) 12212 if !ok { 12213 return fmt.Errorf("expected Timestamp to be json.Number, got %T instead", value) 12214 } 12215 f64, err := jtv.Float64() 12216 if err != nil { 12217 return err 12218 } 12219 sv.FirstSeenDateTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) 12220 } 12221 12222 case "FromAddress": 12223 if value != nil { 12224 jtv, ok := value.(string) 12225 if !ok { 12226 return fmt.Errorf("expected Identity to be of type string, got %T instead", value) 12227 } 12228 sv.FromAddress = ptr.String(jtv) 12229 } 12230 12231 case "ImageUrl": 12232 if value != nil { 12233 jtv, ok := value.(string) 12234 if !ok { 12235 return fmt.Errorf("expected ImageUrl to be of type string, got %T instead", value) 12236 } 12237 sv.ImageUrl = ptr.String(jtv) 12238 } 12239 12240 case "InboxCount": 12241 if value != nil { 12242 jtv, ok := value.(json.Number) 12243 if !ok { 12244 return fmt.Errorf("expected Volume to be json.Number, got %T instead", value) 12245 } 12246 i64, err := jtv.Int64() 12247 if err != nil { 12248 return err 12249 } 12250 sv.InboxCount = ptr.Int64(i64) 12251 } 12252 12253 case "LastSeenDateTime": 12254 if value != nil { 12255 jtv, ok := value.(json.Number) 12256 if !ok { 12257 return fmt.Errorf("expected Timestamp to be json.Number, got %T instead", value) 12258 } 12259 f64, err := jtv.Float64() 12260 if err != nil { 12261 return err 12262 } 12263 sv.LastSeenDateTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) 12264 } 12265 12266 case "ProjectedVolume": 12267 if value != nil { 12268 jtv, ok := value.(json.Number) 12269 if !ok { 12270 return fmt.Errorf("expected Volume to be json.Number, got %T instead", value) 12271 } 12272 i64, err := jtv.Int64() 12273 if err != nil { 12274 return err 12275 } 12276 sv.ProjectedVolume = ptr.Int64(i64) 12277 } 12278 12279 case "ReadDeleteRate": 12280 if value != nil { 12281 jtv, ok := value.(json.Number) 12282 if !ok { 12283 return fmt.Errorf("expected Percentage to be json.Number, got %T instead", value) 12284 } 12285 f64, err := jtv.Float64() 12286 if err != nil { 12287 return err 12288 } 12289 sv.ReadDeleteRate = ptr.Float64(f64) 12290 } 12291 12292 case "ReadRate": 12293 if value != nil { 12294 jtv, ok := value.(json.Number) 12295 if !ok { 12296 return fmt.Errorf("expected Percentage to be json.Number, got %T instead", value) 12297 } 12298 f64, err := jtv.Float64() 12299 if err != nil { 12300 return err 12301 } 12302 sv.ReadRate = ptr.Float64(f64) 12303 } 12304 12305 case "SendingIps": 12306 if err := awsRestjson1_deserializeDocumentIpList(&sv.SendingIps, value); err != nil { 12307 return err 12308 } 12309 12310 case "SpamCount": 12311 if value != nil { 12312 jtv, ok := value.(json.Number) 12313 if !ok { 12314 return fmt.Errorf("expected Volume to be json.Number, got %T instead", value) 12315 } 12316 i64, err := jtv.Int64() 12317 if err != nil { 12318 return err 12319 } 12320 sv.SpamCount = ptr.Int64(i64) 12321 } 12322 12323 case "Subject": 12324 if value != nil { 12325 jtv, ok := value.(string) 12326 if !ok { 12327 return fmt.Errorf("expected Subject to be of type string, got %T instead", value) 12328 } 12329 sv.Subject = ptr.String(jtv) 12330 } 12331 12332 default: 12333 _, _ = key, value 12334 12335 } 12336 } 12337 *v = sv 12338 return nil 12339} 12340 12341func awsRestjson1_deserializeDocumentDomainDeliverabilityCampaignList(v *[]types.DomainDeliverabilityCampaign, value interface{}) error { 12342 if v == nil { 12343 return fmt.Errorf("unexpected nil of type %T", v) 12344 } 12345 if value == nil { 12346 return nil 12347 } 12348 12349 shape, ok := value.([]interface{}) 12350 if !ok { 12351 return fmt.Errorf("unexpected JSON type %v", value) 12352 } 12353 12354 var cv []types.DomainDeliverabilityCampaign 12355 if *v == nil { 12356 cv = []types.DomainDeliverabilityCampaign{} 12357 } else { 12358 cv = *v 12359 } 12360 12361 for _, value := range shape { 12362 var col types.DomainDeliverabilityCampaign 12363 destAddr := &col 12364 if err := awsRestjson1_deserializeDocumentDomainDeliverabilityCampaign(&destAddr, value); err != nil { 12365 return err 12366 } 12367 col = *destAddr 12368 cv = append(cv, col) 12369 12370 } 12371 *v = cv 12372 return nil 12373} 12374 12375func awsRestjson1_deserializeDocumentDomainDeliverabilityTrackingOption(v **types.DomainDeliverabilityTrackingOption, value interface{}) error { 12376 if v == nil { 12377 return fmt.Errorf("unexpected nil of type %T", v) 12378 } 12379 if value == nil { 12380 return nil 12381 } 12382 12383 shape, ok := value.(map[string]interface{}) 12384 if !ok { 12385 return fmt.Errorf("unexpected JSON type %v", value) 12386 } 12387 12388 var sv *types.DomainDeliverabilityTrackingOption 12389 if *v == nil { 12390 sv = &types.DomainDeliverabilityTrackingOption{} 12391 } else { 12392 sv = *v 12393 } 12394 12395 for key, value := range shape { 12396 switch key { 12397 case "Domain": 12398 if value != nil { 12399 jtv, ok := value.(string) 12400 if !ok { 12401 return fmt.Errorf("expected Domain to be of type string, got %T instead", value) 12402 } 12403 sv.Domain = ptr.String(jtv) 12404 } 12405 12406 case "InboxPlacementTrackingOption": 12407 if err := awsRestjson1_deserializeDocumentInboxPlacementTrackingOption(&sv.InboxPlacementTrackingOption, value); err != nil { 12408 return err 12409 } 12410 12411 case "SubscriptionStartDate": 12412 if value != nil { 12413 jtv, ok := value.(json.Number) 12414 if !ok { 12415 return fmt.Errorf("expected Timestamp to be json.Number, got %T instead", value) 12416 } 12417 f64, err := jtv.Float64() 12418 if err != nil { 12419 return err 12420 } 12421 sv.SubscriptionStartDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) 12422 } 12423 12424 default: 12425 _, _ = key, value 12426 12427 } 12428 } 12429 *v = sv 12430 return nil 12431} 12432 12433func awsRestjson1_deserializeDocumentDomainDeliverabilityTrackingOptions(v *[]types.DomainDeliverabilityTrackingOption, value interface{}) error { 12434 if v == nil { 12435 return fmt.Errorf("unexpected nil of type %T", v) 12436 } 12437 if value == nil { 12438 return nil 12439 } 12440 12441 shape, ok := value.([]interface{}) 12442 if !ok { 12443 return fmt.Errorf("unexpected JSON type %v", value) 12444 } 12445 12446 var cv []types.DomainDeliverabilityTrackingOption 12447 if *v == nil { 12448 cv = []types.DomainDeliverabilityTrackingOption{} 12449 } else { 12450 cv = *v 12451 } 12452 12453 for _, value := range shape { 12454 var col types.DomainDeliverabilityTrackingOption 12455 destAddr := &col 12456 if err := awsRestjson1_deserializeDocumentDomainDeliverabilityTrackingOption(&destAddr, value); err != nil { 12457 return err 12458 } 12459 col = *destAddr 12460 cv = append(cv, col) 12461 12462 } 12463 *v = cv 12464 return nil 12465} 12466 12467func awsRestjson1_deserializeDocumentDomainIspPlacement(v **types.DomainIspPlacement, value interface{}) error { 12468 if v == nil { 12469 return fmt.Errorf("unexpected nil of type %T", v) 12470 } 12471 if value == nil { 12472 return nil 12473 } 12474 12475 shape, ok := value.(map[string]interface{}) 12476 if !ok { 12477 return fmt.Errorf("unexpected JSON type %v", value) 12478 } 12479 12480 var sv *types.DomainIspPlacement 12481 if *v == nil { 12482 sv = &types.DomainIspPlacement{} 12483 } else { 12484 sv = *v 12485 } 12486 12487 for key, value := range shape { 12488 switch key { 12489 case "InboxPercentage": 12490 if value != nil { 12491 jtv, ok := value.(json.Number) 12492 if !ok { 12493 return fmt.Errorf("expected Percentage to be json.Number, got %T instead", value) 12494 } 12495 f64, err := jtv.Float64() 12496 if err != nil { 12497 return err 12498 } 12499 sv.InboxPercentage = ptr.Float64(f64) 12500 } 12501 12502 case "InboxRawCount": 12503 if value != nil { 12504 jtv, ok := value.(json.Number) 12505 if !ok { 12506 return fmt.Errorf("expected Volume to be json.Number, got %T instead", value) 12507 } 12508 i64, err := jtv.Int64() 12509 if err != nil { 12510 return err 12511 } 12512 sv.InboxRawCount = ptr.Int64(i64) 12513 } 12514 12515 case "IspName": 12516 if value != nil { 12517 jtv, ok := value.(string) 12518 if !ok { 12519 return fmt.Errorf("expected IspName to be of type string, got %T instead", value) 12520 } 12521 sv.IspName = ptr.String(jtv) 12522 } 12523 12524 case "SpamPercentage": 12525 if value != nil { 12526 jtv, ok := value.(json.Number) 12527 if !ok { 12528 return fmt.Errorf("expected Percentage to be json.Number, got %T instead", value) 12529 } 12530 f64, err := jtv.Float64() 12531 if err != nil { 12532 return err 12533 } 12534 sv.SpamPercentage = ptr.Float64(f64) 12535 } 12536 12537 case "SpamRawCount": 12538 if value != nil { 12539 jtv, ok := value.(json.Number) 12540 if !ok { 12541 return fmt.Errorf("expected Volume to be json.Number, got %T instead", value) 12542 } 12543 i64, err := jtv.Int64() 12544 if err != nil { 12545 return err 12546 } 12547 sv.SpamRawCount = ptr.Int64(i64) 12548 } 12549 12550 default: 12551 _, _ = key, value 12552 12553 } 12554 } 12555 *v = sv 12556 return nil 12557} 12558 12559func awsRestjson1_deserializeDocumentDomainIspPlacements(v *[]types.DomainIspPlacement, value interface{}) error { 12560 if v == nil { 12561 return fmt.Errorf("unexpected nil of type %T", v) 12562 } 12563 if value == nil { 12564 return nil 12565 } 12566 12567 shape, ok := value.([]interface{}) 12568 if !ok { 12569 return fmt.Errorf("unexpected JSON type %v", value) 12570 } 12571 12572 var cv []types.DomainIspPlacement 12573 if *v == nil { 12574 cv = []types.DomainIspPlacement{} 12575 } else { 12576 cv = *v 12577 } 12578 12579 for _, value := range shape { 12580 var col types.DomainIspPlacement 12581 destAddr := &col 12582 if err := awsRestjson1_deserializeDocumentDomainIspPlacement(&destAddr, value); err != nil { 12583 return err 12584 } 12585 col = *destAddr 12586 cv = append(cv, col) 12587 12588 } 12589 *v = cv 12590 return nil 12591} 12592 12593func awsRestjson1_deserializeDocumentEmailTemplateContent(v **types.EmailTemplateContent, value interface{}) error { 12594 if v == nil { 12595 return fmt.Errorf("unexpected nil of type %T", v) 12596 } 12597 if value == nil { 12598 return nil 12599 } 12600 12601 shape, ok := value.(map[string]interface{}) 12602 if !ok { 12603 return fmt.Errorf("unexpected JSON type %v", value) 12604 } 12605 12606 var sv *types.EmailTemplateContent 12607 if *v == nil { 12608 sv = &types.EmailTemplateContent{} 12609 } else { 12610 sv = *v 12611 } 12612 12613 for key, value := range shape { 12614 switch key { 12615 case "Html": 12616 if value != nil { 12617 jtv, ok := value.(string) 12618 if !ok { 12619 return fmt.Errorf("expected EmailTemplateHtml to be of type string, got %T instead", value) 12620 } 12621 sv.Html = ptr.String(jtv) 12622 } 12623 12624 case "Subject": 12625 if value != nil { 12626 jtv, ok := value.(string) 12627 if !ok { 12628 return fmt.Errorf("expected EmailTemplateSubject to be of type string, got %T instead", value) 12629 } 12630 sv.Subject = ptr.String(jtv) 12631 } 12632 12633 case "Text": 12634 if value != nil { 12635 jtv, ok := value.(string) 12636 if !ok { 12637 return fmt.Errorf("expected EmailTemplateText to be of type string, got %T instead", value) 12638 } 12639 sv.Text = ptr.String(jtv) 12640 } 12641 12642 default: 12643 _, _ = key, value 12644 12645 } 12646 } 12647 *v = sv 12648 return nil 12649} 12650 12651func awsRestjson1_deserializeDocumentEmailTemplateMetadata(v **types.EmailTemplateMetadata, value interface{}) error { 12652 if v == nil { 12653 return fmt.Errorf("unexpected nil of type %T", v) 12654 } 12655 if value == nil { 12656 return nil 12657 } 12658 12659 shape, ok := value.(map[string]interface{}) 12660 if !ok { 12661 return fmt.Errorf("unexpected JSON type %v", value) 12662 } 12663 12664 var sv *types.EmailTemplateMetadata 12665 if *v == nil { 12666 sv = &types.EmailTemplateMetadata{} 12667 } else { 12668 sv = *v 12669 } 12670 12671 for key, value := range shape { 12672 switch key { 12673 case "CreatedTimestamp": 12674 if value != nil { 12675 jtv, ok := value.(json.Number) 12676 if !ok { 12677 return fmt.Errorf("expected Timestamp to be json.Number, got %T instead", value) 12678 } 12679 f64, err := jtv.Float64() 12680 if err != nil { 12681 return err 12682 } 12683 sv.CreatedTimestamp = ptr.Time(smithytime.ParseEpochSeconds(f64)) 12684 } 12685 12686 case "TemplateName": 12687 if value != nil { 12688 jtv, ok := value.(string) 12689 if !ok { 12690 return fmt.Errorf("expected EmailTemplateName to be of type string, got %T instead", value) 12691 } 12692 sv.TemplateName = ptr.String(jtv) 12693 } 12694 12695 default: 12696 _, _ = key, value 12697 12698 } 12699 } 12700 *v = sv 12701 return nil 12702} 12703 12704func awsRestjson1_deserializeDocumentEmailTemplateMetadataList(v *[]types.EmailTemplateMetadata, value interface{}) error { 12705 if v == nil { 12706 return fmt.Errorf("unexpected nil of type %T", v) 12707 } 12708 if value == nil { 12709 return nil 12710 } 12711 12712 shape, ok := value.([]interface{}) 12713 if !ok { 12714 return fmt.Errorf("unexpected JSON type %v", value) 12715 } 12716 12717 var cv []types.EmailTemplateMetadata 12718 if *v == nil { 12719 cv = []types.EmailTemplateMetadata{} 12720 } else { 12721 cv = *v 12722 } 12723 12724 for _, value := range shape { 12725 var col types.EmailTemplateMetadata 12726 destAddr := &col 12727 if err := awsRestjson1_deserializeDocumentEmailTemplateMetadata(&destAddr, value); err != nil { 12728 return err 12729 } 12730 col = *destAddr 12731 cv = append(cv, col) 12732 12733 } 12734 *v = cv 12735 return nil 12736} 12737 12738func awsRestjson1_deserializeDocumentEsps(v *[]string, value interface{}) error { 12739 if v == nil { 12740 return fmt.Errorf("unexpected nil of type %T", v) 12741 } 12742 if value == nil { 12743 return nil 12744 } 12745 12746 shape, ok := value.([]interface{}) 12747 if !ok { 12748 return fmt.Errorf("unexpected JSON type %v", value) 12749 } 12750 12751 var cv []string 12752 if *v == nil { 12753 cv = []string{} 12754 } else { 12755 cv = *v 12756 } 12757 12758 for _, value := range shape { 12759 var col string 12760 if value != nil { 12761 jtv, ok := value.(string) 12762 if !ok { 12763 return fmt.Errorf("expected Esp to be of type string, got %T instead", value) 12764 } 12765 col = jtv 12766 } 12767 cv = append(cv, col) 12768 12769 } 12770 *v = cv 12771 return nil 12772} 12773 12774func awsRestjson1_deserializeDocumentEventDestination(v **types.EventDestination, value interface{}) error { 12775 if v == nil { 12776 return fmt.Errorf("unexpected nil of type %T", v) 12777 } 12778 if value == nil { 12779 return nil 12780 } 12781 12782 shape, ok := value.(map[string]interface{}) 12783 if !ok { 12784 return fmt.Errorf("unexpected JSON type %v", value) 12785 } 12786 12787 var sv *types.EventDestination 12788 if *v == nil { 12789 sv = &types.EventDestination{} 12790 } else { 12791 sv = *v 12792 } 12793 12794 for key, value := range shape { 12795 switch key { 12796 case "CloudWatchDestination": 12797 if err := awsRestjson1_deserializeDocumentCloudWatchDestination(&sv.CloudWatchDestination, value); err != nil { 12798 return err 12799 } 12800 12801 case "Enabled": 12802 if value != nil { 12803 jtv, ok := value.(bool) 12804 if !ok { 12805 return fmt.Errorf("expected Enabled to be of type *bool, got %T instead", value) 12806 } 12807 sv.Enabled = jtv 12808 } 12809 12810 case "KinesisFirehoseDestination": 12811 if err := awsRestjson1_deserializeDocumentKinesisFirehoseDestination(&sv.KinesisFirehoseDestination, value); err != nil { 12812 return err 12813 } 12814 12815 case "MatchingEventTypes": 12816 if err := awsRestjson1_deserializeDocumentEventTypes(&sv.MatchingEventTypes, value); err != nil { 12817 return err 12818 } 12819 12820 case "Name": 12821 if value != nil { 12822 jtv, ok := value.(string) 12823 if !ok { 12824 return fmt.Errorf("expected EventDestinationName to be of type string, got %T instead", value) 12825 } 12826 sv.Name = ptr.String(jtv) 12827 } 12828 12829 case "PinpointDestination": 12830 if err := awsRestjson1_deserializeDocumentPinpointDestination(&sv.PinpointDestination, value); err != nil { 12831 return err 12832 } 12833 12834 case "SnsDestination": 12835 if err := awsRestjson1_deserializeDocumentSnsDestination(&sv.SnsDestination, value); err != nil { 12836 return err 12837 } 12838 12839 default: 12840 _, _ = key, value 12841 12842 } 12843 } 12844 *v = sv 12845 return nil 12846} 12847 12848func awsRestjson1_deserializeDocumentEventDestinations(v *[]types.EventDestination, value interface{}) error { 12849 if v == nil { 12850 return fmt.Errorf("unexpected nil of type %T", v) 12851 } 12852 if value == nil { 12853 return nil 12854 } 12855 12856 shape, ok := value.([]interface{}) 12857 if !ok { 12858 return fmt.Errorf("unexpected JSON type %v", value) 12859 } 12860 12861 var cv []types.EventDestination 12862 if *v == nil { 12863 cv = []types.EventDestination{} 12864 } else { 12865 cv = *v 12866 } 12867 12868 for _, value := range shape { 12869 var col types.EventDestination 12870 destAddr := &col 12871 if err := awsRestjson1_deserializeDocumentEventDestination(&destAddr, value); err != nil { 12872 return err 12873 } 12874 col = *destAddr 12875 cv = append(cv, col) 12876 12877 } 12878 *v = cv 12879 return nil 12880} 12881 12882func awsRestjson1_deserializeDocumentEventTypes(v *[]types.EventType, value interface{}) error { 12883 if v == nil { 12884 return fmt.Errorf("unexpected nil of type %T", v) 12885 } 12886 if value == nil { 12887 return nil 12888 } 12889 12890 shape, ok := value.([]interface{}) 12891 if !ok { 12892 return fmt.Errorf("unexpected JSON type %v", value) 12893 } 12894 12895 var cv []types.EventType 12896 if *v == nil { 12897 cv = []types.EventType{} 12898 } else { 12899 cv = *v 12900 } 12901 12902 for _, value := range shape { 12903 var col types.EventType 12904 if value != nil { 12905 jtv, ok := value.(string) 12906 if !ok { 12907 return fmt.Errorf("expected EventType to be of type string, got %T instead", value) 12908 } 12909 col = types.EventType(jtv) 12910 } 12911 cv = append(cv, col) 12912 12913 } 12914 *v = cv 12915 return nil 12916} 12917 12918func awsRestjson1_deserializeDocumentFailureInfo(v **types.FailureInfo, value interface{}) error { 12919 if v == nil { 12920 return fmt.Errorf("unexpected nil of type %T", v) 12921 } 12922 if value == nil { 12923 return nil 12924 } 12925 12926 shape, ok := value.(map[string]interface{}) 12927 if !ok { 12928 return fmt.Errorf("unexpected JSON type %v", value) 12929 } 12930 12931 var sv *types.FailureInfo 12932 if *v == nil { 12933 sv = &types.FailureInfo{} 12934 } else { 12935 sv = *v 12936 } 12937 12938 for key, value := range shape { 12939 switch key { 12940 case "ErrorMessage": 12941 if value != nil { 12942 jtv, ok := value.(string) 12943 if !ok { 12944 return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) 12945 } 12946 sv.ErrorMessage = ptr.String(jtv) 12947 } 12948 12949 case "FailedRecordsS3Url": 12950 if value != nil { 12951 jtv, ok := value.(string) 12952 if !ok { 12953 return fmt.Errorf("expected FailedRecordsS3Url to be of type string, got %T instead", value) 12954 } 12955 sv.FailedRecordsS3Url = ptr.String(jtv) 12956 } 12957 12958 default: 12959 _, _ = key, value 12960 12961 } 12962 } 12963 *v = sv 12964 return nil 12965} 12966 12967func awsRestjson1_deserializeDocumentIdentityInfo(v **types.IdentityInfo, value interface{}) error { 12968 if v == nil { 12969 return fmt.Errorf("unexpected nil of type %T", v) 12970 } 12971 if value == nil { 12972 return nil 12973 } 12974 12975 shape, ok := value.(map[string]interface{}) 12976 if !ok { 12977 return fmt.Errorf("unexpected JSON type %v", value) 12978 } 12979 12980 var sv *types.IdentityInfo 12981 if *v == nil { 12982 sv = &types.IdentityInfo{} 12983 } else { 12984 sv = *v 12985 } 12986 12987 for key, value := range shape { 12988 switch key { 12989 case "IdentityName": 12990 if value != nil { 12991 jtv, ok := value.(string) 12992 if !ok { 12993 return fmt.Errorf("expected Identity to be of type string, got %T instead", value) 12994 } 12995 sv.IdentityName = ptr.String(jtv) 12996 } 12997 12998 case "IdentityType": 12999 if value != nil { 13000 jtv, ok := value.(string) 13001 if !ok { 13002 return fmt.Errorf("expected IdentityType to be of type string, got %T instead", value) 13003 } 13004 sv.IdentityType = types.IdentityType(jtv) 13005 } 13006 13007 case "SendingEnabled": 13008 if value != nil { 13009 jtv, ok := value.(bool) 13010 if !ok { 13011 return fmt.Errorf("expected Enabled to be of type *bool, got %T instead", value) 13012 } 13013 sv.SendingEnabled = jtv 13014 } 13015 13016 default: 13017 _, _ = key, value 13018 13019 } 13020 } 13021 *v = sv 13022 return nil 13023} 13024 13025func awsRestjson1_deserializeDocumentIdentityInfoList(v *[]types.IdentityInfo, value interface{}) error { 13026 if v == nil { 13027 return fmt.Errorf("unexpected nil of type %T", v) 13028 } 13029 if value == nil { 13030 return nil 13031 } 13032 13033 shape, ok := value.([]interface{}) 13034 if !ok { 13035 return fmt.Errorf("unexpected JSON type %v", value) 13036 } 13037 13038 var cv []types.IdentityInfo 13039 if *v == nil { 13040 cv = []types.IdentityInfo{} 13041 } else { 13042 cv = *v 13043 } 13044 13045 for _, value := range shape { 13046 var col types.IdentityInfo 13047 destAddr := &col 13048 if err := awsRestjson1_deserializeDocumentIdentityInfo(&destAddr, value); err != nil { 13049 return err 13050 } 13051 col = *destAddr 13052 cv = append(cv, col) 13053 13054 } 13055 *v = cv 13056 return nil 13057} 13058 13059func awsRestjson1_deserializeDocumentImportDataSource(v **types.ImportDataSource, value interface{}) error { 13060 if v == nil { 13061 return fmt.Errorf("unexpected nil of type %T", v) 13062 } 13063 if value == nil { 13064 return nil 13065 } 13066 13067 shape, ok := value.(map[string]interface{}) 13068 if !ok { 13069 return fmt.Errorf("unexpected JSON type %v", value) 13070 } 13071 13072 var sv *types.ImportDataSource 13073 if *v == nil { 13074 sv = &types.ImportDataSource{} 13075 } else { 13076 sv = *v 13077 } 13078 13079 for key, value := range shape { 13080 switch key { 13081 case "DataFormat": 13082 if value != nil { 13083 jtv, ok := value.(string) 13084 if !ok { 13085 return fmt.Errorf("expected DataFormat to be of type string, got %T instead", value) 13086 } 13087 sv.DataFormat = types.DataFormat(jtv) 13088 } 13089 13090 case "S3Url": 13091 if value != nil { 13092 jtv, ok := value.(string) 13093 if !ok { 13094 return fmt.Errorf("expected S3Url to be of type string, got %T instead", value) 13095 } 13096 sv.S3Url = ptr.String(jtv) 13097 } 13098 13099 default: 13100 _, _ = key, value 13101 13102 } 13103 } 13104 *v = sv 13105 return nil 13106} 13107 13108func awsRestjson1_deserializeDocumentImportDestination(v **types.ImportDestination, value interface{}) error { 13109 if v == nil { 13110 return fmt.Errorf("unexpected nil of type %T", v) 13111 } 13112 if value == nil { 13113 return nil 13114 } 13115 13116 shape, ok := value.(map[string]interface{}) 13117 if !ok { 13118 return fmt.Errorf("unexpected JSON type %v", value) 13119 } 13120 13121 var sv *types.ImportDestination 13122 if *v == nil { 13123 sv = &types.ImportDestination{} 13124 } else { 13125 sv = *v 13126 } 13127 13128 for key, value := range shape { 13129 switch key { 13130 case "ContactListDestination": 13131 if err := awsRestjson1_deserializeDocumentContactListDestination(&sv.ContactListDestination, value); err != nil { 13132 return err 13133 } 13134 13135 case "SuppressionListDestination": 13136 if err := awsRestjson1_deserializeDocumentSuppressionListDestination(&sv.SuppressionListDestination, value); err != nil { 13137 return err 13138 } 13139 13140 default: 13141 _, _ = key, value 13142 13143 } 13144 } 13145 *v = sv 13146 return nil 13147} 13148 13149func awsRestjson1_deserializeDocumentImportJobSummary(v **types.ImportJobSummary, value interface{}) error { 13150 if v == nil { 13151 return fmt.Errorf("unexpected nil of type %T", v) 13152 } 13153 if value == nil { 13154 return nil 13155 } 13156 13157 shape, ok := value.(map[string]interface{}) 13158 if !ok { 13159 return fmt.Errorf("unexpected JSON type %v", value) 13160 } 13161 13162 var sv *types.ImportJobSummary 13163 if *v == nil { 13164 sv = &types.ImportJobSummary{} 13165 } else { 13166 sv = *v 13167 } 13168 13169 for key, value := range shape { 13170 switch key { 13171 case "CreatedTimestamp": 13172 if value != nil { 13173 jtv, ok := value.(json.Number) 13174 if !ok { 13175 return fmt.Errorf("expected Timestamp to be json.Number, got %T instead", value) 13176 } 13177 f64, err := jtv.Float64() 13178 if err != nil { 13179 return err 13180 } 13181 sv.CreatedTimestamp = ptr.Time(smithytime.ParseEpochSeconds(f64)) 13182 } 13183 13184 case "ImportDestination": 13185 if err := awsRestjson1_deserializeDocumentImportDestination(&sv.ImportDestination, value); err != nil { 13186 return err 13187 } 13188 13189 case "JobId": 13190 if value != nil { 13191 jtv, ok := value.(string) 13192 if !ok { 13193 return fmt.Errorf("expected JobId to be of type string, got %T instead", value) 13194 } 13195 sv.JobId = ptr.String(jtv) 13196 } 13197 13198 case "JobStatus": 13199 if value != nil { 13200 jtv, ok := value.(string) 13201 if !ok { 13202 return fmt.Errorf("expected JobStatus to be of type string, got %T instead", value) 13203 } 13204 sv.JobStatus = types.JobStatus(jtv) 13205 } 13206 13207 default: 13208 _, _ = key, value 13209 13210 } 13211 } 13212 *v = sv 13213 return nil 13214} 13215 13216func awsRestjson1_deserializeDocumentImportJobSummaryList(v *[]types.ImportJobSummary, value interface{}) error { 13217 if v == nil { 13218 return fmt.Errorf("unexpected nil of type %T", v) 13219 } 13220 if value == nil { 13221 return nil 13222 } 13223 13224 shape, ok := value.([]interface{}) 13225 if !ok { 13226 return fmt.Errorf("unexpected JSON type %v", value) 13227 } 13228 13229 var cv []types.ImportJobSummary 13230 if *v == nil { 13231 cv = []types.ImportJobSummary{} 13232 } else { 13233 cv = *v 13234 } 13235 13236 for _, value := range shape { 13237 var col types.ImportJobSummary 13238 destAddr := &col 13239 if err := awsRestjson1_deserializeDocumentImportJobSummary(&destAddr, value); err != nil { 13240 return err 13241 } 13242 col = *destAddr 13243 cv = append(cv, col) 13244 13245 } 13246 *v = cv 13247 return nil 13248} 13249 13250func awsRestjson1_deserializeDocumentInboxPlacementTrackingOption(v **types.InboxPlacementTrackingOption, value interface{}) error { 13251 if v == nil { 13252 return fmt.Errorf("unexpected nil of type %T", v) 13253 } 13254 if value == nil { 13255 return nil 13256 } 13257 13258 shape, ok := value.(map[string]interface{}) 13259 if !ok { 13260 return fmt.Errorf("unexpected JSON type %v", value) 13261 } 13262 13263 var sv *types.InboxPlacementTrackingOption 13264 if *v == nil { 13265 sv = &types.InboxPlacementTrackingOption{} 13266 } else { 13267 sv = *v 13268 } 13269 13270 for key, value := range shape { 13271 switch key { 13272 case "Global": 13273 if value != nil { 13274 jtv, ok := value.(bool) 13275 if !ok { 13276 return fmt.Errorf("expected Enabled to be of type *bool, got %T instead", value) 13277 } 13278 sv.Global = jtv 13279 } 13280 13281 case "TrackedIsps": 13282 if err := awsRestjson1_deserializeDocumentIspNameList(&sv.TrackedIsps, value); err != nil { 13283 return err 13284 } 13285 13286 default: 13287 _, _ = key, value 13288 13289 } 13290 } 13291 *v = sv 13292 return nil 13293} 13294 13295func awsRestjson1_deserializeDocumentInvalidNextTokenException(v **types.InvalidNextTokenException, value interface{}) error { 13296 if v == nil { 13297 return fmt.Errorf("unexpected nil of type %T", v) 13298 } 13299 if value == nil { 13300 return nil 13301 } 13302 13303 shape, ok := value.(map[string]interface{}) 13304 if !ok { 13305 return fmt.Errorf("unexpected JSON type %v", value) 13306 } 13307 13308 var sv *types.InvalidNextTokenException 13309 if *v == nil { 13310 sv = &types.InvalidNextTokenException{} 13311 } else { 13312 sv = *v 13313 } 13314 13315 for key, value := range shape { 13316 switch key { 13317 case "message": 13318 if value != nil { 13319 jtv, ok := value.(string) 13320 if !ok { 13321 return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) 13322 } 13323 sv.Message = ptr.String(jtv) 13324 } 13325 13326 default: 13327 _, _ = key, value 13328 13329 } 13330 } 13331 *v = sv 13332 return nil 13333} 13334 13335func awsRestjson1_deserializeDocumentIpList(v *[]string, value interface{}) error { 13336 if v == nil { 13337 return fmt.Errorf("unexpected nil of type %T", v) 13338 } 13339 if value == nil { 13340 return nil 13341 } 13342 13343 shape, ok := value.([]interface{}) 13344 if !ok { 13345 return fmt.Errorf("unexpected JSON type %v", value) 13346 } 13347 13348 var cv []string 13349 if *v == nil { 13350 cv = []string{} 13351 } else { 13352 cv = *v 13353 } 13354 13355 for _, value := range shape { 13356 var col string 13357 if value != nil { 13358 jtv, ok := value.(string) 13359 if !ok { 13360 return fmt.Errorf("expected Ip to be of type string, got %T instead", value) 13361 } 13362 col = jtv 13363 } 13364 cv = append(cv, col) 13365 13366 } 13367 *v = cv 13368 return nil 13369} 13370 13371func awsRestjson1_deserializeDocumentIspNameList(v *[]string, value interface{}) error { 13372 if v == nil { 13373 return fmt.Errorf("unexpected nil of type %T", v) 13374 } 13375 if value == nil { 13376 return nil 13377 } 13378 13379 shape, ok := value.([]interface{}) 13380 if !ok { 13381 return fmt.Errorf("unexpected JSON type %v", value) 13382 } 13383 13384 var cv []string 13385 if *v == nil { 13386 cv = []string{} 13387 } else { 13388 cv = *v 13389 } 13390 13391 for _, value := range shape { 13392 var col string 13393 if value != nil { 13394 jtv, ok := value.(string) 13395 if !ok { 13396 return fmt.Errorf("expected IspName to be of type string, got %T instead", value) 13397 } 13398 col = jtv 13399 } 13400 cv = append(cv, col) 13401 13402 } 13403 *v = cv 13404 return nil 13405} 13406 13407func awsRestjson1_deserializeDocumentIspPlacement(v **types.IspPlacement, value interface{}) error { 13408 if v == nil { 13409 return fmt.Errorf("unexpected nil of type %T", v) 13410 } 13411 if value == nil { 13412 return nil 13413 } 13414 13415 shape, ok := value.(map[string]interface{}) 13416 if !ok { 13417 return fmt.Errorf("unexpected JSON type %v", value) 13418 } 13419 13420 var sv *types.IspPlacement 13421 if *v == nil { 13422 sv = &types.IspPlacement{} 13423 } else { 13424 sv = *v 13425 } 13426 13427 for key, value := range shape { 13428 switch key { 13429 case "IspName": 13430 if value != nil { 13431 jtv, ok := value.(string) 13432 if !ok { 13433 return fmt.Errorf("expected IspName to be of type string, got %T instead", value) 13434 } 13435 sv.IspName = ptr.String(jtv) 13436 } 13437 13438 case "PlacementStatistics": 13439 if err := awsRestjson1_deserializeDocumentPlacementStatistics(&sv.PlacementStatistics, value); err != nil { 13440 return err 13441 } 13442 13443 default: 13444 _, _ = key, value 13445 13446 } 13447 } 13448 *v = sv 13449 return nil 13450} 13451 13452func awsRestjson1_deserializeDocumentIspPlacements(v *[]types.IspPlacement, value interface{}) error { 13453 if v == nil { 13454 return fmt.Errorf("unexpected nil of type %T", v) 13455 } 13456 if value == nil { 13457 return nil 13458 } 13459 13460 shape, ok := value.([]interface{}) 13461 if !ok { 13462 return fmt.Errorf("unexpected JSON type %v", value) 13463 } 13464 13465 var cv []types.IspPlacement 13466 if *v == nil { 13467 cv = []types.IspPlacement{} 13468 } else { 13469 cv = *v 13470 } 13471 13472 for _, value := range shape { 13473 var col types.IspPlacement 13474 destAddr := &col 13475 if err := awsRestjson1_deserializeDocumentIspPlacement(&destAddr, value); err != nil { 13476 return err 13477 } 13478 col = *destAddr 13479 cv = append(cv, col) 13480 13481 } 13482 *v = cv 13483 return nil 13484} 13485 13486func awsRestjson1_deserializeDocumentKinesisFirehoseDestination(v **types.KinesisFirehoseDestination, value interface{}) error { 13487 if v == nil { 13488 return fmt.Errorf("unexpected nil of type %T", v) 13489 } 13490 if value == nil { 13491 return nil 13492 } 13493 13494 shape, ok := value.(map[string]interface{}) 13495 if !ok { 13496 return fmt.Errorf("unexpected JSON type %v", value) 13497 } 13498 13499 var sv *types.KinesisFirehoseDestination 13500 if *v == nil { 13501 sv = &types.KinesisFirehoseDestination{} 13502 } else { 13503 sv = *v 13504 } 13505 13506 for key, value := range shape { 13507 switch key { 13508 case "DeliveryStreamArn": 13509 if value != nil { 13510 jtv, ok := value.(string) 13511 if !ok { 13512 return fmt.Errorf("expected AmazonResourceName to be of type string, got %T instead", value) 13513 } 13514 sv.DeliveryStreamArn = ptr.String(jtv) 13515 } 13516 13517 case "IamRoleArn": 13518 if value != nil { 13519 jtv, ok := value.(string) 13520 if !ok { 13521 return fmt.Errorf("expected AmazonResourceName to be of type string, got %T instead", value) 13522 } 13523 sv.IamRoleArn = ptr.String(jtv) 13524 } 13525 13526 default: 13527 _, _ = key, value 13528 13529 } 13530 } 13531 *v = sv 13532 return nil 13533} 13534 13535func awsRestjson1_deserializeDocumentLimitExceededException(v **types.LimitExceededException, value interface{}) error { 13536 if v == nil { 13537 return fmt.Errorf("unexpected nil of type %T", v) 13538 } 13539 if value == nil { 13540 return nil 13541 } 13542 13543 shape, ok := value.(map[string]interface{}) 13544 if !ok { 13545 return fmt.Errorf("unexpected JSON type %v", value) 13546 } 13547 13548 var sv *types.LimitExceededException 13549 if *v == nil { 13550 sv = &types.LimitExceededException{} 13551 } else { 13552 sv = *v 13553 } 13554 13555 for key, value := range shape { 13556 switch key { 13557 case "message": 13558 if value != nil { 13559 jtv, ok := value.(string) 13560 if !ok { 13561 return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) 13562 } 13563 sv.Message = ptr.String(jtv) 13564 } 13565 13566 default: 13567 _, _ = key, value 13568 13569 } 13570 } 13571 *v = sv 13572 return nil 13573} 13574 13575func awsRestjson1_deserializeDocumentListOfContactLists(v *[]types.ContactList, value interface{}) error { 13576 if v == nil { 13577 return fmt.Errorf("unexpected nil of type %T", v) 13578 } 13579 if value == nil { 13580 return nil 13581 } 13582 13583 shape, ok := value.([]interface{}) 13584 if !ok { 13585 return fmt.Errorf("unexpected JSON type %v", value) 13586 } 13587 13588 var cv []types.ContactList 13589 if *v == nil { 13590 cv = []types.ContactList{} 13591 } else { 13592 cv = *v 13593 } 13594 13595 for _, value := range shape { 13596 var col types.ContactList 13597 destAddr := &col 13598 if err := awsRestjson1_deserializeDocumentContactList(&destAddr, value); err != nil { 13599 return err 13600 } 13601 col = *destAddr 13602 cv = append(cv, col) 13603 13604 } 13605 *v = cv 13606 return nil 13607} 13608 13609func awsRestjson1_deserializeDocumentListOfContacts(v *[]types.Contact, value interface{}) error { 13610 if v == nil { 13611 return fmt.Errorf("unexpected nil of type %T", v) 13612 } 13613 if value == nil { 13614 return nil 13615 } 13616 13617 shape, ok := value.([]interface{}) 13618 if !ok { 13619 return fmt.Errorf("unexpected JSON type %v", value) 13620 } 13621 13622 var cv []types.Contact 13623 if *v == nil { 13624 cv = []types.Contact{} 13625 } else { 13626 cv = *v 13627 } 13628 13629 for _, value := range shape { 13630 var col types.Contact 13631 destAddr := &col 13632 if err := awsRestjson1_deserializeDocumentContact(&destAddr, value); err != nil { 13633 return err 13634 } 13635 col = *destAddr 13636 cv = append(cv, col) 13637 13638 } 13639 *v = cv 13640 return nil 13641} 13642 13643func awsRestjson1_deserializeDocumentListOfDedicatedIpPools(v *[]string, value interface{}) error { 13644 if v == nil { 13645 return fmt.Errorf("unexpected nil of type %T", v) 13646 } 13647 if value == nil { 13648 return nil 13649 } 13650 13651 shape, ok := value.([]interface{}) 13652 if !ok { 13653 return fmt.Errorf("unexpected JSON type %v", value) 13654 } 13655 13656 var cv []string 13657 if *v == nil { 13658 cv = []string{} 13659 } else { 13660 cv = *v 13661 } 13662 13663 for _, value := range shape { 13664 var col string 13665 if value != nil { 13666 jtv, ok := value.(string) 13667 if !ok { 13668 return fmt.Errorf("expected PoolName to be of type string, got %T instead", value) 13669 } 13670 col = jtv 13671 } 13672 cv = append(cv, col) 13673 13674 } 13675 *v = cv 13676 return nil 13677} 13678 13679func awsRestjson1_deserializeDocumentMailFromAttributes(v **types.MailFromAttributes, value interface{}) error { 13680 if v == nil { 13681 return fmt.Errorf("unexpected nil of type %T", v) 13682 } 13683 if value == nil { 13684 return nil 13685 } 13686 13687 shape, ok := value.(map[string]interface{}) 13688 if !ok { 13689 return fmt.Errorf("unexpected JSON type %v", value) 13690 } 13691 13692 var sv *types.MailFromAttributes 13693 if *v == nil { 13694 sv = &types.MailFromAttributes{} 13695 } else { 13696 sv = *v 13697 } 13698 13699 for key, value := range shape { 13700 switch key { 13701 case "BehaviorOnMxFailure": 13702 if value != nil { 13703 jtv, ok := value.(string) 13704 if !ok { 13705 return fmt.Errorf("expected BehaviorOnMxFailure to be of type string, got %T instead", value) 13706 } 13707 sv.BehaviorOnMxFailure = types.BehaviorOnMxFailure(jtv) 13708 } 13709 13710 case "MailFromDomain": 13711 if value != nil { 13712 jtv, ok := value.(string) 13713 if !ok { 13714 return fmt.Errorf("expected MailFromDomainName to be of type string, got %T instead", value) 13715 } 13716 sv.MailFromDomain = ptr.String(jtv) 13717 } 13718 13719 case "MailFromDomainStatus": 13720 if value != nil { 13721 jtv, ok := value.(string) 13722 if !ok { 13723 return fmt.Errorf("expected MailFromDomainStatus to be of type string, got %T instead", value) 13724 } 13725 sv.MailFromDomainStatus = types.MailFromDomainStatus(jtv) 13726 } 13727 13728 default: 13729 _, _ = key, value 13730 13731 } 13732 } 13733 *v = sv 13734 return nil 13735} 13736 13737func awsRestjson1_deserializeDocumentMailFromDomainNotVerifiedException(v **types.MailFromDomainNotVerifiedException, value interface{}) error { 13738 if v == nil { 13739 return fmt.Errorf("unexpected nil of type %T", v) 13740 } 13741 if value == nil { 13742 return nil 13743 } 13744 13745 shape, ok := value.(map[string]interface{}) 13746 if !ok { 13747 return fmt.Errorf("unexpected JSON type %v", value) 13748 } 13749 13750 var sv *types.MailFromDomainNotVerifiedException 13751 if *v == nil { 13752 sv = &types.MailFromDomainNotVerifiedException{} 13753 } else { 13754 sv = *v 13755 } 13756 13757 for key, value := range shape { 13758 switch key { 13759 case "message": 13760 if value != nil { 13761 jtv, ok := value.(string) 13762 if !ok { 13763 return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) 13764 } 13765 sv.Message = ptr.String(jtv) 13766 } 13767 13768 default: 13769 _, _ = key, value 13770 13771 } 13772 } 13773 *v = sv 13774 return nil 13775} 13776 13777func awsRestjson1_deserializeDocumentMessageRejected(v **types.MessageRejected, value interface{}) error { 13778 if v == nil { 13779 return fmt.Errorf("unexpected nil of type %T", v) 13780 } 13781 if value == nil { 13782 return nil 13783 } 13784 13785 shape, ok := value.(map[string]interface{}) 13786 if !ok { 13787 return fmt.Errorf("unexpected JSON type %v", value) 13788 } 13789 13790 var sv *types.MessageRejected 13791 if *v == nil { 13792 sv = &types.MessageRejected{} 13793 } else { 13794 sv = *v 13795 } 13796 13797 for key, value := range shape { 13798 switch key { 13799 case "message": 13800 if value != nil { 13801 jtv, ok := value.(string) 13802 if !ok { 13803 return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) 13804 } 13805 sv.Message = ptr.String(jtv) 13806 } 13807 13808 default: 13809 _, _ = key, value 13810 13811 } 13812 } 13813 *v = sv 13814 return nil 13815} 13816 13817func awsRestjson1_deserializeDocumentNotFoundException(v **types.NotFoundException, value interface{}) error { 13818 if v == nil { 13819 return fmt.Errorf("unexpected nil of type %T", v) 13820 } 13821 if value == nil { 13822 return nil 13823 } 13824 13825 shape, ok := value.(map[string]interface{}) 13826 if !ok { 13827 return fmt.Errorf("unexpected JSON type %v", value) 13828 } 13829 13830 var sv *types.NotFoundException 13831 if *v == nil { 13832 sv = &types.NotFoundException{} 13833 } else { 13834 sv = *v 13835 } 13836 13837 for key, value := range shape { 13838 switch key { 13839 case "message": 13840 if value != nil { 13841 jtv, ok := value.(string) 13842 if !ok { 13843 return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) 13844 } 13845 sv.Message = ptr.String(jtv) 13846 } 13847 13848 default: 13849 _, _ = key, value 13850 13851 } 13852 } 13853 *v = sv 13854 return nil 13855} 13856 13857func awsRestjson1_deserializeDocumentOverallVolume(v **types.OverallVolume, value interface{}) error { 13858 if v == nil { 13859 return fmt.Errorf("unexpected nil of type %T", v) 13860 } 13861 if value == nil { 13862 return nil 13863 } 13864 13865 shape, ok := value.(map[string]interface{}) 13866 if !ok { 13867 return fmt.Errorf("unexpected JSON type %v", value) 13868 } 13869 13870 var sv *types.OverallVolume 13871 if *v == nil { 13872 sv = &types.OverallVolume{} 13873 } else { 13874 sv = *v 13875 } 13876 13877 for key, value := range shape { 13878 switch key { 13879 case "DomainIspPlacements": 13880 if err := awsRestjson1_deserializeDocumentDomainIspPlacements(&sv.DomainIspPlacements, value); err != nil { 13881 return err 13882 } 13883 13884 case "ReadRatePercent": 13885 if value != nil { 13886 jtv, ok := value.(json.Number) 13887 if !ok { 13888 return fmt.Errorf("expected Percentage to be json.Number, got %T instead", value) 13889 } 13890 f64, err := jtv.Float64() 13891 if err != nil { 13892 return err 13893 } 13894 sv.ReadRatePercent = ptr.Float64(f64) 13895 } 13896 13897 case "VolumeStatistics": 13898 if err := awsRestjson1_deserializeDocumentVolumeStatistics(&sv.VolumeStatistics, value); err != nil { 13899 return err 13900 } 13901 13902 default: 13903 _, _ = key, value 13904 13905 } 13906 } 13907 *v = sv 13908 return nil 13909} 13910 13911func awsRestjson1_deserializeDocumentPinpointDestination(v **types.PinpointDestination, value interface{}) error { 13912 if v == nil { 13913 return fmt.Errorf("unexpected nil of type %T", v) 13914 } 13915 if value == nil { 13916 return nil 13917 } 13918 13919 shape, ok := value.(map[string]interface{}) 13920 if !ok { 13921 return fmt.Errorf("unexpected JSON type %v", value) 13922 } 13923 13924 var sv *types.PinpointDestination 13925 if *v == nil { 13926 sv = &types.PinpointDestination{} 13927 } else { 13928 sv = *v 13929 } 13930 13931 for key, value := range shape { 13932 switch key { 13933 case "ApplicationArn": 13934 if value != nil { 13935 jtv, ok := value.(string) 13936 if !ok { 13937 return fmt.Errorf("expected AmazonResourceName to be of type string, got %T instead", value) 13938 } 13939 sv.ApplicationArn = ptr.String(jtv) 13940 } 13941 13942 default: 13943 _, _ = key, value 13944 13945 } 13946 } 13947 *v = sv 13948 return nil 13949} 13950 13951func awsRestjson1_deserializeDocumentPlacementStatistics(v **types.PlacementStatistics, value interface{}) error { 13952 if v == nil { 13953 return fmt.Errorf("unexpected nil of type %T", v) 13954 } 13955 if value == nil { 13956 return nil 13957 } 13958 13959 shape, ok := value.(map[string]interface{}) 13960 if !ok { 13961 return fmt.Errorf("unexpected JSON type %v", value) 13962 } 13963 13964 var sv *types.PlacementStatistics 13965 if *v == nil { 13966 sv = &types.PlacementStatistics{} 13967 } else { 13968 sv = *v 13969 } 13970 13971 for key, value := range shape { 13972 switch key { 13973 case "DkimPercentage": 13974 if value != nil { 13975 jtv, ok := value.(json.Number) 13976 if !ok { 13977 return fmt.Errorf("expected Percentage to be json.Number, got %T instead", value) 13978 } 13979 f64, err := jtv.Float64() 13980 if err != nil { 13981 return err 13982 } 13983 sv.DkimPercentage = ptr.Float64(f64) 13984 } 13985 13986 case "InboxPercentage": 13987 if value != nil { 13988 jtv, ok := value.(json.Number) 13989 if !ok { 13990 return fmt.Errorf("expected Percentage to be json.Number, got %T instead", value) 13991 } 13992 f64, err := jtv.Float64() 13993 if err != nil { 13994 return err 13995 } 13996 sv.InboxPercentage = ptr.Float64(f64) 13997 } 13998 13999 case "MissingPercentage": 14000 if value != nil { 14001 jtv, ok := value.(json.Number) 14002 if !ok { 14003 return fmt.Errorf("expected Percentage to be json.Number, got %T instead", value) 14004 } 14005 f64, err := jtv.Float64() 14006 if err != nil { 14007 return err 14008 } 14009 sv.MissingPercentage = ptr.Float64(f64) 14010 } 14011 14012 case "SpamPercentage": 14013 if value != nil { 14014 jtv, ok := value.(json.Number) 14015 if !ok { 14016 return fmt.Errorf("expected Percentage to be json.Number, got %T instead", value) 14017 } 14018 f64, err := jtv.Float64() 14019 if err != nil { 14020 return err 14021 } 14022 sv.SpamPercentage = ptr.Float64(f64) 14023 } 14024 14025 case "SpfPercentage": 14026 if value != nil { 14027 jtv, ok := value.(json.Number) 14028 if !ok { 14029 return fmt.Errorf("expected Percentage to be json.Number, got %T instead", value) 14030 } 14031 f64, err := jtv.Float64() 14032 if err != nil { 14033 return err 14034 } 14035 sv.SpfPercentage = ptr.Float64(f64) 14036 } 14037 14038 default: 14039 _, _ = key, value 14040 14041 } 14042 } 14043 *v = sv 14044 return nil 14045} 14046 14047func awsRestjson1_deserializeDocumentPolicyMap(v *map[string]string, value interface{}) error { 14048 if v == nil { 14049 return fmt.Errorf("unexpected nil of type %T", v) 14050 } 14051 if value == nil { 14052 return nil 14053 } 14054 14055 shape, ok := value.(map[string]interface{}) 14056 if !ok { 14057 return fmt.Errorf("unexpected JSON type %v", value) 14058 } 14059 14060 var mv map[string]string 14061 if *v == nil { 14062 mv = map[string]string{} 14063 } else { 14064 mv = *v 14065 } 14066 14067 for key, value := range shape { 14068 var parsedVal string 14069 if value != nil { 14070 jtv, ok := value.(string) 14071 if !ok { 14072 return fmt.Errorf("expected Policy to be of type string, got %T instead", value) 14073 } 14074 parsedVal = jtv 14075 } 14076 mv[key] = parsedVal 14077 14078 } 14079 *v = mv 14080 return nil 14081} 14082 14083func awsRestjson1_deserializeDocumentReputationOptions(v **types.ReputationOptions, value interface{}) error { 14084 if v == nil { 14085 return fmt.Errorf("unexpected nil of type %T", v) 14086 } 14087 if value == nil { 14088 return nil 14089 } 14090 14091 shape, ok := value.(map[string]interface{}) 14092 if !ok { 14093 return fmt.Errorf("unexpected JSON type %v", value) 14094 } 14095 14096 var sv *types.ReputationOptions 14097 if *v == nil { 14098 sv = &types.ReputationOptions{} 14099 } else { 14100 sv = *v 14101 } 14102 14103 for key, value := range shape { 14104 switch key { 14105 case "LastFreshStart": 14106 if value != nil { 14107 jtv, ok := value.(json.Number) 14108 if !ok { 14109 return fmt.Errorf("expected LastFreshStart to be json.Number, got %T instead", value) 14110 } 14111 f64, err := jtv.Float64() 14112 if err != nil { 14113 return err 14114 } 14115 sv.LastFreshStart = ptr.Time(smithytime.ParseEpochSeconds(f64)) 14116 } 14117 14118 case "ReputationMetricsEnabled": 14119 if value != nil { 14120 jtv, ok := value.(bool) 14121 if !ok { 14122 return fmt.Errorf("expected Enabled to be of type *bool, got %T instead", value) 14123 } 14124 sv.ReputationMetricsEnabled = jtv 14125 } 14126 14127 default: 14128 _, _ = key, value 14129 14130 } 14131 } 14132 *v = sv 14133 return nil 14134} 14135 14136func awsRestjson1_deserializeDocumentReviewDetails(v **types.ReviewDetails, value interface{}) error { 14137 if v == nil { 14138 return fmt.Errorf("unexpected nil of type %T", v) 14139 } 14140 if value == nil { 14141 return nil 14142 } 14143 14144 shape, ok := value.(map[string]interface{}) 14145 if !ok { 14146 return fmt.Errorf("unexpected JSON type %v", value) 14147 } 14148 14149 var sv *types.ReviewDetails 14150 if *v == nil { 14151 sv = &types.ReviewDetails{} 14152 } else { 14153 sv = *v 14154 } 14155 14156 for key, value := range shape { 14157 switch key { 14158 case "CaseId": 14159 if value != nil { 14160 jtv, ok := value.(string) 14161 if !ok { 14162 return fmt.Errorf("expected CaseId to be of type string, got %T instead", value) 14163 } 14164 sv.CaseId = ptr.String(jtv) 14165 } 14166 14167 case "Status": 14168 if value != nil { 14169 jtv, ok := value.(string) 14170 if !ok { 14171 return fmt.Errorf("expected ReviewStatus to be of type string, got %T instead", value) 14172 } 14173 sv.Status = types.ReviewStatus(jtv) 14174 } 14175 14176 default: 14177 _, _ = key, value 14178 14179 } 14180 } 14181 *v = sv 14182 return nil 14183} 14184 14185func awsRestjson1_deserializeDocumentSendingOptions(v **types.SendingOptions, value interface{}) error { 14186 if v == nil { 14187 return fmt.Errorf("unexpected nil of type %T", v) 14188 } 14189 if value == nil { 14190 return nil 14191 } 14192 14193 shape, ok := value.(map[string]interface{}) 14194 if !ok { 14195 return fmt.Errorf("unexpected JSON type %v", value) 14196 } 14197 14198 var sv *types.SendingOptions 14199 if *v == nil { 14200 sv = &types.SendingOptions{} 14201 } else { 14202 sv = *v 14203 } 14204 14205 for key, value := range shape { 14206 switch key { 14207 case "SendingEnabled": 14208 if value != nil { 14209 jtv, ok := value.(bool) 14210 if !ok { 14211 return fmt.Errorf("expected Enabled to be of type *bool, got %T instead", value) 14212 } 14213 sv.SendingEnabled = jtv 14214 } 14215 14216 default: 14217 _, _ = key, value 14218 14219 } 14220 } 14221 *v = sv 14222 return nil 14223} 14224 14225func awsRestjson1_deserializeDocumentSendingPausedException(v **types.SendingPausedException, value interface{}) error { 14226 if v == nil { 14227 return fmt.Errorf("unexpected nil of type %T", v) 14228 } 14229 if value == nil { 14230 return nil 14231 } 14232 14233 shape, ok := value.(map[string]interface{}) 14234 if !ok { 14235 return fmt.Errorf("unexpected JSON type %v", value) 14236 } 14237 14238 var sv *types.SendingPausedException 14239 if *v == nil { 14240 sv = &types.SendingPausedException{} 14241 } else { 14242 sv = *v 14243 } 14244 14245 for key, value := range shape { 14246 switch key { 14247 case "message": 14248 if value != nil { 14249 jtv, ok := value.(string) 14250 if !ok { 14251 return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) 14252 } 14253 sv.Message = ptr.String(jtv) 14254 } 14255 14256 default: 14257 _, _ = key, value 14258 14259 } 14260 } 14261 *v = sv 14262 return nil 14263} 14264 14265func awsRestjson1_deserializeDocumentSendQuota(v **types.SendQuota, value interface{}) error { 14266 if v == nil { 14267 return fmt.Errorf("unexpected nil of type %T", v) 14268 } 14269 if value == nil { 14270 return nil 14271 } 14272 14273 shape, ok := value.(map[string]interface{}) 14274 if !ok { 14275 return fmt.Errorf("unexpected JSON type %v", value) 14276 } 14277 14278 var sv *types.SendQuota 14279 if *v == nil { 14280 sv = &types.SendQuota{} 14281 } else { 14282 sv = *v 14283 } 14284 14285 for key, value := range shape { 14286 switch key { 14287 case "Max24HourSend": 14288 if value != nil { 14289 jtv, ok := value.(json.Number) 14290 if !ok { 14291 return fmt.Errorf("expected Max24HourSend to be json.Number, got %T instead", value) 14292 } 14293 f64, err := jtv.Float64() 14294 if err != nil { 14295 return err 14296 } 14297 sv.Max24HourSend = f64 14298 } 14299 14300 case "MaxSendRate": 14301 if value != nil { 14302 jtv, ok := value.(json.Number) 14303 if !ok { 14304 return fmt.Errorf("expected MaxSendRate to be json.Number, got %T instead", value) 14305 } 14306 f64, err := jtv.Float64() 14307 if err != nil { 14308 return err 14309 } 14310 sv.MaxSendRate = f64 14311 } 14312 14313 case "SentLast24Hours": 14314 if value != nil { 14315 jtv, ok := value.(json.Number) 14316 if !ok { 14317 return fmt.Errorf("expected SentLast24Hours to be json.Number, got %T instead", value) 14318 } 14319 f64, err := jtv.Float64() 14320 if err != nil { 14321 return err 14322 } 14323 sv.SentLast24Hours = f64 14324 } 14325 14326 default: 14327 _, _ = key, value 14328 14329 } 14330 } 14331 *v = sv 14332 return nil 14333} 14334 14335func awsRestjson1_deserializeDocumentSnsDestination(v **types.SnsDestination, value interface{}) error { 14336 if v == nil { 14337 return fmt.Errorf("unexpected nil of type %T", v) 14338 } 14339 if value == nil { 14340 return nil 14341 } 14342 14343 shape, ok := value.(map[string]interface{}) 14344 if !ok { 14345 return fmt.Errorf("unexpected JSON type %v", value) 14346 } 14347 14348 var sv *types.SnsDestination 14349 if *v == nil { 14350 sv = &types.SnsDestination{} 14351 } else { 14352 sv = *v 14353 } 14354 14355 for key, value := range shape { 14356 switch key { 14357 case "TopicArn": 14358 if value != nil { 14359 jtv, ok := value.(string) 14360 if !ok { 14361 return fmt.Errorf("expected AmazonResourceName to be of type string, got %T instead", value) 14362 } 14363 sv.TopicArn = ptr.String(jtv) 14364 } 14365 14366 default: 14367 _, _ = key, value 14368 14369 } 14370 } 14371 *v = sv 14372 return nil 14373} 14374 14375func awsRestjson1_deserializeDocumentSuppressedDestination(v **types.SuppressedDestination, value interface{}) error { 14376 if v == nil { 14377 return fmt.Errorf("unexpected nil of type %T", v) 14378 } 14379 if value == nil { 14380 return nil 14381 } 14382 14383 shape, ok := value.(map[string]interface{}) 14384 if !ok { 14385 return fmt.Errorf("unexpected JSON type %v", value) 14386 } 14387 14388 var sv *types.SuppressedDestination 14389 if *v == nil { 14390 sv = &types.SuppressedDestination{} 14391 } else { 14392 sv = *v 14393 } 14394 14395 for key, value := range shape { 14396 switch key { 14397 case "Attributes": 14398 if err := awsRestjson1_deserializeDocumentSuppressedDestinationAttributes(&sv.Attributes, value); err != nil { 14399 return err 14400 } 14401 14402 case "EmailAddress": 14403 if value != nil { 14404 jtv, ok := value.(string) 14405 if !ok { 14406 return fmt.Errorf("expected EmailAddress to be of type string, got %T instead", value) 14407 } 14408 sv.EmailAddress = ptr.String(jtv) 14409 } 14410 14411 case "LastUpdateTime": 14412 if value != nil { 14413 jtv, ok := value.(json.Number) 14414 if !ok { 14415 return fmt.Errorf("expected Timestamp to be json.Number, got %T instead", value) 14416 } 14417 f64, err := jtv.Float64() 14418 if err != nil { 14419 return err 14420 } 14421 sv.LastUpdateTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) 14422 } 14423 14424 case "Reason": 14425 if value != nil { 14426 jtv, ok := value.(string) 14427 if !ok { 14428 return fmt.Errorf("expected SuppressionListReason to be of type string, got %T instead", value) 14429 } 14430 sv.Reason = types.SuppressionListReason(jtv) 14431 } 14432 14433 default: 14434 _, _ = key, value 14435 14436 } 14437 } 14438 *v = sv 14439 return nil 14440} 14441 14442func awsRestjson1_deserializeDocumentSuppressedDestinationAttributes(v **types.SuppressedDestinationAttributes, value interface{}) error { 14443 if v == nil { 14444 return fmt.Errorf("unexpected nil of type %T", v) 14445 } 14446 if value == nil { 14447 return nil 14448 } 14449 14450 shape, ok := value.(map[string]interface{}) 14451 if !ok { 14452 return fmt.Errorf("unexpected JSON type %v", value) 14453 } 14454 14455 var sv *types.SuppressedDestinationAttributes 14456 if *v == nil { 14457 sv = &types.SuppressedDestinationAttributes{} 14458 } else { 14459 sv = *v 14460 } 14461 14462 for key, value := range shape { 14463 switch key { 14464 case "FeedbackId": 14465 if value != nil { 14466 jtv, ok := value.(string) 14467 if !ok { 14468 return fmt.Errorf("expected FeedbackId to be of type string, got %T instead", value) 14469 } 14470 sv.FeedbackId = ptr.String(jtv) 14471 } 14472 14473 case "MessageId": 14474 if value != nil { 14475 jtv, ok := value.(string) 14476 if !ok { 14477 return fmt.Errorf("expected OutboundMessageId to be of type string, got %T instead", value) 14478 } 14479 sv.MessageId = ptr.String(jtv) 14480 } 14481 14482 default: 14483 _, _ = key, value 14484 14485 } 14486 } 14487 *v = sv 14488 return nil 14489} 14490 14491func awsRestjson1_deserializeDocumentSuppressedDestinationSummaries(v *[]types.SuppressedDestinationSummary, value interface{}) error { 14492 if v == nil { 14493 return fmt.Errorf("unexpected nil of type %T", v) 14494 } 14495 if value == nil { 14496 return nil 14497 } 14498 14499 shape, ok := value.([]interface{}) 14500 if !ok { 14501 return fmt.Errorf("unexpected JSON type %v", value) 14502 } 14503 14504 var cv []types.SuppressedDestinationSummary 14505 if *v == nil { 14506 cv = []types.SuppressedDestinationSummary{} 14507 } else { 14508 cv = *v 14509 } 14510 14511 for _, value := range shape { 14512 var col types.SuppressedDestinationSummary 14513 destAddr := &col 14514 if err := awsRestjson1_deserializeDocumentSuppressedDestinationSummary(&destAddr, value); err != nil { 14515 return err 14516 } 14517 col = *destAddr 14518 cv = append(cv, col) 14519 14520 } 14521 *v = cv 14522 return nil 14523} 14524 14525func awsRestjson1_deserializeDocumentSuppressedDestinationSummary(v **types.SuppressedDestinationSummary, value interface{}) error { 14526 if v == nil { 14527 return fmt.Errorf("unexpected nil of type %T", v) 14528 } 14529 if value == nil { 14530 return nil 14531 } 14532 14533 shape, ok := value.(map[string]interface{}) 14534 if !ok { 14535 return fmt.Errorf("unexpected JSON type %v", value) 14536 } 14537 14538 var sv *types.SuppressedDestinationSummary 14539 if *v == nil { 14540 sv = &types.SuppressedDestinationSummary{} 14541 } else { 14542 sv = *v 14543 } 14544 14545 for key, value := range shape { 14546 switch key { 14547 case "EmailAddress": 14548 if value != nil { 14549 jtv, ok := value.(string) 14550 if !ok { 14551 return fmt.Errorf("expected EmailAddress to be of type string, got %T instead", value) 14552 } 14553 sv.EmailAddress = ptr.String(jtv) 14554 } 14555 14556 case "LastUpdateTime": 14557 if value != nil { 14558 jtv, ok := value.(json.Number) 14559 if !ok { 14560 return fmt.Errorf("expected Timestamp to be json.Number, got %T instead", value) 14561 } 14562 f64, err := jtv.Float64() 14563 if err != nil { 14564 return err 14565 } 14566 sv.LastUpdateTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) 14567 } 14568 14569 case "Reason": 14570 if value != nil { 14571 jtv, ok := value.(string) 14572 if !ok { 14573 return fmt.Errorf("expected SuppressionListReason to be of type string, got %T instead", value) 14574 } 14575 sv.Reason = types.SuppressionListReason(jtv) 14576 } 14577 14578 default: 14579 _, _ = key, value 14580 14581 } 14582 } 14583 *v = sv 14584 return nil 14585} 14586 14587func awsRestjson1_deserializeDocumentSuppressionAttributes(v **types.SuppressionAttributes, value interface{}) error { 14588 if v == nil { 14589 return fmt.Errorf("unexpected nil of type %T", v) 14590 } 14591 if value == nil { 14592 return nil 14593 } 14594 14595 shape, ok := value.(map[string]interface{}) 14596 if !ok { 14597 return fmt.Errorf("unexpected JSON type %v", value) 14598 } 14599 14600 var sv *types.SuppressionAttributes 14601 if *v == nil { 14602 sv = &types.SuppressionAttributes{} 14603 } else { 14604 sv = *v 14605 } 14606 14607 for key, value := range shape { 14608 switch key { 14609 case "SuppressedReasons": 14610 if err := awsRestjson1_deserializeDocumentSuppressionListReasons(&sv.SuppressedReasons, value); err != nil { 14611 return err 14612 } 14613 14614 default: 14615 _, _ = key, value 14616 14617 } 14618 } 14619 *v = sv 14620 return nil 14621} 14622 14623func awsRestjson1_deserializeDocumentSuppressionListDestination(v **types.SuppressionListDestination, value interface{}) error { 14624 if v == nil { 14625 return fmt.Errorf("unexpected nil of type %T", v) 14626 } 14627 if value == nil { 14628 return nil 14629 } 14630 14631 shape, ok := value.(map[string]interface{}) 14632 if !ok { 14633 return fmt.Errorf("unexpected JSON type %v", value) 14634 } 14635 14636 var sv *types.SuppressionListDestination 14637 if *v == nil { 14638 sv = &types.SuppressionListDestination{} 14639 } else { 14640 sv = *v 14641 } 14642 14643 for key, value := range shape { 14644 switch key { 14645 case "SuppressionListImportAction": 14646 if value != nil { 14647 jtv, ok := value.(string) 14648 if !ok { 14649 return fmt.Errorf("expected SuppressionListImportAction to be of type string, got %T instead", value) 14650 } 14651 sv.SuppressionListImportAction = types.SuppressionListImportAction(jtv) 14652 } 14653 14654 default: 14655 _, _ = key, value 14656 14657 } 14658 } 14659 *v = sv 14660 return nil 14661} 14662 14663func awsRestjson1_deserializeDocumentSuppressionListReasons(v *[]types.SuppressionListReason, value interface{}) error { 14664 if v == nil { 14665 return fmt.Errorf("unexpected nil of type %T", v) 14666 } 14667 if value == nil { 14668 return nil 14669 } 14670 14671 shape, ok := value.([]interface{}) 14672 if !ok { 14673 return fmt.Errorf("unexpected JSON type %v", value) 14674 } 14675 14676 var cv []types.SuppressionListReason 14677 if *v == nil { 14678 cv = []types.SuppressionListReason{} 14679 } else { 14680 cv = *v 14681 } 14682 14683 for _, value := range shape { 14684 var col types.SuppressionListReason 14685 if value != nil { 14686 jtv, ok := value.(string) 14687 if !ok { 14688 return fmt.Errorf("expected SuppressionListReason to be of type string, got %T instead", value) 14689 } 14690 col = types.SuppressionListReason(jtv) 14691 } 14692 cv = append(cv, col) 14693 14694 } 14695 *v = cv 14696 return nil 14697} 14698 14699func awsRestjson1_deserializeDocumentSuppressionOptions(v **types.SuppressionOptions, value interface{}) error { 14700 if v == nil { 14701 return fmt.Errorf("unexpected nil of type %T", v) 14702 } 14703 if value == nil { 14704 return nil 14705 } 14706 14707 shape, ok := value.(map[string]interface{}) 14708 if !ok { 14709 return fmt.Errorf("unexpected JSON type %v", value) 14710 } 14711 14712 var sv *types.SuppressionOptions 14713 if *v == nil { 14714 sv = &types.SuppressionOptions{} 14715 } else { 14716 sv = *v 14717 } 14718 14719 for key, value := range shape { 14720 switch key { 14721 case "SuppressedReasons": 14722 if err := awsRestjson1_deserializeDocumentSuppressionListReasons(&sv.SuppressedReasons, value); err != nil { 14723 return err 14724 } 14725 14726 default: 14727 _, _ = key, value 14728 14729 } 14730 } 14731 *v = sv 14732 return nil 14733} 14734 14735func awsRestjson1_deserializeDocumentTag(v **types.Tag, value interface{}) error { 14736 if v == nil { 14737 return fmt.Errorf("unexpected nil of type %T", v) 14738 } 14739 if value == nil { 14740 return nil 14741 } 14742 14743 shape, ok := value.(map[string]interface{}) 14744 if !ok { 14745 return fmt.Errorf("unexpected JSON type %v", value) 14746 } 14747 14748 var sv *types.Tag 14749 if *v == nil { 14750 sv = &types.Tag{} 14751 } else { 14752 sv = *v 14753 } 14754 14755 for key, value := range shape { 14756 switch key { 14757 case "Key": 14758 if value != nil { 14759 jtv, ok := value.(string) 14760 if !ok { 14761 return fmt.Errorf("expected TagKey to be of type string, got %T instead", value) 14762 } 14763 sv.Key = ptr.String(jtv) 14764 } 14765 14766 case "Value": 14767 if value != nil { 14768 jtv, ok := value.(string) 14769 if !ok { 14770 return fmt.Errorf("expected TagValue to be of type string, got %T instead", value) 14771 } 14772 sv.Value = ptr.String(jtv) 14773 } 14774 14775 default: 14776 _, _ = key, value 14777 14778 } 14779 } 14780 *v = sv 14781 return nil 14782} 14783 14784func awsRestjson1_deserializeDocumentTagList(v *[]types.Tag, value interface{}) error { 14785 if v == nil { 14786 return fmt.Errorf("unexpected nil of type %T", v) 14787 } 14788 if value == nil { 14789 return nil 14790 } 14791 14792 shape, ok := value.([]interface{}) 14793 if !ok { 14794 return fmt.Errorf("unexpected JSON type %v", value) 14795 } 14796 14797 var cv []types.Tag 14798 if *v == nil { 14799 cv = []types.Tag{} 14800 } else { 14801 cv = *v 14802 } 14803 14804 for _, value := range shape { 14805 var col types.Tag 14806 destAddr := &col 14807 if err := awsRestjson1_deserializeDocumentTag(&destAddr, value); err != nil { 14808 return err 14809 } 14810 col = *destAddr 14811 cv = append(cv, col) 14812 14813 } 14814 *v = cv 14815 return nil 14816} 14817 14818func awsRestjson1_deserializeDocumentTooManyRequestsException(v **types.TooManyRequestsException, value interface{}) error { 14819 if v == nil { 14820 return fmt.Errorf("unexpected nil of type %T", v) 14821 } 14822 if value == nil { 14823 return nil 14824 } 14825 14826 shape, ok := value.(map[string]interface{}) 14827 if !ok { 14828 return fmt.Errorf("unexpected JSON type %v", value) 14829 } 14830 14831 var sv *types.TooManyRequestsException 14832 if *v == nil { 14833 sv = &types.TooManyRequestsException{} 14834 } else { 14835 sv = *v 14836 } 14837 14838 for key, value := range shape { 14839 switch key { 14840 case "message": 14841 if value != nil { 14842 jtv, ok := value.(string) 14843 if !ok { 14844 return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) 14845 } 14846 sv.Message = ptr.String(jtv) 14847 } 14848 14849 default: 14850 _, _ = key, value 14851 14852 } 14853 } 14854 *v = sv 14855 return nil 14856} 14857 14858func awsRestjson1_deserializeDocumentTopic(v **types.Topic, value interface{}) error { 14859 if v == nil { 14860 return fmt.Errorf("unexpected nil of type %T", v) 14861 } 14862 if value == nil { 14863 return nil 14864 } 14865 14866 shape, ok := value.(map[string]interface{}) 14867 if !ok { 14868 return fmt.Errorf("unexpected JSON type %v", value) 14869 } 14870 14871 var sv *types.Topic 14872 if *v == nil { 14873 sv = &types.Topic{} 14874 } else { 14875 sv = *v 14876 } 14877 14878 for key, value := range shape { 14879 switch key { 14880 case "DefaultSubscriptionStatus": 14881 if value != nil { 14882 jtv, ok := value.(string) 14883 if !ok { 14884 return fmt.Errorf("expected SubscriptionStatus to be of type string, got %T instead", value) 14885 } 14886 sv.DefaultSubscriptionStatus = types.SubscriptionStatus(jtv) 14887 } 14888 14889 case "Description": 14890 if value != nil { 14891 jtv, ok := value.(string) 14892 if !ok { 14893 return fmt.Errorf("expected Description to be of type string, got %T instead", value) 14894 } 14895 sv.Description = ptr.String(jtv) 14896 } 14897 14898 case "DisplayName": 14899 if value != nil { 14900 jtv, ok := value.(string) 14901 if !ok { 14902 return fmt.Errorf("expected DisplayName to be of type string, got %T instead", value) 14903 } 14904 sv.DisplayName = ptr.String(jtv) 14905 } 14906 14907 case "TopicName": 14908 if value != nil { 14909 jtv, ok := value.(string) 14910 if !ok { 14911 return fmt.Errorf("expected TopicName to be of type string, got %T instead", value) 14912 } 14913 sv.TopicName = ptr.String(jtv) 14914 } 14915 14916 default: 14917 _, _ = key, value 14918 14919 } 14920 } 14921 *v = sv 14922 return nil 14923} 14924 14925func awsRestjson1_deserializeDocumentTopicPreference(v **types.TopicPreference, value interface{}) error { 14926 if v == nil { 14927 return fmt.Errorf("unexpected nil of type %T", v) 14928 } 14929 if value == nil { 14930 return nil 14931 } 14932 14933 shape, ok := value.(map[string]interface{}) 14934 if !ok { 14935 return fmt.Errorf("unexpected JSON type %v", value) 14936 } 14937 14938 var sv *types.TopicPreference 14939 if *v == nil { 14940 sv = &types.TopicPreference{} 14941 } else { 14942 sv = *v 14943 } 14944 14945 for key, value := range shape { 14946 switch key { 14947 case "SubscriptionStatus": 14948 if value != nil { 14949 jtv, ok := value.(string) 14950 if !ok { 14951 return fmt.Errorf("expected SubscriptionStatus to be of type string, got %T instead", value) 14952 } 14953 sv.SubscriptionStatus = types.SubscriptionStatus(jtv) 14954 } 14955 14956 case "TopicName": 14957 if value != nil { 14958 jtv, ok := value.(string) 14959 if !ok { 14960 return fmt.Errorf("expected TopicName to be of type string, got %T instead", value) 14961 } 14962 sv.TopicName = ptr.String(jtv) 14963 } 14964 14965 default: 14966 _, _ = key, value 14967 14968 } 14969 } 14970 *v = sv 14971 return nil 14972} 14973 14974func awsRestjson1_deserializeDocumentTopicPreferenceList(v *[]types.TopicPreference, value interface{}) error { 14975 if v == nil { 14976 return fmt.Errorf("unexpected nil of type %T", v) 14977 } 14978 if value == nil { 14979 return nil 14980 } 14981 14982 shape, ok := value.([]interface{}) 14983 if !ok { 14984 return fmt.Errorf("unexpected JSON type %v", value) 14985 } 14986 14987 var cv []types.TopicPreference 14988 if *v == nil { 14989 cv = []types.TopicPreference{} 14990 } else { 14991 cv = *v 14992 } 14993 14994 for _, value := range shape { 14995 var col types.TopicPreference 14996 destAddr := &col 14997 if err := awsRestjson1_deserializeDocumentTopicPreference(&destAddr, value); err != nil { 14998 return err 14999 } 15000 col = *destAddr 15001 cv = append(cv, col) 15002 15003 } 15004 *v = cv 15005 return nil 15006} 15007 15008func awsRestjson1_deserializeDocumentTopics(v *[]types.Topic, value interface{}) error { 15009 if v == nil { 15010 return fmt.Errorf("unexpected nil of type %T", v) 15011 } 15012 if value == nil { 15013 return nil 15014 } 15015 15016 shape, ok := value.([]interface{}) 15017 if !ok { 15018 return fmt.Errorf("unexpected JSON type %v", value) 15019 } 15020 15021 var cv []types.Topic 15022 if *v == nil { 15023 cv = []types.Topic{} 15024 } else { 15025 cv = *v 15026 } 15027 15028 for _, value := range shape { 15029 var col types.Topic 15030 destAddr := &col 15031 if err := awsRestjson1_deserializeDocumentTopic(&destAddr, value); err != nil { 15032 return err 15033 } 15034 col = *destAddr 15035 cv = append(cv, col) 15036 15037 } 15038 *v = cv 15039 return nil 15040} 15041 15042func awsRestjson1_deserializeDocumentTrackingOptions(v **types.TrackingOptions, value interface{}) error { 15043 if v == nil { 15044 return fmt.Errorf("unexpected nil of type %T", v) 15045 } 15046 if value == nil { 15047 return nil 15048 } 15049 15050 shape, ok := value.(map[string]interface{}) 15051 if !ok { 15052 return fmt.Errorf("unexpected JSON type %v", value) 15053 } 15054 15055 var sv *types.TrackingOptions 15056 if *v == nil { 15057 sv = &types.TrackingOptions{} 15058 } else { 15059 sv = *v 15060 } 15061 15062 for key, value := range shape { 15063 switch key { 15064 case "CustomRedirectDomain": 15065 if value != nil { 15066 jtv, ok := value.(string) 15067 if !ok { 15068 return fmt.Errorf("expected CustomRedirectDomain to be of type string, got %T instead", value) 15069 } 15070 sv.CustomRedirectDomain = ptr.String(jtv) 15071 } 15072 15073 default: 15074 _, _ = key, value 15075 15076 } 15077 } 15078 *v = sv 15079 return nil 15080} 15081 15082func awsRestjson1_deserializeDocumentVolumeStatistics(v **types.VolumeStatistics, value interface{}) error { 15083 if v == nil { 15084 return fmt.Errorf("unexpected nil of type %T", v) 15085 } 15086 if value == nil { 15087 return nil 15088 } 15089 15090 shape, ok := value.(map[string]interface{}) 15091 if !ok { 15092 return fmt.Errorf("unexpected JSON type %v", value) 15093 } 15094 15095 var sv *types.VolumeStatistics 15096 if *v == nil { 15097 sv = &types.VolumeStatistics{} 15098 } else { 15099 sv = *v 15100 } 15101 15102 for key, value := range shape { 15103 switch key { 15104 case "InboxRawCount": 15105 if value != nil { 15106 jtv, ok := value.(json.Number) 15107 if !ok { 15108 return fmt.Errorf("expected Volume to be json.Number, got %T instead", value) 15109 } 15110 i64, err := jtv.Int64() 15111 if err != nil { 15112 return err 15113 } 15114 sv.InboxRawCount = ptr.Int64(i64) 15115 } 15116 15117 case "ProjectedInbox": 15118 if value != nil { 15119 jtv, ok := value.(json.Number) 15120 if !ok { 15121 return fmt.Errorf("expected Volume to be json.Number, got %T instead", value) 15122 } 15123 i64, err := jtv.Int64() 15124 if err != nil { 15125 return err 15126 } 15127 sv.ProjectedInbox = ptr.Int64(i64) 15128 } 15129 15130 case "ProjectedSpam": 15131 if value != nil { 15132 jtv, ok := value.(json.Number) 15133 if !ok { 15134 return fmt.Errorf("expected Volume to be json.Number, got %T instead", value) 15135 } 15136 i64, err := jtv.Int64() 15137 if err != nil { 15138 return err 15139 } 15140 sv.ProjectedSpam = ptr.Int64(i64) 15141 } 15142 15143 case "SpamRawCount": 15144 if value != nil { 15145 jtv, ok := value.(json.Number) 15146 if !ok { 15147 return fmt.Errorf("expected Volume to be json.Number, got %T instead", value) 15148 } 15149 i64, err := jtv.Int64() 15150 if err != nil { 15151 return err 15152 } 15153 sv.SpamRawCount = ptr.Int64(i64) 15154 } 15155 15156 default: 15157 _, _ = key, value 15158 15159 } 15160 } 15161 *v = sv 15162 return nil 15163} 15164