14247 lines
360 KiB
Go
14247 lines
360 KiB
Go
// Code generated by smithy-go-codegen DO NOT EDIT.
|
|
|
|
package ecr
|
|
|
|
import (
|
|
"bytes"
|
|
"context"
|
|
"encoding/json"
|
|
"fmt"
|
|
"github.com/aws/aws-sdk-go-v2/aws/protocol/restjson"
|
|
"github.com/aws/aws-sdk-go-v2/service/ecr/types"
|
|
smithy "github.com/aws/smithy-go"
|
|
smithyio "github.com/aws/smithy-go/io"
|
|
"github.com/aws/smithy-go/middleware"
|
|
"github.com/aws/smithy-go/ptr"
|
|
smithytime "github.com/aws/smithy-go/time"
|
|
smithyhttp "github.com/aws/smithy-go/transport/http"
|
|
"io"
|
|
"math"
|
|
"strings"
|
|
)
|
|
|
|
type awsAwsjson11_deserializeOpBatchCheckLayerAvailability struct {
|
|
}
|
|
|
|
func (*awsAwsjson11_deserializeOpBatchCheckLayerAvailability) ID() string {
|
|
return "OperationDeserializer"
|
|
}
|
|
|
|
func (m *awsAwsjson11_deserializeOpBatchCheckLayerAvailability) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
|
|
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
|
|
) {
|
|
out, metadata, err = next.HandleDeserialize(ctx, in)
|
|
if err != nil {
|
|
return out, metadata, err
|
|
}
|
|
|
|
response, ok := out.RawResponse.(*smithyhttp.Response)
|
|
if !ok {
|
|
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
|
|
}
|
|
|
|
if response.StatusCode < 200 || response.StatusCode >= 300 {
|
|
return out, metadata, awsAwsjson11_deserializeOpErrorBatchCheckLayerAvailability(response, &metadata)
|
|
}
|
|
output := &BatchCheckLayerAvailabilityOutput{}
|
|
out.Result = output
|
|
|
|
var buff [1024]byte
|
|
ringBuffer := smithyio.NewRingBuffer(buff[:])
|
|
|
|
body := io.TeeReader(response.Body, ringBuffer)
|
|
decoder := json.NewDecoder(body)
|
|
decoder.UseNumber()
|
|
var shape interface{}
|
|
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
err = &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
return out, metadata, err
|
|
}
|
|
|
|
err = awsAwsjson11_deserializeOpDocumentBatchCheckLayerAvailabilityOutput(&output, shape)
|
|
if err != nil {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
err = &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
return out, metadata, err
|
|
}
|
|
|
|
return out, metadata, err
|
|
}
|
|
|
|
func awsAwsjson11_deserializeOpErrorBatchCheckLayerAvailability(response *smithyhttp.Response, metadata *middleware.Metadata) error {
|
|
var errorBuffer bytes.Buffer
|
|
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
|
|
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
|
|
}
|
|
errorBody := bytes.NewReader(errorBuffer.Bytes())
|
|
|
|
errorCode := "UnknownError"
|
|
errorMessage := errorCode
|
|
|
|
headerCode := response.Header.Get("X-Amzn-ErrorType")
|
|
|
|
var buff [1024]byte
|
|
ringBuffer := smithyio.NewRingBuffer(buff[:])
|
|
|
|
body := io.TeeReader(errorBody, ringBuffer)
|
|
decoder := json.NewDecoder(body)
|
|
decoder.UseNumber()
|
|
bodyInfo, err := getProtocolErrorInfo(decoder)
|
|
if err != nil {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
err = &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
return err
|
|
}
|
|
|
|
errorBody.Seek(0, io.SeekStart)
|
|
if typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok {
|
|
errorCode = restjson.SanitizeErrorCode(typ)
|
|
}
|
|
if len(bodyInfo.Message) != 0 {
|
|
errorMessage = bodyInfo.Message
|
|
}
|
|
switch {
|
|
case strings.EqualFold("InvalidParameterException", errorCode):
|
|
return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody)
|
|
|
|
case strings.EqualFold("RepositoryNotFoundException", errorCode):
|
|
return awsAwsjson11_deserializeErrorRepositoryNotFoundException(response, errorBody)
|
|
|
|
case strings.EqualFold("ServerException", errorCode):
|
|
return awsAwsjson11_deserializeErrorServerException(response, errorBody)
|
|
|
|
default:
|
|
genericError := &smithy.GenericAPIError{
|
|
Code: errorCode,
|
|
Message: errorMessage,
|
|
}
|
|
return genericError
|
|
|
|
}
|
|
}
|
|
|
|
type awsAwsjson11_deserializeOpBatchDeleteImage struct {
|
|
}
|
|
|
|
func (*awsAwsjson11_deserializeOpBatchDeleteImage) ID() string {
|
|
return "OperationDeserializer"
|
|
}
|
|
|
|
func (m *awsAwsjson11_deserializeOpBatchDeleteImage) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
|
|
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
|
|
) {
|
|
out, metadata, err = next.HandleDeserialize(ctx, in)
|
|
if err != nil {
|
|
return out, metadata, err
|
|
}
|
|
|
|
response, ok := out.RawResponse.(*smithyhttp.Response)
|
|
if !ok {
|
|
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
|
|
}
|
|
|
|
if response.StatusCode < 200 || response.StatusCode >= 300 {
|
|
return out, metadata, awsAwsjson11_deserializeOpErrorBatchDeleteImage(response, &metadata)
|
|
}
|
|
output := &BatchDeleteImageOutput{}
|
|
out.Result = output
|
|
|
|
var buff [1024]byte
|
|
ringBuffer := smithyio.NewRingBuffer(buff[:])
|
|
|
|
body := io.TeeReader(response.Body, ringBuffer)
|
|
decoder := json.NewDecoder(body)
|
|
decoder.UseNumber()
|
|
var shape interface{}
|
|
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
err = &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
return out, metadata, err
|
|
}
|
|
|
|
err = awsAwsjson11_deserializeOpDocumentBatchDeleteImageOutput(&output, shape)
|
|
if err != nil {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
err = &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
return out, metadata, err
|
|
}
|
|
|
|
return out, metadata, err
|
|
}
|
|
|
|
func awsAwsjson11_deserializeOpErrorBatchDeleteImage(response *smithyhttp.Response, metadata *middleware.Metadata) error {
|
|
var errorBuffer bytes.Buffer
|
|
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
|
|
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
|
|
}
|
|
errorBody := bytes.NewReader(errorBuffer.Bytes())
|
|
|
|
errorCode := "UnknownError"
|
|
errorMessage := errorCode
|
|
|
|
headerCode := response.Header.Get("X-Amzn-ErrorType")
|
|
|
|
var buff [1024]byte
|
|
ringBuffer := smithyio.NewRingBuffer(buff[:])
|
|
|
|
body := io.TeeReader(errorBody, ringBuffer)
|
|
decoder := json.NewDecoder(body)
|
|
decoder.UseNumber()
|
|
bodyInfo, err := getProtocolErrorInfo(decoder)
|
|
if err != nil {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
err = &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
return err
|
|
}
|
|
|
|
errorBody.Seek(0, io.SeekStart)
|
|
if typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok {
|
|
errorCode = restjson.SanitizeErrorCode(typ)
|
|
}
|
|
if len(bodyInfo.Message) != 0 {
|
|
errorMessage = bodyInfo.Message
|
|
}
|
|
switch {
|
|
case strings.EqualFold("InvalidParameterException", errorCode):
|
|
return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody)
|
|
|
|
case strings.EqualFold("RepositoryNotFoundException", errorCode):
|
|
return awsAwsjson11_deserializeErrorRepositoryNotFoundException(response, errorBody)
|
|
|
|
case strings.EqualFold("ServerException", errorCode):
|
|
return awsAwsjson11_deserializeErrorServerException(response, errorBody)
|
|
|
|
default:
|
|
genericError := &smithy.GenericAPIError{
|
|
Code: errorCode,
|
|
Message: errorMessage,
|
|
}
|
|
return genericError
|
|
|
|
}
|
|
}
|
|
|
|
type awsAwsjson11_deserializeOpBatchGetImage struct {
|
|
}
|
|
|
|
func (*awsAwsjson11_deserializeOpBatchGetImage) ID() string {
|
|
return "OperationDeserializer"
|
|
}
|
|
|
|
func (m *awsAwsjson11_deserializeOpBatchGetImage) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
|
|
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
|
|
) {
|
|
out, metadata, err = next.HandleDeserialize(ctx, in)
|
|
if err != nil {
|
|
return out, metadata, err
|
|
}
|
|
|
|
response, ok := out.RawResponse.(*smithyhttp.Response)
|
|
if !ok {
|
|
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
|
|
}
|
|
|
|
if response.StatusCode < 200 || response.StatusCode >= 300 {
|
|
return out, metadata, awsAwsjson11_deserializeOpErrorBatchGetImage(response, &metadata)
|
|
}
|
|
output := &BatchGetImageOutput{}
|
|
out.Result = output
|
|
|
|
var buff [1024]byte
|
|
ringBuffer := smithyio.NewRingBuffer(buff[:])
|
|
|
|
body := io.TeeReader(response.Body, ringBuffer)
|
|
decoder := json.NewDecoder(body)
|
|
decoder.UseNumber()
|
|
var shape interface{}
|
|
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
err = &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
return out, metadata, err
|
|
}
|
|
|
|
err = awsAwsjson11_deserializeOpDocumentBatchGetImageOutput(&output, shape)
|
|
if err != nil {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
err = &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
return out, metadata, err
|
|
}
|
|
|
|
return out, metadata, err
|
|
}
|
|
|
|
func awsAwsjson11_deserializeOpErrorBatchGetImage(response *smithyhttp.Response, metadata *middleware.Metadata) error {
|
|
var errorBuffer bytes.Buffer
|
|
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
|
|
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
|
|
}
|
|
errorBody := bytes.NewReader(errorBuffer.Bytes())
|
|
|
|
errorCode := "UnknownError"
|
|
errorMessage := errorCode
|
|
|
|
headerCode := response.Header.Get("X-Amzn-ErrorType")
|
|
|
|
var buff [1024]byte
|
|
ringBuffer := smithyio.NewRingBuffer(buff[:])
|
|
|
|
body := io.TeeReader(errorBody, ringBuffer)
|
|
decoder := json.NewDecoder(body)
|
|
decoder.UseNumber()
|
|
bodyInfo, err := getProtocolErrorInfo(decoder)
|
|
if err != nil {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
err = &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
return err
|
|
}
|
|
|
|
errorBody.Seek(0, io.SeekStart)
|
|
if typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok {
|
|
errorCode = restjson.SanitizeErrorCode(typ)
|
|
}
|
|
if len(bodyInfo.Message) != 0 {
|
|
errorMessage = bodyInfo.Message
|
|
}
|
|
switch {
|
|
case strings.EqualFold("InvalidParameterException", errorCode):
|
|
return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody)
|
|
|
|
case strings.EqualFold("LimitExceededException", errorCode):
|
|
return awsAwsjson11_deserializeErrorLimitExceededException(response, errorBody)
|
|
|
|
case strings.EqualFold("RepositoryNotFoundException", errorCode):
|
|
return awsAwsjson11_deserializeErrorRepositoryNotFoundException(response, errorBody)
|
|
|
|
case strings.EqualFold("ServerException", errorCode):
|
|
return awsAwsjson11_deserializeErrorServerException(response, errorBody)
|
|
|
|
case strings.EqualFold("UnableToGetUpstreamImageException", errorCode):
|
|
return awsAwsjson11_deserializeErrorUnableToGetUpstreamImageException(response, errorBody)
|
|
|
|
default:
|
|
genericError := &smithy.GenericAPIError{
|
|
Code: errorCode,
|
|
Message: errorMessage,
|
|
}
|
|
return genericError
|
|
|
|
}
|
|
}
|
|
|
|
type awsAwsjson11_deserializeOpBatchGetRepositoryScanningConfiguration struct {
|
|
}
|
|
|
|
func (*awsAwsjson11_deserializeOpBatchGetRepositoryScanningConfiguration) ID() string {
|
|
return "OperationDeserializer"
|
|
}
|
|
|
|
func (m *awsAwsjson11_deserializeOpBatchGetRepositoryScanningConfiguration) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
|
|
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
|
|
) {
|
|
out, metadata, err = next.HandleDeserialize(ctx, in)
|
|
if err != nil {
|
|
return out, metadata, err
|
|
}
|
|
|
|
response, ok := out.RawResponse.(*smithyhttp.Response)
|
|
if !ok {
|
|
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
|
|
}
|
|
|
|
if response.StatusCode < 200 || response.StatusCode >= 300 {
|
|
return out, metadata, awsAwsjson11_deserializeOpErrorBatchGetRepositoryScanningConfiguration(response, &metadata)
|
|
}
|
|
output := &BatchGetRepositoryScanningConfigurationOutput{}
|
|
out.Result = output
|
|
|
|
var buff [1024]byte
|
|
ringBuffer := smithyio.NewRingBuffer(buff[:])
|
|
|
|
body := io.TeeReader(response.Body, ringBuffer)
|
|
decoder := json.NewDecoder(body)
|
|
decoder.UseNumber()
|
|
var shape interface{}
|
|
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
err = &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
return out, metadata, err
|
|
}
|
|
|
|
err = awsAwsjson11_deserializeOpDocumentBatchGetRepositoryScanningConfigurationOutput(&output, shape)
|
|
if err != nil {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
err = &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
return out, metadata, err
|
|
}
|
|
|
|
return out, metadata, err
|
|
}
|
|
|
|
func awsAwsjson11_deserializeOpErrorBatchGetRepositoryScanningConfiguration(response *smithyhttp.Response, metadata *middleware.Metadata) error {
|
|
var errorBuffer bytes.Buffer
|
|
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
|
|
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
|
|
}
|
|
errorBody := bytes.NewReader(errorBuffer.Bytes())
|
|
|
|
errorCode := "UnknownError"
|
|
errorMessage := errorCode
|
|
|
|
headerCode := response.Header.Get("X-Amzn-ErrorType")
|
|
|
|
var buff [1024]byte
|
|
ringBuffer := smithyio.NewRingBuffer(buff[:])
|
|
|
|
body := io.TeeReader(errorBody, ringBuffer)
|
|
decoder := json.NewDecoder(body)
|
|
decoder.UseNumber()
|
|
bodyInfo, err := getProtocolErrorInfo(decoder)
|
|
if err != nil {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
err = &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
return err
|
|
}
|
|
|
|
errorBody.Seek(0, io.SeekStart)
|
|
if typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok {
|
|
errorCode = restjson.SanitizeErrorCode(typ)
|
|
}
|
|
if len(bodyInfo.Message) != 0 {
|
|
errorMessage = bodyInfo.Message
|
|
}
|
|
switch {
|
|
case strings.EqualFold("InvalidParameterException", errorCode):
|
|
return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody)
|
|
|
|
case strings.EqualFold("RepositoryNotFoundException", errorCode):
|
|
return awsAwsjson11_deserializeErrorRepositoryNotFoundException(response, errorBody)
|
|
|
|
case strings.EqualFold("ServerException", errorCode):
|
|
return awsAwsjson11_deserializeErrorServerException(response, errorBody)
|
|
|
|
case strings.EqualFold("ValidationException", errorCode):
|
|
return awsAwsjson11_deserializeErrorValidationException(response, errorBody)
|
|
|
|
default:
|
|
genericError := &smithy.GenericAPIError{
|
|
Code: errorCode,
|
|
Message: errorMessage,
|
|
}
|
|
return genericError
|
|
|
|
}
|
|
}
|
|
|
|
type awsAwsjson11_deserializeOpCompleteLayerUpload struct {
|
|
}
|
|
|
|
func (*awsAwsjson11_deserializeOpCompleteLayerUpload) ID() string {
|
|
return "OperationDeserializer"
|
|
}
|
|
|
|
func (m *awsAwsjson11_deserializeOpCompleteLayerUpload) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
|
|
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
|
|
) {
|
|
out, metadata, err = next.HandleDeserialize(ctx, in)
|
|
if err != nil {
|
|
return out, metadata, err
|
|
}
|
|
|
|
response, ok := out.RawResponse.(*smithyhttp.Response)
|
|
if !ok {
|
|
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
|
|
}
|
|
|
|
if response.StatusCode < 200 || response.StatusCode >= 300 {
|
|
return out, metadata, awsAwsjson11_deserializeOpErrorCompleteLayerUpload(response, &metadata)
|
|
}
|
|
output := &CompleteLayerUploadOutput{}
|
|
out.Result = output
|
|
|
|
var buff [1024]byte
|
|
ringBuffer := smithyio.NewRingBuffer(buff[:])
|
|
|
|
body := io.TeeReader(response.Body, ringBuffer)
|
|
decoder := json.NewDecoder(body)
|
|
decoder.UseNumber()
|
|
var shape interface{}
|
|
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
err = &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
return out, metadata, err
|
|
}
|
|
|
|
err = awsAwsjson11_deserializeOpDocumentCompleteLayerUploadOutput(&output, shape)
|
|
if err != nil {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
err = &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
return out, metadata, err
|
|
}
|
|
|
|
return out, metadata, err
|
|
}
|
|
|
|
func awsAwsjson11_deserializeOpErrorCompleteLayerUpload(response *smithyhttp.Response, metadata *middleware.Metadata) error {
|
|
var errorBuffer bytes.Buffer
|
|
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
|
|
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
|
|
}
|
|
errorBody := bytes.NewReader(errorBuffer.Bytes())
|
|
|
|
errorCode := "UnknownError"
|
|
errorMessage := errorCode
|
|
|
|
headerCode := response.Header.Get("X-Amzn-ErrorType")
|
|
|
|
var buff [1024]byte
|
|
ringBuffer := smithyio.NewRingBuffer(buff[:])
|
|
|
|
body := io.TeeReader(errorBody, ringBuffer)
|
|
decoder := json.NewDecoder(body)
|
|
decoder.UseNumber()
|
|
bodyInfo, err := getProtocolErrorInfo(decoder)
|
|
if err != nil {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
err = &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
return err
|
|
}
|
|
|
|
errorBody.Seek(0, io.SeekStart)
|
|
if typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok {
|
|
errorCode = restjson.SanitizeErrorCode(typ)
|
|
}
|
|
if len(bodyInfo.Message) != 0 {
|
|
errorMessage = bodyInfo.Message
|
|
}
|
|
switch {
|
|
case strings.EqualFold("EmptyUploadException", errorCode):
|
|
return awsAwsjson11_deserializeErrorEmptyUploadException(response, errorBody)
|
|
|
|
case strings.EqualFold("InvalidLayerException", errorCode):
|
|
return awsAwsjson11_deserializeErrorInvalidLayerException(response, errorBody)
|
|
|
|
case strings.EqualFold("InvalidParameterException", errorCode):
|
|
return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody)
|
|
|
|
case strings.EqualFold("KmsException", errorCode):
|
|
return awsAwsjson11_deserializeErrorKmsException(response, errorBody)
|
|
|
|
case strings.EqualFold("LayerAlreadyExistsException", errorCode):
|
|
return awsAwsjson11_deserializeErrorLayerAlreadyExistsException(response, errorBody)
|
|
|
|
case strings.EqualFold("LayerPartTooSmallException", errorCode):
|
|
return awsAwsjson11_deserializeErrorLayerPartTooSmallException(response, errorBody)
|
|
|
|
case strings.EqualFold("RepositoryNotFoundException", errorCode):
|
|
return awsAwsjson11_deserializeErrorRepositoryNotFoundException(response, errorBody)
|
|
|
|
case strings.EqualFold("ServerException", errorCode):
|
|
return awsAwsjson11_deserializeErrorServerException(response, errorBody)
|
|
|
|
case strings.EqualFold("UploadNotFoundException", errorCode):
|
|
return awsAwsjson11_deserializeErrorUploadNotFoundException(response, errorBody)
|
|
|
|
default:
|
|
genericError := &smithy.GenericAPIError{
|
|
Code: errorCode,
|
|
Message: errorMessage,
|
|
}
|
|
return genericError
|
|
|
|
}
|
|
}
|
|
|
|
type awsAwsjson11_deserializeOpCreatePullThroughCacheRule struct {
|
|
}
|
|
|
|
func (*awsAwsjson11_deserializeOpCreatePullThroughCacheRule) ID() string {
|
|
return "OperationDeserializer"
|
|
}
|
|
|
|
func (m *awsAwsjson11_deserializeOpCreatePullThroughCacheRule) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
|
|
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
|
|
) {
|
|
out, metadata, err = next.HandleDeserialize(ctx, in)
|
|
if err != nil {
|
|
return out, metadata, err
|
|
}
|
|
|
|
response, ok := out.RawResponse.(*smithyhttp.Response)
|
|
if !ok {
|
|
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
|
|
}
|
|
|
|
if response.StatusCode < 200 || response.StatusCode >= 300 {
|
|
return out, metadata, awsAwsjson11_deserializeOpErrorCreatePullThroughCacheRule(response, &metadata)
|
|
}
|
|
output := &CreatePullThroughCacheRuleOutput{}
|
|
out.Result = output
|
|
|
|
var buff [1024]byte
|
|
ringBuffer := smithyio.NewRingBuffer(buff[:])
|
|
|
|
body := io.TeeReader(response.Body, ringBuffer)
|
|
decoder := json.NewDecoder(body)
|
|
decoder.UseNumber()
|
|
var shape interface{}
|
|
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
err = &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
return out, metadata, err
|
|
}
|
|
|
|
err = awsAwsjson11_deserializeOpDocumentCreatePullThroughCacheRuleOutput(&output, shape)
|
|
if err != nil {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
err = &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
return out, metadata, err
|
|
}
|
|
|
|
return out, metadata, err
|
|
}
|
|
|
|
func awsAwsjson11_deserializeOpErrorCreatePullThroughCacheRule(response *smithyhttp.Response, metadata *middleware.Metadata) error {
|
|
var errorBuffer bytes.Buffer
|
|
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
|
|
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
|
|
}
|
|
errorBody := bytes.NewReader(errorBuffer.Bytes())
|
|
|
|
errorCode := "UnknownError"
|
|
errorMessage := errorCode
|
|
|
|
headerCode := response.Header.Get("X-Amzn-ErrorType")
|
|
|
|
var buff [1024]byte
|
|
ringBuffer := smithyio.NewRingBuffer(buff[:])
|
|
|
|
body := io.TeeReader(errorBody, ringBuffer)
|
|
decoder := json.NewDecoder(body)
|
|
decoder.UseNumber()
|
|
bodyInfo, err := getProtocolErrorInfo(decoder)
|
|
if err != nil {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
err = &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
return err
|
|
}
|
|
|
|
errorBody.Seek(0, io.SeekStart)
|
|
if typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok {
|
|
errorCode = restjson.SanitizeErrorCode(typ)
|
|
}
|
|
if len(bodyInfo.Message) != 0 {
|
|
errorMessage = bodyInfo.Message
|
|
}
|
|
switch {
|
|
case strings.EqualFold("InvalidParameterException", errorCode):
|
|
return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody)
|
|
|
|
case strings.EqualFold("LimitExceededException", errorCode):
|
|
return awsAwsjson11_deserializeErrorLimitExceededException(response, errorBody)
|
|
|
|
case strings.EqualFold("PullThroughCacheRuleAlreadyExistsException", errorCode):
|
|
return awsAwsjson11_deserializeErrorPullThroughCacheRuleAlreadyExistsException(response, errorBody)
|
|
|
|
case strings.EqualFold("SecretNotFoundException", errorCode):
|
|
return awsAwsjson11_deserializeErrorSecretNotFoundException(response, errorBody)
|
|
|
|
case strings.EqualFold("ServerException", errorCode):
|
|
return awsAwsjson11_deserializeErrorServerException(response, errorBody)
|
|
|
|
case strings.EqualFold("UnableToAccessSecretException", errorCode):
|
|
return awsAwsjson11_deserializeErrorUnableToAccessSecretException(response, errorBody)
|
|
|
|
case strings.EqualFold("UnableToDecryptSecretValueException", errorCode):
|
|
return awsAwsjson11_deserializeErrorUnableToDecryptSecretValueException(response, errorBody)
|
|
|
|
case strings.EqualFold("UnsupportedUpstreamRegistryException", errorCode):
|
|
return awsAwsjson11_deserializeErrorUnsupportedUpstreamRegistryException(response, errorBody)
|
|
|
|
case strings.EqualFold("ValidationException", errorCode):
|
|
return awsAwsjson11_deserializeErrorValidationException(response, errorBody)
|
|
|
|
default:
|
|
genericError := &smithy.GenericAPIError{
|
|
Code: errorCode,
|
|
Message: errorMessage,
|
|
}
|
|
return genericError
|
|
|
|
}
|
|
}
|
|
|
|
type awsAwsjson11_deserializeOpCreateRepository struct {
|
|
}
|
|
|
|
func (*awsAwsjson11_deserializeOpCreateRepository) ID() string {
|
|
return "OperationDeserializer"
|
|
}
|
|
|
|
func (m *awsAwsjson11_deserializeOpCreateRepository) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
|
|
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
|
|
) {
|
|
out, metadata, err = next.HandleDeserialize(ctx, in)
|
|
if err != nil {
|
|
return out, metadata, err
|
|
}
|
|
|
|
response, ok := out.RawResponse.(*smithyhttp.Response)
|
|
if !ok {
|
|
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
|
|
}
|
|
|
|
if response.StatusCode < 200 || response.StatusCode >= 300 {
|
|
return out, metadata, awsAwsjson11_deserializeOpErrorCreateRepository(response, &metadata)
|
|
}
|
|
output := &CreateRepositoryOutput{}
|
|
out.Result = output
|
|
|
|
var buff [1024]byte
|
|
ringBuffer := smithyio.NewRingBuffer(buff[:])
|
|
|
|
body := io.TeeReader(response.Body, ringBuffer)
|
|
decoder := json.NewDecoder(body)
|
|
decoder.UseNumber()
|
|
var shape interface{}
|
|
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
err = &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
return out, metadata, err
|
|
}
|
|
|
|
err = awsAwsjson11_deserializeOpDocumentCreateRepositoryOutput(&output, shape)
|
|
if err != nil {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
err = &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
return out, metadata, err
|
|
}
|
|
|
|
return out, metadata, err
|
|
}
|
|
|
|
func awsAwsjson11_deserializeOpErrorCreateRepository(response *smithyhttp.Response, metadata *middleware.Metadata) error {
|
|
var errorBuffer bytes.Buffer
|
|
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
|
|
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
|
|
}
|
|
errorBody := bytes.NewReader(errorBuffer.Bytes())
|
|
|
|
errorCode := "UnknownError"
|
|
errorMessage := errorCode
|
|
|
|
headerCode := response.Header.Get("X-Amzn-ErrorType")
|
|
|
|
var buff [1024]byte
|
|
ringBuffer := smithyio.NewRingBuffer(buff[:])
|
|
|
|
body := io.TeeReader(errorBody, ringBuffer)
|
|
decoder := json.NewDecoder(body)
|
|
decoder.UseNumber()
|
|
bodyInfo, err := getProtocolErrorInfo(decoder)
|
|
if err != nil {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
err = &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
return err
|
|
}
|
|
|
|
errorBody.Seek(0, io.SeekStart)
|
|
if typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok {
|
|
errorCode = restjson.SanitizeErrorCode(typ)
|
|
}
|
|
if len(bodyInfo.Message) != 0 {
|
|
errorMessage = bodyInfo.Message
|
|
}
|
|
switch {
|
|
case strings.EqualFold("InvalidParameterException", errorCode):
|
|
return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody)
|
|
|
|
case strings.EqualFold("InvalidTagParameterException", errorCode):
|
|
return awsAwsjson11_deserializeErrorInvalidTagParameterException(response, errorBody)
|
|
|
|
case strings.EqualFold("KmsException", errorCode):
|
|
return awsAwsjson11_deserializeErrorKmsException(response, errorBody)
|
|
|
|
case strings.EqualFold("LimitExceededException", errorCode):
|
|
return awsAwsjson11_deserializeErrorLimitExceededException(response, errorBody)
|
|
|
|
case strings.EqualFold("RepositoryAlreadyExistsException", errorCode):
|
|
return awsAwsjson11_deserializeErrorRepositoryAlreadyExistsException(response, errorBody)
|
|
|
|
case strings.EqualFold("ServerException", errorCode):
|
|
return awsAwsjson11_deserializeErrorServerException(response, errorBody)
|
|
|
|
case strings.EqualFold("TooManyTagsException", errorCode):
|
|
return awsAwsjson11_deserializeErrorTooManyTagsException(response, errorBody)
|
|
|
|
default:
|
|
genericError := &smithy.GenericAPIError{
|
|
Code: errorCode,
|
|
Message: errorMessage,
|
|
}
|
|
return genericError
|
|
|
|
}
|
|
}
|
|
|
|
type awsAwsjson11_deserializeOpDeleteLifecyclePolicy struct {
|
|
}
|
|
|
|
func (*awsAwsjson11_deserializeOpDeleteLifecyclePolicy) ID() string {
|
|
return "OperationDeserializer"
|
|
}
|
|
|
|
func (m *awsAwsjson11_deserializeOpDeleteLifecyclePolicy) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
|
|
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
|
|
) {
|
|
out, metadata, err = next.HandleDeserialize(ctx, in)
|
|
if err != nil {
|
|
return out, metadata, err
|
|
}
|
|
|
|
response, ok := out.RawResponse.(*smithyhttp.Response)
|
|
if !ok {
|
|
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
|
|
}
|
|
|
|
if response.StatusCode < 200 || response.StatusCode >= 300 {
|
|
return out, metadata, awsAwsjson11_deserializeOpErrorDeleteLifecyclePolicy(response, &metadata)
|
|
}
|
|
output := &DeleteLifecyclePolicyOutput{}
|
|
out.Result = output
|
|
|
|
var buff [1024]byte
|
|
ringBuffer := smithyio.NewRingBuffer(buff[:])
|
|
|
|
body := io.TeeReader(response.Body, ringBuffer)
|
|
decoder := json.NewDecoder(body)
|
|
decoder.UseNumber()
|
|
var shape interface{}
|
|
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
err = &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
return out, metadata, err
|
|
}
|
|
|
|
err = awsAwsjson11_deserializeOpDocumentDeleteLifecyclePolicyOutput(&output, shape)
|
|
if err != nil {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
err = &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
return out, metadata, err
|
|
}
|
|
|
|
return out, metadata, err
|
|
}
|
|
|
|
func awsAwsjson11_deserializeOpErrorDeleteLifecyclePolicy(response *smithyhttp.Response, metadata *middleware.Metadata) error {
|
|
var errorBuffer bytes.Buffer
|
|
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
|
|
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
|
|
}
|
|
errorBody := bytes.NewReader(errorBuffer.Bytes())
|
|
|
|
errorCode := "UnknownError"
|
|
errorMessage := errorCode
|
|
|
|
headerCode := response.Header.Get("X-Amzn-ErrorType")
|
|
|
|
var buff [1024]byte
|
|
ringBuffer := smithyio.NewRingBuffer(buff[:])
|
|
|
|
body := io.TeeReader(errorBody, ringBuffer)
|
|
decoder := json.NewDecoder(body)
|
|
decoder.UseNumber()
|
|
bodyInfo, err := getProtocolErrorInfo(decoder)
|
|
if err != nil {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
err = &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
return err
|
|
}
|
|
|
|
errorBody.Seek(0, io.SeekStart)
|
|
if typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok {
|
|
errorCode = restjson.SanitizeErrorCode(typ)
|
|
}
|
|
if len(bodyInfo.Message) != 0 {
|
|
errorMessage = bodyInfo.Message
|
|
}
|
|
switch {
|
|
case strings.EqualFold("InvalidParameterException", errorCode):
|
|
return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody)
|
|
|
|
case strings.EqualFold("LifecyclePolicyNotFoundException", errorCode):
|
|
return awsAwsjson11_deserializeErrorLifecyclePolicyNotFoundException(response, errorBody)
|
|
|
|
case strings.EqualFold("RepositoryNotFoundException", errorCode):
|
|
return awsAwsjson11_deserializeErrorRepositoryNotFoundException(response, errorBody)
|
|
|
|
case strings.EqualFold("ServerException", errorCode):
|
|
return awsAwsjson11_deserializeErrorServerException(response, errorBody)
|
|
|
|
case strings.EqualFold("ValidationException", errorCode):
|
|
return awsAwsjson11_deserializeErrorValidationException(response, errorBody)
|
|
|
|
default:
|
|
genericError := &smithy.GenericAPIError{
|
|
Code: errorCode,
|
|
Message: errorMessage,
|
|
}
|
|
return genericError
|
|
|
|
}
|
|
}
|
|
|
|
type awsAwsjson11_deserializeOpDeletePullThroughCacheRule struct {
|
|
}
|
|
|
|
func (*awsAwsjson11_deserializeOpDeletePullThroughCacheRule) ID() string {
|
|
return "OperationDeserializer"
|
|
}
|
|
|
|
func (m *awsAwsjson11_deserializeOpDeletePullThroughCacheRule) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
|
|
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
|
|
) {
|
|
out, metadata, err = next.HandleDeserialize(ctx, in)
|
|
if err != nil {
|
|
return out, metadata, err
|
|
}
|
|
|
|
response, ok := out.RawResponse.(*smithyhttp.Response)
|
|
if !ok {
|
|
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
|
|
}
|
|
|
|
if response.StatusCode < 200 || response.StatusCode >= 300 {
|
|
return out, metadata, awsAwsjson11_deserializeOpErrorDeletePullThroughCacheRule(response, &metadata)
|
|
}
|
|
output := &DeletePullThroughCacheRuleOutput{}
|
|
out.Result = output
|
|
|
|
var buff [1024]byte
|
|
ringBuffer := smithyio.NewRingBuffer(buff[:])
|
|
|
|
body := io.TeeReader(response.Body, ringBuffer)
|
|
decoder := json.NewDecoder(body)
|
|
decoder.UseNumber()
|
|
var shape interface{}
|
|
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
err = &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
return out, metadata, err
|
|
}
|
|
|
|
err = awsAwsjson11_deserializeOpDocumentDeletePullThroughCacheRuleOutput(&output, shape)
|
|
if err != nil {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
err = &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
return out, metadata, err
|
|
}
|
|
|
|
return out, metadata, err
|
|
}
|
|
|
|
func awsAwsjson11_deserializeOpErrorDeletePullThroughCacheRule(response *smithyhttp.Response, metadata *middleware.Metadata) error {
|
|
var errorBuffer bytes.Buffer
|
|
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
|
|
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
|
|
}
|
|
errorBody := bytes.NewReader(errorBuffer.Bytes())
|
|
|
|
errorCode := "UnknownError"
|
|
errorMessage := errorCode
|
|
|
|
headerCode := response.Header.Get("X-Amzn-ErrorType")
|
|
|
|
var buff [1024]byte
|
|
ringBuffer := smithyio.NewRingBuffer(buff[:])
|
|
|
|
body := io.TeeReader(errorBody, ringBuffer)
|
|
decoder := json.NewDecoder(body)
|
|
decoder.UseNumber()
|
|
bodyInfo, err := getProtocolErrorInfo(decoder)
|
|
if err != nil {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
err = &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
return err
|
|
}
|
|
|
|
errorBody.Seek(0, io.SeekStart)
|
|
if typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok {
|
|
errorCode = restjson.SanitizeErrorCode(typ)
|
|
}
|
|
if len(bodyInfo.Message) != 0 {
|
|
errorMessage = bodyInfo.Message
|
|
}
|
|
switch {
|
|
case strings.EqualFold("InvalidParameterException", errorCode):
|
|
return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody)
|
|
|
|
case strings.EqualFold("PullThroughCacheRuleNotFoundException", errorCode):
|
|
return awsAwsjson11_deserializeErrorPullThroughCacheRuleNotFoundException(response, errorBody)
|
|
|
|
case strings.EqualFold("ServerException", errorCode):
|
|
return awsAwsjson11_deserializeErrorServerException(response, errorBody)
|
|
|
|
case strings.EqualFold("ValidationException", errorCode):
|
|
return awsAwsjson11_deserializeErrorValidationException(response, errorBody)
|
|
|
|
default:
|
|
genericError := &smithy.GenericAPIError{
|
|
Code: errorCode,
|
|
Message: errorMessage,
|
|
}
|
|
return genericError
|
|
|
|
}
|
|
}
|
|
|
|
type awsAwsjson11_deserializeOpDeleteRegistryPolicy struct {
|
|
}
|
|
|
|
func (*awsAwsjson11_deserializeOpDeleteRegistryPolicy) ID() string {
|
|
return "OperationDeserializer"
|
|
}
|
|
|
|
func (m *awsAwsjson11_deserializeOpDeleteRegistryPolicy) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
|
|
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
|
|
) {
|
|
out, metadata, err = next.HandleDeserialize(ctx, in)
|
|
if err != nil {
|
|
return out, metadata, err
|
|
}
|
|
|
|
response, ok := out.RawResponse.(*smithyhttp.Response)
|
|
if !ok {
|
|
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
|
|
}
|
|
|
|
if response.StatusCode < 200 || response.StatusCode >= 300 {
|
|
return out, metadata, awsAwsjson11_deserializeOpErrorDeleteRegistryPolicy(response, &metadata)
|
|
}
|
|
output := &DeleteRegistryPolicyOutput{}
|
|
out.Result = output
|
|
|
|
var buff [1024]byte
|
|
ringBuffer := smithyio.NewRingBuffer(buff[:])
|
|
|
|
body := io.TeeReader(response.Body, ringBuffer)
|
|
decoder := json.NewDecoder(body)
|
|
decoder.UseNumber()
|
|
var shape interface{}
|
|
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
err = &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
return out, metadata, err
|
|
}
|
|
|
|
err = awsAwsjson11_deserializeOpDocumentDeleteRegistryPolicyOutput(&output, shape)
|
|
if err != nil {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
err = &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
return out, metadata, err
|
|
}
|
|
|
|
return out, metadata, err
|
|
}
|
|
|
|
func awsAwsjson11_deserializeOpErrorDeleteRegistryPolicy(response *smithyhttp.Response, metadata *middleware.Metadata) error {
|
|
var errorBuffer bytes.Buffer
|
|
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
|
|
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
|
|
}
|
|
errorBody := bytes.NewReader(errorBuffer.Bytes())
|
|
|
|
errorCode := "UnknownError"
|
|
errorMessage := errorCode
|
|
|
|
headerCode := response.Header.Get("X-Amzn-ErrorType")
|
|
|
|
var buff [1024]byte
|
|
ringBuffer := smithyio.NewRingBuffer(buff[:])
|
|
|
|
body := io.TeeReader(errorBody, ringBuffer)
|
|
decoder := json.NewDecoder(body)
|
|
decoder.UseNumber()
|
|
bodyInfo, err := getProtocolErrorInfo(decoder)
|
|
if err != nil {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
err = &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
return err
|
|
}
|
|
|
|
errorBody.Seek(0, io.SeekStart)
|
|
if typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok {
|
|
errorCode = restjson.SanitizeErrorCode(typ)
|
|
}
|
|
if len(bodyInfo.Message) != 0 {
|
|
errorMessage = bodyInfo.Message
|
|
}
|
|
switch {
|
|
case strings.EqualFold("InvalidParameterException", errorCode):
|
|
return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody)
|
|
|
|
case strings.EqualFold("RegistryPolicyNotFoundException", errorCode):
|
|
return awsAwsjson11_deserializeErrorRegistryPolicyNotFoundException(response, errorBody)
|
|
|
|
case strings.EqualFold("ServerException", errorCode):
|
|
return awsAwsjson11_deserializeErrorServerException(response, errorBody)
|
|
|
|
case strings.EqualFold("ValidationException", errorCode):
|
|
return awsAwsjson11_deserializeErrorValidationException(response, errorBody)
|
|
|
|
default:
|
|
genericError := &smithy.GenericAPIError{
|
|
Code: errorCode,
|
|
Message: errorMessage,
|
|
}
|
|
return genericError
|
|
|
|
}
|
|
}
|
|
|
|
type awsAwsjson11_deserializeOpDeleteRepository struct {
|
|
}
|
|
|
|
func (*awsAwsjson11_deserializeOpDeleteRepository) ID() string {
|
|
return "OperationDeserializer"
|
|
}
|
|
|
|
func (m *awsAwsjson11_deserializeOpDeleteRepository) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
|
|
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
|
|
) {
|
|
out, metadata, err = next.HandleDeserialize(ctx, in)
|
|
if err != nil {
|
|
return out, metadata, err
|
|
}
|
|
|
|
response, ok := out.RawResponse.(*smithyhttp.Response)
|
|
if !ok {
|
|
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
|
|
}
|
|
|
|
if response.StatusCode < 200 || response.StatusCode >= 300 {
|
|
return out, metadata, awsAwsjson11_deserializeOpErrorDeleteRepository(response, &metadata)
|
|
}
|
|
output := &DeleteRepositoryOutput{}
|
|
out.Result = output
|
|
|
|
var buff [1024]byte
|
|
ringBuffer := smithyio.NewRingBuffer(buff[:])
|
|
|
|
body := io.TeeReader(response.Body, ringBuffer)
|
|
decoder := json.NewDecoder(body)
|
|
decoder.UseNumber()
|
|
var shape interface{}
|
|
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
err = &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
return out, metadata, err
|
|
}
|
|
|
|
err = awsAwsjson11_deserializeOpDocumentDeleteRepositoryOutput(&output, shape)
|
|
if err != nil {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
err = &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
return out, metadata, err
|
|
}
|
|
|
|
return out, metadata, err
|
|
}
|
|
|
|
func awsAwsjson11_deserializeOpErrorDeleteRepository(response *smithyhttp.Response, metadata *middleware.Metadata) error {
|
|
var errorBuffer bytes.Buffer
|
|
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
|
|
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
|
|
}
|
|
errorBody := bytes.NewReader(errorBuffer.Bytes())
|
|
|
|
errorCode := "UnknownError"
|
|
errorMessage := errorCode
|
|
|
|
headerCode := response.Header.Get("X-Amzn-ErrorType")
|
|
|
|
var buff [1024]byte
|
|
ringBuffer := smithyio.NewRingBuffer(buff[:])
|
|
|
|
body := io.TeeReader(errorBody, ringBuffer)
|
|
decoder := json.NewDecoder(body)
|
|
decoder.UseNumber()
|
|
bodyInfo, err := getProtocolErrorInfo(decoder)
|
|
if err != nil {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
err = &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
return err
|
|
}
|
|
|
|
errorBody.Seek(0, io.SeekStart)
|
|
if typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok {
|
|
errorCode = restjson.SanitizeErrorCode(typ)
|
|
}
|
|
if len(bodyInfo.Message) != 0 {
|
|
errorMessage = bodyInfo.Message
|
|
}
|
|
switch {
|
|
case strings.EqualFold("InvalidParameterException", errorCode):
|
|
return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody)
|
|
|
|
case strings.EqualFold("KmsException", errorCode):
|
|
return awsAwsjson11_deserializeErrorKmsException(response, errorBody)
|
|
|
|
case strings.EqualFold("RepositoryNotEmptyException", errorCode):
|
|
return awsAwsjson11_deserializeErrorRepositoryNotEmptyException(response, errorBody)
|
|
|
|
case strings.EqualFold("RepositoryNotFoundException", errorCode):
|
|
return awsAwsjson11_deserializeErrorRepositoryNotFoundException(response, errorBody)
|
|
|
|
case strings.EqualFold("ServerException", errorCode):
|
|
return awsAwsjson11_deserializeErrorServerException(response, errorBody)
|
|
|
|
default:
|
|
genericError := &smithy.GenericAPIError{
|
|
Code: errorCode,
|
|
Message: errorMessage,
|
|
}
|
|
return genericError
|
|
|
|
}
|
|
}
|
|
|
|
type awsAwsjson11_deserializeOpDeleteRepositoryPolicy struct {
|
|
}
|
|
|
|
func (*awsAwsjson11_deserializeOpDeleteRepositoryPolicy) ID() string {
|
|
return "OperationDeserializer"
|
|
}
|
|
|
|
func (m *awsAwsjson11_deserializeOpDeleteRepositoryPolicy) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
|
|
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
|
|
) {
|
|
out, metadata, err = next.HandleDeserialize(ctx, in)
|
|
if err != nil {
|
|
return out, metadata, err
|
|
}
|
|
|
|
response, ok := out.RawResponse.(*smithyhttp.Response)
|
|
if !ok {
|
|
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
|
|
}
|
|
|
|
if response.StatusCode < 200 || response.StatusCode >= 300 {
|
|
return out, metadata, awsAwsjson11_deserializeOpErrorDeleteRepositoryPolicy(response, &metadata)
|
|
}
|
|
output := &DeleteRepositoryPolicyOutput{}
|
|
out.Result = output
|
|
|
|
var buff [1024]byte
|
|
ringBuffer := smithyio.NewRingBuffer(buff[:])
|
|
|
|
body := io.TeeReader(response.Body, ringBuffer)
|
|
decoder := json.NewDecoder(body)
|
|
decoder.UseNumber()
|
|
var shape interface{}
|
|
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
err = &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
return out, metadata, err
|
|
}
|
|
|
|
err = awsAwsjson11_deserializeOpDocumentDeleteRepositoryPolicyOutput(&output, shape)
|
|
if err != nil {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
err = &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
return out, metadata, err
|
|
}
|
|
|
|
return out, metadata, err
|
|
}
|
|
|
|
func awsAwsjson11_deserializeOpErrorDeleteRepositoryPolicy(response *smithyhttp.Response, metadata *middleware.Metadata) error {
|
|
var errorBuffer bytes.Buffer
|
|
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
|
|
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
|
|
}
|
|
errorBody := bytes.NewReader(errorBuffer.Bytes())
|
|
|
|
errorCode := "UnknownError"
|
|
errorMessage := errorCode
|
|
|
|
headerCode := response.Header.Get("X-Amzn-ErrorType")
|
|
|
|
var buff [1024]byte
|
|
ringBuffer := smithyio.NewRingBuffer(buff[:])
|
|
|
|
body := io.TeeReader(errorBody, ringBuffer)
|
|
decoder := json.NewDecoder(body)
|
|
decoder.UseNumber()
|
|
bodyInfo, err := getProtocolErrorInfo(decoder)
|
|
if err != nil {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
err = &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
return err
|
|
}
|
|
|
|
errorBody.Seek(0, io.SeekStart)
|
|
if typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok {
|
|
errorCode = restjson.SanitizeErrorCode(typ)
|
|
}
|
|
if len(bodyInfo.Message) != 0 {
|
|
errorMessage = bodyInfo.Message
|
|
}
|
|
switch {
|
|
case strings.EqualFold("InvalidParameterException", errorCode):
|
|
return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody)
|
|
|
|
case strings.EqualFold("RepositoryNotFoundException", errorCode):
|
|
return awsAwsjson11_deserializeErrorRepositoryNotFoundException(response, errorBody)
|
|
|
|
case strings.EqualFold("RepositoryPolicyNotFoundException", errorCode):
|
|
return awsAwsjson11_deserializeErrorRepositoryPolicyNotFoundException(response, errorBody)
|
|
|
|
case strings.EqualFold("ServerException", errorCode):
|
|
return awsAwsjson11_deserializeErrorServerException(response, errorBody)
|
|
|
|
default:
|
|
genericError := &smithy.GenericAPIError{
|
|
Code: errorCode,
|
|
Message: errorMessage,
|
|
}
|
|
return genericError
|
|
|
|
}
|
|
}
|
|
|
|
type awsAwsjson11_deserializeOpDescribeImageReplicationStatus struct {
|
|
}
|
|
|
|
func (*awsAwsjson11_deserializeOpDescribeImageReplicationStatus) ID() string {
|
|
return "OperationDeserializer"
|
|
}
|
|
|
|
func (m *awsAwsjson11_deserializeOpDescribeImageReplicationStatus) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
|
|
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
|
|
) {
|
|
out, metadata, err = next.HandleDeserialize(ctx, in)
|
|
if err != nil {
|
|
return out, metadata, err
|
|
}
|
|
|
|
response, ok := out.RawResponse.(*smithyhttp.Response)
|
|
if !ok {
|
|
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
|
|
}
|
|
|
|
if response.StatusCode < 200 || response.StatusCode >= 300 {
|
|
return out, metadata, awsAwsjson11_deserializeOpErrorDescribeImageReplicationStatus(response, &metadata)
|
|
}
|
|
output := &DescribeImageReplicationStatusOutput{}
|
|
out.Result = output
|
|
|
|
var buff [1024]byte
|
|
ringBuffer := smithyio.NewRingBuffer(buff[:])
|
|
|
|
body := io.TeeReader(response.Body, ringBuffer)
|
|
decoder := json.NewDecoder(body)
|
|
decoder.UseNumber()
|
|
var shape interface{}
|
|
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
err = &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
return out, metadata, err
|
|
}
|
|
|
|
err = awsAwsjson11_deserializeOpDocumentDescribeImageReplicationStatusOutput(&output, shape)
|
|
if err != nil {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
err = &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
return out, metadata, err
|
|
}
|
|
|
|
return out, metadata, err
|
|
}
|
|
|
|
func awsAwsjson11_deserializeOpErrorDescribeImageReplicationStatus(response *smithyhttp.Response, metadata *middleware.Metadata) error {
|
|
var errorBuffer bytes.Buffer
|
|
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
|
|
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
|
|
}
|
|
errorBody := bytes.NewReader(errorBuffer.Bytes())
|
|
|
|
errorCode := "UnknownError"
|
|
errorMessage := errorCode
|
|
|
|
headerCode := response.Header.Get("X-Amzn-ErrorType")
|
|
|
|
var buff [1024]byte
|
|
ringBuffer := smithyio.NewRingBuffer(buff[:])
|
|
|
|
body := io.TeeReader(errorBody, ringBuffer)
|
|
decoder := json.NewDecoder(body)
|
|
decoder.UseNumber()
|
|
bodyInfo, err := getProtocolErrorInfo(decoder)
|
|
if err != nil {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
err = &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
return err
|
|
}
|
|
|
|
errorBody.Seek(0, io.SeekStart)
|
|
if typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok {
|
|
errorCode = restjson.SanitizeErrorCode(typ)
|
|
}
|
|
if len(bodyInfo.Message) != 0 {
|
|
errorMessage = bodyInfo.Message
|
|
}
|
|
switch {
|
|
case strings.EqualFold("ImageNotFoundException", errorCode):
|
|
return awsAwsjson11_deserializeErrorImageNotFoundException(response, errorBody)
|
|
|
|
case strings.EqualFold("InvalidParameterException", errorCode):
|
|
return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody)
|
|
|
|
case strings.EqualFold("RepositoryNotFoundException", errorCode):
|
|
return awsAwsjson11_deserializeErrorRepositoryNotFoundException(response, errorBody)
|
|
|
|
case strings.EqualFold("ServerException", errorCode):
|
|
return awsAwsjson11_deserializeErrorServerException(response, errorBody)
|
|
|
|
case strings.EqualFold("ValidationException", errorCode):
|
|
return awsAwsjson11_deserializeErrorValidationException(response, errorBody)
|
|
|
|
default:
|
|
genericError := &smithy.GenericAPIError{
|
|
Code: errorCode,
|
|
Message: errorMessage,
|
|
}
|
|
return genericError
|
|
|
|
}
|
|
}
|
|
|
|
type awsAwsjson11_deserializeOpDescribeImages struct {
|
|
}
|
|
|
|
func (*awsAwsjson11_deserializeOpDescribeImages) ID() string {
|
|
return "OperationDeserializer"
|
|
}
|
|
|
|
func (m *awsAwsjson11_deserializeOpDescribeImages) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
|
|
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
|
|
) {
|
|
out, metadata, err = next.HandleDeserialize(ctx, in)
|
|
if err != nil {
|
|
return out, metadata, err
|
|
}
|
|
|
|
response, ok := out.RawResponse.(*smithyhttp.Response)
|
|
if !ok {
|
|
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
|
|
}
|
|
|
|
if response.StatusCode < 200 || response.StatusCode >= 300 {
|
|
return out, metadata, awsAwsjson11_deserializeOpErrorDescribeImages(response, &metadata)
|
|
}
|
|
output := &DescribeImagesOutput{}
|
|
out.Result = output
|
|
|
|
var buff [1024]byte
|
|
ringBuffer := smithyio.NewRingBuffer(buff[:])
|
|
|
|
body := io.TeeReader(response.Body, ringBuffer)
|
|
decoder := json.NewDecoder(body)
|
|
decoder.UseNumber()
|
|
var shape interface{}
|
|
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
err = &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
return out, metadata, err
|
|
}
|
|
|
|
err = awsAwsjson11_deserializeOpDocumentDescribeImagesOutput(&output, shape)
|
|
if err != nil {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
err = &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
return out, metadata, err
|
|
}
|
|
|
|
return out, metadata, err
|
|
}
|
|
|
|
func awsAwsjson11_deserializeOpErrorDescribeImages(response *smithyhttp.Response, metadata *middleware.Metadata) error {
|
|
var errorBuffer bytes.Buffer
|
|
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
|
|
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
|
|
}
|
|
errorBody := bytes.NewReader(errorBuffer.Bytes())
|
|
|
|
errorCode := "UnknownError"
|
|
errorMessage := errorCode
|
|
|
|
headerCode := response.Header.Get("X-Amzn-ErrorType")
|
|
|
|
var buff [1024]byte
|
|
ringBuffer := smithyio.NewRingBuffer(buff[:])
|
|
|
|
body := io.TeeReader(errorBody, ringBuffer)
|
|
decoder := json.NewDecoder(body)
|
|
decoder.UseNumber()
|
|
bodyInfo, err := getProtocolErrorInfo(decoder)
|
|
if err != nil {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
err = &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
return err
|
|
}
|
|
|
|
errorBody.Seek(0, io.SeekStart)
|
|
if typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok {
|
|
errorCode = restjson.SanitizeErrorCode(typ)
|
|
}
|
|
if len(bodyInfo.Message) != 0 {
|
|
errorMessage = bodyInfo.Message
|
|
}
|
|
switch {
|
|
case strings.EqualFold("ImageNotFoundException", errorCode):
|
|
return awsAwsjson11_deserializeErrorImageNotFoundException(response, errorBody)
|
|
|
|
case strings.EqualFold("InvalidParameterException", errorCode):
|
|
return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody)
|
|
|
|
case strings.EqualFold("RepositoryNotFoundException", errorCode):
|
|
return awsAwsjson11_deserializeErrorRepositoryNotFoundException(response, errorBody)
|
|
|
|
case strings.EqualFold("ServerException", errorCode):
|
|
return awsAwsjson11_deserializeErrorServerException(response, errorBody)
|
|
|
|
default:
|
|
genericError := &smithy.GenericAPIError{
|
|
Code: errorCode,
|
|
Message: errorMessage,
|
|
}
|
|
return genericError
|
|
|
|
}
|
|
}
|
|
|
|
type awsAwsjson11_deserializeOpDescribeImageScanFindings struct {
|
|
}
|
|
|
|
func (*awsAwsjson11_deserializeOpDescribeImageScanFindings) ID() string {
|
|
return "OperationDeserializer"
|
|
}
|
|
|
|
func (m *awsAwsjson11_deserializeOpDescribeImageScanFindings) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
|
|
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
|
|
) {
|
|
out, metadata, err = next.HandleDeserialize(ctx, in)
|
|
if err != nil {
|
|
return out, metadata, err
|
|
}
|
|
|
|
response, ok := out.RawResponse.(*smithyhttp.Response)
|
|
if !ok {
|
|
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
|
|
}
|
|
|
|
if response.StatusCode < 200 || response.StatusCode >= 300 {
|
|
return out, metadata, awsAwsjson11_deserializeOpErrorDescribeImageScanFindings(response, &metadata)
|
|
}
|
|
output := &DescribeImageScanFindingsOutput{}
|
|
out.Result = output
|
|
|
|
var buff [1024]byte
|
|
ringBuffer := smithyio.NewRingBuffer(buff[:])
|
|
|
|
body := io.TeeReader(response.Body, ringBuffer)
|
|
decoder := json.NewDecoder(body)
|
|
decoder.UseNumber()
|
|
var shape interface{}
|
|
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
err = &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
return out, metadata, err
|
|
}
|
|
|
|
err = awsAwsjson11_deserializeOpDocumentDescribeImageScanFindingsOutput(&output, shape)
|
|
if err != nil {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
err = &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
return out, metadata, err
|
|
}
|
|
|
|
return out, metadata, err
|
|
}
|
|
|
|
func awsAwsjson11_deserializeOpErrorDescribeImageScanFindings(response *smithyhttp.Response, metadata *middleware.Metadata) error {
|
|
var errorBuffer bytes.Buffer
|
|
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
|
|
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
|
|
}
|
|
errorBody := bytes.NewReader(errorBuffer.Bytes())
|
|
|
|
errorCode := "UnknownError"
|
|
errorMessage := errorCode
|
|
|
|
headerCode := response.Header.Get("X-Amzn-ErrorType")
|
|
|
|
var buff [1024]byte
|
|
ringBuffer := smithyio.NewRingBuffer(buff[:])
|
|
|
|
body := io.TeeReader(errorBody, ringBuffer)
|
|
decoder := json.NewDecoder(body)
|
|
decoder.UseNumber()
|
|
bodyInfo, err := getProtocolErrorInfo(decoder)
|
|
if err != nil {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
err = &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
return err
|
|
}
|
|
|
|
errorBody.Seek(0, io.SeekStart)
|
|
if typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok {
|
|
errorCode = restjson.SanitizeErrorCode(typ)
|
|
}
|
|
if len(bodyInfo.Message) != 0 {
|
|
errorMessage = bodyInfo.Message
|
|
}
|
|
switch {
|
|
case strings.EqualFold("ImageNotFoundException", errorCode):
|
|
return awsAwsjson11_deserializeErrorImageNotFoundException(response, errorBody)
|
|
|
|
case strings.EqualFold("InvalidParameterException", errorCode):
|
|
return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody)
|
|
|
|
case strings.EqualFold("RepositoryNotFoundException", errorCode):
|
|
return awsAwsjson11_deserializeErrorRepositoryNotFoundException(response, errorBody)
|
|
|
|
case strings.EqualFold("ScanNotFoundException", errorCode):
|
|
return awsAwsjson11_deserializeErrorScanNotFoundException(response, errorBody)
|
|
|
|
case strings.EqualFold("ServerException", errorCode):
|
|
return awsAwsjson11_deserializeErrorServerException(response, errorBody)
|
|
|
|
case strings.EqualFold("ValidationException", errorCode):
|
|
return awsAwsjson11_deserializeErrorValidationException(response, errorBody)
|
|
|
|
default:
|
|
genericError := &smithy.GenericAPIError{
|
|
Code: errorCode,
|
|
Message: errorMessage,
|
|
}
|
|
return genericError
|
|
|
|
}
|
|
}
|
|
|
|
type awsAwsjson11_deserializeOpDescribePullThroughCacheRules struct {
|
|
}
|
|
|
|
func (*awsAwsjson11_deserializeOpDescribePullThroughCacheRules) ID() string {
|
|
return "OperationDeserializer"
|
|
}
|
|
|
|
func (m *awsAwsjson11_deserializeOpDescribePullThroughCacheRules) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
|
|
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
|
|
) {
|
|
out, metadata, err = next.HandleDeserialize(ctx, in)
|
|
if err != nil {
|
|
return out, metadata, err
|
|
}
|
|
|
|
response, ok := out.RawResponse.(*smithyhttp.Response)
|
|
if !ok {
|
|
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
|
|
}
|
|
|
|
if response.StatusCode < 200 || response.StatusCode >= 300 {
|
|
return out, metadata, awsAwsjson11_deserializeOpErrorDescribePullThroughCacheRules(response, &metadata)
|
|
}
|
|
output := &DescribePullThroughCacheRulesOutput{}
|
|
out.Result = output
|
|
|
|
var buff [1024]byte
|
|
ringBuffer := smithyio.NewRingBuffer(buff[:])
|
|
|
|
body := io.TeeReader(response.Body, ringBuffer)
|
|
decoder := json.NewDecoder(body)
|
|
decoder.UseNumber()
|
|
var shape interface{}
|
|
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
err = &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
return out, metadata, err
|
|
}
|
|
|
|
err = awsAwsjson11_deserializeOpDocumentDescribePullThroughCacheRulesOutput(&output, shape)
|
|
if err != nil {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
err = &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
return out, metadata, err
|
|
}
|
|
|
|
return out, metadata, err
|
|
}
|
|
|
|
func awsAwsjson11_deserializeOpErrorDescribePullThroughCacheRules(response *smithyhttp.Response, metadata *middleware.Metadata) error {
|
|
var errorBuffer bytes.Buffer
|
|
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
|
|
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
|
|
}
|
|
errorBody := bytes.NewReader(errorBuffer.Bytes())
|
|
|
|
errorCode := "UnknownError"
|
|
errorMessage := errorCode
|
|
|
|
headerCode := response.Header.Get("X-Amzn-ErrorType")
|
|
|
|
var buff [1024]byte
|
|
ringBuffer := smithyio.NewRingBuffer(buff[:])
|
|
|
|
body := io.TeeReader(errorBody, ringBuffer)
|
|
decoder := json.NewDecoder(body)
|
|
decoder.UseNumber()
|
|
bodyInfo, err := getProtocolErrorInfo(decoder)
|
|
if err != nil {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
err = &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
return err
|
|
}
|
|
|
|
errorBody.Seek(0, io.SeekStart)
|
|
if typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok {
|
|
errorCode = restjson.SanitizeErrorCode(typ)
|
|
}
|
|
if len(bodyInfo.Message) != 0 {
|
|
errorMessage = bodyInfo.Message
|
|
}
|
|
switch {
|
|
case strings.EqualFold("InvalidParameterException", errorCode):
|
|
return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody)
|
|
|
|
case strings.EqualFold("PullThroughCacheRuleNotFoundException", errorCode):
|
|
return awsAwsjson11_deserializeErrorPullThroughCacheRuleNotFoundException(response, errorBody)
|
|
|
|
case strings.EqualFold("ServerException", errorCode):
|
|
return awsAwsjson11_deserializeErrorServerException(response, errorBody)
|
|
|
|
case strings.EqualFold("ValidationException", errorCode):
|
|
return awsAwsjson11_deserializeErrorValidationException(response, errorBody)
|
|
|
|
default:
|
|
genericError := &smithy.GenericAPIError{
|
|
Code: errorCode,
|
|
Message: errorMessage,
|
|
}
|
|
return genericError
|
|
|
|
}
|
|
}
|
|
|
|
type awsAwsjson11_deserializeOpDescribeRegistry struct {
|
|
}
|
|
|
|
func (*awsAwsjson11_deserializeOpDescribeRegistry) ID() string {
|
|
return "OperationDeserializer"
|
|
}
|
|
|
|
func (m *awsAwsjson11_deserializeOpDescribeRegistry) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
|
|
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
|
|
) {
|
|
out, metadata, err = next.HandleDeserialize(ctx, in)
|
|
if err != nil {
|
|
return out, metadata, err
|
|
}
|
|
|
|
response, ok := out.RawResponse.(*smithyhttp.Response)
|
|
if !ok {
|
|
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
|
|
}
|
|
|
|
if response.StatusCode < 200 || response.StatusCode >= 300 {
|
|
return out, metadata, awsAwsjson11_deserializeOpErrorDescribeRegistry(response, &metadata)
|
|
}
|
|
output := &DescribeRegistryOutput{}
|
|
out.Result = output
|
|
|
|
var buff [1024]byte
|
|
ringBuffer := smithyio.NewRingBuffer(buff[:])
|
|
|
|
body := io.TeeReader(response.Body, ringBuffer)
|
|
decoder := json.NewDecoder(body)
|
|
decoder.UseNumber()
|
|
var shape interface{}
|
|
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
err = &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
return out, metadata, err
|
|
}
|
|
|
|
err = awsAwsjson11_deserializeOpDocumentDescribeRegistryOutput(&output, shape)
|
|
if err != nil {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
err = &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
return out, metadata, err
|
|
}
|
|
|
|
return out, metadata, err
|
|
}
|
|
|
|
func awsAwsjson11_deserializeOpErrorDescribeRegistry(response *smithyhttp.Response, metadata *middleware.Metadata) error {
|
|
var errorBuffer bytes.Buffer
|
|
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
|
|
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
|
|
}
|
|
errorBody := bytes.NewReader(errorBuffer.Bytes())
|
|
|
|
errorCode := "UnknownError"
|
|
errorMessage := errorCode
|
|
|
|
headerCode := response.Header.Get("X-Amzn-ErrorType")
|
|
|
|
var buff [1024]byte
|
|
ringBuffer := smithyio.NewRingBuffer(buff[:])
|
|
|
|
body := io.TeeReader(errorBody, ringBuffer)
|
|
decoder := json.NewDecoder(body)
|
|
decoder.UseNumber()
|
|
bodyInfo, err := getProtocolErrorInfo(decoder)
|
|
if err != nil {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
err = &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
return err
|
|
}
|
|
|
|
errorBody.Seek(0, io.SeekStart)
|
|
if typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok {
|
|
errorCode = restjson.SanitizeErrorCode(typ)
|
|
}
|
|
if len(bodyInfo.Message) != 0 {
|
|
errorMessage = bodyInfo.Message
|
|
}
|
|
switch {
|
|
case strings.EqualFold("InvalidParameterException", errorCode):
|
|
return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody)
|
|
|
|
case strings.EqualFold("ServerException", errorCode):
|
|
return awsAwsjson11_deserializeErrorServerException(response, errorBody)
|
|
|
|
case strings.EqualFold("ValidationException", errorCode):
|
|
return awsAwsjson11_deserializeErrorValidationException(response, errorBody)
|
|
|
|
default:
|
|
genericError := &smithy.GenericAPIError{
|
|
Code: errorCode,
|
|
Message: errorMessage,
|
|
}
|
|
return genericError
|
|
|
|
}
|
|
}
|
|
|
|
type awsAwsjson11_deserializeOpDescribeRepositories struct {
|
|
}
|
|
|
|
func (*awsAwsjson11_deserializeOpDescribeRepositories) ID() string {
|
|
return "OperationDeserializer"
|
|
}
|
|
|
|
func (m *awsAwsjson11_deserializeOpDescribeRepositories) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
|
|
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
|
|
) {
|
|
out, metadata, err = next.HandleDeserialize(ctx, in)
|
|
if err != nil {
|
|
return out, metadata, err
|
|
}
|
|
|
|
response, ok := out.RawResponse.(*smithyhttp.Response)
|
|
if !ok {
|
|
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
|
|
}
|
|
|
|
if response.StatusCode < 200 || response.StatusCode >= 300 {
|
|
return out, metadata, awsAwsjson11_deserializeOpErrorDescribeRepositories(response, &metadata)
|
|
}
|
|
output := &DescribeRepositoriesOutput{}
|
|
out.Result = output
|
|
|
|
var buff [1024]byte
|
|
ringBuffer := smithyio.NewRingBuffer(buff[:])
|
|
|
|
body := io.TeeReader(response.Body, ringBuffer)
|
|
decoder := json.NewDecoder(body)
|
|
decoder.UseNumber()
|
|
var shape interface{}
|
|
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
err = &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
return out, metadata, err
|
|
}
|
|
|
|
err = awsAwsjson11_deserializeOpDocumentDescribeRepositoriesOutput(&output, shape)
|
|
if err != nil {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
err = &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
return out, metadata, err
|
|
}
|
|
|
|
return out, metadata, err
|
|
}
|
|
|
|
func awsAwsjson11_deserializeOpErrorDescribeRepositories(response *smithyhttp.Response, metadata *middleware.Metadata) error {
|
|
var errorBuffer bytes.Buffer
|
|
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
|
|
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
|
|
}
|
|
errorBody := bytes.NewReader(errorBuffer.Bytes())
|
|
|
|
errorCode := "UnknownError"
|
|
errorMessage := errorCode
|
|
|
|
headerCode := response.Header.Get("X-Amzn-ErrorType")
|
|
|
|
var buff [1024]byte
|
|
ringBuffer := smithyio.NewRingBuffer(buff[:])
|
|
|
|
body := io.TeeReader(errorBody, ringBuffer)
|
|
decoder := json.NewDecoder(body)
|
|
decoder.UseNumber()
|
|
bodyInfo, err := getProtocolErrorInfo(decoder)
|
|
if err != nil {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
err = &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
return err
|
|
}
|
|
|
|
errorBody.Seek(0, io.SeekStart)
|
|
if typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok {
|
|
errorCode = restjson.SanitizeErrorCode(typ)
|
|
}
|
|
if len(bodyInfo.Message) != 0 {
|
|
errorMessage = bodyInfo.Message
|
|
}
|
|
switch {
|
|
case strings.EqualFold("InvalidParameterException", errorCode):
|
|
return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody)
|
|
|
|
case strings.EqualFold("RepositoryNotFoundException", errorCode):
|
|
return awsAwsjson11_deserializeErrorRepositoryNotFoundException(response, errorBody)
|
|
|
|
case strings.EqualFold("ServerException", errorCode):
|
|
return awsAwsjson11_deserializeErrorServerException(response, errorBody)
|
|
|
|
default:
|
|
genericError := &smithy.GenericAPIError{
|
|
Code: errorCode,
|
|
Message: errorMessage,
|
|
}
|
|
return genericError
|
|
|
|
}
|
|
}
|
|
|
|
type awsAwsjson11_deserializeOpGetAuthorizationToken struct {
|
|
}
|
|
|
|
func (*awsAwsjson11_deserializeOpGetAuthorizationToken) ID() string {
|
|
return "OperationDeserializer"
|
|
}
|
|
|
|
func (m *awsAwsjson11_deserializeOpGetAuthorizationToken) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
|
|
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
|
|
) {
|
|
out, metadata, err = next.HandleDeserialize(ctx, in)
|
|
if err != nil {
|
|
return out, metadata, err
|
|
}
|
|
|
|
response, ok := out.RawResponse.(*smithyhttp.Response)
|
|
if !ok {
|
|
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
|
|
}
|
|
|
|
if response.StatusCode < 200 || response.StatusCode >= 300 {
|
|
return out, metadata, awsAwsjson11_deserializeOpErrorGetAuthorizationToken(response, &metadata)
|
|
}
|
|
output := &GetAuthorizationTokenOutput{}
|
|
out.Result = output
|
|
|
|
var buff [1024]byte
|
|
ringBuffer := smithyio.NewRingBuffer(buff[:])
|
|
|
|
body := io.TeeReader(response.Body, ringBuffer)
|
|
decoder := json.NewDecoder(body)
|
|
decoder.UseNumber()
|
|
var shape interface{}
|
|
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
err = &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
return out, metadata, err
|
|
}
|
|
|
|
err = awsAwsjson11_deserializeOpDocumentGetAuthorizationTokenOutput(&output, shape)
|
|
if err != nil {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
err = &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
return out, metadata, err
|
|
}
|
|
|
|
return out, metadata, err
|
|
}
|
|
|
|
func awsAwsjson11_deserializeOpErrorGetAuthorizationToken(response *smithyhttp.Response, metadata *middleware.Metadata) error {
|
|
var errorBuffer bytes.Buffer
|
|
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
|
|
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
|
|
}
|
|
errorBody := bytes.NewReader(errorBuffer.Bytes())
|
|
|
|
errorCode := "UnknownError"
|
|
errorMessage := errorCode
|
|
|
|
headerCode := response.Header.Get("X-Amzn-ErrorType")
|
|
|
|
var buff [1024]byte
|
|
ringBuffer := smithyio.NewRingBuffer(buff[:])
|
|
|
|
body := io.TeeReader(errorBody, ringBuffer)
|
|
decoder := json.NewDecoder(body)
|
|
decoder.UseNumber()
|
|
bodyInfo, err := getProtocolErrorInfo(decoder)
|
|
if err != nil {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
err = &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
return err
|
|
}
|
|
|
|
errorBody.Seek(0, io.SeekStart)
|
|
if typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok {
|
|
errorCode = restjson.SanitizeErrorCode(typ)
|
|
}
|
|
if len(bodyInfo.Message) != 0 {
|
|
errorMessage = bodyInfo.Message
|
|
}
|
|
switch {
|
|
case strings.EqualFold("InvalidParameterException", errorCode):
|
|
return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody)
|
|
|
|
case strings.EqualFold("ServerException", errorCode):
|
|
return awsAwsjson11_deserializeErrorServerException(response, errorBody)
|
|
|
|
default:
|
|
genericError := &smithy.GenericAPIError{
|
|
Code: errorCode,
|
|
Message: errorMessage,
|
|
}
|
|
return genericError
|
|
|
|
}
|
|
}
|
|
|
|
type awsAwsjson11_deserializeOpGetDownloadUrlForLayer struct {
|
|
}
|
|
|
|
func (*awsAwsjson11_deserializeOpGetDownloadUrlForLayer) ID() string {
|
|
return "OperationDeserializer"
|
|
}
|
|
|
|
func (m *awsAwsjson11_deserializeOpGetDownloadUrlForLayer) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
|
|
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
|
|
) {
|
|
out, metadata, err = next.HandleDeserialize(ctx, in)
|
|
if err != nil {
|
|
return out, metadata, err
|
|
}
|
|
|
|
response, ok := out.RawResponse.(*smithyhttp.Response)
|
|
if !ok {
|
|
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
|
|
}
|
|
|
|
if response.StatusCode < 200 || response.StatusCode >= 300 {
|
|
return out, metadata, awsAwsjson11_deserializeOpErrorGetDownloadUrlForLayer(response, &metadata)
|
|
}
|
|
output := &GetDownloadUrlForLayerOutput{}
|
|
out.Result = output
|
|
|
|
var buff [1024]byte
|
|
ringBuffer := smithyio.NewRingBuffer(buff[:])
|
|
|
|
body := io.TeeReader(response.Body, ringBuffer)
|
|
decoder := json.NewDecoder(body)
|
|
decoder.UseNumber()
|
|
var shape interface{}
|
|
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
err = &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
return out, metadata, err
|
|
}
|
|
|
|
err = awsAwsjson11_deserializeOpDocumentGetDownloadUrlForLayerOutput(&output, shape)
|
|
if err != nil {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
err = &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
return out, metadata, err
|
|
}
|
|
|
|
return out, metadata, err
|
|
}
|
|
|
|
func awsAwsjson11_deserializeOpErrorGetDownloadUrlForLayer(response *smithyhttp.Response, metadata *middleware.Metadata) error {
|
|
var errorBuffer bytes.Buffer
|
|
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
|
|
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
|
|
}
|
|
errorBody := bytes.NewReader(errorBuffer.Bytes())
|
|
|
|
errorCode := "UnknownError"
|
|
errorMessage := errorCode
|
|
|
|
headerCode := response.Header.Get("X-Amzn-ErrorType")
|
|
|
|
var buff [1024]byte
|
|
ringBuffer := smithyio.NewRingBuffer(buff[:])
|
|
|
|
body := io.TeeReader(errorBody, ringBuffer)
|
|
decoder := json.NewDecoder(body)
|
|
decoder.UseNumber()
|
|
bodyInfo, err := getProtocolErrorInfo(decoder)
|
|
if err != nil {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
err = &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
return err
|
|
}
|
|
|
|
errorBody.Seek(0, io.SeekStart)
|
|
if typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok {
|
|
errorCode = restjson.SanitizeErrorCode(typ)
|
|
}
|
|
if len(bodyInfo.Message) != 0 {
|
|
errorMessage = bodyInfo.Message
|
|
}
|
|
switch {
|
|
case strings.EqualFold("InvalidParameterException", errorCode):
|
|
return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody)
|
|
|
|
case strings.EqualFold("LayerInaccessibleException", errorCode):
|
|
return awsAwsjson11_deserializeErrorLayerInaccessibleException(response, errorBody)
|
|
|
|
case strings.EqualFold("LayersNotFoundException", errorCode):
|
|
return awsAwsjson11_deserializeErrorLayersNotFoundException(response, errorBody)
|
|
|
|
case strings.EqualFold("RepositoryNotFoundException", errorCode):
|
|
return awsAwsjson11_deserializeErrorRepositoryNotFoundException(response, errorBody)
|
|
|
|
case strings.EqualFold("ServerException", errorCode):
|
|
return awsAwsjson11_deserializeErrorServerException(response, errorBody)
|
|
|
|
case strings.EqualFold("UnableToGetUpstreamLayerException", errorCode):
|
|
return awsAwsjson11_deserializeErrorUnableToGetUpstreamLayerException(response, errorBody)
|
|
|
|
default:
|
|
genericError := &smithy.GenericAPIError{
|
|
Code: errorCode,
|
|
Message: errorMessage,
|
|
}
|
|
return genericError
|
|
|
|
}
|
|
}
|
|
|
|
type awsAwsjson11_deserializeOpGetLifecyclePolicy struct {
|
|
}
|
|
|
|
func (*awsAwsjson11_deserializeOpGetLifecyclePolicy) ID() string {
|
|
return "OperationDeserializer"
|
|
}
|
|
|
|
func (m *awsAwsjson11_deserializeOpGetLifecyclePolicy) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
|
|
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
|
|
) {
|
|
out, metadata, err = next.HandleDeserialize(ctx, in)
|
|
if err != nil {
|
|
return out, metadata, err
|
|
}
|
|
|
|
response, ok := out.RawResponse.(*smithyhttp.Response)
|
|
if !ok {
|
|
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
|
|
}
|
|
|
|
if response.StatusCode < 200 || response.StatusCode >= 300 {
|
|
return out, metadata, awsAwsjson11_deserializeOpErrorGetLifecyclePolicy(response, &metadata)
|
|
}
|
|
output := &GetLifecyclePolicyOutput{}
|
|
out.Result = output
|
|
|
|
var buff [1024]byte
|
|
ringBuffer := smithyio.NewRingBuffer(buff[:])
|
|
|
|
body := io.TeeReader(response.Body, ringBuffer)
|
|
decoder := json.NewDecoder(body)
|
|
decoder.UseNumber()
|
|
var shape interface{}
|
|
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
err = &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
return out, metadata, err
|
|
}
|
|
|
|
err = awsAwsjson11_deserializeOpDocumentGetLifecyclePolicyOutput(&output, shape)
|
|
if err != nil {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
err = &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
return out, metadata, err
|
|
}
|
|
|
|
return out, metadata, err
|
|
}
|
|
|
|
func awsAwsjson11_deserializeOpErrorGetLifecyclePolicy(response *smithyhttp.Response, metadata *middleware.Metadata) error {
|
|
var errorBuffer bytes.Buffer
|
|
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
|
|
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
|
|
}
|
|
errorBody := bytes.NewReader(errorBuffer.Bytes())
|
|
|
|
errorCode := "UnknownError"
|
|
errorMessage := errorCode
|
|
|
|
headerCode := response.Header.Get("X-Amzn-ErrorType")
|
|
|
|
var buff [1024]byte
|
|
ringBuffer := smithyio.NewRingBuffer(buff[:])
|
|
|
|
body := io.TeeReader(errorBody, ringBuffer)
|
|
decoder := json.NewDecoder(body)
|
|
decoder.UseNumber()
|
|
bodyInfo, err := getProtocolErrorInfo(decoder)
|
|
if err != nil {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
err = &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
return err
|
|
}
|
|
|
|
errorBody.Seek(0, io.SeekStart)
|
|
if typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok {
|
|
errorCode = restjson.SanitizeErrorCode(typ)
|
|
}
|
|
if len(bodyInfo.Message) != 0 {
|
|
errorMessage = bodyInfo.Message
|
|
}
|
|
switch {
|
|
case strings.EqualFold("InvalidParameterException", errorCode):
|
|
return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody)
|
|
|
|
case strings.EqualFold("LifecyclePolicyNotFoundException", errorCode):
|
|
return awsAwsjson11_deserializeErrorLifecyclePolicyNotFoundException(response, errorBody)
|
|
|
|
case strings.EqualFold("RepositoryNotFoundException", errorCode):
|
|
return awsAwsjson11_deserializeErrorRepositoryNotFoundException(response, errorBody)
|
|
|
|
case strings.EqualFold("ServerException", errorCode):
|
|
return awsAwsjson11_deserializeErrorServerException(response, errorBody)
|
|
|
|
case strings.EqualFold("ValidationException", errorCode):
|
|
return awsAwsjson11_deserializeErrorValidationException(response, errorBody)
|
|
|
|
default:
|
|
genericError := &smithy.GenericAPIError{
|
|
Code: errorCode,
|
|
Message: errorMessage,
|
|
}
|
|
return genericError
|
|
|
|
}
|
|
}
|
|
|
|
type awsAwsjson11_deserializeOpGetLifecyclePolicyPreview struct {
|
|
}
|
|
|
|
func (*awsAwsjson11_deserializeOpGetLifecyclePolicyPreview) ID() string {
|
|
return "OperationDeserializer"
|
|
}
|
|
|
|
func (m *awsAwsjson11_deserializeOpGetLifecyclePolicyPreview) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
|
|
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
|
|
) {
|
|
out, metadata, err = next.HandleDeserialize(ctx, in)
|
|
if err != nil {
|
|
return out, metadata, err
|
|
}
|
|
|
|
response, ok := out.RawResponse.(*smithyhttp.Response)
|
|
if !ok {
|
|
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
|
|
}
|
|
|
|
if response.StatusCode < 200 || response.StatusCode >= 300 {
|
|
return out, metadata, awsAwsjson11_deserializeOpErrorGetLifecyclePolicyPreview(response, &metadata)
|
|
}
|
|
output := &GetLifecyclePolicyPreviewOutput{}
|
|
out.Result = output
|
|
|
|
var buff [1024]byte
|
|
ringBuffer := smithyio.NewRingBuffer(buff[:])
|
|
|
|
body := io.TeeReader(response.Body, ringBuffer)
|
|
decoder := json.NewDecoder(body)
|
|
decoder.UseNumber()
|
|
var shape interface{}
|
|
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
err = &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
return out, metadata, err
|
|
}
|
|
|
|
err = awsAwsjson11_deserializeOpDocumentGetLifecyclePolicyPreviewOutput(&output, shape)
|
|
if err != nil {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
err = &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
return out, metadata, err
|
|
}
|
|
|
|
return out, metadata, err
|
|
}
|
|
|
|
func awsAwsjson11_deserializeOpErrorGetLifecyclePolicyPreview(response *smithyhttp.Response, metadata *middleware.Metadata) error {
|
|
var errorBuffer bytes.Buffer
|
|
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
|
|
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
|
|
}
|
|
errorBody := bytes.NewReader(errorBuffer.Bytes())
|
|
|
|
errorCode := "UnknownError"
|
|
errorMessage := errorCode
|
|
|
|
headerCode := response.Header.Get("X-Amzn-ErrorType")
|
|
|
|
var buff [1024]byte
|
|
ringBuffer := smithyio.NewRingBuffer(buff[:])
|
|
|
|
body := io.TeeReader(errorBody, ringBuffer)
|
|
decoder := json.NewDecoder(body)
|
|
decoder.UseNumber()
|
|
bodyInfo, err := getProtocolErrorInfo(decoder)
|
|
if err != nil {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
err = &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
return err
|
|
}
|
|
|
|
errorBody.Seek(0, io.SeekStart)
|
|
if typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok {
|
|
errorCode = restjson.SanitizeErrorCode(typ)
|
|
}
|
|
if len(bodyInfo.Message) != 0 {
|
|
errorMessage = bodyInfo.Message
|
|
}
|
|
switch {
|
|
case strings.EqualFold("InvalidParameterException", errorCode):
|
|
return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody)
|
|
|
|
case strings.EqualFold("LifecyclePolicyPreviewNotFoundException", errorCode):
|
|
return awsAwsjson11_deserializeErrorLifecyclePolicyPreviewNotFoundException(response, errorBody)
|
|
|
|
case strings.EqualFold("RepositoryNotFoundException", errorCode):
|
|
return awsAwsjson11_deserializeErrorRepositoryNotFoundException(response, errorBody)
|
|
|
|
case strings.EqualFold("ServerException", errorCode):
|
|
return awsAwsjson11_deserializeErrorServerException(response, errorBody)
|
|
|
|
case strings.EqualFold("ValidationException", errorCode):
|
|
return awsAwsjson11_deserializeErrorValidationException(response, errorBody)
|
|
|
|
default:
|
|
genericError := &smithy.GenericAPIError{
|
|
Code: errorCode,
|
|
Message: errorMessage,
|
|
}
|
|
return genericError
|
|
|
|
}
|
|
}
|
|
|
|
type awsAwsjson11_deserializeOpGetRegistryPolicy struct {
|
|
}
|
|
|
|
func (*awsAwsjson11_deserializeOpGetRegistryPolicy) ID() string {
|
|
return "OperationDeserializer"
|
|
}
|
|
|
|
func (m *awsAwsjson11_deserializeOpGetRegistryPolicy) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
|
|
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
|
|
) {
|
|
out, metadata, err = next.HandleDeserialize(ctx, in)
|
|
if err != nil {
|
|
return out, metadata, err
|
|
}
|
|
|
|
response, ok := out.RawResponse.(*smithyhttp.Response)
|
|
if !ok {
|
|
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
|
|
}
|
|
|
|
if response.StatusCode < 200 || response.StatusCode >= 300 {
|
|
return out, metadata, awsAwsjson11_deserializeOpErrorGetRegistryPolicy(response, &metadata)
|
|
}
|
|
output := &GetRegistryPolicyOutput{}
|
|
out.Result = output
|
|
|
|
var buff [1024]byte
|
|
ringBuffer := smithyio.NewRingBuffer(buff[:])
|
|
|
|
body := io.TeeReader(response.Body, ringBuffer)
|
|
decoder := json.NewDecoder(body)
|
|
decoder.UseNumber()
|
|
var shape interface{}
|
|
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
err = &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
return out, metadata, err
|
|
}
|
|
|
|
err = awsAwsjson11_deserializeOpDocumentGetRegistryPolicyOutput(&output, shape)
|
|
if err != nil {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
err = &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
return out, metadata, err
|
|
}
|
|
|
|
return out, metadata, err
|
|
}
|
|
|
|
func awsAwsjson11_deserializeOpErrorGetRegistryPolicy(response *smithyhttp.Response, metadata *middleware.Metadata) error {
|
|
var errorBuffer bytes.Buffer
|
|
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
|
|
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
|
|
}
|
|
errorBody := bytes.NewReader(errorBuffer.Bytes())
|
|
|
|
errorCode := "UnknownError"
|
|
errorMessage := errorCode
|
|
|
|
headerCode := response.Header.Get("X-Amzn-ErrorType")
|
|
|
|
var buff [1024]byte
|
|
ringBuffer := smithyio.NewRingBuffer(buff[:])
|
|
|
|
body := io.TeeReader(errorBody, ringBuffer)
|
|
decoder := json.NewDecoder(body)
|
|
decoder.UseNumber()
|
|
bodyInfo, err := getProtocolErrorInfo(decoder)
|
|
if err != nil {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
err = &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
return err
|
|
}
|
|
|
|
errorBody.Seek(0, io.SeekStart)
|
|
if typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok {
|
|
errorCode = restjson.SanitizeErrorCode(typ)
|
|
}
|
|
if len(bodyInfo.Message) != 0 {
|
|
errorMessage = bodyInfo.Message
|
|
}
|
|
switch {
|
|
case strings.EqualFold("InvalidParameterException", errorCode):
|
|
return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody)
|
|
|
|
case strings.EqualFold("RegistryPolicyNotFoundException", errorCode):
|
|
return awsAwsjson11_deserializeErrorRegistryPolicyNotFoundException(response, errorBody)
|
|
|
|
case strings.EqualFold("ServerException", errorCode):
|
|
return awsAwsjson11_deserializeErrorServerException(response, errorBody)
|
|
|
|
case strings.EqualFold("ValidationException", errorCode):
|
|
return awsAwsjson11_deserializeErrorValidationException(response, errorBody)
|
|
|
|
default:
|
|
genericError := &smithy.GenericAPIError{
|
|
Code: errorCode,
|
|
Message: errorMessage,
|
|
}
|
|
return genericError
|
|
|
|
}
|
|
}
|
|
|
|
type awsAwsjson11_deserializeOpGetRegistryScanningConfiguration struct {
|
|
}
|
|
|
|
func (*awsAwsjson11_deserializeOpGetRegistryScanningConfiguration) ID() string {
|
|
return "OperationDeserializer"
|
|
}
|
|
|
|
func (m *awsAwsjson11_deserializeOpGetRegistryScanningConfiguration) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
|
|
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
|
|
) {
|
|
out, metadata, err = next.HandleDeserialize(ctx, in)
|
|
if err != nil {
|
|
return out, metadata, err
|
|
}
|
|
|
|
response, ok := out.RawResponse.(*smithyhttp.Response)
|
|
if !ok {
|
|
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
|
|
}
|
|
|
|
if response.StatusCode < 200 || response.StatusCode >= 300 {
|
|
return out, metadata, awsAwsjson11_deserializeOpErrorGetRegistryScanningConfiguration(response, &metadata)
|
|
}
|
|
output := &GetRegistryScanningConfigurationOutput{}
|
|
out.Result = output
|
|
|
|
var buff [1024]byte
|
|
ringBuffer := smithyio.NewRingBuffer(buff[:])
|
|
|
|
body := io.TeeReader(response.Body, ringBuffer)
|
|
decoder := json.NewDecoder(body)
|
|
decoder.UseNumber()
|
|
var shape interface{}
|
|
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
err = &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
return out, metadata, err
|
|
}
|
|
|
|
err = awsAwsjson11_deserializeOpDocumentGetRegistryScanningConfigurationOutput(&output, shape)
|
|
if err != nil {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
err = &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
return out, metadata, err
|
|
}
|
|
|
|
return out, metadata, err
|
|
}
|
|
|
|
func awsAwsjson11_deserializeOpErrorGetRegistryScanningConfiguration(response *smithyhttp.Response, metadata *middleware.Metadata) error {
|
|
var errorBuffer bytes.Buffer
|
|
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
|
|
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
|
|
}
|
|
errorBody := bytes.NewReader(errorBuffer.Bytes())
|
|
|
|
errorCode := "UnknownError"
|
|
errorMessage := errorCode
|
|
|
|
headerCode := response.Header.Get("X-Amzn-ErrorType")
|
|
|
|
var buff [1024]byte
|
|
ringBuffer := smithyio.NewRingBuffer(buff[:])
|
|
|
|
body := io.TeeReader(errorBody, ringBuffer)
|
|
decoder := json.NewDecoder(body)
|
|
decoder.UseNumber()
|
|
bodyInfo, err := getProtocolErrorInfo(decoder)
|
|
if err != nil {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
err = &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
return err
|
|
}
|
|
|
|
errorBody.Seek(0, io.SeekStart)
|
|
if typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok {
|
|
errorCode = restjson.SanitizeErrorCode(typ)
|
|
}
|
|
if len(bodyInfo.Message) != 0 {
|
|
errorMessage = bodyInfo.Message
|
|
}
|
|
switch {
|
|
case strings.EqualFold("InvalidParameterException", errorCode):
|
|
return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody)
|
|
|
|
case strings.EqualFold("ServerException", errorCode):
|
|
return awsAwsjson11_deserializeErrorServerException(response, errorBody)
|
|
|
|
case strings.EqualFold("ValidationException", errorCode):
|
|
return awsAwsjson11_deserializeErrorValidationException(response, errorBody)
|
|
|
|
default:
|
|
genericError := &smithy.GenericAPIError{
|
|
Code: errorCode,
|
|
Message: errorMessage,
|
|
}
|
|
return genericError
|
|
|
|
}
|
|
}
|
|
|
|
type awsAwsjson11_deserializeOpGetRepositoryPolicy struct {
|
|
}
|
|
|
|
func (*awsAwsjson11_deserializeOpGetRepositoryPolicy) ID() string {
|
|
return "OperationDeserializer"
|
|
}
|
|
|
|
func (m *awsAwsjson11_deserializeOpGetRepositoryPolicy) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
|
|
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
|
|
) {
|
|
out, metadata, err = next.HandleDeserialize(ctx, in)
|
|
if err != nil {
|
|
return out, metadata, err
|
|
}
|
|
|
|
response, ok := out.RawResponse.(*smithyhttp.Response)
|
|
if !ok {
|
|
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
|
|
}
|
|
|
|
if response.StatusCode < 200 || response.StatusCode >= 300 {
|
|
return out, metadata, awsAwsjson11_deserializeOpErrorGetRepositoryPolicy(response, &metadata)
|
|
}
|
|
output := &GetRepositoryPolicyOutput{}
|
|
out.Result = output
|
|
|
|
var buff [1024]byte
|
|
ringBuffer := smithyio.NewRingBuffer(buff[:])
|
|
|
|
body := io.TeeReader(response.Body, ringBuffer)
|
|
decoder := json.NewDecoder(body)
|
|
decoder.UseNumber()
|
|
var shape interface{}
|
|
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
err = &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
return out, metadata, err
|
|
}
|
|
|
|
err = awsAwsjson11_deserializeOpDocumentGetRepositoryPolicyOutput(&output, shape)
|
|
if err != nil {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
err = &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
return out, metadata, err
|
|
}
|
|
|
|
return out, metadata, err
|
|
}
|
|
|
|
func awsAwsjson11_deserializeOpErrorGetRepositoryPolicy(response *smithyhttp.Response, metadata *middleware.Metadata) error {
|
|
var errorBuffer bytes.Buffer
|
|
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
|
|
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
|
|
}
|
|
errorBody := bytes.NewReader(errorBuffer.Bytes())
|
|
|
|
errorCode := "UnknownError"
|
|
errorMessage := errorCode
|
|
|
|
headerCode := response.Header.Get("X-Amzn-ErrorType")
|
|
|
|
var buff [1024]byte
|
|
ringBuffer := smithyio.NewRingBuffer(buff[:])
|
|
|
|
body := io.TeeReader(errorBody, ringBuffer)
|
|
decoder := json.NewDecoder(body)
|
|
decoder.UseNumber()
|
|
bodyInfo, err := getProtocolErrorInfo(decoder)
|
|
if err != nil {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
err = &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
return err
|
|
}
|
|
|
|
errorBody.Seek(0, io.SeekStart)
|
|
if typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok {
|
|
errorCode = restjson.SanitizeErrorCode(typ)
|
|
}
|
|
if len(bodyInfo.Message) != 0 {
|
|
errorMessage = bodyInfo.Message
|
|
}
|
|
switch {
|
|
case strings.EqualFold("InvalidParameterException", errorCode):
|
|
return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody)
|
|
|
|
case strings.EqualFold("RepositoryNotFoundException", errorCode):
|
|
return awsAwsjson11_deserializeErrorRepositoryNotFoundException(response, errorBody)
|
|
|
|
case strings.EqualFold("RepositoryPolicyNotFoundException", errorCode):
|
|
return awsAwsjson11_deserializeErrorRepositoryPolicyNotFoundException(response, errorBody)
|
|
|
|
case strings.EqualFold("ServerException", errorCode):
|
|
return awsAwsjson11_deserializeErrorServerException(response, errorBody)
|
|
|
|
default:
|
|
genericError := &smithy.GenericAPIError{
|
|
Code: errorCode,
|
|
Message: errorMessage,
|
|
}
|
|
return genericError
|
|
|
|
}
|
|
}
|
|
|
|
type awsAwsjson11_deserializeOpInitiateLayerUpload struct {
|
|
}
|
|
|
|
func (*awsAwsjson11_deserializeOpInitiateLayerUpload) ID() string {
|
|
return "OperationDeserializer"
|
|
}
|
|
|
|
func (m *awsAwsjson11_deserializeOpInitiateLayerUpload) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
|
|
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
|
|
) {
|
|
out, metadata, err = next.HandleDeserialize(ctx, in)
|
|
if err != nil {
|
|
return out, metadata, err
|
|
}
|
|
|
|
response, ok := out.RawResponse.(*smithyhttp.Response)
|
|
if !ok {
|
|
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
|
|
}
|
|
|
|
if response.StatusCode < 200 || response.StatusCode >= 300 {
|
|
return out, metadata, awsAwsjson11_deserializeOpErrorInitiateLayerUpload(response, &metadata)
|
|
}
|
|
output := &InitiateLayerUploadOutput{}
|
|
out.Result = output
|
|
|
|
var buff [1024]byte
|
|
ringBuffer := smithyio.NewRingBuffer(buff[:])
|
|
|
|
body := io.TeeReader(response.Body, ringBuffer)
|
|
decoder := json.NewDecoder(body)
|
|
decoder.UseNumber()
|
|
var shape interface{}
|
|
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
err = &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
return out, metadata, err
|
|
}
|
|
|
|
err = awsAwsjson11_deserializeOpDocumentInitiateLayerUploadOutput(&output, shape)
|
|
if err != nil {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
err = &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
return out, metadata, err
|
|
}
|
|
|
|
return out, metadata, err
|
|
}
|
|
|
|
func awsAwsjson11_deserializeOpErrorInitiateLayerUpload(response *smithyhttp.Response, metadata *middleware.Metadata) error {
|
|
var errorBuffer bytes.Buffer
|
|
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
|
|
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
|
|
}
|
|
errorBody := bytes.NewReader(errorBuffer.Bytes())
|
|
|
|
errorCode := "UnknownError"
|
|
errorMessage := errorCode
|
|
|
|
headerCode := response.Header.Get("X-Amzn-ErrorType")
|
|
|
|
var buff [1024]byte
|
|
ringBuffer := smithyio.NewRingBuffer(buff[:])
|
|
|
|
body := io.TeeReader(errorBody, ringBuffer)
|
|
decoder := json.NewDecoder(body)
|
|
decoder.UseNumber()
|
|
bodyInfo, err := getProtocolErrorInfo(decoder)
|
|
if err != nil {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
err = &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
return err
|
|
}
|
|
|
|
errorBody.Seek(0, io.SeekStart)
|
|
if typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok {
|
|
errorCode = restjson.SanitizeErrorCode(typ)
|
|
}
|
|
if len(bodyInfo.Message) != 0 {
|
|
errorMessage = bodyInfo.Message
|
|
}
|
|
switch {
|
|
case strings.EqualFold("InvalidParameterException", errorCode):
|
|
return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody)
|
|
|
|
case strings.EqualFold("KmsException", errorCode):
|
|
return awsAwsjson11_deserializeErrorKmsException(response, errorBody)
|
|
|
|
case strings.EqualFold("RepositoryNotFoundException", errorCode):
|
|
return awsAwsjson11_deserializeErrorRepositoryNotFoundException(response, errorBody)
|
|
|
|
case strings.EqualFold("ServerException", errorCode):
|
|
return awsAwsjson11_deserializeErrorServerException(response, errorBody)
|
|
|
|
default:
|
|
genericError := &smithy.GenericAPIError{
|
|
Code: errorCode,
|
|
Message: errorMessage,
|
|
}
|
|
return genericError
|
|
|
|
}
|
|
}
|
|
|
|
type awsAwsjson11_deserializeOpListImages struct {
|
|
}
|
|
|
|
func (*awsAwsjson11_deserializeOpListImages) ID() string {
|
|
return "OperationDeserializer"
|
|
}
|
|
|
|
func (m *awsAwsjson11_deserializeOpListImages) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
|
|
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
|
|
) {
|
|
out, metadata, err = next.HandleDeserialize(ctx, in)
|
|
if err != nil {
|
|
return out, metadata, err
|
|
}
|
|
|
|
response, ok := out.RawResponse.(*smithyhttp.Response)
|
|
if !ok {
|
|
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
|
|
}
|
|
|
|
if response.StatusCode < 200 || response.StatusCode >= 300 {
|
|
return out, metadata, awsAwsjson11_deserializeOpErrorListImages(response, &metadata)
|
|
}
|
|
output := &ListImagesOutput{}
|
|
out.Result = output
|
|
|
|
var buff [1024]byte
|
|
ringBuffer := smithyio.NewRingBuffer(buff[:])
|
|
|
|
body := io.TeeReader(response.Body, ringBuffer)
|
|
decoder := json.NewDecoder(body)
|
|
decoder.UseNumber()
|
|
var shape interface{}
|
|
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
err = &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
return out, metadata, err
|
|
}
|
|
|
|
err = awsAwsjson11_deserializeOpDocumentListImagesOutput(&output, shape)
|
|
if err != nil {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
err = &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
return out, metadata, err
|
|
}
|
|
|
|
return out, metadata, err
|
|
}
|
|
|
|
func awsAwsjson11_deserializeOpErrorListImages(response *smithyhttp.Response, metadata *middleware.Metadata) error {
|
|
var errorBuffer bytes.Buffer
|
|
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
|
|
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
|
|
}
|
|
errorBody := bytes.NewReader(errorBuffer.Bytes())
|
|
|
|
errorCode := "UnknownError"
|
|
errorMessage := errorCode
|
|
|
|
headerCode := response.Header.Get("X-Amzn-ErrorType")
|
|
|
|
var buff [1024]byte
|
|
ringBuffer := smithyio.NewRingBuffer(buff[:])
|
|
|
|
body := io.TeeReader(errorBody, ringBuffer)
|
|
decoder := json.NewDecoder(body)
|
|
decoder.UseNumber()
|
|
bodyInfo, err := getProtocolErrorInfo(decoder)
|
|
if err != nil {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
err = &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
return err
|
|
}
|
|
|
|
errorBody.Seek(0, io.SeekStart)
|
|
if typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok {
|
|
errorCode = restjson.SanitizeErrorCode(typ)
|
|
}
|
|
if len(bodyInfo.Message) != 0 {
|
|
errorMessage = bodyInfo.Message
|
|
}
|
|
switch {
|
|
case strings.EqualFold("InvalidParameterException", errorCode):
|
|
return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody)
|
|
|
|
case strings.EqualFold("RepositoryNotFoundException", errorCode):
|
|
return awsAwsjson11_deserializeErrorRepositoryNotFoundException(response, errorBody)
|
|
|
|
case strings.EqualFold("ServerException", errorCode):
|
|
return awsAwsjson11_deserializeErrorServerException(response, errorBody)
|
|
|
|
default:
|
|
genericError := &smithy.GenericAPIError{
|
|
Code: errorCode,
|
|
Message: errorMessage,
|
|
}
|
|
return genericError
|
|
|
|
}
|
|
}
|
|
|
|
type awsAwsjson11_deserializeOpListTagsForResource struct {
|
|
}
|
|
|
|
func (*awsAwsjson11_deserializeOpListTagsForResource) ID() string {
|
|
return "OperationDeserializer"
|
|
}
|
|
|
|
func (m *awsAwsjson11_deserializeOpListTagsForResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
|
|
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
|
|
) {
|
|
out, metadata, err = next.HandleDeserialize(ctx, in)
|
|
if err != nil {
|
|
return out, metadata, err
|
|
}
|
|
|
|
response, ok := out.RawResponse.(*smithyhttp.Response)
|
|
if !ok {
|
|
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
|
|
}
|
|
|
|
if response.StatusCode < 200 || response.StatusCode >= 300 {
|
|
return out, metadata, awsAwsjson11_deserializeOpErrorListTagsForResource(response, &metadata)
|
|
}
|
|
output := &ListTagsForResourceOutput{}
|
|
out.Result = output
|
|
|
|
var buff [1024]byte
|
|
ringBuffer := smithyio.NewRingBuffer(buff[:])
|
|
|
|
body := io.TeeReader(response.Body, ringBuffer)
|
|
decoder := json.NewDecoder(body)
|
|
decoder.UseNumber()
|
|
var shape interface{}
|
|
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
err = &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
return out, metadata, err
|
|
}
|
|
|
|
err = awsAwsjson11_deserializeOpDocumentListTagsForResourceOutput(&output, shape)
|
|
if err != nil {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
err = &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
return out, metadata, err
|
|
}
|
|
|
|
return out, metadata, err
|
|
}
|
|
|
|
func awsAwsjson11_deserializeOpErrorListTagsForResource(response *smithyhttp.Response, metadata *middleware.Metadata) error {
|
|
var errorBuffer bytes.Buffer
|
|
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
|
|
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
|
|
}
|
|
errorBody := bytes.NewReader(errorBuffer.Bytes())
|
|
|
|
errorCode := "UnknownError"
|
|
errorMessage := errorCode
|
|
|
|
headerCode := response.Header.Get("X-Amzn-ErrorType")
|
|
|
|
var buff [1024]byte
|
|
ringBuffer := smithyio.NewRingBuffer(buff[:])
|
|
|
|
body := io.TeeReader(errorBody, ringBuffer)
|
|
decoder := json.NewDecoder(body)
|
|
decoder.UseNumber()
|
|
bodyInfo, err := getProtocolErrorInfo(decoder)
|
|
if err != nil {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
err = &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
return err
|
|
}
|
|
|
|
errorBody.Seek(0, io.SeekStart)
|
|
if typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok {
|
|
errorCode = restjson.SanitizeErrorCode(typ)
|
|
}
|
|
if len(bodyInfo.Message) != 0 {
|
|
errorMessage = bodyInfo.Message
|
|
}
|
|
switch {
|
|
case strings.EqualFold("InvalidParameterException", errorCode):
|
|
return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody)
|
|
|
|
case strings.EqualFold("RepositoryNotFoundException", errorCode):
|
|
return awsAwsjson11_deserializeErrorRepositoryNotFoundException(response, errorBody)
|
|
|
|
case strings.EqualFold("ServerException", errorCode):
|
|
return awsAwsjson11_deserializeErrorServerException(response, errorBody)
|
|
|
|
default:
|
|
genericError := &smithy.GenericAPIError{
|
|
Code: errorCode,
|
|
Message: errorMessage,
|
|
}
|
|
return genericError
|
|
|
|
}
|
|
}
|
|
|
|
type awsAwsjson11_deserializeOpPutImage struct {
|
|
}
|
|
|
|
func (*awsAwsjson11_deserializeOpPutImage) ID() string {
|
|
return "OperationDeserializer"
|
|
}
|
|
|
|
func (m *awsAwsjson11_deserializeOpPutImage) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
|
|
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
|
|
) {
|
|
out, metadata, err = next.HandleDeserialize(ctx, in)
|
|
if err != nil {
|
|
return out, metadata, err
|
|
}
|
|
|
|
response, ok := out.RawResponse.(*smithyhttp.Response)
|
|
if !ok {
|
|
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
|
|
}
|
|
|
|
if response.StatusCode < 200 || response.StatusCode >= 300 {
|
|
return out, metadata, awsAwsjson11_deserializeOpErrorPutImage(response, &metadata)
|
|
}
|
|
output := &PutImageOutput{}
|
|
out.Result = output
|
|
|
|
var buff [1024]byte
|
|
ringBuffer := smithyio.NewRingBuffer(buff[:])
|
|
|
|
body := io.TeeReader(response.Body, ringBuffer)
|
|
decoder := json.NewDecoder(body)
|
|
decoder.UseNumber()
|
|
var shape interface{}
|
|
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
err = &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
return out, metadata, err
|
|
}
|
|
|
|
err = awsAwsjson11_deserializeOpDocumentPutImageOutput(&output, shape)
|
|
if err != nil {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
err = &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
return out, metadata, err
|
|
}
|
|
|
|
return out, metadata, err
|
|
}
|
|
|
|
func awsAwsjson11_deserializeOpErrorPutImage(response *smithyhttp.Response, metadata *middleware.Metadata) error {
|
|
var errorBuffer bytes.Buffer
|
|
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
|
|
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
|
|
}
|
|
errorBody := bytes.NewReader(errorBuffer.Bytes())
|
|
|
|
errorCode := "UnknownError"
|
|
errorMessage := errorCode
|
|
|
|
headerCode := response.Header.Get("X-Amzn-ErrorType")
|
|
|
|
var buff [1024]byte
|
|
ringBuffer := smithyio.NewRingBuffer(buff[:])
|
|
|
|
body := io.TeeReader(errorBody, ringBuffer)
|
|
decoder := json.NewDecoder(body)
|
|
decoder.UseNumber()
|
|
bodyInfo, err := getProtocolErrorInfo(decoder)
|
|
if err != nil {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
err = &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
return err
|
|
}
|
|
|
|
errorBody.Seek(0, io.SeekStart)
|
|
if typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok {
|
|
errorCode = restjson.SanitizeErrorCode(typ)
|
|
}
|
|
if len(bodyInfo.Message) != 0 {
|
|
errorMessage = bodyInfo.Message
|
|
}
|
|
switch {
|
|
case strings.EqualFold("ImageAlreadyExistsException", errorCode):
|
|
return awsAwsjson11_deserializeErrorImageAlreadyExistsException(response, errorBody)
|
|
|
|
case strings.EqualFold("ImageDigestDoesNotMatchException", errorCode):
|
|
return awsAwsjson11_deserializeErrorImageDigestDoesNotMatchException(response, errorBody)
|
|
|
|
case strings.EqualFold("ImageTagAlreadyExistsException", errorCode):
|
|
return awsAwsjson11_deserializeErrorImageTagAlreadyExistsException(response, errorBody)
|
|
|
|
case strings.EqualFold("InvalidParameterException", errorCode):
|
|
return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody)
|
|
|
|
case strings.EqualFold("KmsException", errorCode):
|
|
return awsAwsjson11_deserializeErrorKmsException(response, errorBody)
|
|
|
|
case strings.EqualFold("LayersNotFoundException", errorCode):
|
|
return awsAwsjson11_deserializeErrorLayersNotFoundException(response, errorBody)
|
|
|
|
case strings.EqualFold("LimitExceededException", errorCode):
|
|
return awsAwsjson11_deserializeErrorLimitExceededException(response, errorBody)
|
|
|
|
case strings.EqualFold("ReferencedImagesNotFoundException", errorCode):
|
|
return awsAwsjson11_deserializeErrorReferencedImagesNotFoundException(response, errorBody)
|
|
|
|
case strings.EqualFold("RepositoryNotFoundException", errorCode):
|
|
return awsAwsjson11_deserializeErrorRepositoryNotFoundException(response, errorBody)
|
|
|
|
case strings.EqualFold("ServerException", errorCode):
|
|
return awsAwsjson11_deserializeErrorServerException(response, errorBody)
|
|
|
|
default:
|
|
genericError := &smithy.GenericAPIError{
|
|
Code: errorCode,
|
|
Message: errorMessage,
|
|
}
|
|
return genericError
|
|
|
|
}
|
|
}
|
|
|
|
type awsAwsjson11_deserializeOpPutImageScanningConfiguration struct {
|
|
}
|
|
|
|
func (*awsAwsjson11_deserializeOpPutImageScanningConfiguration) ID() string {
|
|
return "OperationDeserializer"
|
|
}
|
|
|
|
func (m *awsAwsjson11_deserializeOpPutImageScanningConfiguration) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
|
|
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
|
|
) {
|
|
out, metadata, err = next.HandleDeserialize(ctx, in)
|
|
if err != nil {
|
|
return out, metadata, err
|
|
}
|
|
|
|
response, ok := out.RawResponse.(*smithyhttp.Response)
|
|
if !ok {
|
|
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
|
|
}
|
|
|
|
if response.StatusCode < 200 || response.StatusCode >= 300 {
|
|
return out, metadata, awsAwsjson11_deserializeOpErrorPutImageScanningConfiguration(response, &metadata)
|
|
}
|
|
output := &PutImageScanningConfigurationOutput{}
|
|
out.Result = output
|
|
|
|
var buff [1024]byte
|
|
ringBuffer := smithyio.NewRingBuffer(buff[:])
|
|
|
|
body := io.TeeReader(response.Body, ringBuffer)
|
|
decoder := json.NewDecoder(body)
|
|
decoder.UseNumber()
|
|
var shape interface{}
|
|
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
err = &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
return out, metadata, err
|
|
}
|
|
|
|
err = awsAwsjson11_deserializeOpDocumentPutImageScanningConfigurationOutput(&output, shape)
|
|
if err != nil {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
err = &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
return out, metadata, err
|
|
}
|
|
|
|
return out, metadata, err
|
|
}
|
|
|
|
func awsAwsjson11_deserializeOpErrorPutImageScanningConfiguration(response *smithyhttp.Response, metadata *middleware.Metadata) error {
|
|
var errorBuffer bytes.Buffer
|
|
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
|
|
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
|
|
}
|
|
errorBody := bytes.NewReader(errorBuffer.Bytes())
|
|
|
|
errorCode := "UnknownError"
|
|
errorMessage := errorCode
|
|
|
|
headerCode := response.Header.Get("X-Amzn-ErrorType")
|
|
|
|
var buff [1024]byte
|
|
ringBuffer := smithyio.NewRingBuffer(buff[:])
|
|
|
|
body := io.TeeReader(errorBody, ringBuffer)
|
|
decoder := json.NewDecoder(body)
|
|
decoder.UseNumber()
|
|
bodyInfo, err := getProtocolErrorInfo(decoder)
|
|
if err != nil {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
err = &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
return err
|
|
}
|
|
|
|
errorBody.Seek(0, io.SeekStart)
|
|
if typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok {
|
|
errorCode = restjson.SanitizeErrorCode(typ)
|
|
}
|
|
if len(bodyInfo.Message) != 0 {
|
|
errorMessage = bodyInfo.Message
|
|
}
|
|
switch {
|
|
case strings.EqualFold("InvalidParameterException", errorCode):
|
|
return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody)
|
|
|
|
case strings.EqualFold("RepositoryNotFoundException", errorCode):
|
|
return awsAwsjson11_deserializeErrorRepositoryNotFoundException(response, errorBody)
|
|
|
|
case strings.EqualFold("ServerException", errorCode):
|
|
return awsAwsjson11_deserializeErrorServerException(response, errorBody)
|
|
|
|
case strings.EqualFold("ValidationException", errorCode):
|
|
return awsAwsjson11_deserializeErrorValidationException(response, errorBody)
|
|
|
|
default:
|
|
genericError := &smithy.GenericAPIError{
|
|
Code: errorCode,
|
|
Message: errorMessage,
|
|
}
|
|
return genericError
|
|
|
|
}
|
|
}
|
|
|
|
type awsAwsjson11_deserializeOpPutImageTagMutability struct {
|
|
}
|
|
|
|
func (*awsAwsjson11_deserializeOpPutImageTagMutability) ID() string {
|
|
return "OperationDeserializer"
|
|
}
|
|
|
|
func (m *awsAwsjson11_deserializeOpPutImageTagMutability) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
|
|
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
|
|
) {
|
|
out, metadata, err = next.HandleDeserialize(ctx, in)
|
|
if err != nil {
|
|
return out, metadata, err
|
|
}
|
|
|
|
response, ok := out.RawResponse.(*smithyhttp.Response)
|
|
if !ok {
|
|
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
|
|
}
|
|
|
|
if response.StatusCode < 200 || response.StatusCode >= 300 {
|
|
return out, metadata, awsAwsjson11_deserializeOpErrorPutImageTagMutability(response, &metadata)
|
|
}
|
|
output := &PutImageTagMutabilityOutput{}
|
|
out.Result = output
|
|
|
|
var buff [1024]byte
|
|
ringBuffer := smithyio.NewRingBuffer(buff[:])
|
|
|
|
body := io.TeeReader(response.Body, ringBuffer)
|
|
decoder := json.NewDecoder(body)
|
|
decoder.UseNumber()
|
|
var shape interface{}
|
|
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
err = &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
return out, metadata, err
|
|
}
|
|
|
|
err = awsAwsjson11_deserializeOpDocumentPutImageTagMutabilityOutput(&output, shape)
|
|
if err != nil {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
err = &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
return out, metadata, err
|
|
}
|
|
|
|
return out, metadata, err
|
|
}
|
|
|
|
func awsAwsjson11_deserializeOpErrorPutImageTagMutability(response *smithyhttp.Response, metadata *middleware.Metadata) error {
|
|
var errorBuffer bytes.Buffer
|
|
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
|
|
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
|
|
}
|
|
errorBody := bytes.NewReader(errorBuffer.Bytes())
|
|
|
|
errorCode := "UnknownError"
|
|
errorMessage := errorCode
|
|
|
|
headerCode := response.Header.Get("X-Amzn-ErrorType")
|
|
|
|
var buff [1024]byte
|
|
ringBuffer := smithyio.NewRingBuffer(buff[:])
|
|
|
|
body := io.TeeReader(errorBody, ringBuffer)
|
|
decoder := json.NewDecoder(body)
|
|
decoder.UseNumber()
|
|
bodyInfo, err := getProtocolErrorInfo(decoder)
|
|
if err != nil {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
err = &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
return err
|
|
}
|
|
|
|
errorBody.Seek(0, io.SeekStart)
|
|
if typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok {
|
|
errorCode = restjson.SanitizeErrorCode(typ)
|
|
}
|
|
if len(bodyInfo.Message) != 0 {
|
|
errorMessage = bodyInfo.Message
|
|
}
|
|
switch {
|
|
case strings.EqualFold("InvalidParameterException", errorCode):
|
|
return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody)
|
|
|
|
case strings.EqualFold("RepositoryNotFoundException", errorCode):
|
|
return awsAwsjson11_deserializeErrorRepositoryNotFoundException(response, errorBody)
|
|
|
|
case strings.EqualFold("ServerException", errorCode):
|
|
return awsAwsjson11_deserializeErrorServerException(response, errorBody)
|
|
|
|
default:
|
|
genericError := &smithy.GenericAPIError{
|
|
Code: errorCode,
|
|
Message: errorMessage,
|
|
}
|
|
return genericError
|
|
|
|
}
|
|
}
|
|
|
|
type awsAwsjson11_deserializeOpPutLifecyclePolicy struct {
|
|
}
|
|
|
|
func (*awsAwsjson11_deserializeOpPutLifecyclePolicy) ID() string {
|
|
return "OperationDeserializer"
|
|
}
|
|
|
|
func (m *awsAwsjson11_deserializeOpPutLifecyclePolicy) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
|
|
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
|
|
) {
|
|
out, metadata, err = next.HandleDeserialize(ctx, in)
|
|
if err != nil {
|
|
return out, metadata, err
|
|
}
|
|
|
|
response, ok := out.RawResponse.(*smithyhttp.Response)
|
|
if !ok {
|
|
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
|
|
}
|
|
|
|
if response.StatusCode < 200 || response.StatusCode >= 300 {
|
|
return out, metadata, awsAwsjson11_deserializeOpErrorPutLifecyclePolicy(response, &metadata)
|
|
}
|
|
output := &PutLifecyclePolicyOutput{}
|
|
out.Result = output
|
|
|
|
var buff [1024]byte
|
|
ringBuffer := smithyio.NewRingBuffer(buff[:])
|
|
|
|
body := io.TeeReader(response.Body, ringBuffer)
|
|
decoder := json.NewDecoder(body)
|
|
decoder.UseNumber()
|
|
var shape interface{}
|
|
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
err = &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
return out, metadata, err
|
|
}
|
|
|
|
err = awsAwsjson11_deserializeOpDocumentPutLifecyclePolicyOutput(&output, shape)
|
|
if err != nil {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
err = &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
return out, metadata, err
|
|
}
|
|
|
|
return out, metadata, err
|
|
}
|
|
|
|
func awsAwsjson11_deserializeOpErrorPutLifecyclePolicy(response *smithyhttp.Response, metadata *middleware.Metadata) error {
|
|
var errorBuffer bytes.Buffer
|
|
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
|
|
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
|
|
}
|
|
errorBody := bytes.NewReader(errorBuffer.Bytes())
|
|
|
|
errorCode := "UnknownError"
|
|
errorMessage := errorCode
|
|
|
|
headerCode := response.Header.Get("X-Amzn-ErrorType")
|
|
|
|
var buff [1024]byte
|
|
ringBuffer := smithyio.NewRingBuffer(buff[:])
|
|
|
|
body := io.TeeReader(errorBody, ringBuffer)
|
|
decoder := json.NewDecoder(body)
|
|
decoder.UseNumber()
|
|
bodyInfo, err := getProtocolErrorInfo(decoder)
|
|
if err != nil {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
err = &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
return err
|
|
}
|
|
|
|
errorBody.Seek(0, io.SeekStart)
|
|
if typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok {
|
|
errorCode = restjson.SanitizeErrorCode(typ)
|
|
}
|
|
if len(bodyInfo.Message) != 0 {
|
|
errorMessage = bodyInfo.Message
|
|
}
|
|
switch {
|
|
case strings.EqualFold("InvalidParameterException", errorCode):
|
|
return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody)
|
|
|
|
case strings.EqualFold("RepositoryNotFoundException", errorCode):
|
|
return awsAwsjson11_deserializeErrorRepositoryNotFoundException(response, errorBody)
|
|
|
|
case strings.EqualFold("ServerException", errorCode):
|
|
return awsAwsjson11_deserializeErrorServerException(response, errorBody)
|
|
|
|
case strings.EqualFold("ValidationException", errorCode):
|
|
return awsAwsjson11_deserializeErrorValidationException(response, errorBody)
|
|
|
|
default:
|
|
genericError := &smithy.GenericAPIError{
|
|
Code: errorCode,
|
|
Message: errorMessage,
|
|
}
|
|
return genericError
|
|
|
|
}
|
|
}
|
|
|
|
type awsAwsjson11_deserializeOpPutRegistryPolicy struct {
|
|
}
|
|
|
|
func (*awsAwsjson11_deserializeOpPutRegistryPolicy) ID() string {
|
|
return "OperationDeserializer"
|
|
}
|
|
|
|
func (m *awsAwsjson11_deserializeOpPutRegistryPolicy) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
|
|
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
|
|
) {
|
|
out, metadata, err = next.HandleDeserialize(ctx, in)
|
|
if err != nil {
|
|
return out, metadata, err
|
|
}
|
|
|
|
response, ok := out.RawResponse.(*smithyhttp.Response)
|
|
if !ok {
|
|
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
|
|
}
|
|
|
|
if response.StatusCode < 200 || response.StatusCode >= 300 {
|
|
return out, metadata, awsAwsjson11_deserializeOpErrorPutRegistryPolicy(response, &metadata)
|
|
}
|
|
output := &PutRegistryPolicyOutput{}
|
|
out.Result = output
|
|
|
|
var buff [1024]byte
|
|
ringBuffer := smithyio.NewRingBuffer(buff[:])
|
|
|
|
body := io.TeeReader(response.Body, ringBuffer)
|
|
decoder := json.NewDecoder(body)
|
|
decoder.UseNumber()
|
|
var shape interface{}
|
|
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
err = &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
return out, metadata, err
|
|
}
|
|
|
|
err = awsAwsjson11_deserializeOpDocumentPutRegistryPolicyOutput(&output, shape)
|
|
if err != nil {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
err = &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
return out, metadata, err
|
|
}
|
|
|
|
return out, metadata, err
|
|
}
|
|
|
|
func awsAwsjson11_deserializeOpErrorPutRegistryPolicy(response *smithyhttp.Response, metadata *middleware.Metadata) error {
|
|
var errorBuffer bytes.Buffer
|
|
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
|
|
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
|
|
}
|
|
errorBody := bytes.NewReader(errorBuffer.Bytes())
|
|
|
|
errorCode := "UnknownError"
|
|
errorMessage := errorCode
|
|
|
|
headerCode := response.Header.Get("X-Amzn-ErrorType")
|
|
|
|
var buff [1024]byte
|
|
ringBuffer := smithyio.NewRingBuffer(buff[:])
|
|
|
|
body := io.TeeReader(errorBody, ringBuffer)
|
|
decoder := json.NewDecoder(body)
|
|
decoder.UseNumber()
|
|
bodyInfo, err := getProtocolErrorInfo(decoder)
|
|
if err != nil {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
err = &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
return err
|
|
}
|
|
|
|
errorBody.Seek(0, io.SeekStart)
|
|
if typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok {
|
|
errorCode = restjson.SanitizeErrorCode(typ)
|
|
}
|
|
if len(bodyInfo.Message) != 0 {
|
|
errorMessage = bodyInfo.Message
|
|
}
|
|
switch {
|
|
case strings.EqualFold("InvalidParameterException", errorCode):
|
|
return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody)
|
|
|
|
case strings.EqualFold("ServerException", errorCode):
|
|
return awsAwsjson11_deserializeErrorServerException(response, errorBody)
|
|
|
|
case strings.EqualFold("ValidationException", errorCode):
|
|
return awsAwsjson11_deserializeErrorValidationException(response, errorBody)
|
|
|
|
default:
|
|
genericError := &smithy.GenericAPIError{
|
|
Code: errorCode,
|
|
Message: errorMessage,
|
|
}
|
|
return genericError
|
|
|
|
}
|
|
}
|
|
|
|
type awsAwsjson11_deserializeOpPutRegistryScanningConfiguration struct {
|
|
}
|
|
|
|
func (*awsAwsjson11_deserializeOpPutRegistryScanningConfiguration) ID() string {
|
|
return "OperationDeserializer"
|
|
}
|
|
|
|
func (m *awsAwsjson11_deserializeOpPutRegistryScanningConfiguration) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
|
|
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
|
|
) {
|
|
out, metadata, err = next.HandleDeserialize(ctx, in)
|
|
if err != nil {
|
|
return out, metadata, err
|
|
}
|
|
|
|
response, ok := out.RawResponse.(*smithyhttp.Response)
|
|
if !ok {
|
|
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
|
|
}
|
|
|
|
if response.StatusCode < 200 || response.StatusCode >= 300 {
|
|
return out, metadata, awsAwsjson11_deserializeOpErrorPutRegistryScanningConfiguration(response, &metadata)
|
|
}
|
|
output := &PutRegistryScanningConfigurationOutput{}
|
|
out.Result = output
|
|
|
|
var buff [1024]byte
|
|
ringBuffer := smithyio.NewRingBuffer(buff[:])
|
|
|
|
body := io.TeeReader(response.Body, ringBuffer)
|
|
decoder := json.NewDecoder(body)
|
|
decoder.UseNumber()
|
|
var shape interface{}
|
|
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
err = &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
return out, metadata, err
|
|
}
|
|
|
|
err = awsAwsjson11_deserializeOpDocumentPutRegistryScanningConfigurationOutput(&output, shape)
|
|
if err != nil {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
err = &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
return out, metadata, err
|
|
}
|
|
|
|
return out, metadata, err
|
|
}
|
|
|
|
func awsAwsjson11_deserializeOpErrorPutRegistryScanningConfiguration(response *smithyhttp.Response, metadata *middleware.Metadata) error {
|
|
var errorBuffer bytes.Buffer
|
|
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
|
|
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
|
|
}
|
|
errorBody := bytes.NewReader(errorBuffer.Bytes())
|
|
|
|
errorCode := "UnknownError"
|
|
errorMessage := errorCode
|
|
|
|
headerCode := response.Header.Get("X-Amzn-ErrorType")
|
|
|
|
var buff [1024]byte
|
|
ringBuffer := smithyio.NewRingBuffer(buff[:])
|
|
|
|
body := io.TeeReader(errorBody, ringBuffer)
|
|
decoder := json.NewDecoder(body)
|
|
decoder.UseNumber()
|
|
bodyInfo, err := getProtocolErrorInfo(decoder)
|
|
if err != nil {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
err = &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
return err
|
|
}
|
|
|
|
errorBody.Seek(0, io.SeekStart)
|
|
if typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok {
|
|
errorCode = restjson.SanitizeErrorCode(typ)
|
|
}
|
|
if len(bodyInfo.Message) != 0 {
|
|
errorMessage = bodyInfo.Message
|
|
}
|
|
switch {
|
|
case strings.EqualFold("InvalidParameterException", errorCode):
|
|
return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody)
|
|
|
|
case strings.EqualFold("ServerException", errorCode):
|
|
return awsAwsjson11_deserializeErrorServerException(response, errorBody)
|
|
|
|
case strings.EqualFold("ValidationException", errorCode):
|
|
return awsAwsjson11_deserializeErrorValidationException(response, errorBody)
|
|
|
|
default:
|
|
genericError := &smithy.GenericAPIError{
|
|
Code: errorCode,
|
|
Message: errorMessage,
|
|
}
|
|
return genericError
|
|
|
|
}
|
|
}
|
|
|
|
type awsAwsjson11_deserializeOpPutReplicationConfiguration struct {
|
|
}
|
|
|
|
func (*awsAwsjson11_deserializeOpPutReplicationConfiguration) ID() string {
|
|
return "OperationDeserializer"
|
|
}
|
|
|
|
func (m *awsAwsjson11_deserializeOpPutReplicationConfiguration) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
|
|
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
|
|
) {
|
|
out, metadata, err = next.HandleDeserialize(ctx, in)
|
|
if err != nil {
|
|
return out, metadata, err
|
|
}
|
|
|
|
response, ok := out.RawResponse.(*smithyhttp.Response)
|
|
if !ok {
|
|
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
|
|
}
|
|
|
|
if response.StatusCode < 200 || response.StatusCode >= 300 {
|
|
return out, metadata, awsAwsjson11_deserializeOpErrorPutReplicationConfiguration(response, &metadata)
|
|
}
|
|
output := &PutReplicationConfigurationOutput{}
|
|
out.Result = output
|
|
|
|
var buff [1024]byte
|
|
ringBuffer := smithyio.NewRingBuffer(buff[:])
|
|
|
|
body := io.TeeReader(response.Body, ringBuffer)
|
|
decoder := json.NewDecoder(body)
|
|
decoder.UseNumber()
|
|
var shape interface{}
|
|
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
err = &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
return out, metadata, err
|
|
}
|
|
|
|
err = awsAwsjson11_deserializeOpDocumentPutReplicationConfigurationOutput(&output, shape)
|
|
if err != nil {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
err = &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
return out, metadata, err
|
|
}
|
|
|
|
return out, metadata, err
|
|
}
|
|
|
|
func awsAwsjson11_deserializeOpErrorPutReplicationConfiguration(response *smithyhttp.Response, metadata *middleware.Metadata) error {
|
|
var errorBuffer bytes.Buffer
|
|
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
|
|
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
|
|
}
|
|
errorBody := bytes.NewReader(errorBuffer.Bytes())
|
|
|
|
errorCode := "UnknownError"
|
|
errorMessage := errorCode
|
|
|
|
headerCode := response.Header.Get("X-Amzn-ErrorType")
|
|
|
|
var buff [1024]byte
|
|
ringBuffer := smithyio.NewRingBuffer(buff[:])
|
|
|
|
body := io.TeeReader(errorBody, ringBuffer)
|
|
decoder := json.NewDecoder(body)
|
|
decoder.UseNumber()
|
|
bodyInfo, err := getProtocolErrorInfo(decoder)
|
|
if err != nil {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
err = &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
return err
|
|
}
|
|
|
|
errorBody.Seek(0, io.SeekStart)
|
|
if typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok {
|
|
errorCode = restjson.SanitizeErrorCode(typ)
|
|
}
|
|
if len(bodyInfo.Message) != 0 {
|
|
errorMessage = bodyInfo.Message
|
|
}
|
|
switch {
|
|
case strings.EqualFold("InvalidParameterException", errorCode):
|
|
return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody)
|
|
|
|
case strings.EqualFold("ServerException", errorCode):
|
|
return awsAwsjson11_deserializeErrorServerException(response, errorBody)
|
|
|
|
case strings.EqualFold("ValidationException", errorCode):
|
|
return awsAwsjson11_deserializeErrorValidationException(response, errorBody)
|
|
|
|
default:
|
|
genericError := &smithy.GenericAPIError{
|
|
Code: errorCode,
|
|
Message: errorMessage,
|
|
}
|
|
return genericError
|
|
|
|
}
|
|
}
|
|
|
|
type awsAwsjson11_deserializeOpSetRepositoryPolicy struct {
|
|
}
|
|
|
|
func (*awsAwsjson11_deserializeOpSetRepositoryPolicy) ID() string {
|
|
return "OperationDeserializer"
|
|
}
|
|
|
|
func (m *awsAwsjson11_deserializeOpSetRepositoryPolicy) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
|
|
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
|
|
) {
|
|
out, metadata, err = next.HandleDeserialize(ctx, in)
|
|
if err != nil {
|
|
return out, metadata, err
|
|
}
|
|
|
|
response, ok := out.RawResponse.(*smithyhttp.Response)
|
|
if !ok {
|
|
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
|
|
}
|
|
|
|
if response.StatusCode < 200 || response.StatusCode >= 300 {
|
|
return out, metadata, awsAwsjson11_deserializeOpErrorSetRepositoryPolicy(response, &metadata)
|
|
}
|
|
output := &SetRepositoryPolicyOutput{}
|
|
out.Result = output
|
|
|
|
var buff [1024]byte
|
|
ringBuffer := smithyio.NewRingBuffer(buff[:])
|
|
|
|
body := io.TeeReader(response.Body, ringBuffer)
|
|
decoder := json.NewDecoder(body)
|
|
decoder.UseNumber()
|
|
var shape interface{}
|
|
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
err = &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
return out, metadata, err
|
|
}
|
|
|
|
err = awsAwsjson11_deserializeOpDocumentSetRepositoryPolicyOutput(&output, shape)
|
|
if err != nil {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
err = &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
return out, metadata, err
|
|
}
|
|
|
|
return out, metadata, err
|
|
}
|
|
|
|
func awsAwsjson11_deserializeOpErrorSetRepositoryPolicy(response *smithyhttp.Response, metadata *middleware.Metadata) error {
|
|
var errorBuffer bytes.Buffer
|
|
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
|
|
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
|
|
}
|
|
errorBody := bytes.NewReader(errorBuffer.Bytes())
|
|
|
|
errorCode := "UnknownError"
|
|
errorMessage := errorCode
|
|
|
|
headerCode := response.Header.Get("X-Amzn-ErrorType")
|
|
|
|
var buff [1024]byte
|
|
ringBuffer := smithyio.NewRingBuffer(buff[:])
|
|
|
|
body := io.TeeReader(errorBody, ringBuffer)
|
|
decoder := json.NewDecoder(body)
|
|
decoder.UseNumber()
|
|
bodyInfo, err := getProtocolErrorInfo(decoder)
|
|
if err != nil {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
err = &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
return err
|
|
}
|
|
|
|
errorBody.Seek(0, io.SeekStart)
|
|
if typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok {
|
|
errorCode = restjson.SanitizeErrorCode(typ)
|
|
}
|
|
if len(bodyInfo.Message) != 0 {
|
|
errorMessage = bodyInfo.Message
|
|
}
|
|
switch {
|
|
case strings.EqualFold("InvalidParameterException", errorCode):
|
|
return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody)
|
|
|
|
case strings.EqualFold("RepositoryNotFoundException", errorCode):
|
|
return awsAwsjson11_deserializeErrorRepositoryNotFoundException(response, errorBody)
|
|
|
|
case strings.EqualFold("ServerException", errorCode):
|
|
return awsAwsjson11_deserializeErrorServerException(response, errorBody)
|
|
|
|
default:
|
|
genericError := &smithy.GenericAPIError{
|
|
Code: errorCode,
|
|
Message: errorMessage,
|
|
}
|
|
return genericError
|
|
|
|
}
|
|
}
|
|
|
|
type awsAwsjson11_deserializeOpStartImageScan struct {
|
|
}
|
|
|
|
func (*awsAwsjson11_deserializeOpStartImageScan) ID() string {
|
|
return "OperationDeserializer"
|
|
}
|
|
|
|
func (m *awsAwsjson11_deserializeOpStartImageScan) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
|
|
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
|
|
) {
|
|
out, metadata, err = next.HandleDeserialize(ctx, in)
|
|
if err != nil {
|
|
return out, metadata, err
|
|
}
|
|
|
|
response, ok := out.RawResponse.(*smithyhttp.Response)
|
|
if !ok {
|
|
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
|
|
}
|
|
|
|
if response.StatusCode < 200 || response.StatusCode >= 300 {
|
|
return out, metadata, awsAwsjson11_deserializeOpErrorStartImageScan(response, &metadata)
|
|
}
|
|
output := &StartImageScanOutput{}
|
|
out.Result = output
|
|
|
|
var buff [1024]byte
|
|
ringBuffer := smithyio.NewRingBuffer(buff[:])
|
|
|
|
body := io.TeeReader(response.Body, ringBuffer)
|
|
decoder := json.NewDecoder(body)
|
|
decoder.UseNumber()
|
|
var shape interface{}
|
|
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
err = &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
return out, metadata, err
|
|
}
|
|
|
|
err = awsAwsjson11_deserializeOpDocumentStartImageScanOutput(&output, shape)
|
|
if err != nil {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
err = &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
return out, metadata, err
|
|
}
|
|
|
|
return out, metadata, err
|
|
}
|
|
|
|
func awsAwsjson11_deserializeOpErrorStartImageScan(response *smithyhttp.Response, metadata *middleware.Metadata) error {
|
|
var errorBuffer bytes.Buffer
|
|
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
|
|
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
|
|
}
|
|
errorBody := bytes.NewReader(errorBuffer.Bytes())
|
|
|
|
errorCode := "UnknownError"
|
|
errorMessage := errorCode
|
|
|
|
headerCode := response.Header.Get("X-Amzn-ErrorType")
|
|
|
|
var buff [1024]byte
|
|
ringBuffer := smithyio.NewRingBuffer(buff[:])
|
|
|
|
body := io.TeeReader(errorBody, ringBuffer)
|
|
decoder := json.NewDecoder(body)
|
|
decoder.UseNumber()
|
|
bodyInfo, err := getProtocolErrorInfo(decoder)
|
|
if err != nil {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
err = &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
return err
|
|
}
|
|
|
|
errorBody.Seek(0, io.SeekStart)
|
|
if typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok {
|
|
errorCode = restjson.SanitizeErrorCode(typ)
|
|
}
|
|
if len(bodyInfo.Message) != 0 {
|
|
errorMessage = bodyInfo.Message
|
|
}
|
|
switch {
|
|
case strings.EqualFold("ImageNotFoundException", errorCode):
|
|
return awsAwsjson11_deserializeErrorImageNotFoundException(response, errorBody)
|
|
|
|
case strings.EqualFold("InvalidParameterException", errorCode):
|
|
return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody)
|
|
|
|
case strings.EqualFold("LimitExceededException", errorCode):
|
|
return awsAwsjson11_deserializeErrorLimitExceededException(response, errorBody)
|
|
|
|
case strings.EqualFold("RepositoryNotFoundException", errorCode):
|
|
return awsAwsjson11_deserializeErrorRepositoryNotFoundException(response, errorBody)
|
|
|
|
case strings.EqualFold("ServerException", errorCode):
|
|
return awsAwsjson11_deserializeErrorServerException(response, errorBody)
|
|
|
|
case strings.EqualFold("UnsupportedImageTypeException", errorCode):
|
|
return awsAwsjson11_deserializeErrorUnsupportedImageTypeException(response, errorBody)
|
|
|
|
case strings.EqualFold("ValidationException", errorCode):
|
|
return awsAwsjson11_deserializeErrorValidationException(response, errorBody)
|
|
|
|
default:
|
|
genericError := &smithy.GenericAPIError{
|
|
Code: errorCode,
|
|
Message: errorMessage,
|
|
}
|
|
return genericError
|
|
|
|
}
|
|
}
|
|
|
|
type awsAwsjson11_deserializeOpStartLifecyclePolicyPreview struct {
|
|
}
|
|
|
|
func (*awsAwsjson11_deserializeOpStartLifecyclePolicyPreview) ID() string {
|
|
return "OperationDeserializer"
|
|
}
|
|
|
|
func (m *awsAwsjson11_deserializeOpStartLifecyclePolicyPreview) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
|
|
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
|
|
) {
|
|
out, metadata, err = next.HandleDeserialize(ctx, in)
|
|
if err != nil {
|
|
return out, metadata, err
|
|
}
|
|
|
|
response, ok := out.RawResponse.(*smithyhttp.Response)
|
|
if !ok {
|
|
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
|
|
}
|
|
|
|
if response.StatusCode < 200 || response.StatusCode >= 300 {
|
|
return out, metadata, awsAwsjson11_deserializeOpErrorStartLifecyclePolicyPreview(response, &metadata)
|
|
}
|
|
output := &StartLifecyclePolicyPreviewOutput{}
|
|
out.Result = output
|
|
|
|
var buff [1024]byte
|
|
ringBuffer := smithyio.NewRingBuffer(buff[:])
|
|
|
|
body := io.TeeReader(response.Body, ringBuffer)
|
|
decoder := json.NewDecoder(body)
|
|
decoder.UseNumber()
|
|
var shape interface{}
|
|
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
err = &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
return out, metadata, err
|
|
}
|
|
|
|
err = awsAwsjson11_deserializeOpDocumentStartLifecyclePolicyPreviewOutput(&output, shape)
|
|
if err != nil {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
err = &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
return out, metadata, err
|
|
}
|
|
|
|
return out, metadata, err
|
|
}
|
|
|
|
func awsAwsjson11_deserializeOpErrorStartLifecyclePolicyPreview(response *smithyhttp.Response, metadata *middleware.Metadata) error {
|
|
var errorBuffer bytes.Buffer
|
|
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
|
|
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
|
|
}
|
|
errorBody := bytes.NewReader(errorBuffer.Bytes())
|
|
|
|
errorCode := "UnknownError"
|
|
errorMessage := errorCode
|
|
|
|
headerCode := response.Header.Get("X-Amzn-ErrorType")
|
|
|
|
var buff [1024]byte
|
|
ringBuffer := smithyio.NewRingBuffer(buff[:])
|
|
|
|
body := io.TeeReader(errorBody, ringBuffer)
|
|
decoder := json.NewDecoder(body)
|
|
decoder.UseNumber()
|
|
bodyInfo, err := getProtocolErrorInfo(decoder)
|
|
if err != nil {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
err = &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
return err
|
|
}
|
|
|
|
errorBody.Seek(0, io.SeekStart)
|
|
if typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok {
|
|
errorCode = restjson.SanitizeErrorCode(typ)
|
|
}
|
|
if len(bodyInfo.Message) != 0 {
|
|
errorMessage = bodyInfo.Message
|
|
}
|
|
switch {
|
|
case strings.EqualFold("InvalidParameterException", errorCode):
|
|
return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody)
|
|
|
|
case strings.EqualFold("LifecyclePolicyNotFoundException", errorCode):
|
|
return awsAwsjson11_deserializeErrorLifecyclePolicyNotFoundException(response, errorBody)
|
|
|
|
case strings.EqualFold("LifecyclePolicyPreviewInProgressException", errorCode):
|
|
return awsAwsjson11_deserializeErrorLifecyclePolicyPreviewInProgressException(response, errorBody)
|
|
|
|
case strings.EqualFold("RepositoryNotFoundException", errorCode):
|
|
return awsAwsjson11_deserializeErrorRepositoryNotFoundException(response, errorBody)
|
|
|
|
case strings.EqualFold("ServerException", errorCode):
|
|
return awsAwsjson11_deserializeErrorServerException(response, errorBody)
|
|
|
|
case strings.EqualFold("ValidationException", errorCode):
|
|
return awsAwsjson11_deserializeErrorValidationException(response, errorBody)
|
|
|
|
default:
|
|
genericError := &smithy.GenericAPIError{
|
|
Code: errorCode,
|
|
Message: errorMessage,
|
|
}
|
|
return genericError
|
|
|
|
}
|
|
}
|
|
|
|
type awsAwsjson11_deserializeOpTagResource struct {
|
|
}
|
|
|
|
func (*awsAwsjson11_deserializeOpTagResource) ID() string {
|
|
return "OperationDeserializer"
|
|
}
|
|
|
|
func (m *awsAwsjson11_deserializeOpTagResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
|
|
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
|
|
) {
|
|
out, metadata, err = next.HandleDeserialize(ctx, in)
|
|
if err != nil {
|
|
return out, metadata, err
|
|
}
|
|
|
|
response, ok := out.RawResponse.(*smithyhttp.Response)
|
|
if !ok {
|
|
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
|
|
}
|
|
|
|
if response.StatusCode < 200 || response.StatusCode >= 300 {
|
|
return out, metadata, awsAwsjson11_deserializeOpErrorTagResource(response, &metadata)
|
|
}
|
|
output := &TagResourceOutput{}
|
|
out.Result = output
|
|
|
|
var buff [1024]byte
|
|
ringBuffer := smithyio.NewRingBuffer(buff[:])
|
|
|
|
body := io.TeeReader(response.Body, ringBuffer)
|
|
decoder := json.NewDecoder(body)
|
|
decoder.UseNumber()
|
|
var shape interface{}
|
|
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
err = &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
return out, metadata, err
|
|
}
|
|
|
|
err = awsAwsjson11_deserializeOpDocumentTagResourceOutput(&output, shape)
|
|
if err != nil {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
err = &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
return out, metadata, err
|
|
}
|
|
|
|
return out, metadata, err
|
|
}
|
|
|
|
func awsAwsjson11_deserializeOpErrorTagResource(response *smithyhttp.Response, metadata *middleware.Metadata) error {
|
|
var errorBuffer bytes.Buffer
|
|
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
|
|
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
|
|
}
|
|
errorBody := bytes.NewReader(errorBuffer.Bytes())
|
|
|
|
errorCode := "UnknownError"
|
|
errorMessage := errorCode
|
|
|
|
headerCode := response.Header.Get("X-Amzn-ErrorType")
|
|
|
|
var buff [1024]byte
|
|
ringBuffer := smithyio.NewRingBuffer(buff[:])
|
|
|
|
body := io.TeeReader(errorBody, ringBuffer)
|
|
decoder := json.NewDecoder(body)
|
|
decoder.UseNumber()
|
|
bodyInfo, err := getProtocolErrorInfo(decoder)
|
|
if err != nil {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
err = &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
return err
|
|
}
|
|
|
|
errorBody.Seek(0, io.SeekStart)
|
|
if typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok {
|
|
errorCode = restjson.SanitizeErrorCode(typ)
|
|
}
|
|
if len(bodyInfo.Message) != 0 {
|
|
errorMessage = bodyInfo.Message
|
|
}
|
|
switch {
|
|
case strings.EqualFold("InvalidParameterException", errorCode):
|
|
return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody)
|
|
|
|
case strings.EqualFold("InvalidTagParameterException", errorCode):
|
|
return awsAwsjson11_deserializeErrorInvalidTagParameterException(response, errorBody)
|
|
|
|
case strings.EqualFold("RepositoryNotFoundException", errorCode):
|
|
return awsAwsjson11_deserializeErrorRepositoryNotFoundException(response, errorBody)
|
|
|
|
case strings.EqualFold("ServerException", errorCode):
|
|
return awsAwsjson11_deserializeErrorServerException(response, errorBody)
|
|
|
|
case strings.EqualFold("TooManyTagsException", errorCode):
|
|
return awsAwsjson11_deserializeErrorTooManyTagsException(response, errorBody)
|
|
|
|
default:
|
|
genericError := &smithy.GenericAPIError{
|
|
Code: errorCode,
|
|
Message: errorMessage,
|
|
}
|
|
return genericError
|
|
|
|
}
|
|
}
|
|
|
|
type awsAwsjson11_deserializeOpUntagResource struct {
|
|
}
|
|
|
|
func (*awsAwsjson11_deserializeOpUntagResource) ID() string {
|
|
return "OperationDeserializer"
|
|
}
|
|
|
|
func (m *awsAwsjson11_deserializeOpUntagResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
|
|
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
|
|
) {
|
|
out, metadata, err = next.HandleDeserialize(ctx, in)
|
|
if err != nil {
|
|
return out, metadata, err
|
|
}
|
|
|
|
response, ok := out.RawResponse.(*smithyhttp.Response)
|
|
if !ok {
|
|
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
|
|
}
|
|
|
|
if response.StatusCode < 200 || response.StatusCode >= 300 {
|
|
return out, metadata, awsAwsjson11_deserializeOpErrorUntagResource(response, &metadata)
|
|
}
|
|
output := &UntagResourceOutput{}
|
|
out.Result = output
|
|
|
|
var buff [1024]byte
|
|
ringBuffer := smithyio.NewRingBuffer(buff[:])
|
|
|
|
body := io.TeeReader(response.Body, ringBuffer)
|
|
decoder := json.NewDecoder(body)
|
|
decoder.UseNumber()
|
|
var shape interface{}
|
|
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
err = &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
return out, metadata, err
|
|
}
|
|
|
|
err = awsAwsjson11_deserializeOpDocumentUntagResourceOutput(&output, shape)
|
|
if err != nil {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
err = &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
return out, metadata, err
|
|
}
|
|
|
|
return out, metadata, err
|
|
}
|
|
|
|
func awsAwsjson11_deserializeOpErrorUntagResource(response *smithyhttp.Response, metadata *middleware.Metadata) error {
|
|
var errorBuffer bytes.Buffer
|
|
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
|
|
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
|
|
}
|
|
errorBody := bytes.NewReader(errorBuffer.Bytes())
|
|
|
|
errorCode := "UnknownError"
|
|
errorMessage := errorCode
|
|
|
|
headerCode := response.Header.Get("X-Amzn-ErrorType")
|
|
|
|
var buff [1024]byte
|
|
ringBuffer := smithyio.NewRingBuffer(buff[:])
|
|
|
|
body := io.TeeReader(errorBody, ringBuffer)
|
|
decoder := json.NewDecoder(body)
|
|
decoder.UseNumber()
|
|
bodyInfo, err := getProtocolErrorInfo(decoder)
|
|
if err != nil {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
err = &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
return err
|
|
}
|
|
|
|
errorBody.Seek(0, io.SeekStart)
|
|
if typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok {
|
|
errorCode = restjson.SanitizeErrorCode(typ)
|
|
}
|
|
if len(bodyInfo.Message) != 0 {
|
|
errorMessage = bodyInfo.Message
|
|
}
|
|
switch {
|
|
case strings.EqualFold("InvalidParameterException", errorCode):
|
|
return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody)
|
|
|
|
case strings.EqualFold("InvalidTagParameterException", errorCode):
|
|
return awsAwsjson11_deserializeErrorInvalidTagParameterException(response, errorBody)
|
|
|
|
case strings.EqualFold("RepositoryNotFoundException", errorCode):
|
|
return awsAwsjson11_deserializeErrorRepositoryNotFoundException(response, errorBody)
|
|
|
|
case strings.EqualFold("ServerException", errorCode):
|
|
return awsAwsjson11_deserializeErrorServerException(response, errorBody)
|
|
|
|
case strings.EqualFold("TooManyTagsException", errorCode):
|
|
return awsAwsjson11_deserializeErrorTooManyTagsException(response, errorBody)
|
|
|
|
default:
|
|
genericError := &smithy.GenericAPIError{
|
|
Code: errorCode,
|
|
Message: errorMessage,
|
|
}
|
|
return genericError
|
|
|
|
}
|
|
}
|
|
|
|
type awsAwsjson11_deserializeOpUpdatePullThroughCacheRule struct {
|
|
}
|
|
|
|
func (*awsAwsjson11_deserializeOpUpdatePullThroughCacheRule) ID() string {
|
|
return "OperationDeserializer"
|
|
}
|
|
|
|
func (m *awsAwsjson11_deserializeOpUpdatePullThroughCacheRule) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
|
|
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
|
|
) {
|
|
out, metadata, err = next.HandleDeserialize(ctx, in)
|
|
if err != nil {
|
|
return out, metadata, err
|
|
}
|
|
|
|
response, ok := out.RawResponse.(*smithyhttp.Response)
|
|
if !ok {
|
|
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
|
|
}
|
|
|
|
if response.StatusCode < 200 || response.StatusCode >= 300 {
|
|
return out, metadata, awsAwsjson11_deserializeOpErrorUpdatePullThroughCacheRule(response, &metadata)
|
|
}
|
|
output := &UpdatePullThroughCacheRuleOutput{}
|
|
out.Result = output
|
|
|
|
var buff [1024]byte
|
|
ringBuffer := smithyio.NewRingBuffer(buff[:])
|
|
|
|
body := io.TeeReader(response.Body, ringBuffer)
|
|
decoder := json.NewDecoder(body)
|
|
decoder.UseNumber()
|
|
var shape interface{}
|
|
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
err = &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
return out, metadata, err
|
|
}
|
|
|
|
err = awsAwsjson11_deserializeOpDocumentUpdatePullThroughCacheRuleOutput(&output, shape)
|
|
if err != nil {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
err = &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
return out, metadata, err
|
|
}
|
|
|
|
return out, metadata, err
|
|
}
|
|
|
|
func awsAwsjson11_deserializeOpErrorUpdatePullThroughCacheRule(response *smithyhttp.Response, metadata *middleware.Metadata) error {
|
|
var errorBuffer bytes.Buffer
|
|
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
|
|
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
|
|
}
|
|
errorBody := bytes.NewReader(errorBuffer.Bytes())
|
|
|
|
errorCode := "UnknownError"
|
|
errorMessage := errorCode
|
|
|
|
headerCode := response.Header.Get("X-Amzn-ErrorType")
|
|
|
|
var buff [1024]byte
|
|
ringBuffer := smithyio.NewRingBuffer(buff[:])
|
|
|
|
body := io.TeeReader(errorBody, ringBuffer)
|
|
decoder := json.NewDecoder(body)
|
|
decoder.UseNumber()
|
|
bodyInfo, err := getProtocolErrorInfo(decoder)
|
|
if err != nil {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
err = &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
return err
|
|
}
|
|
|
|
errorBody.Seek(0, io.SeekStart)
|
|
if typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok {
|
|
errorCode = restjson.SanitizeErrorCode(typ)
|
|
}
|
|
if len(bodyInfo.Message) != 0 {
|
|
errorMessage = bodyInfo.Message
|
|
}
|
|
switch {
|
|
case strings.EqualFold("InvalidParameterException", errorCode):
|
|
return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody)
|
|
|
|
case strings.EqualFold("PullThroughCacheRuleNotFoundException", errorCode):
|
|
return awsAwsjson11_deserializeErrorPullThroughCacheRuleNotFoundException(response, errorBody)
|
|
|
|
case strings.EqualFold("SecretNotFoundException", errorCode):
|
|
return awsAwsjson11_deserializeErrorSecretNotFoundException(response, errorBody)
|
|
|
|
case strings.EqualFold("ServerException", errorCode):
|
|
return awsAwsjson11_deserializeErrorServerException(response, errorBody)
|
|
|
|
case strings.EqualFold("UnableToAccessSecretException", errorCode):
|
|
return awsAwsjson11_deserializeErrorUnableToAccessSecretException(response, errorBody)
|
|
|
|
case strings.EqualFold("UnableToDecryptSecretValueException", errorCode):
|
|
return awsAwsjson11_deserializeErrorUnableToDecryptSecretValueException(response, errorBody)
|
|
|
|
case strings.EqualFold("ValidationException", errorCode):
|
|
return awsAwsjson11_deserializeErrorValidationException(response, errorBody)
|
|
|
|
default:
|
|
genericError := &smithy.GenericAPIError{
|
|
Code: errorCode,
|
|
Message: errorMessage,
|
|
}
|
|
return genericError
|
|
|
|
}
|
|
}
|
|
|
|
type awsAwsjson11_deserializeOpUploadLayerPart struct {
|
|
}
|
|
|
|
func (*awsAwsjson11_deserializeOpUploadLayerPart) ID() string {
|
|
return "OperationDeserializer"
|
|
}
|
|
|
|
func (m *awsAwsjson11_deserializeOpUploadLayerPart) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
|
|
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
|
|
) {
|
|
out, metadata, err = next.HandleDeserialize(ctx, in)
|
|
if err != nil {
|
|
return out, metadata, err
|
|
}
|
|
|
|
response, ok := out.RawResponse.(*smithyhttp.Response)
|
|
if !ok {
|
|
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
|
|
}
|
|
|
|
if response.StatusCode < 200 || response.StatusCode >= 300 {
|
|
return out, metadata, awsAwsjson11_deserializeOpErrorUploadLayerPart(response, &metadata)
|
|
}
|
|
output := &UploadLayerPartOutput{}
|
|
out.Result = output
|
|
|
|
var buff [1024]byte
|
|
ringBuffer := smithyio.NewRingBuffer(buff[:])
|
|
|
|
body := io.TeeReader(response.Body, ringBuffer)
|
|
decoder := json.NewDecoder(body)
|
|
decoder.UseNumber()
|
|
var shape interface{}
|
|
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
err = &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
return out, metadata, err
|
|
}
|
|
|
|
err = awsAwsjson11_deserializeOpDocumentUploadLayerPartOutput(&output, shape)
|
|
if err != nil {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
err = &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
return out, metadata, err
|
|
}
|
|
|
|
return out, metadata, err
|
|
}
|
|
|
|
func awsAwsjson11_deserializeOpErrorUploadLayerPart(response *smithyhttp.Response, metadata *middleware.Metadata) error {
|
|
var errorBuffer bytes.Buffer
|
|
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
|
|
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
|
|
}
|
|
errorBody := bytes.NewReader(errorBuffer.Bytes())
|
|
|
|
errorCode := "UnknownError"
|
|
errorMessage := errorCode
|
|
|
|
headerCode := response.Header.Get("X-Amzn-ErrorType")
|
|
|
|
var buff [1024]byte
|
|
ringBuffer := smithyio.NewRingBuffer(buff[:])
|
|
|
|
body := io.TeeReader(errorBody, ringBuffer)
|
|
decoder := json.NewDecoder(body)
|
|
decoder.UseNumber()
|
|
bodyInfo, err := getProtocolErrorInfo(decoder)
|
|
if err != nil {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
err = &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
return err
|
|
}
|
|
|
|
errorBody.Seek(0, io.SeekStart)
|
|
if typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok {
|
|
errorCode = restjson.SanitizeErrorCode(typ)
|
|
}
|
|
if len(bodyInfo.Message) != 0 {
|
|
errorMessage = bodyInfo.Message
|
|
}
|
|
switch {
|
|
case strings.EqualFold("InvalidLayerPartException", errorCode):
|
|
return awsAwsjson11_deserializeErrorInvalidLayerPartException(response, errorBody)
|
|
|
|
case strings.EqualFold("InvalidParameterException", errorCode):
|
|
return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody)
|
|
|
|
case strings.EqualFold("KmsException", errorCode):
|
|
return awsAwsjson11_deserializeErrorKmsException(response, errorBody)
|
|
|
|
case strings.EqualFold("LimitExceededException", errorCode):
|
|
return awsAwsjson11_deserializeErrorLimitExceededException(response, errorBody)
|
|
|
|
case strings.EqualFold("RepositoryNotFoundException", errorCode):
|
|
return awsAwsjson11_deserializeErrorRepositoryNotFoundException(response, errorBody)
|
|
|
|
case strings.EqualFold("ServerException", errorCode):
|
|
return awsAwsjson11_deserializeErrorServerException(response, errorBody)
|
|
|
|
case strings.EqualFold("UploadNotFoundException", errorCode):
|
|
return awsAwsjson11_deserializeErrorUploadNotFoundException(response, errorBody)
|
|
|
|
default:
|
|
genericError := &smithy.GenericAPIError{
|
|
Code: errorCode,
|
|
Message: errorMessage,
|
|
}
|
|
return genericError
|
|
|
|
}
|
|
}
|
|
|
|
type awsAwsjson11_deserializeOpValidatePullThroughCacheRule struct {
|
|
}
|
|
|
|
func (*awsAwsjson11_deserializeOpValidatePullThroughCacheRule) ID() string {
|
|
return "OperationDeserializer"
|
|
}
|
|
|
|
func (m *awsAwsjson11_deserializeOpValidatePullThroughCacheRule) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
|
|
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
|
|
) {
|
|
out, metadata, err = next.HandleDeserialize(ctx, in)
|
|
if err != nil {
|
|
return out, metadata, err
|
|
}
|
|
|
|
response, ok := out.RawResponse.(*smithyhttp.Response)
|
|
if !ok {
|
|
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
|
|
}
|
|
|
|
if response.StatusCode < 200 || response.StatusCode >= 300 {
|
|
return out, metadata, awsAwsjson11_deserializeOpErrorValidatePullThroughCacheRule(response, &metadata)
|
|
}
|
|
output := &ValidatePullThroughCacheRuleOutput{}
|
|
out.Result = output
|
|
|
|
var buff [1024]byte
|
|
ringBuffer := smithyio.NewRingBuffer(buff[:])
|
|
|
|
body := io.TeeReader(response.Body, ringBuffer)
|
|
decoder := json.NewDecoder(body)
|
|
decoder.UseNumber()
|
|
var shape interface{}
|
|
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
err = &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
return out, metadata, err
|
|
}
|
|
|
|
err = awsAwsjson11_deserializeOpDocumentValidatePullThroughCacheRuleOutput(&output, shape)
|
|
if err != nil {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
err = &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
return out, metadata, err
|
|
}
|
|
|
|
return out, metadata, err
|
|
}
|
|
|
|
func awsAwsjson11_deserializeOpErrorValidatePullThroughCacheRule(response *smithyhttp.Response, metadata *middleware.Metadata) error {
|
|
var errorBuffer bytes.Buffer
|
|
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
|
|
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
|
|
}
|
|
errorBody := bytes.NewReader(errorBuffer.Bytes())
|
|
|
|
errorCode := "UnknownError"
|
|
errorMessage := errorCode
|
|
|
|
headerCode := response.Header.Get("X-Amzn-ErrorType")
|
|
|
|
var buff [1024]byte
|
|
ringBuffer := smithyio.NewRingBuffer(buff[:])
|
|
|
|
body := io.TeeReader(errorBody, ringBuffer)
|
|
decoder := json.NewDecoder(body)
|
|
decoder.UseNumber()
|
|
bodyInfo, err := getProtocolErrorInfo(decoder)
|
|
if err != nil {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
err = &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
return err
|
|
}
|
|
|
|
errorBody.Seek(0, io.SeekStart)
|
|
if typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok {
|
|
errorCode = restjson.SanitizeErrorCode(typ)
|
|
}
|
|
if len(bodyInfo.Message) != 0 {
|
|
errorMessage = bodyInfo.Message
|
|
}
|
|
switch {
|
|
case strings.EqualFold("InvalidParameterException", errorCode):
|
|
return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody)
|
|
|
|
case strings.EqualFold("PullThroughCacheRuleNotFoundException", errorCode):
|
|
return awsAwsjson11_deserializeErrorPullThroughCacheRuleNotFoundException(response, errorBody)
|
|
|
|
case strings.EqualFold("ServerException", errorCode):
|
|
return awsAwsjson11_deserializeErrorServerException(response, errorBody)
|
|
|
|
case strings.EqualFold("ValidationException", errorCode):
|
|
return awsAwsjson11_deserializeErrorValidationException(response, errorBody)
|
|
|
|
default:
|
|
genericError := &smithy.GenericAPIError{
|
|
Code: errorCode,
|
|
Message: errorMessage,
|
|
}
|
|
return genericError
|
|
|
|
}
|
|
}
|
|
|
|
func awsAwsjson11_deserializeErrorEmptyUploadException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
|
|
var buff [1024]byte
|
|
ringBuffer := smithyio.NewRingBuffer(buff[:])
|
|
|
|
body := io.TeeReader(errorBody, ringBuffer)
|
|
decoder := json.NewDecoder(body)
|
|
decoder.UseNumber()
|
|
var shape interface{}
|
|
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
err = &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
return err
|
|
}
|
|
|
|
output := &types.EmptyUploadException{}
|
|
err := awsAwsjson11_deserializeDocumentEmptyUploadException(&output, shape)
|
|
|
|
if err != nil {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
err = &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
return err
|
|
}
|
|
|
|
errorBody.Seek(0, io.SeekStart)
|
|
return output
|
|
}
|
|
|
|
func awsAwsjson11_deserializeErrorImageAlreadyExistsException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
|
|
var buff [1024]byte
|
|
ringBuffer := smithyio.NewRingBuffer(buff[:])
|
|
|
|
body := io.TeeReader(errorBody, ringBuffer)
|
|
decoder := json.NewDecoder(body)
|
|
decoder.UseNumber()
|
|
var shape interface{}
|
|
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
err = &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
return err
|
|
}
|
|
|
|
output := &types.ImageAlreadyExistsException{}
|
|
err := awsAwsjson11_deserializeDocumentImageAlreadyExistsException(&output, shape)
|
|
|
|
if err != nil {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
err = &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
return err
|
|
}
|
|
|
|
errorBody.Seek(0, io.SeekStart)
|
|
return output
|
|
}
|
|
|
|
func awsAwsjson11_deserializeErrorImageDigestDoesNotMatchException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
|
|
var buff [1024]byte
|
|
ringBuffer := smithyio.NewRingBuffer(buff[:])
|
|
|
|
body := io.TeeReader(errorBody, ringBuffer)
|
|
decoder := json.NewDecoder(body)
|
|
decoder.UseNumber()
|
|
var shape interface{}
|
|
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
err = &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
return err
|
|
}
|
|
|
|
output := &types.ImageDigestDoesNotMatchException{}
|
|
err := awsAwsjson11_deserializeDocumentImageDigestDoesNotMatchException(&output, shape)
|
|
|
|
if err != nil {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
err = &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
return err
|
|
}
|
|
|
|
errorBody.Seek(0, io.SeekStart)
|
|
return output
|
|
}
|
|
|
|
func awsAwsjson11_deserializeErrorImageNotFoundException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
|
|
var buff [1024]byte
|
|
ringBuffer := smithyio.NewRingBuffer(buff[:])
|
|
|
|
body := io.TeeReader(errorBody, ringBuffer)
|
|
decoder := json.NewDecoder(body)
|
|
decoder.UseNumber()
|
|
var shape interface{}
|
|
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
err = &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
return err
|
|
}
|
|
|
|
output := &types.ImageNotFoundException{}
|
|
err := awsAwsjson11_deserializeDocumentImageNotFoundException(&output, shape)
|
|
|
|
if err != nil {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
err = &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
return err
|
|
}
|
|
|
|
errorBody.Seek(0, io.SeekStart)
|
|
return output
|
|
}
|
|
|
|
func awsAwsjson11_deserializeErrorImageTagAlreadyExistsException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
|
|
var buff [1024]byte
|
|
ringBuffer := smithyio.NewRingBuffer(buff[:])
|
|
|
|
body := io.TeeReader(errorBody, ringBuffer)
|
|
decoder := json.NewDecoder(body)
|
|
decoder.UseNumber()
|
|
var shape interface{}
|
|
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
err = &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
return err
|
|
}
|
|
|
|
output := &types.ImageTagAlreadyExistsException{}
|
|
err := awsAwsjson11_deserializeDocumentImageTagAlreadyExistsException(&output, shape)
|
|
|
|
if err != nil {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
err = &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
return err
|
|
}
|
|
|
|
errorBody.Seek(0, io.SeekStart)
|
|
return output
|
|
}
|
|
|
|
func awsAwsjson11_deserializeErrorInvalidLayerException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
|
|
var buff [1024]byte
|
|
ringBuffer := smithyio.NewRingBuffer(buff[:])
|
|
|
|
body := io.TeeReader(errorBody, ringBuffer)
|
|
decoder := json.NewDecoder(body)
|
|
decoder.UseNumber()
|
|
var shape interface{}
|
|
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
err = &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
return err
|
|
}
|
|
|
|
output := &types.InvalidLayerException{}
|
|
err := awsAwsjson11_deserializeDocumentInvalidLayerException(&output, shape)
|
|
|
|
if err != nil {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
err = &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
return err
|
|
}
|
|
|
|
errorBody.Seek(0, io.SeekStart)
|
|
return output
|
|
}
|
|
|
|
func awsAwsjson11_deserializeErrorInvalidLayerPartException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
|
|
var buff [1024]byte
|
|
ringBuffer := smithyio.NewRingBuffer(buff[:])
|
|
|
|
body := io.TeeReader(errorBody, ringBuffer)
|
|
decoder := json.NewDecoder(body)
|
|
decoder.UseNumber()
|
|
var shape interface{}
|
|
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
err = &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
return err
|
|
}
|
|
|
|
output := &types.InvalidLayerPartException{}
|
|
err := awsAwsjson11_deserializeDocumentInvalidLayerPartException(&output, shape)
|
|
|
|
if err != nil {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
err = &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
return err
|
|
}
|
|
|
|
errorBody.Seek(0, io.SeekStart)
|
|
return output
|
|
}
|
|
|
|
func awsAwsjson11_deserializeErrorInvalidParameterException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
|
|
var buff [1024]byte
|
|
ringBuffer := smithyio.NewRingBuffer(buff[:])
|
|
|
|
body := io.TeeReader(errorBody, ringBuffer)
|
|
decoder := json.NewDecoder(body)
|
|
decoder.UseNumber()
|
|
var shape interface{}
|
|
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
err = &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
return err
|
|
}
|
|
|
|
output := &types.InvalidParameterException{}
|
|
err := awsAwsjson11_deserializeDocumentInvalidParameterException(&output, shape)
|
|
|
|
if err != nil {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
err = &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
return err
|
|
}
|
|
|
|
errorBody.Seek(0, io.SeekStart)
|
|
return output
|
|
}
|
|
|
|
func awsAwsjson11_deserializeErrorInvalidTagParameterException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
|
|
var buff [1024]byte
|
|
ringBuffer := smithyio.NewRingBuffer(buff[:])
|
|
|
|
body := io.TeeReader(errorBody, ringBuffer)
|
|
decoder := json.NewDecoder(body)
|
|
decoder.UseNumber()
|
|
var shape interface{}
|
|
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
err = &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
return err
|
|
}
|
|
|
|
output := &types.InvalidTagParameterException{}
|
|
err := awsAwsjson11_deserializeDocumentInvalidTagParameterException(&output, shape)
|
|
|
|
if err != nil {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
err = &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
return err
|
|
}
|
|
|
|
errorBody.Seek(0, io.SeekStart)
|
|
return output
|
|
}
|
|
|
|
func awsAwsjson11_deserializeErrorKmsException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
|
|
var buff [1024]byte
|
|
ringBuffer := smithyio.NewRingBuffer(buff[:])
|
|
|
|
body := io.TeeReader(errorBody, ringBuffer)
|
|
decoder := json.NewDecoder(body)
|
|
decoder.UseNumber()
|
|
var shape interface{}
|
|
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
err = &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
return err
|
|
}
|
|
|
|
output := &types.KmsException{}
|
|
err := awsAwsjson11_deserializeDocumentKmsException(&output, shape)
|
|
|
|
if err != nil {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
err = &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
return err
|
|
}
|
|
|
|
errorBody.Seek(0, io.SeekStart)
|
|
return output
|
|
}
|
|
|
|
func awsAwsjson11_deserializeErrorLayerAlreadyExistsException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
|
|
var buff [1024]byte
|
|
ringBuffer := smithyio.NewRingBuffer(buff[:])
|
|
|
|
body := io.TeeReader(errorBody, ringBuffer)
|
|
decoder := json.NewDecoder(body)
|
|
decoder.UseNumber()
|
|
var shape interface{}
|
|
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
err = &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
return err
|
|
}
|
|
|
|
output := &types.LayerAlreadyExistsException{}
|
|
err := awsAwsjson11_deserializeDocumentLayerAlreadyExistsException(&output, shape)
|
|
|
|
if err != nil {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
err = &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
return err
|
|
}
|
|
|
|
errorBody.Seek(0, io.SeekStart)
|
|
return output
|
|
}
|
|
|
|
func awsAwsjson11_deserializeErrorLayerInaccessibleException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
|
|
var buff [1024]byte
|
|
ringBuffer := smithyio.NewRingBuffer(buff[:])
|
|
|
|
body := io.TeeReader(errorBody, ringBuffer)
|
|
decoder := json.NewDecoder(body)
|
|
decoder.UseNumber()
|
|
var shape interface{}
|
|
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
err = &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
return err
|
|
}
|
|
|
|
output := &types.LayerInaccessibleException{}
|
|
err := awsAwsjson11_deserializeDocumentLayerInaccessibleException(&output, shape)
|
|
|
|
if err != nil {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
err = &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
return err
|
|
}
|
|
|
|
errorBody.Seek(0, io.SeekStart)
|
|
return output
|
|
}
|
|
|
|
func awsAwsjson11_deserializeErrorLayerPartTooSmallException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
|
|
var buff [1024]byte
|
|
ringBuffer := smithyio.NewRingBuffer(buff[:])
|
|
|
|
body := io.TeeReader(errorBody, ringBuffer)
|
|
decoder := json.NewDecoder(body)
|
|
decoder.UseNumber()
|
|
var shape interface{}
|
|
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
err = &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
return err
|
|
}
|
|
|
|
output := &types.LayerPartTooSmallException{}
|
|
err := awsAwsjson11_deserializeDocumentLayerPartTooSmallException(&output, shape)
|
|
|
|
if err != nil {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
err = &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
return err
|
|
}
|
|
|
|
errorBody.Seek(0, io.SeekStart)
|
|
return output
|
|
}
|
|
|
|
func awsAwsjson11_deserializeErrorLayersNotFoundException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
|
|
var buff [1024]byte
|
|
ringBuffer := smithyio.NewRingBuffer(buff[:])
|
|
|
|
body := io.TeeReader(errorBody, ringBuffer)
|
|
decoder := json.NewDecoder(body)
|
|
decoder.UseNumber()
|
|
var shape interface{}
|
|
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
err = &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
return err
|
|
}
|
|
|
|
output := &types.LayersNotFoundException{}
|
|
err := awsAwsjson11_deserializeDocumentLayersNotFoundException(&output, shape)
|
|
|
|
if err != nil {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
err = &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
return err
|
|
}
|
|
|
|
errorBody.Seek(0, io.SeekStart)
|
|
return output
|
|
}
|
|
|
|
func awsAwsjson11_deserializeErrorLifecyclePolicyNotFoundException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
|
|
var buff [1024]byte
|
|
ringBuffer := smithyio.NewRingBuffer(buff[:])
|
|
|
|
body := io.TeeReader(errorBody, ringBuffer)
|
|
decoder := json.NewDecoder(body)
|
|
decoder.UseNumber()
|
|
var shape interface{}
|
|
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
err = &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
return err
|
|
}
|
|
|
|
output := &types.LifecyclePolicyNotFoundException{}
|
|
err := awsAwsjson11_deserializeDocumentLifecyclePolicyNotFoundException(&output, shape)
|
|
|
|
if err != nil {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
err = &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
return err
|
|
}
|
|
|
|
errorBody.Seek(0, io.SeekStart)
|
|
return output
|
|
}
|
|
|
|
func awsAwsjson11_deserializeErrorLifecyclePolicyPreviewInProgressException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
|
|
var buff [1024]byte
|
|
ringBuffer := smithyio.NewRingBuffer(buff[:])
|
|
|
|
body := io.TeeReader(errorBody, ringBuffer)
|
|
decoder := json.NewDecoder(body)
|
|
decoder.UseNumber()
|
|
var shape interface{}
|
|
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
err = &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
return err
|
|
}
|
|
|
|
output := &types.LifecyclePolicyPreviewInProgressException{}
|
|
err := awsAwsjson11_deserializeDocumentLifecyclePolicyPreviewInProgressException(&output, shape)
|
|
|
|
if err != nil {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
err = &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
return err
|
|
}
|
|
|
|
errorBody.Seek(0, io.SeekStart)
|
|
return output
|
|
}
|
|
|
|
func awsAwsjson11_deserializeErrorLifecyclePolicyPreviewNotFoundException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
|
|
var buff [1024]byte
|
|
ringBuffer := smithyio.NewRingBuffer(buff[:])
|
|
|
|
body := io.TeeReader(errorBody, ringBuffer)
|
|
decoder := json.NewDecoder(body)
|
|
decoder.UseNumber()
|
|
var shape interface{}
|
|
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
err = &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
return err
|
|
}
|
|
|
|
output := &types.LifecyclePolicyPreviewNotFoundException{}
|
|
err := awsAwsjson11_deserializeDocumentLifecyclePolicyPreviewNotFoundException(&output, shape)
|
|
|
|
if err != nil {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
err = &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
return err
|
|
}
|
|
|
|
errorBody.Seek(0, io.SeekStart)
|
|
return output
|
|
}
|
|
|
|
func awsAwsjson11_deserializeErrorLimitExceededException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
|
|
var buff [1024]byte
|
|
ringBuffer := smithyio.NewRingBuffer(buff[:])
|
|
|
|
body := io.TeeReader(errorBody, ringBuffer)
|
|
decoder := json.NewDecoder(body)
|
|
decoder.UseNumber()
|
|
var shape interface{}
|
|
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
err = &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
return err
|
|
}
|
|
|
|
output := &types.LimitExceededException{}
|
|
err := awsAwsjson11_deserializeDocumentLimitExceededException(&output, shape)
|
|
|
|
if err != nil {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
err = &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
return err
|
|
}
|
|
|
|
errorBody.Seek(0, io.SeekStart)
|
|
return output
|
|
}
|
|
|
|
func awsAwsjson11_deserializeErrorPullThroughCacheRuleAlreadyExistsException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
|
|
var buff [1024]byte
|
|
ringBuffer := smithyio.NewRingBuffer(buff[:])
|
|
|
|
body := io.TeeReader(errorBody, ringBuffer)
|
|
decoder := json.NewDecoder(body)
|
|
decoder.UseNumber()
|
|
var shape interface{}
|
|
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
err = &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
return err
|
|
}
|
|
|
|
output := &types.PullThroughCacheRuleAlreadyExistsException{}
|
|
err := awsAwsjson11_deserializeDocumentPullThroughCacheRuleAlreadyExistsException(&output, shape)
|
|
|
|
if err != nil {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
err = &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
return err
|
|
}
|
|
|
|
errorBody.Seek(0, io.SeekStart)
|
|
return output
|
|
}
|
|
|
|
func awsAwsjson11_deserializeErrorPullThroughCacheRuleNotFoundException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
|
|
var buff [1024]byte
|
|
ringBuffer := smithyio.NewRingBuffer(buff[:])
|
|
|
|
body := io.TeeReader(errorBody, ringBuffer)
|
|
decoder := json.NewDecoder(body)
|
|
decoder.UseNumber()
|
|
var shape interface{}
|
|
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
err = &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
return err
|
|
}
|
|
|
|
output := &types.PullThroughCacheRuleNotFoundException{}
|
|
err := awsAwsjson11_deserializeDocumentPullThroughCacheRuleNotFoundException(&output, shape)
|
|
|
|
if err != nil {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
err = &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
return err
|
|
}
|
|
|
|
errorBody.Seek(0, io.SeekStart)
|
|
return output
|
|
}
|
|
|
|
func awsAwsjson11_deserializeErrorReferencedImagesNotFoundException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
|
|
var buff [1024]byte
|
|
ringBuffer := smithyio.NewRingBuffer(buff[:])
|
|
|
|
body := io.TeeReader(errorBody, ringBuffer)
|
|
decoder := json.NewDecoder(body)
|
|
decoder.UseNumber()
|
|
var shape interface{}
|
|
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
err = &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
return err
|
|
}
|
|
|
|
output := &types.ReferencedImagesNotFoundException{}
|
|
err := awsAwsjson11_deserializeDocumentReferencedImagesNotFoundException(&output, shape)
|
|
|
|
if err != nil {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
err = &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
return err
|
|
}
|
|
|
|
errorBody.Seek(0, io.SeekStart)
|
|
return output
|
|
}
|
|
|
|
func awsAwsjson11_deserializeErrorRegistryPolicyNotFoundException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
|
|
var buff [1024]byte
|
|
ringBuffer := smithyio.NewRingBuffer(buff[:])
|
|
|
|
body := io.TeeReader(errorBody, ringBuffer)
|
|
decoder := json.NewDecoder(body)
|
|
decoder.UseNumber()
|
|
var shape interface{}
|
|
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
err = &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
return err
|
|
}
|
|
|
|
output := &types.RegistryPolicyNotFoundException{}
|
|
err := awsAwsjson11_deserializeDocumentRegistryPolicyNotFoundException(&output, shape)
|
|
|
|
if err != nil {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
err = &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
return err
|
|
}
|
|
|
|
errorBody.Seek(0, io.SeekStart)
|
|
return output
|
|
}
|
|
|
|
func awsAwsjson11_deserializeErrorRepositoryAlreadyExistsException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
|
|
var buff [1024]byte
|
|
ringBuffer := smithyio.NewRingBuffer(buff[:])
|
|
|
|
body := io.TeeReader(errorBody, ringBuffer)
|
|
decoder := json.NewDecoder(body)
|
|
decoder.UseNumber()
|
|
var shape interface{}
|
|
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
err = &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
return err
|
|
}
|
|
|
|
output := &types.RepositoryAlreadyExistsException{}
|
|
err := awsAwsjson11_deserializeDocumentRepositoryAlreadyExistsException(&output, shape)
|
|
|
|
if err != nil {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
err = &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
return err
|
|
}
|
|
|
|
errorBody.Seek(0, io.SeekStart)
|
|
return output
|
|
}
|
|
|
|
func awsAwsjson11_deserializeErrorRepositoryNotEmptyException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
|
|
var buff [1024]byte
|
|
ringBuffer := smithyio.NewRingBuffer(buff[:])
|
|
|
|
body := io.TeeReader(errorBody, ringBuffer)
|
|
decoder := json.NewDecoder(body)
|
|
decoder.UseNumber()
|
|
var shape interface{}
|
|
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
err = &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
return err
|
|
}
|
|
|
|
output := &types.RepositoryNotEmptyException{}
|
|
err := awsAwsjson11_deserializeDocumentRepositoryNotEmptyException(&output, shape)
|
|
|
|
if err != nil {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
err = &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
return err
|
|
}
|
|
|
|
errorBody.Seek(0, io.SeekStart)
|
|
return output
|
|
}
|
|
|
|
func awsAwsjson11_deserializeErrorRepositoryNotFoundException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
|
|
var buff [1024]byte
|
|
ringBuffer := smithyio.NewRingBuffer(buff[:])
|
|
|
|
body := io.TeeReader(errorBody, ringBuffer)
|
|
decoder := json.NewDecoder(body)
|
|
decoder.UseNumber()
|
|
var shape interface{}
|
|
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
err = &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
return err
|
|
}
|
|
|
|
output := &types.RepositoryNotFoundException{}
|
|
err := awsAwsjson11_deserializeDocumentRepositoryNotFoundException(&output, shape)
|
|
|
|
if err != nil {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
err = &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
return err
|
|
}
|
|
|
|
errorBody.Seek(0, io.SeekStart)
|
|
return output
|
|
}
|
|
|
|
func awsAwsjson11_deserializeErrorRepositoryPolicyNotFoundException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
|
|
var buff [1024]byte
|
|
ringBuffer := smithyio.NewRingBuffer(buff[:])
|
|
|
|
body := io.TeeReader(errorBody, ringBuffer)
|
|
decoder := json.NewDecoder(body)
|
|
decoder.UseNumber()
|
|
var shape interface{}
|
|
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
err = &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
return err
|
|
}
|
|
|
|
output := &types.RepositoryPolicyNotFoundException{}
|
|
err := awsAwsjson11_deserializeDocumentRepositoryPolicyNotFoundException(&output, shape)
|
|
|
|
if err != nil {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
err = &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
return err
|
|
}
|
|
|
|
errorBody.Seek(0, io.SeekStart)
|
|
return output
|
|
}
|
|
|
|
func awsAwsjson11_deserializeErrorScanNotFoundException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
|
|
var buff [1024]byte
|
|
ringBuffer := smithyio.NewRingBuffer(buff[:])
|
|
|
|
body := io.TeeReader(errorBody, ringBuffer)
|
|
decoder := json.NewDecoder(body)
|
|
decoder.UseNumber()
|
|
var shape interface{}
|
|
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
err = &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
return err
|
|
}
|
|
|
|
output := &types.ScanNotFoundException{}
|
|
err := awsAwsjson11_deserializeDocumentScanNotFoundException(&output, shape)
|
|
|
|
if err != nil {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
err = &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
return err
|
|
}
|
|
|
|
errorBody.Seek(0, io.SeekStart)
|
|
return output
|
|
}
|
|
|
|
func awsAwsjson11_deserializeErrorSecretNotFoundException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
|
|
var buff [1024]byte
|
|
ringBuffer := smithyio.NewRingBuffer(buff[:])
|
|
|
|
body := io.TeeReader(errorBody, ringBuffer)
|
|
decoder := json.NewDecoder(body)
|
|
decoder.UseNumber()
|
|
var shape interface{}
|
|
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
err = &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
return err
|
|
}
|
|
|
|
output := &types.SecretNotFoundException{}
|
|
err := awsAwsjson11_deserializeDocumentSecretNotFoundException(&output, shape)
|
|
|
|
if err != nil {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
err = &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
return err
|
|
}
|
|
|
|
errorBody.Seek(0, io.SeekStart)
|
|
return output
|
|
}
|
|
|
|
func awsAwsjson11_deserializeErrorServerException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
|
|
var buff [1024]byte
|
|
ringBuffer := smithyio.NewRingBuffer(buff[:])
|
|
|
|
body := io.TeeReader(errorBody, ringBuffer)
|
|
decoder := json.NewDecoder(body)
|
|
decoder.UseNumber()
|
|
var shape interface{}
|
|
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
err = &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
return err
|
|
}
|
|
|
|
output := &types.ServerException{}
|
|
err := awsAwsjson11_deserializeDocumentServerException(&output, shape)
|
|
|
|
if err != nil {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
err = &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
return err
|
|
}
|
|
|
|
errorBody.Seek(0, io.SeekStart)
|
|
return output
|
|
}
|
|
|
|
func awsAwsjson11_deserializeErrorTooManyTagsException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
|
|
var buff [1024]byte
|
|
ringBuffer := smithyio.NewRingBuffer(buff[:])
|
|
|
|
body := io.TeeReader(errorBody, ringBuffer)
|
|
decoder := json.NewDecoder(body)
|
|
decoder.UseNumber()
|
|
var shape interface{}
|
|
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
err = &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
return err
|
|
}
|
|
|
|
output := &types.TooManyTagsException{}
|
|
err := awsAwsjson11_deserializeDocumentTooManyTagsException(&output, shape)
|
|
|
|
if err != nil {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
err = &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
return err
|
|
}
|
|
|
|
errorBody.Seek(0, io.SeekStart)
|
|
return output
|
|
}
|
|
|
|
func awsAwsjson11_deserializeErrorUnableToAccessSecretException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
|
|
var buff [1024]byte
|
|
ringBuffer := smithyio.NewRingBuffer(buff[:])
|
|
|
|
body := io.TeeReader(errorBody, ringBuffer)
|
|
decoder := json.NewDecoder(body)
|
|
decoder.UseNumber()
|
|
var shape interface{}
|
|
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
err = &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
return err
|
|
}
|
|
|
|
output := &types.UnableToAccessSecretException{}
|
|
err := awsAwsjson11_deserializeDocumentUnableToAccessSecretException(&output, shape)
|
|
|
|
if err != nil {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
err = &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
return err
|
|
}
|
|
|
|
errorBody.Seek(0, io.SeekStart)
|
|
return output
|
|
}
|
|
|
|
func awsAwsjson11_deserializeErrorUnableToDecryptSecretValueException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
|
|
var buff [1024]byte
|
|
ringBuffer := smithyio.NewRingBuffer(buff[:])
|
|
|
|
body := io.TeeReader(errorBody, ringBuffer)
|
|
decoder := json.NewDecoder(body)
|
|
decoder.UseNumber()
|
|
var shape interface{}
|
|
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
err = &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
return err
|
|
}
|
|
|
|
output := &types.UnableToDecryptSecretValueException{}
|
|
err := awsAwsjson11_deserializeDocumentUnableToDecryptSecretValueException(&output, shape)
|
|
|
|
if err != nil {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
err = &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
return err
|
|
}
|
|
|
|
errorBody.Seek(0, io.SeekStart)
|
|
return output
|
|
}
|
|
|
|
func awsAwsjson11_deserializeErrorUnableToGetUpstreamImageException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
|
|
var buff [1024]byte
|
|
ringBuffer := smithyio.NewRingBuffer(buff[:])
|
|
|
|
body := io.TeeReader(errorBody, ringBuffer)
|
|
decoder := json.NewDecoder(body)
|
|
decoder.UseNumber()
|
|
var shape interface{}
|
|
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
err = &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
return err
|
|
}
|
|
|
|
output := &types.UnableToGetUpstreamImageException{}
|
|
err := awsAwsjson11_deserializeDocumentUnableToGetUpstreamImageException(&output, shape)
|
|
|
|
if err != nil {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
err = &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
return err
|
|
}
|
|
|
|
errorBody.Seek(0, io.SeekStart)
|
|
return output
|
|
}
|
|
|
|
func awsAwsjson11_deserializeErrorUnableToGetUpstreamLayerException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
|
|
var buff [1024]byte
|
|
ringBuffer := smithyio.NewRingBuffer(buff[:])
|
|
|
|
body := io.TeeReader(errorBody, ringBuffer)
|
|
decoder := json.NewDecoder(body)
|
|
decoder.UseNumber()
|
|
var shape interface{}
|
|
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
err = &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
return err
|
|
}
|
|
|
|
output := &types.UnableToGetUpstreamLayerException{}
|
|
err := awsAwsjson11_deserializeDocumentUnableToGetUpstreamLayerException(&output, shape)
|
|
|
|
if err != nil {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
err = &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
return err
|
|
}
|
|
|
|
errorBody.Seek(0, io.SeekStart)
|
|
return output
|
|
}
|
|
|
|
func awsAwsjson11_deserializeErrorUnsupportedImageTypeException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
|
|
var buff [1024]byte
|
|
ringBuffer := smithyio.NewRingBuffer(buff[:])
|
|
|
|
body := io.TeeReader(errorBody, ringBuffer)
|
|
decoder := json.NewDecoder(body)
|
|
decoder.UseNumber()
|
|
var shape interface{}
|
|
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
err = &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
return err
|
|
}
|
|
|
|
output := &types.UnsupportedImageTypeException{}
|
|
err := awsAwsjson11_deserializeDocumentUnsupportedImageTypeException(&output, shape)
|
|
|
|
if err != nil {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
err = &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
return err
|
|
}
|
|
|
|
errorBody.Seek(0, io.SeekStart)
|
|
return output
|
|
}
|
|
|
|
func awsAwsjson11_deserializeErrorUnsupportedUpstreamRegistryException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
|
|
var buff [1024]byte
|
|
ringBuffer := smithyio.NewRingBuffer(buff[:])
|
|
|
|
body := io.TeeReader(errorBody, ringBuffer)
|
|
decoder := json.NewDecoder(body)
|
|
decoder.UseNumber()
|
|
var shape interface{}
|
|
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
err = &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
return err
|
|
}
|
|
|
|
output := &types.UnsupportedUpstreamRegistryException{}
|
|
err := awsAwsjson11_deserializeDocumentUnsupportedUpstreamRegistryException(&output, shape)
|
|
|
|
if err != nil {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
err = &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
return err
|
|
}
|
|
|
|
errorBody.Seek(0, io.SeekStart)
|
|
return output
|
|
}
|
|
|
|
func awsAwsjson11_deserializeErrorUploadNotFoundException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
|
|
var buff [1024]byte
|
|
ringBuffer := smithyio.NewRingBuffer(buff[:])
|
|
|
|
body := io.TeeReader(errorBody, ringBuffer)
|
|
decoder := json.NewDecoder(body)
|
|
decoder.UseNumber()
|
|
var shape interface{}
|
|
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
err = &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
return err
|
|
}
|
|
|
|
output := &types.UploadNotFoundException{}
|
|
err := awsAwsjson11_deserializeDocumentUploadNotFoundException(&output, shape)
|
|
|
|
if err != nil {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
err = &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
return err
|
|
}
|
|
|
|
errorBody.Seek(0, io.SeekStart)
|
|
return output
|
|
}
|
|
|
|
func awsAwsjson11_deserializeErrorValidationException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
|
|
var buff [1024]byte
|
|
ringBuffer := smithyio.NewRingBuffer(buff[:])
|
|
|
|
body := io.TeeReader(errorBody, ringBuffer)
|
|
decoder := json.NewDecoder(body)
|
|
decoder.UseNumber()
|
|
var shape interface{}
|
|
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
err = &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
return err
|
|
}
|
|
|
|
output := &types.ValidationException{}
|
|
err := awsAwsjson11_deserializeDocumentValidationException(&output, shape)
|
|
|
|
if err != nil {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
err = &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
return err
|
|
}
|
|
|
|
errorBody.Seek(0, io.SeekStart)
|
|
return output
|
|
}
|
|
|
|
func awsAwsjson11_deserializeDocumentAttribute(v **types.Attribute, value interface{}) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
if value == nil {
|
|
return nil
|
|
}
|
|
|
|
shape, ok := value.(map[string]interface{})
|
|
if !ok {
|
|
return fmt.Errorf("unexpected JSON type %v", value)
|
|
}
|
|
|
|
var sv *types.Attribute
|
|
if *v == nil {
|
|
sv = &types.Attribute{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for key, value := range shape {
|
|
switch key {
|
|
case "key":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected AttributeKey to be of type string, got %T instead", value)
|
|
}
|
|
sv.Key = ptr.String(jtv)
|
|
}
|
|
|
|
case "value":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected AttributeValue to be of type string, got %T instead", value)
|
|
}
|
|
sv.Value = ptr.String(jtv)
|
|
}
|
|
|
|
default:
|
|
_, _ = key, value
|
|
|
|
}
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson11_deserializeDocumentAttributeList(v *[]types.Attribute, value interface{}) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
if value == nil {
|
|
return nil
|
|
}
|
|
|
|
shape, ok := value.([]interface{})
|
|
if !ok {
|
|
return fmt.Errorf("unexpected JSON type %v", value)
|
|
}
|
|
|
|
var cv []types.Attribute
|
|
if *v == nil {
|
|
cv = []types.Attribute{}
|
|
} else {
|
|
cv = *v
|
|
}
|
|
|
|
for _, value := range shape {
|
|
var col types.Attribute
|
|
destAddr := &col
|
|
if err := awsAwsjson11_deserializeDocumentAttribute(&destAddr, value); err != nil {
|
|
return err
|
|
}
|
|
col = *destAddr
|
|
cv = append(cv, col)
|
|
|
|
}
|
|
*v = cv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson11_deserializeDocumentAuthorizationData(v **types.AuthorizationData, value interface{}) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
if value == nil {
|
|
return nil
|
|
}
|
|
|
|
shape, ok := value.(map[string]interface{})
|
|
if !ok {
|
|
return fmt.Errorf("unexpected JSON type %v", value)
|
|
}
|
|
|
|
var sv *types.AuthorizationData
|
|
if *v == nil {
|
|
sv = &types.AuthorizationData{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for key, value := range shape {
|
|
switch key {
|
|
case "authorizationToken":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected Base64 to be of type string, got %T instead", value)
|
|
}
|
|
sv.AuthorizationToken = ptr.String(jtv)
|
|
}
|
|
|
|
case "expiresAt":
|
|
if value != nil {
|
|
switch jtv := value.(type) {
|
|
case json.Number:
|
|
f64, err := jtv.Float64()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
sv.ExpiresAt = ptr.Time(smithytime.ParseEpochSeconds(f64))
|
|
|
|
default:
|
|
return fmt.Errorf("expected ExpirationTimestamp to be a JSON Number, got %T instead", value)
|
|
|
|
}
|
|
}
|
|
|
|
case "proxyEndpoint":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected ProxyEndpoint to be of type string, got %T instead", value)
|
|
}
|
|
sv.ProxyEndpoint = ptr.String(jtv)
|
|
}
|
|
|
|
default:
|
|
_, _ = key, value
|
|
|
|
}
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson11_deserializeDocumentAuthorizationDataList(v *[]types.AuthorizationData, value interface{}) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
if value == nil {
|
|
return nil
|
|
}
|
|
|
|
shape, ok := value.([]interface{})
|
|
if !ok {
|
|
return fmt.Errorf("unexpected JSON type %v", value)
|
|
}
|
|
|
|
var cv []types.AuthorizationData
|
|
if *v == nil {
|
|
cv = []types.AuthorizationData{}
|
|
} else {
|
|
cv = *v
|
|
}
|
|
|
|
for _, value := range shape {
|
|
var col types.AuthorizationData
|
|
destAddr := &col
|
|
if err := awsAwsjson11_deserializeDocumentAuthorizationData(&destAddr, value); err != nil {
|
|
return err
|
|
}
|
|
col = *destAddr
|
|
cv = append(cv, col)
|
|
|
|
}
|
|
*v = cv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson11_deserializeDocumentAwsEcrContainerImageDetails(v **types.AwsEcrContainerImageDetails, value interface{}) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
if value == nil {
|
|
return nil
|
|
}
|
|
|
|
shape, ok := value.(map[string]interface{})
|
|
if !ok {
|
|
return fmt.Errorf("unexpected JSON type %v", value)
|
|
}
|
|
|
|
var sv *types.AwsEcrContainerImageDetails
|
|
if *v == nil {
|
|
sv = &types.AwsEcrContainerImageDetails{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for key, value := range shape {
|
|
switch key {
|
|
case "architecture":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected Arch to be of type string, got %T instead", value)
|
|
}
|
|
sv.Architecture = ptr.String(jtv)
|
|
}
|
|
|
|
case "author":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected Author to be of type string, got %T instead", value)
|
|
}
|
|
sv.Author = ptr.String(jtv)
|
|
}
|
|
|
|
case "imageHash":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected ImageDigest to be of type string, got %T instead", value)
|
|
}
|
|
sv.ImageHash = ptr.String(jtv)
|
|
}
|
|
|
|
case "imageTags":
|
|
if err := awsAwsjson11_deserializeDocumentImageTagsList(&sv.ImageTags, value); err != nil {
|
|
return err
|
|
}
|
|
|
|
case "platform":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected Platform to be of type string, got %T instead", value)
|
|
}
|
|
sv.Platform = ptr.String(jtv)
|
|
}
|
|
|
|
case "pushedAt":
|
|
if value != nil {
|
|
switch jtv := value.(type) {
|
|
case json.Number:
|
|
f64, err := jtv.Float64()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
sv.PushedAt = ptr.Time(smithytime.ParseEpochSeconds(f64))
|
|
|
|
default:
|
|
return fmt.Errorf("expected Date to be a JSON Number, got %T instead", value)
|
|
|
|
}
|
|
}
|
|
|
|
case "registry":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected RegistryId to be of type string, got %T instead", value)
|
|
}
|
|
sv.Registry = ptr.String(jtv)
|
|
}
|
|
|
|
case "repositoryName":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected RepositoryName to be of type string, got %T instead", value)
|
|
}
|
|
sv.RepositoryName = ptr.String(jtv)
|
|
}
|
|
|
|
default:
|
|
_, _ = key, value
|
|
|
|
}
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson11_deserializeDocumentCvssScore(v **types.CvssScore, value interface{}) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
if value == nil {
|
|
return nil
|
|
}
|
|
|
|
shape, ok := value.(map[string]interface{})
|
|
if !ok {
|
|
return fmt.Errorf("unexpected JSON type %v", value)
|
|
}
|
|
|
|
var sv *types.CvssScore
|
|
if *v == nil {
|
|
sv = &types.CvssScore{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for key, value := range shape {
|
|
switch key {
|
|
case "baseScore":
|
|
if value != nil {
|
|
switch jtv := value.(type) {
|
|
case json.Number:
|
|
f64, err := jtv.Float64()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
sv.BaseScore = f64
|
|
|
|
case string:
|
|
var f64 float64
|
|
switch {
|
|
case strings.EqualFold(jtv, "NaN"):
|
|
f64 = math.NaN()
|
|
|
|
case strings.EqualFold(jtv, "Infinity"):
|
|
f64 = math.Inf(1)
|
|
|
|
case strings.EqualFold(jtv, "-Infinity"):
|
|
f64 = math.Inf(-1)
|
|
|
|
default:
|
|
return fmt.Errorf("unknown JSON number value: %s", jtv)
|
|
|
|
}
|
|
sv.BaseScore = f64
|
|
|
|
default:
|
|
return fmt.Errorf("expected BaseScore to be a JSON Number, got %T instead", value)
|
|
|
|
}
|
|
}
|
|
|
|
case "scoringVector":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected ScoringVector to be of type string, got %T instead", value)
|
|
}
|
|
sv.ScoringVector = ptr.String(jtv)
|
|
}
|
|
|
|
case "source":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected Source to be of type string, got %T instead", value)
|
|
}
|
|
sv.Source = ptr.String(jtv)
|
|
}
|
|
|
|
case "version":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected Version to be of type string, got %T instead", value)
|
|
}
|
|
sv.Version = ptr.String(jtv)
|
|
}
|
|
|
|
default:
|
|
_, _ = key, value
|
|
|
|
}
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson11_deserializeDocumentCvssScoreAdjustment(v **types.CvssScoreAdjustment, value interface{}) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
if value == nil {
|
|
return nil
|
|
}
|
|
|
|
shape, ok := value.(map[string]interface{})
|
|
if !ok {
|
|
return fmt.Errorf("unexpected JSON type %v", value)
|
|
}
|
|
|
|
var sv *types.CvssScoreAdjustment
|
|
if *v == nil {
|
|
sv = &types.CvssScoreAdjustment{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for key, value := range shape {
|
|
switch key {
|
|
case "metric":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected Metric to be of type string, got %T instead", value)
|
|
}
|
|
sv.Metric = ptr.String(jtv)
|
|
}
|
|
|
|
case "reason":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected Reason to be of type string, got %T instead", value)
|
|
}
|
|
sv.Reason = ptr.String(jtv)
|
|
}
|
|
|
|
default:
|
|
_, _ = key, value
|
|
|
|
}
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson11_deserializeDocumentCvssScoreAdjustmentList(v *[]types.CvssScoreAdjustment, value interface{}) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
if value == nil {
|
|
return nil
|
|
}
|
|
|
|
shape, ok := value.([]interface{})
|
|
if !ok {
|
|
return fmt.Errorf("unexpected JSON type %v", value)
|
|
}
|
|
|
|
var cv []types.CvssScoreAdjustment
|
|
if *v == nil {
|
|
cv = []types.CvssScoreAdjustment{}
|
|
} else {
|
|
cv = *v
|
|
}
|
|
|
|
for _, value := range shape {
|
|
var col types.CvssScoreAdjustment
|
|
destAddr := &col
|
|
if err := awsAwsjson11_deserializeDocumentCvssScoreAdjustment(&destAddr, value); err != nil {
|
|
return err
|
|
}
|
|
col = *destAddr
|
|
cv = append(cv, col)
|
|
|
|
}
|
|
*v = cv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson11_deserializeDocumentCvssScoreDetails(v **types.CvssScoreDetails, value interface{}) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
if value == nil {
|
|
return nil
|
|
}
|
|
|
|
shape, ok := value.(map[string]interface{})
|
|
if !ok {
|
|
return fmt.Errorf("unexpected JSON type %v", value)
|
|
}
|
|
|
|
var sv *types.CvssScoreDetails
|
|
if *v == nil {
|
|
sv = &types.CvssScoreDetails{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for key, value := range shape {
|
|
switch key {
|
|
case "adjustments":
|
|
if err := awsAwsjson11_deserializeDocumentCvssScoreAdjustmentList(&sv.Adjustments, value); err != nil {
|
|
return err
|
|
}
|
|
|
|
case "score":
|
|
if value != nil {
|
|
switch jtv := value.(type) {
|
|
case json.Number:
|
|
f64, err := jtv.Float64()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
sv.Score = f64
|
|
|
|
case string:
|
|
var f64 float64
|
|
switch {
|
|
case strings.EqualFold(jtv, "NaN"):
|
|
f64 = math.NaN()
|
|
|
|
case strings.EqualFold(jtv, "Infinity"):
|
|
f64 = math.Inf(1)
|
|
|
|
case strings.EqualFold(jtv, "-Infinity"):
|
|
f64 = math.Inf(-1)
|
|
|
|
default:
|
|
return fmt.Errorf("unknown JSON number value: %s", jtv)
|
|
|
|
}
|
|
sv.Score = f64
|
|
|
|
default:
|
|
return fmt.Errorf("expected Score to be a JSON Number, got %T instead", value)
|
|
|
|
}
|
|
}
|
|
|
|
case "scoreSource":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected Source to be of type string, got %T instead", value)
|
|
}
|
|
sv.ScoreSource = ptr.String(jtv)
|
|
}
|
|
|
|
case "scoringVector":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected ScoringVector to be of type string, got %T instead", value)
|
|
}
|
|
sv.ScoringVector = ptr.String(jtv)
|
|
}
|
|
|
|
case "version":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected Version to be of type string, got %T instead", value)
|
|
}
|
|
sv.Version = ptr.String(jtv)
|
|
}
|
|
|
|
default:
|
|
_, _ = key, value
|
|
|
|
}
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson11_deserializeDocumentCvssScoreList(v *[]types.CvssScore, value interface{}) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
if value == nil {
|
|
return nil
|
|
}
|
|
|
|
shape, ok := value.([]interface{})
|
|
if !ok {
|
|
return fmt.Errorf("unexpected JSON type %v", value)
|
|
}
|
|
|
|
var cv []types.CvssScore
|
|
if *v == nil {
|
|
cv = []types.CvssScore{}
|
|
} else {
|
|
cv = *v
|
|
}
|
|
|
|
for _, value := range shape {
|
|
var col types.CvssScore
|
|
destAddr := &col
|
|
if err := awsAwsjson11_deserializeDocumentCvssScore(&destAddr, value); err != nil {
|
|
return err
|
|
}
|
|
col = *destAddr
|
|
cv = append(cv, col)
|
|
|
|
}
|
|
*v = cv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson11_deserializeDocumentEmptyUploadException(v **types.EmptyUploadException, value interface{}) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
if value == nil {
|
|
return nil
|
|
}
|
|
|
|
shape, ok := value.(map[string]interface{})
|
|
if !ok {
|
|
return fmt.Errorf("unexpected JSON type %v", value)
|
|
}
|
|
|
|
var sv *types.EmptyUploadException
|
|
if *v == nil {
|
|
sv = &types.EmptyUploadException{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for key, value := range shape {
|
|
switch key {
|
|
case "message":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected ExceptionMessage to be of type string, got %T instead", value)
|
|
}
|
|
sv.Message = ptr.String(jtv)
|
|
}
|
|
|
|
default:
|
|
_, _ = key, value
|
|
|
|
}
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson11_deserializeDocumentEncryptionConfiguration(v **types.EncryptionConfiguration, value interface{}) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
if value == nil {
|
|
return nil
|
|
}
|
|
|
|
shape, ok := value.(map[string]interface{})
|
|
if !ok {
|
|
return fmt.Errorf("unexpected JSON type %v", value)
|
|
}
|
|
|
|
var sv *types.EncryptionConfiguration
|
|
if *v == nil {
|
|
sv = &types.EncryptionConfiguration{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for key, value := range shape {
|
|
switch key {
|
|
case "encryptionType":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected EncryptionType to be of type string, got %T instead", value)
|
|
}
|
|
sv.EncryptionType = types.EncryptionType(jtv)
|
|
}
|
|
|
|
case "kmsKey":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected KmsKey to be of type string, got %T instead", value)
|
|
}
|
|
sv.KmsKey = ptr.String(jtv)
|
|
}
|
|
|
|
default:
|
|
_, _ = key, value
|
|
|
|
}
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson11_deserializeDocumentEnhancedImageScanFinding(v **types.EnhancedImageScanFinding, value interface{}) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
if value == nil {
|
|
return nil
|
|
}
|
|
|
|
shape, ok := value.(map[string]interface{})
|
|
if !ok {
|
|
return fmt.Errorf("unexpected JSON type %v", value)
|
|
}
|
|
|
|
var sv *types.EnhancedImageScanFinding
|
|
if *v == nil {
|
|
sv = &types.EnhancedImageScanFinding{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for key, value := range shape {
|
|
switch key {
|
|
case "awsAccountId":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected RegistryId to be of type string, got %T instead", value)
|
|
}
|
|
sv.AwsAccountId = ptr.String(jtv)
|
|
}
|
|
|
|
case "description":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected FindingDescription to be of type string, got %T instead", value)
|
|
}
|
|
sv.Description = ptr.String(jtv)
|
|
}
|
|
|
|
case "findingArn":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected FindingArn to be of type string, got %T instead", value)
|
|
}
|
|
sv.FindingArn = ptr.String(jtv)
|
|
}
|
|
|
|
case "firstObservedAt":
|
|
if value != nil {
|
|
switch jtv := value.(type) {
|
|
case json.Number:
|
|
f64, err := jtv.Float64()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
sv.FirstObservedAt = ptr.Time(smithytime.ParseEpochSeconds(f64))
|
|
|
|
default:
|
|
return fmt.Errorf("expected Date to be a JSON Number, got %T instead", value)
|
|
|
|
}
|
|
}
|
|
|
|
case "lastObservedAt":
|
|
if value != nil {
|
|
switch jtv := value.(type) {
|
|
case json.Number:
|
|
f64, err := jtv.Float64()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
sv.LastObservedAt = ptr.Time(smithytime.ParseEpochSeconds(f64))
|
|
|
|
default:
|
|
return fmt.Errorf("expected Date to be a JSON Number, got %T instead", value)
|
|
|
|
}
|
|
}
|
|
|
|
case "packageVulnerabilityDetails":
|
|
if err := awsAwsjson11_deserializeDocumentPackageVulnerabilityDetails(&sv.PackageVulnerabilityDetails, value); err != nil {
|
|
return err
|
|
}
|
|
|
|
case "remediation":
|
|
if err := awsAwsjson11_deserializeDocumentRemediation(&sv.Remediation, value); err != nil {
|
|
return err
|
|
}
|
|
|
|
case "resources":
|
|
if err := awsAwsjson11_deserializeDocumentResourceList(&sv.Resources, value); err != nil {
|
|
return err
|
|
}
|
|
|
|
case "score":
|
|
if value != nil {
|
|
switch jtv := value.(type) {
|
|
case json.Number:
|
|
f64, err := jtv.Float64()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
sv.Score = f64
|
|
|
|
case string:
|
|
var f64 float64
|
|
switch {
|
|
case strings.EqualFold(jtv, "NaN"):
|
|
f64 = math.NaN()
|
|
|
|
case strings.EqualFold(jtv, "Infinity"):
|
|
f64 = math.Inf(1)
|
|
|
|
case strings.EqualFold(jtv, "-Infinity"):
|
|
f64 = math.Inf(-1)
|
|
|
|
default:
|
|
return fmt.Errorf("unknown JSON number value: %s", jtv)
|
|
|
|
}
|
|
sv.Score = f64
|
|
|
|
default:
|
|
return fmt.Errorf("expected Score to be a JSON Number, got %T instead", value)
|
|
|
|
}
|
|
}
|
|
|
|
case "scoreDetails":
|
|
if err := awsAwsjson11_deserializeDocumentScoreDetails(&sv.ScoreDetails, value); err != nil {
|
|
return err
|
|
}
|
|
|
|
case "severity":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected Severity to be of type string, got %T instead", value)
|
|
}
|
|
sv.Severity = ptr.String(jtv)
|
|
}
|
|
|
|
case "status":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected Status to be of type string, got %T instead", value)
|
|
}
|
|
sv.Status = ptr.String(jtv)
|
|
}
|
|
|
|
case "title":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected Title to be of type string, got %T instead", value)
|
|
}
|
|
sv.Title = ptr.String(jtv)
|
|
}
|
|
|
|
case "type":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected Type to be of type string, got %T instead", value)
|
|
}
|
|
sv.Type = ptr.String(jtv)
|
|
}
|
|
|
|
case "updatedAt":
|
|
if value != nil {
|
|
switch jtv := value.(type) {
|
|
case json.Number:
|
|
f64, err := jtv.Float64()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
sv.UpdatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64))
|
|
|
|
default:
|
|
return fmt.Errorf("expected Date to be a JSON Number, got %T instead", value)
|
|
|
|
}
|
|
}
|
|
|
|
default:
|
|
_, _ = key, value
|
|
|
|
}
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson11_deserializeDocumentEnhancedImageScanFindingList(v *[]types.EnhancedImageScanFinding, value interface{}) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
if value == nil {
|
|
return nil
|
|
}
|
|
|
|
shape, ok := value.([]interface{})
|
|
if !ok {
|
|
return fmt.Errorf("unexpected JSON type %v", value)
|
|
}
|
|
|
|
var cv []types.EnhancedImageScanFinding
|
|
if *v == nil {
|
|
cv = []types.EnhancedImageScanFinding{}
|
|
} else {
|
|
cv = *v
|
|
}
|
|
|
|
for _, value := range shape {
|
|
var col types.EnhancedImageScanFinding
|
|
destAddr := &col
|
|
if err := awsAwsjson11_deserializeDocumentEnhancedImageScanFinding(&destAddr, value); err != nil {
|
|
return err
|
|
}
|
|
col = *destAddr
|
|
cv = append(cv, col)
|
|
|
|
}
|
|
*v = cv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson11_deserializeDocumentFindingSeverityCounts(v *map[string]int32, value interface{}) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
if value == nil {
|
|
return nil
|
|
}
|
|
|
|
shape, ok := value.(map[string]interface{})
|
|
if !ok {
|
|
return fmt.Errorf("unexpected JSON type %v", value)
|
|
}
|
|
|
|
var mv map[string]int32
|
|
if *v == nil {
|
|
mv = map[string]int32{}
|
|
} else {
|
|
mv = *v
|
|
}
|
|
|
|
for key, value := range shape {
|
|
var parsedVal int32
|
|
if value != nil {
|
|
jtv, ok := value.(json.Number)
|
|
if !ok {
|
|
return fmt.Errorf("expected SeverityCount to be json.Number, got %T instead", value)
|
|
}
|
|
i64, err := jtv.Int64()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
parsedVal = int32(i64)
|
|
}
|
|
mv[key] = parsedVal
|
|
|
|
}
|
|
*v = mv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson11_deserializeDocumentImage(v **types.Image, value interface{}) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
if value == nil {
|
|
return nil
|
|
}
|
|
|
|
shape, ok := value.(map[string]interface{})
|
|
if !ok {
|
|
return fmt.Errorf("unexpected JSON type %v", value)
|
|
}
|
|
|
|
var sv *types.Image
|
|
if *v == nil {
|
|
sv = &types.Image{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for key, value := range shape {
|
|
switch key {
|
|
case "imageId":
|
|
if err := awsAwsjson11_deserializeDocumentImageIdentifier(&sv.ImageId, value); err != nil {
|
|
return err
|
|
}
|
|
|
|
case "imageManifest":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected ImageManifest to be of type string, got %T instead", value)
|
|
}
|
|
sv.ImageManifest = ptr.String(jtv)
|
|
}
|
|
|
|
case "imageManifestMediaType":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected MediaType to be of type string, got %T instead", value)
|
|
}
|
|
sv.ImageManifestMediaType = ptr.String(jtv)
|
|
}
|
|
|
|
case "registryId":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected RegistryId to be of type string, got %T instead", value)
|
|
}
|
|
sv.RegistryId = ptr.String(jtv)
|
|
}
|
|
|
|
case "repositoryName":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected RepositoryName to be of type string, got %T instead", value)
|
|
}
|
|
sv.RepositoryName = ptr.String(jtv)
|
|
}
|
|
|
|
default:
|
|
_, _ = key, value
|
|
|
|
}
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson11_deserializeDocumentImageAlreadyExistsException(v **types.ImageAlreadyExistsException, value interface{}) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
if value == nil {
|
|
return nil
|
|
}
|
|
|
|
shape, ok := value.(map[string]interface{})
|
|
if !ok {
|
|
return fmt.Errorf("unexpected JSON type %v", value)
|
|
}
|
|
|
|
var sv *types.ImageAlreadyExistsException
|
|
if *v == nil {
|
|
sv = &types.ImageAlreadyExistsException{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for key, value := range shape {
|
|
switch key {
|
|
case "message":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected ExceptionMessage to be of type string, got %T instead", value)
|
|
}
|
|
sv.Message = ptr.String(jtv)
|
|
}
|
|
|
|
default:
|
|
_, _ = key, value
|
|
|
|
}
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson11_deserializeDocumentImageDetail(v **types.ImageDetail, value interface{}) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
if value == nil {
|
|
return nil
|
|
}
|
|
|
|
shape, ok := value.(map[string]interface{})
|
|
if !ok {
|
|
return fmt.Errorf("unexpected JSON type %v", value)
|
|
}
|
|
|
|
var sv *types.ImageDetail
|
|
if *v == nil {
|
|
sv = &types.ImageDetail{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for key, value := range shape {
|
|
switch key {
|
|
case "artifactMediaType":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected MediaType to be of type string, got %T instead", value)
|
|
}
|
|
sv.ArtifactMediaType = ptr.String(jtv)
|
|
}
|
|
|
|
case "imageDigest":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected ImageDigest to be of type string, got %T instead", value)
|
|
}
|
|
sv.ImageDigest = ptr.String(jtv)
|
|
}
|
|
|
|
case "imageManifestMediaType":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected MediaType to be of type string, got %T instead", value)
|
|
}
|
|
sv.ImageManifestMediaType = ptr.String(jtv)
|
|
}
|
|
|
|
case "imagePushedAt":
|
|
if value != nil {
|
|
switch jtv := value.(type) {
|
|
case json.Number:
|
|
f64, err := jtv.Float64()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
sv.ImagePushedAt = ptr.Time(smithytime.ParseEpochSeconds(f64))
|
|
|
|
default:
|
|
return fmt.Errorf("expected PushTimestamp to be a JSON Number, got %T instead", value)
|
|
|
|
}
|
|
}
|
|
|
|
case "imageScanFindingsSummary":
|
|
if err := awsAwsjson11_deserializeDocumentImageScanFindingsSummary(&sv.ImageScanFindingsSummary, value); err != nil {
|
|
return err
|
|
}
|
|
|
|
case "imageScanStatus":
|
|
if err := awsAwsjson11_deserializeDocumentImageScanStatus(&sv.ImageScanStatus, value); err != nil {
|
|
return err
|
|
}
|
|
|
|
case "imageSizeInBytes":
|
|
if value != nil {
|
|
jtv, ok := value.(json.Number)
|
|
if !ok {
|
|
return fmt.Errorf("expected ImageSizeInBytes to be json.Number, got %T instead", value)
|
|
}
|
|
i64, err := jtv.Int64()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
sv.ImageSizeInBytes = ptr.Int64(i64)
|
|
}
|
|
|
|
case "imageTags":
|
|
if err := awsAwsjson11_deserializeDocumentImageTagList(&sv.ImageTags, value); err != nil {
|
|
return err
|
|
}
|
|
|
|
case "lastRecordedPullTime":
|
|
if value != nil {
|
|
switch jtv := value.(type) {
|
|
case json.Number:
|
|
f64, err := jtv.Float64()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
sv.LastRecordedPullTime = ptr.Time(smithytime.ParseEpochSeconds(f64))
|
|
|
|
default:
|
|
return fmt.Errorf("expected RecordedPullTimestamp to be a JSON Number, got %T instead", value)
|
|
|
|
}
|
|
}
|
|
|
|
case "registryId":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected RegistryId to be of type string, got %T instead", value)
|
|
}
|
|
sv.RegistryId = ptr.String(jtv)
|
|
}
|
|
|
|
case "repositoryName":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected RepositoryName to be of type string, got %T instead", value)
|
|
}
|
|
sv.RepositoryName = ptr.String(jtv)
|
|
}
|
|
|
|
default:
|
|
_, _ = key, value
|
|
|
|
}
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson11_deserializeDocumentImageDetailList(v *[]types.ImageDetail, value interface{}) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
if value == nil {
|
|
return nil
|
|
}
|
|
|
|
shape, ok := value.([]interface{})
|
|
if !ok {
|
|
return fmt.Errorf("unexpected JSON type %v", value)
|
|
}
|
|
|
|
var cv []types.ImageDetail
|
|
if *v == nil {
|
|
cv = []types.ImageDetail{}
|
|
} else {
|
|
cv = *v
|
|
}
|
|
|
|
for _, value := range shape {
|
|
var col types.ImageDetail
|
|
destAddr := &col
|
|
if err := awsAwsjson11_deserializeDocumentImageDetail(&destAddr, value); err != nil {
|
|
return err
|
|
}
|
|
col = *destAddr
|
|
cv = append(cv, col)
|
|
|
|
}
|
|
*v = cv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson11_deserializeDocumentImageDigestDoesNotMatchException(v **types.ImageDigestDoesNotMatchException, value interface{}) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
if value == nil {
|
|
return nil
|
|
}
|
|
|
|
shape, ok := value.(map[string]interface{})
|
|
if !ok {
|
|
return fmt.Errorf("unexpected JSON type %v", value)
|
|
}
|
|
|
|
var sv *types.ImageDigestDoesNotMatchException
|
|
if *v == nil {
|
|
sv = &types.ImageDigestDoesNotMatchException{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for key, value := range shape {
|
|
switch key {
|
|
case "message":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected ExceptionMessage to be of type string, got %T instead", value)
|
|
}
|
|
sv.Message = ptr.String(jtv)
|
|
}
|
|
|
|
default:
|
|
_, _ = key, value
|
|
|
|
}
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson11_deserializeDocumentImageFailure(v **types.ImageFailure, value interface{}) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
if value == nil {
|
|
return nil
|
|
}
|
|
|
|
shape, ok := value.(map[string]interface{})
|
|
if !ok {
|
|
return fmt.Errorf("unexpected JSON type %v", value)
|
|
}
|
|
|
|
var sv *types.ImageFailure
|
|
if *v == nil {
|
|
sv = &types.ImageFailure{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for key, value := range shape {
|
|
switch key {
|
|
case "failureCode":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected ImageFailureCode to be of type string, got %T instead", value)
|
|
}
|
|
sv.FailureCode = types.ImageFailureCode(jtv)
|
|
}
|
|
|
|
case "failureReason":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected ImageFailureReason to be of type string, got %T instead", value)
|
|
}
|
|
sv.FailureReason = ptr.String(jtv)
|
|
}
|
|
|
|
case "imageId":
|
|
if err := awsAwsjson11_deserializeDocumentImageIdentifier(&sv.ImageId, value); err != nil {
|
|
return err
|
|
}
|
|
|
|
default:
|
|
_, _ = key, value
|
|
|
|
}
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson11_deserializeDocumentImageFailureList(v *[]types.ImageFailure, value interface{}) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
if value == nil {
|
|
return nil
|
|
}
|
|
|
|
shape, ok := value.([]interface{})
|
|
if !ok {
|
|
return fmt.Errorf("unexpected JSON type %v", value)
|
|
}
|
|
|
|
var cv []types.ImageFailure
|
|
if *v == nil {
|
|
cv = []types.ImageFailure{}
|
|
} else {
|
|
cv = *v
|
|
}
|
|
|
|
for _, value := range shape {
|
|
var col types.ImageFailure
|
|
destAddr := &col
|
|
if err := awsAwsjson11_deserializeDocumentImageFailure(&destAddr, value); err != nil {
|
|
return err
|
|
}
|
|
col = *destAddr
|
|
cv = append(cv, col)
|
|
|
|
}
|
|
*v = cv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson11_deserializeDocumentImageIdentifier(v **types.ImageIdentifier, value interface{}) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
if value == nil {
|
|
return nil
|
|
}
|
|
|
|
shape, ok := value.(map[string]interface{})
|
|
if !ok {
|
|
return fmt.Errorf("unexpected JSON type %v", value)
|
|
}
|
|
|
|
var sv *types.ImageIdentifier
|
|
if *v == nil {
|
|
sv = &types.ImageIdentifier{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for key, value := range shape {
|
|
switch key {
|
|
case "imageDigest":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected ImageDigest to be of type string, got %T instead", value)
|
|
}
|
|
sv.ImageDigest = ptr.String(jtv)
|
|
}
|
|
|
|
case "imageTag":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected ImageTag to be of type string, got %T instead", value)
|
|
}
|
|
sv.ImageTag = ptr.String(jtv)
|
|
}
|
|
|
|
default:
|
|
_, _ = key, value
|
|
|
|
}
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson11_deserializeDocumentImageIdentifierList(v *[]types.ImageIdentifier, value interface{}) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
if value == nil {
|
|
return nil
|
|
}
|
|
|
|
shape, ok := value.([]interface{})
|
|
if !ok {
|
|
return fmt.Errorf("unexpected JSON type %v", value)
|
|
}
|
|
|
|
var cv []types.ImageIdentifier
|
|
if *v == nil {
|
|
cv = []types.ImageIdentifier{}
|
|
} else {
|
|
cv = *v
|
|
}
|
|
|
|
for _, value := range shape {
|
|
var col types.ImageIdentifier
|
|
destAddr := &col
|
|
if err := awsAwsjson11_deserializeDocumentImageIdentifier(&destAddr, value); err != nil {
|
|
return err
|
|
}
|
|
col = *destAddr
|
|
cv = append(cv, col)
|
|
|
|
}
|
|
*v = cv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson11_deserializeDocumentImageList(v *[]types.Image, value interface{}) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
if value == nil {
|
|
return nil
|
|
}
|
|
|
|
shape, ok := value.([]interface{})
|
|
if !ok {
|
|
return fmt.Errorf("unexpected JSON type %v", value)
|
|
}
|
|
|
|
var cv []types.Image
|
|
if *v == nil {
|
|
cv = []types.Image{}
|
|
} else {
|
|
cv = *v
|
|
}
|
|
|
|
for _, value := range shape {
|
|
var col types.Image
|
|
destAddr := &col
|
|
if err := awsAwsjson11_deserializeDocumentImage(&destAddr, value); err != nil {
|
|
return err
|
|
}
|
|
col = *destAddr
|
|
cv = append(cv, col)
|
|
|
|
}
|
|
*v = cv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson11_deserializeDocumentImageNotFoundException(v **types.ImageNotFoundException, value interface{}) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
if value == nil {
|
|
return nil
|
|
}
|
|
|
|
shape, ok := value.(map[string]interface{})
|
|
if !ok {
|
|
return fmt.Errorf("unexpected JSON type %v", value)
|
|
}
|
|
|
|
var sv *types.ImageNotFoundException
|
|
if *v == nil {
|
|
sv = &types.ImageNotFoundException{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for key, value := range shape {
|
|
switch key {
|
|
case "message":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected ExceptionMessage to be of type string, got %T instead", value)
|
|
}
|
|
sv.Message = ptr.String(jtv)
|
|
}
|
|
|
|
default:
|
|
_, _ = key, value
|
|
|
|
}
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson11_deserializeDocumentImageReplicationStatus(v **types.ImageReplicationStatus, value interface{}) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
if value == nil {
|
|
return nil
|
|
}
|
|
|
|
shape, ok := value.(map[string]interface{})
|
|
if !ok {
|
|
return fmt.Errorf("unexpected JSON type %v", value)
|
|
}
|
|
|
|
var sv *types.ImageReplicationStatus
|
|
if *v == nil {
|
|
sv = &types.ImageReplicationStatus{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for key, value := range shape {
|
|
switch key {
|
|
case "failureCode":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected ReplicationError to be of type string, got %T instead", value)
|
|
}
|
|
sv.FailureCode = ptr.String(jtv)
|
|
}
|
|
|
|
case "region":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected Region to be of type string, got %T instead", value)
|
|
}
|
|
sv.Region = ptr.String(jtv)
|
|
}
|
|
|
|
case "registryId":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected RegistryId to be of type string, got %T instead", value)
|
|
}
|
|
sv.RegistryId = ptr.String(jtv)
|
|
}
|
|
|
|
case "status":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected ReplicationStatus to be of type string, got %T instead", value)
|
|
}
|
|
sv.Status = types.ReplicationStatus(jtv)
|
|
}
|
|
|
|
default:
|
|
_, _ = key, value
|
|
|
|
}
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson11_deserializeDocumentImageReplicationStatusList(v *[]types.ImageReplicationStatus, value interface{}) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
if value == nil {
|
|
return nil
|
|
}
|
|
|
|
shape, ok := value.([]interface{})
|
|
if !ok {
|
|
return fmt.Errorf("unexpected JSON type %v", value)
|
|
}
|
|
|
|
var cv []types.ImageReplicationStatus
|
|
if *v == nil {
|
|
cv = []types.ImageReplicationStatus{}
|
|
} else {
|
|
cv = *v
|
|
}
|
|
|
|
for _, value := range shape {
|
|
var col types.ImageReplicationStatus
|
|
destAddr := &col
|
|
if err := awsAwsjson11_deserializeDocumentImageReplicationStatus(&destAddr, value); err != nil {
|
|
return err
|
|
}
|
|
col = *destAddr
|
|
cv = append(cv, col)
|
|
|
|
}
|
|
*v = cv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson11_deserializeDocumentImageScanFinding(v **types.ImageScanFinding, value interface{}) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
if value == nil {
|
|
return nil
|
|
}
|
|
|
|
shape, ok := value.(map[string]interface{})
|
|
if !ok {
|
|
return fmt.Errorf("unexpected JSON type %v", value)
|
|
}
|
|
|
|
var sv *types.ImageScanFinding
|
|
if *v == nil {
|
|
sv = &types.ImageScanFinding{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for key, value := range shape {
|
|
switch key {
|
|
case "attributes":
|
|
if err := awsAwsjson11_deserializeDocumentAttributeList(&sv.Attributes, value); err != nil {
|
|
return err
|
|
}
|
|
|
|
case "description":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected FindingDescription to be of type string, got %T instead", value)
|
|
}
|
|
sv.Description = ptr.String(jtv)
|
|
}
|
|
|
|
case "name":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected FindingName to be of type string, got %T instead", value)
|
|
}
|
|
sv.Name = ptr.String(jtv)
|
|
}
|
|
|
|
case "severity":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected FindingSeverity to be of type string, got %T instead", value)
|
|
}
|
|
sv.Severity = types.FindingSeverity(jtv)
|
|
}
|
|
|
|
case "uri":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected Url to be of type string, got %T instead", value)
|
|
}
|
|
sv.Uri = ptr.String(jtv)
|
|
}
|
|
|
|
default:
|
|
_, _ = key, value
|
|
|
|
}
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson11_deserializeDocumentImageScanFindingList(v *[]types.ImageScanFinding, value interface{}) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
if value == nil {
|
|
return nil
|
|
}
|
|
|
|
shape, ok := value.([]interface{})
|
|
if !ok {
|
|
return fmt.Errorf("unexpected JSON type %v", value)
|
|
}
|
|
|
|
var cv []types.ImageScanFinding
|
|
if *v == nil {
|
|
cv = []types.ImageScanFinding{}
|
|
} else {
|
|
cv = *v
|
|
}
|
|
|
|
for _, value := range shape {
|
|
var col types.ImageScanFinding
|
|
destAddr := &col
|
|
if err := awsAwsjson11_deserializeDocumentImageScanFinding(&destAddr, value); err != nil {
|
|
return err
|
|
}
|
|
col = *destAddr
|
|
cv = append(cv, col)
|
|
|
|
}
|
|
*v = cv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson11_deserializeDocumentImageScanFindings(v **types.ImageScanFindings, value interface{}) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
if value == nil {
|
|
return nil
|
|
}
|
|
|
|
shape, ok := value.(map[string]interface{})
|
|
if !ok {
|
|
return fmt.Errorf("unexpected JSON type %v", value)
|
|
}
|
|
|
|
var sv *types.ImageScanFindings
|
|
if *v == nil {
|
|
sv = &types.ImageScanFindings{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for key, value := range shape {
|
|
switch key {
|
|
case "enhancedFindings":
|
|
if err := awsAwsjson11_deserializeDocumentEnhancedImageScanFindingList(&sv.EnhancedFindings, value); err != nil {
|
|
return err
|
|
}
|
|
|
|
case "findings":
|
|
if err := awsAwsjson11_deserializeDocumentImageScanFindingList(&sv.Findings, value); err != nil {
|
|
return err
|
|
}
|
|
|
|
case "findingSeverityCounts":
|
|
if err := awsAwsjson11_deserializeDocumentFindingSeverityCounts(&sv.FindingSeverityCounts, value); err != nil {
|
|
return err
|
|
}
|
|
|
|
case "imageScanCompletedAt":
|
|
if value != nil {
|
|
switch jtv := value.(type) {
|
|
case json.Number:
|
|
f64, err := jtv.Float64()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
sv.ImageScanCompletedAt = ptr.Time(smithytime.ParseEpochSeconds(f64))
|
|
|
|
default:
|
|
return fmt.Errorf("expected ScanTimestamp to be a JSON Number, got %T instead", value)
|
|
|
|
}
|
|
}
|
|
|
|
case "vulnerabilitySourceUpdatedAt":
|
|
if value != nil {
|
|
switch jtv := value.(type) {
|
|
case json.Number:
|
|
f64, err := jtv.Float64()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
sv.VulnerabilitySourceUpdatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64))
|
|
|
|
default:
|
|
return fmt.Errorf("expected VulnerabilitySourceUpdateTimestamp to be a JSON Number, got %T instead", value)
|
|
|
|
}
|
|
}
|
|
|
|
default:
|
|
_, _ = key, value
|
|
|
|
}
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson11_deserializeDocumentImageScanFindingsSummary(v **types.ImageScanFindingsSummary, value interface{}) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
if value == nil {
|
|
return nil
|
|
}
|
|
|
|
shape, ok := value.(map[string]interface{})
|
|
if !ok {
|
|
return fmt.Errorf("unexpected JSON type %v", value)
|
|
}
|
|
|
|
var sv *types.ImageScanFindingsSummary
|
|
if *v == nil {
|
|
sv = &types.ImageScanFindingsSummary{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for key, value := range shape {
|
|
switch key {
|
|
case "findingSeverityCounts":
|
|
if err := awsAwsjson11_deserializeDocumentFindingSeverityCounts(&sv.FindingSeverityCounts, value); err != nil {
|
|
return err
|
|
}
|
|
|
|
case "imageScanCompletedAt":
|
|
if value != nil {
|
|
switch jtv := value.(type) {
|
|
case json.Number:
|
|
f64, err := jtv.Float64()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
sv.ImageScanCompletedAt = ptr.Time(smithytime.ParseEpochSeconds(f64))
|
|
|
|
default:
|
|
return fmt.Errorf("expected ScanTimestamp to be a JSON Number, got %T instead", value)
|
|
|
|
}
|
|
}
|
|
|
|
case "vulnerabilitySourceUpdatedAt":
|
|
if value != nil {
|
|
switch jtv := value.(type) {
|
|
case json.Number:
|
|
f64, err := jtv.Float64()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
sv.VulnerabilitySourceUpdatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64))
|
|
|
|
default:
|
|
return fmt.Errorf("expected VulnerabilitySourceUpdateTimestamp to be a JSON Number, got %T instead", value)
|
|
|
|
}
|
|
}
|
|
|
|
default:
|
|
_, _ = key, value
|
|
|
|
}
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson11_deserializeDocumentImageScanningConfiguration(v **types.ImageScanningConfiguration, value interface{}) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
if value == nil {
|
|
return nil
|
|
}
|
|
|
|
shape, ok := value.(map[string]interface{})
|
|
if !ok {
|
|
return fmt.Errorf("unexpected JSON type %v", value)
|
|
}
|
|
|
|
var sv *types.ImageScanningConfiguration
|
|
if *v == nil {
|
|
sv = &types.ImageScanningConfiguration{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for key, value := range shape {
|
|
switch key {
|
|
case "scanOnPush":
|
|
if value != nil {
|
|
jtv, ok := value.(bool)
|
|
if !ok {
|
|
return fmt.Errorf("expected ScanOnPushFlag to be of type *bool, got %T instead", value)
|
|
}
|
|
sv.ScanOnPush = jtv
|
|
}
|
|
|
|
default:
|
|
_, _ = key, value
|
|
|
|
}
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson11_deserializeDocumentImageScanStatus(v **types.ImageScanStatus, value interface{}) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
if value == nil {
|
|
return nil
|
|
}
|
|
|
|
shape, ok := value.(map[string]interface{})
|
|
if !ok {
|
|
return fmt.Errorf("unexpected JSON type %v", value)
|
|
}
|
|
|
|
var sv *types.ImageScanStatus
|
|
if *v == nil {
|
|
sv = &types.ImageScanStatus{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for key, value := range shape {
|
|
switch key {
|
|
case "description":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected ScanStatusDescription to be of type string, got %T instead", value)
|
|
}
|
|
sv.Description = ptr.String(jtv)
|
|
}
|
|
|
|
case "status":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected ScanStatus to be of type string, got %T instead", value)
|
|
}
|
|
sv.Status = types.ScanStatus(jtv)
|
|
}
|
|
|
|
default:
|
|
_, _ = key, value
|
|
|
|
}
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson11_deserializeDocumentImageTagAlreadyExistsException(v **types.ImageTagAlreadyExistsException, value interface{}) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
if value == nil {
|
|
return nil
|
|
}
|
|
|
|
shape, ok := value.(map[string]interface{})
|
|
if !ok {
|
|
return fmt.Errorf("unexpected JSON type %v", value)
|
|
}
|
|
|
|
var sv *types.ImageTagAlreadyExistsException
|
|
if *v == nil {
|
|
sv = &types.ImageTagAlreadyExistsException{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for key, value := range shape {
|
|
switch key {
|
|
case "message":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected ExceptionMessage to be of type string, got %T instead", value)
|
|
}
|
|
sv.Message = ptr.String(jtv)
|
|
}
|
|
|
|
default:
|
|
_, _ = key, value
|
|
|
|
}
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson11_deserializeDocumentImageTagList(v *[]string, value interface{}) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
if value == nil {
|
|
return nil
|
|
}
|
|
|
|
shape, ok := value.([]interface{})
|
|
if !ok {
|
|
return fmt.Errorf("unexpected JSON type %v", value)
|
|
}
|
|
|
|
var cv []string
|
|
if *v == nil {
|
|
cv = []string{}
|
|
} else {
|
|
cv = *v
|
|
}
|
|
|
|
for _, value := range shape {
|
|
var col string
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected ImageTag to be of type string, got %T instead", value)
|
|
}
|
|
col = jtv
|
|
}
|
|
cv = append(cv, col)
|
|
|
|
}
|
|
*v = cv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson11_deserializeDocumentImageTagsList(v *[]string, value interface{}) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
if value == nil {
|
|
return nil
|
|
}
|
|
|
|
shape, ok := value.([]interface{})
|
|
if !ok {
|
|
return fmt.Errorf("unexpected JSON type %v", value)
|
|
}
|
|
|
|
var cv []string
|
|
if *v == nil {
|
|
cv = []string{}
|
|
} else {
|
|
cv = *v
|
|
}
|
|
|
|
for _, value := range shape {
|
|
var col string
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected ImageTag to be of type string, got %T instead", value)
|
|
}
|
|
col = jtv
|
|
}
|
|
cv = append(cv, col)
|
|
|
|
}
|
|
*v = cv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson11_deserializeDocumentInvalidLayerException(v **types.InvalidLayerException, value interface{}) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
if value == nil {
|
|
return nil
|
|
}
|
|
|
|
shape, ok := value.(map[string]interface{})
|
|
if !ok {
|
|
return fmt.Errorf("unexpected JSON type %v", value)
|
|
}
|
|
|
|
var sv *types.InvalidLayerException
|
|
if *v == nil {
|
|
sv = &types.InvalidLayerException{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for key, value := range shape {
|
|
switch key {
|
|
case "message":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected ExceptionMessage to be of type string, got %T instead", value)
|
|
}
|
|
sv.Message = ptr.String(jtv)
|
|
}
|
|
|
|
default:
|
|
_, _ = key, value
|
|
|
|
}
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson11_deserializeDocumentInvalidLayerPartException(v **types.InvalidLayerPartException, value interface{}) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
if value == nil {
|
|
return nil
|
|
}
|
|
|
|
shape, ok := value.(map[string]interface{})
|
|
if !ok {
|
|
return fmt.Errorf("unexpected JSON type %v", value)
|
|
}
|
|
|
|
var sv *types.InvalidLayerPartException
|
|
if *v == nil {
|
|
sv = &types.InvalidLayerPartException{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for key, value := range shape {
|
|
switch key {
|
|
case "lastValidByteReceived":
|
|
if value != nil {
|
|
jtv, ok := value.(json.Number)
|
|
if !ok {
|
|
return fmt.Errorf("expected PartSize to be json.Number, got %T instead", value)
|
|
}
|
|
i64, err := jtv.Int64()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
sv.LastValidByteReceived = ptr.Int64(i64)
|
|
}
|
|
|
|
case "message":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected ExceptionMessage to be of type string, got %T instead", value)
|
|
}
|
|
sv.Message = ptr.String(jtv)
|
|
}
|
|
|
|
case "registryId":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected RegistryId to be of type string, got %T instead", value)
|
|
}
|
|
sv.RegistryId = ptr.String(jtv)
|
|
}
|
|
|
|
case "repositoryName":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected RepositoryName to be of type string, got %T instead", value)
|
|
}
|
|
sv.RepositoryName = ptr.String(jtv)
|
|
}
|
|
|
|
case "uploadId":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected UploadId to be of type string, got %T instead", value)
|
|
}
|
|
sv.UploadId = ptr.String(jtv)
|
|
}
|
|
|
|
default:
|
|
_, _ = key, value
|
|
|
|
}
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson11_deserializeDocumentInvalidParameterException(v **types.InvalidParameterException, value interface{}) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
if value == nil {
|
|
return nil
|
|
}
|
|
|
|
shape, ok := value.(map[string]interface{})
|
|
if !ok {
|
|
return fmt.Errorf("unexpected JSON type %v", value)
|
|
}
|
|
|
|
var sv *types.InvalidParameterException
|
|
if *v == nil {
|
|
sv = &types.InvalidParameterException{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for key, value := range shape {
|
|
switch key {
|
|
case "message":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected ExceptionMessage to be of type string, got %T instead", value)
|
|
}
|
|
sv.Message = ptr.String(jtv)
|
|
}
|
|
|
|
default:
|
|
_, _ = key, value
|
|
|
|
}
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson11_deserializeDocumentInvalidTagParameterException(v **types.InvalidTagParameterException, value interface{}) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
if value == nil {
|
|
return nil
|
|
}
|
|
|
|
shape, ok := value.(map[string]interface{})
|
|
if !ok {
|
|
return fmt.Errorf("unexpected JSON type %v", value)
|
|
}
|
|
|
|
var sv *types.InvalidTagParameterException
|
|
if *v == nil {
|
|
sv = &types.InvalidTagParameterException{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for key, value := range shape {
|
|
switch key {
|
|
case "message":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected ExceptionMessage to be of type string, got %T instead", value)
|
|
}
|
|
sv.Message = ptr.String(jtv)
|
|
}
|
|
|
|
default:
|
|
_, _ = key, value
|
|
|
|
}
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson11_deserializeDocumentKmsException(v **types.KmsException, value interface{}) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
if value == nil {
|
|
return nil
|
|
}
|
|
|
|
shape, ok := value.(map[string]interface{})
|
|
if !ok {
|
|
return fmt.Errorf("unexpected JSON type %v", value)
|
|
}
|
|
|
|
var sv *types.KmsException
|
|
if *v == nil {
|
|
sv = &types.KmsException{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for key, value := range shape {
|
|
switch key {
|
|
case "kmsError":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected KmsError to be of type string, got %T instead", value)
|
|
}
|
|
sv.KmsError = ptr.String(jtv)
|
|
}
|
|
|
|
case "message":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected ExceptionMessage to be of type string, got %T instead", value)
|
|
}
|
|
sv.Message = ptr.String(jtv)
|
|
}
|
|
|
|
default:
|
|
_, _ = key, value
|
|
|
|
}
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson11_deserializeDocumentLayer(v **types.Layer, value interface{}) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
if value == nil {
|
|
return nil
|
|
}
|
|
|
|
shape, ok := value.(map[string]interface{})
|
|
if !ok {
|
|
return fmt.Errorf("unexpected JSON type %v", value)
|
|
}
|
|
|
|
var sv *types.Layer
|
|
if *v == nil {
|
|
sv = &types.Layer{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for key, value := range shape {
|
|
switch key {
|
|
case "layerAvailability":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected LayerAvailability to be of type string, got %T instead", value)
|
|
}
|
|
sv.LayerAvailability = types.LayerAvailability(jtv)
|
|
}
|
|
|
|
case "layerDigest":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected LayerDigest to be of type string, got %T instead", value)
|
|
}
|
|
sv.LayerDigest = ptr.String(jtv)
|
|
}
|
|
|
|
case "layerSize":
|
|
if value != nil {
|
|
jtv, ok := value.(json.Number)
|
|
if !ok {
|
|
return fmt.Errorf("expected LayerSizeInBytes to be json.Number, got %T instead", value)
|
|
}
|
|
i64, err := jtv.Int64()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
sv.LayerSize = ptr.Int64(i64)
|
|
}
|
|
|
|
case "mediaType":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected MediaType to be of type string, got %T instead", value)
|
|
}
|
|
sv.MediaType = ptr.String(jtv)
|
|
}
|
|
|
|
default:
|
|
_, _ = key, value
|
|
|
|
}
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson11_deserializeDocumentLayerAlreadyExistsException(v **types.LayerAlreadyExistsException, value interface{}) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
if value == nil {
|
|
return nil
|
|
}
|
|
|
|
shape, ok := value.(map[string]interface{})
|
|
if !ok {
|
|
return fmt.Errorf("unexpected JSON type %v", value)
|
|
}
|
|
|
|
var sv *types.LayerAlreadyExistsException
|
|
if *v == nil {
|
|
sv = &types.LayerAlreadyExistsException{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for key, value := range shape {
|
|
switch key {
|
|
case "message":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected ExceptionMessage to be of type string, got %T instead", value)
|
|
}
|
|
sv.Message = ptr.String(jtv)
|
|
}
|
|
|
|
default:
|
|
_, _ = key, value
|
|
|
|
}
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson11_deserializeDocumentLayerFailure(v **types.LayerFailure, value interface{}) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
if value == nil {
|
|
return nil
|
|
}
|
|
|
|
shape, ok := value.(map[string]interface{})
|
|
if !ok {
|
|
return fmt.Errorf("unexpected JSON type %v", value)
|
|
}
|
|
|
|
var sv *types.LayerFailure
|
|
if *v == nil {
|
|
sv = &types.LayerFailure{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for key, value := range shape {
|
|
switch key {
|
|
case "failureCode":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected LayerFailureCode to be of type string, got %T instead", value)
|
|
}
|
|
sv.FailureCode = types.LayerFailureCode(jtv)
|
|
}
|
|
|
|
case "failureReason":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected LayerFailureReason to be of type string, got %T instead", value)
|
|
}
|
|
sv.FailureReason = ptr.String(jtv)
|
|
}
|
|
|
|
case "layerDigest":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected BatchedOperationLayerDigest to be of type string, got %T instead", value)
|
|
}
|
|
sv.LayerDigest = ptr.String(jtv)
|
|
}
|
|
|
|
default:
|
|
_, _ = key, value
|
|
|
|
}
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson11_deserializeDocumentLayerFailureList(v *[]types.LayerFailure, value interface{}) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
if value == nil {
|
|
return nil
|
|
}
|
|
|
|
shape, ok := value.([]interface{})
|
|
if !ok {
|
|
return fmt.Errorf("unexpected JSON type %v", value)
|
|
}
|
|
|
|
var cv []types.LayerFailure
|
|
if *v == nil {
|
|
cv = []types.LayerFailure{}
|
|
} else {
|
|
cv = *v
|
|
}
|
|
|
|
for _, value := range shape {
|
|
var col types.LayerFailure
|
|
destAddr := &col
|
|
if err := awsAwsjson11_deserializeDocumentLayerFailure(&destAddr, value); err != nil {
|
|
return err
|
|
}
|
|
col = *destAddr
|
|
cv = append(cv, col)
|
|
|
|
}
|
|
*v = cv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson11_deserializeDocumentLayerInaccessibleException(v **types.LayerInaccessibleException, value interface{}) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
if value == nil {
|
|
return nil
|
|
}
|
|
|
|
shape, ok := value.(map[string]interface{})
|
|
if !ok {
|
|
return fmt.Errorf("unexpected JSON type %v", value)
|
|
}
|
|
|
|
var sv *types.LayerInaccessibleException
|
|
if *v == nil {
|
|
sv = &types.LayerInaccessibleException{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for key, value := range shape {
|
|
switch key {
|
|
case "message":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected ExceptionMessage to be of type string, got %T instead", value)
|
|
}
|
|
sv.Message = ptr.String(jtv)
|
|
}
|
|
|
|
default:
|
|
_, _ = key, value
|
|
|
|
}
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson11_deserializeDocumentLayerList(v *[]types.Layer, value interface{}) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
if value == nil {
|
|
return nil
|
|
}
|
|
|
|
shape, ok := value.([]interface{})
|
|
if !ok {
|
|
return fmt.Errorf("unexpected JSON type %v", value)
|
|
}
|
|
|
|
var cv []types.Layer
|
|
if *v == nil {
|
|
cv = []types.Layer{}
|
|
} else {
|
|
cv = *v
|
|
}
|
|
|
|
for _, value := range shape {
|
|
var col types.Layer
|
|
destAddr := &col
|
|
if err := awsAwsjson11_deserializeDocumentLayer(&destAddr, value); err != nil {
|
|
return err
|
|
}
|
|
col = *destAddr
|
|
cv = append(cv, col)
|
|
|
|
}
|
|
*v = cv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson11_deserializeDocumentLayerPartTooSmallException(v **types.LayerPartTooSmallException, value interface{}) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
if value == nil {
|
|
return nil
|
|
}
|
|
|
|
shape, ok := value.(map[string]interface{})
|
|
if !ok {
|
|
return fmt.Errorf("unexpected JSON type %v", value)
|
|
}
|
|
|
|
var sv *types.LayerPartTooSmallException
|
|
if *v == nil {
|
|
sv = &types.LayerPartTooSmallException{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for key, value := range shape {
|
|
switch key {
|
|
case "message":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected ExceptionMessage to be of type string, got %T instead", value)
|
|
}
|
|
sv.Message = ptr.String(jtv)
|
|
}
|
|
|
|
default:
|
|
_, _ = key, value
|
|
|
|
}
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson11_deserializeDocumentLayersNotFoundException(v **types.LayersNotFoundException, value interface{}) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
if value == nil {
|
|
return nil
|
|
}
|
|
|
|
shape, ok := value.(map[string]interface{})
|
|
if !ok {
|
|
return fmt.Errorf("unexpected JSON type %v", value)
|
|
}
|
|
|
|
var sv *types.LayersNotFoundException
|
|
if *v == nil {
|
|
sv = &types.LayersNotFoundException{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for key, value := range shape {
|
|
switch key {
|
|
case "message":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected ExceptionMessage to be of type string, got %T instead", value)
|
|
}
|
|
sv.Message = ptr.String(jtv)
|
|
}
|
|
|
|
default:
|
|
_, _ = key, value
|
|
|
|
}
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson11_deserializeDocumentLifecyclePolicyNotFoundException(v **types.LifecyclePolicyNotFoundException, value interface{}) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
if value == nil {
|
|
return nil
|
|
}
|
|
|
|
shape, ok := value.(map[string]interface{})
|
|
if !ok {
|
|
return fmt.Errorf("unexpected JSON type %v", value)
|
|
}
|
|
|
|
var sv *types.LifecyclePolicyNotFoundException
|
|
if *v == nil {
|
|
sv = &types.LifecyclePolicyNotFoundException{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for key, value := range shape {
|
|
switch key {
|
|
case "message":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected ExceptionMessage to be of type string, got %T instead", value)
|
|
}
|
|
sv.Message = ptr.String(jtv)
|
|
}
|
|
|
|
default:
|
|
_, _ = key, value
|
|
|
|
}
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson11_deserializeDocumentLifecyclePolicyPreviewInProgressException(v **types.LifecyclePolicyPreviewInProgressException, value interface{}) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
if value == nil {
|
|
return nil
|
|
}
|
|
|
|
shape, ok := value.(map[string]interface{})
|
|
if !ok {
|
|
return fmt.Errorf("unexpected JSON type %v", value)
|
|
}
|
|
|
|
var sv *types.LifecyclePolicyPreviewInProgressException
|
|
if *v == nil {
|
|
sv = &types.LifecyclePolicyPreviewInProgressException{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for key, value := range shape {
|
|
switch key {
|
|
case "message":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected ExceptionMessage to be of type string, got %T instead", value)
|
|
}
|
|
sv.Message = ptr.String(jtv)
|
|
}
|
|
|
|
default:
|
|
_, _ = key, value
|
|
|
|
}
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson11_deserializeDocumentLifecyclePolicyPreviewNotFoundException(v **types.LifecyclePolicyPreviewNotFoundException, value interface{}) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
if value == nil {
|
|
return nil
|
|
}
|
|
|
|
shape, ok := value.(map[string]interface{})
|
|
if !ok {
|
|
return fmt.Errorf("unexpected JSON type %v", value)
|
|
}
|
|
|
|
var sv *types.LifecyclePolicyPreviewNotFoundException
|
|
if *v == nil {
|
|
sv = &types.LifecyclePolicyPreviewNotFoundException{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for key, value := range shape {
|
|
switch key {
|
|
case "message":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected ExceptionMessage to be of type string, got %T instead", value)
|
|
}
|
|
sv.Message = ptr.String(jtv)
|
|
}
|
|
|
|
default:
|
|
_, _ = key, value
|
|
|
|
}
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson11_deserializeDocumentLifecyclePolicyPreviewResult(v **types.LifecyclePolicyPreviewResult, value interface{}) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
if value == nil {
|
|
return nil
|
|
}
|
|
|
|
shape, ok := value.(map[string]interface{})
|
|
if !ok {
|
|
return fmt.Errorf("unexpected JSON type %v", value)
|
|
}
|
|
|
|
var sv *types.LifecyclePolicyPreviewResult
|
|
if *v == nil {
|
|
sv = &types.LifecyclePolicyPreviewResult{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for key, value := range shape {
|
|
switch key {
|
|
case "action":
|
|
if err := awsAwsjson11_deserializeDocumentLifecyclePolicyRuleAction(&sv.Action, value); err != nil {
|
|
return err
|
|
}
|
|
|
|
case "appliedRulePriority":
|
|
if value != nil {
|
|
jtv, ok := value.(json.Number)
|
|
if !ok {
|
|
return fmt.Errorf("expected LifecyclePolicyRulePriority to be json.Number, got %T instead", value)
|
|
}
|
|
i64, err := jtv.Int64()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
sv.AppliedRulePriority = ptr.Int32(int32(i64))
|
|
}
|
|
|
|
case "imageDigest":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected ImageDigest to be of type string, got %T instead", value)
|
|
}
|
|
sv.ImageDigest = ptr.String(jtv)
|
|
}
|
|
|
|
case "imagePushedAt":
|
|
if value != nil {
|
|
switch jtv := value.(type) {
|
|
case json.Number:
|
|
f64, err := jtv.Float64()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
sv.ImagePushedAt = ptr.Time(smithytime.ParseEpochSeconds(f64))
|
|
|
|
default:
|
|
return fmt.Errorf("expected PushTimestamp to be a JSON Number, got %T instead", value)
|
|
|
|
}
|
|
}
|
|
|
|
case "imageTags":
|
|
if err := awsAwsjson11_deserializeDocumentImageTagList(&sv.ImageTags, value); err != nil {
|
|
return err
|
|
}
|
|
|
|
default:
|
|
_, _ = key, value
|
|
|
|
}
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson11_deserializeDocumentLifecyclePolicyPreviewResultList(v *[]types.LifecyclePolicyPreviewResult, value interface{}) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
if value == nil {
|
|
return nil
|
|
}
|
|
|
|
shape, ok := value.([]interface{})
|
|
if !ok {
|
|
return fmt.Errorf("unexpected JSON type %v", value)
|
|
}
|
|
|
|
var cv []types.LifecyclePolicyPreviewResult
|
|
if *v == nil {
|
|
cv = []types.LifecyclePolicyPreviewResult{}
|
|
} else {
|
|
cv = *v
|
|
}
|
|
|
|
for _, value := range shape {
|
|
var col types.LifecyclePolicyPreviewResult
|
|
destAddr := &col
|
|
if err := awsAwsjson11_deserializeDocumentLifecyclePolicyPreviewResult(&destAddr, value); err != nil {
|
|
return err
|
|
}
|
|
col = *destAddr
|
|
cv = append(cv, col)
|
|
|
|
}
|
|
*v = cv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson11_deserializeDocumentLifecyclePolicyPreviewSummary(v **types.LifecyclePolicyPreviewSummary, value interface{}) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
if value == nil {
|
|
return nil
|
|
}
|
|
|
|
shape, ok := value.(map[string]interface{})
|
|
if !ok {
|
|
return fmt.Errorf("unexpected JSON type %v", value)
|
|
}
|
|
|
|
var sv *types.LifecyclePolicyPreviewSummary
|
|
if *v == nil {
|
|
sv = &types.LifecyclePolicyPreviewSummary{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for key, value := range shape {
|
|
switch key {
|
|
case "expiringImageTotalCount":
|
|
if value != nil {
|
|
jtv, ok := value.(json.Number)
|
|
if !ok {
|
|
return fmt.Errorf("expected ImageCount to be json.Number, got %T instead", value)
|
|
}
|
|
i64, err := jtv.Int64()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
sv.ExpiringImageTotalCount = ptr.Int32(int32(i64))
|
|
}
|
|
|
|
default:
|
|
_, _ = key, value
|
|
|
|
}
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson11_deserializeDocumentLifecyclePolicyRuleAction(v **types.LifecyclePolicyRuleAction, value interface{}) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
if value == nil {
|
|
return nil
|
|
}
|
|
|
|
shape, ok := value.(map[string]interface{})
|
|
if !ok {
|
|
return fmt.Errorf("unexpected JSON type %v", value)
|
|
}
|
|
|
|
var sv *types.LifecyclePolicyRuleAction
|
|
if *v == nil {
|
|
sv = &types.LifecyclePolicyRuleAction{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for key, value := range shape {
|
|
switch key {
|
|
case "type":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected ImageActionType to be of type string, got %T instead", value)
|
|
}
|
|
sv.Type = types.ImageActionType(jtv)
|
|
}
|
|
|
|
default:
|
|
_, _ = key, value
|
|
|
|
}
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson11_deserializeDocumentLimitExceededException(v **types.LimitExceededException, value interface{}) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
if value == nil {
|
|
return nil
|
|
}
|
|
|
|
shape, ok := value.(map[string]interface{})
|
|
if !ok {
|
|
return fmt.Errorf("unexpected JSON type %v", value)
|
|
}
|
|
|
|
var sv *types.LimitExceededException
|
|
if *v == nil {
|
|
sv = &types.LimitExceededException{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for key, value := range shape {
|
|
switch key {
|
|
case "message":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected ExceptionMessage to be of type string, got %T instead", value)
|
|
}
|
|
sv.Message = ptr.String(jtv)
|
|
}
|
|
|
|
default:
|
|
_, _ = key, value
|
|
|
|
}
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson11_deserializeDocumentPackageVulnerabilityDetails(v **types.PackageVulnerabilityDetails, value interface{}) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
if value == nil {
|
|
return nil
|
|
}
|
|
|
|
shape, ok := value.(map[string]interface{})
|
|
if !ok {
|
|
return fmt.Errorf("unexpected JSON type %v", value)
|
|
}
|
|
|
|
var sv *types.PackageVulnerabilityDetails
|
|
if *v == nil {
|
|
sv = &types.PackageVulnerabilityDetails{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for key, value := range shape {
|
|
switch key {
|
|
case "cvss":
|
|
if err := awsAwsjson11_deserializeDocumentCvssScoreList(&sv.Cvss, value); err != nil {
|
|
return err
|
|
}
|
|
|
|
case "referenceUrls":
|
|
if err := awsAwsjson11_deserializeDocumentReferenceUrlsList(&sv.ReferenceUrls, value); err != nil {
|
|
return err
|
|
}
|
|
|
|
case "relatedVulnerabilities":
|
|
if err := awsAwsjson11_deserializeDocumentRelatedVulnerabilitiesList(&sv.RelatedVulnerabilities, value); err != nil {
|
|
return err
|
|
}
|
|
|
|
case "source":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected Source to be of type string, got %T instead", value)
|
|
}
|
|
sv.Source = ptr.String(jtv)
|
|
}
|
|
|
|
case "sourceUrl":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected Url to be of type string, got %T instead", value)
|
|
}
|
|
sv.SourceUrl = ptr.String(jtv)
|
|
}
|
|
|
|
case "vendorCreatedAt":
|
|
if value != nil {
|
|
switch jtv := value.(type) {
|
|
case json.Number:
|
|
f64, err := jtv.Float64()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
sv.VendorCreatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64))
|
|
|
|
default:
|
|
return fmt.Errorf("expected Date to be a JSON Number, got %T instead", value)
|
|
|
|
}
|
|
}
|
|
|
|
case "vendorSeverity":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected Severity to be of type string, got %T instead", value)
|
|
}
|
|
sv.VendorSeverity = ptr.String(jtv)
|
|
}
|
|
|
|
case "vendorUpdatedAt":
|
|
if value != nil {
|
|
switch jtv := value.(type) {
|
|
case json.Number:
|
|
f64, err := jtv.Float64()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
sv.VendorUpdatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64))
|
|
|
|
default:
|
|
return fmt.Errorf("expected Date to be a JSON Number, got %T instead", value)
|
|
|
|
}
|
|
}
|
|
|
|
case "vulnerabilityId":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected VulnerabilityId to be of type string, got %T instead", value)
|
|
}
|
|
sv.VulnerabilityId = ptr.String(jtv)
|
|
}
|
|
|
|
case "vulnerablePackages":
|
|
if err := awsAwsjson11_deserializeDocumentVulnerablePackagesList(&sv.VulnerablePackages, value); err != nil {
|
|
return err
|
|
}
|
|
|
|
default:
|
|
_, _ = key, value
|
|
|
|
}
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson11_deserializeDocumentPullThroughCacheRule(v **types.PullThroughCacheRule, value interface{}) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
if value == nil {
|
|
return nil
|
|
}
|
|
|
|
shape, ok := value.(map[string]interface{})
|
|
if !ok {
|
|
return fmt.Errorf("unexpected JSON type %v", value)
|
|
}
|
|
|
|
var sv *types.PullThroughCacheRule
|
|
if *v == nil {
|
|
sv = &types.PullThroughCacheRule{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for key, value := range shape {
|
|
switch key {
|
|
case "createdAt":
|
|
if value != nil {
|
|
switch jtv := value.(type) {
|
|
case json.Number:
|
|
f64, err := jtv.Float64()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
sv.CreatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64))
|
|
|
|
default:
|
|
return fmt.Errorf("expected CreationTimestamp to be a JSON Number, got %T instead", value)
|
|
|
|
}
|
|
}
|
|
|
|
case "credentialArn":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected CredentialArn to be of type string, got %T instead", value)
|
|
}
|
|
sv.CredentialArn = ptr.String(jtv)
|
|
}
|
|
|
|
case "ecrRepositoryPrefix":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected PullThroughCacheRuleRepositoryPrefix to be of type string, got %T instead", value)
|
|
}
|
|
sv.EcrRepositoryPrefix = ptr.String(jtv)
|
|
}
|
|
|
|
case "registryId":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected RegistryId to be of type string, got %T instead", value)
|
|
}
|
|
sv.RegistryId = ptr.String(jtv)
|
|
}
|
|
|
|
case "updatedAt":
|
|
if value != nil {
|
|
switch jtv := value.(type) {
|
|
case json.Number:
|
|
f64, err := jtv.Float64()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
sv.UpdatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64))
|
|
|
|
default:
|
|
return fmt.Errorf("expected UpdatedTimestamp to be a JSON Number, got %T instead", value)
|
|
|
|
}
|
|
}
|
|
|
|
case "upstreamRegistry":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected UpstreamRegistry to be of type string, got %T instead", value)
|
|
}
|
|
sv.UpstreamRegistry = types.UpstreamRegistry(jtv)
|
|
}
|
|
|
|
case "upstreamRegistryUrl":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected Url to be of type string, got %T instead", value)
|
|
}
|
|
sv.UpstreamRegistryUrl = ptr.String(jtv)
|
|
}
|
|
|
|
default:
|
|
_, _ = key, value
|
|
|
|
}
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson11_deserializeDocumentPullThroughCacheRuleAlreadyExistsException(v **types.PullThroughCacheRuleAlreadyExistsException, value interface{}) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
if value == nil {
|
|
return nil
|
|
}
|
|
|
|
shape, ok := value.(map[string]interface{})
|
|
if !ok {
|
|
return fmt.Errorf("unexpected JSON type %v", value)
|
|
}
|
|
|
|
var sv *types.PullThroughCacheRuleAlreadyExistsException
|
|
if *v == nil {
|
|
sv = &types.PullThroughCacheRuleAlreadyExistsException{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for key, value := range shape {
|
|
switch key {
|
|
case "message":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected ExceptionMessage to be of type string, got %T instead", value)
|
|
}
|
|
sv.Message = ptr.String(jtv)
|
|
}
|
|
|
|
default:
|
|
_, _ = key, value
|
|
|
|
}
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson11_deserializeDocumentPullThroughCacheRuleList(v *[]types.PullThroughCacheRule, value interface{}) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
if value == nil {
|
|
return nil
|
|
}
|
|
|
|
shape, ok := value.([]interface{})
|
|
if !ok {
|
|
return fmt.Errorf("unexpected JSON type %v", value)
|
|
}
|
|
|
|
var cv []types.PullThroughCacheRule
|
|
if *v == nil {
|
|
cv = []types.PullThroughCacheRule{}
|
|
} else {
|
|
cv = *v
|
|
}
|
|
|
|
for _, value := range shape {
|
|
var col types.PullThroughCacheRule
|
|
destAddr := &col
|
|
if err := awsAwsjson11_deserializeDocumentPullThroughCacheRule(&destAddr, value); err != nil {
|
|
return err
|
|
}
|
|
col = *destAddr
|
|
cv = append(cv, col)
|
|
|
|
}
|
|
*v = cv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson11_deserializeDocumentPullThroughCacheRuleNotFoundException(v **types.PullThroughCacheRuleNotFoundException, value interface{}) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
if value == nil {
|
|
return nil
|
|
}
|
|
|
|
shape, ok := value.(map[string]interface{})
|
|
if !ok {
|
|
return fmt.Errorf("unexpected JSON type %v", value)
|
|
}
|
|
|
|
var sv *types.PullThroughCacheRuleNotFoundException
|
|
if *v == nil {
|
|
sv = &types.PullThroughCacheRuleNotFoundException{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for key, value := range shape {
|
|
switch key {
|
|
case "message":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected ExceptionMessage to be of type string, got %T instead", value)
|
|
}
|
|
sv.Message = ptr.String(jtv)
|
|
}
|
|
|
|
default:
|
|
_, _ = key, value
|
|
|
|
}
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson11_deserializeDocumentRecommendation(v **types.Recommendation, value interface{}) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
if value == nil {
|
|
return nil
|
|
}
|
|
|
|
shape, ok := value.(map[string]interface{})
|
|
if !ok {
|
|
return fmt.Errorf("unexpected JSON type %v", value)
|
|
}
|
|
|
|
var sv *types.Recommendation
|
|
if *v == nil {
|
|
sv = &types.Recommendation{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for key, value := range shape {
|
|
switch key {
|
|
case "text":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected RecommendationText to be of type string, got %T instead", value)
|
|
}
|
|
sv.Text = ptr.String(jtv)
|
|
}
|
|
|
|
case "url":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected Url to be of type string, got %T instead", value)
|
|
}
|
|
sv.Url = ptr.String(jtv)
|
|
}
|
|
|
|
default:
|
|
_, _ = key, value
|
|
|
|
}
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson11_deserializeDocumentReferencedImagesNotFoundException(v **types.ReferencedImagesNotFoundException, value interface{}) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
if value == nil {
|
|
return nil
|
|
}
|
|
|
|
shape, ok := value.(map[string]interface{})
|
|
if !ok {
|
|
return fmt.Errorf("unexpected JSON type %v", value)
|
|
}
|
|
|
|
var sv *types.ReferencedImagesNotFoundException
|
|
if *v == nil {
|
|
sv = &types.ReferencedImagesNotFoundException{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for key, value := range shape {
|
|
switch key {
|
|
case "message":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected ExceptionMessage to be of type string, got %T instead", value)
|
|
}
|
|
sv.Message = ptr.String(jtv)
|
|
}
|
|
|
|
default:
|
|
_, _ = key, value
|
|
|
|
}
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson11_deserializeDocumentReferenceUrlsList(v *[]string, value interface{}) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
if value == nil {
|
|
return nil
|
|
}
|
|
|
|
shape, ok := value.([]interface{})
|
|
if !ok {
|
|
return fmt.Errorf("unexpected JSON type %v", value)
|
|
}
|
|
|
|
var cv []string
|
|
if *v == nil {
|
|
cv = []string{}
|
|
} else {
|
|
cv = *v
|
|
}
|
|
|
|
for _, value := range shape {
|
|
var col string
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected Url to be of type string, got %T instead", value)
|
|
}
|
|
col = jtv
|
|
}
|
|
cv = append(cv, col)
|
|
|
|
}
|
|
*v = cv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson11_deserializeDocumentRegistryPolicyNotFoundException(v **types.RegistryPolicyNotFoundException, value interface{}) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
if value == nil {
|
|
return nil
|
|
}
|
|
|
|
shape, ok := value.(map[string]interface{})
|
|
if !ok {
|
|
return fmt.Errorf("unexpected JSON type %v", value)
|
|
}
|
|
|
|
var sv *types.RegistryPolicyNotFoundException
|
|
if *v == nil {
|
|
sv = &types.RegistryPolicyNotFoundException{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for key, value := range shape {
|
|
switch key {
|
|
case "message":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected ExceptionMessage to be of type string, got %T instead", value)
|
|
}
|
|
sv.Message = ptr.String(jtv)
|
|
}
|
|
|
|
default:
|
|
_, _ = key, value
|
|
|
|
}
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson11_deserializeDocumentRegistryScanningConfiguration(v **types.RegistryScanningConfiguration, value interface{}) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
if value == nil {
|
|
return nil
|
|
}
|
|
|
|
shape, ok := value.(map[string]interface{})
|
|
if !ok {
|
|
return fmt.Errorf("unexpected JSON type %v", value)
|
|
}
|
|
|
|
var sv *types.RegistryScanningConfiguration
|
|
if *v == nil {
|
|
sv = &types.RegistryScanningConfiguration{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for key, value := range shape {
|
|
switch key {
|
|
case "rules":
|
|
if err := awsAwsjson11_deserializeDocumentRegistryScanningRuleList(&sv.Rules, value); err != nil {
|
|
return err
|
|
}
|
|
|
|
case "scanType":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected ScanType to be of type string, got %T instead", value)
|
|
}
|
|
sv.ScanType = types.ScanType(jtv)
|
|
}
|
|
|
|
default:
|
|
_, _ = key, value
|
|
|
|
}
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson11_deserializeDocumentRegistryScanningRule(v **types.RegistryScanningRule, value interface{}) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
if value == nil {
|
|
return nil
|
|
}
|
|
|
|
shape, ok := value.(map[string]interface{})
|
|
if !ok {
|
|
return fmt.Errorf("unexpected JSON type %v", value)
|
|
}
|
|
|
|
var sv *types.RegistryScanningRule
|
|
if *v == nil {
|
|
sv = &types.RegistryScanningRule{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for key, value := range shape {
|
|
switch key {
|
|
case "repositoryFilters":
|
|
if err := awsAwsjson11_deserializeDocumentScanningRepositoryFilterList(&sv.RepositoryFilters, value); err != nil {
|
|
return err
|
|
}
|
|
|
|
case "scanFrequency":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected ScanFrequency to be of type string, got %T instead", value)
|
|
}
|
|
sv.ScanFrequency = types.ScanFrequency(jtv)
|
|
}
|
|
|
|
default:
|
|
_, _ = key, value
|
|
|
|
}
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson11_deserializeDocumentRegistryScanningRuleList(v *[]types.RegistryScanningRule, value interface{}) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
if value == nil {
|
|
return nil
|
|
}
|
|
|
|
shape, ok := value.([]interface{})
|
|
if !ok {
|
|
return fmt.Errorf("unexpected JSON type %v", value)
|
|
}
|
|
|
|
var cv []types.RegistryScanningRule
|
|
if *v == nil {
|
|
cv = []types.RegistryScanningRule{}
|
|
} else {
|
|
cv = *v
|
|
}
|
|
|
|
for _, value := range shape {
|
|
var col types.RegistryScanningRule
|
|
destAddr := &col
|
|
if err := awsAwsjson11_deserializeDocumentRegistryScanningRule(&destAddr, value); err != nil {
|
|
return err
|
|
}
|
|
col = *destAddr
|
|
cv = append(cv, col)
|
|
|
|
}
|
|
*v = cv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson11_deserializeDocumentRelatedVulnerabilitiesList(v *[]string, value interface{}) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
if value == nil {
|
|
return nil
|
|
}
|
|
|
|
shape, ok := value.([]interface{})
|
|
if !ok {
|
|
return fmt.Errorf("unexpected JSON type %v", value)
|
|
}
|
|
|
|
var cv []string
|
|
if *v == nil {
|
|
cv = []string{}
|
|
} else {
|
|
cv = *v
|
|
}
|
|
|
|
for _, value := range shape {
|
|
var col string
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected RelatedVulnerability to be of type string, got %T instead", value)
|
|
}
|
|
col = jtv
|
|
}
|
|
cv = append(cv, col)
|
|
|
|
}
|
|
*v = cv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson11_deserializeDocumentRemediation(v **types.Remediation, value interface{}) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
if value == nil {
|
|
return nil
|
|
}
|
|
|
|
shape, ok := value.(map[string]interface{})
|
|
if !ok {
|
|
return fmt.Errorf("unexpected JSON type %v", value)
|
|
}
|
|
|
|
var sv *types.Remediation
|
|
if *v == nil {
|
|
sv = &types.Remediation{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for key, value := range shape {
|
|
switch key {
|
|
case "recommendation":
|
|
if err := awsAwsjson11_deserializeDocumentRecommendation(&sv.Recommendation, value); err != nil {
|
|
return err
|
|
}
|
|
|
|
default:
|
|
_, _ = key, value
|
|
|
|
}
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson11_deserializeDocumentReplicationConfiguration(v **types.ReplicationConfiguration, value interface{}) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
if value == nil {
|
|
return nil
|
|
}
|
|
|
|
shape, ok := value.(map[string]interface{})
|
|
if !ok {
|
|
return fmt.Errorf("unexpected JSON type %v", value)
|
|
}
|
|
|
|
var sv *types.ReplicationConfiguration
|
|
if *v == nil {
|
|
sv = &types.ReplicationConfiguration{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for key, value := range shape {
|
|
switch key {
|
|
case "rules":
|
|
if err := awsAwsjson11_deserializeDocumentReplicationRuleList(&sv.Rules, value); err != nil {
|
|
return err
|
|
}
|
|
|
|
default:
|
|
_, _ = key, value
|
|
|
|
}
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson11_deserializeDocumentReplicationDestination(v **types.ReplicationDestination, value interface{}) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
if value == nil {
|
|
return nil
|
|
}
|
|
|
|
shape, ok := value.(map[string]interface{})
|
|
if !ok {
|
|
return fmt.Errorf("unexpected JSON type %v", value)
|
|
}
|
|
|
|
var sv *types.ReplicationDestination
|
|
if *v == nil {
|
|
sv = &types.ReplicationDestination{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for key, value := range shape {
|
|
switch key {
|
|
case "region":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected Region to be of type string, got %T instead", value)
|
|
}
|
|
sv.Region = ptr.String(jtv)
|
|
}
|
|
|
|
case "registryId":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected RegistryId to be of type string, got %T instead", value)
|
|
}
|
|
sv.RegistryId = ptr.String(jtv)
|
|
}
|
|
|
|
default:
|
|
_, _ = key, value
|
|
|
|
}
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson11_deserializeDocumentReplicationDestinationList(v *[]types.ReplicationDestination, value interface{}) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
if value == nil {
|
|
return nil
|
|
}
|
|
|
|
shape, ok := value.([]interface{})
|
|
if !ok {
|
|
return fmt.Errorf("unexpected JSON type %v", value)
|
|
}
|
|
|
|
var cv []types.ReplicationDestination
|
|
if *v == nil {
|
|
cv = []types.ReplicationDestination{}
|
|
} else {
|
|
cv = *v
|
|
}
|
|
|
|
for _, value := range shape {
|
|
var col types.ReplicationDestination
|
|
destAddr := &col
|
|
if err := awsAwsjson11_deserializeDocumentReplicationDestination(&destAddr, value); err != nil {
|
|
return err
|
|
}
|
|
col = *destAddr
|
|
cv = append(cv, col)
|
|
|
|
}
|
|
*v = cv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson11_deserializeDocumentReplicationRule(v **types.ReplicationRule, value interface{}) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
if value == nil {
|
|
return nil
|
|
}
|
|
|
|
shape, ok := value.(map[string]interface{})
|
|
if !ok {
|
|
return fmt.Errorf("unexpected JSON type %v", value)
|
|
}
|
|
|
|
var sv *types.ReplicationRule
|
|
if *v == nil {
|
|
sv = &types.ReplicationRule{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for key, value := range shape {
|
|
switch key {
|
|
case "destinations":
|
|
if err := awsAwsjson11_deserializeDocumentReplicationDestinationList(&sv.Destinations, value); err != nil {
|
|
return err
|
|
}
|
|
|
|
case "repositoryFilters":
|
|
if err := awsAwsjson11_deserializeDocumentRepositoryFilterList(&sv.RepositoryFilters, value); err != nil {
|
|
return err
|
|
}
|
|
|
|
default:
|
|
_, _ = key, value
|
|
|
|
}
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson11_deserializeDocumentReplicationRuleList(v *[]types.ReplicationRule, value interface{}) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
if value == nil {
|
|
return nil
|
|
}
|
|
|
|
shape, ok := value.([]interface{})
|
|
if !ok {
|
|
return fmt.Errorf("unexpected JSON type %v", value)
|
|
}
|
|
|
|
var cv []types.ReplicationRule
|
|
if *v == nil {
|
|
cv = []types.ReplicationRule{}
|
|
} else {
|
|
cv = *v
|
|
}
|
|
|
|
for _, value := range shape {
|
|
var col types.ReplicationRule
|
|
destAddr := &col
|
|
if err := awsAwsjson11_deserializeDocumentReplicationRule(&destAddr, value); err != nil {
|
|
return err
|
|
}
|
|
col = *destAddr
|
|
cv = append(cv, col)
|
|
|
|
}
|
|
*v = cv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson11_deserializeDocumentRepository(v **types.Repository, value interface{}) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
if value == nil {
|
|
return nil
|
|
}
|
|
|
|
shape, ok := value.(map[string]interface{})
|
|
if !ok {
|
|
return fmt.Errorf("unexpected JSON type %v", value)
|
|
}
|
|
|
|
var sv *types.Repository
|
|
if *v == nil {
|
|
sv = &types.Repository{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for key, value := range shape {
|
|
switch key {
|
|
case "createdAt":
|
|
if value != nil {
|
|
switch jtv := value.(type) {
|
|
case json.Number:
|
|
f64, err := jtv.Float64()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
sv.CreatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64))
|
|
|
|
default:
|
|
return fmt.Errorf("expected CreationTimestamp to be a JSON Number, got %T instead", value)
|
|
|
|
}
|
|
}
|
|
|
|
case "encryptionConfiguration":
|
|
if err := awsAwsjson11_deserializeDocumentEncryptionConfiguration(&sv.EncryptionConfiguration, value); err != nil {
|
|
return err
|
|
}
|
|
|
|
case "imageScanningConfiguration":
|
|
if err := awsAwsjson11_deserializeDocumentImageScanningConfiguration(&sv.ImageScanningConfiguration, value); err != nil {
|
|
return err
|
|
}
|
|
|
|
case "imageTagMutability":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected ImageTagMutability to be of type string, got %T instead", value)
|
|
}
|
|
sv.ImageTagMutability = types.ImageTagMutability(jtv)
|
|
}
|
|
|
|
case "registryId":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected RegistryId to be of type string, got %T instead", value)
|
|
}
|
|
sv.RegistryId = ptr.String(jtv)
|
|
}
|
|
|
|
case "repositoryArn":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected Arn to be of type string, got %T instead", value)
|
|
}
|
|
sv.RepositoryArn = ptr.String(jtv)
|
|
}
|
|
|
|
case "repositoryName":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected RepositoryName to be of type string, got %T instead", value)
|
|
}
|
|
sv.RepositoryName = ptr.String(jtv)
|
|
}
|
|
|
|
case "repositoryUri":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected Url to be of type string, got %T instead", value)
|
|
}
|
|
sv.RepositoryUri = ptr.String(jtv)
|
|
}
|
|
|
|
default:
|
|
_, _ = key, value
|
|
|
|
}
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson11_deserializeDocumentRepositoryAlreadyExistsException(v **types.RepositoryAlreadyExistsException, value interface{}) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
if value == nil {
|
|
return nil
|
|
}
|
|
|
|
shape, ok := value.(map[string]interface{})
|
|
if !ok {
|
|
return fmt.Errorf("unexpected JSON type %v", value)
|
|
}
|
|
|
|
var sv *types.RepositoryAlreadyExistsException
|
|
if *v == nil {
|
|
sv = &types.RepositoryAlreadyExistsException{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for key, value := range shape {
|
|
switch key {
|
|
case "message":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected ExceptionMessage to be of type string, got %T instead", value)
|
|
}
|
|
sv.Message = ptr.String(jtv)
|
|
}
|
|
|
|
default:
|
|
_, _ = key, value
|
|
|
|
}
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson11_deserializeDocumentRepositoryFilter(v **types.RepositoryFilter, value interface{}) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
if value == nil {
|
|
return nil
|
|
}
|
|
|
|
shape, ok := value.(map[string]interface{})
|
|
if !ok {
|
|
return fmt.Errorf("unexpected JSON type %v", value)
|
|
}
|
|
|
|
var sv *types.RepositoryFilter
|
|
if *v == nil {
|
|
sv = &types.RepositoryFilter{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for key, value := range shape {
|
|
switch key {
|
|
case "filter":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected RepositoryFilterValue to be of type string, got %T instead", value)
|
|
}
|
|
sv.Filter = ptr.String(jtv)
|
|
}
|
|
|
|
case "filterType":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected RepositoryFilterType to be of type string, got %T instead", value)
|
|
}
|
|
sv.FilterType = types.RepositoryFilterType(jtv)
|
|
}
|
|
|
|
default:
|
|
_, _ = key, value
|
|
|
|
}
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson11_deserializeDocumentRepositoryFilterList(v *[]types.RepositoryFilter, value interface{}) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
if value == nil {
|
|
return nil
|
|
}
|
|
|
|
shape, ok := value.([]interface{})
|
|
if !ok {
|
|
return fmt.Errorf("unexpected JSON type %v", value)
|
|
}
|
|
|
|
var cv []types.RepositoryFilter
|
|
if *v == nil {
|
|
cv = []types.RepositoryFilter{}
|
|
} else {
|
|
cv = *v
|
|
}
|
|
|
|
for _, value := range shape {
|
|
var col types.RepositoryFilter
|
|
destAddr := &col
|
|
if err := awsAwsjson11_deserializeDocumentRepositoryFilter(&destAddr, value); err != nil {
|
|
return err
|
|
}
|
|
col = *destAddr
|
|
cv = append(cv, col)
|
|
|
|
}
|
|
*v = cv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson11_deserializeDocumentRepositoryList(v *[]types.Repository, value interface{}) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
if value == nil {
|
|
return nil
|
|
}
|
|
|
|
shape, ok := value.([]interface{})
|
|
if !ok {
|
|
return fmt.Errorf("unexpected JSON type %v", value)
|
|
}
|
|
|
|
var cv []types.Repository
|
|
if *v == nil {
|
|
cv = []types.Repository{}
|
|
} else {
|
|
cv = *v
|
|
}
|
|
|
|
for _, value := range shape {
|
|
var col types.Repository
|
|
destAddr := &col
|
|
if err := awsAwsjson11_deserializeDocumentRepository(&destAddr, value); err != nil {
|
|
return err
|
|
}
|
|
col = *destAddr
|
|
cv = append(cv, col)
|
|
|
|
}
|
|
*v = cv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson11_deserializeDocumentRepositoryNotEmptyException(v **types.RepositoryNotEmptyException, value interface{}) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
if value == nil {
|
|
return nil
|
|
}
|
|
|
|
shape, ok := value.(map[string]interface{})
|
|
if !ok {
|
|
return fmt.Errorf("unexpected JSON type %v", value)
|
|
}
|
|
|
|
var sv *types.RepositoryNotEmptyException
|
|
if *v == nil {
|
|
sv = &types.RepositoryNotEmptyException{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for key, value := range shape {
|
|
switch key {
|
|
case "message":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected ExceptionMessage to be of type string, got %T instead", value)
|
|
}
|
|
sv.Message = ptr.String(jtv)
|
|
}
|
|
|
|
default:
|
|
_, _ = key, value
|
|
|
|
}
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson11_deserializeDocumentRepositoryNotFoundException(v **types.RepositoryNotFoundException, value interface{}) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
if value == nil {
|
|
return nil
|
|
}
|
|
|
|
shape, ok := value.(map[string]interface{})
|
|
if !ok {
|
|
return fmt.Errorf("unexpected JSON type %v", value)
|
|
}
|
|
|
|
var sv *types.RepositoryNotFoundException
|
|
if *v == nil {
|
|
sv = &types.RepositoryNotFoundException{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for key, value := range shape {
|
|
switch key {
|
|
case "message":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected ExceptionMessage to be of type string, got %T instead", value)
|
|
}
|
|
sv.Message = ptr.String(jtv)
|
|
}
|
|
|
|
default:
|
|
_, _ = key, value
|
|
|
|
}
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson11_deserializeDocumentRepositoryPolicyNotFoundException(v **types.RepositoryPolicyNotFoundException, value interface{}) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
if value == nil {
|
|
return nil
|
|
}
|
|
|
|
shape, ok := value.(map[string]interface{})
|
|
if !ok {
|
|
return fmt.Errorf("unexpected JSON type %v", value)
|
|
}
|
|
|
|
var sv *types.RepositoryPolicyNotFoundException
|
|
if *v == nil {
|
|
sv = &types.RepositoryPolicyNotFoundException{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for key, value := range shape {
|
|
switch key {
|
|
case "message":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected ExceptionMessage to be of type string, got %T instead", value)
|
|
}
|
|
sv.Message = ptr.String(jtv)
|
|
}
|
|
|
|
default:
|
|
_, _ = key, value
|
|
|
|
}
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson11_deserializeDocumentRepositoryScanningConfiguration(v **types.RepositoryScanningConfiguration, value interface{}) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
if value == nil {
|
|
return nil
|
|
}
|
|
|
|
shape, ok := value.(map[string]interface{})
|
|
if !ok {
|
|
return fmt.Errorf("unexpected JSON type %v", value)
|
|
}
|
|
|
|
var sv *types.RepositoryScanningConfiguration
|
|
if *v == nil {
|
|
sv = &types.RepositoryScanningConfiguration{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for key, value := range shape {
|
|
switch key {
|
|
case "appliedScanFilters":
|
|
if err := awsAwsjson11_deserializeDocumentScanningRepositoryFilterList(&sv.AppliedScanFilters, value); err != nil {
|
|
return err
|
|
}
|
|
|
|
case "repositoryArn":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected Arn to be of type string, got %T instead", value)
|
|
}
|
|
sv.RepositoryArn = ptr.String(jtv)
|
|
}
|
|
|
|
case "repositoryName":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected RepositoryName to be of type string, got %T instead", value)
|
|
}
|
|
sv.RepositoryName = ptr.String(jtv)
|
|
}
|
|
|
|
case "scanFrequency":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected ScanFrequency to be of type string, got %T instead", value)
|
|
}
|
|
sv.ScanFrequency = types.ScanFrequency(jtv)
|
|
}
|
|
|
|
case "scanOnPush":
|
|
if value != nil {
|
|
jtv, ok := value.(bool)
|
|
if !ok {
|
|
return fmt.Errorf("expected ScanOnPushFlag to be of type *bool, got %T instead", value)
|
|
}
|
|
sv.ScanOnPush = jtv
|
|
}
|
|
|
|
default:
|
|
_, _ = key, value
|
|
|
|
}
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson11_deserializeDocumentRepositoryScanningConfigurationFailure(v **types.RepositoryScanningConfigurationFailure, value interface{}) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
if value == nil {
|
|
return nil
|
|
}
|
|
|
|
shape, ok := value.(map[string]interface{})
|
|
if !ok {
|
|
return fmt.Errorf("unexpected JSON type %v", value)
|
|
}
|
|
|
|
var sv *types.RepositoryScanningConfigurationFailure
|
|
if *v == nil {
|
|
sv = &types.RepositoryScanningConfigurationFailure{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for key, value := range shape {
|
|
switch key {
|
|
case "failureCode":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected ScanningConfigurationFailureCode to be of type string, got %T instead", value)
|
|
}
|
|
sv.FailureCode = types.ScanningConfigurationFailureCode(jtv)
|
|
}
|
|
|
|
case "failureReason":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected ScanningConfigurationFailureReason to be of type string, got %T instead", value)
|
|
}
|
|
sv.FailureReason = ptr.String(jtv)
|
|
}
|
|
|
|
case "repositoryName":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected RepositoryName to be of type string, got %T instead", value)
|
|
}
|
|
sv.RepositoryName = ptr.String(jtv)
|
|
}
|
|
|
|
default:
|
|
_, _ = key, value
|
|
|
|
}
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson11_deserializeDocumentRepositoryScanningConfigurationFailureList(v *[]types.RepositoryScanningConfigurationFailure, value interface{}) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
if value == nil {
|
|
return nil
|
|
}
|
|
|
|
shape, ok := value.([]interface{})
|
|
if !ok {
|
|
return fmt.Errorf("unexpected JSON type %v", value)
|
|
}
|
|
|
|
var cv []types.RepositoryScanningConfigurationFailure
|
|
if *v == nil {
|
|
cv = []types.RepositoryScanningConfigurationFailure{}
|
|
} else {
|
|
cv = *v
|
|
}
|
|
|
|
for _, value := range shape {
|
|
var col types.RepositoryScanningConfigurationFailure
|
|
destAddr := &col
|
|
if err := awsAwsjson11_deserializeDocumentRepositoryScanningConfigurationFailure(&destAddr, value); err != nil {
|
|
return err
|
|
}
|
|
col = *destAddr
|
|
cv = append(cv, col)
|
|
|
|
}
|
|
*v = cv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson11_deserializeDocumentRepositoryScanningConfigurationList(v *[]types.RepositoryScanningConfiguration, value interface{}) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
if value == nil {
|
|
return nil
|
|
}
|
|
|
|
shape, ok := value.([]interface{})
|
|
if !ok {
|
|
return fmt.Errorf("unexpected JSON type %v", value)
|
|
}
|
|
|
|
var cv []types.RepositoryScanningConfiguration
|
|
if *v == nil {
|
|
cv = []types.RepositoryScanningConfiguration{}
|
|
} else {
|
|
cv = *v
|
|
}
|
|
|
|
for _, value := range shape {
|
|
var col types.RepositoryScanningConfiguration
|
|
destAddr := &col
|
|
if err := awsAwsjson11_deserializeDocumentRepositoryScanningConfiguration(&destAddr, value); err != nil {
|
|
return err
|
|
}
|
|
col = *destAddr
|
|
cv = append(cv, col)
|
|
|
|
}
|
|
*v = cv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson11_deserializeDocumentResource(v **types.Resource, value interface{}) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
if value == nil {
|
|
return nil
|
|
}
|
|
|
|
shape, ok := value.(map[string]interface{})
|
|
if !ok {
|
|
return fmt.Errorf("unexpected JSON type %v", value)
|
|
}
|
|
|
|
var sv *types.Resource
|
|
if *v == nil {
|
|
sv = &types.Resource{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for key, value := range shape {
|
|
switch key {
|
|
case "details":
|
|
if err := awsAwsjson11_deserializeDocumentResourceDetails(&sv.Details, value); err != nil {
|
|
return err
|
|
}
|
|
|
|
case "id":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected ResourceId to be of type string, got %T instead", value)
|
|
}
|
|
sv.Id = ptr.String(jtv)
|
|
}
|
|
|
|
case "tags":
|
|
if err := awsAwsjson11_deserializeDocumentTags(&sv.Tags, value); err != nil {
|
|
return err
|
|
}
|
|
|
|
case "type":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected Type to be of type string, got %T instead", value)
|
|
}
|
|
sv.Type = ptr.String(jtv)
|
|
}
|
|
|
|
default:
|
|
_, _ = key, value
|
|
|
|
}
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson11_deserializeDocumentResourceDetails(v **types.ResourceDetails, value interface{}) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
if value == nil {
|
|
return nil
|
|
}
|
|
|
|
shape, ok := value.(map[string]interface{})
|
|
if !ok {
|
|
return fmt.Errorf("unexpected JSON type %v", value)
|
|
}
|
|
|
|
var sv *types.ResourceDetails
|
|
if *v == nil {
|
|
sv = &types.ResourceDetails{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for key, value := range shape {
|
|
switch key {
|
|
case "awsEcrContainerImage":
|
|
if err := awsAwsjson11_deserializeDocumentAwsEcrContainerImageDetails(&sv.AwsEcrContainerImage, value); err != nil {
|
|
return err
|
|
}
|
|
|
|
default:
|
|
_, _ = key, value
|
|
|
|
}
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson11_deserializeDocumentResourceList(v *[]types.Resource, value interface{}) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
if value == nil {
|
|
return nil
|
|
}
|
|
|
|
shape, ok := value.([]interface{})
|
|
if !ok {
|
|
return fmt.Errorf("unexpected JSON type %v", value)
|
|
}
|
|
|
|
var cv []types.Resource
|
|
if *v == nil {
|
|
cv = []types.Resource{}
|
|
} else {
|
|
cv = *v
|
|
}
|
|
|
|
for _, value := range shape {
|
|
var col types.Resource
|
|
destAddr := &col
|
|
if err := awsAwsjson11_deserializeDocumentResource(&destAddr, value); err != nil {
|
|
return err
|
|
}
|
|
col = *destAddr
|
|
cv = append(cv, col)
|
|
|
|
}
|
|
*v = cv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson11_deserializeDocumentScanningRepositoryFilter(v **types.ScanningRepositoryFilter, value interface{}) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
if value == nil {
|
|
return nil
|
|
}
|
|
|
|
shape, ok := value.(map[string]interface{})
|
|
if !ok {
|
|
return fmt.Errorf("unexpected JSON type %v", value)
|
|
}
|
|
|
|
var sv *types.ScanningRepositoryFilter
|
|
if *v == nil {
|
|
sv = &types.ScanningRepositoryFilter{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for key, value := range shape {
|
|
switch key {
|
|
case "filter":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected ScanningRepositoryFilterValue to be of type string, got %T instead", value)
|
|
}
|
|
sv.Filter = ptr.String(jtv)
|
|
}
|
|
|
|
case "filterType":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected ScanningRepositoryFilterType to be of type string, got %T instead", value)
|
|
}
|
|
sv.FilterType = types.ScanningRepositoryFilterType(jtv)
|
|
}
|
|
|
|
default:
|
|
_, _ = key, value
|
|
|
|
}
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson11_deserializeDocumentScanningRepositoryFilterList(v *[]types.ScanningRepositoryFilter, value interface{}) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
if value == nil {
|
|
return nil
|
|
}
|
|
|
|
shape, ok := value.([]interface{})
|
|
if !ok {
|
|
return fmt.Errorf("unexpected JSON type %v", value)
|
|
}
|
|
|
|
var cv []types.ScanningRepositoryFilter
|
|
if *v == nil {
|
|
cv = []types.ScanningRepositoryFilter{}
|
|
} else {
|
|
cv = *v
|
|
}
|
|
|
|
for _, value := range shape {
|
|
var col types.ScanningRepositoryFilter
|
|
destAddr := &col
|
|
if err := awsAwsjson11_deserializeDocumentScanningRepositoryFilter(&destAddr, value); err != nil {
|
|
return err
|
|
}
|
|
col = *destAddr
|
|
cv = append(cv, col)
|
|
|
|
}
|
|
*v = cv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson11_deserializeDocumentScanNotFoundException(v **types.ScanNotFoundException, value interface{}) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
if value == nil {
|
|
return nil
|
|
}
|
|
|
|
shape, ok := value.(map[string]interface{})
|
|
if !ok {
|
|
return fmt.Errorf("unexpected JSON type %v", value)
|
|
}
|
|
|
|
var sv *types.ScanNotFoundException
|
|
if *v == nil {
|
|
sv = &types.ScanNotFoundException{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for key, value := range shape {
|
|
switch key {
|
|
case "message":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected ExceptionMessage to be of type string, got %T instead", value)
|
|
}
|
|
sv.Message = ptr.String(jtv)
|
|
}
|
|
|
|
default:
|
|
_, _ = key, value
|
|
|
|
}
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson11_deserializeDocumentScoreDetails(v **types.ScoreDetails, value interface{}) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
if value == nil {
|
|
return nil
|
|
}
|
|
|
|
shape, ok := value.(map[string]interface{})
|
|
if !ok {
|
|
return fmt.Errorf("unexpected JSON type %v", value)
|
|
}
|
|
|
|
var sv *types.ScoreDetails
|
|
if *v == nil {
|
|
sv = &types.ScoreDetails{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for key, value := range shape {
|
|
switch key {
|
|
case "cvss":
|
|
if err := awsAwsjson11_deserializeDocumentCvssScoreDetails(&sv.Cvss, value); err != nil {
|
|
return err
|
|
}
|
|
|
|
default:
|
|
_, _ = key, value
|
|
|
|
}
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson11_deserializeDocumentSecretNotFoundException(v **types.SecretNotFoundException, value interface{}) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
if value == nil {
|
|
return nil
|
|
}
|
|
|
|
shape, ok := value.(map[string]interface{})
|
|
if !ok {
|
|
return fmt.Errorf("unexpected JSON type %v", value)
|
|
}
|
|
|
|
var sv *types.SecretNotFoundException
|
|
if *v == nil {
|
|
sv = &types.SecretNotFoundException{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for key, value := range shape {
|
|
switch key {
|
|
case "message":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected ExceptionMessage to be of type string, got %T instead", value)
|
|
}
|
|
sv.Message = ptr.String(jtv)
|
|
}
|
|
|
|
default:
|
|
_, _ = key, value
|
|
|
|
}
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson11_deserializeDocumentServerException(v **types.ServerException, value interface{}) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
if value == nil {
|
|
return nil
|
|
}
|
|
|
|
shape, ok := value.(map[string]interface{})
|
|
if !ok {
|
|
return fmt.Errorf("unexpected JSON type %v", value)
|
|
}
|
|
|
|
var sv *types.ServerException
|
|
if *v == nil {
|
|
sv = &types.ServerException{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for key, value := range shape {
|
|
switch key {
|
|
case "message":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected ExceptionMessage to be of type string, got %T instead", value)
|
|
}
|
|
sv.Message = ptr.String(jtv)
|
|
}
|
|
|
|
default:
|
|
_, _ = key, value
|
|
|
|
}
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson11_deserializeDocumentTag(v **types.Tag, value interface{}) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
if value == nil {
|
|
return nil
|
|
}
|
|
|
|
shape, ok := value.(map[string]interface{})
|
|
if !ok {
|
|
return fmt.Errorf("unexpected JSON type %v", value)
|
|
}
|
|
|
|
var sv *types.Tag
|
|
if *v == nil {
|
|
sv = &types.Tag{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for key, value := range shape {
|
|
switch key {
|
|
case "Key":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected TagKey to be of type string, got %T instead", value)
|
|
}
|
|
sv.Key = ptr.String(jtv)
|
|
}
|
|
|
|
case "Value":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected TagValue to be of type string, got %T instead", value)
|
|
}
|
|
sv.Value = ptr.String(jtv)
|
|
}
|
|
|
|
default:
|
|
_, _ = key, value
|
|
|
|
}
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson11_deserializeDocumentTagList(v *[]types.Tag, value interface{}) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
if value == nil {
|
|
return nil
|
|
}
|
|
|
|
shape, ok := value.([]interface{})
|
|
if !ok {
|
|
return fmt.Errorf("unexpected JSON type %v", value)
|
|
}
|
|
|
|
var cv []types.Tag
|
|
if *v == nil {
|
|
cv = []types.Tag{}
|
|
} else {
|
|
cv = *v
|
|
}
|
|
|
|
for _, value := range shape {
|
|
var col types.Tag
|
|
destAddr := &col
|
|
if err := awsAwsjson11_deserializeDocumentTag(&destAddr, value); err != nil {
|
|
return err
|
|
}
|
|
col = *destAddr
|
|
cv = append(cv, col)
|
|
|
|
}
|
|
*v = cv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson11_deserializeDocumentTags(v *map[string]string, value interface{}) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
if value == nil {
|
|
return nil
|
|
}
|
|
|
|
shape, ok := value.(map[string]interface{})
|
|
if !ok {
|
|
return fmt.Errorf("unexpected JSON type %v", value)
|
|
}
|
|
|
|
var mv map[string]string
|
|
if *v == nil {
|
|
mv = map[string]string{}
|
|
} else {
|
|
mv = *v
|
|
}
|
|
|
|
for key, value := range shape {
|
|
var parsedVal string
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected TagValue to be of type string, got %T instead", value)
|
|
}
|
|
parsedVal = jtv
|
|
}
|
|
mv[key] = parsedVal
|
|
|
|
}
|
|
*v = mv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson11_deserializeDocumentTooManyTagsException(v **types.TooManyTagsException, value interface{}) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
if value == nil {
|
|
return nil
|
|
}
|
|
|
|
shape, ok := value.(map[string]interface{})
|
|
if !ok {
|
|
return fmt.Errorf("unexpected JSON type %v", value)
|
|
}
|
|
|
|
var sv *types.TooManyTagsException
|
|
if *v == nil {
|
|
sv = &types.TooManyTagsException{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for key, value := range shape {
|
|
switch key {
|
|
case "message":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected ExceptionMessage to be of type string, got %T instead", value)
|
|
}
|
|
sv.Message = ptr.String(jtv)
|
|
}
|
|
|
|
default:
|
|
_, _ = key, value
|
|
|
|
}
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson11_deserializeDocumentUnableToAccessSecretException(v **types.UnableToAccessSecretException, value interface{}) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
if value == nil {
|
|
return nil
|
|
}
|
|
|
|
shape, ok := value.(map[string]interface{})
|
|
if !ok {
|
|
return fmt.Errorf("unexpected JSON type %v", value)
|
|
}
|
|
|
|
var sv *types.UnableToAccessSecretException
|
|
if *v == nil {
|
|
sv = &types.UnableToAccessSecretException{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for key, value := range shape {
|
|
switch key {
|
|
case "message":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected ExceptionMessage to be of type string, got %T instead", value)
|
|
}
|
|
sv.Message = ptr.String(jtv)
|
|
}
|
|
|
|
default:
|
|
_, _ = key, value
|
|
|
|
}
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson11_deserializeDocumentUnableToDecryptSecretValueException(v **types.UnableToDecryptSecretValueException, value interface{}) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
if value == nil {
|
|
return nil
|
|
}
|
|
|
|
shape, ok := value.(map[string]interface{})
|
|
if !ok {
|
|
return fmt.Errorf("unexpected JSON type %v", value)
|
|
}
|
|
|
|
var sv *types.UnableToDecryptSecretValueException
|
|
if *v == nil {
|
|
sv = &types.UnableToDecryptSecretValueException{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for key, value := range shape {
|
|
switch key {
|
|
case "message":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected ExceptionMessage to be of type string, got %T instead", value)
|
|
}
|
|
sv.Message = ptr.String(jtv)
|
|
}
|
|
|
|
default:
|
|
_, _ = key, value
|
|
|
|
}
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson11_deserializeDocumentUnableToGetUpstreamImageException(v **types.UnableToGetUpstreamImageException, value interface{}) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
if value == nil {
|
|
return nil
|
|
}
|
|
|
|
shape, ok := value.(map[string]interface{})
|
|
if !ok {
|
|
return fmt.Errorf("unexpected JSON type %v", value)
|
|
}
|
|
|
|
var sv *types.UnableToGetUpstreamImageException
|
|
if *v == nil {
|
|
sv = &types.UnableToGetUpstreamImageException{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for key, value := range shape {
|
|
switch key {
|
|
case "message":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected ExceptionMessage to be of type string, got %T instead", value)
|
|
}
|
|
sv.Message = ptr.String(jtv)
|
|
}
|
|
|
|
default:
|
|
_, _ = key, value
|
|
|
|
}
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson11_deserializeDocumentUnableToGetUpstreamLayerException(v **types.UnableToGetUpstreamLayerException, value interface{}) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
if value == nil {
|
|
return nil
|
|
}
|
|
|
|
shape, ok := value.(map[string]interface{})
|
|
if !ok {
|
|
return fmt.Errorf("unexpected JSON type %v", value)
|
|
}
|
|
|
|
var sv *types.UnableToGetUpstreamLayerException
|
|
if *v == nil {
|
|
sv = &types.UnableToGetUpstreamLayerException{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for key, value := range shape {
|
|
switch key {
|
|
case "message":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected ExceptionMessage to be of type string, got %T instead", value)
|
|
}
|
|
sv.Message = ptr.String(jtv)
|
|
}
|
|
|
|
default:
|
|
_, _ = key, value
|
|
|
|
}
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson11_deserializeDocumentUnsupportedImageTypeException(v **types.UnsupportedImageTypeException, value interface{}) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
if value == nil {
|
|
return nil
|
|
}
|
|
|
|
shape, ok := value.(map[string]interface{})
|
|
if !ok {
|
|
return fmt.Errorf("unexpected JSON type %v", value)
|
|
}
|
|
|
|
var sv *types.UnsupportedImageTypeException
|
|
if *v == nil {
|
|
sv = &types.UnsupportedImageTypeException{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for key, value := range shape {
|
|
switch key {
|
|
case "message":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected ExceptionMessage to be of type string, got %T instead", value)
|
|
}
|
|
sv.Message = ptr.String(jtv)
|
|
}
|
|
|
|
default:
|
|
_, _ = key, value
|
|
|
|
}
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson11_deserializeDocumentUnsupportedUpstreamRegistryException(v **types.UnsupportedUpstreamRegistryException, value interface{}) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
if value == nil {
|
|
return nil
|
|
}
|
|
|
|
shape, ok := value.(map[string]interface{})
|
|
if !ok {
|
|
return fmt.Errorf("unexpected JSON type %v", value)
|
|
}
|
|
|
|
var sv *types.UnsupportedUpstreamRegistryException
|
|
if *v == nil {
|
|
sv = &types.UnsupportedUpstreamRegistryException{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for key, value := range shape {
|
|
switch key {
|
|
case "message":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected ExceptionMessage to be of type string, got %T instead", value)
|
|
}
|
|
sv.Message = ptr.String(jtv)
|
|
}
|
|
|
|
default:
|
|
_, _ = key, value
|
|
|
|
}
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson11_deserializeDocumentUploadNotFoundException(v **types.UploadNotFoundException, value interface{}) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
if value == nil {
|
|
return nil
|
|
}
|
|
|
|
shape, ok := value.(map[string]interface{})
|
|
if !ok {
|
|
return fmt.Errorf("unexpected JSON type %v", value)
|
|
}
|
|
|
|
var sv *types.UploadNotFoundException
|
|
if *v == nil {
|
|
sv = &types.UploadNotFoundException{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for key, value := range shape {
|
|
switch key {
|
|
case "message":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected ExceptionMessage to be of type string, got %T instead", value)
|
|
}
|
|
sv.Message = ptr.String(jtv)
|
|
}
|
|
|
|
default:
|
|
_, _ = key, value
|
|
|
|
}
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson11_deserializeDocumentValidationException(v **types.ValidationException, value interface{}) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
if value == nil {
|
|
return nil
|
|
}
|
|
|
|
shape, ok := value.(map[string]interface{})
|
|
if !ok {
|
|
return fmt.Errorf("unexpected JSON type %v", value)
|
|
}
|
|
|
|
var sv *types.ValidationException
|
|
if *v == nil {
|
|
sv = &types.ValidationException{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for key, value := range shape {
|
|
switch key {
|
|
case "message":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected ExceptionMessage to be of type string, got %T instead", value)
|
|
}
|
|
sv.Message = ptr.String(jtv)
|
|
}
|
|
|
|
default:
|
|
_, _ = key, value
|
|
|
|
}
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson11_deserializeDocumentVulnerablePackage(v **types.VulnerablePackage, value interface{}) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
if value == nil {
|
|
return nil
|
|
}
|
|
|
|
shape, ok := value.(map[string]interface{})
|
|
if !ok {
|
|
return fmt.Errorf("unexpected JSON type %v", value)
|
|
}
|
|
|
|
var sv *types.VulnerablePackage
|
|
if *v == nil {
|
|
sv = &types.VulnerablePackage{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for key, value := range shape {
|
|
switch key {
|
|
case "arch":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected Arch to be of type string, got %T instead", value)
|
|
}
|
|
sv.Arch = ptr.String(jtv)
|
|
}
|
|
|
|
case "epoch":
|
|
if value != nil {
|
|
jtv, ok := value.(json.Number)
|
|
if !ok {
|
|
return fmt.Errorf("expected Epoch to be json.Number, got %T instead", value)
|
|
}
|
|
i64, err := jtv.Int64()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
sv.Epoch = ptr.Int32(int32(i64))
|
|
}
|
|
|
|
case "filePath":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected FilePath to be of type string, got %T instead", value)
|
|
}
|
|
sv.FilePath = ptr.String(jtv)
|
|
}
|
|
|
|
case "name":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected VulnerablePackageName to be of type string, got %T instead", value)
|
|
}
|
|
sv.Name = ptr.String(jtv)
|
|
}
|
|
|
|
case "packageManager":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected PackageManager to be of type string, got %T instead", value)
|
|
}
|
|
sv.PackageManager = ptr.String(jtv)
|
|
}
|
|
|
|
case "release":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected Release to be of type string, got %T instead", value)
|
|
}
|
|
sv.Release = ptr.String(jtv)
|
|
}
|
|
|
|
case "sourceLayerHash":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected SourceLayerHash to be of type string, got %T instead", value)
|
|
}
|
|
sv.SourceLayerHash = ptr.String(jtv)
|
|
}
|
|
|
|
case "version":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected Version to be of type string, got %T instead", value)
|
|
}
|
|
sv.Version = ptr.String(jtv)
|
|
}
|
|
|
|
default:
|
|
_, _ = key, value
|
|
|
|
}
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson11_deserializeDocumentVulnerablePackagesList(v *[]types.VulnerablePackage, value interface{}) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
if value == nil {
|
|
return nil
|
|
}
|
|
|
|
shape, ok := value.([]interface{})
|
|
if !ok {
|
|
return fmt.Errorf("unexpected JSON type %v", value)
|
|
}
|
|
|
|
var cv []types.VulnerablePackage
|
|
if *v == nil {
|
|
cv = []types.VulnerablePackage{}
|
|
} else {
|
|
cv = *v
|
|
}
|
|
|
|
for _, value := range shape {
|
|
var col types.VulnerablePackage
|
|
destAddr := &col
|
|
if err := awsAwsjson11_deserializeDocumentVulnerablePackage(&destAddr, value); err != nil {
|
|
return err
|
|
}
|
|
col = *destAddr
|
|
cv = append(cv, col)
|
|
|
|
}
|
|
*v = cv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson11_deserializeOpDocumentBatchCheckLayerAvailabilityOutput(v **BatchCheckLayerAvailabilityOutput, value interface{}) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
if value == nil {
|
|
return nil
|
|
}
|
|
|
|
shape, ok := value.(map[string]interface{})
|
|
if !ok {
|
|
return fmt.Errorf("unexpected JSON type %v", value)
|
|
}
|
|
|
|
var sv *BatchCheckLayerAvailabilityOutput
|
|
if *v == nil {
|
|
sv = &BatchCheckLayerAvailabilityOutput{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for key, value := range shape {
|
|
switch key {
|
|
case "failures":
|
|
if err := awsAwsjson11_deserializeDocumentLayerFailureList(&sv.Failures, value); err != nil {
|
|
return err
|
|
}
|
|
|
|
case "layers":
|
|
if err := awsAwsjson11_deserializeDocumentLayerList(&sv.Layers, value); err != nil {
|
|
return err
|
|
}
|
|
|
|
default:
|
|
_, _ = key, value
|
|
|
|
}
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson11_deserializeOpDocumentBatchDeleteImageOutput(v **BatchDeleteImageOutput, value interface{}) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
if value == nil {
|
|
return nil
|
|
}
|
|
|
|
shape, ok := value.(map[string]interface{})
|
|
if !ok {
|
|
return fmt.Errorf("unexpected JSON type %v", value)
|
|
}
|
|
|
|
var sv *BatchDeleteImageOutput
|
|
if *v == nil {
|
|
sv = &BatchDeleteImageOutput{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for key, value := range shape {
|
|
switch key {
|
|
case "failures":
|
|
if err := awsAwsjson11_deserializeDocumentImageFailureList(&sv.Failures, value); err != nil {
|
|
return err
|
|
}
|
|
|
|
case "imageIds":
|
|
if err := awsAwsjson11_deserializeDocumentImageIdentifierList(&sv.ImageIds, value); err != nil {
|
|
return err
|
|
}
|
|
|
|
default:
|
|
_, _ = key, value
|
|
|
|
}
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson11_deserializeOpDocumentBatchGetImageOutput(v **BatchGetImageOutput, value interface{}) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
if value == nil {
|
|
return nil
|
|
}
|
|
|
|
shape, ok := value.(map[string]interface{})
|
|
if !ok {
|
|
return fmt.Errorf("unexpected JSON type %v", value)
|
|
}
|
|
|
|
var sv *BatchGetImageOutput
|
|
if *v == nil {
|
|
sv = &BatchGetImageOutput{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for key, value := range shape {
|
|
switch key {
|
|
case "failures":
|
|
if err := awsAwsjson11_deserializeDocumentImageFailureList(&sv.Failures, value); err != nil {
|
|
return err
|
|
}
|
|
|
|
case "images":
|
|
if err := awsAwsjson11_deserializeDocumentImageList(&sv.Images, value); err != nil {
|
|
return err
|
|
}
|
|
|
|
default:
|
|
_, _ = key, value
|
|
|
|
}
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson11_deserializeOpDocumentBatchGetRepositoryScanningConfigurationOutput(v **BatchGetRepositoryScanningConfigurationOutput, value interface{}) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
if value == nil {
|
|
return nil
|
|
}
|
|
|
|
shape, ok := value.(map[string]interface{})
|
|
if !ok {
|
|
return fmt.Errorf("unexpected JSON type %v", value)
|
|
}
|
|
|
|
var sv *BatchGetRepositoryScanningConfigurationOutput
|
|
if *v == nil {
|
|
sv = &BatchGetRepositoryScanningConfigurationOutput{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for key, value := range shape {
|
|
switch key {
|
|
case "failures":
|
|
if err := awsAwsjson11_deserializeDocumentRepositoryScanningConfigurationFailureList(&sv.Failures, value); err != nil {
|
|
return err
|
|
}
|
|
|
|
case "scanningConfigurations":
|
|
if err := awsAwsjson11_deserializeDocumentRepositoryScanningConfigurationList(&sv.ScanningConfigurations, value); err != nil {
|
|
return err
|
|
}
|
|
|
|
default:
|
|
_, _ = key, value
|
|
|
|
}
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson11_deserializeOpDocumentCompleteLayerUploadOutput(v **CompleteLayerUploadOutput, value interface{}) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
if value == nil {
|
|
return nil
|
|
}
|
|
|
|
shape, ok := value.(map[string]interface{})
|
|
if !ok {
|
|
return fmt.Errorf("unexpected JSON type %v", value)
|
|
}
|
|
|
|
var sv *CompleteLayerUploadOutput
|
|
if *v == nil {
|
|
sv = &CompleteLayerUploadOutput{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for key, value := range shape {
|
|
switch key {
|
|
case "layerDigest":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected LayerDigest to be of type string, got %T instead", value)
|
|
}
|
|
sv.LayerDigest = ptr.String(jtv)
|
|
}
|
|
|
|
case "registryId":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected RegistryId to be of type string, got %T instead", value)
|
|
}
|
|
sv.RegistryId = ptr.String(jtv)
|
|
}
|
|
|
|
case "repositoryName":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected RepositoryName to be of type string, got %T instead", value)
|
|
}
|
|
sv.RepositoryName = ptr.String(jtv)
|
|
}
|
|
|
|
case "uploadId":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected UploadId to be of type string, got %T instead", value)
|
|
}
|
|
sv.UploadId = ptr.String(jtv)
|
|
}
|
|
|
|
default:
|
|
_, _ = key, value
|
|
|
|
}
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson11_deserializeOpDocumentCreatePullThroughCacheRuleOutput(v **CreatePullThroughCacheRuleOutput, value interface{}) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
if value == nil {
|
|
return nil
|
|
}
|
|
|
|
shape, ok := value.(map[string]interface{})
|
|
if !ok {
|
|
return fmt.Errorf("unexpected JSON type %v", value)
|
|
}
|
|
|
|
var sv *CreatePullThroughCacheRuleOutput
|
|
if *v == nil {
|
|
sv = &CreatePullThroughCacheRuleOutput{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for key, value := range shape {
|
|
switch key {
|
|
case "createdAt":
|
|
if value != nil {
|
|
switch jtv := value.(type) {
|
|
case json.Number:
|
|
f64, err := jtv.Float64()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
sv.CreatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64))
|
|
|
|
default:
|
|
return fmt.Errorf("expected CreationTimestamp to be a JSON Number, got %T instead", value)
|
|
|
|
}
|
|
}
|
|
|
|
case "credentialArn":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected CredentialArn to be of type string, got %T instead", value)
|
|
}
|
|
sv.CredentialArn = ptr.String(jtv)
|
|
}
|
|
|
|
case "ecrRepositoryPrefix":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected PullThroughCacheRuleRepositoryPrefix to be of type string, got %T instead", value)
|
|
}
|
|
sv.EcrRepositoryPrefix = ptr.String(jtv)
|
|
}
|
|
|
|
case "registryId":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected RegistryId to be of type string, got %T instead", value)
|
|
}
|
|
sv.RegistryId = ptr.String(jtv)
|
|
}
|
|
|
|
case "upstreamRegistry":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected UpstreamRegistry to be of type string, got %T instead", value)
|
|
}
|
|
sv.UpstreamRegistry = types.UpstreamRegistry(jtv)
|
|
}
|
|
|
|
case "upstreamRegistryUrl":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected Url to be of type string, got %T instead", value)
|
|
}
|
|
sv.UpstreamRegistryUrl = ptr.String(jtv)
|
|
}
|
|
|
|
default:
|
|
_, _ = key, value
|
|
|
|
}
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson11_deserializeOpDocumentCreateRepositoryOutput(v **CreateRepositoryOutput, value interface{}) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
if value == nil {
|
|
return nil
|
|
}
|
|
|
|
shape, ok := value.(map[string]interface{})
|
|
if !ok {
|
|
return fmt.Errorf("unexpected JSON type %v", value)
|
|
}
|
|
|
|
var sv *CreateRepositoryOutput
|
|
if *v == nil {
|
|
sv = &CreateRepositoryOutput{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for key, value := range shape {
|
|
switch key {
|
|
case "repository":
|
|
if err := awsAwsjson11_deserializeDocumentRepository(&sv.Repository, value); err != nil {
|
|
return err
|
|
}
|
|
|
|
default:
|
|
_, _ = key, value
|
|
|
|
}
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson11_deserializeOpDocumentDeleteLifecyclePolicyOutput(v **DeleteLifecyclePolicyOutput, value interface{}) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
if value == nil {
|
|
return nil
|
|
}
|
|
|
|
shape, ok := value.(map[string]interface{})
|
|
if !ok {
|
|
return fmt.Errorf("unexpected JSON type %v", value)
|
|
}
|
|
|
|
var sv *DeleteLifecyclePolicyOutput
|
|
if *v == nil {
|
|
sv = &DeleteLifecyclePolicyOutput{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for key, value := range shape {
|
|
switch key {
|
|
case "lastEvaluatedAt":
|
|
if value != nil {
|
|
switch jtv := value.(type) {
|
|
case json.Number:
|
|
f64, err := jtv.Float64()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
sv.LastEvaluatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64))
|
|
|
|
default:
|
|
return fmt.Errorf("expected EvaluationTimestamp to be a JSON Number, got %T instead", value)
|
|
|
|
}
|
|
}
|
|
|
|
case "lifecyclePolicyText":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected LifecyclePolicyText to be of type string, got %T instead", value)
|
|
}
|
|
sv.LifecyclePolicyText = ptr.String(jtv)
|
|
}
|
|
|
|
case "registryId":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected RegistryId to be of type string, got %T instead", value)
|
|
}
|
|
sv.RegistryId = ptr.String(jtv)
|
|
}
|
|
|
|
case "repositoryName":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected RepositoryName to be of type string, got %T instead", value)
|
|
}
|
|
sv.RepositoryName = ptr.String(jtv)
|
|
}
|
|
|
|
default:
|
|
_, _ = key, value
|
|
|
|
}
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson11_deserializeOpDocumentDeletePullThroughCacheRuleOutput(v **DeletePullThroughCacheRuleOutput, value interface{}) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
if value == nil {
|
|
return nil
|
|
}
|
|
|
|
shape, ok := value.(map[string]interface{})
|
|
if !ok {
|
|
return fmt.Errorf("unexpected JSON type %v", value)
|
|
}
|
|
|
|
var sv *DeletePullThroughCacheRuleOutput
|
|
if *v == nil {
|
|
sv = &DeletePullThroughCacheRuleOutput{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for key, value := range shape {
|
|
switch key {
|
|
case "createdAt":
|
|
if value != nil {
|
|
switch jtv := value.(type) {
|
|
case json.Number:
|
|
f64, err := jtv.Float64()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
sv.CreatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64))
|
|
|
|
default:
|
|
return fmt.Errorf("expected CreationTimestamp to be a JSON Number, got %T instead", value)
|
|
|
|
}
|
|
}
|
|
|
|
case "credentialArn":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected CredentialArn to be of type string, got %T instead", value)
|
|
}
|
|
sv.CredentialArn = ptr.String(jtv)
|
|
}
|
|
|
|
case "ecrRepositoryPrefix":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected PullThroughCacheRuleRepositoryPrefix to be of type string, got %T instead", value)
|
|
}
|
|
sv.EcrRepositoryPrefix = ptr.String(jtv)
|
|
}
|
|
|
|
case "registryId":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected RegistryId to be of type string, got %T instead", value)
|
|
}
|
|
sv.RegistryId = ptr.String(jtv)
|
|
}
|
|
|
|
case "upstreamRegistryUrl":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected Url to be of type string, got %T instead", value)
|
|
}
|
|
sv.UpstreamRegistryUrl = ptr.String(jtv)
|
|
}
|
|
|
|
default:
|
|
_, _ = key, value
|
|
|
|
}
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson11_deserializeOpDocumentDeleteRegistryPolicyOutput(v **DeleteRegistryPolicyOutput, value interface{}) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
if value == nil {
|
|
return nil
|
|
}
|
|
|
|
shape, ok := value.(map[string]interface{})
|
|
if !ok {
|
|
return fmt.Errorf("unexpected JSON type %v", value)
|
|
}
|
|
|
|
var sv *DeleteRegistryPolicyOutput
|
|
if *v == nil {
|
|
sv = &DeleteRegistryPolicyOutput{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for key, value := range shape {
|
|
switch key {
|
|
case "policyText":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected RegistryPolicyText to be of type string, got %T instead", value)
|
|
}
|
|
sv.PolicyText = ptr.String(jtv)
|
|
}
|
|
|
|
case "registryId":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected RegistryId to be of type string, got %T instead", value)
|
|
}
|
|
sv.RegistryId = ptr.String(jtv)
|
|
}
|
|
|
|
default:
|
|
_, _ = key, value
|
|
|
|
}
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson11_deserializeOpDocumentDeleteRepositoryOutput(v **DeleteRepositoryOutput, value interface{}) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
if value == nil {
|
|
return nil
|
|
}
|
|
|
|
shape, ok := value.(map[string]interface{})
|
|
if !ok {
|
|
return fmt.Errorf("unexpected JSON type %v", value)
|
|
}
|
|
|
|
var sv *DeleteRepositoryOutput
|
|
if *v == nil {
|
|
sv = &DeleteRepositoryOutput{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for key, value := range shape {
|
|
switch key {
|
|
case "repository":
|
|
if err := awsAwsjson11_deserializeDocumentRepository(&sv.Repository, value); err != nil {
|
|
return err
|
|
}
|
|
|
|
default:
|
|
_, _ = key, value
|
|
|
|
}
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson11_deserializeOpDocumentDeleteRepositoryPolicyOutput(v **DeleteRepositoryPolicyOutput, value interface{}) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
if value == nil {
|
|
return nil
|
|
}
|
|
|
|
shape, ok := value.(map[string]interface{})
|
|
if !ok {
|
|
return fmt.Errorf("unexpected JSON type %v", value)
|
|
}
|
|
|
|
var sv *DeleteRepositoryPolicyOutput
|
|
if *v == nil {
|
|
sv = &DeleteRepositoryPolicyOutput{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for key, value := range shape {
|
|
switch key {
|
|
case "policyText":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected RepositoryPolicyText to be of type string, got %T instead", value)
|
|
}
|
|
sv.PolicyText = ptr.String(jtv)
|
|
}
|
|
|
|
case "registryId":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected RegistryId to be of type string, got %T instead", value)
|
|
}
|
|
sv.RegistryId = ptr.String(jtv)
|
|
}
|
|
|
|
case "repositoryName":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected RepositoryName to be of type string, got %T instead", value)
|
|
}
|
|
sv.RepositoryName = ptr.String(jtv)
|
|
}
|
|
|
|
default:
|
|
_, _ = key, value
|
|
|
|
}
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson11_deserializeOpDocumentDescribeImageReplicationStatusOutput(v **DescribeImageReplicationStatusOutput, value interface{}) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
if value == nil {
|
|
return nil
|
|
}
|
|
|
|
shape, ok := value.(map[string]interface{})
|
|
if !ok {
|
|
return fmt.Errorf("unexpected JSON type %v", value)
|
|
}
|
|
|
|
var sv *DescribeImageReplicationStatusOutput
|
|
if *v == nil {
|
|
sv = &DescribeImageReplicationStatusOutput{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for key, value := range shape {
|
|
switch key {
|
|
case "imageId":
|
|
if err := awsAwsjson11_deserializeDocumentImageIdentifier(&sv.ImageId, value); err != nil {
|
|
return err
|
|
}
|
|
|
|
case "replicationStatuses":
|
|
if err := awsAwsjson11_deserializeDocumentImageReplicationStatusList(&sv.ReplicationStatuses, value); err != nil {
|
|
return err
|
|
}
|
|
|
|
case "repositoryName":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected RepositoryName to be of type string, got %T instead", value)
|
|
}
|
|
sv.RepositoryName = ptr.String(jtv)
|
|
}
|
|
|
|
default:
|
|
_, _ = key, value
|
|
|
|
}
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson11_deserializeOpDocumentDescribeImageScanFindingsOutput(v **DescribeImageScanFindingsOutput, value interface{}) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
if value == nil {
|
|
return nil
|
|
}
|
|
|
|
shape, ok := value.(map[string]interface{})
|
|
if !ok {
|
|
return fmt.Errorf("unexpected JSON type %v", value)
|
|
}
|
|
|
|
var sv *DescribeImageScanFindingsOutput
|
|
if *v == nil {
|
|
sv = &DescribeImageScanFindingsOutput{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for key, value := range shape {
|
|
switch key {
|
|
case "imageId":
|
|
if err := awsAwsjson11_deserializeDocumentImageIdentifier(&sv.ImageId, value); err != nil {
|
|
return err
|
|
}
|
|
|
|
case "imageScanFindings":
|
|
if err := awsAwsjson11_deserializeDocumentImageScanFindings(&sv.ImageScanFindings, value); err != nil {
|
|
return err
|
|
}
|
|
|
|
case "imageScanStatus":
|
|
if err := awsAwsjson11_deserializeDocumentImageScanStatus(&sv.ImageScanStatus, value); err != nil {
|
|
return err
|
|
}
|
|
|
|
case "nextToken":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected NextToken to be of type string, got %T instead", value)
|
|
}
|
|
sv.NextToken = ptr.String(jtv)
|
|
}
|
|
|
|
case "registryId":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected RegistryId to be of type string, got %T instead", value)
|
|
}
|
|
sv.RegistryId = ptr.String(jtv)
|
|
}
|
|
|
|
case "repositoryName":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected RepositoryName to be of type string, got %T instead", value)
|
|
}
|
|
sv.RepositoryName = ptr.String(jtv)
|
|
}
|
|
|
|
default:
|
|
_, _ = key, value
|
|
|
|
}
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson11_deserializeOpDocumentDescribeImagesOutput(v **DescribeImagesOutput, value interface{}) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
if value == nil {
|
|
return nil
|
|
}
|
|
|
|
shape, ok := value.(map[string]interface{})
|
|
if !ok {
|
|
return fmt.Errorf("unexpected JSON type %v", value)
|
|
}
|
|
|
|
var sv *DescribeImagesOutput
|
|
if *v == nil {
|
|
sv = &DescribeImagesOutput{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for key, value := range shape {
|
|
switch key {
|
|
case "imageDetails":
|
|
if err := awsAwsjson11_deserializeDocumentImageDetailList(&sv.ImageDetails, value); err != nil {
|
|
return err
|
|
}
|
|
|
|
case "nextToken":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected NextToken to be of type string, got %T instead", value)
|
|
}
|
|
sv.NextToken = ptr.String(jtv)
|
|
}
|
|
|
|
default:
|
|
_, _ = key, value
|
|
|
|
}
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson11_deserializeOpDocumentDescribePullThroughCacheRulesOutput(v **DescribePullThroughCacheRulesOutput, value interface{}) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
if value == nil {
|
|
return nil
|
|
}
|
|
|
|
shape, ok := value.(map[string]interface{})
|
|
if !ok {
|
|
return fmt.Errorf("unexpected JSON type %v", value)
|
|
}
|
|
|
|
var sv *DescribePullThroughCacheRulesOutput
|
|
if *v == nil {
|
|
sv = &DescribePullThroughCacheRulesOutput{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for key, value := range shape {
|
|
switch key {
|
|
case "nextToken":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected NextToken to be of type string, got %T instead", value)
|
|
}
|
|
sv.NextToken = ptr.String(jtv)
|
|
}
|
|
|
|
case "pullThroughCacheRules":
|
|
if err := awsAwsjson11_deserializeDocumentPullThroughCacheRuleList(&sv.PullThroughCacheRules, value); err != nil {
|
|
return err
|
|
}
|
|
|
|
default:
|
|
_, _ = key, value
|
|
|
|
}
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson11_deserializeOpDocumentDescribeRegistryOutput(v **DescribeRegistryOutput, value interface{}) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
if value == nil {
|
|
return nil
|
|
}
|
|
|
|
shape, ok := value.(map[string]interface{})
|
|
if !ok {
|
|
return fmt.Errorf("unexpected JSON type %v", value)
|
|
}
|
|
|
|
var sv *DescribeRegistryOutput
|
|
if *v == nil {
|
|
sv = &DescribeRegistryOutput{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for key, value := range shape {
|
|
switch key {
|
|
case "registryId":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected RegistryId to be of type string, got %T instead", value)
|
|
}
|
|
sv.RegistryId = ptr.String(jtv)
|
|
}
|
|
|
|
case "replicationConfiguration":
|
|
if err := awsAwsjson11_deserializeDocumentReplicationConfiguration(&sv.ReplicationConfiguration, value); err != nil {
|
|
return err
|
|
}
|
|
|
|
default:
|
|
_, _ = key, value
|
|
|
|
}
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson11_deserializeOpDocumentDescribeRepositoriesOutput(v **DescribeRepositoriesOutput, value interface{}) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
if value == nil {
|
|
return nil
|
|
}
|
|
|
|
shape, ok := value.(map[string]interface{})
|
|
if !ok {
|
|
return fmt.Errorf("unexpected JSON type %v", value)
|
|
}
|
|
|
|
var sv *DescribeRepositoriesOutput
|
|
if *v == nil {
|
|
sv = &DescribeRepositoriesOutput{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for key, value := range shape {
|
|
switch key {
|
|
case "nextToken":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected NextToken to be of type string, got %T instead", value)
|
|
}
|
|
sv.NextToken = ptr.String(jtv)
|
|
}
|
|
|
|
case "repositories":
|
|
if err := awsAwsjson11_deserializeDocumentRepositoryList(&sv.Repositories, value); err != nil {
|
|
return err
|
|
}
|
|
|
|
default:
|
|
_, _ = key, value
|
|
|
|
}
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson11_deserializeOpDocumentGetAuthorizationTokenOutput(v **GetAuthorizationTokenOutput, value interface{}) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
if value == nil {
|
|
return nil
|
|
}
|
|
|
|
shape, ok := value.(map[string]interface{})
|
|
if !ok {
|
|
return fmt.Errorf("unexpected JSON type %v", value)
|
|
}
|
|
|
|
var sv *GetAuthorizationTokenOutput
|
|
if *v == nil {
|
|
sv = &GetAuthorizationTokenOutput{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for key, value := range shape {
|
|
switch key {
|
|
case "authorizationData":
|
|
if err := awsAwsjson11_deserializeDocumentAuthorizationDataList(&sv.AuthorizationData, value); err != nil {
|
|
return err
|
|
}
|
|
|
|
default:
|
|
_, _ = key, value
|
|
|
|
}
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson11_deserializeOpDocumentGetDownloadUrlForLayerOutput(v **GetDownloadUrlForLayerOutput, value interface{}) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
if value == nil {
|
|
return nil
|
|
}
|
|
|
|
shape, ok := value.(map[string]interface{})
|
|
if !ok {
|
|
return fmt.Errorf("unexpected JSON type %v", value)
|
|
}
|
|
|
|
var sv *GetDownloadUrlForLayerOutput
|
|
if *v == nil {
|
|
sv = &GetDownloadUrlForLayerOutput{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for key, value := range shape {
|
|
switch key {
|
|
case "downloadUrl":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected Url to be of type string, got %T instead", value)
|
|
}
|
|
sv.DownloadUrl = ptr.String(jtv)
|
|
}
|
|
|
|
case "layerDigest":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected LayerDigest to be of type string, got %T instead", value)
|
|
}
|
|
sv.LayerDigest = ptr.String(jtv)
|
|
}
|
|
|
|
default:
|
|
_, _ = key, value
|
|
|
|
}
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson11_deserializeOpDocumentGetLifecyclePolicyOutput(v **GetLifecyclePolicyOutput, value interface{}) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
if value == nil {
|
|
return nil
|
|
}
|
|
|
|
shape, ok := value.(map[string]interface{})
|
|
if !ok {
|
|
return fmt.Errorf("unexpected JSON type %v", value)
|
|
}
|
|
|
|
var sv *GetLifecyclePolicyOutput
|
|
if *v == nil {
|
|
sv = &GetLifecyclePolicyOutput{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for key, value := range shape {
|
|
switch key {
|
|
case "lastEvaluatedAt":
|
|
if value != nil {
|
|
switch jtv := value.(type) {
|
|
case json.Number:
|
|
f64, err := jtv.Float64()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
sv.LastEvaluatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64))
|
|
|
|
default:
|
|
return fmt.Errorf("expected EvaluationTimestamp to be a JSON Number, got %T instead", value)
|
|
|
|
}
|
|
}
|
|
|
|
case "lifecyclePolicyText":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected LifecyclePolicyText to be of type string, got %T instead", value)
|
|
}
|
|
sv.LifecyclePolicyText = ptr.String(jtv)
|
|
}
|
|
|
|
case "registryId":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected RegistryId to be of type string, got %T instead", value)
|
|
}
|
|
sv.RegistryId = ptr.String(jtv)
|
|
}
|
|
|
|
case "repositoryName":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected RepositoryName to be of type string, got %T instead", value)
|
|
}
|
|
sv.RepositoryName = ptr.String(jtv)
|
|
}
|
|
|
|
default:
|
|
_, _ = key, value
|
|
|
|
}
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson11_deserializeOpDocumentGetLifecyclePolicyPreviewOutput(v **GetLifecyclePolicyPreviewOutput, value interface{}) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
if value == nil {
|
|
return nil
|
|
}
|
|
|
|
shape, ok := value.(map[string]interface{})
|
|
if !ok {
|
|
return fmt.Errorf("unexpected JSON type %v", value)
|
|
}
|
|
|
|
var sv *GetLifecyclePolicyPreviewOutput
|
|
if *v == nil {
|
|
sv = &GetLifecyclePolicyPreviewOutput{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for key, value := range shape {
|
|
switch key {
|
|
case "lifecyclePolicyText":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected LifecyclePolicyText to be of type string, got %T instead", value)
|
|
}
|
|
sv.LifecyclePolicyText = ptr.String(jtv)
|
|
}
|
|
|
|
case "nextToken":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected NextToken to be of type string, got %T instead", value)
|
|
}
|
|
sv.NextToken = ptr.String(jtv)
|
|
}
|
|
|
|
case "previewResults":
|
|
if err := awsAwsjson11_deserializeDocumentLifecyclePolicyPreviewResultList(&sv.PreviewResults, value); err != nil {
|
|
return err
|
|
}
|
|
|
|
case "registryId":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected RegistryId to be of type string, got %T instead", value)
|
|
}
|
|
sv.RegistryId = ptr.String(jtv)
|
|
}
|
|
|
|
case "repositoryName":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected RepositoryName to be of type string, got %T instead", value)
|
|
}
|
|
sv.RepositoryName = ptr.String(jtv)
|
|
}
|
|
|
|
case "status":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected LifecyclePolicyPreviewStatus to be of type string, got %T instead", value)
|
|
}
|
|
sv.Status = types.LifecyclePolicyPreviewStatus(jtv)
|
|
}
|
|
|
|
case "summary":
|
|
if err := awsAwsjson11_deserializeDocumentLifecyclePolicyPreviewSummary(&sv.Summary, value); err != nil {
|
|
return err
|
|
}
|
|
|
|
default:
|
|
_, _ = key, value
|
|
|
|
}
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson11_deserializeOpDocumentGetRegistryPolicyOutput(v **GetRegistryPolicyOutput, value interface{}) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
if value == nil {
|
|
return nil
|
|
}
|
|
|
|
shape, ok := value.(map[string]interface{})
|
|
if !ok {
|
|
return fmt.Errorf("unexpected JSON type %v", value)
|
|
}
|
|
|
|
var sv *GetRegistryPolicyOutput
|
|
if *v == nil {
|
|
sv = &GetRegistryPolicyOutput{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for key, value := range shape {
|
|
switch key {
|
|
case "policyText":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected RegistryPolicyText to be of type string, got %T instead", value)
|
|
}
|
|
sv.PolicyText = ptr.String(jtv)
|
|
}
|
|
|
|
case "registryId":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected RegistryId to be of type string, got %T instead", value)
|
|
}
|
|
sv.RegistryId = ptr.String(jtv)
|
|
}
|
|
|
|
default:
|
|
_, _ = key, value
|
|
|
|
}
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson11_deserializeOpDocumentGetRegistryScanningConfigurationOutput(v **GetRegistryScanningConfigurationOutput, value interface{}) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
if value == nil {
|
|
return nil
|
|
}
|
|
|
|
shape, ok := value.(map[string]interface{})
|
|
if !ok {
|
|
return fmt.Errorf("unexpected JSON type %v", value)
|
|
}
|
|
|
|
var sv *GetRegistryScanningConfigurationOutput
|
|
if *v == nil {
|
|
sv = &GetRegistryScanningConfigurationOutput{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for key, value := range shape {
|
|
switch key {
|
|
case "registryId":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected RegistryId to be of type string, got %T instead", value)
|
|
}
|
|
sv.RegistryId = ptr.String(jtv)
|
|
}
|
|
|
|
case "scanningConfiguration":
|
|
if err := awsAwsjson11_deserializeDocumentRegistryScanningConfiguration(&sv.ScanningConfiguration, value); err != nil {
|
|
return err
|
|
}
|
|
|
|
default:
|
|
_, _ = key, value
|
|
|
|
}
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson11_deserializeOpDocumentGetRepositoryPolicyOutput(v **GetRepositoryPolicyOutput, value interface{}) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
if value == nil {
|
|
return nil
|
|
}
|
|
|
|
shape, ok := value.(map[string]interface{})
|
|
if !ok {
|
|
return fmt.Errorf("unexpected JSON type %v", value)
|
|
}
|
|
|
|
var sv *GetRepositoryPolicyOutput
|
|
if *v == nil {
|
|
sv = &GetRepositoryPolicyOutput{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for key, value := range shape {
|
|
switch key {
|
|
case "policyText":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected RepositoryPolicyText to be of type string, got %T instead", value)
|
|
}
|
|
sv.PolicyText = ptr.String(jtv)
|
|
}
|
|
|
|
case "registryId":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected RegistryId to be of type string, got %T instead", value)
|
|
}
|
|
sv.RegistryId = ptr.String(jtv)
|
|
}
|
|
|
|
case "repositoryName":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected RepositoryName to be of type string, got %T instead", value)
|
|
}
|
|
sv.RepositoryName = ptr.String(jtv)
|
|
}
|
|
|
|
default:
|
|
_, _ = key, value
|
|
|
|
}
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson11_deserializeOpDocumentInitiateLayerUploadOutput(v **InitiateLayerUploadOutput, value interface{}) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
if value == nil {
|
|
return nil
|
|
}
|
|
|
|
shape, ok := value.(map[string]interface{})
|
|
if !ok {
|
|
return fmt.Errorf("unexpected JSON type %v", value)
|
|
}
|
|
|
|
var sv *InitiateLayerUploadOutput
|
|
if *v == nil {
|
|
sv = &InitiateLayerUploadOutput{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for key, value := range shape {
|
|
switch key {
|
|
case "partSize":
|
|
if value != nil {
|
|
jtv, ok := value.(json.Number)
|
|
if !ok {
|
|
return fmt.Errorf("expected PartSize to be json.Number, got %T instead", value)
|
|
}
|
|
i64, err := jtv.Int64()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
sv.PartSize = ptr.Int64(i64)
|
|
}
|
|
|
|
case "uploadId":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected UploadId to be of type string, got %T instead", value)
|
|
}
|
|
sv.UploadId = ptr.String(jtv)
|
|
}
|
|
|
|
default:
|
|
_, _ = key, value
|
|
|
|
}
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson11_deserializeOpDocumentListImagesOutput(v **ListImagesOutput, value interface{}) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
if value == nil {
|
|
return nil
|
|
}
|
|
|
|
shape, ok := value.(map[string]interface{})
|
|
if !ok {
|
|
return fmt.Errorf("unexpected JSON type %v", value)
|
|
}
|
|
|
|
var sv *ListImagesOutput
|
|
if *v == nil {
|
|
sv = &ListImagesOutput{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for key, value := range shape {
|
|
switch key {
|
|
case "imageIds":
|
|
if err := awsAwsjson11_deserializeDocumentImageIdentifierList(&sv.ImageIds, value); err != nil {
|
|
return err
|
|
}
|
|
|
|
case "nextToken":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected NextToken to be of type string, got %T instead", value)
|
|
}
|
|
sv.NextToken = ptr.String(jtv)
|
|
}
|
|
|
|
default:
|
|
_, _ = key, value
|
|
|
|
}
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson11_deserializeOpDocumentListTagsForResourceOutput(v **ListTagsForResourceOutput, value interface{}) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
if value == nil {
|
|
return nil
|
|
}
|
|
|
|
shape, ok := value.(map[string]interface{})
|
|
if !ok {
|
|
return fmt.Errorf("unexpected JSON type %v", value)
|
|
}
|
|
|
|
var sv *ListTagsForResourceOutput
|
|
if *v == nil {
|
|
sv = &ListTagsForResourceOutput{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for key, value := range shape {
|
|
switch key {
|
|
case "tags":
|
|
if err := awsAwsjson11_deserializeDocumentTagList(&sv.Tags, value); err != nil {
|
|
return err
|
|
}
|
|
|
|
default:
|
|
_, _ = key, value
|
|
|
|
}
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson11_deserializeOpDocumentPutImageOutput(v **PutImageOutput, value interface{}) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
if value == nil {
|
|
return nil
|
|
}
|
|
|
|
shape, ok := value.(map[string]interface{})
|
|
if !ok {
|
|
return fmt.Errorf("unexpected JSON type %v", value)
|
|
}
|
|
|
|
var sv *PutImageOutput
|
|
if *v == nil {
|
|
sv = &PutImageOutput{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for key, value := range shape {
|
|
switch key {
|
|
case "image":
|
|
if err := awsAwsjson11_deserializeDocumentImage(&sv.Image, value); err != nil {
|
|
return err
|
|
}
|
|
|
|
default:
|
|
_, _ = key, value
|
|
|
|
}
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson11_deserializeOpDocumentPutImageScanningConfigurationOutput(v **PutImageScanningConfigurationOutput, value interface{}) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
if value == nil {
|
|
return nil
|
|
}
|
|
|
|
shape, ok := value.(map[string]interface{})
|
|
if !ok {
|
|
return fmt.Errorf("unexpected JSON type %v", value)
|
|
}
|
|
|
|
var sv *PutImageScanningConfigurationOutput
|
|
if *v == nil {
|
|
sv = &PutImageScanningConfigurationOutput{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for key, value := range shape {
|
|
switch key {
|
|
case "imageScanningConfiguration":
|
|
if err := awsAwsjson11_deserializeDocumentImageScanningConfiguration(&sv.ImageScanningConfiguration, value); err != nil {
|
|
return err
|
|
}
|
|
|
|
case "registryId":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected RegistryId to be of type string, got %T instead", value)
|
|
}
|
|
sv.RegistryId = ptr.String(jtv)
|
|
}
|
|
|
|
case "repositoryName":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected RepositoryName to be of type string, got %T instead", value)
|
|
}
|
|
sv.RepositoryName = ptr.String(jtv)
|
|
}
|
|
|
|
default:
|
|
_, _ = key, value
|
|
|
|
}
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson11_deserializeOpDocumentPutImageTagMutabilityOutput(v **PutImageTagMutabilityOutput, value interface{}) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
if value == nil {
|
|
return nil
|
|
}
|
|
|
|
shape, ok := value.(map[string]interface{})
|
|
if !ok {
|
|
return fmt.Errorf("unexpected JSON type %v", value)
|
|
}
|
|
|
|
var sv *PutImageTagMutabilityOutput
|
|
if *v == nil {
|
|
sv = &PutImageTagMutabilityOutput{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for key, value := range shape {
|
|
switch key {
|
|
case "imageTagMutability":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected ImageTagMutability to be of type string, got %T instead", value)
|
|
}
|
|
sv.ImageTagMutability = types.ImageTagMutability(jtv)
|
|
}
|
|
|
|
case "registryId":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected RegistryId to be of type string, got %T instead", value)
|
|
}
|
|
sv.RegistryId = ptr.String(jtv)
|
|
}
|
|
|
|
case "repositoryName":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected RepositoryName to be of type string, got %T instead", value)
|
|
}
|
|
sv.RepositoryName = ptr.String(jtv)
|
|
}
|
|
|
|
default:
|
|
_, _ = key, value
|
|
|
|
}
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson11_deserializeOpDocumentPutLifecyclePolicyOutput(v **PutLifecyclePolicyOutput, value interface{}) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
if value == nil {
|
|
return nil
|
|
}
|
|
|
|
shape, ok := value.(map[string]interface{})
|
|
if !ok {
|
|
return fmt.Errorf("unexpected JSON type %v", value)
|
|
}
|
|
|
|
var sv *PutLifecyclePolicyOutput
|
|
if *v == nil {
|
|
sv = &PutLifecyclePolicyOutput{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for key, value := range shape {
|
|
switch key {
|
|
case "lifecyclePolicyText":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected LifecyclePolicyText to be of type string, got %T instead", value)
|
|
}
|
|
sv.LifecyclePolicyText = ptr.String(jtv)
|
|
}
|
|
|
|
case "registryId":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected RegistryId to be of type string, got %T instead", value)
|
|
}
|
|
sv.RegistryId = ptr.String(jtv)
|
|
}
|
|
|
|
case "repositoryName":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected RepositoryName to be of type string, got %T instead", value)
|
|
}
|
|
sv.RepositoryName = ptr.String(jtv)
|
|
}
|
|
|
|
default:
|
|
_, _ = key, value
|
|
|
|
}
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson11_deserializeOpDocumentPutRegistryPolicyOutput(v **PutRegistryPolicyOutput, value interface{}) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
if value == nil {
|
|
return nil
|
|
}
|
|
|
|
shape, ok := value.(map[string]interface{})
|
|
if !ok {
|
|
return fmt.Errorf("unexpected JSON type %v", value)
|
|
}
|
|
|
|
var sv *PutRegistryPolicyOutput
|
|
if *v == nil {
|
|
sv = &PutRegistryPolicyOutput{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for key, value := range shape {
|
|
switch key {
|
|
case "policyText":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected RegistryPolicyText to be of type string, got %T instead", value)
|
|
}
|
|
sv.PolicyText = ptr.String(jtv)
|
|
}
|
|
|
|
case "registryId":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected RegistryId to be of type string, got %T instead", value)
|
|
}
|
|
sv.RegistryId = ptr.String(jtv)
|
|
}
|
|
|
|
default:
|
|
_, _ = key, value
|
|
|
|
}
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson11_deserializeOpDocumentPutRegistryScanningConfigurationOutput(v **PutRegistryScanningConfigurationOutput, value interface{}) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
if value == nil {
|
|
return nil
|
|
}
|
|
|
|
shape, ok := value.(map[string]interface{})
|
|
if !ok {
|
|
return fmt.Errorf("unexpected JSON type %v", value)
|
|
}
|
|
|
|
var sv *PutRegistryScanningConfigurationOutput
|
|
if *v == nil {
|
|
sv = &PutRegistryScanningConfigurationOutput{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for key, value := range shape {
|
|
switch key {
|
|
case "registryScanningConfiguration":
|
|
if err := awsAwsjson11_deserializeDocumentRegistryScanningConfiguration(&sv.RegistryScanningConfiguration, value); err != nil {
|
|
return err
|
|
}
|
|
|
|
default:
|
|
_, _ = key, value
|
|
|
|
}
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson11_deserializeOpDocumentPutReplicationConfigurationOutput(v **PutReplicationConfigurationOutput, value interface{}) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
if value == nil {
|
|
return nil
|
|
}
|
|
|
|
shape, ok := value.(map[string]interface{})
|
|
if !ok {
|
|
return fmt.Errorf("unexpected JSON type %v", value)
|
|
}
|
|
|
|
var sv *PutReplicationConfigurationOutput
|
|
if *v == nil {
|
|
sv = &PutReplicationConfigurationOutput{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for key, value := range shape {
|
|
switch key {
|
|
case "replicationConfiguration":
|
|
if err := awsAwsjson11_deserializeDocumentReplicationConfiguration(&sv.ReplicationConfiguration, value); err != nil {
|
|
return err
|
|
}
|
|
|
|
default:
|
|
_, _ = key, value
|
|
|
|
}
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson11_deserializeOpDocumentSetRepositoryPolicyOutput(v **SetRepositoryPolicyOutput, value interface{}) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
if value == nil {
|
|
return nil
|
|
}
|
|
|
|
shape, ok := value.(map[string]interface{})
|
|
if !ok {
|
|
return fmt.Errorf("unexpected JSON type %v", value)
|
|
}
|
|
|
|
var sv *SetRepositoryPolicyOutput
|
|
if *v == nil {
|
|
sv = &SetRepositoryPolicyOutput{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for key, value := range shape {
|
|
switch key {
|
|
case "policyText":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected RepositoryPolicyText to be of type string, got %T instead", value)
|
|
}
|
|
sv.PolicyText = ptr.String(jtv)
|
|
}
|
|
|
|
case "registryId":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected RegistryId to be of type string, got %T instead", value)
|
|
}
|
|
sv.RegistryId = ptr.String(jtv)
|
|
}
|
|
|
|
case "repositoryName":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected RepositoryName to be of type string, got %T instead", value)
|
|
}
|
|
sv.RepositoryName = ptr.String(jtv)
|
|
}
|
|
|
|
default:
|
|
_, _ = key, value
|
|
|
|
}
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson11_deserializeOpDocumentStartImageScanOutput(v **StartImageScanOutput, value interface{}) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
if value == nil {
|
|
return nil
|
|
}
|
|
|
|
shape, ok := value.(map[string]interface{})
|
|
if !ok {
|
|
return fmt.Errorf("unexpected JSON type %v", value)
|
|
}
|
|
|
|
var sv *StartImageScanOutput
|
|
if *v == nil {
|
|
sv = &StartImageScanOutput{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for key, value := range shape {
|
|
switch key {
|
|
case "imageId":
|
|
if err := awsAwsjson11_deserializeDocumentImageIdentifier(&sv.ImageId, value); err != nil {
|
|
return err
|
|
}
|
|
|
|
case "imageScanStatus":
|
|
if err := awsAwsjson11_deserializeDocumentImageScanStatus(&sv.ImageScanStatus, value); err != nil {
|
|
return err
|
|
}
|
|
|
|
case "registryId":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected RegistryId to be of type string, got %T instead", value)
|
|
}
|
|
sv.RegistryId = ptr.String(jtv)
|
|
}
|
|
|
|
case "repositoryName":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected RepositoryName to be of type string, got %T instead", value)
|
|
}
|
|
sv.RepositoryName = ptr.String(jtv)
|
|
}
|
|
|
|
default:
|
|
_, _ = key, value
|
|
|
|
}
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson11_deserializeOpDocumentStartLifecyclePolicyPreviewOutput(v **StartLifecyclePolicyPreviewOutput, value interface{}) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
if value == nil {
|
|
return nil
|
|
}
|
|
|
|
shape, ok := value.(map[string]interface{})
|
|
if !ok {
|
|
return fmt.Errorf("unexpected JSON type %v", value)
|
|
}
|
|
|
|
var sv *StartLifecyclePolicyPreviewOutput
|
|
if *v == nil {
|
|
sv = &StartLifecyclePolicyPreviewOutput{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for key, value := range shape {
|
|
switch key {
|
|
case "lifecyclePolicyText":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected LifecyclePolicyText to be of type string, got %T instead", value)
|
|
}
|
|
sv.LifecyclePolicyText = ptr.String(jtv)
|
|
}
|
|
|
|
case "registryId":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected RegistryId to be of type string, got %T instead", value)
|
|
}
|
|
sv.RegistryId = ptr.String(jtv)
|
|
}
|
|
|
|
case "repositoryName":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected RepositoryName to be of type string, got %T instead", value)
|
|
}
|
|
sv.RepositoryName = ptr.String(jtv)
|
|
}
|
|
|
|
case "status":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected LifecyclePolicyPreviewStatus to be of type string, got %T instead", value)
|
|
}
|
|
sv.Status = types.LifecyclePolicyPreviewStatus(jtv)
|
|
}
|
|
|
|
default:
|
|
_, _ = key, value
|
|
|
|
}
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson11_deserializeOpDocumentTagResourceOutput(v **TagResourceOutput, value interface{}) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
if value == nil {
|
|
return nil
|
|
}
|
|
|
|
shape, ok := value.(map[string]interface{})
|
|
if !ok {
|
|
return fmt.Errorf("unexpected JSON type %v", value)
|
|
}
|
|
|
|
var sv *TagResourceOutput
|
|
if *v == nil {
|
|
sv = &TagResourceOutput{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for key, value := range shape {
|
|
switch key {
|
|
default:
|
|
_, _ = key, value
|
|
|
|
}
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson11_deserializeOpDocumentUntagResourceOutput(v **UntagResourceOutput, value interface{}) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
if value == nil {
|
|
return nil
|
|
}
|
|
|
|
shape, ok := value.(map[string]interface{})
|
|
if !ok {
|
|
return fmt.Errorf("unexpected JSON type %v", value)
|
|
}
|
|
|
|
var sv *UntagResourceOutput
|
|
if *v == nil {
|
|
sv = &UntagResourceOutput{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for key, value := range shape {
|
|
switch key {
|
|
default:
|
|
_, _ = key, value
|
|
|
|
}
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson11_deserializeOpDocumentUpdatePullThroughCacheRuleOutput(v **UpdatePullThroughCacheRuleOutput, value interface{}) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
if value == nil {
|
|
return nil
|
|
}
|
|
|
|
shape, ok := value.(map[string]interface{})
|
|
if !ok {
|
|
return fmt.Errorf("unexpected JSON type %v", value)
|
|
}
|
|
|
|
var sv *UpdatePullThroughCacheRuleOutput
|
|
if *v == nil {
|
|
sv = &UpdatePullThroughCacheRuleOutput{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for key, value := range shape {
|
|
switch key {
|
|
case "credentialArn":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected CredentialArn to be of type string, got %T instead", value)
|
|
}
|
|
sv.CredentialArn = ptr.String(jtv)
|
|
}
|
|
|
|
case "ecrRepositoryPrefix":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected PullThroughCacheRuleRepositoryPrefix to be of type string, got %T instead", value)
|
|
}
|
|
sv.EcrRepositoryPrefix = ptr.String(jtv)
|
|
}
|
|
|
|
case "registryId":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected RegistryId to be of type string, got %T instead", value)
|
|
}
|
|
sv.RegistryId = ptr.String(jtv)
|
|
}
|
|
|
|
case "updatedAt":
|
|
if value != nil {
|
|
switch jtv := value.(type) {
|
|
case json.Number:
|
|
f64, err := jtv.Float64()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
sv.UpdatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64))
|
|
|
|
default:
|
|
return fmt.Errorf("expected UpdatedTimestamp to be a JSON Number, got %T instead", value)
|
|
|
|
}
|
|
}
|
|
|
|
default:
|
|
_, _ = key, value
|
|
|
|
}
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson11_deserializeOpDocumentUploadLayerPartOutput(v **UploadLayerPartOutput, value interface{}) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
if value == nil {
|
|
return nil
|
|
}
|
|
|
|
shape, ok := value.(map[string]interface{})
|
|
if !ok {
|
|
return fmt.Errorf("unexpected JSON type %v", value)
|
|
}
|
|
|
|
var sv *UploadLayerPartOutput
|
|
if *v == nil {
|
|
sv = &UploadLayerPartOutput{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for key, value := range shape {
|
|
switch key {
|
|
case "lastByteReceived":
|
|
if value != nil {
|
|
jtv, ok := value.(json.Number)
|
|
if !ok {
|
|
return fmt.Errorf("expected PartSize to be json.Number, got %T instead", value)
|
|
}
|
|
i64, err := jtv.Int64()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
sv.LastByteReceived = ptr.Int64(i64)
|
|
}
|
|
|
|
case "registryId":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected RegistryId to be of type string, got %T instead", value)
|
|
}
|
|
sv.RegistryId = ptr.String(jtv)
|
|
}
|
|
|
|
case "repositoryName":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected RepositoryName to be of type string, got %T instead", value)
|
|
}
|
|
sv.RepositoryName = ptr.String(jtv)
|
|
}
|
|
|
|
case "uploadId":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected UploadId to be of type string, got %T instead", value)
|
|
}
|
|
sv.UploadId = ptr.String(jtv)
|
|
}
|
|
|
|
default:
|
|
_, _ = key, value
|
|
|
|
}
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsAwsjson11_deserializeOpDocumentValidatePullThroughCacheRuleOutput(v **ValidatePullThroughCacheRuleOutput, value interface{}) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
if value == nil {
|
|
return nil
|
|
}
|
|
|
|
shape, ok := value.(map[string]interface{})
|
|
if !ok {
|
|
return fmt.Errorf("unexpected JSON type %v", value)
|
|
}
|
|
|
|
var sv *ValidatePullThroughCacheRuleOutput
|
|
if *v == nil {
|
|
sv = &ValidatePullThroughCacheRuleOutput{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for key, value := range shape {
|
|
switch key {
|
|
case "credentialArn":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected CredentialArn to be of type string, got %T instead", value)
|
|
}
|
|
sv.CredentialArn = ptr.String(jtv)
|
|
}
|
|
|
|
case "ecrRepositoryPrefix":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected PullThroughCacheRuleRepositoryPrefix to be of type string, got %T instead", value)
|
|
}
|
|
sv.EcrRepositoryPrefix = ptr.String(jtv)
|
|
}
|
|
|
|
case "failure":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected PTCValidateFailure to be of type string, got %T instead", value)
|
|
}
|
|
sv.Failure = ptr.String(jtv)
|
|
}
|
|
|
|
case "isValid":
|
|
if value != nil {
|
|
jtv, ok := value.(bool)
|
|
if !ok {
|
|
return fmt.Errorf("expected IsPTCRuleValid to be of type *bool, got %T instead", value)
|
|
}
|
|
sv.IsValid = jtv
|
|
}
|
|
|
|
case "registryId":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected RegistryId to be of type string, got %T instead", value)
|
|
}
|
|
sv.RegistryId = ptr.String(jtv)
|
|
}
|
|
|
|
case "upstreamRegistryUrl":
|
|
if value != nil {
|
|
jtv, ok := value.(string)
|
|
if !ok {
|
|
return fmt.Errorf("expected Url to be of type string, got %T instead", value)
|
|
}
|
|
sv.UpstreamRegistryUrl = ptr.String(jtv)
|
|
}
|
|
|
|
default:
|
|
_, _ = key, value
|
|
|
|
}
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
type protocolErrorInfo struct {
|
|
Type string `json:"__type"`
|
|
Message string
|
|
Code any // nonstandard for awsjson but some services do present the type here
|
|
}
|
|
|
|
func getProtocolErrorInfo(decoder *json.Decoder) (protocolErrorInfo, error) {
|
|
var errInfo protocolErrorInfo
|
|
if err := decoder.Decode(&errInfo); err != nil {
|
|
if err == io.EOF {
|
|
return errInfo, nil
|
|
}
|
|
return errInfo, err
|
|
}
|
|
|
|
return errInfo, nil
|
|
}
|
|
|
|
func resolveProtocolErrorType(headerType string, bodyInfo protocolErrorInfo) (string, bool) {
|
|
if len(headerType) != 0 {
|
|
return headerType, true
|
|
} else if len(bodyInfo.Type) != 0 {
|
|
return bodyInfo.Type, true
|
|
} else if code, ok := bodyInfo.Code.(string); ok && len(code) != 0 {
|
|
return code, true
|
|
}
|
|
return "", false
|
|
}
|