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