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