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